Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2020-04-11 12:28:09 +0000
committerStephan Herrmann2020-04-11 12:28:09 +0000
commitc4606e8c36137ec06dbe7f751e5a1b6fe3148e55 (patch)
treec4e3c0787b3b203dc4cd5446a35f0229a343bb5a
parentbcd16035e3129a4b2ef22ffacae59d6a5ab65085 (diff)
downloadorg.eclipse.objectteams-c4606e8c36137ec06dbe7f751e5a1b6fe3148e55.tar.gz
org.eclipse.objectteams-c4606e8c36137ec06dbe7f751e5a1b6fe3148e55.tar.xz
org.eclipse.objectteams-c4606e8c36137ec06dbe7f751e5a1b6fe3148e55.zip
Remove trailing whitespace on all lines
- manually replays JDT's 560451
-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
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/Activator.java6
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunAllJava13Tests.java4
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunAllJava14Tests.java8
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunAllJava8Tests.java4
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunFormatterTests.java2
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnly335CompilerTests.java6
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnlyAssistModelTests18.java4
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnlyJava12Tests.java4
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnlyJava13Tests.java4
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnlyJava14Tests.java6
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnlyJava8Tests.java4
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/APIDocumentationTests.java6
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter10Test.java40
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter11Test.java8
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter13Test.java352
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter14Test.java398
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15JLS4Test.java346
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15JLS8Test.java348
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java398
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter17Test.java292
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java446
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter9Test.java106
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST3Test.java6
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST4Test.java4
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST8Test.java6
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterBindingsTest.java2
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterBugsTest.java314
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java40
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterRecoveryTest.java104
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTest.java6
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java6
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java262
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST4_2.java296
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST8_2.java322
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTMatcherTest.java46
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTModelBridgeTests.java136
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTNodeFinderTest.java110
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTStructuralPropertyTest.java30
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTTest.java38
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTVisitorTest.java14
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/AbstractASTTests.java10
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/BatchASTCreationTests.java14
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/CompatibilityRulesTests.java2
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ConverterTestSetup.java2
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ProfilingASTConvertionTest.java2
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/TypeAnnotationsConverterTest.java194
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/TypeBindingTests308.java418
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/extensions/TestExternalLibContainerInitializer.java12
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugs18Tests.java2
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java16618
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java8312
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsTests.java152
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterJSR308Tests.java12
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterJSR335Tests.java10
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterMassiveRegressionTests.java2
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java2908
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/RunFormatterMassiveTests.java4
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java60
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaSearchTests.java120
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AccessRestrictionsTests.java382
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AllJavaModelTests.java6
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AttachSourceTests.java118
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AttachedJavadocTests.java176
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/BindingKeyTests.java18
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/Bug376673Test.java4
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClassFileTests.java62
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClassNameTests.java30
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathInitializerTests.java26
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathTests.java706
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompilationUnitTests.java98
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionContextTests_1_5.java4
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests.java606
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests10.java12
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests11.java6
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests14.java30
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests18.java754
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests2.java890
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests3.java130
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests9.java118
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java24
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java154
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CopyMoveResourcesTests.java20
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/EncodingTests.java90
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ExternalAnnotations17Test.java362
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ExternalAnnotations18Test.java1178
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ExternalAnnotations9Test.java38
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/FreezeMonitor.java2
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/HierarchyOnWorkingCopiesTests.java114
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/IgnoreOptionalProblemsFromSourceFoldersTests.java10
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/Java9ElementTests.java84
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaCoreOptionsTests.java8
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaElement8Tests.java100
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaElementDeltaTests.java18
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaIndexTests.java218
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaProjectTests.java162
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs10Tests.java2
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs13Tests.java4
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs14SwitchExpressionTests.java2
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs14Tests.java30
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs8Tests.java952
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs9Tests.java486
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java1128
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests2.java326
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchFineGrainTests.java4
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchMultipleProjectsTests.java28
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchScopeTests.java6
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchTests.java64
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavadocBugsCompletionModelTest.java2
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavadocPackageCompletionModelTest.java6
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/MatchingRegionsTest.java4
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/MementoTests.java18
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleBuilderTests.java1832
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleOptionsTests.java40
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/NamingConventionTests.java64
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/NullAnnotationModelTests.java194
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/NullAnnotationModelTests9.java28
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/OptionTests.java32
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java554
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests9.java310
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/RenameTests.java10
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests.java4
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests10.java44
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests12.java152
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests18.java208
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests2.java194
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests9.java58
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests_1_5.java42
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/RunCompletionModelTests.java2
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SearchParticipantTests.java16
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SearchTests.java28
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SelectionJavadocModelTests.java12
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SignatureTests.java30
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SubstringCompletionTests.java2
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SubwordCompletionTests.java2
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SuiteOfTestCases.java2
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TestCompilationParticipant.java2
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeHierarchyNotificationTests.java46
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java554
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeResolveTests.java90
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/WorkingCopyOwnerTests.java16
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/WorkingCopySearchTests.java64
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/BTreeExpensiveTests.java10
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/DatabaseTestUtil.java6
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/InheritenceTests.java2
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/LargeBlockTest.java2
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/Package.java6
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/SearchKeyTests.java6
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/util/BaseTestCase.java4
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/util/Package.java6
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritePropertyTest.java2
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingExpressionsTest.java68
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingInstanceOfPatternExpressionTest.java6
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingLambdaExpressionTest.java28
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingMethodDeclTest.java130
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingModuleDeclarationTest.java4
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingReferenceExpressionTest.java48
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingStatementsTest.java486
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingSwitchExpressionsTest.java24
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingTest.java22
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingTrackingTest.java4
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingTypeAnnotationsTest.java34
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingTypeDeclTest.java34
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingWithStatementsRecoveryTest.java4
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ImportRewrite18Test.java18
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ImportRewriteTest.java1366
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/modifying/ASTRewritingModifyingCopyTest.java46
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/modifying/ASTRewritingModifyingRemoveTest.java28
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/modifying/ASTRewritingModifyingReplaceTest.java12
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/modifying/ASTRewritingModifyingTest.java4
-rw-r--r--org.eclipse.jdt.core/antadapter/org/eclipse/jdt/core/CheckDebugAttributes.java12
-rw-r--r--org.eclipse.jdt.core/antadapter/org/eclipse/jdt/internal/antadapter/AntAdapterMessages.java2
-rw-r--r--org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/BasicModule.java2
-rw-r--r--org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.java18
-rw-r--r--org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJar.java8
-rw-r--r--org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJep247Jdk12.java4
-rw-r--r--org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJmod.java8
-rw-r--r--org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJrt.java16
-rw-r--r--org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathLocation.java24
-rw-r--r--org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathMultiReleaseJar.java6
-rw-r--r--org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathSourceJar.java6
-rw-r--r--org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/CompilationUnit.java4
-rw-r--r--org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/FileFinder.java4
-rw-r--r--org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/FileSystem.java12
-rw-r--r--org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java58
-rw-r--r--org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ModuleFinder.java8
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java766
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/ISearchRequestor.java2
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionContext.java38
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java16
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalExtendedCompletionContext.java24
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/RelevanceConstants.java4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java100
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/ThrownExceptionFinder.java12
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionNodeDetector.java2
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnExportReference.java4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocTag.java2
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeywordModuleDeclaration.java4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeywordModuleInfo.java2
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSendName.java2
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnModuleDeclaration.java4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnModuleReference.java4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesImplementationsQualifiedTypeReference.java4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesImplementationsSingleTypeReference.java4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesInterfacesQualifiedTypeReference.java4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesInterfacesSingleTypeReference.java4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedTypeReference.java4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnReferenceExpressionName.java6
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnUsesQualifiedTypeReference.java4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnUsesSingleTypeReference.java4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java116
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java2
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java70
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/Engine.java14
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionJavadocParser.java2
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnArgumentName.java2
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnLambdaExpression.java2
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnLocalName.java2
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnModuleDeclaration.java4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnModuleReference.java4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpression.java6
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpressionName.java4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java16
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/objectteams/otdt/internal/codeassist/SelectionOnCallinMapping.java4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/objectteams/otdt/internal/codeassist/select/SelectionOnBaseAllocationExpression.java12
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/CategorizedProblem.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/CharOperation.java16
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java84
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ASTVisitor.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/AbstractAnnotationProcessorManager.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java174
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/CompilationResult.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/Compiler.java20
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java72
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java14
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java30
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java98
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AnnotationMethodDeclaration.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java12
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AssertStatement.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java14
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CharLiteral.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompactConstructorDeclaration.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompoundAssignment.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java70
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java14
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ContainerAnnotation.java20
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/DoStatement.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/DoubleLiteral.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/EqualExpression.java12
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java12
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExportsStatement.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java16
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExpressionContext.java28
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FakedTrackingVariable.java78
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FalseLiteral.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java30
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FloatLiteral.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ForStatement.java8
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ForeachStatement.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FunctionalExpression.java50
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IPolyExpression.java20
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Initializer.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IntersectionCastTypeReference.java8
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Invocation.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LabeledStatement.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java186
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java32
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MemberValuePair.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java78
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java14
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ModuleDeclaration.java10
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ModuleReference.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ModuleStatement.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/NameReference.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/NullAnnotationMatching.java34
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/PackageVisibilityStatement.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java20
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ProvidesStatement.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java20
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java38
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedSuperReference.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedThisReference.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Receiver.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/RecordDeclaration.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Reference.java24
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java208
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/RequiresStatement.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.java12
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleMemberAnnotation.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java18
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java8
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java40
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SuperReference.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchExpression.java44
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java52
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SynchronizedStatement.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ThisReference.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TrueLiteral.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TryStatement.java24
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java22
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeParameter.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java28
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/UnionTypeReference.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/UnlikelyArgumentCheck.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/WhileStatement.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Wildcard.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/YieldStatement.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ComponentInfo.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationDecorator.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider.java34
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/FieldInfo.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/MethodInfo.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ModuleInfo.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/NonNullDefaultAwareTypeAnnotationWalker.java20
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/TypeAnnotationInfo.java36
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/TypeAnnotationWalker.java32
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/AttributeNamesConstants.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java96
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java22
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/MultiCatchExceptionLabel.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/Opcodes.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/TypeAnnotationCodeStream.java22
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/VerificationTypeInfo.java18
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/AutomaticModuleNaming.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IBinaryType.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IBinaryTypeAnnotation.java14
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/ICompilationUnit.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IModule.java14
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IModuleAwareNameEnvironment.java10
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IModulePathEntry.java14
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IMultiModuleEntry.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/INameEnvironmentExtension.java8
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/ITypeAnnotationWalker.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IUpdatableModule.java16
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/ModuleReferenceImpl.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/NameEnvironmentAnswer.java10
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/ConditionalFlowInfo.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/ExceptionHandlingFlowContext.java10
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/FinallyFlowContext.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/FlowContext.java26
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/FlowInfo.java14
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/InitializationFlowContext.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/LoopingFlowContext.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/TryFlowContext.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.java28
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java106
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/Constant.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/ReferenceContext.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/AnnotatableTypeSystem.java106
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/AnnotationBinding.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.java40
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BaseTypeBinding.java28
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryModuleBinding.java14
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java140
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Binding.java12
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java54
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BoundSet.java112
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding.java22
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding18.java14
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CatchParameterBinding.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java52
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java26
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintExceptionFormula.java14
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula.java30
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintFormula.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintTypeFormula.java42
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ElementValuePair.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ExternalAnnotationSuperimposer.java14
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ExtraCompilerModifiers.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/FieldBinding.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ImplicitNullAnnotationVerifier.java58
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java142
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceFailureException.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceSubstitution.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceVariable.java14
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/IntersectionTypeBinding18.java46
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InvocationSite.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalTypeBinding.java18
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java8
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java70
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MemberTypeBinding.java10
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java24
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java16
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java12
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java56
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ModuleBinding.java36
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/NestedTypeBinding.java26
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/NullTypeBinding.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java22
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding.java50
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding.java8
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java84
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/PolyParameterizedGenericMethodBinding.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/PolyTypeBinding.java12
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/PolymorphicMethodBinding.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/RawTypeBinding.java16
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReductionResult.java8
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java92
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java212
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceModuleBinding.java10
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java204
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SplitPackageBinding.java8
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticFactoryMethodBinding.java10
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.java20
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java16
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java48
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBindingVisitor.java34
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBound.java14
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java16
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeIds.java22
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeSystem.java154
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java38
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/VariableBinding.java10
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/VoidTypeBinding.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java24
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java8
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ConflictedParser.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java12
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java3122
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredBlock.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredElement.java8
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredExport.java8
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredField.java8
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredInitializer.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredMethodMapping.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredModule.java12
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredModuleReference.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredStatement.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredType.java14
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredTypeReference.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredUnit.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveryScanner.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java122
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/IProblemRechecker.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemHandler.java8
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java336
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfInteger.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfModule.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfObject.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/JRTUtil.java28
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/ManifestAnalyzer.java12
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/Sorting.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/Util.java12
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/ConfigHelper.java8
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/IOTConstants.java14
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/InferenceKind.java12
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/OTNameUtils.java22
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/Pair.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/exceptions/InternalCompilerError.java20
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/AbstractMethodMappingDeclaration.java8
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/BaseAllocationExpression.java14
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/BaseCallMessageSend.java32
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/CallinMappingDeclaration.java20
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/FieldAccessSpec.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/LiftingTypeReference.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/MethodSpec.java40
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/PotentialLiftExpression.java8
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/PotentialLowerExpression.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/PotentialRoleReceiverExpression.java18
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/PrecedenceDeclaration.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/PrivateRoleMethodCall.java22
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/QualifiedBaseReference.java12
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/RoleClassLiteralAccess.java10
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/TSuperMessageSend.java32
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/TypeAnchorReference.java30
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/WithinStatement.java10
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/AnchorUsageRanksAttribute.java14
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/BytecodeTransformer.java22
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/CallinMethodMappingsAttribute.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/CalloutMappingsAttribute.java12
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/ConstantPoolObjectReader.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/ConstantPoolSimpleConverter.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/ListValueAttribute.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/OTByteCodes.java10
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/OTDynCallinBindingsAttribute.java62
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/OTSpecialAccessAttribute.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/StaticReplaceBindingsAttribute.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/WordValueAttribute.java8
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/Config.java16
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/Dependencies.java36
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/ITranslationStates.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/StateHelper.java14
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lifting/ArrayLifting.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lifting/ArrayLowering.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lifting/DeclaredLifting.java38
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lifting/Lifting.java20
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lifting/LiftingEnvironment.java16
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lifting/Lowering.java8
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/AbstractOTReferenceBinding.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/AnchorMapping.java32
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/CallinCalloutBinding.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/CallinCalloutScope.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/DependentTypeBinding.java28
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/PrecedenceBinding.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/ProblemAnchorBinding.java12
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/RoleTypeBinding.java24
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/SyntheticBaseCallSurrogate.java26
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/SyntheticOTMethodBinding.java10
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/SyntheticOTTargetMethod.java24
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/SyntheticRoleBridgeMethodBinding.java8
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/SyntheticRoleFieldAccess.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/TeamAnchor.java12
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/WeakenedTypeBinding.java8
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CallinImplementor.java30
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CallinImplementorDyn.java170
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CalloutImplementor.java16
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CalloutImplementorDyn.java16
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/MethodMappingImplementor.java10
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/MethodMappingResolver.java12
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/FieldModel.java10
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/MethodModel.java26
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/RoleModel.java14
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/TeamModel.java12
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/TypeModel.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/smap/AbstractSmapGenerator.java8
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/smap/LineNumberProvider.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/smap/RoleSmapGenerator.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/copyinheritance/CopyInheritance.java24
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/copyinheritance/TypeLevel.java14
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/InsertTypeAdjustmentsVisitor.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/MethodSignatureEnhancer.java28
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/PredicateGenerator.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/ReflectionGenerator.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/ReplaceResultReferenceVisitor.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/RoleMigrationImplementor.java16
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/RoleSplitter.java10
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/SerializationGenerator.java44
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/StandardElementGenerator.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/SwitchOnBaseTypeGenerator.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/TeamMethodGenerator.java102
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/TransformStatementsVisitor.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstConverter.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstEdit.java10
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstFactory.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstGenerator.java64
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/IAlienScopeTypeReference.java8
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/IDependentTypeSubstitution.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/Protections.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/RoleTypeCreator.java40
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/Sorting.java18
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/TypeAnalyzer.java14
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java62
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java124
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTMatcher.java18
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java82
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTParser.java8
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTVisitor.java24
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AnnotatableType.java6
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ArrayType.java22
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BaseCallMessageSend.java2
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BindingComparator.java2
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BindingResolver.java6
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BreakStatement.java16
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CompilationUnit.java6
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java10
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CreationReference.java4
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultASTVisitor.java8
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultBindingResolver.java22
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Dimension.java2
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DoStatement.java4
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DocCommentParser.java2
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ExportsDirective.java2
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ExpressionMethodReference.java4
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IBinding.java4
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IDocElement.java4
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IMethodBinding.java26
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IMethodNode.java8
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IModuleBinding.java8
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IPackageBinding.java2
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ITypeBinding.java50
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/InstanceofExpression.java6
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/InternalASTRewrite.java8
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IntersectionType.java2
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/LambdaExpression.java18
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MemberValuePairBinding.java2
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodBinding.java4
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodDeclaration.java62
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodMappingBinding.java2
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodReference.java8
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ModuleBinding.java4
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NameEnvironmentWithProgress.java4
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NameQualifiedType.java12
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NodeFinder.java2
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/OpensDirective.java2
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/PackageDeclaration.java2
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/PrimitiveType.java4
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ProvidesDirective.java2
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/QualifiedType.java12
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecordDeclaration.java14
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecoveredPackageBinding.java2
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecoveredTypeBinding.java6
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SimpleType.java8
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SingleVariableDeclaration.java8
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SuperMethodReference.java4
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SwitchCase.java26
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SwitchExpression.java4
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TSuperConstructorInvocation.java2
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TagElement.java6
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TextBlock.java6
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TryStatement.java10
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Type.java8
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeBinding.java16
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeDeclaration.java2
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeMethodReference.java4
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeParameter.java10
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/UnionType.java2
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableBinding.java2
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableDeclaration.java14
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableDeclarationFragment.java2
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/WildcardType.java4
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/YieldStatement.java10
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ASTRewrite.java10
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ImportRewrite.java72
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/NaiveASTFlattener.java36
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/SourceRangeVerifier.java22
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java236
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFlattener.java30
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter.java10
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore.java4
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportGroupComparator.java4
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/util/DOMASTUtil.java10
-rw-r--r--org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetAllocationExpression.java22
-rw-r--r--org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetClassFile.java4
-rw-r--r--org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetCompiler.java8
-rw-r--r--org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetEvaluator.java38
-rw-r--r--org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetFieldReference.java16
-rw-r--r--org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetMessageSend.java16
-rw-r--r--org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetParser.java14
-rw-r--r--org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetQualifiedNameReference.java18
-rw-r--r--org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetReturnStatement.java6
-rw-r--r--org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetScope.java26
-rw-r--r--org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetSingleNameReference.java4
-rw-r--r--org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton.java8
-rw-r--r--org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetSuperReference.java6
-rw-r--r--org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetThisReference.java36
-rw-r--r--org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetToCuMapper.java46
-rw-r--r--org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetTypeDeclaration.java4
-rw-r--r--org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/EvaluationConstants.java2
-rw-r--r--org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/EvaluationContext.java78
-rw-r--r--org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/EvaluationResult.java6
-rw-r--r--org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/Evaluator.java18
-rw-r--r--org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/InstallException.java6
-rw-r--r--org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/VariablesEvaluator.java14
-rw-r--r--org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/CodeFormatter.java34
-rw-r--r--org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/CodeFormatterApplication.java30
-rw-r--r--org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.java46
-rw-r--r--org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/CommentsPreparator.java8
-rw-r--r--org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatter.java2
-rw-r--r--org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatterOptions.java20
-rw-r--r--org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/LineBreaksPreparator.java4
-rw-r--r--org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/OneLineEnforcer.java2
-rw-r--r--org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/SpacePreparator.java8
-rw-r--r--org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/TokenManager.java2
-rw-r--r--org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/linewrap/WrapExecutor.java8
-rw-r--r--org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/linewrap/WrapPreparator.java2
-rw-r--r--org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/old/CodeFormatter.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/BindingKey.java8
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/CompletionContext.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/CompletionProposal.java26
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/CompletionRequestor.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/CorrectionEngine.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/Flags.java10
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IAccessRule.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IClasspathAttribute.java46
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IClasspathContainer.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IClasspathEntry.java28
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/ICodeAssist.java8
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/ICompilationUnit.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IElementChangedListener.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaModelMarker.java10
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaModelStatusConstants.java20
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaProject.java62
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/ILocalVariable.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IMethod.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IModularClassFile.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IModuleDescription.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IOpenable.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IOrdinaryClassFile.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IPackageFragment.java12
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IPackageFragmentRoot.java8
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/ISourceRange.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/ISourceReference.java12
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IType.java36
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/ITypeParameter.java12
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/ITypeRoot.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaConventions.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java138
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/NamingConventions.java96
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/Signature.java12
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/SourceRange.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/WorkingCopyOwner.java24
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/compiler/CompilationParticipant.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/compiler/ITerminalSymbols.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/eval/IEvaluationContext.java12
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/provisional/JavaModelAccess.java10
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/ExternalAnnotationUtil.java44
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IAttributeNamesConstants.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IComponentInfo.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IConstantPoolConstant.java8
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IConstantPoolEntry.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IConstantPoolEntry2.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IExtendedAnnotation.java48
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IExtendedAnnotationConstants.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IMethodParametersAttribute.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/INestHostAttribute.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/INestMemberAttributeEntry.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/INestMembersAttribute.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/DocumentElementParser.java14
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/ExtraFlags.java30
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/ISourceElementRequestor.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementNotifier.java8
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementParser.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/parser/TypeConverter.java12
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/AbstractClassFile.java32
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/AbstractModule.java14
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMember.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMethod.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryModule.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryType.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CancelableNameEnvironment.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFile.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFileInfo.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java114
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathValidation.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnit.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitElementInfo.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitProblemFinder.java16
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor.java34
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CopyResourceElementsOperation.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ExternalAnnotationTracker.java14
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/INameEnvironmentWithProgress.java8
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ImportContainerInfo.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/InitializerWithChildrenInfo.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/InternalNamingConventions.java114
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JModPackageFragmentRoot.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JarPackageFragmentRoot.java12
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JarPackageFragmentRootInfo.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaCorePreferenceInitializer.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElement.java32
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElementDelta.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElementDeltaBuilder.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElementRequestor.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelCache.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelStatus.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java100
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavadocContents.java140
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JrtPackageFragmentRoot.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/LambdaExpression.java50
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/LambdaFactory.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/LambdaMethod.java20
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/LocalVariable.java12
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Member.java10
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/MemberElementInfo.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModularClassFile.java16
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Module.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModuleDescriptionInfo.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModulePathContainer.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModuleSourcePathManager.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModuleUpdater.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/NameLookup.java12
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragment.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ProjectEntry.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedBinaryType.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SearchableEnvironment.java28
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SelectionRequestor.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SetClasspathOperation.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SingleTypeRequestor.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceConstructorWithChildrenInfo.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceFieldWithChildrenInfo.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMapper.java26
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMethodElementInfo.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMethodWithChildrenInfo.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceType.java16
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceTypeElementInfo.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/TypeParameter.java22
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/TypeParameterElementInfo.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/TypeVector.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/UserLibrary.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/UserLibraryManager.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/AbstractImageBuilder.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/BatchImageBuilder.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathDirectory.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJar.java8
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrt.java8
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrtWithReleaseOption.java12
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathLocation.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathMultiDirectory.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/JavaBuilder.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ModuleEntryProcessor.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ModuleInfoBuilder.java10
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/NameEnvironment.java12
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/State.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyBuilder.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyResolver.java22
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyType.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/BindingKeyParser.java22
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/BindingKeyResolver.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/BootstrapMethodsAttribute.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/CodeSnippetParsingUtil.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ConstantPoolEntry2.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/DOMFinder.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Disassembler.java50
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ExtendedAnnotation.java22
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/HandleFactory.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/HashtableOfArrayToObject.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/MementoTokenizer.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Messages.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/MethodParametersAttribute.java8
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ModuleUtil.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/NestMembersAttributeEntry.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/PublicScanner.java8
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Util.java18
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/ICallinMapping.java28
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/ICalloutMapping.java22
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/ICalloutToFieldMapping.java22
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IFieldAccessSpec.java10
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IMethodMapping.java36
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IMethodSpec.java10
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IOTJavaElement.java28
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IOTType.java38
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IOTTypeHierarchy.java30
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IPhantomType.java10
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IRoleFileType.java8
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IRoleType.java24
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/OTJavaElementDelta.java44
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/OTModelManager.java126
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/OTModelReconcileListener.java26
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/TypeHelper.java188
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/AbstractCalloutMapping.java64
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/BinaryRoleType.java18
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/CallinMapping.java82
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/CalloutMapping.java42
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/CalloutToFieldMapping.java74
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/CompilationUnitMapping.java38
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/MappingElementInfo.java52
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/MethodMapping.java152
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/OTJavaElement.java50
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/OTModel.java46
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/OTType.java90
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/OTTypeList.java22
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/OTTypeMapping.java58
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/PhantomType.java58
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/ResolvedCallinMapping.java22
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/ResolvedCalloutMapping.java14
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/ResolvedCalloutToFieldMapping.java16
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/RoleFileType.java14
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/RoleType.java78
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/SourceMethodMappingInfo.java34
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/TypeHierarchyConnector.java22
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/builder/OTJBuilder.java16
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/builder/OTJIncrementalImageBuilder.java16
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/util/FieldData.java20
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/util/MethodData.java48
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/index/JavaIndexer.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/index/JavaIndexerApplication.java8
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/FieldDeclarationMatch.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/FieldReferenceMatch.java8
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/IJavaSearchConstants.java102
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/IJavaSearchResultCollector.java14
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/IJavaSearchScope.java18
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/ITypeNameRequestor.java16
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/LocalVariableDeclarationMatch.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/LocalVariableReferenceMatch.java8
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/MethodDeclarationMatch.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/MethodNameRequestor.java16
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/MethodReferenceMatch.java12
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/ModuleReferenceMatch.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/PackageDeclarationMatch.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/PackageReferenceMatch.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/ReferenceMatch.java14
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchDocument.java50
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchEngine.java78
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchMatch.java82
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchParticipant.java40
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchPattern.java52
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchRequestor.java6
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeDeclarationMatch.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeNameMatch.java32
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeNameMatchRequestor.java12
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeNameRequestor.java6
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeParameterDeclarationMatch.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeParameterReferenceMatch.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeReferenceMatch.java14
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/DiskIndex.java28
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/FileIndexLocation.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/Index.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/IndexLocation.java16
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/IndexExceptionBuilder.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/Nd.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/RawGrowableArray.java24
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/Chunk.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/ChunkWriter.java12
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/Database.java56
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/IBTreeVisitor.java6
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/IString.java16
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/IndexException.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/MemoryStats.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/ModificationLog.java10
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/Field.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/FieldList.java32
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/FieldManyToOne.java14
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/FieldOneToMany.java12
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/FieldOneToOne.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/FieldSearchIndex.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/IRefCountedField.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/StructDef.java8
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/indexer/ClassFileToIndexConverter.java16
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/indexer/FileStateCache.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/indexer/Indexer.java14
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/indexer/WorkspaceSnapshot.java6
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/FileFingerprint.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/JavaIndex.java6
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/JavaNames.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/NdMethod.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/NdResourceFile.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/NdTypeInterface.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/model/BinaryModuleDescriptor.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/model/BinaryModuleFactory.java8
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/model/BinaryTypeDescriptor.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/model/BinaryTypeFactory.java6
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/model/IndexBinaryType.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/util/CharArrayUtils.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/util/PathMap.java10
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/AbstractJavaSearchScope.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/BasicSearchEngine.java254
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/HierarchyScope.java16
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/IRestrictedAccessTypeRequestor.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/IndexQueryRequestor.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/IndexSelector.java8
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/JavaSearchDocument.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/JavaSearchMethodNameMatch.java8
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/JavaSearchScope.java36
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/JavaSearchTypeNameMatch.java8
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/MethodNameMatchRequestorWrapper.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/MethodNameRequestorWrapper.java8
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/NameMatchRequestorWrapper.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/PathCollector.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/PatternSearchJob.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/SubTypeSearchJob.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/TypeNameRequestorWrapper.java20
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/UnindexedSearchScope.java10
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AbstractIndexer.java38
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AddJarFileToIndex.java6
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AddJrtToIndex.java28
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/BinaryContainer.java8
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/BinaryIndexer.java58
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/DefaultJavaIndexer.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IIndexConstants.java6
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexAllProject.java16
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexBinaryFolder.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexManager.java48
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexNamesRegistry.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexingParser.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/SourceIndexer.java14
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/SourceIndexerRequestor.java40
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ClassFileMatchLocator.java6
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ClasspathSourceDirectory.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ConstructorDeclarationPattern.java38
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ConstructorLocator.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ConstructorPattern.java84
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/FieldLocator.java14
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/FieldPattern.java12
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/IndexBasedJavaSearchEnvironment.java8
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/JavaSearchNameEnvironment.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/JavaSearchPattern.java22
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/LocalVariablePattern.java8
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java158
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser.java24
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchingNodeSet.java6
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MemberDeclarationVisitor.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodDeclarationPattern.java72
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java96
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodPattern.java66
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ModuleLocator.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MultiTypeDeclarationPattern.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/OrLocator.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/OrPattern.java6
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageDeclarationPattern.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.java16
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageReferencePattern.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PatternLocator.java52
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PossibleMatch.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/QualifiedTypeDeclarationPattern.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/SecondaryTypeDeclarationPattern.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/SuperTypeNamesCollector.java6
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferenceLocator.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferencePattern.java16
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationLocator.java10
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern.java8
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeParameterLocator.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeParameterPattern.java10
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java32
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeReferencePattern.java22
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/VariablePattern.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/processing/IJob.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/core/search/Messages.java14
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/core/search/OTSearchEngine.java26
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/core/search/OTSearchHelper.java28
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/core/search/OTSearchRequestor.java20
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/internal/core/search/matching/ReferenceToTeamLocator.java26
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/internal/core/search/matching/ReferenceToTeamPackagePattern.java44
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/internal/core/search/matching/RoleDeclarationLocator.java16
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/internal/core/search/matching/RoleTypePattern.java34
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/internal/core/search/matching/TeamDeclarationLocator.java16
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/internal/core/search/matching/TeamTypePattern.java30
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/AbstractOTDTDebugTest.java454
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/AllTests.java14
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/ClassAttributeReader.java32
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/DebugTestsPlugin.java16
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/ManualDebugTestSuite.java22
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/OTProjectCreationDecorator.java26
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/core/CopyInheritanceBreakpointTest.java56
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/core/RoFiBreakpointTests.java40
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/core/SourceDebugExtensionTest.java16
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/core/StratumTests.java38
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/AllTests.java8
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/BuilderTestPlugin.java10
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/CompilationOrderTests.java28
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/IncrementalTests.java220
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/MultipleCallinsWarningTest.java78
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/OTBuilderTests.java16
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/OTEquinoxBuilderTests.java154
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/OTLaunchEnvironment.java46
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/OTTestingEnvironment.java24
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/AttributesTest.java70
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/CustomizedCompiler.java16
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/ICallbackClient.java8
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/SourceElementRequestorTest.java52
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/TestBase.java220
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/ast/TypeDeclarationTest.java32
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/CallinBindingTest.java142
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/CalloutBindingTest.java716
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/CompilationUnitContainmentTest.java18
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/CopyInheritanceTest.java114
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/ExternalRoleTest.java56
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/LiftingTest.java32
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/LoweringTest.java130
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/ParameterMappingsTest.java60
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/ParserTest.java26
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/RoleBaseInheritanceTest.java126
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/RoleContainmentTest.java20
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/RoleInheritanceTest.java164
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/SourceSnippetRecoveryTest.java20
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/TeamActivationTest.java28
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/TeamContainmentTest.java118
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/TeamInheritanceTest.java78
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/TestAll.java14
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/AbstractSourceMapGeneratorTest.java108
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/AllTests.java8
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/BaseClassSmapGenerationMethodTest.java274
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumFlightbonusTest.java54
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest001.java36
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest002.java80
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest003.java96
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest004.java36
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest005.java68
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest006.java64
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest007.java34
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/Requestor.java14
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/formatter/org/eclipse/objectteams/otdt/core/tests/formatter/FormatterTests.java36
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/AllTests.java8
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/CompleteRoleHierarchyWithClasses.java276
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/FileBasedHierarchyTest.java10
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/ITypeIOTTypeTest.java112
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/OTTypeHierarchyTests.java12
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/AllTests.java8
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest001.java182
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest002.java54
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest004.java72
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest006.java120
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest010.java206
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest011.java84
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest016.java160
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest017.java98
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest018.java56
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest019.java36
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTTypeHierarchyBuilderTest.java66
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/AllTests.java8
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/HierarchyResolverTestWithSrc003.java88
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest001.java346
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest002.java70
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest003.java186
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest004.java54
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest006.java96
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest007.java140
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest007_Stress.java66
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest008.java94
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest009.java96
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest010.java88
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest011.java80
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest013.java108
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest014.java76
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest015.java84
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest016_Regression.java28
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OrdinaryClassesHierarchyWithSubRolesTest.java112
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OrdinaryInterfaceHierarchyTests.java70
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/model/AbstractJavaModelCompletionTests.java18
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/model/AllTests.java12
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/model/CompletionTestsRequestor2.java22
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/model/MiscRegressionTests.java12
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/model/OTCompletionTests.java290
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/AllTests.java12
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/AllTests_.java10
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/CallinMappingTest.java272
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/CalloutMappingTest.java100
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/DeclaredLiftingTest.java64
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/FileBasedModelTest.java8
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/JavaElementDeltaTests.java44
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/OTReconcilerTests.java1186
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/RetargetableFileBasedModelTest.java8
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/TestDataHandler.java16
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/TestSetting.java56
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/AllTests.java10
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/AttributeAssignmentTest.java32
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/GeneralTest.java34
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/LocalClassTest.java38
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test1.java30
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test2.java26
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test3a.java100
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test3b.java92
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test4.java38
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test5.java38
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test6.java34
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test7.java36
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test8.java38
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/AllTests.java12
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test1.java44
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test2.java40
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test3.java56
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test4.java58
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test5.java56
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test6.java54
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test7.java52
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test8.java50
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/equals/AllTests.java10
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/equals/EqualsTest.java16
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/equals/Test1.java46
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/externalrole/AllExternalBoundToOrdinaryRoleTests.java20
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/externalrole/AllExternalBoundToTeamRoleTests.java20
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/externalrole/AllExternalUnboundRoleTests.java20
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/externalrole/AllTests.java12
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internal/AllTests.java8
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internal/OTModelManagerTest.java62
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internal/TypeHelperTest001.java40
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internal/TypeHelperTest002.java28
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internal/TypeHelperTest003.java38
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internal/TypeHelperTest004.java34
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internalrole/AllInternalBoundToOrdinaryRoleTests.java20
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internalrole/AllInternalBoundToRoleRoleTests.java18
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internalrole/AllInternalBoundToTeamRoleTests.java20
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internalrole/AllInternalUnboundRoleTests.java20
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internalrole/AllTests.java10
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test1.java60
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test2.java14
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test3a.java18
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test3b.java24
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test3c.java16
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test3d.java16
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test4a.java16
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test4b.java28
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test5_MethodMappingGeneral.java48
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test5a.java34
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test5b.java16
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test5c.java54
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test5d.java10
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test5e.java10
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/torole/LayeredTeamsTests.java44
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test1.java66
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test2.java20
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test3a.java18
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test3b.java26
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test3c.java16
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test3d.java14
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test4a.java20
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test4b.java28
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test5_MethodMappingGeneral.java46
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test5a.java44
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test5b.java14
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test5c.java64
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test5d.java12
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test5e.java10
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test1.java62
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test2.java10
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test3a.java18
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test3b.java32
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test3c.java14
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test3d.java16
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test4a.java18
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test4b.java28
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test5a.java20
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test5b.java12
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test5c.java12
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test5d.java16
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/sample/AllSampleTests.java14
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/sample/FileBasedTestsSample.java16
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/teams/AllTests.java14
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/teams/Test1.java34
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/teams/Test2.java34
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/AbstractOTJLDNullAnnotationTest.java52
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/AbstractOTJLDTest.java54
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/AllTests.java40
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/JdtTestAdaptor.java14
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/SomeTests.java38
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/Stringify.java8
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/api/Reflection.java174
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/callinbinding/BaseCalls.java254
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/callinbinding/CallinMethodBinding.java672
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/callinbinding/CallinParameterMapping_LiftingAndLowering.java84
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/callinbinding/CallinWithTranslation.java126
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutMethodBinding.java708
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutParameterBinding_LiftingAndLowering.java432
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutToField.java254
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/OverridingAccessRestrictions.java80
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/AllSmartLiftingTests.java8
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/DeclaredLifting.java100
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting1.java60
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting10.java20
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting11.java36
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting12.java28
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting13.java60
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting14.java28
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting15.java20
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting16.java22
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting17.java36
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting18.java30
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting19.java14
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting2.java30
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting20.java12
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting21.java20
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting22.java14
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting23.java12
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting24.java14
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting25.java14
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting26.java14
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting27.java14
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting28.java12
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting29.java24
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting3.java20
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting30.java22
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting4.java22
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting5.java36
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting6.java28
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting7.java60
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting8.java28
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting9.java20
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/AccessModifiers.java158
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Exceptions.java36
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Java5.java534
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Java7.java144
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Java8.java164
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Misc.java346
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Modifiers.java80
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/OTNullAnnotationTest.java50
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/OTNullTypeAnnotationTest.java110
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/regression/CompilationOrder.java86
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/regression/ComplexStructures.java74
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/regression/DevelopmentExamples.java342
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/regression/ReportedBugs.java1134
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/AllBindingAmbiguitiesTests.java10
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BaseClassVisibility.java244
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities1.java90
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities10.java16
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities11.java16
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities12.java10
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities2.java30
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities3.java16
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities4.java24
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities5.java24
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities6.java16
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities7.java20
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities8.java20
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities9.java14
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguitiesM.java4
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/ExplicitRoleCreation.java118
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/GC.java24
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/LiftingAndLowering.java506
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/PlayedByRelation.java274
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/AcquisitionAndInheritanceOfRoleClasses.java174
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/Confinement.java78
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/Covariance.java30
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/ExternalizedRoles.java250
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/FileStructure.java222
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/ImplicitInheritance.java358
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/InheritanceHierarchyOfTeams.java16
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/OldExternalizedRoles.java52
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/RegularRoleInheritance.java166
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/RelevantRole.java86
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/RoleObjectContainment.java30
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/TeamNesting.java410
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/ValueParameters.java72
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/syntax/Syntax.java332
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/teamactivation/ExplicitTeamActivation.java98
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/teamactivation/ImplicitTeamActivation.java18
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/teamactivation/Predicates.java190
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/parser/org/eclipse/objectteams/otdt/tests/parser/AllTests.java8
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/parser/org/eclipse/objectteams/otdt/tests/parser/SourceElementParserTest.java96
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/search/org/eclipse/objectteams/otdt/tests/search/AllTests.java8
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/search/org/eclipse/objectteams/otdt/tests/search/FileBasedSearchTest.java8
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/search/org/eclipse/objectteams/otdt/tests/search/OTJavaFieldSearchTests.java52
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/search/org/eclipse/objectteams/otdt/tests/search/OTJavaMethodSearchTests.java578
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/search/org/eclipse/objectteams/otdt/tests/search/OTJavaSearchTestBase.java24
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/search/org/eclipse/objectteams/otdt/tests/search/OTJavaTypeSearchTests.java358
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/AllTests.java12
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/OTSelectionJavadocTest.java16
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/OTSpecificSelectionWithinRoleTests.java498
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/OTSpecificSelectionWithinTeamTests.java338
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/SelectionWithinRoleTests.java1004
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/SelectionWithinTeamTests.java1450
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/codeselect/CodeSelectionTests.java96
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/AbstractJavaModelTests.java60
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/AllTests.java28
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/ClasspathUtil.java8
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/FileBasedTest.java108
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/ModifyingResourceTests.java18
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/StringBasedTest.java16
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/SuiteOfTestCases.java22
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/AllTests.java14
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/DOMTestPlugin.java10
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/FileBasedDOMTest.java8
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/TypeDeclarationFinder.java30
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/bindings/AllTests.java8
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/bindings/MethodMappingBindingTest.java62
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/bindings/TypeBindingTest.java46
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/AllTests.java16
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/AnchoredTypeTest.java36
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/BaseCallMessageSendTest.java92
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/BaseCallMessageSendTest2.java32
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/BaseConstructorInvocationTest.java58
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/CallinMappingDeclarationTest.java46
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/CalloutMappingDeclarationTest.java218
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/DOMRegressionTests.java36
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/FieldAccessSpecTest.java100
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/GuardPredicateTest.java38
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/LiftingTypeTest.java62
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/MethodSpecTest.java102
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/ParameterMappingCallinTest.java60
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/ParameterMappingCalloutTest.java94
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/PrecedenceDeclarationTest.java32
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/RoleTypeDeclarationTest.java116
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/TSuperConstructorInvocationTest.java64
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/TSuperMessageSendTest.java74
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/WithinStatementTest.java72
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/ASTRewriteFlattenerTest.java336
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/ASTRewritingModifyingCallinMappingDeclarationTest.java289
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/ASTRewritingModifyingCalloutMappingDeclarationTest.java225
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/ASTRewritingModifyingRoleTest.java247
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/ASTRewritingModifyingTeamTest.java211
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/ASTRewritingModifyingTest.java16
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/AllTests.java8
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/describing/AstRewritingDescribingTest.java26
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/describing/CallinMappingDeclarationTest.java28
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/describing/TypeDeclarationTest.java60
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/AllTests.java22
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/FileBasedRefactoringTest.java8
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/MySetup.java12
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/OTRefactoringTestPlugin.java8
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/OTRefactoringTestSetup.java12
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/RefactoringTest.java12
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/adapt/JdtTests.java22
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractcallin/AllTests.java10
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractcallin/ExtractCallinTests.java26
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/AbstractSelectionTestCase.java46
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/AllTests.java10
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/ExtractMethodRefactoringUtilTests.java10
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/ExtractMethodTestSetup.java28
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/ExtractMethodTests.java74
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/ExtractTempTestSetup.java18
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/ExtractTempTests.java44
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/inlinecallin/AllTests.java10
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/inlinecallin/InlineCallinTests.java94
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/misc/ChangeSignatureTests.java22
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/AllTests.java12
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveBaseClassTests.java30
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveInstanceMethodTests.java34
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveMethodTests.java12
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveRoleTests.java26
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveStaticMethodTests.java14
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pullup/AllTests.java12
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pullup/PullUpTests.java66
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pushdown/AllTests.java10
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pushdown/PushDownTests.java68
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/AllTests.java12
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameMethodInInterfaceTests.java26
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameMethodTests.java12
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenamePrivateFieldTests.java24
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenamePrivateMethodTests.java38
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameStaticMethodTests.java48
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameTypeTests.java50
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameVirtualMethodInClassTests.java10
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/reorg/AllTests.java12
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/reorg/MockReorgQueries.java8
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/reorg/OTCopyToClipboardTests.java92
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/reorg/OTDeleteTests.java30
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/reorg/OTPasteActionTest.java60
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/reorg/PasteActionTest.java54
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/requiredfeatures/AllTests.java16
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rolefile/MoveToRileFileTests.java20
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/util/AllTests.java12
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/util/RefactoringUtilTest.java64
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/util/TypeHelperGetInheritedMethodsTest.java34
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/AllTests.java8
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/FileBasedUITest.java8
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/TestAdjuster.java12
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/TestPlugin.java14
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/callinmarker/CallinMarkerTests.java104
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/contentprovider/AllTests.java8
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/contentprovider/ExternalDefinedRoleContentAndParentTests.java230
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/contentprovider/InternalDefinedRoleContentAndParentTests.java228
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/contentprovider/Logger.java14
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/contentprovider/TeamContentTests.java146
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/AddImportQuickFixTest.java66
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/AddUnimplementedMethodsTest.java54
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/CallinQuickFixTest.java74
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/CalloutQuickFixTest.java104
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/CodeCompletionTest.java562
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/CompletionTestSetup.java20
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/HierarchicalASTVisiting.java16
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/JavaQuickFixTests.java56
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/ModifierCorrectionsQuickFixTest.java92
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/OTJavadocQuickFixTest.java32
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/OTQuickFixTest.java28
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/OrganizeImportsTest.java46
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/PrecedenceQuickFixTest.java18
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/ProjectTestSetup.java6
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/ProposalAdaptor.java12
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/StatementQuickFixTest.java20
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/StringAsserts.java8
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/UnresolvedMethodsQuickFixTest.java138
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/rule/ProjectTestSetup.java2
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/AllTests.java8
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/Comparator.java8
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/ITypeComparator.java8
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/OTSubHierarchyContentProviderTests.java132
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/SuperHierarchyContentProviderTests.java152
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/TraditionalHierarchyContentProviderTests.java124
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/TreeNode.java36
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/typecreator/AllInternalRoleCreationTests.java14
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/typecreator/AllTests.java8
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/typecreator/NewTeamWizardPageListenerTest.java10
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/typecreator/RoleCreationTests.java382
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/typecreator/TeamCreationTests.java150
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/util/JavaProjectHelper.java12
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/util/TestOptions.java28
1646 files changed, 152691 insertions, 152695 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);
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/Activator.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/Activator.java
index 8d063b9eb..3057d20f8 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/Activator.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/Activator.java
@@ -34,13 +34,13 @@ public class Activator extends Plugin {
@SuppressWarnings("deprecation")
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);
else
getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, "Failed to load PackageAdmin service. Will not be able to access bundles org.eclipse.jdt.annotation."));
-
+
instance = this;
}
@@ -50,7 +50,7 @@ public class Activator extends Plugin {
/**
* Make the PackageAdmin service accessible to tests.
- *
+ *
* @deprecated uses deprecated class PackageAdmin.
*/
public static org.osgi.service.packageadmin.PackageAdmin getPackageAdmin() {
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunAllJava13Tests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunAllJava13Tests.java
index 4d0cc1f79..de3b55bd8 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunAllJava13Tests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunAllJava13Tests.java
@@ -29,7 +29,7 @@ import junit.framework.TestSuite;
@SuppressWarnings({"rawtypes", "unchecked"})
public class RunAllJava13Tests extends TestCase {
-
+
public RunAllJava13Tests(String name) {
super(name);
}
@@ -41,7 +41,7 @@ public class RunAllJava13Tests extends TestCase {
org.eclipse.jdt.compiler.apt.tests.AllTests.class,
};
}
-
+
public static Class[] getConverterTestClasses() {
return new Class[] {
ASTConverter14Test.class,
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunAllJava14Tests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunAllJava14Tests.java
index e3baeb60a..7336c26fe 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunAllJava14Tests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunAllJava14Tests.java
@@ -27,7 +27,7 @@ import junit.framework.TestSuite;
@SuppressWarnings({"rawtypes", "unchecked"})
public class RunAllJava14Tests extends TestCase {
-
+
public RunAllJava14Tests(String name) {
super(name);
}
@@ -37,16 +37,16 @@ public class RunAllJava14Tests extends TestCase {
};
}
-
+
public static Class[] getConverterTestClasses() {
return new Class[] {
-
+
};
}
public static Class[] getCompilerClasses() {
return new Class[] {
-
+
};
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunAllJava8Tests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunAllJava8Tests.java
index 2a42bd3d1..4b08335d8 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunAllJava8Tests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunAllJava8Tests.java
@@ -45,7 +45,7 @@ import org.eclipse.jdt.core.tests.util.AbstractCompilerTest;
@SuppressWarnings({"rawtypes", "unchecked"})
public class RunAllJava8Tests extends TestCase {
-
+
public RunAllJava8Tests(String name) {
super(name);
}
@@ -65,7 +65,7 @@ public class RunAllJava8Tests extends TestCase {
JavaElement8Tests.class,
};
}
-
+
public static Class[] getConverterTestClasses() {
return new Class[] {
TypeAnnotationsConverterTest.class,
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunFormatterTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunFormatterTests.java
index b3fbea801..324903378 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunFormatterTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunFormatterTests.java
@@ -6,7 +6,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 - Contribution for bug 402173
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnly335CompilerTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnly335CompilerTests.java
index 356123ff1..25a39dae9 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnly335CompilerTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnly335CompilerTests.java
@@ -35,7 +35,7 @@ import org.eclipse.jdt.core.tests.util.AbstractCompilerTest;
@SuppressWarnings({"rawtypes", "unchecked"})
public class RunOnly335CompilerTests extends TestCase {
-
+
public RunOnly335CompilerTests(String name) {
super(name);
}
@@ -50,7 +50,7 @@ public class RunOnly335CompilerTests extends TestCase {
NullTypeAnnotationTest.class, // tests type inference
};
}
-
+
public static Class[] getCompilerClasses() {
return new Class[] {
GenericTypeTest.class,
@@ -64,7 +64,7 @@ public class RunOnly335CompilerTests extends TestCase {
Class[] testClasses = getAllTestClasses();
addTestsToSuite(ts, testClasses);
-
+
AbstractCompilerTest.setpossibleComplianceLevels(AbstractCompilerTest.F_1_8);
addTestsToSuite(ts, getCompilerClasses());
return ts;
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnlyAssistModelTests18.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnlyAssistModelTests18.java
index 5e5259cce..155e21c39 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnlyAssistModelTests18.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnlyAssistModelTests18.java
@@ -29,7 +29,7 @@ import org.eclipse.jdt.core.tests.model.ResolveTests18;
@SuppressWarnings({"rawtypes", "unchecked"})
public class RunOnlyAssistModelTests18 extends TestCase {
-
+
public RunOnlyAssistModelTests18(String name) {
super(name);
}
@@ -43,7 +43,7 @@ public class RunOnlyAssistModelTests18 extends TestCase {
JavaElement8Tests.class,
};
}
-
+
public static Test suite() {
TestSuite ts = new TestSuite(RunOnlyAssistModelTests18.class.getName());
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnlyJava12Tests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnlyJava12Tests.java
index c1b0a6639..63d11831b 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnlyJava12Tests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnlyJava12Tests.java
@@ -23,7 +23,7 @@ import junit.framework.TestSuite;
@SuppressWarnings({"rawtypes", "unchecked"})
public class RunOnlyJava12Tests extends TestCase {
-
+
public RunOnlyJava12Tests(String name) {
super(name);
}
@@ -32,7 +32,7 @@ public class RunOnlyJava12Tests extends TestCase {
// to be filled after other tests are added
};
}
-
+
public static Test suite() {
TestSuite ts = new TestSuite(RunOnlyJava12Tests.class.getName());
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnlyJava13Tests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnlyJava13Tests.java
index 1ad7a13f9..af2f64c2e 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnlyJava13Tests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnlyJava13Tests.java
@@ -30,7 +30,7 @@ import junit.framework.TestSuite;
@SuppressWarnings({"rawtypes", "unchecked"})
public class RunOnlyJava13Tests extends TestCase {
-
+
public RunOnlyJava13Tests(String name) {
super(name);
}
@@ -40,7 +40,7 @@ public class RunOnlyJava13Tests extends TestCase {
SwitchExpressionsYieldTest.class,
};
}
-
+
public static Class[] getConverterTestClasses() {
return new Class[] {
ASTConverter14Test.class,
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnlyJava14Tests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnlyJava14Tests.java
index efc1c3fb0..18215af78 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnlyJava14Tests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnlyJava14Tests.java
@@ -29,7 +29,7 @@ import junit.framework.TestSuite;
@SuppressWarnings({"rawtypes", "unchecked"})
public class RunOnlyJava14Tests extends TestCase {
-
+
public RunOnlyJava14Tests(String name) {
super(name);
}
@@ -38,10 +38,10 @@ public class RunOnlyJava14Tests extends TestCase {
JavaSearchBugs14Tests.class,JavaSearchBugs14SwitchExpressionTests.class, CompletionTests14.class
};
}
-
+
public static Class[] getConverterTestClasses() {
return new Class[] {
-
+
};
}
public static Test suite() {
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnlyJava8Tests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnlyJava8Tests.java
index f5300d603..79afb6e0e 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnlyJava8Tests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnlyJava8Tests.java
@@ -73,7 +73,7 @@ import org.eclipse.jdt.core.tests.rewrite.describing.ASTRewritingTest;
@SuppressWarnings({"rawtypes", "unchecked"})
public class RunOnlyJava8Tests extends TestCase {
-
+
public RunOnlyJava8Tests(String name) {
super(name);
}
@@ -118,7 +118,7 @@ public class RunOnlyJava8Tests extends TestCase {
JavaElement8Tests.class,
};
}
-
+
public static Class[] getConverterTestClasses() {
return new Class[] {
TypeAnnotationsConverterTest.class,
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/APIDocumentationTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/APIDocumentationTests.java
index 1ec90c47c..5a6292da8 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/APIDocumentationTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/APIDocumentationTests.java
@@ -72,7 +72,7 @@ public class APIDocumentationTests extends AbstractASTTests {
// TESTS_NUMBERS = new int[] { 78, 79, 80 };
// TESTS_RANGE = new int[] { 83304, -1 };
}
-
+
/**
* Internal synonym for deprecated constant AST.JSL3
* to alleviate deprecation warnings.
@@ -148,7 +148,7 @@ public void testJavaCoreAPI() throws CoreException, IllegalArgumentException, Il
URL url = bundle.getEntry("/");
IPath path = new Path(FileLocator.toFileURL(url).getPath());
path = path.removeLastSegments(1).append(ORG_ECLIPSE_JDT_CORE);
- String stringPath = path.toString() + "/model/" + PATH_JAVA_CORE_JAVA;
+ String stringPath = path.toString() + "/model/" + PATH_JAVA_CORE_JAVA;
File javaCoreSourceFile = new File(stringPath);
char[] sourceChars = null;
if (javaCoreSourceFile.exists()) {
@@ -174,7 +174,7 @@ public void testJavaCoreAPI() throws CoreException, IllegalArgumentException, Il
}
}
}
-
+
if (sourceChars != null) {
// load field values in a map
Hashtable realOptionIDs = new Hashtable();
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter10Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter10Test.java
index 21285eaed..2d2062e65 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter10Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter10Test.java
@@ -32,7 +32,7 @@ public class ASTConverter10Test extends ConverterTestSetup {
ICompilationUnit workingCopy;
// private static final String jcl9lib = "CONVERTER_JCL9_LIB";
-
+
@SuppressWarnings("deprecation")
public void setUpSuite() throws Exception {
@@ -78,7 +78,7 @@ public class ASTConverter10Test extends ConverterTestSetup {
" }\n" +
"}";
this.workingCopy = getWorkingCopy("/Converter10/src/X.java", true/*resolve*/);
- ASTNode node = buildAST(contents, this.workingCopy);
+ ASTNode node = buildAST(contents, this.workingCopy);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
node = getASTNode((CompilationUnit)node, 0, 0);
MethodDeclaration methodDeclaration = (MethodDeclaration) node;
@@ -136,7 +136,7 @@ public class ASTConverter10Test extends ConverterTestSetup {
String contents =
"public class X {\n" +
" public static void main(String[] args) {\n" +
- " var list = new Y<String>();\n" +
+ " var list = new Y<String>();\n" +
" }\n" +
"}\n" +
"class Y<T> {}";
@@ -157,7 +157,7 @@ public class ASTConverter10Test extends ConverterTestSetup {
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 {}";
@@ -185,8 +185,8 @@ public class ASTConverter10Test extends ConverterTestSetup {
String contents =
"public class X {\n" +
" public static void main(String[] args) {\n" +
- "for (var x= 10; x < 20; x++) {\n" +
- " // do nothing\n" +
+ "for (var x= 10; x < 20; x++) {\n" +
+ " // do nothing\n" +
" }\n" +
"}\n" +
"class Y {}";
@@ -219,22 +219,22 @@ public class ASTConverter10Test extends ConverterTestSetup {
options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_8);
options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_8);
options.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_8);
-
+
String srcFolderInWS = "/Converter10/src";
createFolder(srcFolderInWS + "/cardManager/");
-
+
String srcFilePathInWS = srcFolderInWS + "/cardManager/CardManagerFragment.java";
- createFile(srcFilePathInWS,
- "package cardManager;\n" +
- "\n" +
- "public class CardManagerFragment {\n" +
- " private view.View i;\n" +
- "\n" +
- " private <T> T a() {\n" +
- " return this.i.findViewById(-1);\n" +
- " }\n" +
+ createFile(srcFilePathInWS,
+ "package cardManager;\n" +
+ "\n" +
+ "public class CardManagerFragment {\n" +
+ " private view.View i;\n" +
+ "\n" +
+ " private <T> T a() {\n" +
+ " return this.i.findViewById(-1);\n" +
+ " }\n" +
"}\n");
-
+
jarPath = getWorkspacePath() + "Converter10/P.jar";
createJar(new String[] {
"view/View.java",
@@ -245,7 +245,7 @@ public class ASTConverter10Test extends ConverterTestSetup {
},
jarPath,
options);
-
+
ASTParser parser = ASTParser.newParser(AST_INTERNAL_JLS10);
parser.setResolveBindings(true);
parser.setStatementsRecovery(true);
@@ -253,7 +253,7 @@ public class ASTConverter10Test extends ConverterTestSetup {
parser.setCompilerOptions(options);
parser.setEnvironment(new String[] {jarPath}, new String[] {getWorkspacePath() + srcFolderInWS}, null, true);
parser.setKind(ASTParser.K_COMPILATION_UNIT);
-
+
class MyFileASTRequestor extends FileASTRequestor {
boolean accepted = false;
@SuppressWarnings("synthetic-access")
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter11Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter11Test.java
index 8279e0b7e..cbd5d6510 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter11Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter11Test.java
@@ -22,7 +22,7 @@ import org.eclipse.jdt.core.JavaModelException;
public class ASTConverter11Test extends ConverterTestSetup {
ICompilationUnit workingCopy;
-
+
@SuppressWarnings("deprecation")
public void setUpSuite() throws Exception {
@@ -63,7 +63,7 @@ public class ASTConverter11Test extends ConverterTestSetup {
" public void apply(Integer k);\n" +
"}";
this.workingCopy = getWorkingCopy("/Converter11/src/X.java", true/*resolve*/);
- ASTNode node = buildAST(contents, this.workingCopy);
+ ASTNode node = buildAST(contents, this.workingCopy);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
node = getASTNode((CompilationUnit)node, 0, 0);
MethodDeclaration methodDeclaration = (MethodDeclaration) node;
@@ -95,7 +95,7 @@ public class ASTConverter11Test extends ConverterTestSetup {
" public void apply(Integer k, Integer l);\n" +
"}";
this.workingCopy = getWorkingCopy("/Converter11/src/X.java", true/*resolve*/);
- ASTNode node = buildAST(contents, this.workingCopy);
+ ASTNode node = buildAST(contents, this.workingCopy);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
node = getASTNode((CompilationUnit)node, 0, 0);
MethodDeclaration methodDeclaration = (MethodDeclaration) node;
@@ -115,7 +115,7 @@ public class ASTConverter11Test extends ConverterTestSetup {
binding = simpleName.resolveTypeBinding();
assertTrue("null binding", binding != null);
assertTrue("Wrong Binding", "Integer".equals(simpleName.resolveBinding().getName()));
-
+
}
}
// Add new tests here
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter13Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter13Test.java
index 2b7c36bd6..fde8f0897 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter13Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter13Test.java
@@ -67,7 +67,7 @@ public class ASTConverter13Test extends ConverterTestSetup {
public static Test suite() {
return buildModelTestSuite(ASTConverter13Test.class);
}
-
+
static int getAST13() {
return AST.JLS13;
}
@@ -85,17 +85,17 @@ public class ASTConverter13Test extends ConverterTestSetup {
String contents =
" public class X {\n" +
" enum Day\n" +
- " {\n" +
- " SUNDAY, MONDAY, TUESDAY, WEDNESDAY,\n" +
- " THURSDAY, FRIDAY, SATURDAY;\n" +
+ " {\n" +
+ " SUNDAY, MONDAY, TUESDAY, WEDNESDAY,\n" +
+ " THURSDAY, FRIDAY, SATURDAY;\n" +
" }\n" +
- " public static void main(String[] args) {\n" +
+ " public static void main(String[] args) {\n" +
" Day day = Day.SUNDAY;\n" +
- " int k = switch (day) {\n" +
- " case MONDAY -> throw new NullPointerException();\n" +
- " case TUESDAY -> 1;\n" +
- "\n" +
- " case WEDNESDAY -> {yield 10;}\n" +
+ " int k = switch (day) {\n" +
+ " case MONDAY -> throw new NullPointerException();\n" +
+ " case TUESDAY -> 1;\n" +
+ "\n" +
+ " case WEDNESDAY -> {yield 10;}\n" +
" default -> {\n" +
" int g = day.toString().length();\n" +
" yield g;\n" +
@@ -132,35 +132,35 @@ public class ASTConverter13Test extends ConverterTestSetup {
*/
public void _test0002() throws JavaModelException {
String contents =
- "public class X {\n" +
- " static enum Day {MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY, SATURDAY,SUNDAY}\n" +
- " String aa(Day day) throws Exception {\n" +
- " var today = \"\";\n" +
- " switch (day) {\n" +
- " case SATURDAY,SUNDAY ->\n" +
- " today=\"Weekend\";\n" +
- " case MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY ->\n" +
- " today=\"Working\";\n" +
- " default ->\n" +
- " throw new Exception(\"Invalid day: \" + day.name());\n" +
- " }\n" +
- " return today;\n" +
- " }\n" +
- " \n" +
- " String bb(Day day) throws Exception {\n" +
- " var today = \"\";\n" +
- " switch (day) {\n" +
- " case SATURDAY,SUNDAY:\n" +
- " today = \"Weekend day\";\n" +
- " break;\n" +
- " case MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY:\n" +
- " today = \"Working day\";\n" +
- " break;\n" +
- " default:\n" +
- " throw new Exception(\"Invalid day: \" + day.name());\n" +
- " }\n" +
- " return today;\n" +
- " }\n" +
+ "public class X {\n" +
+ " static enum Day {MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY, SATURDAY,SUNDAY}\n" +
+ " String aa(Day day) throws Exception {\n" +
+ " var today = \"\";\n" +
+ " switch (day) {\n" +
+ " case SATURDAY,SUNDAY ->\n" +
+ " today=\"Weekend\";\n" +
+ " case MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY ->\n" +
+ " today=\"Working\";\n" +
+ " default ->\n" +
+ " throw new Exception(\"Invalid day: \" + day.name());\n" +
+ " }\n" +
+ " return today;\n" +
+ " }\n" +
+ " \n" +
+ " String bb(Day day) throws Exception {\n" +
+ " var today = \"\";\n" +
+ " switch (day) {\n" +
+ " case SATURDAY,SUNDAY:\n" +
+ " today = \"Weekend day\";\n" +
+ " break;\n" +
+ " case MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY:\n" +
+ " today = \"Working day\";\n" +
+ " break;\n" +
+ " default:\n" +
+ " throw new Exception(\"Invalid day: \" + day.name());\n" +
+ " }\n" +
+ " return today;\n" +
+ " }\n" +
"}" ;
this.workingCopy = getWorkingCopy("/Converter13/src/X.java", true/*resolve*/);
IJavaProject javaProject = this.workingCopy.getJavaProject();
@@ -183,7 +183,7 @@ public class ASTConverter13Test extends ConverterTestSetup {
javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, old);
}
}
-
+
/* test implicit break statement */
public void _test0003() throws JavaModelException {
@@ -232,7 +232,7 @@ public class ASTConverter13Test extends ConverterTestSetup {
assertEquals("Switch statement", node.getNodeType(), ASTNode.SWITCH_STATEMENT);
SwitchStatement switchStatement = (SwitchStatement) node;
checkSourceRange((Statement) switchStatement.statements().get(0), "case SATURDAY,SUNDAY ->", contents);
-
+
} finally {
javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, old);
}
@@ -283,7 +283,7 @@ public class ASTConverter13Test extends ConverterTestSetup {
Expression expression2 = brStmt.getExpression();
assertNotNull("should not null", expression2);
assertEquals("incorrect node type", ASTNode.STRING_LITERAL, expression2.getNodeType());
-
+
//default case:
SwitchCase caseStmt = (SwitchCase) statements.get(4);
assertTrue("not default", caseStmt.isDefault());
@@ -291,7 +291,7 @@ public class ASTConverter13Test extends ConverterTestSetup {
expression2 = brStmt.getExpression();
assertNotNull("should not null", expression2);
assertEquals("incorrect node type", ASTNode.STRING_LITERAL, expression2.getNodeType());
-
+
} finally {
javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, old);
}
@@ -300,14 +300,14 @@ public class ASTConverter13Test extends ConverterTestSetup {
public void __test0005() throws JavaModelException {
String contents =
"public class X {\n" +
- " public String _test001() {\n" +
- " int i = 0;\n" +
- " String ret = switch(i%2) {\n" +
- " case 0 -> \"odd\";\n" +
- " case 1 -> \"even\";\n" +
- " default -> \"\";\n" +
- " };\n" +
- " return ret;\n" +
+ " public String _test001() {\n" +
+ " int i = 0;\n" +
+ " String ret = switch(i%2) {\n" +
+ " case 0 -> \"odd\";\n" +
+ " case 1 -> \"even\";\n" +
+ " default -> \"\";\n" +
+ " };\n" +
+ " return ret;\n" +
" }" +
"}" ;
this.workingCopy = getWorkingCopy("/Converter13/src/X.java", true/*resolve*/);
@@ -347,7 +347,7 @@ public class ASTConverter13Test extends ConverterTestSetup {
expression2 = brStmt.getExpression();
assertNotNull("should not null", expression2);
assertEquals("incorrect node type", ASTNode.STRING_LITERAL, expression2.getNodeType());
-
+
} finally {
javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, old);
}
@@ -355,14 +355,14 @@ public class ASTConverter13Test extends ConverterTestSetup {
public void _test0006() throws JavaModelException {
String contents =
"public class X {\n" +
- " public String _test001() {\n" +
- " int i = 0;\n" +
- " String ret = switch(i%2) {\n" +
- " case 0 -> {return \"odd\"; }\n" +
- " case 1 -> \"even\";\n" +
- " default -> \"\";\n" +
- " };\n" +
- " return ret;\n" +
+ " public String _test001() {\n" +
+ " int i = 0;\n" +
+ " String ret = switch(i%2) {\n" +
+ " case 0 -> {return \"odd\"; }\n" +
+ " case 1 -> \"even\";\n" +
+ " default -> \"\";\n" +
+ " };\n" +
+ " return ret;\n" +
" }" +
"}" ;
this.workingCopy = getWorkingCopy("/Converter13/src/X.java", true/*resolve*/);
@@ -411,19 +411,19 @@ public class ASTConverter13Test extends ConverterTestSetup {
String source =
"import java.util.*;\n" +
"public class X {\n" +
- " void testForeach1(int i, List<String> list) {\n" +
- " for (String s : switch(i) { case 1 -> list; default -> ; }) {\n" +
- " \n" +
+ " void testForeach1(int i, List<String> list) {\n" +
+ " for (String s : switch(i) { case 1 -> list; default -> ; }) {\n" +
+ " \n" +
" }\n" +
" Throwable t = switch (i) {\n" +
" case 1 -> new Exception();\n" +
" case 2 -> new RuntimeException();\n" + // trigger !typeUniformAcrossAllArms
" default -> missing;\n" +
" };\n" +
- " }\n" +
+ " }\n" +
" void testForeach0(int i, List<String> list) {\n" + // errors in first arm
- " for (String s : switch(i) { case 1 -> ; default -> list; }) {\n" +
- " \n" +
+ " for (String s : switch(i) { case 1 -> ; default -> list; }) {\n" +
+ " \n" +
" }\n" +
" Throwable t = switch (i) {\n" +
" case 0 -> missing;\n" +
@@ -440,7 +440,7 @@ public class ASTConverter13Test extends ConverterTestSetup {
"}\n";
createFile("Foo/src/X.java", source);
ICompilationUnit cuD = getCompilationUnit("/Foo/src/X.java");
-
+
ASTParser parser = ASTParser.newParser(AST_INTERNAL_JLS13);
parser.setProject(p);
parser.setSource(cuD);
@@ -450,55 +450,55 @@ public class ASTConverter13Test extends ConverterTestSetup {
org.eclipse.jdt.core.dom.CompilationUnit cuAST = (org.eclipse.jdt.core.dom.CompilationUnit) parser.createAST(null);
IProblem[] problems = cuAST.getProblems();
assertProblems("Unexpected problems",
- "1. ERROR in /Foo/src/X.java (at line 4)\n" +
- " for (String s : switch(i) { case 1 -> list; default -> ; }) {\n" +
- " ^^\n" +
- "Syntax error on token \"->\", Expression expected after this token\n" +
- "----------\n" +
- "2. ERROR in /Foo/src/X.java (at line 10)\n" +
- " default -> missing;\n" +
- " ^^^^^^^\n" +
- "missing cannot be resolved to a variable\n" +
- "----------\n" +
- "3. ERROR in /Foo/src/X.java (at line 14)\n" +
- " for (String s : switch(i) { case 1 -> ; default -> list; }) {\n" +
- " ^^\n" +
- "Syntax error on token \"->\", Expression expected after this token\n" +
- "----------\n" +
- "4. ERROR in /Foo/src/X.java (at line 18)\n" +
- " case 0 -> missing;\n" +
- " ^^^^^^^\n" +
- "missing cannot be resolved to a variable\n" +
- "----------\n" +
- "5. ERROR in /Foo/src/X.java (at line 25)\n" +
- " case 0 -> missing;\n" +
- " ^^^^^^^\n" +
- "missing cannot be resolved to a variable\n" +
- "----------\n" +
- "6. ERROR in /Foo/src/X.java (at line 26)\n" +
- " default -> absent;\n" +
- " ^^^^^^\n" +
- "absent cannot be resolved to a variable\n" +
+ "1. ERROR in /Foo/src/X.java (at line 4)\n" +
+ " for (String s : switch(i) { case 1 -> list; default -> ; }) {\n" +
+ " ^^\n" +
+ "Syntax error on token \"->\", Expression expected after this token\n" +
+ "----------\n" +
+ "2. ERROR in /Foo/src/X.java (at line 10)\n" +
+ " default -> missing;\n" +
+ " ^^^^^^^\n" +
+ "missing cannot be resolved to a variable\n" +
+ "----------\n" +
+ "3. ERROR in /Foo/src/X.java (at line 14)\n" +
+ " for (String s : switch(i) { case 1 -> ; default -> list; }) {\n" +
+ " ^^\n" +
+ "Syntax error on token \"->\", Expression expected after this token\n" +
+ "----------\n" +
+ "4. ERROR in /Foo/src/X.java (at line 18)\n" +
+ " case 0 -> missing;\n" +
+ " ^^^^^^^\n" +
+ "missing cannot be resolved to a variable\n" +
+ "----------\n" +
+ "5. ERROR in /Foo/src/X.java (at line 25)\n" +
+ " case 0 -> missing;\n" +
+ " ^^^^^^^\n" +
+ "missing cannot be resolved to a variable\n" +
+ "----------\n" +
+ "6. ERROR in /Foo/src/X.java (at line 26)\n" +
+ " default -> absent;\n" +
+ " ^^^^^^\n" +
+ "absent cannot be resolved to a variable\n" +
"----------\n",
problems, source.toCharArray());
} finally {
deleteProject(p);
}
}
-
+
public void _test0007() throws JavaModelException {
String contents =
"public class X {\n" +
- " public String _test001() {\n" +
- " String s = \"\"\"\n" +
- " <html>\n" +
- " <body>\n" +
- " <p>Hello, world</p>\n" +
- " </body>\n" +
- " </html>\n" +
- " \"\"\";\n" +
+ " public String _test001() {\n" +
+ " String s = \"\"\"\n" +
+ " <html>\n" +
+ " <body>\n" +
+ " <p>Hello, world</p>\n" +
+ " </body>\n" +
+ " </html>\n" +
+ " \"\"\";\n" +
" System.out.println(s);" +
- " return s;\n" +
+ " return s;\n" +
" }" +
"}" ;
this.workingCopy = getWorkingCopy("/Converter13/src/X.java", true/*resolve*/);
@@ -526,14 +526,14 @@ public class ASTConverter13Test extends ConverterTestSetup {
assertTrue("String should not be empty", escapedValue.length() != 0);
assertTrue("String should start with \"\"\"", escapedValue.startsWith("\"\"\""));
-
+
String literal = ((TextBlock) initializer).getLiteralValue();
- assertEquals("literal value not correct",
- " <html>\n" +
- " <body>\n" +
- " <p>Hello, world</p>\n" +
- " </body>\n" +
- " </html>\n" +
+ assertEquals("literal value not correct",
+ " <html>\n" +
+ " <body>\n" +
+ " <p>Hello, world</p>\n" +
+ " </body>\n" +
+ " </html>\n" +
" ",
literal);
@@ -544,16 +544,16 @@ public class ASTConverter13Test extends ConverterTestSetup {
public void _test0008() throws JavaModelException {
String contents =
"public class X {\n" +
- " public String _test001() {\n" +
- " String s = \"\"\"\n" +
- " <html>\n" +
- " <body>\n" +
- " <p>Hello, world</p>\n" +
- " </body>\n" +
- " </html>\n" +
- " \"\"\";\n" +
+ " public String _test001() {\n" +
+ " String s = \"\"\"\n" +
+ " <html>\n" +
+ " <body>\n" +
+ " <p>Hello, world</p>\n" +
+ " </body>\n" +
+ " </html>\n" +
+ " \"\"\";\n" +
" System.out.println(s);" +
- " return s;\n" +
+ " return s;\n" +
" }" +
"}" ;
this.workingCopy = getWorkingCopy("/Converter13/src/X.java", true/*resolve*/);
@@ -581,16 +581,16 @@ public class ASTConverter13Test extends ConverterTestSetup {
public void _test0009() throws JavaModelException {
String contents =
"public class X {\n" +
- " public String _test001() {\n" +
- " String s = \"\"\"\n" +
- " <html>\n" +
- " <body>\n" +
- " <p>Hello, world</p>\n" +
- " </body>\n" +
- " </html>\n" +
- " \"\"\";\n" +
+ " public String _test001() {\n" +
+ " String s = \"\"\"\n" +
+ " <html>\n" +
+ " <body>\n" +
+ " <p>Hello, world</p>\n" +
+ " </body>\n" +
+ " </html>\n" +
+ " \"\"\";\n" +
" System.out.println(s);" +
- " return s;\n" +
+ " return s;\n" +
" }" +
"}" ;
this.workingCopy = getWorkingCopy("/Converter13/src/X.java", true/*resolve*/);
@@ -617,29 +617,29 @@ public class ASTConverter13Test extends ConverterTestSetup {
ITypeBinding binding = initializer.resolveTypeBinding();
assertNotNull("No binding", binding);
assertEquals("Wrong qualified name", "java.lang.String", binding.getQualifiedName());
-
+
String escapedValue = ((TextBlock) initializer).getEscapedValue();
assertTrue("String should not be empty", escapedValue.length() != 0);
assertTrue("String should start with \"\"\"", escapedValue.startsWith("\"\"\""));
- assertEquals("escaped value not correct",
- "\"\"\"\n" +
- " <html>\n" +
- " <body>\n" +
- " <p>Hello, world</p>\n" +
- " </body>\n" +
- " </html>\n" +
- " \"\"\"",
+ assertEquals("escaped value not correct",
+ "\"\"\"\n" +
+ " <html>\n" +
+ " <body>\n" +
+ " <p>Hello, world</p>\n" +
+ " </body>\n" +
+ " </html>\n" +
+ " \"\"\"",
escapedValue);
-
+
String literal = ((TextBlock) initializer).getLiteralValue();
- assertEquals("literal value not correct",
- " <html>\n" +
- " <body>\n" +
- " <p>Hello, world</p>\n" +
- " </body>\n" +
- " </html>\n" +
- " ",
+ assertEquals("literal value not correct",
+ " <html>\n" +
+ " <body>\n" +
+ " <p>Hello, world</p>\n" +
+ " </body>\n" +
+ " </html>\n" +
+ " ",
literal);
} finally {
javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, old);
@@ -647,16 +647,16 @@ public class ASTConverter13Test extends ConverterTestSetup {
}
public void _test0010() throws JavaModelException {
String contents =
- "public class test13 {\n" +
- " public static void main(String[] args) {\n" +
- " String s = \"\"\"\n" +
- " nadknaks vgvh \n" +
- " \"\"\";\n" +
- "\n" +
- " int m = 10;\n" +
- " m = m* 6;\n" +
- " System.out.println(s);\n" +
- " }\n" +
+ "public class test13 {\n" +
+ " public static void main(String[] args) {\n" +
+ " String s = \"\"\"\n" +
+ " nadknaks vgvh \n" +
+ " \"\"\";\n" +
+ "\n" +
+ " int m = 10;\n" +
+ " m = m* 6;\n" +
+ " System.out.println(s);\n" +
+ " }\n" +
"}" ;
this.workingCopy = getWorkingCopy("/Converter13/src/test13.java", true/*resolve*/);
IJavaProject javaProject = this.workingCopy.getJavaProject();
@@ -682,7 +682,7 @@ public class ASTConverter13Test extends ConverterTestSetup {
javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, old);
}
}
-
+
public void _test0011() throws CoreException {
// saw NPE in SwitchExpression.resolveType(SwitchExpression.java:423)
if (!isJRE13) {
@@ -690,23 +690,23 @@ public class ASTConverter13Test extends ConverterTestSetup {
return;
}
String source =
- "public class Switch {\n" +
- " public static void main(String[] args) {\n" +
- " foo(Day.TUESDAY);\n" +
- " }\n" +
- "\n" +
- " @SuppressWarnings(\"preview\")\n" +
- " private static void foo(Day day) {\n" +
- " switch (day) {\n" +
- " case SUNDAY, MONDAY, FRIDAY -> System.out.println(6);\n" +
- " case TUESDAY -> System.out.println(7);\n" +
- " case THURSDAY, SATURDAY -> System.out.println(8);\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "enum Day {\n" +
- " MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY;\n" +
+ "public class Switch {\n" +
+ " public static void main(String[] args) {\n" +
+ " foo(Day.TUESDAY);\n" +
+ " }\n" +
+ "\n" +
+ " @SuppressWarnings(\"preview\")\n" +
+ " private static void foo(Day day) {\n" +
+ " switch (day) {\n" +
+ " case SUNDAY, MONDAY, FRIDAY -> System.out.println(6);\n" +
+ " case TUESDAY -> System.out.println(7);\n" +
+ " case THURSDAY, SATURDAY -> System.out.println(8);\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "enum Day {\n" +
+ " MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY;\n" +
"}\n";
this.workingCopy = getWorkingCopy("/Converter13/src/Switch.java", true/*resolve*/);
IJavaProject javaProject = this.workingCopy.getJavaProject();
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter14Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter14Test.java
index 7654ac0fc..18a70ac7f 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter14Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter14Test.java
@@ -73,7 +73,7 @@ public class ASTConverter14Test extends ConverterTestSetup {
public static Test suite() {
return buildModelTestSuite(ASTConverter14Test.class);
}
-
+
static int getAST14() {
return AST.JLS14;
}
@@ -91,17 +91,17 @@ public class ASTConverter14Test extends ConverterTestSetup {
String contents =
" public class X {\n" +
" enum Day\n" +
- " {\n" +
- " SUNDAY, MONDAY, TUESDAY, WEDNESDAY,\n" +
- " THURSDAY, FRIDAY, SATURDAY;\n" +
+ " {\n" +
+ " SUNDAY, MONDAY, TUESDAY, WEDNESDAY,\n" +
+ " THURSDAY, FRIDAY, SATURDAY;\n" +
" }\n" +
- " public static void main(String[] args) {\n" +
+ " public static void main(String[] args) {\n" +
" Day day = Day.SUNDAY;\n" +
- " int k = switch (day) {\n" +
- " case MONDAY -> throw new NullPointerException();\n" +
- " case TUESDAY -> 1;\n" +
- "\n" +
- " case WEDNESDAY -> {yield 10;}\n" +
+ " int k = switch (day) {\n" +
+ " case MONDAY -> throw new NullPointerException();\n" +
+ " case TUESDAY -> 1;\n" +
+ "\n" +
+ " case WEDNESDAY -> {yield 10;}\n" +
" default -> {\n" +
" int g = day.toString().length();\n" +
" yield g;\n" +
@@ -130,35 +130,35 @@ public class ASTConverter14Test extends ConverterTestSetup {
*/
public void _test0002() throws JavaModelException {
String contents =
- "public class X {\n" +
- " static enum Day {MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY, SATURDAY,SUNDAY}\n" +
- " String aa(Day day) throws Exception {\n" +
- " var today = \"\";\n" +
- " switch (day) {\n" +
- " case SATURDAY,SUNDAY ->\n" +
- " today=\"Weekend\";\n" +
- " case MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY ->\n" +
- " today=\"Working\";\n" +
- " default ->\n" +
- " throw new Exception(\"Invalid day: \" + day.name());\n" +
- " }\n" +
- " return today;\n" +
- " }\n" +
- " \n" +
- " String bb(Day day) throws Exception {\n" +
- " var today = \"\";\n" +
- " switch (day) {\n" +
- " case SATURDAY,SUNDAY:\n" +
- " today = \"Weekend day\";\n" +
- " break;\n" +
- " case MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY:\n" +
- " today = \"Working day\";\n" +
- " break;\n" +
- " default:\n" +
- " throw new Exception(\"Invalid day: \" + day.name());\n" +
- " }\n" +
- " return today;\n" +
- " }\n" +
+ "public class X {\n" +
+ " static enum Day {MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY, SATURDAY,SUNDAY}\n" +
+ " String aa(Day day) throws Exception {\n" +
+ " var today = \"\";\n" +
+ " switch (day) {\n" +
+ " case SATURDAY,SUNDAY ->\n" +
+ " today=\"Weekend\";\n" +
+ " case MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY ->\n" +
+ " today=\"Working\";\n" +
+ " default ->\n" +
+ " throw new Exception(\"Invalid day: \" + day.name());\n" +
+ " }\n" +
+ " return today;\n" +
+ " }\n" +
+ " \n" +
+ " String bb(Day day) throws Exception {\n" +
+ " var today = \"\";\n" +
+ " switch (day) {\n" +
+ " case SATURDAY,SUNDAY:\n" +
+ " today = \"Weekend day\";\n" +
+ " break;\n" +
+ " case MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY:\n" +
+ " today = \"Working day\";\n" +
+ " break;\n" +
+ " default:\n" +
+ " throw new Exception(\"Invalid day: \" + day.name());\n" +
+ " }\n" +
+ " return today;\n" +
+ " }\n" +
"}" ;
this.workingCopy = getWorkingCopy("/Converter14/src/X.java", true/*resolve*/);
ASTNode node = buildAST(
@@ -173,7 +173,7 @@ public class ASTConverter14Test extends ConverterTestSetup {
checkSourceRange((Statement) switchStatement.statements().get(0), "case SATURDAY,SUNDAY ->", contents);
checkSourceRange((Statement) switchStatement.statements().get(2), "case MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY ->", contents);
}
-
+
/* test implicit break statement */
public void _test0003() throws JavaModelException {
@@ -217,9 +217,9 @@ public class ASTConverter14Test extends ConverterTestSetup {
assertEquals("Switch statement", node.getNodeType(), ASTNode.SWITCH_STATEMENT);
SwitchStatement switchStatement = (SwitchStatement) node;
checkSourceRange((Statement) switchStatement.statements().get(0), "case SATURDAY,SUNDAY ->", contents);
-
+
}
-
+
public void _test0004() throws JavaModelException {
String contents =
"public class X {\n" +
@@ -261,7 +261,7 @@ public class ASTConverter14Test extends ConverterTestSetup {
Expression expression2 = brStmt.getExpression();
assertNotNull("should not null", expression2);
assertEquals("incorrect node type", ASTNode.STRING_LITERAL, expression2.getNodeType());
-
+
//default case:
SwitchCase caseStmt = (SwitchCase) statements.get(4);
assertTrue("not default", caseStmt.isDefault());
@@ -269,20 +269,20 @@ public class ASTConverter14Test extends ConverterTestSetup {
expression2 = brStmt.getExpression();
assertNotNull("should not null", expression2);
assertEquals("incorrect node type", ASTNode.STRING_LITERAL, expression2.getNodeType());
-
+
}
@Deprecated
public void _test0005() throws JavaModelException {
String contents =
"public class X {\n" +
- " public String test001() {\n" +
- " int i = 0;\n" +
- " String ret = switch(i%2) {\n" +
- " case 0 -> \"odd\";\n" +
- " case 1 -> \"even\";\n" +
- " default -> \"\";\n" +
- " };\n" +
- " return ret;\n" +
+ " public String test001() {\n" +
+ " int i = 0;\n" +
+ " String ret = switch(i%2) {\n" +
+ " case 0 -> \"odd\";\n" +
+ " case 1 -> \"even\";\n" +
+ " default -> \"\";\n" +
+ " };\n" +
+ " return ret;\n" +
" }" +
"}" ;
this.workingCopy = getWorkingCopy("/Converter14/src/X.java", true/*resolve*/);
@@ -317,19 +317,19 @@ public class ASTConverter14Test extends ConverterTestSetup {
expression2 = brStmt.getExpression();
assertNotNull("should not null", expression2);
assertEquals("incorrect node type", ASTNode.STRING_LITERAL, expression2.getNodeType());
-
+
}
public void _test0006() throws JavaModelException {
String contents =
"public class X {\n" +
- " public String test001() {\n" +
- " int i = 0;\n" +
- " String ret = switch(i%2) {\n" +
- " case 0 -> {return \"odd\"; }\n" +
- " case 1 -> \"even\";\n" +
- " default -> \"\";\n" +
- " };\n" +
- " return ret;\n" +
+ " public String test001() {\n" +
+ " int i = 0;\n" +
+ " String ret = switch(i%2) {\n" +
+ " case 0 -> {return \"odd\"; }\n" +
+ " case 1 -> \"even\";\n" +
+ " default -> \"\";\n" +
+ " };\n" +
+ " return ret;\n" +
" }" +
"}" ;
this.workingCopy = getWorkingCopy("/Converter14/src/X.java", true/*resolve*/);
@@ -368,19 +368,19 @@ public class ASTConverter14Test extends ConverterTestSetup {
String source =
"import java.util.*;\n" +
"public class X {\n" +
- " void testForeach1(int i, List<String> list) {\n" +
- " for (String s : switch(i) { case 1 -> list; default -> ; }) {\n" +
- " \n" +
+ " void testForeach1(int i, List<String> list) {\n" +
+ " for (String s : switch(i) { case 1 -> list; default -> ; }) {\n" +
+ " \n" +
" }\n" +
" Throwable t = switch (i) {\n" +
" case 1 -> new Exception();\n" +
" case 2 -> new RuntimeException();\n" + // trigger !typeUniformAcrossAllArms
" default -> missing;\n" +
" };\n" +
- " }\n" +
+ " }\n" +
" void testForeach0(int i, List<String> list) {\n" + // errors in first arm
- " for (String s : switch(i) { case 1 -> ; default -> list; }) {\n" +
- " \n" +
+ " for (String s : switch(i) { case 1 -> ; default -> list; }) {\n" +
+ " \n" +
" }\n" +
" Throwable t = switch (i) {\n" +
" case 0 -> missing;\n" +
@@ -397,7 +397,7 @@ public class ASTConverter14Test extends ConverterTestSetup {
"}\n";
createFile("Foo/src/X.java", source);
ICompilationUnit cuD = getCompilationUnit("/Foo/src/X.java");
-
+
ASTParser parser = ASTParser.newParser(AST_INTERNAL_JLS14);
parser.setProject(p);
parser.setSource(cuD);
@@ -407,55 +407,55 @@ public class ASTConverter14Test extends ConverterTestSetup {
org.eclipse.jdt.core.dom.CompilationUnit cuAST = (org.eclipse.jdt.core.dom.CompilationUnit) parser.createAST(null);
IProblem[] problems = cuAST.getProblems();
assertProblems("Unexpected problems",
- "1. ERROR in /Foo/src/X.java (at line 4)\n" +
- " for (String s : switch(i) { case 1 -> list; default -> ; }) {\n" +
- " ^^\n" +
- "Syntax error on token \"->\", Expression expected after this token\n" +
- "----------\n" +
- "2. ERROR in /Foo/src/X.java (at line 10)\n" +
- " default -> missing;\n" +
- " ^^^^^^^\n" +
- "missing cannot be resolved to a variable\n" +
- "----------\n" +
- "3. ERROR in /Foo/src/X.java (at line 14)\n" +
- " for (String s : switch(i) { case 1 -> ; default -> list; }) {\n" +
- " ^^\n" +
- "Syntax error on token \"->\", Expression expected after this token\n" +
- "----------\n" +
- "4. ERROR in /Foo/src/X.java (at line 18)\n" +
- " case 0 -> missing;\n" +
- " ^^^^^^^\n" +
- "missing cannot be resolved to a variable\n" +
- "----------\n" +
- "5. ERROR in /Foo/src/X.java (at line 25)\n" +
- " case 0 -> missing;\n" +
- " ^^^^^^^\n" +
- "missing cannot be resolved to a variable\n" +
- "----------\n" +
- "6. ERROR in /Foo/src/X.java (at line 26)\n" +
- " default -> absent;\n" +
- " ^^^^^^\n" +
- "absent cannot be resolved to a variable\n" +
+ "1. ERROR in /Foo/src/X.java (at line 4)\n" +
+ " for (String s : switch(i) { case 1 -> list; default -> ; }) {\n" +
+ " ^^\n" +
+ "Syntax error on token \"->\", Expression expected after this token\n" +
+ "----------\n" +
+ "2. ERROR in /Foo/src/X.java (at line 10)\n" +
+ " default -> missing;\n" +
+ " ^^^^^^^\n" +
+ "missing cannot be resolved to a variable\n" +
+ "----------\n" +
+ "3. ERROR in /Foo/src/X.java (at line 14)\n" +
+ " for (String s : switch(i) { case 1 -> ; default -> list; }) {\n" +
+ " ^^\n" +
+ "Syntax error on token \"->\", Expression expected after this token\n" +
+ "----------\n" +
+ "4. ERROR in /Foo/src/X.java (at line 18)\n" +
+ " case 0 -> missing;\n" +
+ " ^^^^^^^\n" +
+ "missing cannot be resolved to a variable\n" +
+ "----------\n" +
+ "5. ERROR in /Foo/src/X.java (at line 25)\n" +
+ " case 0 -> missing;\n" +
+ " ^^^^^^^\n" +
+ "missing cannot be resolved to a variable\n" +
+ "----------\n" +
+ "6. ERROR in /Foo/src/X.java (at line 26)\n" +
+ " default -> absent;\n" +
+ " ^^^^^^\n" +
+ "absent cannot be resolved to a variable\n" +
"----------\n",
problems, source.toCharArray());
} finally {
deleteProject(p);
}
}
-
+
public void _test0007() throws JavaModelException {
String contents =
"public class X {\n" +
- " public String test001() {\n" +
- " String s = \"\"\"\n" +
- " <html>\n" +
- " <body>\n" +
- " <p>Hello, world</p>\n" +
- " </body>\n" +
- " </html>\n" +
- " \"\"\";\n" +
+ " public String test001() {\n" +
+ " String s = \"\"\"\n" +
+ " <html>\n" +
+ " <body>\n" +
+ " <p>Hello, world</p>\n" +
+ " </body>\n" +
+ " </html>\n" +
+ " \"\"\";\n" +
" System.out.println(s);" +
- " return s;\n" +
+ " return s;\n" +
" }" +
"}" ;
this.workingCopy = getWorkingCopy("/Converter14/src/X.java", true/*resolve*/);
@@ -478,14 +478,14 @@ public class ASTConverter14Test extends ConverterTestSetup {
assertTrue("String should not be empty", escapedValue.length() != 0);
assertTrue("String should start with \"\"\"", escapedValue.startsWith("\"\"\""));
-
+
String literal = ((TextBlock) initializer).getLiteralValue();
- assertEquals("literal value not correct",
- " <html>\n" +
- " <body>\n" +
- " <p>Hello, world</p>\n" +
- " </body>\n" +
- " </html>\n" +
+ assertEquals("literal value not correct",
+ " <html>\n" +
+ " <body>\n" +
+ " <p>Hello, world</p>\n" +
+ " </body>\n" +
+ " </html>\n" +
" ",
literal);
@@ -493,16 +493,16 @@ public class ASTConverter14Test extends ConverterTestSetup {
public void _test0008() throws JavaModelException {
String contents =
"public class X {\n" +
- " public String test001() {\n" +
- " String s = \"\"\"\n" +
- " <html>\n" +
- " <body>\n" +
- " <p>Hello, world</p>\n" +
- " </body>\n" +
- " </html>\n" +
- " \"\"\";\n" +
+ " public String test001() {\n" +
+ " String s = \"\"\"\n" +
+ " <html>\n" +
+ " <body>\n" +
+ " <p>Hello, world</p>\n" +
+ " </body>\n" +
+ " </html>\n" +
+ " \"\"\";\n" +
" System.out.println(s);" +
- " return s;\n" +
+ " return s;\n" +
" }" +
"}" ;
this.workingCopy = getWorkingCopy("/Converter14/src/X.java", true/*resolve*/);
@@ -522,16 +522,16 @@ public class ASTConverter14Test extends ConverterTestSetup {
public void _test0009() throws JavaModelException {
String contents =
"public class X {\n" +
- " public String test001() {\n" +
- " String s = \"\"\"\n" +
- " <html>\n" +
- " <body>\n" +
- " <p>Hello, world</p>\n" +
- " </body>\n" +
- " </html>\n" +
- " \"\"\";\n" +
+ " public String test001() {\n" +
+ " String s = \"\"\"\n" +
+ " <html>\n" +
+ " <body>\n" +
+ " <p>Hello, world</p>\n" +
+ " </body>\n" +
+ " </html>\n" +
+ " \"\"\";\n" +
" System.out.println(s);" +
- " return s;\n" +
+ " return s;\n" +
" }" +
"}" ;
this.workingCopy = getWorkingCopy("/Converter14/src/X.java", true/*resolve*/);
@@ -553,43 +553,43 @@ public class ASTConverter14Test extends ConverterTestSetup {
ITypeBinding binding = initializer.resolveTypeBinding();
assertNotNull("No binding", binding);
assertEquals("Wrong qualified name", "java.lang.String", binding.getQualifiedName());
-
+
String escapedValue = ((TextBlock) initializer).getEscapedValue();
assertTrue("String should not be empty", escapedValue.length() != 0);
assertTrue("String should start with \"\"\"", escapedValue.startsWith("\"\"\""));
- assertEquals("escaped value not correct",
- "\"\"\"\n" +
- " <html>\n" +
- " <body>\n" +
- " <p>Hello, world</p>\n" +
- " </body>\n" +
- " </html>\n" +
- " \"\"\"",
+ assertEquals("escaped value not correct",
+ "\"\"\"\n" +
+ " <html>\n" +
+ " <body>\n" +
+ " <p>Hello, world</p>\n" +
+ " </body>\n" +
+ " </html>\n" +
+ " \"\"\"",
escapedValue);
-
+
String literal = ((TextBlock) initializer).getLiteralValue();
- assertEquals("literal value not correct",
- " <html>\n" +
- " <body>\n" +
- " <p>Hello, world</p>\n" +
- " </body>\n" +
- " </html>\n" +
- " ",
+ assertEquals("literal value not correct",
+ " <html>\n" +
+ " <body>\n" +
+ " <p>Hello, world</p>\n" +
+ " </body>\n" +
+ " </html>\n" +
+ " ",
literal);
}
public void _test0010() throws JavaModelException {
String contents =
- "public class test14 {\n" +
- " public static void main(String[] args) {\n" +
- " String s = \"\"\"\n" +
- " nadknaks vgvh \n" +
- " \"\"\";\n" +
- "\n" +
- " int m = 10;\n" +
- " m = m* 6;\n" +
- " System.out.println(s);\n" +
- " }\n" +
+ "public class test14 {\n" +
+ " public static void main(String[] args) {\n" +
+ " String s = \"\"\"\n" +
+ " nadknaks vgvh \n" +
+ " \"\"\";\n" +
+ "\n" +
+ " int m = 10;\n" +
+ " m = m* 6;\n" +
+ " System.out.println(s);\n" +
+ " }\n" +
"}" ;
this.workingCopy = getWorkingCopy("/Converter14/src/test14.java", true/*resolve*/);
ASTNode node = buildAST(
@@ -607,7 +607,7 @@ public class ASTConverter14Test extends ConverterTestSetup {
node = getASTNode(compilationUnit, 0, 0, 3);
assertEquals("wrong line number", 9, compilationUnit.getLineNumber(node.getStartPosition()));
}
-
+
public void _test0011() throws CoreException {
// saw NPE in SwitchExpression.resolveType(SwitchExpression.java:423)
if (!isJRE14) {
@@ -615,22 +615,22 @@ public class ASTConverter14Test extends ConverterTestSetup {
return;
}
String source =
- "public class Switch {\n" +
- " public static void main(String[] args) {\n" +
- " foo(Day.TUESDAY);\n" +
- " }\n" +
- "\n" +
- " private static void foo(Day day) {\n" +
- " switch (day) {\n" +
- " case SUNDAY, MONDAY, FRIDAY -> System.out.println(6);\n" +
- " case TUESDAY -> System.out.println(7);\n" +
- " case THURSDAY, SATURDAY -> System.out.println(8);\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "enum Day {\n" +
- " MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY;\n" +
+ "public class Switch {\n" +
+ " public static void main(String[] args) {\n" +
+ " foo(Day.TUESDAY);\n" +
+ " }\n" +
+ "\n" +
+ " private static void foo(Day day) {\n" +
+ " switch (day) {\n" +
+ " case SUNDAY, MONDAY, FRIDAY -> System.out.println(6);\n" +
+ " case TUESDAY -> System.out.println(7);\n" +
+ " case THURSDAY, SATURDAY -> System.out.println(8);\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "enum Day {\n" +
+ " MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY;\n" +
"}\n";
this.workingCopy = getWorkingCopy("/Converter14/src/Switch.java", true/*resolve*/);
try {
@@ -645,18 +645,18 @@ public class ASTConverter14Test extends ConverterTestSetup {
}
}
-
+
public void testRecord001() throws CoreException {
if (!isJRE14) {
System.err.println("Test "+getName()+" requires a JRE 14");
return;
}
String contents =
- "public record X() {\n" +
- " public X {\n" +
+ "public record X() {\n" +
+ " public X {\n" +
" System.out.println(\"no error\");\n" +
- " }\n" +
- "\n" +
+ " }\n" +
+ "\n" +
"}\n";
this.workingCopy = getWorkingCopy("/Converter14/src/X.java", true/*resolve*/);
IJavaProject javaProject = this.workingCopy.getJavaProject();
@@ -674,7 +674,7 @@ public class ASTConverter14Test extends ConverterTestSetup {
javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, old);
}
}
-
+
/**
* Added for Bug 561193 - [14]record keyword inside method not colored correctly
* @throws CoreException
@@ -685,13 +685,13 @@ public class ASTConverter14Test extends ConverterTestSetup {
return;
}
String contents =
- "public record X(int param1, int param2) {\n" +
- " public X {\n" +
- " if (param1 > 5) {\n" +
+ "public record X(int param1, int param2) {\n" +
+ " public X {\n" +
+ " if (param1 > 5) {\n" +
" System.out.println(\"error\");\n" +
" }\n" +
- " }\n" +
- "\n" +
+ " }\n" +
+ "\n" +
"}\n";
this.workingCopy = getWorkingCopy("/Converter14/src/X.java", true/*resolve*/);
IJavaProject javaProject = this.workingCopy.getJavaProject();
@@ -709,25 +709,25 @@ public class ASTConverter14Test extends ConverterTestSetup {
javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, old);
}
}
-
+
public void testRecord003() throws CoreException {
if (!isJRE14) {
System.err.println("Test "+getName()+" requires a JRE 14");
return;
}
String contents =
- "public record X(int param1, int param2) {\n" +
- " public X {\n" +
- " if (param1 > 5) {\n" +
+ "public record X(int param1, int param2) {\n" +
+ " public X {\n" +
+ " if (param1 > 5) {\n" +
" System.out.println(\"error\");\n" +
" }\n" +
- " }\n" +
- "\n" +
- " public X(int a) {\n" +
- " this.param1 = 6;\n" +
- " this.param2 = 16;\n" +
- " a = 6;\n" +
- " }\n" +
+ " }\n" +
+ "\n" +
+ " public X(int a) {\n" +
+ " this.param1 = 6;\n" +
+ " this.param2 = 16;\n" +
+ " a = 6;\n" +
+ " }\n" +
"}\n";
this.workingCopy = getWorkingCopy("/Converter14/src/X.java", true/*resolve*/);
IJavaProject javaProject = this.workingCopy.getJavaProject();
@@ -751,7 +751,7 @@ public class ASTConverter14Test extends ConverterTestSetup {
System.err.println("Test " + getName() + " requires a JRE 14");
return;
}
- String contents = "public class X {\n" +
+ String contents = "public class X {\n" +
" public static void main(String[] args) {\n" +
" record R(int x,int y){}\n" +
" R r = new R(100, 200);\n" +
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15JLS4Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15JLS4Test.java
index 0b779715e..4a9d94042 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15JLS4Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15JLS4Test.java
@@ -79,7 +79,7 @@ public class ASTConverter15JLS4Test extends ConverterTestSetup {
public void test234609() throws JavaModelException {
String newContents = "package p;\n" +
- "import java.util.HashMap;\n" +
+ "import java.util.HashMap;\n" +
"public class X {\n" +
" /*start*/HashMap<? extends Integer,? super String>/*end*/ s;" +
"}";
@@ -117,7 +117,7 @@ public class ASTConverter15JLS4Test extends ConverterTestSetup {
},
getJavaProject("Converter15")
);
-
+
if (bindingFromKey.length != 1)
fail("Problem in going from key to binding\n");
if (!composedBindingKey.equals(bindingFromKey[0].getKey()))
@@ -127,27 +127,27 @@ public class ASTConverter15JLS4Test extends ConverterTestSetup {
fail("Bad signature");
assertTrue("Equals", bindingFromKey[0].isEqualTo(bindingFromAST));
-
+
// check existence of getGenericType() API.
ITypeBinding gType = bindingFromAST.getTypeArguments()[0].getGenericTypeOfWildcardType();
if (gType == null)
fail("Missing generic type");
if (!gType.getKey().equals("Ljava/util/HashMap<TK;TV;>;"))
fail("getKey() API is broken");
-
+
// test for getRank API.
if (bindingFromAST.getTypeArguments()[0].getRank() != 0)
fail ("Wrong rank");
-
+
if (bindingFromAST.getTypeArguments()[1].getRank() != 1)
- fail ("Wrong rank");
+ fail ("Wrong rank");
}
// Similar test as above - variation in wildcard type being unbounded.
public void test234609b() throws JavaModelException {
String newContents = "package p;\n" +
- "import java.util.ArrayList;\n" +
+ "import java.util.ArrayList;\n" +
"public class X {\n" +
" /*start*/ArrayList<?>/*end*/ s;" +
"}";
@@ -163,7 +163,7 @@ public class ASTConverter15JLS4Test extends ConverterTestSetup {
String genericTypeKey = BindingKey.createTypeBindingKey("java.util.ArrayList");
String [] wildcardKeys = new String [] { BindingKey.createWildcardTypeBindingKey(genericTypeKey, Signature.C_STAR, null, 0) };
-
+
String composedBindingKey = BindingKey.createParameterizedTypeBindingKey(genericTypeKey, wildcardKeys);
if (!composedBindingKey.equals(recoveredBindingKey))
@@ -183,7 +183,7 @@ public class ASTConverter15JLS4Test extends ConverterTestSetup {
},
getJavaProject("Converter15")
);
-
+
if (bindingFromKey.length != 1)
fail("Problem in going from key to binding\n");
if (!composedBindingKey.equals(bindingFromKey[0].getKey()))
@@ -193,7 +193,7 @@ public class ASTConverter15JLS4Test extends ConverterTestSetup {
fail("Bad signature");
assertTrue("Equals", bindingFromKey[0].isEqualTo(bindingFromAST));
}
-
+
public void test0001() throws JavaModelException {
ICompilationUnit sourceUnit = getCompilationUnit("Converter15" , "src", "test0001", "X.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
char[] source = sourceUnit.getSource().toCharArray();
@@ -673,7 +673,7 @@ public class ASTConverter15JLS4Test extends ConverterTestSetup {
assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.COMPILATION_UNIT);
CompilationUnit compilationUnit = (CompilationUnit) result;
String expectedProblems =
- "Pair is a raw type. References to generic type Pair<A,B> should be parameterized\n" +
+ "Pair is a raw type. References to generic type Pair<A,B> should be parameterized\n" +
"Pair is a raw type. References to generic type Pair<A,B> should be parameterized";
assertProblemsSize(compilationUnit, 2, expectedProblems);
ASTNode node = getASTNode(compilationUnit, 0, 5);
@@ -900,7 +900,7 @@ public class ASTConverter15JLS4Test extends ConverterTestSetup {
assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.COMPILATION_UNIT);
CompilationUnit compilationUnit = (CompilationUnit) result;
String expectedProblems =
- "Pair is a raw type. References to generic type Pair<A,B> should be parameterized\n" +
+ "Pair is a raw type. References to generic type Pair<A,B> should be parameterized\n" +
"Pair is a raw type. References to generic type Pair<A,B> should be parameterized";
assertProblemsSize(compilationUnit, 2, expectedProblems);
ASTNode node = getASTNode(compilationUnit, 0, 5);
@@ -3270,12 +3270,12 @@ public class ASTConverter15JLS4Test extends ConverterTestSetup {
"}";
this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/);
this.workingCopy.getBuffer().setContents(contents.toCharArray());
- ASTNode node = runConversion(getJLS4(), this.workingCopy, true);
+ ASTNode node = runConversion(getJLS4(), this.workingCopy, true);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
CompilationUnit compilationUnit = (CompilationUnit) node;
String expectedOutput = "Dead code";
assertProblemsSize(compilationUnit, 1, expectedOutput);
-
+
node = getASTNode(compilationUnit, 0, 0, 0);
assertEquals("Not an assert statement", ASTNode.ASSERT_STATEMENT, node.getNodeType());
AssertStatement assertStatement = (AssertStatement) node;
@@ -10365,15 +10365,15 @@ public class ASTConverter15JLS4Test extends ConverterTestSetup {
this.workingCopy = getWorkingCopy("/Converter15/src/test0316/X.java", true/*resolve*/);
ClassInstanceCreation expression = (ClassInstanceCreation) buildAST(
"package test0316;\n" +
- "class AbstractClass {\n" +
- " XXList<Class> statements = null;\n" +
- "}\n" +
+ "class AbstractClass {\n" +
+ " XXList<Class> statements = null;\n" +
+ "}\n" +
"import java.util.ArrayList;\n" +
- "public class X extends AbstractClass {\n" +
- " public List<Class> compute() {\n" +
- " statements = /*start*/new ArrayList<Class>()/*end*/;\n" +
- " return statements;\n" +
- " }\n" +
+ "public class X extends AbstractClass {\n" +
+ " public List<Class> compute() {\n" +
+ " statements = /*start*/new ArrayList<Class>()/*end*/;\n" +
+ " return statements;\n" +
+ " }\n" +
"}",
this.workingCopy,
false,
@@ -10389,14 +10389,14 @@ public class ASTConverter15JLS4Test extends ConverterTestSetup {
this.workingCopy = getWorkingCopy("/Converter15/src/test0317/X.java", true/*resolve*/);
ClassInstanceCreation expression = (ClassInstanceCreation) buildAST(
"package test0317;\n" +
- "import java.util.ArrayList;\n" +
- "import java.util.List;\n" +
- "public class X {\n" +
- " XXList<Class> statements = null;\n" +
- " public List<Class> compute() {\n" +
- " statements = /*start*/new ArrayList<Class>()/*end*/;\n" +
- " return statements;\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "public class X {\n" +
+ " XXList<Class> statements = null;\n" +
+ " public List<Class> compute() {\n" +
+ " statements = /*start*/new ArrayList<Class>()/*end*/;\n" +
+ " return statements;\n" +
+ " }\n" +
"}",
this.workingCopy,
false,
@@ -10411,15 +10411,15 @@ public class ASTConverter15JLS4Test extends ConverterTestSetup {
public void test0318() throws JavaModelException {
this.workingCopy = getWorkingCopy("/Converter15/src/test0317/X.java", true/*resolve*/);
SimpleType type = (SimpleType) buildAST(
- "class X {\n" +
- " {\n" +
- " abstract class B<T> {\n" +
- " abstract class A {}\n" +
- " public void foo() {\n" +
- " new /*start*/A/*end*/() {};\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "class X {\n" +
+ " {\n" +
+ " abstract class B<T> {\n" +
+ " abstract class A {}\n" +
+ " public void foo() {\n" +
+ " new /*start*/A/*end*/() {};\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}",
this.workingCopy,
false,
@@ -10479,13 +10479,13 @@ public class ASTConverter15JLS4Test extends ConverterTestSetup {
String contents =
"package test0321;\n" +
"import java.util.*;\n" +
- "class X {\n" +
- " <T extends Collection<? extends Number>> T getLonger(T t1, T t2) {\n" +
- " return t1.size() > t2.size() ? t1 : t2;\n" +
- " }\n" +
- " void m(HashSet<? extends Double> list, ArrayList<? extends Integer> set) {\n" +
- " /*start*/getLonger(list, set)/*end*/;\n" +
- " }\n" +
+ "class X {\n" +
+ " <T extends Collection<? extends Number>> T getLonger(T t1, T t2) {\n" +
+ " return t1.size() > t2.size() ? t1 : t2;\n" +
+ " }\n" +
+ " void m(HashSet<? extends Double> list, ArrayList<? extends Integer> set) {\n" +
+ " /*start*/getLonger(list, set)/*end*/;\n" +
+ " }\n" +
"}";
this.workingCopy = getWorkingCopy(
"/Converter15/src/test0321/X.java",
@@ -10502,17 +10502,17 @@ public class ASTConverter15JLS4Test extends ConverterTestSetup {
public void test0322() throws JavaModelException {
String contents =
"package test0322;\n" +
- "@interface Range {\n" +
- " long min() default -9223372036854775808L;\n" +
- " long max() default 9223372036854775807L;\n" +
- " String message() default \"\";\n" +
- "}\n" +
- "public class X {\n" +
- " private int id;\n" +
- " /*start*/@Range(max=9999999999999999)/*end*/\n" +
- " public long getId() {\n" +
- " return id;\n" +
- " }\n" +
+ "@interface Range {\n" +
+ " long min() default -9223372036854775808L;\n" +
+ " long max() default 9223372036854775807L;\n" +
+ " String message() default \"\";\n" +
+ "}\n" +
+ "public class X {\n" +
+ " private int id;\n" +
+ " /*start*/@Range(max=9999999999999999)/*end*/\n" +
+ " public long getId() {\n" +
+ " return id;\n" +
+ " }\n" +
"}";
this.workingCopy = getWorkingCopy(
"/Converter15/src/test0322/X.java",
@@ -10530,20 +10530,20 @@ public class ASTConverter15JLS4Test extends ConverterTestSetup {
*/
public void test0323() throws JavaModelException {
String contents =
- "class X {\n" +
- " {\n" +
+ "class X {\n" +
+ " {\n" +
" for(Object obj:\n" +
" new Object[]{\n" +
- " new Object(){\n" +
+ " new Object(){\n" +
" int field=method(\n" +
- " });\n" +
+ " });\n" +
" }\n" +
- " });\n" +
- " }\n" +
+ " });\n" +
+ " }\n" +
" int method(int...args){\n" +
" return args.length;\n" +
- " }\n" +
- "}\n" +
+ " }\n" +
+ "}\n" +
"";
this.workingCopy = getWorkingCopy(
"/Converter15/src/test0322/X.java",
@@ -10570,7 +10570,7 @@ public class ASTConverter15JLS4Test extends ConverterTestSetup {
ParenthesizedExpression newParenthesizedExpression = (ParenthesizedExpression) ASTNode.copySubtree(
intValueReceiver.getAST(), intValueReceiver);
replaceNodeInParent(methodCall, newParenthesizedExpression);
-
+
// copied node
ClassInstanceCreation constructorCall = (ClassInstanceCreation) newParenthesizedExpression.getExpression();
constructorCall.resolveTypeBinding();
@@ -10667,16 +10667,16 @@ public class ASTConverter15JLS4Test extends ConverterTestSetup {
*/
public void test0329() throws JavaModelException {
String contents =
- "package test0329;\n" +
- "@JoinTable(\n" +
- " name=\"EMP_PROJ\",\n" +
- " joinColumns = {\n" +
- " @JoinColumn(name = \"EMP_ID\", referencedColumnName = \"EMP_ID\")\n" +
- " },\n" +
- " inverseJoinColumns = {\n" +
- " @JoinColumn(name = \"PROJ_ID\", referencedColumnName = \"PROJ_ID\")\n" +
+ "package test0329;\n" +
+ "@JoinTable(\n" +
+ " name=\"EMP_PROJ\",\n" +
+ " joinColumns = {\n" +
+ " @JoinColumn(name = \"EMP_ID\", referencedColumnName = \"EMP_ID\")\n" +
+ " },\n" +
+ " inverseJoinColumns = {\n" +
+ " @JoinColumn(name = \"PROJ_ID\", referencedColumnName = \"PROJ_ID\")\n" +
" }\n" +
- ")\n" +
+ ")\n" +
"public class X {}";
this.workingCopy = getWorkingCopy(
"/Converter15/src/test0329/X.java",
@@ -10706,12 +10706,12 @@ public class ASTConverter15JLS4Test extends ConverterTestSetup {
*/
public void test0331() throws JavaModelException {
String contents =
- "package test0331;\n" +
- "@JoinTable(\n" +
- " name=\"EMP_PROJ\",\n" +
- " joinColumns = @JoinColumn(name = \"EMP_ID\", referencedColumnName = \"EMP_ID\"),\n" +
+ "package test0331;\n" +
+ "@JoinTable(\n" +
+ " name=\"EMP_PROJ\",\n" +
+ " joinColumns = @JoinColumn(name = \"EMP_ID\", referencedColumnName = \"EMP_ID\"),\n" +
" inverseJoinColumns = @JoinColumn(name = \"PROJ_ID\", referencedColumnName = \"PROJ_ID\")\n" +
- ")\n" +
+ ")\n" +
"public class X {}";
this.workingCopy = getWorkingCopy(
"/Converter15/src/test0331/X.java",
@@ -10867,18 +10867,18 @@ public class ASTConverter15JLS4Test extends ConverterTestSetup {
*/
public void test0337() throws JavaModelException {
String contents =
- "public class X {\n" +
- " void m() {\n" +
- " int x= 1 ;\n" +
- " int y= - 1 , z=0 ;\n" +
- " // Assignment nodes too long:\n" +
- " int a= x = 2 ;\n" +
- " System.out.print( x=1 );\n" +
- " java.util.Arrays.asList( x = 1 /*bla*/ , x= 2\n" +
- " // comment \n" +
- " );\n" +
- " }\n" +
- "}\n" +
+ "public class X {\n" +
+ " void m() {\n" +
+ " int x= 1 ;\n" +
+ " int y= - 1 , z=0 ;\n" +
+ " // Assignment nodes too long:\n" +
+ " int a= x = 2 ;\n" +
+ " System.out.print( x=1 );\n" +
+ " java.util.Arrays.asList( x = 1 /*bla*/ , x= 2\n" +
+ " // comment \n" +
+ " );\n" +
+ " }\n" +
+ "}\n" +
"";
this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/);
CompilationUnit unit= (CompilationUnit) buildAST(
@@ -10908,11 +10908,11 @@ public class ASTConverter15JLS4Test extends ConverterTestSetup {
*/
public void test0338() throws JavaModelException {
String contents =
- "/**\n" +
- " * The first enum value for my enum.\n" +
- " *\n" +
- " * @enum myEnum\n" +
- " */\n" +
+ "/**\n" +
+ " * The first enum value for my enum.\n" +
+ " *\n" +
+ " * @enum myEnum\n" +
+ " */\n" +
"public class X {}";
this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/);
CompilationUnit unit= (CompilationUnit) buildAST(
@@ -10932,11 +10932,11 @@ public class ASTConverter15JLS4Test extends ConverterTestSetup {
*/
public void test0339() throws JavaModelException {
String contents =
- "/**\n" +
- " * Use const as a tag element name.\n" +
- " *\n" +
- " * @const new constant\n" +
- " */\n" +
+ "/**\n" +
+ " * Use const as a tag element name.\n" +
+ " *\n" +
+ " * @const new constant\n" +
+ " */\n" +
"public class X {}";
this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/);
CompilationUnit unit= (CompilationUnit) buildAST(
@@ -10956,11 +10956,11 @@ public class ASTConverter15JLS4Test extends ConverterTestSetup {
*/
public void test0340() throws JavaModelException {
String contents =
- "/**\n" +
- " * Use the goto as a tag element name.\n" +
- " *\n" +
- " * @goto new position\n" +
- " */\n" +
+ "/**\n" +
+ " * Use the goto as a tag element name.\n" +
+ " *\n" +
+ " * @goto new position\n" +
+ " */\n" +
"public class X {}";
this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/);
CompilationUnit unit= (CompilationUnit) buildAST(
@@ -11055,56 +11055,56 @@ public class ASTConverter15JLS4Test extends ConverterTestSetup {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=223225
public void test344() throws JavaModelException {
String contents =
- "public class X {\n" +
- " private @interface Strings {\n" +
- " String[] value() default \"default element\";\n" +
- " }\n" +
- " private @interface Annot {\n" +
- " String[] value();\n" +
- " }\n" +
- " private @interface Annot2 {\n" +
- " String value();\n" +
- " }\n" +
- " private @interface Annot3 {\n" +
- " Class<?> value();\n" +
- " }\n" +
- " @Strings\n" +
- " public void marker() {\n" +
- " // nothing\n" +
- " }\n" +
- " @Strings(\"single element\")\n" +
- " public void single() {\n" +
- " // nothing\n" +
- " }\n" +
- " @Strings(value = \"single element\")\n" +
- " public void singleValue() {\n" +
- " // nothing\n" +
- " }\n" +
- " @Strings({\"single element\"})\n" +
- " public void singleArray() {\n" +
- " // nothing\n" +
- " }\n" +
- " @Strings(value = {\"single element\"})\n" +
- " public void singleArrayValue() {\n" +
- " // nothing\n" +
- " }\n" +
- " @Strings({\"one\", \"two\", \"three\"})\n" +
- " public void multi() {\n" +
- " // nothing\n" +
- " }\n" +
- " @Strings(value = {\"one\", \"two\", \"three\"})\n" +
- " public void multiValue() {\n" +
- " // nothing\n" +
- " }\n" +
- " @Annot(\"test\")\n" +
- " public void singleValue2() {\n" +
- " // nothing\n" +
- " }\n" +
+ "public class X {\n" +
+ " private @interface Strings {\n" +
+ " String[] value() default \"default element\";\n" +
+ " }\n" +
+ " private @interface Annot {\n" +
+ " String[] value();\n" +
+ " }\n" +
+ " private @interface Annot2 {\n" +
+ " String value();\n" +
+ " }\n" +
+ " private @interface Annot3 {\n" +
+ " Class<?> value();\n" +
+ " }\n" +
+ " @Strings\n" +
+ " public void marker() {\n" +
+ " // nothing\n" +
+ " }\n" +
+ " @Strings(\"single element\")\n" +
+ " public void single() {\n" +
+ " // nothing\n" +
+ " }\n" +
+ " @Strings(value = \"single element\")\n" +
+ " public void singleValue() {\n" +
+ " // nothing\n" +
+ " }\n" +
+ " @Strings({\"single element\"})\n" +
+ " public void singleArray() {\n" +
+ " // nothing\n" +
+ " }\n" +
+ " @Strings(value = {\"single element\"})\n" +
+ " public void singleArrayValue() {\n" +
+ " // nothing\n" +
+ " }\n" +
+ " @Strings({\"one\", \"two\", \"three\"})\n" +
+ " public void multi() {\n" +
+ " // nothing\n" +
+ " }\n" +
+ " @Strings(value = {\"one\", \"two\", \"three\"})\n" +
+ " public void multiValue() {\n" +
+ " // nothing\n" +
+ " }\n" +
+ " @Annot(\"test\")\n" +
+ " public void singleValue2() {\n" +
+ " // nothing\n" +
+ " }\n" +
" @Annot2(\"test\")\n" +
- " @Annot3(Object.class)\n" +
- " public void singleValue3() {\n" +
- " // nothing\n" +
- " }\n" +
+ " @Annot3(Object.class)\n" +
+ " public void singleValue3() {\n" +
+ " // nothing\n" +
+ " }\n" +
"}";
this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/);
CompilationUnit unit= (CompilationUnit) buildAST(
@@ -11183,9 +11183,9 @@ public class ASTConverter15JLS4Test extends ConverterTestSetup {
public void test0345() throws JavaModelException {
this.workingCopy = getWorkingCopy("/Converter15/src/test0345/X.java", true/*resolve*/);
String contents =
- "package test0345;\n" +
- "public class X extends A {\n" +
- " /*start*/@Test(groups = NAME)/*end*/ int i;\n" +
+ "package test0345;\n" +
+ "public class X extends A {\n" +
+ " /*start*/@Test(groups = NAME)/*end*/ int i;\n" +
"}";
NormalAnnotation annotation = (NormalAnnotation) buildAST(
contents,
@@ -11203,9 +11203,9 @@ public class ASTConverter15JLS4Test extends ConverterTestSetup {
public void test0346() throws JavaModelException {
this.workingCopy = getWorkingCopy("/Converter15/src/test0346/X.java", true/*resolve*/);
String contents =
- "package test0346;\n" +
- "public class X extends A {\n" +
- " /*start*/@Test(groups = NAME)/*end*/ int i;\n" +
+ "package test0346;\n" +
+ "public class X extends A {\n" +
+ " /*start*/@Test(groups = NAME)/*end*/ int i;\n" +
"}";
NormalAnnotation annotation = (NormalAnnotation) buildAST(
contents,
@@ -11224,12 +11224,12 @@ public class ASTConverter15JLS4Test extends ConverterTestSetup {
public void test0347() throws JavaModelException {
this.workingCopy = getWorkingCopy("/Converter15/src/test0347/X.java", true/*resolve*/);
String contents =
- "package test0347;\n" +
- "public class X implements One</*start*/Outer<Integer>.Inner<Double>[]/*end*/> {\n" +
- "}\n" +
- "interface One<T> {}\n" +
- "class Outer<T> {\n" +
- " public class Inner<S> {}\n" +
+ "package test0347;\n" +
+ "public class X implements One</*start*/Outer<Integer>.Inner<Double>[]/*end*/> {\n" +
+ "}\n" +
+ "interface One<T> {}\n" +
+ "class Outer<T> {\n" +
+ " public class Inner<S> {}\n" +
"}";
ArrayType type = (ArrayType) buildAST(
contents,
@@ -11288,7 +11288,7 @@ public class ASTConverter15JLS4Test extends ConverterTestSetup {
}
}
}
-
+
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=334119
* Ensures that dollar in a type name is not confused as the starting of member type
@@ -11306,7 +11306,7 @@ public class ASTConverter15JLS4Test extends ConverterTestSetup {
"Lp/X$Y;", // should not be Lp/X$Y-X$Y;
binding.getKey());
}
-
+
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=334119
* Ensures that dollar in a type name is not confused as the starting of member type
@@ -11330,11 +11330,11 @@ public class ASTConverter15JLS4Test extends ConverterTestSetup {
public void test0349() throws JavaModelException {
String contents =
"import java.util.*;\n" +
- "public class X {\n" +
- " public static Object foo() {\n" +
+ "public class X {\n" +
+ " public static Object foo() {\n" +
" List<String> l = new ArrayList<>();\n" +
" return l;\n" +
- " }\n" +
+ " }\n" +
"}";
this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/);
CompilationUnit unit = (CompilationUnit) buildAST(
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15JLS8Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15JLS8Test.java
index 942eaaf0e..e28436922 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15JLS8Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15JLS8Test.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 bug 186342 - [compiler][null] Using annotations for null checking
@@ -72,7 +72,7 @@ public class ASTConverter15JLS8Test extends ConverterTestSetup {
public void test234609() throws JavaModelException {
String newContents = "package p;\n" +
- "import java.util.HashMap;\n" +
+ "import java.util.HashMap;\n" +
"public class X {\n" +
" /*start*/HashMap<? extends Integer,? super String>/*end*/ s;" +
"}";
@@ -110,7 +110,7 @@ public class ASTConverter15JLS8Test extends ConverterTestSetup {
},
getJavaProject("Converter15")
);
-
+
if (bindingFromKey.length != 1)
fail("Problem in going from key to binding\n");
if (!composedBindingKey.equals(bindingFromKey[0].getKey()))
@@ -120,27 +120,27 @@ public class ASTConverter15JLS8Test extends ConverterTestSetup {
fail("Bad signature");
assertTrue("Equals", bindingFromKey[0].isEqualTo(bindingFromAST));
-
+
// check existence of getGenericType() API.
ITypeBinding gType = bindingFromAST.getTypeArguments()[0].getGenericTypeOfWildcardType();
if (gType == null)
fail("Missing generic type");
if (!gType.getKey().equals("Ljava/util/HashMap<TK;TV;>;"))
fail("getKey() API is broken");
-
+
// test for getRank API.
if (bindingFromAST.getTypeArguments()[0].getRank() != 0)
fail ("Wrong rank");
-
+
if (bindingFromAST.getTypeArguments()[1].getRank() != 1)
- fail ("Wrong rank");
+ fail ("Wrong rank");
}
// Similar test as above - variation in wildcard type being unbounded.
public void test234609b() throws JavaModelException {
String newContents = "package p;\n" +
- "import java.util.ArrayList;\n" +
+ "import java.util.ArrayList;\n" +
"public class X {\n" +
" /*start*/ArrayList<?>/*end*/ s;" +
"}";
@@ -156,7 +156,7 @@ public class ASTConverter15JLS8Test extends ConverterTestSetup {
String genericTypeKey = BindingKey.createTypeBindingKey("java.util.ArrayList");
String [] wildcardKeys = new String [] { BindingKey.createWildcardTypeBindingKey(genericTypeKey, Signature.C_STAR, null, 0) };
-
+
String composedBindingKey = BindingKey.createParameterizedTypeBindingKey(genericTypeKey, wildcardKeys);
if (!composedBindingKey.equals(recoveredBindingKey))
@@ -176,7 +176,7 @@ public class ASTConverter15JLS8Test extends ConverterTestSetup {
},
getJavaProject("Converter15")
);
-
+
if (bindingFromKey.length != 1)
fail("Problem in going from key to binding\n");
if (!composedBindingKey.equals(bindingFromKey[0].getKey()))
@@ -186,7 +186,7 @@ public class ASTConverter15JLS8Test extends ConverterTestSetup {
fail("Bad signature");
assertTrue("Equals", bindingFromKey[0].isEqualTo(bindingFromAST));
}
-
+
public void test0001() throws JavaModelException {
ICompilationUnit sourceUnit = getCompilationUnit("Converter15" , "src", "test0001", "X.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
char[] source = sourceUnit.getSource().toCharArray();
@@ -666,7 +666,7 @@ public class ASTConverter15JLS8Test extends ConverterTestSetup {
assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.COMPILATION_UNIT);
CompilationUnit compilationUnit = (CompilationUnit) result;
String expectedProblems =
- "Pair is a raw type. References to generic type Pair<A,B> should be parameterized\n" +
+ "Pair is a raw type. References to generic type Pair<A,B> should be parameterized\n" +
"Pair is a raw type. References to generic type Pair<A,B> should be parameterized";
assertProblemsSize(compilationUnit, 2, expectedProblems);
ASTNode node = getASTNode(compilationUnit, 0, 5);
@@ -893,7 +893,7 @@ public class ASTConverter15JLS8Test extends ConverterTestSetup {
assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.COMPILATION_UNIT);
CompilationUnit compilationUnit = (CompilationUnit) result;
String expectedProblems =
- "Pair is a raw type. References to generic type Pair<A,B> should be parameterized\n" +
+ "Pair is a raw type. References to generic type Pair<A,B> should be parameterized\n" +
"Pair is a raw type. References to generic type Pair<A,B> should be parameterized";
assertProblemsSize(compilationUnit, 2, expectedProblems);
ASTNode node = getASTNode(compilationUnit, 0, 5);
@@ -3257,12 +3257,12 @@ public class ASTConverter15JLS8Test extends ConverterTestSetup {
"}";
this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/);
this.workingCopy.getBuffer().setContents(contents.toCharArray());
- ASTNode node = runConversion(getJLS8(), this.workingCopy, true);
+ ASTNode node = runConversion(getJLS8(), this.workingCopy, true);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
CompilationUnit compilationUnit = (CompilationUnit) node;
String expectedOutput = "Dead code";
assertProblemsSize(compilationUnit, 1, expectedOutput);
-
+
node = getASTNode(compilationUnit, 0, 0, 0);
assertEquals("Not an assert statement", ASTNode.ASSERT_STATEMENT, node.getNodeType());
AssertStatement assertStatement = (AssertStatement) node;
@@ -10353,15 +10353,15 @@ public class ASTConverter15JLS8Test extends ConverterTestSetup {
this.workingCopy = getWorkingCopy("/Converter15/src/test0316/X.java", true/*resolve*/);
ClassInstanceCreation expression = (ClassInstanceCreation) buildAST(
"package test0316;\n" +
- "class AbstractClass {\n" +
- " XXList<Class> statements = null;\n" +
- "}\n" +
+ "class AbstractClass {\n" +
+ " XXList<Class> statements = null;\n" +
+ "}\n" +
"import java.util.ArrayList;\n" +
- "public class X extends AbstractClass {\n" +
- " public List<Class> compute() {\n" +
- " statements = /*start*/new ArrayList<Class>()/*end*/;\n" +
- " return statements;\n" +
- " }\n" +
+ "public class X extends AbstractClass {\n" +
+ " public List<Class> compute() {\n" +
+ " statements = /*start*/new ArrayList<Class>()/*end*/;\n" +
+ " return statements;\n" +
+ " }\n" +
"}",
this.workingCopy,
false,
@@ -10377,14 +10377,14 @@ public class ASTConverter15JLS8Test extends ConverterTestSetup {
this.workingCopy = getWorkingCopy("/Converter15/src/test0317/X.java", true/*resolve*/);
ClassInstanceCreation expression = (ClassInstanceCreation) buildAST(
"package test0317;\n" +
- "import java.util.ArrayList;\n" +
- "import java.util.List;\n" +
- "public class X {\n" +
- " XXList<Class> statements = null;\n" +
- " public List<Class> compute() {\n" +
- " statements = /*start*/new ArrayList<Class>()/*end*/;\n" +
- " return statements;\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "public class X {\n" +
+ " XXList<Class> statements = null;\n" +
+ " public List<Class> compute() {\n" +
+ " statements = /*start*/new ArrayList<Class>()/*end*/;\n" +
+ " return statements;\n" +
+ " }\n" +
"}",
this.workingCopy,
false,
@@ -10399,15 +10399,15 @@ public class ASTConverter15JLS8Test extends ConverterTestSetup {
public void test0318() throws JavaModelException {
this.workingCopy = getWorkingCopy("/Converter15/src/test0317/X.java", true/*resolve*/);
SimpleType type = (SimpleType) buildAST(
- "class X {\n" +
- " {\n" +
- " abstract class B<T> {\n" +
- " abstract class A {}\n" +
- " public void foo() {\n" +
- " new /*start*/A/*end*/() {};\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "class X {\n" +
+ " {\n" +
+ " abstract class B<T> {\n" +
+ " abstract class A {}\n" +
+ " public void foo() {\n" +
+ " new /*start*/A/*end*/() {};\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}",
this.workingCopy,
false,
@@ -10467,13 +10467,13 @@ public class ASTConverter15JLS8Test extends ConverterTestSetup {
String contents =
"package test0321;\n" +
"import java.util.*;\n" +
- "class X {\n" +
- " <T extends Collection<? extends Number>> T getLonger(T t1, T t2) {\n" +
- " return t1.size() > t2.size() ? t1 : t2;\n" +
- " }\n" +
- " void m(HashSet<? extends Double> list, ArrayList<? extends Integer> set) {\n" +
- " /*start*/getLonger(list, set)/*end*/;\n" +
- " }\n" +
+ "class X {\n" +
+ " <T extends Collection<? extends Number>> T getLonger(T t1, T t2) {\n" +
+ " return t1.size() > t2.size() ? t1 : t2;\n" +
+ " }\n" +
+ " void m(HashSet<? extends Double> list, ArrayList<? extends Integer> set) {\n" +
+ " /*start*/getLonger(list, set)/*end*/;\n" +
+ " }\n" +
"}";
this.workingCopy = getWorkingCopy(
"/Converter15/src/test0321/X.java",
@@ -10490,17 +10490,17 @@ public class ASTConverter15JLS8Test extends ConverterTestSetup {
public void test0322() throws JavaModelException {
String contents =
"package test0322;\n" +
- "@interface Range {\n" +
- " long min() default -9223372036854775808L;\n" +
- " long max() default 9223372036854775807L;\n" +
- " String message() default \"\";\n" +
- "}\n" +
- "public class X {\n" +
- " private int id;\n" +
- " /*start*/@Range(max=9999999999999999)/*end*/\n" +
- " public long getId() {\n" +
- " return id;\n" +
- " }\n" +
+ "@interface Range {\n" +
+ " long min() default -9223372036854775808L;\n" +
+ " long max() default 9223372036854775807L;\n" +
+ " String message() default \"\";\n" +
+ "}\n" +
+ "public class X {\n" +
+ " private int id;\n" +
+ " /*start*/@Range(max=9999999999999999)/*end*/\n" +
+ " public long getId() {\n" +
+ " return id;\n" +
+ " }\n" +
"}";
this.workingCopy = getWorkingCopy(
"/Converter15/src/test0322/X.java",
@@ -10518,20 +10518,20 @@ public class ASTConverter15JLS8Test extends ConverterTestSetup {
*/
public void test0323() throws JavaModelException {
String contents =
- "class X {\n" +
- " {\n" +
+ "class X {\n" +
+ " {\n" +
" for(Object obj:\n" +
" new Object[]{\n" +
- " new Object(){\n" +
+ " new Object(){\n" +
" int field=method(\n" +
- " });\n" +
+ " });\n" +
" }\n" +
- " });\n" +
- " }\n" +
+ " });\n" +
+ " }\n" +
" int method(int...args){\n" +
" return args.length;\n" +
- " }\n" +
- "}\n" +
+ " }\n" +
+ "}\n" +
"";
this.workingCopy = getWorkingCopy(
"/Converter15/src/test0322/X.java",
@@ -10558,7 +10558,7 @@ public class ASTConverter15JLS8Test extends ConverterTestSetup {
ParenthesizedExpression newParenthesizedExpression = (ParenthesizedExpression) ASTNode.copySubtree(
intValueReceiver.getAST(), intValueReceiver);
replaceNodeInParent(methodCall, newParenthesizedExpression);
-
+
// copied node
ClassInstanceCreation constructorCall = (ClassInstanceCreation) newParenthesizedExpression.getExpression();
constructorCall.resolveTypeBinding();
@@ -10655,16 +10655,16 @@ public class ASTConverter15JLS8Test extends ConverterTestSetup {
*/
public void test0329() throws JavaModelException {
String contents =
- "package test0329;\n" +
- "@JoinTable(\n" +
- " name=\"EMP_PROJ\",\n" +
- " joinColumns = {\n" +
- " @JoinColumn(name = \"EMP_ID\", referencedColumnName = \"EMP_ID\")\n" +
- " },\n" +
- " inverseJoinColumns = {\n" +
- " @JoinColumn(name = \"PROJ_ID\", referencedColumnName = \"PROJ_ID\")\n" +
+ "package test0329;\n" +
+ "@JoinTable(\n" +
+ " name=\"EMP_PROJ\",\n" +
+ " joinColumns = {\n" +
+ " @JoinColumn(name = \"EMP_ID\", referencedColumnName = \"EMP_ID\")\n" +
+ " },\n" +
+ " inverseJoinColumns = {\n" +
+ " @JoinColumn(name = \"PROJ_ID\", referencedColumnName = \"PROJ_ID\")\n" +
" }\n" +
- ")\n" +
+ ")\n" +
"public class X {}";
this.workingCopy = getWorkingCopy(
"/Converter15/src/test0329/X.java",
@@ -10694,12 +10694,12 @@ public class ASTConverter15JLS8Test extends ConverterTestSetup {
*/
public void test0331() throws JavaModelException {
String contents =
- "package test0331;\n" +
- "@JoinTable(\n" +
- " name=\"EMP_PROJ\",\n" +
- " joinColumns = @JoinColumn(name = \"EMP_ID\", referencedColumnName = \"EMP_ID\"),\n" +
+ "package test0331;\n" +
+ "@JoinTable(\n" +
+ " name=\"EMP_PROJ\",\n" +
+ " joinColumns = @JoinColumn(name = \"EMP_ID\", referencedColumnName = \"EMP_ID\"),\n" +
" inverseJoinColumns = @JoinColumn(name = \"PROJ_ID\", referencedColumnName = \"PROJ_ID\")\n" +
- ")\n" +
+ ")\n" +
"public class X {}";
this.workingCopy = getWorkingCopy(
"/Converter15/src/test0331/X.java",
@@ -10855,18 +10855,18 @@ public class ASTConverter15JLS8Test extends ConverterTestSetup {
*/
public void test0337() throws JavaModelException {
String contents =
- "public class X {\n" +
- " void m() {\n" +
- " int x= 1 ;\n" +
- " int y= - 1 , z=0 ;\n" +
- " // Assignment nodes too long:\n" +
- " int a= x = 2 ;\n" +
- " System.out.print( x=1 );\n" +
- " java.util.Arrays.asList( x = 1 /*bla*/ , x= 2\n" +
- " // comment \n" +
- " );\n" +
- " }\n" +
- "}\n" +
+ "public class X {\n" +
+ " void m() {\n" +
+ " int x= 1 ;\n" +
+ " int y= - 1 , z=0 ;\n" +
+ " // Assignment nodes too long:\n" +
+ " int a= x = 2 ;\n" +
+ " System.out.print( x=1 );\n" +
+ " java.util.Arrays.asList( x = 1 /*bla*/ , x= 2\n" +
+ " // comment \n" +
+ " );\n" +
+ " }\n" +
+ "}\n" +
"";
this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/);
CompilationUnit unit= (CompilationUnit) buildAST(
@@ -10896,11 +10896,11 @@ public class ASTConverter15JLS8Test extends ConverterTestSetup {
*/
public void test0338() throws JavaModelException {
String contents =
- "/**\n" +
- " * The first enum value for my enum.\n" +
- " *\n" +
- " * @enum myEnum\n" +
- " */\n" +
+ "/**\n" +
+ " * The first enum value for my enum.\n" +
+ " *\n" +
+ " * @enum myEnum\n" +
+ " */\n" +
"public class X {}";
this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/);
CompilationUnit unit= (CompilationUnit) buildAST(
@@ -10920,11 +10920,11 @@ public class ASTConverter15JLS8Test extends ConverterTestSetup {
*/
public void test0339() throws JavaModelException {
String contents =
- "/**\n" +
- " * Use const as a tag element name.\n" +
- " *\n" +
- " * @const new constant\n" +
- " */\n" +
+ "/**\n" +
+ " * Use const as a tag element name.\n" +
+ " *\n" +
+ " * @const new constant\n" +
+ " */\n" +
"public class X {}";
this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/);
CompilationUnit unit= (CompilationUnit) buildAST(
@@ -10944,11 +10944,11 @@ public class ASTConverter15JLS8Test extends ConverterTestSetup {
*/
public void test0340() throws JavaModelException {
String contents =
- "/**\n" +
- " * Use the goto as a tag element name.\n" +
- " *\n" +
- " * @goto new position\n" +
- " */\n" +
+ "/**\n" +
+ " * Use the goto as a tag element name.\n" +
+ " *\n" +
+ " * @goto new position\n" +
+ " */\n" +
"public class X {}";
this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/);
CompilationUnit unit= (CompilationUnit) buildAST(
@@ -11043,56 +11043,56 @@ public class ASTConverter15JLS8Test extends ConverterTestSetup {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=223225
public void test344() throws JavaModelException {
String contents =
- "public class X {\n" +
- " private @interface Strings {\n" +
- " String[] value() default \"default element\";\n" +
- " }\n" +
- " private @interface Annot {\n" +
- " String[] value();\n" +
- " }\n" +
- " private @interface Annot2 {\n" +
- " String value();\n" +
- " }\n" +
- " private @interface Annot3 {\n" +
- " Class<?> value();\n" +
- " }\n" +
- " @Strings\n" +
- " public void marker() {\n" +
- " // nothing\n" +
- " }\n" +
- " @Strings(\"single element\")\n" +
- " public void single() {\n" +
- " // nothing\n" +
- " }\n" +
- " @Strings(value = \"single element\")\n" +
- " public void singleValue() {\n" +
- " // nothing\n" +
- " }\n" +
- " @Strings({\"single element\"})\n" +
- " public void singleArray() {\n" +
- " // nothing\n" +
- " }\n" +
- " @Strings(value = {\"single element\"})\n" +
- " public void singleArrayValue() {\n" +
- " // nothing\n" +
- " }\n" +
- " @Strings({\"one\", \"two\", \"three\"})\n" +
- " public void multi() {\n" +
- " // nothing\n" +
- " }\n" +
- " @Strings(value = {\"one\", \"two\", \"three\"})\n" +
- " public void multiValue() {\n" +
- " // nothing\n" +
- " }\n" +
- " @Annot(\"test\")\n" +
- " public void singleValue2() {\n" +
- " // nothing\n" +
- " }\n" +
+ "public class X {\n" +
+ " private @interface Strings {\n" +
+ " String[] value() default \"default element\";\n" +
+ " }\n" +
+ " private @interface Annot {\n" +
+ " String[] value();\n" +
+ " }\n" +
+ " private @interface Annot2 {\n" +
+ " String value();\n" +
+ " }\n" +
+ " private @interface Annot3 {\n" +
+ " Class<?> value();\n" +
+ " }\n" +
+ " @Strings\n" +
+ " public void marker() {\n" +
+ " // nothing\n" +
+ " }\n" +
+ " @Strings(\"single element\")\n" +
+ " public void single() {\n" +
+ " // nothing\n" +
+ " }\n" +
+ " @Strings(value = \"single element\")\n" +
+ " public void singleValue() {\n" +
+ " // nothing\n" +
+ " }\n" +
+ " @Strings({\"single element\"})\n" +
+ " public void singleArray() {\n" +
+ " // nothing\n" +
+ " }\n" +
+ " @Strings(value = {\"single element\"})\n" +
+ " public void singleArrayValue() {\n" +
+ " // nothing\n" +
+ " }\n" +
+ " @Strings({\"one\", \"two\", \"three\"})\n" +
+ " public void multi() {\n" +
+ " // nothing\n" +
+ " }\n" +
+ " @Strings(value = {\"one\", \"two\", \"three\"})\n" +
+ " public void multiValue() {\n" +
+ " // nothing\n" +
+ " }\n" +
+ " @Annot(\"test\")\n" +
+ " public void singleValue2() {\n" +
+ " // nothing\n" +
+ " }\n" +
" @Annot2(\"test\")\n" +
- " @Annot3(Object.class)\n" +
- " public void singleValue3() {\n" +
- " // nothing\n" +
- " }\n" +
+ " @Annot3(Object.class)\n" +
+ " public void singleValue3() {\n" +
+ " // nothing\n" +
+ " }\n" +
"}";
this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/);
CompilationUnit unit= (CompilationUnit) buildAST(
@@ -11171,9 +11171,9 @@ public class ASTConverter15JLS8Test extends ConverterTestSetup {
public void test0345() throws JavaModelException {
this.workingCopy = getWorkingCopy("/Converter15/src/test0345/X.java", true/*resolve*/);
String contents =
- "package test0345;\n" +
- "public class X extends A {\n" +
- " /*start*/@Test(groups = NAME)/*end*/ int i;\n" +
+ "package test0345;\n" +
+ "public class X extends A {\n" +
+ " /*start*/@Test(groups = NAME)/*end*/ int i;\n" +
"}";
NormalAnnotation annotation = (NormalAnnotation) buildAST(
contents,
@@ -11191,9 +11191,9 @@ public class ASTConverter15JLS8Test extends ConverterTestSetup {
public void test0346() throws JavaModelException {
this.workingCopy = getWorkingCopy("/Converter15/src/test0346/X.java", true/*resolve*/);
String contents =
- "package test0346;\n" +
- "public class X extends A {\n" +
- " /*start*/@Test(groups = NAME)/*end*/ int i;\n" +
+ "package test0346;\n" +
+ "public class X extends A {\n" +
+ " /*start*/@Test(groups = NAME)/*end*/ int i;\n" +
"}";
NormalAnnotation annotation = (NormalAnnotation) buildAST(
contents,
@@ -11212,12 +11212,12 @@ public class ASTConverter15JLS8Test extends ConverterTestSetup {
public void test0347() throws JavaModelException {
this.workingCopy = getWorkingCopy("/Converter15/src/test0347/X.java", true/*resolve*/);
String contents =
- "package test0347;\n" +
- "public class X implements One</*start*/Outer<Integer>.Inner<Double>[]/*end*/> {\n" +
- "}\n" +
- "interface One<T> {}\n" +
- "class Outer<T> {\n" +
- " public class Inner<S> {}\n" +
+ "package test0347;\n" +
+ "public class X implements One</*start*/Outer<Integer>.Inner<Double>[]/*end*/> {\n" +
+ "}\n" +
+ "interface One<T> {}\n" +
+ "class Outer<T> {\n" +
+ " public class Inner<S> {}\n" +
"}";
ArrayType type = (ArrayType) buildAST(
contents,
@@ -11276,7 +11276,7 @@ public class ASTConverter15JLS8Test extends ConverterTestSetup {
}
}
}
-
+
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=334119
* Ensures that dollar in a type name is not confused as the starting of member type
@@ -11294,7 +11294,7 @@ public class ASTConverter15JLS8Test extends ConverterTestSetup {
"Lp/X$Y;", // should not be Lp/X$Y-X$Y;
binding.getKey());
}
-
+
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=334119
* Ensures that dollar in a type name is not confused as the starting of member type
@@ -11318,11 +11318,11 @@ public class ASTConverter15JLS8Test extends ConverterTestSetup {
public void test0349() throws JavaModelException {
String contents =
"import java.util.*;\n" +
- "public class X {\n" +
- " public static Object foo() {\n" +
+ "public class X {\n" +
+ " public static Object foo() {\n" +
" List<String> l = new ArrayList<>();\n" +
" return l;\n" +
- " }\n" +
+ " }\n" +
"}";
this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/);
CompilationUnit unit = (CompilationUnit) buildAST(
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java
index b33268d5d..fbe9593f6 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java
@@ -10,7 +10,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Stephan Herrmann - Contributions for
+ * Stephan Herrmann - Contributions for
* Bug 342671 - ClassCastException: org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding cannot be cast to org.eclipse.jdt.internal.compiler.lookup.ArrayBinding
* Bug 353474 - type converters should include more annotations
* Bug 186342 - [compiler][null] Using annotations for null checking
@@ -44,7 +44,7 @@ import org.eclipse.jdt.core.tests.util.Util;
public class ASTConverter15Test extends ConverterTestSetup {
ICompilationUnit workingCopy;
-
+
public void setUpSuite() throws Exception {
super.setUpSuite();
this.ast = AST.newAST(getJLS3(), false);
@@ -89,7 +89,7 @@ public class ASTConverter15Test extends ConverterTestSetup {
public void test234609() throws JavaModelException {
String newContents = "package p;\n" +
- "import java.util.HashMap;\n" +
+ "import java.util.HashMap;\n" +
"public class X {\n" +
" /*start*/HashMap<? extends Integer,? super String>/*end*/ s;" +
"}";
@@ -127,7 +127,7 @@ public class ASTConverter15Test extends ConverterTestSetup {
},
getJavaProject("Converter15")
);
-
+
if (bindingFromKey.length != 1)
fail("Problem in going from key to binding\n");
if (!composedBindingKey.equals(bindingFromKey[0].getKey()))
@@ -137,27 +137,27 @@ public class ASTConverter15Test extends ConverterTestSetup {
fail("Bad signature");
assertTrue("Equals", bindingFromKey[0].isEqualTo(bindingFromAST));
-
+
// check existence of getGenericType() API.
ITypeBinding gType = bindingFromAST.getTypeArguments()[0].getGenericTypeOfWildcardType();
if (gType == null)
fail("Missing generic type");
if (!gType.getKey().equals("Ljava/util/HashMap<TK;TV;>;"))
fail("getKey() API is broken");
-
+
// test for getRank API.
if (bindingFromAST.getTypeArguments()[0].getRank() != 0)
fail ("Wrong rank");
-
+
if (bindingFromAST.getTypeArguments()[1].getRank() != 1)
- fail ("Wrong rank");
+ fail ("Wrong rank");
}
// Similar test as above - variation in wildcard type being unbounded.
public void test234609b() throws JavaModelException {
String newContents = "package p;\n" +
- "import java.util.ArrayList;\n" +
+ "import java.util.ArrayList;\n" +
"public class X {\n" +
" /*start*/ArrayList<?>/*end*/ s;" +
"}";
@@ -173,7 +173,7 @@ public class ASTConverter15Test extends ConverterTestSetup {
String genericTypeKey = BindingKey.createTypeBindingKey("java.util.ArrayList");
String [] wildcardKeys = new String [] { BindingKey.createWildcardTypeBindingKey(genericTypeKey, Signature.C_STAR, null, 0) };
-
+
String composedBindingKey = BindingKey.createParameterizedTypeBindingKey(genericTypeKey, wildcardKeys);
if (!composedBindingKey.equals(recoveredBindingKey))
@@ -193,7 +193,7 @@ public class ASTConverter15Test extends ConverterTestSetup {
},
getJavaProject("Converter15")
);
-
+
if (bindingFromKey.length != 1)
fail("Problem in going from key to binding\n");
if (!composedBindingKey.equals(bindingFromKey[0].getKey()))
@@ -203,7 +203,7 @@ public class ASTConverter15Test extends ConverterTestSetup {
fail("Bad signature");
assertTrue("Equals", bindingFromKey[0].isEqualTo(bindingFromAST));
}
-
+
public void test0001() throws JavaModelException {
ICompilationUnit sourceUnit = getCompilationUnit("Converter15" , "src", "test0001", "X.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
char[] source = sourceUnit.getSource().toCharArray();
@@ -683,7 +683,7 @@ public class ASTConverter15Test extends ConverterTestSetup {
assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.COMPILATION_UNIT);
CompilationUnit compilationUnit = (CompilationUnit) result;
String expectedProblems =
- "Pair is a raw type. References to generic type Pair<A,B> should be parameterized\n" +
+ "Pair is a raw type. References to generic type Pair<A,B> should be parameterized\n" +
"Pair is a raw type. References to generic type Pair<A,B> should be parameterized";
assertProblemsSize(compilationUnit, 2, expectedProblems);
ASTNode node = getASTNode(compilationUnit, 0, 5);
@@ -910,7 +910,7 @@ public class ASTConverter15Test extends ConverterTestSetup {
assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.COMPILATION_UNIT);
CompilationUnit compilationUnit = (CompilationUnit) result;
String expectedProblems =
- "Pair is a raw type. References to generic type Pair<A,B> should be parameterized\n" +
+ "Pair is a raw type. References to generic type Pair<A,B> should be parameterized\n" +
"Pair is a raw type. References to generic type Pair<A,B> should be parameterized";
assertProblemsSize(compilationUnit, 2, expectedProblems);
ASTNode node = getASTNode(compilationUnit, 0, 5);
@@ -3280,12 +3280,12 @@ public class ASTConverter15Test extends ConverterTestSetup {
"}";
this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/);
this.workingCopy.getBuffer().setContents(contents.toCharArray());
- ASTNode node = runConversion(getJLS3(), this.workingCopy, true);
+ ASTNode node = runConversion(getJLS3(), this.workingCopy, true);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
CompilationUnit compilationUnit = (CompilationUnit) node;
String expectedOutput = "Dead code";
assertProblemsSize(compilationUnit, 1, expectedOutput);
-
+
node = getASTNode(compilationUnit, 0, 0, 0);
assertEquals("Not an assert statement", ASTNode.ASSERT_STATEMENT, node.getNodeType());
AssertStatement assertStatement = (AssertStatement) node;
@@ -10376,15 +10376,15 @@ public class ASTConverter15Test extends ConverterTestSetup {
this.workingCopy = getWorkingCopy("/Converter15/src/test0316/X.java", true/*resolve*/);
ClassInstanceCreation expression = (ClassInstanceCreation) buildAST(
"package test0316;\n" +
- "class AbstractClass {\n" +
- " XXList<Class> statements = null;\n" +
- "}\n" +
+ "class AbstractClass {\n" +
+ " XXList<Class> statements = null;\n" +
+ "}\n" +
"import java.util.ArrayList;\n" +
- "public class X extends AbstractClass {\n" +
- " public List<Class> compute() {\n" +
- " statements = /*start*/new ArrayList<Class>()/*end*/;\n" +
- " return statements;\n" +
- " }\n" +
+ "public class X extends AbstractClass {\n" +
+ " public List<Class> compute() {\n" +
+ " statements = /*start*/new ArrayList<Class>()/*end*/;\n" +
+ " return statements;\n" +
+ " }\n" +
"}",
this.workingCopy,
false,
@@ -10400,14 +10400,14 @@ public class ASTConverter15Test extends ConverterTestSetup {
this.workingCopy = getWorkingCopy("/Converter15/src/test0317/X.java", true/*resolve*/);
ClassInstanceCreation expression = (ClassInstanceCreation) buildAST(
"package test0317;\n" +
- "import java.util.ArrayList;\n" +
- "import java.util.List;\n" +
- "public class X {\n" +
- " XXList<Class> statements = null;\n" +
- " public List<Class> compute() {\n" +
- " statements = /*start*/new ArrayList<Class>()/*end*/;\n" +
- " return statements;\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "public class X {\n" +
+ " XXList<Class> statements = null;\n" +
+ " public List<Class> compute() {\n" +
+ " statements = /*start*/new ArrayList<Class>()/*end*/;\n" +
+ " return statements;\n" +
+ " }\n" +
"}",
this.workingCopy,
false,
@@ -10422,15 +10422,15 @@ public class ASTConverter15Test extends ConverterTestSetup {
public void test0318() throws JavaModelException {
this.workingCopy = getWorkingCopy("/Converter15/src/test0317/X.java", true/*resolve*/);
SimpleType type = (SimpleType) buildAST(
- "class X {\n" +
- " {\n" +
- " abstract class B<T> {\n" +
- " abstract class A {}\n" +
- " public void foo() {\n" +
- " new /*start*/A/*end*/() {};\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "class X {\n" +
+ " {\n" +
+ " abstract class B<T> {\n" +
+ " abstract class A {}\n" +
+ " public void foo() {\n" +
+ " new /*start*/A/*end*/() {};\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}",
this.workingCopy,
false,
@@ -10490,13 +10490,13 @@ public class ASTConverter15Test extends ConverterTestSetup {
String contents =
"package test0321;\n" +
"import java.util.*;\n" +
- "class X {\n" +
- " <T extends Collection<? extends Number>> T getLonger(T t1, T t2) {\n" +
- " return t1.size() > t2.size() ? t1 : t2;\n" +
- " }\n" +
- " void m(HashSet<? extends Double> list, ArrayList<? extends Integer> set) {\n" +
- " /*start*/getLonger(list, set)/*end*/;\n" +
- " }\n" +
+ "class X {\n" +
+ " <T extends Collection<? extends Number>> T getLonger(T t1, T t2) {\n" +
+ " return t1.size() > t2.size() ? t1 : t2;\n" +
+ " }\n" +
+ " void m(HashSet<? extends Double> list, ArrayList<? extends Integer> set) {\n" +
+ " /*start*/getLonger(list, set)/*end*/;\n" +
+ " }\n" +
"}";
this.workingCopy = getWorkingCopy(
"/Converter15/src/test0321/X.java",
@@ -10513,17 +10513,17 @@ public class ASTConverter15Test extends ConverterTestSetup {
public void test0322() throws JavaModelException {
String contents =
"package test0322;\n" +
- "@interface Range {\n" +
- " long min() default -9223372036854775808L;\n" +
- " long max() default 9223372036854775807L;\n" +
- " String message() default \"\";\n" +
- "}\n" +
- "public class X {\n" +
- " private int id;\n" +
- " /*start*/@Range(max=9999999999999999)/*end*/\n" +
- " public long getId() {\n" +
- " return id;\n" +
- " }\n" +
+ "@interface Range {\n" +
+ " long min() default -9223372036854775808L;\n" +
+ " long max() default 9223372036854775807L;\n" +
+ " String message() default \"\";\n" +
+ "}\n" +
+ "public class X {\n" +
+ " private int id;\n" +
+ " /*start*/@Range(max=9999999999999999)/*end*/\n" +
+ " public long getId() {\n" +
+ " return id;\n" +
+ " }\n" +
"}";
this.workingCopy = getWorkingCopy(
"/Converter15/src/test0322/X.java",
@@ -10541,20 +10541,20 @@ public class ASTConverter15Test extends ConverterTestSetup {
*/
public void test0323() throws JavaModelException {
String contents =
- "class X {\n" +
- " {\n" +
+ "class X {\n" +
+ " {\n" +
" for(Object obj:\n" +
" new Object[]{\n" +
- " new Object(){\n" +
+ " new Object(){\n" +
" int field=method(\n" +
- " });\n" +
+ " });\n" +
" }\n" +
- " });\n" +
- " }\n" +
+ " });\n" +
+ " }\n" +
" int method(int...args){\n" +
" return args.length;\n" +
- " }\n" +
- "}\n" +
+ " }\n" +
+ "}\n" +
"";
this.workingCopy = getWorkingCopy(
"/Converter15/src/test0322/X.java",
@@ -10581,7 +10581,7 @@ public class ASTConverter15Test extends ConverterTestSetup {
ParenthesizedExpression newParenthesizedExpression = (ParenthesizedExpression) ASTNode.copySubtree(
intValueReceiver.getAST(), intValueReceiver);
replaceNodeInParent(methodCall, newParenthesizedExpression);
-
+
// copied node
ClassInstanceCreation constructorCall = (ClassInstanceCreation) newParenthesizedExpression.getExpression();
constructorCall.resolveTypeBinding();
@@ -10678,16 +10678,16 @@ public class ASTConverter15Test extends ConverterTestSetup {
*/
public void test0329() throws JavaModelException {
String contents =
- "package test0329;\n" +
- "@JoinTable(\n" +
- " name=\"EMP_PROJ\",\n" +
- " joinColumns = {\n" +
- " @JoinColumn(name = \"EMP_ID\", referencedColumnName = \"EMP_ID\")\n" +
- " },\n" +
- " inverseJoinColumns = {\n" +
- " @JoinColumn(name = \"PROJ_ID\", referencedColumnName = \"PROJ_ID\")\n" +
+ "package test0329;\n" +
+ "@JoinTable(\n" +
+ " name=\"EMP_PROJ\",\n" +
+ " joinColumns = {\n" +
+ " @JoinColumn(name = \"EMP_ID\", referencedColumnName = \"EMP_ID\")\n" +
+ " },\n" +
+ " inverseJoinColumns = {\n" +
+ " @JoinColumn(name = \"PROJ_ID\", referencedColumnName = \"PROJ_ID\")\n" +
" }\n" +
- ")\n" +
+ ")\n" +
"public class X {}";
this.workingCopy = getWorkingCopy(
"/Converter15/src/test0329/X.java",
@@ -10717,12 +10717,12 @@ public class ASTConverter15Test extends ConverterTestSetup {
*/
public void test0331() throws JavaModelException {
String contents =
- "package test0331;\n" +
- "@JoinTable(\n" +
- " name=\"EMP_PROJ\",\n" +
- " joinColumns = @JoinColumn(name = \"EMP_ID\", referencedColumnName = \"EMP_ID\"),\n" +
+ "package test0331;\n" +
+ "@JoinTable(\n" +
+ " name=\"EMP_PROJ\",\n" +
+ " joinColumns = @JoinColumn(name = \"EMP_ID\", referencedColumnName = \"EMP_ID\"),\n" +
" inverseJoinColumns = @JoinColumn(name = \"PROJ_ID\", referencedColumnName = \"PROJ_ID\")\n" +
- ")\n" +
+ ")\n" +
"public class X {}";
this.workingCopy = getWorkingCopy(
"/Converter15/src/test0331/X.java",
@@ -10878,18 +10878,18 @@ public class ASTConverter15Test extends ConverterTestSetup {
*/
public void test0337() throws JavaModelException {
String contents =
- "public class X {\n" +
- " void m() {\n" +
- " int x= 1 ;\n" +
- " int y= - 1 , z=0 ;\n" +
- " // Assignment nodes too long:\n" +
- " int a= x = 2 ;\n" +
- " System.out.print( x=1 );\n" +
- " java.util.Arrays.asList( x = 1 /*bla*/ , x= 2\n" +
- " // comment \n" +
- " );\n" +
- " }\n" +
- "}\n" +
+ "public class X {\n" +
+ " void m() {\n" +
+ " int x= 1 ;\n" +
+ " int y= - 1 , z=0 ;\n" +
+ " // Assignment nodes too long:\n" +
+ " int a= x = 2 ;\n" +
+ " System.out.print( x=1 );\n" +
+ " java.util.Arrays.asList( x = 1 /*bla*/ , x= 2\n" +
+ " // comment \n" +
+ " );\n" +
+ " }\n" +
+ "}\n" +
"";
this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/);
CompilationUnit unit= (CompilationUnit) buildAST(
@@ -10919,11 +10919,11 @@ public class ASTConverter15Test extends ConverterTestSetup {
*/
public void test0338() throws JavaModelException {
String contents =
- "/**\n" +
- " * The first enum value for my enum.\n" +
- " *\n" +
- " * @enum myEnum\n" +
- " */\n" +
+ "/**\n" +
+ " * The first enum value for my enum.\n" +
+ " *\n" +
+ " * @enum myEnum\n" +
+ " */\n" +
"public class X {}";
this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/);
CompilationUnit unit= (CompilationUnit) buildAST(
@@ -10943,11 +10943,11 @@ public class ASTConverter15Test extends ConverterTestSetup {
*/
public void test0339() throws JavaModelException {
String contents =
- "/**\n" +
- " * Use const as a tag element name.\n" +
- " *\n" +
- " * @const new constant\n" +
- " */\n" +
+ "/**\n" +
+ " * Use const as a tag element name.\n" +
+ " *\n" +
+ " * @const new constant\n" +
+ " */\n" +
"public class X {}";
this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/);
CompilationUnit unit= (CompilationUnit) buildAST(
@@ -10967,11 +10967,11 @@ public class ASTConverter15Test extends ConverterTestSetup {
*/
public void test0340() throws JavaModelException {
String contents =
- "/**\n" +
- " * Use the goto as a tag element name.\n" +
- " *\n" +
- " * @goto new position\n" +
- " */\n" +
+ "/**\n" +
+ " * Use the goto as a tag element name.\n" +
+ " *\n" +
+ " * @goto new position\n" +
+ " */\n" +
"public class X {}";
this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/);
CompilationUnit unit= (CompilationUnit) buildAST(
@@ -11066,56 +11066,56 @@ public class ASTConverter15Test extends ConverterTestSetup {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=223225
public void test344() throws JavaModelException {
String contents =
- "public class X {\n" +
- " private @interface Strings {\n" +
- " String[] value() default \"default element\";\n" +
- " }\n" +
- " private @interface Annot {\n" +
- " String[] value();\n" +
- " }\n" +
- " private @interface Annot2 {\n" +
- " String value();\n" +
- " }\n" +
- " private @interface Annot3 {\n" +
- " Class<?> value();\n" +
- " }\n" +
- " @Strings\n" +
- " public void marker() {\n" +
- " // nothing\n" +
- " }\n" +
- " @Strings(\"single element\")\n" +
- " public void single() {\n" +
- " // nothing\n" +
- " }\n" +
- " @Strings(value = \"single element\")\n" +
- " public void singleValue() {\n" +
- " // nothing\n" +
- " }\n" +
- " @Strings({\"single element\"})\n" +
- " public void singleArray() {\n" +
- " // nothing\n" +
- " }\n" +
- " @Strings(value = {\"single element\"})\n" +
- " public void singleArrayValue() {\n" +
- " // nothing\n" +
- " }\n" +
- " @Strings({\"one\", \"two\", \"three\"})\n" +
- " public void multi() {\n" +
- " // nothing\n" +
- " }\n" +
- " @Strings(value = {\"one\", \"two\", \"three\"})\n" +
- " public void multiValue() {\n" +
- " // nothing\n" +
- " }\n" +
- " @Annot(\"test\")\n" +
- " public void singleValue2() {\n" +
- " // nothing\n" +
- " }\n" +
+ "public class X {\n" +
+ " private @interface Strings {\n" +
+ " String[] value() default \"default element\";\n" +
+ " }\n" +
+ " private @interface Annot {\n" +
+ " String[] value();\n" +
+ " }\n" +
+ " private @interface Annot2 {\n" +
+ " String value();\n" +
+ " }\n" +
+ " private @interface Annot3 {\n" +
+ " Class<?> value();\n" +
+ " }\n" +
+ " @Strings\n" +
+ " public void marker() {\n" +
+ " // nothing\n" +
+ " }\n" +
+ " @Strings(\"single element\")\n" +
+ " public void single() {\n" +
+ " // nothing\n" +
+ " }\n" +
+ " @Strings(value = \"single element\")\n" +
+ " public void singleValue() {\n" +
+ " // nothing\n" +
+ " }\n" +
+ " @Strings({\"single element\"})\n" +
+ " public void singleArray() {\n" +
+ " // nothing\n" +
+ " }\n" +
+ " @Strings(value = {\"single element\"})\n" +
+ " public void singleArrayValue() {\n" +
+ " // nothing\n" +
+ " }\n" +
+ " @Strings({\"one\", \"two\", \"three\"})\n" +
+ " public void multi() {\n" +
+ " // nothing\n" +
+ " }\n" +
+ " @Strings(value = {\"one\", \"two\", \"three\"})\n" +
+ " public void multiValue() {\n" +
+ " // nothing\n" +
+ " }\n" +
+ " @Annot(\"test\")\n" +
+ " public void singleValue2() {\n" +
+ " // nothing\n" +
+ " }\n" +
" @Annot2(\"test\")\n" +
- " @Annot3(Object.class)\n" +
- " public void singleValue3() {\n" +
- " // nothing\n" +
- " }\n" +
+ " @Annot3(Object.class)\n" +
+ " public void singleValue3() {\n" +
+ " // nothing\n" +
+ " }\n" +
"}";
this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/);
CompilationUnit unit= (CompilationUnit) buildAST(
@@ -11194,9 +11194,9 @@ public class ASTConverter15Test extends ConverterTestSetup {
public void test0345() throws JavaModelException {
this.workingCopy = getWorkingCopy("/Converter15/src/test0345/X.java", true/*resolve*/);
String contents =
- "package test0345;\n" +
- "public class X extends A {\n" +
- " /*start*/@Test(groups = NAME)/*end*/ int i;\n" +
+ "package test0345;\n" +
+ "public class X extends A {\n" +
+ " /*start*/@Test(groups = NAME)/*end*/ int i;\n" +
"}";
NormalAnnotation annotation = (NormalAnnotation) buildAST(
contents,
@@ -11214,9 +11214,9 @@ public class ASTConverter15Test extends ConverterTestSetup {
public void test0346() throws JavaModelException {
this.workingCopy = getWorkingCopy("/Converter15/src/test0346/X.java", true/*resolve*/);
String contents =
- "package test0346;\n" +
- "public class X extends A {\n" +
- " /*start*/@Test(groups = NAME)/*end*/ int i;\n" +
+ "package test0346;\n" +
+ "public class X extends A {\n" +
+ " /*start*/@Test(groups = NAME)/*end*/ int i;\n" +
"}";
NormalAnnotation annotation = (NormalAnnotation) buildAST(
contents,
@@ -11235,12 +11235,12 @@ public class ASTConverter15Test extends ConverterTestSetup {
public void test0347() throws JavaModelException {
this.workingCopy = getWorkingCopy("/Converter15/src/test0347/X.java", true/*resolve*/);
String contents =
- "package test0347;\n" +
- "public class X implements One</*start*/Outer<Integer>.Inner<Double>[]/*end*/> {\n" +
- "}\n" +
- "interface One<T> {}\n" +
- "class Outer<T> {\n" +
- " public class Inner<S> {}\n" +
+ "package test0347;\n" +
+ "public class X implements One</*start*/Outer<Integer>.Inner<Double>[]/*end*/> {\n" +
+ "}\n" +
+ "interface One<T> {}\n" +
+ "class Outer<T> {\n" +
+ " public class Inner<S> {}\n" +
"}";
ArrayType type = (ArrayType) buildAST(
contents,
@@ -11299,7 +11299,7 @@ public class ASTConverter15Test extends ConverterTestSetup {
}
}
}
-
+
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=334119
* Ensures that dollar in a type name is not confused as the starting of member type
@@ -11317,7 +11317,7 @@ public class ASTConverter15Test extends ConverterTestSetup {
"Lp/X$Y;", // should not be Lp/X$Y-X$Y;
binding.getKey());
}
-
+
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=334119
* Ensures that dollar in a type name is not confused as the starting of member type
@@ -11339,14 +11339,14 @@ public class ASTConverter15Test extends ConverterTestSetup {
public void test0350() throws JavaModelException {
this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/);
CompilationUnit unit = (CompilationUnit) buildAST(
- "public class X {\n" +
- " <T> T combine(T t1, T t2) {\n" +
- " boolean b = true;\n" +
- " return b ? t1 : t2; \n" +
- " }\n" +
- " void test(String s, Integer i) { \n" +
- " combine(s, i); \n" +
- " }\n" +
+ "public class X {\n" +
+ " <T> T combine(T t1, T t2) {\n" +
+ " boolean b = true;\n" +
+ " return b ? t1 : t2; \n" +
+ " }\n" +
+ " void test(String s, Integer i) { \n" +
+ " combine(s, i); \n" +
+ " }\n" +
"}",
this.workingCopy,
true,
@@ -11422,20 +11422,20 @@ public class ASTConverter15Test extends ConverterTestSetup {
}
// Bug 353474 - type converters should include more annotations
public void testBug353474() throws CoreException {
-
+
this.createFolder("/Converter15/src/testBug353474/annot");
- String contents =
+ String contents =
"package testBug353474.annot;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.*;\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@Target({METHOD,PARAMETER,LOCAL_VARIABLE})\n" +
- "public @interface Nullable {\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Target({METHOD,PARAMETER,LOCAL_VARIABLE})\n" +
+ "public @interface Nullable {\n" +
"}\n";
getWorkingCopy("/Converter15/src/testBug353474/annot/Nullable.java", contents, true/*resolve*/);
this.createFolder("/Converter15/src/testBug353474/p1");
- contents =
+ contents =
"package testBug353474.p1;\n" +
"import testBug353474.annot.*;\n" +
"public class C1 {\n" +
@@ -11469,7 +11469,7 @@ public class ASTConverter15Test extends ConverterTestSetup {
assertNotNull("Parameter annotation should not be null", parameterAnnotations0);
assertEquals("Should have exactly one annotation", 1, parameterAnnotations0.length);
assertEquals("Unexpected annotation name", "Nullable", parameterAnnotations0[0].getName());
-
+
IAnnotationBinding[] returnAnnotations = resolvedFoo.getAnnotations();
assertNotNull("Return annotation should not be null", returnAnnotations);
assertEquals("Should have exactly one return annotation", 1, returnAnnotations.length);
@@ -11506,7 +11506,7 @@ public class ASTConverter15Test extends ConverterTestSetup {
assertNotNull("Parameter annotation should not be null", parameterAnnotations0);
assertEquals("Should have exactly one annotation", 1, parameterAnnotations0.length);
assertEquals("Unexpected annotation name", "Nullable", parameterAnnotations0[0].getName());
-
+
IAnnotationBinding[] returnAnnotations = resolvedFoo.getAnnotations();
assertNotNull("Return annotation should not be null", returnAnnotations);
assertEquals("Should have exactly one return annotation", 1, returnAnnotations.length);
@@ -11595,7 +11595,7 @@ public class ASTConverter15Test extends ConverterTestSetup {
TypeDeclaration typeDeclaration = (TypeDeclaration) compilationUnit.types().get(0);
node = (ASTNode) typeDeclaration.bodyDeclarations().get(2);
- assertEquals("Not a method declaration", ASTNode.METHOD_DECLARATION, node.getNodeType());
+ assertEquals("Not a method declaration", ASTNode.METHOD_DECLARATION, node.getNodeType());
MethodDeclaration methodDecl = (MethodDeclaration) node;
Type type = methodDecl.getReturnType2();
assertTrue(type.isQualifiedType());
@@ -11606,9 +11606,9 @@ public class ASTConverter15Test extends ConverterTestSetup {
type = param.getType();
assertTrue(type.isQualifiedType());
assertTrue(isMalformed(type));
-
+
node = (ASTNode) typeDeclaration.bodyDeclarations().get(3);
- assertEquals("Not a field declaration", ASTNode.FIELD_DECLARATION, node.getNodeType());
+ assertEquals("Not a field declaration", ASTNode.FIELD_DECLARATION, node.getNodeType());
FieldDeclaration field = (FieldDeclaration) node;
type = field.getType();
assertTrue(type.isQualifiedType());
@@ -11815,7 +11815,7 @@ public class ASTConverter15Test extends ConverterTestSetup {
MethodDeclaration method = type.getMethods()[0];
EnhancedForStatement eh = (EnhancedForStatement) method.getBody().statements().get(0);
SingleVariableDeclaration var = eh.getParameter();
- checkSourceRange(var, "final Object obj", str);
+ checkSourceRange(var, "final Object obj", str);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=484220
public void testBug484220_002() throws JavaModelException {
@@ -11839,7 +11839,7 @@ public class ASTConverter15Test extends ConverterTestSetup {
MethodDeclaration method = type.getMethods()[0];
ForStatement forStmt = (ForStatement) method.getBody().statements().get(0);
VariableDeclarationExpression var = (VariableDeclarationExpression) forStmt.initializers().get(0);
- checkSourceRange(var, "final Object obj", str);
+ checkSourceRange(var, "final Object obj", str);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=527462
public void testBug527462() throws JavaModelException {
@@ -11918,10 +11918,10 @@ public class ASTConverter15Test extends ConverterTestSetup {
public void testBug540313() throws JavaModelException {
this.workingCopy = getWorkingCopy("/Converter15/src/X/C120644mr.java", true/*resolve*/);
String contents =
- "package X;\n" +
- "\n" +
- "/* renamed from: X.4mr */\n" +
- "public class C120644mr<V, X extends java.lang.Exception> extends X.C16280iv<V> {\n" +
+ "package X;\n" +
+ "\n" +
+ "/* renamed from: X.4mr */\n" +
+ "public class C120644mr<V, X extends java.lang.Exception> extends X.C16280iv<V> {\n" +
"}\n";
ASTNode node = buildAST(
contents,
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter17Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter17Test.java
index 93176e730..8c26c16d6 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter17Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter17Test.java
@@ -400,39 +400,39 @@ public class ASTConverter17Test extends ConverterTestSetup {
*/
public void test0011() throws JavaModelException {
String contents =
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
- " int option= 1;\n" +
- " throw option == 1 ? new ExceptionA() : new ExceptionB();\n" +
- " } catch (/*final*/ ExceptionA | ExceptionB ex) {\n" +
- " System.out.println(\"type of ex: \" + ex.getClass());\n" +
- " // next 2 methods on 'ex' use different parts of lub:\n" +
- " ex.myMethod();\n" +
- " throw ex;\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "interface Mix {\n" +
- " public void myMethod();\n" +
- "}\n" +
- "class ExceptionA extends RuntimeException implements Mix {\n" +
- " private static final long serialVersionUID = 1L;\n" +
- " public void myMethod() {\n" +
- " System.out.println(\"ExceptionA.myMethod()\");\n" +
- " }\n" +
- " public void onlyA() {\n" +
- " System.out.println(\"ExceptionA.onlyA()\");\n" +
- " }\n" +
- "}\n" +
- "class ExceptionB extends RuntimeException implements Mix {\n" +
- " private static final long serialVersionUID = 1L;\n" +
- " public void myMethod() {\n" +
- " System.out.println(\"ExceptionB.myMethod()\");\n" +
- " }\n" +
- " public void onlyB() {\n" +
- " System.out.println(\"ExceptionA.onlyB()\");\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
+ " int option= 1;\n" +
+ " throw option == 1 ? new ExceptionA() : new ExceptionB();\n" +
+ " } catch (/*final*/ ExceptionA | ExceptionB ex) {\n" +
+ " System.out.println(\"type of ex: \" + ex.getClass());\n" +
+ " // next 2 methods on 'ex' use different parts of lub:\n" +
+ " ex.myMethod();\n" +
+ " throw ex;\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "interface Mix {\n" +
+ " public void myMethod();\n" +
+ "}\n" +
+ "class ExceptionA extends RuntimeException implements Mix {\n" +
+ " private static final long serialVersionUID = 1L;\n" +
+ " public void myMethod() {\n" +
+ " System.out.println(\"ExceptionA.myMethod()\");\n" +
+ " }\n" +
+ " public void onlyA() {\n" +
+ " System.out.println(\"ExceptionA.onlyA()\");\n" +
+ " }\n" +
+ "}\n" +
+ "class ExceptionB extends RuntimeException implements Mix {\n" +
+ " private static final long serialVersionUID = 1L;\n" +
+ " public void myMethod() {\n" +
+ " System.out.println(\"ExceptionB.myMethod()\");\n" +
+ " }\n" +
+ " public void onlyB() {\n" +
+ " System.out.println(\"ExceptionA.onlyB()\");\n" +
+ " }\n" +
"}";
this.workingCopy = getWorkingCopy("/Converter17/src/X.java", true/*resolve*/);
this.workingCopy.getBuffer().setContents(contents);
@@ -476,11 +476,11 @@ public class ASTConverter17Test extends ConverterTestSetup {
public void test0013() throws JavaModelException {
String contents =
"import java.util.*;\n" +
- "public class X {\n" +
- " public static Object foo() {\n" +
+ "public class X {\n" +
+ " public static Object foo() {\n" +
" List<String> l = new ArrayList<>();\n" +
" return l;\n" +
- " }\n" +
+ " }\n" +
"}";
this.workingCopy = getWorkingCopy("/Converter17/src/X.java", true/*resolve*/);
this.workingCopy.getBuffer().setContents(contents);
@@ -501,12 +501,12 @@ public class ASTConverter17Test extends ConverterTestSetup {
*/
public void test0014() throws JavaModelException {
String contents =
- "public class X {\n" +
- " void foo() {\n" +
- " try (Object | Integer res= null) {\n" +
- " } catch (Exception e) {\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " void foo() {\n" +
+ " try (Object | Integer res= null) {\n" +
+ " } catch (Exception e) {\n" +
+ " }\n" +
+ " }\n" +
"}";
this.workingCopy = getWorkingCopy("/Converter17/src/X.java", true/*resolve*/);
this.workingCopy.getBuffer().setContents(contents);
@@ -521,51 +521,51 @@ public class ASTConverter17Test extends ConverterTestSetup {
*/
public void test0015() throws JavaModelException {
String contents =
- "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" +
- " Object x;\n" +
- " String s;\n" +
- " int i;\n" +
- " MethodType mt;\n" +
- " MethodHandle mh;\n" +
- " MethodHandles.Lookup lookup = MethodHandles.lookup();\n" +
- " // mt is (char,char)String\n" +
- " mt = MethodType.methodType(String.class, char.class, char.class);\n" +
- " mh = lookup.findVirtual(String.class, \"replace\", mt);\n" +
- " s = (String) mh.invokeExact(\"daddy\", 'd', 'n');\n" +
- " // invokeExact(Ljava/lang/String;CC)Ljava/lang/String;\n" +
- " assert s.equals(\"nanny\");\n" +
- " // weakly typed invocation (using MHs.invoke)\n" +
- " s = (String) mh.invokeWithArguments(\"sappy\", 'p', 'v');\n" +
- " assert s.equals(\"nanny\");\n" +
- " // mt is (Object[])List\n" +
- " mt = MethodType.methodType(java.util.List.class, Object[].class);\n" +
- " mh = lookup.findStatic(java.util.Arrays.class, \"asList\", mt);\n" +
- " assert (mh.isVarargsCollector());\n" +
- " x = mh.invoke(\"one\", \"two\");\n" +
- " // invoke(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object;\n" +
- " System.out.println(x);\n" +
- " // mt is (Object,Object,Object)Object\n" +
- " mt = MethodType.genericMethodType(3);\n" +
- " mh = mh.asType(mt);\n" +
- " x = mh.invokeExact((Object) 1, (Object) 2, (Object) 3);\n" +
- " // invokeExact(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n" +
- " System.out.println(x);\n" +
- " // mt is ()int\n" +
- " mt = MethodType.methodType(int.class);\n" +
- " mh = lookup.findVirtual(java.util.List.class, \"size\", mt);\n" +
- " i = (int) mh.invokeExact(java.util.Arrays.asList(1, 2, 3));\n" +
- " // invokeExact(Ljava/util/List;)I\n" +
- " assert (i == 3);\n" +
- " mt = MethodType.methodType(void.class, String.class);\n" +
- " mh = lookup.findVirtual(java.io.PrintStream.class, \"println\", mt);\n" +
- " mh.invokeExact(System.out, \"Hello, world.\");\n" +
- " // invokeExact(Ljava/io/PrintStream;Ljava/lang/String;)V\n" +
- " }\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" +
+ " Object x;\n" +
+ " String s;\n" +
+ " int i;\n" +
+ " MethodType mt;\n" +
+ " MethodHandle mh;\n" +
+ " MethodHandles.Lookup lookup = MethodHandles.lookup();\n" +
+ " // mt is (char,char)String\n" +
+ " mt = MethodType.methodType(String.class, char.class, char.class);\n" +
+ " mh = lookup.findVirtual(String.class, \"replace\", mt);\n" +
+ " s = (String) mh.invokeExact(\"daddy\", 'd', 'n');\n" +
+ " // invokeExact(Ljava/lang/String;CC)Ljava/lang/String;\n" +
+ " assert s.equals(\"nanny\");\n" +
+ " // weakly typed invocation (using MHs.invoke)\n" +
+ " s = (String) mh.invokeWithArguments(\"sappy\", 'p', 'v');\n" +
+ " assert s.equals(\"nanny\");\n" +
+ " // mt is (Object[])List\n" +
+ " mt = MethodType.methodType(java.util.List.class, Object[].class);\n" +
+ " mh = lookup.findStatic(java.util.Arrays.class, \"asList\", mt);\n" +
+ " assert (mh.isVarargsCollector());\n" +
+ " x = mh.invoke(\"one\", \"two\");\n" +
+ " // invoke(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object;\n" +
+ " System.out.println(x);\n" +
+ " // mt is (Object,Object,Object)Object\n" +
+ " mt = MethodType.genericMethodType(3);\n" +
+ " mh = mh.asType(mt);\n" +
+ " x = mh.invokeExact((Object) 1, (Object) 2, (Object) 3);\n" +
+ " // invokeExact(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n" +
+ " System.out.println(x);\n" +
+ " // mt is ()int\n" +
+ " mt = MethodType.methodType(int.class);\n" +
+ " mh = lookup.findVirtual(java.util.List.class, \"size\", mt);\n" +
+ " i = (int) mh.invokeExact(java.util.Arrays.asList(1, 2, 3));\n" +
+ " // invokeExact(Ljava/util/List;)I\n" +
+ " assert (i == 3);\n" +
+ " mt = MethodType.methodType(void.class, String.class);\n" +
+ " mh = lookup.findVirtual(java.io.PrintStream.class, \"println\", mt);\n" +
+ " mh.invokeExact(System.out, \"Hello, world.\");\n" +
+ " // invokeExact(Ljava/io/PrintStream;Ljava/lang/String;)V\n" +
+ " }\n" +
"}";
this.workingCopy = getWorkingCopy("/Converter17/src/X.java", true/*resolve*/);
this.workingCopy.getBuffer().setContents(contents);
@@ -616,19 +616,19 @@ public class ASTConverter17Test extends ConverterTestSetup {
public void test0016() throws JavaModelException {
this.workingCopy = getWorkingCopy("/Converter17/src/X.java", true/*resolve*/);
String contents =
- "import java.lang.invoke.MethodHandle;\n" +
- "import java.lang.invoke.MethodHandles;\n" +
- "import java.lang.invoke.MethodType;\n" +
- "\n" +
- "public class X {\n" +
- " void bar() throws Throwable {\n" +
+ "import java.lang.invoke.MethodHandle;\n" +
+ "import java.lang.invoke.MethodHandles;\n" +
+ "import java.lang.invoke.MethodType;\n" +
+ "\n" +
+ "public class X {\n" +
+ " void bar() throws Throwable {\n" +
" MethodType mt;\n" +
- " MethodHandle mh;\n" +
- " MethodHandles.Lookup lookup = MethodHandles.lookup();\n" +
- " mt = MethodType.methodType(String.class, char.class, char.class);\n" +
- " mh = lookup.findVirtual(String.class, \"replace\", mt);\n" +
- " String s = (String) mh.invokeExact(\"daddy\",'d','n');\n" +
- " }\n" +
+ " MethodHandle mh;\n" +
+ " MethodHandles.Lookup lookup = MethodHandles.lookup();\n" +
+ " mt = MethodType.methodType(String.class, char.class, char.class);\n" +
+ " mh = lookup.findVirtual(String.class, \"replace\", mt);\n" +
+ " String s = (String) mh.invokeExact(\"daddy\",'d','n');\n" +
+ " }\n" +
"}";
this.workingCopy.getBuffer().setContents(contents);
this.workingCopy.save(null, true);
@@ -661,7 +661,7 @@ public class ASTConverter17Test extends ConverterTestSetup {
ITypeBinding[] parameterTypes = ((IMethodBinding) bindings[0]).getParameterTypes();
assertEquals("Wrong size", 3, parameterTypes.length);
assertEquals("Wrong key", key, bindings[0].getKey());
-
+
VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) getASTNode((CompilationUnit) node, 0, 0, 5);
Expression initializer = ((VariableDeclarationFragment) variableDeclarationStatement.fragments().get(0)).getInitializer();
MethodInvocation invocation = (MethodInvocation) ((CastExpression) initializer).getExpression();
@@ -701,32 +701,32 @@ public class ASTConverter17Test extends ConverterTestSetup {
*/
public void test0018() throws JavaModelException {
String contents =
- "public class X<T> {\n" +
- " T field1;\n" +
- " public X(T param){\n" +
- " field1 = param;\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " X<Object> a = new X<Object>(\"hello\");\n" +
- " X.testFunction(a.getField()); //prints 2\n" +
- " X<String> b = new X<>(\"hello\");\n" +
- " X.testFunction(b.getField()); // prints 1\n" +
- "\n" +
- " X<Object> c = new X<>(null);\n" +
- " X.testFunction(c.getField()); // prints 2\n" +
- " X<String> d = new X<>(null);\n" +
- " X.testFunction(d.getField()); // prints 1\n" +
- " }\n" +
- " public static void testFunction(String param){\n" +
- " System.out.println(1 + \", String param: \" + param);\n" +
- " }\n" +
- " public static void testFunction(Object param){\n" +
- " System.out.println(2);\n" +
- " }\n" +
- " public T getField(){\n" +
- " return field1;\n" +
- " }\n" +
+ "public class X<T> {\n" +
+ " T field1;\n" +
+ " public X(T param){\n" +
+ " field1 = param;\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " X<Object> a = new X<Object>(\"hello\");\n" +
+ " X.testFunction(a.getField()); //prints 2\n" +
+ " X<String> b = new X<>(\"hello\");\n" +
+ " X.testFunction(b.getField()); // prints 1\n" +
+ "\n" +
+ " X<Object> c = new X<>(null);\n" +
+ " X.testFunction(c.getField()); // prints 2\n" +
+ " X<String> d = new X<>(null);\n" +
+ " X.testFunction(d.getField()); // prints 1\n" +
+ " }\n" +
+ " public static void testFunction(String param){\n" +
+ " System.out.println(1 + \", String param: \" + param);\n" +
+ " }\n" +
+ " public static void testFunction(Object param){\n" +
+ " System.out.println(2);\n" +
+ " }\n" +
+ " public T getField(){\n" +
+ " return field1;\n" +
+ " }\n" +
"}";
this.workingCopy = getWorkingCopy("/Converter17/src/X.java", true/*resolve*/);
this.workingCopy.getBuffer().setContents(contents);
@@ -779,11 +779,11 @@ public class ASTConverter17Test extends ConverterTestSetup {
*/
public void test0020() throws JavaModelException {
String contents =
- "public class DiamondTest<T> {\n" +
- " public <U> DiamondTest(T t) {}\n" +
- " public static void main ( String[] args ) {\n" +
- " DiamondTest<String> d = new <Integer> DiamondTest<>();\n" +
- " }\n" +
+ "public class DiamondTest<T> {\n" +
+ " public <U> DiamondTest(T t) {}\n" +
+ " public static void main ( String[] args ) {\n" +
+ " DiamondTest<String> d = new <Integer> DiamondTest<>();\n" +
+ " }\n" +
"}";
this.workingCopy = getWorkingCopy("/Converter17/src/DiamondTest.java", true/*resolve*/);
this.workingCopy.getBuffer().setContents(contents);
@@ -863,7 +863,7 @@ public class ASTConverter17Test extends ConverterTestSetup {
}
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=402674
- *
+ *
* @throws JavaModelException
*/
public void test403444() throws JavaModelException {
@@ -887,19 +887,19 @@ public class ASTConverter17Test extends ConverterTestSetup {
" bar((int x, int y) -> x+y); //SingleVariableDeclarations are OK\n" +
" }\n" +
"}\n";
-
-
+
+
this.workingCopy = getWorkingCopy("/Converter/src/test403444/X.java", true/* resolve */);
this.workingCopy.getBuffer().setContents(contents);
ASTNode node = runConversion(this.workingCopy, true);
assertTrue(node != null);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
CompilationUnit unit = (CompilationUnit) node;
-
- String error = "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" +
- "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" +
+
+ String error = "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" +
+ "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" +
"Lambda expressions are allowed only at source level 1.8 or above";
assertProblemsSize(unit, 5, error);
@@ -907,41 +907,41 @@ public class ASTConverter17Test extends ConverterTestSetup {
MethodDeclaration methoddecl = (MethodDeclaration)typedeclaration.bodyDeclarations().get(4);
List statements = methoddecl.getBody().statements();
int sCount = 0;
-
+
ExpressionStatement statement = (ExpressionStatement)statements.get(sCount++);
MethodInvocation methodInvocation = (MethodInvocation)statement.getExpression();
Expression expression = (Expression) methodInvocation.arguments().get(0);
assertTrue(expression instanceof NullLiteral);
ITypeBinding binding = expression.resolveTypeBinding();
- assertNull(binding);
-
+ assertNull(binding);
+
statement = (ExpressionStatement)statements.get(sCount++);
methodInvocation = (MethodInvocation)statement.getExpression();
expression = (Expression) methodInvocation.arguments().get(0);
assertTrue(expression instanceof NullLiteral);
binding = expression.resolveTypeBinding();
- assertNull(binding);
+ assertNull(binding);
statement = (ExpressionStatement)statements.get(sCount++);
methodInvocation = (MethodInvocation)statement.getExpression();
expression = (Expression) methodInvocation.arguments().get(0);
assertTrue(expression instanceof NullLiteral);
binding = expression.resolveTypeBinding();
- assertNull(binding);
+ assertNull(binding);
statement = (ExpressionStatement)statements.get(sCount++);
methodInvocation = (MethodInvocation)statement.getExpression();
expression = (Expression) methodInvocation.arguments().get(0);
assertTrue(expression instanceof NullLiteral);
binding = expression.resolveTypeBinding();
- assertNull(binding);
+ assertNull(binding);
statement = (ExpressionStatement)statements.get(sCount++);
methodInvocation = (MethodInvocation)statement.getExpression();
expression = (Expression) methodInvocation.arguments().get(0);
assertTrue(expression instanceof NullLiteral);
binding = expression.resolveTypeBinding();
- assertNull(binding);
+ assertNull(binding);
}
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=399791
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java
index 995812c7f..e74ceb2eb 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java
@@ -119,10 +119,10 @@ public class ASTConverter18Test extends ConverterTestSetup {
String contents =
"import java.lang.annotation.*;\n" +
"public class X {\n" +
- " @Target(ElementType.TYPE_USE) static @interface A {}\n" +
- " @Target(ElementType.TYPE_USE) static @interface B {}\n" +
- " @Target(ElementType.TYPE_USE) static @interface C { Class<?> value() default Object.class; }\n" +
- " @Target(ElementType.TYPE_USE) static @interface D { Class<?> d(); }\n" +
+ " @Target(ElementType.TYPE_USE) static @interface A {}\n" +
+ " @Target(ElementType.TYPE_USE) static @interface B {}\n" +
+ " @Target(ElementType.TYPE_USE) static @interface C { Class<?> value() default Object.class; }\n" +
+ " @Target(ElementType.TYPE_USE) static @interface D { Class<?> d(); }\n" +
" void foo(@A int @B()[] @C(int[].class) [] @D(d=String[].class)... arg) {}\n" +
"}";
this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true/*resolve*/);
@@ -138,33 +138,33 @@ public class ASTConverter18Test extends ConverterTestSetup {
List parameters = methodDeclaration.parameters();
assertEquals("wrong size", 1, parameters.size());
SingleVariableDeclaration parameter = (SingleVariableDeclaration) parameters.get(0);
-
+
ArrayType type = (ArrayType) parameter.getType();
List dimensions = type.dimensions();
assertEquals(2, dimensions.size());
-
+
Dimension dimension = (Dimension) dimensions.get(0);
List annotations = dimension.annotations();
assertEquals("Wrong number of annotations", 1, annotations.size());
Annotation annotation = (Annotation) annotations.get(0);
checkSourceRange(annotation, "@B()", contents);
-
+
dimension = (Dimension) dimensions.get(1);
annotations = dimension.annotations();
assertEquals("Wrong number of annotations", 1, annotations.size());
annotation = (Annotation) annotations.get(0);
checkSourceRange(annotation, "@C(int[].class)", contents);
-
+
annotations = parameter.varargsAnnotations();
assertEquals("Wrong number of annotations", 1, annotations.size());
annotation = (Annotation) annotations.get(0);
checkSourceRange(annotation, "@D(d=String[].class)", contents);
-
+
}
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=395886 tests annotations on
* QTR in multiple scenarios of occurrence.
- *
+ *
* @throws JavaModelException
*/
public void test0002() throws JavaModelException {
@@ -266,7 +266,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=395886 tests the
* representation of type annotations on a possible JAVA 7 and 8 place.
- *
+ *
* @throws JavaModelException
*/
public void test0003() throws JavaModelException {
@@ -304,7 +304,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=395886 tests QTR with
* annotations
- *
+ *
* @throws JavaModelException
*/
public void test0004() throws JavaModelException {
@@ -353,7 +353,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=395886 tests QTR with
* annotations
- *
+ *
* @throws JavaModelException
*/
public void test0005() throws JavaModelException {
@@ -453,7 +453,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=395886 tests PQTR with
* annotations part
- *
+ *
* @throws JavaModelException
*/
public void test0006() throws JavaModelException {
@@ -1078,19 +1078,19 @@ public class ASTConverter18Test extends ConverterTestSetup {
"import java.lang.annotation.ElementType;\n" +
"public class X {\n" +
" class Y {\n" +
- " @Annot int @Annot1 [] a @Annot2 @Annot3 [] @Annot3 @Annot2 [] @Annot4 [], b @Annot2 @Annot3 [] @Annot4 [], c [][][];\n" +
+ " @Annot int @Annot1 [] a @Annot2 @Annot3 [] @Annot3 @Annot2 [] @Annot4 [], b @Annot2 @Annot3 [] @Annot4 [], c [][][];\n" +
" public void foo1(@Annot int @Annot1 [] p @Annot2 @Annot3 [] @Annot3 @Annot2 [] @Annot4 @Annot3 []) {}\n" +
" public void foo2(@Annot int p [][]) {}\n" +
- " @Annot String @Annot1 [] foo3() @Annot1 @Annot2 [][] { return null; }\n" +
+ " @Annot String @Annot1 [] foo3() @Annot1 @Annot2 [][] { return null; }\n" +
" }\n" +
"}\n" +
- "@java.lang.annotation.Target(value = {ElementType.TYPE_USE})\n" +
+ "@java.lang.annotation.Target(value = {ElementType.TYPE_USE})\n" +
"@interface Annot {}\n" +
- "@java.lang.annotation.Target(value = {ElementType.TYPE_USE})\n" +
+ "@java.lang.annotation.Target(value = {ElementType.TYPE_USE})\n" +
"@interface Annot1 {}\n" +
"@java.lang.annotation.Target(value = {ElementType.TYPE_USE})\n" +
"@interface Annot2 {}\n" +
- "@java.lang.annotation.Target(value = {ElementType.TYPE_USE})\n" +
+ "@java.lang.annotation.Target(value = {ElementType.TYPE_USE})\n" +
"@interface Annot3 {}\n" +
"@java.lang.annotation.Target(value = {ElementType.TYPE_USE})\n" +
"@interface Annot4 {}";
@@ -1107,7 +1107,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
assertExtraDimensionsEqual("Incorrect extra dimensions", fragment.extraDimensions(), "@Annot2 @Annot3 [] @Annot3 @Annot2 [] @Annot4 []");
fragment = (VariableDeclarationFragment) fragments.get(1);
- assertExtraDimensionsEqual("Incorrect extra dimensions", fragment.extraDimensions(), "@Annot2 @Annot3 [] @Annot4 []");
+ assertExtraDimensionsEqual("Incorrect extra dimensions", fragment.extraDimensions(), "@Annot2 @Annot3 [] @Annot4 []");
fragment = (VariableDeclarationFragment) fragments.get(2);
assertExtraDimensionsEqual("Incorrect extra dimensions", fragment.extraDimensions(), "[] [] []");
MethodDeclaration[] methods = type.getMethods();
@@ -1153,7 +1153,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
"import java.lang.annotation.ElementType;\n" +
"public class X {\n" +
" public void foo() {\n" +
- " int @Marker [][][] i = new @Marker2 int @Marker @Marker2 [2] @Marker2 @Marker3 [bar()] @Marker3 @Marker []; \n" +
+ " int @Marker [][][] i = new @Marker2 int @Marker @Marker2 [2] @Marker2 @Marker3 [bar()] @Marker3 @Marker []; \n" +
" int @Marker [][][] j = new @Marker int @Marker3 @Marker [2] @Marker @Marker2 [X.bar2(2)] @Marker2 @Marker3 [];\n" +
" }\n" +
" public int bar() {\n" +
@@ -1163,13 +1163,13 @@ public class ASTConverter18Test extends ConverterTestSetup {
" return k;\n" +
" }\n" +
"}\n" +
- "@java.lang.annotation.Target (ElementType.TYPE_USE)\n" +
+ "@java.lang.annotation.Target (ElementType.TYPE_USE)\n" +
"@interface Marker {}\n" +
- "@java.lang.annotation.Target (ElementType.TYPE_USE)\n" +
+ "@java.lang.annotation.Target (ElementType.TYPE_USE)\n" +
"@interface Marker2 {}\n" +
- "@java.lang.annotation.Target (ElementType.TYPE_USE)\n" +
+ "@java.lang.annotation.Target (ElementType.TYPE_USE)\n" +
"@interface Marker3 {}";
-
+
this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true);
ASTNode node = buildAST(contents, this.workingCopy);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
@@ -1198,13 +1198,13 @@ public class ASTConverter18Test extends ConverterTestSetup {
assertEquals("Incorrect expressions", 2, dimensions.size());
assertEquals("Incorrect expressions", "2", dimensions.get(0).toString());
assertEquals("Incorrect expressions", "bar()", dimensions.get(1).toString());
-
+
list = statement2.fragments();
assertEquals("Incorrect no of fragments", 1, list.size());
fragment = (VariableDeclarationFragment) list.get(0);
creation = (ArrayCreation) fragment.getInitializer();
checkSourceRange(creation.getType(), "@Marker int @Marker3 @Marker [2] @Marker @Marker2 [X.bar2(2)] @Marker2 @Marker3 []", contents.toCharArray());
-
+
type = creation.getType();
assertEquals("Incorrect type", true, type.isArrayType());
dimension = (Dimension) ((ArrayType) type).dimensions().get(2);
@@ -1224,14 +1224,14 @@ public class ASTConverter18Test extends ConverterTestSetup {
"import java.lang.annotation.ElementType;\n" +
"public class X {\n" +
" public void foo() {\n" +
- " int @Marker [][][] i = new @Marker2 int @Marker @Marker2 [] @Marker2 @Marker3 [] @Marker3 @Marker [] {{{1, 2, 3}}}; \n" +
+ " int @Marker [][][] i = new @Marker2 int @Marker @Marker2 [] @Marker2 @Marker3 [] @Marker3 @Marker [] {{{1, 2, 3}}}; \n" +
" }\n" +
"}\n" +
- "@java.lang.annotation.Target (ElementType.TYPE_USE)\n" +
+ "@java.lang.annotation.Target (ElementType.TYPE_USE)\n" +
"@interface Marker {}\n" +
- "@java.lang.annotation.Target (ElementType.TYPE_USE)\n" +
+ "@java.lang.annotation.Target (ElementType.TYPE_USE)\n" +
"@interface Marker2 {}\n" +
- "@java.lang.annotation.Target (ElementType.TYPE_USE)\n" +
+ "@java.lang.annotation.Target (ElementType.TYPE_USE)\n" +
"@interface Marker3 {}";
this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true);
ASTNode node = buildAST(contents, this.workingCopy);
@@ -1260,18 +1260,18 @@ public class ASTConverter18Test extends ConverterTestSetup {
"import java.lang.annotation.ElementType;\n" +
"public class X {\n" +
" public void foo() {\n" +
- " int @Marker [][][] i = new @Marker2 int @Marker @Marker2 [] @Marker2 @Marker3 [] @Marker3 @Marker [] {{{1, 2, 3}}}; \n" +
+ " int @Marker [][][] i = new @Marker2 int @Marker @Marker2 [] @Marker2 @Marker3 [] @Marker3 @Marker [] {{{1, 2, 3}}}; \n" +
" }\n" +
"}\n" +
- "@java.lang.annotation.Target (ElementType.TYPE_USE)\n" +
+ "@java.lang.annotation.Target (ElementType.TYPE_USE)\n" +
"@interface Marker {}\n" +
- "@java.lang.annotation.Target (ElementType.TYPE_USE)\n" +
+ "@java.lang.annotation.Target (ElementType.TYPE_USE)\n" +
"@interface Marker2 {}\n" +
- "@java.lang.annotation.Target (ElementType.TYPE_USE)\n" +
+ "@java.lang.annotation.Target (ElementType.TYPE_USE)\n" +
"@interface Marker3 {}";
this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true);
CompilationUnit unit = (CompilationUnit) buildAST(getJLS4(), contents, this.workingCopy, true, true, true);
-
+
ASTNode node = getASTNode(unit, 0, 0);
assertEquals("Not a Method Declaration", ASTNode.METHOD_DECLARATION, node.getNodeType());
MethodDeclaration method = (MethodDeclaration) node;
@@ -1288,7 +1288,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
}
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=399768
- *
+ *
* @throws JavaModelException
*/
public void test0013() throws JavaModelException {
@@ -1297,10 +1297,10 @@ public class ASTConverter18Test extends ConverterTestSetup {
String contents = "package test0010;"
+ "import java.lang.annotation.Target;\n"
+ "public class X implements One<@Marker1 Integer, @Marker2 Boolean> {\n"
- + "}\n"
+ + "}\n"
+ "class Y implements One<@Marker1 @Marker2 Integer, @Marker2 @Marker1 Double> {\n"
- + "}\n"
- + "interface One<T, U> {}\n"
+ + "}\n"
+ + "interface One<T, U> {}\n"
+ "@Target (java.lang.annotation.ElementType.TYPE_USE)\n"
+ "@interface Marker1 {}\n"
+ "@Target (java.lang.annotation.ElementType.TYPE_USE)\n"
@@ -1322,19 +1322,19 @@ public class ASTConverter18Test extends ConverterTestSetup {
annotations = simpleType.annotations();
assertEquals("wrong number of annotations", 2, annotations.size());
assertEquals("@Marker2", annotations.get(1).toString());
- assertNotNull("No annotation", type);
+ assertNotNull("No annotation", type);
type = (Type)((ParameterizedType) typedeclaration.superInterfaceTypes().get(0)).typeArguments().get(1);
assertTrue(type.isSimpleType());
simpleType = (SimpleType) type;
annotations = simpleType.annotations();
assertEquals("wrong number of annotations", 2, annotations.size());
assertEquals("@Marker1", annotations.get(1).toString());
- assertNotNull("No annotation", type);
+ assertNotNull("No annotation", type);
}
-
+
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=399768
- *
+ *
* @throws JavaModelException
*/
public void test0014() throws JavaModelException {
@@ -1348,7 +1348,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
+ " len = y.<@Marker1 @Marker2 String> bar(new String(\"World\"));\n"
+ " }\n"
+ " public int len;\n"
- + "}\n"
+ + "}\n"
+ "class Y {\n"
+ " public <T> Y(T t) {\n"
+ " len = t instanceof String ? ((String)t).length() : 0;\n"
@@ -1390,7 +1390,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=399768
- *
+ *
* @throws JavaModelException
*/
public void test0015() throws JavaModelException {
@@ -1402,21 +1402,21 @@ public class ASTConverter18Test extends ConverterTestSetup {
+ "public class X <@Marker1 @Marker3 F extends @Marker1 @Marker2 File> {\n"
+ " public int foo(F f) {\n"
+ " Y <@Marker2 @Marker3 ? super @Marker1 @Marker2 File> y = new @Marker2 @Marker1 Y<File>();\n"
- + " Outer o = new @Marker1 @Marker2 Outer();\n"
- + " Outer.Inner inner = o.new @Marker1 @Marker2 Inner();\n"
- + " ZZ zz = new <String> @Marker1 @Marker2 ZZ();\n"
+ + " Outer o = new @Marker1 @Marker2 Outer();\n"
+ + " Outer.Inner inner = o.new @Marker1 @Marker2 Inner();\n"
+ + " ZZ zz = new <String> @Marker1 @Marker2 ZZ();\n"
+ " return f.getName().length() + y.hashCode() + inner.hashCode();\n"
+ " }\n"
- + "}\n"
+ + "}\n"
+ "class Y<@Marker3 T> {\n"
+ " public int bar(T t) {\n"
+ " return t instanceof @Marker1 @Marker2 File ? t.toString().length() : 0;\n"
+ " }\n"
+ "}\n"
+ "class Outer {\n"
- + " public class Inner {\n"
+ + " public class Inner {\n"
+ " public class Deeper {\n"
- + " }\n"
+ + " }\n"
+ " }\n"
+ "}\n"
+ "class ZZ {\n"
@@ -1434,7 +1434,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
+ "@Target (java.lang.annotation.ElementType.TYPE_USE)\n"
+ "@interface Marker3 {}\n";
CompilationUnit cu = (CompilationUnit) buildAST(contents, this.workingCopy);
-
+
TypeDeclaration typedeclaration = (TypeDeclaration) getASTNode(cu, 0);
TypeParameter typeParameter = (TypeParameter) typedeclaration.typeParameters().get(0);
@@ -1461,7 +1461,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
assertTrue(type.isParameterizedType());
type = (Type)((ParameterizedType)type).typeArguments().get(0);
assertTrue(type.isWildcardType());
-
+
// for constructor invocation results 1/4
VariableDeclarationFragment fragment = (VariableDeclarationFragment) variableDeclarationStatement.fragments().get(0);
Expression expression = fragment.getInitializer();
@@ -1472,7 +1472,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
assertEquals("@Marker1", annotation.toString());
abinding = annotation.resolveAnnotationBinding();
assertEquals("@Marker1()", abinding.toString());
-
+
// for constructor invocation results 2/4
variableDeclarationStatement = (VariableDeclarationStatement) statements.get(1);
fragment = (VariableDeclarationFragment) variableDeclarationStatement.fragments().get(0);
@@ -1484,7 +1484,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
assertEquals("@Marker2", annotation.toString());
abinding = annotation.resolveAnnotationBinding();
assertEquals("@Marker2()", abinding.toString());
-
+
// for constructor invocation results 3/4
variableDeclarationStatement = (VariableDeclarationStatement) statements.get(2);
fragment = (VariableDeclarationFragment) variableDeclarationStatement.fragments().get(0);
@@ -1565,7 +1565,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=399793
- *
+ *
* @throws JavaModelException
*/
public void test399793a() throws JavaModelException {
@@ -1574,7 +1574,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
String contents = "package test399793;"
+ "interface I {\n"
+ " int foo(int x);\n"
- + "}\n"
+ + "}\n"
+ "public class X {\n"
+ " I i = vlambda -> {return 200;};\n"
+"}\n";
@@ -1593,8 +1593,8 @@ public class ASTConverter18Test extends ConverterTestSetup {
VariableDeclaration variableDeclaration = (VariableDeclaration) lambdaExpression.parameters().get(0);
assertTrue(variableDeclaration instanceof VariableDeclarationFragment);
fragment = (VariableDeclarationFragment)variableDeclaration;
- assertEquals("vlambda", fragment.toString());
- IVariableBinding variableBinding = fragment.resolveBinding();
+ assertEquals("vlambda", fragment.toString());
+ IVariableBinding variableBinding = fragment.resolveBinding();
ITypeBinding typeBinding = variableBinding.getType();
assertNotNull("Null Binding for lambda argument", typeBinding);
assertEquals("binding of int expected for lambda","int",typeBinding.getName());
@@ -1602,7 +1602,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=399793
- *
+ *
* @throws JavaModelException
*/
public void test399793b() throws JavaModelException {
@@ -1611,7 +1611,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
String contents = "package test399793;"
+ "interface I {\n"
+ " int foo(int x);\n"
- + "}\n"
+ + "}\n"
+ "public class X {\n"
+ " I i = vlambda -> 200;\n"
+"}\n";
@@ -1630,12 +1630,12 @@ public class ASTConverter18Test extends ConverterTestSetup {
VariableDeclaration variableDeclaration = (VariableDeclaration) lambdaExpression.parameters().get(0);
assertTrue(variableDeclaration instanceof VariableDeclarationFragment);
fragment = (VariableDeclarationFragment)variableDeclaration;
- assertEquals("vlambda", fragment.toString());
+ assertEquals("vlambda", fragment.toString());
}
-
+
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=399793
- *
+ *
* @throws JavaModelException
*/
public void test399793c() throws JavaModelException {
@@ -1644,7 +1644,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
String contents = "package test399793;"
+ "interface I {\n"
+ " Object foo(int [] ia);\n"
- + "}\n"
+ + "}\n"
+ "public class X {\n"
+ " I i = (int [] ia) ->{\n"
+ " return ia.clone();"
@@ -1670,7 +1670,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=399793
- *
+ *
* @throws JavaModelException
*/
public void test399793d() throws JavaModelException {
@@ -1690,7 +1690,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
" };\n" +
" };\n" +
" };\n" +
- " }\n";
+ " }\n";
CompilationUnit cu = (CompilationUnit) buildAST(contents, this.workingCopy);
TypeDeclaration typedeclaration = (TypeDeclaration) getASTNode(cu, 1);
FieldDeclaration fieldDeclaration = (FieldDeclaration) typedeclaration.bodyDeclarations().get(0);
@@ -1710,7 +1710,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=399794
* ReferenceExpression Family Tests
- *
+ *
* @throws JavaModelException
*/
public void test399794() throws JavaModelException {
@@ -1754,7 +1754,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
" void foo() {\n" +
" J jz = X.super :: foo;\n" +
" }\n" +
- " }\n" +
+ " }\n" +
" }\n" +
" public static void main (String [] args) {}\n" +
"}\n" +
@@ -1764,14 +1764,14 @@ public class ASTConverter18Test extends ConverterTestSetup {
"\n" +
"@Target (ElementType.TYPE_USE)\n" +
"@interface Marker {}";
-
+
CompilationUnit cu = (CompilationUnit) buildAST(contents, this.workingCopy);
TypeDeclaration typeDeclaration = (TypeDeclaration) getASTNode(cu, 4);
MethodDeclaration method = typeDeclaration.getMethods()[0];
List statements = method.getBody().statements();
assertTrue(statements.size() == 8);
int fCount = 1;
-
+
// type method reference with primitive type with type arguments
VariableDeclarationStatement statement = (VariableDeclarationStatement) statements.get(fCount++);
VariableDeclarationFragment fragment = (VariableDeclarationFragment) statement.fragments().get(0);
@@ -1893,7 +1893,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
assertNotNull(typeBinding);
methodBinding = superMethodReference.resolveMethodBinding();
assertNotNull(methodBinding);
- assertNull(superMethodReference.getQualifier());
+ assertNull(superMethodReference.getQualifier());
typeArguments = superMethodReference.typeArguments();
assertTrue(typeArguments.size() == 0);
name = superMethodReference.getName();
@@ -1918,19 +1918,19 @@ public class ASTConverter18Test extends ConverterTestSetup {
methodBinding = superMethodReference.resolveMethodBinding();
assertNotNull(methodBinding);
name = (SimpleName) superMethodReference.getQualifier();
- checkSourceRange(name, "X", contents);
+ checkSourceRange(name, "X", contents);
typeArguments = superMethodReference.typeArguments();
assertTrue(typeArguments.size() == 0);
name = superMethodReference.getName();
checkSourceRange(name, "foo", contents);
typeBinding = name.resolveTypeBinding();
assertNotNull(typeBinding);
-
+
}
-
+
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=399793
- *
+ *
* @throws JavaModelException
*/
public void test399793e() throws JavaModelException {
@@ -1946,7 +1946,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
"public class X {\n" +
" I I = () -> () -> 10;\n" +
"}\n";
-
+
CompilationUnit cu = (CompilationUnit) buildAST(contents, this.workingCopy);
TypeDeclaration typedeclaration = (TypeDeclaration) getASTNode(cu, 2);
FieldDeclaration fieldDeclaration = (FieldDeclaration) typedeclaration.bodyDeclarations().get(0);
@@ -1959,11 +1959,11 @@ public class ASTConverter18Test extends ConverterTestSetup {
assertEquals("public test399793.J foo() ", binding.toString());
assertEquals("real modifiers", ClassFileConstants.AccPublic, binding.getModifiers());
assertTrue(lambdaExpression.parameters().size() == 0);
- }
-
+ }
+
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=402665
- *
+ *
* @throws JavaModelException
*/
public void test402665a() throws JavaModelException {
@@ -1987,19 +1987,19 @@ public class ASTConverter18Test extends ConverterTestSetup {
" bar((int x, int y) -> x+y); //SingleVariableDeclarations are OK\n" +
" }\n" +
"}\n";
-
+
CompilationUnit cu = (CompilationUnit) buildAST(contents, this.workingCopy);
TypeDeclaration typedeclaration = (TypeDeclaration) getASTNode(cu, 0);
MethodDeclaration methoddecl = (MethodDeclaration)typedeclaration.bodyDeclarations().get(4);
List statements = methoddecl.getBody().statements();
int sCount = 0;
-
+
ExpressionStatement statement = (ExpressionStatement)statements.get(sCount++);
MethodInvocation methodInvocation = (MethodInvocation)statement.getExpression();
LambdaExpression lambdaExpression = (LambdaExpression) methodInvocation.arguments().get(0);
VariableDeclarationFragment fragment = (VariableDeclarationFragment)lambdaExpression.parameters().get(0);
checkSourceRange(fragment, "s", contents);
-
+
statement = (ExpressionStatement)statements.get(sCount++);
methodInvocation = (MethodInvocation)statement.getExpression();
lambdaExpression = (LambdaExpression) methodInvocation.arguments().get(0);
@@ -2093,25 +2093,25 @@ public class ASTConverter18Test extends ConverterTestSetup {
TypeDeclaration type = (TypeDeclaration)node;
node = (ASTNode) type.bodyDeclarations().get(0);
type = (TypeDeclaration) node;
-
+
MethodDeclaration method = (MethodDeclaration) type.bodyDeclarations().get(0);
Type receiver = method.getReceiverType();
assertEquals("Not a ParameterizedType", ASTNode.PARAMETERIZED_TYPE, receiver.getNodeType());
checkSourceRange(receiver, "@A X<T>.@B Y<K, V>", contents);
assertEquals("Incorrect method signature", "public Z(@A X<T>.@B Y<K,V> Y.this,boolean a){\n}\n", method.toString());
-
+
method = (MethodDeclaration) type.bodyDeclarations().get(1);
receiver = method.getReceiverType();
assertEquals("Not a QualifiedType", ASTNode.QUALIFIED_TYPE, receiver.getNodeType());
checkSourceRange(receiver, "@B Y<K, V>.@C Z", contents);
assertEquals("Incorrect method signature", "public void foo(@B Y<K,V>.@C Z this,boolean a){\n}\n", method.toString());
-
+
method = (MethodDeclaration) type.bodyDeclarations().get(2);
receiver = method.getReceiverType();
assertEquals("Not a ParameterizedType", ASTNode.PARAMETERIZED_TYPE, receiver.getNodeType());
checkSourceRange(receiver, "X<T>.@B Y<K, V>", contents);
assertEquals("Incorrect method signature", "public Z(X<T>.@B Y<K,V> Y.this){\n}\n", method.toString());
-
+
method = (MethodDeclaration) type.bodyDeclarations().get(3);
receiver = method.getReceiverType();
assertEquals("Not a QualifiedType", ASTNode.QUALIFIED_TYPE, receiver.getNodeType());
@@ -2150,7 +2150,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
}
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=402674
- *
+ *
* @throws JavaModelException
*/
public void test402674() throws JavaModelException {
@@ -2174,20 +2174,20 @@ public class ASTConverter18Test extends ConverterTestSetup {
" bar((int x, int y) -> x+y); //SingleVariableDeclarations are OK\n" +
" }\n" +
"}\n";
-
+
CompilationUnit cu = (CompilationUnit) buildAST(contents, this.workingCopy);
TypeDeclaration typedeclaration = (TypeDeclaration) getASTNode(cu, 0);
MethodDeclaration methoddecl = (MethodDeclaration)typedeclaration.bodyDeclarations().get(4);
List statements = methoddecl.getBody().statements();
int sCount = 0;
-
+
ExpressionStatement statement = (ExpressionStatement)statements.get(sCount++);
MethodInvocation methodInvocation = (MethodInvocation)statement.getExpression();
LambdaExpression lambdaExpression = (LambdaExpression) methodInvocation.arguments().get(0);
ITypeBinding binding = lambdaExpression.resolveTypeBinding();
assertNotNull(binding);
assertEquals("StringToInt", binding.getName());
-
+
statement = (ExpressionStatement)statements.get(sCount++);
methodInvocation = (MethodInvocation)statement.getExpression();
lambdaExpression = (LambdaExpression) methodInvocation.arguments().get(0);
@@ -2280,7 +2280,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
assertEquals("Not a Type Declaration", ASTNode.TYPE_DECLARATION, node.getNodeType());
node = (ASTNode) ((TypeDeclaration)node).bodyDeclarations().get(0);
assertEquals("Not a Type Declaration", ASTNode.TYPE_DECLARATION, node.getNodeType());
- node = (ASTNode) ((TypeDeclaration)node).bodyDeclarations().get(0);
+ node = (ASTNode) ((TypeDeclaration)node).bodyDeclarations().get(0);
assertEquals("Not a method Declaration", ASTNode.METHOD_DECLARATION, node.getNodeType());
MethodDeclaration method = (MethodDeclaration) node;
assertEquals("Method should not be malformed", 0, (method.getFlags() & ASTNode.MALFORMED));
@@ -2334,7 +2334,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
TypeDeclaration typeDeclaration = (TypeDeclaration) compilationUnit.types().get(0);
node = (ASTNode) typeDeclaration.bodyDeclarations().get(2);
- assertEquals("Not a method declaration", ASTNode.METHOD_DECLARATION, node.getNodeType());
+ assertEquals("Not a method declaration", ASTNode.METHOD_DECLARATION, node.getNodeType());
MethodDeclaration methodDecl = (MethodDeclaration) node;
Type type = methodDecl.getReturnType2();
assertTrue(type.isNameQualifiedType());
@@ -2343,7 +2343,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
ITypeBinding typeBinding = nameQualifiedType.resolveBinding();
assertNotNull("null binding", typeBinding);
assertEquals("not a valid binding", "test404489.bug.IOException", typeBinding.getQualifiedName());
-
+
// qualifier of the name qualified type
Name name = nameQualifiedType.getQualifier();
assertTrue(name.isQualifiedName());
@@ -2370,7 +2370,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
binding = simpleName.resolveBinding();
assertTrue("not a package binding", binding.getKind() == IBinding.PACKAGE);
assertEquals("wrong package binding", "package test404489.bug", binding.toString());
-
+
// annotations of name qualified type
List annotations = nameQualifiedType.annotations();
assertTrue(annotations.size() == 1);
@@ -2386,13 +2386,13 @@ public class ASTConverter18Test extends ConverterTestSetup {
typeBinding = simpleName.resolveTypeBinding();
checkSourceRange(simpleName, "NonNull", source);
assertNotNull(typeBinding);
-
+
// name of the name qualified type
simpleName = nameQualifiedType.getName();
checkSourceRange(simpleName, "IOException", source);
typeBinding = simpleName.resolveTypeBinding();
assertNotNull(typeBinding);
-
+
// parameter
SingleVariableDeclaration param = (SingleVariableDeclaration) methodDecl.parameters().get(0);
type = param.getType();
@@ -2402,7 +2402,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
typeBinding = nameQualifiedType.resolveBinding();
assertNotNull("null binding", typeBinding);
assertEquals("not a valid binding", "test404489.bug.FileNotFoundException", typeBinding.getQualifiedName());
-
+
// qualifier of the name qualified type
name = nameQualifiedType.getQualifier();
assertTrue(name.isQualifiedName());
@@ -2429,7 +2429,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
binding = simpleName.resolveBinding();
assertTrue("not a package binding", binding.getKind() == IBinding.PACKAGE);
assertEquals("wrong package binding", "package test404489.bug", binding.toString());
-
+
// annotations of name qualified type
annotations = nameQualifiedType.annotations();
assertTrue(annotations.size() == 1);
@@ -2445,13 +2445,13 @@ public class ASTConverter18Test extends ConverterTestSetup {
typeBinding = simpleName.resolveTypeBinding();
checkSourceRange(simpleName, "NonNull", source);
assertNotNull(typeBinding);
-
+
// name of the name qualified type
simpleName = nameQualifiedType.getName();
checkSourceRange(simpleName, "FileNotFoundException", source);
typeBinding = simpleName.resolveTypeBinding();
assertNotNull(typeBinding);
-
+
// throws
type = (Type) methodDecl.thrownExceptionTypes().get(0);
assertTrue(type.isNameQualifiedType());
@@ -2460,7 +2460,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
typeBinding = nameQualifiedType.resolveBinding();
assertNotNull("null binding", typeBinding);
assertEquals("not a valid binding", "test404489.bug.EOFException", typeBinding.getQualifiedName());
-
+
// qualifier of the name qualified type
name = nameQualifiedType.getQualifier();
assertTrue(name.isQualifiedName());
@@ -2487,7 +2487,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
binding = simpleName.resolveBinding();
assertTrue("not a package binding", binding.getKind() == IBinding.PACKAGE);
assertEquals("wrong package binding", "package test404489.bug", binding.toString());
-
+
// annotations of name qualified type
annotations = nameQualifiedType.annotations();
assertTrue(annotations.size() == 1);
@@ -2503,7 +2503,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
typeBinding = simpleName.resolveTypeBinding();
checkSourceRange(simpleName, "NonNull", source);
assertNotNull(typeBinding);
-
+
// name of the name qualified type
simpleName = nameQualifiedType.getName();
checkSourceRange(simpleName, "EOFException", source);
@@ -2511,7 +2511,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
assertNotNull(typeBinding);
node = (ASTNode) typeDeclaration.bodyDeclarations().get(3);
- assertEquals("Not a field declaration", ASTNode.FIELD_DECLARATION, node.getNodeType());
+ assertEquals("Not a field declaration", ASTNode.FIELD_DECLARATION, node.getNodeType());
FieldDeclaration field = (FieldDeclaration) node;
type = field.getType();
assertTrue(type.isQualifiedType());
@@ -2523,7 +2523,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
assertEquals("not a valid binding", "test404489.bug.X", typeBinding.getQualifiedName());
name = nameQualifiedType.getName();
assertSame("bindings different for name qualified type and assocated name", typeBinding, name.resolveTypeBinding());
-
+
// qualifier of the name qualified type
name = nameQualifiedType.getQualifier();
assertTrue(name.isQualifiedName());
@@ -2550,7 +2550,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
binding = simpleName.resolveBinding();
assertTrue("not a package binding", binding.getKind() == IBinding.PACKAGE);
assertEquals("wrong package binding", "package test404489.bug", binding.toString());
-
+
// annotations of name qualified type
annotations = nameQualifiedType.annotations();
assertTrue(annotations.size() == 1);
@@ -2566,13 +2566,13 @@ public class ASTConverter18Test extends ConverterTestSetup {
typeBinding = simpleName.resolveTypeBinding();
checkSourceRange(simpleName, "NonNull", source);
assertNotNull(typeBinding);
-
+
// name of the name qualified type
simpleName = nameQualifiedType.getName();
checkSourceRange(simpleName, "X", source);
typeBinding = simpleName.resolveTypeBinding();
assertNotNull(typeBinding);
-
+
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399792
public void testBug399792() throws JavaModelException {
@@ -2656,13 +2656,13 @@ public class ASTConverter18Test extends ConverterTestSetup {
assertEquals("Not a method Declaration", ASTNode.METHOD_DECLARATION, node.getNodeType());
MethodDeclaration method = (MethodDeclaration) node;
assertEquals("Method should not be malformed", 0, (method.getFlags() & ASTNode.MALFORMED));
-
+
List statements = method.getBody().statements();
VariableDeclarationStatement statement = (VariableDeclarationStatement) statements.get(0);
fragment = (VariableDeclarationFragment) statement.fragments().get(0);
cast = (CastExpression) fragment.getInitializer();
castType = cast.getType();
-
+
intersectionTypes = ((IntersectionType) castType).types();
assertEquals("Incorrect no of types", 3, intersectionTypes.size());
castType = (Type) intersectionTypes.get(0);
@@ -2685,7 +2685,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=406505
* tests the source range issue that resulted in bad ast node.
- *
+ *
* @throws JavaModelException
*/
public void testBug406505() throws JavaModelException {
@@ -2696,10 +2696,10 @@ public class ASTConverter18Test extends ConverterTestSetup {
+ "import java.io.File;\n"
+ "public class X {\n"
+ " class Folder<@Marker F extends File> { }\n"
- + "}\n"
+ + "}\n"
+ "@Target (java.lang.annotation.ElementType.TYPE_USE)\n"
+ "@interface Marker {}\n";
- CompilationUnit cu = (CompilationUnit) buildAST(contents, this.workingCopy);
+ CompilationUnit cu = (CompilationUnit) buildAST(contents, this.workingCopy);
TypeDeclaration typedeclaration = (TypeDeclaration) getASTNode(cu, 0);
typedeclaration = (TypeDeclaration)typedeclaration.bodyDeclarations().get(0);
TypeParameter typeParameter = (TypeParameter) typedeclaration.typeParameters().get(0);
@@ -2757,7 +2757,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
}
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=417017
- *
+ *
* @throws JavaModelException
*/
public void test417017a() throws JavaModelException {
@@ -2766,7 +2766,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
String contents = "package test417017;"
+ "interface I {\n"
+ " int foo(int x);\n"
- + "}\n"
+ + "}\n"
+ "public class X {\n"
+ " void fun(int a) {\n"
+" I i1 = x1-> x1;\n"
@@ -2789,7 +2789,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
}
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=417017
- *
+ *
* @throws JavaModelException
*/
public void test417017b() throws JavaModelException {
@@ -2821,7 +2821,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
}
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=417017
- *
+ *
* @throws JavaModelException
*/
public void test417017c() throws JavaModelException {
@@ -2853,7 +2853,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
}
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=417017
- *
+ *
* @throws JavaModelException
*/
public void test417017d() throws JavaModelException {
@@ -2868,11 +2868,11 @@ public class ASTConverter18Test extends ConverterTestSetup {
" }\n" +
" I i = this::foo;\n" +
"}\n";
-
+
CompilationUnit cu = (CompilationUnit) buildAST(contents, this.workingCopy);
TypeDeclaration typeDeclaration = (TypeDeclaration) getASTNode(cu, 1);
FieldDeclaration field = typeDeclaration.getFields()[0];
-
+
VariableDeclarationFragment fragment = (VariableDeclarationFragment) field.fragments().get(0);
Expression expression = fragment.getInitializer();
ExpressionMethodReference methodReference = (ExpressionMethodReference) expression;
@@ -2885,7 +2885,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=417017
- *
+ *
* @throws JavaModelException
*/
public void test417017e() throws JavaModelException {
@@ -2898,7 +2898,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
"public class X {\n" +
" I i = int []::new;\n" +
"}\n";
-
+
CompilationUnit cu = (CompilationUnit) buildAST(contents, this.workingCopy);
TypeDeclaration typeDeclaration = (TypeDeclaration) getASTNode(cu, 1);
FieldDeclaration field = typeDeclaration.getFields()[0];
@@ -2912,7 +2912,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=417017
- *
+ *
* @throws JavaModelException
*/
public void test417017f() throws JavaModelException {
@@ -3024,7 +3024,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
ASTNode node = buildAST(contents, this.workingCopy, false);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
CompilationUnit unit = (CompilationUnit) node;
-
+
TypeDeclaration type = (TypeDeclaration) unit.types().get(0);
SimpleType simpleType = (SimpleType) type.getSuperclassType();
checkSourceRange(simpleType, "@NonNull(int[].class) Object", contents);
@@ -3034,7 +3034,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
checkSourceRange(typeLiteral, "int[].class", contents);
ArrayType arrayType = (ArrayType) typeLiteral.getType();
checkSourceRange(arrayType, "int[]", contents);
-
+
int count = 0;
FieldDeclaration field = (FieldDeclaration) type.bodyDeclarations().get(count++);
checkSourceRange(field, "Object field = new ArrayList< @NonEmpty(0) int @NonNull(value1 = 1) [] @NonEmpty(1) [ ]>() ;", contents);
@@ -3049,7 +3049,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
checkSourceRange(dimension, "@NonNull(value1 = 1) []", contents);
dimension = (Dimension) arrayType.dimensions().get(1);
checkSourceRange(dimension, "@NonEmpty(1) [ ]", contents);
-
+
field = (FieldDeclaration) type.bodyDeclarations().get(count++);
checkSourceRange(field, "@Annot int @Annot1 [] a1 @Annot2 @Annot3 @NonNull (value = int[].class, value1 = 0)[/* [] */ ] @Annot3 @Annot2 [] @Annot4 [];", contents);
arrayType = (ArrayType) field.getType();
@@ -3059,13 +3059,13 @@ public class ASTConverter18Test extends ConverterTestSetup {
checkSourceRange(dimension, "@Annot2 @Annot3 @NonNull (value = int[].class, value1 = 0)[/* [] */ ]", contents);
dimension = (Dimension) fragment.extraDimensions().get(1);
checkSourceRange(dimension, "@Annot3 @Annot2 []", contents);
-
+
field = (FieldDeclaration) type.bodyDeclarations().get(count++);
checkSourceRange(field, "int[] xxx[];", contents);
assertTrue(field.getType().isArrayType());
arrayType = (ArrayType) field.getType();
checkSourceRange(arrayType, "int[]", contents);
-
+
field = (FieldDeclaration) type.bodyDeclarations().get(count++);
checkSourceRange(field, "int [][] ii = new int[2][3];", contents);
arrayType = (ArrayType) field.getType();
@@ -3075,7 +3075,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
arrayType = arrayCreation.getType();
assertTrue(arrayType.getElementType().isPrimitiveType());
assertTrue(arrayType.getDimensions() == 2);
-
+
field = (FieldDeclaration) type.bodyDeclarations().get(count++);
checkSourceRange(field, "ArrayList<int[]> [][] yyy;", contents);
arrayType = (ArrayType) field.getType();
@@ -3086,13 +3086,13 @@ public class ASTConverter18Test extends ConverterTestSetup {
arrayType = (ArrayType) field.getType();
assertTrue(arrayType.getElementType().isParameterizedType());
assertTrue(arrayType.getDimensions() == 4);
-
+
field = (FieldDeclaration) type.bodyDeclarations().get(count++);
checkSourceRange(field, "ArrayList<Float> [][][] zzz2;", contents);
arrayType = (ArrayType) field.getType();
assertTrue(arrayType.getElementType().isParameterizedType());
assertTrue(arrayType.getDimensions() == 3);
-
+
field = (FieldDeclaration) type.bodyDeclarations().get(count++);
checkSourceRange(field, "Object a = new ArrayList< @TakeType(int[][].class) int @TakeType(float.class) [] @TakeType(double.class) []>() ;", contents);
fragment = (VariableDeclarationFragment) field.fragments().get(0);
@@ -3110,14 +3110,14 @@ public class ASTConverter18Test extends ConverterTestSetup {
singleMemberAnnotation = (SingleMemberAnnotation) annotation;
typeLiteral = (TypeLiteral) singleMemberAnnotation.getValue();
checkSourceRange(typeLiteral, "double.class", contents);
-
+
field = (FieldDeclaration) type.bodyDeclarations().get(count++);
checkSourceRange(field, "Object b = new @NonNull(value1 = Math.PI) ArrayList< >() ;", contents);
fragment = (VariableDeclarationFragment) field.fragments().get(0);
classInstanceCreation = (ClassInstanceCreation) fragment.getInitializer();
parameterizedType = (ParameterizedType) classInstanceCreation.getType();
checkSourceRange(parameterizedType.getType(), "@NonNull(value1 = Math.PI) ArrayList", contents);
-
+
field = (FieldDeclaration) type.bodyDeclarations().get(count++);
checkSourceRange(field, "Object c = new ArrayList<@NonNull(value1= Math.PI ) Object[]>() ;", contents);
fragment = (VariableDeclarationFragment) field.fragments().get(0);
@@ -3125,7 +3125,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
parameterizedType = (ParameterizedType) classInstanceCreation.getType();
arrayType = (ArrayType) parameterizedType.typeArguments().get(0);
assertTrue(arrayType.getDimensions() == 1);
-
+
MethodDeclaration method = (MethodDeclaration) type.bodyDeclarations().get(count++);
dimension = (Dimension) method.extraDimensions().get(0);
checkSourceRange(dimension, "@TakeType(int[].class) []", contents);
@@ -3151,12 +3151,12 @@ public class ASTConverter18Test extends ConverterTestSetup {
fragment = (VariableDeclarationFragment) variableDeclarationExpression.fragments().get(0);
dimension = (Dimension) fragment.extraDimensions().get(0);
checkSourceRange(dimension, "@TakeType(int[].class) []", contents);
-
+
method = (MethodDeclaration) type.bodyDeclarations().get(count++);
singleVariableDeclaration = (SingleVariableDeclaration) method.parameters().get(0);
// test case active only after bug 417660 is fixed (uncomment)
checkSourceRange(singleVariableDeclaration, "int [] /*@TakeType(int[].class)*/ [] a", contents);
-
+
method = (MethodDeclaration) type.bodyDeclarations().get(count++);
singleVariableDeclaration = (SingleVariableDeclaration) method.parameters().get(0);
checkSourceRange(singleVariableDeclaration, "int @TakeType(int[].class)... args", contents);
@@ -3165,7 +3165,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
arrayType = (ArrayType) typeLiteral.getType();
assertTrue(arrayType.getElementType().isPrimitiveType());
assertTrue(arrayType.getDimensions() == 1);
-
+
method = (MethodDeclaration) type.bodyDeclarations().get(count++);
singleVariableDeclaration = (SingleVariableDeclaration) method.parameters().get(0);
checkSourceRange(singleVariableDeclaration, "int @Annot ... args", contents);
@@ -3174,7 +3174,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=409586
public void testBug409586() throws JavaModelException {
- String contents =
+ String contents =
"@java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_USE)\n" +
"@interface Marker {\n" +
" String value() default \"\";\n" +
@@ -3208,7 +3208,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
assertNotNull("Should not be null", mBinding);
ITypeBinding tBinding1 = mBinding.getReturnType();
assertNotNull("Should not be null", tBinding1);
-
+
/* public @Marker("1") String foo(int @Marker @Marker2 [] args) */
List params = methodDeclaration.parameters();
assertEquals("Incorrect params", 1, params.size());
@@ -3220,7 +3220,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
assertEquals("Incorrect type annotations", 2, annots.length);
assertEquals("Incorrect annotation", "@Marker()", annots[0].toString());
assertEquals("Incorrect annotation", "@Marker2()", annots[1].toString());
-
+
/* public @Marker("3") String bar()*/
node = getASTNode(compilationUnit, 2, 1);
assertTrue("Not a method declaration", node.getNodeType() == ASTNode.METHOD_DECLARATION);
@@ -3262,7 +3262,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
annots = tBinding3.getTypeAnnotations();
assertEquals("Incorrect type annotations", 1, annots.length);
assertEquals("Incorrect annotation", "@Marker(value = i1)", annots[0].toString());
-
+
/* public @Marker String str2 = null; */
node = getASTNode(compilationUnit, 2, 3);
assertTrue("Not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION);
@@ -3273,7 +3273,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
variable = fragment.resolveBinding();
assertNotNull("Should not be null", variable);
tBinding1 = variable.getType();
-
+
/* public @Marker String str3 = null; */
node = getASTNode(compilationUnit, 2, 4);
assertTrue("Not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION);
@@ -3286,7 +3286,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
tBinding2 = variable.getType();
assertSame("Type bindings should be same", tBinding1, tBinding2);
assertTrue("Unannotated bindings should be same", tBinding1.isEqualTo(tBinding2));
-
+
/* public String str4 = null; */
node = getASTNode(compilationUnit, 2, 5);
assertTrue("Not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION);
@@ -3300,9 +3300,9 @@ public class ASTConverter18Test extends ConverterTestSetup {
assertNotSame("Type bindings should not be same", tBinding1, tBinding2);
assertTrue("Unannotated bindings should be same", tBinding1.isEqualTo(tBinding2));
}
-
+
public void testExtendedDimensions() throws JavaModelException {
- String contents =
+ String contents =
"@java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_USE)\n" +
"@interface Marker {\n" +
" String value() default \"\";\n" +
@@ -3334,7 +3334,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
ITypeBinding tBinding1 = returnType.resolveBinding();
assertEquals("Unexpected type", tBinding1.toString(), "@Marker((String)\"1\") String @Marker((String)\"2\") []");
assertEquals("Unexpected type", methodDeclaration.resolveBinding().getReturnType().toString(), "@Marker((String)\"1\") String @Marker3((String)\"3\") [] @Marker((String)\"2\") []");
-
+
List params = methodDeclaration.parameters();
assertEquals("Incorrect params", 1, params.size());
SingleVariableDeclaration param = (SingleVariableDeclaration) params.get(0);
@@ -3355,7 +3355,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=417669
public void testBug417669() throws JavaModelException {
- String contents =
+ String contents =
"@java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_USE)\n" +
"@interface Marker {}\n" +
"public class X {\n" +
@@ -3374,7 +3374,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
assertTrue("Not a method declaration", node.getNodeType() == ASTNode.METHOD_DECLARATION);
MethodDeclaration method = (MethodDeclaration) node;
assertEquals("Method should not be malformed", 0, (method.getFlags() & ASTNode.MALFORMED));
-
+
List statements = method.getBody().statements();
VariableDeclarationStatement statement = (VariableDeclarationStatement) statements.get(0);
VariableDeclarationFragment fragment = (VariableDeclarationFragment) statement.fragments().get(0);
@@ -3419,13 +3419,13 @@ public class ASTConverter18Test extends ConverterTestSetup {
" int effectivelyFinalVar = 2;\n" +
" int nonFinalVar = 3;\n" +
" nonFinalVar = 4; \n" +
- " q = 0;\n" +
- " try (FIS fis = new FIS()) {\n" +
+ " q = 0;\n" +
+ " try (FIS fis = new FIS()) {\n" +
" if (q == 0) { throw new IOError(); } else { throw new IllegalStateException(); }\n" +
- " } catch (IOError | IllegalStateException implicitlyFinalExc) {\n" +
- " // implicitlyFinalExc is not effectively final! \n" +
- " } catch (Exception effectivelyFinalExc) { \n" +
- " }\n" +
+ " } catch (IOError | IllegalStateException implicitlyFinalExc) {\n" +
+ " // implicitlyFinalExc is not effectively final! \n" +
+ " } catch (Exception effectivelyFinalExc) { \n" +
+ " }\n" +
" }\n" +
"}\n" +
"class IOError extends Exception {private static final long serialVersionUID = 1L;}\n" +
@@ -3450,7 +3450,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
variable = (SingleVariableDeclaration) params.get(1);
binding = variable.resolveBinding();
assertFalse("Should not be effectively final", binding.isEffectivelyFinal());
-
+
List statements = method.getBody().statements();
VariableDeclarationStatement statement = (VariableDeclarationStatement) statements.get(0);
List fragments = statement.fragments();
@@ -3468,7 +3468,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
fragment = (VariableDeclarationFragment) fragments.get(0);
binding = fragment.resolveBinding();
assertFalse("Should not be effectively final", binding.isEffectivelyFinal());
-
+
TryStatement tryStmt = (TryStatement) statements.get(5);
List resources = tryStmt.resources();
VariableDeclarationExpression resourceExp = (VariableDeclarationExpression) resources.get(0);
@@ -3499,9 +3499,9 @@ public class ASTConverter18Test extends ConverterTestSetup {
" I j = new I () {\n" +
" public void foo() {\n" +
" System.out.println(is);\n" +
- " }\n" +
- " };\n" +
- " }\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
" }\n" +
"}\n";
this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true/*resolve*/);
@@ -3553,7 +3553,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
assertTrue(false);
}
}
-
+
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=424138
*/
@@ -3683,7 +3683,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
ASTNode node = buildAST(contents, this.workingCopy, false);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
CompilationUnit compilationUnit = (CompilationUnit) node;
- assertProblemsSize(compilationUnit, 2, "The method goo(I) in the type X is not applicable for the arguments ((<no type> s) -> {})\n" +
+ assertProblemsSize(compilationUnit, 2, "The method goo(I) in the type X is not applicable for the arguments ((<no type> s) -> {})\n" +
"The target type of this expression must be a functional interface");
node = getASTNode(compilationUnit, 1);
assertEquals("Not a type declaration", ASTNode.TYPE_DECLARATION, node.getNodeType());
@@ -4002,7 +4002,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
checkSourceRange(variableDeclaration, "int x", contents);
}
/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=425743, [1.8][api] CompilationUnit#findDeclaringNode(IBinding binding) returns null for type inferred lambda parameter
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=425743, [1.8][api] CompilationUnit#findDeclaringNode(IBinding binding) returns null for type inferred lambda parameter
*/
public void testBug425743() throws JavaModelException {
String contents =
@@ -4037,7 +4037,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
" };\n" +
" static class Inner {\n" +
" public Inner(Test2 Test2.this){}\n" +
- " public Inner(Inner Inner.this, int i){}\n" +
+ " public Inner(Inner Inner.this, int i){}\n" +
" }\n" +
"}\n"+
"interface I {}";
@@ -4050,7 +4050,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
Type receiver = method.getReceiverType();
assertNotNull("Receiver should not be null", receiver);
assertEquals("Incorrect receiver type", "X", receiver.toString());
-
+
method = (MethodDeclaration) typeDecl.bodyDeclarations().get(1);
receiver = method.getReceiverType();
assertNotNull("Receiver should not be null", receiver);
@@ -4116,7 +4116,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
annotations = binding.getTypeAnnotations();
assertEquals("Incorrect no of type annotations", 1, annotations.length);
assertEquals("Incorrect annotation", "@A()", annotations[0].toString());
-
+
node = getASTNode(compilationUnit, 3, 1);
assertTrue("Not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION);
field = (FieldDeclaration) node;
@@ -4127,17 +4127,17 @@ public class ASTConverter18Test extends ConverterTestSetup {
assertEquals("Incorrect type binding", "@C String [] @A [] @B [] @C []", binding.toString());
dims = binding.getDimensions();
assertEquals("Incorrect no of dimensions", 4, dims);
-
+
binding = original.createArrayType(-1);
assertEquals("Incorrect type binding", "@C String @B [] @C []", binding.toString());
dims = binding.getDimensions();
assertEquals("Incorrect no of dimensions", 2, dims);
-
+
binding = original.createArrayType(-2);
assertEquals("Incorrect type binding", "@C String @C []", binding.toString());
dims = binding.getDimensions();
assertEquals("Incorrect no of dimensions", 1, dims);
-
+
node = getASTNode(compilationUnit, 3, 2);
assertTrue("Not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION);
field = (FieldDeclaration) node;
@@ -4172,7 +4172,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
CompilationUnit compilationUnit = (CompilationUnit) node;
assertProblemsSize(compilationUnit, 0);
-
+
node = getASTNode(compilationUnit, 3, 0);
assertEquals("Not a method declaration", ASTNode.METHOD_DECLARATION, node.getNodeType());
Type type = ((MethodDeclaration) node).getReturnType2();
@@ -4200,7 +4200,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
assertEquals("Incorrect type binding", "@C int", binding.toString());
binding = binding.createArrayType(2);
assertEquals("Incorrect type binding", "@C int [] []", binding.toString());
-
+
node = getASTNode(compilationUnit, 3, 2);
assertEquals("Not a method declaration", ASTNode.METHOD_DECLARATION, node.getNodeType());
type = ((MethodDeclaration) node).getReturnType2();
@@ -4210,7 +4210,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
assertEquals("Incorrect type binding", "@A @B X [] []", binding.toString());
dims = binding.getDimensions();
assertEquals("Incorrect no of dimensions", 2, dims);
-
+
node = getASTNode(compilationUnit, 3, 3);
assertEquals("Not a method declaration", ASTNode.METHOD_DECLARATION, node.getNodeType());
type = ((MethodDeclaration) node).getReturnType2();
@@ -4220,7 +4220,7 @@ public class ASTConverter18Test extends ConverterTestSetup {
assertEquals("Incorrect type binding", "@A X.Y [] [] @B []", binding.toString());
dims = binding.getDimensions();
assertEquals("Incorrect no of dimensions", 3, dims);
-
+
binding = original.createArrayType(-1);
assertEquals("Incorrect type binding", "@A X.Y @B []", binding.toString());
dims = binding.getDimensions();
@@ -4235,20 +4235,20 @@ public class ASTConverter18Test extends ConverterTestSetup {
" void m(N arg);\n" +
"}\n" +
"interface Baz extends Foo<Integer, Integer> {}\n";
-
+
this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true);
ASTNode node = buildAST(contents, this.workingCopy);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
CompilationUnit compilationUnit = (CompilationUnit) node;
assertProblemsSize(compilationUnit, 0);
-
+
TypeDeclaration type = (TypeDeclaration) getASTNode(compilationUnit, 0);
assertEquals("Not a Type declaration", ASTNode.TYPE_DECLARATION, type.getNodeType());
ITypeBinding binding = type.resolveBinding();
assertNotNull("Binding should not be null", binding);
IMethodBinding functionalInterfaceMethod = binding.getFunctionalInterfaceMethod();
assertNull("Should not be a functional interface", functionalInterfaceMethod);
-
+
type = (TypeDeclaration) getASTNode(compilationUnit, 1);
assertEquals("Not a Type declaration", ASTNode.TYPE_DECLARATION, type.getNodeType());
binding = type.resolveBinding();
@@ -4266,27 +4266,27 @@ public class ASTConverter18Test extends ConverterTestSetup {
"interface K extends I, J {}\n" +
"class X {}\n" +
"class Y extends X {}\n";
-
+
this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true);
ASTNode node = buildAST(contents, this.workingCopy);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
CompilationUnit compilationUnit = (CompilationUnit) node;
assertProblemsSize(compilationUnit, 0);
-
+
TypeDeclaration type = (TypeDeclaration) getASTNode(compilationUnit, 0);
assertEquals("Not a Type declaration", ASTNode.TYPE_DECLARATION, type.getNodeType());
ITypeBinding binding = type.resolveBinding();
assertNotNull("Binding should not be null", binding);
IMethodBinding functionalInterfaceMethod = binding.getFunctionalInterfaceMethod();
assertNotNull("Should not be a functional interface", functionalInterfaceMethod);
-
+
type = (TypeDeclaration) getASTNode(compilationUnit, 1);
assertEquals("Not a Type declaration", ASTNode.TYPE_DECLARATION, type.getNodeType());
binding = type.resolveBinding();
assertNotNull("Binding should not be null", binding);
functionalInterfaceMethod = binding.getFunctionalInterfaceMethod();
assertNotNull("Should be a functional interface", functionalInterfaceMethod);
-
+
type = (TypeDeclaration) getASTNode(compilationUnit, 2);
assertEquals("Not a Type declaration", ASTNode.TYPE_DECLARATION, type.getNodeType());
binding = type.resolveBinding();
@@ -4299,27 +4299,27 @@ public class ASTConverter18Test extends ConverterTestSetup {
// round-trip for binding keys of CaptureBinding18:
public void testBug425183a() throws JavaModelException {
- String contents =
+ String contents =
"interface Comparator<T> {\n" +
" public static <T extends Comparable<? super T>> Comparator<T> naturalOrder() { return null; }\n" +
- "}\n" +
+ "}\n" +
"public class Bug425183a {\n" +
- " @SuppressWarnings(\"unchecked\")\n" +
- " <T> void test() {\n" +
+ " @SuppressWarnings(\"unchecked\")\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 Bug425183a().test();\n" +
" }\n" +
"}\n";
-
+
this.workingCopy = getWorkingCopy("/Converter18/src/Bug425183a.java", true);
ASTNode node = buildAST(contents, this.workingCopy);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
CompilationUnit compilationUnit = (CompilationUnit) node;
assertProblemsSize(compilationUnit, 0);
-
+
String selection = "naturalOrder";
int start = contents.lastIndexOf(selection);
int length = selection.length();
@@ -4338,13 +4338,13 @@ public void testBug425183a() throws JavaModelException {
assertBindingsEqual(
keys[0],
requestor.getBindings(keys));
-
+
// assert that KeyToSignature doesn't throw AIOOBE, the result containing '!*' is a workaround for now, see https://bugs.eclipse.org/429264
assertEquals("wrong signature", "<T::Ljava.lang.Comparable<-TT;>;>()LComparator<!*>;", new BindingKey(method.getKey()).toSignature());
}
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=432051
- *
+ *
* @throws JavaModelException
*/
public void testBug432051() throws JavaModelException {
@@ -4380,7 +4380,7 @@ public void testBug432051() throws JavaModelException {
}
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=426977
- *
+ *
* @throws JavaModelException
*/
public void testBug426977() throws JavaModelException {
@@ -4917,7 +4917,7 @@ public void testBug432614() throws JavaModelException {
}
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=447062
- *
+ *
* @throws JavaModelException
*/
public void testBug447062() throws JavaModelException {
@@ -4949,7 +4949,7 @@ public void testBug447062() throws JavaModelException {
}
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=399793
- *
+ *
* @throws JavaModelException
*/
public void testBug425601_001() throws JavaModelException {
@@ -4982,7 +4982,7 @@ public void testBug425601_001() throws JavaModelException {
FieldDeclaration[] fields = typedeclaration.getFields();
ITypeBinding binding = fields[0].getType().resolveBinding();
assertTrue(binding.isDeprecated());
- binding = fields[3].getType().resolveBinding();
+ binding = fields[3].getType().resolveBinding();
assertTrue(binding.isDeprecated());
binding = fields[1].getType().resolveBinding(); // Middle Case One
assertTrue(binding.isDeprecated());
@@ -4994,7 +4994,7 @@ public void testBug425601_001() throws JavaModelException {
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=399793
- *
+ *
* @throws JavaModelException
*/
public void testBug425601_002() throws JavaModelException {
@@ -5027,7 +5027,7 @@ public void testBug425601_002() throws JavaModelException {
FieldDeclaration[] fields = typedeclaration.getFields();
ITypeBinding binding = fields[0].getType().resolveBinding();
assertTrue(!binding.isDeprecated());
- binding = fields[3].getType().resolveBinding();
+ binding = fields[3].getType().resolveBinding();
assertTrue(binding.isDeprecated());
binding = fields[1].getType().resolveBinding(); // Middle Case One
assertTrue(binding.isDeprecated());
@@ -5039,8 +5039,8 @@ public void testBug425601_002() throws JavaModelException {
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=44000
- *
- * @bug Bug 440000 [1.8][dom] MethodReference#resolveMethodBinding() API should return null for CreationReference of an ArrayType
+ *
+ * @bug Bug 440000 [1.8][dom] MethodReference#resolveMethodBinding() API should return null for CreationReference of an ArrayType
* @throws JavaModelException
*/
public void testBug440000_001() throws JavaModelException {
@@ -5065,7 +5065,7 @@ public void testBug440000_001() throws JavaModelException {
}
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=459344
- *
+ *
* @throws JavaModelException
*/
public void testBug459344_001() throws JavaModelException {
@@ -5099,10 +5099,10 @@ public void testBug459344_001() throws JavaModelException {
*/
public void testBug460186() throws JavaModelException {
String contents =
- "class Foo {\n" +
- " void foo()\n {" +
- " foo();[]\n" +
- " }\n" +
+ "class Foo {\n" +
+ " void foo()\n {" +
+ " foo();[]\n" +
+ " }\n" +
"}";
this.workingCopy = getWorkingCopy("/Converter18/src/test460186/NPE.java", contents, false/*computeProblems*/);
IJavaProject javaProject = this.workingCopy.getJavaProject();
@@ -5123,11 +5123,11 @@ public void testBug460186() throws JavaModelException {
public void testBug443232() throws JavaModelException {
String contents =
"package test443232;\n" +
- "public class E21 {\n" +
- " {private int[] nums;\n" +
- " void foo() {\n" +
- " nums\n" +
- " }\n" +
+ "public class E21 {\n" +
+ " {private int[] nums;\n" +
+ " void foo() {\n" +
+ " nums\n" +
+ " }\n" +
"}";
this.workingCopy = getWorkingCopy("/Converter18/src/test443232/E21.java", contents, false/*computeProblems*/);
IJavaProject javaProject = this.workingCopy.getJavaProject();
@@ -5145,7 +5145,7 @@ public void testBug443232() throws JavaModelException {
}
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=429813
- *
+ *
* @throws JavaModelException
*/
public void test429813() throws JavaModelException {
@@ -5248,7 +5248,7 @@ public void testBug470794_001() throws JavaModelException {
assertEquals("Not a method Declaration", ASTNode.METHOD_DECLARATION, node.getNodeType());
MethodDeclaration method = (MethodDeclaration) node;
assertEquals("Method should not be malformed", 0, (method.getFlags() & ASTNode.MALFORMED));
-
+
List statements = method.getBody().statements();
VariableDeclarationStatement statement = (VariableDeclarationStatement) statements.get(0);
fragment = (VariableDeclarationFragment) statement.fragments().get(0);
@@ -5270,18 +5270,18 @@ public void testBug470794_001() throws JavaModelException {
public void testBug500503() throws JavaModelException {
String contents =
"package test432051;\n" +
- "public class Colon\n" +
- "{\n" +
- " void foo()\n" +
- " {\n" +
- " }\n" +
- "\n" +
- " void bar()\n" +
- " {\n" +
- " run( this:foo );\n" +
- " }\n" +
- " \n" +
- " void run( Runnable r ) { }\n" +
+ "public class Colon\n" +
+ "{\n" +
+ " void foo()\n" +
+ " {\n" +
+ " }\n" +
+ "\n" +
+ " void bar()\n" +
+ " {\n" +
+ " run( this:foo );\n" +
+ " }\n" +
+ " \n" +
+ " void run( Runnable r ) { }\n" +
"}\n";
this.workingCopy = getWorkingCopy("/Converter18/src/test432051/Colon.java", contents, true/*computeProblems*/);
IJavaProject javaProject = this.workingCopy.getJavaProject();
@@ -5381,7 +5381,7 @@ public void testBug526449_001() throws JavaModelException {
public void testLambdaSynthetic() throws JavaModelException {
this.workingCopy = getWorkingCopy("/Converter18/src/xyz/X.java",
true/* resolve */);
- String contents =
+ String contents =
"package xyz;\n"+
"\n"+
"interface Function<T, R> {\n"+
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter9Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter9Test.java
index ae7f6c176..13fa8ae69 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter9Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter9Test.java
@@ -44,7 +44,7 @@ public class ASTConverter9Test extends ConverterTestSetup {
ICompilationUnit workingCopy;
private static final String jcl9lib = "CONVERTER_JCL9_LIB";
-
+
public void setUpSuite() throws Exception {
super.setUpSuite();
@@ -109,9 +109,9 @@ public class ASTConverter9Test extends ConverterTestSetup {
checkSourceRange(simpleName, "y1", source);
variableDeclarationExpression = (VariableDeclarationExpression) list.get(2);
checkSourceRange(variableDeclarationExpression, "final Y y2 = new Y()", source);
-
+
}
-
+
public void testBug497719_0002() throws JavaModelException {
String contents =
"import java.io.IOException;\n" +
@@ -219,7 +219,7 @@ public class ASTConverter9Test extends ConverterTestSetup {
IJavaProject project1 = createJavaProject("ConverterTests9", new String[] {"src"}, new String[] {jcl9lib}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String content =
+ String content =
"module first {\n" +
" requires second.third;\n" +
" exports pack1.X11 to org.eclipse.jdt;\n" +
@@ -314,15 +314,15 @@ public class ASTConverter9Test extends ConverterTestSetup {
+ "}";
this.workingCopies[0] = getWorkingCopy(
"/Converter9/src/module-info.java", content);
-
+
CompilationUnit unit = (CompilationUnit) runConversion(this.ast.apiLevel(), this.workingCopies[0], false/*no bindings*/);
ModuleDeclaration moduleDecl = unit.getModule();
-
+
assertTrue(moduleDecl.isOpen());
checkSourceRange(moduleDecl, content, content);
List<ModuleDirective> stmts = moduleDecl.moduleStatements();
assertTrue(stmts.size() > 0);
-
+
int count = 0;
RequiresDirective req = (RequiresDirective) stmts.get(count++);
checkSourceRange(req, "requires one;", content);
@@ -351,7 +351,7 @@ public class ASTConverter9Test extends ConverterTestSetup {
IJavaProject project1 = createJavaProject("ConverterTests9", new String[] {"src"}, new String[] {jcl9lib}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String content =
+ String content =
"module first {\n" +
" requires transitive static second.third;\n" +
" exports pack1.X11 to org.eclipse.jdt;\n" +
@@ -394,10 +394,10 @@ public class ASTConverter9Test extends ConverterTestSetup {
IJavaProject project1 = createJavaProject("ConverterTests9", new String[] {"src"}, new String[] {jcl9lib}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module first {\n" +
" requires second;\n" +
- " uses pack22.I22;\n" +
+ " uses pack22.I22;\n" +
" provides pack22.I22 with pack1.X11;\n" +
"}";
createFile("/ConverterTests9/src/module-info.java", fileContent);
@@ -409,7 +409,7 @@ public class ASTConverter9Test extends ConverterTestSetup {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {jcl9lib}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module second {\n" +
" exports pack22 to first;\n" +
"}";
@@ -425,7 +425,7 @@ public class ASTConverter9Test extends ConverterTestSetup {
IJavaProject project3 = createJavaProject("third", new String[] {"src"}, new String[] {jcl9lib}, "bin", "9");
project3.open(null);
addClasspathEntry(project3, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String thirdFile =
+ String thirdFile =
"module third {\n" +
" requires first;\n" +
"}";
@@ -453,7 +453,7 @@ public class ASTConverter9Test extends ConverterTestSetup {
moduleBinding = (IModuleBinding) binding;
assertModuleFirstDetails(moduleBinding);
-
+
// indirectly fetch the binary version of "first" via "third":
ICompilationUnit sourceUnit3 = getCompilationUnit("third" , "src", "", "module-info.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
ASTNode unit3 = runConversion(this.ast.apiLevel(), sourceUnit3, true);
@@ -462,7 +462,7 @@ public class ASTConverter9Test extends ConverterTestSetup {
IModuleBinding firstModAsBinary = moduleDecl3.resolveBinding().getRequiredModules()[1]; // skip java.base
assertModuleFirstDetails(firstModAsBinary);
-
+
} finally {
deleteProject("ConverterTests9");
deleteProject("second");
@@ -475,7 +475,7 @@ public class ASTConverter9Test extends ConverterTestSetup {
String name = moduleBinding.getName();
assertTrue("Module Name null", name != null);
assertTrue("Wrong Module Name", name.equals("first"));
-
+
assertTrue("Module Binding null", moduleBinding != null);
name = moduleBinding.getName();
assertTrue("Module Name null", name != null);
@@ -516,7 +516,7 @@ public class ASTConverter9Test extends ConverterTestSetup {
IJavaProject project1 = createJavaProject("ConverterTests9", new String[] {"src"}, new String[] {jcl9lib}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module first {\n" +
" requires second;\n" +
" provides pack22.I22 with pack1.X11;\n" +
@@ -530,7 +530,7 @@ public class ASTConverter9Test extends ConverterTestSetup {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {jcl9lib}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module second {\n" +
" exports pack22 to first;\n" +
"}";
@@ -572,7 +572,7 @@ public class ASTConverter9Test extends ConverterTestSetup {
IJavaProject project1 = createJavaProject("ConverterTests9", new String[] {"src"}, new String[] {jcl9lib}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"open module first {\n" +
" requires second;\n" +
" provides pack22.I22 with pack1.X11;\n" +
@@ -586,7 +586,7 @@ public class ASTConverter9Test extends ConverterTestSetup {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {jcl9lib}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"open module second {\n" +
" exports pack22 to first;\n" +
"}";
@@ -607,7 +607,7 @@ public class ASTConverter9Test extends ConverterTestSetup {
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, unit1.getNodeType());
ModuleDeclaration moduleDecl1 = ((CompilationUnit) unit1).getModule();
checkSourceRange(moduleDecl1, fileContent, fileContent);
-
+
Name name = moduleDecl1.getName();
IModuleBinding moduleBinding = (IModuleBinding) name.resolveBinding();
assertTrue("Module Binding null", moduleBinding != null);
@@ -744,11 +744,11 @@ public class ASTConverter9Test extends ConverterTestSetup {
try {
project1 = createJavaProject("ConverterTests9", new String[] {"src"}, new String[] {jcl9lib}, "bin", "9");
project1.open(null);
- String fileContent =
+ String fileContent =
"open module first.module {\n" +
"}";
createFile("/ConverterTests9/src/module-info.java", fileContent);
-
+
IModuleDescription firstModule = project1.findModule("first.module", null);
IJavaElement[] elements = new IJavaElement[] {
firstModule,
@@ -774,17 +774,17 @@ public class ASTConverter9Test extends ConverterTestSetup {
try {
project1 = createJavaProject("ConverterTests9", new String[] {"src"}, new String[] {jcl9lib}, "bin", "9");
project1.open(null);
- String fileContent =
+ String fileContent =
"module first.module { }";
createFile("/ConverterTests9/src/module-info.java", fileContent);
-
+
project1.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
-
+
project2 = createJavaProject("second", new String[] {"src"}, new String[] {jcl9lib}, "bin", "9");
- addClasspathEntry(project2, JavaCore.newLibraryEntry(new Path("/ConverterTests9/bin"), null, null, null,
- new IClasspathAttribute[] { JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true") }, false));
+ addClasspathEntry(project2, JavaCore.newLibraryEntry(new Path("/ConverterTests9/bin"), null, null, null,
+ new IClasspathAttribute[] { JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true") }, false));
project2.open(null);
-
+
IModuleDescription firstModule = null;
for (IPackageFragmentRoot root : project2.getPackageFragmentRoots()) {
IModuleDescription module = root.getModuleDescription();
@@ -1137,7 +1137,7 @@ public class ASTConverter9Test extends ConverterTestSetup {
deleteProject("second");
}
}
- //
+ //
public void testBug518794_001() throws Exception {
try {
@@ -1373,7 +1373,7 @@ public class ASTConverter9Test extends ConverterTestSetup {
ModuleDirective stat = (ModuleDirective) moduleDeclaration2.moduleStatements().get(0);
IBinding requiredModule = ((RequiresDirective) stat).getName().resolveBinding();
validateBinding.accept(requiredModule);
-
+
} finally {
deleteProject("First");
deleteProject("Second");
@@ -1389,15 +1389,15 @@ public class ASTConverter9Test extends ConverterTestSetup {
project1.open(null);
createFolder("/Foo/src/foo");
createFile("/Foo/src/foo/Foo.java",
- "package foo;\n" +
- "\n" +
- "public class Foo {\n" +
- " public interface MyInterface<T> {\n" +
- " public void perform(T t);\n" +
- " }\n" +
- " public <T> MyInterface<T> createMyInterface() {\n" +
+ "package foo;\n" +
+ "\n" +
+ "public class Foo {\n" +
+ " public interface MyInterface<T> {\n" +
+ " public void perform(T t);\n" +
+ " }\n" +
+ " public <T> MyInterface<T> createMyInterface() {\n" +
" return new My\n" + // incomplete, use case is: completion after "My"
- " }\n" +
+ " }\n" +
"}\n");
ASTParser parser = ASTParser.newParser(this.ast.apiLevel());
parser.setProject(project1);
@@ -1443,7 +1443,7 @@ public class ASTConverter9Test extends ConverterTestSetup {
" }\n" +
"}\n");
ICompilationUnit cuD = getCompilationUnit("/Foo/src/Test.java");
-
+
p.setOption(JavaCore.COMPILER_PB_DEPRECATION, JavaCore.ERROR);
ASTParser parser = ASTParser.newParser(AST_INTERNAL_JLS11);
parser.setProject(p);
@@ -1454,20 +1454,20 @@ public class ASTConverter9Test extends ConverterTestSetup {
org.eclipse.jdt.core.dom.CompilationUnit cuAST = (org.eclipse.jdt.core.dom.CompilationUnit) parser.createAST(null);
IProblem[] problems = cuAST.getProblems();
assertProblems("Unexpected problems",
- "1. ERROR in /Foo/src/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 /Foo/src/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 /Foo/src/Test.java (at line 1)\n" +
- " public class Test implements test.Screen.Component {}\n" +
- " ^^^^^^^^^\n" +
- "The type Screen.Component is deprecated\n" +
+ "1. ERROR in /Foo/src/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 /Foo/src/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 /Foo/src/Test.java (at line 1)\n" +
+ " public class Test implements test.Screen.Component {}\n" +
+ " ^^^^^^^^^\n" +
+ "The type Screen.Component is deprecated\n" +
"----------\n",
problems, source.toCharArray());
} finally {
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST3Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST3Test.java
index a86f1d8cf..971b748fc 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST3Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST3Test.java
@@ -25,7 +25,7 @@ import org.eclipse.jdt.core.util.IModifierConstants;
@SuppressWarnings({"rawtypes"})
public class ASTConverterAST3Test extends ConverterTestSetup {
-
+
public void setUpSuite() throws Exception {
super.setUpSuite();
this.ast = AST.newAST(getJLS3(), false);
@@ -41,7 +41,7 @@ public class ASTConverterAST3Test extends ConverterTestSetup {
public static Test suite() {
return buildModelTestSuite(ASTConverterAST3Test.class);
}
- /**
+ /**
* Internal access method to VariableDeclarationFragment#setExtraDimensions() for avoiding deprecated warnings.
*
* @param node
@@ -51,7 +51,7 @@ public class ASTConverterAST3Test extends ConverterTestSetup {
private void internalSetExtraDimensions(VariableDeclarationFragment node, int dimensions) {
node.setExtraDimensions(dimensions);
}
- /**
+ /**
* Internal access method to MethodDeclaration#thrownExceptions() for avoiding deprecated warnings.
* @deprecated
*/
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST4Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST4Test.java
index 8d2f911f0..6eb7ba762 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST4Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST4Test.java
@@ -41,7 +41,7 @@ public class ASTConverterAST4Test extends ConverterTestSetup {
public static Test suite() {
return buildModelTestSuite(ASTConverterAST4Test.class);
}
- /**
+ /**
* Internal access method to VariableDeclarationFragment#setExtraDimensions() for avoiding deprecated warnings.
*
* @param node
@@ -51,7 +51,7 @@ public class ASTConverterAST4Test extends ConverterTestSetup {
private void internalSetExtraDimensions(VariableDeclarationFragment node, int dimensions) {
node.setExtraDimensions(dimensions);
}
- /**
+ /**
* Internal access method to MethodDeclaration#thrownExceptions() for avoiding deprecated warnings.
* @deprecated
*/
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST8Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST8Test.java
index 8fe1f1dc7..1408641b8 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST8Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST8Test.java
@@ -42,7 +42,7 @@ public class ASTConverterAST8Test extends ConverterTestSetup {
public static Test suite() {
return buildModelTestSuite(ASTConverterAST8Test.class);
}
- /**
+ /**
* Internal access method to MethodDeclaration#thrownExceptions() for avoiding deprecated warnings.
* @deprecated
*/
@@ -8158,7 +8158,7 @@ public class ASTConverterAST8Test extends ConverterTestSetup {
List thrownExceptions = internalThrownExceptions(methodDeclaration);
assertEquals("Wrong size", 1, thrownExceptions.size()); //$NON-NLS-1$
Name name = (Name) thrownExceptions.get(0);
- binding = name.resolveBinding();
+ binding = name.resolveBinding();
} else {
List thrownExceptionTypes = methodDeclaration.thrownExceptionTypes();
assertEquals("Wrong size", 1, thrownExceptionTypes.size()); //$NON-NLS-1$
@@ -9779,7 +9779,7 @@ public class ASTConverterAST8Test extends ConverterTestSetup {
assertTrue("Not an superconstructorinvocation", statement.getNodeType() == ASTNode.SUPER_CONSTRUCTOR_INVOCATION); //$NON-NLS-1$
checkSourceRange(statement, "super();", source); //$NON-NLS-1$
}
-
+
public void test0401() throws JavaModelException {
ICompilationUnit sourceUnit = getCompilationUnit("Converter18" , "src", "testBug496596", "Test.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
ASTNode result = runConversion(getJLS8(), sourceUnit, true);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterBindingsTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterBindingsTest.java
index 00ea0a5ad..40e0059c9 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterBindingsTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterBindingsTest.java
@@ -83,7 +83,7 @@ import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
@SuppressWarnings({"rawtypes", "unchecked"})
public class ASTConverterBindingsTest extends ConverterTestSetup {
private static final boolean DEBUG = false;
-
+
static class BindingsCollector extends ASTVisitor {
public ArrayList arrayList;
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterBugsTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterBugsTest.java
index 5368096fe..12f68ffaa 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterBugsTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterBugsTest.java
@@ -811,39 +811,39 @@ public void testBug218824a() throws JavaModelException {
"}\n");
assertASTResult(
- "===== AST =====\n" +
- "package a;\n" +
- "public class X {\n" +
- " public void takeParam( int i){\n" +
- " }\n" +
- " void test(){\n" +
- " char c=\'a\';\n" +
- " public void takeParam;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "===== Details =====\n" +
- "1:No corresponding node\n" +
- "===== Problems =====\n" +
- "1. ERROR in /Converter15/src/a/X.java (at line 9)\n" +
- " public void takeParam(int i) {\n" +
- " ^^^^\n" +
- "Syntax error on token \"void\", record expected\n" +
- "2. ERROR in /Converter15/src/a/X.java (at line 9)\n" +
- " public void takeParam(int i) {\n" +
- " ^^^^^^^^^\n" +
- "void is an invalid type for the variable takeParam\n" +
- "3. ERROR in /Converter15/src/a/X.java (at line 13)\n" +
- " void test() {\n" +
- " ^^^^\n" +
- "Syntax error on token \"void\", record expected\n" +
- "4. ERROR in /Converter15/src/a/X.java (at line 14)\n" +
- " char c = \'a\';\n" +
- " ^\n" +
- "Syntax error on token \";\", { expected after this token\n" +
- "5. ERROR in /Converter15/src/a/X.java (at line 16)\n" +
- " }takeParam((int) c);\n" +
- " ^\n" +
+ "===== AST =====\n" +
+ "package a;\n" +
+ "public class X {\n" +
+ " public void takeParam( int i){\n" +
+ " }\n" +
+ " void test(){\n" +
+ " char c=\'a\';\n" +
+ " public void takeParam;\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "===== Details =====\n" +
+ "1:No corresponding node\n" +
+ "===== Problems =====\n" +
+ "1. ERROR in /Converter15/src/a/X.java (at line 9)\n" +
+ " public void takeParam(int i) {\n" +
+ " ^^^^\n" +
+ "Syntax error on token \"void\", record expected\n" +
+ "2. ERROR in /Converter15/src/a/X.java (at line 9)\n" +
+ " public void takeParam(int i) {\n" +
+ " ^^^^^^^^^\n" +
+ "void is an invalid type for the variable takeParam\n" +
+ "3. ERROR in /Converter15/src/a/X.java (at line 13)\n" +
+ " void test() {\n" +
+ " ^^^^\n" +
+ "Syntax error on token \"void\", record expected\n" +
+ "4. ERROR in /Converter15/src/a/X.java (at line 14)\n" +
+ " char c = \'a\';\n" +
+ " ^\n" +
+ "Syntax error on token \";\", { expected after this token\n" +
+ "5. ERROR in /Converter15/src/a/X.java (at line 16)\n" +
+ " }takeParam((int) c);\n" +
+ " ^\n" +
"Syntax error, insert \"}\" to complete RecordBody\n",
result);
}
@@ -1058,25 +1058,25 @@ public void testBug274898a() throws JavaModelException {
"}\n");
assertASTResult(
- "===== AST =====\n" +
- "package a;\n" +
- "public class X {\n" +
- " public void foo(){\n" +
- " [*1*]Object o;[*1*]\n" +
- " [*2*]new Object(){\n" +
- " }\n" +
- ";[*2*]\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "===== Details =====\n" +
- "1:VARIABLE_DECLARATION_STATEMENT,[72,15],,,[N/A]\n" +
- "2:EXPRESSION_STATEMENT,[87,14],,,[N/A]\n" +
- "2:CLASS_INSTANCE_CREATION,[87,14],,RECOVERED,[N/A]\n" +
- "===== Problems =====\n" +
- "1. ERROR in /Converter15/src/a/X.java (at line 4)\n" +
- " Object o = new new Object(){}; \n" +
- " ^^^\n" +
+ "===== AST =====\n" +
+ "package a;\n" +
+ "public class X {\n" +
+ " public void foo(){\n" +
+ " [*1*]Object o;[*1*]\n" +
+ " [*2*]new Object(){\n" +
+ " }\n" +
+ ";[*2*]\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "===== Details =====\n" +
+ "1:VARIABLE_DECLARATION_STATEMENT,[72,15],,,[N/A]\n" +
+ "2:EXPRESSION_STATEMENT,[87,14],,,[N/A]\n" +
+ "2:CLASS_INSTANCE_CREATION,[87,14],,RECOVERED,[N/A]\n" +
+ "===== Problems =====\n" +
+ "1. ERROR in /Converter15/src/a/X.java (at line 4)\n" +
+ " Object o = new new Object(){}; \n" +
+ " ^^^\n" +
"Syntax error on token \"new\", delete this token\n",
result);
}
@@ -1091,25 +1091,25 @@ public void testBug274898b() throws JavaModelException {
"}\n");
assertASTResult(
- "===== AST =====\n" +
- "package a;\n" +
- "public class X {\n" +
- " public void foo(){\n" +
- " [*1*]Object o;[*1*]\n" +
- " [*2*]new Object(){\n" +
- " }\n" +
- ";[*2*]\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "===== Details =====\n" +
- "1:VARIABLE_DECLARATION_STATEMENT,[72,17],,,[N/A]\n" +
- "2:EXPRESSION_STATEMENT,[89,14],,,[N/A]\n" +
- "2:CLASS_INSTANCE_CREATION,[89,14],,,[N/A]\n" +
- "===== Problems =====\n" +
- "1. ERROR in /Converter15/src/a/X.java (at line 4)\n" +
- " Object o = new # new Object(){}; \n" +
- " ^^^^^\n" +
+ "===== AST =====\n" +
+ "package a;\n" +
+ "public class X {\n" +
+ " public void foo(){\n" +
+ " [*1*]Object o;[*1*]\n" +
+ " [*2*]new Object(){\n" +
+ " }\n" +
+ ";[*2*]\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "===== Details =====\n" +
+ "1:VARIABLE_DECLARATION_STATEMENT,[72,17],,,[N/A]\n" +
+ "2:EXPRESSION_STATEMENT,[89,14],,,[N/A]\n" +
+ "2:CLASS_INSTANCE_CREATION,[89,14],,,[N/A]\n" +
+ "===== Problems =====\n" +
+ "1. ERROR in /Converter15/src/a/X.java (at line 4)\n" +
+ " Object o = new # new Object(){}; \n" +
+ " ^^^^^\n" +
"Syntax error on tokens, delete these tokens\n",
result);
}
@@ -1127,23 +1127,23 @@ public void testBug277204a() throws JavaModelException {
"}\n");
assertASTResult(
- "===== AST =====\n" +
- "package a;\n" +
- "public class X {\n" +
- "{\n" +
- "class Local {\n" +
- " [*1*]Object [*2*]x[*2*], [*3*]Local[*3*];[*1*]\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "===== Details =====\n" +
- "1:FIELD_DECLARATION,[69,16],,,[N/A]\n" +
- "2:VARIABLE_DECLARATION_FRAGMENT,[76,1],,,[VARIABLE,La/X$45$Local;.x)Ljava/lang/Object;,]\n" +
- "2:SIMPLE_NAME,[76,1],,,[VARIABLE,La/X$45$Local;.x)Ljava/lang/Object;,]\n" +
- "3:VARIABLE_DECLARATION_FRAGMENT,[79,5],,,[VARIABLE,La/X$45$Local;.Local)Ljava/lang/Object;,]\n" +
- "3:SIMPLE_NAME,[79,5],,,[VARIABLE,La/X$45$Local;.Local)Ljava/lang/Object;,]\n" +
- "===== Problems =====\n" +
+ "===== AST =====\n" +
+ "package a;\n" +
+ "public class X {\n" +
+ "{\n" +
+ "class Local {\n" +
+ " [*1*]Object [*2*]x[*2*], [*3*]Local[*3*];[*1*]\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "===== Details =====\n" +
+ "1:FIELD_DECLARATION,[69,16],,,[N/A]\n" +
+ "2:VARIABLE_DECLARATION_FRAGMENT,[76,1],,,[VARIABLE,La/X$45$Local;.x)Ljava/lang/Object;,]\n" +
+ "2:SIMPLE_NAME,[76,1],,,[VARIABLE,La/X$45$Local;.x)Ljava/lang/Object;,]\n" +
+ "3:VARIABLE_DECLARATION_FRAGMENT,[79,5],,,[VARIABLE,La/X$45$Local;.Local)Ljava/lang/Object;,]\n" +
+ "3:SIMPLE_NAME,[79,5],,,[VARIABLE,La/X$45$Local;.Local)Ljava/lang/Object;,]\n" +
+ "===== Problems =====\n" +
"No problem",
result);
}
@@ -1160,26 +1160,26 @@ public void testBug277204b() throws JavaModelException {
"}\n");
assertASTResult(
- "===== AST =====\n" +
- "package a;\n" +
- "public class X {\n" +
- "{\n" +
- "class Local {\n" +
- " [*1*]Object [*2*]x[*2*], [*3*]Local[*3*];[*1*]\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "===== Details =====\n" +
- "1:FIELD_DECLARATION,[69,26],,MALFORMED,[N/A]\n" +
- "2:VARIABLE_DECLARATION_FRAGMENT,[76,1],,,[VARIABLE,La/X$45$Local;.x)Ljava/lang/Object;,]\n" +
- "2:SIMPLE_NAME,[76,1],,,[VARIABLE,La/X$45$Local;.x)Ljava/lang/Object;,]\n" +
- "3:VARIABLE_DECLARATION_FRAGMENT,[79,5],,,[VARIABLE,La/X$45$Local;.Local)Ljava/lang/Object;,]\n" +
- "3:SIMPLE_NAME,[79,5],,,[VARIABLE,La/X$45$Local;.Local)Ljava/lang/Object;,]\n" +
- "===== Problems =====\n" +
- "1. ERROR in /Converter15/src/a/X.java (at line 5)\n" +
- " Object x, Local \n" +
- " ^^^^^\n" +
+ "===== AST =====\n" +
+ "package a;\n" +
+ "public class X {\n" +
+ "{\n" +
+ "class Local {\n" +
+ " [*1*]Object [*2*]x[*2*], [*3*]Local[*3*];[*1*]\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "===== Details =====\n" +
+ "1:FIELD_DECLARATION,[69,26],,MALFORMED,[N/A]\n" +
+ "2:VARIABLE_DECLARATION_FRAGMENT,[76,1],,,[VARIABLE,La/X$45$Local;.x)Ljava/lang/Object;,]\n" +
+ "2:SIMPLE_NAME,[76,1],,,[VARIABLE,La/X$45$Local;.x)Ljava/lang/Object;,]\n" +
+ "3:VARIABLE_DECLARATION_FRAGMENT,[79,5],,,[VARIABLE,La/X$45$Local;.Local)Ljava/lang/Object;,]\n" +
+ "3:SIMPLE_NAME,[79,5],,,[VARIABLE,La/X$45$Local;.Local)Ljava/lang/Object;,]\n" +
+ "===== Problems =====\n" +
+ "1. ERROR in /Converter15/src/a/X.java (at line 5)\n" +
+ " Object x, Local \n" +
+ " ^^^^^\n" +
"Syntax error, insert \";\" to complete ClassBodyDeclarations\n",
result);
}
@@ -1192,19 +1192,19 @@ public void testBug277204c() throws JavaModelException {
"}\n");
assertASTResult(
- "===== AST =====\n" +
- "package a;\n" +
- "public class X {\n" +
- " [*1*]Object [*2*]x[*2*], [*3*]Local[*3*];[*1*]\n" +
- "}\n" +
- "\n" +
- "===== Details =====\n" +
- "1:FIELD_DECLARATION,[32,16],,,[N/A]\n" +
- "2:VARIABLE_DECLARATION_FRAGMENT,[39,1],,,[VARIABLE,La/X;.x)Ljava/lang/Object;,]\n" +
- "2:SIMPLE_NAME,[39,1],,,[VARIABLE,La/X;.x)Ljava/lang/Object;,]\n" +
- "3:VARIABLE_DECLARATION_FRAGMENT,[42,5],,,[VARIABLE,La/X;.Local)Ljava/lang/Object;,]\n" +
- "3:SIMPLE_NAME,[42,5],,,[VARIABLE,La/X;.Local)Ljava/lang/Object;,]\n" +
- "===== Problems =====\n" +
+ "===== AST =====\n" +
+ "package a;\n" +
+ "public class X {\n" +
+ " [*1*]Object [*2*]x[*2*], [*3*]Local[*3*];[*1*]\n" +
+ "}\n" +
+ "\n" +
+ "===== Details =====\n" +
+ "1:FIELD_DECLARATION,[32,16],,,[N/A]\n" +
+ "2:VARIABLE_DECLARATION_FRAGMENT,[39,1],,,[VARIABLE,La/X;.x)Ljava/lang/Object;,]\n" +
+ "2:SIMPLE_NAME,[39,1],,,[VARIABLE,La/X;.x)Ljava/lang/Object;,]\n" +
+ "3:VARIABLE_DECLARATION_FRAGMENT,[42,5],,,[VARIABLE,La/X;.Local)Ljava/lang/Object;,]\n" +
+ "3:SIMPLE_NAME,[42,5],,,[VARIABLE,La/X;.Local)Ljava/lang/Object;,]\n" +
+ "===== Problems =====\n" +
"No problem",
result);
}
@@ -1217,22 +1217,22 @@ public void testBug277204d() throws JavaModelException {
"}\n");
assertASTResult(
- "===== AST =====\n" +
- "package a;\n" +
- "public class X {\n" +
- " [*1*]Object [*2*]x[*2*], [*3*]Local[*3*];[*1*]\n" +
- "}\n" +
- "\n" +
- "===== Details =====\n" +
- "1:FIELD_DECLARATION,[32,15],,MALFORMED|RECOVERED,[N/A]\n" +
- "2:VARIABLE_DECLARATION_FRAGMENT,[39,1],,,[VARIABLE,La/X;.x)Ljava/lang/Object;,]\n" +
- "2:SIMPLE_NAME,[39,1],,,[VARIABLE,La/X;.x)Ljava/lang/Object;,]\n" +
- "3:VARIABLE_DECLARATION_FRAGMENT,[42,5],,,[VARIABLE,La/X;.Local)Ljava/lang/Object;,]\n" +
- "3:SIMPLE_NAME,[42,5],,,[VARIABLE,La/X;.Local)Ljava/lang/Object;,]\n" +
- "===== Problems =====\n" +
- "1. ERROR in /Converter15/src/a/X.java (at line 3)\n" +
- " Object x, Local \n" +
- " ^^^^^\n" +
+ "===== AST =====\n" +
+ "package a;\n" +
+ "public class X {\n" +
+ " [*1*]Object [*2*]x[*2*], [*3*]Local[*3*];[*1*]\n" +
+ "}\n" +
+ "\n" +
+ "===== Details =====\n" +
+ "1:FIELD_DECLARATION,[32,15],,MALFORMED|RECOVERED,[N/A]\n" +
+ "2:VARIABLE_DECLARATION_FRAGMENT,[39,1],,,[VARIABLE,La/X;.x)Ljava/lang/Object;,]\n" +
+ "2:SIMPLE_NAME,[39,1],,,[VARIABLE,La/X;.x)Ljava/lang/Object;,]\n" +
+ "3:VARIABLE_DECLARATION_FRAGMENT,[42,5],,,[VARIABLE,La/X;.Local)Ljava/lang/Object;,]\n" +
+ "3:SIMPLE_NAME,[42,5],,,[VARIABLE,La/X;.Local)Ljava/lang/Object;,]\n" +
+ "===== Problems =====\n" +
+ "1. ERROR in /Converter15/src/a/X.java (at line 3)\n" +
+ " Object x, Local \n" +
+ " ^^^^^\n" +
"Syntax error, insert \";\" to complete ClassBodyDeclarations\n",
result);
}
@@ -1250,26 +1250,26 @@ public void testBug277204e() throws JavaModelException {
"}\n");
assertASTResult(
- "===== AST =====\n" +
- "package a;\n" +
- "public class X {\n" +
- "{\n" +
- "class Local {\n" +
- " [*1*]Object [*2*]x[*2*], [*3*]Local[*3*];[*1*]\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "===== Details =====\n" +
- "1:FIELD_DECLARATION,[69,42],,MALFORMED,[N/A]\n" +
- "2:VARIABLE_DECLARATION_FRAGMENT,[76,1],,,[VARIABLE,La/X$45$Local;.x)Ljava/lang/Object;,]\n" +
- "2:SIMPLE_NAME,[76,1],,,[VARIABLE,La/X$45$Local;.x)Ljava/lang/Object;,]\n" +
- "3:VARIABLE_DECLARATION_FRAGMENT,[95,5],,,[VARIABLE,La/X$45$Local;.Local)Ljava/lang/Object;,]\n" +
- "3:SIMPLE_NAME,[95,5],,,[VARIABLE,La/X$45$Local;.Local)Ljava/lang/Object;,]\n" +
- "===== Problems =====\n" +
- "1. ERROR in /Converter15/src/a/X.java (at line 6)\n" +
- " Local \n" +
- " ^^^^^\n" +
+ "===== AST =====\n" +
+ "package a;\n" +
+ "public class X {\n" +
+ "{\n" +
+ "class Local {\n" +
+ " [*1*]Object [*2*]x[*2*], [*3*]Local[*3*];[*1*]\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "===== Details =====\n" +
+ "1:FIELD_DECLARATION,[69,42],,MALFORMED,[N/A]\n" +
+ "2:VARIABLE_DECLARATION_FRAGMENT,[76,1],,,[VARIABLE,La/X$45$Local;.x)Ljava/lang/Object;,]\n" +
+ "2:SIMPLE_NAME,[76,1],,,[VARIABLE,La/X$45$Local;.x)Ljava/lang/Object;,]\n" +
+ "3:VARIABLE_DECLARATION_FRAGMENT,[95,5],,,[VARIABLE,La/X$45$Local;.Local)Ljava/lang/Object;,]\n" +
+ "3:SIMPLE_NAME,[95,5],,,[VARIABLE,La/X$45$Local;.Local)Ljava/lang/Object;,]\n" +
+ "===== Problems =====\n" +
+ "1. ERROR in /Converter15/src/a/X.java (at line 6)\n" +
+ " Local \n" +
+ " ^^^^^\n" +
"Syntax error, insert \";\" to complete ClassBodyDeclarations\n",
result);
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java
index b6e0c0cf8..acd90b81c 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java
@@ -3373,7 +3373,7 @@ public class ASTConverterJavadocTest extends ConverterTestSetup {
ICompilationUnit unit = getCompilationUnit("Converter" , "src", "javadoc.testBug336821", "Try.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
verifyComments(unit);
}
-
+
public void testBug347100() throws Exception {
ICompilationUnit unit = getCompilationUnit("Converter" , "src", "javadoc.testBug347100", "X.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
CompilationUnit compilUnit = verifyComments(unit);
@@ -3381,22 +3381,22 @@ public class ASTConverterJavadocTest extends ConverterTestSetup {
Javadoc comment = (Javadoc) compilUnit.getCommentList().get(0);
List tags = comment.tags();
assertEquals(4, tags.size());
-
+
List mainTags = ((TagElement) tags.get(0)).fragments();
assertEquals(8, mainTags.size());
-
+
TagElement link1 = (TagElement) mainTags.get(1);
assertEquals(TagElement.TAG_LINK, link1.getTagName());
SimpleName javadocRef = (SimpleName) link1.fragments().get(0);
assertTrue(javadocRef.resolveBinding() instanceof IPackageBinding);
link1.subtreeMatch(new ASTMatcher(true), tags.get(1));
-
+
TagElement link2 = (TagElement) mainTags.get(4);
assertEquals(TagElement.TAG_LINK, link2.getTagName());
TextElement stringRef = (TextElement) link2.fragments().get(0);
assertEquals(" \"Hello World\"", stringRef.getText());
link2.subtreeMatch(new ASTMatcher(true), tags.get(2));
-
+
TagElement link3 = (TagElement) mainTags.get(7);
assertEquals(TagElement.TAG_LINK, link3.getTagName());
link3.subtreeMatch(new ASTMatcher(true), tags.get(3));
@@ -3408,11 +3408,11 @@ public class ASTConverterJavadocTest extends ConverterTestSetup {
public void testBug481143a() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/a/X.java",
- "package a;\n" +
- "public class X {\n" +
- " public X subtest = new X(\"Test1\", // comment\n" +
- " \"Test2\") { };\n" +
- " public X(String foo, String bar) { }\n" +
+ "package a;\n" +
+ "public class X {\n" +
+ " public X subtest = new X(\"Test1\", // comment\n" +
+ " \"Test2\") { };\n" +
+ " public X(String foo, String bar) { }\n" +
"}"
);
CompilationUnit unit = (CompilationUnit) runConversion(getJLS3(), this.workingCopies[0], true);
@@ -3424,9 +3424,9 @@ public class ASTConverterJavadocTest extends ConverterTestSetup {
public void testBug481143b() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/a/X.java",
- "package a;\n" +
- "public enum X implements // comment\n" +
- " Serializable {\n" +
+ "package a;\n" +
+ "public enum X implements // comment\n" +
+ " Serializable {\n" +
"}"
);
CompilationUnit unit = (CompilationUnit) runConversion(getJLS3(), this.workingCopies[0], true);
@@ -3438,15 +3438,15 @@ public class ASTConverterJavadocTest extends ConverterTestSetup {
public void testBug481143c() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/a/X.java",
- "package a;\n" +
- "public @interface X // comment\n" +
- " {\n" +
+ "package a;\n" +
+ "public @interface X // comment\n" +
+ " {\n" +
"}"
);
CompilationUnit unit = (CompilationUnit) runConversion(getJLS3(), this.workingCopies[0], true);
assumeEquals(this.prefix+"Wrong number of comments", 1, unit.getCommentList().size());
}
-
+
/**
* @bug 206345: [javadoc] compiler should not interpret contents of {@literal}
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=206345"
@@ -3456,7 +3456,7 @@ public class ASTConverterJavadocTest extends ConverterTestSetup {
this.workingCopies = new ICompilationUnit[1];
this.astLevel = AST.JLS3;
this.workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b206345/X.java",
- "package javadoc.b206345;\n" +
+ "package javadoc.b206345;\n" +
"\n" +
"public class X extends Object {\n" +
" /**\n" +
@@ -3496,7 +3496,7 @@ public class ASTConverterJavadocTest extends ConverterTestSetup {
}
}
/**
- *
+ *
* @throws JavaModelException
* @deprecated
*/
@@ -3504,7 +3504,7 @@ public class ASTConverterJavadocTest extends ConverterTestSetup {
this.workingCopies = new ICompilationUnit[1];
this.astLevel = AST.JLS3;
this.workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b206345/X.java",
- "package javadoc.b206345;\n" +
+ "package javadoc.b206345;\n" +
"\n" +
"public class X extends Object {\n" +
" /**\n" +
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterRecoveryTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterRecoveryTest.java
index 39131fd81..5fc3ac2af 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterRecoveryTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterRecoveryTest.java
@@ -960,7 +960,7 @@ public class ASTConverterRecoveryTest extends ConverterTestSetup {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=239117
public void test0018() throws JavaModelException {
this.workingCopies = new ICompilationUnit[0];
-
+
ASTResult result = this.buildMarkedAST(
"/Converter/src/p/X.java",
"package p;\n" +
@@ -970,30 +970,30 @@ public class ASTConverterRecoveryTest extends ConverterTestSetup {
" }\n" +
" }\n" +
"}");
-
+
assertASTResult(
- "===== AST =====\n" +
- "package p;\n" +
- "public class X {\n" +
- " void m( Object var){\n" +
- " if (1 == 1 && var.equals(1)) [*1*];[*1*]\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "===== Details =====\n" +
- "1:EMPTY_STATEMENT,[77,0],,RECOVERED,[N/A]\n" +
- "===== Problems =====\n" +
- "1. WARNING in /Converter/src/p/X.java (at line 4)\n" +
- " if (1==1 && var.equals(1) {\n" +
- " ^^^^\n" +
- "Comparing identical expressions\n" +
- "2. ERROR in /Converter/src/p/X.java (at line 4)\n" +
- " if (1==1 && var.equals(1) {\n" +
- " ^^^^^^\n" +
- "The method equals(Object) in the type Object is not applicable for the arguments (int)\n" +
- "3. ERROR in /Converter/src/p/X.java (at line 4)\n" +
- " if (1==1 && var.equals(1) {\n" +
- " ^\n" +
+ "===== AST =====\n" +
+ "package p;\n" +
+ "public class X {\n" +
+ " void m( Object var){\n" +
+ " if (1 == 1 && var.equals(1)) [*1*];[*1*]\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "===== Details =====\n" +
+ "1:EMPTY_STATEMENT,[77,0],,RECOVERED,[N/A]\n" +
+ "===== Problems =====\n" +
+ "1. WARNING in /Converter/src/p/X.java (at line 4)\n" +
+ " if (1==1 && var.equals(1) {\n" +
+ " ^^^^\n" +
+ "Comparing identical expressions\n" +
+ "2. ERROR in /Converter/src/p/X.java (at line 4)\n" +
+ " if (1==1 && var.equals(1) {\n" +
+ " ^^^^^^\n" +
+ "The method equals(Object) in the type Object is not applicable for the arguments (int)\n" +
+ "3. ERROR in /Converter/src/p/X.java (at line 4)\n" +
+ " if (1==1 && var.equals(1) {\n" +
+ " ^\n" +
"Syntax error, insert \") Statement\" to complete BlockStatements\n",
result);
}
@@ -1004,22 +1004,22 @@ public class ASTConverterRecoveryTest extends ConverterTestSetup {
"/Converter/src/test/X.java",
"package test;\n"+
"public class X {\n"+
- " void foo() {\n" +
- " return new Object() {hash};\n" +
- " }\n" +
+ " void foo() {\n" +
+ " return new Object() {hash};\n" +
+ " }\n" +
"}\n");
char[] source = this.workingCopies[0].getSource().toCharArray();
ASTNode result = runConversion(getJLS3(), this.workingCopies[0], true, true);
assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " return new Object(){\n" +
- " }\n" +
- ";\n" +
- " }\n" +
+ "package test;\n" +
+ "public class X {\n" +
+ " void foo(){\n" +
+ " return new Object(){\n" +
+ " }\n" +
+ ";\n" +
+ " }\n" +
"}\n",
result);
@@ -1044,22 +1044,22 @@ public class ASTConverterRecoveryTest extends ConverterTestSetup {
"/Converter/src/test/X.java",
"package test;\n"+
"public class X {\n"+
- " void foo() {\n" +
- " field= new Object() {hash};\n" +
- " }\n" +
+ " void foo() {\n" +
+ " field= new Object() {hash};\n" +
+ " }\n" +
"}\n");
char[] source = this.workingCopies[0].getSource().toCharArray();
ASTNode result = runConversion(getJLS3(), this.workingCopies[0], true, true);
assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " field=new Object(){\n" +
- " }\n" +
- ";\n" +
- " }\n" +
+ "package test;\n" +
+ "public class X {\n" +
+ " void foo(){\n" +
+ " field=new Object(){\n" +
+ " }\n" +
+ ";\n" +
+ " }\n" +
"}\n",
result);
@@ -1081,7 +1081,7 @@ public class ASTConverterRecoveryTest extends ConverterTestSetup {
checkSourceRange(anonymousClassDeclaration, "new Object() {hash}", source); //$NON-NLS-1$
checkSourceRange(assignment, "field= new Object() {hash}", source); //$NON-NLS-1$
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=340691
public void test0021() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
@@ -1089,17 +1089,17 @@ public class ASTConverterRecoveryTest extends ConverterTestSetup {
"/Converter/src/test/X.java",
"package test;\n"+
"public class X {\n"+
- " void foo() {\n" +
- " synchronized new Object();\n" +
- " }\n" +
+ " void foo() {\n" +
+ " synchronized new Object();\n" +
+ " }\n" +
"}\n");
ASTNode result = runConversion(getJLS3(), this.workingCopies[0], true, true);
assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " }\n" +
+ "package test;\n" +
+ "public class X {\n" +
+ " void foo(){\n" +
+ " }\n" +
"}\n",
result);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTest.java
index 9e33ef567..0ba937d61 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTest.java
@@ -44,7 +44,7 @@ public class ASTConverterTest extends ConverterTestSetup {
public static Test suite() {
return buildModelTestSuite(ASTConverterTest.class);
}
- /**
+ /**
* Internal access method to MethodDeclaration#thrownExceptions() for avoiding deprecated warnings.
* @deprecated
*/
@@ -8338,12 +8338,12 @@ public class ASTConverterTest extends ConverterTestSetup {
List thrownExceptions = internalThrownExceptions(methodDeclaration);
assertEquals("Wrong size", 1, thrownExceptions.size()); //$NON-NLS-1$
Name name = (Name) thrownExceptions.get(0);
- binding = name.resolveBinding();
+ binding = name.resolveBinding();
} else {
List thrownExceptionTypes = methodDeclaration.thrownExceptionTypes();
assertEquals("Wrong size", 1, thrownExceptionTypes.size()); //$NON-NLS-1$
Type type = (Type) thrownExceptionTypes.get(0);
- binding = type.resolveBinding();
+ binding = type.resolveBinding();
}
assertEquals("wrong type", IBinding.TYPE, binding.getKind()); //$NON-NLS-1$
assertEquals("wrong name", "IOException", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java
index 8919e0c55..5f527a5ba 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java
@@ -52,7 +52,7 @@ public class ASTConverterTest2 extends ConverterTestSetup {
public static Test suite() {
return buildModelTestSuite(ASTConverterTest2.class);
}
- /**
+ /**
* Internal access method to MethodDeclaration#thrownExceptions() for avoiding deprecated warnings.
* @deprecated
*/
@@ -5556,7 +5556,7 @@ public class ASTConverterTest2 extends ConverterTestSetup {
workingCopy.discardWorkingCopy();
}
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=270446. NPE while building abridged AST
public void test0610() throws CoreException {
ICompilationUnit workingCopy = null;
@@ -5572,7 +5572,7 @@ public class ASTConverterTest2 extends ConverterTestSetup {
" }\n" +
" }\n"
);
-
+
// Create parser
ASTParser parser = ASTParser.newParser(getJLS3());
parser.setSource(workingCopy);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java
index b0dced2a2..4bd9d0305 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java
@@ -135,7 +135,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
public static Test suite() {
return buildModelTestSuite(ASTConverterTestAST3_2.class);
}
- /**
+ /**
* Internal access method to MethodDeclaration#thrownExceptions() for avoiding deprecated warnings.
* @deprecated
*/
@@ -6754,7 +6754,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
"}";
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
workingCopy.getBuffer().setContents(contents.toCharArray());
- ASTNode node = runConversion(getJLS3(), workingCopy, true);
+ ASTNode node = runConversion(getJLS3(), workingCopy, true);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
CompilationUnit unit = (CompilationUnit) node;
String expectedOutput = "Dead code";
@@ -9386,7 +9386,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
"}";
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
workingCopy.getBuffer().setContents(contents.toCharArray());
- ASTNode node = runConversion(getJLS3(), workingCopy, true);
+ ASTNode node = runConversion(getJLS3(), workingCopy, true);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
CompilationUnit unit = (CompilationUnit) node;
String expectedOutput = "Dead code";
@@ -9787,7 +9787,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
ICompilationUnit unit = getCompilationUnit("Converter" , "src", "test0691", "X.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
IType type = unit.getType("X");
IMethod method = type.getMethod("foo", new String[0]);
-
+
ASTParser parser = ASTParser.newParser(getJLS3());
parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS);
parser.setSource(unit);
@@ -9832,15 +9832,15 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
public void test0693() throws JavaModelException {
ICompilationUnit unit = getCompilationUnit("Converter" , "src", "test0693", "X.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
ICompilationUnit unit2 = getCompilationUnit("Converter" , "src", "test0693", "Y.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-
+
ASTParser parser = ASTParser.newParser(getJLS3());
ASTRequestor requestor = new ASTRequestor() {};
ICompilationUnit[] cus = new ICompilationUnit[2];
cus[0] = unit;
cus[1] = unit2;
-
+
try {
- // the following line will throw exception but seemingly shouldn't
+ // the following line will throw exception but seemingly shouldn't
parser.createASTs(cus, new String[0], requestor, null);
} catch(Exception e) {
e.printStackTrace();
@@ -9853,15 +9853,15 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
public void test0694() throws JavaModelException {
ICompilationUnit unit = getCompilationUnit("Converter" , "src", "test0694", "X.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
ICompilationUnit unit2 = getCompilationUnit("Converter" , "src", "test0694", "Y.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-
+
ASTParser parser = ASTParser.newParser(getJLS3());
ASTRequestor requestor = new ASTRequestor() {};
ICompilationUnit[] cus = new ICompilationUnit[2];
cus[0] = unit;
cus[1] = unit2;
-
+
try {
- // the following line will throw exception but seemingly shouldn't
+ // the following line will throw exception but seemingly shouldn't
parser.createASTs(cus, new String[0], requestor, null);
} catch(Exception e) {
e.printStackTrace();
@@ -9925,10 +9925,10 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
ICompilationUnit workingCopy = null;
try {
String contents =
- "public class X {\n" +
- " /*start*/private void foo() {\n" +
- " Object o = new new Object() {};\n" +
- " }/*end*/\n" +
+ "public class X {\n" +
+ " /*start*/private void foo() {\n" +
+ " Object o = new new Object() {};\n" +
+ " }/*end*/\n" +
"}";
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
MethodDeclaration methodDeclaration = (MethodDeclaration) buildAST(
@@ -9952,10 +9952,10 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
ICompilationUnit workingCopy = null;
try {
String contents =
- "public class X {\n" +
- " private void foo() {\n" +
- " Object o = new /*start*/new Object() {}/*end*/;\n" +
- " }\n" +
+ "public class X {\n" +
+ " private void foo() {\n" +
+ " Object o = new /*start*/new Object() {}/*end*/;\n" +
+ " }\n" +
"}";
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
ExpressionStatement statement = (ExpressionStatement) buildAST(
@@ -9972,7 +9972,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
}
}
}
-
+
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=248246
*/
@@ -9980,10 +9980,10 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
ICompilationUnit workingCopy = null;
try {
String contents =
- "public class X {\n" +
- " private void foo() {\n" +
- " /*start*/Object o = new /*end*/new Object() {};\n" +
- " }\n" +
+ "public class X {\n" +
+ " private void foo() {\n" +
+ " /*start*/Object o = new /*end*/new Object() {};\n" +
+ " }\n" +
"}";
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
VariableDeclarationStatement statement = (VariableDeclarationStatement) buildAST(
@@ -10007,13 +10007,13 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
try {
workingCopy = getWorkingCopy("/Converter/src/example/Test.java", true/*resolve*/);
String contents =
- "package example;\n" +
- "public class Test {\n" +
- " public void test() throws Throwable {\n" +
- " B /*start*/b = new B()/*end*/;\n" +
- " }\n" +
+ "package example;\n" +
+ "public class Test {\n" +
+ " public void test() throws Throwable {\n" +
+ " B /*start*/b = new B()/*end*/;\n" +
+ " }\n" +
"}";
-
+
VariableDeclarationFragment fragment = (VariableDeclarationFragment) buildAST(contents, workingCopy, false, true, true);
IVariableBinding variableBinding = fragment.resolveBinding();
final String key = variableBinding.getKey();
@@ -10021,7 +10021,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
parser.setProject(workingCopy.getJavaProject());
parser.setResolveBindings(true);
parser.setKind(ASTParser.K_COMPILATION_UNIT);
-
+
parser.createASTs(
new ICompilationUnit[] { workingCopy },
new String[] { key },
@@ -10031,7 +10031,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
assertEquals("Wrong key", key, bindingKey);
assertTrue("Not a variable binding", binding.getKind() == IBinding.VARIABLE);
}
-
+
public void acceptAST(ICompilationUnit source,
CompilationUnit astCompilationUnit) {
}
@@ -10048,14 +10048,14 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
try {
workingCopy = getWorkingCopy("/Converter/src/example/Test.java", true/*resolve*/);
String contents =
- "package example;\n" +
+ "package example;\n" +
"import java.io.IOException;\n" +
- "public class Test {\n" +
- " public void test() throws IOException, RuntimeException {\n" +
- " B /*start*/b = new B()/*end*/;\n" +
- " }\n" +
+ "public class Test {\n" +
+ " public void test() throws IOException, RuntimeException {\n" +
+ " B /*start*/b = new B()/*end*/;\n" +
+ " }\n" +
"}";
-
+
VariableDeclarationFragment fragment = (VariableDeclarationFragment) buildAST(contents, workingCopy, false, true, true);
IVariableBinding variableBinding = fragment.resolveBinding();
final String key = variableBinding.getKey();
@@ -10063,7 +10063,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
parser.setProject(workingCopy.getJavaProject());
parser.setResolveBindings(true);
parser.setKind(ASTParser.K_COMPILATION_UNIT);
-
+
parser.createASTs(
new ICompilationUnit[] { workingCopy },
new String[] { key },
@@ -10073,7 +10073,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
assertEquals("Wrong key", key, bindingKey);
assertTrue("Not a variable binding", binding.getKind() == IBinding.VARIABLE);
}
-
+
public void acceptAST(ICompilationUnit source,
CompilationUnit astCompilationUnit) {
}
@@ -10091,14 +10091,14 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
try {
workingCopy = getWorkingCopy("/Converter/src/example/Test.java", true/*resolve*/);
String contents =
- "package example;\n" +
+ "package example;\n" +
"import java.io.IOException;\n" +
- "public class Test {\n" +
- " public void test() {\n" +
- " B /*start*/b = new B()/*end*/;\n" +
- " }\n" +
+ "public class Test {\n" +
+ " public void test() {\n" +
+ " B /*start*/b = new B()/*end*/;\n" +
+ " }\n" +
"}";
-
+
VariableDeclarationFragment fragment = (VariableDeclarationFragment) buildAST(contents, workingCopy, false, true, true);
IVariableBinding variableBinding = fragment.resolveBinding();
final String key = variableBinding.getKey();
@@ -10106,7 +10106,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
parser.setProject(workingCopy.getJavaProject());
parser.setResolveBindings(true);
parser.setKind(ASTParser.K_COMPILATION_UNIT);
-
+
parser.createASTs(
new ICompilationUnit[] { workingCopy },
new String[] { key },
@@ -10130,7 +10130,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
* http://dev.eclipse.org/bugs/show_bug.cgi?id=270148
*/
public void test0702() throws JavaModelException {
- final char[] source = ("void foo() {\n" +
+ final char[] source = ("void foo() {\n" +
" Integer I = new ${cursor}\n" +
"}").toCharArray();
ASTParser parser = ASTParser.newParser(getJLS3());
@@ -10152,10 +10152,10 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
* http://dev.eclipse.org/bugs/show_bug.cgi?id=270148
*/
public void test0703() throws JavaModelException {
- final char[] source = ("public class Try {\n" +
- " void foo() {\n" +
- " Integer I = new ${cursor}\n" +
- " }\n" +
+ final char[] source = ("public class Try {\n" +
+ " void foo() {\n" +
+ " Integer I = new ${cursor}\n" +
+ " }\n" +
"}").toCharArray();
ASTParser parser = ASTParser.newParser(getJLS3());
parser.setKind(ASTParser.K_COMPILATION_UNIT);
@@ -10176,7 +10176,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
* http://dev.eclipse.org/bugs/show_bug.cgi?id=270148
*/
public void test0704() throws JavaModelException {
- final char[] source = ("{\n" +
+ final char[] source = ("{\n" +
" Integer I = new ${cursor}\n" +
"}").toCharArray();
ASTParser parser = ASTParser.newParser(getJLS3());
@@ -10198,10 +10198,10 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
* http://dev.eclipse.org/bugs/show_bug.cgi?id=270148
*/
public void test0705() throws JavaModelException {
- final char[] source = ("{\n" +
+ final char[] source = ("{\n" +
" Integer I = new ${cursor}\n" +
"}\n" +
- "{\n" +
+ "{\n" +
" Integer I = new ${cursor}\n" +
"}").toCharArray();
ASTParser parser = ASTParser.newParser(getJLS3());
@@ -10228,10 +10228,10 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
* http://dev.eclipse.org/bugs/show_bug.cgi?id=270148
*/
public void test0706() throws JavaModelException {
- final char[] source = ("public class Try {\n" +
- " Integer i = new Integer() {\n" +
- " Integer I = new ${cursor}\n" +
- " };\"\n" +
+ final char[] source = ("public class Try {\n" +
+ " Integer i = new Integer() {\n" +
+ " Integer I = new ${cursor}\n" +
+ " };\"\n" +
"}").toCharArray();
ASTParser parser = ASTParser.newParser(getJLS3());
parser.setKind(ASTParser.K_COMPILATION_UNIT);
@@ -10247,8 +10247,8 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
* http://dev.eclipse.org/bugs/show_bug.cgi?id=270148
*/
public void test0707() throws JavaModelException {
- final char[] source = ("Integer i = new Integer() {\n" +
- " Integer I = new ${cursor}\n" +
+ final char[] source = ("Integer i = new Integer() {\n" +
+ " Integer I = new ${cursor}\n" +
"};").toCharArray();
ASTParser parser = ASTParser.newParser(getJLS3());
parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS);
@@ -10280,15 +10280,15 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
try {
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
String contents =
- "public class X {\n" +
- " public Integer test() {\n" +
- " return (new Integer(getId()));\n" +
- " }\n" +
- " public String getId() {\n" +
- " return \"1\";\n" +
- " }\n" +
+ "public class X {\n" +
+ " public Integer test() {\n" +
+ " return (new Integer(getId()));\n" +
+ " }\n" +
+ " public String getId() {\n" +
+ " return \"1\";\n" +
+ " }\n" +
"}";
-
+
ASTNode node = buildAST(
contents,
workingCopy);
@@ -10353,14 +10353,14 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
* http://dev.eclipse.org/bugs/show_bug.cgi?id=280063
*/
public void test0713() throws JavaModelException {
- final char[] source = (" class MyCommand extends CompoundCommand\n" +
- " {\n" +
- " public void execute()\n" +
- " {\n" +
- " // ...\n" +
- " appendAndExecute(new AddCommand(...));\n" +
- " if (condition) appendAndExecute(new AddCommand(...));\n" +
- " }\n" +
+ final char[] source = (" class MyCommand extends CompoundCommand\n" +
+ " {\n" +
+ " public void execute()\n" +
+ " {\n" +
+ " // ...\n" +
+ " appendAndExecute(new AddCommand(...));\n" +
+ " if (condition) appendAndExecute(new AddCommand(...));\n" +
+ " }\n" +
" }").toCharArray();
ASTParser parser = ASTParser.newParser(getJLS3());
parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS);
@@ -10375,41 +10375,41 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
* http://dev.eclipse.org/bugs/show_bug.cgi?id=280063
*/
public void test0714() throws JavaModelException {
- final char[] source = ("class MyCommand extends CommandBase\n" +
- " {\n" +
- " protected Command subcommand;\n" +
- "\n" +
- " //...\n" +
- "\n" +
- " public void execute()\n" +
- " {\n" +
- " // ...\n" +
- " Compound subcommands = new CompoundCommand();\n" +
- " subcommands.appendAndExecute(new AddCommand(...));\n" +
- " if (condition) subcommands.appendAndExecute(new AddCommand(...));\n" +
- " subcommand = subcommands.unwrap();\n" +
- " }\n" +
- "\n" +
- " public void undo()\n" +
- " {\n" +
- " // ...\n" +
- " subcommand.undo();\n" +
- " }\n" +
- "\n" +
- " public void redo()\n" +
- " {\n" +
- " // ...\n" +
- " subcommand.redo();\n" +
- " }\n" +
- "\n" +
- " public void dispose()\n" +
- " {\n" +
- " // ...\n" +
- " if (subcommand != null)\n" +
- " {\n" +
- " subcommand.dispose();\n" +
- " }\n" +
- " }\n" +
+ final char[] source = ("class MyCommand extends CommandBase\n" +
+ " {\n" +
+ " protected Command subcommand;\n" +
+ "\n" +
+ " //...\n" +
+ "\n" +
+ " public void execute()\n" +
+ " {\n" +
+ " // ...\n" +
+ " Compound subcommands = new CompoundCommand();\n" +
+ " subcommands.appendAndExecute(new AddCommand(...));\n" +
+ " if (condition) subcommands.appendAndExecute(new AddCommand(...));\n" +
+ " subcommand = subcommands.unwrap();\n" +
+ " }\n" +
+ "\n" +
+ " public void undo()\n" +
+ " {\n" +
+ " // ...\n" +
+ " subcommand.undo();\n" +
+ " }\n" +
+ "\n" +
+ " public void redo()\n" +
+ " {\n" +
+ " // ...\n" +
+ " subcommand.redo();\n" +
+ " }\n" +
+ "\n" +
+ " public void dispose()\n" +
+ " {\n" +
+ " // ...\n" +
+ " if (subcommand != null)\n" +
+ " {\n" +
+ " subcommand.dispose();\n" +
+ " }\n" +
+ " }\n" +
" }").toCharArray();
ASTParser parser = ASTParser.newParser(getJLS3());
parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS);
@@ -10465,14 +10465,14 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=288211
*/
public void test0717() throws JavaModelException {
- final char[] source = (" class MyCommand extends CompoundCommand\n" +
- " {\n" +
- " public void execute()\n" +
- " {\n" +
- " // ...\n" +
- " appendAndExecute(new AddCommand());\n" +
- " if (condition) appendAndExecute(new AddCommand());\n" +
- " }\n" +
+ final char[] source = (" class MyCommand extends CompoundCommand\n" +
+ " {\n" +
+ " public void execute()\n" +
+ " {\n" +
+ " // ...\n" +
+ " appendAndExecute(new AddCommand());\n" +
+ " if (condition) appendAndExecute(new AddCommand());\n" +
+ " }\n" +
" }").toCharArray();
ASTParser parser = ASTParser.newParser(getJLS3());
parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS);
@@ -10497,15 +10497,15 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
try {
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
String contents =
- "public class X {\n" +
- " public void v() {\n" +
- " class Test2 {}\n" +
- " Test2 t = get();\n" +
- " t.toString();\n" +
- " }\n" +
- " public Object get() {return null;}\n" +
+ "public class X {\n" +
+ " public void v() {\n" +
+ " class Test2 {}\n" +
+ " Test2 t = get();\n" +
+ " t.toString();\n" +
+ " }\n" +
+ " public Object get() {return null;}\n" +
"}";
-
+
CompilationUnit unit = (CompilationUnit) buildAST(
contents,
workingCopy,
@@ -10527,7 +10527,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
String contents =
"public class X {}";
-
+
CompilationUnit unit = (CompilationUnit) buildAST(
contents,
workingCopy,
@@ -10616,7 +10616,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
element = (TagElement) fragments.get(0);
assertEquals("wrong tag name", "@code", element.getTagName());
checkSourceRange((TextElement) element.fragments().get(0), " stars*", source);
-
+
element = (TagElement) fragments.get(2);
assertEquals("wrong tag name", "@literal", element.getTagName());
checkSourceRange((TextElement) element.fragments().get(0), " stars****", source);
@@ -10628,7 +10628,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
element = (TagElement) fragments.get(5);
assertEquals("wrong tag name", "@code", element.getTagName());
checkSourceRange((TextElement) element.fragments().get(0), " stars* ", source);
-
+
element = (TagElement) fragments.get(7);
assertEquals("wrong tag name", "@literal", element.getTagName());
checkSourceRange((TextElement) element.fragments().get(0), " stars**** ", source);
@@ -10643,7 +10643,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup {
" }\n" +
" }\n" +
"}\n";
-
+
ASTParser parser = ASTParser.newParser(getJLS3());
parser.setKind(ASTParser.K_COMPILATION_UNIT);
parser.setSource(source.toCharArray());
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST4_2.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST4_2.java
index fb679ff12..e5203887d 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST4_2.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST4_2.java
@@ -8,7 +8,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -132,7 +132,7 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
public static Test suite() {
return buildModelTestSuite(ASTConverterTestAST4_2.class);
}
- /**
+ /**
* Internal access method to MethodDeclaration#thrownExceptions() for avoiding deprecated warnings.
* @deprecated
*/
@@ -6751,7 +6751,7 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
"}";
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
workingCopy.getBuffer().setContents(contents.toCharArray());
- ASTNode node = runConversion(getJLS4(), workingCopy, true);
+ ASTNode node = runConversion(getJLS4(), workingCopy, true);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
CompilationUnit unit = (CompilationUnit) node;
String expectedOutput = "Dead code";
@@ -9383,7 +9383,7 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
"}";
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
workingCopy.getBuffer().setContents(contents.toCharArray());
- ASTNode node = runConversion(getJLS4(), workingCopy, true);
+ ASTNode node = runConversion(getJLS4(), workingCopy, true);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
CompilationUnit unit = (CompilationUnit) node;
String expectedOutput = "Dead code";
@@ -9784,7 +9784,7 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
ICompilationUnit unit = getCompilationUnit("Converter" , "src", "test0691", "X.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
IType type = unit.getType("X");
IMethod method = type.getMethod("foo", new String[0]);
-
+
ASTParser parser = ASTParser.newParser(getJLS4());
parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS);
parser.setSource(unit);
@@ -9829,15 +9829,15 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
public void test0693() throws JavaModelException {
ICompilationUnit unit = getCompilationUnit("Converter" , "src", "test0693", "X.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
ICompilationUnit unit2 = getCompilationUnit("Converter" , "src", "test0693", "Y.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-
+
ASTParser parser = ASTParser.newParser(getJLS4());
ASTRequestor requestor = new ASTRequestor() {};
ICompilationUnit[] cus = new ICompilationUnit[2];
cus[0] = unit;
cus[1] = unit2;
-
+
try {
- // the following line will throw exception but seemingly shouldn't
+ // the following line will throw exception but seemingly shouldn't
parser.createASTs(cus, new String[0], requestor, null);
} catch(Exception e) {
e.printStackTrace();
@@ -9850,15 +9850,15 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
public void test0694() throws JavaModelException {
ICompilationUnit unit = getCompilationUnit("Converter" , "src", "test0694", "X.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
ICompilationUnit unit2 = getCompilationUnit("Converter" , "src", "test0694", "Y.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-
+
ASTParser parser = ASTParser.newParser(getJLS4());
ASTRequestor requestor = new ASTRequestor() {};
ICompilationUnit[] cus = new ICompilationUnit[2];
cus[0] = unit;
cus[1] = unit2;
-
+
try {
- // the following line will throw exception but seemingly shouldn't
+ // the following line will throw exception but seemingly shouldn't
parser.createASTs(cus, new String[0], requestor, null);
} catch(Exception e) {
e.printStackTrace();
@@ -9922,10 +9922,10 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
ICompilationUnit workingCopy = null;
try {
String contents =
- "public class X {\n" +
- " /*start*/private void foo() {\n" +
- " Object o = new new Object() {};\n" +
- " }/*end*/\n" +
+ "public class X {\n" +
+ " /*start*/private void foo() {\n" +
+ " Object o = new new Object() {};\n" +
+ " }/*end*/\n" +
"}";
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
MethodDeclaration methodDeclaration = (MethodDeclaration) buildAST(
@@ -9949,10 +9949,10 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
ICompilationUnit workingCopy = null;
try {
String contents =
- "public class X {\n" +
- " private void foo() {\n" +
- " Object o = new /*start*/new Object() {}/*end*/;\n" +
- " }\n" +
+ "public class X {\n" +
+ " private void foo() {\n" +
+ " Object o = new /*start*/new Object() {}/*end*/;\n" +
+ " }\n" +
"}";
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
ExpressionStatement statement = (ExpressionStatement) buildAST(
@@ -9969,7 +9969,7 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
}
}
}
-
+
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=248246
*/
@@ -9977,10 +9977,10 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
ICompilationUnit workingCopy = null;
try {
String contents =
- "public class X {\n" +
- " private void foo() {\n" +
- " /*start*/Object o = new /*end*/new Object() {};\n" +
- " }\n" +
+ "public class X {\n" +
+ " private void foo() {\n" +
+ " /*start*/Object o = new /*end*/new Object() {};\n" +
+ " }\n" +
"}";
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
VariableDeclarationStatement statement = (VariableDeclarationStatement) buildAST(
@@ -10004,13 +10004,13 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
try {
workingCopy = getWorkingCopy("/Converter/src/example/Test.java", true/*resolve*/);
String contents =
- "package example;\n" +
- "public class Test {\n" +
- " public void test() throws Throwable {\n" +
- " B /*start*/b = new B()/*end*/;\n" +
- " }\n" +
+ "package example;\n" +
+ "public class Test {\n" +
+ " public void test() throws Throwable {\n" +
+ " B /*start*/b = new B()/*end*/;\n" +
+ " }\n" +
"}";
-
+
VariableDeclarationFragment fragment = (VariableDeclarationFragment) buildAST(contents, workingCopy, false, true, true);
IVariableBinding variableBinding = fragment.resolveBinding();
final String key = variableBinding.getKey();
@@ -10018,7 +10018,7 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
parser.setProject(workingCopy.getJavaProject());
parser.setResolveBindings(true);
parser.setKind(ASTParser.K_COMPILATION_UNIT);
-
+
parser.createASTs(
new ICompilationUnit[] { workingCopy },
new String[] { key },
@@ -10028,7 +10028,7 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
assertEquals("Wrong key", key, bindingKey);
assertTrue("Not a variable binding", binding.getKind() == IBinding.VARIABLE);
}
-
+
public void acceptAST(ICompilationUnit source,
CompilationUnit astCompilationUnit) {
}
@@ -10045,14 +10045,14 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
try {
workingCopy = getWorkingCopy("/Converter/src/example/Test.java", true/*resolve*/);
String contents =
- "package example;\n" +
+ "package example;\n" +
"import java.io.IOException;\n" +
- "public class Test {\n" +
- " public void test() throws IOException, RuntimeException {\n" +
- " B /*start*/b = new B()/*end*/;\n" +
- " }\n" +
+ "public class Test {\n" +
+ " public void test() throws IOException, RuntimeException {\n" +
+ " B /*start*/b = new B()/*end*/;\n" +
+ " }\n" +
"}";
-
+
VariableDeclarationFragment fragment = (VariableDeclarationFragment) buildAST(contents, workingCopy, false, true, true);
IVariableBinding variableBinding = fragment.resolveBinding();
final String key = variableBinding.getKey();
@@ -10060,7 +10060,7 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
parser.setProject(workingCopy.getJavaProject());
parser.setResolveBindings(true);
parser.setKind(ASTParser.K_COMPILATION_UNIT);
-
+
parser.createASTs(
new ICompilationUnit[] { workingCopy },
new String[] { key },
@@ -10070,7 +10070,7 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
assertEquals("Wrong key", key, bindingKey);
assertTrue("Not a variable binding", binding.getKind() == IBinding.VARIABLE);
}
-
+
public void acceptAST(ICompilationUnit source,
CompilationUnit astCompilationUnit) {
}
@@ -10088,14 +10088,14 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
try {
workingCopy = getWorkingCopy("/Converter/src/example/Test.java", true/*resolve*/);
String contents =
- "package example;\n" +
+ "package example;\n" +
"import java.io.IOException;\n" +
- "public class Test {\n" +
- " public void test() {\n" +
- " B /*start*/b = new B()/*end*/;\n" +
- " }\n" +
+ "public class Test {\n" +
+ " public void test() {\n" +
+ " B /*start*/b = new B()/*end*/;\n" +
+ " }\n" +
"}";
-
+
VariableDeclarationFragment fragment = (VariableDeclarationFragment) buildAST(contents, workingCopy, false, true, true);
IVariableBinding variableBinding = fragment.resolveBinding();
final String key = variableBinding.getKey();
@@ -10103,7 +10103,7 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
parser.setProject(workingCopy.getJavaProject());
parser.setResolveBindings(true);
parser.setKind(ASTParser.K_COMPILATION_UNIT);
-
+
parser.createASTs(
new ICompilationUnit[] { workingCopy },
new String[] { key },
@@ -10127,7 +10127,7 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
* http://dev.eclipse.org/bugs/show_bug.cgi?id=270148
*/
public void test0702() throws JavaModelException {
- final char[] source = ("void foo() {\n" +
+ final char[] source = ("void foo() {\n" +
" Integer I = new ${cursor}\n" +
"}").toCharArray();
ASTParser parser = ASTParser.newParser(getJLS4());
@@ -10149,10 +10149,10 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
* http://dev.eclipse.org/bugs/show_bug.cgi?id=270148
*/
public void test0703() throws JavaModelException {
- final char[] source = ("public class Try {\n" +
- " void foo() {\n" +
- " Integer I = new ${cursor}\n" +
- " }\n" +
+ final char[] source = ("public class Try {\n" +
+ " void foo() {\n" +
+ " Integer I = new ${cursor}\n" +
+ " }\n" +
"}").toCharArray();
ASTParser parser = ASTParser.newParser(getJLS4());
parser.setKind(ASTParser.K_COMPILATION_UNIT);
@@ -10173,7 +10173,7 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
* http://dev.eclipse.org/bugs/show_bug.cgi?id=270148
*/
public void test0704() throws JavaModelException {
- final char[] source = ("{\n" +
+ final char[] source = ("{\n" +
" Integer I = new ${cursor}\n" +
"}").toCharArray();
ASTParser parser = ASTParser.newParser(getJLS4());
@@ -10195,10 +10195,10 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
* http://dev.eclipse.org/bugs/show_bug.cgi?id=270148
*/
public void test0705() throws JavaModelException {
- final char[] source = ("{\n" +
+ final char[] source = ("{\n" +
" Integer I = new ${cursor}\n" +
"}\n" +
- "{\n" +
+ "{\n" +
" Integer I = new ${cursor}\n" +
"}").toCharArray();
ASTParser parser = ASTParser.newParser(getJLS4());
@@ -10225,10 +10225,10 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
* http://dev.eclipse.org/bugs/show_bug.cgi?id=270148
*/
public void test0706() throws JavaModelException {
- final char[] source = ("public class Try {\n" +
- " Integer i = new Integer() {\n" +
- " Integer I = new ${cursor}\n" +
- " };\"\n" +
+ final char[] source = ("public class Try {\n" +
+ " Integer i = new Integer() {\n" +
+ " Integer I = new ${cursor}\n" +
+ " };\"\n" +
"}").toCharArray();
ASTParser parser = ASTParser.newParser(getJLS4());
parser.setKind(ASTParser.K_COMPILATION_UNIT);
@@ -10244,8 +10244,8 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
* http://dev.eclipse.org/bugs/show_bug.cgi?id=270148
*/
public void test0707() throws JavaModelException {
- final char[] source = ("Integer i = new Integer() {\n" +
- " Integer I = new ${cursor}\n" +
+ final char[] source = ("Integer i = new Integer() {\n" +
+ " Integer I = new ${cursor}\n" +
"};").toCharArray();
ASTParser parser = ASTParser.newParser(getJLS4());
parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS);
@@ -10277,15 +10277,15 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
try {
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
String contents =
- "public class X {\n" +
- " public Integer test() {\n" +
- " return (new Integer(getId()));\n" +
- " }\n" +
- " public String getId() {\n" +
- " return \"1\";\n" +
- " }\n" +
+ "public class X {\n" +
+ " public Integer test() {\n" +
+ " return (new Integer(getId()));\n" +
+ " }\n" +
+ " public String getId() {\n" +
+ " return \"1\";\n" +
+ " }\n" +
"}";
-
+
ASTNode node = buildAST(
contents,
workingCopy);
@@ -10350,14 +10350,14 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
* http://dev.eclipse.org/bugs/show_bug.cgi?id=280063
*/
public void test0713() throws JavaModelException {
- final char[] source = (" class MyCommand extends CompoundCommand\n" +
- " {\n" +
- " public void execute()\n" +
- " {\n" +
- " // ...\n" +
- " appendAndExecute(new AddCommand(...));\n" +
- " if (condition) appendAndExecute(new AddCommand(...));\n" +
- " }\n" +
+ final char[] source = (" class MyCommand extends CompoundCommand\n" +
+ " {\n" +
+ " public void execute()\n" +
+ " {\n" +
+ " // ...\n" +
+ " appendAndExecute(new AddCommand(...));\n" +
+ " if (condition) appendAndExecute(new AddCommand(...));\n" +
+ " }\n" +
" }").toCharArray();
ASTParser parser = ASTParser.newParser(getJLS4());
parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS);
@@ -10372,41 +10372,41 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
* http://dev.eclipse.org/bugs/show_bug.cgi?id=280063
*/
public void test0714() throws JavaModelException {
- final char[] source = ("class MyCommand extends CommandBase\n" +
- " {\n" +
- " protected Command subcommand;\n" +
- "\n" +
- " //...\n" +
- "\n" +
- " public void execute()\n" +
- " {\n" +
- " // ...\n" +
- " Compound subcommands = new CompoundCommand();\n" +
- " subcommands.appendAndExecute(new AddCommand(...));\n" +
- " if (condition) subcommands.appendAndExecute(new AddCommand(...));\n" +
- " subcommand = subcommands.unwrap();\n" +
- " }\n" +
- "\n" +
- " public void undo()\n" +
- " {\n" +
- " // ...\n" +
- " subcommand.undo();\n" +
- " }\n" +
- "\n" +
- " public void redo()\n" +
- " {\n" +
- " // ...\n" +
- " subcommand.redo();\n" +
- " }\n" +
- "\n" +
- " public void dispose()\n" +
- " {\n" +
- " // ...\n" +
- " if (subcommand != null)\n" +
- " {\n" +
- " subcommand.dispose();\n" +
- " }\n" +
- " }\n" +
+ final char[] source = ("class MyCommand extends CommandBase\n" +
+ " {\n" +
+ " protected Command subcommand;\n" +
+ "\n" +
+ " //...\n" +
+ "\n" +
+ " public void execute()\n" +
+ " {\n" +
+ " // ...\n" +
+ " Compound subcommands = new CompoundCommand();\n" +
+ " subcommands.appendAndExecute(new AddCommand(...));\n" +
+ " if (condition) subcommands.appendAndExecute(new AddCommand(...));\n" +
+ " subcommand = subcommands.unwrap();\n" +
+ " }\n" +
+ "\n" +
+ " public void undo()\n" +
+ " {\n" +
+ " // ...\n" +
+ " subcommand.undo();\n" +
+ " }\n" +
+ "\n" +
+ " public void redo()\n" +
+ " {\n" +
+ " // ...\n" +
+ " subcommand.redo();\n" +
+ " }\n" +
+ "\n" +
+ " public void dispose()\n" +
+ " {\n" +
+ " // ...\n" +
+ " if (subcommand != null)\n" +
+ " {\n" +
+ " subcommand.dispose();\n" +
+ " }\n" +
+ " }\n" +
" }").toCharArray();
ASTParser parser = ASTParser.newParser(getJLS4());
parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS);
@@ -10462,14 +10462,14 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=288211
*/
public void test0717() throws JavaModelException {
- final char[] source = (" class MyCommand extends CompoundCommand\n" +
- " {\n" +
- " public void execute()\n" +
- " {\n" +
- " // ...\n" +
- " appendAndExecute(new AddCommand());\n" +
- " if (condition) appendAndExecute(new AddCommand());\n" +
- " }\n" +
+ final char[] source = (" class MyCommand extends CompoundCommand\n" +
+ " {\n" +
+ " public void execute()\n" +
+ " {\n" +
+ " // ...\n" +
+ " appendAndExecute(new AddCommand());\n" +
+ " if (condition) appendAndExecute(new AddCommand());\n" +
+ " }\n" +
" }").toCharArray();
ASTParser parser = ASTParser.newParser(getJLS4());
parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS);
@@ -10494,15 +10494,15 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
try {
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
String contents =
- "public class X {\n" +
- " public void v() {\n" +
- " class Test2 {}\n" +
- " Test2 t = get();\n" +
- " t.toString();\n" +
- " }\n" +
- " public Object get() {return null;}\n" +
+ "public class X {\n" +
+ " public void v() {\n" +
+ " class Test2 {}\n" +
+ " Test2 t = get();\n" +
+ " t.toString();\n" +
+ " }\n" +
+ " public Object get() {return null;}\n" +
"}";
-
+
CompilationUnit unit = (CompilationUnit) buildAST(
contents,
workingCopy,
@@ -10524,7 +10524,7 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
String contents =
"public class X {}";
-
+
CompilationUnit unit = (CompilationUnit) buildAST(
contents,
workingCopy,
@@ -10602,16 +10602,16 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
ICompilationUnit workingCopy = null;
try {
String contents =
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " File file = new File(args[0]);\n" +
- " /*start*/try {\n" +
- " FileInputStream fis = new FileInputStream(file);\n" +
- " fis.read();\n" +
- " } catch (FileNotFoundException | IOException e) {\n" +
- " e.printStackTrace();\n" +
- " }/*end*/\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " File file = new File(args[0]);\n" +
+ " /*start*/try {\n" +
+ " FileInputStream fis = new FileInputStream(file);\n" +
+ " fis.read();\n" +
+ " } catch (FileNotFoundException | IOException e) {\n" +
+ " e.printStackTrace();\n" +
+ " }/*end*/\n" +
+ " }\n" +
"}";
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
TryStatement statement = (TryStatement) buildAST(
@@ -10636,15 +10636,15 @@ public class ASTConverterTestAST4_2 extends ConverterTestSetup {
ICompilationUnit workingCopy = null;
try {
String contents =
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " File file = new File(args[0]);\n" +
- " /*start*/try (FileInputStream fis = new FileInputStream(file);) {\n" +
- " fis.read();\n" +
- " } catch (IOException e) {\n" +
- " e.printStackTrace();\n" +
- " }/*end*/\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " File file = new File(args[0]);\n" +
+ " /*start*/try (FileInputStream fis = new FileInputStream(file);) {\n" +
+ " fis.read();\n" +
+ " } catch (IOException e) {\n" +
+ " e.printStackTrace();\n" +
+ " }/*end*/\n" +
+ " }\n" +
"}";
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
TryStatement statement = (TryStatement) buildAST(
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST8_2.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST8_2.java
index cbb10deed..1a2aaf908 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST8_2.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST8_2.java
@@ -8,7 +8,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -133,7 +133,7 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
public static Test suite() {
return buildModelTestSuite(ASTConverterTestAST8_2.class);
}
- /**
+ /**
* Internal access method to MethodDeclaration#thrownExceptions() for avoiding deprecated warnings.
* @deprecated
*/
@@ -550,12 +550,12 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
List throwsException = internalThrownExceptions(methodDeclaration);
assertEquals("wrong size", 2, throwsException.size()); //$NON-NLS-1$
Name name = (Name) throwsException.get(0);
- binding = name.resolveBinding();
+ binding = name.resolveBinding();
} else {
List throwsExceptionTypes = methodDeclaration.thrownExceptionTypes();
assertEquals("wrong size", 2, throwsExceptionTypes.size()); //$NON-NLS-1$
Type type = (Type) throwsExceptionTypes.get(0);
- binding = type.resolveBinding();
+ binding = type.resolveBinding();
}
assertNotNull("No binding", binding); //$NON-NLS-1$
assertEquals("LIOException;", binding.getKey());
@@ -6781,7 +6781,7 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
"}";
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
workingCopy.getBuffer().setContents(contents.toCharArray());
- ASTNode node = runConversion(getJLS8(), workingCopy, true);
+ ASTNode node = runConversion(getJLS8(), workingCopy, true);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
CompilationUnit unit = (CompilationUnit) node;
String expectedOutput = "Dead code";
@@ -9413,7 +9413,7 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
"}";
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
workingCopy.getBuffer().setContents(contents.toCharArray());
- ASTNode node = runConversion(getJLS8(), workingCopy, true);
+ ASTNode node = runConversion(getJLS8(), workingCopy, true);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
CompilationUnit unit = (CompilationUnit) node;
String expectedOutput = "Dead code";
@@ -9819,7 +9819,7 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
ICompilationUnit unit = getCompilationUnit("Converter" , "src", "test0691", "X.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
IType type = unit.getType("X");
IMethod method = type.getMethod("foo", new String[0]);
-
+
ASTParser parser = ASTParser.newParser(getJLS8());
parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS);
parser.setSource(unit);
@@ -9864,15 +9864,15 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
public void test0693() throws JavaModelException {
ICompilationUnit unit = getCompilationUnit("Converter" , "src", "test0693", "X.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
ICompilationUnit unit2 = getCompilationUnit("Converter" , "src", "test0693", "Y.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-
+
ASTParser parser = ASTParser.newParser(getJLS8());
ASTRequestor requestor = new ASTRequestor() {};
ICompilationUnit[] cus = new ICompilationUnit[2];
cus[0] = unit;
cus[1] = unit2;
-
+
try {
- // the following line will throw exception but seemingly shouldn't
+ // the following line will throw exception but seemingly shouldn't
parser.createASTs(cus, new String[0], requestor, null);
} catch(Exception e) {
e.printStackTrace();
@@ -9885,15 +9885,15 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
public void test0694() throws JavaModelException {
ICompilationUnit unit = getCompilationUnit("Converter" , "src", "test0694", "X.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
ICompilationUnit unit2 = getCompilationUnit("Converter" , "src", "test0694", "Y.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-
+
ASTParser parser = ASTParser.newParser(getJLS8());
ASTRequestor requestor = new ASTRequestor() {};
ICompilationUnit[] cus = new ICompilationUnit[2];
cus[0] = unit;
cus[1] = unit2;
-
+
try {
- // the following line will throw exception but seemingly shouldn't
+ // the following line will throw exception but seemingly shouldn't
parser.createASTs(cus, new String[0], requestor, null);
} catch(Exception e) {
e.printStackTrace();
@@ -9957,10 +9957,10 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
ICompilationUnit workingCopy = null;
try {
String contents =
- "public class X {\n" +
- " /*start*/private void foo() {\n" +
- " Object o = new new Object() {};\n" +
- " }/*end*/\n" +
+ "public class X {\n" +
+ " /*start*/private void foo() {\n" +
+ " Object o = new new Object() {};\n" +
+ " }/*end*/\n" +
"}";
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
MethodDeclaration methodDeclaration = (MethodDeclaration) buildAST(
@@ -9984,10 +9984,10 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
ICompilationUnit workingCopy = null;
try {
String contents =
- "public class X {\n" +
- " private void foo() {\n" +
- " Object o = new /*start*/new Object() {}/*end*/;\n" +
- " }\n" +
+ "public class X {\n" +
+ " private void foo() {\n" +
+ " Object o = new /*start*/new Object() {}/*end*/;\n" +
+ " }\n" +
"}";
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
ExpressionStatement statement = (ExpressionStatement) buildAST(
@@ -10004,7 +10004,7 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
}
}
}
-
+
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=248246
*/
@@ -10012,10 +10012,10 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
ICompilationUnit workingCopy = null;
try {
String contents =
- "public class X {\n" +
- " private void foo() {\n" +
- " /*start*/Object o = new /*end*/new Object() {};\n" +
- " }\n" +
+ "public class X {\n" +
+ " private void foo() {\n" +
+ " /*start*/Object o = new /*end*/new Object() {};\n" +
+ " }\n" +
"}";
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
VariableDeclarationStatement statement = (VariableDeclarationStatement) buildAST(
@@ -10039,13 +10039,13 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
try {
workingCopy = getWorkingCopy("/Converter/src/example/Test.java", true/*resolve*/);
String contents =
- "package example;\n" +
- "public class Test {\n" +
- " public void test() throws Throwable {\n" +
- " B /*start*/b = new B()/*end*/;\n" +
- " }\n" +
+ "package example;\n" +
+ "public class Test {\n" +
+ " public void test() throws Throwable {\n" +
+ " B /*start*/b = new B()/*end*/;\n" +
+ " }\n" +
"}";
-
+
VariableDeclarationFragment fragment = (VariableDeclarationFragment) buildAST(contents, workingCopy, false, true, true);
IVariableBinding variableBinding = fragment.resolveBinding();
final String key = variableBinding.getKey();
@@ -10053,7 +10053,7 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
parser.setProject(workingCopy.getJavaProject());
parser.setResolveBindings(true);
parser.setKind(ASTParser.K_COMPILATION_UNIT);
-
+
parser.createASTs(
new ICompilationUnit[] { workingCopy },
new String[] { key },
@@ -10063,7 +10063,7 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
assertEquals("Wrong key", key, bindingKey);
assertTrue("Not a variable binding", binding.getKind() == IBinding.VARIABLE);
}
-
+
public void acceptAST(ICompilationUnit source,
CompilationUnit astCompilationUnit) {
}
@@ -10080,14 +10080,14 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
try {
workingCopy = getWorkingCopy("/Converter/src/example/Test.java", true/*resolve*/);
String contents =
- "package example;\n" +
+ "package example;\n" +
"import java.io.IOException;\n" +
- "public class Test {\n" +
- " public void test() throws IOException, RuntimeException {\n" +
- " B /*start*/b = new B()/*end*/;\n" +
- " }\n" +
+ "public class Test {\n" +
+ " public void test() throws IOException, RuntimeException {\n" +
+ " B /*start*/b = new B()/*end*/;\n" +
+ " }\n" +
"}";
-
+
VariableDeclarationFragment fragment = (VariableDeclarationFragment) buildAST(contents, workingCopy, false, true, true);
IVariableBinding variableBinding = fragment.resolveBinding();
final String key = variableBinding.getKey();
@@ -10095,7 +10095,7 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
parser.setProject(workingCopy.getJavaProject());
parser.setResolveBindings(true);
parser.setKind(ASTParser.K_COMPILATION_UNIT);
-
+
parser.createASTs(
new ICompilationUnit[] { workingCopy },
new String[] { key },
@@ -10105,7 +10105,7 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
assertEquals("Wrong key", key, bindingKey);
assertTrue("Not a variable binding", binding.getKind() == IBinding.VARIABLE);
}
-
+
public void acceptAST(ICompilationUnit source,
CompilationUnit astCompilationUnit) {
}
@@ -10123,14 +10123,14 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
try {
workingCopy = getWorkingCopy("/Converter/src/example/Test.java", true/*resolve*/);
String contents =
- "package example;\n" +
+ "package example;\n" +
"import java.io.IOException;\n" +
- "public class Test {\n" +
- " public void test() {\n" +
- " B /*start*/b = new B()/*end*/;\n" +
- " }\n" +
+ "public class Test {\n" +
+ " public void test() {\n" +
+ " B /*start*/b = new B()/*end*/;\n" +
+ " }\n" +
"}";
-
+
VariableDeclarationFragment fragment = (VariableDeclarationFragment) buildAST(contents, workingCopy, false, true, true);
IVariableBinding variableBinding = fragment.resolveBinding();
final String key = variableBinding.getKey();
@@ -10138,7 +10138,7 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
parser.setProject(workingCopy.getJavaProject());
parser.setResolveBindings(true);
parser.setKind(ASTParser.K_COMPILATION_UNIT);
-
+
parser.createASTs(
new ICompilationUnit[] { workingCopy },
new String[] { key },
@@ -10162,7 +10162,7 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
* http://dev.eclipse.org/bugs/show_bug.cgi?id=270148
*/
public void test0702() throws JavaModelException {
- final char[] source = ("void foo() {\n" +
+ final char[] source = ("void foo() {\n" +
" Integer I = new ${cursor}\n" +
"}").toCharArray();
ASTParser parser = ASTParser.newParser(getJLS8());
@@ -10184,10 +10184,10 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
* http://dev.eclipse.org/bugs/show_bug.cgi?id=270148
*/
public void test0703() throws JavaModelException {
- final char[] source = ("public class Try {\n" +
- " void foo() {\n" +
- " Integer I = new ${cursor}\n" +
- " }\n" +
+ final char[] source = ("public class Try {\n" +
+ " void foo() {\n" +
+ " Integer I = new ${cursor}\n" +
+ " }\n" +
"}").toCharArray();
ASTParser parser = ASTParser.newParser(getJLS8());
parser.setKind(ASTParser.K_COMPILATION_UNIT);
@@ -10208,7 +10208,7 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
* http://dev.eclipse.org/bugs/show_bug.cgi?id=270148
*/
public void test0704() throws JavaModelException {
- final char[] source = ("{\n" +
+ final char[] source = ("{\n" +
" Integer I = new ${cursor}\n" +
"}").toCharArray();
ASTParser parser = ASTParser.newParser(getJLS8());
@@ -10230,10 +10230,10 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
* http://dev.eclipse.org/bugs/show_bug.cgi?id=270148
*/
public void test0705() throws JavaModelException {
- final char[] source = ("{\n" +
+ final char[] source = ("{\n" +
" Integer I = new ${cursor}\n" +
"}\n" +
- "{\n" +
+ "{\n" +
" Integer I = new ${cursor}\n" +
"}").toCharArray();
ASTParser parser = ASTParser.newParser(getJLS8());
@@ -10260,10 +10260,10 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
* http://dev.eclipse.org/bugs/show_bug.cgi?id=270148
*/
public void test0706() throws JavaModelException {
- final char[] source = ("public class Try {\n" +
- " Integer i = new Integer() {\n" +
- " Integer I = new ${cursor}\n" +
- " };\"\n" +
+ final char[] source = ("public class Try {\n" +
+ " Integer i = new Integer() {\n" +
+ " Integer I = new ${cursor}\n" +
+ " };\"\n" +
"}").toCharArray();
ASTParser parser = ASTParser.newParser(getJLS8());
parser.setKind(ASTParser.K_COMPILATION_UNIT);
@@ -10279,8 +10279,8 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
* http://dev.eclipse.org/bugs/show_bug.cgi?id=270148
*/
public void test0707() throws JavaModelException {
- final char[] source = ("Integer i = new Integer() {\n" +
- " Integer I = new ${cursor}\n" +
+ final char[] source = ("Integer i = new Integer() {\n" +
+ " Integer I = new ${cursor}\n" +
"};").toCharArray();
ASTParser parser = ASTParser.newParser(getJLS8());
parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS);
@@ -10312,15 +10312,15 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
try {
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
String contents =
- "public class X {\n" +
- " public Integer test() {\n" +
- " return (new Integer(getId()));\n" +
- " }\n" +
- " public String getId() {\n" +
- " return \"1\";\n" +
- " }\n" +
+ "public class X {\n" +
+ " public Integer test() {\n" +
+ " return (new Integer(getId()));\n" +
+ " }\n" +
+ " public String getId() {\n" +
+ " return \"1\";\n" +
+ " }\n" +
"}";
-
+
ASTNode node = buildAST(
contents,
workingCopy);
@@ -10385,14 +10385,14 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
* http://dev.eclipse.org/bugs/show_bug.cgi?id=280063
*/
public void test0713() throws JavaModelException {
- final char[] source = (" class MyCommand extends CompoundCommand\n" +
- " {\n" +
- " public void execute()\n" +
- " {\n" +
- " // ...\n" +
- " appendAndExecute(new AddCommand(...));\n" +
- " if (condition) appendAndExecute(new AddCommand(...));\n" +
- " }\n" +
+ final char[] source = (" class MyCommand extends CompoundCommand\n" +
+ " {\n" +
+ " public void execute()\n" +
+ " {\n" +
+ " // ...\n" +
+ " appendAndExecute(new AddCommand(...));\n" +
+ " if (condition) appendAndExecute(new AddCommand(...));\n" +
+ " }\n" +
" }").toCharArray();
ASTParser parser = ASTParser.newParser(getJLS8());
parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS);
@@ -10407,41 +10407,41 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
* http://dev.eclipse.org/bugs/show_bug.cgi?id=280063
*/
public void test0714() throws JavaModelException {
- final char[] source = ("class MyCommand extends CommandBase\n" +
- " {\n" +
- " protected Command subcommand;\n" +
- "\n" +
- " //...\n" +
- "\n" +
- " public void execute()\n" +
- " {\n" +
- " // ...\n" +
- " Compound subcommands = new CompoundCommand();\n" +
- " subcommands.appendAndExecute(new AddCommand(...));\n" +
- " if (condition) subcommands.appendAndExecute(new AddCommand(...));\n" +
- " subcommand = subcommands.unwrap();\n" +
- " }\n" +
- "\n" +
- " public void undo()\n" +
- " {\n" +
- " // ...\n" +
- " subcommand.undo();\n" +
- " }\n" +
- "\n" +
- " public void redo()\n" +
- " {\n" +
- " // ...\n" +
- " subcommand.redo();\n" +
- " }\n" +
- "\n" +
- " public void dispose()\n" +
- " {\n" +
- " // ...\n" +
- " if (subcommand != null)\n" +
- " {\n" +
- " subcommand.dispose();\n" +
- " }\n" +
- " }\n" +
+ final char[] source = ("class MyCommand extends CommandBase\n" +
+ " {\n" +
+ " protected Command subcommand;\n" +
+ "\n" +
+ " //...\n" +
+ "\n" +
+ " public void execute()\n" +
+ " {\n" +
+ " // ...\n" +
+ " Compound subcommands = new CompoundCommand();\n" +
+ " subcommands.appendAndExecute(new AddCommand(...));\n" +
+ " if (condition) subcommands.appendAndExecute(new AddCommand(...));\n" +
+ " subcommand = subcommands.unwrap();\n" +
+ " }\n" +
+ "\n" +
+ " public void undo()\n" +
+ " {\n" +
+ " // ...\n" +
+ " subcommand.undo();\n" +
+ " }\n" +
+ "\n" +
+ " public void redo()\n" +
+ " {\n" +
+ " // ...\n" +
+ " subcommand.redo();\n" +
+ " }\n" +
+ "\n" +
+ " public void dispose()\n" +
+ " {\n" +
+ " // ...\n" +
+ " if (subcommand != null)\n" +
+ " {\n" +
+ " subcommand.dispose();\n" +
+ " }\n" +
+ " }\n" +
" }").toCharArray();
ASTParser parser = ASTParser.newParser(getJLS8());
parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS);
@@ -10497,14 +10497,14 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=288211
*/
public void test0717() throws JavaModelException {
- final char[] source = (" class MyCommand extends CompoundCommand\n" +
- " {\n" +
- " public void execute()\n" +
- " {\n" +
- " // ...\n" +
- " appendAndExecute(new AddCommand());\n" +
- " if (condition) appendAndExecute(new AddCommand());\n" +
- " }\n" +
+ final char[] source = (" class MyCommand extends CompoundCommand\n" +
+ " {\n" +
+ " public void execute()\n" +
+ " {\n" +
+ " // ...\n" +
+ " appendAndExecute(new AddCommand());\n" +
+ " if (condition) appendAndExecute(new AddCommand());\n" +
+ " }\n" +
" }").toCharArray();
ASTParser parser = ASTParser.newParser(getJLS8());
parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS);
@@ -10529,15 +10529,15 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
try {
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
String contents =
- "public class X {\n" +
- " public void v() {\n" +
- " class Test2 {}\n" +
- " Test2 t = get();\n" +
- " t.toString();\n" +
- " }\n" +
- " public Object get() {return null;}\n" +
+ "public class X {\n" +
+ " public void v() {\n" +
+ " class Test2 {}\n" +
+ " Test2 t = get();\n" +
+ " t.toString();\n" +
+ " }\n" +
+ " public Object get() {return null;}\n" +
"}";
-
+
CompilationUnit unit = (CompilationUnit) buildAST(
contents,
workingCopy,
@@ -10559,7 +10559,7 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
String contents =
"public class X {}";
-
+
CompilationUnit unit = (CompilationUnit) buildAST(
contents,
workingCopy,
@@ -10637,16 +10637,16 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
ICompilationUnit workingCopy = null;
try {
String contents =
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " File file = new File(args[0]);\n" +
- " /*start*/try {\n" +
- " FileInputStream fis = new FileInputStream(file);\n" +
- " fis.read();\n" +
- " } catch (FileNotFoundException | IOException e) {\n" +
- " e.printStackTrace();\n" +
- " }/*end*/\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " File file = new File(args[0]);\n" +
+ " /*start*/try {\n" +
+ " FileInputStream fis = new FileInputStream(file);\n" +
+ " fis.read();\n" +
+ " } catch (FileNotFoundException | IOException e) {\n" +
+ " e.printStackTrace();\n" +
+ " }/*end*/\n" +
+ " }\n" +
"}";
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
TryStatement statement = (TryStatement) buildAST(
@@ -10671,15 +10671,15 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
ICompilationUnit workingCopy = null;
try {
String contents =
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " File file = new File(args[0]);\n" +
- " /*start*/try (FileInputStream fis = new FileInputStream(file);) {\n" +
- " fis.read();\n" +
- " } catch (IOException e) {\n" +
- " e.printStackTrace();\n" +
- " }/*end*/\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " File file = new File(args[0]);\n" +
+ " /*start*/try (FileInputStream fis = new FileInputStream(file);) {\n" +
+ " fis.read();\n" +
+ " } catch (IOException e) {\n" +
+ " e.printStackTrace();\n" +
+ " }/*end*/\n" +
+ " }\n" +
"}";
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
TryStatement statement = (TryStatement) buildAST(
@@ -10813,7 +10813,7 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
ICompilationUnit workingCopy = null;
try {
String contents =
- "package test;\n" +
+ "package test;\n" +
"\n" +
"abstract class ThreadFactory { abstract Thread newThread(Runnable r); }\n" +
"class AtomicInteger {\n" +
@@ -10822,17 +10822,17 @@ public class ASTConverterTestAST8_2 extends ConverterTestSetup {
"}\n" +
"class Thread {\n" +
" Thread(Runnable r, String name) {}\n" +
- "}\n" +
- "public abstract class AsyncTask<Params, Progress, Result> {\n" +
- "\n" +
+ "}\n" +
+ "public abstract class AsyncTask<Params, Progress, Result> {\n" +
+ "\n" +
" private static final ThreadFactory threadFactory = \n" +
- " /*start*/new ThreadFactory() {\n" +
- " private final AtomicInteger count = new AtomicInteger(1);\n" +
- "\n" +
- " public Thread newThread(java.lang.Runnable r) {\n" +
- " return new Thread(r, \"AsyncTask #\" + this.count.getAndIncrement());\n" +
- " }\n" +
- " }/*end*/;\n" +
+ " /*start*/new ThreadFactory() {\n" +
+ " private final AtomicInteger count = new AtomicInteger(1);\n" +
+ "\n" +
+ " public Thread newThread(java.lang.Runnable r) {\n" +
+ " return new Thread(r, \"AsyncTask #\" + this.count.getAndIncrement());\n" +
+ " }\n" +
+ " }/*end*/;\n" +
"}\n";
workingCopy = getWorkingCopy("/Converter18/src/test/AsyncTask.java", true/*resolve*/);
Expression outerRhs = (Expression) buildAST(
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTMatcherTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTMatcherTest.java
index 7c1aad507..3c4e8c789 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTMatcherTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTMatcherTest.java
@@ -31,14 +31,14 @@ public class ASTMatcherTest extends org.eclipse.jdt.core.tests.junit.extension.T
* @deprecated
*/
/*package*/ static final int JLS3_INTERNAL = AST.JLS3;
-
+
/**
* Internal synonym for deprecated constant AST.JSL4
* to alleviate deprecation warnings.
* @deprecated
*/
/*package*/ static final int JLS4_INTERNAL = AST.JLS4;
-
+
/** @deprecated using deprecated code */
public static Test suite() {
// TODO (frederic) use buildList + setAstLevel(init) instead...
@@ -898,7 +898,7 @@ public class ASTMatcherTest extends org.eclipse.jdt.core.tests.junit.extension.T
x1.setType(this.T1);
basicMatch(x1);
}
-
+
public void testDoStatement() {
DoStatement x1 = this.ast.newDoStatement();
x1.setExpression(this.E1);
@@ -964,7 +964,7 @@ public class ASTMatcherTest extends org.eclipse.jdt.core.tests.junit.extension.T
x1.setName(this.N1);
basicMatch(x1);
}
-
+
public void testExpressionStatement() {
ExpressionStatement x1 = this.ast.newExpressionStatement(this.E1);
basicMatch(x1);
@@ -1082,10 +1082,10 @@ public class ASTMatcherTest extends org.eclipse.jdt.core.tests.junit.extension.T
x1.parameters().add(this.V2);
if (this.ast.apiLevel() < getJLS8()) {
x1.thrownExceptions().add(this.N2);
- x1.thrownExceptions().add(this.N3);
+ x1.thrownExceptions().add(this.N3);
} else {
x1.thrownExceptionTypes().add(this.T3);
- x1.thrownExceptionTypes().add(this.T4);
+ x1.thrownExceptionTypes().add(this.T4);
}
x1.setBody(this.B1);
basicMatch(x1);
@@ -1437,7 +1437,7 @@ public class ASTMatcherTest extends org.eclipse.jdt.core.tests.junit.extension.T
x1.varargsAnnotations().add(this.ANO1);
basicMatch(x1);
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=395886
public void testQualifiedTypeAnnotation() {
if (this.ast.apiLevel() < getJLS8()) {
@@ -1449,13 +1449,13 @@ public class ASTMatcherTest extends org.eclipse.jdt.core.tests.junit.extension.T
x1.annotations().add(this.ANO2);
basicMatch(x1);
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=395886
public void testParameterizedQualifiedTypeAnnotation() {
if (this.ast.apiLevel() < getJLS8()) {
return;
}
- QualifiedType qualifiedType = this.ast.newQualifiedType(this.T1, this.N1);
+ QualifiedType qualifiedType = this.ast.newQualifiedType(this.T1, this.N1);
qualifiedType.annotations().add(this.ANO1);
ParameterizedType x1 = this.ast.newParameterizedType(qualifiedType);
x1.typeArguments().add(this.ast.newSimpleType(this.ast.newSimpleName("SN1")));
@@ -1466,9 +1466,9 @@ public class ASTMatcherTest extends org.eclipse.jdt.core.tests.junit.extension.T
x1.typeArguments().add(simpleType);
basicMatch(x1);
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399768
- public void testTypeAnnotations1() {
+ public void testTypeAnnotations1() {
if (this.ast.apiLevel() < getJLS8()) {
return;
}
@@ -1479,7 +1479,7 @@ public class ASTMatcherTest extends org.eclipse.jdt.core.tests.junit.extension.T
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399768
- public void testTypeAnnotations2() {
+ public void testTypeAnnotations2() {
if (this.ast.apiLevel() < getJLS8()) {
return;
}
@@ -1488,13 +1488,13 @@ public class ASTMatcherTest extends org.eclipse.jdt.core.tests.junit.extension.T
ParameterizedType x2 = this.ast.newParameterizedType(x1);
x1 = this.ast.newSimpleType(this.ast.newSimpleName("SN1"));
x1.annotations().add(this.ANO1);
- x1.annotations().add(this.ANO2);
+ x1.annotations().add(this.ANO2);
x2.typeArguments().add(x1);
basicMatch(x2);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399768
- public void testTypeAnnotations3() {
+ public void testTypeAnnotations3() {
if (this.ast.apiLevel() < getJLS8()) {
return;
}
@@ -1507,7 +1507,7 @@ public class ASTMatcherTest extends org.eclipse.jdt.core.tests.junit.extension.T
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399768
- public void testTypeAnnotations4() {
+ public void testTypeAnnotations4() {
if (this.ast.apiLevel() < getJLS8()) {
return;
}
@@ -1521,7 +1521,7 @@ public class ASTMatcherTest extends org.eclipse.jdt.core.tests.junit.extension.T
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399768
- public void testTypeAnnotations5() {
+ public void testTypeAnnotations5() {
if (this.ast.apiLevel() < getJLS8()) {
return;
}
@@ -1534,7 +1534,7 @@ public class ASTMatcherTest extends org.eclipse.jdt.core.tests.junit.extension.T
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399768
- public void testTypeAnnotations6() {
+ public void testTypeAnnotations6() {
if (this.ast.apiLevel() < getJLS8()) {
return;
}
@@ -1547,7 +1547,7 @@ public class ASTMatcherTest extends org.eclipse.jdt.core.tests.junit.extension.T
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399768
- public void testTypeAnnotations7() {
+ public void testTypeAnnotations7() {
if (this.ast.apiLevel() < getJLS8()) {
return;
}
@@ -1561,7 +1561,7 @@ public class ASTMatcherTest extends org.eclipse.jdt.core.tests.junit.extension.T
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399768
- public void testTypeAnnotations8() {
+ public void testTypeAnnotations8() {
if (this.ast.apiLevel() < getJLS8()) {
return;
}
@@ -1574,7 +1574,7 @@ public class ASTMatcherTest extends org.eclipse.jdt.core.tests.junit.extension.T
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399768
- public void testTypeAnnotations9() {
+ public void testTypeAnnotations9() {
if (this.ast.apiLevel() < getJLS8()) {
return;
}
@@ -1587,7 +1587,7 @@ public class ASTMatcherTest extends org.eclipse.jdt.core.tests.junit.extension.T
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399768
- public void testTypeAnnotations10() {
+ public void testTypeAnnotations10() {
if (this.ast.apiLevel() < getJLS8()) {
return;
}
@@ -1602,7 +1602,7 @@ public class ASTMatcherTest extends org.eclipse.jdt.core.tests.junit.extension.T
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399768
- public void testTypeAnnotations11() {
+ public void testTypeAnnotations11() {
if (this.ast.apiLevel() < getJLS8()) {
return;
}
@@ -1649,7 +1649,7 @@ public class ASTMatcherTest extends org.eclipse.jdt.core.tests.junit.extension.T
x1.setName(this.N1);
basicMatch(x1);
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399793
public void testLambdaExpressions1() {
if (this.ast.apiLevel() < getJLS8()) {
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTModelBridgeTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTModelBridgeTests.java
index e1b452f76..e3a494f81 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTModelBridgeTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTModelBridgeTests.java
@@ -48,7 +48,7 @@ public class ASTModelBridgeTests extends AbstractASTTests {
* @deprecated
*/
/*package*/ static final int JLS3_INTERNAL = AST.JLS3;
-
+
protected void checkSourceRange(int start, int length, String expectedContents, String source) {
assertTrue("length == 0", length != 0); //$NON-NLS-1$ //$NON-NLS-2$
assertTrue("start == -1", start != -1); //$NON-NLS-1$
@@ -348,7 +348,7 @@ public class ASTModelBridgeTests extends AbstractASTTests {
*/
public void testAnnotation6() throws JavaModelException {
ASTNode node = buildAST(
- "/*start*/@MyAnnot/*end*/\n" +
+ "/*start*/@MyAnnot/*end*/\n" +
"public @interface X {\n" +
"}\n" +
"@interface MyAnnot {\n" +
@@ -362,14 +362,14 @@ public class ASTModelBridgeTests extends AbstractASTTests {
element
);
}
-
+
/*
* Ensures that the IJavaElement of an IBinding representing an annotation on an enum type is correct.
* (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=249844 )
*/
public void testAnnotation7() throws JavaModelException {
ASTNode node = buildAST(
- "/*start*/@MyAnnot/*end*/\n" +
+ "/*start*/@MyAnnot/*end*/\n" +
"public enum X {\n" +
"}\n" +
"@interface MyAnnot {\n" +
@@ -383,7 +383,7 @@ public class ASTModelBridgeTests extends AbstractASTTests {
element
);
}
-
+
/*
* Ensures that the IJavaElement of an IBinding representing an annotation of a binary member type is correct.
*/
@@ -529,19 +529,19 @@ public class ASTModelBridgeTests extends AbstractASTTests {
"public @interface NonNull{}\n");
createFile("/P/src/lib/Foo.java",
"package lib;\n" +
- "public class Foo {\n" +
- " public <T> void bug1(@NonNull T x) { return; }\n" +
- " public static <T> void bug2(@NonNull String x) { return; }\n" +
+ "public class Foo {\n" +
+ " public <T> void bug1(@NonNull T x) { return; }\n" +
+ " public static <T> void bug2(@NonNull String x) { return; }\n" +
"}\n");
-
+
String barSource =
"import lib.Foo;\n" +
- "public class Bar {\n" +
- " void m() { new Foo().bug1(\"x\"); Foo.bug2(\"x\"); }\n" +
+ "public class Bar {\n" +
+ " void m() { new Foo().bug1(\"x\"); Foo.bug2(\"x\"); }\n" +
"}\n";
this.workingCopies = new ICompilationUnit[2];
this.workingCopies[1] = getWorkingCopy("/P/src/Bar.java", barSource, this.wcOwner);
-
+
ASTParser parser = ASTParser.newParser(getJLS8());
parser.setProject(getJavaProject("P"));
parser.setSource(this.workingCopies[1]);
@@ -863,8 +863,8 @@ public class ASTModelBridgeTests extends AbstractASTTests {
this.workingCopies[0] = getWorkingCopy(
"/P/src/p/IScriptRunnable.java",
"package p;\n" +
- "public interface IScriptRunnable<V, E extends Exception> {\n" +
- " public V run(Object cx, Object scope) throws E;\n" +
+ "public interface IScriptRunnable<V, E extends Exception> {\n" +
+ " public V run(Object cx, Object scope) throws E;\n" +
"}",
owner
);
@@ -872,7 +872,7 @@ public class ASTModelBridgeTests extends AbstractASTTests {
"/P/src/p/Environment.java",
"package p;\n" +
"public interface Environment {\n" +
- " public <V, E extends Exception> V execute(IScriptRunnable<V, E> code) throws E;\n" +
+ " public <V, E extends Exception> V execute(IScriptRunnable<V, E> code) throws E;\n" +
"}",
owner
);
@@ -881,13 +881,13 @@ public class ASTModelBridgeTests extends AbstractASTTests {
"import p.*;\n" +
"public class X {\n" +
" p.Environment env;\n" +
- " private void test() {\n" +
- " env.execute(new IScriptRunnable<Object, RuntimeException>() {\n" +
- " public Object run(Object cx, Object scope) throws RuntimeException {\n" +
- " return null;\n" +
- " }\n" +
- " });\n" +
- " }\n" +
+ " private void test() {\n" +
+ " env.execute(new IScriptRunnable<Object, RuntimeException>() {\n" +
+ " public Object run(Object cx, Object scope) throws RuntimeException {\n" +
+ " return null;\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
"}",
owner
);
@@ -898,8 +898,8 @@ public class ASTModelBridgeTests extends AbstractASTTests {
};
IBinding[] bindings = parser.createBindings(elements, null);
assertBindingsEqual(
- "Lp/IScriptRunnable<TV;TE;>;\n" +
- "Lp/Environment;\n" +
+ "Lp/IScriptRunnable<TV;TE;>;\n" +
+ "Lp/Environment;\n" +
"LX$90;",
bindings);
}
@@ -1282,7 +1282,7 @@ public class ASTModelBridgeTests extends AbstractASTTests {
"LX;@LX~MyAnnot;",
bindings);
}
-
+
/*
* Ensures that the correct IBinding is created for package-info.class's IType
*/
@@ -1400,13 +1400,13 @@ public class ASTModelBridgeTests extends AbstractASTTests {
" public static <T> T foo(int i, boolean f) { return null; }\n" +
"}");
IType typeA = javaProject.findType("p.A");
-
+
IJavaElement[] elems= typeA.getMethod("foo", new String[]{"I", "Z"}).getParameters();
ASTParser parser = ASTParser.newParser(getJLS8());
parser.setProject(javaProject);
IBinding[] bindings = parser.createBindings(elems, null);
assertBindingsEqual(
- "Lp/A;.foo<T:Ljava/lang/Object;>(IZ)TT;#arg0#0#0\n" +
+ "Lp/A;.foo<T:Ljava/lang/Object;>(IZ)TT;#arg0#0#0\n" +
"Lp/A;.foo<T:Ljava/lang/Object;>(IZ)TT;#arg1#0#1",
bindings);
IVariableBinding param1 = (IVariableBinding) bindings[0];
@@ -1898,10 +1898,10 @@ public class ASTModelBridgeTests extends AbstractASTTests {
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=368646
*/
public void testLocalVariable7() throws JavaModelException {
- final String source = "public class X {\n" +
- " public void m(String strX) {\n" +
- " String strB = strX;\n" +
- " }\n" +
+ final String source = "public class X {\n" +
+ " public void m(String strX) {\n" +
+ " String strB = strX;\n" +
+ " }\n" +
"}";
ASTNode node = buildAST(source);
final boolean[] checked = new boolean[1];
@@ -2595,7 +2595,7 @@ public class ASTModelBridgeTests extends AbstractASTTests {
"Lp/X<TT;>;\n" +
"Lp/X;:TT;",
bindings);
-
+
IJavaElement element = bindings[1].getJavaElement();
assertElementExists(
"Unexpected Java element",
@@ -2669,8 +2669,8 @@ public class ASTModelBridgeTests extends AbstractASTTests {
parser.setProject(javaProject);
IBinding[] bindings = parser.createBindings(elements, null);
assertBindingsEqual(
- "Llib/A;.foo<T:Ljava/lang/Object;Z:Ljava/lang/Object;>(ITZ;)TT;\n" +
- "Llib/A;.foo<T:Ljava/lang/Object;Z:Ljava/lang/Object;>(ITZ;)TT;:TT;\n" +
+ "Llib/A;.foo<T:Ljava/lang/Object;Z:Ljava/lang/Object;>(ITZ;)TT;\n" +
+ "Llib/A;.foo<T:Ljava/lang/Object;Z:Ljava/lang/Object;>(ITZ;)TT;:TT;\n" +
"Llib/A;.foo<T:Ljava/lang/Object;Z:Ljava/lang/Object;>(ITZ;)TT;:TZ;",
bindings);
} finally {
@@ -2699,7 +2699,7 @@ public class ASTModelBridgeTests extends AbstractASTTests {
}
/**
* Test behavior when the binding key denotes a non existent type.
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=157847"
+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=157847"
*/
public void test157847a() throws CoreException {
String filePath = "/P/src/Bug157847A.java";
@@ -2729,7 +2729,7 @@ public class ASTModelBridgeTests extends AbstractASTTests {
/**
* Ensures that we don't create internally inconsistent wildcard
* bindings of the form '? extends <null>' or '? super <null>'
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=157847"
+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=157847"
*/
public void test157847b() throws CoreException {
String filePath = "/P/src/Bug157847B.java";
@@ -2759,7 +2759,7 @@ public class ASTModelBridgeTests extends AbstractASTTests {
/**
* Ensures that we don't create internally inconsistent wildcard
* bindings of the form '? extends <null>' or '? super <null>'
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=157847"
+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=157847"
*/
public void test157847c() throws CoreException {
String filePath = "/P/src/Bug157847C.java";
@@ -2796,7 +2796,7 @@ public class ASTModelBridgeTests extends AbstractASTTests {
" Y<MissingType1, MissingType2> y;\n" +
" public X() {\n" +
" this.y = new Y<MissingType1, MissingType2>();\n" +
- " }\n" +
+ " }\n" +
"}";
createFile(filePath, contents);
ICompilationUnit compilationUnit = getCompilationUnit("P", "src", "", "X.java");
@@ -2825,36 +2825,36 @@ public class ASTModelBridgeTests extends AbstractASTTests {
);
assertNotNull("No ast", asts[0]);
final IProblem[] problems = asts[0].getProblems();
- String expectedProblems =
- "1. ERROR in /P/src/X.java (at line 3)\n" +
- " Y<MissingType1, MissingType2> y;\n" +
- " ^^^^^^^^^^^^\n" +
- "MissingType1 cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in /P/src/X.java (at line 3)\n" +
- " Y<MissingType1, MissingType2> y;\n" +
- " ^^^^^^^^^^^^\n" +
- "MissingType2 cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in /P/src/X.java (at line 5)\n" +
- " this.y = new Y<MissingType1, MissingType2>();\n" +
- " ^^^^^^\n" +
- "MissingType1 cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in /P/src/X.java (at line 5)\n" +
- " this.y = new Y<MissingType1, MissingType2>();\n" +
- " ^^^^^^\n" +
- "MissingType2 cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in /P/src/X.java (at line 5)\n" +
- " this.y = new Y<MissingType1, MissingType2>();\n" +
- " ^^^^^^^^^^^^\n" +
- "MissingType1 cannot be resolved to a type\n" +
- "----------\n" +
- "6. ERROR in /P/src/X.java (at line 5)\n" +
- " this.y = new Y<MissingType1, MissingType2>();\n" +
- " ^^^^^^^^^^^^\n" +
- "MissingType2 cannot be resolved to a type\n" +
+ String expectedProblems =
+ "1. ERROR in /P/src/X.java (at line 3)\n" +
+ " Y<MissingType1, MissingType2> y;\n" +
+ " ^^^^^^^^^^^^\n" +
+ "MissingType1 cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in /P/src/X.java (at line 3)\n" +
+ " Y<MissingType1, MissingType2> y;\n" +
+ " ^^^^^^^^^^^^\n" +
+ "MissingType2 cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in /P/src/X.java (at line 5)\n" +
+ " this.y = new Y<MissingType1, MissingType2>();\n" +
+ " ^^^^^^\n" +
+ "MissingType1 cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in /P/src/X.java (at line 5)\n" +
+ " this.y = new Y<MissingType1, MissingType2>();\n" +
+ " ^^^^^^\n" +
+ "MissingType2 cannot be resolved to a type\n" +
+ "----------\n" +
+ "5. ERROR in /P/src/X.java (at line 5)\n" +
+ " this.y = new Y<MissingType1, MissingType2>();\n" +
+ " ^^^^^^^^^^^^\n" +
+ "MissingType1 cannot be resolved to a type\n" +
+ "----------\n" +
+ "6. ERROR in /P/src/X.java (at line 5)\n" +
+ " this.y = new Y<MissingType1, MissingType2>();\n" +
+ " ^^^^^^^^^^^^\n" +
+ "MissingType2 cannot be resolved to a type\n" +
"----------\n";
assertProblems("Wrong problems", expectedProblems, problems, contents.toCharArray());
} finally {
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTNodeFinderTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTNodeFinderTest.java
index 5747a4725..fd21d254d 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTNodeFinderTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTNodeFinderTest.java
@@ -44,7 +44,7 @@ public class ASTNodeFinderTest extends ConverterTestSetup {
this.workingCopy = null;
}
}
-
+
static {
// TESTS_NUMBERS = new int[] { 9 };
}
@@ -56,12 +56,12 @@ public class ASTNodeFinderTest extends ConverterTestSetup {
public void test0001() throws JavaModelException {
this.workingCopy = getWorkingCopy("/NodeFinder/src/test0001/Test.java", false);
String contents =
- "package test0001;\n" +
- "import java.util.*;\n" +
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"Hello\" + \" world\");\n" +
- " }\n" +
+ "package test0001;\n" +
+ "import java.util.*;\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(\"Hello\" + \" world\");\n" +
+ " }\n" +
"}";
ASTNode result = buildAST(
contents,
@@ -77,12 +77,12 @@ public class ASTNodeFinderTest extends ConverterTestSetup {
public void test0002() throws JavaModelException {
this.workingCopy = getWorkingCopy("/NodeFinder/src/test0001/Test.java", false);
String contents =
- "package test0001;\n" +
- "import java.util.*;\n" +
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"Hello\" + \" world\");\n" +
- " }\n" +
+ "package test0001;\n" +
+ "import java.util.*;\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(\"Hello\" + \" world\");\n" +
+ " }\n" +
"}";
ASTNode result = buildAST(
contents,
@@ -97,12 +97,12 @@ public class ASTNodeFinderTest extends ConverterTestSetup {
public void test0003() throws JavaModelException {
this.workingCopy = getWorkingCopy("/NodeFinder/src/test0001/Test.java", false);
String contents =
- "package test0001;\n" +
- "import java.util.*;\n" +
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"Hello\" + \" world\");\n" +
- " }\n" +
+ "package test0001;\n" +
+ "import java.util.*;\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(\"Hello\" + \" world\");\n" +
+ " }\n" +
"}";
ASTNode result = buildAST(
contents,
@@ -119,12 +119,12 @@ public class ASTNodeFinderTest extends ConverterTestSetup {
public void test0004() throws JavaModelException {
this.workingCopy = getWorkingCopy("/NodeFinder/src/test0001/Test.java", false);
String contents =
- "package test0001;\n" +
- "import java.util.*;\n" +
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"Hello\" + \" world\");\n" +
- " }\n" +
+ "package test0001;\n" +
+ "import java.util.*;\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(\"Hello\" + \" world\");\n" +
+ " }\n" +
"}";
ASTNode result = buildAST(
contents,
@@ -140,12 +140,12 @@ public class ASTNodeFinderTest extends ConverterTestSetup {
public void test0005() throws JavaModelException {
this.workingCopy = getWorkingCopy("/NodeFinder/src/test0001/Test.java", false);
String contents =
- "package test0001;\n" +
- "import java.util.*;\n" +
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"Hello\" + \" world\");\n" +
- " }\n" +
+ "package test0001;\n" +
+ "import java.util.*;\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(\"Hello\" + \" world\");\n" +
+ " }\n" +
"}";
ASTNode result = buildAST(
contents,
@@ -161,12 +161,12 @@ public class ASTNodeFinderTest extends ConverterTestSetup {
public void test0006() throws JavaModelException {
this.workingCopy = getWorkingCopy("/NodeFinder/src/test0001/Test.java", false);
String contents =
- "package test0001;\n" +
- "import java.util.*;\n" +
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"Hello\" + \" world\");\n" +
- " }\n" +
+ "package test0001;\n" +
+ "import java.util.*;\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(\"Hello\" + \" world\");\n" +
+ " }\n" +
"}";
ASTNode result = buildAST(
contents,
@@ -181,12 +181,12 @@ public class ASTNodeFinderTest extends ConverterTestSetup {
public void test0007() throws JavaModelException {
this.workingCopy = getWorkingCopy("/NodeFinder/src/test0001/Test.java", false);
String contents =
- "package test0001;\n" +
- "import java.util.*;\n" +
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"Hello\" + \" world\");\n" +
- " }\n" +
+ "package test0001;\n" +
+ "import java.util.*;\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(\"Hello\" + \" world\");\n" +
+ " }\n" +
"}";
ASTNode result = buildAST(
contents,
@@ -202,12 +202,12 @@ public class ASTNodeFinderTest extends ConverterTestSetup {
public void test0008() throws JavaModelException {
this.workingCopy = getWorkingCopy("/NodeFinder/src/test0001/Test.java", false);
String contents =
- "package test0001;\n" +
- "import java.util.*;\n" +
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"Hello\" + \" world\");\n" +
- " }\n" +
+ "package test0001;\n" +
+ "import java.util.*;\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(\"Hello\" + \" world\");\n" +
+ " }\n" +
"}";
ASTNode result = buildAST(
contents,
@@ -224,12 +224,12 @@ public class ASTNodeFinderTest extends ConverterTestSetup {
public void test0009() throws JavaModelException {
this.workingCopy = getWorkingCopy("/NodeFinder/src/test0001/Test.java", false);
String contents =
- "package test0001;\n" +
- "import java.util.*;\n" +
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"Hello\" + \" world\");\n" +
- " }\n" +
+ "package test0001;\n" +
+ "import java.util.*;\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(\"Hello\" + \" world\");\n" +
+ " }\n" +
"}";
ASTNode result = buildAST(
contents,
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTStructuralPropertyTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTStructuralPropertyTest.java
index d18e62a54..b9e50aae8 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTStructuralPropertyTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTStructuralPropertyTest.java
@@ -57,7 +57,7 @@ public class ASTStructuralPropertyTest extends org.eclipse.jdt.core.tests.junit.
name.indexOf(" - JLS");
this.API_LEVEL = Integer.parseInt(name.substring(name.indexOf(" - JLS") + 6));
}
-
+
public ASTStructuralPropertyTest(String name, int apiLevel) {
super(name);
this.API_LEVEL = apiLevel;
@@ -154,7 +154,7 @@ public class ASTStructuralPropertyTest extends org.eclipse.jdt.core.tests.junit.
assertEquals("Wrong number of visited node classes", 67, nodeClasses.size());
assertEquals("Wrong number of visited properties", 81, visitedProperties.size());
//{ObjectTeams: 2 new simple properties in TypeDeclaration: TEAM_PROPERTY and ROLE_PROPERTY:
-/* orig:
+/* orig:
assertEquals("Wrong number of simple properties", 26, simpleProperties.size());
:giro */
assertEquals("Wrong number of simple properties", 28, simpleProperties.size());
@@ -176,7 +176,7 @@ public class ASTStructuralPropertyTest extends org.eclipse.jdt.core.tests.junit.
assertEquals("Wrong number of visited properties", 103, visitedProperties.size());
//{ObjectTeams: 2 new simple properties in TypeDeclaration: TEAM_PROPERTY and ROLE_PROPERTY:
// 1 new property in ImportDeclaration: BASE_PROPERTY
-/* orig:
+/* orig:
assertEquals("Wrong number of simple properties", 23, simpleProperties.size());
:giro */
assertEquals("Wrong number of simple properties", 26, simpleProperties.size());
@@ -185,8 +185,8 @@ public class ASTStructuralPropertyTest extends org.eclipse.jdt.core.tests.junit.
assertEquals("Wrong number of child properties", 115, childProperties.size());
:giro */
assertEquals("Wrong number of child properties", 117, childProperties.size());
-
- // 2 new child list properties: TypeDeclaration.PRECEDENCES_PROPERTY, PackageDeclaration.MODIFIERS_PROPERTY
+
+ // 2 new child list properties: TypeDeclaration.PRECEDENCES_PROPERTY, PackageDeclaration.MODIFIERS_PROPERTY
/* orig:
assertEquals("Wrong number of child list properties", 52, childListProperties.size());
:giro */
@@ -198,7 +198,7 @@ public class ASTStructuralPropertyTest extends org.eclipse.jdt.core.tests.junit.
assertEquals("Wrong number of visited properties", 103, visitedProperties.size());
//{ObjectTeams: 2 new simple properties in TypeDeclaration: TEAM_PROPERTY and ROLE_PROPERTY:
// 1 new property in ImportDeclaration: BASE_PROPERTY
-/* orig:
+/* orig:
assertEquals("Wrong number of simple properties", 23, simpleProperties.size());
:giro */
assertEquals("Wrong number of simple properties", 26, simpleProperties.size());
@@ -207,20 +207,20 @@ public class ASTStructuralPropertyTest extends org.eclipse.jdt.core.tests.junit.
assertEquals("Wrong number of child properties", 115, childProperties.size());
:giro */
assertEquals("Wrong number of child properties", 117, childProperties.size());
-
- // 2 new child list properties: TypeDeclaration.PRECEDENCES_PROPERTY, PackageDeclaration.MODIFIERS_PROPERTY
+
+ // 2 new child list properties: TypeDeclaration.PRECEDENCES_PROPERTY, PackageDeclaration.MODIFIERS_PROPERTY
/* orig:
assertEquals("Wrong number of child list properties", 54, childListProperties.size());
:giro */
assertEquals("Wrong number of child list properties", 56, childListProperties.size());
-// SH}
+// SH}
break;
case AST.JLS8 :
assertEquals("Wrong number of visited node classes", 84, nodeClasses.size());
assertEquals("Wrong number of visited properties", 106, visitedProperties.size());
//{ObjectTeams: 2 new simple properties in TypeDeclaration: TEAM_PROPERTY and ROLE_PROPERTY:
// 1 new property in ImportDeclaration: BASE_PROPERTY
-/* orig:
+/* orig:
assertEquals("Wrong number of simple properties", 21, simpleProperties.size());
:giro */
assertEquals("Wrong number of simple properties", 24, simpleProperties.size());
@@ -229,13 +229,13 @@ public class ASTStructuralPropertyTest extends org.eclipse.jdt.core.tests.junit.
assertEquals("Wrong number of child properties", 118, childProperties.size());
:giro */
assertEquals("Wrong number of child properties", 120, childProperties.size());
-
- // 2 new child list properties: TypeDeclaration.PRECEDENCES_PROPERTY, PackageDeclaration.MODIFIERS_PROPERTY
+
+ // 2 new child list properties: TypeDeclaration.PRECEDENCES_PROPERTY, PackageDeclaration.MODIFIERS_PROPERTY
/* orig:
assertEquals("Wrong number of child list properties", 66, childListProperties.size());
:giro */
assertEquals("Wrong number of child list properties", 68, childListProperties.size());
-// SH}
+// SH}
break;
default :
fail();
@@ -445,12 +445,12 @@ public class ASTStructuralPropertyTest extends org.eclipse.jdt.core.tests.junit.
// oops - guess that's not valid
}
}
-// {ObjectTeams: adapted for OT specific ASTNodes
+// {ObjectTeams: adapted for OT specific ASTNodes
/* orig:
assertEquals("Wrong last known type", 103, hi); // last known one
:giro */
assertEquals("Wrong last known type", 119, hi); // last known one
-// jwl}
+// jwl}
assertEquals("Wrong number of distinct types", hi, classes.size()); // all classes are distinct
}
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTTest.java
index eb6b0ac9d..efa8b0494 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTTest.java
@@ -1316,7 +1316,7 @@ public class ASTTest extends org.eclipse.jdt.core.tests.junit.extension.TestCase
if (s == null)
return AST.JLS12;
switch (s) {
- case JavaCore.VERSION_1_2 : return AST.JLS2;
+ case JavaCore.VERSION_1_2 : return AST.JLS2;
case JavaCore.VERSION_1_3: return AST.JLS3;
case JavaCore.VERSION_1_4: return AST.JLS4;
case JavaCore.VERSION_1_5: return AST.JLS4;
@@ -1468,16 +1468,16 @@ public class ASTTest extends org.eclipse.jdt.core.tests.junit.extension.TestCase
String[] reserved =
new String[] {
"true", "false", "null", // literals //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-//{ObjectTeams: for Some.Team.this.anchor.Role "this" must be usable as an identifier
+//{ObjectTeams: for Some.Team.this.anchor.Role "this" must be usable as an identifier
/* orig:
"abstract", "default", "if", "private", "this", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- :giro */
+ :giro */
"abstract", "default", "if", "private", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
// more keywords:
"as", "callin", "playedBy", "precedence", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- "team", "tsuper", "with", "within", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ "team", "tsuper", "with", "within", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
// treated as identifier: "base", "when" (predicate method name)
-// SH}
+// SH}
"boolean", "do", "implements", "protected", "throw", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
"break", "double", "import", "public", "throws", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
"byte", "else", "instanceof", "return", "transient", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
@@ -1777,17 +1777,17 @@ public class ASTTest extends org.eclipse.jdt.core.tests.junit.extension.TestCase
} catch (RuntimeException e) {
// pass
}
-
+
// test for 319900
x.setLiteralValue("'");
assertEquals("", "\"'\"", x.getEscapedValue());
assertEquals("", "'", x.getLiteralValue());
-
+
// test for 319900
x.setEscapedValue("\"'\"");
assertEquals("", "\"'\"", x.getEscapedValue());
assertEquals("", "'", x.getLiteralValue());
-
+
// test for bug 442614
x.setLiteralValue("\0041");
assertEquals("", "\"\\u00041\"", x.getEscapedValue());
@@ -3392,7 +3392,7 @@ public class ASTTest extends org.eclipse.jdt.core.tests.junit.extension.TestCase
}
});
}
-
+
genericPropertyTest(x, new Property("Initializer", false, Expression.class) { //$NON-NLS-1$
public ASTNode sample(AST targetAst, boolean parented) {
SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
@@ -3493,7 +3493,7 @@ public class ASTTest extends org.eclipse.jdt.core.tests.junit.extension.TestCase
}
});
}
-
+
genericPropertyTest(x, new Property("Initializer", false, Expression.class) { //$NON-NLS-1$
public ASTNode sample(AST targetAst, boolean parented) {
SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
@@ -3561,9 +3561,9 @@ public class ASTTest extends org.eclipse.jdt.core.tests.junit.extension.TestCase
assertTrue(x.getJavadoc() == null);
assertTrue(x.parameters().size() == 0);
if (this.ast.apiLevel() < getJLS8()) {
- assertTrue(x.thrownExceptions().size() == 0);
+ assertTrue(x.thrownExceptions().size() == 0);
} else {
- assertTrue(x.thrownExceptionTypes().size() == 0);
+ assertTrue(x.thrownExceptionTypes().size() == 0);
}
assertTrue(x.getBody() == null);
assertTrue(x.getNodeType() == ASTNode.METHOD_DECLARATION);
@@ -3699,7 +3699,7 @@ public class ASTTest extends org.eclipse.jdt.core.tests.junit.extension.TestCase
}
});
}
-
+
genericPropertyListTest(x, x.parameters(),
new Property("Parameters", true, SingleVariableDeclaration.class) { //$NON-NLS-1$
public ASTNode sample(AST targetAst, boolean parented) {
@@ -3735,7 +3735,7 @@ public class ASTTest extends org.eclipse.jdt.core.tests.junit.extension.TestCase
}
return result;
}
- });
+ });
} else {
genericPropertyListTest(x, x.thrownExceptionTypes(),
new Property("ThrownExceptionTypes", true, Type.class) { //$NON-NLS-1$
@@ -3746,7 +3746,7 @@ public class ASTTest extends org.eclipse.jdt.core.tests.junit.extension.TestCase
}
return result;
}
- });
+ });
}
genericPropertyTest(x, new Property("Body", false, Block.class) { //$NON-NLS-1$
@@ -8946,7 +8946,7 @@ public class ASTTest extends org.eclipse.jdt.core.tests.junit.extension.TestCase
}
assertEquals(nodeType, node.getNodeType());
}
-
+
// assert that test covers all nodeTypes:
Field[] fields = ASTNode.class.getDeclaredFields();
HashSet declaredNodeTypes = new HashSet();
@@ -8972,7 +8972,7 @@ public class ASTTest extends org.eclipse.jdt.core.tests.junit.extension.TestCase
}
assertEquals("node types missing in test", Collections.EMPTY_SET, declaredNodeTypes);
}
-
+
@SuppressWarnings("deprecation")
public void testASTLevels() throws Exception {
int[] apilLevels = {AST.JLS2, AST.JLS3, AST.JLS4, AST.JLS8, AST.JLS9, AST.JLS10, AST.JLS11, AST.JLS12, AST.JLS13, AST.JLS14};
@@ -8983,8 +8983,8 @@ public class ASTTest extends org.eclipse.jdt.core.tests.junit.extension.TestCase
throw new AssertionFailedError("missing support for AST level: " + level);
}
}
-
-
+
+
}
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTVisitorTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTVisitorTest.java
index 670faf9a4..1adf6971b 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTVisitorTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTVisitorTest.java
@@ -130,7 +130,7 @@ public class ASTVisitorTest extends org.eclipse.jdt.core.tests.junit.extension.T
String T3S;
Type T4;
String T4S;
-
+
final StringBuffer b = new StringBuffer();
int API_LEVEL;
@@ -139,7 +139,7 @@ public class ASTVisitorTest extends org.eclipse.jdt.core.tests.junit.extension.T
super(name);
this.API_LEVEL = apiLevel;
}
-
+
public ASTVisitorTest(String name) {
super(name.substring(0, name.indexOf(" - JLS")));
name.indexOf(" - JLS");
@@ -308,7 +308,7 @@ public class ASTVisitorTest extends org.eclipse.jdt.core.tests.junit.extension.T
this.T4 = this.ast.newSimpleType(this.ast.newSimpleName("X")); //$NON-NLS-1$
this.T4S = "[(tS[(nSXXnS)]tS)]"; //$NON-NLS-1$
}
-
+
}
protected void tearDown() throws Exception {
@@ -1115,7 +1115,7 @@ public class ASTVisitorTest extends org.eclipse.jdt.core.tests.junit.extension.T
public void endVisit(Dimension node) {
ASTVisitorTest.this.b.append("@ED)"); //$NON-NLS-1$
}
-
+
public void preVisit(ASTNode node) {
ASTVisitorTest.this.b.append("["); //$NON-NLS-1$
}
@@ -1779,10 +1779,10 @@ public class ASTVisitorTest extends org.eclipse.jdt.core.tests.junit.extension.T
x1.parameters().add(this.V2);
if (this.ast.apiLevel() < getJLS8()) {
x1.thrownExceptions().add(this.N2);
- x1.thrownExceptions().add(this.N3);
+ x1.thrownExceptions().add(this.N3);
} else {
x1.thrownExceptionTypes().add(this.T3);
- x1.thrownExceptionTypes().add(this.T4);
+ x1.thrownExceptionTypes().add(this.T4);
}
x1.setBody(this.B1);
TestVisitor v1 = new TestVisitor();
@@ -1794,7 +1794,7 @@ public class ASTVisitorTest extends org.eclipse.jdt.core.tests.junit.extension.T
} else if (this.ast.apiLevel() < getJLS8()) {
assertEquals("[(MD"+this.JD1S+this.MOD1S+this.MOD2S+this.TP1S+this.T1S+this.N1S+this.V1S+this.V2S+this.N2S+this.N3S+this.B1S+"MD)]", result); //$NON-NLS-1$ //$NON-NLS-2$
} else {
- assertEquals("[(MD"+this.JD1S+this.MOD1S+this.MOD2S+this.TP1S+this.T1S+this.N1S+this.V1S+this.V2S+this.T3S+this.T4S+this.B1S+"MD)]", result); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("[(MD"+this.JD1S+this.MOD1S+this.MOD2S+this.TP1S+this.T1S+this.N1S+this.V1S+this.V2S+this.T3S+this.T4S+this.B1S+"MD)]", result); //$NON-NLS-1$ //$NON-NLS-2$
}
}
/** @deprecated using deprecated code */
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/AbstractASTTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/AbstractASTTests.java
index 2203a05ea..1a9124da9 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/AbstractASTTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/AbstractASTTests.java
@@ -97,11 +97,11 @@ public class AbstractASTTests extends ModifyingResourceTests implements DefaultM
public void setUpSuite() throws Exception {
super.setUpSuite();
-
+
SourceRangeVerifier.DEBUG = true;
SourceRangeVerifier.DEBUG_THROW = true;
}
-
+
/*
* Removes the *start* and *end* markers from the given source
* and remembers the positions.
@@ -500,11 +500,11 @@ public class AbstractASTTests extends ModifyingResourceTests implements DefaultM
} else if (jdkLevel >= ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_12)) {
JLSLevel = AST_INTERNAL_JLS12;
} else if (jdkLevel >= ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_11)) {
- JLSLevel = AST_INTERNAL_JLS11;
+ JLSLevel = AST_INTERNAL_JLS11;
} else if (jdkLevel >= ClassFileConstants.JDK10) {
- JLSLevel = AST_INTERNAL_JLS10;
+ JLSLevel = AST_INTERNAL_JLS10;
} else if (jdkLevel >= ClassFileConstants.JDK9) {
- JLSLevel = AST_INTERNAL_JLS9;
+ JLSLevel = AST_INTERNAL_JLS9;
} else if (jdkLevel >= ClassFileConstants.JDK1_8) {
JLSLevel = AST_INTERNAL_JLS8;
} else if (jdkLevel >= ClassFileConstants.JDK1_7) {
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/BatchASTCreationTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/BatchASTCreationTests.java
index 072d39ea9..27a099174 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/BatchASTCreationTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/BatchASTCreationTests.java
@@ -48,7 +48,7 @@ public class BatchASTCreationTests extends AbstractASTTests {
* @deprecated
*/
/*package*/ static final int JLS3_INTERNAL = AST.JLS3;
-
+
public class TestASTRequestor extends ASTRequestor {
public ArrayList asts = new ArrayList();
public void acceptAST(ICompilationUnit source, CompilationUnit ast) {
@@ -1448,7 +1448,7 @@ public class BatchASTCreationTests extends AbstractASTTests {
"Lp1/X<>;.foo(Lp1/Z;)V"
);
}
-
+
/*
* Ensures that a parameterized type binding with a capture binding in its arguments can be created using its key in batch creation.
* (regression test for bug 94092 ASTParser#createASTs(..) restores wrong bindings from capture keys)
@@ -2219,17 +2219,17 @@ public void test082() throws CoreException, IOException {
},
"LA~B<LC;:1TV;LC;:1TE;>;");
}
-
+
public void testIgnoreMethodBodies1() throws CoreException {
this.workingCopies = createWorkingCopies(new String[] {
"/P/p1/X.java",
"package p1;\n" +
"public class X {\n" +
" public int foo() {\n" +
- " int i = 0;\n" +
+ " int i = 0;\n" +
" }\n" +
" public int bar() {\n" +
- " int i = 0;\n" +
+ " int i = 0;\n" +
" new X() /*start*/{\n" +
" }/*end*/;" +
" }\n" +
@@ -2258,10 +2258,10 @@ public void test082() throws CoreException, IOException {
"package p1;\n" +
"public class X {\n" +
" public int foo() {\n" +
- " int i = 0;\n" +
+ " int i = 0;\n" +
" }\n" +
" public int bar() {\n" +
- " int i = 0;\n" +
+ " int i = 0;\n" +
" new X() /*start*/{\n" +
" }/*end*/;" +
" }\n" +
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/CompatibilityRulesTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/CompatibilityRulesTests.java
index 2be971eee..f53bb732c 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/CompatibilityRulesTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/CompatibilityRulesTests.java
@@ -1056,7 +1056,7 @@ public class CompatibilityRulesTests extends AbstractASTTests {
});
assertTrue("Y#foo() should be a subsignature of X#foo()", bindings[1].isSubsignature(bindings[0]));
}
-
+
/*
* Ensures that the byte base type is assignment compatible with the int base type
*/
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ConverterTestSetup.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ConverterTestSetup.java
index df8e11203..633fd9a40 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ConverterTestSetup.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ConverterTestSetup.java
@@ -62,7 +62,7 @@ public abstract class ConverterTestSetup extends AbstractASTTests {
static int getJLS8() {
return JLS8_INTERNAL;
- }
+ }
protected AST ast;
public static List TEST_SUITES = null;
public static boolean PROJECT_SETUP = false;
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ProfilingASTConvertionTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ProfilingASTConvertionTest.java
index cd5029e24..09ad12ba8 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ProfilingASTConvertionTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ProfilingASTConvertionTest.java
@@ -47,7 +47,7 @@ public class ProfilingASTConvertionTest extends AbstractJavaModelTests {
* @deprecated
*/
/*package*/ static final int JLS3_INTERNAL = AST.JLS3;
-
+
static class Result implements Comparable {
long length;
long time;
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/TypeAnnotationsConverterTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/TypeAnnotationsConverterTest.java
index 9d6a88214..a3f68ff99 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/TypeAnnotationsConverterTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/TypeAnnotationsConverterTest.java
@@ -59,7 +59,7 @@ public class TypeAnnotationsConverterTest extends ConverterTestSetup {
" }\n" +
" }\n" +
" Object o = (@Marker X. @Marker Y.@Marker Z) null;\n" +
-
+
" @java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_USE)\n" +
" @interface Marker {\n" +
" }\n" +
@@ -68,14 +68,14 @@ public class TypeAnnotationsConverterTest extends ConverterTestSetup {
ASTNode node = buildAST(
contents,
this.workingCopy);
- String expectedOutput =
- "public class X {\n" +
- "class Y {\n" +
- "class Z {\n" +
- " }\n" +
- " }\n" +
- " Object o=(@Marker X.@Marker Y.@Marker Z)null;\n" +
- " @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE_USE) @interface Marker {}\n" +
+ String expectedOutput =
+ "public class X {\n" +
+ "class Y {\n" +
+ "class Z {\n" +
+ " }\n" +
+ " }\n" +
+ " Object o=(@Marker X.@Marker Y.@Marker Z)null;\n" +
+ " @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE_USE) @interface Marker {}\n" +
"}\n";
assertASTNodeEquals(expectedOutput, node);
}
@@ -88,7 +88,7 @@ public class TypeAnnotationsConverterTest extends ConverterTestSetup {
" }\n" +
" }\n" +
" Object o = (@Marker X. @Marker Y.@Marker Z<String>) null;\n" +
-
+
" @java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_USE)\n" +
" @interface Marker {\n" +
" }\n" +
@@ -97,14 +97,14 @@ public class TypeAnnotationsConverterTest extends ConverterTestSetup {
ASTNode node = buildAST(
contents,
this.workingCopy);
- String expectedOutput =
- "public class X {\n" +
- "class Y {\n" +
- "class Z<T> {\n" +
- " }\n" +
- " }\n" +
- " Object o=(@Marker X.@Marker Y.@Marker Z<String>)null;\n" +
- " @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE_USE) @interface Marker {}\n" +
+ String expectedOutput =
+ "public class X {\n" +
+ "class Y {\n" +
+ "class Z<T> {\n" +
+ " }\n" +
+ " }\n" +
+ " Object o=(@Marker X.@Marker Y.@Marker Z<String>)null;\n" +
+ " @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE_USE) @interface Marker {}\n" +
"}\n";
assertASTNodeEquals(expectedOutput, node);
}
@@ -117,7 +117,7 @@ public class TypeAnnotationsConverterTest extends ConverterTestSetup {
" }\n" +
" }\n" +
" Object o = (@Marker X<String>. @Marker Y<Integer>.@Marker Z<Object>) null;\n" +
-
+
" @java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_USE)\n" +
" @interface Marker {\n" +
" }\n" +
@@ -126,14 +126,14 @@ public class TypeAnnotationsConverterTest extends ConverterTestSetup {
ASTNode node = buildAST(
contents,
this.workingCopy);
- String expectedOutput =
- "public class X<T> {\n" +
- "class Y<R> {\n" +
- "class Z<Q> {\n" +
- " }\n" +
- " }\n" +
- " Object o=(@Marker X<String>.@Marker Y<Integer>.@Marker Z<Object>)null;\n" +
- " @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE_USE) @interface Marker {}\n" +
+ String expectedOutput =
+ "public class X<T> {\n" +
+ "class Y<R> {\n" +
+ "class Z<Q> {\n" +
+ " }\n" +
+ " }\n" +
+ " Object o=(@Marker X<String>.@Marker Y<Integer>.@Marker Z<Object>)null;\n" +
+ " @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE_USE) @interface Marker {}\n" +
"}\n";
assertASTNodeEquals(expectedOutput, node);
}
@@ -146,7 +146,7 @@ public class TypeAnnotationsConverterTest extends ConverterTestSetup {
" }\n" +
" }\n" +
" Object o = (@Marker X<@Marker String>. @Marker Y<@Marker Integer>.@Marker Z<@Marker Object> @Marker [] [] @Marker [] []) null;\n" +
-
+
" @java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_USE)\n" +
" @interface Marker {\n" +
" }\n" +
@@ -155,14 +155,14 @@ public class TypeAnnotationsConverterTest extends ConverterTestSetup {
ASTNode node = buildAST(
contents,
this.workingCopy);
- String expectedOutput =
- "public class X<T> {\n" +
- "class Y<R> {\n" +
- "class Z<Q> {\n" +
- " }\n" +
- " }\n" +
- " Object o=(@Marker X<@Marker String>.@Marker Y<@Marker Integer>.@Marker Z<@Marker Object> @Marker [][] @Marker [][])null;\n" +
- " @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE_USE) @interface Marker {}\n" +
+ String expectedOutput =
+ "public class X<T> {\n" +
+ "class Y<R> {\n" +
+ "class Z<Q> {\n" +
+ " }\n" +
+ " }\n" +
+ " Object o=(@Marker X<@Marker String>.@Marker Y<@Marker Integer>.@Marker Z<@Marker Object> @Marker [][] @Marker [][])null;\n" +
+ " @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE_USE) @interface Marker {}\n" +
"}\n";
assertASTNodeEquals(expectedOutput, node);
}
@@ -175,7 +175,7 @@ public class TypeAnnotationsConverterTest extends ConverterTestSetup {
" }\n" +
" }\n" +
" Object o = (@Marker X<@Marker String>. @Marker Y<@Marker Integer>.@Marker Z<@Marker Object> [] @Marker [] [] @Marker []) null;\n" +
-
+
" @java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_USE)\n" +
" @interface Marker {\n" +
" }\n" +
@@ -184,14 +184,14 @@ public class TypeAnnotationsConverterTest extends ConverterTestSetup {
ASTNode node = buildAST(
contents,
this.workingCopy);
- String expectedOutput =
- "public class X<T> {\n" +
- "class Y<R> {\n" +
- "class Z<Q> {\n" +
- " }\n" +
- " }\n" +
- " Object o=(@Marker X<@Marker String>.@Marker Y<@Marker Integer>.@Marker Z<@Marker Object>[] @Marker [][] @Marker [])null;\n" +
- " @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE_USE) @interface Marker {}\n" +
+ String expectedOutput =
+ "public class X<T> {\n" +
+ "class Y<R> {\n" +
+ "class Z<Q> {\n" +
+ " }\n" +
+ " }\n" +
+ " Object o=(@Marker X<@Marker String>.@Marker Y<@Marker Integer>.@Marker Z<@Marker Object>[] @Marker [][] @Marker [])null;\n" +
+ " @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE_USE) @interface Marker {}\n" +
"}\n";
assertASTNodeEquals(expectedOutput, node);
}
@@ -204,7 +204,7 @@ public class TypeAnnotationsConverterTest extends ConverterTestSetup {
" }\n" +
" }\n" +
" int[][][][] o = (@One int[] @Two [][] @Three []) null;\n" +
-
+
" @java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_USE)\n" +
" @interface Marker {\n" +
" }\n" +
@@ -213,14 +213,14 @@ public class TypeAnnotationsConverterTest extends ConverterTestSetup {
ASTNode node = buildAST(
contents,
this.workingCopy, false);
- String expectedOutput =
- "public class X<T> {\n" +
- "class Y<R> {\n" +
- "class Z<Q> {\n" +
- " }\n" +
- " }\n" +
- " int[][][][] o=(@One int[] @Two [][] @Three [])null;\n" +
- " @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE_USE) @interface Marker {}\n" +
+ String expectedOutput =
+ "public class X<T> {\n" +
+ "class Y<R> {\n" +
+ "class Z<Q> {\n" +
+ " }\n" +
+ " }\n" +
+ " int[][][][] o=(@One int[] @Two [][] @Three [])null;\n" +
+ " @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE_USE) @interface Marker {}\n" +
"}\n";
assertASTNodeEquals(expectedOutput, node);
}
@@ -233,7 +233,7 @@ public class TypeAnnotationsConverterTest extends ConverterTestSetup {
" }\n" +
" }\n" +
" String [][][][] o = (@One String[]@Two [][]@Three []) null;\n" +
-
+
" @java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_USE)\n" +
" @interface Marker {\n" +
" }\n" +
@@ -242,14 +242,14 @@ public class TypeAnnotationsConverterTest extends ConverterTestSetup {
ASTNode node = buildAST(
contents,
this.workingCopy, false);
- String expectedOutput =
- "public class X<T> {\n" +
- "class Y<R> {\n" +
- "class Z<Q> {\n" +
- " }\n" +
- " }\n" +
- " String[][][][] o=(@One String[] @Two [][] @Three [])null;\n" +
- " @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE_USE) @interface Marker {}\n" +
+ String expectedOutput =
+ "public class X<T> {\n" +
+ "class Y<R> {\n" +
+ "class Z<Q> {\n" +
+ " }\n" +
+ " }\n" +
+ " String[][][][] o=(@One String[] @Two [][] @Three [])null;\n" +
+ " @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE_USE) @interface Marker {}\n" +
"}\n";
assertASTNodeEquals(expectedOutput, node);
}
@@ -262,7 +262,7 @@ public class TypeAnnotationsConverterTest extends ConverterTestSetup {
" }\n" +
" }\n" +
" Object o = (@One X<String> [] @Two [][]@Three []) null;\n" +
-
+
" @java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_USE)\n" +
" @interface Marker {\n" +
" }\n" +
@@ -271,14 +271,14 @@ public class TypeAnnotationsConverterTest extends ConverterTestSetup {
ASTNode node = buildAST(
contents,
this.workingCopy, false);
- String expectedOutput =
- "public class X<T> {\n" +
- "class Y<R> {\n" +
- "class Z<Q> {\n" +
- " }\n" +
- " }\n" +
- " Object o=(@One X<String>[] @Two [][] @Three [])null;\n" +
- " @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE_USE) @interface Marker {}\n" +
+ String expectedOutput =
+ "public class X<T> {\n" +
+ "class Y<R> {\n" +
+ "class Z<Q> {\n" +
+ " }\n" +
+ " }\n" +
+ " Object o=(@One X<String>[] @Two [][] @Three [])null;\n" +
+ " @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE_USE) @interface Marker {}\n" +
"}\n";
assertASTNodeEquals(expectedOutput, node);
}
@@ -295,12 +295,12 @@ public class TypeAnnotationsConverterTest extends ConverterTestSetup {
ASTNode node = buildAST(
contents,
this.workingCopy, false);
- String expectedOutput =
- "public class X<@NonNull T> {\n" +
- "class Y<@Nullable R> {\n" +
- "class Z<@Readonly Q> {\n" +
- " }\n" +
- " }\n" +
+ String expectedOutput =
+ "public class X<@NonNull T> {\n" +
+ "class Y<@Nullable R> {\n" +
+ "class Z<@Readonly Q> {\n" +
+ " }\n" +
+ " }\n" +
"}\n";
assertASTNodeEquals(expectedOutput, node);
}
@@ -314,9 +314,9 @@ public class TypeAnnotationsConverterTest extends ConverterTestSetup {
ASTNode node = buildAST(
contents,
this.workingCopy, false);
- String expectedOutput =
- "public class X<@NonNull T> {\n" +
- " X<@NonNull ? extends @Nullable String> x;\n" +
+ String expectedOutput =
+ "public class X<@NonNull T> {\n" +
+ " X<@NonNull ? extends @Nullable String> x;\n" +
"}\n";
assertASTNodeEquals(expectedOutput, node);
}
@@ -334,14 +334,14 @@ public class TypeAnnotationsConverterTest extends ConverterTestSetup {
ASTNode node = buildAST(
contents,
this.workingCopy, false);
- String expectedOutput =
- "public class X<@NonNull T> {\n" +
- " void foo(){\n" +
- " try {\n" +
- " }\n" +
- " catch ( @NonNull NullPointerException|@Nullable ArrayIndexOutOfBoundsException e) {\n" +
- " }\n" +
- " }\n" +
+ String expectedOutput =
+ "public class X<@NonNull T> {\n" +
+ " void foo(){\n" +
+ " try {\n" +
+ " }\n" +
+ " catch ( @NonNull NullPointerException|@Nullable ArrayIndexOutOfBoundsException e) {\n" +
+ " }\n" +
+ " }\n" +
"}\n";
assertASTNodeEquals(expectedOutput, node);
}
@@ -359,14 +359,14 @@ public class TypeAnnotationsConverterTest extends ConverterTestSetup {
ASTNode node = buildAST(
contents,
this.workingCopy, false);
- String expectedOutput =
- "public class X<@NonNull T> {\n" +
- " void foo() throws @NonNull NullPointerException, @Nullable ArrayIndexOutOfBoundsException {\n" +
- " try {\n" +
- " }\n" +
- " catch ( @NonNull NullPointerException|@Nullable ArrayIndexOutOfBoundsException e) {\n" +
- " }\n" +
- " }\n" +
+ String expectedOutput =
+ "public class X<@NonNull T> {\n" +
+ " void foo() throws @NonNull NullPointerException, @Nullable ArrayIndexOutOfBoundsException {\n" +
+ " try {\n" +
+ " }\n" +
+ " catch ( @NonNull NullPointerException|@Nullable ArrayIndexOutOfBoundsException e) {\n" +
+ " }\n" +
+ " }\n" +
"}\n";
assertASTNodeEquals(expectedOutput, node);
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/TypeBindingTests308.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/TypeBindingTests308.java
index 829dcf912..feb62742e 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/TypeBindingTests308.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/TypeBindingTests308.java
@@ -121,9 +121,9 @@ public class TypeBindingTests308 extends ConverterTestSetup {
assertEquals("Incorrect annotation", annots[i], (annotations[i] == null) ? null : annotations[i].toString());
}
}
-
+
public void test000() throws Exception {
- String contents =
+ String contents =
"public class X extends @Marker @SingleMember(0) @Normal(value = 0) Object {\n" +
"}\n" +
"@java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_USE)\n" +
@@ -132,7 +132,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
"@interface SingleMember { int value() default 0;}\n" +
"@java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_USE)\n" +
"@interface Normal { int value() default 0;}\n";
-
+
this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true/*resolve*/);
ASTNode node = buildAST(contents, this.workingCopy);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
@@ -143,11 +143,11 @@ public class TypeBindingTests308 extends ConverterTestSetup {
TypeDeclaration typeDecl = (TypeDeclaration) types.get(0);
Type type = typeDecl.getSuperclassType();
assertNotNull("Super class should not be null", type);
-
+
verifyAnnotationOnType(type, new String[]{"@Marker()", "@SingleMember(value = 0)", "@Normal(value = 0)"});
}
public void test001() throws Exception {
- String contents =
+ String contents =
"public class X {\n" +
" @Marker int x;\n" +
"}\n" +
@@ -168,7 +168,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
verifyAnnotationOnType(field.getType(), new String[]{"@Marker()"});
}
public void test002() throws Exception {
- String contents =
+ String contents =
"public class X {\n" +
" @Marker <@Marker2 T> int x() { return 10; };\n" +
"}\n" +
@@ -195,7 +195,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
verifyAnnotationOnType(method.getReturnType2(), new String[]{"@Marker()"});
}
public void test003() throws Exception {
- String contents =
+ String contents =
"public class X {\n" +
" int x(@Marker int p) { return 10; };\n" +
"}\n" +
@@ -216,12 +216,12 @@ public class TypeBindingTests308 extends ConverterTestSetup {
List params = method.parameters();
SingleVariableDeclaration param = (SingleVariableDeclaration) params.get(0);
ITypeBinding binding = param.resolveBinding().getType();
-
+
verifyAnnotationsOnBinding(binding, new String[]{"@Marker()"});
verifyAnnotationOnType(param.getType(), new String[]{"@Marker()"});
}
public void test004() throws Exception {
- String contents =
+ String contents =
"public class X {\n" +
" int x(@Marker int ... p) { return 10; };\n" +
"}\n" +
@@ -245,7 +245,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
}
public void test005() throws Exception {
- String contents =
+ String contents =
"public class X {\n" +
" int x(@Marker int @Marker2 [] @Marker3 ... p) { return 10; };\n" +
"}\n" +
@@ -277,7 +277,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
verifyAnnotationsOnBinding(binding, new String[]{"@Marker()"});
}
public void test006() throws Exception {
- String contents =
+ String contents =
"public class X {\n" +
" int x() {\n" +
" try {\n" +
@@ -310,12 +310,12 @@ public class TypeBindingTests308 extends ConverterTestSetup {
assertEquals("Incorrect union types", 2, types.size());
Type type = (Type) types.get(0);
verifyAnnotationOnType(type, new String[]{"@Marker()"});
-
+
type = (Type) types.get(1);
verifyAnnotationOnType(type, new String[]{"@Marker2()"});
- }
+ }
public void test007() throws Exception {
- String contents =
+ String contents =
"package java.lang;\n" +
"public class X {\n" +
" public void x() throws Exception {\n" +
@@ -352,19 +352,19 @@ public class TypeBindingTests308 extends ConverterTestSetup {
Type type = resource.getType();
assertNotNull("Resource type should not be null", type);
verifyAnnotationOnType(type, new String[]{"@Marker()"});
-
+
resource = (VariableDeclarationExpression) resources.get(1);
type = resource.getType();
assertNotNull("Resource type should not be null", type);
verifyAnnotationOnType(type, new String[]{"@Marker2()"});
-
+
resource = (VariableDeclarationExpression) resources.get(2);
type = resource.getType();
assertNotNull("Resource type should not be null", type);
verifyAnnotationOnType(type, new String[]{"@Marker3()"});
}
public void test008() throws Exception {
- String contents =
+ String contents =
"public class X {\n" +
" int x() {\n" +
" for (@Marker int i: new int[3]) {}\n" +
@@ -396,9 +396,9 @@ public class TypeBindingTests308 extends ConverterTestSetup {
verifyAnnotationsOnBinding(binding, new String[]{"@Marker()"});
binding = type.resolveBinding();
verifyAnnotationsOnBinding(binding, new String[]{"@Marker()"});
- }
+ }
public void test009() throws Exception {
- String contents =
+ String contents =
"interface I {\n" +
" Object copy(int [] ia);\n" +
"}\n" +
@@ -435,7 +435,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
verifyAnnotationsOnBinding(binding, new String[]{"@Marker()"});
}
public void test010() throws Exception {
- String contents =
+ String contents =
"public class X {\n" +
" public static void main(String [] args) {\n" +
" int i [] = new @Marker int @Marker2 [4];\n" +
@@ -474,7 +474,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
fragment = (VariableDeclarationFragment) stmt.fragments().get(0);
arrayCr = (ArrayCreation) fragment.getInitializer();
type = arrayCr.getType();
-
+
binding = type.resolveBinding();
verifyAnnotationOnType(type, new String[]{"@Marker()"});
verifyAnnotationsOnBinding(binding, new String[]{"@Marker()"});
@@ -482,7 +482,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
verifyAnnotationsOnBinding(binding, new String[]{"@Marker2()"});
}
public void test011() throws Exception {
- String contents =
+ String contents =
"public class X {\n" +
" public static void main(String [] args) {\n" +
" int i = (@Marker int) 0;\n" +
@@ -511,12 +511,12 @@ public class TypeBindingTests308 extends ConverterTestSetup {
CastExpression castExp = (CastExpression) fragment.getInitializer();
Type type = castExp.getType();
verifyAnnotationOnType(type, new String[]{"@Marker()"});
-
+
stmt = (VariableDeclarationStatement) statements.get(1);
fragment = (VariableDeclarationFragment) stmt.fragments().get(0);
castExp = (CastExpression) fragment.getInitializer();
ArrayType arrayType = (ArrayType) castExp.getType();
-
+
ITypeBinding binding = arrayType.resolveBinding();
verifyAnnotationOnType(arrayType, new String[]{"@Marker2()"});
verifyAnnotationsOnBinding(binding, new String[]{"@Marker2()"});
@@ -524,7 +524,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
verifyAnnotationsOnBinding(binding, new String[]{"@Marker()"});
}
public void test012() throws Exception {
- String contents =
+ String contents =
"public class X {\n" +
" public static void main(String args) {\n" +
" if (args instanceof @Marker String) {\n" +
@@ -552,7 +552,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
verifyAnnotationOnType(type, new String[]{"@Marker()"});
}
public void test013() throws Exception {
- String contents =
+ String contents =
"public class X extends Y<@Marker(10) Integer, String> {}\n" +
"class Y<T, V> {}\n" +
"@java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_USE)\n" +
@@ -570,11 +570,11 @@ public class TypeBindingTests308 extends ConverterTestSetup {
List arguments = superClass.typeArguments();
assertEquals("Incorrect no of type arguments", 2, arguments.size());
Type type = (Type) arguments.get(0);
-
+
verifyAnnotationOnType(type, new String[]{"@Marker(value = 10)"});
}
public void test014() throws Exception {
- String contents =
+ String contents =
"public class X<T extends Object & Comparable<? super @Marker String>> {}\n" +
"class Y<T> {}\n" +
"@java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_USE)\n" +
@@ -602,7 +602,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
verifyAnnotationOnType(bound, new String[]{"@Marker()"});
}
public void test015() throws Exception {
- String contents =
+ String contents =
"public class X {\n" +
" void foo(Map<@Marker ? super @Marker2 Object, @Marker3 ? extends @Marker4 String> m){}\n" +
" void goo(Map<@Marker4 ? extends @Marker3 Object, @Marker2 ? super @Marker String> m){}\n" +
@@ -624,15 +624,15 @@ public class TypeBindingTests308 extends ConverterTestSetup {
assertProblemsSize(compilationUnit, 0);
List types = compilationUnit.types();
assertEquals("Incorrect no of types", 6, types.size());
-
+
MethodDeclaration[] methods = ((TypeDeclaration) types.get(0)).getMethods();
assertEquals("Incorrect no of metods", 2, methods.length);
MethodDeclaration method = methods[0];
SingleVariableDeclaration arg = (SingleVariableDeclaration) method.parameters().get(0);
-
-
+
+
List typeArgs = ((ParameterizedType) arg.getType()).typeArguments();
-
+
WildcardType wildcard = (WildcardType) typeArgs.get(0);
verifyAnnotationOnType(wildcard, new String[]{"@Marker()"});
Type type = wildcard.getBound();
@@ -642,7 +642,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
verifyAnnotationOnType(wildcard, new String[]{"@Marker3()"});
type = wildcard.getBound();
verifyAnnotationOnType(type, new String[]{"@Marker4()"});
-
+
method = methods[1];
arg = (SingleVariableDeclaration) method.parameters().get(0);
typeArgs = ((ParameterizedType) arg.getType()).typeArguments();
@@ -658,7 +658,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
verifyAnnotationOnType(type, new String[]{"@Marker()"});
}
public void test016() throws Exception {
- String contents =
+ String contents =
"public class X<E> {\n" +
" class Y {\n" +
" E e;\n" +
@@ -690,7 +690,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
verifyAnnotationOnType(type.getQualifier(), new String[]{"@Marker()"});
}
public void test017() throws Exception {
- String contents =
+ String contents =
"public class X<P, C> {\n" +
" public X() {\n" +
" if (!(this instanceof @Marker X)) {}\n" +
@@ -715,7 +715,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
verifyAnnotationOnType(expression.getRightOperand(), new String[]{"@Marker()"});
}
public void test018() throws Exception {
- String contents =
+ String contents =
"interface I {\n" +
" void foo(Y<String>.Z z, int x);\n" +
"}\n" +
@@ -755,7 +755,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
verifyAnnotationOnType(((QualifiedType) type).getQualifier() , new String[]{});
}
public void test019() throws Exception {
- String contents =
+ String contents =
"public class X {\n" +
" public static void main(String [] args) {\n" +
" X [] x = new @Marker X @Marker2 [5];\n" +
@@ -783,10 +783,10 @@ public class TypeBindingTests308 extends ConverterTestSetup {
ArrayCreation initializer = (ArrayCreation) fragment.getInitializer();
ArrayType arrayType = initializer.getType();
ITypeBinding binding = arrayType.resolveBinding();
-
+
verifyAnnotationOnType(arrayType, new String[]{"@Marker2()"});
verifyAnnotationsOnBinding(binding, new String[]{"@Marker2()"});
-
+
binding = binding.getComponentType();
verifyAnnotationsOnBinding(binding, new String[]{"@Marker()"});
@@ -797,12 +797,12 @@ public class TypeBindingTests308 extends ConverterTestSetup {
binding = arrayType.resolveBinding();
verifyAnnotationOnType(arrayType, new String[]{"@Marker()"});
verifyAnnotationsOnBinding(binding, new String[]{"@Marker()"});
-
+
binding = binding.getComponentType();
verifyAnnotationsOnBinding(binding, new String[]{"@Marker2()"});
}
public void test020() throws Exception {
- String contents =
+ String contents =
"public class X {\n" +
" public static void main(String [] args) {\n" +
" Map.Entry<String, String> [] e = (Map.@Marker Entry<String, String> []) null;\n" +
@@ -834,7 +834,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
verifyAnnotationOnType(type.getType(), new String[]{"@Marker()"});
}
public void test021() throws Exception {
- String contents =
+ String contents =
"import java.io.Serializable;\n" +
"import java.util.List;\n" +
"public class X<T extends Comparable<T> & Serializable> {\n" +
@@ -864,10 +864,10 @@ public class TypeBindingTests308 extends ConverterTestSetup {
verifyAnnotationOnType(bound, new String[]{"@Marker()", "@Marker2()"});
}
public void test022() throws Exception {
- String contents =
+ String contents =
"public class X {\n" +
" X x = new @Marker X();\n" +
- " X y = new <String> @Marker X();\n" +
+ " X y = new <String> @Marker X();\n" +
" <T> X(){}\n" +
"}\n" +
"@java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_USE)\n" +
@@ -887,14 +887,14 @@ public class TypeBindingTests308 extends ConverterTestSetup {
VariableDeclarationFragment fragment = (VariableDeclarationFragment) field.fragments().get(0);
ClassInstanceCreation creation = (ClassInstanceCreation) fragment.getInitializer();
verifyAnnotationOnType(creation.getType(), new String[]{"@Marker()"});
-
+
field = fields[1];
fragment = (VariableDeclarationFragment) field.fragments().get(0);
creation = (ClassInstanceCreation) fragment.getInitializer();
verifyAnnotationOnType(creation.getType(), new String[]{"@Marker()"});
}
public void test023() throws Exception {
- String contents =
+ String contents =
"public class X {\n" +
" class Y {\n" +
" <T> Y(){}\n" +
@@ -923,7 +923,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
verifyAnnotationOnType(creation.getType(), new String[]{"@Marker2()"});
creation = (ClassInstanceCreation) creation.getExpression();
verifyAnnotationOnType(creation.getType(), new String[]{"@Marker()"});
-
+
field = fields[1];
fragment = (VariableDeclarationFragment) field.fragments().get(0);
creation = (ClassInstanceCreation) fragment.getInitializer();
@@ -932,7 +932,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
verifyAnnotationOnType(creation.getType(), new String[]{"@Marker2()"});
}
public void test024() throws Exception {
- String contents =
+ String contents =
"public class X {\n" +
" void foo() throws @Marker NullPointerException, @Marker2 ArrayIndexOutOfBoundsException {}\n" +
"}\n" +
@@ -958,7 +958,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
verifyAnnotationOnType(type, new String[]{"@Marker2()"});
}
public void test025() throws Exception {
- String contents =
+ String contents =
"interface I {}\n" +
"interface J {}\n" +
"interface K extends @Marker I, @Marker2 J {}\n" +
@@ -982,7 +982,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
assertEquals("Incorrect no of super interfaces", 2, interfaces.size());
verifyAnnotationOnType((Type) interfaces.get(0), new String[]{"@Marker()"});
verifyAnnotationOnType((Type) interfaces.get(1), new String[]{"@Marker2()"});
-
+
typeDecl = (TypeDeclaration) types.get(4);
interfaces = typeDecl.superInterfaceTypes();
assertEquals("Incorrect no of super interfaces", 2, interfaces.size());
@@ -990,7 +990,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
verifyAnnotationOnType((Type) interfaces.get(1), new String[]{"@Marker()"});
}
public void test026() throws Exception {
- String contents =
+ String contents =
"interface I {\n" +
" void foo(int x);\n" +
"}\n" +
@@ -1022,7 +1022,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
TypeDeclaration typeDecl = (TypeDeclaration) types.get(1);
MethodDeclaration method = typeDecl.getMethods()[0];
List statements = method.getBody().statements();
-
+
VariableDeclarationStatement stmt = (VariableDeclarationStatement) statements.get(0);
VariableDeclarationFragment fragment = (VariableDeclarationFragment) stmt.fragments().get(0);
TypeMethodReference lambda = (TypeMethodReference) fragment.getInitializer();
@@ -1031,7 +1031,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
verifyAnnotationOnType(type, new String[]{"@Marker()"});
}
public void test027() throws Exception {
- String contents =
+ String contents =
"interface I {\n" +
" Y foo(int x);\n" +
"}\n" +
@@ -1083,7 +1083,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=418096
public void test028() throws Exception {
- String contents =
+ String contents =
"public class X {\n" +
" @TypeUseAnnotation(\"a\") String @TypeUseAnnotation(\"a1\") [] @TypeUseAnnotation(\"a2\") [] _field2 @TypeUseAnnotation(\"a3\") [], _field3 @TypeUseAnnotation(\"a4\") [][] = null;\n" +
"}" +
@@ -1118,7 +1118,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
verifyAnnotationsOnBinding(binding = binding.getComponentType(), new String[]{"@TypeUseAnnotation(value = a2)"});
verifyAnnotationsOnBinding(binding = binding.getComponentType(), new String[]{"@TypeUseAnnotation(value = a)"});
}
-
+
public void testAnnotatedBinaryType() throws CoreException, IOException {
String jarName = "TypeBindingTests308.jar";
String srcName = "TypeBindingTests308_src.zip";
@@ -1138,18 +1138,18 @@ public class TypeBindingTests308 extends ConverterTestSetup {
" String value() default \"GOK\";\n" +
"}\n"
};
-
+
HashMap libraryOptions = new HashMap(javaProject.getOptions(true));
libraryOptions.put(CompilerOptions.OPTION_Store_Annotations, CompilerOptions.ENABLED);
addLibrary(javaProject, jarName, srcName, pathAndContents, JavaCore.VERSION_1_8, libraryOptions);
-
- String contents =
+
+ String contents =
"public class X {\n" +
" void foo(Outer o) {\n" +
" o.omi = null;\n" +
" }\n" +
"}";
-
+
this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true);
ASTNode node = buildAST(contents, this.workingCopy);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
@@ -1158,7 +1158,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
List types = compilationUnit.types();
assertEquals("Incorrect no of types", 1, types.size());
TypeDeclaration typeDecl = (TypeDeclaration) types.get(0);
-
+
MethodDeclaration[] methods = typeDecl.getMethods();
assertEquals("Incorrect no of methods", 1, methods.length);
MethodDeclaration method = methods[0];
@@ -1167,7 +1167,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
Assignment assignment = (Assignment) stmt.getExpression();
Expression left = assignment.getLeftHandSide();
ITypeBinding type = left.resolveTypeBinding();
- assertEquals("Wrong type", "@Marker((String)\"Outer\") Outer.@Marker((String)\"Middle\") Middle.@Marker((String)\"Inner\") Inner", type.toString());
+ assertEquals("Wrong type", "@Marker((String)\"Outer\") Outer.@Marker((String)\"Middle\") Middle.@Marker((String)\"Inner\") Inner", type.toString());
} finally {
removeLibrary(javaProject, jarName, srcName);
}
@@ -1191,18 +1191,18 @@ public class TypeBindingTests308 extends ConverterTestSetup {
" String value() default \"GOK\";\n" +
"}\n"
};
-
+
HashMap libraryOptions = new HashMap(javaProject.getOptions(true));
libraryOptions.put(CompilerOptions.OPTION_Store_Annotations, CompilerOptions.ENABLED);
addLibrary(javaProject, jarName, srcName, pathAndContents, JavaCore.VERSION_1_8, libraryOptions);
-
- String contents =
+
+ String contents =
"public class X {\n" +
" void foo(Outer o) {\n" +
" o.omi = null;\n" +
" }\n" +
"}";
-
+
this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true);
ASTNode node = buildAST(contents, this.workingCopy);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
@@ -1211,7 +1211,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
List types = compilationUnit.types();
assertEquals("Incorrect no of types", 1, types.size());
TypeDeclaration typeDecl = (TypeDeclaration) types.get(0);
-
+
MethodDeclaration[] methods = typeDecl.getMethods();
assertEquals("Incorrect no of methods", 1, methods.length);
MethodDeclaration method = methods[0];
@@ -1220,7 +1220,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
Assignment assignment = (Assignment) stmt.getExpression();
Expression left = assignment.getLeftHandSide();
ITypeBinding type = left.resolveTypeBinding();
- assertEquals("Wrong type", "@Marker((String)\"Outer\") Outer.@Marker((String)\"Middle\") Middle.@Marker((String)\"Inner\") Inner @Marker((String)\"Extended []\") [] @Marker((String)\"Prefix []\") []", type.toString());
+ assertEquals("Wrong type", "@Marker((String)\"Outer\") Outer.@Marker((String)\"Middle\") Middle.@Marker((String)\"Inner\") Inner @Marker((String)\"Extended []\") [] @Marker((String)\"Prefix []\") []", type.toString());
} finally {
removeLibrary(javaProject, jarName, srcName);
}
@@ -1242,18 +1242,18 @@ public class TypeBindingTests308 extends ConverterTestSetup {
" int value();\n" +
"}\n"
};
-
+
HashMap libraryOptions = new HashMap(javaProject.getOptions(true));
libraryOptions.put(CompilerOptions.OPTION_Store_Annotations, CompilerOptions.ENABLED);
addLibrary(javaProject, jarName, srcName, pathAndContents, JavaCore.VERSION_1_8, libraryOptions);
-
- String contents =
+
+ String contents =
"public class X {\n" +
" void foo(Outer<String> o) {\n" +
" o.omi = null;\n" +
" }\n" +
"}";
-
+
this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true);
ASTNode node = buildAST(contents, this.workingCopy);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
@@ -1262,7 +1262,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
List types = compilationUnit.types();
assertEquals("Incorrect no of types", 1, types.size());
TypeDeclaration typeDecl = (TypeDeclaration) types.get(0);
-
+
MethodDeclaration[] methods = typeDecl.getMethods();
assertEquals("Incorrect no of methods", 1, methods.length);
MethodDeclaration method = methods[0];
@@ -1271,12 +1271,12 @@ public class TypeBindingTests308 extends ConverterTestSetup {
Assignment assignment = (Assignment) stmt.getExpression();
Expression left = assignment.getLeftHandSide();
ITypeBinding type = left.resolveTypeBinding();
- assertEquals("Wrong type", "@T((int)1) Outer<@T((int)2) String>.@T((int)3) Inner<@T((int)4) Integer> @T((int)6) [] @T((int)5) []", type.toString());
+ assertEquals("Wrong type", "@T((int)1) Outer<@T((int)2) String>.@T((int)3) Inner<@T((int)4) Integer> @T((int)6) [] @T((int)5) []", type.toString());
} finally {
removeLibrary(javaProject, jarName, srcName);
}
}
-
+
public void testAnnotatedBinaryType4() throws CoreException, IOException {
String jarName = "TypeBindingTests308.jar";
String srcName = "TypeBindingTests308_src.zip";
@@ -1294,18 +1294,18 @@ public class TypeBindingTests308 extends ConverterTestSetup {
" int value();\n" +
"}\n"
};
-
+
HashMap libraryOptions = new HashMap(javaProject.getOptions(true));
libraryOptions.put(CompilerOptions.OPTION_Store_Annotations, CompilerOptions.ENABLED);
addLibrary(javaProject, jarName, srcName, pathAndContents, JavaCore.VERSION_1_8, libraryOptions);
-
- String contents =
+
+ String contents =
"public class X {\n" +
" void foo(Outer<String> o) {\n" +
" o.f = null;\n" +
" }\n" +
"}";
-
+
this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true);
ASTNode node = buildAST(contents, this.workingCopy);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
@@ -1314,7 +1314,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
List types = compilationUnit.types();
assertEquals("Incorrect no of types", 1, types.size());
TypeDeclaration typeDecl = (TypeDeclaration) types.get(0);
-
+
MethodDeclaration[] methods = typeDecl.getMethods();
assertEquals("Incorrect no of methods", 1, methods.length);
MethodDeclaration method = methods[0];
@@ -1323,7 +1323,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
Assignment assignment = (Assignment) stmt.getExpression();
Expression left = assignment.getLeftHandSide();
ITypeBinding type = left.resolveTypeBinding();
- assertEquals("Wrong type", "@T((int)1) String @T((int)3) [] @T((int)2) []", type.toString());
+ assertEquals("Wrong type", "@T((int)1) String @T((int)3) [] @T((int)2) []", type.toString());
} finally {
removeLibrary(javaProject, jarName, srcName);
}
@@ -1345,18 +1345,18 @@ public class TypeBindingTests308 extends ConverterTestSetup {
" int value();\n" +
"}\n"
};
-
+
HashMap libraryOptions = new HashMap(javaProject.getOptions(true));
libraryOptions.put(CompilerOptions.OPTION_Store_Annotations, CompilerOptions.ENABLED);
addLibrary(javaProject, jarName, srcName, pathAndContents, JavaCore.VERSION_1_8, libraryOptions);
-
- String contents =
+
+ String contents =
"public class X {\n" +
" void foo(Outer<String> o) {\n" +
" o.f = null;\n" +
" }\n" +
"}";
-
+
this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true);
ASTNode node = buildAST(contents, this.workingCopy);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
@@ -1365,7 +1365,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
List types = compilationUnit.types();
assertEquals("Incorrect no of types", 1, types.size());
TypeDeclaration typeDecl = (TypeDeclaration) types.get(0);
-
+
MethodDeclaration[] methods = typeDecl.getMethods();
assertEquals("Incorrect no of methods", 1, methods.length);
MethodDeclaration method = methods[0];
@@ -1374,7 +1374,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
Assignment assignment = (Assignment) stmt.getExpression();
Expression left = assignment.getLeftHandSide();
ITypeBinding type = left.resolveTypeBinding();
- assertEquals("Wrong type", "@T((int)1) Outer<@T((int)2) ? extends @T((int)3) String>.@T((int)4) Inner<@T((int)5) ? super @T((int)6) Integer> @T((int)8) [] @T((int)7) []", type.toString());
+ assertEquals("Wrong type", "@T((int)1) Outer<@T((int)2) ? extends @T((int)3) String>.@T((int)4) Inner<@T((int)5) ? super @T((int)6) Integer> @T((int)8) [] @T((int)7) []", type.toString());
} finally {
removeLibrary(javaProject, jarName, srcName);
}
@@ -1396,18 +1396,18 @@ public class TypeBindingTests308 extends ConverterTestSetup {
" int value();\n" +
"}\n"
};
-
+
HashMap libraryOptions = new HashMap(javaProject.getOptions(true));
libraryOptions.put(CompilerOptions.OPTION_Store_Annotations, CompilerOptions.ENABLED);
addLibrary(javaProject, jarName, srcName, pathAndContents, JavaCore.VERSION_1_8, libraryOptions);
-
- String contents =
+
+ String contents =
"public class X {\n" +
" void foo(Outer<String> o) {\n" +
" o.f = null;\n" +
" }\n" +
"}";
-
+
this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true);
ASTNode node = buildAST(contents, this.workingCopy);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
@@ -1416,7 +1416,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
List types = compilationUnit.types();
assertEquals("Incorrect no of types", 1, types.size());
TypeDeclaration typeDecl = (TypeDeclaration) types.get(0);
-
+
MethodDeclaration[] methods = typeDecl.getMethods();
assertEquals("Incorrect no of methods", 1, methods.length);
MethodDeclaration method = methods[0];
@@ -1425,13 +1425,13 @@ public class TypeBindingTests308 extends ConverterTestSetup {
Assignment assignment = (Assignment) stmt.getExpression();
Expression left = assignment.getLeftHandSide();
ITypeBinding type = left.resolveTypeBinding();
- assertEquals("Wrong type", "@T((int)1) Outer#RAW.@T((int)2) Inner#RAW @T((int)4) [] @T((int)3) []", type.toString());
+ assertEquals("Wrong type", "@T((int)1) Outer#RAW.@T((int)2) Inner#RAW @T((int)4) [] @T((int)3) []", type.toString());
} finally {
removeLibrary(javaProject, jarName, srcName);
}
}
public void testIntersectionCastType() throws CoreException, IOException {
- String contents =
+ String contents =
"import java.lang.annotation.ElementType;\n" +
"import java.lang.annotation.Target;\n" +
"@Target(ElementType.TYPE_USE)\n" +
@@ -1465,7 +1465,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
Type castType = cast.getType();
ITypeBinding binding1 = castType.resolveBinding();
assertEquals("Wrong annotations", "@T1 Object & @T2 Runnable & @T3 Serializable", binding1.toString());
-
+
field = fields[1];
fragments = field.fragments();
assertEquals("Incorrect no of fragments", 1, fragments.size());
@@ -1488,12 +1488,12 @@ public class TypeBindingTests308 extends ConverterTestSetup {
" }\n" +
"}\n"
};
-
+
HashMap libraryOptions = new HashMap(javaProject.getOptions(true));
libraryOptions.put(CompilerOptions.OPTION_Store_Annotations, CompilerOptions.ENABLED);
addLibrary(javaProject, jarName, srcName, pathAndContents, JavaCore.VERSION_1_8, libraryOptions);
-
- String contents =
+
+ String contents =
"public class X {\n" +
" void foo(@T Outer o) {\n" +
" }\n" +
@@ -1501,8 +1501,8 @@ public class TypeBindingTests308 extends ConverterTestSetup {
"@java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_USE)\n" +
"@interface T {\n" +
"}\n";
-
-
+
+
this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true);
ASTNode node = buildAST(contents, this.workingCopy);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
@@ -1511,7 +1511,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
List types = compilationUnit.types();
assertEquals("Incorrect no of types", 2, types.size());
TypeDeclaration typeDecl = (TypeDeclaration) types.get(0);
-
+
MethodDeclaration[] methods = typeDecl.getMethods();
assertEquals("Incorrect no of methods", 1, methods.length);
MethodDeclaration method = methods[0];
@@ -1541,18 +1541,18 @@ public class TypeBindingTests308 extends ConverterTestSetup {
"@interface T {\n" +
"}\n"
};
-
+
HashMap libraryOptions = new HashMap(javaProject.getOptions(true));
libraryOptions.put(CompilerOptions.OPTION_Store_Annotations, CompilerOptions.ENABLED);
addLibrary(javaProject, jarName, srcName, pathAndContents, JavaCore.VERSION_1_8, libraryOptions);
-
- String contents =
+
+ String contents =
"public class X {\n" +
" void foo(Outer o) {\n" +
" o.f = null;\n" +
" }\n" +
"}\n";
-
+
this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true);
ASTNode node = buildAST(contents, this.workingCopy);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
@@ -1561,7 +1561,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
List types = compilationUnit.types();
assertEquals("Incorrect no of types", 1, types.size());
TypeDeclaration typeDecl = (TypeDeclaration) types.get(0);
-
+
MethodDeclaration[] methods = typeDecl.getMethods();
assertEquals("Incorrect no of methods", 1, methods.length);
MethodDeclaration method = methods[0];
@@ -1593,17 +1593,17 @@ public class TypeBindingTests308 extends ConverterTestSetup {
"public abstract class Y implements Comparable<@T1 Y>{ \n" +
"}\n"
};
-
+
HashMap libraryOptions = new HashMap(javaProject.getOptions(true));
libraryOptions.put(CompilerOptions.OPTION_Store_Annotations, CompilerOptions.ENABLED);
addLibrary(javaProject, jarName, srcName, pathAndContents, JavaCore.VERSION_1_8, libraryOptions);
-
- String contents =
+
+ String contents =
"public class X {\n" +
" void foo(Y y) {\n" +
" }\n" +
"}\n";
-
+
this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true);
ASTNode node = buildAST(contents, this.workingCopy);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
@@ -1612,7 +1612,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
List types = compilationUnit.types();
assertEquals("Incorrect no of types", 1, types.size());
TypeDeclaration typeDecl = (TypeDeclaration) types.get(0);
-
+
MethodDeclaration[] methods = typeDecl.getMethods();
assertEquals("Incorrect no of methods", 1, methods.length);
MethodDeclaration method = methods[0];
@@ -1621,13 +1621,13 @@ public class TypeBindingTests308 extends ConverterTestSetup {
ITypeBinding binding = parameter.resolveBinding().getType();
ITypeBinding binding2 = binding.getInterfaces()[0].getTypeArguments()[0];
assertEquals("Wrong type", "@T1 Y", binding2.toString());
- assertEquals("Wrong type", "Comparable<@T1 Y>", binding2.getInterfaces()[0].toString());
+ assertEquals("Wrong type", "Comparable<@T1 Y>", binding2.getInterfaces()[0].toString());
} finally {
removeLibrary(javaProject, jarName, srcName);
}
}
public void testMemberTypeSource() throws CoreException, IOException {
- String contents =
+ String contents =
"import java.lang.annotation.ElementType;\n" +
"import java.lang.annotation.Target;\n" +
"@Target(ElementType.TYPE_USE)\n" +
@@ -1653,7 +1653,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
assertEquals("Wrong Type", "@T X.Y", (binding = binding.getDeclaredTypes()[0]).toString());
}
public void testAnnotatedTypeIdentity() throws CoreException, IOException {
- String contents =
+ String contents =
"import java.lang.annotation.ElementType;\n" +
"import java.lang.annotation.Target;\n" +
"import java.util.List;\n" +
@@ -1696,19 +1696,19 @@ public class TypeBindingTests308 extends ConverterTestSetup {
" int value() default 10;\n" +
"}\n"
};
-
+
HashMap libraryOptions = new HashMap(javaProject.getOptions(true));
libraryOptions.put(CompilerOptions.OPTION_Store_Annotations, CompilerOptions.ENABLED);
addLibrary(javaProject, jarName, srcName, pathAndContents, JavaCore.VERSION_1_8, libraryOptions);
-
- String contents =
+
+ String contents =
"public class X {\n" +
" Outer @T [] f @T [];\n" +
" void foo(Outer o) {\n" +
" o.f = this.f;\n" +
" }\n" +
"}";
-
+
this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true);
ASTNode node = buildAST(contents, this.workingCopy);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
@@ -1717,7 +1717,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
List types = compilationUnit.types();
assertEquals("Incorrect no of types", 1, types.size());
TypeDeclaration typeDecl = (TypeDeclaration) types.get(0);
-
+
MethodDeclaration[] methods = typeDecl.getMethods();
assertEquals("Incorrect no of methods", 1, methods.length);
MethodDeclaration method = methods[0];
@@ -1750,12 +1750,12 @@ public class TypeBindingTests308 extends ConverterTestSetup {
" int value() default 10;\n" +
"}\n"
};
-
+
HashMap libraryOptions = new HashMap(javaProject.getOptions(true));
libraryOptions.put(CompilerOptions.OPTION_Store_Annotations, CompilerOptions.ENABLED);
addLibrary(javaProject, jarName, srcName, pathAndContents, JavaCore.VERSION_1_8, libraryOptions);
-
- String contents =
+
+ String contents =
"import java.util.List;\n" +
"public class X {\n" +
" @T List<@T String> ls;\n" +
@@ -1763,7 +1763,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
" o.ls = this.ls;\n" +
" }\n" +
"}";
-
+
this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true);
ASTNode node = buildAST(contents, this.workingCopy);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
@@ -1772,7 +1772,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
List types = compilationUnit.types();
assertEquals("Incorrect no of types", 1, types.size());
TypeDeclaration typeDecl = (TypeDeclaration) types.get(0);
-
+
MethodDeclaration[] methods = typeDecl.getMethods();
assertEquals("Incorrect no of methods", 1, methods.length);
MethodDeclaration method = methods[0];
@@ -1790,7 +1790,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
}
}
public void testHybridAnnotations() throws CoreException, IOException {
- String contents =
+ String contents =
"import java.lang.annotation.ElementType;\n" +
"import java.lang.annotation.Target;\n" +
"@interface A {\n" +
@@ -1811,7 +1811,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
" void foo(@A @AUse @AUseParameter @AUseLocal @AParameter X x) {\n" +
" }\n" +
"}\n";
-
+
this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true);
ASTNode node = buildAST(contents, this.workingCopy);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
@@ -1830,7 +1830,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
verifyAnnotationsOnBinding(type, new String [] { "@AUse()", "@AUseParameter()", "@AUseLocal()" });
}
public void testGenericMethod() throws CoreException, IOException {
- String contents =
+ String contents =
"import java.lang.annotation.Annotation;\n" +
"import java.lang.annotation.ElementType;\n" +
"import java.lang.annotation.Target;\n" +
@@ -1842,7 +1842,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
" return null;\n" +
" }\n" +
"}\n";
-
+
this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true);
ASTNode node = buildAST(contents, this.workingCopy);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
@@ -1859,7 +1859,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
verifyAnnotationsOnBinding(type, new String [] { "@T()" });
}
public void testHybridAnnotations2() throws CoreException, IOException {
- String contents =
+ String contents =
"import java.lang.annotation.Target;\n" +
"import java.lang.annotation.ElementType;\n" +
"@Target({ ElementType.TYPE_USE, ElementType.METHOD })\n" +
@@ -1878,7 +1878,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
" @SillyAnnotation\n" +
" X field;\n" +
"}\n";
-
+
this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true);
ASTNode node = buildAST(contents, this.workingCopy);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
@@ -1886,11 +1886,11 @@ public class TypeBindingTests308 extends ConverterTestSetup {
assertProblemsSize(compilationUnit, 0);
List types = compilationUnit.types();
assertEquals("Incorrect no of types", 2, types.size());
-
+
TypeDeclaration typeDecl = (TypeDeclaration) types.get(1);
MethodDeclaration[] methods = typeDecl.getMethods();
assertEquals("Incorrect no of methods", 3, methods.length);
-
+
MethodDeclaration method = methods[0];
List modifiers = method.modifiers();
int size = modifiers.size();
@@ -1902,7 +1902,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
assertTrue("should be 0", annotations == null || annotations.length == 0);
IAnnotationBinding [] typeAnnotations = parameter.getType().resolveBinding().getTypeAnnotations();
assertEquals("Incorrect annotation", "@SillyAnnotation()", typeAnnotations[0].toString());
-
+
method = methods[1];
modifiers = method.modifiers();
size = modifiers.size();
@@ -1916,7 +1916,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
assertTrue("should be 0", annotations == null || annotations.length == 0);
typeAnnotations = parameter.getType().resolveBinding().getTypeAnnotations();
assertEquals("Incorrect annotation", "@SillyAnnotation()", typeAnnotations[0].toString());
-
+
method = methods[2];
modifiers = method.modifiers();
size = modifiers.size();
@@ -1931,10 +1931,10 @@ public class TypeBindingTests308 extends ConverterTestSetup {
assertTrue("should be 0", annotations == null || annotations.length == 0);
typeAnnotations = parameter.getType().resolveBinding().getTypeAnnotations();
assertEquals("Incorrect annotation", "@SillyAnnotation()", typeAnnotations[0].toString());
-
+
FieldDeclaration[] fields = typeDecl.getFields();
assertEquals("Incorrect no of fields", 1, fields.length);
-
+
FieldDeclaration field = fields[0];
modifiers = field.modifiers();
size = modifiers.size();
@@ -1944,7 +1944,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
VariableDeclarationFragment fragment = (VariableDeclarationFragment) field.fragments().get(0);
annotations = fragment.resolveBinding().getAnnotations();
assertTrue("Incorrect annotation", annotations == null || annotations.length == 0);
-
+
typeAnnotations = field.getType().resolveBinding().getTypeAnnotations();
assertTrue("Should be just 1", typeAnnotations.length == 1);
assertEquals("Incorrect annotation", "@SillyAnnotation()", typeAnnotations[0].toString());
@@ -1976,12 +1976,12 @@ public class TypeBindingTests308 extends ConverterTestSetup {
" class Inner {}\n" +
"}\n"
};
-
+
HashMap libraryOptions = new HashMap(javaProject.getOptions(true));
libraryOptions.put(CompilerOptions.OPTION_Store_Annotations, CompilerOptions.ENABLED);
addLibrary(javaProject, jarName, srcName, pathAndContents, JavaCore.VERSION_1_8, libraryOptions);
-
- String contents =
+
+ String contents =
"@T(21)\n" +
"public abstract class X extends @T(22) Superclass implements @T(23) Runnable {\n" +
" Object @T(24) [] field;\n" +
@@ -1996,7 +1996,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
" class Inner {\n" +
" }\n" +
"}\n";
-
+
this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true);
ASTNode node = buildAST(contents, this.workingCopy);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
@@ -2015,72 +2015,72 @@ public class TypeBindingTests308 extends ConverterTestSetup {
annotations = typeBinding.getInterfaces()[0].getTypeAnnotations();
assertTrue("Should be 1", annotations.length == 1);
assertEquals("Annotation mismatch", "@T(value = 23)", annotations[0].toString());
-
+
annotations = typeDecl.getFields()[0].getType().resolveBinding().getTypeAnnotations();
assertTrue("Should be 1", annotations.length == 1);
assertEquals("Annotation mismatch", "@T(value = 24)", annotations[0].toString());
-
+
annotations = typeDecl.getMethods()[0].getReturnType2().resolveBinding().getTypeAnnotations();
assertTrue("Should be 1", annotations.length == 1);
assertEquals("Annotation mismatch", "@T(value = 25)", annotations[0].toString());
-
+
annotations = typeDecl.getMethods()[0].getReceiverType().resolveBinding().getTypeAnnotations();
assertTrue("Should be 1", annotations.length == 1);
assertEquals("Annotation mismatch", "@T(value = 26)", annotations[0].toString());
-
+
annotations = ((SingleVariableDeclaration) (typeDecl.getMethods()[0].parameters().get(0))).getType().resolveBinding().getTypeAnnotations();
assertTrue("Should be 1", annotations.length == 1);
assertEquals("Annotation mismatch", "@T(value = 27)", annotations[0].toString());
-
+
annotations = ((Type) typeDecl.getMethods()[0].thrownExceptionTypes().get(0)).resolveBinding().getTypeAnnotations();
assertTrue("Should be 1", annotations.length == 1);
assertEquals("Annotation mismatch", "@T(value = 28)", annotations[0].toString());
-
+
annotations = typeDecl.getMethods()[1].resolveBinding().getAnnotations();
assertTrue("Should be 0", annotations.length == 0);
-
+
annotations = typeDecl.getTypes()[0].resolveBinding().getAnnotations();
assertTrue("Should be 1", annotations.length == 1);
assertEquals("Annotation mismatch", "@T(value = 30)", annotations[0].toString());
-
-
+
+
// Check the same set of things for the binary type.
annotations = typeBinding.getSuperclass().getAnnotations();
assertTrue("Should be 1", annotations.length == 1);
assertEquals("Annotation mismatch", "@T(value = 1)", annotations[0].toString());
-
+
annotations = typeBinding.getSuperclass().getSuperclass().getTypeAnnotations();
assertTrue("Should be 1", annotations.length == 1);
assertEquals("Annotation mismatch", "@T(value = 2)", annotations[0].toString());
-
+
annotations = typeBinding.getSuperclass().getInterfaces()[0].getTypeAnnotations();
assertTrue("Should be 1", annotations.length == 1);
assertEquals("Annotation mismatch", "@T(value = 3)", annotations[0].toString());
-
+
annotations = typeBinding.getSuperclass().getDeclaredFields()[0].getType().getTypeAnnotations();
assertTrue("Should be 1", annotations.length == 1);
assertEquals("Annotation mismatch", "@T(value = 4)", annotations[0].toString());
-
+
// Skip past the constructor at [0]
annotations = typeBinding.getSuperclass().getDeclaredMethods()[1].getReturnType().getTypeAnnotations();
assertTrue("Should be 1", annotations.length == 1);
assertEquals("Annotation mismatch", "@T(value = 5)", annotations[0].toString());
-
+
annotations = typeBinding.getSuperclass().getDeclaredMethods()[1].getDeclaredReceiverType().getTypeAnnotations();
assertTrue("Should be 1", annotations.length == 1);
assertEquals("Annotation mismatch", "@T(value = 6)", annotations[0].toString());
-
+
annotations = typeBinding.getSuperclass().getDeclaredMethods()[1].getParameterTypes()[0].getTypeAnnotations();
assertTrue("Should be 1", annotations.length == 1);
assertEquals("Annotation mismatch", "@T(value = 7)", annotations[0].toString());
-
+
annotations = typeBinding.getSuperclass().getDeclaredMethods()[1].getExceptionTypes()[0].getTypeAnnotations();
assertTrue("Should be 1", annotations.length == 1);
assertEquals("Annotation mismatch", "@T(value = 8)", annotations[0].toString());
-
+
annotations = typeBinding.getSuperclass().getDeclaredMethods()[0].getAnnotations();
assertTrue("Should be 0", annotations.length == 0);
-
+
annotations = typeBinding.getSuperclass().getDeclaredTypes()[0].getAnnotations();
assertTrue("Should be 1", annotations.length == 1);
assertEquals("Annotation mismatch", "@T(value = 10)", annotations[0].toString());
@@ -2116,16 +2116,16 @@ public class TypeBindingTests308 extends ConverterTestSetup {
" static class SubNested extends @T(15) Nested {}\n" +
"}\n"
};
-
+
HashMap libraryOptions = new HashMap(javaProject.getOptions(true));
libraryOptions.put(CompilerOptions.OPTION_Store_Annotations, CompilerOptions.ENABLED);
addLibrary(javaProject, jarName, srcName, pathAndContents, JavaCore.VERSION_1_8, libraryOptions);
-
- String contents =
+
+ String contents =
"@T(21)\n" +
"public abstract class X extends @T(22) Superclass implements @T(23) Runnable {\n" +
"}\n";
-
+
this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true);
ASTNode node = buildAST(contents, this.workingCopy);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
@@ -2138,29 +2138,29 @@ public class TypeBindingTests308 extends ConverterTestSetup {
IAnnotationBinding[] annotations = typeBinding.getAnnotations();
assertTrue("Should be 1", annotations.length == 1);
assertEquals("Annotation mismatch", "@T(value = 21)", annotations[0].toString());
-
+
ITypeBinding superclass = typeBinding.getSuperclass();
ITypeBinding[] inners = superclass.getDeclaredTypes();
assertTrue("Should be 2", inners.length == 4);
-
+
ITypeBinding subInner = inners[2];
assertEquals("Type name mismatch", "SubInner", subInner.getName());
annotations = subInner.getAnnotations();
assertTrue("Should be 1", annotations.length == 1);
assertEquals("Annotation mismatch", "@T(value = 11)", annotations[0].toString());
-
+
annotations = subInner.getSuperclass().getTypeAnnotations();
assertTrue("Should be 1", annotations.length == 1);
assertEquals("Annotation mismatch", "@T(value = 12)", annotations[0].toString());
-
+
ITypeBinding subNested = inners[3];
annotations = subNested.getAnnotations();
assertTrue("Should be 1", annotations.length == 1);
assertEquals("Annotation mismatch", "@T(value = 14)", annotations[0].toString());
-
+
annotations = subNested.getSuperclass().getTypeAnnotations();
assertTrue("Should be 1", annotations.length == 1);
- assertEquals("Annotation mismatch", "@T(value = 15)", annotations[0].toString());
+ assertEquals("Annotation mismatch", "@T(value = 15)", annotations[0].toString());
} finally {
removeLibrary(javaProject, jarName, srcName);
}
@@ -2175,22 +2175,22 @@ public class TypeBindingTests308 extends ConverterTestSetup {
"T.java",
"import java.lang.annotation.ElementType;\n" +
"import java.lang.annotation.Target;\n" +
- "@Deprecated\n" +
+ "@Deprecated\n" +
"@Target(ElementType.TYPE_USE)\n" +
"@interface T {\n" +
" int value() default 0;\n" +
"}\n"
};
-
+
HashMap libraryOptions = new HashMap(javaProject.getOptions(true));
libraryOptions.put(CompilerOptions.OPTION_Store_Annotations, CompilerOptions.ENABLED);
addLibrary(javaProject, jarName, srcName, pathAndContents, JavaCore.VERSION_1_8, libraryOptions);
-
- String contents =
+
+ String contents =
"@T\n" +
"public class X {\n" +
"}\n";
-
+
this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true);
ASTNode node = buildAST(contents, this.workingCopy, false);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
@@ -2210,7 +2210,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=420320, [1.8] Bad AST recovery with type annotation and a syntax error in secondary type
public void testAnnotationRecovery() throws CoreException, IOException {
- String contents =
+ String contents =
"import java.lang.annotation.ElementType;\n" +
"import java.lang.annotation.Target;\n" +
"import java.util.List;\n" +
@@ -2224,7 +2224,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
" void bar()\n" +
" void foo() { }\n" +
"}\n";
-
+
String expected =
"import java.lang.annotation.ElementType;\n" +
"import java.lang.annotation.Target;\n" +
@@ -2239,18 +2239,18 @@ public class TypeBindingTests308 extends ConverterTestSetup {
" void foo(){\n" +
" }\n" +
"}\n";
-
+
this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true);
ASTNode node = buildAST(contents, this.workingCopy, false, true);
assertEquals("AST mismatch", expected, node.toString());
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427337
public void testBug427337() throws CoreException, IOException {
- String contents =
+ String contents =
"public class X implements I {\n" +
"}\n";
- createFile("/Converter18/src/NonNull.java",
+ createFile("/Converter18/src/NonNull.java",
"import java.lang.annotation.ElementType;\n" +
"import java.lang.annotation.Target;\n" +
"@Target(ElementType.TYPE_USE)\n" +
@@ -2310,9 +2310,9 @@ public class TypeBindingTests308 extends ConverterTestSetup {
deleteFile("/Converter18/src/Outer.java");
}
}
- // 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() throws CoreException, IOException {
- String contents =
+ String contents =
"import java.lang.annotation.ElementType;\n" +
"import java.lang.annotation.Target;\n" +
"public class X {\n" +
@@ -2322,7 +2322,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
"class Outer {\n" +
" class Middle<E> {}\n" +
"}\n";
-
+
this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true);
ASTNode node = buildAST(contents, this.workingCopy);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
@@ -2338,7 +2338,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=425216, Bug 425216 - [1.8][dom ast] Binding for 'this' should have type annotations when receiver is annotated
public void test425216() throws CoreException, IOException {
- String contents =
+ String contents =
"import static java.lang.annotation.ElementType.TYPE_USE;\n" +
"import java.lang.annotation.Target;\n" +
"@Target(TYPE_USE)\n" +
@@ -2348,7 +2348,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
" return this;\n" +
" }\n" +
"}\n";
-
+
this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true);
ASTNode node = buildAST(contents, this.workingCopy);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
@@ -2367,7 +2367,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=425216, Bug 425216 - [1.8][dom ast] Binding for 'this' should have type annotations when receiver is annotated
public void test425216a() throws CoreException, IOException {
- String contents =
+ String contents =
"import java.lang.annotation.*;\n" +
"@Target(ElementType.TYPE_USE)\n" +
"@interface A {\n" +
@@ -2384,7 +2384,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
" }\n" +
" }\n" +
"}\n";
-
+
this.workingCopy = getWorkingCopy("/Converter18/src/Outer.java", true);
ASTNode node = buildAST(contents, this.workingCopy);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
@@ -2416,7 +2416,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=425216, Bug 425216 - [1.8][dom ast] Binding for 'this' should have type annotations when receiver is annotated
public void test425216b() throws CoreException, IOException {
- String contents =
+ String contents =
"import java.lang.annotation.*;\n" +
"@Target(ElementType.TYPE_USE)\n" +
"@interface A {\n" +
@@ -2430,7 +2430,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
" }\n" +
" }\n" +
"}\n";
-
+
this.workingCopy = getWorkingCopy("/Converter18/src/Outer.java", true);
ASTNode node = buildAST(contents, this.workingCopy);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
@@ -2447,7 +2447,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427320
public void testBug427320() throws Exception {
try {
- String contents =
+ String contents =
"public class X {\n" +
" @A @B @C X() {}\n" +
" @A @B @C String foo() {\nreturn null;\n}\n" +
@@ -2460,7 +2460,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
"@interface B {}\n" +
"@java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_USE)\n" +
"@interface C {}\n";
-
+
this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true/*resolve*/);
ASTNode node = buildAST(contents, this.workingCopy, false);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
@@ -2478,7 +2478,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
ITypeBinding binding = methodBinding.getReturnType();
annots = binding.getTypeAnnotations();
assertEquals("Incorrect no of annotations", 0, annots.length);
-
+
method = typeDecl.getMethods()[1];
methodBinding = method.resolveBinding();
annots = methodBinding.getAnnotations();
@@ -2619,7 +2619,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
} finally {
deleteFile("/Converter18/src/X.java");
}
- }
+ }
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=487716
public void testBug487716a() throws Exception {
try {
@@ -2644,10 +2644,10 @@ public class TypeBindingTests308 extends ConverterTestSetup {
List types = compilationUnit.types();
TypeDeclaration typeDecl = (TypeDeclaration) types.get(1);
-
+
assertEquals(1, typeDecl.getTypes().length);
typeDecl = typeDecl.getTypes()[0];
-
+
// On the Qualified Allocation expression type - new X().new Y()
FieldDeclaration field = typeDecl.getFields()[0];
VariableDeclarationFragment fragment = (VariableDeclarationFragment) field.fragments().get(0);
@@ -2671,24 +2671,24 @@ public class TypeBindingTests308 extends ConverterTestSetup {
assertFalse(srcRoot.isReadOnly());
createFolder(srcRoot.getPath().append("test"));
IPackageFragment testPackage = srcRoot.getPackageFragment("test");
-
- testPackage.createCompilationUnit("Generic.java",
- "package test;\n" +
- "\n" +
- "public class Generic<T> {\n" +
- " public static class NestedStatic {\n" +
- " public static final String X = \"x\";\n" +
- " }\n" +
+
+ testPackage.createCompilationUnit("Generic.java",
+ "package test;\n" +
+ "\n" +
+ "public class Generic<T> {\n" +
+ " public static class NestedStatic {\n" +
+ " public static final String X = \"x\";\n" +
+ " }\n" +
"}\n",
true,
null);
String contents =
- "package test;\n" +
- "\n" +
- "public class Usage {\n" +
- " String f() {\n" +
- " return Generic.NestedStatic.X;\n" +
- " }\n" +
+ "package test;\n" +
+ "\n" +
+ "public class Usage {\n" +
+ " String f() {\n" +
+ " return Generic.NestedStatic.X;\n" +
+ " }\n" +
"}\n";
ICompilationUnit cu = testPackage.createCompilationUnit("Usage.java", contents, true, null);
ASTNode node = buildAST(contents, cu, false);
@@ -2701,7 +2701,7 @@ public class TypeBindingTests308 extends ConverterTestSetup {
assertEquals(1, methods.size());
List statements = ((MethodDeclaration) methods.get(0)).getBody().statements();
assertEquals(1, statements.size());
-
+
Expression expression = ((ReturnStatement) statements.get(0)).getExpression();
IBinding binding = ((QualifiedName) expression).getQualifier().resolveBinding();
assertNotNull(binding);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/extensions/TestExternalLibContainerInitializer.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/extensions/TestExternalLibContainerInitializer.java
index 0010858ac..e34346f30 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/extensions/TestExternalLibContainerInitializer.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/extensions/TestExternalLibContainerInitializer.java
@@ -25,29 +25,29 @@ import org.eclipse.jdt.core.JavaCore;
public class TestExternalLibContainerInitializer extends ClasspathContainerInitializer {
IClasspathEntry[] entries;
-
+
public void initialize(final IPath containerName, IJavaProject project)
throws CoreException {
IPath ws = ResourcesPlugin.getWorkspace().getRoot().getLocation();
final IPath containerPath = ws.append("../TestContainer/");
IClasspathContainer container = new IClasspathContainer() {
-
+
public IPath getPath() {
return containerName;
}
-
+
public int getKind() {
return IClasspathContainer.K_APPLICATION;
}
-
+
public String getDescription() {
return "Test Container";
}
-
+
public IClasspathEntry[] getClasspathEntries() {
if (TestExternalLibContainerInitializer.this.entries == null) {
TestExternalLibContainerInitializer.this.entries = new IClasspathEntry[] {
- JavaCore.newLibraryEntry(containerPath, null, null)
+ JavaCore.newLibraryEntry(containerPath, null, null)
};
}
return TestExternalLibContainerInitializer.this.entries;
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugs18Tests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugs18Tests.java
index 85439d774..eb72547cc 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugs18Tests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugs18Tests.java
@@ -40,7 +40,7 @@ public void setUpSuite() throws Exception {
/**
* @bug 426520: [1.8][formatter] inserts spaces into annotated qualified type
* @test Ensure that formatting does not change the qualified type formatting for c and it
- * it removes the spaces for s.
+ * it removes the spaces for s.
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=426520"
*/
public void testBug426520a() throws JavaModelException {
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java
index 3bbf65b3d..1dc88efff 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java
@@ -85,29 +85,29 @@ public void setUpSuite() throws Exception {
*/
public void testBug027079a() throws JavaModelException {
String source =
- "public class X01 {\n" +
- "\n" +
- "/* disable-formatter */\n" +
- "void foo( ) { \n" +
- " // unformatted comment\n" +
- "}\n" +
- "/* enable-formatter */\n" +
- "void bar( ) { \n" +
- " // formatted comment\n" +
- "}\n" +
- "}\n";
- formatSource(source,
- "public class X01 {\n" +
- "\n" +
- " /* disable-formatter */\n" +
- " void foo() {\n" +
- " // unformatted comment\n" +
- " }\n" +
- "\n" +
- " /* enable-formatter */\n" +
- " void bar() {\n" +
- " // formatted comment\n" +
- " }\n" +
+ "public class X01 {\n" +
+ "\n" +
+ "/* disable-formatter */\n" +
+ "void foo( ) { \n" +
+ " // unformatted comment\n" +
+ "}\n" +
+ "/* enable-formatter */\n" +
+ "void bar( ) { \n" +
+ " // formatted comment\n" +
+ "}\n" +
+ "}\n";
+ formatSource(source,
+ "public class X01 {\n" +
+ "\n" +
+ " /* disable-formatter */\n" +
+ " void foo() {\n" +
+ " // unformatted comment\n" +
+ " }\n" +
+ "\n" +
+ " /* enable-formatter */\n" +
+ " void bar() {\n" +
+ " // formatted comment\n" +
+ " }\n" +
"}\n"
);
}
@@ -116,28 +116,28 @@ public void testBug027079a1() throws JavaModelException {
this.formatterPrefs.disabling_tag = "disable-formatter".toCharArray();
this.formatterPrefs.enabling_tag = "enable-formatter".toCharArray();
String source =
- "public class X01 {\n" +
- "\n" +
- "/* disable-formatter */\n" +
- "void foo( ) { \n" +
- " // unformatted comment\n" +
- "}\n" +
- "/* enable-formatter */\n" +
- "void bar( ) { \n" +
- " // formatted comment\n" +
- "}\n" +
+ "public class X01 {\n" +
+ "\n" +
+ "/* disable-formatter */\n" +
+ "void foo( ) { \n" +
+ " // unformatted comment\n" +
+ "}\n" +
+ "/* enable-formatter */\n" +
+ "void bar( ) { \n" +
+ " // formatted comment\n" +
+ "}\n" +
"}\n";
formatSource(source,
- "public class X01 {\n" +
- "\n" +
- "/* disable-formatter */\n" +
- "void foo( ) { \n" +
- " // unformatted comment\n" +
- "}\n" +
- "/* enable-formatter */\n" +
- " void bar() {\n" +
- " // formatted comment\n" +
- " }\n" +
+ "public class X01 {\n" +
+ "\n" +
+ "/* disable-formatter */\n" +
+ "void foo( ) { \n" +
+ " // unformatted comment\n" +
+ "}\n" +
+ "/* enable-formatter */\n" +
+ " void bar() {\n" +
+ " // formatted comment\n" +
+ " }\n" +
"}\n"
);
}
@@ -146,28 +146,28 @@ public void testBug027079a2() throws JavaModelException {
this.formatterPrefs.disabling_tag = "disable-formatter".toCharArray();
this.formatterPrefs.enabling_tag = "enable-formatter".toCharArray();
String source =
- "public class X01 {\n" +
- "\n" +
- "/** disable-formatter */\n" +
- "void foo( ) { \n" +
- " // unformatted comment\n" +
- "}\n" +
- "/** enable-formatter */\n" +
- "void bar( ) { \n" +
- " // formatted comment\n" +
- "}\n" +
+ "public class X01 {\n" +
+ "\n" +
+ "/** disable-formatter */\n" +
+ "void foo( ) { \n" +
+ " // unformatted comment\n" +
+ "}\n" +
+ "/** enable-formatter */\n" +
+ "void bar( ) { \n" +
+ " // formatted comment\n" +
+ "}\n" +
"}\n";
formatSource(source,
- "public class X01 {\n" +
- "\n" +
- "/** disable-formatter */\n" +
- "void foo( ) { \n" +
- " // unformatted comment\n" +
- "}\n" +
- "/** enable-formatter */\n" +
- " void bar() {\n" +
- " // formatted comment\n" +
- " }\n" +
+ "public class X01 {\n" +
+ "\n" +
+ "/** disable-formatter */\n" +
+ "void foo( ) { \n" +
+ " // unformatted comment\n" +
+ "}\n" +
+ "/** enable-formatter */\n" +
+ " void bar() {\n" +
+ " // formatted comment\n" +
+ " }\n" +
"}\n"
);
}
@@ -176,28 +176,28 @@ public void testBug027079a3() throws JavaModelException {
this.formatterPrefs.disabling_tag = "disable-formatter".toCharArray();
this.formatterPrefs.enabling_tag = "enable-formatter".toCharArray();
String source =
- "public class X01 {\n" +
- "\n" +
- "// disable-formatter\n" +
- "void foo( ) { \n" +
- " // unformatted comment\n" +
- "}\n" +
- "// enable-formatter\n" +
- "void bar( ) { \n" +
- " // formatted comment\n" +
- "}\n" +
+ "public class X01 {\n" +
+ "\n" +
+ "// disable-formatter\n" +
+ "void foo( ) { \n" +
+ " // unformatted comment\n" +
+ "}\n" +
+ "// enable-formatter\n" +
+ "void bar( ) { \n" +
+ " // formatted comment\n" +
+ "}\n" +
"}\n";
formatSource(source,
- "public class X01 {\n" +
- "\n" +
- "// disable-formatter\n" +
- "void foo( ) { \n" +
- " // unformatted comment\n" +
- "}\n" +
- "// enable-formatter\n" +
- " void bar() {\n" +
- " // formatted comment\n" +
- " }\n" +
+ "public class X01 {\n" +
+ "\n" +
+ "// disable-formatter\n" +
+ "void foo( ) { \n" +
+ " // unformatted comment\n" +
+ "}\n" +
+ "// enable-formatter\n" +
+ " void bar() {\n" +
+ " // formatted comment\n" +
+ " }\n" +
"}\n"
);
}
@@ -206,29 +206,29 @@ public void testBug027079a4() throws JavaModelException {
this.formatterPrefs.disabling_tag = "disable-formatter".toCharArray();
this.formatterPrefs.enabling_tag = "enable-formatter".toCharArray();
String source =
- "public class X01 {\n" +
- "\n" +
- "// disable-formatter\n" +
- "void foo( ) { \n" +
- " // unformatted comment \n" +
- "}\n" +
- "// enable-formatter \n" +
- "void bar( ) { \n" +
- " // formatted comment \n" +
- " /* disable-formatter *//* unformatted comment *//* enable-formatter */\n" +
+ "public class X01 {\n" +
+ "\n" +
+ "// disable-formatter\n" +
+ "void foo( ) { \n" +
+ " // unformatted comment \n" +
+ "}\n" +
+ "// enable-formatter \n" +
+ "void bar( ) { \n" +
+ " // formatted comment \n" +
+ " /* disable-formatter *//* unformatted comment *//* enable-formatter */\n" +
"}\n" + "}\n";
formatSource(source,
- "public class X01 {\n" +
- "\n" +
- "// disable-formatter\n" +
- "void foo( ) { \n" +
- " // unformatted comment \n" +
- "}\n" +
- "// enable-formatter \n" +
- " void bar() {\n" +
- " // formatted comment\n" +
- " /* disable-formatter *//* unformatted comment *//* enable-formatter */\n" +
- " }\n" +
+ "public class X01 {\n" +
+ "\n" +
+ "// disable-formatter\n" +
+ "void foo( ) { \n" +
+ " // unformatted comment \n" +
+ "}\n" +
+ "// enable-formatter \n" +
+ " void bar() {\n" +
+ " // formatted comment\n" +
+ " /* disable-formatter *//* unformatted comment *//* enable-formatter */\n" +
+ " }\n" +
"}\n"
);
}
@@ -237,37 +237,37 @@ public void testBug027079b() throws JavaModelException {
this.formatterPrefs.disabling_tag = "disable-formatter".toCharArray();
this.formatterPrefs.enabling_tag = "enable-formatter".toCharArray();
String source =
- "public class X02 {\n" +
- "void foo() {\n" +
- "/* disable-formatter */\n" +
- " /* unformatted comment */\n" +
- " String test1= \"this\"+\n" +
- " \"is\"+\n" +
- " \"a specific\"+\n" +
- " \"line wrapping \";\n" +
- "\n" +
- "/* enable-formatter */\n" +
- " /* formatted comment */\n" +
- " String test2= \"this\"+\n" +
- " \"is\"+\n" +
- " \"a specific\"+\n" +
- " \"line wrapping \";\n" +
- "}\n" +
- "}\n";
- formatSource(source,
- "public class X02 {\n" +
- " void foo() {\n" +
- "/* disable-formatter */\n" +
- " /* unformatted comment */\n" +
- " String test1= \"this\"+\n" +
- " \"is\"+\n" +
- " \"a specific\"+\n" +
- " \"line wrapping \";\n" +
- "\n" +
- "/* enable-formatter */\n" +
- " /* formatted comment */\n" +
- " String test2 = \"this\" + \"is\" + \"a specific\" + \"line wrapping \";\n" +
- " }\n" +
+ "public class X02 {\n" +
+ "void foo() {\n" +
+ "/* disable-formatter */\n" +
+ " /* unformatted comment */\n" +
+ " String test1= \"this\"+\n" +
+ " \"is\"+\n" +
+ " \"a specific\"+\n" +
+ " \"line wrapping \";\n" +
+ "\n" +
+ "/* enable-formatter */\n" +
+ " /* formatted comment */\n" +
+ " String test2= \"this\"+\n" +
+ " \"is\"+\n" +
+ " \"a specific\"+\n" +
+ " \"line wrapping \";\n" +
+ "}\n" +
+ "}\n";
+ formatSource(source,
+ "public class X02 {\n" +
+ " void foo() {\n" +
+ "/* disable-formatter */\n" +
+ " /* unformatted comment */\n" +
+ " String test1= \"this\"+\n" +
+ " \"is\"+\n" +
+ " \"a specific\"+\n" +
+ " \"line wrapping \";\n" +
+ "\n" +
+ "/* enable-formatter */\n" +
+ " /* formatted comment */\n" +
+ " String test2 = \"this\" + \"is\" + \"a specific\" + \"line wrapping \";\n" +
+ " }\n" +
"}\n"
);
}
@@ -276,48 +276,48 @@ public void testBug027079c() throws JavaModelException {
this.formatterPrefs.disabling_tag = "disable-formatter".toCharArray();
this.formatterPrefs.enabling_tag = "enable-formatter".toCharArray();
String source =
- "public class X03 {\n" +
- "void foo() {\n" +
- "/* disable-formatter */\n" +
- " bar(\n" +
- " /** unformatted comment */\n" +
- " \"this\" ,\n" +
- " \"is\",\n" +
- " \"a specific\",\n" +
- " \"line wrapping \"\n" +
- " );\n" +
- "\n" +
- "/* enable-formatter */\n" +
- " bar(\n" +
- " /** formatted comment */\n" +
- " \"this\" ,\n" +
- " \"is\",\n" +
- " \"a specific\",\n" +
- " \"line wrapping \"\n" +
- " );\n" +
- "}\n" +
- "void bar(String... str) {}\n" +
- "}\n";
- formatSource(source,
- "public class X03 {\n" +
- " void foo() {\n" +
- "/* disable-formatter */\n" +
- " bar(\n" +
- " /** unformatted comment */\n" +
- " \"this\" ,\n" +
- " \"is\",\n" +
- " \"a specific\",\n" +
- " \"line wrapping \"\n" +
- " );\n" +
- "\n" +
- "/* enable-formatter */\n" +
- " bar(\n" +
- " /** formatted comment */\n" +
- " \"this\", \"is\", \"a specific\", \"line wrapping \");\n" +
- " }\n" +
- "\n" +
- " void bar(String... str) {\n" +
- " }\n" +
+ "public class X03 {\n" +
+ "void foo() {\n" +
+ "/* disable-formatter */\n" +
+ " bar(\n" +
+ " /** unformatted comment */\n" +
+ " \"this\" ,\n" +
+ " \"is\",\n" +
+ " \"a specific\",\n" +
+ " \"line wrapping \"\n" +
+ " );\n" +
+ "\n" +
+ "/* enable-formatter */\n" +
+ " bar(\n" +
+ " /** formatted comment */\n" +
+ " \"this\" ,\n" +
+ " \"is\",\n" +
+ " \"a specific\",\n" +
+ " \"line wrapping \"\n" +
+ " );\n" +
+ "}\n" +
+ "void bar(String... str) {}\n" +
+ "}\n";
+ formatSource(source,
+ "public class X03 {\n" +
+ " void foo() {\n" +
+ "/* disable-formatter */\n" +
+ " bar(\n" +
+ " /** unformatted comment */\n" +
+ " \"this\" ,\n" +
+ " \"is\",\n" +
+ " \"a specific\",\n" +
+ " \"line wrapping \"\n" +
+ " );\n" +
+ "\n" +
+ "/* enable-formatter */\n" +
+ " bar(\n" +
+ " /** formatted comment */\n" +
+ " \"this\", \"is\", \"a specific\", \"line wrapping \");\n" +
+ " }\n" +
+ "\n" +
+ " void bar(String... str) {\n" +
+ " }\n" +
"}\n"
);
}
@@ -326,46 +326,46 @@ public void testBug027079c2() throws JavaModelException {
this.formatterPrefs.disabling_tag = "disable-formatter".toCharArray();
this.formatterPrefs.enabling_tag = "enable-formatter".toCharArray();
String source =
- "public class X03b {\n" +
- "void foo() {\n" +
- " bar(\n" +
- "// disable-formatter\n" +
- " /** unformatted comment */\n" +
- " \"this\" ,\n" +
- " \"is\",\n" +
- " \"a specific\",\n" +
- " \"line wrapping \"\n" +
- "// enable-formatter\n" +
- " );\n" +
- " bar(\n" +
- " /** formatted comment */\n" +
- " \"this\" ,\n" +
- " \"is\",\n" +
- " \"a specific\",\n" +
- " \"line wrapping \"\n" +
- " );\n" +
- "}\n" +
- "void bar(String... str) {}\n" +
- "}\n";
- formatSource(source,
- "public class X03b {\n" +
- " void foo() {\n" +
- " bar(\n" +
- "// disable-formatter\n" +
- " /** unformatted comment */\n" +
- " \"this\" ,\n" +
- " \"is\",\n" +
- " \"a specific\",\n" +
- " \"line wrapping \"\n" +
- "// enable-formatter\n" +
- " );\n" +
- " bar(\n" +
- " /** formatted comment */\n" +
- " \"this\", \"is\", \"a specific\", \"line wrapping \");\n" +
- " }\n" +
- "\n" +
- " void bar(String... str) {\n" +
- " }\n" +
+ "public class X03b {\n" +
+ "void foo() {\n" +
+ " bar(\n" +
+ "// disable-formatter\n" +
+ " /** unformatted comment */\n" +
+ " \"this\" ,\n" +
+ " \"is\",\n" +
+ " \"a specific\",\n" +
+ " \"line wrapping \"\n" +
+ "// enable-formatter\n" +
+ " );\n" +
+ " bar(\n" +
+ " /** formatted comment */\n" +
+ " \"this\" ,\n" +
+ " \"is\",\n" +
+ " \"a specific\",\n" +
+ " \"line wrapping \"\n" +
+ " );\n" +
+ "}\n" +
+ "void bar(String... str) {}\n" +
+ "}\n";
+ formatSource(source,
+ "public class X03b {\n" +
+ " void foo() {\n" +
+ " bar(\n" +
+ "// disable-formatter\n" +
+ " /** unformatted comment */\n" +
+ " \"this\" ,\n" +
+ " \"is\",\n" +
+ " \"a specific\",\n" +
+ " \"line wrapping \"\n" +
+ "// enable-formatter\n" +
+ " );\n" +
+ " bar(\n" +
+ " /** formatted comment */\n" +
+ " \"this\", \"is\", \"a specific\", \"line wrapping \");\n" +
+ " }\n" +
+ "\n" +
+ " void bar(String... str) {\n" +
+ " }\n" +
"}\n"
);
}
@@ -374,28 +374,28 @@ public void testBug027079d() throws JavaModelException {
this.formatterPrefs.disabling_tag = "disable-formatter".toCharArray();
this.formatterPrefs.enabling_tag = "enable-formatter".toCharArray();
String source =
- "public class X04 {\n" +
- "\n" +
- "/* disable-formatter */\n" +
- "void foo( ) { \n" +
- " // unformatted comment \n" +
- "}\n" +
- "/* enable-formatter */\n" +
- "void bar( ) { \n" +
- " // formatted comment \n" +
- "}\n" +
- "}\n";
- formatSource(source,
- "public class X04 {\n" +
- "\n" +
- "/* disable-formatter */\n" +
- "void foo( ) { \n" +
- " // unformatted comment \n" +
- "}\n" +
- "/* enable-formatter */\n" +
- " void bar() {\n" +
- " // formatted comment\n" +
- " }\n" +
+ "public class X04 {\n" +
+ "\n" +
+ "/* disable-formatter */\n" +
+ "void foo( ) { \n" +
+ " // unformatted comment \n" +
+ "}\n" +
+ "/* enable-formatter */\n" +
+ "void bar( ) { \n" +
+ " // formatted comment \n" +
+ "}\n" +
+ "}\n";
+ formatSource(source,
+ "public class X04 {\n" +
+ "\n" +
+ "/* disable-formatter */\n" +
+ "void foo( ) { \n" +
+ " // unformatted comment \n" +
+ "}\n" +
+ "/* enable-formatter */\n" +
+ " void bar() {\n" +
+ " // formatted comment\n" +
+ " }\n" +
"}\n",
CodeFormatter.K_COMPILATION_UNIT | CodeFormatter.F_INCLUDE_COMMENTS,
0 /* indentation level */,
@@ -409,28 +409,28 @@ public void testBug027079d2() throws JavaModelException {
this.formatterPrefs.disabling_tag = "disable-formatter".toCharArray();
this.formatterPrefs.enabling_tag = "enable-formatter".toCharArray();
String source =
- "public class X04b {\n" +
- "\n" +
- "/* disable-formatter */\n" +
- "void foo( ) { \n" +
- " // unformatted comment \n" +
- "}\n" +
- "/* enable-formatter */\n" +
- "void bar( ) { \n" +
- " // formatted comment \n" +
- "}\n" +
- "}\n";
- formatSource(source,
- "public class X04b {\n" +
- "\n" +
- "/* disable-formatter */\n" +
- "void foo( ) { \n" +
- " // unformatted comment \n" +
- "}\n" +
- "/* enable-formatter */\n" +
- " void bar() {\n" +
- " // formatted comment\n" +
- " }\n" +
+ "public class X04b {\n" +
+ "\n" +
+ "/* disable-formatter */\n" +
+ "void foo( ) { \n" +
+ " // unformatted comment \n" +
+ "}\n" +
+ "/* enable-formatter */\n" +
+ "void bar( ) { \n" +
+ " // formatted comment \n" +
+ "}\n" +
+ "}\n";
+ formatSource(source,
+ "public class X04b {\n" +
+ "\n" +
+ "/* disable-formatter */\n" +
+ "void foo( ) { \n" +
+ " // unformatted comment \n" +
+ "}\n" +
+ "/* enable-formatter */\n" +
+ " void bar() {\n" +
+ " // formatted comment\n" +
+ " }\n" +
"}\n",
CodeFormatter.K_COMPILATION_UNIT | CodeFormatter.F_INCLUDE_COMMENTS,
0 /* indentation level */,
@@ -444,28 +444,28 @@ public void testBug027079d3() throws JavaModelException {
this.formatterPrefs.disabling_tag = "disable-formatter".toCharArray();
this.formatterPrefs.enabling_tag = "enable-formatter".toCharArray();
String source =
- "public class X04c {\n" +
- "\n" +
- "/* disable-formatter */\n" +
- "void foo( ) { \n" +
- " // unformatted comment \n" +
- "}\n" +
- "/* enable-formatter */\n" +
- "void bar( ) { \n" +
- " // formatted comment \n" +
- "}\n" +
- "}\n";
- formatSource(source,
- "public class X04c {\n" +
- "\n" +
- "/* disable-formatter */\n" +
- "void foo( ) { \n" +
- " // unformatted comment \n" +
- "}\n" +
- "/* enable-formatter */\n" +
- " void bar() {\n" +
- " // formatted comment\n" +
- " }\n" +
+ "public class X04c {\n" +
+ "\n" +
+ "/* disable-formatter */\n" +
+ "void foo( ) { \n" +
+ " // unformatted comment \n" +
+ "}\n" +
+ "/* enable-formatter */\n" +
+ "void bar( ) { \n" +
+ " // formatted comment \n" +
+ "}\n" +
+ "}\n";
+ formatSource(source,
+ "public class X04c {\n" +
+ "\n" +
+ "/* disable-formatter */\n" +
+ "void foo( ) { \n" +
+ " // unformatted comment \n" +
+ "}\n" +
+ "/* enable-formatter */\n" +
+ " void bar() {\n" +
+ " // formatted comment\n" +
+ " }\n" +
"}\n",
CodeFormatter.K_COMPILATION_UNIT | CodeFormatter.F_INCLUDE_COMMENTS,
0 /* indentation level */,
@@ -479,28 +479,28 @@ public void testBug027079d4() throws JavaModelException {
this.formatterPrefs.disabling_tag = "disable-formatter".toCharArray();
this.formatterPrefs.enabling_tag = "enable-formatter".toCharArray();
String source =
- "public class X04d {\n" +
- "\n" +
- "/* disable-formatter */\n" +
- "void foo( ) { \n" +
- " // unformatted comment \n" +
- "}\n" +
- "/* enable-formatter */\n" +
- "void bar( ) { \n" +
- " // formatted comment \n" +
- "}\n" +
- "}\n";
- formatSource(source,
- "public class X04d {\n" +
- "\n" +
- "/* disable-formatter */\n" +
- "void foo( ) { \n" +
- " // unformatted comment \n" +
- "}\n" +
- "/* enable-formatter */\n" +
- " void bar() {\n" +
- " // formatted comment\n" +
- " }\n" +
+ "public class X04d {\n" +
+ "\n" +
+ "/* disable-formatter */\n" +
+ "void foo( ) { \n" +
+ " // unformatted comment \n" +
+ "}\n" +
+ "/* enable-formatter */\n" +
+ "void bar( ) { \n" +
+ " // formatted comment \n" +
+ "}\n" +
+ "}\n";
+ formatSource(source,
+ "public class X04d {\n" +
+ "\n" +
+ "/* disable-formatter */\n" +
+ "void foo( ) { \n" +
+ " // unformatted comment \n" +
+ "}\n" +
+ "/* enable-formatter */\n" +
+ " void bar() {\n" +
+ " // formatted comment\n" +
+ " }\n" +
"}\n",
CodeFormatter.K_COMPILATION_UNIT | CodeFormatter.F_INCLUDE_COMMENTS,
0 /* indentation level */,
@@ -514,28 +514,28 @@ public void testBug027079e() throws JavaModelException {
this.formatterPrefs.disabling_tag = "format: off".toCharArray();
this.formatterPrefs.enabling_tag = "format: on".toCharArray();
String source =
- "public class X05 {\n" +
- "\n" +
- "/* format: off */\n" +
- "void foo( ) { \n" +
- " // unformatted comment\n" +
- "}\n" +
- "/* format: on */\n" +
- "void bar( ) { \n" +
- " // formatted comment\n" +
- "}\n" +
+ "public class X05 {\n" +
+ "\n" +
+ "/* format: off */\n" +
+ "void foo( ) { \n" +
+ " // unformatted comment\n" +
+ "}\n" +
+ "/* format: on */\n" +
+ "void bar( ) { \n" +
+ " // formatted comment\n" +
+ "}\n" +
"}\n";
formatSource(source,
- "public class X05 {\n" +
- "\n" +
- "/* format: off */\n" +
- "void foo( ) { \n" +
- " // unformatted comment\n" +
- "}\n" +
- "/* format: on */\n" +
- " void bar() {\n" +
- " // formatted comment\n" +
- " }\n" +
+ "public class X05 {\n" +
+ "\n" +
+ "/* format: off */\n" +
+ "void foo( ) { \n" +
+ " // unformatted comment\n" +
+ "}\n" +
+ "/* format: on */\n" +
+ " void bar() {\n" +
+ " // formatted comment\n" +
+ " }\n" +
"}\n"
);
}
@@ -544,28 +544,28 @@ public void testBug027079f() throws JavaModelException {
this.formatterPrefs.disabling_tag = "format: off".toCharArray();
this.formatterPrefs.enabling_tag = "format: on".toCharArray();
String source =
- "public class X06 {\n" +
- "\n" +
- "// format: off\n" +
- "void foo( ) { \n" +
- " // unformatted comment\n" +
- "}\n" +
- "// format: on\n" +
- "void bar( ) { \n" +
- " // formatted comment\n" +
- "}\n" +
+ "public class X06 {\n" +
+ "\n" +
+ "// format: off\n" +
+ "void foo( ) { \n" +
+ " // unformatted comment\n" +
+ "}\n" +
+ "// format: on\n" +
+ "void bar( ) { \n" +
+ " // formatted comment\n" +
+ "}\n" +
"}\n";
formatSource(source,
- "public class X06 {\n" +
- "\n" +
- "// format: off\n" +
- "void foo( ) { \n" +
- " // unformatted comment\n" +
- "}\n" +
- "// format: on\n" +
- " void bar() {\n" +
- " // formatted comment\n" +
- " }\n" +
+ "public class X06 {\n" +
+ "\n" +
+ "// format: off\n" +
+ "void foo( ) { \n" +
+ " // unformatted comment\n" +
+ "}\n" +
+ "// format: on\n" +
+ " void bar() {\n" +
+ " // formatted comment\n" +
+ " }\n" +
"}\n"
);
}
@@ -574,28 +574,28 @@ public void testBug027079f2() throws JavaModelException {
this.formatterPrefs.disabling_tag = "format: off".toCharArray();
this.formatterPrefs.enabling_tag = "format: on".toCharArray();
String source =
- "public class X06b {\n" +
- "\n" +
- "/** format: off */\n" +
- "void foo( ) { \n" +
- " // unformatted comment\n" +
- "}\n" +
- "/** format: on */\n" +
- "void bar( ) { \n" +
- " // formatted comment\n" +
- "}\n" +
+ "public class X06b {\n" +
+ "\n" +
+ "/** format: off */\n" +
+ "void foo( ) { \n" +
+ " // unformatted comment\n" +
+ "}\n" +
+ "/** format: on */\n" +
+ "void bar( ) { \n" +
+ " // formatted comment\n" +
+ "}\n" +
"}\n";
formatSource(source,
- "public class X06b {\n" +
- "\n" +
- "/** format: off */\n" +
- "void foo( ) { \n" +
- " // unformatted comment\n" +
- "}\n" +
- "/** format: on */\n" +
- " void bar() {\n" +
- " // formatted comment\n" +
- " }\n" +
+ "public class X06b {\n" +
+ "\n" +
+ "/** format: off */\n" +
+ "void foo( ) { \n" +
+ " // unformatted comment\n" +
+ "}\n" +
+ "/** format: on */\n" +
+ " void bar() {\n" +
+ " // formatted comment\n" +
+ " }\n" +
"}\n"
);
}
@@ -604,28 +604,28 @@ public void testBug027079f3() throws JavaModelException {
this.formatterPrefs.disabling_tag = " format: off ".toCharArray();
this.formatterPrefs.enabling_tag = " format: on ".toCharArray();
String source =
- "public class X06c {\n" +
- "\n" +
- "/* format: off */\n" +
- "void foo( ) { \n" +
- " // unformatted comment\n" +
- "}\n" +
- "// format: on \n" +
- "void bar( ) { \n" +
- " // formatted comment\n" +
- "}\n" +
+ "public class X06c {\n" +
+ "\n" +
+ "/* format: off */\n" +
+ "void foo( ) { \n" +
+ " // unformatted comment\n" +
+ "}\n" +
+ "// format: on \n" +
+ "void bar( ) { \n" +
+ " // formatted comment\n" +
+ "}\n" +
"}\n";
formatSource(source,
- "public class X06c {\n" +
- "\n" +
- "/* format: off */\n" +
- "void foo( ) { \n" +
- " // unformatted comment\n" +
- "}\n" +
- "// format: on \n" +
- " void bar() {\n" +
- " // formatted comment\n" +
- " }\n" +
+ "public class X06c {\n" +
+ "\n" +
+ "/* format: off */\n" +
+ "void foo( ) { \n" +
+ " // unformatted comment\n" +
+ "}\n" +
+ "// format: on \n" +
+ " void bar() {\n" +
+ " // formatted comment\n" +
+ " }\n" +
"}\n"
);
}
@@ -634,29 +634,29 @@ public void testBug027079f4() throws JavaModelException {
this.formatterPrefs.disabling_tag = " format: off ".toCharArray();
this.formatterPrefs.enabling_tag = " format: on ".toCharArray();
String source =
- "public class X06d {\n" +
- "\n" +
- "/* format: off */\n" +
- "void foo( ) { \n" +
- " // formatted comment\n" +
- "}\n" +
- "/* format: on */\n" +
- "void bar( ) { \n" +
- " // formatted comment\n" +
- "}\n" +
+ "public class X06d {\n" +
+ "\n" +
+ "/* format: off */\n" +
+ "void foo( ) { \n" +
+ " // formatted comment\n" +
+ "}\n" +
+ "/* format: on */\n" +
+ "void bar( ) { \n" +
+ " // formatted comment\n" +
+ "}\n" +
"}\n";
formatSource(source,
- "public class X06d {\n" +
- "\n" +
- " /* format: off */\n" +
- " void foo() {\n" +
- " // formatted comment\n" +
- " }\n" +
- "\n" +
- " /* format: on */\n" +
- " void bar() {\n" +
- " // formatted comment\n" +
- " }\n" +
+ "public class X06d {\n" +
+ "\n" +
+ " /* format: off */\n" +
+ " void foo() {\n" +
+ " // formatted comment\n" +
+ " }\n" +
+ "\n" +
+ " /* format: on */\n" +
+ " void bar() {\n" +
+ " // formatted comment\n" +
+ " }\n" +
"}\n"
);
}
@@ -670,16 +670,16 @@ public void testBug059891_01() throws JavaModelException {
this.formatterPrefs.page_width = 40;
String source =
"public class X01 {\n" +
- " void test() {\n" +
- " foo(bar(1, 2, 3, 4), bar(5, 6, 7, 8));\n" +
- " }\n" +
+ " void test() {\n" +
+ " foo(bar(1, 2, 3, 4), bar(5, 6, 7, 8));\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X01 {\n" +
- " void test() {\n" +
- " foo(bar(1, 2, 3, 4),\n" +
- " bar(5, 6, 7, 8));\n" +
- " }\n" +
+ "public class X01 {\n" +
+ " void test() {\n" +
+ " foo(bar(1, 2, 3, 4),\n" +
+ " bar(5, 6, 7, 8));\n" +
+ " }\n" +
"}\n"
);
}
@@ -691,16 +691,16 @@ public void testBug059891_01b() throws JavaModelException {
DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
String source =
"public class X01 {\n" +
- " void test() {\n" +
- " foo(bar(1, 2, 3, 4), bar(5, 6, 7, 8));\n" +
- " }\n" +
+ " void test() {\n" +
+ " foo(bar(1, 2, 3, 4), bar(5, 6, 7, 8));\n" +
+ " }\n" +
"}\n";
formatSource(source,
"public class X01 {\n" +
- " void test() {\n" +
- " foo(bar(1, 2, 3, 4),\n" +
- " bar(5, 6, 7, 8));\n" +
- " }\n" +
+ " void test() {\n" +
+ " foo(bar(1, 2, 3, 4),\n" +
+ " bar(5, 6, 7, 8));\n" +
+ " }\n" +
"}\n"
);
}
@@ -708,19 +708,19 @@ public void testBug059891_02() throws JavaModelException {
this.formatterPrefs.page_width = 40;
String source =
"public class X02 {\n" +
- " void test() {\n" +
- " foo(bar(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), bar(11, 12, 13, 14, 15, 16, 17, 18, 19, 20));\n" +
- " }\n" +
+ " void test() {\n" +
+ " foo(bar(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), bar(11, 12, 13, 14, 15, 16, 17, 18, 19, 20));\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X02 {\n" +
- " void test() {\n" +
- " foo(bar(1, 2, 3, 4, 5, 6, 7, 8,\n" +
- " 9, 10),\n" +
- " bar(11, 12, 13, 14, 15,\n" +
- " 16, 17, 18, 19,\n" +
- " 20));\n" +
- " }\n" +
+ "public class X02 {\n" +
+ " void test() {\n" +
+ " foo(bar(1, 2, 3, 4, 5, 6, 7, 8,\n" +
+ " 9, 10),\n" +
+ " bar(11, 12, 13, 14, 15,\n" +
+ " 16, 17, 18, 19,\n" +
+ " 20));\n" +
+ " }\n" +
"}\n"
);
}
@@ -732,18 +732,18 @@ public void testBug059891_02b() throws JavaModelException {
DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
String source =
"public class X02 {\n" +
- " void test() {\n" +
- " foo(bar(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), bar(11, 12, 13, 14, 15, 16, 17, 18, 19, 20));\n" +
- " }\n" +
+ " void test() {\n" +
+ " foo(bar(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), bar(11, 12, 13, 14, 15, 16, 17, 18, 19, 20));\n" +
+ " }\n" +
"}\n";
formatSource(source,
"public class X02 {\n" +
- " void test() {\n" +
- " foo(bar(1, 2, 3, 4, 5, 6, 7, 8,\n" +
- " 9, 10),\n" +
- " bar(11, 12, 13, 14, 15, 16,\n" +
- " 17, 18, 19, 20));\n" +
- " }\n" +
+ " void test() {\n" +
+ " foo(bar(1, 2, 3, 4, 5, 6, 7, 8,\n" +
+ " 9, 10),\n" +
+ " bar(11, 12, 13, 14, 15, 16,\n" +
+ " 17, 18, 19, 20));\n" +
+ " }\n" +
"}\n"
);
}
@@ -751,17 +751,17 @@ public void testBug059891_03() throws JavaModelException {
this.formatterPrefs.page_width = 40;
String source =
"public class X03 {\n" +
- " void test() {\n" +
- " foo(bar(1, 2, 3, 4), bar(5, 6, 7, 8), bar(9, 10, 11, 12));\n" +
- " }\n" +
+ " void test() {\n" +
+ " foo(bar(1, 2, 3, 4), bar(5, 6, 7, 8), bar(9, 10, 11, 12));\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X03 {\n" +
- " void test() {\n" +
- " foo(bar(1, 2, 3, 4),\n" +
- " bar(5, 6, 7, 8),\n" +
- " bar(9, 10, 11, 12));\n" +
- " }\n" +
+ "public class X03 {\n" +
+ " void test() {\n" +
+ " foo(bar(1, 2, 3, 4),\n" +
+ " bar(5, 6, 7, 8),\n" +
+ " bar(9, 10, 11, 12));\n" +
+ " }\n" +
"}\n"
);
}
@@ -773,17 +773,17 @@ public void testBug059891_03b() throws JavaModelException {
DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
String source =
"public class X03 {\n" +
- " void test() {\n" +
- " foo(bar(1, 2, 3, 4), bar(5, 6, 7, 8), bar(9, 10, 11, 12));\n" +
- " }\n" +
+ " void test() {\n" +
+ " foo(bar(1, 2, 3, 4), bar(5, 6, 7, 8), bar(9, 10, 11, 12));\n" +
+ " }\n" +
"}\n";
formatSource(source,
"public class X03 {\n" +
- " void test() {\n" +
- " foo(bar(1, 2, 3, 4),\n" +
- " bar(5, 6, 7, 8),\n" +
- " bar(9, 10, 11, 12));\n" +
- " }\n" +
+ " void test() {\n" +
+ " foo(bar(1, 2, 3, 4),\n" +
+ " bar(5, 6, 7, 8),\n" +
+ " bar(9, 10, 11, 12));\n" +
+ " }\n" +
"}\n"
);
}
@@ -791,50 +791,50 @@ public void testBug059891_03b() throws JavaModelException {
public void testBug059891_146175() throws JavaModelException {
setPageWidth80();
String source =
- "public class FormatterDemo {\n" +
- "\n" +
- " public void fooBar() {\n" +
- " SomeOtherClass instanceOfOtherClass = new SomeOtherClass();\n" +
- "\n" +
- " /* The following statement demonstrates the formatter issue */\n" +
- " SomeOtherClass.someMethodInInnerClass(\n" +
- " instanceOfOtherClass.anotherMethod(\"Value of paramter 1\"),\n" +
- " instanceOfOtherClass.anotherMethod(\"Value of paramter 2\"));\n" +
- "\n" +
- " }\n" +
- "\n" +
- " private static class SomeOtherClass {\n" +
- " public static void someMethodInInnerClass(\n" +
- " String param1,\n" +
- " String param2) {\n" +
- " }\n" +
- " public String anotherMethod(String par) {\n" +
- " return par;\n" +
- " }\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "public class FormatterDemo {\n" +
- "\n" +
- " public void fooBar() {\n" +
- " SomeOtherClass instanceOfOtherClass = new SomeOtherClass();\n" +
- "\n" +
- " /* The following statement demonstrates the formatter issue */\n" +
- " SomeOtherClass.someMethodInInnerClass(\n" +
- " instanceOfOtherClass.anotherMethod(\"Value of paramter 1\"),\n" +
- " instanceOfOtherClass.anotherMethod(\"Value of paramter 2\"));\n" +
- "\n" +
- " }\n" +
- "\n" +
- " private static class SomeOtherClass {\n" +
- " public static void someMethodInInnerClass(String param1,\n" +
- " String param2) {\n" +
- " }\n" +
- "\n" +
- " public String anotherMethod(String par) {\n" +
- " return par;\n" +
- " }\n" +
- " }\n" +
+ "public class FormatterDemo {\n" +
+ "\n" +
+ " public void fooBar() {\n" +
+ " SomeOtherClass instanceOfOtherClass = new SomeOtherClass();\n" +
+ "\n" +
+ " /* The following statement demonstrates the formatter issue */\n" +
+ " SomeOtherClass.someMethodInInnerClass(\n" +
+ " instanceOfOtherClass.anotherMethod(\"Value of paramter 1\"),\n" +
+ " instanceOfOtherClass.anotherMethod(\"Value of paramter 2\"));\n" +
+ "\n" +
+ " }\n" +
+ "\n" +
+ " private static class SomeOtherClass {\n" +
+ " public static void someMethodInInnerClass(\n" +
+ " String param1,\n" +
+ " String param2) {\n" +
+ " }\n" +
+ " public String anotherMethod(String par) {\n" +
+ " return par;\n" +
+ " }\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "public class FormatterDemo {\n" +
+ "\n" +
+ " public void fooBar() {\n" +
+ " SomeOtherClass instanceOfOtherClass = new SomeOtherClass();\n" +
+ "\n" +
+ " /* The following statement demonstrates the formatter issue */\n" +
+ " SomeOtherClass.someMethodInInnerClass(\n" +
+ " instanceOfOtherClass.anotherMethod(\"Value of paramter 1\"),\n" +
+ " instanceOfOtherClass.anotherMethod(\"Value of paramter 2\"));\n" +
+ "\n" +
+ " }\n" +
+ "\n" +
+ " private static class SomeOtherClass {\n" +
+ " public static void someMethodInInnerClass(String param1,\n" +
+ " String param2) {\n" +
+ " }\n" +
+ "\n" +
+ " public String anotherMethod(String par) {\n" +
+ " return par;\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -846,18 +846,18 @@ public void testBug059891_164093_01() throws JavaModelException {
DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
String source =
- "public class Test {\n" +
- " int someLongMethodName(int foo, boolean bar, String yetAnotherArg) {\n" +
- " return 0;\n" +
- " }\n" +
+ "public class Test {\n" +
+ " int someLongMethodName(int foo, boolean bar, String yetAnotherArg) {\n" +
+ " return 0;\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- " int someLongMethodName( int foo,\n" +
- " boolean bar,\n" +
- " String yetAnotherArg) {\n" +
- " return 0;\n" +
- " }\n" +
+ "public class Test {\n" +
+ " int someLongMethodName( int foo,\n" +
+ " boolean bar,\n" +
+ " String yetAnotherArg) {\n" +
+ " return 0;\n" +
+ " }\n" +
"}\n"
);
}
@@ -869,20 +869,20 @@ public void testBug059891_164093_02() throws JavaModelException {
DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SELECTOR_IN_METHOD_INVOCATION,
DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
String source =
- "public class X01 {\n" +
- " void foo() {\n" +
- " someIdentifier(someArg).someMethodName().someMethodName(foo, bar).otherMethod(arg0, arg1);\n" +
- " }\n" +
+ "public class X01 {\n" +
+ " void foo() {\n" +
+ " someIdentifier(someArg).someMethodName().someMethodName(foo, bar).otherMethod(arg0, arg1);\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X01 {\n" +
- " void foo() {\n" +
- " someIdentifier(someArg).someMethodName()\n" +
- " .someMethodName(foo,\n" +
- " bar)\n" +
- " .otherMethod(arg0,\n" +
- " arg1);\n" +
- " }\n" +
+ "public class X01 {\n" +
+ " void foo() {\n" +
+ " someIdentifier(someArg).someMethodName()\n" +
+ " .someMethodName(foo,\n" +
+ " bar)\n" +
+ " .otherMethod(arg0,\n" +
+ " arg1);\n" +
+ " }\n" +
"}\n"
);
}
@@ -890,23 +890,23 @@ public void testBug059891_164093_02() throws JavaModelException {
public void testBug059891_203588() throws JavaModelException {
setPageWidth80();
String source =
- "public class Test {\n" +
- "public void a()\n" +
- "{\n" +
- " if(true)\n" +
- " {\n" +
- " allocation.add(idx_ta + 1, Double.valueOf(allocation.get(idx_ta).doubleValue() + q));\n" +
- " }\n" +
- "}\n" +
+ "public class Test {\n" +
+ "public void a()\n" +
+ "{\n" +
+ " if(true)\n" +
+ " {\n" +
+ " allocation.add(idx_ta + 1, Double.valueOf(allocation.get(idx_ta).doubleValue() + q));\n" +
+ " }\n" +
+ "}\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- " public void a() {\n" +
- " if (true) {\n" +
- " allocation.add(idx_ta + 1,\n" +
- " Double.valueOf(allocation.get(idx_ta).doubleValue() + q));\n" +
- " }\n" +
- " }\n" +
+ "public class Test {\n" +
+ " public void a() {\n" +
+ " if (true) {\n" +
+ " allocation.add(idx_ta + 1,\n" +
+ " Double.valueOf(allocation.get(idx_ta).doubleValue() + q));\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -914,272 +914,272 @@ public void testBug059891_203588() throws JavaModelException {
public void testBug059891_wksp1_01() throws JavaModelException {
setPageWidth80();
String source =
- "public class X01 {\n" +
- " private void reportError(String name) throws ParseError {\n" +
- " throw new ParseError(MessageFormat.format(AntDTDSchemaMessages.getString(\"NfmParser.Ambiguous\"), new String[]{name})); //$NON-NLS-1$\n" +
- " }\n" +
+ "public class X01 {\n" +
+ " private void reportError(String name) throws ParseError {\n" +
+ " throw new ParseError(MessageFormat.format(AntDTDSchemaMessages.getString(\"NfmParser.Ambiguous\"), new String[]{name})); //$NON-NLS-1$\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X01 {\n" +
- " private void reportError(String name) throws ParseError {\n" +
- " throw new ParseError(MessageFormat.format(\n" +
- " AntDTDSchemaMessages.getString(\"NfmParser.Ambiguous\"), //$NON-NLS-1$\n" +
- " new String[] { name }));\n" +
- " }\n" +
+ "public class X01 {\n" +
+ " private void reportError(String name) throws ParseError {\n" +
+ " throw new ParseError(MessageFormat.format(\n" +
+ " AntDTDSchemaMessages.getString(\"NfmParser.Ambiguous\"), //$NON-NLS-1$\n" +
+ " new String[] { name }));\n" +
+ " }\n" +
"}\n"
);
}
public void testBug059891_wksp1_02() throws JavaModelException {
setPageWidth80();
String source =
- "public class X02 {\n" +
- " private void parseBuildFile(Project project) {\n" +
- " if (!buildFile.exists()) {\n" +
- " throw new BuildException(MessageFormat.format(InternalAntMessages.getString(\"InternalAntRunner.Buildfile__{0}_does_not_exist_!_1\"), //$NON-NLS-1$\n" +
- " new String[]{buildFile.getAbsolutePath()}));\n" +
- " }\n" +
- " if (!buildFile.isFile()) {\n" +
- " throw new BuildException(MessageFormat.format(InternalAntMessages.getString(\"InternalAntRunner.Buildfile__{0}_is_not_a_file_1\"), //$NON-NLS-1$\n" +
- " new String[]{buildFile.getAbsolutePath()}));\n" +
- " }\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "public class X02 {\n" +
- " private void parseBuildFile(Project project) {\n" +
- " if (!buildFile.exists()) {\n" +
- " throw new BuildException(MessageFormat.format(\n" +
- " InternalAntMessages.getString(\n" +
- " \"InternalAntRunner.Buildfile__{0}_does_not_exist_!_1\"), //$NON-NLS-1$\n" +
- " new String[] { buildFile.getAbsolutePath() }));\n" +
- " }\n" +
- " if (!buildFile.isFile()) {\n" +
- " throw new BuildException(MessageFormat.format(\n" +
- " InternalAntMessages.getString(\n" +
- " \"InternalAntRunner.Buildfile__{0}_is_not_a_file_1\"), //$NON-NLS-1$\n" +
- " new String[] { buildFile.getAbsolutePath() }));\n" +
- " }\n" +
- " }\n" +
+ "public class X02 {\n" +
+ " private void parseBuildFile(Project project) {\n" +
+ " if (!buildFile.exists()) {\n" +
+ " throw new BuildException(MessageFormat.format(InternalAntMessages.getString(\"InternalAntRunner.Buildfile__{0}_does_not_exist_!_1\"), //$NON-NLS-1$\n" +
+ " new String[]{buildFile.getAbsolutePath()}));\n" +
+ " }\n" +
+ " if (!buildFile.isFile()) {\n" +
+ " throw new BuildException(MessageFormat.format(InternalAntMessages.getString(\"InternalAntRunner.Buildfile__{0}_is_not_a_file_1\"), //$NON-NLS-1$\n" +
+ " new String[]{buildFile.getAbsolutePath()}));\n" +
+ " }\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "public class X02 {\n" +
+ " private void parseBuildFile(Project project) {\n" +
+ " if (!buildFile.exists()) {\n" +
+ " throw new BuildException(MessageFormat.format(\n" +
+ " InternalAntMessages.getString(\n" +
+ " \"InternalAntRunner.Buildfile__{0}_does_not_exist_!_1\"), //$NON-NLS-1$\n" +
+ " new String[] { buildFile.getAbsolutePath() }));\n" +
+ " }\n" +
+ " if (!buildFile.isFile()) {\n" +
+ " throw new BuildException(MessageFormat.format(\n" +
+ " InternalAntMessages.getString(\n" +
+ " \"InternalAntRunner.Buildfile__{0}_is_not_a_file_1\"), //$NON-NLS-1$\n" +
+ " new String[] { buildFile.getAbsolutePath() }));\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
public void testBug059891_wksp1_03() throws JavaModelException {
setPageWidth80();
String source =
- "public class X03 {\n" +
- "\n" +
- " protected void foo() {\n" +
- " printTargets(project, subNames, null, InternalAntMessages.getString(\"InternalAntRunner.Subtargets__5\"), 0); //$NON-NLS-1$\n" +
- " }\n" +
+ "public class X03 {\n" +
+ "\n" +
+ " protected void foo() {\n" +
+ " printTargets(project, subNames, null, InternalAntMessages.getString(\"InternalAntRunner.Subtargets__5\"), 0); //$NON-NLS-1$\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X03 {\n" +
- "\n" +
- " protected void foo() {\n" +
- " printTargets(project, subNames, null, InternalAntMessages\n" +
- " .getString(\"InternalAntRunner.Subtargets__5\"), 0); //$NON-NLS-1$\n" +
- " }\n" +
+ "public class X03 {\n" +
+ "\n" +
+ " protected void foo() {\n" +
+ " printTargets(project, subNames, null, InternalAntMessages\n" +
+ " .getString(\"InternalAntRunner.Subtargets__5\"), 0); //$NON-NLS-1$\n" +
+ " }\n" +
"}\n"
);
}
public void testBug059891_wksp1_04() throws JavaModelException {
String source =
- "public class X04 {\n" +
- " void foo() {\n" +
- " if (AntUIPlugin.getDefault().getPreferenceStore().getBoolean(IAntUIPreferenceConstants.OUTLINE_LINK_WITH_EDITOR)) {\n" +
- " synchronizeOutlinePage(node, true);\n" +
- " }\n" +
- " }\n" +
+ "public class X04 {\n" +
+ " void foo() {\n" +
+ " if (AntUIPlugin.getDefault().getPreferenceStore().getBoolean(IAntUIPreferenceConstants.OUTLINE_LINK_WITH_EDITOR)) {\n" +
+ " synchronizeOutlinePage(node, true);\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X04 {\n" +
- " void foo() {\n" +
- " if (AntUIPlugin.getDefault().getPreferenceStore()\n" +
- " .getBoolean(IAntUIPreferenceConstants.OUTLINE_LINK_WITH_EDITOR)) {\n" +
- " synchronizeOutlinePage(node, true);\n" +
- " }\n" +
- " }\n" +
+ "public class X04 {\n" +
+ " void foo() {\n" +
+ " if (AntUIPlugin.getDefault().getPreferenceStore()\n" +
+ " .getBoolean(IAntUIPreferenceConstants.OUTLINE_LINK_WITH_EDITOR)) {\n" +
+ " synchronizeOutlinePage(node, true);\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
public void testBug059891_wksp1_05() throws JavaModelException {
setPageWidth80();
String source =
- "public class X05 {\n" +
- "void foo() {\n" +
- " if (false && AntUIPlugin.getDefault().getPreferenceStore().getBoolean(AntEditorPreferenceConstants.TEMPLATES_USE_CODEFORMATTER)) {\n" +
- " }\n" +
- "}\n" +
+ "public class X05 {\n" +
+ "void foo() {\n" +
+ " if (false && AntUIPlugin.getDefault().getPreferenceStore().getBoolean(AntEditorPreferenceConstants.TEMPLATES_USE_CODEFORMATTER)) {\n" +
+ " }\n" +
+ "}\n" +
"}\n";
formatSource(source,
- "public class X05 {\n" +
- " void foo() {\n" +
- " if (false && AntUIPlugin.getDefault().getPreferenceStore().getBoolean(\n" +
- " AntEditorPreferenceConstants.TEMPLATES_USE_CODEFORMATTER)) {\n" +
- " }\n" +
- " }\n" +
+ "public class X05 {\n" +
+ " void foo() {\n" +
+ " if (false && AntUIPlugin.getDefault().getPreferenceStore().getBoolean(\n" +
+ " AntEditorPreferenceConstants.TEMPLATES_USE_CODEFORMATTER)) {\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
public void testBug059891_wksp1_06() throws JavaModelException {
setPageWidth80();
String source =
- "public class X06 {\n" +
- " public void launch() {\n" +
- " try {\n" +
- " if ((javaProject == null) || !javaProject.exists()) {\n" +
- " abort(PDEPlugin________.getResourceString(\"JUnitLaunchConfig_____\"), null, IJavaLaunchConfigurationConstants.ERR_NOT_A_JAVA_PROJECT);\n" +
- " }\n" +
- " } catch (CoreException e) {\n" +
- " }\n" +
- " }\n" +
+ "public class X06 {\n" +
+ " public void launch() {\n" +
+ " try {\n" +
+ " if ((javaProject == null) || !javaProject.exists()) {\n" +
+ " abort(PDEPlugin________.getResourceString(\"JUnitLaunchConfig_____\"), null, IJavaLaunchConfigurationConstants.ERR_NOT_A_JAVA_PROJECT);\n" +
+ " }\n" +
+ " } catch (CoreException e) {\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X06 {\n" +
- " public void launch() {\n" +
- " try {\n" +
- " if ((javaProject == null) || !javaProject.exists()) {\n" +
- " abort(PDEPlugin________\n" +
- " .getResourceString(\"JUnitLaunchConfig_____\"), null,\n" +
- " IJavaLaunchConfigurationConstants.ERR_NOT_A_JAVA_PROJECT);\n" +
- " }\n" +
- " } catch (CoreException e) {\n" +
- " }\n" +
- " }\n" +
+ "public class X06 {\n" +
+ " public void launch() {\n" +
+ " try {\n" +
+ " if ((javaProject == null) || !javaProject.exists()) {\n" +
+ " abort(PDEPlugin________\n" +
+ " .getResourceString(\"JUnitLaunchConfig_____\"), null,\n" +
+ " IJavaLaunchConfigurationConstants.ERR_NOT_A_JAVA_PROJECT);\n" +
+ " }\n" +
+ " } catch (CoreException e) {\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
public void testBug059891_wksp1_07() throws JavaModelException {
setPageWidth80();
String source =
- "public class X07 {\n" +
- " void foo() {\n" +
- " if (true) {\n" +
- " configureAntObject(result, element, task, task.getTaskName(), InternalCoreAntMessages.getString(\"AntCorePreferences.No_library_for_task\")); //$NON-NLS-1$\n" +
- " }\n" +
- " }\n" +
+ "public class X07 {\n" +
+ " void foo() {\n" +
+ " if (true) {\n" +
+ " configureAntObject(result, element, task, task.getTaskName(), InternalCoreAntMessages.getString(\"AntCorePreferences.No_library_for_task\")); //$NON-NLS-1$\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X07 {\n" +
- " void foo() {\n" +
- " if (true) {\n" +
- " configureAntObject(result, element, task, task.getTaskName(),\n" +
- " InternalCoreAntMessages.getString(\n" +
- " \"AntCorePreferences.No_library_for_task\")); //$NON-NLS-1$\n" +
- " }\n" +
- " }\n" +
+ "public class X07 {\n" +
+ " void foo() {\n" +
+ " if (true) {\n" +
+ " configureAntObject(result, element, task, task.getTaskName(),\n" +
+ " InternalCoreAntMessages.getString(\n" +
+ " \"AntCorePreferences.No_library_for_task\")); //$NON-NLS-1$\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
public void testBug059891_wksp1_08() throws JavaModelException {
setPageWidth80();
String source =
- "public class X08 {\n" +
- " public void foo() {\n" +
- " if (true) {\n" +
- " IStatus status= new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_RUNNING_BUILD, MessageFormat.format(InternalCoreAntMessages.getString(\"AntRunner.Already_in_progess\"), new String[]{buildFileLocation}), null); //$NON-NLS-1$\n" +
- " }\n" +
- " }\n" +
+ "public class X08 {\n" +
+ " public void foo() {\n" +
+ " if (true) {\n" +
+ " IStatus status= new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_RUNNING_BUILD, MessageFormat.format(InternalCoreAntMessages.getString(\"AntRunner.Already_in_progess\"), new String[]{buildFileLocation}), null); //$NON-NLS-1$\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X08 {\n" +
- " public void foo() {\n" +
- " if (true) {\n" +
- " IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE,\n" +
- " AntCorePlugin.ERROR_RUNNING_BUILD,\n" +
- " MessageFormat.format(\n" +
- " InternalCoreAntMessages\n" +
- " .getString(\"AntRunner.Already_in_progess\"), //$NON-NLS-1$\n" +
- " new String[] { buildFileLocation }),\n" +
- " null);\n" +
- " }\n" +
- " }\n" +
+ "public class X08 {\n" +
+ " public void foo() {\n" +
+ " if (true) {\n" +
+ " IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE,\n" +
+ " AntCorePlugin.ERROR_RUNNING_BUILD,\n" +
+ " MessageFormat.format(\n" +
+ " InternalCoreAntMessages\n" +
+ " .getString(\"AntRunner.Already_in_progess\"), //$NON-NLS-1$\n" +
+ " new String[] { buildFileLocation }),\n" +
+ " null);\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
public void testBug059891_wksp1_09() throws JavaModelException {
setPageWidth80();
String source =
- "public class X09 {\n" +
- " void foo() {\n" +
- " if (true) {\n" +
- " String secondFileName = secondDirectoryAbsolutePath + File.separator + currentFile.substring(firstDirectoryAbsolutePath.length() + 1);\n" +
- " }\n" +
- " }\n" +
+ "public class X09 {\n" +
+ " void foo() {\n" +
+ " if (true) {\n" +
+ " String secondFileName = secondDirectoryAbsolutePath + File.separator + currentFile.substring(firstDirectoryAbsolutePath.length() + 1);\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X09 {\n" +
- " void foo() {\n" +
- " if (true) {\n" +
- " String secondFileName = secondDirectoryAbsolutePath + File.separator\n" +
- " + currentFile\n" +
- " .substring(firstDirectoryAbsolutePath.length() + 1);\n" +
- " }\n" +
- " }\n" +
+ "public class X09 {\n" +
+ " void foo() {\n" +
+ " if (true) {\n" +
+ " String secondFileName = secondDirectoryAbsolutePath + File.separator\n" +
+ " + currentFile\n" +
+ " .substring(firstDirectoryAbsolutePath.length() + 1);\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
public void testBug059891_wksp1_10() throws JavaModelException {
setPageWidth80();
String source =
- "public class X10 {\n" +
- " void foo() {\n" +
- " if (true) {\n" +
- " if (true) {\n" +
- " throw new BuildException(InternalAntMessages.getString(\"InternalAntRunner.Could_not_load_the_version_information._10\")); //$NON-NLS-1$\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "public class X10 {\n" +
+ " void foo() {\n" +
+ " if (true) {\n" +
+ " if (true) {\n" +
+ " throw new BuildException(InternalAntMessages.getString(\"InternalAntRunner.Could_not_load_the_version_information._10\")); //$NON-NLS-1$\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X10 {\n" +
- " void foo() {\n" +
- " if (true) {\n" +
- " if (true) {\n" +
- " throw new BuildException(InternalAntMessages.getString(\n" +
- " \"InternalAntRunner.Could_not_load_the_version_information._10\")); //$NON-NLS-1$\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "public class X10 {\n" +
+ " void foo() {\n" +
+ " if (true) {\n" +
+ " if (true) {\n" +
+ " throw new BuildException(InternalAntMessages.getString(\n" +
+ " \"InternalAntRunner.Could_not_load_the_version_information._10\")); //$NON-NLS-1$\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
public void testBug059891_wksp1_11() throws JavaModelException {
setPageWidth80();
String source =
- "public class X11 {\n" +
- " private void antFileNotFound() {\n" +
- " reportError(AntLaunchConfigurationMessages.getString(\"AntLaunchShortcut.Unable\"), null); //$NON-NLS-1$ \n" +
- " }\n" +
+ "public class X11 {\n" +
+ " private void antFileNotFound() {\n" +
+ " reportError(AntLaunchConfigurationMessages.getString(\"AntLaunchShortcut.Unable\"), null); //$NON-NLS-1$ \n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X11 {\n" +
- " private void antFileNotFound() {\n" +
- " reportError(AntLaunchConfigurationMessages\n" +
- " .getString(\"AntLaunchShortcut.Unable\"), null); //$NON-NLS-1$\n" +
- " }\n" +
+ "public class X11 {\n" +
+ " private void antFileNotFound() {\n" +
+ " reportError(AntLaunchConfigurationMessages\n" +
+ " .getString(\"AntLaunchShortcut.Unable\"), null); //$NON-NLS-1$\n" +
+ " }\n" +
"}\n"
);
}
public void testBug059891_wksp1_12() throws JavaModelException {
setPageWidth80();
String source =
- "public class X12 {\n" +
- " void foo() {\n" +
- " if (this.fTests.size() == 0) {\n" +
- " this.addTest(TestSuite\n" +
- " .warning(\"No tests found in \" + theClass.getName())); //$NON-NLS-1$\n" +
- " }\n" +
- " }\n" +
+ "public class X12 {\n" +
+ " void foo() {\n" +
+ " if (this.fTests.size() == 0) {\n" +
+ " this.addTest(TestSuite\n" +
+ " .warning(\"No tests found in \" + theClass.getName())); //$NON-NLS-1$\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X12 {\n" +
- " void foo() {\n" +
- " if (this.fTests.size() == 0) {\n" +
+ "public class X12 {\n" +
+ " void foo() {\n" +
+ " if (this.fTests.size() == 0) {\n" +
" this.addTest(TestSuite\n" +
- " .warning(\"No tests found in \" + theClass.getName())); //$NON-NLS-1$\n" +
- " }\n" +
- " }\n" +
+ " .warning(\"No tests found in \" + theClass.getName())); //$NON-NLS-1$\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -1437,44 +1437,44 @@ public void testBug198074_dup213700() throws JavaModelException {
*/
public void testBug199265a() throws JavaModelException {
String source =
- "import java.util.List;\n" +
- "//import java.util.HashMap;\n" +
- "import java.util.Set;\n" +
- "\n" +
- "public class X01 {\n" +
+ "import java.util.List;\n" +
+ "//import java.util.HashMap;\n" +
+ "import java.util.Set;\n" +
+ "\n" +
+ "public class X01 {\n" +
"}\n";
formatSource(source);
}
public void testBug199265b() throws JavaModelException {
String source =
- "import java.util.List;\n" +
- "import java.util.Set;\n" +
- "//import java.util.HashMap;\n" +
- "\n" +
- "public class X02 {\n" +
+ "import java.util.List;\n" +
+ "import java.util.Set;\n" +
+ "//import java.util.HashMap;\n" +
+ "\n" +
+ "public class X02 {\n" +
"}\n";
formatSource(source,
- "import java.util.List;\n" +
- "import java.util.Set;\n" +
- "//import java.util.HashMap;\n" +
- "\n" +
- "public class X02 {\n" +
+ "import java.util.List;\n" +
+ "import java.util.Set;\n" +
+ "//import java.util.HashMap;\n" +
+ "\n" +
+ "public class X02 {\n" +
"}\n"
);
}
public void testBug199265c1() throws JavaModelException {
String source =
- "import java.util.List;\n" +
- "// CU snippet\n" +
- "public class X03 {\n" +
- " List field;\n" +
+ "import java.util.List;\n" +
+ "// CU snippet\n" +
+ "public class X03 {\n" +
+ " List field;\n" +
"}\n";
formatSource(source,
- "import java.util.List;\n" +
- "\n" +
- "// CU snippet\n" +
- "public class X03 {\n" +
- " List field;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "// CU snippet\n" +
+ "public class X03 {\n" +
+ " List field;\n" +
"}\n"
);
}
@@ -1482,152 +1482,152 @@ public void testBug199265c2() throws JavaModelException {
setFormatLineCommentOnFirstColumn();
this.formatterPrefs.comment_format_header = true;
String source =
- "import java.util.List;\n" +
- "// CU snippet\n" +
- "public class X03 {\n" +
- " List field;\n" +
+ "import java.util.List;\n" +
+ "// CU snippet\n" +
+ "public class X03 {\n" +
+ " List field;\n" +
"}\n";
formatSource(source,
- "import java.util.List;\n" +
- "\n" +
- "// CU snippet\n" +
- "public class X03 {\n" +
- " List field;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "// CU snippet\n" +
+ "public class X03 {\n" +
+ " List field;\n" +
"}\n"
);
}
public void testBug199265c3() throws JavaModelException {
String source =
- "import java.util.List;\n" +
- "\n" +
- "// line comment\n" +
- "public class X03 {\n" +
- " List field;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "// line comment\n" +
+ "public class X03 {\n" +
+ " List field;\n" +
"}\n";
formatSource(source);
}
public void testBug199265d1() throws JavaModelException {
String source =
- "import java.util.Set; // trailing comment\n" +
- "// line comment\n" +
- "import java.util.Map; // trailing comment\n" +
- "// line comment\n" +
- "public class X04 {\n" +
- "\n" +
+ "import java.util.Set; // trailing comment\n" +
+ "// line comment\n" +
+ "import java.util.Map; // trailing comment\n" +
+ "// line comment\n" +
+ "public class X04 {\n" +
+ "\n" +
"}\n";
formatSource(source,
- "import java.util.Set; // trailing comment\n" +
- "// line comment\n" +
- "import java.util.Map; // trailing comment\n" +
- "// line comment\n" +
- "\n" +
- "public class X04 {\n" +
- "\n" +
+ "import java.util.Set; // trailing comment\n" +
+ "// line comment\n" +
+ "import java.util.Map; // trailing comment\n" +
+ "// line comment\n" +
+ "\n" +
+ "public class X04 {\n" +
+ "\n" +
"}\n"
);
}
public void testBug199265d2() throws JavaModelException {
String source =
- "import java.util.Set; // trailing comment\n" +
- "// line comment\n" +
- "import java.util.Map; // trailing comment\n" +
- "// line comment\n" +
- "\n" +
- "public class X04 {\n" +
- "\n" +
+ "import java.util.Set; // trailing comment\n" +
+ "// line comment\n" +
+ "import java.util.Map; // trailing comment\n" +
+ "// line comment\n" +
+ "\n" +
+ "public class X04 {\n" +
+ "\n" +
"}\n";
formatSource(source);
}
public void testBug199265d3() throws JavaModelException {
String source =
- "import java.util.Set; // trailing comment\n" +
- " // line comment\n" +
- "import java.util.Map; // trailing comment\n" +
- " // line comment\n" +
- "public class X04 {\n" +
- "\n" +
+ "import java.util.Set; // trailing comment\n" +
+ " // line comment\n" +
+ "import java.util.Map; // trailing comment\n" +
+ " // line comment\n" +
+ "public class X04 {\n" +
+ "\n" +
"}\n";
formatSource(source,
- "import java.util.Set; // trailing comment\n" +
- "// line comment\n" +
- "import java.util.Map; // trailing comment\n" +
- "// line comment\n" +
- "\n" +
- "public class X04 {\n" +
- "\n" +
+ "import java.util.Set; // trailing comment\n" +
+ "// line comment\n" +
+ "import java.util.Map; // trailing comment\n" +
+ "// line comment\n" +
+ "\n" +
+ "public class X04 {\n" +
+ "\n" +
"}\n"
);
}
public void testBug199265_wksp1a() throws JavaModelException {
String source =
- "package wksp1;\n" +
- "\n" +
- "import java.util.*;\n" +
- "import java.util.List; // line comment\n" +
- "\n" +
- "/**\n" +
- " * Javadoc comment\n" +
- " */\n" +
- "public class X01 {\n" +
- "\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "import java.util.*;\n" +
+ "import java.util.List; // line comment\n" +
+ "\n" +
+ "/**\n" +
+ " * Javadoc comment\n" +
+ " */\n" +
+ "public class X01 {\n" +
+ "\n" +
"}\n";
formatSource(source);
}
public void testBug199265_wksp1b() throws JavaModelException {
String source =
- "package wksp1;\n" +
- "\n" +
- "import java.util.Map;\n" +
- "\n" +
- "//==========================\n" +
- "// Line comment\n" +
- "//==========================\n" +
- "\n" +
- "/**\n" +
- " * Javadoc comment\n" +
- " */\n" +
- "public class X02 {\n" +
- "\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "import java.util.Map;\n" +
+ "\n" +
+ "//==========================\n" +
+ "// Line comment\n" +
+ "//==========================\n" +
+ "\n" +
+ "/**\n" +
+ " * Javadoc comment\n" +
+ " */\n" +
+ "public class X02 {\n" +
+ "\n" +
"}\n";
formatSource(source);
}
public void testBug199265_wksp2a() throws JavaModelException {
String source =
- "package wksp2;\n" +
- "\n" +
- "import java.util.Map;\n" +
- "\n" +
- "//#if defined(TEST)\n" +
- "import java.util.Vector;\n" +
- "//#else\n" +
- "//##import java.util.Set;\n" +
- "//#endif\n" +
- "\n" +
- "public class X01 {\n" +
- "\n" +
+ "package wksp2;\n" +
+ "\n" +
+ "import java.util.Map;\n" +
+ "\n" +
+ "//#if defined(TEST)\n" +
+ "import java.util.Vector;\n" +
+ "//#else\n" +
+ "//##import java.util.Set;\n" +
+ "//#endif\n" +
+ "\n" +
+ "public class X01 {\n" +
+ "\n" +
"}\n";
formatSource(source);
}
public void testBug199265_wksp3a() throws JavaModelException {
String source =
- "package wksp3;\n" +
- "\n" +
- "import java.util.Set; // comment 1\n" +
- "import java.util.Map; // comment 2\n" +
- "import java.util.List; // comment 3\n" +
- "\n" +
- "public class X01 {\n" +
- "\n" +
+ "package wksp3;\n" +
+ "\n" +
+ "import java.util.Set; // comment 1\n" +
+ "import java.util.Map; // comment 2\n" +
+ "import java.util.List; // comment 3\n" +
+ "\n" +
+ "public class X01 {\n" +
+ "\n" +
"}\n";
formatSource(source,
- "package wksp3;\n" +
- "\n" +
- "import java.util.Set; // comment 1\n" +
- "import java.util.Map; // comment 2\n" +
- "import java.util.List; // comment 3\n" +
- "\n" +
- "public class X01 {\n" +
- "\n" +
+ "package wksp3;\n" +
+ "\n" +
+ "import java.util.Set; // comment 1\n" +
+ "import java.util.Map; // comment 2\n" +
+ "import java.util.List; // comment 3\n" +
+ "\n" +
+ "public class X01 {\n" +
+ "\n" +
"}\n"
);
}
@@ -1704,185 +1704,185 @@ public void testBug203588() throws JavaModelException {
*/
public void testBug252556() {
String source =
- "package a;\n" +
- "\n" +
- "public class Test {\n" +
- "\n" +
- " private int field;\n" +
- " \n" +
- " [#/**\n" +
- " * fds \n" +
- " */#]\n" +
- " public void foo() {\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "package a;\n" +
- "\n" +
- "public class Test {\n" +
- "\n" +
- " private int field;\n" +
- " \n" +
- " /**\n" +
- " * fds\n" +
- " */\n" +
- " public void foo() {\n" +
- " }\n" +
+ "package a;\n" +
+ "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " private int field;\n" +
+ " \n" +
+ " [#/**\n" +
+ " * fds \n" +
+ " */#]\n" +
+ " public void foo() {\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "package a;\n" +
+ "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " private int field;\n" +
+ " \n" +
+ " /**\n" +
+ " * fds\n" +
+ " */\n" +
+ " public void foo() {\n" +
+ " }\n" +
"}\n"
);
}
// see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=95340
public void testBug252556a() {
String source =
- "public class Test {\n" +
- "\n" +
- "int foo() {[#\n" +
- "return 0;\n" +
- "#]}\n" +
- "void bar(){}\n" +
+ "public class Test {\n" +
+ "\n" +
+ "int foo() {[#\n" +
+ "return 0;\n" +
+ "#]}\n" +
+ "void bar(){}\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- "int foo() {\n" +
- " return 0;\n" +
- "}\n" +
- "void bar(){}\n" +
+ "public class Test {\n" +
+ "\n" +
+ "int foo() {\n" +
+ " return 0;\n" +
+ "}\n" +
+ "void bar(){}\n" +
"}\n"
);
}
// see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=95340
public void testBug252556b() {
String source =
- "public class Test {\n" +
- "\n" +
- "int [#foo() {\n" +
- "return 0;\n" +
- "#]}\n" +
- "void bar(){}\n" +
+ "public class Test {\n" +
+ "\n" +
+ "int [#foo() {\n" +
+ "return 0;\n" +
+ "#]}\n" +
+ "void bar(){}\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- "int foo() {\n" +
- " return 0;\n" +
- "}\n" +
- "void bar(){}\n" +
+ "public class Test {\n" +
+ "\n" +
+ "int foo() {\n" +
+ " return 0;\n" +
+ "}\n" +
+ "void bar(){}\n" +
"}\n"
);
}
// see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=95340
public void testBug252556c() {
String source =
- "public class Test {\n" +
- "\n" +
- "[#int foo() {\n" +
- "return 0;\n" +
- "#]}\n" +
- "void bar(){}\n" +
+ "public class Test {\n" +
+ "\n" +
+ "[#int foo() {\n" +
+ "return 0;\n" +
+ "#]}\n" +
+ "void bar(){}\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " int foo() {\n" +
- " return 0;\n" +
- " }\n" +
- "void bar(){}\n" +
+ "public class Test {\n" +
+ "\n" +
+ " int foo() {\n" +
+ " return 0;\n" +
+ " }\n" +
+ "void bar(){}\n" +
"}\n"
);
}
// see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=95340
public void testBug252556d() {
String source =
- "public class Test {\n" +
- "\n" +
- "[#int foo() {\n" +
- "return 0;\n" +
- "}#]\n" +
- "void bar(){}\n" +
+ "public class Test {\n" +
+ "\n" +
+ "[#int foo() {\n" +
+ "return 0;\n" +
+ "}#]\n" +
+ "void bar(){}\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " int foo() {\n" +
- " return 0;\n" +
- " }\n" +
- "void bar(){}\n" +
+ "public class Test {\n" +
+ "\n" +
+ " int foo() {\n" +
+ " return 0;\n" +
+ " }\n" +
+ "void bar(){}\n" +
"}\n"
);
}
// see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=95340
public void testBug252556e() {
String source =
- "public class Test {\n" +
- "\n" +
- "[#int foo() {\n" +
- "return 0;\n" +
- "}\n" +
- "#]void bar(){}\n" +
+ "public class Test {\n" +
+ "\n" +
+ "[#int foo() {\n" +
+ "return 0;\n" +
+ "}\n" +
+ "#]void bar(){}\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " int foo() {\n" +
- " return 0;\n" +
- " }\n" +
- "\n" +
- " void bar(){}\n" +
+ "public class Test {\n" +
+ "\n" +
+ " int foo() {\n" +
+ " return 0;\n" +
+ " }\n" +
+ "\n" +
+ " void bar(){}\n" +
"}\n"
);
}
// see org.eclipse.jdt.ui.tests.core.CodeFormatterUtilTest.testFormatSubstring()
public void testBug252556f() {
String source =
- "package test1;\n" +
- "\n" +
- "import java.util.Vector;\n" +
- "\n" +
- "public class A {\n" +
- " public void foo() {\n" +
- " [#Runnable runnable= new Runnable() {};#]\n" +
- " runnable.toString();\n" +
- " }\n" +
+ "package test1;\n" +
+ "\n" +
+ "import java.util.Vector;\n" +
+ "\n" +
+ "public class A {\n" +
+ " public void foo() {\n" +
+ " [#Runnable runnable= new Runnable() {};#]\n" +
+ " runnable.toString();\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "package test1;\n" +
- "\n" +
- "import java.util.Vector;\n" +
- "\n" +
- "public class A {\n" +
- " public void foo() {\n" +
- " Runnable runnable = new Runnable() {\n" +
- " };\n" +
- " runnable.toString();\n" +
- " }\n" +
+ "package test1;\n" +
+ "\n" +
+ "import java.util.Vector;\n" +
+ "\n" +
+ "public class A {\n" +
+ " public void foo() {\n" +
+ " Runnable runnable = new Runnable() {\n" +
+ " };\n" +
+ " runnable.toString();\n" +
+ " }\n" +
"}\n"
);
}
// Adding a test case impacted by the fix for bug 252556 got from massive tests
public void testBug252556_wksp3a() {
String source =
- "package wksp3;\n" +
- "\n" +
- "/**\n" +
- " * <pre>import java.net.*;\n" +
- " * import org.xml.sax.*;\n" +
- " * </pre>\n" +
- " */\n" +
- "public class X01 {\n" +
- "\n" +
+ "package wksp3;\n" +
+ "\n" +
+ "/**\n" +
+ " * <pre>import java.net.*;\n" +
+ " * import org.xml.sax.*;\n" +
+ " * </pre>\n" +
+ " */\n" +
+ "public class X01 {\n" +
+ "\n" +
"}\n";
formatSource(source,
- "package wksp3;\n" +
- "\n" +
- "/**\n" +
- " * <pre>\n" +
- " * import java.net.*;\n" +
- " * import org.xml.sax.*;\n" +
- " * </pre>\n" +
- " */\n" +
- "public class X01 {\n" +
- "\n" +
+ "package wksp3;\n" +
+ "\n" +
+ "/**\n" +
+ " * <pre>\n" +
+ " * import java.net.*;\n" +
+ " * import org.xml.sax.*;\n" +
+ " * </pre>\n" +
+ " */\n" +
+ "public class X01 {\n" +
+ "\n" +
"}\n"
);
}
@@ -1897,26 +1897,26 @@ public void testBug281655() throws JavaModelException {
this.formatterPrefs.join_wrapped_lines = false;
this.formatterPrefs.alignment_for_arguments_in_annotation = Alignment.M_COMPACT_SPLIT;
String source =
- "@MessageDriven(mappedName = \"filiality/SchedulerMQService\", \n" +
- " activationConfig = { \n" +
- " @ActivationConfigProperty(propertyName = \"cronTrigger\",\n" +
- "propertyValue = \"0/10 * * * * ?\") \n" +
- " })\n" +
- "@RunAs(\"admin\")\n" +
- "@ResourceAdapter(\"quartz-ra.rar\")\n" +
- "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n" +
- "public class X {\n" +
+ "@MessageDriven(mappedName = \"filiality/SchedulerMQService\", \n" +
+ " activationConfig = { \n" +
+ " @ActivationConfigProperty(propertyName = \"cronTrigger\",\n" +
+ "propertyValue = \"0/10 * * * * ?\") \n" +
+ " })\n" +
+ "@RunAs(\"admin\")\n" +
+ "@ResourceAdapter(\"quartz-ra.rar\")\n" +
+ "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n" +
+ "public class X {\n" +
"}\n";
formatSource(source,
- "@MessageDriven(mappedName = \"filiality/SchedulerMQService\",\n" +
- " activationConfig = {\n" +
- " @ActivationConfigProperty(propertyName = \"cronTrigger\",\n" +
- " propertyValue = \"0/10 * * * * ?\")\n" +
- " })\n" +
- "@RunAs(\"admin\")\n" +
- "@ResourceAdapter(\"quartz-ra.rar\")\n" +
- "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n" +
- "public class X {\n" +
+ "@MessageDriven(mappedName = \"filiality/SchedulerMQService\",\n" +
+ " activationConfig = {\n" +
+ " @ActivationConfigProperty(propertyName = \"cronTrigger\",\n" +
+ " propertyValue = \"0/10 * * * * ?\")\n" +
+ " })\n" +
+ "@RunAs(\"admin\")\n" +
+ "@ResourceAdapter(\"quartz-ra.rar\")\n" +
+ "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n" +
+ "public class X {\n" +
"}\n"
);
}
@@ -1924,22 +1924,22 @@ public void testBug281655a() throws JavaModelException {
this.formatterPrefs.alignment_for_arguments_in_annotation = Alignment.M_NO_ALIGNMENT;
this.formatterPrefs.alignment_for_expressions_in_array_initializer = Alignment.M_NO_ALIGNMENT;
String source =
- "@MessageDriven(mappedName = \"filiality/SchedulerMQService\", \n" +
- " activationConfig = { \n" +
- " @ActivationConfigProperty(propertyName = \"cronTrigger\",\n" +
- "propertyValue = \"0/10 * * * * ?\") \n" +
- " })\n" +
- "@RunAs(\"admin\")\n" +
- "@ResourceAdapter(\"quartz-ra.rar\")\n" +
- "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n" +
- "public class X {\n" +
+ "@MessageDriven(mappedName = \"filiality/SchedulerMQService\", \n" +
+ " activationConfig = { \n" +
+ " @ActivationConfigProperty(propertyName = \"cronTrigger\",\n" +
+ "propertyValue = \"0/10 * * * * ?\") \n" +
+ " })\n" +
+ "@RunAs(\"admin\")\n" +
+ "@ResourceAdapter(\"quartz-ra.rar\")\n" +
+ "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n" +
+ "public class X {\n" +
"}\n";
formatSource(source,
- "@MessageDriven(mappedName = \"filiality/SchedulerMQService\", activationConfig = { @ActivationConfigProperty(propertyName = \"cronTrigger\", propertyValue = \"0/10 * * * * ?\") })\n" +
- "@RunAs(\"admin\")\n" +
- "@ResourceAdapter(\"quartz-ra.rar\")\n" +
- "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n" +
- "public class X {\n" +
+ "@MessageDriven(mappedName = \"filiality/SchedulerMQService\", activationConfig = { @ActivationConfigProperty(propertyName = \"cronTrigger\", propertyValue = \"0/10 * * * * ?\") })\n" +
+ "@RunAs(\"admin\")\n" +
+ "@ResourceAdapter(\"quartz-ra.rar\")\n" +
+ "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n" +
+ "public class X {\n" +
"}\n"
);
}
@@ -1947,25 +1947,25 @@ public void testBug281655b() throws JavaModelException {
this.formatterPrefs.alignment_for_arguments_in_annotation = Alignment.M_COMPACT_SPLIT;
setPageWidth80();
String source =
- "@MessageDriven(mappedName = \"filiality/SchedulerMQService\", \n" +
- " activationConfig = { \n" +
- " @ActivationConfigProperty(propertyName = \"cronTrigger\",\n" +
- "propertyValue = \"0/10 * * * * ?\") \n" +
- " })\n" +
- "@RunAs(\"admin\")\n" +
- "@ResourceAdapter(\"quartz-ra.rar\")\n" +
- "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n" +
- "public class X {\n" +
+ "@MessageDriven(mappedName = \"filiality/SchedulerMQService\", \n" +
+ " activationConfig = { \n" +
+ " @ActivationConfigProperty(propertyName = \"cronTrigger\",\n" +
+ "propertyValue = \"0/10 * * * * ?\") \n" +
+ " })\n" +
+ "@RunAs(\"admin\")\n" +
+ "@ResourceAdapter(\"quartz-ra.rar\")\n" +
+ "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n" +
+ "public class X {\n" +
"}\n";
formatSource(source,
- "@MessageDriven(mappedName = \"filiality/SchedulerMQService\",\n" +
- " activationConfig = {\n" +
- " @ActivationConfigProperty(propertyName = \"cronTrigger\",\n" +
- " propertyValue = \"0/10 * * * * ?\") })\n" +
- "@RunAs(\"admin\")\n" +
- "@ResourceAdapter(\"quartz-ra.rar\")\n" +
- "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n" +
- "public class X {\n" +
+ "@MessageDriven(mappedName = \"filiality/SchedulerMQService\",\n" +
+ " activationConfig = {\n" +
+ " @ActivationConfigProperty(propertyName = \"cronTrigger\",\n" +
+ " propertyValue = \"0/10 * * * * ?\") })\n" +
+ "@RunAs(\"admin\")\n" +
+ "@ResourceAdapter(\"quartz-ra.rar\")\n" +
+ "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n" +
+ "public class X {\n" +
"}\n"
);
}
@@ -1973,26 +1973,26 @@ public void testBug281655c() throws JavaModelException {
this.formatterPrefs.alignment_for_arguments_in_annotation = Alignment.M_COMPACT_FIRST_BREAK_SPLIT;
setPageWidth80();
String source =
- "@MessageDriven(mappedName = \"filiality/SchedulerMQService\", \n" +
- " activationConfig = { \n" +
- " @ActivationConfigProperty(propertyName = \"cronTrigger\",\n" +
- "propertyValue = \"0/10 * * * * ?\") \n" +
- " })\n" +
- "@RunAs(\"admin\")\n" +
- "@ResourceAdapter(\"quartz-ra.rar\")\n" +
- "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n" +
- "public class X {\n" +
+ "@MessageDriven(mappedName = \"filiality/SchedulerMQService\", \n" +
+ " activationConfig = { \n" +
+ " @ActivationConfigProperty(propertyName = \"cronTrigger\",\n" +
+ "propertyValue = \"0/10 * * * * ?\") \n" +
+ " })\n" +
+ "@RunAs(\"admin\")\n" +
+ "@ResourceAdapter(\"quartz-ra.rar\")\n" +
+ "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n" +
+ "public class X {\n" +
"}\n";
formatSource(source,
- "@MessageDriven(\n" +
- " mappedName = \"filiality/SchedulerMQService\",\n" +
- " activationConfig = { @ActivationConfigProperty(\n" +
- " propertyName = \"cronTrigger\",\n" +
- " propertyValue = \"0/10 * * * * ?\") })\n" +
- "@RunAs(\"admin\")\n" +
- "@ResourceAdapter(\"quartz-ra.rar\")\n" +
- "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n" +
- "public class X {\n" +
+ "@MessageDriven(\n" +
+ " mappedName = \"filiality/SchedulerMQService\",\n" +
+ " activationConfig = { @ActivationConfigProperty(\n" +
+ " propertyName = \"cronTrigger\",\n" +
+ " propertyValue = \"0/10 * * * * ?\") })\n" +
+ "@RunAs(\"admin\")\n" +
+ "@ResourceAdapter(\"quartz-ra.rar\")\n" +
+ "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n" +
+ "public class X {\n" +
"}\n"
);
}
@@ -2000,26 +2000,26 @@ public void testBug281655d() throws JavaModelException {
this.formatterPrefs.alignment_for_arguments_in_annotation = Alignment.M_ONE_PER_LINE_SPLIT;
setPageWidth80();
String source =
- "@MessageDriven(mappedName = \"filiality/SchedulerMQService\", \n" +
- " activationConfig = { \n" +
- " @ActivationConfigProperty(propertyName = \"cronTrigger\",\n" +
- "propertyValue = \"0/10 * * * * ?\") \n" +
- " })\n" +
- "@RunAs(\"admin\")\n" +
- "@ResourceAdapter(\"quartz-ra.rar\")\n" +
- "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n" +
- "public class X {\n" +
+ "@MessageDriven(mappedName = \"filiality/SchedulerMQService\", \n" +
+ " activationConfig = { \n" +
+ " @ActivationConfigProperty(propertyName = \"cronTrigger\",\n" +
+ "propertyValue = \"0/10 * * * * ?\") \n" +
+ " })\n" +
+ "@RunAs(\"admin\")\n" +
+ "@ResourceAdapter(\"quartz-ra.rar\")\n" +
+ "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n" +
+ "public class X {\n" +
"}\n";
formatSource(source,
- "@MessageDriven(\n" +
- " mappedName = \"filiality/SchedulerMQService\",\n" +
- " activationConfig = { @ActivationConfigProperty(\n" +
- " propertyName = \"cronTrigger\",\n" +
- " propertyValue = \"0/10 * * * * ?\") })\n" +
- "@RunAs(\"admin\")\n" +
- "@ResourceAdapter(\"quartz-ra.rar\")\n" +
- "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n" +
- "public class X {\n" +
+ "@MessageDriven(\n" +
+ " mappedName = \"filiality/SchedulerMQService\",\n" +
+ " activationConfig = { @ActivationConfigProperty(\n" +
+ " propertyName = \"cronTrigger\",\n" +
+ " propertyValue = \"0/10 * * * * ?\") })\n" +
+ "@RunAs(\"admin\")\n" +
+ "@ResourceAdapter(\"quartz-ra.rar\")\n" +
+ "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n" +
+ "public class X {\n" +
"}\n"
);
}
@@ -2027,26 +2027,26 @@ public void testBug281655e() throws JavaModelException {
this.formatterPrefs.alignment_for_arguments_in_annotation = Alignment.M_NEXT_SHIFTED_SPLIT;
setPageWidth80();
String source =
- "@MessageDriven(mappedName = \"filiality/SchedulerMQService\", \n" +
- " activationConfig = { \n" +
- " @ActivationConfigProperty(propertyName = \"cronTrigger\",\n" +
- "propertyValue = \"0/10 * * * * ?\") \n" +
- " })\n" +
- "@RunAs(\"admin\")\n" +
- "@ResourceAdapter(\"quartz-ra.rar\")\n" +
- "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n" +
- "public class X {\n" +
+ "@MessageDriven(mappedName = \"filiality/SchedulerMQService\", \n" +
+ " activationConfig = { \n" +
+ " @ActivationConfigProperty(propertyName = \"cronTrigger\",\n" +
+ "propertyValue = \"0/10 * * * * ?\") \n" +
+ " })\n" +
+ "@RunAs(\"admin\")\n" +
+ "@ResourceAdapter(\"quartz-ra.rar\")\n" +
+ "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n" +
+ "public class X {\n" +
"}\n";
formatSource(source,
- "@MessageDriven(\n" +
- " mappedName = \"filiality/SchedulerMQService\",\n" +
- " activationConfig = { @ActivationConfigProperty(\n" +
- " propertyName = \"cronTrigger\",\n" +
- " propertyValue = \"0/10 * * * * ?\") })\n" +
- "@RunAs(\"admin\")\n" +
- "@ResourceAdapter(\"quartz-ra.rar\")\n" +
- "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n" +
- "public class X {\n" +
+ "@MessageDriven(\n" +
+ " mappedName = \"filiality/SchedulerMQService\",\n" +
+ " activationConfig = { @ActivationConfigProperty(\n" +
+ " propertyName = \"cronTrigger\",\n" +
+ " propertyValue = \"0/10 * * * * ?\") })\n" +
+ "@RunAs(\"admin\")\n" +
+ "@ResourceAdapter(\"quartz-ra.rar\")\n" +
+ "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n" +
+ "public class X {\n" +
"}\n"
);
}
@@ -2054,25 +2054,25 @@ public void testBug281655f() throws JavaModelException {
this.formatterPrefs.alignment_for_arguments_in_annotation = Alignment.M_NEXT_PER_LINE_SPLIT;
setPageWidth80();
String source =
- "@MessageDriven(mappedName = \"filiality/SchedulerMQService\", \n" +
- " activationConfig = { \n" +
- " @ActivationConfigProperty(propertyName = \"cronTrigger\",\n" +
- "propertyValue = \"0/10 * * * * ?\") \n" +
- " })\n" +
- "@RunAs(\"admin\")\n" +
- "@ResourceAdapter(\"quartz-ra.rar\")\n" +
- "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n" +
- "public class X {\n" +
+ "@MessageDriven(mappedName = \"filiality/SchedulerMQService\", \n" +
+ " activationConfig = { \n" +
+ " @ActivationConfigProperty(propertyName = \"cronTrigger\",\n" +
+ "propertyValue = \"0/10 * * * * ?\") \n" +
+ " })\n" +
+ "@RunAs(\"admin\")\n" +
+ "@ResourceAdapter(\"quartz-ra.rar\")\n" +
+ "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n" +
+ "public class X {\n" +
"}\n";
formatSource(source,
- "@MessageDriven(mappedName = \"filiality/SchedulerMQService\",\n" +
+ "@MessageDriven(mappedName = \"filiality/SchedulerMQService\",\n" +
" activationConfig = {\n" +
- " @ActivationConfigProperty(propertyName = \"cronTrigger\",\n" +
- " propertyValue = \"0/10 * * * * ?\") })\n" +
- "@RunAs(\"admin\")\n" +
- "@ResourceAdapter(\"quartz-ra.rar\")\n" +
- "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n" +
- "public class X {\n" +
+ " @ActivationConfigProperty(propertyName = \"cronTrigger\",\n" +
+ " propertyValue = \"0/10 * * * * ?\") })\n" +
+ "@RunAs(\"admin\")\n" +
+ "@ResourceAdapter(\"quartz-ra.rar\")\n" +
+ "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n" +
+ "public class X {\n" +
"}\n"
);
}
@@ -2086,27 +2086,27 @@ public void testBug282030() throws JavaModelException {
this.formatterPrefs.alignment_for_arguments_in_annotation = Alignment.M_COMPACT_SPLIT;
setPageWidth80();
String source =
- "@DeclareParents(value =\n" +
- "\"com.apress.springrecipes.calculator.ArithmeticCalculatorImpl\", defaultImpl =\n" +
- "MaxCalculatorImpl.class) \n" +
- "public class X {\n" +
+ "@DeclareParents(value =\n" +
+ "\"com.apress.springrecipes.calculator.ArithmeticCalculatorImpl\", defaultImpl =\n" +
+ "MaxCalculatorImpl.class) \n" +
+ "public class X {\n" +
"}\n";
formatSource(source,
- "@DeclareParents(\n" +
- " value = \"com.apress.springrecipes.calculator.ArithmeticCalculatorImpl\",\n" +
- " defaultImpl = MaxCalculatorImpl.class)\n" +
- "public class X {\n" +
+ "@DeclareParents(\n" +
+ " value = \"com.apress.springrecipes.calculator.ArithmeticCalculatorImpl\",\n" +
+ " defaultImpl = MaxCalculatorImpl.class)\n" +
+ "public class X {\n" +
"}\n"
);
}
public void testBug282030a() throws JavaModelException {
String source =
- "@MyAnnot(value1 = \"this is an example\", value2 = \"of an annotation\", value3 = \"with several arguments\", value4 = \"which may need to be wrapped\")\n" +
- "public class Test {\n" +
+ "@MyAnnot(value1 = \"this is an example\", value2 = \"of an annotation\", value3 = \"with several arguments\", value4 = \"which may need to be wrapped\")\n" +
+ "public class Test {\n" +
"}\n";
formatSource(source,
- "@MyAnnot(value1 = \"this is an example\", value2 = \"of an annotation\", value3 = \"with several arguments\", value4 = \"which may need to be wrapped\")\n" +
- "public class Test {\n" +
+ "@MyAnnot(value1 = \"this is an example\", value2 = \"of an annotation\", value3 = \"with several arguments\", value4 = \"which may need to be wrapped\")\n" +
+ "public class Test {\n" +
"}\n"
);
}
@@ -2114,14 +2114,14 @@ public void testBug282030b() throws JavaModelException {
this.formatterPrefs.alignment_for_arguments_in_annotation = Alignment.M_COMPACT_SPLIT;
setPageWidth80();
String source =
- "@MyAnnot(value1 = \"this is an example\", value2 = \"of an annotation\", value3 = \"with several arguments\", value4 = \"which may need to be wrapped\")\n" +
- "public class Test {\n" +
+ "@MyAnnot(value1 = \"this is an example\", value2 = \"of an annotation\", value3 = \"with several arguments\", value4 = \"which may need to be wrapped\")\n" +
+ "public class Test {\n" +
"}\n";
formatSource(source,
- "@MyAnnot(value1 = \"this is an example\", value2 = \"of an annotation\",\n" +
- " value3 = \"with several arguments\",\n" +
- " value4 = \"which may need to be wrapped\")\n" +
- "public class Test {\n" +
+ "@MyAnnot(value1 = \"this is an example\", value2 = \"of an annotation\",\n" +
+ " value3 = \"with several arguments\",\n" +
+ " value4 = \"which may need to be wrapped\")\n" +
+ "public class Test {\n" +
"}\n"
);
}
@@ -2129,88 +2129,88 @@ public void testBug282030c() throws JavaModelException {
this.formatterPrefs.alignment_for_arguments_in_annotation = Alignment.M_COMPACT_FIRST_BREAK_SPLIT;
setPageWidth80();
String source =
- "@MyAnnot(value1 = \"this is an example\", value2 = \"of an annotation\", value3 = \"with several arguments\", value4 = \"which may need to be wrapped\")\n" +
- "public class Test {\n" +
+ "@MyAnnot(value1 = \"this is an example\", value2 = \"of an annotation\", value3 = \"with several arguments\", value4 = \"which may need to be wrapped\")\n" +
+ "public class Test {\n" +
"}\n";
formatSource(source,
- "@MyAnnot(\n" +
- " value1 = \"this is an example\", value2 = \"of an annotation\",\n" +
- " value3 = \"with several arguments\",\n" +
- " value4 = \"which may need to be wrapped\")\n" +
- "public class Test {\n" +
+ "@MyAnnot(\n" +
+ " value1 = \"this is an example\", value2 = \"of an annotation\",\n" +
+ " value3 = \"with several arguments\",\n" +
+ " value4 = \"which may need to be wrapped\")\n" +
+ "public class Test {\n" +
"}\n"
);
}
public void testBug282030d() throws JavaModelException {
this.formatterPrefs.alignment_for_arguments_in_annotation = Alignment.M_ONE_PER_LINE_SPLIT;
String source =
- "@MyAnnot(value1 = \"this is an example\", value2 = \"of an annotation\", value3 = \"with several arguments\", value4 = \"which may need to be wrapped\")\n" +
- "public class Test {\n" +
+ "@MyAnnot(value1 = \"this is an example\", value2 = \"of an annotation\", value3 = \"with several arguments\", value4 = \"which may need to be wrapped\")\n" +
+ "public class Test {\n" +
"}\n";
formatSource(source,
- "@MyAnnot(\n" +
- " value1 = \"this is an example\",\n" +
- " value2 = \"of an annotation\",\n" +
- " value3 = \"with several arguments\",\n" +
- " value4 = \"which may need to be wrapped\")\n" +
- "public class Test {\n" +
+ "@MyAnnot(\n" +
+ " value1 = \"this is an example\",\n" +
+ " value2 = \"of an annotation\",\n" +
+ " value3 = \"with several arguments\",\n" +
+ " value4 = \"which may need to be wrapped\")\n" +
+ "public class Test {\n" +
"}\n"
);
}
public void testBug282030e() throws JavaModelException {
this.formatterPrefs.alignment_for_arguments_in_annotation = Alignment.M_NEXT_SHIFTED_SPLIT;
String source =
- "@MyAnnot(value1 = \"this is an example\", value2 = \"of an annotation\", value3 = \"with several arguments\", value4 = \"which may need to be wrapped\")\n" +
- "public class Test {\n" +
+ "@MyAnnot(value1 = \"this is an example\", value2 = \"of an annotation\", value3 = \"with several arguments\", value4 = \"which may need to be wrapped\")\n" +
+ "public class Test {\n" +
"}\n";
formatSource(source,
- "@MyAnnot(\n" +
- " value1 = \"this is an example\",\n" +
- " value2 = \"of an annotation\",\n" +
- " value3 = \"with several arguments\",\n" +
- " value4 = \"which may need to be wrapped\")\n" +
- "public class Test {\n" +
+ "@MyAnnot(\n" +
+ " value1 = \"this is an example\",\n" +
+ " value2 = \"of an annotation\",\n" +
+ " value3 = \"with several arguments\",\n" +
+ " value4 = \"which may need to be wrapped\")\n" +
+ "public class Test {\n" +
"}\n"
);
}
public void testBug282030f() throws JavaModelException {
this.formatterPrefs.alignment_for_arguments_in_annotation = Alignment.M_NEXT_PER_LINE_SPLIT;
String source =
- "@MyAnnot(value1 = \"this is an example\", value2 = \"of an annotation\", value3 = \"with several arguments\", value4 = \"which may need to be wrapped\")\n" +
- "public class Test {\n" +
+ "@MyAnnot(value1 = \"this is an example\", value2 = \"of an annotation\", value3 = \"with several arguments\", value4 = \"which may need to be wrapped\")\n" +
+ "public class Test {\n" +
"}\n";
formatSource(source,
- "@MyAnnot(value1 = \"this is an example\",\n" +
- " value2 = \"of an annotation\",\n" +
- " value3 = \"with several arguments\",\n" +
- " value4 = \"which may need to be wrapped\")\n" +
- "public class Test {\n" +
+ "@MyAnnot(value1 = \"this is an example\",\n" +
+ " value2 = \"of an annotation\",\n" +
+ " value3 = \"with several arguments\",\n" +
+ " value4 = \"which may need to be wrapped\")\n" +
+ "public class Test {\n" +
"}\n"
);
}
public void testBug282030g1() throws JavaModelException {
this.formatterPrefs.alignment_for_arguments_in_annotation = Alignment.M_ONE_PER_LINE_SPLIT;
String source =
- "@MyAnnot1(member1 = \"sample1\", member2 = \"sample2\")\n" +
- "public class X {\n" +
+ "@MyAnnot1(member1 = \"sample1\", member2 = \"sample2\")\n" +
+ "public class X {\n" +
"}\n";
formatSource(source,
- "@MyAnnot1(member1 = \"sample1\", member2 = \"sample2\")\n" +
- "public class X {\n" +
+ "@MyAnnot1(member1 = \"sample1\", member2 = \"sample2\")\n" +
+ "public class X {\n" +
"}\n"
);
}
public void testBug282030g2() throws JavaModelException {
this.formatterPrefs.alignment_for_arguments_in_annotation = Alignment.M_ONE_PER_LINE_SPLIT | Alignment.M_FORCE;
String source =
- "@MyAnnot1(member1 = \"sample1\", member2 = \"sample2\")\n" +
- "public class X {\n" +
+ "@MyAnnot1(member1 = \"sample1\", member2 = \"sample2\")\n" +
+ "public class X {\n" +
"}\n";
formatSource(source,
"@MyAnnot1(\n" +
" member1 = \"sample1\",\n" +
- " member2 = \"sample2\")\n" +
- "public class X {\n" +
+ " member2 = \"sample2\")\n" +
+ "public class X {\n" +
"}\n"
);
}
@@ -2218,38 +2218,38 @@ public void testBug282030h1() throws JavaModelException {
this.formatterPrefs.alignment_for_arguments_in_annotation = Alignment.M_ONE_PER_LINE_SPLIT;
setPageWidth80();
String source =
- "@MyAnnot1(name = \"sample1\", \n" +
- " value = { \n" +
- " @MyAnnot2(name = \"sample2\",\n" +
- "value = \"demo\") \n" +
- " })\n" +
- "public class X {\n" +
+ "@MyAnnot1(name = \"sample1\", \n" +
+ " value = { \n" +
+ " @MyAnnot2(name = \"sample2\",\n" +
+ "value = \"demo\") \n" +
+ " })\n" +
+ "public class X {\n" +
"}\n";
formatSource(source,
- "@MyAnnot1(\n" +
- " name = \"sample1\",\n" +
- " value = { @MyAnnot2(name = \"sample2\", value = \"demo\") })\n" +
- "public class X {\n" +
+ "@MyAnnot1(\n" +
+ " name = \"sample1\",\n" +
+ " value = { @MyAnnot2(name = \"sample2\", value = \"demo\") })\n" +
+ "public class X {\n" +
"}\n"
);
}
public void testBug282030h2() throws JavaModelException {
this.formatterPrefs.alignment_for_arguments_in_annotation = Alignment.M_ONE_PER_LINE_SPLIT | Alignment.M_FORCE;
String source =
- "@MyAnnot1(name = \"sample1\", \n" +
- " value = { \n" +
- " @MyAnnot2(name = \"sample2\",\n" +
- "value = \"demo\") \n" +
- " })\n" +
- "public class X {\n" +
+ "@MyAnnot1(name = \"sample1\", \n" +
+ " value = { \n" +
+ " @MyAnnot2(name = \"sample2\",\n" +
+ "value = \"demo\") \n" +
+ " })\n" +
+ "public class X {\n" +
"}\n";
formatSource(source,
"@MyAnnot1(\n" +
" name = \"sample1\",\n" +
" value = { @MyAnnot2(\n" +
- " name = \"sample2\",\n" +
- " value = \"demo\") })\n" +
- "public class X {\n" +
+ " name = \"sample2\",\n" +
+ " value = \"demo\") })\n" +
+ "public class X {\n" +
"}\n"
);
}
@@ -2304,34 +2304,34 @@ public void testBug284789() throws JavaModelException {
this.formatterPrefs.alignment_for_method_declaration = Alignment.M_COMPACT_SPLIT;
setPageWidth80();
String source =
- "public class Test {\n" +
- "public synchronized List<FantasticallyWonderfulContainer<FantasticallyWonderfulClass>> getMeTheFantasticContainer() {\n" +
- " return null;\n" +
- "}\n" +
+ "public class Test {\n" +
+ "public synchronized List<FantasticallyWonderfulContainer<FantasticallyWonderfulClass>> getMeTheFantasticContainer() {\n" +
+ " return null;\n" +
+ "}\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- " public synchronized\n" +
- " List<FantasticallyWonderfulContainer<FantasticallyWonderfulClass>>\n" +
- " getMeTheFantasticContainer() {\n" +
- " return null;\n" +
- " }\n" +
+ "public class Test {\n" +
+ " public synchronized\n" +
+ " List<FantasticallyWonderfulContainer<FantasticallyWonderfulClass>>\n" +
+ " getMeTheFantasticContainer() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
);
}
public void testBug284789_01a() throws JavaModelException {
// default is no wrapping for method declaration
String source =
- "class X01 {\n" +
- " public final synchronized java.lang.String a_method_which_have_a_very_long_name() {\n" +
- " return null;\n" +
- " }\n" +
+ "class X01 {\n" +
+ " public final synchronized java.lang.String a_method_which_have_a_very_long_name() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "class X01 {\n" +
- " public final synchronized java.lang.String a_method_which_have_a_very_long_name() {\n" +
- " return null;\n" +
- " }\n" +
+ "class X01 {\n" +
+ " public final synchronized java.lang.String a_method_which_have_a_very_long_name() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
);
}
@@ -2339,17 +2339,17 @@ public void testBug284789_01b() throws JavaModelException {
this.formatterPrefs.alignment_for_method_declaration = Alignment.M_COMPACT_SPLIT;
setPageWidth80();
String source =
- "class X01 {\n" +
- " public final synchronized java.lang.String a_method_which_have_a_very_long_name() {\n" +
- " return null;\n" +
- " }\n" +
+ "class X01 {\n" +
+ " public final synchronized java.lang.String a_method_which_have_a_very_long_name() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "class X01 {\n" +
- " public final synchronized java.lang.String\n" +
- " a_method_which_have_a_very_long_name() {\n" +
- " return null;\n" +
- " }\n" +
+ "class X01 {\n" +
+ " public final synchronized java.lang.String\n" +
+ " a_method_which_have_a_very_long_name() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
);
}
@@ -2357,17 +2357,17 @@ public void testBug284789_01c() throws JavaModelException {
this.formatterPrefs.alignment_for_method_declaration = Alignment.M_COMPACT_FIRST_BREAK_SPLIT;
setPageWidth80();
String source =
- "class X01 {\n" +
- " public final synchronized java.lang.String a_method_which_have_a_very_long_name() {\n" +
- " return null;\n" +
- " }\n" +
+ "class X01 {\n" +
+ " public final synchronized java.lang.String a_method_which_have_a_very_long_name() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "class X01 {\n" +
- " public final synchronized\n" +
- " java.lang.String a_method_which_have_a_very_long_name() {\n" +
- " return null;\n" +
- " }\n" +
+ "class X01 {\n" +
+ " public final synchronized\n" +
+ " java.lang.String a_method_which_have_a_very_long_name() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
);
}
@@ -2375,18 +2375,18 @@ public void testBug284789_01d() throws JavaModelException {
this.formatterPrefs.alignment_for_method_declaration = Alignment.M_ONE_PER_LINE_SPLIT;
setPageWidth80();
String source =
- "class X01 {\n" +
- " public final synchronized java.lang.String a_method_which_have_a_very_long_name() {\n" +
- " return null;\n" +
- " }\n" +
+ "class X01 {\n" +
+ " public final synchronized java.lang.String a_method_which_have_a_very_long_name() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "class X01 {\n" +
- " public final synchronized\n" +
- " java.lang.String\n" +
- " a_method_which_have_a_very_long_name() {\n" +
- " return null;\n" +
- " }\n" +
+ "class X01 {\n" +
+ " public final synchronized\n" +
+ " java.lang.String\n" +
+ " a_method_which_have_a_very_long_name() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
);
}
@@ -2394,18 +2394,18 @@ public void testBug284789_01e() throws JavaModelException {
this.formatterPrefs.alignment_for_method_declaration = Alignment.M_NEXT_SHIFTED_SPLIT;
setPageWidth80();
String source =
- "class X01 {\n" +
- " public final synchronized java.lang.String a_method_which_have_a_very_long_name() {\n" +
- " return null;\n" +
- " }\n" +
+ "class X01 {\n" +
+ " public final synchronized java.lang.String a_method_which_have_a_very_long_name() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "class X01 {\n" +
- " public final synchronized\n" +
- " java.lang.String\n" +
- " a_method_which_have_a_very_long_name() {\n" +
- " return null;\n" +
- " }\n" +
+ "class X01 {\n" +
+ " public final synchronized\n" +
+ " java.lang.String\n" +
+ " a_method_which_have_a_very_long_name() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
);
}
@@ -2413,17 +2413,17 @@ public void testBug284789_01f() throws JavaModelException {
this.formatterPrefs.alignment_for_method_declaration = Alignment.M_NEXT_PER_LINE_SPLIT;
setPageWidth80();
String source =
- "class X01 {\n" +
- " public final synchronized java.lang.String a_method_which_have_a_very_long_name() {\n" +
- " return null;\n" +
- " }\n" +
+ "class X01 {\n" +
+ " public final synchronized java.lang.String a_method_which_have_a_very_long_name() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "class X01 {\n" +
- " public final synchronized java.lang.String\n" +
- " a_method_which_have_a_very_long_name() {\n" +
- " return null;\n" +
- " }\n" +
+ "class X01 {\n" +
+ " public final synchronized java.lang.String\n" +
+ " a_method_which_have_a_very_long_name() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
);
}
@@ -2431,17 +2431,17 @@ public void testBug284789_02a() throws JavaModelException {
// default is no wrapping for method declaration
setPageWidth80();
String source =
- "class X02 {\n" +
- " public final synchronized java.lang.String a_method_which_have_a_very_long_name(String first, String second, String third) {\n" +
- " return null;\n" +
- " }\n" +
+ "class X02 {\n" +
+ " public final synchronized java.lang.String a_method_which_have_a_very_long_name(String first, String second, String third) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "class X02 {\n" +
- " public final synchronized java.lang.String a_method_which_have_a_very_long_name(\n" +
- " String first, String second, String third) {\n" +
- " return null;\n" +
- " }\n" +
+ "class X02 {\n" +
+ " public final synchronized java.lang.String a_method_which_have_a_very_long_name(\n" +
+ " String first, String second, String third) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
);
}
@@ -2450,18 +2450,18 @@ public void testBug284789_02b() throws JavaModelException {
this.formatterPrefs.alignment_for_parameters_in_method_declaration = Alignment.M_COMPACT_SPLIT;
setPageWidth80();
String source =
- "class X02 {\n" +
- " public final synchronized java.lang.String a_method_which_have_a_very_long_name(String first, String second, String third) {\n" +
- " return null;\n" +
- " }\n" +
+ "class X02 {\n" +
+ " public final synchronized java.lang.String a_method_which_have_a_very_long_name(String first, String second, String third) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "class X02 {\n" +
- " public final synchronized java.lang.String\n" +
- " a_method_which_have_a_very_long_name(String first, String second,\n" +
- " String third) {\n" +
- " return null;\n" +
- " }\n" +
+ "class X02 {\n" +
+ " public final synchronized java.lang.String\n" +
+ " a_method_which_have_a_very_long_name(String first, String second,\n" +
+ " String third) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
);
}
@@ -2470,18 +2470,18 @@ public void testBug284789_02c() throws JavaModelException {
this.formatterPrefs.alignment_for_parameters_in_method_declaration = Alignment.M_COMPACT_FIRST_BREAK_SPLIT;
setPageWidth80();
String source =
- "class X02 {\n" +
- " public final synchronized java.lang.String a_method_which_have_a_very_long_name(String first, String second, String third) {\n" +
- " return null;\n" +
- " }\n" +
+ "class X02 {\n" +
+ " public final synchronized java.lang.String a_method_which_have_a_very_long_name(String first, String second, String third) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "class X02 {\n" +
- " public final synchronized\n" +
- " java.lang.String a_method_which_have_a_very_long_name(\n" +
- " String first, String second, String third) {\n" +
- " return null;\n" +
- " }\n" +
+ "class X02 {\n" +
+ " public final synchronized\n" +
+ " java.lang.String a_method_which_have_a_very_long_name(\n" +
+ " String first, String second, String third) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
);
}
@@ -2490,21 +2490,21 @@ public void testBug284789_02d() throws JavaModelException {
this.formatterPrefs.alignment_for_parameters_in_method_declaration = Alignment.M_ONE_PER_LINE_SPLIT;
setPageWidth80();
String source =
- "class X02 {\n" +
- " public final synchronized java.lang.String a_method_which_have_a_very_long_name(String first, String second, String third) {\n" +
- " return null;\n" +
- " }\n" +
+ "class X02 {\n" +
+ " public final synchronized java.lang.String a_method_which_have_a_very_long_name(String first, String second, String third) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "class X02 {\n" +
- " public final synchronized\n" +
- " java.lang.String\n" +
- " a_method_which_have_a_very_long_name(\n" +
- " String first,\n" +
- " String second,\n" +
- " String third) {\n" +
- " return null;\n" +
- " }\n" +
+ "class X02 {\n" +
+ " public final synchronized\n" +
+ " java.lang.String\n" +
+ " a_method_which_have_a_very_long_name(\n" +
+ " String first,\n" +
+ " String second,\n" +
+ " String third) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
);
}
@@ -2513,21 +2513,21 @@ public void testBug284789_02e() throws JavaModelException {
this.formatterPrefs.alignment_for_parameters_in_method_declaration = Alignment.M_NEXT_SHIFTED_SPLIT;
setPageWidth80();
String source =
- "class X02 {\n" +
- " public final synchronized java.lang.String a_method_which_have_a_very_long_name(String first, String second, String third) {\n" +
- " return null;\n" +
- " }\n" +
+ "class X02 {\n" +
+ " public final synchronized java.lang.String a_method_which_have_a_very_long_name(String first, String second, String third) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "class X02 {\n" +
- " public final synchronized\n" +
- " java.lang.String\n" +
- " a_method_which_have_a_very_long_name(\n" +
- " String first,\n" +
- " String second,\n" +
- " String third) {\n" +
- " return null;\n" +
- " }\n" +
+ "class X02 {\n" +
+ " public final synchronized\n" +
+ " java.lang.String\n" +
+ " a_method_which_have_a_very_long_name(\n" +
+ " String first,\n" +
+ " String second,\n" +
+ " String third) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
);
}
@@ -2536,19 +2536,19 @@ public void testBug284789_02f() throws JavaModelException {
this.formatterPrefs.alignment_for_parameters_in_method_declaration = Alignment.M_NEXT_PER_LINE_SPLIT;
setPageWidth80();
String source =
- "class X02 {\n" +
- " public final synchronized java.lang.String a_method_which_have_a_very_long_name(String first, String second, String third) {\n" +
- " return null;\n" +
- " }\n" +
+ "class X02 {\n" +
+ " public final synchronized java.lang.String a_method_which_have_a_very_long_name(String first, String second, String third) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "class X02 {\n" +
- " public final synchronized java.lang.String\n" +
- " a_method_which_have_a_very_long_name(String first,\n" +
- " String second,\n" +
- " String third) {\n" +
- " return null;\n" +
- " }\n" +
+ "class X02 {\n" +
+ " public final synchronized java.lang.String\n" +
+ " a_method_which_have_a_very_long_name(String first,\n" +
+ " String second,\n" +
+ " String third) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
);
}
@@ -2774,52 +2774,52 @@ public void testBug286601_massive_01() {
this.formatterPrefs.join_wrapped_lines = false;
setUpBracesPreferences(DefaultCodeFormatterConstants.NEXT_LINE);
String source =
- "package massive;\n" +
- "public class X01 {\n" +
- " public void build(String href) {\n" +
- " // set the href on the related topic\n" +
- " if (href == null)\n" +
- " setHref(\"\"); //$NON-NLS-1$\n" +
- " else {\n" +
- " if (!href.equals(\"\") // no empty link //$NON-NLS-1$\n" +
- " && !href.startsWith(\"/\") // no help url //$NON-NLS-1$\n" +
- " && href.indexOf(\':\') == -1) // no other protocols\n" +
- " {\n" +
- " setHref(\"/test/\" + href); //$NON-NLS-1$ //$NON-NLS-2$\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " private void setHref(String string)\n" +
- " {\n" +
- " \n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "package massive;\n" +
- "\n" +
- "public class X01\n" +
- "{\n" +
- " public void build(String href)\n" +
- " {\n" +
- " // set the href on the related topic\n" +
- " if (href == null)\n" +
- " setHref(\"\"); //$NON-NLS-1$\n" +
- " else\n" +
- " {\n" +
- " if (!href.equals(\"\") // no empty link //$NON-NLS-1$\n" +
- " && !href.startsWith(\"/\") // no help url //$NON-NLS-1$\n" +
- " && href.indexOf(\':\') == -1) // no other protocols\n" +
- " {\n" +
- " setHref(\"/test/\" + href); //$NON-NLS-1$ //$NON-NLS-2$\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " private void setHref(String string)\n" +
- " {\n" +
- "\n" +
- " }\n" +
+ "package massive;\n" +
+ "public class X01 {\n" +
+ " public void build(String href) {\n" +
+ " // set the href on the related topic\n" +
+ " if (href == null)\n" +
+ " setHref(\"\"); //$NON-NLS-1$\n" +
+ " else {\n" +
+ " if (!href.equals(\"\") // no empty link //$NON-NLS-1$\n" +
+ " && !href.startsWith(\"/\") // no help url //$NON-NLS-1$\n" +
+ " && href.indexOf(\':\') == -1) // no other protocols\n" +
+ " {\n" +
+ " setHref(\"/test/\" + href); //$NON-NLS-1$ //$NON-NLS-2$\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " private void setHref(String string)\n" +
+ " {\n" +
+ " \n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "package massive;\n" +
+ "\n" +
+ "public class X01\n" +
+ "{\n" +
+ " public void build(String href)\n" +
+ " {\n" +
+ " // set the href on the related topic\n" +
+ " if (href == null)\n" +
+ " setHref(\"\"); //$NON-NLS-1$\n" +
+ " else\n" +
+ " {\n" +
+ " if (!href.equals(\"\") // no empty link //$NON-NLS-1$\n" +
+ " && !href.startsWith(\"/\") // no help url //$NON-NLS-1$\n" +
+ " && href.indexOf(\':\') == -1) // no other protocols\n" +
+ " {\n" +
+ " setHref(\"/test/\" + href); //$NON-NLS-1$ //$NON-NLS-2$\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " private void setHref(String string)\n" +
+ " {\n" +
+ "\n" +
+ " }\n" +
"}\n"
);
}
@@ -2828,49 +2828,49 @@ public void testBug286601_massive_02() {
setUpBracesPreferences(DefaultCodeFormatterConstants.NEXT_LINE);
setPageWidth80();
String source =
- "package massive;\n" +
- "\n" +
- "public class X02\n" +
- "{\n" +
- " \n" +
- " private AntModel getAntModel(final File buildFile) {\n" +
- " AntModel model= new AntModel(XMLCore.getDefault(), doc, null, new LocationProvider(null) {\n" +
- " /* (non-Javadoc)\n" +
- " * @see org.eclipse.ant.internal.ui.editor.outline.ILocationProvider#getLocation()\n" +
- " */\n" +
- " public IPath getLocation() {\n" +
- " return new Path(buildFile.getAbsolutePath());\n" +
- " }\n" +
- " });\n" +
- " model.reconcile(null);\n" +
- " return model;\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "package massive;\n" +
- "\n" +
- "public class X02\n" +
- "{\n" +
- "\n" +
- " private AntModel getAntModel(final File buildFile)\n" +
- " {\n" +
- " AntModel model = new AntModel(XMLCore.getDefault(), doc, null,\n" +
- " new LocationProvider(null)\n" +
- " {\n" +
- " /*\n" +
- " * (non-Javadoc)\n" +
- " * \n" +
- " * @see org.eclipse.ant.internal.ui.editor.outline.\n" +
- " * ILocationProvider#getLocation()\n" +
- " */\n" +
- " public IPath getLocation()\n" +
- " {\n" +
- " return new Path(buildFile.getAbsolutePath());\n" +
- " }\n" +
- " });\n" +
- " model.reconcile(null);\n" +
- " return model;\n" +
- " }\n" +
+ "package massive;\n" +
+ "\n" +
+ "public class X02\n" +
+ "{\n" +
+ " \n" +
+ " private AntModel getAntModel(final File buildFile) {\n" +
+ " AntModel model= new AntModel(XMLCore.getDefault(), doc, null, new LocationProvider(null) {\n" +
+ " /* (non-Javadoc)\n" +
+ " * @see org.eclipse.ant.internal.ui.editor.outline.ILocationProvider#getLocation()\n" +
+ " */\n" +
+ " public IPath getLocation() {\n" +
+ " return new Path(buildFile.getAbsolutePath());\n" +
+ " }\n" +
+ " });\n" +
+ " model.reconcile(null);\n" +
+ " return model;\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "package massive;\n" +
+ "\n" +
+ "public class X02\n" +
+ "{\n" +
+ "\n" +
+ " private AntModel getAntModel(final File buildFile)\n" +
+ " {\n" +
+ " AntModel model = new AntModel(XMLCore.getDefault(), doc, null,\n" +
+ " new LocationProvider(null)\n" +
+ " {\n" +
+ " /*\n" +
+ " * (non-Javadoc)\n" +
+ " * \n" +
+ " * @see org.eclipse.ant.internal.ui.editor.outline.\n" +
+ " * ILocationProvider#getLocation()\n" +
+ " */\n" +
+ " public IPath getLocation()\n" +
+ " {\n" +
+ " return new Path(buildFile.getAbsolutePath());\n" +
+ " }\n" +
+ " });\n" +
+ " model.reconcile(null);\n" +
+ " return model;\n" +
+ " }\n" +
"}\n"
);
}
@@ -2878,50 +2878,50 @@ public void testBug286601_massive_03() {
this.formatterPrefs.join_wrapped_lines = false;
setPageWidth80();
String source =
- "package massive;\n" +
- "\n" +
- "public class X03\n" +
- "{\n" +
- "\n" +
- " public void foo() throws NullPointerException {\n" +
- "\n" +
- " Object body = new Object() {\n" +
- " public void run(StringBuffer monitor) throws IllegalArgumentException {\n" +
- " IResourceVisitor visitor = new IResourceVisitor() {\n" +
- " public boolean visit(String resource) throws IllegalArgumentException {\n" +
- " return true;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "\n" +
- "}\n" +
- "interface IResourceVisitor {\n" +
- "}\n";
- formatSource(source,
- "package massive;\n" +
- "\n" +
+ "package massive;\n" +
+ "\n" +
+ "public class X03\n" +
+ "{\n" +
+ "\n" +
+ " public void foo() throws NullPointerException {\n" +
+ "\n" +
+ " Object body = new Object() {\n" +
+ " public void run(StringBuffer monitor) throws IllegalArgumentException {\n" +
+ " IResourceVisitor visitor = new IResourceVisitor() {\n" +
+ " public boolean visit(String resource) throws IllegalArgumentException {\n" +
+ " return true;\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
+ "\n" +
+ "}\n" +
+ "interface IResourceVisitor {\n" +
+ "}\n";
+ formatSource(source,
+ "package massive;\n" +
+ "\n" +
"public class X03 {\n" +
- "\n" +
- " public void foo() throws NullPointerException {\n" +
- "\n" +
- " Object body = new Object() {\n" +
- " public void run(StringBuffer monitor)\n" +
- " throws IllegalArgumentException {\n" +
- " IResourceVisitor visitor = new IResourceVisitor() {\n" +
- " public boolean visit(String resource)\n" +
- " throws IllegalArgumentException {\n" +
- " return true;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "\n" +
- "}\n" +
- "\n" +
- "interface IResourceVisitor {\n" +
+ "\n" +
+ " public void foo() throws NullPointerException {\n" +
+ "\n" +
+ " Object body = new Object() {\n" +
+ " public void run(StringBuffer monitor)\n" +
+ " throws IllegalArgumentException {\n" +
+ " IResourceVisitor visitor = new IResourceVisitor() {\n" +
+ " public boolean visit(String resource)\n" +
+ " throws IllegalArgumentException {\n" +
+ " return true;\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
+ "\n" +
+ "}\n" +
+ "\n" +
+ "interface IResourceVisitor {\n" +
"}\n"
);
}
@@ -2930,57 +2930,57 @@ public void testBug286601_wksp_03b() {
setUpBracesPreferences(DefaultCodeFormatterConstants.NEXT_LINE);
setPageWidth80();
String source =
- "package massive;\n" +
- "\n" +
- "public class X03\n" +
- "{\n" +
- "\n" +
- " public void foo() throws NullPointerException {\n" +
- "\n" +
- " Object body = new Object() {\n" +
- " public void run(StringBuffer monitor) throws IllegalArgumentException {\n" +
- " IResourceVisitor visitor = new IResourceVisitor() {\n" +
- " public boolean visit(String resource) throws IllegalArgumentException {\n" +
- " return true;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "\n" +
- "}\n" +
- "interface IResourceVisitor {\n" +
- "}\n";
- formatSource(source,
- "package massive;\n" +
- "\n" +
- "public class X03\n" +
- "{\n" +
- "\n" +
- " public void foo() throws NullPointerException\n" +
- " {\n" +
- "\n" +
- " Object body = new Object()\n" +
- " {\n" +
- " public void run(StringBuffer monitor)\n" +
- " throws IllegalArgumentException\n" +
- " {\n" +
- " IResourceVisitor visitor = new IResourceVisitor()\n" +
- " {\n" +
- " public boolean visit(String resource)\n" +
- " throws IllegalArgumentException\n" +
- " {\n" +
- " return true;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "\n" +
- "}\n" +
- "\n" +
- "interface IResourceVisitor\n" +
- "{\n" +
+ "package massive;\n" +
+ "\n" +
+ "public class X03\n" +
+ "{\n" +
+ "\n" +
+ " public void foo() throws NullPointerException {\n" +
+ "\n" +
+ " Object body = new Object() {\n" +
+ " public void run(StringBuffer monitor) throws IllegalArgumentException {\n" +
+ " IResourceVisitor visitor = new IResourceVisitor() {\n" +
+ " public boolean visit(String resource) throws IllegalArgumentException {\n" +
+ " return true;\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
+ "\n" +
+ "}\n" +
+ "interface IResourceVisitor {\n" +
+ "}\n";
+ formatSource(source,
+ "package massive;\n" +
+ "\n" +
+ "public class X03\n" +
+ "{\n" +
+ "\n" +
+ " public void foo() throws NullPointerException\n" +
+ " {\n" +
+ "\n" +
+ " Object body = new Object()\n" +
+ " {\n" +
+ " public void run(StringBuffer monitor)\n" +
+ " throws IllegalArgumentException\n" +
+ " {\n" +
+ " IResourceVisitor visitor = new IResourceVisitor()\n" +
+ " {\n" +
+ " public boolean visit(String resource)\n" +
+ " throws IllegalArgumentException\n" +
+ " {\n" +
+ " return true;\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
+ "\n" +
+ "}\n" +
+ "\n" +
+ "interface IResourceVisitor\n" +
+ "{\n" +
"}\n"
);
}
@@ -3007,9 +3007,9 @@ public void testBug286668() throws JavaModelException {
"\n" +
" void foo() {\n" +
" StringBuilder builder = new StringBuilder();\n" +
- " builder.append(\"abc\").append(\"def\").append(\"ghi\").append(\"jkl\")\n" +
- " .append(\"mno\")\n" +
- " .append(\"pqr\").append(\"stu\").append(\"vwx\").append(\"yz\");\n" +
+ " builder.append(\"abc\").append(\"def\").append(\"ghi\").append(\"jkl\")\n" +
+ " .append(\"mno\")\n" +
+ " .append(\"pqr\").append(\"stu\").append(\"vwx\").append(\"yz\");\n" +
" }\n" +
"}\n"
);
@@ -3081,15 +3081,15 @@ public void testBug286668_40w() throws JavaModelException {
"\n" +
" void foo() {\n" +
" StringBuilder builder = new StringBuilder();\n" +
- " builder.append(\"abc\")\n" +
- " .append(\"def\")\n" +
- " .append(\"ghi\")\n" +
- " .append(\"jkl\")\n" +
- " .append(\"mno\")\n" +
- " .append(\"pqr\")\n" +
- " .append(\"stu\")\n" +
- " .append(\"vwx\")\n" +
- " .append(\"yz\");\n" +
+ " builder.append(\"abc\")\n" +
+ " .append(\"def\")\n" +
+ " .append(\"ghi\")\n" +
+ " .append(\"jkl\")\n" +
+ " .append(\"mno\")\n" +
+ " .append(\"pqr\")\n" +
+ " .append(\"stu\")\n" +
+ " .append(\"vwx\")\n" +
+ " .append(\"yz\");\n" +
" }\n" +
"}\n"
);
@@ -3112,15 +3112,15 @@ public void testBug286668b_40w() throws JavaModelException {
"\n" +
" void foo() {\n" +
" StringBuilder builder = new StringBuilder();\n" +
- " builder.append(\"abc\")\n" +
- " .append(\"def\")\n" +
- " .append(\"ghi\")\n" +
- " .append(\"jkl\")\n" +
- " .append(\"mno\")\n" +
- " .append(\"pqr\")\n" +
- " .append(\"stu\")\n" +
- " .append(\"vwx\")\n" +
- " .append(\"yz\");\n" +
+ " builder.append(\"abc\")\n" +
+ " .append(\"def\")\n" +
+ " .append(\"ghi\")\n" +
+ " .append(\"jkl\")\n" +
+ " .append(\"mno\")\n" +
+ " .append(\"pqr\")\n" +
+ " .append(\"stu\")\n" +
+ " .append(\"vwx\")\n" +
+ " .append(\"yz\");\n" +
" }\n" +
"}\n"
);
@@ -3144,15 +3144,15 @@ public void testBug286668c_40w() throws JavaModelException {
"\n" +
" void foo() {\n" +
" StringBuilder builder = new StringBuilder();\n" +
- " builder.append(\"abc\")\n" +
- " .append(\"def\")\n" +
- " .append(\"ghi\")\n" +
- " .append(\"jkl\")\n" +
- " .append(\"mno\")\n" +
- " .append(\"pqr\")\n" +
- " .append(\"stu\")\n" +
- " .append(\"vwx\")\n" +
- " .append(\"yz\");\n" +
+ " builder.append(\"abc\")\n" +
+ " .append(\"def\")\n" +
+ " .append(\"ghi\")\n" +
+ " .append(\"jkl\")\n" +
+ " .append(\"mno\")\n" +
+ " .append(\"pqr\")\n" +
+ " .append(\"stu\")\n" +
+ " .append(\"vwx\")\n" +
+ " .append(\"yz\");\n" +
" }\n" +
"}\n"
);
@@ -3427,1304 +3427,1304 @@ public void testBug293240() {
*/
public void testBug293300_wksp1_01() {
useOldCommentWidthCounting();
- String source =
- "package wksp1;\n" +
- "\n" +
- "public class X01 {\n" +
- "\n" +
- " boolean foo(int test, int value) {\n" +
- " // This comment may also be impacted after having been split in several lines. Furthermore, it\'s also important to verify that the algorithm works when the comment is split into several lines. It\'s a common use case that it may works for 1, 2 but not for 3 iterations...\n" +
- " if (test == 0) {\n" +
- " // skip\n" +
- " } else if (Math.sqrt(Math.pow(test, 2)) > 10) // This is the offending comment after having been split into several lines\n" +
- " return false;\n" +
- " return true;\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X01 {\n" +
- "\n" +
- " boolean foo(int test, int value) {\n" +
- " // This comment may also be impacted after having been split in several\n" +
- " // lines. Furthermore, it\'s also important to verify that the algorithm\n" +
- " // works when the comment is split into several lines. It\'s a common use\n" +
- " // case that it may works for 1, 2 but not for 3 iterations...\n" +
- " if (test == 0) {\n" +
- " // skip\n" +
- " } else if (Math.sqrt(Math.pow(test, 2)) > 10) // This is the offending\n" +
- " // comment after having\n" +
- " // been split into\n" +
- " // several lines\n" +
- " return false;\n" +
- " return true;\n" +
- " }\n" +
+ String source =
+ "package wksp1;\n" +
+ "\n" +
+ "public class X01 {\n" +
+ "\n" +
+ " boolean foo(int test, int value) {\n" +
+ " // This comment may also be impacted after having been split in several lines. Furthermore, it\'s also important to verify that the algorithm works when the comment is split into several lines. It\'s a common use case that it may works for 1, 2 but not for 3 iterations...\n" +
+ " if (test == 0) {\n" +
+ " // skip\n" +
+ " } else if (Math.sqrt(Math.pow(test, 2)) > 10) // This is the offending comment after having been split into several lines\n" +
+ " return false;\n" +
+ " return true;\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp1;\n" +
+ "\n" +
+ "public class X01 {\n" +
+ "\n" +
+ " boolean foo(int test, int value) {\n" +
+ " // This comment may also be impacted after having been split in several\n" +
+ " // lines. Furthermore, it\'s also important to verify that the algorithm\n" +
+ " // works when the comment is split into several lines. It\'s a common use\n" +
+ " // case that it may works for 1, 2 but not for 3 iterations...\n" +
+ " if (test == 0) {\n" +
+ " // skip\n" +
+ " } else if (Math.sqrt(Math.pow(test, 2)) > 10) // This is the offending\n" +
+ " // comment after having\n" +
+ " // been split into\n" +
+ " // several lines\n" +
+ " return false;\n" +
+ " return true;\n" +
+ " }\n" +
"}\n"
);
}
public void testBug293300_wkps1_02() {
useOldCommentWidthCounting();
- String source =
- "package wksp1;\n" +
- "\n" +
- "public class X02 {\n" +
- " String field;\n" +
- " public X02(String test) {\n" +
- " field= test.toLowerCase();\n" +
- " try {\n" +
- " testWhetherItWorksOrNot(test); // This comment will be split and should not involve instability\n" +
- " } catch (Exception e) {\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
- " private void testWhetherItWorksOrNot(String test) {\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X02 {\n" +
- " String field;\n" +
- "\n" +
- " public X02(String test) {\n" +
- " field = test.toLowerCase();\n" +
- " try {\n" +
- " testWhetherItWorksOrNot(test); // This comment will be split and\n" +
- " // should not involve instability\n" +
- " } catch (Exception e) {\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " private void testWhetherItWorksOrNot(String test) {\n" +
- " }\n" +
+ String source =
+ "package wksp1;\n" +
+ "\n" +
+ "public class X02 {\n" +
+ " String field;\n" +
+ " public X02(String test) {\n" +
+ " field= test.toLowerCase();\n" +
+ " try {\n" +
+ " testWhetherItWorksOrNot(test); // This comment will be split and should not involve instability\n" +
+ " } catch (Exception e) {\n" +
+ " return;\n" +
+ " }\n" +
+ " }\n" +
+ " private void testWhetherItWorksOrNot(String test) {\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp1;\n" +
+ "\n" +
+ "public class X02 {\n" +
+ " String field;\n" +
+ "\n" +
+ " public X02(String test) {\n" +
+ " field = test.toLowerCase();\n" +
+ " try {\n" +
+ " testWhetherItWorksOrNot(test); // This comment will be split and\n" +
+ " // should not involve instability\n" +
+ " } catch (Exception e) {\n" +
+ " return;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " private void testWhetherItWorksOrNot(String test) {\n" +
+ " }\n" +
"}\n"
);
}
public void testBug293300_wkps1_03() {
setPageWidth80();
- String source =
- "package wksp1;\n" +
- "\n" +
- "public class X03 {\n" +
- "public static final native int foo(\n" +
- " int firstParameter,\n" +
- " int secondParameter,\n" +
- " int[] param3); //When a long comment is placed here with at least one line to follow,\n" +
- " // the second line may be difficult to be formatted correctly\n" +
- "public static final native int bar();\n" +
- "\n" +
- "}\n";
- formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X03 {\n" +
- " public static final native int foo(int firstParameter, int secondParameter,\n" +
- " int[] param3); // When a long comment is placed here with at least\n" +
- " // one line to follow,\n" +
- " // the second line may be difficult to be formatted\n" +
- " // correctly\n" +
- "\n" +
- " public static final native int bar();\n" +
- "\n" +
+ String source =
+ "package wksp1;\n" +
+ "\n" +
+ "public class X03 {\n" +
+ "public static final native int foo(\n" +
+ " int firstParameter,\n" +
+ " int secondParameter,\n" +
+ " int[] param3); //When a long comment is placed here with at least one line to follow,\n" +
+ " // the second line may be difficult to be formatted correctly\n" +
+ "public static final native int bar();\n" +
+ "\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp1;\n" +
+ "\n" +
+ "public class X03 {\n" +
+ " public static final native int foo(int firstParameter, int secondParameter,\n" +
+ " int[] param3); // When a long comment is placed here with at least\n" +
+ " // one line to follow,\n" +
+ " // the second line may be difficult to be formatted\n" +
+ " // correctly\n" +
+ "\n" +
+ " public static final native int bar();\n" +
+ "\n" +
"}\n"
);
}
public void testBug293300_wkps1_04() {
useOldCommentWidthCounting();
- String source =
- "package wksp1;\n" +
- "\n" +
- "interface Y04_____________________________ {\n" +
- "}\n" +
- "\n" +
- "public interface X04 extends Y04_____________________________ { // modifier constant\n" +
- " // those constants are depending upon ClassFileConstants (relying that classfiles only use the 16 lower bits)\n" +
- " final int AccDefault = 0;\n" +
- "}\n";
- formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "interface Y04_____________________________ {\n" +
- "}\n" +
- "\n" +
- "public interface X04 extends Y04_____________________________ { // modifier\n" +
- " // constant\n" +
- " // those constants are depending upon ClassFileConstants (relying that\n" +
- " // classfiles only use the 16 lower bits)\n" +
- " final int AccDefault = 0;\n" +
+ String source =
+ "package wksp1;\n" +
+ "\n" +
+ "interface Y04_____________________________ {\n" +
+ "}\n" +
+ "\n" +
+ "public interface X04 extends Y04_____________________________ { // modifier constant\n" +
+ " // those constants are depending upon ClassFileConstants (relying that classfiles only use the 16 lower bits)\n" +
+ " final int AccDefault = 0;\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp1;\n" +
+ "\n" +
+ "interface Y04_____________________________ {\n" +
+ "}\n" +
+ "\n" +
+ "public interface X04 extends Y04_____________________________ { // modifier\n" +
+ " // constant\n" +
+ " // those constants are depending upon ClassFileConstants (relying that\n" +
+ " // classfiles only use the 16 lower bits)\n" +
+ " final int AccDefault = 0;\n" +
"}\n"
);
}
public void testBug293300_wkps1_05() {
- String source =
- "package wksp1;\n" +
- "\n" +
- "public class X05 {\n" +
- " private final static String[] TEST_BUG = {\"a\", //$NON-NLS-1$\n" +
- " \"b\", //$NON-NLS-1$\n" +
- " \"c\", //$NON-NLS-1$\n" +
- " };\n" +
+ String source =
+ "package wksp1;\n" +
+ "\n" +
+ "public class X05 {\n" +
+ " private final static String[] TEST_BUG = {\"a\", //$NON-NLS-1$\n" +
+ " \"b\", //$NON-NLS-1$\n" +
+ " \"c\", //$NON-NLS-1$\n" +
+ " };\n" +
"}\n";
formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X05 {\n" +
- " private final static String[] TEST_BUG = { \"a\", //$NON-NLS-1$\n" +
- " \"b\", //$NON-NLS-1$\n" +
- " \"c\", //$NON-NLS-1$\n" +
- " };\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X05 {\n" +
+ " private final static String[] TEST_BUG = { \"a\", //$NON-NLS-1$\n" +
+ " \"b\", //$NON-NLS-1$\n" +
+ " \"c\", //$NON-NLS-1$\n" +
+ " };\n" +
"}\n"
);
}
public void testBug293300_wkps1_05_JoinLinesComments_BracesNextLine() {
this.formatterPrefs.join_wrapped_lines = false;
setUpBracesPreferences(DefaultCodeFormatterConstants.NEXT_LINE);
- String source =
- "package wksp1;\n" +
- "\n" +
- "public class X05 {\n" +
- " private final static String[] TEST_BUG = {\"a\", //$NON-NLS-1$\n" +
- " \"b\", //$NON-NLS-1$\n" +
- " \"c\", //$NON-NLS-1$\n" +
- " };\n" +
+ String source =
+ "package wksp1;\n" +
+ "\n" +
+ "public class X05 {\n" +
+ " private final static String[] TEST_BUG = {\"a\", //$NON-NLS-1$\n" +
+ " \"b\", //$NON-NLS-1$\n" +
+ " \"c\", //$NON-NLS-1$\n" +
+ " };\n" +
"}\n";
formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X05\n" +
- "{\n" +
- " private final static String[] TEST_BUG =\n" +
- " { \"a\", //$NON-NLS-1$\n" +
- " \"b\", //$NON-NLS-1$\n" +
- " \"c\", //$NON-NLS-1$\n" +
- " };\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X05\n" +
+ "{\n" +
+ " private final static String[] TEST_BUG =\n" +
+ " { \"a\", //$NON-NLS-1$\n" +
+ " \"b\", //$NON-NLS-1$\n" +
+ " \"c\", //$NON-NLS-1$\n" +
+ " };\n" +
"}\n"
);
}
public void testBug293300_wksp2_01() {
- String source =
- "package wksp2;\n" +
- "\n" +
- "public class X01 {\n" +
- "\n" +
- " protected String foo(String[] tests) {\n" +
- " String result = null;\n" +
- " for (int i = 0; i < tests.length; i++) {\n" +
- " String test = tests[i];\n" +
- " if (test.startsWith(\"test\")) { //$NON-NLS-1$\n" +
- " //we got the malformed tree exception here\n" +
- " result = test;\n" +
- " }\n" +
- " }\n" +
- " return result;\n" +
- " }\n" +
- "\n" +
- "}\n";
- formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public class X01 {\n" +
- "\n" +
- " protected String foo(String[] tests) {\n" +
- " String result = null;\n" +
- " for (int i = 0; i < tests.length; i++) {\n" +
- " String test = tests[i];\n" +
- " if (test.startsWith(\"test\")) { //$NON-NLS-1$\n" +
- " // we got the malformed tree exception here\n" +
- " result = test;\n" +
- " }\n" +
- " }\n" +
- " return result;\n" +
- " }\n" +
- "\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public class X01 {\n" +
+ "\n" +
+ " protected String foo(String[] tests) {\n" +
+ " String result = null;\n" +
+ " for (int i = 0; i < tests.length; i++) {\n" +
+ " String test = tests[i];\n" +
+ " if (test.startsWith(\"test\")) { //$NON-NLS-1$\n" +
+ " //we got the malformed tree exception here\n" +
+ " result = test;\n" +
+ " }\n" +
+ " }\n" +
+ " return result;\n" +
+ " }\n" +
+ "\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp2;\n" +
+ "\n" +
+ "public class X01 {\n" +
+ "\n" +
+ " protected String foo(String[] tests) {\n" +
+ " String result = null;\n" +
+ " for (int i = 0; i < tests.length; i++) {\n" +
+ " String test = tests[i];\n" +
+ " if (test.startsWith(\"test\")) { //$NON-NLS-1$\n" +
+ " // we got the malformed tree exception here\n" +
+ " result = test;\n" +
+ " }\n" +
+ " }\n" +
+ " return result;\n" +
+ " }\n" +
+ "\n" +
"}\n"
);
}
public void testBug293300_wksp2_02() {
- String source =
- "package wksp2;\n" +
- "\n" +
- "public class X02 {\n" +
- "\n" +
- "\n" +
- " public void foo(int kind) {\n" +
- " switch (kind) {\n" +
- " case 0 :\n" +
- " break;\n" +
- " case 1 :\n" +
- " //the first formatting looks strange on this already splitted\n" +
- " // comment\n" +
- " if (true)\n" +
- " return;\n" +
- " //fall through\n" +
- " default:\n" +
- " if (kind < 0)\n" +
- " return;\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
- "\n" +
- "}\n";
- formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public class X02 {\n" +
- "\n" +
- " public void foo(int kind) {\n" +
- " switch (kind) {\n" +
- " case 0:\n" +
- " break;\n" +
- " case 1:\n" +
- " // the first formatting looks strange on this already splitted\n" +
- " // comment\n" +
- " if (true)\n" +
- " return;\n" +
- " // fall through\n" +
- " default:\n" +
- " if (kind < 0)\n" +
- " return;\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
- "\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public class X02 {\n" +
+ "\n" +
+ "\n" +
+ " public void foo(int kind) {\n" +
+ " switch (kind) {\n" +
+ " case 0 :\n" +
+ " break;\n" +
+ " case 1 :\n" +
+ " //the first formatting looks strange on this already splitted\n" +
+ " // comment\n" +
+ " if (true)\n" +
+ " return;\n" +
+ " //fall through\n" +
+ " default:\n" +
+ " if (kind < 0)\n" +
+ " return;\n" +
+ " break;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp2;\n" +
+ "\n" +
+ "public class X02 {\n" +
+ "\n" +
+ " public void foo(int kind) {\n" +
+ " switch (kind) {\n" +
+ " case 0:\n" +
+ " break;\n" +
+ " case 1:\n" +
+ " // the first formatting looks strange on this already splitted\n" +
+ " // comment\n" +
+ " if (true)\n" +
+ " return;\n" +
+ " // fall through\n" +
+ " default:\n" +
+ " if (kind < 0)\n" +
+ " return;\n" +
+ " break;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
"}\n"
);
}
public void testBug293300_wksp2_03() {
- String source =
- "package wksp2;\n" +
- "\n" +
- "public class X03 {\n" +
- " public byte[] foo(byte value) {\n" +
- " byte[] result = new byte[10];\n" +
- " int valTest = 0;\n" +
- " switch (value) {\n" +
- " case 1 :\n" +
- " for (int j = 10; j >= 0; j--) {\n" +
- " result[j] = (byte) (valTest & 0xff); // Bottom 8\n" +
- " // bits\n" +
- " valTest = valTest >>> 2;\n" +
- " }\n" +
- " break;\n" +
- " }\n" +
- " return result;\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public class X03 {\n" +
- " public byte[] foo(byte value) {\n" +
- " byte[] result = new byte[10];\n" +
- " int valTest = 0;\n" +
- " switch (value) {\n" +
- " case 1:\n" +
- " for (int j = 10; j >= 0; j--) {\n" +
- " result[j] = (byte) (valTest & 0xff); // Bottom 8\n" +
- " // bits\n" +
- " valTest = valTest >>> 2;\n" +
- " }\n" +
- " break;\n" +
- " }\n" +
- " return result;\n" +
- " }\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public class X03 {\n" +
+ " public byte[] foo(byte value) {\n" +
+ " byte[] result = new byte[10];\n" +
+ " int valTest = 0;\n" +
+ " switch (value) {\n" +
+ " case 1 :\n" +
+ " for (int j = 10; j >= 0; j--) {\n" +
+ " result[j] = (byte) (valTest & 0xff); // Bottom 8\n" +
+ " // bits\n" +
+ " valTest = valTest >>> 2;\n" +
+ " }\n" +
+ " break;\n" +
+ " }\n" +
+ " return result;\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp2;\n" +
+ "\n" +
+ "public class X03 {\n" +
+ " public byte[] foo(byte value) {\n" +
+ " byte[] result = new byte[10];\n" +
+ " int valTest = 0;\n" +
+ " switch (value) {\n" +
+ " case 1:\n" +
+ " for (int j = 10; j >= 0; j--) {\n" +
+ " result[j] = (byte) (valTest & 0xff); // Bottom 8\n" +
+ " // bits\n" +
+ " valTest = valTest >>> 2;\n" +
+ " }\n" +
+ " break;\n" +
+ " }\n" +
+ " return result;\n" +
+ " }\n" +
"}\n"
);
}
public void testBug293300_wksp2_04() {
useOldCommentWidthCounting();
- String source =
- "package wksp2;\n" +
- "\n" +
- "public class X04 {\n" +
- "\n" +
- " void foo() {\n" +
- " int lastDiagonal[]= new int[1000000 + 1]; // this line comments configuration\n" +
- " // may screw up the formatter to know which one\n" +
- " int origin= 1000000 / 2; // needs to stay at its current indentation or not\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public class X04 {\n" +
- "\n" +
- " void foo() {\n" +
- " int lastDiagonal[] = new int[1000000 + 1]; // this line comments\n" +
- " // configuration\n" +
- " // may screw up the formatter to know which one\n" +
- " int origin = 1000000 / 2; // needs to stay at its current indentation or\n" +
- " // not\n" +
- " }\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public class X04 {\n" +
+ "\n" +
+ " void foo() {\n" +
+ " int lastDiagonal[]= new int[1000000 + 1]; // this line comments configuration\n" +
+ " // may screw up the formatter to know which one\n" +
+ " int origin= 1000000 / 2; // needs to stay at its current indentation or not\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp2;\n" +
+ "\n" +
+ "public class X04 {\n" +
+ "\n" +
+ " void foo() {\n" +
+ " int lastDiagonal[] = new int[1000000 + 1]; // this line comments\n" +
+ " // configuration\n" +
+ " // may screw up the formatter to know which one\n" +
+ " int origin = 1000000 / 2; // needs to stay at its current indentation or\n" +
+ " // not\n" +
+ " }\n" +
"}\n"
);
}
private static final String EXPECTED_OUTPUT_WKSP2E1 =
- "package wksp2;\n" +
- "\n" +
- "public class X05 {\n" +
- " void foo(int val) {\n" +
- " try {\n" +
- " loop: for (int i = 0; i < 10; i++) {\n" +
- " switch (val) {\n" +
- " case 1:\n" +
- " if (i == 0) {\n" +
- " if (true) {\n" +
- " val++;\n" +
- " } // these comments\n" +
- " // may be wrongly\n" +
- " // realigned\n" +
- " // by the formatter\n" +
- "\n" +
- " // other comment\n" +
- " val--;\n" +
- " continue loop;\n" +
- " }\n" +
- " default:\n" +
- " throw new IllegalArgumentException();\n" +
- " }\n" +
- " }\n" +
- " } finally {\n" +
- " }\n" +
- " }\n" +
+ "package wksp2;\n" +
+ "\n" +
+ "public class X05 {\n" +
+ " void foo(int val) {\n" +
+ " try {\n" +
+ " loop: for (int i = 0; i < 10; i++) {\n" +
+ " switch (val) {\n" +
+ " case 1:\n" +
+ " if (i == 0) {\n" +
+ " if (true) {\n" +
+ " val++;\n" +
+ " } // these comments\n" +
+ " // may be wrongly\n" +
+ " // realigned\n" +
+ " // by the formatter\n" +
+ "\n" +
+ " // other comment\n" +
+ " val--;\n" +
+ " continue loop;\n" +
+ " }\n" +
+ " default:\n" +
+ " throw new IllegalArgumentException();\n" +
+ " }\n" +
+ " }\n" +
+ " } finally {\n" +
+ " }\n" +
+ " }\n" +
"}\n";
public void testBug293300_wksp2_05() {
- String source =
- "package wksp2;\n" +
- "\n" +
- "public class X05 {\n" +
- " void foo(int val) {\n" +
- " try {\n" +
- " loop: for (int i=0; i<10; i++) {\n" +
- " switch (val) {\n" +
- " case 1 :\n" +
- " if (i==0) {\n" +
- " if (true) {\n" +
- " val++;\n" +
- " } //these comments\n" +
- " // may be wrongly\n" +
- " // realigned\n" +
- " // by the formatter\n" +
- "\n" +
- " // other comment\n" +
- " val--;\n" +
- " continue loop;\n" +
- " }\n" +
- " default :\n" +
- " throw new IllegalArgumentException();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " finally {\n" +
- " }\n" +
- " }\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public class X05 {\n" +
+ " void foo(int val) {\n" +
+ " try {\n" +
+ " loop: for (int i=0; i<10; i++) {\n" +
+ " switch (val) {\n" +
+ " case 1 :\n" +
+ " if (i==0) {\n" +
+ " if (true) {\n" +
+ " val++;\n" +
+ " } //these comments\n" +
+ " // may be wrongly\n" +
+ " // realigned\n" +
+ " // by the formatter\n" +
+ "\n" +
+ " // other comment\n" +
+ " val--;\n" +
+ " continue loop;\n" +
+ " }\n" +
+ " default :\n" +
+ " throw new IllegalArgumentException();\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " finally {\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source, EXPECTED_OUTPUT_WKSP2E1);
}
public void testBug293300_wksp2_05b() {
- String source =
- "package wksp2;\n" +
- "\n" +
- "public class X05 {\n" +
- " void foo(int val) {\n" +
- " try {\n" +
- " loop: for (int i=0; i<10; i++) {\n" +
- " switch (val) {\n" +
- " case 1 :\n" +
- " if (i==0) {\n" +
- " if (true) {\n" +
- " val++;\n" +
- " } //these comments\n" +
- " // may be wrongly\n" +
- " // realigned\n" +
- " // by the formatter\n" +
- "\n" +
- " // other comment\n" +
- " val--;\n" +
- " continue loop;\n" +
- " }\n" +
- " default :\n" +
- " throw new IllegalArgumentException();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " finally {\n" +
- " }\n" +
- " }\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public class X05 {\n" +
+ " void foo(int val) {\n" +
+ " try {\n" +
+ " loop: for (int i=0; i<10; i++) {\n" +
+ " switch (val) {\n" +
+ " case 1 :\n" +
+ " if (i==0) {\n" +
+ " if (true) {\n" +
+ " val++;\n" +
+ " } //these comments\n" +
+ " // may be wrongly\n" +
+ " // realigned\n" +
+ " // by the formatter\n" +
+ "\n" +
+ " // other comment\n" +
+ " val--;\n" +
+ " continue loop;\n" +
+ " }\n" +
+ " default :\n" +
+ " throw new IllegalArgumentException();\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " finally {\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source, EXPECTED_OUTPUT_WKSP2E1);
}
private static final String EXPECTED_OUTPUT_WKSP2E3 =
- "package wksp2;\n" +
- "\n" +
- "public class X05 {\n" +
- " void foo(int val) {\n" +
- " try {\n" +
- " loop: for (int i = 0; i < 10; i++) {\n" +
- " switch (val) {\n" +
- " case 1:\n" +
- " if (i == 0) {\n" +
- " if (true) {\n" +
- " val++;\n" +
- " } // these comments\n" +
- " // may be wrongly\n" +
- " // realigned\n" +
- " // by the formatter\n" +
- "\n" +
- " // other comment\n" +
- " val--;\n" +
- " continue loop;\n" +
- " }\n" +
- " default:\n" +
- " throw new IllegalArgumentException();\n" +
- " }\n" +
- " }\n" +
- " } finally {\n" +
- " }\n" +
- " }\n" +
+ "package wksp2;\n" +
+ "\n" +
+ "public class X05 {\n" +
+ " void foo(int val) {\n" +
+ " try {\n" +
+ " loop: for (int i = 0; i < 10; i++) {\n" +
+ " switch (val) {\n" +
+ " case 1:\n" +
+ " if (i == 0) {\n" +
+ " if (true) {\n" +
+ " val++;\n" +
+ " } // these comments\n" +
+ " // may be wrongly\n" +
+ " // realigned\n" +
+ " // by the formatter\n" +
+ "\n" +
+ " // other comment\n" +
+ " val--;\n" +
+ " continue loop;\n" +
+ " }\n" +
+ " default:\n" +
+ " throw new IllegalArgumentException();\n" +
+ " }\n" +
+ " }\n" +
+ " } finally {\n" +
+ " }\n" +
+ " }\n" +
"}\n";
public void testBug293300_wksp2_05c() {
- String source =
- "package wksp2;\n" +
- "\n" +
- "public class X05 {\n" +
- " void foo(int val) {\n" +
- " try {\n" +
- " loop: for (int i=0; i<10; i++) {\n" +
- " switch (val) {\n" +
- " case 1 :\n" +
- " if (i==0) {\n" +
- " if (true) {\n" +
- " val++;\n" +
- " } //these comments\n" +
- " // may be wrongly\n" +
- " // realigned\n" +
- " // by the formatter\n" +
- "\n" +
- " // other comment\n" +
- " val--;\n" +
- " continue loop;\n" +
- " }\n" +
- " default :\n" +
- " throw new IllegalArgumentException();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " finally {\n" +
- " }\n" +
- " }\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public class X05 {\n" +
+ " void foo(int val) {\n" +
+ " try {\n" +
+ " loop: for (int i=0; i<10; i++) {\n" +
+ " switch (val) {\n" +
+ " case 1 :\n" +
+ " if (i==0) {\n" +
+ " if (true) {\n" +
+ " val++;\n" +
+ " } //these comments\n" +
+ " // may be wrongly\n" +
+ " // realigned\n" +
+ " // by the formatter\n" +
+ "\n" +
+ " // other comment\n" +
+ " val--;\n" +
+ " continue loop;\n" +
+ " }\n" +
+ " default :\n" +
+ " throw new IllegalArgumentException();\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " finally {\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source, EXPECTED_OUTPUT_WKSP2E3);
}
public void testBug293300_wksp2_05d() {
- String source =
- "package wksp2;\n" +
- "\n" +
- "public class X05 {\n" +
- " void foo(int val) {\n" +
- " try {\n" +
- " loop: for (int i=0; i<10; i++) {\n" +
- " switch (val) {\n" +
- " case 1 :\n" +
- " if (i==0) {\n" +
- " if (true) {\n" +
- " val++;\n" +
- " } //these comments\n" +
- " // may be wrongly\n" +
- " // realigned\n" +
- " // by the formatter\n" +
- "\n" +
- " // other comment\n" +
- " val--;\n" +
- " continue loop;\n" +
- " }\n" +
- " default :\n" +
- " throw new IllegalArgumentException();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " finally {\n" +
- " }\n" +
- " }\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public class X05 {\n" +
+ " void foo(int val) {\n" +
+ " try {\n" +
+ " loop: for (int i=0; i<10; i++) {\n" +
+ " switch (val) {\n" +
+ " case 1 :\n" +
+ " if (i==0) {\n" +
+ " if (true) {\n" +
+ " val++;\n" +
+ " } //these comments\n" +
+ " // may be wrongly\n" +
+ " // realigned\n" +
+ " // by the formatter\n" +
+ "\n" +
+ " // other comment\n" +
+ " val--;\n" +
+ " continue loop;\n" +
+ " }\n" +
+ " default :\n" +
+ " throw new IllegalArgumentException();\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " finally {\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source, EXPECTED_OUTPUT_WKSP2E3);
}
public void testBug293300_wksp2_05e() {
- String source =
- "package wksp2;\n" +
- "\n" +
- "public class X05 {\n" +
- " void foo(int val) {\n" +
- " try {\n" +
- " loop: for (int i=0; i<10; i++) {\n" +
- " switch (val) {\n" +
- " case 1 :\n" +
- " if (i==0) {\n" +
- " if (true) {\n" +
- " val++;\n" +
- " } //these comments\n" +
- " // may be wrongly\n" +
- " // realigned\n" +
- " // by the formatter\n" +
- "\n" +
- " // other comment\n" +
- " val--;\n" +
- " continue loop;\n" +
- " }\n" +
- " default :\n" +
- " throw new IllegalArgumentException();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " finally {\n" +
- " }\n" +
- " }\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public class X05 {\n" +
+ " void foo(int val) {\n" +
+ " try {\n" +
+ " loop: for (int i=0; i<10; i++) {\n" +
+ " switch (val) {\n" +
+ " case 1 :\n" +
+ " if (i==0) {\n" +
+ " if (true) {\n" +
+ " val++;\n" +
+ " } //these comments\n" +
+ " // may be wrongly\n" +
+ " // realigned\n" +
+ " // by the formatter\n" +
+ "\n" +
+ " // other comment\n" +
+ " val--;\n" +
+ " continue loop;\n" +
+ " }\n" +
+ " default :\n" +
+ " throw new IllegalArgumentException();\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " finally {\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source, EXPECTED_OUTPUT_WKSP2E3);
}
private static final String EXPECTED_OUTPUT_WKSP2E1_SPACES =
- "package wksp2;\n" +
- "\n" +
- "public class X05 {\n" +
- " void foo(int val) {\n" +
- " try {\n" +
- " loop: for (int i = 0; i < 10; i++) {\n" +
- " switch (val) {\n" +
- " case 1:\n" +
- " if (i == 0) {\n" +
- " if (true) {\n" +
- " val++;\n" +
- " } // these comments\n" +
- " // may be wrongly\n" +
- " // realigned\n" +
- " // by the formatter\n" +
- "\n" +
- " // other comment\n" +
- " val--;\n" +
- " continue loop;\n" +
- " }\n" +
- " default:\n" +
- " throw new IllegalArgumentException();\n" +
- " }\n" +
- " }\n" +
- " } finally {\n" +
- " }\n" +
- " }\n" +
+ "package wksp2;\n" +
+ "\n" +
+ "public class X05 {\n" +
+ " void foo(int val) {\n" +
+ " try {\n" +
+ " loop: for (int i = 0; i < 10; i++) {\n" +
+ " switch (val) {\n" +
+ " case 1:\n" +
+ " if (i == 0) {\n" +
+ " if (true) {\n" +
+ " val++;\n" +
+ " } // these comments\n" +
+ " // may be wrongly\n" +
+ " // realigned\n" +
+ " // by the formatter\n" +
+ "\n" +
+ " // other comment\n" +
+ " val--;\n" +
+ " continue loop;\n" +
+ " }\n" +
+ " default:\n" +
+ " throw new IllegalArgumentException();\n" +
+ " }\n" +
+ " }\n" +
+ " } finally {\n" +
+ " }\n" +
+ " }\n" +
"}\n";
public void testBug293300_wksp2_05_spaces() {
this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.SPACE;
- String source =
- "package wksp2;\n" +
- "\n" +
- "public class X05 {\n" +
- " void foo(int val) {\n" +
- " try {\n" +
- " loop: for (int i=0; i<10; i++) {\n" +
- " switch (val) {\n" +
- " case 1 :\n" +
- " if (i==0) {\n" +
- " if (true) {\n" +
- " val++;\n" +
- " } //these comments\n" +
- " // may be wrongly\n" +
- " // realigned\n" +
- " // by the formatter\n" +
- "\n" +
- " // other comment\n" +
- " val--;\n" +
- " continue loop;\n" +
- " }\n" +
- " default :\n" +
- " throw new IllegalArgumentException();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " finally {\n" +
- " }\n" +
- " }\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public class X05 {\n" +
+ " void foo(int val) {\n" +
+ " try {\n" +
+ " loop: for (int i=0; i<10; i++) {\n" +
+ " switch (val) {\n" +
+ " case 1 :\n" +
+ " if (i==0) {\n" +
+ " if (true) {\n" +
+ " val++;\n" +
+ " } //these comments\n" +
+ " // may be wrongly\n" +
+ " // realigned\n" +
+ " // by the formatter\n" +
+ "\n" +
+ " // other comment\n" +
+ " val--;\n" +
+ " continue loop;\n" +
+ " }\n" +
+ " default :\n" +
+ " throw new IllegalArgumentException();\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " finally {\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source, EXPECTED_OUTPUT_WKSP2E1_SPACES);
}
public void testBug293300_wksp2_05b_spaces() {
this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.SPACE;
- String source =
- "package wksp2;\n" +
- "\n" +
- "public class X05 {\n" +
- " void foo(int val) {\n" +
- " try {\n" +
- " loop: for (int i=0; i<10; i++) {\n" +
- " switch (val) {\n" +
- " case 1 :\n" +
- " if (i==0) {\n" +
- " if (true) {\n" +
- " val++;\n" +
- " } //these comments\n" +
- " // may be wrongly\n" +
- " // realigned\n" +
- " // by the formatter\n" +
- "\n" +
- " // other comment\n" +
- " val--;\n" +
- " continue loop;\n" +
- " }\n" +
- " default :\n" +
- " throw new IllegalArgumentException();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " finally {\n" +
- " }\n" +
- " }\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public class X05 {\n" +
+ " void foo(int val) {\n" +
+ " try {\n" +
+ " loop: for (int i=0; i<10; i++) {\n" +
+ " switch (val) {\n" +
+ " case 1 :\n" +
+ " if (i==0) {\n" +
+ " if (true) {\n" +
+ " val++;\n" +
+ " } //these comments\n" +
+ " // may be wrongly\n" +
+ " // realigned\n" +
+ " // by the formatter\n" +
+ "\n" +
+ " // other comment\n" +
+ " val--;\n" +
+ " continue loop;\n" +
+ " }\n" +
+ " default :\n" +
+ " throw new IllegalArgumentException();\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " finally {\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source, EXPECTED_OUTPUT_WKSP2E1_SPACES);
}
private static final String EXPECTED_OUTPUT_WKSP2E3_SPACES =
- "package wksp2;\n" +
- "\n" +
- "public class X05 {\n" +
- " void foo(int val) {\n" +
- " try {\n" +
- " loop: for (int i = 0; i < 10; i++) {\n" +
- " switch (val) {\n" +
- " case 1:\n" +
- " if (i == 0) {\n" +
- " if (true) {\n" +
- " val++;\n" +
- " } // these comments\n" +
- " // may be wrongly\n" +
- " // realigned\n" +
- " // by the formatter\n" +
- "\n" +
- " // other comment\n" +
- " val--;\n" +
- " continue loop;\n" +
- " }\n" +
- " default:\n" +
- " throw new IllegalArgumentException();\n" +
- " }\n" +
- " }\n" +
- " } finally {\n" +
- " }\n" +
- " }\n" +
+ "package wksp2;\n" +
+ "\n" +
+ "public class X05 {\n" +
+ " void foo(int val) {\n" +
+ " try {\n" +
+ " loop: for (int i = 0; i < 10; i++) {\n" +
+ " switch (val) {\n" +
+ " case 1:\n" +
+ " if (i == 0) {\n" +
+ " if (true) {\n" +
+ " val++;\n" +
+ " } // these comments\n" +
+ " // may be wrongly\n" +
+ " // realigned\n" +
+ " // by the formatter\n" +
+ "\n" +
+ " // other comment\n" +
+ " val--;\n" +
+ " continue loop;\n" +
+ " }\n" +
+ " default:\n" +
+ " throw new IllegalArgumentException();\n" +
+ " }\n" +
+ " }\n" +
+ " } finally {\n" +
+ " }\n" +
+ " }\n" +
"}\n";
public void testBug293300_wksp2_05c_spaces() {
this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.SPACE;
- String source =
- "package wksp2;\n" +
- "\n" +
- "public class X05 {\n" +
- " void foo(int val) {\n" +
- " try {\n" +
- " loop: for (int i=0; i<10; i++) {\n" +
- " switch (val) {\n" +
- " case 1 :\n" +
- " if (i==0) {\n" +
- " if (true) {\n" +
- " val++;\n" +
- " } //these comments\n" +
- " // may be wrongly\n" +
- " // realigned\n" +
- " // by the formatter\n" +
- "\n" +
- " // other comment\n" +
- " val--;\n" +
- " continue loop;\n" +
- " }\n" +
- " default :\n" +
- " throw new IllegalArgumentException();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " finally {\n" +
- " }\n" +
- " }\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public class X05 {\n" +
+ " void foo(int val) {\n" +
+ " try {\n" +
+ " loop: for (int i=0; i<10; i++) {\n" +
+ " switch (val) {\n" +
+ " case 1 :\n" +
+ " if (i==0) {\n" +
+ " if (true) {\n" +
+ " val++;\n" +
+ " } //these comments\n" +
+ " // may be wrongly\n" +
+ " // realigned\n" +
+ " // by the formatter\n" +
+ "\n" +
+ " // other comment\n" +
+ " val--;\n" +
+ " continue loop;\n" +
+ " }\n" +
+ " default :\n" +
+ " throw new IllegalArgumentException();\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " finally {\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source, EXPECTED_OUTPUT_WKSP2E3_SPACES);
}
public void testBug293300_wksp2_05d_spaces() {
this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.SPACE;
- String source =
- "package wksp2;\n" +
- "\n" +
- "public class X05 {\n" +
- " void foo(int val) {\n" +
- " try {\n" +
- " loop: for (int i=0; i<10; i++) {\n" +
- " switch (val) {\n" +
- " case 1 :\n" +
- " if (i==0) {\n" +
- " if (true) {\n" +
- " val++;\n" +
- " } //these comments\n" +
- " // may be wrongly\n" +
- " // realigned\n" +
- " // by the formatter\n" +
- "\n" +
- " // other comment\n" +
- " val--;\n" +
- " continue loop;\n" +
- " }\n" +
- " default :\n" +
- " throw new IllegalArgumentException();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " finally {\n" +
- " }\n" +
- " }\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public class X05 {\n" +
+ " void foo(int val) {\n" +
+ " try {\n" +
+ " loop: for (int i=0; i<10; i++) {\n" +
+ " switch (val) {\n" +
+ " case 1 :\n" +
+ " if (i==0) {\n" +
+ " if (true) {\n" +
+ " val++;\n" +
+ " } //these comments\n" +
+ " // may be wrongly\n" +
+ " // realigned\n" +
+ " // by the formatter\n" +
+ "\n" +
+ " // other comment\n" +
+ " val--;\n" +
+ " continue loop;\n" +
+ " }\n" +
+ " default :\n" +
+ " throw new IllegalArgumentException();\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " finally {\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source, EXPECTED_OUTPUT_WKSP2E3_SPACES);
}
public void testBug293300_wksp2_05e_spaces() {
this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.SPACE;
- String source =
- "package wksp2;\n" +
- "\n" +
- "public class X05 {\n" +
- " void foo(int val) {\n" +
- " try {\n" +
- " loop: for (int i=0; i<10; i++) {\n" +
- " switch (val) {\n" +
- " case 1 :\n" +
- " if (i==0) {\n" +
- " if (true) {\n" +
- " val++;\n" +
- " } //these comments\n" +
- " // may be wrongly\n" +
- " // realigned\n" +
- " // by the formatter\n" +
- "\n" +
- " // other comment\n" +
- " val--;\n" +
- " continue loop;\n" +
- " }\n" +
- " default :\n" +
- " throw new IllegalArgumentException();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " finally {\n" +
- " }\n" +
- " }\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public class X05 {\n" +
+ " void foo(int val) {\n" +
+ " try {\n" +
+ " loop: for (int i=0; i<10; i++) {\n" +
+ " switch (val) {\n" +
+ " case 1 :\n" +
+ " if (i==0) {\n" +
+ " if (true) {\n" +
+ " val++;\n" +
+ " } //these comments\n" +
+ " // may be wrongly\n" +
+ " // realigned\n" +
+ " // by the formatter\n" +
+ "\n" +
+ " // other comment\n" +
+ " val--;\n" +
+ " continue loop;\n" +
+ " }\n" +
+ " default :\n" +
+ " throw new IllegalArgumentException();\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " finally {\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source, EXPECTED_OUTPUT_WKSP2E3_SPACES);
}
public void testBug293300_wksp_06() {
useOldCommentWidthCounting();
- String source =
- "package wksp2;\n" +
- "\n" +
- "public class X06 {\n" +
- "public static final native int foo(\n" +
- " String field, //First field\n" +
- " int[] array); //This comment may cause trouble for the formatter, especially if there\'s another\n" +
- " // line below \n" +
- "public static final native int bar();\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public class X06 {\n" +
+ "public static final native int foo(\n" +
+ " String field, //First field\n" +
+ " int[] array); //This comment may cause trouble for the formatter, especially if there\'s another\n" +
+ " // line below \n" +
+ "public static final native int bar();\n" +
"}\n";
formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public class X06 {\n" +
- " public static final native int foo(String field, // First field\n" +
- " int[] array); // This comment may cause trouble for the formatter,\n" +
- " // especially if there\'s another\n" +
- " // line below\n" +
- "\n" +
- " public static final native int bar();\n" +
+ "package wksp2;\n" +
+ "\n" +
+ "public class X06 {\n" +
+ " public static final native int foo(String field, // First field\n" +
+ " int[] array); // This comment may cause trouble for the formatter,\n" +
+ " // especially if there\'s another\n" +
+ " // line below\n" +
+ "\n" +
+ " public static final native int bar();\n" +
"}\n"
);
}
public void testBug293300_wksp_07() {
- String source =
- "package wksp2;\n" +
- "\n" +
- "public class X07 {\n" +
- " void foo(boolean test) {\n" +
- " if (test) {\n" +
- " while (true) {\n" +
- " try {\n" +
- " try {\n" +
- " } finally {\n" +
- " if (true) {\n" +
- " try {\n" +
- " toString();\n" +
- " } catch (Exception e) {\n" +
- " } // nothing\n" +
- " }\n" +
- " } // first comment which does not move\n" +
- "\n" +
- " // second comment which should not move\n" +
- " toString();\n" +
- " } catch (Exception e) {\n" +
- " }\n" +
- "\n" +
- " } // last comment\n" +
- "\n" +
- " }\n" +
- "\n" +
- " return;\n" +
- " }\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public class X07 {\n" +
+ " void foo(boolean test) {\n" +
+ " if (test) {\n" +
+ " while (true) {\n" +
+ " try {\n" +
+ " try {\n" +
+ " } finally {\n" +
+ " if (true) {\n" +
+ " try {\n" +
+ " toString();\n" +
+ " } catch (Exception e) {\n" +
+ " } // nothing\n" +
+ " }\n" +
+ " } // first comment which does not move\n" +
+ "\n" +
+ " // second comment which should not move\n" +
+ " toString();\n" +
+ " } catch (Exception e) {\n" +
+ " }\n" +
+ "\n" +
+ " } // last comment\n" +
+ "\n" +
+ " }\n" +
+ "\n" +
+ " return;\n" +
+ " }\n" +
"}\n";
formatSource(source);
}
public void testBug293300_wksp2_08() {
- String source =
- "package wksp2;\n" +
- "\n" +
- "public class X08 {\n" +
- "int foo(int x) {\n" +
- " while (x < 0) {\n" +
- " switch (x) {\n" +
- " \n" +
- " }\n" +
- " } // end while\n" +
- "\n" +
- " // fill in output parameter\n" +
- " if(x > 10)\n" +
- " x = 1;\n" +
- "\n" +
- " // return the value\n" +
- " return x;\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public class X08 {\n" +
- " int foo(int x) {\n" +
- " while (x < 0) {\n" +
- " switch (x) {\n" +
- "\n" +
- " }\n" +
- " } // end while\n" +
- "\n" +
- " // fill in output parameter\n" +
- " if (x > 10)\n" +
- " x = 1;\n" +
- "\n" +
- " // return the value\n" +
- " return x;\n" +
- " }\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public class X08 {\n" +
+ "int foo(int x) {\n" +
+ " while (x < 0) {\n" +
+ " switch (x) {\n" +
+ " \n" +
+ " }\n" +
+ " } // end while\n" +
+ "\n" +
+ " // fill in output parameter\n" +
+ " if(x > 10)\n" +
+ " x = 1;\n" +
+ "\n" +
+ " // return the value\n" +
+ " return x;\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp2;\n" +
+ "\n" +
+ "public class X08 {\n" +
+ " int foo(int x) {\n" +
+ " while (x < 0) {\n" +
+ " switch (x) {\n" +
+ "\n" +
+ " }\n" +
+ " } // end while\n" +
+ "\n" +
+ " // fill in output parameter\n" +
+ " if (x > 10)\n" +
+ " x = 1;\n" +
+ "\n" +
+ " // return the value\n" +
+ " return x;\n" +
+ " }\n" +
"}\n"
);
}
public void testBug293300_wksp2_08b() {
- String source =
- "package wksp2;\n" +
- "\n" +
- "public class X08 {\n" +
- "int foo(int x) {\n" +
- " while (x < 0) {\n" +
- " switch (x) {\n" +
- " \n" +
- " }\n" +
- " } /* end while */\n" +
- "\n" +
- " // fill in output parameter\n" +
- " if(x > 10)\n" +
- " x = 1;\n" +
- "\n" +
- " // return the value\n" +
- " return x;\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public class X08 {\n" +
- " int foo(int x) {\n" +
- " while (x < 0) {\n" +
- " switch (x) {\n" +
- "\n" +
- " }\n" +
- " } /* end while */\n" +
- "\n" +
- " // fill in output parameter\n" +
- " if (x > 10)\n" +
- " x = 1;\n" +
- "\n" +
- " // return the value\n" +
- " return x;\n" +
- " }\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public class X08 {\n" +
+ "int foo(int x) {\n" +
+ " while (x < 0) {\n" +
+ " switch (x) {\n" +
+ " \n" +
+ " }\n" +
+ " } /* end while */\n" +
+ "\n" +
+ " // fill in output parameter\n" +
+ " if(x > 10)\n" +
+ " x = 1;\n" +
+ "\n" +
+ " // return the value\n" +
+ " return x;\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp2;\n" +
+ "\n" +
+ "public class X08 {\n" +
+ " int foo(int x) {\n" +
+ " while (x < 0) {\n" +
+ " switch (x) {\n" +
+ "\n" +
+ " }\n" +
+ " } /* end while */\n" +
+ "\n" +
+ " // fill in output parameter\n" +
+ " if (x > 10)\n" +
+ " x = 1;\n" +
+ "\n" +
+ " // return the value\n" +
+ " return x;\n" +
+ " }\n" +
"}\n"
);
}
public void testBug293300_wksp2_08c() {
- String source =
- "package wksp2;\n" +
- "\n" +
- "public class X08 {\n" +
- "int foo(int x) {\n" +
- " while (x < 0) {\n" +
- " switch (x) {\n" +
- " \n" +
- " }\n" +
- " } /** end while */\n" +
- "\n" +
- " // fill in output parameter\n" +
- " if(x > 10)\n" +
- " x = 1;\n" +
- "\n" +
- " // return the value\n" +
- " return x;\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public class X08 {\n" +
- " int foo(int x) {\n" +
- " while (x < 0) {\n" +
- " switch (x) {\n" +
- "\n" +
- " }\n" +
- " } /** end while */\n" +
- "\n" +
- " // fill in output parameter\n" +
- " if (x > 10)\n" +
- " x = 1;\n" +
- "\n" +
- " // return the value\n" +
- " return x;\n" +
- " }\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public class X08 {\n" +
+ "int foo(int x) {\n" +
+ " while (x < 0) {\n" +
+ " switch (x) {\n" +
+ " \n" +
+ " }\n" +
+ " } /** end while */\n" +
+ "\n" +
+ " // fill in output parameter\n" +
+ " if(x > 10)\n" +
+ " x = 1;\n" +
+ "\n" +
+ " // return the value\n" +
+ " return x;\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp2;\n" +
+ "\n" +
+ "public class X08 {\n" +
+ " int foo(int x) {\n" +
+ " while (x < 0) {\n" +
+ " switch (x) {\n" +
+ "\n" +
+ " }\n" +
+ " } /** end while */\n" +
+ "\n" +
+ " // fill in output parameter\n" +
+ " if (x > 10)\n" +
+ " x = 1;\n" +
+ "\n" +
+ " // return the value\n" +
+ " return x;\n" +
+ " }\n" +
"}\n"
);
}
public void testBug293300_wksp2_09() {
- String source =
- "package wksp2;\n" +
- "\n" +
- "public class X09 {\n" +
- "void foo(int param) {\n" +
- " int local = param - 10000; // first comment\n" +
- " // on several lines\n" +
- " // following unrelated comment\n" +
- " // also on several lines\n" +
- " int value = param + 10000;\n" +
- "}\n" +
- "}\n";
- formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public class X09 {\n" +
- " void foo(int param) {\n" +
- " int local = param - 10000; // first comment\n" +
- " // on several lines\n" +
- " // following unrelated comment\n" +
- " // also on several lines\n" +
- " int value = param + 10000;\n" +
- " }\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public class X09 {\n" +
+ "void foo(int param) {\n" +
+ " int local = param - 10000; // first comment\n" +
+ " // on several lines\n" +
+ " // following unrelated comment\n" +
+ " // also on several lines\n" +
+ " int value = param + 10000;\n" +
+ "}\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp2;\n" +
+ "\n" +
+ "public class X09 {\n" +
+ " void foo(int param) {\n" +
+ " int local = param - 10000; // first comment\n" +
+ " // on several lines\n" +
+ " // following unrelated comment\n" +
+ " // also on several lines\n" +
+ " int value = param + 10000;\n" +
+ " }\n" +
"}\n"
);
}
public void testBug293300_wksp2_10() {
useOldCommentWidthCounting();
- String source =
- "package wksp2;\n" +
- "\n" +
- "public class X10 {\n" +
- "\n" +
- " private String field; // Trailing comment of the field\n" +
- " // This comment was not well formatted\n" +
- " // as an unexpected line was inserted after the first one\n" +
- "\n" +
- " // -------------------------------\n" +
- " X10() {}\n" +
- "}\n";
- formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public class X10 {\n" +
- "\n" +
- " private String field; // Trailing comment of the field\n" +
- " // This comment was not well formatted\n" +
- " // as an unexpected line was inserted after the\n" +
- " // first one\n" +
- "\n" +
- " // -------------------------------\n" +
- " X10() {\n" +
- " }\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public class X10 {\n" +
+ "\n" +
+ " private String field; // Trailing comment of the field\n" +
+ " // This comment was not well formatted\n" +
+ " // as an unexpected line was inserted after the first one\n" +
+ "\n" +
+ " // -------------------------------\n" +
+ " X10() {}\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp2;\n" +
+ "\n" +
+ "public class X10 {\n" +
+ "\n" +
+ " private String field; // Trailing comment of the field\n" +
+ " // This comment was not well formatted\n" +
+ " // as an unexpected line was inserted after the\n" +
+ " // first one\n" +
+ "\n" +
+ " // -------------------------------\n" +
+ " X10() {\n" +
+ " }\n" +
"}\n"
);
}
public void testBug293300_wksp2_11() {
setFormatLineCommentOnFirstColumn();
- String source =
- "package wksp2;\n" +
- "\n" +
- "public abstract class X11 {\n" +
- "\n" +
- " // [NEW] \n" +
- " /**\n" +
- " * Comment foo\n" +
- " */\n" +
- " public abstract StringBuffer foo();\n" +
- "//#if defined(TEST)\n" +
- "//#else\n" +
- "//#endif\n" +
- "\n" +
- " // [NEW]\n" +
- " /**\n" +
- " * Comment foo2\n" +
- " */\n" +
- " public abstract StringBuffer foo2();\n" +
- " // [NEW]\n" +
- " /**\n" +
- " * Comment foo3\n" +
- " */\n" +
- " public abstract StringBuffer foo3();\n" +
- "\n" +
- "}\n";
- formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public abstract class X11 {\n" +
- "\n" +
- " // [NEW]\n" +
- " /**\n" +
- " * Comment foo\n" +
- " */\n" +
- " public abstract StringBuffer foo();\n" +
- " // #if defined(TEST)\n" +
- " // #else\n" +
- " // #endif\n" +
- "\n" +
- " // [NEW]\n" +
- " /**\n" +
- " * Comment foo2\n" +
- " */\n" +
- " public abstract StringBuffer foo2();\n" +
- "\n" +
- " // [NEW]\n" +
- " /**\n" +
- " * Comment foo3\n" +
- " */\n" +
- " public abstract StringBuffer foo3();\n" +
- "\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public abstract class X11 {\n" +
+ "\n" +
+ " // [NEW] \n" +
+ " /**\n" +
+ " * Comment foo\n" +
+ " */\n" +
+ " public abstract StringBuffer foo();\n" +
+ "//#if defined(TEST)\n" +
+ "//#else\n" +
+ "//#endif\n" +
+ "\n" +
+ " // [NEW]\n" +
+ " /**\n" +
+ " * Comment foo2\n" +
+ " */\n" +
+ " public abstract StringBuffer foo2();\n" +
+ " // [NEW]\n" +
+ " /**\n" +
+ " * Comment foo3\n" +
+ " */\n" +
+ " public abstract StringBuffer foo3();\n" +
+ "\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp2;\n" +
+ "\n" +
+ "public abstract class X11 {\n" +
+ "\n" +
+ " // [NEW]\n" +
+ " /**\n" +
+ " * Comment foo\n" +
+ " */\n" +
+ " public abstract StringBuffer foo();\n" +
+ " // #if defined(TEST)\n" +
+ " // #else\n" +
+ " // #endif\n" +
+ "\n" +
+ " // [NEW]\n" +
+ " /**\n" +
+ " * Comment foo2\n" +
+ " */\n" +
+ " public abstract StringBuffer foo2();\n" +
+ "\n" +
+ " // [NEW]\n" +
+ " /**\n" +
+ " * Comment foo3\n" +
+ " */\n" +
+ " public abstract StringBuffer foo3();\n" +
+ "\n" +
"}\n"
);
}
public void testBug293300_wksp2_12a() {
useOldCommentWidthCounting();
- String source =
- "package wksp2;\n" +
- "\n" +
- "public class X12 {\n" +
- "\n" +
- "\n" +
- " private boolean sampleField = false; //trailing comment of the field which\n" +
- " //was wrongly formatted in previous\n" +
- " //version as an unexpected empty lines was\n" +
- " //inserted after the second comment line...\n" +
- "\n" +
- "\n" +
- " /**\n" +
- " Javadoc comment\n" +
- " */\n" +
- " public X12() {}\n" +
- "}\n";
- formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public class X12 {\n" +
- "\n" +
- " private boolean sampleField = false; // trailing comment of the field which\n" +
- " // was wrongly formatted in previous\n" +
- " // version as an unexpected empty\n" +
- " // lines was\n" +
- " // inserted after the second comment\n" +
- " // line...\n" +
- "\n" +
- " /**\n" +
- " * Javadoc comment\n" +
- " */\n" +
- " public X12() {\n" +
- " }\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public class X12 {\n" +
+ "\n" +
+ "\n" +
+ " private boolean sampleField = false; //trailing comment of the field which\n" +
+ " //was wrongly formatted in previous\n" +
+ " //version as an unexpected empty lines was\n" +
+ " //inserted after the second comment line...\n" +
+ "\n" +
+ "\n" +
+ " /**\n" +
+ " Javadoc comment\n" +
+ " */\n" +
+ " public X12() {}\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp2;\n" +
+ "\n" +
+ "public class X12 {\n" +
+ "\n" +
+ " private boolean sampleField = false; // trailing comment of the field which\n" +
+ " // was wrongly formatted in previous\n" +
+ " // version as an unexpected empty\n" +
+ " // lines was\n" +
+ " // inserted after the second comment\n" +
+ " // line...\n" +
+ "\n" +
+ " /**\n" +
+ " * Javadoc comment\n" +
+ " */\n" +
+ " public X12() {\n" +
+ " }\n" +
"}\n"
);
}
public void testBug293300_wksp2_12b() {
useOldCommentWidthCounting();
- String source =
- "package wksp2;\n" +
- "\n" +
- "public class X12 {\n" +
- "\n" +
- "\n" +
- " private boolean sampleField = false; //trailing comment of the field which\n" +
- " //was wrongly formatted in previous\n" +
- " //version as an unexpected empty lines was\n" +
- " //inserted after the second comment line...\n" +
- "\n" +
- "\n" +
- " /**\n" +
- " Javadoc comment\n" +
- " */\n" +
- " public X12() {}\n" +
- "}\n";
- formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public class X12 {\n" +
- "\n" +
- " private boolean sampleField = false; // trailing comment of the field which\n" +
- " // was wrongly formatted in previous\n" +
- " // version as an unexpected empty\n" +
- " // lines was\n" +
- " // inserted after the second comment\n" +
- " // line...\n" +
- "\n" +
- " /**\n" +
- " * Javadoc comment\n" +
- " */\n" +
- " public X12() {\n" +
- " }\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public class X12 {\n" +
+ "\n" +
+ "\n" +
+ " private boolean sampleField = false; //trailing comment of the field which\n" +
+ " //was wrongly formatted in previous\n" +
+ " //version as an unexpected empty lines was\n" +
+ " //inserted after the second comment line...\n" +
+ "\n" +
+ "\n" +
+ " /**\n" +
+ " Javadoc comment\n" +
+ " */\n" +
+ " public X12() {}\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp2;\n" +
+ "\n" +
+ "public class X12 {\n" +
+ "\n" +
+ " private boolean sampleField = false; // trailing comment of the field which\n" +
+ " // was wrongly formatted in previous\n" +
+ " // version as an unexpected empty\n" +
+ " // lines was\n" +
+ " // inserted after the second comment\n" +
+ " // line...\n" +
+ "\n" +
+ " /**\n" +
+ " * Javadoc comment\n" +
+ " */\n" +
+ " public X12() {\n" +
+ " }\n" +
"}\n"
);
}
public void testBug293300_wksp2_13() {
useOldCommentWidthCounting();
setFormatLineCommentOnFirstColumn();
- String source =
- "package wksp2;\n" +
- "\n" +
- "public class X13 {\n" +
- "void foo(int x) {\n" +
- " switch (x) {\n" +
- " default : // regular object ref\n" +
- "// if (compileTimeType.isRawType() && runtimeTimeType.isBoundParameterizedType()) {\n" +
- "// scope.problemReporter().unsafeRawExpression(this, compileTimeType, runtimeTimeType);\n" +
- "// }\n" +
- " }\n" +
- "}\n" +
- "}\n";
- formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public class X13 {\n" +
- " void foo(int x) {\n" +
- " switch (x) {\n" +
- " default: // regular object ref\n" +
- " // if (compileTimeType.isRawType() &&\n" +
- " // runtimeTimeType.isBoundParameterizedType()) {\n" +
- " // scope.problemReporter().unsafeRawExpression(this,\n" +
- " // compileTimeType, runtimeTimeType);\n" +
- " // }\n" +
- " }\n" +
- " }\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public class X13 {\n" +
+ "void foo(int x) {\n" +
+ " switch (x) {\n" +
+ " default : // regular object ref\n" +
+ "// if (compileTimeType.isRawType() && runtimeTimeType.isBoundParameterizedType()) {\n" +
+ "// scope.problemReporter().unsafeRawExpression(this, compileTimeType, runtimeTimeType);\n" +
+ "// }\n" +
+ " }\n" +
+ "}\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp2;\n" +
+ "\n" +
+ "public class X13 {\n" +
+ " void foo(int x) {\n" +
+ " switch (x) {\n" +
+ " default: // regular object ref\n" +
+ " // if (compileTimeType.isRawType() &&\n" +
+ " // runtimeTimeType.isBoundParameterizedType()) {\n" +
+ " // scope.problemReporter().unsafeRawExpression(this,\n" +
+ " // compileTimeType, runtimeTimeType);\n" +
+ " // }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
public void testBug293300_wksp2_14() {
setFormatLineCommentOnFirstColumn();
- String source =
- "package wksp2;\n" +
- "\n" +
- "public interface X14 {\n" +
- "void foo();\n" +
- "// line 1\n" +
- "// line 2\n" +
- "void bar();\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public interface X14 {\n" +
+ "void foo();\n" +
+ "// line 1\n" +
+ "// line 2\n" +
+ "void bar();\n" +
"}\n";
formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public interface X14 {\n" +
- " void foo();\n" +
- "\n" +
- " // line 1\n" +
- " // line 2\n" +
- " void bar();\n" +
+ "package wksp2;\n" +
+ "\n" +
+ "public interface X14 {\n" +
+ " void foo();\n" +
+ "\n" +
+ " // line 1\n" +
+ " // line 2\n" +
+ " void bar();\n" +
"}\n"
);
}
// TODO (frederic) try to fix the formatter instability in the following test case
public void _testBug293300_wksp2_15a() {
- String source =
- "package wksp2;\n" +
- "\n" +
- "public class X15 {\n" +
- " void foo(int[] params) {\n" +
- " if (params.length > 0) { // trailing comment formatted in several lines...\n" +
- "// int length = params == null ? : 0 params.length; // this commented lined causes troubles for the formatter but only if the comment starts at column 1...\n" +
- " for (int i=0; i<params.length; i++) {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "\n" +
- "public class X15 {\n" +
- " void foo(int[] params) {\n" +
- " if (params.length > 0) { // trailing comment formatted in several\n" +
- " // lines...\n" +
- " // int length = params == null ? : 0 params.length; // this\n" +
- " // commented\n" +
- " // lined causes troubles for the formatter but only if the comment\n" +
- " // starts at column 1...\n" +
- " for (int i = 0; i < params.length; i++) {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public class X15 {\n" +
+ " void foo(int[] params) {\n" +
+ " if (params.length > 0) { // trailing comment formatted in several lines...\n" +
+ "// int length = params == null ? : 0 params.length; // this commented lined causes troubles for the formatter but only if the comment starts at column 1...\n" +
+ " for (int i=0; i<params.length; i++) {\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "\n" +
+ "public class X15 {\n" +
+ " void foo(int[] params) {\n" +
+ " if (params.length > 0) { // trailing comment formatted in several\n" +
+ " // lines...\n" +
+ " // int length = params == null ? : 0 params.length; // this\n" +
+ " // commented\n" +
+ " // lined causes troubles for the formatter but only if the comment\n" +
+ " // starts at column 1...\n" +
+ " for (int i = 0; i < params.length; i++) {\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
public void testBug293300_wksp2_15b() {
useOldCommentWidthCounting();
- String source =
- "package wksp2;\n" +
- "\n" +
- "public class X15 {\n" +
- " void foo(int[] params) {\n" +
- " if (params.length > 0) { // trailing comment formatted in several lines...\n" +
- " // int length = params == null ? : 0 params.length; // this commented lined does not cause troubles for the formatter when the comments is not on column 1...\n" +
- " for (int i=0; i<params.length; i++) {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public class X15 {\n" +
- " void foo(int[] params) {\n" +
- " if (params.length > 0) { // trailing comment formatted in several\n" +
- " // lines...\n" +
- " // int length = params == null ? : 0 params.length; // this\n" +
- " // commented lined does not cause troubles for the formatter when\n" +
- " // the comments is not on column 1...\n" +
- " for (int i = 0; i < params.length; i++) {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public class X15 {\n" +
+ " void foo(int[] params) {\n" +
+ " if (params.length > 0) { // trailing comment formatted in several lines...\n" +
+ " // int length = params == null ? : 0 params.length; // this commented lined does not cause troubles for the formatter when the comments is not on column 1...\n" +
+ " for (int i=0; i<params.length; i++) {\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp2;\n" +
+ "\n" +
+ "public class X15 {\n" +
+ " void foo(int[] params) {\n" +
+ " if (params.length > 0) { // trailing comment formatted in several\n" +
+ " // lines...\n" +
+ " // int length = params == null ? : 0 params.length; // this\n" +
+ " // commented lined does not cause troubles for the formatter when\n" +
+ " // the comments is not on column 1...\n" +
+ " for (int i = 0; i < params.length; i++) {\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
public void testBug293300_wksp3_01() {
setFormatLineCommentOnFirstColumn();
- String source =
- "package wksp3;\n" +
- "\n" +
- "public class X01 {\n" +
- "static String[] constant = {\n" +
- "// comment\n" +
- "\"first\",\n" +
- "// comment\n" +
- "\"second\",\n" +
- "};\n" +
+ String source =
+ "package wksp3;\n" +
+ "\n" +
+ "public class X01 {\n" +
+ "static String[] constant = {\n" +
+ "// comment\n" +
+ "\"first\",\n" +
+ "// comment\n" +
+ "\"second\",\n" +
+ "};\n" +
"}\n";
formatSource(source,
- "package wksp3;\n" +
- "\n" +
- "public class X01 {\n" +
- " static String[] constant = {\n" +
- " // comment\n" +
- " \"first\",\n" +
- " // comment\n" +
- " \"second\", };\n" +
+ "package wksp3;\n" +
+ "\n" +
+ "public class X01 {\n" +
+ " static String[] constant = {\n" +
+ " // comment\n" +
+ " \"first\",\n" +
+ " // comment\n" +
+ " \"second\", };\n" +
"}\n"
);
}
@@ -4751,69 +4751,69 @@ public void testBug293496() {
*/
public void testBug294500a() {
String source =
- "package wkps3;\n" +
- "/**\n" +
- " * This sample produce an MalformedTreeException\n" +
- " * when formatted.\n" +
- " *\n" +
- " * <p> First paragraph\n" +
- " * {@link java.lang.String </code>a simple\n" +
- " * string<code>}.\n" +
- " *\n" +
- " * <p> Second paragraph.\n" +
- " *\n" +
- " * <p> Third paragraph. </p>\n" +
- " *\n" +
- " */\n" +
- "public class X01 {\n" +
- "\n" +
- "}\n";
- formatSource(source,
- "package wkps3;\n" +
- "\n" +
- "/**\n" +
- " * This sample produce an MalformedTreeException when formatted.\n" +
- " *\n" +
- " * <p>\n" +
- " * First paragraph {@link java.lang.String </code>a simple string<code>}.\n" +
- " *\n" +
- " * <p>\n" +
- " * Second paragraph.\n" +
- " *\n" +
- " * <p>\n" +
- " * Third paragraph.\n" +
- " * </p>\n" +
- " *\n" +
- " */\n" +
- "public class X01 {\n" +
- "\n" +
+ "package wkps3;\n" +
+ "/**\n" +
+ " * This sample produce an MalformedTreeException\n" +
+ " * when formatted.\n" +
+ " *\n" +
+ " * <p> First paragraph\n" +
+ " * {@link java.lang.String </code>a simple\n" +
+ " * string<code>}.\n" +
+ " *\n" +
+ " * <p> Second paragraph.\n" +
+ " *\n" +
+ " * <p> Third paragraph. </p>\n" +
+ " *\n" +
+ " */\n" +
+ "public class X01 {\n" +
+ "\n" +
+ "}\n";
+ formatSource(source,
+ "package wkps3;\n" +
+ "\n" +
+ "/**\n" +
+ " * This sample produce an MalformedTreeException when formatted.\n" +
+ " *\n" +
+ " * <p>\n" +
+ " * First paragraph {@link java.lang.String </code>a simple string<code>}.\n" +
+ " *\n" +
+ " * <p>\n" +
+ " * Second paragraph.\n" +
+ " *\n" +
+ " * <p>\n" +
+ " * Third paragraph.\n" +
+ " * </p>\n" +
+ " *\n" +
+ " */\n" +
+ "public class X01 {\n" +
+ "\n" +
"}\n"
);
}
public void testBug294500b() {
String source =
- "package wkps3;\n" +
- "/**\n" +
- " * This sample produce an AIIOBE when formatting.\n" +
- " *\n" +
- " * <p> First paragraph\n" +
- " * {@link java.lang.String </code>a simple\n" +
- " * string<code>}.\n" +
- " */\n" +
- "public class X02 {\n" +
- "\n" +
+ "package wkps3;\n" +
+ "/**\n" +
+ " * This sample produce an AIIOBE when formatting.\n" +
+ " *\n" +
+ " * <p> First paragraph\n" +
+ " * {@link java.lang.String </code>a simple\n" +
+ " * string<code>}.\n" +
+ " */\n" +
+ "public class X02 {\n" +
+ "\n" +
"}\n";
formatSource(source,
- "package wkps3;\n" +
- "\n" +
- "/**\n" +
- " * This sample produce an AIIOBE when formatting.\n" +
- " *\n" +
- " * <p>\n" +
- " * First paragraph {@link java.lang.String </code>a simple string<code>}.\n" +
- " */\n" +
- "public class X02 {\n" +
- "\n" +
+ "package wkps3;\n" +
+ "\n" +
+ "/**\n" +
+ " * This sample produce an AIIOBE when formatting.\n" +
+ " *\n" +
+ " * <p>\n" +
+ " * First paragraph {@link java.lang.String </code>a simple string<code>}.\n" +
+ " */\n" +
+ "public class X02 {\n" +
+ "\n" +
"}\n"
);
}
@@ -4825,114 +4825,114 @@ public void testBug294500b() {
*/
public void testBug294618a() {
String source =
- "package wkps3;\n" +
- "\n" +
- "/**\n" +
- " * The formatter was not able to format the current comment:\n" +
- " * \n" +
- " * <ol>\n" +
- " * <li><p> First item\n" +
- " *\n" +
- " * <li><p> Second item\n" +
- " *\n" +
- " * <li><p> First paragraph of third item\n" +
- " *\n" +
- " * <p> Second paragraph of third item\n" +
- " *\n" +
- " * <blockquote><table cellpadding=0 cellspacing=0 summary=\"layout\">\n" +
- " * <tr><td><tt>::255.255.0.d</tt><td></tr>\n" +
- " * </table></blockquote>\n" +
- " * </li>\n" +
- " * </ol>\n" +
- " */\n" +
- "public class X01 {\n" +
- "\n" +
- "}\n";
- formatSource(source,
- "package wkps3;\n" +
- "\n" +
- "/**\n" +
- " * The formatter was not able to format the current comment:\n" +
- " * \n" +
- " * <ol>\n" +
- " * <li>\n" +
- " * <p>\n" +
- " * First item\n" +
- " *\n" +
- " * <li>\n" +
- " * <p>\n" +
- " * Second item\n" +
- " *\n" +
- " * <li>\n" +
- " * <p>\n" +
- " * First paragraph of third item\n" +
- " *\n" +
- " * <p>\n" +
- " * Second paragraph of third item\n" +
- " *\n" +
- " * <blockquote>\n" +
- " * <table cellpadding=0 cellspacing=0 summary=\"layout\">\n" +
- " * <tr>\n" +
- " * <td><tt>::255.255.0.d</tt>\n" +
- " * <td>\n" +
- " * </tr>\n" +
- " * </table>\n" +
- " * </blockquote></li>\n" +
- " * </ol>\n" +
- " */\n" +
- "public class X01 {\n" +
- "\n" +
+ "package wkps3;\n" +
+ "\n" +
+ "/**\n" +
+ " * The formatter was not able to format the current comment:\n" +
+ " * \n" +
+ " * <ol>\n" +
+ " * <li><p> First item\n" +
+ " *\n" +
+ " * <li><p> Second item\n" +
+ " *\n" +
+ " * <li><p> First paragraph of third item\n" +
+ " *\n" +
+ " * <p> Second paragraph of third item\n" +
+ " *\n" +
+ " * <blockquote><table cellpadding=0 cellspacing=0 summary=\"layout\">\n" +
+ " * <tr><td><tt>::255.255.0.d</tt><td></tr>\n" +
+ " * </table></blockquote>\n" +
+ " * </li>\n" +
+ " * </ol>\n" +
+ " */\n" +
+ "public class X01 {\n" +
+ "\n" +
+ "}\n";
+ formatSource(source,
+ "package wkps3;\n" +
+ "\n" +
+ "/**\n" +
+ " * The formatter was not able to format the current comment:\n" +
+ " * \n" +
+ " * <ol>\n" +
+ " * <li>\n" +
+ " * <p>\n" +
+ " * First item\n" +
+ " *\n" +
+ " * <li>\n" +
+ " * <p>\n" +
+ " * Second item\n" +
+ " *\n" +
+ " * <li>\n" +
+ " * <p>\n" +
+ " * First paragraph of third item\n" +
+ " *\n" +
+ " * <p>\n" +
+ " * Second paragraph of third item\n" +
+ " *\n" +
+ " * <blockquote>\n" +
+ " * <table cellpadding=0 cellspacing=0 summary=\"layout\">\n" +
+ " * <tr>\n" +
+ " * <td><tt>::255.255.0.d</tt>\n" +
+ " * <td>\n" +
+ " * </tr>\n" +
+ " * </table>\n" +
+ " * </blockquote></li>\n" +
+ " * </ol>\n" +
+ " */\n" +
+ "public class X01 {\n" +
+ "\n" +
"}\n"
);
}
public void testBug294618b() {
String source =
- "/**\n" +
- " * Verify deep html tag nesting:\n" +
- " * \n" +
- " * <ol>\n" +
- " * <li><p> First item\n" +
- " * <li><p> Second item\n" +
- " * <ul>\n" +
- " * <li><p> First item of second item\n" +
- " * <blockquote><table cellpadding=0 cellspacing=0 summary=\"layout\">\n" +
- " * <tr><td><tt><i><b>::255.255.0.d</b></i></tt></td></tr>\n" +
- " * </table></blockquote>\n" +
- " * </li>\n" +
- " * </ul>\n" +
- " * </li>\n" +
- " * </ol>\n" +
- " */\n" +
- "public class X02 {\n" +
- "\n" +
- "}\n";
- formatSource(source,
- "/**\n" +
- " * Verify deep html tag nesting:\n" +
- " * \n" +
- " * <ol>\n" +
- " * <li>\n" +
- " * <p>\n" +
- " * First item\n" +
- " * <li>\n" +
- " * <p>\n" +
- " * Second item\n" +
- " * <ul>\n" +
- " * <li>\n" +
- " * <p>\n" +
- " * First item of second item <blockquote>\n" +
- " * <table cellpadding=0 cellspacing=0 summary=\"layout\">\n" +
- " * <tr>\n" +
- " * <td><tt><i><b>::255.255.0.d</b></i></tt></td>\n" +
- " * </tr>\n" +
- " * </table>\n" +
- " * </blockquote></li>\n" +
- " * </ul>\n" +
- " * </li>\n" +
- " * </ol>\n" +
- " */\n" +
- "public class X02 {\n" +
- "\n" +
+ "/**\n" +
+ " * Verify deep html tag nesting:\n" +
+ " * \n" +
+ " * <ol>\n" +
+ " * <li><p> First item\n" +
+ " * <li><p> Second item\n" +
+ " * <ul>\n" +
+ " * <li><p> First item of second item\n" +
+ " * <blockquote><table cellpadding=0 cellspacing=0 summary=\"layout\">\n" +
+ " * <tr><td><tt><i><b>::255.255.0.d</b></i></tt></td></tr>\n" +
+ " * </table></blockquote>\n" +
+ " * </li>\n" +
+ " * </ul>\n" +
+ " * </li>\n" +
+ " * </ol>\n" +
+ " */\n" +
+ "public class X02 {\n" +
+ "\n" +
+ "}\n";
+ formatSource(source,
+ "/**\n" +
+ " * Verify deep html tag nesting:\n" +
+ " * \n" +
+ " * <ol>\n" +
+ " * <li>\n" +
+ " * <p>\n" +
+ " * First item\n" +
+ " * <li>\n" +
+ " * <p>\n" +
+ " * Second item\n" +
+ " * <ul>\n" +
+ " * <li>\n" +
+ " * <p>\n" +
+ " * First item of second item <blockquote>\n" +
+ " * <table cellpadding=0 cellspacing=0 summary=\"layout\">\n" +
+ " * <tr>\n" +
+ " * <td><tt><i><b>::255.255.0.d</b></i></tt></td>\n" +
+ " * </tr>\n" +
+ " * </table>\n" +
+ " * </blockquote></li>\n" +
+ " * </ul>\n" +
+ " * </li>\n" +
+ " * </ol>\n" +
+ " */\n" +
+ "public class X02 {\n" +
+ "\n" +
"}\n"
);
}
@@ -4944,33 +4944,33 @@ public void testBug294618b() {
*/
public void testBug294631() {
String source =
- "package wkps3;\n" +
- "\n" +
- "/**\n" +
- " * This comment makes the formatter unstable:\n" +
- " * \n" +
- " * <ol>\n" +
- " * <li><p> first line\n" +
- " * second line</li>\n" +
- " * </ol>\n" +
- " */\n" +
- "public class X {\n" +
- "\n" +
- "}\n";
- formatSource(source,
- "package wkps3;\n" +
- "\n" +
- "/**\n" +
- " * This comment makes the formatter unstable:\n" +
- " * \n" +
- " * <ol>\n" +
- " * <li>\n" +
- " * <p>\n" +
- " * first line second line</li>\n" +
- " * </ol>\n" +
- " */\n" +
- "public class X {\n" +
- "\n" +
+ "package wkps3;\n" +
+ "\n" +
+ "/**\n" +
+ " * This comment makes the formatter unstable:\n" +
+ " * \n" +
+ " * <ol>\n" +
+ " * <li><p> first line\n" +
+ " * second line</li>\n" +
+ " * </ol>\n" +
+ " */\n" +
+ "public class X {\n" +
+ "\n" +
+ "}\n";
+ formatSource(source,
+ "package wkps3;\n" +
+ "\n" +
+ "/**\n" +
+ " * This comment makes the formatter unstable:\n" +
+ " * \n" +
+ " * <ol>\n" +
+ " * <li>\n" +
+ " * <p>\n" +
+ " * first line second line</li>\n" +
+ " * </ol>\n" +
+ " */\n" +
+ "public class X {\n" +
+ "\n" +
"}\n"
);
}
@@ -4981,175 +4981,175 @@ public void testBug294631() {
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=295175"
*/
public void testBug295175a() {
- String source =
- "public class X {\n" +
- "/**\n" +
- " * <p>\n" +
- " * \"String\", this string may be not well formatted in certain circumstances,\n" +
- " * typically after bug 294529 has been fixed...\n" +
- " */\n" +
- "void foo() {}\n" +
+ String source =
+ "public class X {\n" +
+ "/**\n" +
+ " * <p>\n" +
+ " * \"String\", this string may be not well formatted in certain circumstances,\n" +
+ " * typically after bug 294529 has been fixed...\n" +
+ " */\n" +
+ "void foo() {}\n" +
"}\n";
formatSource(source,
- "public class X {\n" +
- " /**\n" +
- " * <p>\n" +
- " * \"String\", this string may be not well formatted in certain circumstances,\n" +
- " * typically after bug 294529 has been fixed...\n" +
- " */\n" +
- " void foo() {\n" +
- " }\n" +
+ "public class X {\n" +
+ " /**\n" +
+ " * <p>\n" +
+ " * \"String\", this string may be not well formatted in certain circumstances,\n" +
+ " * typically after bug 294529 has been fixed...\n" +
+ " */\n" +
+ " void foo() {\n" +
+ " }\n" +
"}\n"
);
}
public void testBug295175b() {
- String source =
- "package wksp2;\n" +
- "\n" +
- "public interface X {\n" +
- "\n" +
- " /**\n" +
- " * <P>\n" +
- " * <BR>\n" +
- " *<B>NOTE</B><BR>\n" +
- " * Formatter can miss a space before the previous B tag...\n" +
- " **/\n" +
- " void foo();\n" +
- "}\n";
- formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public interface X {\n" +
- "\n" +
- " /**\n" +
- " * <P>\n" +
- " * <BR>\n" +
- " * <B>NOTE</B><BR>\n" +
- " * Formatter can miss a space before the previous B tag...\n" +
- " **/\n" +
- " void foo();\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public interface X {\n" +
+ "\n" +
+ " /**\n" +
+ " * <P>\n" +
+ " * <BR>\n" +
+ " *<B>NOTE</B><BR>\n" +
+ " * Formatter can miss a space before the previous B tag...\n" +
+ " **/\n" +
+ " void foo();\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp2;\n" +
+ "\n" +
+ "public interface X {\n" +
+ "\n" +
+ " /**\n" +
+ " * <P>\n" +
+ " * <BR>\n" +
+ " * <B>NOTE</B><BR>\n" +
+ " * Formatter can miss a space before the previous B tag...\n" +
+ " **/\n" +
+ " void foo();\n" +
"}\n"
);
}
public void testBug295175c() {
- String source =
- "package wksp2;\n" +
- "\n" +
- "public interface X {\n" +
- "\n" +
- " /**\n" +
- " * <P>Following p tag can miss a space before after formatting\n" +
- " *<p>\n" +
- " * end of comment.\n" +
- " **/\n" +
- " void foo();\n" +
- "}\n";
- formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public interface X {\n" +
- "\n" +
- " /**\n" +
- " * <P>\n" +
- " * Following p tag can miss a space before after formatting\n" +
- " * <p>\n" +
- " * end of comment.\n" +
- " **/\n" +
- " void foo();\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public interface X {\n" +
+ "\n" +
+ " /**\n" +
+ " * <P>Following p tag can miss a space before after formatting\n" +
+ " *<p>\n" +
+ " * end of comment.\n" +
+ " **/\n" +
+ " void foo();\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp2;\n" +
+ "\n" +
+ "public interface X {\n" +
+ "\n" +
+ " /**\n" +
+ " * <P>\n" +
+ " * Following p tag can miss a space before after formatting\n" +
+ " * <p>\n" +
+ " * end of comment.\n" +
+ " **/\n" +
+ " void foo();\n" +
"}\n"
);
}
public void testBug295175d() {
- String source =
- "package wksp2;\n" +
- "\n" +
- "public interface X {\n" +
- "\n" +
- " /**\n" +
- " * <p>Following p tag can miss a space before after formatting\n" +
- " *\n" +
- " *<p>\n" +
- " * <BR>\n" +
- " *<B>NOTE</B><BR>\n" +
- " * Formatter can miss a space before the previous B tag...\n" +
- " **/\n" +
- " void foo();\n" +
- "}\n";
- formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public interface X {\n" +
- "\n" +
- " /**\n" +
- " * <p>\n" +
- " * Following p tag can miss a space before after formatting\n" +
- " *\n" +
- " * <p>\n" +
- " * <BR>\n" +
- " * <B>NOTE</B><BR>\n" +
- " * Formatter can miss a space before the previous B tag...\n" +
- " **/\n" +
- " void foo();\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public interface X {\n" +
+ "\n" +
+ " /**\n" +
+ " * <p>Following p tag can miss a space before after formatting\n" +
+ " *\n" +
+ " *<p>\n" +
+ " * <BR>\n" +
+ " *<B>NOTE</B><BR>\n" +
+ " * Formatter can miss a space before the previous B tag...\n" +
+ " **/\n" +
+ " void foo();\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp2;\n" +
+ "\n" +
+ "public interface X {\n" +
+ "\n" +
+ " /**\n" +
+ " * <p>\n" +
+ " * Following p tag can miss a space before after formatting\n" +
+ " *\n" +
+ " * <p>\n" +
+ " * <BR>\n" +
+ " * <B>NOTE</B><BR>\n" +
+ " * Formatter can miss a space before the previous B tag...\n" +
+ " **/\n" +
+ " void foo();\n" +
"}\n"
);
}
public void testBug295175e() {
useOldCommentWidthCounting();
- String source =
- "package wksp3;\n" +
- "\n" +
- "public class X01 {\n" +
- " /** \n" +
- " * In this peculiar config <code>true</code>, the comment is not___ \n" +
- " * really well formatted. The problem is that the first_ code tag\n" +
- " * here_______ <code>/*</code> and <code>*&#47;</code> go at the end of the previous line\n" +
- " * instead of staying on the 3rd one... \n" +
- " */\n" +
- " void foo() {}\n" +
- "}\n";
- formatSource(source,
- "package wksp3;\n" +
- "\n" +
- "public class X01 {\n" +
- " /**\n" +
- " * In this peculiar config <code>true</code>, the comment is not___ really\n" +
- " * well formatted. The problem is that the first_ code tag here_______\n" +
- " * <code>/*</code> and <code>*&#47;</code> go at the end of the previous\n" +
- " * line instead of staying on the 3rd one...\n" +
- " */\n" +
- " void foo() {\n" +
- " }\n" +
+ String source =
+ "package wksp3;\n" +
+ "\n" +
+ "public class X01 {\n" +
+ " /** \n" +
+ " * In this peculiar config <code>true</code>, the comment is not___ \n" +
+ " * really well formatted. The problem is that the first_ code tag\n" +
+ " * here_______ <code>/*</code> and <code>*&#47;</code> go at the end of the previous line\n" +
+ " * instead of staying on the 3rd one... \n" +
+ " */\n" +
+ " void foo() {}\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp3;\n" +
+ "\n" +
+ "public class X01 {\n" +
+ " /**\n" +
+ " * In this peculiar config <code>true</code>, the comment is not___ really\n" +
+ " * well formatted. The problem is that the first_ code tag here_______\n" +
+ " * <code>/*</code> and <code>*&#47;</code> go at the end of the previous\n" +
+ " * line instead of staying on the 3rd one...\n" +
+ " */\n" +
+ " void foo() {\n" +
+ " }\n" +
"}\n"
);
}
public void testBug295175f() {
useOldCommentWidthCounting();
- String source =
- "package wksp1;\n" +
- "\n" +
- "public class X01 {\n" +
- "\n" +
- " /**\n" +
- " * Finds the deepest <code>IJavaElement</code> in the hierarchy of\n" +
- " * <code>elt</elt>'s children (including <code>elt</code> itself)\n" +
- " * which has a source range that encloses <code>position</code>\n" +
- " * according to <code>mapper</code>.\n" +
- " */\n" +
- " void foo() {}\n" +
- "}\n";
- formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X01 {\n" +
- "\n" +
- " /**\n" +
- " * Finds the deepest <code>IJavaElement</code> in the hierarchy of\n" +
- " * <code>elt</elt>\'s children (including <code>elt</code> itself) which has\n" +
- " * a source range that encloses <code>position</code> according to\n" +
- " * <code>mapper</code>.\n" +
- " */\n" +
- " void foo() {\n" +
- " }\n" +
+ String source =
+ "package wksp1;\n" +
+ "\n" +
+ "public class X01 {\n" +
+ "\n" +
+ " /**\n" +
+ " * Finds the deepest <code>IJavaElement</code> in the hierarchy of\n" +
+ " * <code>elt</elt>'s children (including <code>elt</code> itself)\n" +
+ " * which has a source range that encloses <code>position</code>\n" +
+ " * according to <code>mapper</code>.\n" +
+ " */\n" +
+ " void foo() {}\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp1;\n" +
+ "\n" +
+ "public class X01 {\n" +
+ "\n" +
+ " /**\n" +
+ " * Finds the deepest <code>IJavaElement</code> in the hierarchy of\n" +
+ " * <code>elt</elt>\'s children (including <code>elt</code> itself) which has\n" +
+ " * a source range that encloses <code>position</code> according to\n" +
+ " * <code>mapper</code>.\n" +
+ " */\n" +
+ " void foo() {\n" +
+ " }\n" +
"}\n"
);
}
@@ -5163,36 +5163,36 @@ public void testBug295175f() {
public void testBug295238() {
useOldCommentWidthCounting();
this.formatterPrefs.join_lines_in_comments = false;
- String source =
- "package wksp1;\n" +
- "\n" +
- "public interface X03 {\n" +
- " \n" +
- " class Inner {\n" +
- " \n" +
- " /* (non-Javadoc)\n" +
- " * @see org.eclipse.jface.text.TextViewer#customizeDocumentCommand(org.eclipse.jface.text.DocumentCommand)\n" +
- " */\n" +
- " protected void foo() {\n" +
- " }\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public interface X03 {\n" +
- "\n" +
- " class Inner {\n" +
- "\n" +
- " /*\n" +
- " * (non-Javadoc)\n" +
- " * \n" +
- " * @see org.eclipse.jface.text.TextViewer#customizeDocumentCommand(org.\n" +
- " * eclipse.jface.text.DocumentCommand)\n" +
- " */\n" +
- " protected void foo() {\n" +
- " }\n" +
- " }\n" +
+ String source =
+ "package wksp1;\n" +
+ "\n" +
+ "public interface X03 {\n" +
+ " \n" +
+ " class Inner {\n" +
+ " \n" +
+ " /* (non-Javadoc)\n" +
+ " * @see org.eclipse.jface.text.TextViewer#customizeDocumentCommand(org.eclipse.jface.text.DocumentCommand)\n" +
+ " */\n" +
+ " protected void foo() {\n" +
+ " }\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp1;\n" +
+ "\n" +
+ "public interface X03 {\n" +
+ "\n" +
+ " class Inner {\n" +
+ "\n" +
+ " /*\n" +
+ " * (non-Javadoc)\n" +
+ " * \n" +
+ " * @see org.eclipse.jface.text.TextViewer#customizeDocumentCommand(org.\n" +
+ " * eclipse.jface.text.DocumentCommand)\n" +
+ " */\n" +
+ " protected void foo() {\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -5200,33 +5200,33 @@ public void testBug295238() {
public void testBug295238b1() {
useOldCommentWidthCounting();
this.formatterPrefs.join_lines_in_comments = false;
- String source =
- "package wksp1;\n" +
- "\n" +
- "public class X02 {\n" +
- "\n" +
- " void foo() {\n" +
- "/* if ((operatorSignature & CompareMASK) == (alternateOperatorSignature & CompareMASK)) { // same promotions and result\n" +
- " scope.problemReporter().unnecessaryCastForArgument((CastExpression)expression, TypeBinding.wellKnownType(scope, expression.implicitConversion >> 4)); \n" +
- " }\n" +
- "*/ \n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X02 {\n" +
- "\n" +
- " void foo() {\n" +
- " /*\n" +
- " * if ((operatorSignature & CompareMASK) == (alternateOperatorSignature\n" +
- " * & CompareMASK)) { // same promotions and result\n" +
- " * scope.problemReporter().unnecessaryCastForArgument((CastExpression)\n" +
- " * expression, TypeBinding.wellKnownType(scope,\n" +
- " * expression.implicitConversion >> 4));\n" +
- " * }\n" +
- " */\n" +
- " }\n" +
+ String source =
+ "package wksp1;\n" +
+ "\n" +
+ "public class X02 {\n" +
+ "\n" +
+ " void foo() {\n" +
+ "/* if ((operatorSignature & CompareMASK) == (alternateOperatorSignature & CompareMASK)) { // same promotions and result\n" +
+ " scope.problemReporter().unnecessaryCastForArgument((CastExpression)expression, TypeBinding.wellKnownType(scope, expression.implicitConversion >> 4)); \n" +
+ " }\n" +
+ "*/ \n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp1;\n" +
+ "\n" +
+ "public class X02 {\n" +
+ "\n" +
+ " void foo() {\n" +
+ " /*\n" +
+ " * if ((operatorSignature & CompareMASK) == (alternateOperatorSignature\n" +
+ " * & CompareMASK)) { // same promotions and result\n" +
+ " * scope.problemReporter().unnecessaryCastForArgument((CastExpression)\n" +
+ " * expression, TypeBinding.wellKnownType(scope,\n" +
+ " * expression.implicitConversion >> 4));\n" +
+ " * }\n" +
+ " */\n" +
+ " }\n" +
"}\n"
);
}
@@ -5234,28 +5234,28 @@ public void testBug295238b1() {
public void testBug295238b2() {
useOldCommentWidthCounting();
this.formatterPrefs.join_lines_in_comments = false;
- String source =
- "package wksp1;\n" +
- "\n" +
- "public class X02 {\n" +
- "\n" +
- " void foo() {\n" +
- "/* scope.problemReporter().unnecessaryCastForArgument((CastExpression)expression, TypeBinding.wellKnownType(scope, expression.implicitConversion >> 4)); \n" +
- "*/ \n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X02 {\n" +
- "\n" +
- " void foo() {\n" +
- " /*\n" +
- " * scope.problemReporter().unnecessaryCastForArgument((CastExpression)\n" +
- " * expression, TypeBinding.wellKnownType(scope,\n" +
- " * expression.implicitConversion >> 4));\n" +
- " */\n" +
- " }\n" +
+ String source =
+ "package wksp1;\n" +
+ "\n" +
+ "public class X02 {\n" +
+ "\n" +
+ " void foo() {\n" +
+ "/* scope.problemReporter().unnecessaryCastForArgument((CastExpression)expression, TypeBinding.wellKnownType(scope, expression.implicitConversion >> 4)); \n" +
+ "*/ \n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp1;\n" +
+ "\n" +
+ "public class X02 {\n" +
+ "\n" +
+ " void foo() {\n" +
+ " /*\n" +
+ " * scope.problemReporter().unnecessaryCastForArgument((CastExpression)\n" +
+ " * expression, TypeBinding.wellKnownType(scope,\n" +
+ " * expression.implicitConversion >> 4));\n" +
+ " */\n" +
+ " }\n" +
"}\n"
);
}
@@ -5263,357 +5263,357 @@ public void testBug295238b2() {
public void testBug295238b3() {
useOldCommentWidthCounting();
this.formatterPrefs.join_lines_in_comments = false;
- String source =
- "package wksp1;\n" +
- "\n" +
- "public class X02 {\n" +
- "\n" +
- " void foo() {\n" +
- "/*\n" +
- " scope.problemReporter().unnecessaryCastForArgument((CastExpression)expression, TypeBinding.wellKnownType(scope, expression.implicitConversion >> 4)); \n" +
- "*/ \n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X02 {\n" +
- "\n" +
- " void foo() {\n" +
- " /*\n" +
- " * scope.problemReporter().unnecessaryCastForArgument((CastExpression)\n" +
- " * expression, TypeBinding.wellKnownType(scope,\n" +
- " * expression.implicitConversion >> 4));\n" +
- " */\n" +
- " }\n" +
+ String source =
+ "package wksp1;\n" +
+ "\n" +
+ "public class X02 {\n" +
+ "\n" +
+ " void foo() {\n" +
+ "/*\n" +
+ " scope.problemReporter().unnecessaryCastForArgument((CastExpression)expression, TypeBinding.wellKnownType(scope, expression.implicitConversion >> 4)); \n" +
+ "*/ \n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp1;\n" +
+ "\n" +
+ "public class X02 {\n" +
+ "\n" +
+ " void foo() {\n" +
+ " /*\n" +
+ " * scope.problemReporter().unnecessaryCastForArgument((CastExpression)\n" +
+ " * expression, TypeBinding.wellKnownType(scope,\n" +
+ " * expression.implicitConversion >> 4));\n" +
+ " */\n" +
+ " }\n" +
"}\n"
);
}
/**
* @bug 264112: [Formatter] Wrap when necessary too aggressive on short qualifiers
- * @test
+ * @test
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=264112"
*/
// Max line width = 24
public void testBug264112_w24_S1() {
this.formatterPrefs.page_width = 24;
- String source =
- "class Sample1 {void foo() {Other.bar( 100,\n" +
- "200,\n" +
- "300,\n" +
- "400,\n" +
- "500,\n" +
- "600,\n" +
- "700,\n" +
- "800,\n" +
+ String source =
+ "class Sample1 {void foo() {Other.bar( 100,\n" +
+ "200,\n" +
+ "300,\n" +
+ "400,\n" +
+ "500,\n" +
+ "600,\n" +
+ "700,\n" +
+ "800,\n" +
"900 );}}\n";
formatSource(source,
- "class Sample1 {\n" +
- " void foo() {\n" +
- " Other.bar(100,\n" +
- " 200,\n" +
- " 300,\n" +
- " 400,\n" +
- " 500,\n" +
- " 600,\n" +
- " 700,\n" +
- " 800,\n" +
- " 900);\n" +
- " }\n" +
+ "class Sample1 {\n" +
+ " void foo() {\n" +
+ " Other.bar(100,\n" +
+ " 200,\n" +
+ " 300,\n" +
+ " 400,\n" +
+ " 500,\n" +
+ " 600,\n" +
+ " 700,\n" +
+ " 800,\n" +
+ " 900);\n" +
+ " }\n" +
"}\n"
);
}
public void testBug264112_w24_S2() {
this.formatterPrefs.page_width = 24;
- String source =
+ String source =
"class Sample2 {int foo(Some a) {return a.getFirst();}}\n";
formatSource(source,
- "class Sample2 {\n" +
- " int foo(Some a) {\n" +
- " return a.getFirst();\n" +
- " }\n" +
+ "class Sample2 {\n" +
+ " int foo(Some a) {\n" +
+ " return a.getFirst();\n" +
+ " }\n" +
"}\n"
);
}
// Max line width = 25
public void testBug264112_w25_S1() {
this.formatterPrefs.page_width = 25;
- String source =
- "class Sample1 {void foo() {Other.bar( 100,\n" +
- "200,\n" +
- "300,\n" +
- "400,\n" +
- "500,\n" +
- "600,\n" +
- "700,\n" +
- "800,\n" +
+ String source =
+ "class Sample1 {void foo() {Other.bar( 100,\n" +
+ "200,\n" +
+ "300,\n" +
+ "400,\n" +
+ "500,\n" +
+ "600,\n" +
+ "700,\n" +
+ "800,\n" +
"900 );}}\n";
formatSource(source,
- "class Sample1 {\n" +
- " void foo() {\n" +
- " Other.bar(100,\n" +
- " 200, 300,\n" +
- " 400, 500,\n" +
- " 600, 700,\n" +
- " 800,\n" +
- " 900);\n" +
- " }\n" +
+ "class Sample1 {\n" +
+ " void foo() {\n" +
+ " Other.bar(100,\n" +
+ " 200, 300,\n" +
+ " 400, 500,\n" +
+ " 600, 700,\n" +
+ " 800,\n" +
+ " 900);\n" +
+ " }\n" +
"}\n"
);
}
public void testBug264112_w25_S2() {
this.formatterPrefs.page_width = 25;
- String source =
+ String source =
"class Sample2 {int foo(Some a) {return a.getFirst();}}\n";
formatSource(source,
- "class Sample2 {\n" +
- " int foo(Some a) {\n" +
- " return a.getFirst();\n" +
- " }\n" +
+ "class Sample2 {\n" +
+ " int foo(Some a) {\n" +
+ " return a.getFirst();\n" +
+ " }\n" +
"}\n"
);
}
// Max line width = 26
public void testBug264112_w26_S1() {
this.formatterPrefs.page_width = 26;
- String source =
- "class Sample1 {void foo() {Other.bar( 100,\n" +
- "200,\n" +
- "300,\n" +
- "400,\n" +
- "500,\n" +
- "600,\n" +
- "700,\n" +
- "800,\n" +
+ String source =
+ "class Sample1 {void foo() {Other.bar( 100,\n" +
+ "200,\n" +
+ "300,\n" +
+ "400,\n" +
+ "500,\n" +
+ "600,\n" +
+ "700,\n" +
+ "800,\n" +
"900 );}}\n";
formatSource(source,
- "class Sample1 {\n" +
- " void foo() {\n" +
- " Other.bar(100,\n" +
- " 200, 300,\n" +
- " 400, 500,\n" +
- " 600, 700,\n" +
- " 800, 900);\n" +
- " }\n" +
+ "class Sample1 {\n" +
+ " void foo() {\n" +
+ " Other.bar(100,\n" +
+ " 200, 300,\n" +
+ " 400, 500,\n" +
+ " 600, 700,\n" +
+ " 800, 900);\n" +
+ " }\n" +
"}\n"
);
}
public void testBug264112_w26_S2() {
this.formatterPrefs.page_width = 26;
- String source =
+ String source =
"class Sample2 {int foo(Some a) {return a.getFirst();}}\n";
formatSource(source,
- "class Sample2 {\n" +
- " int foo(Some a) {\n" +
- " return a.getFirst();\n" +
- " }\n" +
+ "class Sample2 {\n" +
+ " int foo(Some a) {\n" +
+ " return a.getFirst();\n" +
+ " }\n" +
"}\n"
);
}
public void testBug264112_wksp1_01() {
setPageWidth80();
- String source =
- "package wksp1;\n" +
- "\n" +
- "public class X01 {\n" +
- "\n" +
- " public Object foo(Object scope) {\n" +
- " if (scope != null) {\n" +
- " if (true) {\n" +
- " for (int i = 0; i < 10; i++) {\n" +
- " if (i == 0) {\n" +
- " } else if (i < 5) {\n" +
- " } else {\n" +
- " scope.problemReporter().typeMismatchErrorActualTypeExpectedType(expression, expressionTb, expectedElementsTb);\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- "\n" +
- "}\n";
- formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X01 {\n" +
- "\n" +
- " public Object foo(Object scope) {\n" +
- " if (scope != null) {\n" +
- " if (true) {\n" +
- " for (int i = 0; i < 10; i++) {\n" +
- " if (i == 0) {\n" +
- " } else if (i < 5) {\n" +
- " } else {\n" +
- " scope.problemReporter()\n" +
- " .typeMismatchErrorActualTypeExpectedType(\n" +
- " expression, expressionTb,\n" +
- " expectedElementsTb);\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- "\n" +
+ String source =
+ "package wksp1;\n" +
+ "\n" +
+ "public class X01 {\n" +
+ "\n" +
+ " public Object foo(Object scope) {\n" +
+ " if (scope != null) {\n" +
+ " if (true) {\n" +
+ " for (int i = 0; i < 10; i++) {\n" +
+ " if (i == 0) {\n" +
+ " } else if (i < 5) {\n" +
+ " } else {\n" +
+ " scope.problemReporter().typeMismatchErrorActualTypeExpectedType(expression, expressionTb, expectedElementsTb);\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp1;\n" +
+ "\n" +
+ "public class X01 {\n" +
+ "\n" +
+ " public Object foo(Object scope) {\n" +
+ " if (scope != null) {\n" +
+ " if (true) {\n" +
+ " for (int i = 0; i < 10; i++) {\n" +
+ " if (i == 0) {\n" +
+ " } else if (i < 5) {\n" +
+ " } else {\n" +
+ " scope.problemReporter()\n" +
+ " .typeMismatchErrorActualTypeExpectedType(\n" +
+ " expression, expressionTb,\n" +
+ " expectedElementsTb);\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
"}\n"
);
}
public void testBug264112_wksp1_02() {
- String source =
- "package wksp1;\n" +
- "\n" +
- "public class X02 {\n" +
- "\n" +
- " public String toString() {\n" +
- " StringBuffer buffer = new StringBuffer();\n" +
- " if (true) {\n" +
- " buffer.append(\"- possible values: [\"); //$NON-NLS-1$ \n" +
- " buffer.append(\"]\\n\"); //$NON-NLS-1$ \n" +
- " buffer.append(\"- curr. val. index: \").append(currentValueIndex).append(\"\\n\"); //$NON-NLS-1$ //$NON-NLS-2$\n" +
- " }\n" +
- " buffer.append(\"- description: \").append(description).append(\"\\n\"); //$NON-NLS-1$ //$NON-NLS-2$\n" +
- " return buffer.toString();\n" +
- " }\n" +
- "\n" +
- "}\n";
- formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X02 {\n" +
- "\n" +
- " public String toString() {\n" +
- " StringBuffer buffer = new StringBuffer();\n" +
- " if (true) {\n" +
- " buffer.append(\"- possible values: [\"); //$NON-NLS-1$\n" +
- " buffer.append(\"]\\n\"); //$NON-NLS-1$\n" +
- " buffer.append(\"- curr. val. index: \").append(currentValueIndex).append(\"\\n\"); //$NON-NLS-1$ //$NON-NLS-2$\n" +
- " }\n" +
- " buffer.append(\"- description: \").append(description).append(\"\\n\"); //$NON-NLS-1$ //$NON-NLS-2$\n" +
- " return buffer.toString();\n" +
- " }\n" +
- "\n" +
+ String source =
+ "package wksp1;\n" +
+ "\n" +
+ "public class X02 {\n" +
+ "\n" +
+ " public String toString() {\n" +
+ " StringBuffer buffer = new StringBuffer();\n" +
+ " if (true) {\n" +
+ " buffer.append(\"- possible values: [\"); //$NON-NLS-1$ \n" +
+ " buffer.append(\"]\\n\"); //$NON-NLS-1$ \n" +
+ " buffer.append(\"- curr. val. index: \").append(currentValueIndex).append(\"\\n\"); //$NON-NLS-1$ //$NON-NLS-2$\n" +
+ " }\n" +
+ " buffer.append(\"- description: \").append(description).append(\"\\n\"); //$NON-NLS-1$ //$NON-NLS-2$\n" +
+ " return buffer.toString();\n" +
+ " }\n" +
+ "\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp1;\n" +
+ "\n" +
+ "public class X02 {\n" +
+ "\n" +
+ " public String toString() {\n" +
+ " StringBuffer buffer = new StringBuffer();\n" +
+ " if (true) {\n" +
+ " buffer.append(\"- possible values: [\"); //$NON-NLS-1$\n" +
+ " buffer.append(\"]\\n\"); //$NON-NLS-1$\n" +
+ " buffer.append(\"- curr. val. index: \").append(currentValueIndex).append(\"\\n\"); //$NON-NLS-1$ //$NON-NLS-2$\n" +
+ " }\n" +
+ " buffer.append(\"- description: \").append(description).append(\"\\n\"); //$NON-NLS-1$ //$NON-NLS-2$\n" +
+ " return buffer.toString();\n" +
+ " }\n" +
+ "\n" +
"}\n"
);
}
public void testBug264112_wksp2_01() {
setPageWidth80();
- String source =
- "package wksp2;\n" +
- "\n" +
- "public class X01 {\n" +
- "\n" +
- " private static final String PATH_SMOOTH_QUAD_TO = \"SMOOTH\";\n" +
- " private static final String XML_SPACE = \" \";\n" +
- " private static final String PATH_CLOSE = \"CLOSE\";\n" +
- "\n" +
- " String foo(Point point, Point point_plus1) {\n" +
- " StringBuffer sb = new StringBuffer();\n" +
- " while (true) {\n" +
- " if (point != null) {\n" +
- " // Following message send was unnecessarily split\n" +
- " sb.append(PATH_SMOOTH_QUAD_TO)\n" +
- " .append(String.valueOf(midValue(point.x, point_plus1.x)))\n" +
- " .append(XML_SPACE)\n" +
- " .append(String.valueOf(midValue(point.y, point_plus1.y)));\n" +
- " } else {\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
- " sb.append(PATH_CLOSE);\n" +
- "\n" +
- " return sb.toString();\n" +
- " }\n" +
- "\n" +
- " private int midValue(int x1, int x2) {\n" +
- " return (x1 + x2) / 2;\n" +
- " }\n" +
- "\n" +
- "}\n" +
- "class Point {\n" +
- " int x,y;\n" +
- "}\n";
- formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public class X01 {\n" +
- "\n" +
- " private static final String PATH_SMOOTH_QUAD_TO = \"SMOOTH\";\n" +
- " private static final String XML_SPACE = \" \";\n" +
- " private static final String PATH_CLOSE = \"CLOSE\";\n" +
- "\n" +
- " String foo(Point point, Point point_plus1) {\n" +
- " StringBuffer sb = new StringBuffer();\n" +
- " while (true) {\n" +
- " if (point != null) {\n" +
- " // Following message send was unnecessarily split\n" +
- " sb.append(PATH_SMOOTH_QUAD_TO)\n" +
- " .append(String\n" +
- " .valueOf(midValue(point.x, point_plus1.x)))\n" +
- " .append(XML_SPACE).append(String\n" +
- " .valueOf(midValue(point.y, point_plus1.y)));\n" +
- " } else {\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
- " sb.append(PATH_CLOSE);\n" +
- "\n" +
- " return sb.toString();\n" +
- " }\n" +
- "\n" +
- " private int midValue(int x1, int x2) {\n" +
- " return (x1 + x2) / 2;\n" +
- " }\n" +
- "\n" +
- "}\n" +
- "\n" +
- "class Point {\n" +
- " int x, y;\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public class X01 {\n" +
+ "\n" +
+ " private static final String PATH_SMOOTH_QUAD_TO = \"SMOOTH\";\n" +
+ " private static final String XML_SPACE = \" \";\n" +
+ " private static final String PATH_CLOSE = \"CLOSE\";\n" +
+ "\n" +
+ " String foo(Point point, Point point_plus1) {\n" +
+ " StringBuffer sb = new StringBuffer();\n" +
+ " while (true) {\n" +
+ " if (point != null) {\n" +
+ " // Following message send was unnecessarily split\n" +
+ " sb.append(PATH_SMOOTH_QUAD_TO)\n" +
+ " .append(String.valueOf(midValue(point.x, point_plus1.x)))\n" +
+ " .append(XML_SPACE)\n" +
+ " .append(String.valueOf(midValue(point.y, point_plus1.y)));\n" +
+ " } else {\n" +
+ " break;\n" +
+ " }\n" +
+ " }\n" +
+ " sb.append(PATH_CLOSE);\n" +
+ "\n" +
+ " return sb.toString();\n" +
+ " }\n" +
+ "\n" +
+ " private int midValue(int x1, int x2) {\n" +
+ " return (x1 + x2) / 2;\n" +
+ " }\n" +
+ "\n" +
+ "}\n" +
+ "class Point {\n" +
+ " int x,y;\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp2;\n" +
+ "\n" +
+ "public class X01 {\n" +
+ "\n" +
+ " private static final String PATH_SMOOTH_QUAD_TO = \"SMOOTH\";\n" +
+ " private static final String XML_SPACE = \" \";\n" +
+ " private static final String PATH_CLOSE = \"CLOSE\";\n" +
+ "\n" +
+ " String foo(Point point, Point point_plus1) {\n" +
+ " StringBuffer sb = new StringBuffer();\n" +
+ " while (true) {\n" +
+ " if (point != null) {\n" +
+ " // Following message send was unnecessarily split\n" +
+ " sb.append(PATH_SMOOTH_QUAD_TO)\n" +
+ " .append(String\n" +
+ " .valueOf(midValue(point.x, point_plus1.x)))\n" +
+ " .append(XML_SPACE).append(String\n" +
+ " .valueOf(midValue(point.y, point_plus1.y)));\n" +
+ " } else {\n" +
+ " break;\n" +
+ " }\n" +
+ " }\n" +
+ " sb.append(PATH_CLOSE);\n" +
+ "\n" +
+ " return sb.toString();\n" +
+ " }\n" +
+ "\n" +
+ " private int midValue(int x1, int x2) {\n" +
+ " return (x1 + x2) / 2;\n" +
+ " }\n" +
+ "\n" +
+ "}\n" +
+ "\n" +
+ "class Point {\n" +
+ " int x, y;\n" +
"}\n"
);
}
public void testBug264112_wksp2_02() {
- String source =
- "package wksp2;\n" +
- "\n" +
- "public class X02 {\n" +
- " \n" +
- " void test(X02 indexsc) {\n" +
- " if (indexsc == null) {\n" +
- " } else {\n" +
- "\n" +
- " indexsc.reopenScan(\n" +
- " searchRow, // startKeyValue\n" +
- " ScanController.GE, // startSearchOp\n" +
- " null, // qualifier\n" +
- " null, // stopKeyValue\n" +
- " ScanController.GT // stopSearchOp \n" +
- " );\n" +
- " }\n" +
- " \n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public class X02 {\n" +
- "\n" +
- " void test(X02 indexsc) {\n" +
- " if (indexsc == null) {\n" +
- " } else {\n" +
- "\n" +
- " indexsc.reopenScan(searchRow, // startKeyValue\n" +
- " ScanController.GE, // startSearchOp\n" +
- " null, // qualifier\n" +
- " null, // stopKeyValue\n" +
- " ScanController.GT // stopSearchOp\n" +
- " );\n" +
- " }\n" +
- "\n" +
- " }\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public class X02 {\n" +
+ " \n" +
+ " void test(X02 indexsc) {\n" +
+ " if (indexsc == null) {\n" +
+ " } else {\n" +
+ "\n" +
+ " indexsc.reopenScan(\n" +
+ " searchRow, // startKeyValue\n" +
+ " ScanController.GE, // startSearchOp\n" +
+ " null, // qualifier\n" +
+ " null, // stopKeyValue\n" +
+ " ScanController.GT // stopSearchOp \n" +
+ " );\n" +
+ " }\n" +
+ " \n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp2;\n" +
+ "\n" +
+ "public class X02 {\n" +
+ "\n" +
+ " void test(X02 indexsc) {\n" +
+ " if (indexsc == null) {\n" +
+ " } else {\n" +
+ "\n" +
+ " indexsc.reopenScan(searchRow, // startKeyValue\n" +
+ " ScanController.GE, // startSearchOp\n" +
+ " null, // qualifier\n" +
+ " null, // stopKeyValue\n" +
+ " ScanController.GT // stopSearchOp\n" +
+ " );\n" +
+ " }\n" +
+ "\n" +
+ " }\n" +
"}\n"
);
}
@@ -5628,22 +5628,22 @@ public void testBug297225() {
this.formatterPrefs.comment_format_line_comment = false;
this.formatterPrefs.comment_format_block_comment = false;
this.formatterPrefs.comment_format_javadoc_comment = false;
- String source =
- "public class X01 {\n" +
- " \n" +
- " /**\n" +
- " * The foo method\n" +
- " */\n" +
- " void foo() {}\n" +
+ String source =
+ "public class X01 {\n" +
+ " \n" +
+ " /**\n" +
+ " * The foo method\n" +
+ " */\n" +
+ " void foo() {}\n" +
"}\n";
formatSource(source,
- "public class X01 {\n" +
- "\n" +
- " /**\n" +
- " * The foo method\n" +
- " */\n" +
- " void foo() {\n" +
- " }\n" +
+ "public class X01 {\n" +
+ "\n" +
+ " /**\n" +
+ " * The foo method\n" +
+ " */\n" +
+ " void foo() {\n" +
+ " }\n" +
"}\n"
);
}
@@ -5654,41 +5654,41 @@ public void testBug297225() {
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=297546"
*/
public void testBug297546() {
- String source =
- "package org.eclipse.jdt.core;\n" +
- "public class TestClass implements TestInterface {\n" +
- "\n" +
- " /* (non-Javadoc)\n" +
- " * @see org.eclipse.jdt.core.TestInterface#testMethod(org.eclipse.jdt.core.TestInterface)\n" +
- " */\n" +
- " public void testMethod(TestInterface aLongNameForAParam) {\n" +
- " // do nothing\n" +
- " }\n" +
- "\n" +
- " \n" +
- "}\n" +
- "interface TestInterface {\n" +
- " void testMethod(TestInterface aLongNameForAParam);\n" +
- "}\n";
- formatSource(source,
- "package org.eclipse.jdt.core;\n" +
- "\n" +
- "public class TestClass implements TestInterface {\n" +
- "\n" +
- " /*\n" +
- " * (non-Javadoc)\n" +
- " * \n" +
- " * @see org.eclipse.jdt.core.TestInterface#testMethod(org.eclipse.jdt.core.\n" +
- " * TestInterface)\n" +
- " */\n" +
- " public void testMethod(TestInterface aLongNameForAParam) {\n" +
- " // do nothing\n" +
- " }\n" +
- "\n" +
- "}\n" +
- "\n" +
- "interface TestInterface {\n" +
- " void testMethod(TestInterface aLongNameForAParam);\n" +
+ String source =
+ "package org.eclipse.jdt.core;\n" +
+ "public class TestClass implements TestInterface {\n" +
+ "\n" +
+ " /* (non-Javadoc)\n" +
+ " * @see org.eclipse.jdt.core.TestInterface#testMethod(org.eclipse.jdt.core.TestInterface)\n" +
+ " */\n" +
+ " public void testMethod(TestInterface aLongNameForAParam) {\n" +
+ " // do nothing\n" +
+ " }\n" +
+ "\n" +
+ " \n" +
+ "}\n" +
+ "interface TestInterface {\n" +
+ " void testMethod(TestInterface aLongNameForAParam);\n" +
+ "}\n";
+ formatSource(source,
+ "package org.eclipse.jdt.core;\n" +
+ "\n" +
+ "public class TestClass implements TestInterface {\n" +
+ "\n" +
+ " /*\n" +
+ " * (non-Javadoc)\n" +
+ " * \n" +
+ " * @see org.eclipse.jdt.core.TestInterface#testMethod(org.eclipse.jdt.core.\n" +
+ " * TestInterface)\n" +
+ " */\n" +
+ " public void testMethod(TestInterface aLongNameForAParam) {\n" +
+ " // do nothing\n" +
+ " }\n" +
+ "\n" +
+ "}\n" +
+ "\n" +
+ "interface TestInterface {\n" +
+ " void testMethod(TestInterface aLongNameForAParam);\n" +
"}\n"
);
}
@@ -5700,18 +5700,18 @@ public void testBug297546() {
*/
public void testBug298243() {
this.formatterPrefs.number_of_empty_lines_to_preserve = 0;
- String source =
- "package test;\n" +
- "\n" +
- "import java.util.concurrent.atomic.AtomicInteger;\n" +
- "\n" +
- "import org.xml.sax.SAXException;\n" +
- "\n" +
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " SAXException e;\n" +
- " AtomicInteger w;\n" +
- " }\n" +
+ String source =
+ "package test;\n" +
+ "\n" +
+ "import java.util.concurrent.atomic.AtomicInteger;\n" +
+ "\n" +
+ "import org.xml.sax.SAXException;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) {\n" +
+ " SAXException e;\n" +
+ " AtomicInteger w;\n" +
+ " }\n" +
"}\n";
formatSource(source);
}
@@ -5724,33 +5724,33 @@ public void testBug298243() {
public void testBug298844a() {
setFormatLineCommentOnFirstColumn();
this.formatterPrefs.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
- String source =
- "public class X01 {\n" +
- "public X01() {\n" +
- "// TODO Auto-generated constructor stub\n" +
- "}\n" +
+ String source =
+ "public class X01 {\n" +
+ "public X01() {\n" +
+ "// TODO Auto-generated constructor stub\n" +
+ "}\n" +
"}\n";
formatSource(source,
- "public class X01 {\n" +
- " public X01() {\n" +
- " // TODO Auto-generated constructor stub\n" +
- " }\n" +
+ "public class X01 {\n" +
+ " public X01() {\n" +
+ " // TODO Auto-generated constructor stub\n" +
+ " }\n" +
"}\n"
);
}
public void testBug298844b() {
this.formatterPrefs.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
- String source =
- "public class X02 {\n" +
- "public void foo() {\n" +
- " // TODO Auto-generated constructor stub\n" +
- "}\n" +
+ String source =
+ "public class X02 {\n" +
+ "public void foo() {\n" +
+ " // TODO Auto-generated constructor stub\n" +
+ "}\n" +
"}\n";
formatSource(source,
- "public class X02 {\n" +
- " public void foo() {\n" +
- " // TODO Auto-generated constructor stub\n" +
- " }\n" +
+ "public class X02 {\n" +
+ " public void foo() {\n" +
+ " // TODO Auto-generated constructor stub\n" +
+ " }\n" +
"}\n"
);
}
@@ -5761,86 +5761,86 @@ public void testBug298844b() {
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=302123"
*/
public void testBug302123() {
- String source =
- "package test;\n" +
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " String s=\"X\"+/** ***/\"Y\";\n" +
- " }\n" +
- "\n" +
+ String source =
+ "package test;\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) {\n" +
+ " String s=\"X\"+/** ***/\"Y\";\n" +
+ " }\n" +
+ "\n" +
"}\n";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " String s = \"X\" + /** ***/\n" +
- " \"Y\";\n" +
- " }\n" +
- "\n" +
+ "package test;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) {\n" +
+ " String s = \"X\" + /** ***/\n" +
+ " \"Y\";\n" +
+ " }\n" +
+ "\n" +
"}\n"
);
}
public void testBug302123b() {
- String source =
- "package test;\n" +
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " String s=\"X\"+/** XXX ***/\"Y\";\n" +
- " }\n" +
- "\n" +
+ String source =
+ "package test;\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) {\n" +
+ " String s=\"X\"+/** XXX ***/\"Y\";\n" +
+ " }\n" +
+ "\n" +
"}\n";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " String s = \"X\" + /** XXX ***/\n" +
- " \"Y\";\n" +
- " }\n" +
- "\n" +
+ "package test;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) {\n" +
+ " String s = \"X\" + /** XXX ***/\n" +
+ " \"Y\";\n" +
+ " }\n" +
+ "\n" +
"}\n"
);
}
public void testBug302123c() {
- String source =
- "package test;\n" +
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " String s=\"X\"+/** ** XXX ** ***/\"Y\";\n" +
- " }\n" +
- "\n" +
+ String source =
+ "package test;\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) {\n" +
+ " String s=\"X\"+/** ** XXX ** ***/\"Y\";\n" +
+ " }\n" +
+ "\n" +
"}\n";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " String s = \"X\" + /** ** XXX ** ***/\n" +
- " \"Y\";\n" +
- " }\n" +
- "\n" +
+ "package test;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) {\n" +
+ " String s = \"X\" + /** ** XXX ** ***/\n" +
+ " \"Y\";\n" +
+ " }\n" +
+ "\n" +
"}\n"
);
}
public void testBug302123d() {
- String source =
- "package test;\n" +
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " String s=\"X\"+/**AAA *** BBB *** CCC***/\"Y\";\n" +
- " }\n" +
- "\n" +
+ String source =
+ "package test;\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) {\n" +
+ " String s=\"X\"+/**AAA *** BBB *** CCC***/\"Y\";\n" +
+ " }\n" +
+ "\n" +
"}\n";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " String s = \"X\" + /** AAA *** BBB *** CCC ***/\n" +
- " \"Y\";\n" +
- " }\n" +
- "\n" +
+ "package test;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) {\n" +
+ " String s = \"X\" + /** AAA *** BBB *** CCC ***/\n" +
+ " \"Y\";\n" +
+ " }\n" +
+ "\n" +
"}\n"
);
}
@@ -5853,81 +5853,81 @@ public void testBug302123d() {
public void testBug302552_LW0() {
this.formatterPrefs.page_width = 20;
this.formatterPrefs.alignment_for_selector_in_method_invocation = Alignment.M_NO_ALIGNMENT;
- String source =
+ String source =
"class Sample2 {int foo(Some a) {return a.getFirst();}}\n";
formatSource(source,
- "class Sample2 {\n" +
- " int foo(Some a) {\n" +
- " return a.getFirst();\n" +
- " }\n" +
+ "class Sample2 {\n" +
+ " int foo(Some a) {\n" +
+ " return a.getFirst();\n" +
+ " }\n" +
"}\n"
);
}
public void testBug302552_LW1() {
this.formatterPrefs.page_width = 20;
this.formatterPrefs.alignment_for_selector_in_method_invocation = Alignment.M_COMPACT_SPLIT;
- String source =
+ String source =
"class Sample2 {int foo(Some a) {return a.getFirst();}}\n";
formatSource(source,
- "class Sample2 {\n" +
- " int foo(Some a) {\n" +
- " return a.getFirst();\n" +
- " }\n" +
+ "class Sample2 {\n" +
+ " int foo(Some a) {\n" +
+ " return a.getFirst();\n" +
+ " }\n" +
"}\n"
);
}
public void testBug302552_LW2() {
this.formatterPrefs.page_width = 20;
this.formatterPrefs.alignment_for_selector_in_method_invocation = Alignment.M_COMPACT_FIRST_BREAK_SPLIT;
- String source =
+ String source =
"class Sample2 {int foo(Some a) {return a.getFirst();}}\n";
formatSource(source,
- "class Sample2 {\n" +
- " int foo(Some a) {\n" +
- " return a\n" +
- " .getFirst();\n" +
- " }\n" +
+ "class Sample2 {\n" +
+ " int foo(Some a) {\n" +
+ " return a\n" +
+ " .getFirst();\n" +
+ " }\n" +
"}\n"
);
}
public void testBug302552_LW3() {
this.formatterPrefs.page_width = 20;
this.formatterPrefs.alignment_for_selector_in_method_invocation = Alignment.M_ONE_PER_LINE_SPLIT;
- String source =
+ String source =
"class Sample2 {int foo(Some a) {return a.getFirst();}}\n";
formatSource(source,
- "class Sample2 {\n" +
- " int foo(Some a) {\n" +
- " return a\n" +
- " .getFirst();\n" +
- " }\n" +
+ "class Sample2 {\n" +
+ " int foo(Some a) {\n" +
+ " return a\n" +
+ " .getFirst();\n" +
+ " }\n" +
"}\n"
);
}
public void testBug302552_LW4() {
this.formatterPrefs.page_width = 20;
this.formatterPrefs.alignment_for_selector_in_method_invocation = Alignment.M_NEXT_SHIFTED_SPLIT;
- String source =
+ String source =
"class Sample2 {int foo(Some a) {return a.getFirst();}}\n";
formatSource(source,
- "class Sample2 {\n" +
- " int foo(Some a) {\n" +
- " return a\n" +
- " .getFirst();\n" +
- " }\n" +
+ "class Sample2 {\n" +
+ " int foo(Some a) {\n" +
+ " return a\n" +
+ " .getFirst();\n" +
+ " }\n" +
"}\n"
);
}
public void testBug302552_LW5() {
this.formatterPrefs.page_width = 20;
this.formatterPrefs.alignment_for_selector_in_method_invocation = Alignment.M_NEXT_PER_LINE_SPLIT;
- String source =
+ String source =
"class Sample2 {int foo(Some a) {return a.getFirst();}}\n";
formatSource(source,
- "class Sample2 {\n" +
- " int foo(Some a) {\n" +
- " return a.getFirst();\n" +
- " }\n" +
+ "class Sample2 {\n" +
+ " int foo(Some a) {\n" +
+ " return a.getFirst();\n" +
+ " }\n" +
"}\n"
);
}
@@ -5942,11 +5942,11 @@ public void testBug304529() {
this.formatterPrefs.disabling_tag = "off".toCharArray();
this.formatterPrefs.enabling_tag = null;
String source =
- "/* off */\n" +
- "public class X01 {\n" +
- "void foo( ) { \n" +
- " // unformatted area\n" +
- "}\n" +
+ "/* off */\n" +
+ "public class X01 {\n" +
+ "void foo( ) { \n" +
+ " // unformatted area\n" +
+ "}\n" +
"}\n";
formatSource(source);
}
@@ -5955,18 +5955,18 @@ public void testBug304529b() {
this.formatterPrefs.disabling_tag = null;
this.formatterPrefs.enabling_tag = "on".toCharArray();
String source =
- "/* on */\n" +
- "public class X01 {\n" +
- "void foo( ) { \n" +
- " // formatted area\n" +
- "}\n" +
+ "/* on */\n" +
+ "public class X01 {\n" +
+ "void foo( ) { \n" +
+ " // formatted area\n" +
+ "}\n" +
"}\n";
formatSource(source,
- "/* on */\n" +
- "public class X01 {\n" +
- " void foo() {\n" +
- " // formatted area\n" +
- " }\n" +
+ "/* on */\n" +
+ "public class X01 {\n" +
+ " void foo() {\n" +
+ " // formatted area\n" +
+ " }\n" +
"}\n"
);
}
@@ -5976,11 +5976,11 @@ public void testBug304529c() {
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_DISABLING_TAG, "off");
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_ENABLING_TAG, "");
String source =
- "/* off */\n" +
- "public class X01 {\n" +
- "void foo( ) { \n" +
- " // unformatted area\n" +
- "}\n" +
+ "/* off */\n" +
+ "public class X01 {\n" +
+ "void foo( ) { \n" +
+ " // unformatted area\n" +
+ "}\n" +
"}\n";
formatSource(source);
}
@@ -5990,18 +5990,18 @@ public void testBug304529d() {
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_DISABLING_TAG, "");
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_ENABLING_TAG, "on");
String source =
- "/* on */\n" +
- "public class X01 {\n" +
- "void foo( ) { \n" +
- " // formatted area\n" +
- "}\n" +
+ "/* on */\n" +
+ "public class X01 {\n" +
+ "void foo( ) { \n" +
+ " // formatted area\n" +
+ "}\n" +
"}\n";
formatSource(source,
- "/* on */\n" +
- "public class X01 {\n" +
- " void foo() {\n" +
- " // formatted area\n" +
- " }\n" +
+ "/* on */\n" +
+ "public class X01 {\n" +
+ " void foo() {\n" +
+ " // formatted area\n" +
+ " }\n" +
"}\n"
);
}
@@ -6011,26 +6011,26 @@ public void testBug304529e() {
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_DISABLING_TAG, "off");
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_ENABLING_TAG, "on");
String source =
- "public class X01 {\n" +
- "/* off */\n" +
- "void foo( ) { \n" +
- " // unformatted area\n" +
- "}\n" +
- "/* on */\n" +
- "void bar( ) { \n" +
- " // formatted area\n" +
- "}\n" +
+ "public class X01 {\n" +
+ "/* off */\n" +
+ "void foo( ) { \n" +
+ " // unformatted area\n" +
+ "}\n" +
+ "/* on */\n" +
+ "void bar( ) { \n" +
+ " // formatted area\n" +
+ "}\n" +
"}\n";
formatSource(source,
- "public class X01 {\n" +
- "/* off */\n" +
- "void foo( ) { \n" +
- " // unformatted area\n" +
- "}\n" +
- "/* on */\n" +
- " void bar() {\n" +
- " // formatted area\n" +
- " }\n" +
+ "public class X01 {\n" +
+ "/* off */\n" +
+ "void foo( ) { \n" +
+ " // unformatted area\n" +
+ "}\n" +
+ "/* on */\n" +
+ " void bar() {\n" +
+ " // formatted area\n" +
+ " }\n" +
"}\n"
);
}
@@ -6042,49 +6042,49 @@ public void testBug304529e() {
*/
public void testBug309706() {
String source =
- "public class Test {\n" +
- "\n" +
- " private int id;;;\n" +
- "\n" +
- " private void dummy() {\n" +
- "\n" +
- " if (true) {\n" +
- " System.out.println(\"bla\");\n" +
- " }\n" +
- " }\n" +
+ "public class Test {\n" +
+ "\n" +
+ " private int id;;;\n" +
+ "\n" +
+ " private void dummy() {\n" +
+ "\n" +
+ " if (true) {\n" +
+ " System.out.println(\"bla\");\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " private int id;;;\n" +
- "\n" +
- " private void dummy() {\n" +
- "\n" +
- " if (true) {\n" +
- " System.out.println(\"bla\");\n" +
- " }\n" +
- " }\n" +
+ "public class Test {\n" +
+ "\n" +
+ " private int id;;;\n" +
+ "\n" +
+ " private void dummy() {\n" +
+ "\n" +
+ " if (true) {\n" +
+ " System.out.println(\"bla\");\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
public void testBug309706b() {
String source =
- " private int id;;;\n" +
- "\n" +
- " private void dummy() {\n" +
- "\n" +
- " if (true) {\n" +
- " System.out.println(\"bla\");\n" +
- " }\n" +
+ " private int id;;;\n" +
+ "\n" +
+ " private void dummy() {\n" +
+ "\n" +
+ " if (true) {\n" +
+ " System.out.println(\"bla\");\n" +
+ " }\n" +
" }\n";
formatSource(source,
- "private int id;;;\n" +
- "\n" +
- "private void dummy() {\n" +
- "\n" +
- " if (true) {\n" +
- " System.out.println(\"bla\");\n" +
- " }\n" +
+ "private int id;;;\n" +
+ "\n" +
+ "private void dummy() {\n" +
+ "\n" +
+ " if (true) {\n" +
+ " System.out.println(\"bla\");\n" +
+ " }\n" +
"}\n",
CodeFormatter.K_CLASS_BODY_DECLARATIONS
);
@@ -6100,65 +6100,65 @@ public void testBug311578a() throws JavaModelException {
this.formatterPrefs.disabling_tag = "//J-".toCharArray();
this.formatterPrefs.enabling_tag = "//J+".toCharArray();
String source =
- "package a;\n" +
- "public class Bug {\n" +
- "int a = - 1 + 42;\n" +
- "\n" +
- "//J-\n" +
- "int b = - 1 + 42;\n" +
- "//J+\n" +
- "\n" +
- "char x;\n" +
- "\n" +
- "////J-\n" +
- "int c = - 1 + 42;\n" +
- "////J+\n" +
- "\n" +
- "char y;\n" +
- "\n" +
- "/* J- */\n" +
- "int d = - 1 + 42;\n" +
- "/* J+ */\n" +
- "\n" +
- "char z;\n" +
- "\n" +
- "/* //J- */\n" +
- "int e = - 1 + 42;\n" +
- "/* //J+ */\n" +
- "\n" +
- "/** J-1 blabla */\n" +
- "char t;\n" +
- "}\n";
- formatSource(source,
- "package a;\n" +
- "\n" +
- "public class Bug {\n" +
- " int a = -1 + 42;\n" +
- "\n" +
- "//J-\n" +
- "int b = - 1 + 42;\n" +
- "//J+\n" +
- "\n" +
- " char x;\n" +
- "\n" +
- "////J-\n" +
- "int c = - 1 + 42;\n" +
- "////J+\n" +
- "\n" +
- " char y;\n" +
- "\n" +
- " /* J- */\n" +
- " int d = -1 + 42;\n" +
- " /* J+ */\n" +
- "\n" +
- " char z;\n" +
- "\n" +
- "/* //J- */\n" +
- "int e = - 1 + 42;\n" +
- "/* //J+ */\n" +
- "\n" +
- " /** J-1 blabla */\n" +
- " char t;\n" +
+ "package a;\n" +
+ "public class Bug {\n" +
+ "int a = - 1 + 42;\n" +
+ "\n" +
+ "//J-\n" +
+ "int b = - 1 + 42;\n" +
+ "//J+\n" +
+ "\n" +
+ "char x;\n" +
+ "\n" +
+ "////J-\n" +
+ "int c = - 1 + 42;\n" +
+ "////J+\n" +
+ "\n" +
+ "char y;\n" +
+ "\n" +
+ "/* J- */\n" +
+ "int d = - 1 + 42;\n" +
+ "/* J+ */\n" +
+ "\n" +
+ "char z;\n" +
+ "\n" +
+ "/* //J- */\n" +
+ "int e = - 1 + 42;\n" +
+ "/* //J+ */\n" +
+ "\n" +
+ "/** J-1 blabla */\n" +
+ "char t;\n" +
+ "}\n";
+ formatSource(source,
+ "package a;\n" +
+ "\n" +
+ "public class Bug {\n" +
+ " int a = -1 + 42;\n" +
+ "\n" +
+ "//J-\n" +
+ "int b = - 1 + 42;\n" +
+ "//J+\n" +
+ "\n" +
+ " char x;\n" +
+ "\n" +
+ "////J-\n" +
+ "int c = - 1 + 42;\n" +
+ "////J+\n" +
+ "\n" +
+ " char y;\n" +
+ "\n" +
+ " /* J- */\n" +
+ " int d = -1 + 42;\n" +
+ " /* J+ */\n" +
+ "\n" +
+ " char z;\n" +
+ "\n" +
+ "/* //J- */\n" +
+ "int e = - 1 + 42;\n" +
+ "/* //J+ */\n" +
+ "\n" +
+ " /** J-1 blabla */\n" +
+ " char t;\n" +
"}\n"
);
}
@@ -6168,65 +6168,65 @@ public void testBug311578b() throws JavaModelException {
this.formatterPrefs.disabling_tag = "/* J- */".toCharArray();
this.formatterPrefs.enabling_tag = "/* J+ */".toCharArray();
String source =
- "package a;\n" +
- "public class Bug {\n" +
- "int a = - 1 + 42;\n" +
- "\n" +
- "//J-\n" +
- "int b = - 1 + 42;\n" +
- "//J+\n" +
- "\n" +
- "char x;\n" +
- "\n" +
- "////J-\n" +
- "int c = - 1 + 42;\n" +
- "////J+\n" +
- "\n" +
- "char y;\n" +
- "\n" +
- "/* J- */\n" +
- "int d = - 1 + 42;\n" +
- "/* J+ */\n" +
- "\n" +
- "char z;\n" +
- "\n" +
- "/* //J- */\n" +
- "int e = - 1 + 42;\n" +
- "/* //J+ */\n" +
- "\n" +
- "/** J-1 blabla */\n" +
- "char t;\n" +
- "}\n";
- formatSource(source,
- "package a;\n" +
- "\n" +
- "public class Bug {\n" +
- " int a = -1 + 42;\n" +
- "\n" +
- " // J-\n" +
- " int b = -1 + 42;\n" +
- " // J+\n" +
- "\n" +
- " char x;\n" +
- "\n" +
- " //// J-\n" +
- " int c = -1 + 42;\n" +
- " //// J+\n" +
- "\n" +
- " char y;\n" +
- "\n" +
- "/* J- */\n" +
- "int d = - 1 + 42;\n" +
- "/* J+ */\n" +
- "\n" +
- " char z;\n" +
- "\n" +
- " /* //J- */\n" +
- " int e = -1 + 42;\n" +
- " /* //J+ */\n" +
- "\n" +
- " /** J-1 blabla */\n" +
- " char t;\n" +
+ "package a;\n" +
+ "public class Bug {\n" +
+ "int a = - 1 + 42;\n" +
+ "\n" +
+ "//J-\n" +
+ "int b = - 1 + 42;\n" +
+ "//J+\n" +
+ "\n" +
+ "char x;\n" +
+ "\n" +
+ "////J-\n" +
+ "int c = - 1 + 42;\n" +
+ "////J+\n" +
+ "\n" +
+ "char y;\n" +
+ "\n" +
+ "/* J- */\n" +
+ "int d = - 1 + 42;\n" +
+ "/* J+ */\n" +
+ "\n" +
+ "char z;\n" +
+ "\n" +
+ "/* //J- */\n" +
+ "int e = - 1 + 42;\n" +
+ "/* //J+ */\n" +
+ "\n" +
+ "/** J-1 blabla */\n" +
+ "char t;\n" +
+ "}\n";
+ formatSource(source,
+ "package a;\n" +
+ "\n" +
+ "public class Bug {\n" +
+ " int a = -1 + 42;\n" +
+ "\n" +
+ " // J-\n" +
+ " int b = -1 + 42;\n" +
+ " // J+\n" +
+ "\n" +
+ " char x;\n" +
+ "\n" +
+ " //// J-\n" +
+ " int c = -1 + 42;\n" +
+ " //// J+\n" +
+ "\n" +
+ " char y;\n" +
+ "\n" +
+ "/* J- */\n" +
+ "int d = - 1 + 42;\n" +
+ "/* J+ */\n" +
+ "\n" +
+ " char z;\n" +
+ "\n" +
+ " /* //J- */\n" +
+ " int e = -1 + 42;\n" +
+ " /* //J+ */\n" +
+ "\n" +
+ " /** J-1 blabla */\n" +
+ " char t;\n" +
"}\n"
);
}
@@ -6236,65 +6236,65 @@ public void testBug311578c() throws JavaModelException {
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_DISABLING_TAG, "//F--");
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_ENABLING_TAG, "//F++");
String source =
- "package a;\n" +
- "public class Bug {\n" +
- "int a = - 1 + 42;\n" +
- "\n" +
- "//F--\n" +
- "int b = - 1 + 42;\n" +
- "//F++\n" +
- "\n" +
- "char x;\n" +
- "\n" +
- "////F--\n" +
- "int c = - 1 + 42;\n" +
- "////F++\n" +
- "\n" +
- "char y;\n" +
- "\n" +
- "/* F-- */\n" +
- "int d = - 1 + 42;\n" +
- "/* F++ */\n" +
- "\n" +
- "char z;\n" +
- "\n" +
- "/* //F-- */\n" +
- "int e = - 1 + 42;\n" +
- "/* //F++ */\n" +
- "\n" +
- "/** F--1 blabla */\n" +
- "char t;\n" +
- "}\n";
- formatSource(source,
- "package a;\n" +
- "\n" +
- "public class Bug {\n" +
- " int a = -1 + 42;\n" +
- "\n" +
- "//F--\n" +
- "int b = - 1 + 42;\n" +
- "//F++\n" +
- "\n" +
- " char x;\n" +
- "\n" +
- "////F--\n" +
- "int c = - 1 + 42;\n" +
- "////F++\n" +
- "\n" +
- " char y;\n" +
- "\n" +
- " /* F-- */\n" +
- " int d = -1 + 42;\n" +
- " /* F++ */\n" +
- "\n" +
- " char z;\n" +
- "\n" +
- "/* //F-- */\n" +
- "int e = - 1 + 42;\n" +
- "/* //F++ */\n" +
- "\n" +
- " /** F--1 blabla */\n" +
- " char t;\n" +
+ "package a;\n" +
+ "public class Bug {\n" +
+ "int a = - 1 + 42;\n" +
+ "\n" +
+ "//F--\n" +
+ "int b = - 1 + 42;\n" +
+ "//F++\n" +
+ "\n" +
+ "char x;\n" +
+ "\n" +
+ "////F--\n" +
+ "int c = - 1 + 42;\n" +
+ "////F++\n" +
+ "\n" +
+ "char y;\n" +
+ "\n" +
+ "/* F-- */\n" +
+ "int d = - 1 + 42;\n" +
+ "/* F++ */\n" +
+ "\n" +
+ "char z;\n" +
+ "\n" +
+ "/* //F-- */\n" +
+ "int e = - 1 + 42;\n" +
+ "/* //F++ */\n" +
+ "\n" +
+ "/** F--1 blabla */\n" +
+ "char t;\n" +
+ "}\n";
+ formatSource(source,
+ "package a;\n" +
+ "\n" +
+ "public class Bug {\n" +
+ " int a = -1 + 42;\n" +
+ "\n" +
+ "//F--\n" +
+ "int b = - 1 + 42;\n" +
+ "//F++\n" +
+ "\n" +
+ " char x;\n" +
+ "\n" +
+ "////F--\n" +
+ "int c = - 1 + 42;\n" +
+ "////F++\n" +
+ "\n" +
+ " char y;\n" +
+ "\n" +
+ " /* F-- */\n" +
+ " int d = -1 + 42;\n" +
+ " /* F++ */\n" +
+ "\n" +
+ " char z;\n" +
+ "\n" +
+ "/* //F-- */\n" +
+ "int e = - 1 + 42;\n" +
+ "/* //F++ */\n" +
+ "\n" +
+ " /** F--1 blabla */\n" +
+ " char t;\n" +
"}\n"
);
}
@@ -6306,77 +6306,77 @@ public void testBug311578d() throws JavaModelException {
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_DISABLING_TAG, "/*F--*/");
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_ENABLING_TAG, "/*F++*/");
String source =
- "package a;\n" +
- "public class Bug {\n" +
- "int a = - 1 + 42;\n" +
- "\n" +
- "//F--\n" +
- "int b = - 1 + 42;\n" +
- "//F++\n" +
- "\n" +
- "char x;\n" +
- "\n" +
- "////F--\n" +
- "int c = - 1 + 42;\n" +
- "////F++\n" +
- "\n" +
- "char y;\n" +
- "\n" +
- "/* F-- */\n" +
- "int d = - 1 + 42;\n" +
- "/* F++ */\n" +
- "\n" +
- "char y2;\n" +
- "\n" +
- "/*F--*/\n" +
- "int d2 = - 1 + 42;\n" +
- "/*F++*/\n" +
- "\n" +
- "char z;\n" +
- "\n" +
- "/* //F-- */\n" +
- "int e = - 1 + 42;\n" +
- "/* //F++ */\n" +
- "\n" +
- "/** F--1 blabla */\n" +
- "char t;\n" +
- "}\n";
- formatSource(source,
- "package a;\n" +
- "\n" +
- "public class Bug {\n" +
- " int a = -1 + 42;\n" +
- "\n" +
- " // F--\n" +
- " int b = -1 + 42;\n" +
- " // F++\n" +
- "\n" +
- " char x;\n" +
- "\n" +
- " //// F--\n" +
- " int c = -1 + 42;\n" +
- " //// F++\n" +
- "\n" +
- " char y;\n" +
- "\n" +
- " /* F-- */\n" +
- " int d = -1 + 42;\n" +
- " /* F++ */\n" +
- "\n" +
- " char y2;\n" +
- "\n" +
- "/*F--*/\n" +
- "int d2 = - 1 + 42;\n" +
- "/*F++*/\n" +
- "\n" +
- " char z;\n" +
- "\n" +
- " /* //F-- */\n" +
- " int e = -1 + 42;\n" +
- " /* //F++ */\n" +
- "\n" +
- " /** F--1 blabla */\n" +
- " char t;\n" +
+ "package a;\n" +
+ "public class Bug {\n" +
+ "int a = - 1 + 42;\n" +
+ "\n" +
+ "//F--\n" +
+ "int b = - 1 + 42;\n" +
+ "//F++\n" +
+ "\n" +
+ "char x;\n" +
+ "\n" +
+ "////F--\n" +
+ "int c = - 1 + 42;\n" +
+ "////F++\n" +
+ "\n" +
+ "char y;\n" +
+ "\n" +
+ "/* F-- */\n" +
+ "int d = - 1 + 42;\n" +
+ "/* F++ */\n" +
+ "\n" +
+ "char y2;\n" +
+ "\n" +
+ "/*F--*/\n" +
+ "int d2 = - 1 + 42;\n" +
+ "/*F++*/\n" +
+ "\n" +
+ "char z;\n" +
+ "\n" +
+ "/* //F-- */\n" +
+ "int e = - 1 + 42;\n" +
+ "/* //F++ */\n" +
+ "\n" +
+ "/** F--1 blabla */\n" +
+ "char t;\n" +
+ "}\n";
+ formatSource(source,
+ "package a;\n" +
+ "\n" +
+ "public class Bug {\n" +
+ " int a = -1 + 42;\n" +
+ "\n" +
+ " // F--\n" +
+ " int b = -1 + 42;\n" +
+ " // F++\n" +
+ "\n" +
+ " char x;\n" +
+ "\n" +
+ " //// F--\n" +
+ " int c = -1 + 42;\n" +
+ " //// F++\n" +
+ "\n" +
+ " char y;\n" +
+ "\n" +
+ " /* F-- */\n" +
+ " int d = -1 + 42;\n" +
+ " /* F++ */\n" +
+ "\n" +
+ " char y2;\n" +
+ "\n" +
+ "/*F--*/\n" +
+ "int d2 = - 1 + 42;\n" +
+ "/*F++*/\n" +
+ "\n" +
+ " char z;\n" +
+ "\n" +
+ " /* //F-- */\n" +
+ " int e = -1 + 42;\n" +
+ " /* //F++ */\n" +
+ "\n" +
+ " /** F--1 blabla */\n" +
+ " char t;\n" +
"}\n"
);
}
@@ -6385,71 +6385,71 @@ public void testBug311578e() throws JavaModelException {
this.formatterPrefs.disabling_tag = "//J-".toCharArray();
this.formatterPrefs.enabling_tag = "//J+".toCharArray();
String source =
- "package a;\n" +
- "public class Bug {\n" +
- "char z2;\n" +
- "\n" +
- "//J-1\n" +
- "int f = - 1 + 42;\n" +
- "//J+2\n" +
- "\n" +
- "char z3;\n" +
- "\n" +
- "//J- 1\n" +
- "int g = - 1 + 42;\n" +
- "//J+ 2\n" +
- "\n" +
- "char z4;\n" +
- "\n" +
- " //J-\n" +
- "int h = - 1 + 42;\n" +
- " //J+\n" +
- "\n" +
- "char z5;\n" +
- "\n" +
- "/*\n" +
- "//J-\n" +
- "*/\n" +
- "int i = - 1 + 42;\n" +
- "/*\n" +
- " //J+\n" +
- " */\n" +
- "\n" +
+ "package a;\n" +
+ "public class Bug {\n" +
+ "char z2;\n" +
+ "\n" +
+ "//J-1\n" +
+ "int f = - 1 + 42;\n" +
+ "//J+2\n" +
+ "\n" +
+ "char z3;\n" +
+ "\n" +
+ "//J- 1\n" +
+ "int g = - 1 + 42;\n" +
+ "//J+ 2\n" +
+ "\n" +
+ "char z4;\n" +
+ "\n" +
+ " //J-\n" +
+ "int h = - 1 + 42;\n" +
+ " //J+\n" +
+ "\n" +
+ "char z5;\n" +
+ "\n" +
+ "/*\n" +
+ "//J-\n" +
+ "*/\n" +
+ "int i = - 1 + 42;\n" +
+ "/*\n" +
+ " //J+\n" +
+ " */\n" +
+ "\n" +
"char z6;" +
"}\n";
formatSource(source,
- "package a;\n" +
- "\n" +
- "public class Bug {\n" +
- " char z2;\n" +
- "\n" +
- "//J-1\n" +
- "int f = - 1 + 42;\n" +
- "//J+2\n" +
- "\n" +
- " char z3;\n" +
- "\n" +
- "//J- 1\n" +
- "int g = - 1 + 42;\n" +
- "//J+ 2\n" +
- "\n" +
- " char z4;\n" +
- "\n" +
- " //J-\n" +
- "int h = - 1 + 42;\n" +
- " //J+\n" +
- "\n" +
- " char z5;\n" +
- "\n" +
- "/*\n" +
- "//J-\n" +
- "*/\n" +
- "int i = - 1 + 42;\n" +
- "/*\n" +
- " //J+\n" +
- " */\n" +
- "\n" +
- " char z6;\n" +
+ "package a;\n" +
+ "\n" +
+ "public class Bug {\n" +
+ " char z2;\n" +
+ "\n" +
+ "//J-1\n" +
+ "int f = - 1 + 42;\n" +
+ "//J+2\n" +
+ "\n" +
+ " char z3;\n" +
+ "\n" +
+ "//J- 1\n" +
+ "int g = - 1 + 42;\n" +
+ "//J+ 2\n" +
+ "\n" +
+ " char z4;\n" +
+ "\n" +
+ " //J-\n" +
+ "int h = - 1 + 42;\n" +
+ " //J+\n" +
+ "\n" +
+ " char z5;\n" +
+ "\n" +
+ "/*\n" +
+ "//J-\n" +
+ "*/\n" +
+ "int i = - 1 + 42;\n" +
+ "/*\n" +
+ " //J+\n" +
+ " */\n" +
+ "\n" +
+ " char z6;\n" +
"}\n"
);
}
@@ -6458,26 +6458,26 @@ public void testBug311578_320754a() throws JavaModelException {
this.formatterPrefs.disabling_tag = "//J-".toCharArray();
this.formatterPrefs.enabling_tag = "//J+".toCharArray();
String source =
- "//J-\n" +
- "@MyAnnot (\n" +
- " testAttribute = {\"test1\", \"test2\", \"test3\"}\n" +
- ")\n" +
- "//J+\n" +
- "public class X\n" +
- "{\n" +
- " public void foo()\n" +
- " {\n" +
- " }\n" +
+ "//J-\n" +
+ "@MyAnnot (\n" +
+ " testAttribute = {\"test1\", \"test2\", \"test3\"}\n" +
+ ")\n" +
+ "//J+\n" +
+ "public class X\n" +
+ "{\n" +
+ " public void foo()\n" +
+ " {\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "//J-\n" +
- "@MyAnnot (\n" +
- " testAttribute = {\"test1\", \"test2\", \"test3\"}\n" +
- ")\n" +
- "//J+\n" +
- "public class X {\n" +
- " public void foo() {\n" +
- " }\n" +
+ "//J-\n" +
+ "@MyAnnot (\n" +
+ " testAttribute = {\"test1\", \"test2\", \"test3\"}\n" +
+ ")\n" +
+ "//J+\n" +
+ "public class X {\n" +
+ " public void foo() {\n" +
+ " }\n" +
"}\n"
);
}
@@ -6486,26 +6486,26 @@ public void testBug311578_320754b() throws JavaModelException {
this.formatterPrefs.disabling_tag = "/*J-*/".toCharArray();
this.formatterPrefs.enabling_tag = "/*J+*/".toCharArray();
String source =
- "/*J-*/\n" +
- "@MyAnnot (\n" +
- " testAttribute = {\"test1\", \"test2\", \"test3\"}\n" +
- ")\n" +
- "/*J+*/\n" +
- "public class X\n" +
- "{\n" +
- " public void foo()\n" +
- " {\n" +
- " }\n" +
+ "/*J-*/\n" +
+ "@MyAnnot (\n" +
+ " testAttribute = {\"test1\", \"test2\", \"test3\"}\n" +
+ ")\n" +
+ "/*J+*/\n" +
+ "public class X\n" +
+ "{\n" +
+ " public void foo()\n" +
+ " {\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "/*J-*/\n" +
- "@MyAnnot (\n" +
- " testAttribute = {\"test1\", \"test2\", \"test3\"}\n" +
- ")\n" +
- "/*J+*/\n" +
- "public class X {\n" +
- " public void foo() {\n" +
- " }\n" +
+ "/*J-*/\n" +
+ "@MyAnnot (\n" +
+ " testAttribute = {\"test1\", \"test2\", \"test3\"}\n" +
+ ")\n" +
+ "/*J+*/\n" +
+ "public class X {\n" +
+ " public void foo() {\n" +
+ " }\n" +
"}\n"
);
}
@@ -6519,29 +6519,29 @@ public void testBug311582a() throws JavaModelException {
this.formatterPrefs.disabling_tag = "disable-formatter".toCharArray();
this.formatterPrefs.enabling_tag = "enable-formatter".toCharArray();
String source =
- "public class X01 {\n" +
- "\n" +
- "/* disable-formatter */\n" +
- "void foo( ) { \n" +
- " // unformatted comment\n" +
- "}\n" +
- "/* enable-formatter */\n" +
- "void bar( ) { \n" +
- " // formatted comment\n" +
- "}\n" +
+ "public class X01 {\n" +
+ "\n" +
+ "/* disable-formatter */\n" +
+ "void foo( ) { \n" +
+ " // unformatted comment\n" +
+ "}\n" +
+ "/* enable-formatter */\n" +
+ "void bar( ) { \n" +
+ " // formatted comment\n" +
+ "}\n" +
"}\n";
formatSource(source,
- "public class X01 {\n" +
- "\n" +
- " /* disable-formatter */\n" +
- " void foo() {\n" +
- " // unformatted comment\n" +
- " }\n" +
- "\n" +
- " /* enable-formatter */\n" +
- " void bar() {\n" +
- " // formatted comment\n" +
- " }\n" +
+ "public class X01 {\n" +
+ "\n" +
+ " /* disable-formatter */\n" +
+ " void foo() {\n" +
+ " // unformatted comment\n" +
+ " }\n" +
+ "\n" +
+ " /* enable-formatter */\n" +
+ " void bar() {\n" +
+ " // formatted comment\n" +
+ " }\n" +
"}\n"
);
}
@@ -6550,18 +6550,18 @@ public void testBug311582b() {
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_DISABLING_TAG, "off");
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_ENABLING_TAG, "");
String source =
- "/* off */\n" +
- "public class X01 {\n" +
- "void foo( ) { \n" +
- " // unformatted area\n" +
- "}\n" +
+ "/* off */\n" +
+ "public class X01 {\n" +
+ "void foo( ) { \n" +
+ " // unformatted area\n" +
+ "}\n" +
"}\n";
formatSource(source,
- "/* off */\n" +
- "public class X01 {\n" +
- " void foo() {\n" +
- " // unformatted area\n" +
- " }\n" +
+ "/* off */\n" +
+ "public class X01 {\n" +
+ " void foo() {\n" +
+ " // unformatted area\n" +
+ " }\n" +
"}\n"
);
}
@@ -6574,28 +6574,28 @@ public void testBug311582b() {
public void testBug311617() throws JavaModelException {
this.formatterPrefs.use_tags = true;
String source =
- "public class X01 {\n" +
- "\n" +
- "/* @formatter:off */\n" +
- "void foo( ) { \n" +
- " // unformatted comment\n" +
- "}\n" +
- "/* @formatter:on */\n" +
- "void bar( ) { \n" +
- " // formatted comment\n" +
- "}\n" +
+ "public class X01 {\n" +
+ "\n" +
+ "/* @formatter:off */\n" +
+ "void foo( ) { \n" +
+ " // unformatted comment\n" +
+ "}\n" +
+ "/* @formatter:on */\n" +
+ "void bar( ) { \n" +
+ " // formatted comment\n" +
+ "}\n" +
"}\n";
formatSource(source,
- "public class X01 {\n" +
- "\n" +
- "/* @formatter:off */\n" +
- "void foo( ) { \n" +
- " // unformatted comment\n" +
- "}\n" +
- "/* @formatter:on */\n" +
- " void bar() {\n" +
- " // formatted comment\n" +
- " }\n" +
+ "public class X01 {\n" +
+ "\n" +
+ "/* @formatter:off */\n" +
+ "void foo( ) { \n" +
+ " // unformatted comment\n" +
+ "}\n" +
+ "/* @formatter:on */\n" +
+ " void bar() {\n" +
+ " // formatted comment\n" +
+ " }\n" +
"}\n"
);
}
@@ -6603,11 +6603,11 @@ public void testBug311617b() {
this.formatterPrefs = null;
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_USE_ON_OFF_TAGS, DefaultCodeFormatterConstants.TRUE);
String source =
- "/* @formatter:off */\n" +
- "public class X01 {\n" +
- "void foo( ) { \n" +
- " // unformatted area\n" +
- "}\n" +
+ "/* @formatter:off */\n" +
+ "public class X01 {\n" +
+ "void foo( ) { \n" +
+ " // unformatted area\n" +
+ "}\n" +
"}\n";
formatSource(source);
}
@@ -6623,16 +6623,16 @@ public void testBug313524_01() throws JavaModelException {
this.formatterPrefs.wrap_outer_expressions_when_nested = false;
String source =
"public class X01 {\n" +
- " void test() {\n" +
- " foo(bar(1, 2, 3, 4), bar(5, 6, 7, 8));\n" +
- " }\n" +
+ " void test() {\n" +
+ " foo(bar(1, 2, 3, 4), bar(5, 6, 7, 8));\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X01 {\n" +
- " void test() {\n" +
- " foo(bar(1, 2, 3, 4), bar(5, 6,\n" +
- " 7, 8));\n" +
- " }\n" +
+ "public class X01 {\n" +
+ " void test() {\n" +
+ " foo(bar(1, 2, 3, 4), bar(5, 6,\n" +
+ " 7, 8));\n" +
+ " }\n" +
"}\n"
);
}
@@ -6645,17 +6645,17 @@ public void testBug313524_01b() throws JavaModelException {
DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
String source =
"public class X01 {\n" +
- " void test() {\n" +
- " foo(bar(1, 2, 3, 4), bar(5, 6, 7, 8));\n" +
- " }\n" +
+ " void test() {\n" +
+ " foo(bar(1, 2, 3, 4), bar(5, 6, 7, 8));\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X01 {\n" +
- " void test() {\n" +
- " foo(bar(1, 2, 3, 4), bar( 5, 6,\n" +
- " 7,\n" +
- " 8));\n" +
- " }\n" +
+ "public class X01 {\n" +
+ " void test() {\n" +
+ " foo(bar(1, 2, 3, 4), bar( 5, 6,\n" +
+ " 7,\n" +
+ " 8));\n" +
+ " }\n" +
"}\n"
);
}
@@ -6664,18 +6664,18 @@ public void testBug313524_02() throws JavaModelException {
this.formatterPrefs.wrap_outer_expressions_when_nested = false;
String source =
"public class X02 {\n" +
- " void test() {\n" +
- " foo(bar(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), bar(11, 12, 13, 14, 15, 16, 17, 18, 19, 20));\n" +
- " }\n" +
+ " void test() {\n" +
+ " foo(bar(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), bar(11, 12, 13, 14, 15, 16, 17, 18, 19, 20));\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X02 {\n" +
- " void test() {\n" +
- " foo(bar(1, 2, 3, 4, 5, 6, 7, 8,\n" +
- " 9, 10), bar(11, 12, 13,\n" +
- " 14, 15, 16, 17,\n" +
- " 18, 19, 20));\n" +
- " }\n" +
+ "public class X02 {\n" +
+ " void test() {\n" +
+ " foo(bar(1, 2, 3, 4, 5, 6, 7, 8,\n" +
+ " 9, 10), bar(11, 12, 13,\n" +
+ " 14, 15, 16, 17,\n" +
+ " 18, 19, 20));\n" +
+ " }\n" +
"}\n"
);
}
@@ -6688,19 +6688,19 @@ public void testBug313524_02b() throws JavaModelException {
DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
String source =
"public class X02 {\n" +
- " void test() {\n" +
- " foo(bar(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), bar(11, 12, 13, 14, 15, 16, 17, 18, 19, 20));\n" +
- " }\n" +
+ " void test() {\n" +
+ " foo(bar(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), bar(11, 12, 13, 14, 15, 16, 17, 18, 19, 20));\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X02 {\n" +
- " void test() {\n" +
- " foo(bar(1, 2, 3, 4, 5, 6, 7, 8,\n" +
- " 9, 10), bar(11, 12, 13,\n" +
- " 14, 15, 16,\n" +
- " 17, 18, 19,\n" +
- " 20));\n" +
- " }\n" +
+ "public class X02 {\n" +
+ " void test() {\n" +
+ " foo(bar(1, 2, 3, 4, 5, 6, 7, 8,\n" +
+ " 9, 10), bar(11, 12, 13,\n" +
+ " 14, 15, 16,\n" +
+ " 17, 18, 19,\n" +
+ " 20));\n" +
+ " }\n" +
"}\n"
);
}
@@ -6709,17 +6709,17 @@ public void testBug313524_03() throws JavaModelException {
this.formatterPrefs.wrap_outer_expressions_when_nested = false;
String source =
"public class X03 {\n" +
- " void test() {\n" +
- " foo(bar(1, 2, 3, 4), bar(5, 6, 7, 8), bar(9, 10, 11, 12));\n" +
- " }\n" +
+ " void test() {\n" +
+ " foo(bar(1, 2, 3, 4), bar(5, 6, 7, 8), bar(9, 10, 11, 12));\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X03 {\n" +
- " void test() {\n" +
- " foo(bar(1, 2, 3, 4), bar(5, 6,\n" +
- " 7, 8), bar(9, 10, 11,\n" +
- " 12));\n" +
- " }\n" +
+ "public class X03 {\n" +
+ " void test() {\n" +
+ " foo(bar(1, 2, 3, 4), bar(5, 6,\n" +
+ " 7, 8), bar(9, 10, 11,\n" +
+ " 12));\n" +
+ " }\n" +
"}\n"
);
}
@@ -6732,18 +6732,18 @@ public void testBug313524_03b() throws JavaModelException {
DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
String source =
"public class X03 {\n" +
- " void test() {\n" +
- " foo(bar(1, 2, 3, 4), bar(5, 6, 7, 8), bar(9, 10, 11, 12));\n" +
- " }\n" +
+ " void test() {\n" +
+ " foo(bar(1, 2, 3, 4), bar(5, 6, 7, 8), bar(9, 10, 11, 12));\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X03 {\n" +
- " void test() {\n" +
- " foo(bar(1, 2, 3, 4), bar( 5, 6,\n" +
- " 7,\n" +
- " 8),\n" +
- " bar(9, 10, 11, 12));\n" +
- " }\n" +
+ "public class X03 {\n" +
+ " void test() {\n" +
+ " foo(bar(1, 2, 3, 4), bar( 5, 6,\n" +
+ " 7,\n" +
+ " 8),\n" +
+ " bar(9, 10, 11, 12));\n" +
+ " }\n" +
"}\n"
);
}
@@ -6752,50 +6752,50 @@ public void testBug313524_146175() throws JavaModelException {
this.formatterPrefs.wrap_outer_expressions_when_nested = false;
setPageWidth80();
String source =
- "public class FormatterDemo {\n" +
- "\n" +
- " public void fooBar() {\n" +
- " SomeOtherClass instanceOfOtherClass = new SomeOtherClass();\n" +
- "\n" +
- " /* The following statement demonstrates the formatter issue */\n" +
- " SomeOtherClass.someMethodInInnerClass(\n" +
- " instanceOfOtherClass.anotherMethod(\"Value of paramter 1\"),\n" +
- " instanceOfOtherClass.anotherMethod(\"Value of paramter 2\"));\n" +
- "\n" +
- " }\n" +
- "\n" +
- " private static class SomeOtherClass {\n" +
- " public static void someMethodInInnerClass(\n" +
- " String param1,\n" +
- " String param2) {\n" +
- " }\n" +
- " public String anotherMethod(String par) {\n" +
- " return par;\n" +
- " }\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "public class FormatterDemo {\n" +
- "\n" +
- " public void fooBar() {\n" +
- " SomeOtherClass instanceOfOtherClass = new SomeOtherClass();\n" +
- "\n" +
- " /* The following statement demonstrates the formatter issue */\n" +
- " SomeOtherClass.someMethodInInnerClass(instanceOfOtherClass\n" +
- " .anotherMethod(\"Value of paramter 1\"), instanceOfOtherClass\n" +
- " .anotherMethod(\"Value of paramter 2\"));\n" +
- "\n" +
- " }\n" +
- "\n" +
- " private static class SomeOtherClass {\n" +
- " public static void someMethodInInnerClass(String param1,\n" +
- " String param2) {\n" +
- " }\n" +
- "\n" +
- " public String anotherMethod(String par) {\n" +
- " return par;\n" +
- " }\n" +
- " }\n" +
+ "public class FormatterDemo {\n" +
+ "\n" +
+ " public void fooBar() {\n" +
+ " SomeOtherClass instanceOfOtherClass = new SomeOtherClass();\n" +
+ "\n" +
+ " /* The following statement demonstrates the formatter issue */\n" +
+ " SomeOtherClass.someMethodInInnerClass(\n" +
+ " instanceOfOtherClass.anotherMethod(\"Value of paramter 1\"),\n" +
+ " instanceOfOtherClass.anotherMethod(\"Value of paramter 2\"));\n" +
+ "\n" +
+ " }\n" +
+ "\n" +
+ " private static class SomeOtherClass {\n" +
+ " public static void someMethodInInnerClass(\n" +
+ " String param1,\n" +
+ " String param2) {\n" +
+ " }\n" +
+ " public String anotherMethod(String par) {\n" +
+ " return par;\n" +
+ " }\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "public class FormatterDemo {\n" +
+ "\n" +
+ " public void fooBar() {\n" +
+ " SomeOtherClass instanceOfOtherClass = new SomeOtherClass();\n" +
+ "\n" +
+ " /* The following statement demonstrates the formatter issue */\n" +
+ " SomeOtherClass.someMethodInInnerClass(instanceOfOtherClass\n" +
+ " .anotherMethod(\"Value of paramter 1\"), instanceOfOtherClass\n" +
+ " .anotherMethod(\"Value of paramter 2\"));\n" +
+ "\n" +
+ " }\n" +
+ "\n" +
+ " private static class SomeOtherClass {\n" +
+ " public static void someMethodInInnerClass(String param1,\n" +
+ " String param2) {\n" +
+ " }\n" +
+ "\n" +
+ " public String anotherMethod(String par) {\n" +
+ " return par;\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -6808,18 +6808,18 @@ public void testBug313524_164093_01() throws JavaModelException {
DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
String source =
- "public class Test {\n" +
- " int someLongMethodName(int foo, boolean bar, String yetAnotherArg) {\n" +
- " return 0;\n" +
- " }\n" +
+ "public class Test {\n" +
+ " int someLongMethodName(int foo, boolean bar, String yetAnotherArg) {\n" +
+ " return 0;\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- " int someLongMethodName( int foo,\n" +
- " boolean bar,\n" +
- " String yetAnotherArg) {\n" +
- " return 0;\n" +
- " }\n" +
+ "public class Test {\n" +
+ " int someLongMethodName( int foo,\n" +
+ " boolean bar,\n" +
+ " String yetAnotherArg) {\n" +
+ " return 0;\n" +
+ " }\n" +
"}\n"
);
}
@@ -6832,20 +6832,20 @@ public void testBug313524_164093_02() throws JavaModelException {
DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SELECTOR_IN_METHOD_INVOCATION,
DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
String source =
- "public class X01 {\n" +
- " void foo() {\n" +
- " someIdentifier(someArg).someMethodName().someMethodName(foo, bar).otherMethod(arg0, arg1);\n" +
- " }\n" +
+ "public class X01 {\n" +
+ " void foo() {\n" +
+ " someIdentifier(someArg).someMethodName().someMethodName(foo, bar).otherMethod(arg0, arg1);\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X01 {\n" +
- " void foo() {\n" +
- " someIdentifier(someArg).someMethodName()\n" +
- " .someMethodName(foo,\n" +
- " bar)\n" +
- " .otherMethod(arg0,\n" +
- " arg1);\n" +
- " }\n" +
+ "public class X01 {\n" +
+ " void foo() {\n" +
+ " someIdentifier(someArg).someMethodName()\n" +
+ " .someMethodName(foo,\n" +
+ " bar)\n" +
+ " .otherMethod(arg0,\n" +
+ " arg1);\n" +
+ " }\n" +
"}\n"
);
}
@@ -6854,23 +6854,23 @@ public void testBug313524_203588() throws JavaModelException {
this.formatterPrefs.wrap_outer_expressions_when_nested = false;
setPageWidth80();
String source =
- "public class Test {\n" +
- "public void a()\n" +
- "{\n" +
- " if(true)\n" +
- " {\n" +
- " allocation.add(idx_ta + 1, Double.valueOf(allocation.get(idx_ta).doubleValue() + q));\n" +
- " }\n" +
- "}\n" +
+ "public class Test {\n" +
+ "public void a()\n" +
+ "{\n" +
+ " if(true)\n" +
+ " {\n" +
+ " allocation.add(idx_ta + 1, Double.valueOf(allocation.get(idx_ta).doubleValue() + q));\n" +
+ " }\n" +
+ "}\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- " public void a() {\n" +
- " if (true) {\n" +
- " allocation.add(idx_ta + 1, Double.valueOf(allocation.get(idx_ta)\n" +
- " .doubleValue() + q));\n" +
- " }\n" +
- " }\n" +
+ "public class Test {\n" +
+ " public void a() {\n" +
+ " if (true) {\n" +
+ " allocation.add(idx_ta + 1, Double.valueOf(allocation.get(idx_ta)\n" +
+ " .doubleValue() + q));\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -6879,17 +6879,17 @@ public void testBug313524_wksp1_01() throws JavaModelException {
this.formatterPrefs.wrap_outer_expressions_when_nested = false;
setPageWidth80();
String source =
- "public class X01 {\n" +
- " private void reportError(String name) throws ParseError {\n" +
- " throw new ParseError(MessageFormat.format(AntDTDSchemaMessages.getString(\"NfmParser.Ambiguous\"), new String[]{name})); //$NON-NLS-1$\n" +
- " }\n" +
+ "public class X01 {\n" +
+ " private void reportError(String name) throws ParseError {\n" +
+ " throw new ParseError(MessageFormat.format(AntDTDSchemaMessages.getString(\"NfmParser.Ambiguous\"), new String[]{name})); //$NON-NLS-1$\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X01 {\n" +
- " private void reportError(String name) throws ParseError {\n" +
- " throw new ParseError(MessageFormat.format(AntDTDSchemaMessages\n" +
- " .getString(\"NfmParser.Ambiguous\"), new String[] { name })); //$NON-NLS-1$\n" +
- " }\n" +
+ "public class X01 {\n" +
+ " private void reportError(String name) throws ParseError {\n" +
+ " throw new ParseError(MessageFormat.format(AntDTDSchemaMessages\n" +
+ " .getString(\"NfmParser.Ambiguous\"), new String[] { name })); //$NON-NLS-1$\n" +
+ " }\n" +
"}\n"
);
}
@@ -6897,34 +6897,34 @@ public void testBug313524_wksp1_02() throws JavaModelException {
this.formatterPrefs.wrap_outer_expressions_when_nested = false;
setPageWidth80();
String source =
- "public class X02 {\n" +
- " private void parseBuildFile(Project project) {\n" +
- " if (!buildFile.exists()) {\n" +
- " throw new BuildException(MessageFormat.format(InternalAntMessages.getString(\"InternalAntRunner.Buildfile__{0}_does_not_exist_!_1\"), //$NON-NLS-1$\n" +
- " new String[]{buildFile.getAbsolutePath()}));\n" +
- " }\n" +
- " if (!buildFile.isFile()) {\n" +
- " throw new BuildException(MessageFormat.format(InternalAntMessages.getString(\"InternalAntRunner.Buildfile__{0}_is_not_a_file_1\"), //$NON-NLS-1$\n" +
- " new String[]{buildFile.getAbsolutePath()}));\n" +
- " }\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "public class X02 {\n" +
- " private void parseBuildFile(Project project) {\n" +
- " if (!buildFile.exists()) {\n" +
- " throw new BuildException(MessageFormat.format(InternalAntMessages\n" +
- " .getString(\n" +
- " \"InternalAntRunner.Buildfile__{0}_does_not_exist_!_1\"), //$NON-NLS-1$\n" +
- " new String[] { buildFile.getAbsolutePath() }));\n" +
- " }\n" +
- " if (!buildFile.isFile()) {\n" +
- " throw new BuildException(MessageFormat.format(InternalAntMessages\n" +
- " .getString(\n" +
- " \"InternalAntRunner.Buildfile__{0}_is_not_a_file_1\"), //$NON-NLS-1$\n" +
- " new String[] { buildFile.getAbsolutePath() }));\n" +
- " }\n" +
- " }\n" +
+ "public class X02 {\n" +
+ " private void parseBuildFile(Project project) {\n" +
+ " if (!buildFile.exists()) {\n" +
+ " throw new BuildException(MessageFormat.format(InternalAntMessages.getString(\"InternalAntRunner.Buildfile__{0}_does_not_exist_!_1\"), //$NON-NLS-1$\n" +
+ " new String[]{buildFile.getAbsolutePath()}));\n" +
+ " }\n" +
+ " if (!buildFile.isFile()) {\n" +
+ " throw new BuildException(MessageFormat.format(InternalAntMessages.getString(\"InternalAntRunner.Buildfile__{0}_is_not_a_file_1\"), //$NON-NLS-1$\n" +
+ " new String[]{buildFile.getAbsolutePath()}));\n" +
+ " }\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "public class X02 {\n" +
+ " private void parseBuildFile(Project project) {\n" +
+ " if (!buildFile.exists()) {\n" +
+ " throw new BuildException(MessageFormat.format(InternalAntMessages\n" +
+ " .getString(\n" +
+ " \"InternalAntRunner.Buildfile__{0}_does_not_exist_!_1\"), //$NON-NLS-1$\n" +
+ " new String[] { buildFile.getAbsolutePath() }));\n" +
+ " }\n" +
+ " if (!buildFile.isFile()) {\n" +
+ " throw new BuildException(MessageFormat.format(InternalAntMessages\n" +
+ " .getString(\n" +
+ " \"InternalAntRunner.Buildfile__{0}_is_not_a_file_1\"), //$NON-NLS-1$\n" +
+ " new String[] { buildFile.getAbsolutePath() }));\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -6932,19 +6932,19 @@ public void testBug313524_wksp1_03() throws JavaModelException {
this.formatterPrefs.wrap_outer_expressions_when_nested = false;
setPageWidth80();
String source =
- "public class X03 {\n" +
- "\n" +
- " protected void foo() {\n" +
- " printTargets(project, subNames, null, InternalAntMessages.getString(\"InternalAntRunner.Subtargets__5\"), 0); //$NON-NLS-1$\n" +
- " }\n" +
+ "public class X03 {\n" +
+ "\n" +
+ " protected void foo() {\n" +
+ " printTargets(project, subNames, null, InternalAntMessages.getString(\"InternalAntRunner.Subtargets__5\"), 0); //$NON-NLS-1$\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X03 {\n" +
- "\n" +
- " protected void foo() {\n" +
- " printTargets(project, subNames, null, InternalAntMessages.getString(\n" +
- " \"InternalAntRunner.Subtargets__5\"), 0); //$NON-NLS-1$\n" +
- " }\n" +
+ "public class X03 {\n" +
+ "\n" +
+ " protected void foo() {\n" +
+ " printTargets(project, subNames, null, InternalAntMessages.getString(\n" +
+ " \"InternalAntRunner.Subtargets__5\"), 0); //$NON-NLS-1$\n" +
+ " }\n" +
"}\n"
);
}
@@ -6952,40 +6952,40 @@ public void testBug313524_wksp1_04() throws JavaModelException {
this.formatterPrefs.wrap_outer_expressions_when_nested = false;
setPageWidth80();
String source =
- "public class X04 {\n" +
- " void foo() {\n" +
- " if (AntUIPlugin.getDefault().getPreferenceStore().getBoolean(IAntUIPreferenceConstants.OUTLINE_LINK_WITH_EDITOR)) {\n" +
- " synchronizeOutlinePage(node, true);\n" +
- " }\n" +
- " }\n" +
+ "public class X04 {\n" +
+ " void foo() {\n" +
+ " if (AntUIPlugin.getDefault().getPreferenceStore().getBoolean(IAntUIPreferenceConstants.OUTLINE_LINK_WITH_EDITOR)) {\n" +
+ " synchronizeOutlinePage(node, true);\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X04 {\n" +
- " void foo() {\n" +
- " if (AntUIPlugin.getDefault().getPreferenceStore().getBoolean(\n" +
- " IAntUIPreferenceConstants.OUTLINE_LINK_WITH_EDITOR)) {\n" +
- " synchronizeOutlinePage(node, true);\n" +
- " }\n" +
- " }\n" +
+ "public class X04 {\n" +
+ " void foo() {\n" +
+ " if (AntUIPlugin.getDefault().getPreferenceStore().getBoolean(\n" +
+ " IAntUIPreferenceConstants.OUTLINE_LINK_WITH_EDITOR)) {\n" +
+ " synchronizeOutlinePage(node, true);\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
public void testBug313524_wksp1_05() throws JavaModelException {
this.formatterPrefs.wrap_outer_expressions_when_nested = false;
String source =
- "public class X05 {\n" +
- "void foo() {\n" +
- " if (false && AntUIPlugin.getDefault().getPreferenceStore().getBoolean(AntEditorPreferenceConstants.TEMPLATES_USE_CODEFORMATTER)) {\n" +
- " }\n" +
- "}\n" +
+ "public class X05 {\n" +
+ "void foo() {\n" +
+ " if (false && AntUIPlugin.getDefault().getPreferenceStore().getBoolean(AntEditorPreferenceConstants.TEMPLATES_USE_CODEFORMATTER)) {\n" +
+ " }\n" +
+ "}\n" +
"}\n";
formatSource(source,
- "public class X05 {\n" +
- " void foo() {\n" +
- " if (false && AntUIPlugin.getDefault().getPreferenceStore().getBoolean(\n" +
- " AntEditorPreferenceConstants.TEMPLATES_USE_CODEFORMATTER)) {\n" +
- " }\n" +
- " }\n" +
+ "public class X05 {\n" +
+ " void foo() {\n" +
+ " if (false && AntUIPlugin.getDefault().getPreferenceStore().getBoolean(\n" +
+ " AntEditorPreferenceConstants.TEMPLATES_USE_CODEFORMATTER)) {\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -6994,28 +6994,28 @@ public void testBug313524_wksp1_06() throws JavaModelException {
this.formatterPrefs.wrap_outer_expressions_when_nested = false;
setPageWidth80();
String source =
- "public class X06 {\n" +
- " public void launch() {\n" +
- " try {\n" +
- " if ((javaProject == null) || !javaProject.exists()) {\n" +
- " abort(PDEPlugin________.getResourceString(\"JUnitLaunchConfig_____\"), null, IJavaLaunchConfigurationConstants.ERR_NOT_A_JAVA_PROJECT);\n" +
- " }\n" +
- " } catch (CoreException e) {\n" +
- " }\n" +
- " }\n" +
+ "public class X06 {\n" +
+ " public void launch() {\n" +
+ " try {\n" +
+ " if ((javaProject == null) || !javaProject.exists()) {\n" +
+ " abort(PDEPlugin________.getResourceString(\"JUnitLaunchConfig_____\"), null, IJavaLaunchConfigurationConstants.ERR_NOT_A_JAVA_PROJECT);\n" +
+ " }\n" +
+ " } catch (CoreException e) {\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X06 {\n" +
- " public void launch() {\n" +
- " try {\n" +
- " if ((javaProject == null) || !javaProject.exists()) {\n" +
- " abort(PDEPlugin________.getResourceString(\n" +
- " \"JUnitLaunchConfig_____\"), null,\n" +
- " IJavaLaunchConfigurationConstants.ERR_NOT_A_JAVA_PROJECT);\n" +
- " }\n" +
- " } catch (CoreException e) {\n" +
- " }\n" +
- " }\n" +
+ "public class X06 {\n" +
+ " public void launch() {\n" +
+ " try {\n" +
+ " if ((javaProject == null) || !javaProject.exists()) {\n" +
+ " abort(PDEPlugin________.getResourceString(\n" +
+ " \"JUnitLaunchConfig_____\"), null,\n" +
+ " IJavaLaunchConfigurationConstants.ERR_NOT_A_JAVA_PROJECT);\n" +
+ " }\n" +
+ " } catch (CoreException e) {\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -7023,22 +7023,22 @@ public void testBug313524_wksp1_07() throws JavaModelException {
this.formatterPrefs.wrap_outer_expressions_when_nested = false;
setPageWidth80();
String source =
- "public class X07 {\n" +
- " void foo() {\n" +
- " if (true) {\n" +
- " configureAntObject(result, element, task, task.getTaskName(), InternalCoreAntMessages.getString(\"AntCorePreferences.No_library_for_task\")); //$NON-NLS-1$\n" +
- " }\n" +
- " }\n" +
+ "public class X07 {\n" +
+ " void foo() {\n" +
+ " if (true) {\n" +
+ " configureAntObject(result, element, task, task.getTaskName(), InternalCoreAntMessages.getString(\"AntCorePreferences.No_library_for_task\")); //$NON-NLS-1$\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X07 {\n" +
- " void foo() {\n" +
- " if (true) {\n" +
- " configureAntObject(result, element, task, task.getTaskName(),\n" +
- " InternalCoreAntMessages.getString(\n" +
- " \"AntCorePreferences.No_library_for_task\")); //$NON-NLS-1$\n" +
- " }\n" +
- " }\n" +
+ "public class X07 {\n" +
+ " void foo() {\n" +
+ " if (true) {\n" +
+ " configureAntObject(result, element, task, task.getTaskName(),\n" +
+ " InternalCoreAntMessages.getString(\n" +
+ " \"AntCorePreferences.No_library_for_task\")); //$NON-NLS-1$\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -7046,24 +7046,24 @@ public void testBug313524_wksp1_08() throws JavaModelException {
this.formatterPrefs.wrap_outer_expressions_when_nested = false;
setPageWidth80();
String source =
- "public class X08 {\n" +
- " public void foo() {\n" +
- " if (true) {\n" +
- " IStatus status= new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_RUNNING_BUILD, MessageFormat.format(InternalCoreAntMessages.getString(\"AntRunner.Already_in_progess\"), new String[]{buildFileLocation}), null); //$NON-NLS-1$\n" +
- " }\n" +
- " }\n" +
+ "public class X08 {\n" +
+ " public void foo() {\n" +
+ " if (true) {\n" +
+ " IStatus status= new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_RUNNING_BUILD, MessageFormat.format(InternalCoreAntMessages.getString(\"AntRunner.Already_in_progess\"), new String[]{buildFileLocation}), null); //$NON-NLS-1$\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X08 {\n" +
- " public void foo() {\n" +
- " if (true) {\n" +
- " IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE,\n" +
- " AntCorePlugin.ERROR_RUNNING_BUILD, MessageFormat.format(\n" +
- " InternalCoreAntMessages.getString(\n" +
- " \"AntRunner.Already_in_progess\"), //$NON-NLS-1$\n" +
- " new String[] { buildFileLocation }), null);\n" +
- " }\n" +
- " }\n" +
+ "public class X08 {\n" +
+ " public void foo() {\n" +
+ " if (true) {\n" +
+ " IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE,\n" +
+ " AntCorePlugin.ERROR_RUNNING_BUILD, MessageFormat.format(\n" +
+ " InternalCoreAntMessages.getString(\n" +
+ " \"AntRunner.Already_in_progess\"), //$NON-NLS-1$\n" +
+ " new String[] { buildFileLocation }), null);\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -7071,22 +7071,22 @@ public void testBug313524_wksp1_09() throws JavaModelException {
this.formatterPrefs.wrap_outer_expressions_when_nested = false;
setPageWidth80();
String source =
- "public class X09 {\n" +
- " void foo() {\n" +
- " if (true) {\n" +
- " String secondFileName = secondDirectoryAbsolutePath + File.separator + currentFile.substring(firstDirectoryAbsolutePath.length() + 1);\n" +
- " }\n" +
- " }\n" +
+ "public class X09 {\n" +
+ " void foo() {\n" +
+ " if (true) {\n" +
+ " String secondFileName = secondDirectoryAbsolutePath + File.separator + currentFile.substring(firstDirectoryAbsolutePath.length() + 1);\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X09 {\n" +
- " void foo() {\n" +
- " if (true) {\n" +
- " String secondFileName = secondDirectoryAbsolutePath + File.separator\n" +
- " + currentFile.substring(firstDirectoryAbsolutePath.length()\n" +
- " + 1);\n" +
- " }\n" +
- " }\n" +
+ "public class X09 {\n" +
+ " void foo() {\n" +
+ " if (true) {\n" +
+ " String secondFileName = secondDirectoryAbsolutePath + File.separator\n" +
+ " + currentFile.substring(firstDirectoryAbsolutePath.length()\n" +
+ " + 1);\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -7094,25 +7094,25 @@ public void testBug313524_wksp1_10() throws JavaModelException {
this.formatterPrefs.wrap_outer_expressions_when_nested = false;
setPageWidth80();
String source =
- "public class X10 {\n" +
- " void foo() {\n" +
- " if (true) {\n" +
- " if (true) {\n" +
- " throw new BuildException(InternalAntMessages.getString(\"InternalAntRunner.Could_not_load_the_version_information._10\")); //$NON-NLS-1$\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "public class X10 {\n" +
+ " void foo() {\n" +
+ " if (true) {\n" +
+ " if (true) {\n" +
+ " throw new BuildException(InternalAntMessages.getString(\"InternalAntRunner.Could_not_load_the_version_information._10\")); //$NON-NLS-1$\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X10 {\n" +
- " void foo() {\n" +
- " if (true) {\n" +
- " if (true) {\n" +
- " throw new BuildException(InternalAntMessages.getString(\n" +
- " \"InternalAntRunner.Could_not_load_the_version_information._10\")); //$NON-NLS-1$\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "public class X10 {\n" +
+ " void foo() {\n" +
+ " if (true) {\n" +
+ " if (true) {\n" +
+ " throw new BuildException(InternalAntMessages.getString(\n" +
+ " \"InternalAntRunner.Could_not_load_the_version_information._10\")); //$NON-NLS-1$\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -7120,17 +7120,17 @@ public void testBug313524_wksp1_11() throws JavaModelException {
this.formatterPrefs.wrap_outer_expressions_when_nested = false;
setPageWidth80();
String source =
- "public class X11 {\n" +
- " private void antFileNotFound() {\n" +
- " reportError(AntLaunchConfigurationMessages.getString(\"AntLaunchShortcut.Unable\"), null); //$NON-NLS-1$ \n" +
- " }\n" +
+ "public class X11 {\n" +
+ " private void antFileNotFound() {\n" +
+ " reportError(AntLaunchConfigurationMessages.getString(\"AntLaunchShortcut.Unable\"), null); //$NON-NLS-1$ \n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X11 {\n" +
- " private void antFileNotFound() {\n" +
- " reportError(AntLaunchConfigurationMessages.getString(\n" +
- " \"AntLaunchShortcut.Unable\"), null); //$NON-NLS-1$\n" +
- " }\n" +
+ "public class X11 {\n" +
+ " private void antFileNotFound() {\n" +
+ " reportError(AntLaunchConfigurationMessages.getString(\n" +
+ " \"AntLaunchShortcut.Unable\"), null); //$NON-NLS-1$\n" +
+ " }\n" +
"}\n"
);
}
@@ -7138,22 +7138,22 @@ public void testBug313524_wksp1_12() throws JavaModelException {
this.formatterPrefs.wrap_outer_expressions_when_nested = false;
setPageWidth80();
String source =
- "public class X12 {\n" +
- " void foo() {\n" +
- " if (this.fTests.size() == 0) {\n" +
- " this.addTest(TestSuite\n" +
- " .warning(\"No tests found in \" + theClass.getName())); //$NON-NLS-1$\n" +
- " }\n" +
- " }\n" +
+ "public class X12 {\n" +
+ " void foo() {\n" +
+ " if (this.fTests.size() == 0) {\n" +
+ " this.addTest(TestSuite\n" +
+ " .warning(\"No tests found in \" + theClass.getName())); //$NON-NLS-1$\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X12 {\n" +
- " void foo() {\n" +
- " if (this.fTests.size() == 0) {\n" +
+ "public class X12 {\n" +
+ " void foo() {\n" +
+ " if (this.fTests.size() == 0) {\n" +
" this.addTest(TestSuite.warning(\"No tests found in \" + theClass //$NON-NLS-1$\n" +
- " .getName()));\n" +
- " }\n" +
- " }\n" +
+ " .getName()));\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -7166,34 +7166,34 @@ public void testBug313524_wksp1_12() throws JavaModelException {
public void testBug317039_njl() {
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "public class X01\n" +
- " {\n" +
- "\n" +
- " public void innerThread()\n" +
- " {\n" +
- "\n" +
- " new Thread(new Runnable()\n" +
- " {\n" +
- " @Override\n" +
- " public void run()\n" +
- " {\n" +
- " // TODO Auto-generated method stub\n" +
- " }\n" +
- " }).start();\n" +
- " }\n" +
+ "public class X01\n" +
+ " {\n" +
+ "\n" +
+ " public void innerThread()\n" +
+ " {\n" +
+ "\n" +
+ " new Thread(new Runnable()\n" +
+ " {\n" +
+ " @Override\n" +
+ " public void run()\n" +
+ " {\n" +
+ " // TODO Auto-generated method stub\n" +
+ " }\n" +
+ " }).start();\n" +
+ " }\n" +
" }\n";
formatSource(source,
- "public class X01 {\n" +
- "\n" +
- " public void innerThread() {\n" +
- "\n" +
- " new Thread(new Runnable() {\n" +
- " @Override\n" +
- " public void run() {\n" +
- " // TODO Auto-generated method stub\n" +
- " }\n" +
- " }).start();\n" +
- " }\n" +
+ "public class X01 {\n" +
+ "\n" +
+ " public void innerThread() {\n" +
+ "\n" +
+ " new Thread(new Runnable() {\n" +
+ " @Override\n" +
+ " public void run() {\n" +
+ " // TODO Auto-generated method stub\n" +
+ " }\n" +
+ " }).start();\n" +
+ " }\n" +
"}\n"
);
}
@@ -7205,285 +7205,285 @@ public void testBug317039_njl() {
*/
public void testBug320754_00() throws JavaModelException {
String source =
- "public class X00\n" +
- "{\n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " int a=0;int b;\n" +
- "\n" +
- " System.out.println(a);\n" +
- "\n" +
- " }\n" +
+ "public class X00\n" +
+ "{\n" +
+ " public static void main(String[] args)\n" +
+ " {\n" +
+ " int a=0;int b;\n" +
+ "\n" +
+ " System.out.println(a);\n" +
+ "\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X00 {\n" +
- " public static void main(String[] args) {\n" +
- " int a = 0;\n" +
- " int b;\n" +
- "\n" +
- " System.out.println(a);\n" +
- "\n" +
- " }\n" +
+ "public class X00 {\n" +
+ " public static void main(String[] args) {\n" +
+ " int a = 0;\n" +
+ " int b;\n" +
+ "\n" +
+ " System.out.println(a);\n" +
+ "\n" +
+ " }\n" +
"}\n"
);
}
public void testBug320754_01a() throws JavaModelException {
this.formatterPrefs.use_tags = true;
String source =
- "//@formatter:off\n" +
- "//@formatter:on\n" +
- "public class X01a\n" +
- "{\n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " int a=0;int b;\n" +
- "\n" +
- " System.out.println(a);\n" +
- "\n" +
- " }\n" +
+ "//@formatter:off\n" +
+ "//@formatter:on\n" +
+ "public class X01a\n" +
+ "{\n" +
+ " public static void main(String[] args)\n" +
+ " {\n" +
+ " int a=0;int b;\n" +
+ "\n" +
+ " System.out.println(a);\n" +
+ "\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "//@formatter:off\n" +
- "//@formatter:on\n" +
- "public class X01a {\n" +
- " public static void main(String[] args) {\n" +
- " int a = 0;\n" +
- " int b;\n" +
- "\n" +
- " System.out.println(a);\n" +
- "\n" +
- " }\n" +
+ "//@formatter:off\n" +
+ "//@formatter:on\n" +
+ "public class X01a {\n" +
+ " public static void main(String[] args) {\n" +
+ " int a = 0;\n" +
+ " int b;\n" +
+ "\n" +
+ " System.out.println(a);\n" +
+ "\n" +
+ " }\n" +
"}\n"
);
}
public void testBug320754_01b() throws JavaModelException {
this.formatterPrefs.use_tags = true;
String source =
- "/* @formatter:off */\n" +
- "/* @formatter:on */\n" +
- "public class X01b\n" +
- "{\n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " int a=0;int b;\n" +
- "\n" +
- " System.out.println(a);\n" +
- "\n" +
- " }\n" +
+ "/* @formatter:off */\n" +
+ "/* @formatter:on */\n" +
+ "public class X01b\n" +
+ "{\n" +
+ " public static void main(String[] args)\n" +
+ " {\n" +
+ " int a=0;int b;\n" +
+ "\n" +
+ " System.out.println(a);\n" +
+ "\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "/* @formatter:off */\n" +
- "/* @formatter:on */\n" +
- "public class X01b {\n" +
- " public static void main(String[] args) {\n" +
- " int a = 0;\n" +
- " int b;\n" +
- "\n" +
- " System.out.println(a);\n" +
- "\n" +
- " }\n" +
+ "/* @formatter:off */\n" +
+ "/* @formatter:on */\n" +
+ "public class X01b {\n" +
+ " public static void main(String[] args) {\n" +
+ " int a = 0;\n" +
+ " int b;\n" +
+ "\n" +
+ " System.out.println(a);\n" +
+ "\n" +
+ " }\n" +
"}\n"
);
}
public void testBug320754_01c() throws JavaModelException {
this.formatterPrefs.use_tags = true;
String source =
- "/** @formatter:off */\n" +
- "/** @formatter:on */\n" +
- "public class X01c\n" +
- "{\n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " int a=0;int b;\n" +
- "\n" +
- " System.out.println(a);\n" +
- "\n" +
- " }\n" +
+ "/** @formatter:off */\n" +
+ "/** @formatter:on */\n" +
+ "public class X01c\n" +
+ "{\n" +
+ " public static void main(String[] args)\n" +
+ " {\n" +
+ " int a=0;int b;\n" +
+ "\n" +
+ " System.out.println(a);\n" +
+ "\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "/** @formatter:off */\n" +
- "/** @formatter:on */\n" +
- "public class X01c {\n" +
- " public static void main(String[] args) {\n" +
- " int a = 0;\n" +
- " int b;\n" +
- "\n" +
- " System.out.println(a);\n" +
- "\n" +
- " }\n" +
+ "/** @formatter:off */\n" +
+ "/** @formatter:on */\n" +
+ "public class X01c {\n" +
+ " public static void main(String[] args) {\n" +
+ " int a = 0;\n" +
+ " int b;\n" +
+ "\n" +
+ " System.out.println(a);\n" +
+ "\n" +
+ " }\n" +
"}\n"
);
}
public void testBug320754_02a() throws JavaModelException {
this.formatterPrefs.use_tags = true;
String source =
- "//@formatter:off\n" +
- "@MyAnnot (\n" +
- " testAttribute = {\"test1\", \"test2\", \"test3\"}\n" +
- ")\n" +
- "//@formatter:on\n" +
- "public class X02\n" +
- "{\n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " int a=0;int b;\n" +
- "\n" +
- " System.out.println(a);\n" +
- "\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "//@formatter:off\n" +
- "@MyAnnot (\n" +
- " testAttribute = {\"test1\", \"test2\", \"test3\"}\n" +
- ")\n" +
- "//@formatter:on\n" +
- "public class X02 {\n" +
- " public static void main(String[] args) {\n" +
- " int a = 0;\n" +
- " int b;\n" +
- "\n" +
- " System.out.println(a);\n" +
- "\n" +
- " }\n" +
+ "//@formatter:off\n" +
+ "@MyAnnot (\n" +
+ " testAttribute = {\"test1\", \"test2\", \"test3\"}\n" +
+ ")\n" +
+ "//@formatter:on\n" +
+ "public class X02\n" +
+ "{\n" +
+ " public static void main(String[] args)\n" +
+ " {\n" +
+ " int a=0;int b;\n" +
+ "\n" +
+ " System.out.println(a);\n" +
+ "\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "//@formatter:off\n" +
+ "@MyAnnot (\n" +
+ " testAttribute = {\"test1\", \"test2\", \"test3\"}\n" +
+ ")\n" +
+ "//@formatter:on\n" +
+ "public class X02 {\n" +
+ " public static void main(String[] args) {\n" +
+ " int a = 0;\n" +
+ " int b;\n" +
+ "\n" +
+ " System.out.println(a);\n" +
+ "\n" +
+ " }\n" +
"}\n"
);
}
public void testBug320754_02b() throws JavaModelException {
this.formatterPrefs.use_tags = true;
String source =
- "/* @formatter:off */\n" +
- "@MyAnnot (\n" +
- " testAttribute = {\"test1\", \"test2\", \"test3\"}\n" +
- ")\n" +
- "/* @formatter:on */\n" +
- "public class X02b\n" +
- "{\n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " int a=0;int b;\n" +
- "\n" +
- " System.out.println(a);\n" +
- "\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "/* @formatter:off */\n" +
- "@MyAnnot (\n" +
- " testAttribute = {\"test1\", \"test2\", \"test3\"}\n" +
- ")\n" +
- "/* @formatter:on */\n" +
- "public class X02b {\n" +
- " public static void main(String[] args) {\n" +
- " int a = 0;\n" +
- " int b;\n" +
- "\n" +
- " System.out.println(a);\n" +
- "\n" +
- " }\n" +
+ "/* @formatter:off */\n" +
+ "@MyAnnot (\n" +
+ " testAttribute = {\"test1\", \"test2\", \"test3\"}\n" +
+ ")\n" +
+ "/* @formatter:on */\n" +
+ "public class X02b\n" +
+ "{\n" +
+ " public static void main(String[] args)\n" +
+ " {\n" +
+ " int a=0;int b;\n" +
+ "\n" +
+ " System.out.println(a);\n" +
+ "\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "/* @formatter:off */\n" +
+ "@MyAnnot (\n" +
+ " testAttribute = {\"test1\", \"test2\", \"test3\"}\n" +
+ ")\n" +
+ "/* @formatter:on */\n" +
+ "public class X02b {\n" +
+ " public static void main(String[] args) {\n" +
+ " int a = 0;\n" +
+ " int b;\n" +
+ "\n" +
+ " System.out.println(a);\n" +
+ "\n" +
+ " }\n" +
"}\n"
);
}
public void testBug320754_02c() throws JavaModelException {
this.formatterPrefs.use_tags = true;
String source =
- "/** @formatter:off */\n" +
- "@MyAnnot (\n" +
- " testAttribute = {\"test1\", \"test2\", \"test3\"}\n" +
- ")\n" +
- "/** @formatter:on */\n" +
- "public class X02c\n" +
- "{\n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " int a=0;int b;\n" +
- "\n" +
- " System.out.println(a);\n" +
- "\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "/** @formatter:off */\n" +
- "@MyAnnot (\n" +
- " testAttribute = {\"test1\", \"test2\", \"test3\"}\n" +
- ")\n" +
- "/** @formatter:on */\n" +
- "public class X02c {\n" +
- " public static void main(String[] args) {\n" +
- " int a = 0;\n" +
- " int b;\n" +
- "\n" +
- " System.out.println(a);\n" +
- "\n" +
- " }\n" +
+ "/** @formatter:off */\n" +
+ "@MyAnnot (\n" +
+ " testAttribute = {\"test1\", \"test2\", \"test3\"}\n" +
+ ")\n" +
+ "/** @formatter:on */\n" +
+ "public class X02c\n" +
+ "{\n" +
+ " public static void main(String[] args)\n" +
+ " {\n" +
+ " int a=0;int b;\n" +
+ "\n" +
+ " System.out.println(a);\n" +
+ "\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "/** @formatter:off */\n" +
+ "@MyAnnot (\n" +
+ " testAttribute = {\"test1\", \"test2\", \"test3\"}\n" +
+ ")\n" +
+ "/** @formatter:on */\n" +
+ "public class X02c {\n" +
+ " public static void main(String[] args) {\n" +
+ " int a = 0;\n" +
+ " int b;\n" +
+ "\n" +
+ " System.out.println(a);\n" +
+ "\n" +
+ " }\n" +
"}\n"
);
}
public void testBug320754_02d() throws JavaModelException {
this.formatterPrefs.use_tags = true;
String source =
- "//@formatter:off\n" +
- "@MyAnnot (\n" +
- " testAttribute = {\"test1\", \"test2\", \"test3\"}\n" +
- ")\n" +
- "\n" +
- "//@formatter:on\n" +
- "public class X02d\n" +
- "{\n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " int a=0;int b;\n" +
- "\n" +
- " System.out.println(a);\n" +
- "\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "//@formatter:off\n" +
- "@MyAnnot (\n" +
- " testAttribute = {\"test1\", \"test2\", \"test3\"}\n" +
- ")\n" +
- "\n" +
- "//@formatter:on\n" +
- "public class X02d {\n" +
- " public static void main(String[] args) {\n" +
- " int a = 0;\n" +
- " int b;\n" +
- "\n" +
- " System.out.println(a);\n" +
- "\n" +
- " }\n" +
+ "//@formatter:off\n" +
+ "@MyAnnot (\n" +
+ " testAttribute = {\"test1\", \"test2\", \"test3\"}\n" +
+ ")\n" +
+ "\n" +
+ "//@formatter:on\n" +
+ "public class X02d\n" +
+ "{\n" +
+ " public static void main(String[] args)\n" +
+ " {\n" +
+ " int a=0;int b;\n" +
+ "\n" +
+ " System.out.println(a);\n" +
+ "\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "//@formatter:off\n" +
+ "@MyAnnot (\n" +
+ " testAttribute = {\"test1\", \"test2\", \"test3\"}\n" +
+ ")\n" +
+ "\n" +
+ "//@formatter:on\n" +
+ "public class X02d {\n" +
+ " public static void main(String[] args) {\n" +
+ " int a = 0;\n" +
+ " int b;\n" +
+ "\n" +
+ " System.out.println(a);\n" +
+ "\n" +
+ " }\n" +
"}\n"
);
}
public void testBug320754_03() throws JavaModelException {
this.formatterPrefs.use_tags = true;
String source =
- "//@formatter:off\n" +
- "\n" +
- "//@formatter:on\n" +
- "public class X03\n" +
- "{\n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " int a=0;int b;\n" +
- "\n" +
- " System.out.println(a);\n" +
- "\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "//@formatter:off\n" +
- "\n" +
- "//@formatter:on\n" +
- "public class X03 {\n" +
- " public static void main(String[] args) {\n" +
- " int a = 0;\n" +
- " int b;\n" +
- "\n" +
- " System.out.println(a);\n" +
- "\n" +
- " }\n" +
+ "//@formatter:off\n" +
+ "\n" +
+ "//@formatter:on\n" +
+ "public class X03\n" +
+ "{\n" +
+ " public static void main(String[] args)\n" +
+ " {\n" +
+ " int a=0;int b;\n" +
+ "\n" +
+ " System.out.println(a);\n" +
+ "\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "//@formatter:off\n" +
+ "\n" +
+ "//@formatter:on\n" +
+ "public class X03 {\n" +
+ " public static void main(String[] args) {\n" +
+ " int a = 0;\n" +
+ " int b;\n" +
+ "\n" +
+ " System.out.println(a);\n" +
+ "\n" +
+ " }\n" +
"}\n"
);
}
@@ -7550,20 +7550,20 @@ public void testBug328240() {
*/
public void testBug328362() throws Exception {
String source =
- "package test1;\n" +
- "\n" +
- "[# class A {#]\n" +
- "\n" +
- "[# int i;#]\n" +
- "\n" +
+ "package test1;\n" +
+ "\n" +
+ "[# class A {#]\n" +
+ "\n" +
+ "[# int i;#]\n" +
+ "\n" +
"}\n";
formatSource(source,
- "package test1;\n" +
- "\n" +
- "class A {\n" +
- "\n" +
- " int i;\n" +
- "\n" +
+ "package test1;\n" +
+ "\n" +
+ "class A {\n" +
+ "\n" +
+ " int i;\n" +
+ "\n" +
"}\n"
);
}
@@ -7576,157 +7576,157 @@ public void testBug328362() throws Exception {
public void testBug330313() {
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "public class Test {\n" +
- " private void helper2(\n" +
- " boolean[] booleans) {\n" +
- " if (booleans[0]) {\n" +
- "\n" +
- " }\n" +
- " }\n" +
+ "public class Test {\n" +
+ " private void helper2(\n" +
+ " boolean[] booleans) {\n" +
+ " if (booleans[0]) {\n" +
+ "\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- " private void helper2(\n" +
- " boolean[] booleans) {\n" +
- " if (booleans[0]) {\n" +
- "\n" +
- " }\n" +
- " }\n" +
+ "public class Test {\n" +
+ " private void helper2(\n" +
+ " boolean[] booleans) {\n" +
+ " if (booleans[0]) {\n" +
+ "\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
public void testBug330313a() {
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "public class Test {\n" +
- " private void helper2(\n" +
- " boolean[] booleans) {\n" +
- " if (booleans[0]) {\n" +
- "\n" +
- " }\n" +
- " }\n" +
+ "public class Test {\n" +
+ " private void helper2(\n" +
+ " boolean[] booleans) {\n" +
+ " if (booleans[0]) {\n" +
+ "\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source);
}
public void testBug330313b() {
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "public class Test {\n" +
- " private void helper2(\n" +
- " boolean[] booleans) {\n" +
- " if (booleans[0]) {\n" +
- "\n" +
- " }\n" +
- " }\n" +
+ "public class Test {\n" +
+ " private void helper2(\n" +
+ " boolean[] booleans) {\n" +
+ " if (booleans[0]) {\n" +
+ "\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- " private void helper2(\n" +
- " boolean[] booleans) {\n" +
- " if (booleans[0]) {\n" +
- "\n" +
- " }\n" +
- " }\n" +
+ "public class Test {\n" +
+ " private void helper2(\n" +
+ " boolean[] booleans) {\n" +
+ " if (booleans[0]) {\n" +
+ "\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
public void testBug330313c() {
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "public class Test {\n" +
- " private void helper2(\n" +
- "boolean[] booleans) {\n" +
- " if (booleans[0]) {\n" +
- "\n" +
- " }\n" +
- " }\n" +
+ "public class Test {\n" +
+ " private void helper2(\n" +
+ "boolean[] booleans) {\n" +
+ " if (booleans[0]) {\n" +
+ "\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- " private void helper2(\n" +
- " boolean[] booleans) {\n" +
- " if (booleans[0]) {\n" +
- "\n" +
- " }\n" +
- " }\n" +
+ "public class Test {\n" +
+ " private void helper2(\n" +
+ " boolean[] booleans) {\n" +
+ " if (booleans[0]) {\n" +
+ "\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
public void testBug330313d() {
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "public class Test {\n" +
- " private void helper2(\n" +
- " boolean[] booleans) {\n" +
- " if (booleans[0]) {\n" +
- "\n" +
- " }\n" +
- " }\n" +
+ "public class Test {\n" +
+ " private void helper2(\n" +
+ " boolean[] booleans) {\n" +
+ " if (booleans[0]) {\n" +
+ "\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- " private void helper2(\n" +
- " boolean[] booleans) {\n" +
- " if (booleans[0]) {\n" +
- "\n" +
- " }\n" +
- " }\n" +
+ "public class Test {\n" +
+ " private void helper2(\n" +
+ " boolean[] booleans) {\n" +
+ " if (booleans[0]) {\n" +
+ "\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
public void testBug330313_regression_187a() {
setPageWidth80();
String source =
- "import java.io.File;\n" +
- "\n" +
- "public class RegressionTest_187 {\n" +
- "\n" +
- " private String createC42PDFCommandLine(String documentName) {\n" +
- " return (Registry.getConvertToolPath() + File.separator +\n" +
- " Registry.getConvertToolName() +\n" +
- " \" -o \" + _workingDir + File.separator + documentName +\n" +
- " \" -l \" + _workingDir + File.separator + _fileList);\n" +
- " }\n" +
+ "import java.io.File;\n" +
+ "\n" +
+ "public class RegressionTest_187 {\n" +
+ "\n" +
+ " private String createC42PDFCommandLine(String documentName) {\n" +
+ " return (Registry.getConvertToolPath() + File.separator +\n" +
+ " Registry.getConvertToolName() +\n" +
+ " \" -o \" + _workingDir + File.separator + documentName +\n" +
+ " \" -l \" + _workingDir + File.separator + _fileList);\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "import java.io.File;\n" +
- "\n" +
- "public class RegressionTest_187 {\n" +
- "\n" +
- " private String createC42PDFCommandLine(String documentName) {\n" +
- " return (Registry.getConvertToolPath() + File.separator\n" +
- " + Registry.getConvertToolName() + \" -o \" + _workingDir\n" +
- " + File.separator + documentName + \" -l \" + _workingDir\n" +
- " + File.separator + _fileList);\n" +
- " }\n" +
+ "import java.io.File;\n" +
+ "\n" +
+ "public class RegressionTest_187 {\n" +
+ "\n" +
+ " private String createC42PDFCommandLine(String documentName) {\n" +
+ " return (Registry.getConvertToolPath() + File.separator\n" +
+ " + Registry.getConvertToolName() + \" -o \" + _workingDir\n" +
+ " + File.separator + documentName + \" -l \" + _workingDir\n" +
+ " + File.separator + _fileList);\n" +
+ " }\n" +
"}\n"
);
}
public void testBug330313_regression_187b() {
setPageWidth80();
String source =
- "import java.io.File;\n" +
- "\n" +
- "public class RegressionTest_187 {\n" +
- "\n" +
- " private String createC42PDFCommandLine(String documentName) {\n" +
- " return (Registry.getConvertToolPath() + File.separator +\n" +
- " Registry.getConvertToolName() +\n" +
- " (\" -o \" + _workingDir + File.separator + documentName +\n" +
- " (\" -l \" + _workingDir + File.separator + _fileList)));\n" +
- " }\n" +
+ "import java.io.File;\n" +
+ "\n" +
+ "public class RegressionTest_187 {\n" +
+ "\n" +
+ " private String createC42PDFCommandLine(String documentName) {\n" +
+ " return (Registry.getConvertToolPath() + File.separator +\n" +
+ " Registry.getConvertToolName() +\n" +
+ " (\" -o \" + _workingDir + File.separator + documentName +\n" +
+ " (\" -l \" + _workingDir + File.separator + _fileList)));\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "import java.io.File;\n" +
- "\n" +
- "public class RegressionTest_187 {\n" +
- "\n" +
- " private String createC42PDFCommandLine(String documentName) {\n" +
- " return (Registry.getConvertToolPath() + File.separator\n" +
- " + Registry.getConvertToolName()\n" +
- " + (\" -o \" + _workingDir + File.separator + documentName\n" +
- " + (\" -l \" + _workingDir + File.separator + _fileList)));\n" +
- " }\n" +
+ "import java.io.File;\n" +
+ "\n" +
+ "public class RegressionTest_187 {\n" +
+ "\n" +
+ " private String createC42PDFCommandLine(String documentName) {\n" +
+ " return (Registry.getConvertToolPath() + File.separator\n" +
+ " + Registry.getConvertToolName()\n" +
+ " + (\" -o \" + _workingDir + File.separator + documentName\n" +
+ " + (\" -l \" + _workingDir + File.separator + _fileList)));\n" +
+ " }\n" +
"}\n"
);
}
@@ -7734,84 +7734,84 @@ public void testBug330313_regression_187b() {
public void testBug330313_wksp1_01_njl() {
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X01 {\n" +
- "\n" +
- " protected String getPrefixFromDocument(String aDocumentText, int anOffset) {\n" +
- " int startOfWordToken = anOffset;\n" +
- " \n" +
- " char token= \'a\';\n" +
- " if (startOfWordToken > 0) {\n" +
- " token= aDocumentText.charAt(startOfWordToken - 1);\n" +
- " }\n" +
- " \n" +
- " while (startOfWordToken > 0 \n" +
- " && (Character.isJavaIdentifierPart(token) \n" +
- " || \'.\' == token\n" +
- " || \'-\' == token\n" +
- " || \';\' == token)\n" +
- " && !(\'$\' == token)) {\n" +
- " startOfWordToken--;\n" +
- " if (startOfWordToken == 0) {\n" +
- " break; //word goes right to the beginning of the doc\n" +
- " }\n" +
- " token= aDocumentText.charAt(startOfWordToken - 1);\n" +
- " }\n" +
- " return \"\";\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X01 {\n" +
- "\n" +
- " protected String getPrefixFromDocument(String aDocumentText, int anOffset) {\n" +
- " int startOfWordToken = anOffset;\n" +
- "\n" +
- " char token = \'a\';\n" +
- " if (startOfWordToken > 0) {\n" +
- " token = aDocumentText.charAt(startOfWordToken - 1);\n" +
- " }\n" +
- "\n" +
- " while (startOfWordToken > 0\n" +
- " && (Character.isJavaIdentifierPart(token)\n" +
- " || \'.\' == token\n" +
- " || \'-\' == token\n" +
- " || \';\' == token)\n" +
- " && !(\'$\' == token)) {\n" +
- " startOfWordToken--;\n" +
- " if (startOfWordToken == 0) {\n" +
- " break; // word goes right to the beginning of the doc\n" +
- " }\n" +
- " token = aDocumentText.charAt(startOfWordToken - 1);\n" +
- " }\n" +
- " return \"\";\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X01 {\n" +
+ "\n" +
+ " protected String getPrefixFromDocument(String aDocumentText, int anOffset) {\n" +
+ " int startOfWordToken = anOffset;\n" +
+ " \n" +
+ " char token= \'a\';\n" +
+ " if (startOfWordToken > 0) {\n" +
+ " token= aDocumentText.charAt(startOfWordToken - 1);\n" +
+ " }\n" +
+ " \n" +
+ " while (startOfWordToken > 0 \n" +
+ " && (Character.isJavaIdentifierPart(token) \n" +
+ " || \'.\' == token\n" +
+ " || \'-\' == token\n" +
+ " || \';\' == token)\n" +
+ " && !(\'$\' == token)) {\n" +
+ " startOfWordToken--;\n" +
+ " if (startOfWordToken == 0) {\n" +
+ " break; //word goes right to the beginning of the doc\n" +
+ " }\n" +
+ " token= aDocumentText.charAt(startOfWordToken - 1);\n" +
+ " }\n" +
+ " return \"\";\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp1;\n" +
+ "\n" +
+ "public class X01 {\n" +
+ "\n" +
+ " protected String getPrefixFromDocument(String aDocumentText, int anOffset) {\n" +
+ " int startOfWordToken = anOffset;\n" +
+ "\n" +
+ " char token = \'a\';\n" +
+ " if (startOfWordToken > 0) {\n" +
+ " token = aDocumentText.charAt(startOfWordToken - 1);\n" +
+ " }\n" +
+ "\n" +
+ " while (startOfWordToken > 0\n" +
+ " && (Character.isJavaIdentifierPart(token)\n" +
+ " || \'.\' == token\n" +
+ " || \'-\' == token\n" +
+ " || \';\' == token)\n" +
+ " && !(\'$\' == token)) {\n" +
+ " startOfWordToken--;\n" +
+ " if (startOfWordToken == 0) {\n" +
+ " break; // word goes right to the beginning of the doc\n" +
+ " }\n" +
+ " token = aDocumentText.charAt(startOfWordToken - 1);\n" +
+ " }\n" +
+ " return \"\";\n" +
+ " }\n" +
"}\n"
);
}
public void testBug330313_wksp1_02_njl() {
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X02 {\n" +
- " public void testMethod(String currentTokenVal,\n" +
- " int[][] expectedTokenSequencesVal,\n" +
- " String[] tokenImageVal\n" +
- " )\n" +
- " {\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X02 {\n" +
+ " public void testMethod(String currentTokenVal,\n" +
+ " int[][] expectedTokenSequencesVal,\n" +
+ " String[] tokenImageVal\n" +
+ " )\n" +
+ " {\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X02 {\n" +
- " public void testMethod(String currentTokenVal,\n" +
- " int[][] expectedTokenSequencesVal,\n" +
- " String[] tokenImageVal) {\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X02 {\n" +
+ " public void testMethod(String currentTokenVal,\n" +
+ " int[][] expectedTokenSequencesVal,\n" +
+ " String[] tokenImageVal) {\n" +
+ " }\n" +
"}\n"
);
}
@@ -7819,123 +7819,123 @@ public void testBug330313_wksp1_03_njl() {
this.formatterPrefs.join_wrapped_lines = false;
setPageWidth80();
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X03 {\n" +
- "\n" +
- " void foo() {\n" +
- " if (declaringClass.isNestedType()){\n" +
- " NestedTypeBinding nestedType = (NestedTypeBinding) declaringClass;\n" +
- " this.scope.extraSyntheticArguments = nestedType.syntheticOuterLocalVariables();\n" +
- " scope.computeLocalVariablePositions(// consider synthetic arguments if any\n" +
- " nestedType.enclosingInstancesSlotSize + 1,\n" +
- " codeStream);\n" +
- " argSlotSize += nestedType.enclosingInstancesSlotSize;\n" +
- " argSlotSize += nestedType.outerLocalVariablesSlotSize;\n" +
- " } else {\n" +
- " scope.computeLocalVariablePositions(1, codeStream);\n" +
- " }\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X03 {\n" +
- "\n" +
- " void foo() {\n" +
- " if (declaringClass.isNestedType()) {\n" +
- " NestedTypeBinding nestedType = (NestedTypeBinding) declaringClass;\n" +
- " this.scope.extraSyntheticArguments = nestedType\n" +
- " .syntheticOuterLocalVariables();\n" +
- " scope.computeLocalVariablePositions(// consider synthetic arguments\n" +
- " // if any\n" +
- " nestedType.enclosingInstancesSlotSize + 1,\n" +
- " codeStream);\n" +
- " argSlotSize += nestedType.enclosingInstancesSlotSize;\n" +
- " argSlotSize += nestedType.outerLocalVariablesSlotSize;\n" +
- " } else {\n" +
- " scope.computeLocalVariablePositions(1, codeStream);\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X03 {\n" +
+ "\n" +
+ " void foo() {\n" +
+ " if (declaringClass.isNestedType()){\n" +
+ " NestedTypeBinding nestedType = (NestedTypeBinding) declaringClass;\n" +
+ " this.scope.extraSyntheticArguments = nestedType.syntheticOuterLocalVariables();\n" +
+ " scope.computeLocalVariablePositions(// consider synthetic arguments if any\n" +
+ " nestedType.enclosingInstancesSlotSize + 1,\n" +
+ " codeStream);\n" +
+ " argSlotSize += nestedType.enclosingInstancesSlotSize;\n" +
+ " argSlotSize += nestedType.outerLocalVariablesSlotSize;\n" +
+ " } else {\n" +
+ " scope.computeLocalVariablePositions(1, codeStream);\n" +
+ " }\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp1;\n" +
+ "\n" +
+ "public class X03 {\n" +
+ "\n" +
+ " void foo() {\n" +
+ " if (declaringClass.isNestedType()) {\n" +
+ " NestedTypeBinding nestedType = (NestedTypeBinding) declaringClass;\n" +
+ " this.scope.extraSyntheticArguments = nestedType\n" +
+ " .syntheticOuterLocalVariables();\n" +
+ " scope.computeLocalVariablePositions(// consider synthetic arguments\n" +
+ " // if any\n" +
+ " nestedType.enclosingInstancesSlotSize + 1,\n" +
+ " codeStream);\n" +
+ " argSlotSize += nestedType.enclosingInstancesSlotSize;\n" +
+ " argSlotSize += nestedType.outerLocalVariablesSlotSize;\n" +
+ " } else {\n" +
+ " scope.computeLocalVariablePositions(1, codeStream);\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
public void testBug330313_wksp1_04() {
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X04 {\n" +
- "\n" +
- " void foo() {\n" +
- " for (;;) {\n" +
- " if (act <= NUM_RULES) { // reduce action\n" +
- " tempStackTop--;\n" +
- " } else if (act < ACCEPT_ACTION || // shift action\n" +
- " act > ERROR_ACTION) { // shift-reduce action\n" +
- " if (indx == MAX_DISTANCE)\n" +
- " return indx;\n" +
- " indx++;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X04 {\n" +
- "\n" +
- " void foo() {\n" +
- " for (;;) {\n" +
- " if (act <= NUM_RULES) { // reduce action\n" +
- " tempStackTop--;\n" +
- " } else if (act < ACCEPT_ACTION || // shift action\n" +
- " act > ERROR_ACTION) { // shift-reduce action\n" +
- " if (indx == MAX_DISTANCE)\n" +
- " return indx;\n" +
- " indx++;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X04 {\n" +
+ "\n" +
+ " void foo() {\n" +
+ " for (;;) {\n" +
+ " if (act <= NUM_RULES) { // reduce action\n" +
+ " tempStackTop--;\n" +
+ " } else if (act < ACCEPT_ACTION || // shift action\n" +
+ " act > ERROR_ACTION) { // shift-reduce action\n" +
+ " if (indx == MAX_DISTANCE)\n" +
+ " return indx;\n" +
+ " indx++;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp1;\n" +
+ "\n" +
+ "public class X04 {\n" +
+ "\n" +
+ " void foo() {\n" +
+ " for (;;) {\n" +
+ " if (act <= NUM_RULES) { // reduce action\n" +
+ " tempStackTop--;\n" +
+ " } else if (act < ACCEPT_ACTION || // shift action\n" +
+ " act > ERROR_ACTION) { // shift-reduce action\n" +
+ " if (indx == MAX_DISTANCE)\n" +
+ " return indx;\n" +
+ " indx++;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
public void testBug330313_wksp1_04_njl() {
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X04 {\n" +
- "\n" +
- " void foo() {\n" +
- " for (;;) {\n" +
- " if (act <= NUM_RULES) { // reduce action\n" +
- " tempStackTop--;\n" +
- " } else if (act < ACCEPT_ACTION || // shift action\n" +
- " act > ERROR_ACTION) { // shift-reduce action\n" +
- " if (indx == MAX_DISTANCE)\n" +
- " return indx;\n" +
- " indx++;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X04 {\n" +
- "\n" +
- " void foo() {\n" +
- " for (;;) {\n" +
- " if (act <= NUM_RULES) { // reduce action\n" +
- " tempStackTop--;\n" +
- " } else if (act < ACCEPT_ACTION || // shift action\n" +
- " act > ERROR_ACTION) { // shift-reduce action\n" +
- " if (indx == MAX_DISTANCE)\n" +
- " return indx;\n" +
- " indx++;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X04 {\n" +
+ "\n" +
+ " void foo() {\n" +
+ " for (;;) {\n" +
+ " if (act <= NUM_RULES) { // reduce action\n" +
+ " tempStackTop--;\n" +
+ " } else if (act < ACCEPT_ACTION || // shift action\n" +
+ " act > ERROR_ACTION) { // shift-reduce action\n" +
+ " if (indx == MAX_DISTANCE)\n" +
+ " return indx;\n" +
+ " indx++;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp1;\n" +
+ "\n" +
+ "public class X04 {\n" +
+ "\n" +
+ " void foo() {\n" +
+ " for (;;) {\n" +
+ " if (act <= NUM_RULES) { // reduce action\n" +
+ " tempStackTop--;\n" +
+ " } else if (act < ACCEPT_ACTION || // shift action\n" +
+ " act > ERROR_ACTION) { // shift-reduce action\n" +
+ " if (indx == MAX_DISTANCE)\n" +
+ " return indx;\n" +
+ " indx++;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -7943,25 +7943,25 @@ public void testBug330313_wksp1_05_njl() {
this.formatterPrefs.join_wrapped_lines = false;
setUpBracesPreferences(DefaultCodeFormatterConstants.NEXT_LINE);
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X05 {\n" +
- "\n" +
- " private void foo() {\n" +
- " setBuildFileLocation.invoke(runner, new Object[] { buildFileLocation });\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X05 {\n" +
+ "\n" +
+ " private void foo() {\n" +
+ " setBuildFileLocation.invoke(runner, new Object[] { buildFileLocation });\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X05\n" +
- "{\n" +
- "\n" +
- " private void foo()\n" +
- " {\n" +
- " setBuildFileLocation.invoke(runner, new Object[]\n" +
- " { buildFileLocation });\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X05\n" +
+ "{\n" +
+ "\n" +
+ " private void foo()\n" +
+ " {\n" +
+ " setBuildFileLocation.invoke(runner, new Object[]\n" +
+ " { buildFileLocation });\n" +
+ " }\n" +
"}\n"
);
}
@@ -7970,119 +7970,119 @@ public void testBug330313_wksp1_06_njl() {
setUpBracesPreferences(DefaultCodeFormatterConstants.NEXT_LINE);
setPageWidth80();
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X06 {\n" +
- "\n" +
- " public void foo(Object index) {\n" +
- "\n" +
- " try {\n" +
- " index = this.manager.getIndexForUpdate(this.containerPath, true, /*reuse index file*/ true /*create if none*/);\n" +
- " }\n" +
- " finally {}\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X06\n" +
- "{\n" +
- "\n" +
- " public void foo(Object index)\n" +
- " {\n" +
- "\n" +
- " try\n" +
- " {\n" +
- " index = this.manager.getIndexForUpdate(this.containerPath, true,\n" +
- " /* reuse index file */ true /* create if none */);\n" +
- " } finally\n" +
- " {\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X06 {\n" +
+ "\n" +
+ " public void foo(Object index) {\n" +
+ "\n" +
+ " try {\n" +
+ " index = this.manager.getIndexForUpdate(this.containerPath, true, /*reuse index file*/ true /*create if none*/);\n" +
+ " }\n" +
+ " finally {}\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp1;\n" +
+ "\n" +
+ "public class X06\n" +
+ "{\n" +
+ "\n" +
+ " public void foo(Object index)\n" +
+ " {\n" +
+ "\n" +
+ " try\n" +
+ " {\n" +
+ " index = this.manager.getIndexForUpdate(this.containerPath, true,\n" +
+ " /* reuse index file */ true /* create if none */);\n" +
+ " } finally\n" +
+ " {\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
public void testBug330313_wksp1_07() {
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X07 {\n" +
- "\n" +
- "static final long[] jjtoToken = {\n" +
- " 0x7fbfecffL, \n" +
- "};\n" +
- "static final long[] jjtoSkip = {\n" +
- " 0x400000L, \n" +
- "};\n" +
- "\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X07 {\n" +
+ "\n" +
+ "static final long[] jjtoToken = {\n" +
+ " 0x7fbfecffL, \n" +
+ "};\n" +
+ "static final long[] jjtoSkip = {\n" +
+ " 0x400000L, \n" +
+ "};\n" +
+ "\n" +
"}\n";
formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X07 {\n" +
- "\n" +
- " static final long[] jjtoToken = { 0x7fbfecffL, };\n" +
- " static final long[] jjtoSkip = { 0x400000L, };\n" +
- "\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X07 {\n" +
+ "\n" +
+ " static final long[] jjtoToken = { 0x7fbfecffL, };\n" +
+ " static final long[] jjtoSkip = { 0x400000L, };\n" +
+ "\n" +
"}\n"
);
}
public void testBug330313_wksp1_07_bnl() {
setUpBracesPreferences(DefaultCodeFormatterConstants.NEXT_LINE);
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X07 {\n" +
- "\n" +
- "static final long[] jjtoToken = {\n" +
- " 0x7fbfecffL, \n" +
- "};\n" +
- "static final long[] jjtoSkip = {\n" +
- " 0x400000L, \n" +
- "};\n" +
- "\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X07 {\n" +
+ "\n" +
+ "static final long[] jjtoToken = {\n" +
+ " 0x7fbfecffL, \n" +
+ "};\n" +
+ "static final long[] jjtoSkip = {\n" +
+ " 0x400000L, \n" +
+ "};\n" +
+ "\n" +
"}\n";
formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X07\n" +
- "{\n" +
- "\n" +
- " static final long[] jjtoToken =\n" +
- " { 0x7fbfecffL, };\n" +
- " static final long[] jjtoSkip =\n" +
- " { 0x400000L, };\n" +
- "\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X07\n" +
+ "{\n" +
+ "\n" +
+ " static final long[] jjtoToken =\n" +
+ " { 0x7fbfecffL, };\n" +
+ " static final long[] jjtoSkip =\n" +
+ " { 0x400000L, };\n" +
+ "\n" +
"}\n"
);
}
public void testBug330313_wksp1_07_njl() {
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X07 {\n" +
- "\n" +
- "static final long[] jjtoToken = {\n" +
- " 0x7fbfecffL, \n" +
- "};\n" +
- "static final long[] jjtoSkip = {\n" +
- " 0x400000L, \n" +
- "};\n" +
- "\n" +
- "}\n";
- formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X07 {\n" +
- "\n" +
- " static final long[] jjtoToken = {\n" +
- " 0x7fbfecffL,\n" +
- " };\n" +
- " static final long[] jjtoSkip = {\n" +
- " 0x400000L,\n" +
- " };\n" +
- "\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X07 {\n" +
+ "\n" +
+ "static final long[] jjtoToken = {\n" +
+ " 0x7fbfecffL, \n" +
+ "};\n" +
+ "static final long[] jjtoSkip = {\n" +
+ " 0x400000L, \n" +
+ "};\n" +
+ "\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp1;\n" +
+ "\n" +
+ "public class X07 {\n" +
+ "\n" +
+ " static final long[] jjtoToken = {\n" +
+ " 0x7fbfecffL,\n" +
+ " };\n" +
+ " static final long[] jjtoSkip = {\n" +
+ " 0x400000L,\n" +
+ " };\n" +
+ "\n" +
"}\n"
);
}
@@ -8090,33 +8090,33 @@ public void testBug330313_wksp1_07_njl_bnl() {
this.formatterPrefs.join_wrapped_lines = false;
setUpBracesPreferences(DefaultCodeFormatterConstants.NEXT_LINE);
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X07 {\n" +
- "\n" +
- "static final long[] jjtoToken = {\n" +
- " 0x7fbfecffL, \n" +
- "};\n" +
- "static final long[] jjtoSkip = {\n" +
- " 0x400000L, \n" +
- "};\n" +
- "\n" +
- "}\n";
- formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X07\n" +
- "{\n" +
- "\n" +
- " static final long[] jjtoToken =\n" +
- " {\n" +
- " 0x7fbfecffL,\n" +
- " };\n" +
- " static final long[] jjtoSkip =\n" +
- " {\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X07 {\n" +
+ "\n" +
+ "static final long[] jjtoToken = {\n" +
+ " 0x7fbfecffL, \n" +
+ "};\n" +
+ "static final long[] jjtoSkip = {\n" +
+ " 0x400000L, \n" +
+ "};\n" +
+ "\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp1;\n" +
+ "\n" +
+ "public class X07\n" +
+ "{\n" +
+ "\n" +
+ " static final long[] jjtoToken =\n" +
+ " {\n" +
+ " 0x7fbfecffL,\n" +
+ " };\n" +
+ " static final long[] jjtoSkip =\n" +
+ " {\n" +
" 0x400000L,\n" +
- " };\n" +
- "\n" +
+ " };\n" +
+ "\n" +
"}\n"
);
}
@@ -8124,24 +8124,24 @@ public void testBug330313_wksp1_08_njl() {
this.formatterPrefs.join_wrapped_lines = false;
this.formatterPrefs.alignment_for_assignment = Alignment.M_COMPACT_SPLIT;
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X08 {\n" +
- "\n" +
- " void foo() {\n" +
- " MinimizedFileSystemElement dummyParent =\n" +
- " new MinimizedFileSystemElement(\"\", null, true);//$NON-NLS-1$\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X08 {\n" +
+ "\n" +
+ " void foo() {\n" +
+ " MinimizedFileSystemElement dummyParent =\n" +
+ " new MinimizedFileSystemElement(\"\", null, true);//$NON-NLS-1$\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X08 {\n" +
- "\n" +
- " void foo() {\n" +
- " MinimizedFileSystemElement dummyParent =\n" +
- " new MinimizedFileSystemElement(\"\", null, true);//$NON-NLS-1$\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X08 {\n" +
+ "\n" +
+ " void foo() {\n" +
+ " MinimizedFileSystemElement dummyParent =\n" +
+ " new MinimizedFileSystemElement(\"\", null, true);//$NON-NLS-1$\n" +
+ " }\n" +
"}\n"
);
}
@@ -8149,24 +8149,24 @@ public void testBug330313_wksp1_08_njl() {
public void testBug330313_wksp1_09_njl() {
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X09 {\n" +
- " public Class[] getAdapterList() {\n" +
- " return new Class[] {\n" +
- " IWorkbenchAdapter.class\n" +
- " };\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X09 {\n" +
+ " public Class[] getAdapterList() {\n" +
+ " return new Class[] {\n" +
+ " IWorkbenchAdapter.class\n" +
+ " };\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X09 {\n" +
- " public Class[] getAdapterList() {\n" +
- " return new Class[] {\n" +
- " IWorkbenchAdapter.class\n" +
- " };\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X09 {\n" +
+ " public Class[] getAdapterList() {\n" +
+ " return new Class[] {\n" +
+ " IWorkbenchAdapter.class\n" +
+ " };\n" +
+ " }\n" +
"}\n"
);
}
@@ -8174,28 +8174,28 @@ public void testBug330313_wksp1_09_njl() {
public void testBug330313_wksp1_10_njl() {
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X10 {\n" +
- "\n" +
- "public void computeConstant() {\n" +
- "\n" +
- " if (true)\n" +
- " { //only a true 0 can be made of zeros\n" +
- " //2.00000000000000000e-324 is illegal .... \n" +
- " }}\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X10 {\n" +
+ "\n" +
+ "public void computeConstant() {\n" +
+ "\n" +
+ " if (true)\n" +
+ " { //only a true 0 can be made of zeros\n" +
+ " //2.00000000000000000e-324 is illegal .... \n" +
+ " }}\n" +
"}\n";
formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X10 {\n" +
- "\n" +
- " public void computeConstant() {\n" +
- "\n" +
- " if (true) { // only a true 0 can be made of zeros\n" +
- " // 2.00000000000000000e-324 is illegal ....\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X10 {\n" +
+ "\n" +
+ " public void computeConstant() {\n" +
+ "\n" +
+ " if (true) { // only a true 0 can be made of zeros\n" +
+ " // 2.00000000000000000e-324 is illegal ....\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -8203,32 +8203,32 @@ public void testBug330313_wksp1_10_njl() {
public void testBug330313_wksp1_11_njl() {
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X11 {\n" +
- " X11() {\n" +
- " accessFlags\n" +
- " &= ~(\n" +
- " AccStrictfp\n" +
- " | AccProtected\n" +
- " | AccPrivate\n" +
- " | AccStatic\n" +
- " | AccSynchronized\n" +
- " | AccNative);\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X11 {\n" +
- " X11() {\n" +
- " accessFlags &= ~(AccStrictfp\n" +
- " | AccProtected\n" +
- " | AccPrivate\n" +
- " | AccStatic\n" +
- " | AccSynchronized\n" +
- " | AccNative);\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X11 {\n" +
+ " X11() {\n" +
+ " accessFlags\n" +
+ " &= ~(\n" +
+ " AccStrictfp\n" +
+ " | AccProtected\n" +
+ " | AccPrivate\n" +
+ " | AccStatic\n" +
+ " | AccSynchronized\n" +
+ " | AccNative);\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp1;\n" +
+ "\n" +
+ "public class X11 {\n" +
+ " X11() {\n" +
+ " accessFlags &= ~(AccStrictfp\n" +
+ " | AccProtected\n" +
+ " | AccPrivate\n" +
+ " | AccStatic\n" +
+ " | AccSynchronized\n" +
+ " | AccNative);\n" +
+ " }\n" +
"}\n"
);
}
@@ -8236,57 +8236,57 @@ public void testBug330313_wksp1_11_njl() {
public void testBug330313_wksp1_12() {
setPageWidth80();
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X12 {\n" +
- "\n" +
- " private static Document createDocument(String string, Position[] positions) throws IllegalArgumentException {\n" +
- " Document doc= new Document(string);\n" +
- " try {\n" +
- " if (positions != null) {\n" +
- " doc.addPositionUpdater(new DefaultPositionUpdater(POS_CATEGORY) {\n" +
- " protected boolean notDeleted() {\n" +
- " if (fOffset < fPosition.offset && (fPosition.offset + fPosition.length < fOffset + fLength)) {\n" +
- " return false;\n" +
- " }\n" +
- " return true;\n" +
- " }\n" +
- " });\n" +
- " }\n" +
- " } catch (BadPositionCategoryException cannotHappen) {\n" +
- " // can not happen: category is correctly set up\n" +
- " }\n" +
- " return doc;\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X12 {\n" +
- "\n" +
- " private static Document createDocument(String string, Position[] positions)\n" +
- " throws IllegalArgumentException {\n" +
- " Document doc = new Document(string);\n" +
- " try {\n" +
- " if (positions != null) {\n" +
- " doc.addPositionUpdater(\n" +
- " new DefaultPositionUpdater(POS_CATEGORY) {\n" +
- " protected boolean notDeleted() {\n" +
- " if (fOffset < fPosition.offset\n" +
- " && (fPosition.offset\n" +
- " + fPosition.length < fOffset\n" +
- " + fLength)) {\n" +
- " return false;\n" +
- " }\n" +
- " return true;\n" +
- " }\n" +
- " });\n" +
- " }\n" +
- " } catch (BadPositionCategoryException cannotHappen) {\n" +
- " // can not happen: category is correctly set up\n" +
- " }\n" +
- " return doc;\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X12 {\n" +
+ "\n" +
+ " private static Document createDocument(String string, Position[] positions) throws IllegalArgumentException {\n" +
+ " Document doc= new Document(string);\n" +
+ " try {\n" +
+ " if (positions != null) {\n" +
+ " doc.addPositionUpdater(new DefaultPositionUpdater(POS_CATEGORY) {\n" +
+ " protected boolean notDeleted() {\n" +
+ " if (fOffset < fPosition.offset && (fPosition.offset + fPosition.length < fOffset + fLength)) {\n" +
+ " return false;\n" +
+ " }\n" +
+ " return true;\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
+ " } catch (BadPositionCategoryException cannotHappen) {\n" +
+ " // can not happen: category is correctly set up\n" +
+ " }\n" +
+ " return doc;\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp1;\n" +
+ "\n" +
+ "public class X12 {\n" +
+ "\n" +
+ " private static Document createDocument(String string, Position[] positions)\n" +
+ " throws IllegalArgumentException {\n" +
+ " Document doc = new Document(string);\n" +
+ " try {\n" +
+ " if (positions != null) {\n" +
+ " doc.addPositionUpdater(\n" +
+ " new DefaultPositionUpdater(POS_CATEGORY) {\n" +
+ " protected boolean notDeleted() {\n" +
+ " if (fOffset < fPosition.offset\n" +
+ " && (fPosition.offset\n" +
+ " + fPosition.length < fOffset\n" +
+ " + fLength)) {\n" +
+ " return false;\n" +
+ " }\n" +
+ " return true;\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
+ " } catch (BadPositionCategoryException cannotHappen) {\n" +
+ " // can not happen: category is correctly set up\n" +
+ " }\n" +
+ " return doc;\n" +
+ " }\n" +
"}\n"
);
}
@@ -8294,57 +8294,57 @@ public void testBug330313_wksp1_12_njl() {
this.formatterPrefs.join_wrapped_lines = false;
setPageWidth80();
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X12 {\n" +
- "\n" +
- " private static Document createDocument(String string, Position[] positions) throws IllegalArgumentException {\n" +
- " Document doc= new Document(string);\n" +
- " try {\n" +
- " if (positions != null) {\n" +
- " doc.addPositionUpdater(new DefaultPositionUpdater(POS_CATEGORY) {\n" +
- " protected boolean notDeleted() {\n" +
- " if (fOffset < fPosition.offset && (fPosition.offset + fPosition.length < fOffset + fLength)) {\n" +
- " return false;\n" +
- " }\n" +
- " return true;\n" +
- " }\n" +
- " });\n" +
- " }\n" +
- " } catch (BadPositionCategoryException cannotHappen) {\n" +
- " // can not happen: category is correctly set up\n" +
- " }\n" +
- " return doc;\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X12 {\n" +
- "\n" +
- " private static Document createDocument(String string, Position[] positions)\n" +
- " throws IllegalArgumentException {\n" +
- " Document doc = new Document(string);\n" +
- " try {\n" +
- " if (positions != null) {\n" +
- " doc.addPositionUpdater(\n" +
- " new DefaultPositionUpdater(POS_CATEGORY) {\n" +
- " protected boolean notDeleted() {\n" +
- " if (fOffset < fPosition.offset\n" +
- " && (fPosition.offset\n" +
- " + fPosition.length < fOffset\n" +
- " + fLength)) {\n" +
- " return false;\n" +
- " }\n" +
- " return true;\n" +
- " }\n" +
- " });\n" +
- " }\n" +
- " } catch (BadPositionCategoryException cannotHappen) {\n" +
- " // can not happen: category is correctly set up\n" +
- " }\n" +
- " return doc;\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X12 {\n" +
+ "\n" +
+ " private static Document createDocument(String string, Position[] positions) throws IllegalArgumentException {\n" +
+ " Document doc= new Document(string);\n" +
+ " try {\n" +
+ " if (positions != null) {\n" +
+ " doc.addPositionUpdater(new DefaultPositionUpdater(POS_CATEGORY) {\n" +
+ " protected boolean notDeleted() {\n" +
+ " if (fOffset < fPosition.offset && (fPosition.offset + fPosition.length < fOffset + fLength)) {\n" +
+ " return false;\n" +
+ " }\n" +
+ " return true;\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
+ " } catch (BadPositionCategoryException cannotHappen) {\n" +
+ " // can not happen: category is correctly set up\n" +
+ " }\n" +
+ " return doc;\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp1;\n" +
+ "\n" +
+ "public class X12 {\n" +
+ "\n" +
+ " private static Document createDocument(String string, Position[] positions)\n" +
+ " throws IllegalArgumentException {\n" +
+ " Document doc = new Document(string);\n" +
+ " try {\n" +
+ " if (positions != null) {\n" +
+ " doc.addPositionUpdater(\n" +
+ " new DefaultPositionUpdater(POS_CATEGORY) {\n" +
+ " protected boolean notDeleted() {\n" +
+ " if (fOffset < fPosition.offset\n" +
+ " && (fPosition.offset\n" +
+ " + fPosition.length < fOffset\n" +
+ " + fLength)) {\n" +
+ " return false;\n" +
+ " }\n" +
+ " return true;\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
+ " } catch (BadPositionCategoryException cannotHappen) {\n" +
+ " // can not happen: category is correctly set up\n" +
+ " }\n" +
+ " return doc;\n" +
+ " }\n" +
"}\n"
);
}
@@ -8352,24 +8352,24 @@ public void testBug330313_wksp1_12_njl() {
public void testBug330313_wksp1_13() {
setPageWidth80();
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X13 {\n" +
- "\n" +
- " public boolean isEmptyDelta() {\n" +
- " return (this.getType() == AbstractDataTreeNode.T_NO_DATA_DELTA_NODE && this.getNamesOfChildren().length == 0 && this.getNamesOfDeletedChildren().length == 0);\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X13 {\n" +
+ "\n" +
+ " public boolean isEmptyDelta() {\n" +
+ " return (this.getType() == AbstractDataTreeNode.T_NO_DATA_DELTA_NODE && this.getNamesOfChildren().length == 0 && this.getNamesOfDeletedChildren().length == 0);\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X13 {\n" +
- "\n" +
- " public boolean isEmptyDelta() {\n" +
- " return (this.getType() == AbstractDataTreeNode.T_NO_DATA_DELTA_NODE\n" +
- " && this.getNamesOfChildren().length == 0\n" +
- " && this.getNamesOfDeletedChildren().length == 0);\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X13 {\n" +
+ "\n" +
+ " public boolean isEmptyDelta() {\n" +
+ " return (this.getType() == AbstractDataTreeNode.T_NO_DATA_DELTA_NODE\n" +
+ " && this.getNamesOfChildren().length == 0\n" +
+ " && this.getNamesOfDeletedChildren().length == 0);\n" +
+ " }\n" +
"}\n"
);
}
@@ -8377,24 +8377,24 @@ public void testBug330313_wksp1_13_njl() {
this.formatterPrefs.join_wrapped_lines = false;
setPageWidth80();
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X13 {\n" +
- "\n" +
- " public boolean isEmptyDelta() {\n" +
- " return (this.getType() == AbstractDataTreeNode.T_NO_DATA_DELTA_NODE && this.getNamesOfChildren().length == 0 && this.getNamesOfDeletedChildren().length == 0);\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X13 {\n" +
+ "\n" +
+ " public boolean isEmptyDelta() {\n" +
+ " return (this.getType() == AbstractDataTreeNode.T_NO_DATA_DELTA_NODE && this.getNamesOfChildren().length == 0 && this.getNamesOfDeletedChildren().length == 0);\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X13 {\n" +
- "\n" +
- " public boolean isEmptyDelta() {\n" +
- " return (this.getType() == AbstractDataTreeNode.T_NO_DATA_DELTA_NODE\n" +
- " && this.getNamesOfChildren().length == 0\n" +
- " && this.getNamesOfDeletedChildren().length == 0);\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X13 {\n" +
+ "\n" +
+ " public boolean isEmptyDelta() {\n" +
+ " return (this.getType() == AbstractDataTreeNode.T_NO_DATA_DELTA_NODE\n" +
+ " && this.getNamesOfChildren().length == 0\n" +
+ " && this.getNamesOfDeletedChildren().length == 0);\n" +
+ " }\n" +
"}\n"
);
}
@@ -8402,38 +8402,38 @@ public void testBug330313_wksp1_13_njl() {
public void testBug330313_wksp1_14() {
setPageWidth80();
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X14 {\n" +
- " public void foo() {\n" +
- " if (true) {\n" +
- " if (((bits & DepthMASK) != 0)\n" +
- " && (fieldBinding.isPrivate() // private access\n" +
- " || (fieldBinding.isProtected() // implicit protected access\n" +
- " && fieldBinding.declaringClass.getPackage() \n" +
- " != currentScope.enclosingSourceType().getPackage()))) {\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X14 {\n" +
- " public void foo() {\n" +
- " if (true) {\n" +
- " if (((bits & DepthMASK) != 0) && (fieldBinding.isPrivate() // private\n" +
- " // access\n" +
- " || (fieldBinding.isProtected() // implicit protected access\n" +
- " && fieldBinding.declaringClass\n" +
- " .getPackage() != currentScope\n" +
- " .enclosingSourceType()\n" +
- " .getPackage()))) {\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X14 {\n" +
+ " public void foo() {\n" +
+ " if (true) {\n" +
+ " if (((bits & DepthMASK) != 0)\n" +
+ " && (fieldBinding.isPrivate() // private access\n" +
+ " || (fieldBinding.isProtected() // implicit protected access\n" +
+ " && fieldBinding.declaringClass.getPackage() \n" +
+ " != currentScope.enclosingSourceType().getPackage()))) {\n" +
+ " return;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp1;\n" +
+ "\n" +
+ "public class X14 {\n" +
+ " public void foo() {\n" +
+ " if (true) {\n" +
+ " if (((bits & DepthMASK) != 0) && (fieldBinding.isPrivate() // private\n" +
+ " // access\n" +
+ " || (fieldBinding.isProtected() // implicit protected access\n" +
+ " && fieldBinding.declaringClass\n" +
+ " .getPackage() != currentScope\n" +
+ " .enclosingSourceType()\n" +
+ " .getPackage()))) {\n" +
+ " return;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -8441,37 +8441,37 @@ public void testBug330313_wksp1_14_njl() {
useOldCommentWidthCounting();
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X14 {\n" +
- " public void foo() {\n" +
- " if (true) {\n" +
- " if (((bits & DepthMASK) != 0)\n" +
- " && (fieldBinding.isPrivate() // private access\n" +
- " || (fieldBinding.isProtected() // implicit protected access\n" +
- " && fieldBinding.declaringClass.getPackage() \n" +
- " != currentScope.enclosingSourceType().getPackage()))) {\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X14 {\n" +
- " public void foo() {\n" +
- " if (true) {\n" +
- " if (((bits & DepthMASK) != 0)\n" +
- " && (fieldBinding.isPrivate() // private access\n" +
- " || (fieldBinding.isProtected() // implicit protected\n" +
- " // access\n" +
- " && fieldBinding.declaringClass.getPackage() != currentScope.enclosingSourceType()\n" +
- " .getPackage()))) {\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X14 {\n" +
+ " public void foo() {\n" +
+ " if (true) {\n" +
+ " if (((bits & DepthMASK) != 0)\n" +
+ " && (fieldBinding.isPrivate() // private access\n" +
+ " || (fieldBinding.isProtected() // implicit protected access\n" +
+ " && fieldBinding.declaringClass.getPackage() \n" +
+ " != currentScope.enclosingSourceType().getPackage()))) {\n" +
+ " return;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp1;\n" +
+ "\n" +
+ "public class X14 {\n" +
+ " public void foo() {\n" +
+ " if (true) {\n" +
+ " if (((bits & DepthMASK) != 0)\n" +
+ " && (fieldBinding.isPrivate() // private access\n" +
+ " || (fieldBinding.isProtected() // implicit protected\n" +
+ " // access\n" +
+ " && fieldBinding.declaringClass.getPackage() != currentScope.enclosingSourceType()\n" +
+ " .getPackage()))) {\n" +
+ " return;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -8480,54 +8480,54 @@ public void testBug330313_wksp1_15_njl() {
this.formatterPrefs.join_wrapped_lines = false;
setPageWidth80();
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X15 {\n" +
- " public void foo() {\n" +
- " if (true) {\n" +
- " if (fieldBinding.declaringClass != this.actualReceiverType\n" +
- " && !this.actualReceiverType.isArrayType() \n" +
- " && fieldBinding.declaringClass != null\n" +
- " && fieldBinding.constant == NotAConstant\n" +
- " && ((currentScope.environment().options.targetJDK >= ClassFileConstants.JDK1_2 \n" +
- " && !fieldBinding.isStatic()\n" +
- " && fieldBinding.declaringClass.id != T_Object) // no change for Object fields (if there was any)\n" +
- " || !fieldBinding.declaringClass.canBeSeenBy(currentScope))){\n" +
- " this.codegenBinding = currentScope.enclosingSourceType().getUpdatedFieldBinding(fieldBinding, (ReferenceBinding)this.actualReceiverType);\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X15 {\n" +
- " public void foo() {\n" +
- " if (true) {\n" +
- " if (fieldBinding.declaringClass != this.actualReceiverType\n" +
- " && !this.actualReceiverType.isArrayType()\n" +
- " && fieldBinding.declaringClass != null\n" +
- " && fieldBinding.constant == NotAConstant\n" +
- " && ((currentScope\n" +
- " .environment().options.targetJDK >= ClassFileConstants.JDK1_2\n" +
- " && !fieldBinding.isStatic()\n" +
- " && fieldBinding.declaringClass.id != T_Object) // no\n" +
- " // change\n" +
- " // for\n" +
- " // Object\n" +
- " // fields\n" +
- " // (if\n" +
- " // there\n" +
- " // was\n" +
- " // any)\n" +
- " || !fieldBinding.declaringClass\n" +
- " .canBeSeenBy(currentScope))) {\n" +
- " this.codegenBinding = currentScope.enclosingSourceType()\n" +
- " .getUpdatedFieldBinding(fieldBinding,\n" +
- " (ReferenceBinding) this.actualReceiverType);\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X15 {\n" +
+ " public void foo() {\n" +
+ " if (true) {\n" +
+ " if (fieldBinding.declaringClass != this.actualReceiverType\n" +
+ " && !this.actualReceiverType.isArrayType() \n" +
+ " && fieldBinding.declaringClass != null\n" +
+ " && fieldBinding.constant == NotAConstant\n" +
+ " && ((currentScope.environment().options.targetJDK >= ClassFileConstants.JDK1_2 \n" +
+ " && !fieldBinding.isStatic()\n" +
+ " && fieldBinding.declaringClass.id != T_Object) // no change for Object fields (if there was any)\n" +
+ " || !fieldBinding.declaringClass.canBeSeenBy(currentScope))){\n" +
+ " this.codegenBinding = currentScope.enclosingSourceType().getUpdatedFieldBinding(fieldBinding, (ReferenceBinding)this.actualReceiverType);\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp1;\n" +
+ "\n" +
+ "public class X15 {\n" +
+ " public void foo() {\n" +
+ " if (true) {\n" +
+ " if (fieldBinding.declaringClass != this.actualReceiverType\n" +
+ " && !this.actualReceiverType.isArrayType()\n" +
+ " && fieldBinding.declaringClass != null\n" +
+ " && fieldBinding.constant == NotAConstant\n" +
+ " && ((currentScope\n" +
+ " .environment().options.targetJDK >= ClassFileConstants.JDK1_2\n" +
+ " && !fieldBinding.isStatic()\n" +
+ " && fieldBinding.declaringClass.id != T_Object) // no\n" +
+ " // change\n" +
+ " // for\n" +
+ " // Object\n" +
+ " // fields\n" +
+ " // (if\n" +
+ " // there\n" +
+ " // was\n" +
+ " // any)\n" +
+ " || !fieldBinding.declaringClass\n" +
+ " .canBeSeenBy(currentScope))) {\n" +
+ " this.codegenBinding = currentScope.enclosingSourceType()\n" +
+ " .getUpdatedFieldBinding(fieldBinding,\n" +
+ " (ReferenceBinding) this.actualReceiverType);\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -8535,40 +8535,40 @@ public void testBug330313_wksp1_15_njl() {
public void testBug330313_wksp1_16() {
setPageWidth80();
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X16 {\n" +
- "void foo() {\n" +
- " // recovery\n" +
- " if (this.currentElement != null) {\n" +
- " if (!(this.currentElement instanceof RecoveredType)\n" +
- " && (this.currentToken == TokenNameDOT\n" +
- " //|| declaration.modifiers != 0\n" +
- " || (this.scanner.getLineNumber(declaration.type.sourceStart)\n" +
- " != this.scanner.getLineNumber((int) (namePosition >>> 32))))){\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "}\n";
- formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X16 {\n" +
- " void foo() {\n" +
- " // recovery\n" +
- " if (this.currentElement != null) {\n" +
- " if (!(this.currentElement instanceof RecoveredType)\n" +
- " && (this.currentToken == TokenNameDOT\n" +
- " // || declaration.modifiers != 0\n" +
- " || (this.scanner.getLineNumber(\n" +
- " declaration.type.sourceStart) != this.scanner\n" +
- " .getLineNumber(\n" +
- " (int) (namePosition >>> 32))))) {\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X16 {\n" +
+ "void foo() {\n" +
+ " // recovery\n" +
+ " if (this.currentElement != null) {\n" +
+ " if (!(this.currentElement instanceof RecoveredType)\n" +
+ " && (this.currentToken == TokenNameDOT\n" +
+ " //|| declaration.modifiers != 0\n" +
+ " || (this.scanner.getLineNumber(declaration.type.sourceStart)\n" +
+ " != this.scanner.getLineNumber((int) (namePosition >>> 32))))){\n" +
+ " return;\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp1;\n" +
+ "\n" +
+ "public class X16 {\n" +
+ " void foo() {\n" +
+ " // recovery\n" +
+ " if (this.currentElement != null) {\n" +
+ " if (!(this.currentElement instanceof RecoveredType)\n" +
+ " && (this.currentToken == TokenNameDOT\n" +
+ " // || declaration.modifiers != 0\n" +
+ " || (this.scanner.getLineNumber(\n" +
+ " declaration.type.sourceStart) != this.scanner\n" +
+ " .getLineNumber(\n" +
+ " (int) (namePosition >>> 32))))) {\n" +
+ " return;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -8576,40 +8576,40 @@ public void testBug330313_wksp1_16_njl() {
this.formatterPrefs.join_wrapped_lines = false;
setPageWidth80();
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X16 {\n" +
- "void foo() {\n" +
- " // recovery\n" +
- " if (this.currentElement != null) {\n" +
- " if (!(this.currentElement instanceof RecoveredType)\n" +
- " && (this.currentToken == TokenNameDOT\n" +
- " //|| declaration.modifiers != 0\n" +
- " || (this.scanner.getLineNumber(declaration.type.sourceStart)\n" +
- " != this.scanner.getLineNumber((int) (namePosition >>> 32))))){\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "}\n";
- formatSource(source,
- "package wksp1;\n" +
- "\n" +
- "public class X16 {\n" +
- " void foo() {\n" +
- " // recovery\n" +
- " if (this.currentElement != null) {\n" +
- " if (!(this.currentElement instanceof RecoveredType)\n" +
- " && (this.currentToken == TokenNameDOT\n" +
- " // || declaration.modifiers != 0\n" +
- " || (this.scanner.getLineNumber(\n" +
- " declaration.type.sourceStart) != this.scanner\n" +
- " .getLineNumber(\n" +
- " (int) (namePosition >>> 32))))) {\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X16 {\n" +
+ "void foo() {\n" +
+ " // recovery\n" +
+ " if (this.currentElement != null) {\n" +
+ " if (!(this.currentElement instanceof RecoveredType)\n" +
+ " && (this.currentToken == TokenNameDOT\n" +
+ " //|| declaration.modifiers != 0\n" +
+ " || (this.scanner.getLineNumber(declaration.type.sourceStart)\n" +
+ " != this.scanner.getLineNumber((int) (namePosition >>> 32))))){\n" +
+ " return;\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp1;\n" +
+ "\n" +
+ "public class X16 {\n" +
+ " void foo() {\n" +
+ " // recovery\n" +
+ " if (this.currentElement != null) {\n" +
+ " if (!(this.currentElement instanceof RecoveredType)\n" +
+ " && (this.currentToken == TokenNameDOT\n" +
+ " // || declaration.modifiers != 0\n" +
+ " || (this.scanner.getLineNumber(\n" +
+ " declaration.type.sourceStart) != this.scanner\n" +
+ " .getLineNumber(\n" +
+ " (int) (namePosition >>> 32))))) {\n" +
+ " return;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -8617,25 +8617,25 @@ public void testBug330313_wksp1_16_njl() {
public void testBug330313_wksp1_17_njl() {
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X17 {\n" +
- " void foo() {\n" +
- " if ((currentMethodScope = this.methodScope())\n" +
- " != outerLocalVariable.declaringScope.methodScope()) {\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X17 {\n" +
+ " void foo() {\n" +
+ " if ((currentMethodScope = this.methodScope())\n" +
+ " != outerLocalVariable.declaringScope.methodScope()) {\n" +
+ " return;\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X17 {\n" +
- " void foo() {\n" +
- " if ((currentMethodScope = this.methodScope()) != outerLocalVariable.declaringScope.methodScope()) {\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X17 {\n" +
+ " void foo() {\n" +
+ " if ((currentMethodScope = this.methodScope()) != outerLocalVariable.declaringScope.methodScope()) {\n" +
+ " return;\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -8643,33 +8643,33 @@ public void testBug330313_wksp1_17_njl() {
public void testBug330313_wksp1_18_njl() {
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X18 {\n" +
- " public boolean foo() {\n" +
- " return (\n" +
- " safeSubtreeMatch(node.getJavadoc(), o.getJavadoc())\n" +
- " && safeSubtreeListMatch(node.modifiers(), o.modifiers())\n" +
- " && safeSubtreeMatch(node.getName(), o.getName())\n" +
- " && safeSubtreeListMatch(node.arguments(), o.arguments())\n" +
- " && safeSubtreeListMatch(\n" +
- " node.bodyDeclarations(),\n" +
- " o.bodyDeclarations()));\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X18 {\n" +
+ " public boolean foo() {\n" +
+ " return (\n" +
+ " safeSubtreeMatch(node.getJavadoc(), o.getJavadoc())\n" +
+ " && safeSubtreeListMatch(node.modifiers(), o.modifiers())\n" +
+ " && safeSubtreeMatch(node.getName(), o.getName())\n" +
+ " && safeSubtreeListMatch(node.arguments(), o.arguments())\n" +
+ " && safeSubtreeListMatch(\n" +
+ " node.bodyDeclarations(),\n" +
+ " o.bodyDeclarations()));\n" +
+ " }\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X18 {\n" +
- " public boolean foo() {\n" +
- " return (safeSubtreeMatch(node.getJavadoc(), o.getJavadoc())\n" +
- " && safeSubtreeListMatch(node.modifiers(), o.modifiers())\n" +
- " && safeSubtreeMatch(node.getName(), o.getName())\n" +
- " && safeSubtreeListMatch(node.arguments(), o.arguments())\n" +
- " && safeSubtreeListMatch(\n" +
- " node.bodyDeclarations(),\n" +
- " o.bodyDeclarations()));\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X18 {\n" +
+ " public boolean foo() {\n" +
+ " return (safeSubtreeMatch(node.getJavadoc(), o.getJavadoc())\n" +
+ " && safeSubtreeListMatch(node.modifiers(), o.modifiers())\n" +
+ " && safeSubtreeMatch(node.getName(), o.getName())\n" +
+ " && safeSubtreeListMatch(node.arguments(), o.arguments())\n" +
+ " && safeSubtreeListMatch(\n" +
+ " node.bodyDeclarations(),\n" +
+ " o.bodyDeclarations()));\n" +
+ " }\n" +
"}\n"
);
}
@@ -8677,34 +8677,34 @@ public void testBug330313_wksp1_19_njl() {
this.formatterPrefs.join_wrapped_lines = false;
setPageWidth80();
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X19 {\n" +
- " public boolean foo() {\n" +
- " return (\n" +
- " safeSubtreeMatch(node.getJavadoc(), o.getJavadoc())\n" +
- " && safeSubtreeListMatch(node.modifiers(), o.modifiers())\n" +
- " && safeSubtreeMatch(node.getName(), o.getName())\n" +
- " && safeSubtreeListMatch(node.superInterfaceTypes(), o.superInterfaceTypes())\n" +
- " && safeSubtreeListMatch(\n" +
- " node.bodyDeclarations(),\n" +
- " o.bodyDeclarations()));\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X19 {\n" +
+ " public boolean foo() {\n" +
+ " return (\n" +
+ " safeSubtreeMatch(node.getJavadoc(), o.getJavadoc())\n" +
+ " && safeSubtreeListMatch(node.modifiers(), o.modifiers())\n" +
+ " && safeSubtreeMatch(node.getName(), o.getName())\n" +
+ " && safeSubtreeListMatch(node.superInterfaceTypes(), o.superInterfaceTypes())\n" +
+ " && safeSubtreeListMatch(\n" +
+ " node.bodyDeclarations(),\n" +
+ " o.bodyDeclarations()));\n" +
+ " }\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X19 {\n" +
- " public boolean foo() {\n" +
- " return (safeSubtreeMatch(node.getJavadoc(), o.getJavadoc())\n" +
- " && safeSubtreeListMatch(node.modifiers(), o.modifiers())\n" +
- " && safeSubtreeMatch(node.getName(), o.getName())\n" +
- " && safeSubtreeListMatch(node.superInterfaceTypes(),\n" +
- " o.superInterfaceTypes())\n" +
- " && safeSubtreeListMatch(\n" +
- " node.bodyDeclarations(),\n" +
- " o.bodyDeclarations()));\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X19 {\n" +
+ " public boolean foo() {\n" +
+ " return (safeSubtreeMatch(node.getJavadoc(), o.getJavadoc())\n" +
+ " && safeSubtreeListMatch(node.modifiers(), o.modifiers())\n" +
+ " && safeSubtreeMatch(node.getName(), o.getName())\n" +
+ " && safeSubtreeListMatch(node.superInterfaceTypes(),\n" +
+ " o.superInterfaceTypes())\n" +
+ " && safeSubtreeListMatch(\n" +
+ " node.bodyDeclarations(),\n" +
+ " o.bodyDeclarations()));\n" +
+ " }\n" +
"}\n"
);
}
@@ -8714,37 +8714,37 @@ public void testBug330313_wksp1_20_njl() {
this.formatterPrefs.alignment_for_assignment = Alignment.M_COMPACT_SPLIT;
setPageWidth80();
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X20 {\n" +
- "\n" +
- " static final String decode(String entity) {\n" +
- " if (true) {\n" +
- " if (entity.charAt(2) == \'X\' || entity.charAt(2) == \'x\') {\n" +
- " }\n" +
- " Character c =\n" +
- " new Character((char)Integer.parseInt(entity.substring(start), radix));\n" +
- " return c.toString();\n" +
- " }\n" +
- " return \"\";\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X20 {\n" +
+ "\n" +
+ " static final String decode(String entity) {\n" +
+ " if (true) {\n" +
+ " if (entity.charAt(2) == \'X\' || entity.charAt(2) == \'x\') {\n" +
+ " }\n" +
+ " Character c =\n" +
+ " new Character((char)Integer.parseInt(entity.substring(start), radix));\n" +
+ " return c.toString();\n" +
+ " }\n" +
+ " return \"\";\n" +
+ " }\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X20 {\n" +
- "\n" +
- " static final String decode(String entity) {\n" +
- " if (true) {\n" +
- " if (entity.charAt(2) == \'X\' || entity.charAt(2) == \'x\') {\n" +
- " }\n" +
- " Character c =\n" +
- " new Character((char) Integer\n" +
- " .parseInt(entity.substring(start), radix));\n" +
- " return c.toString();\n" +
- " }\n" +
- " return \"\";\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X20 {\n" +
+ "\n" +
+ " static final String decode(String entity) {\n" +
+ " if (true) {\n" +
+ " if (entity.charAt(2) == \'X\' || entity.charAt(2) == \'x\') {\n" +
+ " }\n" +
+ " Character c =\n" +
+ " new Character((char) Integer\n" +
+ " .parseInt(entity.substring(start), radix));\n" +
+ " return c.toString();\n" +
+ " }\n" +
+ " return \"\";\n" +
+ " }\n" +
"}\n"
);
}
@@ -8753,21 +8753,21 @@ public void testBug330313_wksp1_21_njl() {
this.formatterPrefs.join_wrapped_lines = false;
setPageWidth80();
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X21 {\n" +
- " public boolean isAvailable() {\n" +
- " return !(getViewer() == null || getViewer().getControl() == null || getViewer().getControl().isDisposed());\n" +
- " } \n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X21 {\n" +
+ " public boolean isAvailable() {\n" +
+ " return !(getViewer() == null || getViewer().getControl() == null || getViewer().getControl().isDisposed());\n" +
+ " } \n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X21 {\n" +
- " public boolean isAvailable() {\n" +
- " return !(getViewer() == null || getViewer().getControl() == null\n" +
- " || getViewer().getControl().isDisposed());\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X21 {\n" +
+ " public boolean isAvailable() {\n" +
+ " return !(getViewer() == null || getViewer().getControl() == null\n" +
+ " || getViewer().getControl().isDisposed());\n" +
+ " }\n" +
"}\n"
);
}
@@ -8776,151 +8776,151 @@ public void testBug330313_wksp1_22_njl() {
this.formatterPrefs.join_wrapped_lines = false;
setPageWidth80();
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X22 {\n" +
- " public boolean foo() {\n" +
- " return (\n" +
- " (node.isInterface() == o.isInterface())\n" +
- " && safeSubtreeMatch(node.getJavadoc(), o.getJavadoc())\n" +
- " && safeSubtreeMatch(node.getName(), o.getName())\n" +
- " && safeSubtreeListMatch(node.bodyDeclarations(), o.bodyDeclarations()));\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X22 {\n" +
+ " public boolean foo() {\n" +
+ " return (\n" +
+ " (node.isInterface() == o.isInterface())\n" +
+ " && safeSubtreeMatch(node.getJavadoc(), o.getJavadoc())\n" +
+ " && safeSubtreeMatch(node.getName(), o.getName())\n" +
+ " && safeSubtreeListMatch(node.bodyDeclarations(), o.bodyDeclarations()));\n" +
+ " }\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X22 {\n" +
- " public boolean foo() {\n" +
- " return ((node.isInterface() == o.isInterface())\n" +
- " && safeSubtreeMatch(node.getJavadoc(), o.getJavadoc())\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X22 {\n" +
+ " public boolean foo() {\n" +
+ " return ((node.isInterface() == o.isInterface())\n" +
+ " && safeSubtreeMatch(node.getJavadoc(), o.getJavadoc())\n" +
" && safeSubtreeMatch(node.getName(), o.getName())\n" +
- " && safeSubtreeListMatch(node.bodyDeclarations(),\n" +
- " o.bodyDeclarations()));\n" +
- " }\n" +
+ " && safeSubtreeListMatch(node.bodyDeclarations(),\n" +
+ " o.bodyDeclarations()));\n" +
+ " }\n" +
"}\n"
);
}
public void testBug330313_wksp1_23_njl() {
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X23 {\n" +
- " void foo() {\n" +
- " boolean wasError = IMarker.SEVERITY_ERROR == pb.getAttribute(IMarker.SEVERITY,\n" +
- " IMarker.SEVERITY_ERROR);\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X23 {\n" +
+ " void foo() {\n" +
+ " boolean wasError = IMarker.SEVERITY_ERROR == pb.getAttribute(IMarker.SEVERITY,\n" +
+ " IMarker.SEVERITY_ERROR);\n" +
+ " }\n" +
"}\n";
formatSource(source );
}
public void testBug330313_wksp1_24_njl() {
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X24 {\n" +
- "\n" +
- " protected boolean canRunEvaluation() {\n" +
- " // NOTE similar to #canStep, except a quiet suspend state is OK\n" +
- " try {\n" +
- " return isSuspendedQuiet() || (isSuspended()\n" +
- " && !(isPerformingEvaluation() || isInvokingMethod())\n" +
- " && !isStepping()\n" +
- " && getTopStackFrame() != null\n" +
- " && !getJavaDebugTarget().isPerformingHotCodeReplace());\n" +
- " } catch (DebugException e) {\n" +
- " return false;\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X24 {\n" +
+ "\n" +
+ " protected boolean canRunEvaluation() {\n" +
+ " // NOTE similar to #canStep, except a quiet suspend state is OK\n" +
+ " try {\n" +
+ " return isSuspendedQuiet() || (isSuspended()\n" +
+ " && !(isPerformingEvaluation() || isInvokingMethod())\n" +
+ " && !isStepping()\n" +
+ " && getTopStackFrame() != null\n" +
+ " && !getJavaDebugTarget().isPerformingHotCodeReplace());\n" +
+ " } catch (DebugException e) {\n" +
+ " return false;\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source );
}
public void testBug330313_wksp1_25_njl() {
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X25 {\n" +
- "\n" +
- " void unloadIcon(ImageData icon) {\n" +
- " int sizeImage = (((icon.width * icon.depth + 31) / 32 * 4) +\n" +
- " ((icon.width + 31) / 32 * 4)) * icon.height;\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X25 {\n" +
+ "\n" +
+ " void unloadIcon(ImageData icon) {\n" +
+ " int sizeImage = (((icon.width * icon.depth + 31) / 32 * 4) +\n" +
+ " ((icon.width + 31) / 32 * 4)) * icon.height;\n" +
+ " }\n" +
"}\n";
formatSource(source );
}
public void testBug330313_wksp1_26_njl() {
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X26 {\n" +
- "\n" +
- "void foo() {\n" +
- " for (int i = 0; i < data.length; i++) {\n" +
- " byte s = data[i];\n" +
- " sourceData[i] = (byte)(((s & 0x80) >> 7) |\n" +
- " ((s & 0x40) >> 5) |\n" +
- " ((s & 0x20) >> 3) |\n" +
- " ((s & 0x10) >> 1) |\n" +
- " ((s & 0x08) << 1) |\n" +
- " ((s & 0x04) << 3) |\n" +
- " ((s & 0x02) << 5) |\n" +
- " ((s & 0x01) << 7));\n" +
- " }\n" +
- "}\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X26 {\n" +
+ "\n" +
+ "void foo() {\n" +
+ " for (int i = 0; i < data.length; i++) {\n" +
+ " byte s = data[i];\n" +
+ " sourceData[i] = (byte)(((s & 0x80) >> 7) |\n" +
+ " ((s & 0x40) >> 5) |\n" +
+ " ((s & 0x20) >> 3) |\n" +
+ " ((s & 0x10) >> 1) |\n" +
+ " ((s & 0x08) << 1) |\n" +
+ " ((s & 0x04) << 3) |\n" +
+ " ((s & 0x02) << 5) |\n" +
+ " ((s & 0x01) << 7));\n" +
+ " }\n" +
+ "}\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X26 {\n" +
- "\n" +
- " void foo() {\n" +
- " for (int i = 0; i < data.length; i++) {\n" +
- " byte s = data[i];\n" +
- " sourceData[i] = (byte) (((s & 0x80) >> 7) |\n" +
- " ((s & 0x40) >> 5) |\n" +
- " ((s & 0x20) >> 3) |\n" +
- " ((s & 0x10) >> 1) |\n" +
- " ((s & 0x08) << 1) |\n" +
- " ((s & 0x04) << 3) |\n" +
- " ((s & 0x02) << 5) |\n" +
- " ((s & 0x01) << 7));\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X26 {\n" +
+ "\n" +
+ " void foo() {\n" +
+ " for (int i = 0; i < data.length; i++) {\n" +
+ " byte s = data[i];\n" +
+ " sourceData[i] = (byte) (((s & 0x80) >> 7) |\n" +
+ " ((s & 0x40) >> 5) |\n" +
+ " ((s & 0x20) >> 3) |\n" +
+ " ((s & 0x10) >> 1) |\n" +
+ " ((s & 0x08) << 1) |\n" +
+ " ((s & 0x04) << 3) |\n" +
+ " ((s & 0x02) << 5) |\n" +
+ " ((s & 0x01) << 7));\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
public void testBug330313_wksp1_27_njl() {
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X27 {\n" +
- " private void foo() {\n" +
- "\n" +
- " if (_VerificationResult.getVerificationCode()\n" +
- " == IVerificationResult.TYPE_ENTRY_SIGNED_UNRECOGNIZED\n" +
- " || _VerificationResult.getVerificationCode()\n" +
- " == IVerificationResult.TYPE_ENTRY_SIGNED_RECOGNIZED) {\n" +
- " // Group box\n" +
- " }\n" +
- " }\n" +
- "\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X27 {\n" +
+ " private void foo() {\n" +
+ "\n" +
+ " if (_VerificationResult.getVerificationCode()\n" +
+ " == IVerificationResult.TYPE_ENTRY_SIGNED_UNRECOGNIZED\n" +
+ " || _VerificationResult.getVerificationCode()\n" +
+ " == IVerificationResult.TYPE_ENTRY_SIGNED_RECOGNIZED) {\n" +
+ " // Group box\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X27 {\n" +
- " private void foo() {\n" +
- "\n" +
- " if (_VerificationResult.getVerificationCode() == IVerificationResult.TYPE_ENTRY_SIGNED_UNRECOGNIZED\n" +
- " || _VerificationResult.getVerificationCode() == IVerificationResult.TYPE_ENTRY_SIGNED_RECOGNIZED) {\n" +
- " // Group box\n" +
- " }\n" +
- " }\n" +
- "\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X27 {\n" +
+ " private void foo() {\n" +
+ "\n" +
+ " if (_VerificationResult.getVerificationCode() == IVerificationResult.TYPE_ENTRY_SIGNED_UNRECOGNIZED\n" +
+ " || _VerificationResult.getVerificationCode() == IVerificationResult.TYPE_ENTRY_SIGNED_RECOGNIZED) {\n" +
+ " // Group box\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
"}\n"
);
}
@@ -8928,51 +8928,51 @@ public void testBug330313_wksp1_28_njl() {
this.formatterPrefs.join_wrapped_lines = false;
setPageWidth80();
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X28 {\n" +
- "\n" +
- " void foo() {\n" +
- " if (fieldBinding.declaringClass != lastReceiverType\n" +
- " && !lastReceiverType.isArrayType() \n" +
- " && fieldBinding.declaringClass != null\n" +
- " && fieldBinding.constant == NotAConstant\n" +
- " && ((currentScope.environment().options.targetJDK >= ClassFileConstants.JDK1_2\n" +
- " && (fieldBinding != this.binding || this.indexOfFirstFieldBinding > 1 || !fieldBinding.isStatic())\n" +
- " && fieldBinding.declaringClass.id != T_Object)\n" +
- " || !(useDelegate\n" +
- " ? new CodeSnippetScope(currentScope).canBeSeenByForCodeSnippet(fieldBinding.declaringClass, (ReferenceBinding) this.delegateThis.type)\n" +
- " : fieldBinding.declaringClass.canBeSeenBy(currentScope)))){\n" +
- " // code\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X28 {\n" +
+ "\n" +
+ " void foo() {\n" +
+ " if (fieldBinding.declaringClass != lastReceiverType\n" +
+ " && !lastReceiverType.isArrayType() \n" +
+ " && fieldBinding.declaringClass != null\n" +
+ " && fieldBinding.constant == NotAConstant\n" +
+ " && ((currentScope.environment().options.targetJDK >= ClassFileConstants.JDK1_2\n" +
+ " && (fieldBinding != this.binding || this.indexOfFirstFieldBinding > 1 || !fieldBinding.isStatic())\n" +
+ " && fieldBinding.declaringClass.id != T_Object)\n" +
+ " || !(useDelegate\n" +
+ " ? new CodeSnippetScope(currentScope).canBeSeenByForCodeSnippet(fieldBinding.declaringClass, (ReferenceBinding) this.delegateThis.type)\n" +
+ " : fieldBinding.declaringClass.canBeSeenBy(currentScope)))){\n" +
+ " // code\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X28 {\n" +
- "\n" +
- " void foo() {\n" +
- " if (fieldBinding.declaringClass != lastReceiverType\n" +
- " && !lastReceiverType.isArrayType()\n" +
- " && fieldBinding.declaringClass != null\n" +
- " && fieldBinding.constant == NotAConstant\n" +
- " && ((currentScope\n" +
- " .environment().options.targetJDK >= ClassFileConstants.JDK1_2\n" +
- " && (fieldBinding != this.binding\n" +
- " || this.indexOfFirstFieldBinding > 1\n" +
- " || !fieldBinding.isStatic())\n" +
- " && fieldBinding.declaringClass.id != T_Object)\n" +
- " || !(useDelegate\n" +
- " ? new CodeSnippetScope(currentScope)\n" +
- " .canBeSeenByForCodeSnippet(\n" +
- " fieldBinding.declaringClass,\n" +
- " (ReferenceBinding) this.delegateThis.type)\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X28 {\n" +
+ "\n" +
+ " void foo() {\n" +
+ " if (fieldBinding.declaringClass != lastReceiverType\n" +
+ " && !lastReceiverType.isArrayType()\n" +
+ " && fieldBinding.declaringClass != null\n" +
+ " && fieldBinding.constant == NotAConstant\n" +
+ " && ((currentScope\n" +
+ " .environment().options.targetJDK >= ClassFileConstants.JDK1_2\n" +
+ " && (fieldBinding != this.binding\n" +
+ " || this.indexOfFirstFieldBinding > 1\n" +
+ " || !fieldBinding.isStatic())\n" +
+ " && fieldBinding.declaringClass.id != T_Object)\n" +
+ " || !(useDelegate\n" +
+ " ? new CodeSnippetScope(currentScope)\n" +
+ " .canBeSeenByForCodeSnippet(\n" +
+ " fieldBinding.declaringClass,\n" +
+ " (ReferenceBinding) this.delegateThis.type)\n" +
" : fieldBinding.declaringClass\n" +
- " .canBeSeenBy(currentScope)))) {\n" +
- " // code\n" +
- " }\n" +
- " }\n" +
+ " .canBeSeenBy(currentScope)))) {\n" +
+ " // code\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -8980,23 +8980,23 @@ public void testBug330313_wksp1_29_njl() {
this.formatterPrefs.join_wrapped_lines = false;
setPageWidth80();
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X29 {\n" +
- "\n" +
- " boolean foo() {\n" +
- " return (pack != null && otherpack != null && isSamePackage(pack, otherpack));\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X29 {\n" +
+ "\n" +
+ " boolean foo() {\n" +
+ " return (pack != null && otherpack != null && isSamePackage(pack, otherpack));\n" +
+ " }\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X29 {\n" +
- "\n" +
- " boolean foo() {\n" +
- " return (pack != null && otherpack != null\n" +
- " && isSamePackage(pack, otherpack));\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X29 {\n" +
+ "\n" +
+ " boolean foo() {\n" +
+ " return (pack != null && otherpack != null\n" +
+ " && isSamePackage(pack, otherpack));\n" +
+ " }\n" +
"}\n"
);
}
@@ -9004,25 +9004,25 @@ public void testBug330313_wksp1_30_njl() {
this.formatterPrefs.join_wrapped_lines = false;
setPageWidth80();
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X30 {\n" +
- " private boolean isInTypeNestedInInputType(ASTNode node, TypeDeclaration inputType){\n" +
- " return (isInAnonymousTypeInsideInputType(node, inputType) ||\n" +
- " isInLocalTypeInsideInputType(node, inputType) ||\n" +
- " isInNonStaticMemberTypeInsideInputType(node, inputType));\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X30 {\n" +
+ " private boolean isInTypeNestedInInputType(ASTNode node, TypeDeclaration inputType){\n" +
+ " return (isInAnonymousTypeInsideInputType(node, inputType) ||\n" +
+ " isInLocalTypeInsideInputType(node, inputType) ||\n" +
+ " isInNonStaticMemberTypeInsideInputType(node, inputType));\n" +
+ " }\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X30 {\n" +
- " private boolean isInTypeNestedInInputType(ASTNode node,\n" +
- " TypeDeclaration inputType) {\n" +
- " return (isInAnonymousTypeInsideInputType(node, inputType) ||\n" +
- " isInLocalTypeInsideInputType(node, inputType) ||\n" +
- " isInNonStaticMemberTypeInsideInputType(node, inputType));\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X30 {\n" +
+ " private boolean isInTypeNestedInInputType(ASTNode node,\n" +
+ " TypeDeclaration inputType) {\n" +
+ " return (isInAnonymousTypeInsideInputType(node, inputType) ||\n" +
+ " isInLocalTypeInsideInputType(node, inputType) ||\n" +
+ " isInNonStaticMemberTypeInsideInputType(node, inputType));\n" +
+ " }\n" +
"}\n"
);
}
@@ -9030,36 +9030,36 @@ public void testBug330313_wksp1_31_njl() {
this.formatterPrefs.join_wrapped_lines = false;
setPageWidth80();
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X31 {\n" +
- " void foo(int i) {\n" +
- " if (true) {\n" +
- " switch (i) {\n" +
- " case 0:\n" +
- " if (!((offset == (hashable.length - 1)) && !has95 && hasOneOf(meta63, hashable, offset - 2, 2) && !hasOneOf(meta64, hashable, offset - 4, 2)))\n" +
- " buffer.append(\'R\');\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X31 {\n" +
+ " void foo(int i) {\n" +
+ " if (true) {\n" +
+ " switch (i) {\n" +
+ " case 0:\n" +
+ " if (!((offset == (hashable.length - 1)) && !has95 && hasOneOf(meta63, hashable, offset - 2, 2) && !hasOneOf(meta64, hashable, offset - 4, 2)))\n" +
+ " buffer.append(\'R\');\n" +
+ " break;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X31 {\n" +
- " void foo(int i) {\n" +
- " if (true) {\n" +
- " switch (i) {\n" +
- " case 0:\n" +
- " if (!((offset == (hashable.length - 1)) && !has95\n" +
- " && hasOneOf(meta63, hashable, offset - 2, 2)\n" +
- " && !hasOneOf(meta64, hashable, offset - 4, 2)))\n" +
- " buffer.append(\'R\');\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X31 {\n" +
+ " void foo(int i) {\n" +
+ " if (true) {\n" +
+ " switch (i) {\n" +
+ " case 0:\n" +
+ " if (!((offset == (hashable.length - 1)) && !has95\n" +
+ " && hasOneOf(meta63, hashable, offset - 2, 2)\n" +
+ " && !hasOneOf(meta64, hashable, offset - 4, 2)))\n" +
+ " buffer.append(\'R\');\n" +
+ " break;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -9067,23 +9067,23 @@ public void testBug330313_wksp1_32_njl() {
this.formatterPrefs.join_wrapped_lines = false;
setPageWidth80();
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X32 {\n" +
- " public boolean equals(Object object) {\n" +
- " TextAttribute a= (TextAttribute) object;\n" +
- " return (a.style == style && equals(a.foreground, foreground) && equals(a.background, background));\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X32 {\n" +
+ " public boolean equals(Object object) {\n" +
+ " TextAttribute a= (TextAttribute) object;\n" +
+ " return (a.style == style && equals(a.foreground, foreground) && equals(a.background, background));\n" +
+ " }\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X32 {\n" +
- " public boolean equals(Object object) {\n" +
- " TextAttribute a = (TextAttribute) object;\n" +
- " return (a.style == style && equals(a.foreground, foreground)\n" +
- " && equals(a.background, background));\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X32 {\n" +
+ " public boolean equals(Object object) {\n" +
+ " TextAttribute a = (TextAttribute) object;\n" +
+ " return (a.style == style && equals(a.foreground, foreground)\n" +
+ " && equals(a.background, background));\n" +
+ " }\n" +
"}\n"
);
}
@@ -9091,64 +9091,64 @@ public void testBug330313_wksp1_32_njl() {
public void testBug330313_wksp1_33() {
setPageWidth80();
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X33 {\n" +
- " void foo() {\n" +
- " if(inMetaTag &&\n" +
- " ( t1.image.equalsIgnoreCase(\"name\") ||\n" +
- " t1.image.equalsIgnoreCase(\"HTTP-EQUIV\")\n" +
- " )\n" +
- " && t2 != null)\n" +
- " {\n" +
- " currentMetaTag=t2.image.toLowerCase();\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X33 {\n" +
+ " void foo() {\n" +
+ " if(inMetaTag &&\n" +
+ " ( t1.image.equalsIgnoreCase(\"name\") ||\n" +
+ " t1.image.equalsIgnoreCase(\"HTTP-EQUIV\")\n" +
+ " )\n" +
+ " && t2 != null)\n" +
+ " {\n" +
+ " currentMetaTag=t2.image.toLowerCase();\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X33 {\n" +
- " void foo() {\n" +
- " if (inMetaTag\n" +
- " && (t1.image.equalsIgnoreCase(\"name\")\n" +
- " || t1.image.equalsIgnoreCase(\"HTTP-EQUIV\"))\n" +
- " && t2 != null) {\n" +
- " currentMetaTag = t2.image.toLowerCase();\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X33 {\n" +
+ " void foo() {\n" +
+ " if (inMetaTag\n" +
+ " && (t1.image.equalsIgnoreCase(\"name\")\n" +
+ " || t1.image.equalsIgnoreCase(\"HTTP-EQUIV\"))\n" +
+ " && t2 != null) {\n" +
+ " currentMetaTag = t2.image.toLowerCase();\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
public void testBug330313_wksp1_33_njl() {
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X33 {\n" +
- " void foo() {\n" +
- " if(inMetaTag &&\n" +
- " ( t1.image.equalsIgnoreCase(\"name\") ||\n" +
- " t1.image.equalsIgnoreCase(\"HTTP-EQUIV\")\n" +
- " )\n" +
- " && t2 != null)\n" +
- " {\n" +
- " currentMetaTag=t2.image.toLowerCase();\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X33 {\n" +
+ " void foo() {\n" +
+ " if(inMetaTag &&\n" +
+ " ( t1.image.equalsIgnoreCase(\"name\") ||\n" +
+ " t1.image.equalsIgnoreCase(\"HTTP-EQUIV\")\n" +
+ " )\n" +
+ " && t2 != null)\n" +
+ " {\n" +
+ " currentMetaTag=t2.image.toLowerCase();\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X33 {\n" +
- " void foo() {\n" +
- " if (inMetaTag &&\n" +
- " (t1.image.equalsIgnoreCase(\"name\") ||\n" +
- " t1.image.equalsIgnoreCase(\"HTTP-EQUIV\"))\n" +
- " && t2 != null) {\n" +
- " currentMetaTag = t2.image.toLowerCase();\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X33 {\n" +
+ " void foo() {\n" +
+ " if (inMetaTag &&\n" +
+ " (t1.image.equalsIgnoreCase(\"name\") ||\n" +
+ " t1.image.equalsIgnoreCase(\"HTTP-EQUIV\"))\n" +
+ " && t2 != null) {\n" +
+ " currentMetaTag = t2.image.toLowerCase();\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -9156,34 +9156,34 @@ public void testBug330313_wksp1_34_njl() {
this.formatterPrefs.join_wrapped_lines = false;
setPageWidth80();
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X34 {\n" +
- " private boolean compareMarkers(ResourceInfo oldElement, ResourceInfo newElement) {\n" +
- " boolean bothNull = oldElement.getMarkers(false) == null && newElement.getMarkers(false) == null;\n" +
- " return bothNull || oldElement.getMarkerGenerationCount() == newElement.getMarkerGenerationCount();\n" +
- " }\n" +
- " private boolean compareSync(ResourceInfo oldElement, ResourceInfo newElement) {\n" +
- " return oldElement.getSyncInfoGenerationCount() == newElement.getSyncInfoGenerationCount();\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X34 {\n" +
+ " private boolean compareMarkers(ResourceInfo oldElement, ResourceInfo newElement) {\n" +
+ " boolean bothNull = oldElement.getMarkers(false) == null && newElement.getMarkers(false) == null;\n" +
+ " return bothNull || oldElement.getMarkerGenerationCount() == newElement.getMarkerGenerationCount();\n" +
+ " }\n" +
+ " private boolean compareSync(ResourceInfo oldElement, ResourceInfo newElement) {\n" +
+ " return oldElement.getSyncInfoGenerationCount() == newElement.getSyncInfoGenerationCount();\n" +
+ " }\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X34 {\n" +
- " private boolean compareMarkers(ResourceInfo oldElement,\n" +
- " ResourceInfo newElement) {\n" +
- " boolean bothNull = oldElement.getMarkers(false) == null\n" +
- " && newElement.getMarkers(false) == null;\n" +
- " return bothNull || oldElement.getMarkerGenerationCount() == newElement\n" +
- " .getMarkerGenerationCount();\n" +
- " }\n" +
- "\n" +
- " private boolean compareSync(ResourceInfo oldElement,\n" +
- " ResourceInfo newElement) {\n" +
- " return oldElement.getSyncInfoGenerationCount() == newElement\n" +
- " .getSyncInfoGenerationCount();\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X34 {\n" +
+ " private boolean compareMarkers(ResourceInfo oldElement,\n" +
+ " ResourceInfo newElement) {\n" +
+ " boolean bothNull = oldElement.getMarkers(false) == null\n" +
+ " && newElement.getMarkers(false) == null;\n" +
+ " return bothNull || oldElement.getMarkerGenerationCount() == newElement\n" +
+ " .getMarkerGenerationCount();\n" +
+ " }\n" +
+ "\n" +
+ " private boolean compareSync(ResourceInfo oldElement,\n" +
+ " ResourceInfo newElement) {\n" +
+ " return oldElement.getSyncInfoGenerationCount() == newElement\n" +
+ " .getSyncInfoGenerationCount();\n" +
+ " }\n" +
"}\n"
);
}
@@ -9192,29 +9192,29 @@ public void testBug330313_wksp1_35_njl() {
this.formatterPrefs.join_wrapped_lines = false;
setPageWidth80();
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X35 {\n" +
- " void foo() {\n" +
- " if (true) {\n" +
- " if (20+lineNum*printGC.getFontMetrics().getHeight() > printer.getClientArea().height) {\n" +
- " //\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X35 {\n" +
+ " void foo() {\n" +
+ " if (true) {\n" +
+ " if (20+lineNum*printGC.getFontMetrics().getHeight() > printer.getClientArea().height) {\n" +
+ " //\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X35 {\n" +
- " void foo() {\n" +
- " if (true) {\n" +
- " if (20 + lineNum * printGC.getFontMetrics().getHeight() > printer\n" +
- " .getClientArea().height) {\n" +
- " //\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X35 {\n" +
+ " void foo() {\n" +
+ " if (true) {\n" +
+ " if (20 + lineNum * printGC.getFontMetrics().getHeight() > printer\n" +
+ " .getClientArea().height) {\n" +
+ " //\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -9223,26 +9223,26 @@ public void testBug330313_wksp1_36_njl() {
this.formatterPrefs.join_wrapped_lines = false;
setPageWidth80();
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X36 {\n" +
- " public static boolean isRuntimeException(ITypeBinding thrownException) {\n" +
- " if (thrownException == null || thrownException.isPrimitive() || thrownException.isArray())\n" +
- " return false;\n" +
- " return findTypeInHierarchy(thrownException, \"java.lang.RuntimeException\") != null; //$NON-NLS-1$\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X36 {\n" +
+ " public static boolean isRuntimeException(ITypeBinding thrownException) {\n" +
+ " if (thrownException == null || thrownException.isPrimitive() || thrownException.isArray())\n" +
+ " return false;\n" +
+ " return findTypeInHierarchy(thrownException, \"java.lang.RuntimeException\") != null; //$NON-NLS-1$\n" +
+ " }\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X36 {\n" +
- " public static boolean isRuntimeException(ITypeBinding thrownException) {\n" +
- " if (thrownException == null || thrownException.isPrimitive()\n" +
- " || thrownException.isArray())\n" +
- " return false;\n" +
- " return findTypeInHierarchy(thrownException,\n" +
- " \"java.lang.RuntimeException\") != null; //$NON-NLS-1$\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X36 {\n" +
+ " public static boolean isRuntimeException(ITypeBinding thrownException) {\n" +
+ " if (thrownException == null || thrownException.isPrimitive()\n" +
+ " || thrownException.isArray())\n" +
+ " return false;\n" +
+ " return findTypeInHierarchy(thrownException,\n" +
+ " \"java.lang.RuntimeException\") != null; //$NON-NLS-1$\n" +
+ " }\n" +
"}\n"
);
}
@@ -9250,35 +9250,35 @@ public void testBug330313_wksp1_37_njl() {
this.formatterPrefs.join_wrapped_lines = false;
setPageWidth80();
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X37 {\n" +
- " void foo() {\n" +
- " if (true) {\n" +
- " if (ignoreQuickDiffPrefPage && (info.getAnnotationType().equals(\"org.eclipse.ui.workbench.texteditor.quickdiffChange\") //$NON-NLS-1$\n" +
- " || (info.getAnnotationType().equals(\"org.eclipse.ui.workbench.texteditor.quickdiffAddition\")) //$NON-NLS-1$\n" +
- " || (info.getAnnotationType().equals(\"org.eclipse.ui.workbench.texteditor.quickdiffDeletion\")) //$NON-NLS-1$\n" +
- " )) \n" +
- " continue;\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X37 {\n" +
+ " void foo() {\n" +
+ " if (true) {\n" +
+ " if (ignoreQuickDiffPrefPage && (info.getAnnotationType().equals(\"org.eclipse.ui.workbench.texteditor.quickdiffChange\") //$NON-NLS-1$\n" +
+ " || (info.getAnnotationType().equals(\"org.eclipse.ui.workbench.texteditor.quickdiffAddition\")) //$NON-NLS-1$\n" +
+ " || (info.getAnnotationType().equals(\"org.eclipse.ui.workbench.texteditor.quickdiffDeletion\")) //$NON-NLS-1$\n" +
+ " )) \n" +
+ " continue;\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X37 {\n" +
- " void foo() {\n" +
- " if (true) {\n" +
- " if (ignoreQuickDiffPrefPage && (info.getAnnotationType().equals(\n" +
- " \"org.eclipse.ui.workbench.texteditor.quickdiffChange\") //$NON-NLS-1$\n" +
- " || (info.getAnnotationType().equals(\n" +
- " \"org.eclipse.ui.workbench.texteditor.quickdiffAddition\")) //$NON-NLS-1$\n" +
- " || (info.getAnnotationType().equals(\n" +
- " \"org.eclipse.ui.workbench.texteditor.quickdiffDeletion\")) //$NON-NLS-1$\n" +
- " ))\n" +
- " continue;\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X37 {\n" +
+ " void foo() {\n" +
+ " if (true) {\n" +
+ " if (ignoreQuickDiffPrefPage && (info.getAnnotationType().equals(\n" +
+ " \"org.eclipse.ui.workbench.texteditor.quickdiffChange\") //$NON-NLS-1$\n" +
+ " || (info.getAnnotationType().equals(\n" +
+ " \"org.eclipse.ui.workbench.texteditor.quickdiffAddition\")) //$NON-NLS-1$\n" +
+ " || (info.getAnnotationType().equals(\n" +
+ " \"org.eclipse.ui.workbench.texteditor.quickdiffDeletion\")) //$NON-NLS-1$\n" +
+ " ))\n" +
+ " continue;\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -9286,70 +9286,70 @@ public void testBug330313_wksp1_37_njl() {
public void testBug330313_wksp1_38_njl() {
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X38 {\n" +
- " void foo(boolean condition) {\n" +
- " if (condition)\n" +
- " {\n" +
- " // block 1\n" +
- " }\n" +
- " else\n" +
- " {\n" +
- " // block 2\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X38 {\n" +
+ " void foo(boolean condition) {\n" +
+ " if (condition)\n" +
+ " {\n" +
+ " // block 1\n" +
+ " }\n" +
+ " else\n" +
+ " {\n" +
+ " // block 2\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X38 {\n" +
- " void foo(boolean condition) {\n" +
- " if (condition) {\n" +
- " // block 1\n" +
- " } else {\n" +
- " // block 2\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X38 {\n" +
+ " void foo(boolean condition) {\n" +
+ " if (condition) {\n" +
+ " // block 1\n" +
+ " } else {\n" +
+ " // block 2\n" +
+ " }\n" +
+ " }\n" +
"}\n");
}
public void testBug330313_wksp1_39_njl() {
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X39 {\n" +
- "/**\n" +
- " * <pre>\n" +
- " * RadioGroupFieldEditor editor= new RadioGroupFieldEditor(\n" +
- " * \"GeneralPage.DoubleClick\", resName, 1,\n" +
- " * new String[][] {\n" +
- " * {\"Open Browser\", \"open\"},\n" +
- " * {\"Expand Tree\", \"expand\"}\n" +
- " * },\n" +
- " * parent); \n" +
- " * </pre>\n" +
- " */\n" +
- "public void foo() {\n" +
- "}\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X39 {\n" +
+ "/**\n" +
+ " * <pre>\n" +
+ " * RadioGroupFieldEditor editor= new RadioGroupFieldEditor(\n" +
+ " * \"GeneralPage.DoubleClick\", resName, 1,\n" +
+ " * new String[][] {\n" +
+ " * {\"Open Browser\", \"open\"},\n" +
+ " * {\"Expand Tree\", \"expand\"}\n" +
+ " * },\n" +
+ " * parent); \n" +
+ " * </pre>\n" +
+ " */\n" +
+ "public void foo() {\n" +
+ "}\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X39 {\n" +
- " /**\n" +
- " * <pre>\n" +
- " * RadioGroupFieldEditor editor = new RadioGroupFieldEditor(\n" +
- " * \"GeneralPage.DoubleClick\", resName, 1,\n" +
- " * new String[][] {\n" +
- " * { \"Open Browser\", \"open\" },\n" +
- " * { \"Expand Tree\", \"expand\" }\n" +
- " * },\n" +
- " * parent);\n" +
- " * </pre>\n" +
- " */\n" +
- " public void foo() {\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X39 {\n" +
+ " /**\n" +
+ " * <pre>\n" +
+ " * RadioGroupFieldEditor editor = new RadioGroupFieldEditor(\n" +
+ " * \"GeneralPage.DoubleClick\", resName, 1,\n" +
+ " * new String[][] {\n" +
+ " * { \"Open Browser\", \"open\" },\n" +
+ " * { \"Expand Tree\", \"expand\" }\n" +
+ " * },\n" +
+ " * parent);\n" +
+ " * </pre>\n" +
+ " */\n" +
+ " public void foo() {\n" +
+ " }\n" +
"}\n"
);
}
@@ -9357,27 +9357,27 @@ public void testBug330313_wksp1_40_njl() {
this.formatterPrefs.join_wrapped_lines = false;
setPageWidth80();
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X40 {\n" +
- " protected final static String[][] TABLE= new String[][] {\n" +
- " /*INACTIVE*/ /*PARTLY_ACTIVE */ /*ACTIVE */\n" +
- " /* INACTIVE */ { \"INACTIVE\", \"PARTLY_ACTIVE\", \"PARTLY_ACTIVE\" },\n" +
- " /* PARTLY_ACTIVE*/ { \"PARTLY_ACTIVE\", \"PARTLY_ACTIVE\", \"PARTLY_ACTIVE\" },\n" +
- " /* ACTIVE */ { \"PARTLY_ACTIVE\", \"PARTLY_ACTIVE\", \"ACTIVE\"}\n" +
- " };\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X40 {\n" +
+ " protected final static String[][] TABLE= new String[][] {\n" +
+ " /*INACTIVE*/ /*PARTLY_ACTIVE */ /*ACTIVE */\n" +
+ " /* INACTIVE */ { \"INACTIVE\", \"PARTLY_ACTIVE\", \"PARTLY_ACTIVE\" },\n" +
+ " /* PARTLY_ACTIVE*/ { \"PARTLY_ACTIVE\", \"PARTLY_ACTIVE\", \"PARTLY_ACTIVE\" },\n" +
+ " /* ACTIVE */ { \"PARTLY_ACTIVE\", \"PARTLY_ACTIVE\", \"ACTIVE\"}\n" +
+ " };\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X40 {\n" +
- " protected final static String[][] TABLE = new String[][] {\n" +
- " /* INACTIVE */ /* PARTLY_ACTIVE */ /* ACTIVE */\n" +
- " /* INACTIVE */ { \"INACTIVE\", \"PARTLY_ACTIVE\", \"PARTLY_ACTIVE\" },\n" +
- " /* PARTLY_ACTIVE */ { \"PARTLY_ACTIVE\", \"PARTLY_ACTIVE\",\n" +
- " \"PARTLY_ACTIVE\" },\n" +
- " /* ACTIVE */ { \"PARTLY_ACTIVE\", \"PARTLY_ACTIVE\", \"ACTIVE\" }\n" +
- " };\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X40 {\n" +
+ " protected final static String[][] TABLE = new String[][] {\n" +
+ " /* INACTIVE */ /* PARTLY_ACTIVE */ /* ACTIVE */\n" +
+ " /* INACTIVE */ { \"INACTIVE\", \"PARTLY_ACTIVE\", \"PARTLY_ACTIVE\" },\n" +
+ " /* PARTLY_ACTIVE */ { \"PARTLY_ACTIVE\", \"PARTLY_ACTIVE\",\n" +
+ " \"PARTLY_ACTIVE\" },\n" +
+ " /* ACTIVE */ { \"PARTLY_ACTIVE\", \"PARTLY_ACTIVE\", \"ACTIVE\" }\n" +
+ " };\n" +
"}\n"
);
}
@@ -9385,173 +9385,173 @@ public void testBug330313_wksp1_41_njl() {
setFormatLineCommentOnFirstColumn();
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X41 {\n" +
- " static final int [][] TABLE = {\n" +
- " \n" +
- " /* First */\n" +
- " {1, 2},\n" +
- " {3, 4},\n" +
- " {5, 6},\n" +
- "// {7????, 8},\n" +
- "\n" +
- " /* Second */ \n" +
- "// {11, 12},\n" +
- "// {13, 14},\n" +
- "// {15, 16},\n" +
- " \n" +
- " \n" +
- " /* Third */\n" +
- " {21, 22},\n" +
- " {23, 24},\n" +
- " {25, 26},\n" +
- "// {27????, 28},\n" +
- "\n" +
- " /* Others */\n" +
- " {31, 32},\n" +
- " {33, 34},\n" +
- " {35, 36},\n" +
- "// {37????, 38},\n" +
- " \n" +
- " };\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X41 {\n" +
+ " static final int [][] TABLE = {\n" +
+ " \n" +
+ " /* First */\n" +
+ " {1, 2},\n" +
+ " {3, 4},\n" +
+ " {5, 6},\n" +
+ "// {7????, 8},\n" +
+ "\n" +
+ " /* Second */ \n" +
+ "// {11, 12},\n" +
+ "// {13, 14},\n" +
+ "// {15, 16},\n" +
+ " \n" +
+ " \n" +
+ " /* Third */\n" +
+ " {21, 22},\n" +
+ " {23, 24},\n" +
+ " {25, 26},\n" +
+ "// {27????, 28},\n" +
+ "\n" +
+ " /* Others */\n" +
+ " {31, 32},\n" +
+ " {33, 34},\n" +
+ " {35, 36},\n" +
+ "// {37????, 38},\n" +
+ " \n" +
+ " };\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X41 {\n" +
- " static final int[][] TABLE = {\n" +
- "\n" +
- " /* First */\n" +
- " { 1, 2 },\n" +
- " { 3, 4 },\n" +
- " { 5, 6 },\n" +
- " // {7????, 8},\n" +
- "\n" +
- " /* Second */\n" +
- " // {11, 12},\n" +
- " // {13, 14},\n" +
- " // {15, 16},\n" +
- "\n" +
- " /* Third */\n" +
- " { 21, 22 },\n" +
- " { 23, 24 },\n" +
- " { 25, 26 },\n" +
- " // {27????, 28},\n" +
- "\n" +
- " /* Others */\n" +
- " { 31, 32 },\n" +
- " { 33, 34 },\n" +
- " { 35, 36 },\n" +
- " // {37????, 38},\n" +
- "\n" +
- " };\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X41 {\n" +
+ " static final int[][] TABLE = {\n" +
+ "\n" +
+ " /* First */\n" +
+ " { 1, 2 },\n" +
+ " { 3, 4 },\n" +
+ " { 5, 6 },\n" +
+ " // {7????, 8},\n" +
+ "\n" +
+ " /* Second */\n" +
+ " // {11, 12},\n" +
+ " // {13, 14},\n" +
+ " // {15, 16},\n" +
+ "\n" +
+ " /* Third */\n" +
+ " { 21, 22 },\n" +
+ " { 23, 24 },\n" +
+ " { 25, 26 },\n" +
+ " // {27????, 28},\n" +
+ "\n" +
+ " /* Others */\n" +
+ " { 31, 32 },\n" +
+ " { 33, 34 },\n" +
+ " { 35, 36 },\n" +
+ " // {37????, 38},\n" +
+ "\n" +
+ " };\n" +
"}\n"
);
}
public void testBug330313_wksp1_42_njl() {
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X42 {\n" +
- " static final byte[][] DashList = {\n" +
- " { }, // SWT.LINE_SOLID\n" +
- " { 10, 4 }, // SWT.LINE_DASH\n" +
- " { 2, 2 }, // SWT.LINE_DOT\n" +
- " { 10, 4, 2, 4 }, // SWT.LINE_DASHDOT\n" +
- " { 10, 4, 2, 4, 2, 4 } // SWT.LINE_DASHDOTDOT\n" +
- " };\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X42 {\n" +
+ " static final byte[][] DashList = {\n" +
+ " { }, // SWT.LINE_SOLID\n" +
+ " { 10, 4 }, // SWT.LINE_DASH\n" +
+ " { 2, 2 }, // SWT.LINE_DOT\n" +
+ " { 10, 4, 2, 4 }, // SWT.LINE_DASHDOT\n" +
+ " { 10, 4, 2, 4, 2, 4 } // SWT.LINE_DASHDOTDOT\n" +
+ " };\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X42 {\n" +
- " static final byte[][] DashList = {\n" +
- " {}, // SWT.LINE_SOLID\n" +
- " { 10, 4 }, // SWT.LINE_DASH\n" +
- " { 2, 2 }, // SWT.LINE_DOT\n" +
- " { 10, 4, 2, 4 }, // SWT.LINE_DASHDOT\n" +
- " { 10, 4, 2, 4, 2, 4 } // SWT.LINE_DASHDOTDOT\n" +
- " };\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X42 {\n" +
+ " static final byte[][] DashList = {\n" +
+ " {}, // SWT.LINE_SOLID\n" +
+ " { 10, 4 }, // SWT.LINE_DASH\n" +
+ " { 2, 2 }, // SWT.LINE_DOT\n" +
+ " { 10, 4, 2, 4 }, // SWT.LINE_DASHDOT\n" +
+ " { 10, 4, 2, 4, 2, 4 } // SWT.LINE_DASHDOTDOT\n" +
+ " };\n" +
"}\n"
);
}
public void testBug330313_wksp1_43_njl() {
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X43 {\n" +
- " Cloneable clone;\n" +
- "X43() {\n" +
- " this.clone = new Cloneable() {\n" +
- " void foo(int x) {\n" +
- " switch (x) {\n" +
- " case 1:\n" +
- " case 2:\n" +
- " if (true) break;\n" +
- " // FALL THROUGH\n" +
- " case 3:\n" +
- " case 4:\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
- " };\n" +
- "}\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X43 {\n" +
+ " Cloneable clone;\n" +
+ "X43() {\n" +
+ " this.clone = new Cloneable() {\n" +
+ " void foo(int x) {\n" +
+ " switch (x) {\n" +
+ " case 1:\n" +
+ " case 2:\n" +
+ " if (true) break;\n" +
+ " // FALL THROUGH\n" +
+ " case 3:\n" +
+ " case 4:\n" +
+ " break;\n" +
+ " }\n" +
+ " }\n" +
+ " };\n" +
+ "}\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X43 {\n" +
- " Cloneable clone;\n" +
- "\n" +
- " X43() {\n" +
- " this.clone = new Cloneable() {\n" +
- " void foo(int x) {\n" +
- " switch (x) {\n" +
- " case 1:\n" +
- " case 2:\n" +
- " if (true)\n" +
- " break;\n" +
- " // FALL THROUGH\n" +
- " case 3:\n" +
- " case 4:\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
- " };\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X43 {\n" +
+ " Cloneable clone;\n" +
+ "\n" +
+ " X43() {\n" +
+ " this.clone = new Cloneable() {\n" +
+ " void foo(int x) {\n" +
+ " switch (x) {\n" +
+ " case 1:\n" +
+ " case 2:\n" +
+ " if (true)\n" +
+ " break;\n" +
+ " // FALL THROUGH\n" +
+ " case 3:\n" +
+ " case 4:\n" +
+ " break;\n" +
+ " }\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
"}\n"
);
}
public void testBug330313_wksp1_44_njl() {
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X44 {\n" +
- " String foo() {\n" +
- " return Policy.bind(\"CVSAnnotateBlock.6\", new Object[] { //$NON-NLS-1$\n" +
- " user,\n" +
- " revision,\n" +
- " String.valueOf(delta),\n" +
- " line\n" +
- " });\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X44 {\n" +
+ " String foo() {\n" +
+ " return Policy.bind(\"CVSAnnotateBlock.6\", new Object[] { //$NON-NLS-1$\n" +
+ " user,\n" +
+ " revision,\n" +
+ " String.valueOf(delta),\n" +
+ " line\n" +
+ " });\n" +
+ " }\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X44 {\n" +
- " String foo() {\n" +
- " return Policy.bind(\"CVSAnnotateBlock.6\", new Object[] { //$NON-NLS-1$\n" +
- " user,\n" +
- " revision,\n" +
- " String.valueOf(delta),\n" +
- " line\n" +
- " });\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X44 {\n" +
+ " String foo() {\n" +
+ " return Policy.bind(\"CVSAnnotateBlock.6\", new Object[] { //$NON-NLS-1$\n" +
+ " user,\n" +
+ " revision,\n" +
+ " String.valueOf(delta),\n" +
+ " line\n" +
+ " });\n" +
+ " }\n" +
"}\n"
);
}
@@ -9559,33 +9559,33 @@ public void testBug330313_wksp1_45_njl() {
this.formatterPrefs.join_wrapped_lines = false;
setPageWidth80();
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X45 {\n" +
- " private String[][] TABLE = {\n" +
- " {\"COL_REVISION\", \"COL_DATE\", \"COL_AUTHOR\", \"COL_COMMENT\", \"COL_TAGS\"}, /* revision */ \n" +
- " {\"COL_TAGS\", \"COL_REVISION\", \"COL_DATE\", \"COL_AUTHOR\", \"COL_COMMENT\"}, /* tags */\n" +
- " {\"COL_DATE\", \"COL_REVISION\", \"COL_AUTHOR\", \"COL_COMMENT\", \"COL_TAGS\"}, /* date */\n" +
- " {\"COL_AUTHOR\", \"COL_REVISION\", \"COL_DATE\", \"COL_COMMENT\", \"COL_TAGS\"}, /* author */\n" +
- " {\"COL_COMMENT\", \"COL_REVISION\", \"COL_DATE\", \"COL_AUTHOR\", \"COL_TAGS\"} /* comment */\n" +
- " };\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X45 {\n" +
+ " private String[][] TABLE = {\n" +
+ " {\"COL_REVISION\", \"COL_DATE\", \"COL_AUTHOR\", \"COL_COMMENT\", \"COL_TAGS\"}, /* revision */ \n" +
+ " {\"COL_TAGS\", \"COL_REVISION\", \"COL_DATE\", \"COL_AUTHOR\", \"COL_COMMENT\"}, /* tags */\n" +
+ " {\"COL_DATE\", \"COL_REVISION\", \"COL_AUTHOR\", \"COL_COMMENT\", \"COL_TAGS\"}, /* date */\n" +
+ " {\"COL_AUTHOR\", \"COL_REVISION\", \"COL_DATE\", \"COL_COMMENT\", \"COL_TAGS\"}, /* author */\n" +
+ " {\"COL_COMMENT\", \"COL_REVISION\", \"COL_DATE\", \"COL_AUTHOR\", \"COL_TAGS\"} /* comment */\n" +
+ " };\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X45 {\n" +
- " private String[][] TABLE = {\n" +
- " { \"COL_REVISION\", \"COL_DATE\", \"COL_AUTHOR\", \"COL_COMMENT\",\n" +
- " \"COL_TAGS\" }, /* revision */\n" +
- " { \"COL_TAGS\", \"COL_REVISION\", \"COL_DATE\", \"COL_AUTHOR\",\n" +
- " \"COL_COMMENT\" }, /* tags */\n" +
- " { \"COL_DATE\", \"COL_REVISION\", \"COL_AUTHOR\", \"COL_COMMENT\",\n" +
- " \"COL_TAGS\" }, /* date */\n" +
- " { \"COL_AUTHOR\", \"COL_REVISION\", \"COL_DATE\", \"COL_COMMENT\",\n" +
- " \"COL_TAGS\" }, /* author */\n" +
- " { \"COL_COMMENT\", \"COL_REVISION\", \"COL_DATE\", \"COL_AUTHOR\",\n" +
- " \"COL_TAGS\" } /* comment */\n" +
- " };\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X45 {\n" +
+ " private String[][] TABLE = {\n" +
+ " { \"COL_REVISION\", \"COL_DATE\", \"COL_AUTHOR\", \"COL_COMMENT\",\n" +
+ " \"COL_TAGS\" }, /* revision */\n" +
+ " { \"COL_TAGS\", \"COL_REVISION\", \"COL_DATE\", \"COL_AUTHOR\",\n" +
+ " \"COL_COMMENT\" }, /* tags */\n" +
+ " { \"COL_DATE\", \"COL_REVISION\", \"COL_AUTHOR\", \"COL_COMMENT\",\n" +
+ " \"COL_TAGS\" }, /* date */\n" +
+ " { \"COL_AUTHOR\", \"COL_REVISION\", \"COL_DATE\", \"COL_COMMENT\",\n" +
+ " \"COL_TAGS\" }, /* author */\n" +
+ " { \"COL_COMMENT\", \"COL_REVISION\", \"COL_DATE\", \"COL_AUTHOR\",\n" +
+ " \"COL_TAGS\" } /* comment */\n" +
+ " };\n" +
"}\n"
);
}
@@ -9593,33 +9593,33 @@ public void testBug330313_wksp1_45b_njl() {
this.formatterPrefs.join_wrapped_lines = false;
setPageWidth80();
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X45 {\n" +
- " private String[][] TABLE = {\n" +
- " {\"COL_REVISION\", \"COL_DATE\", \"COL_AUTHOR\", \"COL_COMMENT\", \"COL_TAGS\"}, // revision \n" +
- " {\"COL_TAGS\", \"COL_REVISION\", \"COL_DATE\", \"COL_AUTHOR\", \"COL_COMMENT\"}, // tags \n" +
- " {\"COL_DATE\", \"COL_REVISION\", \"COL_AUTHOR\", \"COL_COMMENT\", \"COL_TAGS\"}, // date \n" +
- " {\"COL_AUTHOR\", \"COL_REVISION\", \"COL_DATE\", \"COL_COMMENT\", \"COL_TAGS\"}, // author \n" +
- " {\"COL_COMMENT\", \"COL_REVISION\", \"COL_DATE\", \"COL_AUTHOR\", \"COL_TAGS\"} // comment \n" +
- " };\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X45 {\n" +
+ " private String[][] TABLE = {\n" +
+ " {\"COL_REVISION\", \"COL_DATE\", \"COL_AUTHOR\", \"COL_COMMENT\", \"COL_TAGS\"}, // revision \n" +
+ " {\"COL_TAGS\", \"COL_REVISION\", \"COL_DATE\", \"COL_AUTHOR\", \"COL_COMMENT\"}, // tags \n" +
+ " {\"COL_DATE\", \"COL_REVISION\", \"COL_AUTHOR\", \"COL_COMMENT\", \"COL_TAGS\"}, // date \n" +
+ " {\"COL_AUTHOR\", \"COL_REVISION\", \"COL_DATE\", \"COL_COMMENT\", \"COL_TAGS\"}, // author \n" +
+ " {\"COL_COMMENT\", \"COL_REVISION\", \"COL_DATE\", \"COL_AUTHOR\", \"COL_TAGS\"} // comment \n" +
+ " };\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X45 {\n" +
- " private String[][] TABLE = {\n" +
- " { \"COL_REVISION\", \"COL_DATE\", \"COL_AUTHOR\", \"COL_COMMENT\",\n" +
- " \"COL_TAGS\" }, // revision\n" +
- " { \"COL_TAGS\", \"COL_REVISION\", \"COL_DATE\", \"COL_AUTHOR\",\n" +
- " \"COL_COMMENT\" }, // tags\n" +
- " { \"COL_DATE\", \"COL_REVISION\", \"COL_AUTHOR\", \"COL_COMMENT\",\n" +
- " \"COL_TAGS\" }, // date\n" +
- " { \"COL_AUTHOR\", \"COL_REVISION\", \"COL_DATE\", \"COL_COMMENT\",\n" +
- " \"COL_TAGS\" }, // author\n" +
- " { \"COL_COMMENT\", \"COL_REVISION\", \"COL_DATE\", \"COL_AUTHOR\",\n" +
- " \"COL_TAGS\" } // comment\n" +
- " };\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X45 {\n" +
+ " private String[][] TABLE = {\n" +
+ " { \"COL_REVISION\", \"COL_DATE\", \"COL_AUTHOR\", \"COL_COMMENT\",\n" +
+ " \"COL_TAGS\" }, // revision\n" +
+ " { \"COL_TAGS\", \"COL_REVISION\", \"COL_DATE\", \"COL_AUTHOR\",\n" +
+ " \"COL_COMMENT\" }, // tags\n" +
+ " { \"COL_DATE\", \"COL_REVISION\", \"COL_AUTHOR\", \"COL_COMMENT\",\n" +
+ " \"COL_TAGS\" }, // date\n" +
+ " { \"COL_AUTHOR\", \"COL_REVISION\", \"COL_DATE\", \"COL_COMMENT\",\n" +
+ " \"COL_TAGS\" }, // author\n" +
+ " { \"COL_COMMENT\", \"COL_REVISION\", \"COL_DATE\", \"COL_AUTHOR\",\n" +
+ " \"COL_TAGS\" } // comment\n" +
+ " };\n" +
"}\n"
);
}
@@ -9627,38 +9627,38 @@ public void testBug330313_wksp1_46_njl() {
this.formatterPrefs.join_wrapped_lines = false;
setPageWidth80();
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X46 {\n" +
- " void foo() {\n" +
- " if (getActive() == StackPresentation.AS_ACTIVE_NOFOCUS) {\n" +
- " drawGradient(\n" +
- " colorRegistry.get(IWorkbenchThemeConstants.INACTIVE_TAB_TEXT_COLOR), \n" +
- " new Color [] {\n" +
- " colorRegistry.get(IWorkbenchThemeConstants.INACTIVE_TAB_BG_START) \n" +
- " }, \n" +
- " new int [0],\n" +
- " true); \n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X46 {\n" +
+ " void foo() {\n" +
+ " if (getActive() == StackPresentation.AS_ACTIVE_NOFOCUS) {\n" +
+ " drawGradient(\n" +
+ " colorRegistry.get(IWorkbenchThemeConstants.INACTIVE_TAB_TEXT_COLOR), \n" +
+ " new Color [] {\n" +
+ " colorRegistry.get(IWorkbenchThemeConstants.INACTIVE_TAB_BG_START) \n" +
+ " }, \n" +
+ " new int [0],\n" +
+ " true); \n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X46 {\n" +
- " void foo() {\n" +
- " if (getActive() == StackPresentation.AS_ACTIVE_NOFOCUS) {\n" +
- " drawGradient(\n" +
- " colorRegistry.get(\n" +
- " IWorkbenchThemeConstants.INACTIVE_TAB_TEXT_COLOR),\n" +
- " new Color[] {\n" +
- " colorRegistry.get(\n" +
- " IWorkbenchThemeConstants.INACTIVE_TAB_BG_START)\n" +
- " },\n" +
- " new int[0],\n" +
- " true);\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X46 {\n" +
+ " void foo() {\n" +
+ " if (getActive() == StackPresentation.AS_ACTIVE_NOFOCUS) {\n" +
+ " drawGradient(\n" +
+ " colorRegistry.get(\n" +
+ " IWorkbenchThemeConstants.INACTIVE_TAB_TEXT_COLOR),\n" +
+ " new Color[] {\n" +
+ " colorRegistry.get(\n" +
+ " IWorkbenchThemeConstants.INACTIVE_TAB_BG_START)\n" +
+ " },\n" +
+ " new int[0],\n" +
+ " true);\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -9666,47 +9666,47 @@ public void testBug330313_wksp1_47_njl() {
useOldCommentWidthCounting();
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X47 {\n" +
- " void foo(int x) {\n" +
- " switch (x) {\n" +
- " case 0 :\n" +
- " // case 0\n" +
- " break;\n" +
- " case 3 :\n" +
- " // case 3\n" +
- " break;\n" +
- " //case -1 :\n" +
- " // internal failure: trying to load variable not supposed to be generated\n" +
- " // break;\n" +
- " default :\n" +
- " // default\n" +
- " }\n" +
- " // last comment\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X47 {\n" +
+ " void foo(int x) {\n" +
+ " switch (x) {\n" +
+ " case 0 :\n" +
+ " // case 0\n" +
+ " break;\n" +
+ " case 3 :\n" +
+ " // case 3\n" +
+ " break;\n" +
+ " //case -1 :\n" +
+ " // internal failure: trying to load variable not supposed to be generated\n" +
+ " // break;\n" +
+ " default :\n" +
+ " // default\n" +
+ " }\n" +
+ " // last comment\n" +
+ " }\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X47 {\n" +
- " void foo(int x) {\n" +
- " switch (x) {\n" +
- " case 0:\n" +
- " // case 0\n" +
- " break;\n" +
- " case 3:\n" +
- " // case 3\n" +
- " break;\n" +
- " // case -1 :\n" +
- " // internal failure: trying to load variable not supposed to be\n" +
- " // generated\n" +
- " // break;\n" +
- " default:\n" +
- " // default\n" +
- " }\n" +
- " // last comment\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X47 {\n" +
+ " void foo(int x) {\n" +
+ " switch (x) {\n" +
+ " case 0:\n" +
+ " // case 0\n" +
+ " break;\n" +
+ " case 3:\n" +
+ " // case 3\n" +
+ " break;\n" +
+ " // case -1 :\n" +
+ " // internal failure: trying to load variable not supposed to be\n" +
+ " // generated\n" +
+ " // break;\n" +
+ " default:\n" +
+ " // default\n" +
+ " }\n" +
+ " // last comment\n" +
+ " }\n" +
"}\n"
);
}
@@ -9714,43 +9714,43 @@ public void testBug330313_wksp1_48_njl() {
useOldCommentWidthCounting();
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X48 {\n" +
- " void foo(int x) {\n" +
- " switch (x) {\n" +
- " case 0 :\n" +
- " // case 0\n" +
- " break;\n" +
- " case 3 :\n" +
- " // case 3\n" +
- " break;\n" +
- " //case -1 :\n" +
- " // internal failure: trying to load variable not supposed to be generated\n" +
- " // break;\n" +
- " }\n" +
- " // last comment\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X48 {\n" +
+ " void foo(int x) {\n" +
+ " switch (x) {\n" +
+ " case 0 :\n" +
+ " // case 0\n" +
+ " break;\n" +
+ " case 3 :\n" +
+ " // case 3\n" +
+ " break;\n" +
+ " //case -1 :\n" +
+ " // internal failure: trying to load variable not supposed to be generated\n" +
+ " // break;\n" +
+ " }\n" +
+ " // last comment\n" +
+ " }\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X48 {\n" +
- " void foo(int x) {\n" +
- " switch (x) {\n" +
- " case 0:\n" +
- " // case 0\n" +
- " break;\n" +
- " case 3:\n" +
- " // case 3\n" +
- " break;\n" +
- " // case -1 :\n" +
- " // internal failure: trying to load variable not supposed to be\n" +
- " // generated\n" +
- " // break;\n" +
- " }\n" +
- " // last comment\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X48 {\n" +
+ " void foo(int x) {\n" +
+ " switch (x) {\n" +
+ " case 0:\n" +
+ " // case 0\n" +
+ " break;\n" +
+ " case 3:\n" +
+ " // case 3\n" +
+ " break;\n" +
+ " // case -1 :\n" +
+ " // internal failure: trying to load variable not supposed to be\n" +
+ " // generated\n" +
+ " // break;\n" +
+ " }\n" +
+ " // last comment\n" +
+ " }\n" +
"}\n"
);
}
@@ -9758,78 +9758,78 @@ public void testBug330313_wksp1_49_njl() {
this.formatterPrefs.join_wrapped_lines = false;
setPageWidth80();
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X49 {\n" +
- " void foo(int i) {\n" +
- " if (true) {\n" +
- " if (true) {\n" +
- " this.foundTaskPositions[this.foundTaskCount] = new int[] { i, i + tagLength - 1 };\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X49 {\n" +
+ " void foo(int i) {\n" +
+ " if (true) {\n" +
+ " if (true) {\n" +
+ " this.foundTaskPositions[this.foundTaskCount] = new int[] { i, i + tagLength - 1 };\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X49 {\n" +
- " void foo(int i) {\n" +
- " if (true) {\n" +
- " if (true) {\n" +
- " this.foundTaskPositions[this.foundTaskCount] = new int[] { i,\n" +
- " i + tagLength - 1 };\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X49 {\n" +
+ " void foo(int i) {\n" +
+ " if (true) {\n" +
+ " if (true) {\n" +
+ " this.foundTaskPositions[this.foundTaskCount] = new int[] { i,\n" +
+ " i + tagLength - 1 };\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
public void testBug330313_wksp1_50_njl() {
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X50 {\n" +
- "private void deployCodeSnippetClassIfNeeded(IRequestor requestor) {\n" +
- " if (this.codeSnippetBinary == null) {\n" +
- " // Deploy CodeSnippet class (only once)\n" +
- " requestor.acceptClassFiles(\n" +
- " new ClassFile[] {\n" +
- " new ClassFile() {\n" +
- " public byte[] getBytes() {\n" +
- " return getCodeSnippetBytes();\n" +
- " }\n" +
- " public char[][] getCompoundName() {\n" +
- " return EvaluationConstants.ROOT_COMPOUND_NAME;\n" +
- " }\n" +
- " }\n" +
- " }, \n" +
- " null);\n" +
- " }\n" +
- "}\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X50 {\n" +
+ "private void deployCodeSnippetClassIfNeeded(IRequestor requestor) {\n" +
+ " if (this.codeSnippetBinary == null) {\n" +
+ " // Deploy CodeSnippet class (only once)\n" +
+ " requestor.acceptClassFiles(\n" +
+ " new ClassFile[] {\n" +
+ " new ClassFile() {\n" +
+ " public byte[] getBytes() {\n" +
+ " return getCodeSnippetBytes();\n" +
+ " }\n" +
+ " public char[][] getCompoundName() {\n" +
+ " return EvaluationConstants.ROOT_COMPOUND_NAME;\n" +
+ " }\n" +
+ " }\n" +
+ " }, \n" +
+ " null);\n" +
+ " }\n" +
+ "}\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X50 {\n" +
- " private void deployCodeSnippetClassIfNeeded(IRequestor requestor) {\n" +
- " if (this.codeSnippetBinary == null) {\n" +
- " // Deploy CodeSnippet class (only once)\n" +
- " requestor.acceptClassFiles(\n" +
- " new ClassFile[] {\n" +
- " new ClassFile() {\n" +
- " public byte[] getBytes() {\n" +
- " return getCodeSnippetBytes();\n" +
- " }\n" +
- "\n" +
- " public char[][] getCompoundName() {\n" +
- " return EvaluationConstants.ROOT_COMPOUND_NAME;\n" +
- " }\n" +
- " }\n" +
- " },\n" +
- " null);\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X50 {\n" +
+ " private void deployCodeSnippetClassIfNeeded(IRequestor requestor) {\n" +
+ " if (this.codeSnippetBinary == null) {\n" +
+ " // Deploy CodeSnippet class (only once)\n" +
+ " requestor.acceptClassFiles(\n" +
+ " new ClassFile[] {\n" +
+ " new ClassFile() {\n" +
+ " public byte[] getBytes() {\n" +
+ " return getCodeSnippetBytes();\n" +
+ " }\n" +
+ "\n" +
+ " public char[][] getCompoundName() {\n" +
+ " return EvaluationConstants.ROOT_COMPOUND_NAME;\n" +
+ " }\n" +
+ " }\n" +
+ " },\n" +
+ " null);\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -9837,97 +9837,97 @@ public void testBug330313_wksp1_51_njl() {
this.formatterPrefs.join_wrapped_lines = false;
setPageWidth80();
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X51 {\n" +
- "\n" +
- "protected void addAllSourceFiles(final ArrayList sourceFiles) throws CoreException {\n" +
- " for (int i = 0, l = sourceLocations.length; i < l; i++) {\n" +
- " sourceLocation.sourceFolder.accept(\n" +
- " new IResourceProxyVisitor() {\n" +
- " public boolean visit(IResourceProxy proxy) throws CoreException {\n" +
- " IResource resource = null;\n" +
- " switch(proxy.getType()) {\n" +
- " case IResource.FILE :\n" +
- " if (exclusionPatterns != null || inclusionPatterns != null) {\n" +
- " resource = proxy.requestResource();\n" +
- " if (Util.isExcluded(resource, inclusionPatterns, exclusionPatterns)) return false;\n" +
- " }\n" +
- " if (org.eclipse.jdt.internal.compiler.util.Util.isJavaFileName(proxy.getName())) {\n" +
- " if (resource == null)\n" +
- " resource = proxy.requestResource();\n" +
- " sourceFiles.add(new SourceFile((IFile) resource, sourceLocation));\n" +
- " }\n" +
- " return false;\n" +
- " case IResource.FOLDER :\n" +
- " if (exclusionPatterns != null && inclusionPatterns == null) {\n" +
- " // if there are inclusion patterns then we must walk the children\n" +
- " resource = proxy.requestResource();\n" +
- " if (Util.isExcluded(resource, inclusionPatterns, exclusionPatterns)) return false;\n" +
- " }\n" +
- " if (isAlsoProject && isExcludedFromProject(proxy.requestFullPath())) return false;\n" +
- " }\n" +
- " return true;\n" +
- " }\n" +
- " },\n" +
- " IResource.NONE);\n" +
- " notifier.checkCancel();\n" +
- " }\n" +
- "}\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X51 {\n" +
+ "\n" +
+ "protected void addAllSourceFiles(final ArrayList sourceFiles) throws CoreException {\n" +
+ " for (int i = 0, l = sourceLocations.length; i < l; i++) {\n" +
+ " sourceLocation.sourceFolder.accept(\n" +
+ " new IResourceProxyVisitor() {\n" +
+ " public boolean visit(IResourceProxy proxy) throws CoreException {\n" +
+ " IResource resource = null;\n" +
+ " switch(proxy.getType()) {\n" +
+ " case IResource.FILE :\n" +
+ " if (exclusionPatterns != null || inclusionPatterns != null) {\n" +
+ " resource = proxy.requestResource();\n" +
+ " if (Util.isExcluded(resource, inclusionPatterns, exclusionPatterns)) return false;\n" +
+ " }\n" +
+ " if (org.eclipse.jdt.internal.compiler.util.Util.isJavaFileName(proxy.getName())) {\n" +
+ " if (resource == null)\n" +
+ " resource = proxy.requestResource();\n" +
+ " sourceFiles.add(new SourceFile((IFile) resource, sourceLocation));\n" +
+ " }\n" +
+ " return false;\n" +
+ " case IResource.FOLDER :\n" +
+ " if (exclusionPatterns != null && inclusionPatterns == null) {\n" +
+ " // if there are inclusion patterns then we must walk the children\n" +
+ " resource = proxy.requestResource();\n" +
+ " if (Util.isExcluded(resource, inclusionPatterns, exclusionPatterns)) return false;\n" +
+ " }\n" +
+ " if (isAlsoProject && isExcludedFromProject(proxy.requestFullPath())) return false;\n" +
+ " }\n" +
+ " return true;\n" +
+ " }\n" +
+ " },\n" +
+ " IResource.NONE);\n" +
+ " notifier.checkCancel();\n" +
+ " }\n" +
+ "}\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X51 {\n" +
- "\n" +
- " protected void addAllSourceFiles(final ArrayList sourceFiles)\n" +
- " throws CoreException {\n" +
- " for (int i = 0, l = sourceLocations.length; i < l; i++) {\n" +
- " sourceLocation.sourceFolder.accept(\n" +
- " new IResourceProxyVisitor() {\n" +
- " public boolean visit(IResourceProxy proxy)\n" +
- " throws CoreException {\n" +
- " IResource resource = null;\n" +
- " switch (proxy.getType()) {\n" +
- " case IResource.FILE:\n" +
- " if (exclusionPatterns != null\n" +
- " || inclusionPatterns != null) {\n" +
- " resource = proxy.requestResource();\n" +
- " if (Util.isExcluded(resource,\n" +
- " inclusionPatterns,\n" +
- " exclusionPatterns))\n" +
- " return false;\n" +
- " }\n" +
- " if (org.eclipse.jdt.internal.compiler.util.Util\n" +
- " .isJavaFileName(proxy.getName())) {\n" +
- " if (resource == null)\n" +
- " resource = proxy.requestResource();\n" +
- " sourceFiles.add(new SourceFile(\n" +
- " (IFile) resource, sourceLocation));\n" +
- " }\n" +
- " return false;\n" +
- " case IResource.FOLDER:\n" +
- " if (exclusionPatterns != null\n" +
- " && inclusionPatterns == null) {\n" +
- " // if there are inclusion patterns then we\n" +
- " // must walk the children\n" +
- " resource = proxy.requestResource();\n" +
- " if (Util.isExcluded(resource,\n" +
- " inclusionPatterns,\n" +
- " exclusionPatterns))\n" +
- " return false;\n" +
- " }\n" +
- " if (isAlsoProject && isExcludedFromProject(\n" +
- " proxy.requestFullPath()))\n" +
- " return false;\n" +
- " }\n" +
- " return true;\n" +
- " }\n" +
- " },\n" +
- " IResource.NONE);\n" +
- " notifier.checkCancel();\n" +
- " }\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X51 {\n" +
+ "\n" +
+ " protected void addAllSourceFiles(final ArrayList sourceFiles)\n" +
+ " throws CoreException {\n" +
+ " for (int i = 0, l = sourceLocations.length; i < l; i++) {\n" +
+ " sourceLocation.sourceFolder.accept(\n" +
+ " new IResourceProxyVisitor() {\n" +
+ " public boolean visit(IResourceProxy proxy)\n" +
+ " throws CoreException {\n" +
+ " IResource resource = null;\n" +
+ " switch (proxy.getType()) {\n" +
+ " case IResource.FILE:\n" +
+ " if (exclusionPatterns != null\n" +
+ " || inclusionPatterns != null) {\n" +
+ " resource = proxy.requestResource();\n" +
+ " if (Util.isExcluded(resource,\n" +
+ " inclusionPatterns,\n" +
+ " exclusionPatterns))\n" +
+ " return false;\n" +
+ " }\n" +
+ " if (org.eclipse.jdt.internal.compiler.util.Util\n" +
+ " .isJavaFileName(proxy.getName())) {\n" +
+ " if (resource == null)\n" +
+ " resource = proxy.requestResource();\n" +
+ " sourceFiles.add(new SourceFile(\n" +
+ " (IFile) resource, sourceLocation));\n" +
+ " }\n" +
+ " return false;\n" +
+ " case IResource.FOLDER:\n" +
+ " if (exclusionPatterns != null\n" +
+ " && inclusionPatterns == null) {\n" +
+ " // if there are inclusion patterns then we\n" +
+ " // must walk the children\n" +
+ " resource = proxy.requestResource();\n" +
+ " if (Util.isExcluded(resource,\n" +
+ " inclusionPatterns,\n" +
+ " exclusionPatterns))\n" +
+ " return false;\n" +
+ " }\n" +
+ " if (isAlsoProject && isExcludedFromProject(\n" +
+ " proxy.requestFullPath()))\n" +
+ " return false;\n" +
+ " }\n" +
+ " return true;\n" +
+ " }\n" +
+ " },\n" +
+ " IResource.NONE);\n" +
+ " notifier.checkCancel();\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -9935,186 +9935,186 @@ public void testBug330313_wksp1_52_njl() {
this.formatterPrefs.join_wrapped_lines = false;
setPageWidth80();
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X52 {\n" +
- " protected FastSyncInfoFilter getKnownFailureCases() {\n" +
- " return new OrSyncInfoFilter(new FastSyncInfoFilter[] {\n" +
- " // Conflicting additions of files will fail\n" +
- " new AndSyncInfoFilter(new FastSyncInfoFilter[] {\n" +
- " FastSyncInfoFilter.getDirectionAndChangeFilter(SyncInfo.CONFLICTING, SyncInfo.ADDITION),\n" +
- " new FastSyncInfoFilter() {\n" +
- " public boolean select(SyncInfo info) {\n" +
- " return info.getLocal().getType() == IResource.FILE;\n" +
- " }\n" +
- " }\n" +
- " }),\n" +
- " // Conflicting changes of files will fail if the local is not managed\n" +
- " // or is an addition\n" +
- " new AndSyncInfoFilter(new FastSyncInfoFilter[] {\n" +
- " FastSyncInfoFilter.getDirectionAndChangeFilter(SyncInfo.CONFLICTING, SyncInfo.CHANGE),\n" +
- " new FastSyncInfoFilter() {\n" +
- " public boolean select(SyncInfo info) {\n" +
- " if (info.getLocal().getType() == IResource.FILE) {\n" +
- " try {\n" +
- " ICVSFile cvsFile = CVSWorkspaceRoot.getCVSFileFor((IFile)info.getLocal());\n" +
- " byte[] syncBytes = cvsFile.getSyncBytes();\n" +
- " return (syncBytes == null || ResourceSyncInfo.isAddition(syncBytes));\n" +
- " } catch (CVSException e) {\n" +
- " CVSUIPlugin.log(e);\n" +
- " // Fall though and try to update\n" +
- " }\n" +
- " }\n" +
- " return false;\n" +
- " }\n" +
- " }\n" +
- " }),\n" +
- " // Conflicting changes involving a deletion on one side will aways fail\n" +
- " new AndSyncInfoFilter(new FastSyncInfoFilter[] {\n" +
- " FastSyncInfoFilter.getDirectionAndChangeFilter(SyncInfo.CONFLICTING, SyncInfo.CHANGE),\n" +
- " new FastSyncInfoFilter() {\n" +
- " public boolean select(SyncInfo info) {\n" +
- " IResourceVariant remote = info.getRemote();\n" +
- " IResourceVariant base = info.getBase();\n" +
- " if (info.getLocal().exists()) {\n" +
- " // local != base and no remote will fail\n" +
- " return (base != null && remote == null);\n" +
- " } else {\n" +
- " // no local and base != remote\n" +
- " return (base != null && remote != null && !base.equals(remote));\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }),\n" +
- " // Conflicts where the file type is binary will work but are not merged\n" +
- " // so they should be skipped\n" +
- " new AndSyncInfoFilter(new FastSyncInfoFilter[] {\n" +
- " FastSyncInfoFilter.getDirectionAndChangeFilter(SyncInfo.CONFLICTING, SyncInfo.CHANGE),\n" +
- " new FastSyncInfoFilter() {\n" +
- " public boolean select(SyncInfo info) {\n" +
- " IResource local = info.getLocal();\n" +
- " if (local.getType() == IResource.FILE) {\n" +
- " try {\n" +
- " ICVSFile file = CVSWorkspaceRoot.getCVSFileFor((IFile)local);\n" +
- " byte[] syncBytes = file.getSyncBytes();\n" +
- " if (syncBytes != null) {\n" +
- " return ResourceSyncInfo.isBinary(syncBytes);\n" +
- " }\n" +
- " } catch (CVSException e) {\n" +
- " // There was an error obtaining or interpreting the sync bytes\n" +
- " // Log it and skip the file\n" +
- " CVSProviderPlugin.log(e);\n" +
- " return true;\n" +
- " }\n" +
- " }\n" +
- " return false;\n" +
- " }\n" +
- " }\n" +
- " }),\n" +
- " // Outgoing changes may not fail but they are skipped as well\n" +
- " new SyncInfoDirectionFilter(SyncInfo.OUTGOING)\n" +
- " });\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X52 {\n" +
+ " protected FastSyncInfoFilter getKnownFailureCases() {\n" +
+ " return new OrSyncInfoFilter(new FastSyncInfoFilter[] {\n" +
+ " // Conflicting additions of files will fail\n" +
+ " new AndSyncInfoFilter(new FastSyncInfoFilter[] {\n" +
+ " FastSyncInfoFilter.getDirectionAndChangeFilter(SyncInfo.CONFLICTING, SyncInfo.ADDITION),\n" +
+ " new FastSyncInfoFilter() {\n" +
+ " public boolean select(SyncInfo info) {\n" +
+ " return info.getLocal().getType() == IResource.FILE;\n" +
+ " }\n" +
+ " }\n" +
+ " }),\n" +
+ " // Conflicting changes of files will fail if the local is not managed\n" +
+ " // or is an addition\n" +
+ " new AndSyncInfoFilter(new FastSyncInfoFilter[] {\n" +
+ " FastSyncInfoFilter.getDirectionAndChangeFilter(SyncInfo.CONFLICTING, SyncInfo.CHANGE),\n" +
+ " new FastSyncInfoFilter() {\n" +
+ " public boolean select(SyncInfo info) {\n" +
+ " if (info.getLocal().getType() == IResource.FILE) {\n" +
+ " try {\n" +
+ " ICVSFile cvsFile = CVSWorkspaceRoot.getCVSFileFor((IFile)info.getLocal());\n" +
+ " byte[] syncBytes = cvsFile.getSyncBytes();\n" +
+ " return (syncBytes == null || ResourceSyncInfo.isAddition(syncBytes));\n" +
+ " } catch (CVSException e) {\n" +
+ " CVSUIPlugin.log(e);\n" +
+ " // Fall though and try to update\n" +
+ " }\n" +
+ " }\n" +
+ " return false;\n" +
+ " }\n" +
+ " }\n" +
+ " }),\n" +
+ " // Conflicting changes involving a deletion on one side will aways fail\n" +
+ " new AndSyncInfoFilter(new FastSyncInfoFilter[] {\n" +
+ " FastSyncInfoFilter.getDirectionAndChangeFilter(SyncInfo.CONFLICTING, SyncInfo.CHANGE),\n" +
+ " new FastSyncInfoFilter() {\n" +
+ " public boolean select(SyncInfo info) {\n" +
+ " IResourceVariant remote = info.getRemote();\n" +
+ " IResourceVariant base = info.getBase();\n" +
+ " if (info.getLocal().exists()) {\n" +
+ " // local != base and no remote will fail\n" +
+ " return (base != null && remote == null);\n" +
+ " } else {\n" +
+ " // no local and base != remote\n" +
+ " return (base != null && remote != null && !base.equals(remote));\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " }),\n" +
+ " // Conflicts where the file type is binary will work but are not merged\n" +
+ " // so they should be skipped\n" +
+ " new AndSyncInfoFilter(new FastSyncInfoFilter[] {\n" +
+ " FastSyncInfoFilter.getDirectionAndChangeFilter(SyncInfo.CONFLICTING, SyncInfo.CHANGE),\n" +
+ " new FastSyncInfoFilter() {\n" +
+ " public boolean select(SyncInfo info) {\n" +
+ " IResource local = info.getLocal();\n" +
+ " if (local.getType() == IResource.FILE) {\n" +
+ " try {\n" +
+ " ICVSFile file = CVSWorkspaceRoot.getCVSFileFor((IFile)local);\n" +
+ " byte[] syncBytes = file.getSyncBytes();\n" +
+ " if (syncBytes != null) {\n" +
+ " return ResourceSyncInfo.isBinary(syncBytes);\n" +
+ " }\n" +
+ " } catch (CVSException e) {\n" +
+ " // There was an error obtaining or interpreting the sync bytes\n" +
+ " // Log it and skip the file\n" +
+ " CVSProviderPlugin.log(e);\n" +
+ " return true;\n" +
+ " }\n" +
+ " }\n" +
+ " return false;\n" +
+ " }\n" +
+ " }\n" +
+ " }),\n" +
+ " // Outgoing changes may not fail but they are skipped as well\n" +
+ " new SyncInfoDirectionFilter(SyncInfo.OUTGOING)\n" +
+ " });\n" +
+ " }\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X52 {\n" +
- " protected FastSyncInfoFilter getKnownFailureCases() {\n" +
- " return new OrSyncInfoFilter(new FastSyncInfoFilter[] {\n" +
- " // Conflicting additions of files will fail\n" +
- " new AndSyncInfoFilter(new FastSyncInfoFilter[] {\n" +
- " FastSyncInfoFilter.getDirectionAndChangeFilter(\n" +
- " SyncInfo.CONFLICTING, SyncInfo.ADDITION),\n" +
- " new FastSyncInfoFilter() {\n" +
- " public boolean select(SyncInfo info) {\n" +
- " return info.getLocal()\n" +
- " .getType() == IResource.FILE;\n" +
- " }\n" +
- " }\n" +
- " }),\n" +
- " // Conflicting changes of files will fail if the local is not\n" +
- " // managed\n" +
- " // or is an addition\n" +
- " new AndSyncInfoFilter(new FastSyncInfoFilter[] {\n" +
- " FastSyncInfoFilter.getDirectionAndChangeFilter(\n" +
- " SyncInfo.CONFLICTING, SyncInfo.CHANGE),\n" +
- " new FastSyncInfoFilter() {\n" +
- " public boolean select(SyncInfo info) {\n" +
- " if (info.getLocal()\n" +
- " .getType() == IResource.FILE) {\n" +
- " try {\n" +
- " ICVSFile cvsFile = CVSWorkspaceRoot\n" +
- " .getCVSFileFor((IFile) info\n" +
- " .getLocal());\n" +
- " byte[] syncBytes = cvsFile\n" +
- " .getSyncBytes();\n" +
- " return (syncBytes == null\n" +
- " || ResourceSyncInfo\n" +
- " .isAddition(syncBytes));\n" +
- " } catch (CVSException e) {\n" +
- " CVSUIPlugin.log(e);\n" +
- " // Fall though and try to update\n" +
- " }\n" +
- " }\n" +
- " return false;\n" +
- " }\n" +
- " }\n" +
- " }),\n" +
- " // Conflicting changes involving a deletion on one side will\n" +
- " // aways fail\n" +
- " new AndSyncInfoFilter(new FastSyncInfoFilter[] {\n" +
- " FastSyncInfoFilter.getDirectionAndChangeFilter(\n" +
- " SyncInfo.CONFLICTING, SyncInfo.CHANGE),\n" +
- " new FastSyncInfoFilter() {\n" +
- " public boolean select(SyncInfo info) {\n" +
- " IResourceVariant remote = info.getRemote();\n" +
- " IResourceVariant base = info.getBase();\n" +
- " if (info.getLocal().exists()) {\n" +
- " // local != base and no remote will fail\n" +
- " return (base != null && remote == null);\n" +
- " } else {\n" +
- " // no local and base != remote\n" +
- " return (base != null && remote != null\n" +
- " && !base.equals(remote));\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }),\n" +
- " // Conflicts where the file type is binary will work but are not\n" +
- " // merged\n" +
- " // so they should be skipped\n" +
- " new AndSyncInfoFilter(new FastSyncInfoFilter[] {\n" +
- " FastSyncInfoFilter.getDirectionAndChangeFilter(\n" +
- " SyncInfo.CONFLICTING, SyncInfo.CHANGE),\n" +
- " new FastSyncInfoFilter() {\n" +
- " public boolean select(SyncInfo info) {\n" +
- " IResource local = info.getLocal();\n" +
- " if (local.getType() == IResource.FILE) {\n" +
- " try {\n" +
- " ICVSFile file = CVSWorkspaceRoot\n" +
- " .getCVSFileFor((IFile) local);\n" +
- " byte[] syncBytes = file.getSyncBytes();\n" +
- " if (syncBytes != null) {\n" +
- " return ResourceSyncInfo\n" +
- " .isBinary(syncBytes);\n" +
- " }\n" +
- " } catch (CVSException e) {\n" +
- " // There was an error obtaining or\n" +
- " // interpreting the sync bytes\n" +
- " // Log it and skip the file\n" +
- " CVSProviderPlugin.log(e);\n" +
- " return true;\n" +
- " }\n" +
- " }\n" +
- " return false;\n" +
- " }\n" +
- " }\n" +
- " }),\n" +
- " // Outgoing changes may not fail but they are skipped as well\n" +
- " new SyncInfoDirectionFilter(SyncInfo.OUTGOING)\n" +
- " });\n" +
- " }\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X52 {\n" +
+ " protected FastSyncInfoFilter getKnownFailureCases() {\n" +
+ " return new OrSyncInfoFilter(new FastSyncInfoFilter[] {\n" +
+ " // Conflicting additions of files will fail\n" +
+ " new AndSyncInfoFilter(new FastSyncInfoFilter[] {\n" +
+ " FastSyncInfoFilter.getDirectionAndChangeFilter(\n" +
+ " SyncInfo.CONFLICTING, SyncInfo.ADDITION),\n" +
+ " new FastSyncInfoFilter() {\n" +
+ " public boolean select(SyncInfo info) {\n" +
+ " return info.getLocal()\n" +
+ " .getType() == IResource.FILE;\n" +
+ " }\n" +
+ " }\n" +
+ " }),\n" +
+ " // Conflicting changes of files will fail if the local is not\n" +
+ " // managed\n" +
+ " // or is an addition\n" +
+ " new AndSyncInfoFilter(new FastSyncInfoFilter[] {\n" +
+ " FastSyncInfoFilter.getDirectionAndChangeFilter(\n" +
+ " SyncInfo.CONFLICTING, SyncInfo.CHANGE),\n" +
+ " new FastSyncInfoFilter() {\n" +
+ " public boolean select(SyncInfo info) {\n" +
+ " if (info.getLocal()\n" +
+ " .getType() == IResource.FILE) {\n" +
+ " try {\n" +
+ " ICVSFile cvsFile = CVSWorkspaceRoot\n" +
+ " .getCVSFileFor((IFile) info\n" +
+ " .getLocal());\n" +
+ " byte[] syncBytes = cvsFile\n" +
+ " .getSyncBytes();\n" +
+ " return (syncBytes == null\n" +
+ " || ResourceSyncInfo\n" +
+ " .isAddition(syncBytes));\n" +
+ " } catch (CVSException e) {\n" +
+ " CVSUIPlugin.log(e);\n" +
+ " // Fall though and try to update\n" +
+ " }\n" +
+ " }\n" +
+ " return false;\n" +
+ " }\n" +
+ " }\n" +
+ " }),\n" +
+ " // Conflicting changes involving a deletion on one side will\n" +
+ " // aways fail\n" +
+ " new AndSyncInfoFilter(new FastSyncInfoFilter[] {\n" +
+ " FastSyncInfoFilter.getDirectionAndChangeFilter(\n" +
+ " SyncInfo.CONFLICTING, SyncInfo.CHANGE),\n" +
+ " new FastSyncInfoFilter() {\n" +
+ " public boolean select(SyncInfo info) {\n" +
+ " IResourceVariant remote = info.getRemote();\n" +
+ " IResourceVariant base = info.getBase();\n" +
+ " if (info.getLocal().exists()) {\n" +
+ " // local != base and no remote will fail\n" +
+ " return (base != null && remote == null);\n" +
+ " } else {\n" +
+ " // no local and base != remote\n" +
+ " return (base != null && remote != null\n" +
+ " && !base.equals(remote));\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " }),\n" +
+ " // Conflicts where the file type is binary will work but are not\n" +
+ " // merged\n" +
+ " // so they should be skipped\n" +
+ " new AndSyncInfoFilter(new FastSyncInfoFilter[] {\n" +
+ " FastSyncInfoFilter.getDirectionAndChangeFilter(\n" +
+ " SyncInfo.CONFLICTING, SyncInfo.CHANGE),\n" +
+ " new FastSyncInfoFilter() {\n" +
+ " public boolean select(SyncInfo info) {\n" +
+ " IResource local = info.getLocal();\n" +
+ " if (local.getType() == IResource.FILE) {\n" +
+ " try {\n" +
+ " ICVSFile file = CVSWorkspaceRoot\n" +
+ " .getCVSFileFor((IFile) local);\n" +
+ " byte[] syncBytes = file.getSyncBytes();\n" +
+ " if (syncBytes != null) {\n" +
+ " return ResourceSyncInfo\n" +
+ " .isBinary(syncBytes);\n" +
+ " }\n" +
+ " } catch (CVSException e) {\n" +
+ " // There was an error obtaining or\n" +
+ " // interpreting the sync bytes\n" +
+ " // Log it and skip the file\n" +
+ " CVSProviderPlugin.log(e);\n" +
+ " return true;\n" +
+ " }\n" +
+ " }\n" +
+ " return false;\n" +
+ " }\n" +
+ " }\n" +
+ " }),\n" +
+ " // Outgoing changes may not fail but they are skipped as well\n" +
+ " new SyncInfoDirectionFilter(SyncInfo.OUTGOING)\n" +
+ " });\n" +
+ " }\n" +
"}\n"
);
}
@@ -10122,111 +10122,111 @@ public void testBug330313_wksp1_53_njl_bnl() {
this.formatterPrefs.join_wrapped_lines = false;
setUpBracesPreferences(DefaultCodeFormatterConstants.NEXT_LINE);
String source =
- "package wksp1;\n" +
- "\n" +
- "public class X53 {\n" +
- " static final short[][][] BLACK_CODE = {\n" +
- " /* 9 bits */\n" +
- " {{24, 15}},\n" +
- " /* 10 bits */\n" +
- " {{8, 18}, {15, 64}, {23, 16}, {24, 17}, {55, 0}},\n" +
- " /* 11 bits */\n" +
- " {/* EOL */{0, -1}, {8, 1792}, {23, 24}, {24, 25}, {40, 23}, {55, 22}, {103, 19},\n" +
- " {104, 20}, {108, 21}, {12, 1856}, {13, 1920}},\n" +
- " };\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X53 {\n" +
+ " static final short[][][] BLACK_CODE = {\n" +
+ " /* 9 bits */\n" +
+ " {{24, 15}},\n" +
+ " /* 10 bits */\n" +
+ " {{8, 18}, {15, 64}, {23, 16}, {24, 17}, {55, 0}},\n" +
+ " /* 11 bits */\n" +
+ " {/* EOL */{0, -1}, {8, 1792}, {23, 24}, {24, 25}, {40, 23}, {55, 22}, {103, 19},\n" +
+ " {104, 20}, {108, 21}, {12, 1856}, {13, 1920}},\n" +
+ " };\n" +
"}\n";
formatSource(source ,
- "package wksp1;\n" +
- "\n" +
- "public class X53\n" +
- "{\n" +
- " static final short[][][] BLACK_CODE =\n" +
- " {\n" +
- " /* 9 bits */\n" +
- " {\n" +
- " { 24, 15 } },\n" +
- " /* 10 bits */\n" +
- " {\n" +
- " { 8, 18 },\n" +
- " { 15, 64 },\n" +
- " { 23, 16 },\n" +
- " { 24, 17 },\n" +
- " { 55, 0 } },\n" +
- " /* 11 bits */\n" +
- " {\n" +
- " /* EOL */{ 0, -1 },\n" +
- " { 8, 1792 },\n" +
- " { 23, 24 },\n" +
- " { 24, 25 },\n" +
- " { 40, 23 },\n" +
- " { 55, 22 },\n" +
- " { 103, 19 },\n" +
- " { 104, 20 },\n" +
- " { 108, 21 },\n" +
- " { 12, 1856 },\n" +
- " { 13, 1920 } },\n" +
- " };\n" +
+ "package wksp1;\n" +
+ "\n" +
+ "public class X53\n" +
+ "{\n" +
+ " static final short[][][] BLACK_CODE =\n" +
+ " {\n" +
+ " /* 9 bits */\n" +
+ " {\n" +
+ " { 24, 15 } },\n" +
+ " /* 10 bits */\n" +
+ " {\n" +
+ " { 8, 18 },\n" +
+ " { 15, 64 },\n" +
+ " { 23, 16 },\n" +
+ " { 24, 17 },\n" +
+ " { 55, 0 } },\n" +
+ " /* 11 bits */\n" +
+ " {\n" +
+ " /* EOL */{ 0, -1 },\n" +
+ " { 8, 1792 },\n" +
+ " { 23, 24 },\n" +
+ " { 24, 25 },\n" +
+ " { 40, 23 },\n" +
+ " { 55, 22 },\n" +
+ " { 103, 19 },\n" +
+ " { 104, 20 },\n" +
+ " { 108, 21 },\n" +
+ " { 12, 1856 },\n" +
+ " { 13, 1920 } },\n" +
+ " };\n" +
"}\n"
);
}
public void testBug330313_wksp2_01 () {
String source =
- "package wksp2;\n" +
- "\n" +
- "public class X01 {\n" +
- "\n" +
- " static final Object[][] contents = {\n" +
- " // comment\n" +
- " { \"STR1\",\n" +
- " // comment\n" +
- " new String[] { \"STR\", // comment\n" +
- " \"STR\", // comment\n" +
- " \"STR\"} // comment\n" +
- " }\n" +
- "\n" +
- " };\n" +
- "\n" +
- "}\n";
- formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public class X01 {\n" +
- "\n" +
- " static final Object[][] contents = {\n" +
- " // comment\n" +
- " { \"STR1\",\n" +
- " // comment\n" +
- " new String[] { \"STR\", // comment\n" +
- " \"STR\", // comment\n" +
- " \"STR\" } // comment\n" +
- " }\n" +
- "\n" +
- " };\n" +
- "\n" +
+ "package wksp2;\n" +
+ "\n" +
+ "public class X01 {\n" +
+ "\n" +
+ " static final Object[][] contents = {\n" +
+ " // comment\n" +
+ " { \"STR1\",\n" +
+ " // comment\n" +
+ " new String[] { \"STR\", // comment\n" +
+ " \"STR\", // comment\n" +
+ " \"STR\"} // comment\n" +
+ " }\n" +
+ "\n" +
+ " };\n" +
+ "\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp2;\n" +
+ "\n" +
+ "public class X01 {\n" +
+ "\n" +
+ " static final Object[][] contents = {\n" +
+ " // comment\n" +
+ " { \"STR1\",\n" +
+ " // comment\n" +
+ " new String[] { \"STR\", // comment\n" +
+ " \"STR\", // comment\n" +
+ " \"STR\" } // comment\n" +
+ " }\n" +
+ "\n" +
+ " };\n" +
+ "\n" +
"}\n"
);
}
public void testBug330313_wksp3_X01_njl() {
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "package wksp3;\n" +
- "\n" +
- "public class X01 {\n" +
- " private static final String foo[][] = {\n" +
- " // line 1\n" +
- " // line 2\n" +
- " {\"A\", \"B\", \"C\", \"D\", \"E\"} // comment\n" +
- " };\n" +
+ "package wksp3;\n" +
+ "\n" +
+ "public class X01 {\n" +
+ " private static final String foo[][] = {\n" +
+ " // line 1\n" +
+ " // line 2\n" +
+ " {\"A\", \"B\", \"C\", \"D\", \"E\"} // comment\n" +
+ " };\n" +
"}\n";
formatSource(source ,
- "package wksp3;\n" +
- "\n" +
- "public class X01 {\n" +
- " private static final String foo[][] = {\n" +
- " // line 1\n" +
- " // line 2\n" +
- " { \"A\", \"B\", \"C\", \"D\", \"E\" } // comment\n" +
- " };\n" +
+ "package wksp3;\n" +
+ "\n" +
+ "public class X01 {\n" +
+ " private static final String foo[][] = {\n" +
+ " // line 1\n" +
+ " // line 2\n" +
+ " { \"A\", \"B\", \"C\", \"D\", \"E\" } // comment\n" +
+ " };\n" +
"}\n"
);
}
@@ -10237,78 +10237,78 @@ public void testBug330313_b286601_04() {
setUpBracesPreferences(DefaultCodeFormatterConstants.NEXT_LINE);
setPageWidth80();
String source =
- "package b286601;\n" +
- "\n" +
- "public class X04 {\n" +
- "\n" +
- " \n" +
- " // Table to merge access modes for condition statements (e.g branch[x] || branch[y]). \n" +
- " private static final int[][] ACCESS_MODE_CONDITIONAL_TABLE= {\n" +
- " /* UNUSED READ READ_POTENTIAL WRTIE WRITE_POTENTIAL UNKNOWN */\n" +
- " /* UNUSED */ { UNUSED, READ_POTENTIAL, READ_POTENTIAL, WRITE_POTENTIAL, WRITE_POTENTIAL, UNKNOWN },\n" +
- " /* READ */ { READ_POTENTIAL, READ, READ_POTENTIAL, UNKNOWN, UNKNOWN, UNKNOWN },\n" +
- " /* READ_POTENTIAL */ { READ_POTENTIAL, READ_POTENTIAL, READ_POTENTIAL, UNKNOWN, UNKNOWN, UNKNOWN },\n" +
- " /* WRITE */ { WRITE_POTENTIAL, UNKNOWN, UNKNOWN, WRITE, WRITE_POTENTIAL, UNKNOWN },\n" +
- " /* WRITE_POTENTIAL */ { WRITE_POTENTIAL, UNKNOWN, UNKNOWN, WRITE_POTENTIAL, WRITE_POTENTIAL, UNKNOWN },\n" +
- " /* UNKNOWN */ { UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN }\n" +
- " };\n" +
- "\n" +
- "}\n";
- formatSource(source,
- "package b286601;\n" +
- "\n" +
- "public class X04\n" +
- "{\n" +
- "\n" +
- " // Table to merge access modes for condition statements (e.g branch[x] ||\n" +
- " // branch[y]).\n" +
- " private static final int[][] ACCESS_MODE_CONDITIONAL_TABLE =\n" +
- " {\n" +
- " /* UNUSED READ READ_POTENTIAL WRTIE WRITE_POTENTIAL UNKNOWN */\n" +
- " /* UNUSED */ {\n" +
- " UNUSED,\n" +
- " READ_POTENTIAL,\n" +
- " READ_POTENTIAL,\n" +
- " WRITE_POTENTIAL,\n" +
- " WRITE_POTENTIAL,\n" +
- " UNKNOWN },\n" +
- " /* READ */ {\n" +
- " READ_POTENTIAL,\n" +
- " READ,\n" +
- " READ_POTENTIAL,\n" +
- " UNKNOWN,\n" +
- " UNKNOWN,\n" +
- " UNKNOWN },\n" +
- " /* READ_POTENTIAL */ {\n" +
- " READ_POTENTIAL,\n" +
- " READ_POTENTIAL,\n" +
- " READ_POTENTIAL,\n" +
- " UNKNOWN,\n" +
- " UNKNOWN,\n" +
- " UNKNOWN },\n" +
- " /* WRITE */ {\n" +
- " WRITE_POTENTIAL,\n" +
- " UNKNOWN,\n" +
- " UNKNOWN,\n" +
- " WRITE,\n" +
- " WRITE_POTENTIAL,\n" +
- " UNKNOWN },\n" +
- " /* WRITE_POTENTIAL */ {\n" +
- " WRITE_POTENTIAL,\n" +
- " UNKNOWN,\n" +
- " UNKNOWN,\n" +
- " WRITE_POTENTIAL,\n" +
- " WRITE_POTENTIAL,\n" +
- " UNKNOWN },\n" +
- " /* UNKNOWN */ {\n" +
- " UNKNOWN,\n" +
- " UNKNOWN,\n" +
- " UNKNOWN,\n" +
- " UNKNOWN,\n" +
- " UNKNOWN,\n" +
- " UNKNOWN }\n" +
- " };\n" +
- "\n" +
+ "package b286601;\n" +
+ "\n" +
+ "public class X04 {\n" +
+ "\n" +
+ " \n" +
+ " // Table to merge access modes for condition statements (e.g branch[x] || branch[y]). \n" +
+ " private static final int[][] ACCESS_MODE_CONDITIONAL_TABLE= {\n" +
+ " /* UNUSED READ READ_POTENTIAL WRTIE WRITE_POTENTIAL UNKNOWN */\n" +
+ " /* UNUSED */ { UNUSED, READ_POTENTIAL, READ_POTENTIAL, WRITE_POTENTIAL, WRITE_POTENTIAL, UNKNOWN },\n" +
+ " /* READ */ { READ_POTENTIAL, READ, READ_POTENTIAL, UNKNOWN, UNKNOWN, UNKNOWN },\n" +
+ " /* READ_POTENTIAL */ { READ_POTENTIAL, READ_POTENTIAL, READ_POTENTIAL, UNKNOWN, UNKNOWN, UNKNOWN },\n" +
+ " /* WRITE */ { WRITE_POTENTIAL, UNKNOWN, UNKNOWN, WRITE, WRITE_POTENTIAL, UNKNOWN },\n" +
+ " /* WRITE_POTENTIAL */ { WRITE_POTENTIAL, UNKNOWN, UNKNOWN, WRITE_POTENTIAL, WRITE_POTENTIAL, UNKNOWN },\n" +
+ " /* UNKNOWN */ { UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN }\n" +
+ " };\n" +
+ "\n" +
+ "}\n";
+ formatSource(source,
+ "package b286601;\n" +
+ "\n" +
+ "public class X04\n" +
+ "{\n" +
+ "\n" +
+ " // Table to merge access modes for condition statements (e.g branch[x] ||\n" +
+ " // branch[y]).\n" +
+ " private static final int[][] ACCESS_MODE_CONDITIONAL_TABLE =\n" +
+ " {\n" +
+ " /* UNUSED READ READ_POTENTIAL WRTIE WRITE_POTENTIAL UNKNOWN */\n" +
+ " /* UNUSED */ {\n" +
+ " UNUSED,\n" +
+ " READ_POTENTIAL,\n" +
+ " READ_POTENTIAL,\n" +
+ " WRITE_POTENTIAL,\n" +
+ " WRITE_POTENTIAL,\n" +
+ " UNKNOWN },\n" +
+ " /* READ */ {\n" +
+ " READ_POTENTIAL,\n" +
+ " READ,\n" +
+ " READ_POTENTIAL,\n" +
+ " UNKNOWN,\n" +
+ " UNKNOWN,\n" +
+ " UNKNOWN },\n" +
+ " /* READ_POTENTIAL */ {\n" +
+ " READ_POTENTIAL,\n" +
+ " READ_POTENTIAL,\n" +
+ " READ_POTENTIAL,\n" +
+ " UNKNOWN,\n" +
+ " UNKNOWN,\n" +
+ " UNKNOWN },\n" +
+ " /* WRITE */ {\n" +
+ " WRITE_POTENTIAL,\n" +
+ " UNKNOWN,\n" +
+ " UNKNOWN,\n" +
+ " WRITE,\n" +
+ " WRITE_POTENTIAL,\n" +
+ " UNKNOWN },\n" +
+ " /* WRITE_POTENTIAL */ {\n" +
+ " WRITE_POTENTIAL,\n" +
+ " UNKNOWN,\n" +
+ " UNKNOWN,\n" +
+ " WRITE_POTENTIAL,\n" +
+ " WRITE_POTENTIAL,\n" +
+ " UNKNOWN },\n" +
+ " /* UNKNOWN */ {\n" +
+ " UNKNOWN,\n" +
+ " UNKNOWN,\n" +
+ " UNKNOWN,\n" +
+ " UNKNOWN,\n" +
+ " UNKNOWN,\n" +
+ " UNKNOWN }\n" +
+ " };\n" +
+ "\n" +
"}\n"
);
}
@@ -10318,44 +10318,44 @@ public void testBug330313_b286601_05() {
setUpBracesPreferences(DefaultCodeFormatterConstants.NEXT_LINE);
setPageWidth80();
String source =
- "package b286601;\n" +
- "\n" +
- "public class X05 {\n" +
- "\n" +
- " \n" +
- " // Table to merge access modes for condition statements (e.g branch[x] || branch[y]). \n" +
- " static final String[][] ACCESS_MODE_CONDITIONAL_TABLE= {\n" +
- " { \"UNUSED\", \"READ_POTENTIAL\", \"READ_POTENTIAL\", \"WRITE_POTENTIAL\", \"WRITE_POTENTIAL\", \"UNKNOWN\" },\n" +
- " { \"READ_POTENTIAL\", \"READ\", \"READ_POTENTIAL\", \"UNKNOWN\", \"UNKNOWN\", \"UNKNOWN\" },\n" +
- " };\n" +
- "\n" +
- "}\n";
- formatSource(source,
- "package b286601;\n" +
- "\n" +
- "public class X05\n" +
- "{\n" +
- "\n" +
- " // Table to merge access modes for condition statements (e.g branch[x] ||\n" +
- " // branch[y]).\n" +
- " static final String[][] ACCESS_MODE_CONDITIONAL_TABLE =\n" +
- " {\n" +
- " {\n" +
- " \"UNUSED\",\n" +
- " \"READ_POTENTIAL\",\n" +
- " \"READ_POTENTIAL\",\n" +
- " \"WRITE_POTENTIAL\",\n" +
- " \"WRITE_POTENTIAL\",\n" +
- " \"UNKNOWN\" },\n" +
- " {\n" +
- " \"READ_POTENTIAL\",\n" +
- " \"READ\",\n" +
- " \"READ_POTENTIAL\",\n" +
- " \"UNKNOWN\",\n" +
- " \"UNKNOWN\",\n" +
- " \"UNKNOWN\" },\n" +
- " };\n" +
- "\n" +
+ "package b286601;\n" +
+ "\n" +
+ "public class X05 {\n" +
+ "\n" +
+ " \n" +
+ " // Table to merge access modes for condition statements (e.g branch[x] || branch[y]). \n" +
+ " static final String[][] ACCESS_MODE_CONDITIONAL_TABLE= {\n" +
+ " { \"UNUSED\", \"READ_POTENTIAL\", \"READ_POTENTIAL\", \"WRITE_POTENTIAL\", \"WRITE_POTENTIAL\", \"UNKNOWN\" },\n" +
+ " { \"READ_POTENTIAL\", \"READ\", \"READ_POTENTIAL\", \"UNKNOWN\", \"UNKNOWN\", \"UNKNOWN\" },\n" +
+ " };\n" +
+ "\n" +
+ "}\n";
+ formatSource(source,
+ "package b286601;\n" +
+ "\n" +
+ "public class X05\n" +
+ "{\n" +
+ "\n" +
+ " // Table to merge access modes for condition statements (e.g branch[x] ||\n" +
+ " // branch[y]).\n" +
+ " static final String[][] ACCESS_MODE_CONDITIONAL_TABLE =\n" +
+ " {\n" +
+ " {\n" +
+ " \"UNUSED\",\n" +
+ " \"READ_POTENTIAL\",\n" +
+ " \"READ_POTENTIAL\",\n" +
+ " \"WRITE_POTENTIAL\",\n" +
+ " \"WRITE_POTENTIAL\",\n" +
+ " \"UNKNOWN\" },\n" +
+ " {\n" +
+ " \"READ_POTENTIAL\",\n" +
+ " \"READ\",\n" +
+ " \"READ_POTENTIAL\",\n" +
+ " \"UNKNOWN\",\n" +
+ " \"UNKNOWN\",\n" +
+ " \"UNKNOWN\" },\n" +
+ " };\n" +
+ "\n" +
"}\n"
);
}
@@ -10365,46 +10365,46 @@ public void testBug330313_b286601_06() {
setUpBracesPreferences(DefaultCodeFormatterConstants.NEXT_LINE);
setPageWidth80();
String source =
- "package b286601;\n" +
- "\n" +
- "public class X06 {\n" +
- "\n" +
- " \n" +
- " // Table to merge access modes for condition statements (e.g branch[x] || branch[y]). \n" +
- " static final String[][] ACCESS_MODE_CONDITIONAL_TABLE= {\n" +
- " /* Comment 1 */\n" +
- " /* Comment 2 */ { \"UNUSED\", \"READ_POTENTIAL\", \"READ_POTENTIAL\", \"WRITE_POTENTIAL\", \"WRITE_POTENTIAL\", \"UNKNOWN\" },\n" +
- " /* Comment 3 */ { \"READ_POTENTIAL\", \"READ\", \"READ_POTENTIAL\", \"UNKNOWN\", \"UNKNOWN\", \"UNKNOWN\" },\n" +
- " };\n" +
- "\n" +
- "}\n";
- formatSource(source,
- "package b286601;\n" +
- "\n" +
- "public class X06\n" +
- "{\n" +
- "\n" +
- " // Table to merge access modes for condition statements (e.g branch[x] ||\n" +
- " // branch[y]).\n" +
- " static final String[][] ACCESS_MODE_CONDITIONAL_TABLE =\n" +
- " {\n" +
- " /* Comment 1 */\n" +
- " /* Comment 2 */ {\n" +
- " \"UNUSED\",\n" +
- " \"READ_POTENTIAL\",\n" +
- " \"READ_POTENTIAL\",\n" +
- " \"WRITE_POTENTIAL\",\n" +
- " \"WRITE_POTENTIAL\",\n" +
- " \"UNKNOWN\" },\n" +
- " /* Comment 3 */ {\n" +
- " \"READ_POTENTIAL\",\n" +
- " \"READ\",\n" +
- " \"READ_POTENTIAL\",\n" +
- " \"UNKNOWN\",\n" +
- " \"UNKNOWN\",\n" +
- " \"UNKNOWN\" },\n" +
- " };\n" +
- "\n" +
+ "package b286601;\n" +
+ "\n" +
+ "public class X06 {\n" +
+ "\n" +
+ " \n" +
+ " // Table to merge access modes for condition statements (e.g branch[x] || branch[y]). \n" +
+ " static final String[][] ACCESS_MODE_CONDITIONAL_TABLE= {\n" +
+ " /* Comment 1 */\n" +
+ " /* Comment 2 */ { \"UNUSED\", \"READ_POTENTIAL\", \"READ_POTENTIAL\", \"WRITE_POTENTIAL\", \"WRITE_POTENTIAL\", \"UNKNOWN\" },\n" +
+ " /* Comment 3 */ { \"READ_POTENTIAL\", \"READ\", \"READ_POTENTIAL\", \"UNKNOWN\", \"UNKNOWN\", \"UNKNOWN\" },\n" +
+ " };\n" +
+ "\n" +
+ "}\n";
+ formatSource(source,
+ "package b286601;\n" +
+ "\n" +
+ "public class X06\n" +
+ "{\n" +
+ "\n" +
+ " // Table to merge access modes for condition statements (e.g branch[x] ||\n" +
+ " // branch[y]).\n" +
+ " static final String[][] ACCESS_MODE_CONDITIONAL_TABLE =\n" +
+ " {\n" +
+ " /* Comment 1 */\n" +
+ " /* Comment 2 */ {\n" +
+ " \"UNUSED\",\n" +
+ " \"READ_POTENTIAL\",\n" +
+ " \"READ_POTENTIAL\",\n" +
+ " \"WRITE_POTENTIAL\",\n" +
+ " \"WRITE_POTENTIAL\",\n" +
+ " \"UNKNOWN\" },\n" +
+ " /* Comment 3 */ {\n" +
+ " \"READ_POTENTIAL\",\n" +
+ " \"READ\",\n" +
+ " \"READ_POTENTIAL\",\n" +
+ " \"UNKNOWN\",\n" +
+ " \"UNKNOWN\",\n" +
+ " \"UNKNOWN\" },\n" +
+ " };\n" +
+ "\n" +
"}\n"
);
}
@@ -10415,38 +10415,38 @@ public void testBug330313_b286601_07() {
setUpBracesPreferences(DefaultCodeFormatterConstants.NEXT_LINE);
setPageWidth80();
String source =
- "package b286601;\n" +
- "\n" +
- "public class X07 {\n" +
- "\n" +
- " \n" +
- " // Table to merge access modes for condition statements (e.g branch[x] || branch[y]). \n" +
- " static final String[][] ACCESS_MODE_CONDITIONAL_TABLE= {\n" +
- " /* Comment 1 */\n" +
- " /* Comment 2 */ { \"1234567890123456789012345678901234567890\", \"1234567890123456789012345678901234567890\" },\n" +
- " /* Comment 3 */ { \"ABCDEFGHIJKLMNOPQRSTUVWXYZ______________\", \"ABCDEFGHIJKLMNOPQRSTUVWXYZ______________\" },\n" +
- " };\n" +
- "\n" +
- "}\n";
- formatSource(source,
- "package b286601;\n" +
- "\n" +
- "public class X07\n" +
- "{\n" +
- "\n" +
- " // Table to merge access modes for condition statements (e.g branch[x] ||\n" +
- " // branch[y]).\n" +
- " static final String[][] ACCESS_MODE_CONDITIONAL_TABLE =\n" +
- " {\n" +
- " /* Comment 1 */\n" +
- " /* Comment 2 */ {\n" +
- " \"1234567890123456789012345678901234567890\",\n" +
- " \"1234567890123456789012345678901234567890\" },\n" +
- " /* Comment 3 */ {\n" +
- " \"ABCDEFGHIJKLMNOPQRSTUVWXYZ______________\",\n" +
- " \"ABCDEFGHIJKLMNOPQRSTUVWXYZ______________\" },\n" +
- " };\n" +
- "\n" +
+ "package b286601;\n" +
+ "\n" +
+ "public class X07 {\n" +
+ "\n" +
+ " \n" +
+ " // Table to merge access modes for condition statements (e.g branch[x] || branch[y]). \n" +
+ " static final String[][] ACCESS_MODE_CONDITIONAL_TABLE= {\n" +
+ " /* Comment 1 */\n" +
+ " /* Comment 2 */ { \"1234567890123456789012345678901234567890\", \"1234567890123456789012345678901234567890\" },\n" +
+ " /* Comment 3 */ { \"ABCDEFGHIJKLMNOPQRSTUVWXYZ______________\", \"ABCDEFGHIJKLMNOPQRSTUVWXYZ______________\" },\n" +
+ " };\n" +
+ "\n" +
+ "}\n";
+ formatSource(source,
+ "package b286601;\n" +
+ "\n" +
+ "public class X07\n" +
+ "{\n" +
+ "\n" +
+ " // Table to merge access modes for condition statements (e.g branch[x] ||\n" +
+ " // branch[y]).\n" +
+ " static final String[][] ACCESS_MODE_CONDITIONAL_TABLE =\n" +
+ " {\n" +
+ " /* Comment 1 */\n" +
+ " /* Comment 2 */ {\n" +
+ " \"1234567890123456789012345678901234567890\",\n" +
+ " \"1234567890123456789012345678901234567890\" },\n" +
+ " /* Comment 3 */ {\n" +
+ " \"ABCDEFGHIJKLMNOPQRSTUVWXYZ______________\",\n" +
+ " \"ABCDEFGHIJKLMNOPQRSTUVWXYZ______________\" },\n" +
+ " };\n" +
+ "\n" +
"}\n"
);
}
@@ -10456,40 +10456,40 @@ public void testBug330313_b286601_08() {
setUpBracesPreferences(DefaultCodeFormatterConstants.NEXT_LINE);
setPageWidth80();
String source =
- "package b286601;\n" +
- "\n" +
- "public class X08 {\n" +
- " private MinimizedFileSystemElement selectFiles(final Object rootFileSystemObject, final IImportStructureProvider structureProvider) {\n" +
- "\n" +
- " BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {\n" +
- " public void run() {\n" +
- " //Create the root element from the supplied file system object\n" +
- " }\n" +
- " });\n" +
- "\n" +
- " return null;\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "package b286601;\n" +
- "\n" +
- "public class X08\n" +
- "{\n" +
- " private MinimizedFileSystemElement selectFiles(\n" +
- " final Object rootFileSystemObject,\n" +
- " final IImportStructureProvider structureProvider)\n" +
- " {\n" +
- "\n" +
- " BusyIndicator.showWhile(getShell().getDisplay(), new Runnable()\n" +
- " {\n" +
- " public void run()\n" +
- " {\n" +
- " // Create the root element from the supplied file system object\n" +
- " }\n" +
- " });\n" +
- "\n" +
- " return null;\n" +
- " }\n" +
+ "package b286601;\n" +
+ "\n" +
+ "public class X08 {\n" +
+ " private MinimizedFileSystemElement selectFiles(final Object rootFileSystemObject, final IImportStructureProvider structureProvider) {\n" +
+ "\n" +
+ " BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {\n" +
+ " public void run() {\n" +
+ " //Create the root element from the supplied file system object\n" +
+ " }\n" +
+ " });\n" +
+ "\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "package b286601;\n" +
+ "\n" +
+ "public class X08\n" +
+ "{\n" +
+ " private MinimizedFileSystemElement selectFiles(\n" +
+ " final Object rootFileSystemObject,\n" +
+ " final IImportStructureProvider structureProvider)\n" +
+ " {\n" +
+ "\n" +
+ " BusyIndicator.showWhile(getShell().getDisplay(), new Runnable()\n" +
+ " {\n" +
+ " public void run()\n" +
+ " {\n" +
+ " // Create the root element from the supplied file system object\n" +
+ " }\n" +
+ " });\n" +
+ "\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
);
}
@@ -10503,46 +10503,46 @@ public void testBug332818() throws Exception {
this.formatterPrefs.indent_empty_lines = true;
this.formatterPrefs.number_of_empty_lines_to_preserve = 99;
String source =
- "public class Test {\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " private String f1;\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " private String f2;\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "}\n";
- formatSource(source,
- "public class Test {\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " private String f1;\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " private String f2;\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
+ "public class Test {\n" +
+ "\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " private String f1;\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "\n" +
+ " \n" +
+ " private String f2;\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "}\n";
+ formatSource(source,
+ "public class Test {\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " private String f1;\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " private String f2;\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
"}\n"
);
}
@@ -10554,21 +10554,21 @@ public void testBug332818() throws Exception {
*/
public void testBug332877() throws Exception {
String source =
- "public enum Environment {\n" +
- " PROD, // Production level environments\n" +
- " STAGING // Staging\n" +
+ "public enum Environment {\n" +
+ " PROD, // Production level environments\n" +
+ " STAGING // Staging\n" +
"}\n";
formatSource(source,
- "public enum Environment {\n" +
- " PROD, // Production level environments\n" +
- " STAGING // Staging\n" +
+ "public enum Environment {\n" +
+ " PROD, // Production level environments\n" +
+ " STAGING // Staging\n" +
"}\n"
);
}
/**
* @bug 282988: [formatter] Option to align single-line comments in a column
- * @test Ensure that with line comment formatting turned off comment alignment doesn't change
+ * @test Ensure that with line comment formatting turned off comment alignment doesn't change
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=282988"
*/
public void testBug282988() throws Exception {
@@ -10626,7 +10626,7 @@ public void testBug356851() throws Exception {
}
/**
* @bug 437639: [formatter] ArrayIndexOutOfBoundsException while formatting source code
- * @test test that the AIOOB is not generated
+ * @test test that the AIOOB is not generated
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=437639"
*/
public void testBug437639() throws Exception {
@@ -10683,18 +10683,18 @@ public void testBug437639() throws Exception {
public void testBug460008() throws Exception {
this.formatterPrefs.insert_new_line_at_end_of_file_if_missing = true;
String source = "name";
-
+
formatSource(source, source, CodeFormatter.K_EXPRESSION);
formatSource(source, source, CodeFormatter.K_UNKNOWN);
-
+
source = "public int field = 1;";
formatSource(source, source, CodeFormatter.K_STATEMENTS | CodeFormatter.F_INCLUDE_COMMENTS);
-
+
source = "/**Javadoc*/public int field=1;";
String result = "/** Javadoc */\n" +
"public int field = 1;";
formatSource(source, result, CodeFormatter.K_CLASS_BODY_DECLARATIONS | CodeFormatter.F_INCLUDE_COMMENTS);
-
+
// K_COMPILATION_UNIT is tested by FormatterRegressionTests#test512() and #test643()
}
/**
@@ -10704,15 +10704,15 @@ public void testBug460008() throws Exception {
*/
public void testBug462945() throws Exception {
String source =
- "package p1;\n" +
- "enum ReviewResult {\n" +
- " Good{, Bad\n" +
+ "package p1;\n" +
+ "enum ReviewResult {\n" +
+ " Good{, Bad\n" +
"}\n";
formatSource(source,
- "package p1;\n" +
- "\n" +
- "enum ReviewResult {\n" +
- " Good{, Bad\n" +
+ "package p1;\n" +
+ "\n" +
+ "enum ReviewResult {\n" +
+ " Good{, Bad\n" +
"}\n"
);
}
@@ -10777,76 +10777,76 @@ public void testBug464312() throws Exception {
formatSource(source, source, CodeFormatter.K_STATEMENTS);
}
/**
- * @bug 458208: [formatter] follow up bug for comments
+ * @bug 458208: [formatter] follow up bug for comments
* @test test a space is not added after a lambda expression in parenthesis
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=458208#c2"
*/
public void testBug458208() throws Exception {
String source =
- "package p;\n" +
- "import java.util.function.IntConsumer;\n" +
- "class TestInlineLambda1 {\n" +
- " {\n" +
- " IntConsumer op = (x -> {} );\n" +
- " }\n" +
+ "package p;\n" +
+ "import java.util.function.IntConsumer;\n" +
+ "class TestInlineLambda1 {\n" +
+ " {\n" +
+ " IntConsumer op = (x -> {} );\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "package p;\n" +
- "\n" +
- "import java.util.function.IntConsumer;\n" +
- "\n" +
- "class TestInlineLambda1 {\n" +
- " {\n" +
- " IntConsumer op = (x -> {\n" +
- " });\n" +
- " }\n" +
+ "package p;\n" +
+ "\n" +
+ "import java.util.function.IntConsumer;\n" +
+ "\n" +
+ "class TestInlineLambda1 {\n" +
+ " {\n" +
+ " IntConsumer op = (x -> {\n" +
+ " });\n" +
+ " }\n" +
"}\n"
);
}
/**
- * @bug 458208: [formatter] follow up bug for comments
+ * @bug 458208: [formatter] follow up bug for comments
* @test test that comments in switch statements are properly indented
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=458208#c21"
*/
public void testBug458208b() throws Exception {
formatSource(
- "package p;\n" +
- "\n" +
- "public class C1 {\n" +
- " void foo(int x) {\n" +
- " switch (x) {\n" +
- " // case 1\n" +
- " case 1:\n" +
- " break;\n" +
- " // case 2\n" +
- " case 2:\n" +
- " break;\n" +
- " // no more cases\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " int bar(int x) {\n" +
- " while (true) {\n" +
- " int y = 9;\n" +
- " switch (x) {\n" +
- " // case 1\n" +
- " case 1:\n" +
- " // should return\n" +
- " return y;\n" +
- " // case 2\n" +
- " case 2:\n" +
- " // should break\n" +
- " break;\n" +
- " case 3:\n" +
- " // TODO\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n"
- );
-}
-/**
- * @bug 458208: [formatter] follow up bug for comments
+ "package p;\n" +
+ "\n" +
+ "public class C1 {\n" +
+ " void foo(int x) {\n" +
+ " switch (x) {\n" +
+ " // case 1\n" +
+ " case 1:\n" +
+ " break;\n" +
+ " // case 2\n" +
+ " case 2:\n" +
+ " break;\n" +
+ " // no more cases\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " int bar(int x) {\n" +
+ " while (true) {\n" +
+ " int y = 9;\n" +
+ " switch (x) {\n" +
+ " // case 1\n" +
+ " case 1:\n" +
+ " // should return\n" +
+ " return y;\n" +
+ " // case 2\n" +
+ " case 2:\n" +
+ " // should break\n" +
+ " break;\n" +
+ " case 3:\n" +
+ " // TODO\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "}\n"
+ );
+}
+/**
+ * @bug 458208: [formatter] follow up bug for comments
* @test test that elements separated with empty lines are properly indented
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=458208#c18"
*/
@@ -10855,58 +10855,58 @@ public void testBug458208c() throws Exception {
this.formatterPrefs.alignment_for_enum_constants = wrapAllOnColumn;
this.formatterPrefs.alignment_for_arguments_in_enum_constant = wrapAllOnColumn;
this.formatterPrefs.alignment_for_expressions_in_array_initializer = wrapAllOnColumn;
- String source =
- "package p;\n" +
- "\n" +
- "public enum TestEnum {\n" +
- " FIRST_ENUM(\"first type\",\n" +
- " new SomeClass(),\n" +
- " new OtherEnumType[] { OtherEnumType.FOO }),\n" +
- "\n" +
- " SECOND_ENUM(\"second type\",\n" +
- " new SomeClassOtherClass(),\n" +
- " new OtherEnumType[] { OtherEnumType.BAR }),\n" +
- "\n" +
- " THIRD_ENUM(\"third type\",\n" +
- " new YetAnotherClass(),\n" +
- " new OtherEnumType[] { OtherEnumType.FOOBAR,\n" +
- " OtherEnumType.FOOBARBAZ,\n" +
- "\n" +
- " OtherEnumType.LONGERFOOBARBAZ,\n" +
- " OtherEnumType.MORELETTERSINHERE });\n" +
- "\n" +
- " /* data members and methods go here */\n" +
- " TestEnum(String s, Cls s1, OtherEnumType[] e) {\n" +
- " }\n" +
+ String source =
+ "package p;\n" +
+ "\n" +
+ "public enum TestEnum {\n" +
+ " FIRST_ENUM(\"first type\",\n" +
+ " new SomeClass(),\n" +
+ " new OtherEnumType[] { OtherEnumType.FOO }),\n" +
+ "\n" +
+ " SECOND_ENUM(\"second type\",\n" +
+ " new SomeClassOtherClass(),\n" +
+ " new OtherEnumType[] { OtherEnumType.BAR }),\n" +
+ "\n" +
+ " THIRD_ENUM(\"third type\",\n" +
+ " new YetAnotherClass(),\n" +
+ " new OtherEnumType[] { OtherEnumType.FOOBAR,\n" +
+ " OtherEnumType.FOOBARBAZ,\n" +
+ "\n" +
+ " OtherEnumType.LONGERFOOBARBAZ,\n" +
+ " OtherEnumType.MORELETTERSINHERE });\n" +
+ "\n" +
+ " /* data members and methods go here */\n" +
+ " TestEnum(String s, Cls s1, OtherEnumType[] e) {\n" +
+ " }\n" +
"}";
formatSource(source,
- "package p;\n" +
- "\n" +
- "public enum TestEnum {\n" +
- " FIRST_ENUM( \"first type\",\n" +
- " new SomeClass(),\n" +
- " new OtherEnumType[] { OtherEnumType.FOO }),\n" +
- "\n" +
- " SECOND_ENUM(\"second type\",\n" +
- " new SomeClassOtherClass(),\n" +
- " new OtherEnumType[] { OtherEnumType.BAR }),\n" +
- "\n" +
- " THIRD_ENUM( \"third type\",\n" +
- " new YetAnotherClass(),\n" +
- " new OtherEnumType[] { OtherEnumType.FOOBAR,\n" +
- " OtherEnumType.FOOBARBAZ,\n" +
- "\n" +
- " OtherEnumType.LONGERFOOBARBAZ,\n" +
- " OtherEnumType.MORELETTERSINHERE });\n" +
- "\n" +
- " /* data members and methods go here */\n" +
- " TestEnum(String s, Cls s1, OtherEnumType[] e) {\n" +
- " }\n" +
+ "package p;\n" +
+ "\n" +
+ "public enum TestEnum {\n" +
+ " FIRST_ENUM( \"first type\",\n" +
+ " new SomeClass(),\n" +
+ " new OtherEnumType[] { OtherEnumType.FOO }),\n" +
+ "\n" +
+ " SECOND_ENUM(\"second type\",\n" +
+ " new SomeClassOtherClass(),\n" +
+ " new OtherEnumType[] { OtherEnumType.BAR }),\n" +
+ "\n" +
+ " THIRD_ENUM( \"third type\",\n" +
+ " new YetAnotherClass(),\n" +
+ " new OtherEnumType[] { OtherEnumType.FOOBAR,\n" +
+ " OtherEnumType.FOOBARBAZ,\n" +
+ "\n" +
+ " OtherEnumType.LONGERFOOBARBAZ,\n" +
+ " OtherEnumType.MORELETTERSINHERE });\n" +
+ "\n" +
+ " /* data members and methods go here */\n" +
+ " TestEnum(String s, Cls s1, OtherEnumType[] e) {\n" +
+ " }\n" +
"}"
);
}
/**
- * @bug 458208: [formatter] follow up bug for comments
+ * @bug 458208: [formatter] follow up bug for comments
* @test test that enum constants are not indented with spaces when "Use spaces to indent wrapped lines" is on
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=458208#c24"
*/
@@ -10914,18 +10914,18 @@ public void testBug458208d() throws Exception {
this.formatterPrefs.alignment_for_enum_constants = Alignment.M_COMPACT_SPLIT;
this.formatterPrefs.use_tabs_only_for_leading_indentations = true;
setPageWidth80();
- String source =
- "package p;\n" +
- "\n" +
- "public enum TestEnum {\n" +
- " ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, ELEVEN, TWELWE, THIRTEEN, FOURTEEN, FIFTEEN;\n" +
+ String source =
+ "package p;\n" +
+ "\n" +
+ "public enum TestEnum {\n" +
+ " ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, ELEVEN, TWELWE, THIRTEEN, FOURTEEN, FIFTEEN;\n" +
"}";
formatSource(source,
- "package p;\n" +
- "\n" +
- "public enum TestEnum {\n" +
- " ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, ELEVEN, TWELWE,\n" +
- " THIRTEEN, FOURTEEN, FIFTEEN;\n" +
+ "package p;\n" +
+ "\n" +
+ "public enum TestEnum {\n" +
+ " ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, ELEVEN, TWELWE,\n" +
+ " THIRTEEN, FOURTEEN, FIFTEEN;\n" +
"}"
);
}
@@ -10938,36 +10938,36 @@ public void testBug465669() throws Exception {
this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.SPACE;
this.formatterPrefs.indentation_size = 2;
setPageWidth80();
- String source =
- "public class ffffffffffffffffff\r\n" +
- "{\r\n" +
- " private static void test(String s)\r\n" +
- " {\r\n" +
- " dddd = (aaaaaaaaaaaaaaaaaaaaaaa.ffffffffffffffffff)new dddddddddddddddd()\r\n" +
- " .ttt(null, aaaaaaaaaaaaaaaaaaaaaaa.ffffffffffffffffff.class)\r\n" +
- " .ttt(\"bbbbbbb\", xxxxxxxxx.class)\r\n" +
- " .ttt(\"sssssssvvvvvvv\", new fffffffffff(\"xxxx\")\r\n" +
- " .add(\"eeeeeeee\", aaaaaaaaaaaaaaaaaaaaaaa.ffffffffffffffffff.ssssssssssssss.class)\r\n" +
- " .add(\"cccccccccc\", aaaaaaaaaaaaaaaaaaaaaaa.ffffffffffffffffff.wwwwwwwwwwwwwwww.class)\r\n" +
- " )\r\n" +
- " .bbbbbbbbbbb(s);\r\n" +
- " }\r\n" +
- " \r\n" +
+ String source =
+ "public class ffffffffffffffffff\r\n" +
+ "{\r\n" +
+ " private static void test(String s)\r\n" +
+ " {\r\n" +
+ " dddd = (aaaaaaaaaaaaaaaaaaaaaaa.ffffffffffffffffff)new dddddddddddddddd()\r\n" +
+ " .ttt(null, aaaaaaaaaaaaaaaaaaaaaaa.ffffffffffffffffff.class)\r\n" +
+ " .ttt(\"bbbbbbb\", xxxxxxxxx.class)\r\n" +
+ " .ttt(\"sssssssvvvvvvv\", new fffffffffff(\"xxxx\")\r\n" +
+ " .add(\"eeeeeeee\", aaaaaaaaaaaaaaaaaaaaaaa.ffffffffffffffffff.ssssssssssssss.class)\r\n" +
+ " .add(\"cccccccccc\", aaaaaaaaaaaaaaaaaaaaaaa.ffffffffffffffffff.wwwwwwwwwwwwwwww.class)\r\n" +
+ " )\r\n" +
+ " .bbbbbbbbbbb(s);\r\n" +
+ " }\r\n" +
+ " \r\n" +
"}";
formatSource(source,
- "public class ffffffffffffffffff {\r\n" +
- " private static void test(String s) {\r\n" +
- " dddd = (aaaaaaaaaaaaaaaaaaaaaaa.ffffffffffffffffff) new dddddddddddddddd()\r\n" +
- " .ttt(null, aaaaaaaaaaaaaaaaaaaaaaa.ffffffffffffffffff.class)\r\n" +
- " .ttt(\"bbbbbbb\", xxxxxxxxx.class)\r\n" +
- " .ttt(\"sssssssvvvvvvv\", new fffffffffff(\"xxxx\")\r\n" +
- " .add(\"eeeeeeee\",\r\n" +
- " aaaaaaaaaaaaaaaaaaaaaaa.ffffffffffffffffff.ssssssssssssss.class)\r\n" +
- " .add(\"cccccccccc\",\r\n" +
- " aaaaaaaaaaaaaaaaaaaaaaa.ffffffffffffffffff.wwwwwwwwwwwwwwww.class))\r\n" +
- " .bbbbbbbbbbb(s);\r\n" +
- " }\r\n" +
- "\r\n" +
+ "public class ffffffffffffffffff {\r\n" +
+ " private static void test(String s) {\r\n" +
+ " dddd = (aaaaaaaaaaaaaaaaaaaaaaa.ffffffffffffffffff) new dddddddddddddddd()\r\n" +
+ " .ttt(null, aaaaaaaaaaaaaaaaaaaaaaa.ffffffffffffffffff.class)\r\n" +
+ " .ttt(\"bbbbbbb\", xxxxxxxxx.class)\r\n" +
+ " .ttt(\"sssssssvvvvvvv\", new fffffffffff(\"xxxx\")\r\n" +
+ " .add(\"eeeeeeee\",\r\n" +
+ " aaaaaaaaaaaaaaaaaaaaaaa.ffffffffffffffffff.ssssssssssssss.class)\r\n" +
+ " .add(\"cccccccccc\",\r\n" +
+ " aaaaaaaaaaaaaaaaaaaaaaa.ffffffffffffffffff.wwwwwwwwwwwwwwww.class))\r\n" +
+ " .bbbbbbbbbbb(s);\r\n" +
+ " }\r\n" +
+ "\r\n" +
"}"
);
}
@@ -10975,13 +10975,13 @@ public void testBug471090() throws JavaModelException {
setFormatLineCommentOnFirstColumn();
this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.SPACE;
this.formatterPrefs.indentation_size = 2;
- String source =
- "class FormatterBug {\n" +
+ String source =
+ "class FormatterBug {\n" +
"// \\u00C4\n" +
"}\n";
- formatSource(source,
- "class FormatterBug {\n" +
- " // \\u00C4\n" +
+ formatSource(source,
+ "class FormatterBug {\n" +
+ " // \\u00C4\n" +
"}\n"
);
}
@@ -10993,35 +10993,35 @@ public void testBug471090() throws JavaModelException {
public void testBug471364() throws JavaModelException {
this.formatterPrefs.blank_lines_before_abstract_method = 0;
this.formatterPrefs.alignment_for_method_declaration = Alignment.M_COMPACT_SPLIT;
- String source =
- "interface Example {\r\n" +
- "\r\n" +
- " void method2();\r\n" +
- " void method2();\r\n" +
- "\r\n" +
- " void method3();\r\n" +
- "\r\n" +
- " /**\r\n" +
- " * \r\n" +
- " */\r\n" +
- " void method4();\r\n" +
- "\r\n" +
+ String source =
+ "interface Example {\r\n" +
+ "\r\n" +
+ " void method2();\r\n" +
+ " void method2();\r\n" +
+ "\r\n" +
+ " void method3();\r\n" +
+ "\r\n" +
+ " /**\r\n" +
+ " * \r\n" +
+ " */\r\n" +
+ " void method4();\r\n" +
+ "\r\n" +
"}";
formatSource(source);
- source =
- "public class Example {\r\n" +
- "\r\n" +
- " void method2();\r\n" +
- " void method2();\r\n" +
- "\r\n" +
- " void method3();\r\n" +
- "\r\n" +
- " /**\r\n" +
- " * \r\n" +
- " */\r\n" +
- " void method4();\r\n" +
- "\r\n" +
+ source =
+ "public class Example {\r\n" +
+ "\r\n" +
+ " void method2();\r\n" +
+ " void method2();\r\n" +
+ "\r\n" +
+ " void method3();\r\n" +
+ "\r\n" +
+ " /**\r\n" +
+ " * \r\n" +
+ " */\r\n" +
+ " void method4();\r\n" +
+ "\r\n" +
"}";
formatSource(source);
}
@@ -11033,27 +11033,27 @@ public void testBug471364() throws JavaModelException {
public void testBug471145() throws JavaModelException {
this.formatterPrefs.insert_space_before_opening_brace_in_block = false;
this.formatterPrefs.keep_simple_if_on_one_line = true;
- String source =
- "class C {\r\n" +
- " void method() {\r\n" +
- " if (condition) {\r\n" +
- " operation();\r\n" +
- " }\r\n" +
- " if (condition)// don't add space before comment\r\n" +
- " operation();\r\n" +
- " if (condition)operation();\r\n" +
- " }\r\n" +
+ String source =
+ "class C {\r\n" +
+ " void method() {\r\n" +
+ " if (condition) {\r\n" +
+ " operation();\r\n" +
+ " }\r\n" +
+ " if (condition)// don't add space before comment\r\n" +
+ " operation();\r\n" +
+ " if (condition)operation();\r\n" +
+ " }\r\n" +
"}";
formatSource(source,
- "class C {\r\n" +
- " void method() {\r\n" +
- " if (condition){\r\n" +
- " operation();\r\n" +
- " }\r\n" +
- " if (condition)// don't add space before comment\r\n" +
- " operation();\r\n" +
- " if (condition) operation();\r\n" +
- " }\r\n" +
+ "class C {\r\n" +
+ " void method() {\r\n" +
+ " if (condition){\r\n" +
+ " operation();\r\n" +
+ " }\r\n" +
+ " if (condition)// don't add space before comment\r\n" +
+ " operation();\r\n" +
+ " if (condition) operation();\r\n" +
+ " }\r\n" +
"}");
}
/**
@@ -11064,24 +11064,24 @@ public void testBug471145() throws JavaModelException {
public void testBug469438() {
this.formatterPrefs.use_tags = true;
String source =
- "public class C1 {\r\n" +
- " int b;\r\n" +
- "\r\n" +
- " /** @formatter:off */\r\n" +
- " private void a() {\r\n" +
- " // @formatter:on\r\n" +
- " if ()\r\n" +
- " }\r\n" +
+ "public class C1 {\r\n" +
+ " int b;\r\n" +
+ "\r\n" +
+ " /** @formatter:off */\r\n" +
+ " private void a() {\r\n" +
+ " // @formatter:on\r\n" +
+ " if ()\r\n" +
+ " }\r\n" +
"}";
formatSource(source,
- "public class C1 {\r\n" +
- " int b;\r\n" +
- "\r\n" +
- " /** @formatter:off */\r\n" +
- " private void a() {\r\n" +
- " // @formatter:on\r\n" +
- " if ()\r\n" +
- " }\r\n" +
+ "public class C1 {\r\n" +
+ " int b;\r\n" +
+ "\r\n" +
+ " /** @formatter:off */\r\n" +
+ " private void a() {\r\n" +
+ " // @formatter:on\r\n" +
+ " if ()\r\n" +
+ " }\r\n" +
"}"
);
}
@@ -11094,13 +11094,13 @@ public void testBug471883() throws Exception {
this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.SPACE;
this.formatterPrefs.indentation_size = 2;
setPageWidth80();
- String source =
- "/**\r\n" +
- " * <pre>\r\n" +
- " * isInEncoding(char ch);\r\n" +
- " * </pre>\r\n" +
- " */\r\n" +
- "public class Try {\r\n" +
+ String source =
+ "/**\r\n" +
+ " * <pre>\r\n" +
+ " * isInEncoding(char ch);\r\n" +
+ " * </pre>\r\n" +
+ " */\r\n" +
+ "public class Try {\r\n" +
"}";
formatSource(source);
}
@@ -11110,20 +11110,20 @@ public void testBug471883() throws Exception {
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=470977"
*/
public void testBug470977() throws Exception {
- String source =
- "public class TestFormat {\r\n" +
- " public static void main(String[] args) {\r\n" +
- " assert \"\".length() == 0;\r\n" +
- " assert (!false);\r\n" +
- "\r\n" +
- " assert !false;\r\n" +
- " assert +0 == 0;\r\n" +
- " assert -0 == 0;\r\n" +
- "\r\n" +
- " int i = 0;\r\n" +
- " assert ++i == 1;\r\n" +
- " assert --i == 0;\r\n" +
- " }\r\n" +
+ String source =
+ "public class TestFormat {\r\n" +
+ " public static void main(String[] args) {\r\n" +
+ " assert \"\".length() == 0;\r\n" +
+ " assert (!false);\r\n" +
+ "\r\n" +
+ " assert !false;\r\n" +
+ " assert +0 == 0;\r\n" +
+ " assert -0 == 0;\r\n" +
+ "\r\n" +
+ " int i = 0;\r\n" +
+ " assert ++i == 1;\r\n" +
+ " assert --i == 0;\r\n" +
+ " }\r\n" +
"}";
formatSource(source);
}
@@ -11133,11 +11133,11 @@ public void testBug470977() throws Exception {
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=472962"
*/
public void testBug472962() {
- String source =
- "public @interface A {\r\n" +
- " String[] strings();\r\n" +
- "\r\n" +
- " Class<String> stringClasses();\r\n" +
+ String source =
+ "public @interface A {\r\n" +
+ " String[] strings();\r\n" +
+ "\r\n" +
+ " Class<String> stringClasses();\r\n" +
"}";
formatSource(source);
}
@@ -11148,13 +11148,13 @@ public void testBug472962() {
*/
public void testBug470506() {
this.formatterPrefs.align_type_members_on_columns = true;
- String source =
- "class C {\r\n" +
- " private int iii;\r\n" +
- " String sss;\r\n" +
- "\r\n" +
- " protected ArrayList<Integer> aaa;\r\n" +
- "\r\n" +
+ String source =
+ "class C {\r\n" +
+ " private int iii;\r\n" +
+ " String sss;\r\n" +
+ "\r\n" +
+ " protected ArrayList<Integer> aaa;\r\n" +
+ "\r\n" +
"}";
formatSource(source);
}
@@ -11163,7 +11163,7 @@ public void testBug470506() {
* @bug 472205: Class extends generic type and implements another type, missing space after ">"
*/
public void testBug472205() {
- String source =
+ String source =
"public class Test<E> extends ArrayList<String> implements Callable<String> {\n" +
"}\n" +
"\n" +
@@ -11184,12 +11184,12 @@ public void testBug472205() {
* @bug 471780 - [formatter] Regression in enum value Javadoc formatting
*/
public void testBug471780() {
- String source =
- "public enum MyEnum {\r\n" +
- " /** A. */\r\n" +
- " A,\r\n" +
- " /** B. */\r\n" +
- " B\r\n" +
+ String source =
+ "public enum MyEnum {\r\n" +
+ " /** A. */\r\n" +
+ " A,\r\n" +
+ " /** B. */\r\n" +
+ " B\r\n" +
"}";
formatSource(source);
}
@@ -11198,17 +11198,17 @@ public void testBug471780() {
*/
public void testBug472009() {
this.formatterPrefs.alignment_for_compact_if |= Alignment.M_FORCE;
- String source =
- "public class A {\r\n" +
- " void a() {\r\n" +
- " if (a == b) {\r\n" +
- "\r\n" +
- " } else if (c == d) {\r\n" +
- "\r\n" +
- " } else if (e == f) {\r\n" +
- "\r\n" +
- " }\r\n" +
- " }\r\n" +
+ String source =
+ "public class A {\r\n" +
+ " void a() {\r\n" +
+ " if (a == b) {\r\n" +
+ "\r\n" +
+ " } else if (c == d) {\r\n" +
+ "\r\n" +
+ " } else if (e == f) {\r\n" +
+ "\r\n" +
+ " }\r\n" +
+ " }\r\n" +
"}";
formatSource(source);
}
@@ -11226,22 +11226,22 @@ public void testBug474629() {
public void testBug467618() {
this.formatterPrefs.alignment_for_enum_constants = Alignment.M_NEXT_PER_LINE_SPLIT + Alignment.M_INDENT_ON_COLUMN + Alignment.M_FORCE;
String source =
- "public enum E2 {\r\n" +
- "\r\n" +
- " FOOBAR,\r\n" +
- "\r\n" +
- " FOOBARBAZ,\r\n" +
- "\r\n" +
- " FOO;\r\n" +
+ "public enum E2 {\r\n" +
+ "\r\n" +
+ " FOOBAR,\r\n" +
+ "\r\n" +
+ " FOOBARBAZ,\r\n" +
+ "\r\n" +
+ " FOO;\r\n" +
"}";
formatSource(source,
- "public enum E2 {\r\n" +
- "\r\n" +
- " FOOBAR,\r\n" +
- "\r\n" +
- " FOOBARBAZ,\r\n" +
- "\r\n" +
- " FOO;\r\n" +
+ "public enum E2 {\r\n" +
+ "\r\n" +
+ " FOOBAR,\r\n" +
+ "\r\n" +
+ " FOOBARBAZ,\r\n" +
+ "\r\n" +
+ " FOO;\r\n" +
"}"
);
}
@@ -11251,22 +11251,22 @@ public void testBug467618() {
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=474916"
*/
public void testBug474916() {
- String source =
- "/**\r\n" +
- " * < \r\n" +
- " * > <p style='color:red'> Test </p>\r\n" +
- " * <a title=\"I like to 'quote' it\" \r\n" +
- "href = 'http://www.eclipse.org'>Toast</a> */\r\n" +
+ String source =
+ "/**\r\n" +
+ " * < \r\n" +
+ " * > <p style='color:red'> Test </p>\r\n" +
+ " * <a title=\"I like to 'quote' it\" \r\n" +
+ "href = 'http://www.eclipse.org'>Toast</a> */\r\n" +
"class A {}";
formatSource(source,
- "/**\r\n" +
- " * < >\r\n" +
- " * <p style='color:red'>\r\n" +
- " * Test\r\n" +
- " * </p>\r\n" +
- " * <a title=\"I like to 'quote' it\" href = 'http://www.eclipse.org'>Toast</a>\r\n" +
- " */\r\n" +
- "class A {\r\n" +
+ "/**\r\n" +
+ " * < >\r\n" +
+ " * <p style='color:red'>\r\n" +
+ " * Test\r\n" +
+ " * </p>\r\n" +
+ " * <a title=\"I like to 'quote' it\" href = 'http://www.eclipse.org'>Toast</a>\r\n" +
+ " */\r\n" +
+ "class A {\r\n" +
"}"
);
}
@@ -11276,63 +11276,63 @@ public void testBug474916() {
public void testBug474918() {
useOldCommentWidthCounting();
this.formatterPrefs.align_type_members_on_columns = true;
- String source =
- "import java.util.function.Function;\r\n" +
- "\r\n" +
- "public class A {\r\n" +
- " private Function mapper = (Object a) -> {\r\n" +
- " return a.toString().equals(\"test\");\r\n" +
- " };\r\n" +
- " String ssssssssssssssss = \"dsadaaaaaaaaaaaaaaaaaaaaaaaaa\"; //$NON-NLS-1$ // B // A\r\n" +
- "\r\n" +
- " int bb = 4;\r\n" +
- "\r\n" +
- " Object c = new Object() {\r\n" +
- " int a = 55;\r\n" +
- " Object cdddddddddddd = null;\r\n" +
- " };\r\n" +
- "\r\n" +
- " private enum E {\r\n" +
- " AAA, BBB;\r\n" +
- " int a = 55;\r\n" +
- " String sssss = \"ssssss\";\r\n" +
- " }\r\n" +
- "\r\n" +
- " private @interface II {\r\n" +
- " int aaaaaa = 1;\r\n" +
- " String bbbbbbbbb = \"default\";\r\n" +
- " }\r\n" +
+ String source =
+ "import java.util.function.Function;\r\n" +
+ "\r\n" +
+ "public class A {\r\n" +
+ " private Function mapper = (Object a) -> {\r\n" +
+ " return a.toString().equals(\"test\");\r\n" +
+ " };\r\n" +
+ " String ssssssssssssssss = \"dsadaaaaaaaaaaaaaaaaaaaaaaaaa\"; //$NON-NLS-1$ // B // A\r\n" +
+ "\r\n" +
+ " int bb = 4;\r\n" +
+ "\r\n" +
+ " Object c = new Object() {\r\n" +
+ " int a = 55;\r\n" +
+ " Object cdddddddddddd = null;\r\n" +
+ " };\r\n" +
+ "\r\n" +
+ " private enum E {\r\n" +
+ " AAA, BBB;\r\n" +
+ " int a = 55;\r\n" +
+ " String sssss = \"ssssss\";\r\n" +
+ " }\r\n" +
+ "\r\n" +
+ " private @interface II {\r\n" +
+ " int aaaaaa = 1;\r\n" +
+ " String bbbbbbbbb = \"default\";\r\n" +
+ " }\r\n" +
"}";
formatSource(source,
- "import java.util.function.Function;\r\n" +
- "\r\n" +
- "public class A {\r\n" +
- " private Function mapper = (Object a) -> {\r\n" +
- " return a.toString().equals(\"test\");\r\n" +
- " };\r\n" +
- " String ssssssssssssssss = \"dsadaaaaaaaaaaaaaaaaaaaaaaaaa\"; //$NON-NLS-1$ //\r\n" +
- " // B\r\n" +
- " // //\r\n" +
- " // A\r\n" +
- "\r\n" +
- " int bb = 4;\r\n" +
- "\r\n" +
- " Object c = new Object() {\r\n" +
- " int a = 55;\r\n" +
- " Object cdddddddddddd = null;\r\n" +
- " };\r\n" +
- "\r\n" +
- " private enum E {\r\n" +
- " AAA, BBB;\r\n" +
- "\r\n" +
- " int a = 55;\r\n" +
- " String sssss = \"ssssss\";\r\n" +
- " }\r\n" +
- "\r\n" +
- " private @interface II {\r\n" +
- " int aaaaaa = 1;\r\n" +
- " String bbbbbbbbb = \"default\";\r\n" +
- " }\r\n" +
+ "import java.util.function.Function;\r\n" +
+ "\r\n" +
+ "public class A {\r\n" +
+ " private Function mapper = (Object a) -> {\r\n" +
+ " return a.toString().equals(\"test\");\r\n" +
+ " };\r\n" +
+ " String ssssssssssssssss = \"dsadaaaaaaaaaaaaaaaaaaaaaaaaa\"; //$NON-NLS-1$ //\r\n" +
+ " // B\r\n" +
+ " // //\r\n" +
+ " // A\r\n" +
+ "\r\n" +
+ " int bb = 4;\r\n" +
+ "\r\n" +
+ " Object c = new Object() {\r\n" +
+ " int a = 55;\r\n" +
+ " Object cdddddddddddd = null;\r\n" +
+ " };\r\n" +
+ "\r\n" +
+ " private enum E {\r\n" +
+ " AAA, BBB;\r\n" +
+ "\r\n" +
+ " int a = 55;\r\n" +
+ " String sssss = \"ssssss\";\r\n" +
+ " }\r\n" +
+ "\r\n" +
+ " private @interface II {\r\n" +
+ " int aaaaaa = 1;\r\n" +
+ " String bbbbbbbbb = \"default\";\r\n" +
+ " }\r\n" +
"}"
);
}
@@ -11343,63 +11343,63 @@ public void testBug474918b() {
useOldCommentWidthCounting();
this.formatterPrefs.align_type_members_on_columns = true;
this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.SPACE;
- String source =
- "import java.util.function.Function;\r\n" +
- "\r\n" +
- "public class A {\r\n" +
- " private Function mapper = (Object a) -> {\r\n" +
- " return a.toString().equals(\"test\");\r\n" +
- " };\r\n" +
- " String ssssssssssssssss = \"dsadaaaaaaaaaaaaaaaaaaaaaaaaa\"; //$NON-NLS-1$ // B // A\r\n" +
- "\r\n" +
- " int bb = 4;\r\n" +
- "\r\n" +
- " Object c = new Object() {\r\n" +
- " int a = 55;\r\n" +
- " Object cdddddddddddd = null;\r\n" +
- " };\r\n" +
- "\r\n" +
- " private enum E {\r\n" +
- " AAA, BBB;\r\n" +
- " int a = 55;\r\n" +
- " String sssss = \"ssssss\";\r\n" +
- " }\r\n" +
- "\r\n" +
- " private @interface II {\r\n" +
- " int aaaaaa = 1;\r\n" +
- " String bbbbbbbbb = \"default\";\r\n" +
- " }\r\n" +
+ String source =
+ "import java.util.function.Function;\r\n" +
+ "\r\n" +
+ "public class A {\r\n" +
+ " private Function mapper = (Object a) -> {\r\n" +
+ " return a.toString().equals(\"test\");\r\n" +
+ " };\r\n" +
+ " String ssssssssssssssss = \"dsadaaaaaaaaaaaaaaaaaaaaaaaaa\"; //$NON-NLS-1$ // B // A\r\n" +
+ "\r\n" +
+ " int bb = 4;\r\n" +
+ "\r\n" +
+ " Object c = new Object() {\r\n" +
+ " int a = 55;\r\n" +
+ " Object cdddddddddddd = null;\r\n" +
+ " };\r\n" +
+ "\r\n" +
+ " private enum E {\r\n" +
+ " AAA, BBB;\r\n" +
+ " int a = 55;\r\n" +
+ " String sssss = \"ssssss\";\r\n" +
+ " }\r\n" +
+ "\r\n" +
+ " private @interface II {\r\n" +
+ " int aaaaaa = 1;\r\n" +
+ " String bbbbbbbbb = \"default\";\r\n" +
+ " }\r\n" +
"}";
formatSource(source,
- "import java.util.function.Function;\r\n" +
- "\r\n" +
- "public class A {\r\n" +
- " private Function mapper = (Object a) -> {\r\n" +
- " return a.toString().equals(\"test\");\r\n" +
- " };\r\n" +
- " String ssssssssssssssss = \"dsadaaaaaaaaaaaaaaaaaaaaaaaaa\"; //$NON-NLS-1$ //\r\n" +
- " // B\r\n" +
- " // //\r\n" +
- " // A\r\n" +
- "\r\n" +
- " int bb = 4;\r\n" +
- "\r\n" +
- " Object c = new Object() {\r\n" +
- " int a = 55;\r\n" +
- " Object cdddddddddddd = null;\r\n" +
- " };\r\n" +
- "\r\n" +
- " private enum E {\r\n" +
- " AAA, BBB;\r\n" +
- "\r\n" +
- " int a = 55;\r\n" +
- " String sssss = \"ssssss\";\r\n" +
- " }\r\n" +
- "\r\n" +
- " private @interface II {\r\n" +
- " int aaaaaa = 1;\r\n" +
- " String bbbbbbbbb = \"default\";\r\n" +
- " }\r\n" +
+ "import java.util.function.Function;\r\n" +
+ "\r\n" +
+ "public class A {\r\n" +
+ " private Function mapper = (Object a) -> {\r\n" +
+ " return a.toString().equals(\"test\");\r\n" +
+ " };\r\n" +
+ " String ssssssssssssssss = \"dsadaaaaaaaaaaaaaaaaaaaaaaaaa\"; //$NON-NLS-1$ //\r\n" +
+ " // B\r\n" +
+ " // //\r\n" +
+ " // A\r\n" +
+ "\r\n" +
+ " int bb = 4;\r\n" +
+ "\r\n" +
+ " Object c = new Object() {\r\n" +
+ " int a = 55;\r\n" +
+ " Object cdddddddddddd = null;\r\n" +
+ " };\r\n" +
+ "\r\n" +
+ " private enum E {\r\n" +
+ " AAA, BBB;\r\n" +
+ "\r\n" +
+ " int a = 55;\r\n" +
+ " String sssss = \"ssssss\";\r\n" +
+ " }\r\n" +
+ "\r\n" +
+ " private @interface II {\r\n" +
+ " int aaaaaa = 1;\r\n" +
+ " String bbbbbbbbb = \"default\";\r\n" +
+ " }\r\n" +
"}"
);
}
@@ -11410,63 +11410,63 @@ public void testBug474918c() {
useOldCommentWidthCounting();
this.formatterPrefs.align_type_members_on_columns = true;
this.formatterPrefs.use_tabs_only_for_leading_indentations = true;
- String source =
- "import java.util.function.Function;\r\n" +
- "\r\n" +
- "public class A {\r\n" +
- " private Function mapper = (Object a) -> {\r\n" +
- " return a.toString().equals(\"test\");\r\n" +
- " };\r\n" +
- " String ssssssssssssssss = \"dsadaaaaaaaaaaaaaaaaaaaaaaaaa\"; //$NON-NLS-1$ // B // A\r\n" +
- "\r\n" +
- " int bb = 4;\r\n" +
- "\r\n" +
- " Object c = new Object() {\r\n" +
- " int a = 55;\r\n" +
- " Object cdddddddddddd = null;\r\n" +
- " };\r\n" +
- "\r\n" +
- " private enum E {\r\n" +
- " AAA, BBB;\r\n" +
- " int a = 55;\r\n" +
- " String sssss = \"ssssss\";\r\n" +
- " }\r\n" +
- "\r\n" +
- " private @interface II {\r\n" +
- " int aaaaaa = 1;\r\n" +
- " String bbbbbbbbb = \"default\";\r\n" +
- " }\r\n" +
+ String source =
+ "import java.util.function.Function;\r\n" +
+ "\r\n" +
+ "public class A {\r\n" +
+ " private Function mapper = (Object a) -> {\r\n" +
+ " return a.toString().equals(\"test\");\r\n" +
+ " };\r\n" +
+ " String ssssssssssssssss = \"dsadaaaaaaaaaaaaaaaaaaaaaaaaa\"; //$NON-NLS-1$ // B // A\r\n" +
+ "\r\n" +
+ " int bb = 4;\r\n" +
+ "\r\n" +
+ " Object c = new Object() {\r\n" +
+ " int a = 55;\r\n" +
+ " Object cdddddddddddd = null;\r\n" +
+ " };\r\n" +
+ "\r\n" +
+ " private enum E {\r\n" +
+ " AAA, BBB;\r\n" +
+ " int a = 55;\r\n" +
+ " String sssss = \"ssssss\";\r\n" +
+ " }\r\n" +
+ "\r\n" +
+ " private @interface II {\r\n" +
+ " int aaaaaa = 1;\r\n" +
+ " String bbbbbbbbb = \"default\";\r\n" +
+ " }\r\n" +
"}";
formatSource(source,
- "import java.util.function.Function;\r\n" +
- "\r\n" +
- "public class A {\r\n" +
- " private Function mapper = (Object a) -> {\r\n" +
- " return a.toString().equals(\"test\");\r\n" +
- " };\r\n" +
- " String ssssssssssssssss = \"dsadaaaaaaaaaaaaaaaaaaaaaaaaa\"; //$NON-NLS-1$ //\r\n" +
- " // B\r\n" +
- " // //\r\n" +
- " // A\r\n" +
- "\r\n" +
- " int bb = 4;\r\n" +
- "\r\n" +
- " Object c = new Object() {\r\n" +
- " int a = 55;\r\n" +
- " Object cdddddddddddd = null;\r\n" +
- " };\r\n" +
- "\r\n" +
- " private enum E {\r\n" +
- " AAA, BBB;\r\n" +
- "\r\n" +
- " int a = 55;\r\n" +
- " String sssss = \"ssssss\";\r\n" +
- " }\r\n" +
- "\r\n" +
- " private @interface II {\r\n" +
- " int aaaaaa = 1;\r\n" +
- " String bbbbbbbbb = \"default\";\r\n" +
- " }\r\n" +
+ "import java.util.function.Function;\r\n" +
+ "\r\n" +
+ "public class A {\r\n" +
+ " private Function mapper = (Object a) -> {\r\n" +
+ " return a.toString().equals(\"test\");\r\n" +
+ " };\r\n" +
+ " String ssssssssssssssss = \"dsadaaaaaaaaaaaaaaaaaaaaaaaaa\"; //$NON-NLS-1$ //\r\n" +
+ " // B\r\n" +
+ " // //\r\n" +
+ " // A\r\n" +
+ "\r\n" +
+ " int bb = 4;\r\n" +
+ "\r\n" +
+ " Object c = new Object() {\r\n" +
+ " int a = 55;\r\n" +
+ " Object cdddddddddddd = null;\r\n" +
+ " };\r\n" +
+ "\r\n" +
+ " private enum E {\r\n" +
+ " AAA, BBB;\r\n" +
+ "\r\n" +
+ " int a = 55;\r\n" +
+ " String sssss = \"ssssss\";\r\n" +
+ " }\r\n" +
+ "\r\n" +
+ " private @interface II {\r\n" +
+ " int aaaaaa = 1;\r\n" +
+ " String bbbbbbbbb = \"default\";\r\n" +
+ " }\r\n" +
"}"
);
}
@@ -11474,13 +11474,13 @@ public void testBug474918c() {
* https://bugs.eclipse.org/475865 - JDT deletes code
*/
public void testBug475865() {
- String source =
- "public class Snippet {\r\n" +
- "\r\n" +
- " Runnable disposeRunnable = this::dispose();\r\n" +
- "\r\n" +
- " void dispose() {\r\n" +
- " }\r\n" +
+ String source =
+ "public class Snippet {\r\n" +
+ "\r\n" +
+ " Runnable disposeRunnable = this::dispose();\r\n" +
+ "\r\n" +
+ " void dispose() {\r\n" +
+ " }\r\n" +
"}";
formatSource(source);
}
@@ -11490,20 +11490,20 @@ public void testBug475865() {
public void testBug435241() {
this.formatterPrefs.brace_position_for_block = DefaultCodeFormatterConstants.NEXT_LINE;
this.formatterPrefs.insert_new_line_before_else_in_if_statement = true;
- String source =
- "public class Snippet {\r\n" +
- " public static void main(String[] args) {\r\n" +
- " Executors.newSingleThreadExecutor().execute(() -> {\r\n" +
- " if (true)\r\n" +
- " {\r\n" +
- " System.err.println(\"foo\");\r\n" +
- " }\r\n" +
- " else\r\n" +
- " {\r\n" +
- " System.err.println(\"bar\");\r\n" +
- " }\r\n" +
- " });\r\n" +
- " }\r\n" +
+ String source =
+ "public class Snippet {\r\n" +
+ " public static void main(String[] args) {\r\n" +
+ " Executors.newSingleThreadExecutor().execute(() -> {\r\n" +
+ " if (true)\r\n" +
+ " {\r\n" +
+ " System.err.println(\"foo\");\r\n" +
+ " }\r\n" +
+ " else\r\n" +
+ " {\r\n" +
+ " System.err.println(\"bar\");\r\n" +
+ " }\r\n" +
+ " });\r\n" +
+ " }\r\n" +
"}";
formatSource(source);
}
@@ -11512,77 +11512,77 @@ public void testBug435241() {
*/
public void testBug472815() {
this.formatterPrefs.number_of_empty_lines_to_preserve = 2;
- String source =
- "public class Snippet {\r\n" +
- "\r\n" +
- " int[] a1 = { };\r\n" +
- " int[] a2 = {\r\n" +
- " };\r\n" +
- " int[] a3 = {\r\n" +
- "\r\n" +
- " };\r\n" +
- " int[] a4 = {\r\n" +
- "\r\n" +
- "\r\n" +
- " };\r\n" +
- " int[] a5 = {\r\n" +
- "\r\n" +
- "\r\n" +
- "\r\n" +
- " };\r\n" +
- "\r\n" +
- " void f1() { }\r\n" +
- " void f2() {\r\n" +
- " }\r\n" +
- " void f3() {\r\n" +
- "\r\n" +
- " }\r\n" +
- " void f4() {\r\n" +
- "\r\n" +
- "\r\n" +
- " }\r\n" +
- " void f5() {\r\n" +
- "\r\n" +
- "\r\n" +
- "\r\n" +
- " }\r\n" +
+ String source =
+ "public class Snippet {\r\n" +
+ "\r\n" +
+ " int[] a1 = { };\r\n" +
+ " int[] a2 = {\r\n" +
+ " };\r\n" +
+ " int[] a3 = {\r\n" +
+ "\r\n" +
+ " };\r\n" +
+ " int[] a4 = {\r\n" +
+ "\r\n" +
+ "\r\n" +
+ " };\r\n" +
+ " int[] a5 = {\r\n" +
+ "\r\n" +
+ "\r\n" +
+ "\r\n" +
+ " };\r\n" +
+ "\r\n" +
+ " void f1() { }\r\n" +
+ " void f2() {\r\n" +
+ " }\r\n" +
+ " void f3() {\r\n" +
+ "\r\n" +
+ " }\r\n" +
+ " void f4() {\r\n" +
+ "\r\n" +
+ "\r\n" +
+ " }\r\n" +
+ " void f5() {\r\n" +
+ "\r\n" +
+ "\r\n" +
+ "\r\n" +
+ " }\r\n" +
"}";
formatSource(source,
- "public class Snippet {\r\n" +
- "\r\n" +
- " int[] a1 = {};\r\n" +
- " int[] a2 = {};\r\n" +
- " int[] a3 = {\r\n" +
- "\r\n" +
- " };\r\n" +
- " int[] a4 = {\r\n" +
- "\r\n" +
- "\r\n" +
- " };\r\n" +
- " int[] a5 = {\r\n" +
- "\r\n" +
- "\r\n" +
- " };\r\n" +
- "\r\n" +
- " void f1() {\r\n" +
- " }\r\n" +
- "\r\n" +
- " void f2() {\r\n" +
- " }\r\n" +
- "\r\n" +
- " void f3() {\r\n" +
- "\r\n" +
- " }\r\n" +
- "\r\n" +
- " void f4() {\r\n" +
- "\r\n" +
- "\r\n" +
- " }\r\n" +
- "\r\n" +
- " void f5() {\r\n" +
- "\r\n" +
- "\r\n" +
- " }\r\n" +
+ "public class Snippet {\r\n" +
+ "\r\n" +
+ " int[] a1 = {};\r\n" +
+ " int[] a2 = {};\r\n" +
+ " int[] a3 = {\r\n" +
+ "\r\n" +
+ " };\r\n" +
+ " int[] a4 = {\r\n" +
+ "\r\n" +
+ "\r\n" +
+ " };\r\n" +
+ " int[] a5 = {\r\n" +
+ "\r\n" +
+ "\r\n" +
+ " };\r\n" +
+ "\r\n" +
+ " void f1() {\r\n" +
+ " }\r\n" +
+ "\r\n" +
+ " void f2() {\r\n" +
+ " }\r\n" +
+ "\r\n" +
+ " void f3() {\r\n" +
+ "\r\n" +
+ " }\r\n" +
+ "\r\n" +
+ " void f4() {\r\n" +
+ "\r\n" +
+ "\r\n" +
+ " }\r\n" +
+ "\r\n" +
+ " void f5() {\r\n" +
+ "\r\n" +
+ "\r\n" +
+ " }\r\n" +
"}"
);
}
@@ -11592,77 +11592,77 @@ public void testBug472815() {
public void testBug472815b() {
this.formatterPrefs.number_of_empty_lines_to_preserve = 2;
this.formatterPrefs.indent_empty_lines = true;
- String source =
- "public class Snippet {\r\n" +
- "\r\n" +
- " int[] a1 = { };\r\n" +
- " int[] a2 = {\r\n" +
- " };\r\n" +
- " int[] a3 = {\r\n" +
- "\r\n" +
- " };\r\n" +
- " int[] a4 = {\r\n" +
- "\r\n" +
- "\r\n" +
- " };\r\n" +
- " int[] a5 = {\r\n" +
- "\r\n" +
- "\r\n" +
- "\r\n" +
- " };\r\n" +
- "\r\n" +
- " void f1() { }\r\n" +
- " void f2() {\r\n" +
- " }\r\n" +
- " void f3() {\r\n" +
- "\r\n" +
- " }\r\n" +
- " void f4() {\r\n" +
- "\r\n" +
- "\r\n" +
- " }\r\n" +
- " void f5() {\r\n" +
- "\r\n" +
- "\r\n" +
- "\r\n" +
- " }\r\n" +
+ String source =
+ "public class Snippet {\r\n" +
+ "\r\n" +
+ " int[] a1 = { };\r\n" +
+ " int[] a2 = {\r\n" +
+ " };\r\n" +
+ " int[] a3 = {\r\n" +
+ "\r\n" +
+ " };\r\n" +
+ " int[] a4 = {\r\n" +
+ "\r\n" +
+ "\r\n" +
+ " };\r\n" +
+ " int[] a5 = {\r\n" +
+ "\r\n" +
+ "\r\n" +
+ "\r\n" +
+ " };\r\n" +
+ "\r\n" +
+ " void f1() { }\r\n" +
+ " void f2() {\r\n" +
+ " }\r\n" +
+ " void f3() {\r\n" +
+ "\r\n" +
+ " }\r\n" +
+ " void f4() {\r\n" +
+ "\r\n" +
+ "\r\n" +
+ " }\r\n" +
+ " void f5() {\r\n" +
+ "\r\n" +
+ "\r\n" +
+ "\r\n" +
+ " }\r\n" +
"}";
formatSource(source,
- "public class Snippet {\r\n" +
- " \r\n" +
- " int[] a1 = {};\r\n" +
- " int[] a2 = {};\r\n" +
- " int[] a3 = {\r\n" +
- " \r\n" +
- " };\r\n" +
- " int[] a4 = {\r\n" +
- " \r\n" +
- " \r\n" +
- " };\r\n" +
- " int[] a5 = {\r\n" +
- " \r\n" +
- " \r\n" +
- " };\r\n" +
- " \r\n" +
- " void f1() {\r\n" +
- " }\r\n" +
- " \r\n" +
- " void f2() {\r\n" +
- " }\r\n" +
- " \r\n" +
- " void f3() {\r\n" +
- " \r\n" +
- " }\r\n" +
- " \r\n" +
- " void f4() {\r\n" +
- " \r\n" +
- " \r\n" +
- " }\r\n" +
- " \r\n" +
- " void f5() {\r\n" +
- " \r\n" +
- " \r\n" +
- " }\r\n" +
+ "public class Snippet {\r\n" +
+ " \r\n" +
+ " int[] a1 = {};\r\n" +
+ " int[] a2 = {};\r\n" +
+ " int[] a3 = {\r\n" +
+ " \r\n" +
+ " };\r\n" +
+ " int[] a4 = {\r\n" +
+ " \r\n" +
+ " \r\n" +
+ " };\r\n" +
+ " int[] a5 = {\r\n" +
+ " \r\n" +
+ " \r\n" +
+ " };\r\n" +
+ " \r\n" +
+ " void f1() {\r\n" +
+ " }\r\n" +
+ " \r\n" +
+ " void f2() {\r\n" +
+ " }\r\n" +
+ " \r\n" +
+ " void f3() {\r\n" +
+ " \r\n" +
+ " }\r\n" +
+ " \r\n" +
+ " void f4() {\r\n" +
+ " \r\n" +
+ " \r\n" +
+ " }\r\n" +
+ " \r\n" +
+ " void f5() {\r\n" +
+ " \r\n" +
+ " \r\n" +
+ " }\r\n" +
"}"
);
}
@@ -11670,99 +11670,99 @@ public void testBug472815b() {
* https://bugs.eclipse.org/472413 - [formatter] Wrap all arguments on new lines and prefer outer expressions result is inconsistent
*/
public void testBug472413() {
- this.formatterPrefs.alignment_for_arguments_in_method_invocation =
+ this.formatterPrefs.alignment_for_arguments_in_method_invocation =
DefaultCodeFormatterOptions.Alignment.M_ONE_PER_LINE_SPLIT
+ DefaultCodeFormatterOptions.Alignment.M_INDENT_BY_ONE;
this.formatterPrefs.page_width = 80;
- String source =
- "class Snippet {\r\n" +
- "\r\n" +
- " void foo1() {\r\n" +
- " Other.bar(\r\n" +
- " 100,\r\n" +
- " nestedMethod2Arg(\r\n" +
- " nestedMethod1Arg(\r\n" +
- " nestedMethod2Arg(nestedMethod1Arg(nestedMethod2Arg(\r\n" +
- " nestedMethod1Arg(nestedMethod1Arg(nestedMethod1Arg(\r\n" +
- " nested(200, 300, 400, 500, 600, 700, 800, 900)))),\r\n" +
- " null)), null)),\r\n" +
- " null),\r\n" +
- " 100);\r\n" +
- " }\r\n" +
- "\r\n" +
- " void foo2() {\r\n" +
- " nestedMethodAAAA(\r\n" +
- " nestedMethodBBBB(\r\n" +
- " nestedMethodCCC(dddddd(200, 300, 400, 500, 600, 700, 800, 900)),\r\n" +
- " null));\r\n" +
- " nestedMethodAAAA(nestedMethodBBBB(\r\n" +
- " nestedMethodCCC(dddddd(200, 300, 400, 500, 600, 700, 800, 900)),\r\n" +
- " null));\r\n" +
- " }\r\n" +
- "\r\n" +
- " void foo3() {\r\n" +
- " nestedMethodAAAA(\r\n" +
- " nestedMethodBBBB(\r\n" +
- " nestedMethodCCC(dddddd(200, 300, 400, 500, 600, 700, 800, 900)),\r\n" +
- " null),\r\n" +
- " null);\r\n" +
- " nestedMethodAAAA(nestedMethodBBBB(\r\n" +
- " nestedMethodCCC(dddddd(200, 300, 400, 500, 600, 700, 800, 900)),\r\n" +
- " null), null);\r\n" +
- " }\r\n" +
+ String source =
+ "class Snippet {\r\n" +
+ "\r\n" +
+ " void foo1() {\r\n" +
+ " Other.bar(\r\n" +
+ " 100,\r\n" +
+ " nestedMethod2Arg(\r\n" +
+ " nestedMethod1Arg(\r\n" +
+ " nestedMethod2Arg(nestedMethod1Arg(nestedMethod2Arg(\r\n" +
+ " nestedMethod1Arg(nestedMethod1Arg(nestedMethod1Arg(\r\n" +
+ " nested(200, 300, 400, 500, 600, 700, 800, 900)))),\r\n" +
+ " null)), null)),\r\n" +
+ " null),\r\n" +
+ " 100);\r\n" +
+ " }\r\n" +
+ "\r\n" +
+ " void foo2() {\r\n" +
+ " nestedMethodAAAA(\r\n" +
+ " nestedMethodBBBB(\r\n" +
+ " nestedMethodCCC(dddddd(200, 300, 400, 500, 600, 700, 800, 900)),\r\n" +
+ " null));\r\n" +
+ " nestedMethodAAAA(nestedMethodBBBB(\r\n" +
+ " nestedMethodCCC(dddddd(200, 300, 400, 500, 600, 700, 800, 900)),\r\n" +
+ " null));\r\n" +
+ " }\r\n" +
+ "\r\n" +
+ " void foo3() {\r\n" +
+ " nestedMethodAAAA(\r\n" +
+ " nestedMethodBBBB(\r\n" +
+ " nestedMethodCCC(dddddd(200, 300, 400, 500, 600, 700, 800, 900)),\r\n" +
+ " null),\r\n" +
+ " null);\r\n" +
+ " nestedMethodAAAA(nestedMethodBBBB(\r\n" +
+ " nestedMethodCCC(dddddd(200, 300, 400, 500, 600, 700, 800, 900)),\r\n" +
+ " null), null);\r\n" +
+ " }\r\n" +
"}";
formatSource(source,
- "class Snippet {\r\n" +
- "\r\n" +
- " void foo1() {\r\n" +
- " Other.bar(\r\n" +
- " 100,\r\n" +
- " nestedMethod2Arg(\r\n" +
- " nestedMethod1Arg(\r\n" +
- " nestedMethod2Arg(\r\n" +
- " nestedMethod1Arg(\r\n" +
- " nestedMethod2Arg(\r\n" +
- " nestedMethod1Arg(\r\n" +
- " nestedMethod1Arg(\r\n" +
- " nestedMethod1Arg(\r\n" +
- " nested(\r\n" +
- " 200,\r\n" +
- " 300,\r\n" +
- " 400,\r\n" +
- " 500,\r\n" +
- " 600,\r\n" +
- " 700,\r\n" +
- " 800,\r\n" +
- " 900)))),\r\n" +
- " null)),\r\n" +
- " null)),\r\n" +
- " null),\r\n" +
- " 100);\r\n" +
- " }\r\n" +
- "\r\n" +
- " void foo2() {\r\n" +
- " nestedMethodAAAA(\r\n" +
- " nestedMethodBBBB(\r\n" +
- " nestedMethodCCC(dddddd(200, 300, 400, 500, 600, 700, 800, 900)),\r\n" +
- " null));\r\n" +
- " nestedMethodAAAA(\r\n" +
- " nestedMethodBBBB(\r\n" +
- " nestedMethodCCC(dddddd(200, 300, 400, 500, 600, 700, 800, 900)),\r\n" +
- " null));\r\n" +
- " }\r\n" +
- "\r\n" +
- " void foo3() {\r\n" +
- " nestedMethodAAAA(\r\n" +
- " nestedMethodBBBB(\r\n" +
- " nestedMethodCCC(dddddd(200, 300, 400, 500, 600, 700, 800, 900)),\r\n" +
- " null),\r\n" +
- " null);\r\n" +
- " nestedMethodAAAA(\r\n" +
- " nestedMethodBBBB(\r\n" +
- " nestedMethodCCC(dddddd(200, 300, 400, 500, 600, 700, 800, 900)),\r\n" +
- " null),\r\n" +
- " null);\r\n" +
- " }\r\n" +
+ "class Snippet {\r\n" +
+ "\r\n" +
+ " void foo1() {\r\n" +
+ " Other.bar(\r\n" +
+ " 100,\r\n" +
+ " nestedMethod2Arg(\r\n" +
+ " nestedMethod1Arg(\r\n" +
+ " nestedMethod2Arg(\r\n" +
+ " nestedMethod1Arg(\r\n" +
+ " nestedMethod2Arg(\r\n" +
+ " nestedMethod1Arg(\r\n" +
+ " nestedMethod1Arg(\r\n" +
+ " nestedMethod1Arg(\r\n" +
+ " nested(\r\n" +
+ " 200,\r\n" +
+ " 300,\r\n" +
+ " 400,\r\n" +
+ " 500,\r\n" +
+ " 600,\r\n" +
+ " 700,\r\n" +
+ " 800,\r\n" +
+ " 900)))),\r\n" +
+ " null)),\r\n" +
+ " null)),\r\n" +
+ " null),\r\n" +
+ " 100);\r\n" +
+ " }\r\n" +
+ "\r\n" +
+ " void foo2() {\r\n" +
+ " nestedMethodAAAA(\r\n" +
+ " nestedMethodBBBB(\r\n" +
+ " nestedMethodCCC(dddddd(200, 300, 400, 500, 600, 700, 800, 900)),\r\n" +
+ " null));\r\n" +
+ " nestedMethodAAAA(\r\n" +
+ " nestedMethodBBBB(\r\n" +
+ " nestedMethodCCC(dddddd(200, 300, 400, 500, 600, 700, 800, 900)),\r\n" +
+ " null));\r\n" +
+ " }\r\n" +
+ "\r\n" +
+ " void foo3() {\r\n" +
+ " nestedMethodAAAA(\r\n" +
+ " nestedMethodBBBB(\r\n" +
+ " nestedMethodCCC(dddddd(200, 300, 400, 500, 600, 700, 800, 900)),\r\n" +
+ " null),\r\n" +
+ " null);\r\n" +
+ " nestedMethodAAAA(\r\n" +
+ " nestedMethodBBBB(\r\n" +
+ " nestedMethodCCC(dddddd(200, 300, 400, 500, 600, 700, 800, 900)),\r\n" +
+ " null),\r\n" +
+ " null);\r\n" +
+ " }\r\n" +
"}"
);
}
@@ -11772,16 +11772,16 @@ public void testBug472413() {
public void testBug475793() {
this.formatterPrefs.keep_lambda_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
String source =
- "public class C {\r\n" +
- " public void f() {\r\n" +
- " Foo.bar(() -> {} , IllegalArgumentException.class);\r\n" +
- " }\r\n" +
+ "public class C {\r\n" +
+ " public void f() {\r\n" +
+ " Foo.bar(() -> {} , IllegalArgumentException.class);\r\n" +
+ " }\r\n" +
"}";
formatSource(source,
- "public class C {\r\n" +
- " public void f() {\r\n" +
- " Foo.bar(() -> {}, IllegalArgumentException.class);\r\n" +
- " }\r\n" +
+ "public class C {\r\n" +
+ " public void f() {\r\n" +
+ " Foo.bar(() -> {}, IllegalArgumentException.class);\r\n" +
+ " }\r\n" +
"}"
);
}
@@ -11799,47 +11799,47 @@ public void testBug475746() {
this.formatterPrefs.insert_space_after_opening_paren_in_annotation = true;
this.formatterPrefs.insert_space_before_closing_paren_in_annotation = true;
String source =
- "import java.awt.*;\r\n" +
- "\r\n" +
- "public class MyClass {\r\n" +
- "\r\n" +
- " @Annotation( Arrays.asList( \"\" ))\r\n" +
- " static Point p = new Point( x, y) {\r\n" +
- " @Override\r\n" +
- " public int hashCode( ) {\r\n" +
- " return 42;\r\n" +
- " }\r\n" +
- " };\r\n" +
- "\r\n" +
- " MyClass( @Annotation( \"annotationVal\" ) String s)\r\n" +
- " {\r\n" +
- " Foo.bar( ( @Annotation( \"annotationVal\" ) int a) -> { } , IllegalArgumentException.class );\r\n" +
- " }\r\n" +
- "\r\n" +
- " public interface I {\r\n" +
- " void m(int a);\r\n" +
- " }\r\n" +
+ "import java.awt.*;\r\n" +
+ "\r\n" +
+ "public class MyClass {\r\n" +
+ "\r\n" +
+ " @Annotation( Arrays.asList( \"\" ))\r\n" +
+ " static Point p = new Point( x, y) {\r\n" +
+ " @Override\r\n" +
+ " public int hashCode( ) {\r\n" +
+ " return 42;\r\n" +
+ " }\r\n" +
+ " };\r\n" +
+ "\r\n" +
+ " MyClass( @Annotation( \"annotationVal\" ) String s)\r\n" +
+ " {\r\n" +
+ " Foo.bar( ( @Annotation( \"annotationVal\" ) int a) -> { } , IllegalArgumentException.class );\r\n" +
+ " }\r\n" +
+ "\r\n" +
+ " public interface I {\r\n" +
+ " void m(int a);\r\n" +
+ " }\r\n" +
"}";
formatSource(source,
- "import java.awt.*;\r\n" +
- "\r\n" +
- "public class MyClass {\r\n" +
- "\r\n" +
- " @Annotation( Arrays.asList( \"\" ) )\r\n" +
- " static Point p = new Point( x, y ) {\r\n" +
- " @Override\r\n" +
- " public int hashCode() {\r\n" +
- " return 42;\r\n" +
- " }\r\n" +
- " };\r\n" +
- "\r\n" +
- " MyClass( @Annotation( \"annotationVal\" ) String s ) {\r\n" +
- " Foo.bar( ( @Annotation( \"annotationVal\" ) int a ) -> {}, IllegalArgumentException.class );\r\n" +
- " }\r\n" +
- "\r\n" +
- " public interface I {\r\n" +
- " void m( int a );\r\n" +
- " }\r\n" +
+ "import java.awt.*;\r\n" +
+ "\r\n" +
+ "public class MyClass {\r\n" +
+ "\r\n" +
+ " @Annotation( Arrays.asList( \"\" ) )\r\n" +
+ " static Point p = new Point( x, y ) {\r\n" +
+ " @Override\r\n" +
+ " public int hashCode() {\r\n" +
+ " return 42;\r\n" +
+ " }\r\n" +
+ " };\r\n" +
+ "\r\n" +
+ " MyClass( @Annotation( \"annotationVal\" ) String s ) {\r\n" +
+ " Foo.bar( ( @Annotation( \"annotationVal\" ) int a ) -> {}, IllegalArgumentException.class );\r\n" +
+ " }\r\n" +
+ "\r\n" +
+ " public interface I {\r\n" +
+ " void m( int a );\r\n" +
+ " }\r\n" +
"}"
);
}
@@ -11850,11 +11850,11 @@ public void testBug477005() {
this.formatterPrefs.indent_empty_lines = true;
this.formatterPrefs.blank_lines_before_package = 2;
String source =
- "\r\n" +
- "\r\n" +
- "package test;\r\n" +
- "\r\n" +
- "public class MyClass {\r\n" +
+ "\r\n" +
+ "\r\n" +
+ "package test;\r\n" +
+ "\r\n" +
+ "public class MyClass {\r\n" +
"}";
formatSource(source);
}
@@ -11863,19 +11863,19 @@ public void testBug477005() {
*/
public void testBug471202() {
String source =
- "public @interface MyAnnotation {\r\n" +
- " Attributes attributes() default @Attributes()\r\n" +
- " ;\r\n" +
- "\r\n" +
- " @MyAnnotation(attributes = @Attributes() )\r\n" +
- " String test();\r\n" +
+ "public @interface MyAnnotation {\r\n" +
+ " Attributes attributes() default @Attributes()\r\n" +
+ " ;\r\n" +
+ "\r\n" +
+ " @MyAnnotation(attributes = @Attributes() )\r\n" +
+ " String test();\r\n" +
"}";
formatSource(source,
- "public @interface MyAnnotation {\r\n" +
- " Attributes attributes() default @Attributes();\r\n" +
- "\r\n" +
- " @MyAnnotation(attributes = @Attributes())\r\n" +
- " String test();\r\n" +
+ "public @interface MyAnnotation {\r\n" +
+ " Attributes attributes() default @Attributes();\r\n" +
+ "\r\n" +
+ " @MyAnnotation(attributes = @Attributes())\r\n" +
+ " String test();\r\n" +
"}"
);
}
@@ -11885,54 +11885,54 @@ public void testBug471202() {
public void testBug475791() {
this.formatterPrefs.blank_lines_before_new_chunk = 0;
String source =
- "public class Example {\r\n" +
- " static String staticField;\r\n" +
- " static {}\r\n" +
- " String field;\r\n" +
- " {}\r\n" +
- " static String staticField2;\r\n" +
- " {}\r\n" +
- " String field2;\r\n" +
- " static {}\r\n" +
- " static void staticMethod() {};\r\n" +
- " static {}\r\n" +
- " void method() {}\r\n" +
- " static{}\r\n" +
- " {}\r\n" +
- " static class staticClass {};\r\n" +
- " {}\r\n" +
- " static{}\r\n" +
+ "public class Example {\r\n" +
+ " static String staticField;\r\n" +
+ " static {}\r\n" +
+ " String field;\r\n" +
+ " {}\r\n" +
+ " static String staticField2;\r\n" +
+ " {}\r\n" +
+ " String field2;\r\n" +
+ " static {}\r\n" +
+ " static void staticMethod() {};\r\n" +
+ " static {}\r\n" +
+ " void method() {}\r\n" +
+ " static{}\r\n" +
+ " {}\r\n" +
+ " static class staticClass {};\r\n" +
+ " {}\r\n" +
+ " static{}\r\n" +
"}";
formatSource(source,
- "public class Example {\r\n" +
- " static String staticField;\r\n" +
- " static {\r\n" +
- " }\r\n" +
- " String field;\r\n" +
- " {\r\n" +
- " }\r\n" +
- " static String staticField2;\r\n" +
- " {\r\n" +
- " }\r\n" +
- " String field2;\r\n" +
- " static {\r\n" +
- " }\r\n" +
- " static void staticMethod() {\r\n" +
- " };\r\n" +
- " static {\r\n" +
- " }\r\n" +
- " void method() {\r\n" +
- " }\r\n" +
- " static {\r\n" +
- " }\r\n" +
- " {\r\n" +
- " }\r\n" +
- " static class staticClass {\r\n" +
- " };\r\n" +
- " {\r\n" +
- " }\r\n" +
- " static {\r\n" +
- " }\r\n" +
+ "public class Example {\r\n" +
+ " static String staticField;\r\n" +
+ " static {\r\n" +
+ " }\r\n" +
+ " String field;\r\n" +
+ " {\r\n" +
+ " }\r\n" +
+ " static String staticField2;\r\n" +
+ " {\r\n" +
+ " }\r\n" +
+ " String field2;\r\n" +
+ " static {\r\n" +
+ " }\r\n" +
+ " static void staticMethod() {\r\n" +
+ " };\r\n" +
+ " static {\r\n" +
+ " }\r\n" +
+ " void method() {\r\n" +
+ " }\r\n" +
+ " static {\r\n" +
+ " }\r\n" +
+ " {\r\n" +
+ " }\r\n" +
+ " static class staticClass {\r\n" +
+ " };\r\n" +
+ " {\r\n" +
+ " }\r\n" +
+ " static {\r\n" +
+ " }\r\n" +
"}"
);
}
@@ -11942,66 +11942,66 @@ public void testBug475791() {
public void testBug475791b() {
this.formatterPrefs.blank_lines_before_new_chunk = 2;
String source =
- "public class Example {\r\n" +
- " static String staticField;\r\n" +
- " static {}\r\n" +
- " String field;\r\n" +
- " {}\r\n" +
- " static String staticField2;\r\n" +
- " {}\r\n" +
- " String field2;\r\n" +
- " static {}\r\n" +
- " static void staticMethod() {};\r\n" +
- " static {}\r\n" +
- " void method() {}\r\n" +
- " static{}\r\n" +
- " {}\r\n" +
- " static class staticClass {};\r\n" +
- " {}\r\n" +
- " static{}\r\n" +
+ "public class Example {\r\n" +
+ " static String staticField;\r\n" +
+ " static {}\r\n" +
+ " String field;\r\n" +
+ " {}\r\n" +
+ " static String staticField2;\r\n" +
+ " {}\r\n" +
+ " String field2;\r\n" +
+ " static {}\r\n" +
+ " static void staticMethod() {};\r\n" +
+ " static {}\r\n" +
+ " void method() {}\r\n" +
+ " static{}\r\n" +
+ " {}\r\n" +
+ " static class staticClass {};\r\n" +
+ " {}\r\n" +
+ " static{}\r\n" +
"}";
formatSource(source,
- "public class Example {\r\n" +
- " static String staticField;\r\n" +
- " static {\r\n" +
- " }\r\n" +
- " String field;\r\n" +
- " {\r\n" +
- " }\r\n" +
- " static String staticField2;\r\n" +
- " {\r\n" +
- " }\r\n" +
- " String field2;\r\n" +
- " static {\r\n" +
- " }\r\n" +
- "\r\n" +
- "\r\n" +
- " static void staticMethod() {\r\n" +
- " };\r\n" +
- "\r\n" +
- "\r\n" +
- " static {\r\n" +
- " }\r\n" +
- "\r\n" +
- "\r\n" +
- " void method() {\r\n" +
- " }\r\n" +
- "\r\n" +
- "\r\n" +
- " static {\r\n" +
- " }\r\n" +
- " {\r\n" +
- " }\r\n" +
- "\r\n" +
- "\r\n" +
- " static class staticClass {\r\n" +
- " };\r\n" +
- "\r\n" +
- "\r\n" +
- " {\r\n" +
- " }\r\n" +
- " static {\r\n" +
- " }\r\n" +
+ "public class Example {\r\n" +
+ " static String staticField;\r\n" +
+ " static {\r\n" +
+ " }\r\n" +
+ " String field;\r\n" +
+ " {\r\n" +
+ " }\r\n" +
+ " static String staticField2;\r\n" +
+ " {\r\n" +
+ " }\r\n" +
+ " String field2;\r\n" +
+ " static {\r\n" +
+ " }\r\n" +
+ "\r\n" +
+ "\r\n" +
+ " static void staticMethod() {\r\n" +
+ " };\r\n" +
+ "\r\n" +
+ "\r\n" +
+ " static {\r\n" +
+ " }\r\n" +
+ "\r\n" +
+ "\r\n" +
+ " void method() {\r\n" +
+ " }\r\n" +
+ "\r\n" +
+ "\r\n" +
+ " static {\r\n" +
+ " }\r\n" +
+ " {\r\n" +
+ " }\r\n" +
+ "\r\n" +
+ "\r\n" +
+ " static class staticClass {\r\n" +
+ " };\r\n" +
+ "\r\n" +
+ "\r\n" +
+ " {\r\n" +
+ " }\r\n" +
+ " static {\r\n" +
+ " }\r\n" +
"}"
);
}
@@ -12009,24 +12009,24 @@ public void testBug475791b() {
* https://bugs.eclipse.org/477430 - [formatter] wrong indentation when nesting anonymous classes
*/
public void testBug477430() {
- this.formatterPrefs.alignment_for_arguments_in_method_invocation =
+ this.formatterPrefs.alignment_for_arguments_in_method_invocation =
DefaultCodeFormatterOptions.Alignment.M_ONE_PER_LINE_SPLIT
+ DefaultCodeFormatterOptions.Alignment.M_FORCE;
String source =
- "public class Example {\r\n" +
- " void foo() {\r\n" +
- " Object o = new AbstractRegistryConfiguration() {\r\n" +
- " public void configureRegistry() {\r\n" +
- " registerConfigAttribute(\r\n" +
- " new IExportFormatter() {\r\n" +
- " public Object formatForExport() {\r\n" +
- " return null;\r\n" +
- " }\r\n" +
- " },\r\n" +
- " null);\r\n" +
- " }\r\n" +
- " };\r\n" +
- " }\r\n" +
+ "public class Example {\r\n" +
+ " void foo() {\r\n" +
+ " Object o = new AbstractRegistryConfiguration() {\r\n" +
+ " public void configureRegistry() {\r\n" +
+ " registerConfigAttribute(\r\n" +
+ " new IExportFormatter() {\r\n" +
+ " public Object formatForExport() {\r\n" +
+ " return null;\r\n" +
+ " }\r\n" +
+ " },\r\n" +
+ " null);\r\n" +
+ " }\r\n" +
+ " };\r\n" +
+ " }\r\n" +
"}";
formatSource(source);
}
@@ -12036,13 +12036,13 @@ public void testBug477430() {
public void testBug480074() {
this.formatterPrefs.alignment_for_enum_constants = Alignment.M_NEXT_PER_LINE_SPLIT + Alignment.M_INDENT_ON_COLUMN;
String source =
- "public class Example {\n" +
- " private enum Something {\n" +
- " /** hello */\n" +
- " AAA,\n" +
- " /** hello */\n" +
- " BBB\n" +
- " }\n" +
+ "public class Example {\n" +
+ " private enum Something {\n" +
+ " /** hello */\n" +
+ " AAA,\n" +
+ " /** hello */\n" +
+ " BBB\n" +
+ " }\n" +
"}";
formatSource(source);
}
@@ -12053,87 +12053,87 @@ public void testBug479959() {
this.formatterPrefs.indent_empty_lines = true;
this.formatterPrefs.number_of_empty_lines_to_preserve = 2;
String source =
- "public class Example {\r\n" +
- " \r\n" +
- " \r\n" +
- " public boolean foo() {\r\n" +
- " \r\n" +
- " \r\n" +
- " if (foo())\r\n" +
- " \r\n" +
- " \r\n" +
- " return foo();\r\n" +
- " \r\n" +
- " \r\n" +
- " while (foo())\r\n" +
- " \r\n" +
- " \r\n" +
- " foo();\r\n" +
- " \r\n" +
- " \r\n" +
- " do\r\n" +
- " \r\n" +
- " \r\n" +
- " foo();\r\n" +
- " \r\n" +
- " \r\n" +
- " while (foo());\r\n" +
- " \r\n" +
- " \r\n" +
- " if (foo()) {\r\n" +
- " \r\n" +
- " \r\n" +
- " foo();\r\n" +
- " \r\n" +
- " \r\n" +
- " }\r\n" +
- " \r\n" +
- " \r\n" +
- " if (foo())\r\n" +
- " \r\n" +
- " \r\n" +
- " foo();\r\n" +
- " \r\n" +
- " \r\n" +
- " else\r\n" +
- " \r\n" +
- " \r\n" +
- " foo();\r\n" +
- " \r\n" +
- " \r\n" +
- " for (int i = 0; i < 5; i++)\r\n" +
- " \r\n" +
- " \r\n" +
- " foo();\r\n" +
- " \r\n" +
- " \r\n" +
- " switch (4) {\r\n" +
- " \r\n" +
- " \r\n" +
- " case 4:\r\n" +
- " \r\n" +
- " \r\n" +
- " foo();\r\n" +
- " break;\r\n" +
- " \r\n" +
- " \r\n" +
- " case 5: {\r\n" +
- " \r\n" +
- " \r\n" +
- " break;\r\n" +
- " }\r\n" +
- " \r\n" +
- " \r\n" +
- " case 6:\r\n" +
- " }\r\n" +
- " \r\n" +
- " \r\n" +
- " return false;\r\n" +
- " \r\n" +
- " \r\n" +
- " }\r\n" +
- " \r\n" +
- " \r\n" +
+ "public class Example {\r\n" +
+ " \r\n" +
+ " \r\n" +
+ " public boolean foo() {\r\n" +
+ " \r\n" +
+ " \r\n" +
+ " if (foo())\r\n" +
+ " \r\n" +
+ " \r\n" +
+ " return foo();\r\n" +
+ " \r\n" +
+ " \r\n" +
+ " while (foo())\r\n" +
+ " \r\n" +
+ " \r\n" +
+ " foo();\r\n" +
+ " \r\n" +
+ " \r\n" +
+ " do\r\n" +
+ " \r\n" +
+ " \r\n" +
+ " foo();\r\n" +
+ " \r\n" +
+ " \r\n" +
+ " while (foo());\r\n" +
+ " \r\n" +
+ " \r\n" +
+ " if (foo()) {\r\n" +
+ " \r\n" +
+ " \r\n" +
+ " foo();\r\n" +
+ " \r\n" +
+ " \r\n" +
+ " }\r\n" +
+ " \r\n" +
+ " \r\n" +
+ " if (foo())\r\n" +
+ " \r\n" +
+ " \r\n" +
+ " foo();\r\n" +
+ " \r\n" +
+ " \r\n" +
+ " else\r\n" +
+ " \r\n" +
+ " \r\n" +
+ " foo();\r\n" +
+ " \r\n" +
+ " \r\n" +
+ " for (int i = 0; i < 5; i++)\r\n" +
+ " \r\n" +
+ " \r\n" +
+ " foo();\r\n" +
+ " \r\n" +
+ " \r\n" +
+ " switch (4) {\r\n" +
+ " \r\n" +
+ " \r\n" +
+ " case 4:\r\n" +
+ " \r\n" +
+ " \r\n" +
+ " foo();\r\n" +
+ " break;\r\n" +
+ " \r\n" +
+ " \r\n" +
+ " case 5: {\r\n" +
+ " \r\n" +
+ " \r\n" +
+ " break;\r\n" +
+ " }\r\n" +
+ " \r\n" +
+ " \r\n" +
+ " case 6:\r\n" +
+ " }\r\n" +
+ " \r\n" +
+ " \r\n" +
+ " return false;\r\n" +
+ " \r\n" +
+ " \r\n" +
+ " }\r\n" +
+ " \r\n" +
+ " \r\n" +
"}";
formatSource(source);
}
@@ -12144,8 +12144,8 @@ public void testBug480086() {
this.formatterPrefs.insert_space_after_opening_angle_bracket_in_parameterized_type_reference = true;
this.formatterPrefs.insert_space_before_closing_angle_bracket_in_parameterized_type_reference = true;
String source =
- "public class Test {\r\n" +
- " private ArrayList< String > ss = new ArrayList<>();\r\n" +
+ "public class Test {\r\n" +
+ " private ArrayList< String > ss = new ArrayList<>();\r\n" +
"}";
formatSource(source);
}
@@ -12154,7 +12154,7 @@ public void testBug480086() {
*/
public void testBug480735() {
String source =
- "public enum Example implements Serializable, Cloneable {\r\n" +
+ "public enum Example implements Serializable, Cloneable {\r\n" +
"}";
formatSource(source);
}
@@ -12164,31 +12164,31 @@ public void testBug480735() {
public void testBug481221a() {
this.formatterPrefs.join_wrapped_lines = false;
String source =
- "public class Test {\r\n" +
- " public enum Enum0 {\r\n" +
- " }\r\n" +
- "\r\n" +
- " public enum Enum1 {\r\n" +
- " ;\r\n" +
- " }\r\n" +
- "\r\n" +
- " public enum Enum2 {\r\n" +
- " ,;\r\n" +
- " }\r\n" +
- "\r\n" +
- " public enum Enum3 {\r\n" +
- " ,\r\n" +
- " ;\r\n" +
- " }\r\n" +
- "\r\n" +
- " public enum Enum4 {\r\n" +
- " AAA,;\r\n" +
- " }\r\n" +
- "\r\n" +
- " public enum Enum5 {\r\n" +
- " AAA,\r\n" +
- " ;\r\n" +
- " }\r\n" +
+ "public class Test {\r\n" +
+ " public enum Enum0 {\r\n" +
+ " }\r\n" +
+ "\r\n" +
+ " public enum Enum1 {\r\n" +
+ " ;\r\n" +
+ " }\r\n" +
+ "\r\n" +
+ " public enum Enum2 {\r\n" +
+ " ,;\r\n" +
+ " }\r\n" +
+ "\r\n" +
+ " public enum Enum3 {\r\n" +
+ " ,\r\n" +
+ " ;\r\n" +
+ " }\r\n" +
+ "\r\n" +
+ " public enum Enum4 {\r\n" +
+ " AAA,;\r\n" +
+ " }\r\n" +
+ "\r\n" +
+ " public enum Enum5 {\r\n" +
+ " AAA,\r\n" +
+ " ;\r\n" +
+ " }\r\n" +
"}";
formatSource(source);
}
@@ -12199,16 +12199,16 @@ public void testBug481221b() {
this.formatterPrefs.join_wrapped_lines = false;
this.formatterPrefs.alignment_for_enum_constants = Alignment.M_COMPACT_SPLIT + Alignment.M_INDENT_ON_COLUMN;
String source =
- "public class Test {\r\n" +
- " public enum Enum1 {\r\n" +
- " ,\r\n" +
- " ;\r\n" +
- " }\r\n" +
- "\r\n" +
- " public enum Enum2 {\r\n" +
- " AAA,\r\n" +
- " ;\r\n" +
- " }\r\n" +
+ "public class Test {\r\n" +
+ " public enum Enum1 {\r\n" +
+ " ,\r\n" +
+ " ;\r\n" +
+ " }\r\n" +
+ "\r\n" +
+ " public enum Enum2 {\r\n" +
+ " AAA,\r\n" +
+ " ;\r\n" +
+ " }\r\n" +
"}";
formatSource(source);
}
@@ -12219,11 +12219,11 @@ public void testBug483922a() {
this.formatterPrefs.alignment_for_parameters_in_method_declaration = Alignment.M_COMPACT_FIRST_BREAK_SPLIT + Alignment.M_FORCE + Alignment.M_INDENT_ON_COLUMN;
this.formatterPrefs.alignment_for_throws_clause_in_method_declaration = Alignment.M_COMPACT_FIRST_BREAK_SPLIT + Alignment.M_FORCE;
String source =
- "public class Test {\r\n" +
- " public void foo(\r\n" +
- " int a, int b)\r\n" +
- " throws Exception {\r\n" +
- " }\r\n" +
+ "public class Test {\r\n" +
+ " public void foo(\r\n" +
+ " int a, int b)\r\n" +
+ " throws Exception {\r\n" +
+ " }\r\n" +
"}";
formatSource(source);
}
@@ -12234,11 +12234,11 @@ public void testBug483922b() {
this.formatterPrefs.alignment_for_parameters_in_constructor_declaration = Alignment.M_COMPACT_FIRST_BREAK_SPLIT + Alignment.M_FORCE + Alignment.M_INDENT_ON_COLUMN;
this.formatterPrefs.alignment_for_throws_clause_in_constructor_declaration = Alignment.M_COMPACT_FIRST_BREAK_SPLIT + Alignment.M_FORCE;
String source =
- "public class Test {\r\n" +
- " public Test(\r\n" +
- " int a, int b)\r\n" +
- " throws Exception {\r\n" +
- " }\r\n" +
+ "public class Test {\r\n" +
+ " public Test(\r\n" +
+ " int a, int b)\r\n" +
+ " throws Exception {\r\n" +
+ " }\r\n" +
"}";
formatSource(source);
}
@@ -12249,99 +12249,99 @@ public void testBug485163() {
this.formatterPrefs.indent_empty_lines = true;
this.formatterPrefs.blank_lines_before_field = 1;
String source =
- "public class Test {\r\n" +
- "\r\n" +
- " public String sssss1 = \".................................................\" + \"...........................................\";\r\n" +
- " public String sssss2 = \".................................................\" + \"...........................................\";\r\n" +
- "\r\n" +
- " public String sssss3 = \".................................................\" + \"...........................................\";\r\n" +
- "\r\n" +
- " public void foo() {\r\n" +
- "\r\n" +
- " String sssss = \".................................................\" + \"...........................................\";\r\n" +
- "\r\n" +
- " Object o =\r\n" +
- "\r\n" +
- " new Object() {\r\n" +
- "\r\n" +
- " int a;\r\n" +
- "\r\n" +
- " void foo() {\r\n" +
- "\r\n" +
- " String sssss1 = \".................................................\" + \"...........................................\";\r\n" +
- "\r\n" +
- " String sssss2 = \".................................................\" + \"...........................................\";\r\n" +
- "\r\n" +
- " }\r\n" +
- "\r\n" +
- " };\r\n" +
- "\r\n" +
- " new Object() {\r\n" +
- "\r\n" +
- " int a;\r\n" +
- "\r\n" +
- " void foo() {\r\n" +
- "\r\n" +
- " String sssss1 = \".................................................\" + \"...........................................\";\r\n" +
- "\r\n" +
- " String sssss2 = \".................................................\" + \"...........................................\";\r\n" +
- "\r\n" +
- " }\r\n" +
- "\r\n" +
- " };\r\n" +
- " }\r\n" +
+ "public class Test {\r\n" +
+ "\r\n" +
+ " public String sssss1 = \".................................................\" + \"...........................................\";\r\n" +
+ " public String sssss2 = \".................................................\" + \"...........................................\";\r\n" +
+ "\r\n" +
+ " public String sssss3 = \".................................................\" + \"...........................................\";\r\n" +
+ "\r\n" +
+ " public void foo() {\r\n" +
+ "\r\n" +
+ " String sssss = \".................................................\" + \"...........................................\";\r\n" +
+ "\r\n" +
+ " Object o =\r\n" +
+ "\r\n" +
+ " new Object() {\r\n" +
+ "\r\n" +
+ " int a;\r\n" +
+ "\r\n" +
+ " void foo() {\r\n" +
+ "\r\n" +
+ " String sssss1 = \".................................................\" + \"...........................................\";\r\n" +
+ "\r\n" +
+ " String sssss2 = \".................................................\" + \"...........................................\";\r\n" +
+ "\r\n" +
+ " }\r\n" +
+ "\r\n" +
+ " };\r\n" +
+ "\r\n" +
+ " new Object() {\r\n" +
+ "\r\n" +
+ " int a;\r\n" +
+ "\r\n" +
+ " void foo() {\r\n" +
+ "\r\n" +
+ " String sssss1 = \".................................................\" + \"...........................................\";\r\n" +
+ "\r\n" +
+ " String sssss2 = \".................................................\" + \"...........................................\";\r\n" +
+ "\r\n" +
+ " }\r\n" +
+ "\r\n" +
+ " };\r\n" +
+ " }\r\n" +
"}";
formatSource(source,
- "public class Test {\r\n" +
- " \r\n" +
- " public String sssss1 = \".................................................\"\r\n" +
- " + \"...........................................\";\r\n" +
- " \r\n" +
- " public String sssss2 = \".................................................\"\r\n" +
- " + \"...........................................\";\r\n" +
- " \r\n" +
- " public String sssss3 = \".................................................\"\r\n" +
- " + \"...........................................\";\r\n" +
- " \r\n" +
- " public void foo() {\r\n" +
- " \r\n" +
- " String sssss = \".................................................\"\r\n" +
- " + \"...........................................\";\r\n" +
- " \r\n" +
- " Object o =\r\n" +
- " \r\n" +
- " new Object() {\r\n" +
- " \r\n" +
- " int a;\r\n" +
- " \r\n" +
- " void foo() {\r\n" +
- " \r\n" +
- " String sssss1 = \".................................................\"\r\n" +
- " + \"...........................................\";\r\n" +
- " \r\n" +
- " String sssss2 = \".................................................\"\r\n" +
- " + \"...........................................\";\r\n" +
- " \r\n" +
- " }\r\n" +
- " \r\n" +
- " };\r\n" +
- " \r\n" +
- " new Object() {\r\n" +
- " \r\n" +
- " int a;\r\n" +
- " \r\n" +
- " void foo() {\r\n" +
- " \r\n" +
- " String sssss1 = \".................................................\"\r\n" +
- " + \"...........................................\";\r\n" +
- " \r\n" +
- " String sssss2 = \".................................................\"\r\n" +
- " + \"...........................................\";\r\n" +
- " \r\n" +
- " }\r\n" +
- " \r\n" +
- " };\r\n" +
- " }\r\n" +
+ "public class Test {\r\n" +
+ " \r\n" +
+ " public String sssss1 = \".................................................\"\r\n" +
+ " + \"...........................................\";\r\n" +
+ " \r\n" +
+ " public String sssss2 = \".................................................\"\r\n" +
+ " + \"...........................................\";\r\n" +
+ " \r\n" +
+ " public String sssss3 = \".................................................\"\r\n" +
+ " + \"...........................................\";\r\n" +
+ " \r\n" +
+ " public void foo() {\r\n" +
+ " \r\n" +
+ " String sssss = \".................................................\"\r\n" +
+ " + \"...........................................\";\r\n" +
+ " \r\n" +
+ " Object o =\r\n" +
+ " \r\n" +
+ " new Object() {\r\n" +
+ " \r\n" +
+ " int a;\r\n" +
+ " \r\n" +
+ " void foo() {\r\n" +
+ " \r\n" +
+ " String sssss1 = \".................................................\"\r\n" +
+ " + \"...........................................\";\r\n" +
+ " \r\n" +
+ " String sssss2 = \".................................................\"\r\n" +
+ " + \"...........................................\";\r\n" +
+ " \r\n" +
+ " }\r\n" +
+ " \r\n" +
+ " };\r\n" +
+ " \r\n" +
+ " new Object() {\r\n" +
+ " \r\n" +
+ " int a;\r\n" +
+ " \r\n" +
+ " void foo() {\r\n" +
+ " \r\n" +
+ " String sssss1 = \".................................................\"\r\n" +
+ " + \"...........................................\";\r\n" +
+ " \r\n" +
+ " String sssss2 = \".................................................\"\r\n" +
+ " + \"...........................................\";\r\n" +
+ " \r\n" +
+ " }\r\n" +
+ " \r\n" +
+ " };\r\n" +
+ " }\r\n" +
"}"
);
}
@@ -12351,13 +12351,13 @@ public void testBug485163() {
public void testBug479898() {
this.formatterPrefs.alignment_for_union_type_in_multicatch = Alignment.M_COMPACT_SPLIT + Alignment.M_INDENT_ON_COLUMN;
String source =
- "public class FormattingTest {\r\n" +
- " public void formatterTest() {\r\n" +
- " try {\r\n" +
- " } catch (final InstantiationException | IllegalAccessException | IllegalArgumentException\r\n" +
- " | NoSuchMethodException e) {\r\n" +
- " }\r\n" +
- " }\r\n" +
+ "public class FormattingTest {\r\n" +
+ " public void formatterTest() {\r\n" +
+ " try {\r\n" +
+ " } catch (final InstantiationException | IllegalAccessException | IllegalArgumentException\r\n" +
+ " | NoSuchMethodException e) {\r\n" +
+ " }\r\n" +
+ " }\r\n" +
"}";
formatSource(source);
}
@@ -12368,18 +12368,18 @@ public void testBug485276() {
this.formatterPrefs.use_tabs_only_for_leading_indentations = true;
this.formatterPrefs.alignment_for_expressions_in_array_initializer = Alignment.M_COMPACT_SPLIT + Alignment.M_INDENT_BY_ONE;
String source =
- "public class PostSaveListenerCleanUpExceptionTest {\r\n" +
- " public Object[][] dataProvider() {\r\n" +
- " return new Object[][] { { new String() // comment 1\r\n" +
- " }, { new String() } };\r\n" +
- " }\r\n" +
- "\r\n" +
- " Object o = new Object() {\r\n" +
- " public Object[][] dataProvider() {\r\n" +
- " return new Object[][] { { new String() // comment 1\r\n" +
- " }, { new String() } };\r\n" +
- " }\r\n" +
- " };\r\n" +
+ "public class PostSaveListenerCleanUpExceptionTest {\r\n" +
+ " public Object[][] dataProvider() {\r\n" +
+ " return new Object[][] { { new String() // comment 1\r\n" +
+ " }, { new String() } };\r\n" +
+ " }\r\n" +
+ "\r\n" +
+ " Object o = new Object() {\r\n" +
+ " public Object[][] dataProvider() {\r\n" +
+ " return new Object[][] { { new String() // comment 1\r\n" +
+ " }, { new String() } };\r\n" +
+ " }\r\n" +
+ " };\r\n" +
"}";
formatSource(source);
}
@@ -12388,9 +12388,9 @@ public void testBug485276() {
*/
public void testBug487375() {
String source =
- "public class Test {\r\n" +
- " /* public */ void foo() {\r\n" +
- " }\r\n" +
+ "public class Test {\r\n" +
+ " /* public */ void foo() {\r\n" +
+ " }\r\n" +
"}";
formatSource(source);
}
@@ -12400,22 +12400,22 @@ public void testBug487375() {
public void testBug489797a() {
this.formatterPrefs.indent_empty_lines = true;
String source =
- "public class Example {\r\n" +
- " public void foo() {\r\n" +
- " if (true)\r\n" +
- " return;\r\n" +
- "[##]\r\n" +
- " return;\r\n" +
- " }\r\n" +
+ "public class Example {\r\n" +
+ " public void foo() {\r\n" +
+ " if (true)\r\n" +
+ " return;\r\n" +
+ "[##]\r\n" +
+ " return;\r\n" +
+ " }\r\n" +
"}";
formatSource(source,
- "public class Example {\r\n" +
- " public void foo() {\r\n" +
- " if (true)\r\n" +
- " return;\r\n" +
- " \r\n" +
- " return;\r\n" +
- " }\r\n" +
+ "public class Example {\r\n" +
+ " public void foo() {\r\n" +
+ " if (true)\r\n" +
+ " return;\r\n" +
+ " \r\n" +
+ " return;\r\n" +
+ " }\r\n" +
"}"
);
}
@@ -12425,22 +12425,22 @@ public void testBug489797a() {
public void testBug489797b() {
this.formatterPrefs.indent_empty_lines = true;
String source =
- "public class Example {\r\n" +
- " public void foo() {\r\n" +
- " if (true)\r\n" +
- " return;\r\n" +
- "[# #]\r\n" +
- " return;\r\n" +
- " }\r\n" +
+ "public class Example {\r\n" +
+ " public void foo() {\r\n" +
+ " if (true)\r\n" +
+ " return;\r\n" +
+ "[# #]\r\n" +
+ " return;\r\n" +
+ " }\r\n" +
"}";
formatSource(source,
- "public class Example {\r\n" +
- " public void foo() {\r\n" +
- " if (true)\r\n" +
- " return;\r\n" +
- " \r\n" +
- " return;\r\n" +
- " }\r\n" +
+ "public class Example {\r\n" +
+ " public void foo() {\r\n" +
+ " if (true)\r\n" +
+ " return;\r\n" +
+ " \r\n" +
+ " return;\r\n" +
+ " }\r\n" +
"}"
);
}
@@ -12451,24 +12451,24 @@ public void testBug489797c() {
this.formatterPrefs.indent_empty_lines = true;
this.formatterPrefs.number_of_empty_lines_to_preserve = 5;
String source =
- "public class Example {\r\n" +
- " public void foo() {\r\n" +
- " if (true)\r\n" +
- " return;\r\n" +
- "[#\r\n" +
- "#]\r\n" +
- " return;\r\n" +
- " }\r\n" +
+ "public class Example {\r\n" +
+ " public void foo() {\r\n" +
+ " if (true)\r\n" +
+ " return;\r\n" +
+ "[#\r\n" +
+ "#]\r\n" +
+ " return;\r\n" +
+ " }\r\n" +
"}";
formatSource(source,
- "public class Example {\r\n" +
- " public void foo() {\r\n" +
- " if (true)\r\n" +
- " return;\r\n" +
- " \r\n" +
- " \r\n" +
- " return;\r\n" +
- " }\r\n" +
+ "public class Example {\r\n" +
+ " public void foo() {\r\n" +
+ " if (true)\r\n" +
+ " return;\r\n" +
+ " \r\n" +
+ " \r\n" +
+ " return;\r\n" +
+ " }\r\n" +
"}"
);
}
@@ -12478,9 +12478,9 @@ public void testBug489797c() {
public void testBug488898() {
this.formatterPrefs.alignment_for_parameters_in_method_declaration = Alignment.M_NO_ALIGNMENT + Alignment.M_FORCE;
String source =
- "class Example {\r\n" +
- " void foo(int bar) {\r\n" +
- " }\r\n" +
+ "class Example {\r\n" +
+ " void foo(int bar) {\r\n" +
+ " }\r\n" +
"}";
formatSource(source);
}
@@ -12491,22 +12491,22 @@ public void testBug492735() {
this.formatterPrefs.alignment_for_assignment = Alignment.M_COMPACT_SPLIT;
this.formatterPrefs.page_width = 60;
String source =
- "class FormatterIssue {\r\n" +
- " String[] S = new String[] {\r\n" +
- " foo(\"first line xxxxxxxxxxx\", \"y\", \"z\"),\r\n" +
- " foo(\"second line xxxxxxxxxxxxxxxxxxx\", \"b\",\r\n" +
- " \"c\"), };\r\n" +
+ "class FormatterIssue {\r\n" +
+ " String[] S = new String[] {\r\n" +
+ " foo(\"first line xxxxxxxxxxx\", \"y\", \"z\"),\r\n" +
+ " foo(\"second line xxxxxxxxxxxxxxxxxxx\", \"b\",\r\n" +
+ " \"c\"), };\r\n" +
"}";
formatSource(source);
}
/**
- * https://bugs.eclipse.org/494831 - Formatter ignores whitespace rules for diamond operator
+ * https://bugs.eclipse.org/494831 - Formatter ignores whitespace rules for diamond operator
*/
public void testBug494831() {
this.formatterPrefs.insert_space_before_opening_angle_bracket_in_parameterized_type_reference = true;
String source =
- "class Example {\r\n" +
- " List <String> list = new ArrayList <>();\r\n" +
+ "class Example {\r\n" +
+ " List <String> list = new ArrayList <>();\r\n" +
"}";
formatSource(source);
}
@@ -12515,13 +12515,13 @@ public void testBug494831() {
*/
public void testBug497245a() {
String source =
- "public class Test {\r\n" +
- " void method() {\r\n" +
- " if (true)\r\n" +
- " // comment\r\n" +
- " if (false)\r\n" +
- " method();\r\n" +
- " }\r\n" +
+ "public class Test {\r\n" +
+ " void method() {\r\n" +
+ " if (true)\r\n" +
+ " // comment\r\n" +
+ " if (false)\r\n" +
+ " method();\r\n" +
+ " }\r\n" +
"}";
formatSource(source);
}
@@ -12531,12 +12531,12 @@ public void testBug497245a() {
public void testBug497245b() {
this.formatterPrefs.keep_then_statement_on_same_line = true;
String source =
- "public class Test {\r\n" +
- " void method() {\r\n" +
- " if (true)\r\n" +
- " // comment\r\n" +
- " if (false) method();\r\n" +
- " }\r\n" +
+ "public class Test {\r\n" +
+ " void method() {\r\n" +
+ " if (true)\r\n" +
+ " // comment\r\n" +
+ " if (false) method();\r\n" +
+ " }\r\n" +
"}";
formatSource(source);
}
@@ -12547,12 +12547,12 @@ public void testBug500443() {
this.formatterPrefs.alignment_for_enum_constants = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE;
this.formatterPrefs.alignment_for_superclass_in_type_declaration = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE;
String source =
- "public class SomeClass\n" +
- " /* */ extends\n" +
- " Object {\n" +
- " enum MyEnum {\n" +
- " /* 1 */ ONE\n" +
- " }\n" +
+ "public class SomeClass\n" +
+ " /* */ extends\n" +
+ " Object {\n" +
+ " enum MyEnum {\n" +
+ " /* 1 */ ONE\n" +
+ " }\n" +
"}";
formatSource(source);
}
@@ -12562,15 +12562,15 @@ public void testBug500443() {
public void testBug500092() {
this.formatterPrefs.blank_lines_at_beginning_of_method_body = 1;
String source =
- "public class Test {\n" +
- " public Test() { int a; }\n" +
+ "public class Test {\n" +
+ " public Test() { int a; }\n" +
"}";
formatSource(source,
- "public class Test {\n" +
- " public Test() {\n" +
- "\n" +
- " int a;\n" +
- " }\n" +
+ "public class Test {\n" +
+ " public Test() {\n" +
+ "\n" +
+ " int a;\n" +
+ " }\n" +
"}"
);
}
@@ -12580,10 +12580,10 @@ public void testBug500092() {
public void testBug500135() {
this.formatterPrefs.parenthesis_positions_in_annotation = DefaultCodeFormatterConstants.SEPARATE_LINES;
String source =
- "@SomeAnnotation(\n" +
- " \"some value\"\n" +
- ")\n" +
- "public class Test {\n" +
+ "@SomeAnnotation(\n" +
+ " \"some value\"\n" +
+ ")\n" +
+ "public class Test {\n" +
"}";
formatSource(source);
}
@@ -12593,11 +12593,11 @@ public void testBug500135() {
public void testBug500096a() {
this.formatterPrefs.indent_body_declarations_compare_to_enum_declaration_header = false;
String source =
- "public enum Test {\n" +
- "AAA, BBB;\n" +
- "\n" +
- "Test() {\n" +
- "}\n" +
+ "public enum Test {\n" +
+ "AAA, BBB;\n" +
+ "\n" +
+ "Test() {\n" +
+ "}\n" +
"}";
formatSource(source);
}
@@ -12608,11 +12608,11 @@ public void testBug500096b() {
this.formatterPrefs.indent_body_declarations_compare_to_enum_declaration_header = false;
this.formatterPrefs.alignment_for_enum_constants = Alignment.M_COMPACT_SPLIT + Alignment.M_INDENT_BY_ONE;
String source =
- "public enum Test {\n" +
- " AAA, BBB;\n" +
- "\n" +
- "Test() {\n" +
- "}\n" +
+ "public enum Test {\n" +
+ " AAA, BBB;\n" +
+ "\n" +
+ "Test() {\n" +
+ "}\n" +
"}";
formatSource(source);
}
@@ -12624,29 +12624,29 @@ public void testBug500093() {
this.formatterPrefs.page_width = 60;
this.formatterPrefs.use_tabs_only_for_leading_indentations = true;
String source =
- "public class SomeClass {\n" +
- " void foo() {\n" +
- " Arrays.asList(new String[] { \"ddd\", \"eee\", \"fff\" });\n" +
- " Arrays.asList(new String[] { \"a\", \"b\", \"c\" },\n" +
- " new String[]\n" +
- " { \"a\", \"b\", \"c\", });\n" +
- " Arrays.asList(//\n" +
- " new String[]\n" +
- " { \"ddd\", \"eee\", \"fff\" });\n" +
- " Arrays.asList(\n" +
- " new String[]\n" +
- " { \"eedd\", \"eee\", \"fff\" });\n" +
- " Arrays.asList(\n" +
- " new String[]\n" +
- " { \"aa\", \"bb\", \"cc\", \"dd\", \"ee\", \"ff\", \"gg\",\n" +
- " \"hh\", \"ii\" });\n" +
- " String[][] test = { { \"aaaaaa\", \"bbbbb\", \"ccccc\" },\n" +
- " { \"aaaa\", \"bb\", \"ccc\" } };\n" +
- " test[123456 //\n" +
- " * (234567 + 345678 + 456789 - 567890\n" +
- " - 678901)] = new String[]\n" +
- " { \"a\", \"b\", \"c\" };\n" +
- " }\n" +
+ "public class SomeClass {\n" +
+ " void foo() {\n" +
+ " Arrays.asList(new String[] { \"ddd\", \"eee\", \"fff\" });\n" +
+ " Arrays.asList(new String[] { \"a\", \"b\", \"c\" },\n" +
+ " new String[]\n" +
+ " { \"a\", \"b\", \"c\", });\n" +
+ " Arrays.asList(//\n" +
+ " new String[]\n" +
+ " { \"ddd\", \"eee\", \"fff\" });\n" +
+ " Arrays.asList(\n" +
+ " new String[]\n" +
+ " { \"eedd\", \"eee\", \"fff\" });\n" +
+ " Arrays.asList(\n" +
+ " new String[]\n" +
+ " { \"aa\", \"bb\", \"cc\", \"dd\", \"ee\", \"ff\", \"gg\",\n" +
+ " \"hh\", \"ii\" });\n" +
+ " String[][] test = { { \"aaaaaa\", \"bbbbb\", \"ccccc\" },\n" +
+ " { \"aaaa\", \"bb\", \"ccc\" } };\n" +
+ " test[123456 //\n" +
+ " * (234567 + 345678 + 456789 - 567890\n" +
+ " - 678901)] = new String[]\n" +
+ " { \"a\", \"b\", \"c\" };\n" +
+ " }\n" +
"}";
formatSource(source);
}
@@ -12656,9 +12656,9 @@ public void testBug500093() {
public void testBug500853() {
this.formatterPrefs.parenthesis_positions_in_method_declaration = new String(DefaultCodeFormatterConstants.PRESERVE_POSITIONS);
String source =
- "public class SomeClass {\n" +
- " void foo() {\n" +
- " }\n" +
+ "public class SomeClass {\n" +
+ " void foo() {\n" +
+ " }\n" +
"}";
formatSource(source);
}
@@ -12669,15 +12669,15 @@ public void testBug500853() {
public void testBug512791a() {
this.formatterPrefs.use_tabs_only_for_leading_indentations = true;
String source =
- "public class Test {\n" +
- "\n" +
- " void f() {\n" +
- " int a = 1 + 2 + 3 + 4;\n" +
- " f ( ;\n" +
- " }\n" +
- "\n" +
- " Object o = new Object() {\n" +
- " };\n" +
+ "public class Test {\n" +
+ "\n" +
+ " void f() {\n" +
+ " int a = 1 + 2 + 3 + 4;\n" +
+ " f ( ;\n" +
+ " }\n" +
+ "\n" +
+ " Object o = new Object() {\n" +
+ " };\n" +
"}";
formatSource(source);
}
@@ -12688,15 +12688,15 @@ public void testBug512791a() {
public void testBug512791b() {
this.formatterPrefs.use_tabs_only_for_leading_indentations = true;
String source =
- "public class Test {\n" +
- "\n" +
- " void f() {\n" +
- " f ( ;\n" +
- " }\n" +
- "\n" +
- " Object o = new Object() {\n" +
- " int a;\n" +
- " };\n" +
+ "public class Test {\n" +
+ "\n" +
+ " void f() {\n" +
+ " f ( ;\n" +
+ " }\n" +
+ "\n" +
+ " Object o = new Object() {\n" +
+ " int a;\n" +
+ " };\n" +
"}";
formatSource(source);
}
@@ -12708,11 +12708,11 @@ public void testBug514591a() {
this.formatterPrefs.never_indent_line_comments_on_first_column = true;
this.formatterPrefs.use_tabs_only_for_leading_indentations = true;
String source =
- "public class Test {\n" +
- "\n" +
- " String s = new StringBuilder()\n" +
- "// .append(\"aa\")\n" +
- " .toString();\n" +
+ "public class Test {\n" +
+ "\n" +
+ " String s = new StringBuilder()\n" +
+ "// .append(\"aa\")\n" +
+ " .toString();\n" +
"}";
formatSource(source);
}
@@ -12724,11 +12724,11 @@ public void testBug514591b() {
this.formatterPrefs.never_indent_block_comments_on_first_column = true;
this.formatterPrefs.use_tabs_only_for_leading_indentations = true;
String source =
- "public class Test {\n" +
- "\n" +
- " String s = new StringBuilder()\n" +
- "/* .append(\"aa\") */\n" +
- " .toString();\n" +
+ "public class Test {\n" +
+ "\n" +
+ " String s = new StringBuilder()\n" +
+ "/* .append(\"aa\") */\n" +
+ " .toString();\n" +
"}";
formatSource(source);
}
@@ -12740,11 +12740,11 @@ public void testBug525611() {
setPageWidth80();
this.formatterPrefs.alignment_for_selector_in_method_invocation = Alignment.M_ONE_PER_LINE_SPLIT;
String source =
- "class Test {\n" +
- " String s = aaaaaaa()\n" +
- " .bbbbbbbb()\n" +
- " .ccccccccc()\n" +
- " .ddddddddddddd(\"eeeeeeee\" + \"fffffff\");\n" +
+ "class Test {\n" +
+ " String s = aaaaaaa()\n" +
+ " .bbbbbbbb()\n" +
+ " .ccccccccc()\n" +
+ " .ddddddddddddd(\"eeeeeeee\" + \"fffffff\");\n" +
"}";
formatSource(source);
}
@@ -12755,10 +12755,10 @@ public void testBug525611() {
public void testBug526992a() {
this.formatterPrefs.never_indent_line_comments_on_first_column = true;
String source =
- "public class Test {\n" +
- " Object o = new Object[] { new Object() {\n" +
- "//\n" +
- " } };\n" +
+ "public class Test {\n" +
+ " Object o = new Object[] { new Object() {\n" +
+ "//\n" +
+ " } };\n" +
"}";
formatSource(source);
}
@@ -12769,10 +12769,10 @@ public void testBug526992a() {
public void testBug526992b() {
this.formatterPrefs.never_indent_block_comments_on_first_column = true;
String source =
- "public class Test {\n" +
- " Object o = new Object[] { new Object() {\n" +
- "/**/\n" +
- " } };\n" +
+ "public class Test {\n" +
+ " Object o = new Object[] { new Object() {\n" +
+ "/**/\n" +
+ " } };\n" +
"}";
formatSource(source);
}
@@ -12784,10 +12784,10 @@ public void testBug530066() {
this.formatterPrefs.alignment_for_assignment = Alignment.M_COMPACT_SPLIT;
this.formatterPrefs.wrap_before_assignment_operator = true;
String source =
- "class Test {\n" +
- " boolean someVariable\n" +
- " // comment\n" +
- " = true;\n" +
+ "class Test {\n" +
+ " boolean someVariable\n" +
+ " // comment\n" +
+ " = true;\n" +
"}";
formatSource(source);
}
@@ -12798,24 +12798,24 @@ public void testBug530066() {
public void testBug531981() {
this.formatterPrefs.comment_indent_parameter_description = true;
String source =
- "/**\n" +
- " * <code>a<code>\n" +
- " *\n" +
- " * @param b\n" +
- " * c\n" +
- " * d</code>\n" +
- " */\n" +
- "class Test {\n" +
+ "/**\n" +
+ " * <code>a<code>\n" +
+ " *\n" +
+ " * @param b\n" +
+ " * c\n" +
+ " * d</code>\n" +
+ " */\n" +
+ "class Test {\n" +
"}";
formatSource(source,
- "/**\n" +
- " * <code>a<code>\n" +
- " *\n" +
- " * &#64;param b\n" +
- " * c\n" +
- " * d</code>\n" +
- " */\n" +
- "class Test {\n" +
+ "/**\n" +
+ " * <code>a<code>\n" +
+ " *\n" +
+ " * &#64;param b\n" +
+ " * c\n" +
+ " * d</code>\n" +
+ " */\n" +
+ "class Test {\n" +
"}"
);
}
@@ -12827,9 +12827,9 @@ public void testBug373625a() {
this.formatterPrefs.align_type_members_on_columns = true;
this.formatterPrefs.comment_preserve_white_space_between_code_and_line_comments = true;
String source =
- "class C {\n" +
- " int a = 1; // comment1\n" +
- " String bb = null; // comment2\n" +
+ "class C {\n" +
+ " int a = 1; // comment1\n" +
+ " String bb = null; // comment2\n" +
"}";
formatSource(source);
}
@@ -12841,14 +12841,14 @@ public void testBug373625b() {
this.formatterPrefs.align_type_members_on_columns = true;
this.formatterPrefs.comment_preserve_white_space_between_code_and_line_comments = true;
String source =
- "class C {\n" +
- " int a = 1; /* comment1 */\n" +
- " String bb = \"\"; //$NON-NLS-1$\n" +
+ "class C {\n" +
+ " int a = 1; /* comment1 */\n" +
+ " String bb = \"\"; //$NON-NLS-1$\n" +
"}";
formatSource(source,
- "class C {\n" +
- " int a = 1; /* comment1 */\n" +
- " String bb = \"\"; //$NON-NLS-1$\n" +
+ "class C {\n" +
+ " int a = 1; /* comment1 */\n" +
+ " String bb = \"\"; //$NON-NLS-1$\n" +
"}"
);
}
@@ -12860,10 +12860,10 @@ public void testBug534225() {
this.formatterPrefs.comment_align_tags_descriptions_grouped = true;
this.formatterPrefs.comment_indent_parameter_description = true;
String source =
- "/**\n" +
- " * @param args a b c d e f\n" +
- " */\n" +
- "public class C {\n" +
+ "/**\n" +
+ " * @param args a b c d e f\n" +
+ " */\n" +
+ "public class C {\n" +
"}";
formatSource(source);
}
@@ -12875,13 +12875,13 @@ public void testBug534742() {
setPageWidth80();
this.formatterPrefs.comment_preserve_white_space_between_code_and_line_comments = true;
String source =
- "class C {\n" +
- " String ssssssssssss = fffffffffffffffff(\"aaaaaaaaaaaaaaaaa\", bbbbbbbbbbbbbbbbbb); //$NON-NLS-1$\n" +
+ "class C {\n" +
+ " String ssssssssssss = fffffffffffffffff(\"aaaaaaaaaaaaaaaaa\", bbbbbbbbbbbbbbbbbb); //$NON-NLS-1$\n" +
"}";
formatSource(source,
- "class C {\n" +
- " String ssssssssssss = fffffffffffffffff(\"aaaaaaaaaaaaaaaaa\", //$NON-NLS-1$\n" +
- " bbbbbbbbbbbbbbbbbb);\n" +
+ "class C {\n" +
+ " String ssssssssssss = fffffffffffffffff(\"aaaaaaaaaaaaaaaaa\", //$NON-NLS-1$\n" +
+ " bbbbbbbbbbbbbbbbbb);\n" +
"}"
);
}
@@ -12891,11 +12891,11 @@ public void testBug534742() {
*/
public void testBug536322() {
String source =
- "class C {\n" +
- " /** */\n" +
- " enum E {\n" +
- " enum1;\n" +
- " }\n" +
+ "class C {\n" +
+ " /** */\n" +
+ " enum E {\n" +
+ " enum1;\n" +
+ " }\n" +
"}";
formatSource(source);
}
@@ -12906,8 +12906,8 @@ public void testBug536552a() {
this.formatterPrefs.use_tabs_only_for_leading_indentations = true;
this.formatterPrefs.never_indent_line_comments_on_first_column = true;
String source =
- "// comment\n" +
- "class C {\n" +
+ "// comment\n" +
+ "class C {\n" +
"}";
formatSource(source);
}
@@ -12918,8 +12918,8 @@ public void testBug536552b() {
this.formatterPrefs.use_tabs_only_for_leading_indentations = true;
this.formatterPrefs.never_indent_block_comments_on_first_column = true;
String source =
- "/* comment */\n" +
- "class C {\n" +
+ "/* comment */\n" +
+ "class C {\n" +
"}";
formatSource(source);
}
@@ -12929,14 +12929,14 @@ public void testBug536552b() {
public void testBug542625() {
this.formatterPrefs.parenthesis_positions_in_if_while_statement = DefaultCodeFormatterConstants.PRESERVE_POSITIONS;
String source =
- "class C {\n" +
- " void m() {\n" +
- " //\n" +
- " //\n" +
- " if (\n" +
- " true)\n" +
- " ;\n" +
- " }\n" +
+ "class C {\n" +
+ " void m() {\n" +
+ " //\n" +
+ " //\n" +
+ " if (\n" +
+ " true)\n" +
+ " ;\n" +
+ " }\n" +
"}";
formatSource(source);
}
@@ -12949,15 +12949,15 @@ public void testBug543780() {
this.formatterPrefs.alignment_for_compact_if = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE;
this.formatterPrefs.use_tabs_only_for_leading_indentations = true;
String source =
- "class Example {\n" +
- " int foo(int argument) {\n" +
- " if (argument == 0)\n" +
- " return 0;\n" +
- " if (argument == 1)\n" +
- " return 42;\n" +
- " else\n" +
- " return 43;\n" +
- " }\n" +
+ "class Example {\n" +
+ " int foo(int argument) {\n" +
+ " if (argument == 0)\n" +
+ " return 0;\n" +
+ " if (argument == 1)\n" +
+ " return 42;\n" +
+ " else\n" +
+ " return 43;\n" +
+ " }\n" +
"}";
formatSource(source);
}
@@ -12969,20 +12969,20 @@ public void testBug413193a() {
this.formatterPrefs.blank_lines_after_last_class_body_declaration = 3;
this.formatterPrefs.blank_lines_before_new_chunk = 4;
formatSource(
- "public enum TestEnum {\n" +
- "\n" +
- "\n" +
- " ONE, TWO, THREE;\n" +
- "\n" +
- "\n" +
- "\n" +
- "\n" +
- " public int foo() {\n" +
- " return 0;\n" +
- " }\n" +
- "\n" +
- "\n" +
- "\n" +
+ "public enum TestEnum {\n" +
+ "\n" +
+ "\n" +
+ " ONE, TWO, THREE;\n" +
+ "\n" +
+ "\n" +
+ "\n" +
+ "\n" +
+ " public int foo() {\n" +
+ " return 0;\n" +
+ " }\n" +
+ "\n" +
+ "\n" +
+ "\n" +
"}");
}
/**
@@ -12993,8 +12993,8 @@ public void testBug413193b() {
this.formatterPrefs.blank_lines_after_last_class_body_declaration = 3;
this.formatterPrefs.blank_lines_before_new_chunk = 4;
formatSource(
- "public enum TestEnum {\n" +
- " ONE, TWO, THREE;\n" +
+ "public enum TestEnum {\n" +
+ " ONE, TWO, THREE;\n" +
"}");
}
/**
@@ -13005,21 +13005,21 @@ public void testBug413193c() {
this.formatterPrefs.blank_lines_after_last_class_body_declaration = ~0;
this.formatterPrefs.blank_lines_before_new_chunk = ~0;
String source =
- "public enum TestEnum {\n" +
- "\n" +
- " ONE, TWO, THREE;\n" +
- "\n" +
- " public int foo() {\n" +
- " return 0;\n" +
- " }\n" +
- "\n" +
+ "public enum TestEnum {\n" +
+ "\n" +
+ " ONE, TWO, THREE;\n" +
+ "\n" +
+ " public int foo() {\n" +
+ " return 0;\n" +
+ " }\n" +
+ "\n" +
"}";
formatSource(source,
- "public enum TestEnum {\n" +
- " ONE, TWO, THREE;\n" +
- " public int foo() {\n" +
- " return 0;\n" +
- " }\n" +
+ "public enum TestEnum {\n" +
+ " ONE, TWO, THREE;\n" +
+ " public int foo() {\n" +
+ " return 0;\n" +
+ " }\n" +
"}");
}
/**
@@ -13027,13 +13027,13 @@ public void testBug413193c() {
*/
public void testBug551189() {
formatSource(
- "public class AAA {\n" +
- "\n" +
- "import java.awt.*;\n" +
- "\n" +
- "public class BBB {\n" +
- " int a;\n" +
- "\n" +
+ "public class AAA {\n" +
+ "\n" +
+ "import java.awt.*;\n" +
+ "\n" +
+ "public class BBB {\n" +
+ " int a;\n" +
+ "\n" +
"}}");
}
/**
@@ -13044,15 +13044,15 @@ public void testBug220713() {
this.formatterPrefs.alignment_for_expressions_in_array_initializer = Alignment.M_NEXT_SHIFTED_SPLIT | Alignment.M_INDENT_ON_COLUMN | Alignment.M_FORCE;
this.formatterPrefs.insert_new_line_before_closing_brace_in_array_initializer = true;
formatSource(
- "public class A {\n" +
- " void f() {\n" +
- " methodWithArrays( new Object[] {\n" +
- " null,\n" +
- " },\n" +
- " new Object[] {\n" +
- " null,\n" +
- " });\n" +
- " }\n" +
+ "public class A {\n" +
+ " void f() {\n" +
+ " methodWithArrays( new Object[] {\n" +
+ " null,\n" +
+ " },\n" +
+ " new Object[] {\n" +
+ " null,\n" +
+ " });\n" +
+ " }\n" +
"}");
}
/**
@@ -13061,8 +13061,8 @@ public void testBug220713() {
public void testBug() {
this.formatterPrefs.blank_lines_after_last_class_body_declaration = 1;
String source =
- "public int getA() {\n" +
- " return a;\n" +
+ "public int getA() {\n" +
+ " return a;\n" +
"}";
formatSource(source, source, CodeFormatter.K_CLASS_BODY_DECLARATIONS);
}
@@ -13072,17 +13072,17 @@ public void testBug() {
public void testBug250656() {
this.formatterPrefs.page_width = 50;
formatSource(
- "class C {\n" +
- " void f() {\n" +
- " doSomething(aaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbb\n" +
- "[# + ccccccccccccccccccc);#]\n" +
- " }\n" +
+ "class C {\n" +
+ " void f() {\n" +
+ " doSomething(aaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbb\n" +
+ "[# + ccccccccccccccccccc);#]\n" +
+ " }\n" +
"}",
- "class C {\n" +
- " void f() {\n" +
- " doSomething(aaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbb\n" +
- " + ccccccccccccccccccc);\n" +
- " }\n" +
+ "class C {\n" +
+ " void f() {\n" +
+ " doSomething(aaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbb\n" +
+ " + ccccccccccccccccccc);\n" +
+ " }\n" +
"}");
}
/**
@@ -13091,19 +13091,19 @@ public void testBug250656() {
public void testBug559006() {
this.formatterPrefs.page_width = 50;
formatSource(
- "class C {\n" +
- " void f() {\n" +
- " doSomething(aaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbb,\n" +
- " + ccccccccccccccccccc);\n" +
- "[# doSomethingElse();#]\n" +
- " }\n" +
+ "class C {\n" +
+ " void f() {\n" +
+ " doSomething(aaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbb,\n" +
+ " + ccccccccccccccccccc);\n" +
+ "[# doSomethingElse();#]\n" +
+ " }\n" +
"}",
- "class C {\n" +
- " void f() {\n" +
- " doSomething(aaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbb,\n" +
- " + ccccccccccccccccccc);\n" +
- " doSomethingElse();\n" +
- " }\n" +
+ "class C {\n" +
+ " void f() {\n" +
+ " doSomething(aaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbb,\n" +
+ " + ccccccccccccccccccc);\n" +
+ " doSomethingElse();\n" +
+ " }\n" +
"}");
}
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java
index 1c6de96d1..5180219cf 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java
@@ -56,69 +56,69 @@ IPath getOutputFolder() {
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=196308"
*/
public void testBug196308() throws JavaModelException {
- String source =
- "public class X {\n" +
- "\n" +
- " /**\n" +
- " * <pre>\n" +
- " * &at;MyAnnotation\n" +
- " * </pre>\n" +
- " */\n" +
+ String source =
+ "public class X {\n" +
+ "\n" +
+ " /**\n" +
+ " * <pre>\n" +
+ " * &at;MyAnnotation\n" +
+ " * </pre>\n" +
+ " */\n" +
"}\n";
formatSource(source,
- "public class X {\n" +
- "\n" +
- " /**\n" +
- " * <pre>\n" +
- " * &at;MyAnnotation\n" +
- " * </pre>\n" +
- " */\n" +
+ "public class X {\n" +
+ "\n" +
+ " /**\n" +
+ " * <pre>\n" +
+ " * &at;MyAnnotation\n" +
+ " * </pre>\n" +
+ " */\n" +
"}\n"
);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=204257
public void testBug196308b() throws JavaModelException {
- String source =
- "public class A\n" +
- "{\n" +
- " /**\n" +
- " * <pre>\n" +
- " * &#92;u\n" +
- " * </pre>\n" +
- " */\n" +
- " public void a()\n" +
- " {\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "public class A {\n" +
- " /**\n" +
- " * <pre>\n" +
- " * &#92;u\n" +
- " * </pre>\n" +
- " */\n" +
- " public void a() {\n" +
- " }\n" +
+ String source =
+ "public class A\n" +
+ "{\n" +
+ " /**\n" +
+ " * <pre>\n" +
+ " * &#92;u\n" +
+ " * </pre>\n" +
+ " */\n" +
+ " public void a()\n" +
+ " {\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "public class A {\n" +
+ " /**\n" +
+ " * <pre>\n" +
+ " * &#92;u\n" +
+ " * </pre>\n" +
+ " */\n" +
+ " public void a() {\n" +
+ " }\n" +
"}\n"
);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=238547
public void testBug196308c() throws JavaModelException {
- String source =
- "/**\n" +
- " * &#x01;&#x20;&#x21;&#x40;&#x41;&#233;\n" +
- " * <pre>&#x01;&#x20;&#x21;&#x40;&#x41;&#233;</pre>\n" +
- " */\n" +
+ String source =
+ "/**\n" +
+ " * &#x01;&#x20;&#x21;&#x40;&#x41;&#233;\n" +
+ " * <pre>&#x01;&#x20;&#x21;&#x40;&#x41;&#233;</pre>\n" +
+ " */\n" +
"public class TestClass {}\n";
formatSource(source,
- "/**\n" +
- " * &#x01;&#x20;&#x21;&#x40;&#x41;&#233;\n" +
- " * \n" +
- " * <pre>\n" +
- " * &#x01;&#x20;&#x21;&#x40;&#x41;&#233;\n" +
- " * </pre>\n" +
- " */\n" +
- "public class TestClass {\n" +
+ "/**\n" +
+ " * &#x01;&#x20;&#x21;&#x40;&#x41;&#233;\n" +
+ " * \n" +
+ " * <pre>\n" +
+ " * &#x01;&#x20;&#x21;&#x40;&#x41;&#233;\n" +
+ " * </pre>\n" +
+ " */\n" +
+ "public class TestClass {\n" +
"}\n"
);
}
@@ -132,18 +132,18 @@ public void testBug198963_Tabs01() {
this.formatterPrefs.comment_format_block_comment = false;
this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.TAB;
String source =
- "public class Test {\n" +
- "\n" +
- " int x = 0; /*\n" +
- " * XXXX\n" +
- " */\n" +
+ "public class Test {\n" +
+ "\n" +
+ " int x = 0; /*\n" +
+ " * XXXX\n" +
+ " */\n" +
"}";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " int x = 0; /*\n" +
- " * XXXX\n" +
- " */\n" +
+ "public class Test {\n" +
+ "\n" +
+ " int x = 0; /*\n" +
+ " * XXXX\n" +
+ " */\n" +
"}"
);
}
@@ -151,18 +151,18 @@ public void testBug198963_Tabs02() {
this.formatterPrefs.comment_format_block_comment = false;
this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.TAB;
String source =
- "public class Test {\n" +
- "\n" +
- " int x = 10; /*\n" +
- " * XXXX\n" +
- " */\n" +
+ "public class Test {\n" +
+ "\n" +
+ " int x = 10; /*\n" +
+ " * XXXX\n" +
+ " */\n" +
"}";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " int x = 10; /*\n" +
- " * XXXX\n" +
- " */\n" +
+ "public class Test {\n" +
+ "\n" +
+ " int x = 10; /*\n" +
+ " * XXXX\n" +
+ " */\n" +
"}"
);
}
@@ -170,18 +170,18 @@ public void testBug198963_Tabs03() {
this.formatterPrefs.comment_format_block_comment = false;
this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.TAB;
String source =
- "public class Test {\n" +
- "\n" +
- " int x = 100; /*\n" +
- " * XXXX\n" +
- " */\n" +
+ "public class Test {\n" +
+ "\n" +
+ " int x = 100; /*\n" +
+ " * XXXX\n" +
+ " */\n" +
"}";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " int x = 100; /*\n" +
- " * XXXX\n" +
- " */\n" +
+ "public class Test {\n" +
+ "\n" +
+ " int x = 100; /*\n" +
+ " * XXXX\n" +
+ " */\n" +
"}"
);
}
@@ -189,18 +189,18 @@ public void testBug198963_Tabs04() {
this.formatterPrefs.comment_format_block_comment = false;
this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.TAB;
String source =
- "public class Test {\n" +
- "\n" +
- " int x = 0; /*\n" +
- " * XXXX\n" +
- " */\n" +
+ "public class Test {\n" +
+ "\n" +
+ " int x = 0; /*\n" +
+ " * XXXX\n" +
+ " */\n" +
"}";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " int x = 0; /*\n" +
- " * XXXX\n" +
- " */\n" +
+ "public class Test {\n" +
+ "\n" +
+ " int x = 0; /*\n" +
+ " * XXXX\n" +
+ " */\n" +
"}"
);
}
@@ -208,20 +208,20 @@ public void testBug198963_Tabs05() {
this.formatterPrefs.comment_format_block_comment = false;
this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.TAB;
String source =
- "public class Test {\n" +
- "\n" +
- " /*\n" +
- " * XXXX\n" +
- " */\n" +
- " int x = 0;\n" +
+ "public class Test {\n" +
+ "\n" +
+ " /*\n" +
+ " * XXXX\n" +
+ " */\n" +
+ " int x = 0;\n" +
"}";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " /*\n" +
- " * XXXX\n" +
- " */\n" +
- " int x = 0;\n" +
+ "public class Test {\n" +
+ "\n" +
+ " /*\n" +
+ " * XXXX\n" +
+ " */\n" +
+ " int x = 0;\n" +
"}"
);
}
@@ -229,20 +229,20 @@ public void testBug198963_Tabs06() {
this.formatterPrefs.comment_format_block_comment = false;
this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.TAB;
String source =
- "public class Test {\n" +
- "\n" +
- " /*\n" +
- " * XXXX\n" +
- " */\n" +
- " int x = 0;\n" +
+ "public class Test {\n" +
+ "\n" +
+ " /*\n" +
+ " * XXXX\n" +
+ " */\n" +
+ " int x = 0;\n" +
"}";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " /*\n" +
- " * XXXX\n" +
- " */\n" +
- " int x = 0;\n" +
+ "public class Test {\n" +
+ "\n" +
+ " /*\n" +
+ " * XXXX\n" +
+ " */\n" +
+ " int x = 0;\n" +
"}"
);
}
@@ -250,18 +250,18 @@ public void testBug198963_Spaces01() {
this.formatterPrefs.comment_format_block_comment = false;
this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.SPACE;
String source =
- "public class Test {\n" +
- "\n" +
- " int x = 0; /*\n" +
- " * XXXX\n" +
- " */\n" +
+ "public class Test {\n" +
+ "\n" +
+ " int x = 0; /*\n" +
+ " * XXXX\n" +
+ " */\n" +
"}";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " int x = 0; /*\n" +
- " * XXXX\n" +
- " */\n" +
+ "public class Test {\n" +
+ "\n" +
+ " int x = 0; /*\n" +
+ " * XXXX\n" +
+ " */\n" +
"}"
);
}
@@ -269,18 +269,18 @@ public void testBug198963_Spaces02() {
this.formatterPrefs.comment_format_block_comment = false;
this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.SPACE;
String source =
- "public class Test {\n" +
- "\n" +
- " int x = 10; /*\n" +
- " * XXXX\n" +
- " */\n" +
+ "public class Test {\n" +
+ "\n" +
+ " int x = 10; /*\n" +
+ " * XXXX\n" +
+ " */\n" +
"}";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " int x = 10; /*\n" +
- " * XXXX\n" +
- " */\n" +
+ "public class Test {\n" +
+ "\n" +
+ " int x = 10; /*\n" +
+ " * XXXX\n" +
+ " */\n" +
"}"
);
}
@@ -288,18 +288,18 @@ public void testBug198963_Spaces03() {
this.formatterPrefs.comment_format_block_comment = false;
this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.SPACE;
String source =
- "public class Test {\n" +
- "\n" +
- " int x = 100; /*\n" +
- " * XXXX\n" +
- " */\n" +
+ "public class Test {\n" +
+ "\n" +
+ " int x = 100; /*\n" +
+ " * XXXX\n" +
+ " */\n" +
"}";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " int x = 100; /*\n" +
- " * XXXX\n" +
- " */\n" +
+ "public class Test {\n" +
+ "\n" +
+ " int x = 100; /*\n" +
+ " * XXXX\n" +
+ " */\n" +
"}"
);
}
@@ -307,18 +307,18 @@ public void testBug198963_Spaces04() {
this.formatterPrefs.comment_format_block_comment = false;
this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.SPACE;
String source =
- "public class Test {\n" +
- "\n" +
- " int x = 0; /*\n" +
- " * XXXX\n" +
- " */\n" +
+ "public class Test {\n" +
+ "\n" +
+ " int x = 0; /*\n" +
+ " * XXXX\n" +
+ " */\n" +
"}";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " int x = 0; /*\n" +
- " * XXXX\n" +
- " */\n" +
+ "public class Test {\n" +
+ "\n" +
+ " int x = 0; /*\n" +
+ " * XXXX\n" +
+ " */\n" +
"}"
);
}
@@ -326,20 +326,20 @@ public void testBug198963_Spaces05() {
this.formatterPrefs.comment_format_block_comment = false;
this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.SPACE;
String source =
- "public class Test {\n" +
- "\n" +
- " /*\n" +
- " * XXXX\n" +
- " */\n" +
- " int x = 0;\n" +
+ "public class Test {\n" +
+ "\n" +
+ " /*\n" +
+ " * XXXX\n" +
+ " */\n" +
+ " int x = 0;\n" +
"}";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " /*\n" +
- " * XXXX\n" +
- " */\n" +
- " int x = 0;\n" +
+ "public class Test {\n" +
+ "\n" +
+ " /*\n" +
+ " * XXXX\n" +
+ " */\n" +
+ " int x = 0;\n" +
"}"
);
}
@@ -347,20 +347,20 @@ public void testBug198963_Spaces06() {
this.formatterPrefs.comment_format_block_comment = false;
this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.SPACE;
String source =
- "public class Test {\n" +
- "\n" +
- " /*\n" +
- " * XXXX\n" +
- " */\n" +
- " int x = 0;\n" +
+ "public class Test {\n" +
+ "\n" +
+ " /*\n" +
+ " * XXXX\n" +
+ " */\n" +
+ " int x = 0;\n" +
"}";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " /*\n" +
- " * XXXX\n" +
- " */\n" +
- " int x = 0;\n" +
+ "public class Test {\n" +
+ "\n" +
+ " /*\n" +
+ " * XXXX\n" +
+ " */\n" +
+ " int x = 0;\n" +
"}"
);
}
@@ -368,18 +368,18 @@ public void testBug198963_Mixed01() {
this.formatterPrefs.comment_format_block_comment = false;
this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.MIXED;
String source =
- "public class Test {\n" +
- "\n" +
- " int x = 0; /*\n" +
- " * XXXX\n" +
- " */\n" +
+ "public class Test {\n" +
+ "\n" +
+ " int x = 0; /*\n" +
+ " * XXXX\n" +
+ " */\n" +
"}";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " int x = 0; /*\n" +
- " * XXXX\n" +
- " */\n" +
+ "public class Test {\n" +
+ "\n" +
+ " int x = 0; /*\n" +
+ " * XXXX\n" +
+ " */\n" +
"}"
);
}
@@ -387,18 +387,18 @@ public void testBug198963_Mixed02() {
this.formatterPrefs.comment_format_block_comment = false;
this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.MIXED;
String source =
- "public class Test {\n" +
- "\n" +
- " int x = 10; /*\n" +
- " * XXXX\n" +
- " */\n" +
+ "public class Test {\n" +
+ "\n" +
+ " int x = 10; /*\n" +
+ " * XXXX\n" +
+ " */\n" +
"}";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " int x = 10; /*\n" +
- " * XXXX\n" +
- " */\n" +
+ "public class Test {\n" +
+ "\n" +
+ " int x = 10; /*\n" +
+ " * XXXX\n" +
+ " */\n" +
"}"
);
}
@@ -406,18 +406,18 @@ public void testBug198963_Mixed03() {
this.formatterPrefs.comment_format_block_comment = false;
this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.MIXED;
String source =
- "public class Test {\n" +
- "\n" +
- " int x = 100; /*\n" +
- " * XXXX\n" +
- " */\n" +
+ "public class Test {\n" +
+ "\n" +
+ " int x = 100; /*\n" +
+ " * XXXX\n" +
+ " */\n" +
"}";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " int x = 100; /*\n" +
- " * XXXX\n" +
- " */\n" +
+ "public class Test {\n" +
+ "\n" +
+ " int x = 100; /*\n" +
+ " * XXXX\n" +
+ " */\n" +
"}"
);
}
@@ -425,18 +425,18 @@ public void testBug198963_Mixed04() {
this.formatterPrefs.comment_format_block_comment = false;
this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.MIXED;
String source =
- "public class Test {\n" +
- "\n" +
- " int x = 0; /*\n" +
- " * XXXX\n" +
- " */\n" +
+ "public class Test {\n" +
+ "\n" +
+ " int x = 0; /*\n" +
+ " * XXXX\n" +
+ " */\n" +
"}";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " int x = 0; /*\n" +
- " * XXXX\n" +
- " */\n" +
+ "public class Test {\n" +
+ "\n" +
+ " int x = 0; /*\n" +
+ " * XXXX\n" +
+ " */\n" +
"}"
);
}
@@ -444,20 +444,20 @@ public void testBug198963_Mixed05() {
this.formatterPrefs.comment_format_block_comment = false;
this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.MIXED;
String source =
- "public class Test {\n" +
- "\n" +
- " /*\n" +
- " * XXXX\n" +
- " */\n" +
- " int x = 0;\n" +
+ "public class Test {\n" +
+ "\n" +
+ " /*\n" +
+ " * XXXX\n" +
+ " */\n" +
+ " int x = 0;\n" +
"}";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " /*\n" +
- " * XXXX\n" +
- " */\n" +
- " int x = 0;\n" +
+ "public class Test {\n" +
+ "\n" +
+ " /*\n" +
+ " * XXXX\n" +
+ " */\n" +
+ " int x = 0;\n" +
"}"
);
}
@@ -465,20 +465,20 @@ public void testBug198963_Mixed06() {
this.formatterPrefs.comment_format_block_comment = false;
this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.MIXED;
String source =
- "public class Test {\n" +
- "\n" +
- " /*\n" +
- " * XXXX\n" +
- " */\n" +
- " int x = 0;\n" +
+ "public class Test {\n" +
+ "\n" +
+ " /*\n" +
+ " * XXXX\n" +
+ " */\n" +
+ " int x = 0;\n" +
"}";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " /*\n" +
- " * XXXX\n" +
- " */\n" +
- " int x = 0;\n" +
+ "public class Test {\n" +
+ "\n" +
+ " /*\n" +
+ " * XXXX\n" +
+ " */\n" +
+ " int x = 0;\n" +
"}"
);
}
@@ -492,24 +492,24 @@ public void testBug198963_Mixed06() {
public void _testBug204091() {
String source =
"public class Test {\r\n" +
- " /**\r\n" +
- " * Don't format this:\r\n" +
- " * it has been formatted by the user!\r\n" +
- " * \r\n" +
- " * [#@param param format this comment #]\r\n" +
- " */\r\n" +
+ " /**\r\n" +
+ " * Don't format this:\r\n" +
+ " * it has been formatted by the user!\r\n" +
+ " * \r\n" +
+ " * [#@param param format this comment #]\r\n" +
+ " */\r\n" +
" public void foo() {\r\n" +
" }\r\n" +
"}";
formatSource(source,
"public class Test {\r\n" +
- " /**\r\n" +
- " * Don't format this:\r\n" +
- " * it has been formatted by the user!\r\n" +
- " * \r\n" +
- " * @param param\n" +
- " * format this comment\n" +
- " */\r\n" +
+ " /**\r\n" +
+ " * Don't format this:\r\n" +
+ " * it has been formatted by the user!\r\n" +
+ " * \r\n" +
+ " * @param param\n" +
+ " * format this comment\n" +
+ " */\r\n" +
" public void foo() {\r\n" +
" }\r\n" +
"}"
@@ -523,177 +523,177 @@ public void _testBug204091() {
*/
public void testBug217108a() {
String source =
- "public class Test {\n" +
- "\n" +
- " /* a */\n" +
- " // b\n" +
- "\n" +
- " int i;\n" +
- "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " /* a */\n" +
+ " // b\n" +
+ "\n" +
+ " int i;\n" +
+ "\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " /* a */\n" +
- " // b\n" +
- "\n" +
- " int i;\n" +
- "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " /* a */\n" +
+ " // b\n" +
+ "\n" +
+ " int i;\n" +
+ "\n" +
"}\n"
);
}
public void testBug217108b() {
String source =
- "public class Test {\n" +
- "\n" +
- " /* a */\n" +
- "\n" +
- " // b\n" +
- "\n" +
- " int i;\n" +
- "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " /* a */\n" +
+ "\n" +
+ " // b\n" +
+ "\n" +
+ " int i;\n" +
+ "\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " /* a */\n" +
- "\n" +
- " // b\n" +
- "\n" +
- " int i;\n" +
- "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " /* a */\n" +
+ "\n" +
+ " // b\n" +
+ "\n" +
+ " int i;\n" +
+ "\n" +
"}\n"
);
}
public void testBug217108c() {
String source =
- "public class Test {\n" +
- "\n" +
- " // b\n" +
- " /* a */\n" +
- "\n" +
- " int i;\n" +
- "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " // b\n" +
+ " /* a */\n" +
+ "\n" +
+ " int i;\n" +
+ "\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " // b\n" +
- " /* a */\n" +
- "\n" +
- " int i;\n" +
- "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " // b\n" +
+ " /* a */\n" +
+ "\n" +
+ " int i;\n" +
+ "\n" +
"}\n"
);
}
public void testBug217108d() {
String source =
- "public class Test {\n" +
- "\n" +
- " // b\n" +
- "\n" +
- " /* a */\n" +
- "\n" +
- " int i;\n" +
- "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " // b\n" +
+ "\n" +
+ " /* a */\n" +
+ "\n" +
+ " int i;\n" +
+ "\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " // b\n" +
- "\n" +
- " /* a */\n" +
- "\n" +
- " int i;\n" +
- "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " // b\n" +
+ "\n" +
+ " /* a */\n" +
+ "\n" +
+ " int i;\n" +
+ "\n" +
"}\n"
);
}
public void testBug217108e() {
String source =
- "public class Test {\n" +
- "\n" +
- " // a\n" +
- "\n" +
- " // b\n" +
- "\n" +
- " int i;\n" +
- "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " // a\n" +
+ "\n" +
+ " // b\n" +
+ "\n" +
+ " int i;\n" +
+ "\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " // a\n" +
- "\n" +
- " // b\n" +
- "\n" +
- " int i;\n" +
- "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " // a\n" +
+ "\n" +
+ " // b\n" +
+ "\n" +
+ " int i;\n" +
+ "\n" +
"}\n"
);
}
public void testBug217108f() {
String source =
- "public class Test {\n" +
- "\n" +
- " // a\n" +
- " // b\n" +
- "\n" +
- " int i;\n" +
- "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " // a\n" +
+ " // b\n" +
+ "\n" +
+ " int i;\n" +
+ "\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " // a\n" +
- " // b\n" +
- "\n" +
- " int i;\n" +
- "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " // a\n" +
+ " // b\n" +
+ "\n" +
+ " int i;\n" +
+ "\n" +
"}\n"
);
}
public void testBug217108g() {
String source =
- "public class Test {\n" +
- "\n" +
- " /** a */\n" +
- " // b\n" +
- "\n" +
- " int i;\n" +
- "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " /** a */\n" +
+ " // b\n" +
+ "\n" +
+ " int i;\n" +
+ "\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " /** a */\n" +
- " // b\n" +
- "\n" +
- " int i;\n" +
- "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " /** a */\n" +
+ " // b\n" +
+ "\n" +
+ " int i;\n" +
+ "\n" +
"}\n"
);
}
public void testBug217108h() {
String source =
- "public class Test {\n" +
- "\n" +
- " /** a */\n" +
- "\n" +
- " // b\n" +
- "\n" +
- " int i;\n" +
- "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " /** a */\n" +
+ "\n" +
+ " // b\n" +
+ "\n" +
+ " int i;\n" +
+ "\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " /** a */\n" +
- "\n" +
- " // b\n" +
- "\n" +
- " int i;\n" +
- "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " /** a */\n" +
+ "\n" +
+ " // b\n" +
+ "\n" +
+ " int i;\n" +
+ "\n" +
"}\n"
);
}
@@ -1823,257 +1823,257 @@ public void testBug234336() throws JavaModelException {
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=234583"
*/
public void testBug234583a() throws JavaModelException {
- String source =
- "public class X {\n" +
- "[# int i= 1; #]\n" +
+ String source =
+ "public class X {\n" +
+ "[# int i= 1; #]\n" +
"}\n";
formatSource(source,
- "public class X {\n" +
- " int i = 1;\n" +
+ "public class X {\n" +
+ " int i = 1;\n" +
"}\n"
);
}
public void testBug234583b() throws JavaModelException {
- String source =
- "public class X { \n" +
- "\n" +
- "\n" +
- "\n" +
- "[# int i= 1; #]\n" +
- "\n" +
- "\n" +
- "\n" +
- "\n" +
+ String source =
+ "public class X { \n" +
+ "\n" +
+ "\n" +
+ "\n" +
+ "[# int i= 1; #]\n" +
+ "\n" +
+ "\n" +
+ "\n" +
+ "\n" +
" }\n";
formatSource(source,
- "public class X { \n" +
- "\n" +
- "\n" +
- "\n" +
- " int i = 1;\n" +
- "\n" +
- "\n" +
- "\n" +
- "\n" +
+ "public class X { \n" +
+ "\n" +
+ "\n" +
+ "\n" +
+ " int i = 1;\n" +
+ "\n" +
+ "\n" +
+ "\n" +
+ "\n" +
" }\n"
);
}
public void testBug234583c() throws JavaModelException {
- String source =
- "public class X { \n" +
- "\n" +
- "\n" +
- "\n" +
- "[# int i= 1; \n" +
- "#]\n" +
- "\n" +
- "\n" +
- "\n" +
+ String source =
+ "public class X { \n" +
+ "\n" +
+ "\n" +
+ "\n" +
+ "[# int i= 1; \n" +
+ "#]\n" +
+ "\n" +
+ "\n" +
+ "\n" +
" }\n";
formatSource(source,
- "public class X { \n" +
- "\n" +
- "\n" +
- "\n" +
- " int i = 1;\n" +
- "\n" +
- "\n" +
- "\n" +
+ "public class X { \n" +
+ "\n" +
+ "\n" +
+ "\n" +
+ " int i = 1;\n" +
+ "\n" +
+ "\n" +
+ "\n" +
" }\n"
);
}
public void testBug234583d() throws JavaModelException {
- String source =
- "public class X { \n" +
- "\n" +
- "\n" +
- "[#\n" +
- " int i= 1; \n" +
- "\n" +
- "#]\n" +
- "\n" +
- "\n" +
+ String source =
+ "public class X { \n" +
+ "\n" +
+ "\n" +
+ "[#\n" +
+ " int i= 1; \n" +
+ "\n" +
+ "#]\n" +
+ "\n" +
+ "\n" +
" }\n";
formatSource(source,
- "public class X { \n" +
- "\n" +
- "\n" +
- " int i = 1;\n" +
- "\n" +
- "\n" +
+ "public class X { \n" +
+ "\n" +
+ "\n" +
+ " int i = 1;\n" +
+ "\n" +
+ "\n" +
" }\n"
);
}
public void testBug234583e() throws JavaModelException {
- String source =
- "public class X { \n" +
- "\n" +
- "[#\n" +
- "\n" +
- " int i= 1; \n" +
- "\n" +
- "\n" +
- "#]\n" +
- "\n" +
+ String source =
+ "public class X { \n" +
+ "\n" +
+ "[#\n" +
+ "\n" +
+ " int i= 1; \n" +
+ "\n" +
+ "\n" +
+ "#]\n" +
+ "\n" +
" }\n";
formatSource(source,
- "public class X { \n" +
- "\n" +
- " int i = 1;\n" +
- "\n" +
+ "public class X { \n" +
+ "\n" +
+ " int i = 1;\n" +
+ "\n" +
" }\n"
);
}
public void testBug234583f() throws JavaModelException {
- String source =
- "public class X { \n" +
- "[#\n" +
- "\n" +
- "\n" +
- " int i= 1; \n" +
- "\n" +
- "\n" +
- "\n" +
- "#]\n" +
+ String source =
+ "public class X { \n" +
+ "[#\n" +
+ "\n" +
+ "\n" +
+ " int i= 1; \n" +
+ "\n" +
+ "\n" +
+ "\n" +
+ "#]\n" +
" }\n";
formatSource(source,
- "public class X { \n" +
- "\n" +
- " int i = 1;\n" +
- "\n" +
+ "public class X { \n" +
+ "\n" +
+ " int i = 1;\n" +
+ "\n" +
" }\n"
);
}
public void testBug234583g() throws JavaModelException {
- String source =
- "public class X { [#\n" +
- "\n" +
- "\n" +
- "\n" +
- " int i= 1; \n" +
- "\n" +
- "\n" +
- "\n" +
- "\n" +
+ String source =
+ "public class X { [#\n" +
+ "\n" +
+ "\n" +
+ "\n" +
+ " int i= 1; \n" +
+ "\n" +
+ "\n" +
+ "\n" +
+ "\n" +
"#] }\n";
formatSource(source,
- "public class X { \n" +
- "\n" +
- " int i = 1;\n" +
- "\n" +
+ "public class X { \n" +
+ "\n" +
+ " int i = 1;\n" +
+ "\n" +
" }\n"
);
}
public void testBug234583h() throws JavaModelException {
- String source =
- "public class X { [# \n" +
- "\n" +
- "\n" +
- "\n" +
- " int i= 1; \n" +
- "\n" +
- "\n" +
- "\n" +
- "\n" +
+ String source =
+ "public class X { [# \n" +
+ "\n" +
+ "\n" +
+ "\n" +
+ " int i= 1; \n" +
+ "\n" +
+ "\n" +
+ "\n" +
+ "\n" +
" #] }\n";
formatSource(source,
- "public class X { \n" +
- "\n" +
- " int i = 1;\n" +
- "\n" +
+ "public class X { \n" +
+ "\n" +
+ " int i = 1;\n" +
+ "\n" +
" }\n"
);
}
public void testBug234583i() throws JavaModelException {
- String source =
- "public class X {[# \n" +
- "\n" +
- "\n" +
- "\n" +
- " int i= 1; \n" +
- "\n" +
- "\n" +
- "\n" +
- "\n" +
+ String source =
+ "public class X {[# \n" +
+ "\n" +
+ "\n" +
+ "\n" +
+ " int i= 1; \n" +
+ "\n" +
+ "\n" +
+ "\n" +
+ "\n" +
" #]}\n";
formatSource(source,
- "public class X {\n" +
- "\n" +
- " int i = 1;\n" +
- "\n" +
+ "public class X {\n" +
+ "\n" +
+ " int i = 1;\n" +
+ "\n" +
"}\n"
);
}
// duplicate https://bugs.eclipse.org/bugs/show_bug.cgi?id=239447
public void testBug234583_Bug239447() throws JavaModelException {
setPageWidth80();
- String source =
- "public class Bug239447 {\n" +
- " private static final String CONTENT = \"test.ObjectB {\\n\"\n" +
- "[# + \" multiEle = { name=\\\"Foo\\\" }\\n\"#]\n" +
- " + \" multiEle = :x { name=\\\"Bar\\\" }\\n\" + \" singleEle = x;\\n\"\n" +
- " + \"}\";\n" +
- "\n" +
+ String source =
+ "public class Bug239447 {\n" +
+ " private static final String CONTENT = \"test.ObjectB {\\n\"\n" +
+ "[# + \" multiEle = { name=\\\"Foo\\\" }\\n\"#]\n" +
+ " + \" multiEle = :x { name=\\\"Bar\\\" }\\n\" + \" singleEle = x;\\n\"\n" +
+ " + \"}\";\n" +
+ "\n" +
"}\n";
formatSource(source,
- "public class Bug239447 {\n" +
- " private static final String CONTENT = \"test.ObjectB {\\n\"\n" +
- " + \" multiEle = { name=\\\"Foo\\\" }\\n\"\n" +
- " + \" multiEle = :x { name=\\\"Bar\\\" }\\n\" + \" singleEle = x;\\n\"\n" +
- " + \"}\";\n" +
- "\n" +
+ "public class Bug239447 {\n" +
+ " private static final String CONTENT = \"test.ObjectB {\\n\"\n" +
+ " + \" multiEle = { name=\\\"Foo\\\" }\\n\"\n" +
+ " + \" multiEle = :x { name=\\\"Bar\\\" }\\n\" + \" singleEle = x;\\n\"\n" +
+ " + \"}\";\n" +
+ "\n" +
"}\n"
);
}
// duplicate https://bugs.eclipse.org/bugs/show_bug.cgi?id=237592
public void testBug234583_Bug237592() throws JavaModelException {
- String source =
- "package test;\n" +
- "\n" +
- "public class Test {\n" +
- "\n" +
- " void foo() {\n" +
- " }\n" +
- "\n" +
- "[# #]\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "[# #]\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " void bar() {\n" +
- " }\n" +
- "\n" +
- "}\n";
- formatSource(source,
- "package test;\n" +
- "\n" +
- "public class Test {\n" +
- "\n" +
- " void foo() {\n" +
- " }\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " void bar() {\n" +
- " }\n" +
- "\n" +
+ String source =
+ "package test;\n" +
+ "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " void foo() {\n" +
+ " }\n" +
+ "\n" +
+ "[# #]\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "[# #]\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " void bar() {\n" +
+ " }\n" +
+ "\n" +
+ "}\n";
+ formatSource(source,
+ "package test;\n" +
+ "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " void foo() {\n" +
+ " }\n" +
+ "\n" +
+ "\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " void bar() {\n" +
+ " }\n" +
+ "\n" +
"}\n"
);
}
@@ -2228,7 +2228,7 @@ public void testBug236230d() throws JavaModelException {
" * If there is an authority, it is:\n" +
" * \n" +
" * <pre>\n" +
- " * // class body snippet\n" +
+ " * // class body snippet\n" +
" * public class X {\n" +
" * }\n" +
" * </pre>\n" +
@@ -2285,7 +2285,7 @@ public void testBug236230f() throws JavaModelException {
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=236406"
*/
public void testBug236406_CDB1() {
- String source =
+ String source =
"/** Javadoc comment */void foo1() {System.out.println();}\n" +
"// Line comment \n" +
"void foo2() {System.out.println();}\n" +
@@ -2294,27 +2294,27 @@ public void testBug236406_CDB1() {
"/* statement Block comment */\n" +
"System.out.println();}\n";
formatSource(source,
- "/** Javadoc comment */\n" +
- "void foo1() {\n" +
- " System.out.println();\n" +
- "}\n" +
- "\n" +
- "// Line comment \n" +
- "void foo2() {\n" +
- " System.out.println();\n" +
- "}\n" +
- "\n" +
+ "/** Javadoc comment */\n" +
+ "void foo1() {\n" +
+ " System.out.println();\n" +
+ "}\n" +
+ "\n" +
+ "// Line comment \n" +
+ "void foo2() {\n" +
+ " System.out.println();\n" +
+ "}\n" +
+ "\n" +
"/* Block comment */\n" +
"void foo3() {\n" +
- " /* statement Block comment */\n" +
- " System.out.println();\n" +
+ " /* statement Block comment */\n" +
+ " System.out.println();\n" +
"}\n",
CodeFormatter.K_CLASS_BODY_DECLARATIONS
);
}
public void testBug236406_CDB2() {
setFormatLineCommentOnFirstColumn();
- String source =
+ String source =
"/** Javadoc comment */void foo1() {System.out.println();}\n" +
"// Line comment \n" +
"void foo2() {System.out.println();}\n" +
@@ -2323,55 +2323,55 @@ public void testBug236406_CDB2() {
"/* statement Block comment */\n" +
"System.out.println();}\n";
formatSource(source,
- "/** Javadoc comment */\n" +
- "void foo1() {\n" +
- " System.out.println();\n" +
- "}\n" +
- "\n" +
- "// Line comment\n" +
- "void foo2() {\n" +
- " System.out.println();\n" +
- "}\n" +
- "\n" +
+ "/** Javadoc comment */\n" +
+ "void foo1() {\n" +
+ " System.out.println();\n" +
+ "}\n" +
+ "\n" +
+ "// Line comment\n" +
+ "void foo2() {\n" +
+ " System.out.println();\n" +
+ "}\n" +
+ "\n" +
"/* Block comment */\n" +
- "void foo3() {\n" +
- " /* statement Block comment */\n" +
- " System.out.println();\n" +
+ "void foo3() {\n" +
+ " /* statement Block comment */\n" +
+ " System.out.println();\n" +
"}\n",
CodeFormatter.K_CLASS_BODY_DECLARATIONS | CodeFormatter.F_INCLUDE_COMMENTS
);
}
public void testBug236406_EX1() {
- String source =
+ String source =
"// Line comment \n" +
"i = \n" +
"/** Javadoc comment */\n" +
"1 + (/* Block comment*/++a)\n";
formatSource(source,
- "// Line comment \n" +
- "i =\n" +
- " /** Javadoc comment */\n" +
+ "// Line comment \n" +
+ "i =\n" +
+ " /** Javadoc comment */\n" +
" 1 + (/* Block comment*/++a)\n",
CodeFormatter.K_EXPRESSION
);
}
public void testBug236406_EX2() {
setFormatLineCommentOnFirstColumn();
- String source =
+ String source =
"// Line comment \n" +
"i = \n" +
"/** Javadoc comment */\n" +
"1 + (/* Block comment*/++a)\n";
formatSource(source,
- "// Line comment\n" +
- "i =\n" +
- " /** Javadoc comment */\n" +
+ "// Line comment\n" +
+ "i =\n" +
+ " /** Javadoc comment */\n" +
" 1 + (/* Block comment */++a)\n",
CodeFormatter.K_EXPRESSION | CodeFormatter.F_INCLUDE_COMMENTS
);
}
public void testBug236406_ST1() {
- String source =
+ String source =
"/** Javadoc comment */foo1();\n" +
"// Line comment \n" +
"foo2();\n" +
@@ -2380,22 +2380,22 @@ public void testBug236406_ST1() {
"/* indented Block comment */\n" +
"System.out.println();}\n";
formatSource(source,
- "/** Javadoc comment */\n" +
- "foo1();\n" +
- "// Line comment \n" +
- "foo2();\n" +
- "/* Block comment */\n" +
- "foo3();\n" +
- "{\n" +
- " /* indented Block comment */\n" +
- " System.out.println();\n" +
+ "/** Javadoc comment */\n" +
+ "foo1();\n" +
+ "// Line comment \n" +
+ "foo2();\n" +
+ "/* Block comment */\n" +
+ "foo3();\n" +
+ "{\n" +
+ " /* indented Block comment */\n" +
+ " System.out.println();\n" +
"}\n",
CodeFormatter.K_STATEMENTS
);
}
public void testBug236406_ST2() {
setFormatLineCommentOnFirstColumn();
- String source =
+ String source =
"/** Javadoc comment */foo1();\n" +
"// Line comment \n" +
"foo2();\n" +
@@ -2404,15 +2404,15 @@ public void testBug236406_ST2() {
"/* indented Block comment */\n" +
"System.out.println();}\n";
formatSource(source,
- "/** Javadoc comment */\n" +
- "foo1();\n" +
- "// Line comment\n" +
- "foo2();\n" +
- "/* Block comment */\n" +
- "foo3();\n" +
- "{\n" +
- " /* indented Block comment */\n" +
- " System.out.println();\n" +
+ "/** Javadoc comment */\n" +
+ "foo1();\n" +
+ "// Line comment\n" +
+ "foo2();\n" +
+ "/* Block comment */\n" +
+ "foo3();\n" +
+ "{\n" +
+ " /* indented Block comment */\n" +
+ " System.out.println();\n" +
"}\n",
CodeFormatter.K_STATEMENTS | CodeFormatter.F_INCLUDE_COMMENTS
);
@@ -2549,223 +2549,223 @@ public void testBug237051d() throws JavaModelException {
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=237453"
*/
public void testBug237453a() throws JavaModelException {
- String source =
- "package test1;\n" +
- "\n" +
- "public class E1 {\n" +
- " void foo() {\n" +
- " }\n" +
- " [#\n" +
- " #]\n" +
- " void bar() {\n" +
- " }\n" +
+ String source =
+ "package test1;\n" +
+ "\n" +
+ "public class E1 {\n" +
+ " void foo() {\n" +
+ " }\n" +
+ " [#\n" +
+ " #]\n" +
+ " void bar() {\n" +
+ " }\n" +
"}";
formatSource(source,
- "package test1;\n" +
- "\n" +
- "public class E1 {\n" +
- " void foo() {\n" +
- " }\n" +
- " \n" +
- " void bar() {\n" +
- " }\n" +
+ "package test1;\n" +
+ "\n" +
+ "public class E1 {\n" +
+ " void foo() {\n" +
+ " }\n" +
+ " \n" +
+ " void bar() {\n" +
+ " }\n" +
"}"
);
}
public void testBug237453b() throws JavaModelException {
- String source =
- "package test1;\n" +
- "\n" +
- "public class E1 {\n" +
- " void foo() {\n" +
- " }\n" +
- " \n" +
- "[# #]\n" +
- " void bar() {\n" +
- " }\n" +
+ String source =
+ "package test1;\n" +
+ "\n" +
+ "public class E1 {\n" +
+ " void foo() {\n" +
+ " }\n" +
+ " \n" +
+ "[# #]\n" +
+ " void bar() {\n" +
+ " }\n" +
"}";
formatSource(source,
- "package test1;\n" +
- "\n" +
- "public class E1 {\n" +
- " void foo() {\n" +
- " }\n" +
- " \n" +
- "\n" +
- " void bar() {\n" +
- " }\n" +
+ "package test1;\n" +
+ "\n" +
+ "public class E1 {\n" +
+ " void foo() {\n" +
+ " }\n" +
+ " \n" +
+ "\n" +
+ " void bar() {\n" +
+ " }\n" +
"}"
);
}
public void testBug237453c() throws JavaModelException {
- String source =
- "package test1;\n" +
- "\n" +
- "public class E1 {\n" +
- " void foo() {\n" +
- " }\n" +
- " \n" +
- "[# \n" +
- "#] void bar() {\n" +
- " }\n" +
+ String source =
+ "package test1;\n" +
+ "\n" +
+ "public class E1 {\n" +
+ " void foo() {\n" +
+ " }\n" +
+ " \n" +
+ "[# \n" +
+ "#] void bar() {\n" +
+ " }\n" +
"}";
formatSource(source,
- "package test1;\n" +
- "\n" +
- "public class E1 {\n" +
- " void foo() {\n" +
- " }\n" +
- " \n" +
- " void bar() {\n" +
- " }\n" +
+ "package test1;\n" +
+ "\n" +
+ "public class E1 {\n" +
+ " void foo() {\n" +
+ " }\n" +
+ " \n" +
+ " void bar() {\n" +
+ " }\n" +
"}"
);
}
public void testBug237453d() throws JavaModelException {
- String source =
- "package test1;\n" +
- "\n" +
- "public class E1 {\n" +
- " void foo() {\n" +
- " }\n" +
- " \n" +
- "[# \n" +
- " #] void bar() {\n" +
- " }\n" +
+ String source =
+ "package test1;\n" +
+ "\n" +
+ "public class E1 {\n" +
+ " void foo() {\n" +
+ " }\n" +
+ " \n" +
+ "[# \n" +
+ " #] void bar() {\n" +
+ " }\n" +
"}";
formatSource(source,
- "package test1;\n" +
- "\n" +
- "public class E1 {\n" +
- " void foo() {\n" +
- " }\n" +
- " \n" +
- " void bar() {\n" +
- " }\n" +
+ "package test1;\n" +
+ "\n" +
+ "public class E1 {\n" +
+ " void foo() {\n" +
+ " }\n" +
+ " \n" +
+ " void bar() {\n" +
+ " }\n" +
"}"
);
}
public void testBug237453e() throws JavaModelException {
- String source =
- "package test1;\n" +
- "\n" +
- "public class E1 {\n" +
- " void foo() {\n" +
- " }\n" +
- " \n" +
- "[# \n" +
- " #]void bar() {\n" +
- " }\n" +
+ String source =
+ "package test1;\n" +
+ "\n" +
+ "public class E1 {\n" +
+ " void foo() {\n" +
+ " }\n" +
+ " \n" +
+ "[# \n" +
+ " #]void bar() {\n" +
+ " }\n" +
"}";
formatSource(source,
- "package test1;\n" +
- "\n" +
- "public class E1 {\n" +
- " void foo() {\n" +
- " }\n" +
- " \n" +
- " void bar() {\n" +
- " }\n" +
+ "package test1;\n" +
+ "\n" +
+ "public class E1 {\n" +
+ " void foo() {\n" +
+ " }\n" +
+ " \n" +
+ " void bar() {\n" +
+ " }\n" +
"}"
);
}
public void testBug237453f() throws JavaModelException {
- String source =
- "package test1;\n" +
- "\n" +
- "public class E1 {\n" +
- " void foo() {\n" +
- " }\n" +
- " \n" +
- " \n" +
- "[# #] void bar() {\n" +
- " }\n" +
+ String source =
+ "package test1;\n" +
+ "\n" +
+ "public class E1 {\n" +
+ " void foo() {\n" +
+ " }\n" +
+ " \n" +
+ " \n" +
+ "[# #] void bar() {\n" +
+ " }\n" +
"}";
formatSource(source,
- "package test1;\n" +
- "\n" +
- "public class E1 {\n" +
- " void foo() {\n" +
- " }\n" +
- " \n" +
- " \n" +
- " void bar() {\n" +
- " }\n" +
+ "package test1;\n" +
+ "\n" +
+ "public class E1 {\n" +
+ " void foo() {\n" +
+ " }\n" +
+ " \n" +
+ " \n" +
+ " void bar() {\n" +
+ " }\n" +
"}"
);
}
public void testBug237453g() throws JavaModelException {
- String source =
- "package test1;\n" +
- "\n" +
- "public class E1 {\n" +
- " void foo() {\n" +
- " }\n" +
- " \n" +
- " \n" +
- "[# #] void bar() {\n" +
- " }\n" +
+ String source =
+ "package test1;\n" +
+ "\n" +
+ "public class E1 {\n" +
+ " void foo() {\n" +
+ " }\n" +
+ " \n" +
+ " \n" +
+ "[# #] void bar() {\n" +
+ " }\n" +
"}";
formatSource(source,
- "package test1;\n" +
- "\n" +
- "public class E1 {\n" +
- " void foo() {\n" +
- " }\n" +
- " \n" +
- " \n" +
- " void bar() {\n" +
- " }\n" +
+ "package test1;\n" +
+ "\n" +
+ "public class E1 {\n" +
+ " void foo() {\n" +
+ " }\n" +
+ " \n" +
+ " \n" +
+ " void bar() {\n" +
+ " }\n" +
"}"
);
}
public void testBug237453h() throws JavaModelException {
- String source =
- "package test1;\n" +
- "\n" +
- "public class E1 {\n" +
- " void foo() {\n" +
- " }\n" +
- " \n" +
- " \n" +
- "[# #]void bar() {\n" +
- " }\n" +
+ String source =
+ "package test1;\n" +
+ "\n" +
+ "public class E1 {\n" +
+ " void foo() {\n" +
+ " }\n" +
+ " \n" +
+ " \n" +
+ "[# #]void bar() {\n" +
+ " }\n" +
"}";
formatSource(source,
- "package test1;\n" +
- "\n" +
- "public class E1 {\n" +
- " void foo() {\n" +
- " }\n" +
- " \n" +
- " \n" +
- " void bar() {\n" +
- " }\n" +
+ "package test1;\n" +
+ "\n" +
+ "public class E1 {\n" +
+ " void foo() {\n" +
+ " }\n" +
+ " \n" +
+ " \n" +
+ " void bar() {\n" +
+ " }\n" +
"}"
);
}
public void testBug237453i() throws JavaModelException {
- String source =
- "package test1;\n" +
- "\n" +
- "public class E1 {\n" +
- " void foo() {\n" +
- " }\n" +
- " \n" +
- " \n" +
- "[# #]void bar() {\n" +
- " }\n" +
+ String source =
+ "package test1;\n" +
+ "\n" +
+ "public class E1 {\n" +
+ " void foo() {\n" +
+ " }\n" +
+ " \n" +
+ " \n" +
+ "[# #]void bar() {\n" +
+ " }\n" +
"}";
formatSource(source,
- "package test1;\n" +
- "\n" +
- "public class E1 {\n" +
- " void foo() {\n" +
- " }\n" +
- " \n" +
- " \n" +
- " void bar() {\n" +
- " }\n" +
+ "package test1;\n" +
+ "\n" +
+ "public class E1 {\n" +
+ " void foo() {\n" +
+ " }\n" +
+ " \n" +
+ " \n" +
+ " void bar() {\n" +
+ " }\n" +
"}"
);
}
@@ -2813,153 +2813,153 @@ public void testBug238090() throws JavaModelException {
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=238210"
*/
public void testBug238210() throws JavaModelException {
- String source =
- "/**\n" +
- " * LineCommentTestCase\n" +
- " * \n" +
- " * Formatting this compilation unit with line comment enabled and comment line width set to 100 or\n" +
- " * lower will result in both protected region comments to be wrapped although they do not contain\n" +
- " * any whitespace (excluding leading whitespace which should be / is being ignored altogether)\n" +
- " * \n" +
- " * @author Axel Faust, PRODYNA AG\n" +
- " */\n" +
- "public class LineCommentTestCase {\n" +
- "\n" +
- " public void someGeneratedMethod() {\n" +
- " //protected-region-start_[id=_14_0_1_3dd20592_1202209856234_914658_24183_someGeneratedMethod]\n" +
- " // some manually written code\n" +
- " // protected-region-end_[id=_14_0_1_3dd20592_1202209856234_914658_24183_someGeneratedMethod]\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "/**\n" +
- " * LineCommentTestCase\n" +
- " * \n" +
- " * Formatting this compilation unit with line comment enabled and comment line\n" +
- " * width set to 100 or lower will result in both protected region comments to be\n" +
- " * wrapped although they do not contain any whitespace (excluding leading\n" +
- " * whitespace which should be / is being ignored altogether)\n" +
- " * \n" +
- " * @author Axel Faust, PRODYNA AG\n" +
- " */\n" +
- "public class LineCommentTestCase {\n" +
- "\n" +
- " public void someGeneratedMethod() {\n" +
- " // protected-region-start_[id=_14_0_1_3dd20592_1202209856234_914658_24183_someGeneratedMethod]\n" +
- " // some manually written code\n" +
- " // protected-region-end_[id=_14_0_1_3dd20592_1202209856234_914658_24183_someGeneratedMethod]\n" +
- " }\n" +
+ String source =
+ "/**\n" +
+ " * LineCommentTestCase\n" +
+ " * \n" +
+ " * Formatting this compilation unit with line comment enabled and comment line width set to 100 or\n" +
+ " * lower will result in both protected region comments to be wrapped although they do not contain\n" +
+ " * any whitespace (excluding leading whitespace which should be / is being ignored altogether)\n" +
+ " * \n" +
+ " * @author Axel Faust, PRODYNA AG\n" +
+ " */\n" +
+ "public class LineCommentTestCase {\n" +
+ "\n" +
+ " public void someGeneratedMethod() {\n" +
+ " //protected-region-start_[id=_14_0_1_3dd20592_1202209856234_914658_24183_someGeneratedMethod]\n" +
+ " // some manually written code\n" +
+ " // protected-region-end_[id=_14_0_1_3dd20592_1202209856234_914658_24183_someGeneratedMethod]\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "/**\n" +
+ " * LineCommentTestCase\n" +
+ " * \n" +
+ " * Formatting this compilation unit with line comment enabled and comment line\n" +
+ " * width set to 100 or lower will result in both protected region comments to be\n" +
+ " * wrapped although they do not contain any whitespace (excluding leading\n" +
+ " * whitespace which should be / is being ignored altogether)\n" +
+ " * \n" +
+ " * @author Axel Faust, PRODYNA AG\n" +
+ " */\n" +
+ "public class LineCommentTestCase {\n" +
+ "\n" +
+ " public void someGeneratedMethod() {\n" +
+ " // protected-region-start_[id=_14_0_1_3dd20592_1202209856234_914658_24183_someGeneratedMethod]\n" +
+ " // some manually written code\n" +
+ " // protected-region-end_[id=_14_0_1_3dd20592_1202209856234_914658_24183_someGeneratedMethod]\n" +
+ " }\n" +
"}\n"
);
}
// possible side effects detected while running massive tests
public void testBug238210_X01() throws JavaModelException {
setPageWidth80();
- String source =
- "package eclipse30;\n" +
- "\n" +
- "public class X01 {\n" +
- "\n" +
- " void foo() {\n" +
- " \n" +
- " binding = new LocalVariableBinding(this, tb, modifiers, false); // argument decl, but local var (where isArgument = false)\n" +
- " }\n" +
- "\n" +
- " public class LocalVariableBinding {\n" +
- "\n" +
- " public LocalVariableBinding(X01 x01, Object tb, Object modifiers,\n" +
- " boolean b) {\n" +
- " }\n" +
- "\n" +
- " }\n" +
- "\n" +
- " Object modifiers;\n" +
- " Object tb;\n" +
- " LocalVariableBinding binding;\n" +
- "}\n";
- formatSource(source,
- "package eclipse30;\n" +
- "\n" +
- "public class X01 {\n" +
- "\n" +
- " void foo() {\n" +
- "\n" +
- " binding = new LocalVariableBinding(this, tb, modifiers, false); // argument\n" +
- " // decl,\n" +
- " // but\n" +
- " // local\n" +
- " // var\n" +
- " // (where\n" +
- " // isArgument\n" +
- " // =\n" +
- " // false)\n" +
- " }\n" +
- "\n" +
- " public class LocalVariableBinding {\n" +
- "\n" +
- " public LocalVariableBinding(X01 x01, Object tb, Object modifiers,\n" +
- " boolean b) {\n" +
- " }\n" +
- "\n" +
- " }\n" +
- "\n" +
- " Object modifiers;\n" +
- " Object tb;\n" +
- " LocalVariableBinding binding;\n" +
+ String source =
+ "package eclipse30;\n" +
+ "\n" +
+ "public class X01 {\n" +
+ "\n" +
+ " void foo() {\n" +
+ " \n" +
+ " binding = new LocalVariableBinding(this, tb, modifiers, false); // argument decl, but local var (where isArgument = false)\n" +
+ " }\n" +
+ "\n" +
+ " public class LocalVariableBinding {\n" +
+ "\n" +
+ " public LocalVariableBinding(X01 x01, Object tb, Object modifiers,\n" +
+ " boolean b) {\n" +
+ " }\n" +
+ "\n" +
+ " }\n" +
+ "\n" +
+ " Object modifiers;\n" +
+ " Object tb;\n" +
+ " LocalVariableBinding binding;\n" +
+ "}\n";
+ formatSource(source,
+ "package eclipse30;\n" +
+ "\n" +
+ "public class X01 {\n" +
+ "\n" +
+ " void foo() {\n" +
+ "\n" +
+ " binding = new LocalVariableBinding(this, tb, modifiers, false); // argument\n" +
+ " // decl,\n" +
+ " // but\n" +
+ " // local\n" +
+ " // var\n" +
+ " // (where\n" +
+ " // isArgument\n" +
+ " // =\n" +
+ " // false)\n" +
+ " }\n" +
+ "\n" +
+ " public class LocalVariableBinding {\n" +
+ "\n" +
+ " public LocalVariableBinding(X01 x01, Object tb, Object modifiers,\n" +
+ " boolean b) {\n" +
+ " }\n" +
+ "\n" +
+ " }\n" +
+ "\n" +
+ " Object modifiers;\n" +
+ " Object tb;\n" +
+ " LocalVariableBinding binding;\n" +
"}\n",
false /*do not formatting twice*/
);
}
public void testBug238210_X02() throws JavaModelException {
useOldCommentWidthCounting();
- String source =
- "package eclipse30;\n" +
- "\n" +
- "public class X02 {\n" +
- " //private static short[] randomArray = {213, 231, 37, 85, 211, 29, 161, 175, 187, 3, 147, 246, 170, 30, 202, 183, 242, 47, 254, 189, 25, 248, 193, 2};\n" +
+ String source =
+ "package eclipse30;\n" +
+ "\n" +
+ "public class X02 {\n" +
+ " //private static short[] randomArray = {213, 231, 37, 85, 211, 29, 161, 175, 187, 3, 147, 246, 170, 30, 202, 183, 242, 47, 254, 189, 25, 248, 193, 2};\n" +
"}\n";
formatSource(source,
- "package eclipse30;\n" +
- "\n" +
- "public class X02 {\n" +
- " // private static short[] randomArray = {213, 231, 37, 85, 211, 29, 161,\n" +
- " // 175, 187, 3, 147, 246, 170, 30, 202, 183, 242, 47, 254, 189, 25, 248,\n" +
- " // 193, 2};\n" +
+ "package eclipse30;\n" +
+ "\n" +
+ "public class X02 {\n" +
+ " // private static short[] randomArray = {213, 231, 37, 85, 211, 29, 161,\n" +
+ " // 175, 187, 3, 147, 246, 170, 30, 202, 183, 242, 47, 254, 189, 25, 248,\n" +
+ " // 193, 2};\n" +
"}\n"
);
}
public void testBug238210_X03() throws JavaModelException {
useOldCommentWidthCounting();
- String source =
- "package eclipse30;\n" +
- "\n" +
- "public class X03 {\n" +
- "\n" +
- " \n" +
- " /**\n" +
- " * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#handleBreakpointEvent(com.sun.jdi.event.Event, org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget, org.eclipse.jdt.internal.debug.core.model.JDIThread)\n" +
- " * \n" +
- " * (From referenced JavaDoc:\n" +
- " * Returns whethers the thread should be resumed\n" +
- " */\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "package eclipse30;\n" +
- "\n" +
- "public class X03 {\n" +
- "\n" +
- " /**\n" +
- " * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#handleBreakpointEvent(com.sun.jdi.event.Event,\n" +
- " * org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget,\n" +
- " * org.eclipse.jdt.internal.debug.core.model.JDIThread)\n" +
- " * \n" +
- " * (From referenced JavaDoc: Returns whethers the thread should be\n" +
- " * resumed\n" +
- " */\n" +
- " void foo() {\n" +
- " }\n" +
+ String source =
+ "package eclipse30;\n" +
+ "\n" +
+ "public class X03 {\n" +
+ "\n" +
+ " \n" +
+ " /**\n" +
+ " * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#handleBreakpointEvent(com.sun.jdi.event.Event, org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget, org.eclipse.jdt.internal.debug.core.model.JDIThread)\n" +
+ " * \n" +
+ " * (From referenced JavaDoc:\n" +
+ " * Returns whethers the thread should be resumed\n" +
+ " */\n" +
+ " void foo() {\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "package eclipse30;\n" +
+ "\n" +
+ "public class X03 {\n" +
+ "\n" +
+ " /**\n" +
+ " * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#handleBreakpointEvent(com.sun.jdi.event.Event,\n" +
+ " * org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget,\n" +
+ " * org.eclipse.jdt.internal.debug.core.model.JDIThread)\n" +
+ " * \n" +
+ " * (From referenced JavaDoc: Returns whethers the thread should be\n" +
+ " * resumed\n" +
+ " */\n" +
+ " void foo() {\n" +
+ " }\n" +
"}\n"
);
}
@@ -2970,30 +2970,30 @@ public void testBug238210_X03() throws JavaModelException {
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=238853"
*/
public void testBug238853() throws JavaModelException {
- String source =
- "public class Test {\n" +
- "\n" +
- "/**\n" +
- " * This is a test comment. \n" +
- " * <p /> \n" +
- " * Another comment. <br /> \n" +
- " * Another comment.\n" +
- " */\n" +
- "public void testMethod1()\n" +
- "{\n" +
- "}\n" +
- "}\n";
- formatSource(source,
- "public class Test {\n" +
- "\n" +
- " /**\n" +
- " * This is a test comment.\n" +
- " * <p />\n" +
- " * Another comment. <br />\n" +
- " * Another comment.\n" +
- " */\n" +
- " public void testMethod1() {\n" +
- " }\n" +
+ String source =
+ "public class Test {\n" +
+ "\n" +
+ "/**\n" +
+ " * This is a test comment. \n" +
+ " * <p /> \n" +
+ " * Another comment. <br /> \n" +
+ " * Another comment.\n" +
+ " */\n" +
+ "public void testMethod1()\n" +
+ "{\n" +
+ "}\n" +
+ "}\n";
+ formatSource(source,
+ "public class Test {\n" +
+ "\n" +
+ " /**\n" +
+ " * This is a test comment.\n" +
+ " * <p />\n" +
+ " * Another comment. <br />\n" +
+ " * Another comment.\n" +
+ " */\n" +
+ " public void testMethod1() {\n" +
+ " }\n" +
"}\n"
);
}
@@ -3004,66 +3004,66 @@ public void testBug238853() throws JavaModelException {
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=238920"
*/
public void testBug238920() throws JavaModelException {
- String source =
- "public class X01 {\n" +
- "/**\n" +
- " * @category test\n" +
- " */\n" +
- "void foo() {\n" +
- "}\n" +
+ String source =
+ "public class X01 {\n" +
+ "/**\n" +
+ " * @category test\n" +
+ " */\n" +
+ "void foo() {\n" +
+ "}\n" +
"}\n";
formatSource(source,
- "public class X01 {\n" +
- " /**\n" +
- " * @category test\n" +
- " */\n" +
- " void foo() {\n" +
- " }\n" +
+ "public class X01 {\n" +
+ " /**\n" +
+ " * @category test\n" +
+ " */\n" +
+ " void foo() {\n" +
+ " }\n" +
"}\n"
);
}
public void testBug238920b() throws JavaModelException {
- String source =
- "public class X02 {\n" +
- "/**\n" +
- " * Test for bug 238920\n" +
- " * @category test\n" +
- " */\n" +
- "void foo() {\n" +
- "}\n" +
+ String source =
+ "public class X02 {\n" +
+ "/**\n" +
+ " * Test for bug 238920\n" +
+ " * @category test\n" +
+ " */\n" +
+ "void foo() {\n" +
+ "}\n" +
"}\n";
formatSource(source,
- "public class X02 {\n" +
- " /**\n" +
- " * Test for bug 238920\n" +
- " * \n" +
- " * @category test\n" +
- " */\n" +
- " void foo() {\n" +
- " }\n" +
+ "public class X02 {\n" +
+ " /**\n" +
+ " * Test for bug 238920\n" +
+ " * \n" +
+ " * @category test\n" +
+ " */\n" +
+ " void foo() {\n" +
+ " }\n" +
"}\n"
);
}
public void testBug238920c() throws JavaModelException {
- String source =
- "public class X03 {\n" +
- "/**\n" +
- " * @category test\n" +
- " * @return zero\n" +
- " */\n" +
- "int foo() {\n" +
- " return 0;\n" +
- "}\n" +
+ String source =
+ "public class X03 {\n" +
+ "/**\n" +
+ " * @category test\n" +
+ " * @return zero\n" +
+ " */\n" +
+ "int foo() {\n" +
+ " return 0;\n" +
+ "}\n" +
"}\n";
formatSource(source,
- "public class X03 {\n" +
- " /**\n" +
- " * @category test\n" +
- " * @return zero\n" +
- " */\n" +
- " int foo() {\n" +
- " return 0;\n" +
- " }\n" +
+ "public class X03 {\n" +
+ " /**\n" +
+ " * @category test\n" +
+ " * @return zero\n" +
+ " */\n" +
+ " int foo() {\n" +
+ " return 0;\n" +
+ " }\n" +
"}\n"
);
}
@@ -3074,103 +3074,103 @@ public void testBug238920c() throws JavaModelException {
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=239130"
*/
public void testBug239130_default() throws JavaModelException {
- String source =
- "public class X {\n" +
- "\n" +
- " /**\n" +
- " * @see java.lang.String\n" +
- " * \n" +
- " * Formatter should keep empty line above\n" +
- " */\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "public class X {\n" +
- "\n" +
- " /**\n" +
- " * @see java.lang.String\n" +
- " * \n" +
- " * Formatter should keep empty line above\n" +
- " */\n" +
- " void foo() {\n" +
- " }\n" +
+ String source =
+ "public class X {\n" +
+ "\n" +
+ " /**\n" +
+ " * @see java.lang.String\n" +
+ " * \n" +
+ " * Formatter should keep empty line above\n" +
+ " */\n" +
+ " void foo() {\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "public class X {\n" +
+ "\n" +
+ " /**\n" +
+ " * @see java.lang.String\n" +
+ " * \n" +
+ " * Formatter should keep empty line above\n" +
+ " */\n" +
+ " void foo() {\n" +
+ " }\n" +
"}\n"
);
}
public void testBug239130_clearBlankLines() throws JavaModelException {
this.formatterPrefs.comment_clear_blank_lines_in_javadoc_comment = true;
- String source =
- "public class X {\n" +
- "\n" +
- " /**\n" +
- " * @see java.lang.String\n" +
- " * \n" +
- " * Formatter should keep empty line above\n" +
- " */\n" +
- " void foo() {\n" +
- " }\n" +
+ String source =
+ "public class X {\n" +
+ "\n" +
+ " /**\n" +
+ " * @see java.lang.String\n" +
+ " * \n" +
+ " * Formatter should keep empty line above\n" +
+ " */\n" +
+ " void foo() {\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X {\n" +
- "\n" +
- " /**\n" +
- " * @see java.lang.String Formatter should keep empty line above\n" +
- " */\n" +
- " void foo() {\n" +
- " }\n" +
+ "public class X {\n" +
+ "\n" +
+ " /**\n" +
+ " * @see java.lang.String Formatter should keep empty line above\n" +
+ " */\n" +
+ " void foo() {\n" +
+ " }\n" +
"}\n"
);
}
public void testBug239130_preserveLineBreaks() throws JavaModelException {
this.formatterPrefs.join_lines_in_comments = false;
- String source =
- "public class X {\n" +
- "\n" +
- " /**\n" +
- " * @see java.lang.String\n" +
- " * \n" +
- " * Formatter should keep empty line above\n" +
- " */\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "public class X {\n" +
- "\n" +
- " /**\n" +
- " * @see java.lang.String\n" +
- " * \n" +
- " * Formatter should keep empty line above\n" +
- " */\n" +
- " void foo() {\n" +
- " }\n" +
+ String source =
+ "public class X {\n" +
+ "\n" +
+ " /**\n" +
+ " * @see java.lang.String\n" +
+ " * \n" +
+ " * Formatter should keep empty line above\n" +
+ " */\n" +
+ " void foo() {\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "public class X {\n" +
+ "\n" +
+ " /**\n" +
+ " * @see java.lang.String\n" +
+ " * \n" +
+ " * Formatter should keep empty line above\n" +
+ " */\n" +
+ " void foo() {\n" +
+ " }\n" +
"}\n"
);
}
public void testBug239130_clearBlankLines_preserveLineBreaks() throws JavaModelException {
this.formatterPrefs.join_lines_in_comments = false;
this.formatterPrefs.comment_clear_blank_lines_in_javadoc_comment = true;
- String source =
- "public class X {\n" +
- "\n" +
- " /**\n" +
- " * @see java.lang.String\n" +
- " * \n" +
- " * Formatter should keep empty line above\n" +
- " */\n" +
- " void foo() {\n" +
- " }\n" +
+ String source =
+ "public class X {\n" +
+ "\n" +
+ " /**\n" +
+ " * @see java.lang.String\n" +
+ " * \n" +
+ " * Formatter should keep empty line above\n" +
+ " */\n" +
+ " void foo() {\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X {\n" +
- "\n" +
- " /**\n" +
- " * @see java.lang.String\n" +
- " * Formatter should keep empty line above\n" +
- " */\n" +
- " void foo() {\n" +
- " }\n" +
+ "public class X {\n" +
+ "\n" +
+ " /**\n" +
+ " * @see java.lang.String\n" +
+ " * Formatter should keep empty line above\n" +
+ " */\n" +
+ " void foo() {\n" +
+ " }\n" +
"}\n"
);
}
@@ -3178,89 +3178,89 @@ public void testBug239130_clearBlankLines_preserveLineBreaks() throws JavaModelE
public void testBug239130_196124_default() throws JavaModelException {
useOldCommentWidthCounting();
useOldJavadocTagsFormatting();
- String source =
- "public class X {\n" +
- "\n" +
- " /**\n" +
- " * The foo method.\n" +
- " * foo is a substitute for bar.\n" +
- " * \n" +
- " * @param param1 The first parameter\n" +
- " * @param param2\n" +
- " * The second parameter.\n" +
- " * If <b>null</b>the first parameter is used\n" +
- " */\n" +
- " public void foo(Object param1, Object param2) {\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "public class X {\n" +
- "\n" +
- " /**\n" +
- " * The foo method. foo is a substitute for bar.\n" +
- " * \n" +
- " * @param param1\n" +
- " * The first parameter\n" +
- " * @param param2\n" +
- " * The second parameter. If <b>null</b>the first parameter is\n" +
- " * used\n" +
- " */\n" +
- " public void foo(Object param1, Object param2) {\n" +
- " }\n" +
+ String source =
+ "public class X {\n" +
+ "\n" +
+ " /**\n" +
+ " * The foo method.\n" +
+ " * foo is a substitute for bar.\n" +
+ " * \n" +
+ " * @param param1 The first parameter\n" +
+ " * @param param2\n" +
+ " * The second parameter.\n" +
+ " * If <b>null</b>the first parameter is used\n" +
+ " */\n" +
+ " public void foo(Object param1, Object param2) {\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "public class X {\n" +
+ "\n" +
+ " /**\n" +
+ " * The foo method. foo is a substitute for bar.\n" +
+ " * \n" +
+ " * @param param1\n" +
+ " * The first parameter\n" +
+ " * @param param2\n" +
+ " * The second parameter. If <b>null</b>the first parameter is\n" +
+ " * used\n" +
+ " */\n" +
+ " public void foo(Object param1, Object param2) {\n" +
+ " }\n" +
"}\n"
);
}
public void testBug239130_196124() throws JavaModelException {
this.formatterPrefs.join_lines_in_comments = false;
useOldJavadocTagsFormatting();
- String source =
- "public class X {\n" +
- "\n" +
- " /**\n" +
- " * The foo method.\n" +
- " * foo is a substitute for bar.\n" +
- " * \n" +
- " * @param param1 The first parameter\n" +
- " * @param param2\n" +
- " * The second parameter.\n" +
- " * If <b>null</b>the first parameter is used\n" +
- " */\n" +
- " public void foo(Object param1, Object param2) {\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "public class X {\n" +
- "\n" +
- " /**\n" +
+ String source =
+ "public class X {\n" +
+ "\n" +
+ " /**\n" +
+ " * The foo method.\n" +
+ " * foo is a substitute for bar.\n" +
+ " * \n" +
+ " * @param param1 The first parameter\n" +
+ " * @param param2\n" +
+ " * The second parameter.\n" +
+ " * If <b>null</b>the first parameter is used\n" +
+ " */\n" +
+ " public void foo(Object param1, Object param2) {\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "public class X {\n" +
+ "\n" +
+ " /**\n" +
" * The foo method.\n" +
- " * foo is a substitute for bar.\n" +
- " * \n" +
- " * @param param1\n" +
- " * The first parameter\n" +
- " * @param param2\n" +
- " * The second parameter.\n" +
- " * If <b>null</b>the first parameter is used\n" +
- " */\n" +
- " public void foo(Object param1, Object param2) {\n" +
- " }\n" +
+ " * foo is a substitute for bar.\n" +
+ " * \n" +
+ " * @param param1\n" +
+ " * The first parameter\n" +
+ " * @param param2\n" +
+ " * The second parameter.\n" +
+ " * If <b>null</b>the first parameter is used\n" +
+ " */\n" +
+ " public void foo(Object param1, Object param2) {\n" +
+ " }\n" +
"}\n"
);
}
// duplicate bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=96696
public void testBug239130_96696_block_default() throws JavaModelException {
- String source =
- "public class Test {\n" +
- "\n" +
- " /*\n" +
- " * Conceptually, all viewers perform two primary tasks:\n" +
- " * \n" +
- " * - They help adapt your domain objects into viewable entities\n" +
- " * \n" +
- " * - They provide notifications when the viewable entities are selected or\n" +
- " * changed through the UI\n" +
- " */\n" +
- " public void foo() {\n" +
- " }\n" +
+ String source =
+ "public class Test {\n" +
+ "\n" +
+ " /*\n" +
+ " * Conceptually, all viewers perform two primary tasks:\n" +
+ " * \n" +
+ " * - They help adapt your domain objects into viewable entities\n" +
+ " * \n" +
+ " * - They provide notifications when the viewable entities are selected or\n" +
+ " * changed through the UI\n" +
+ " */\n" +
+ " public void foo() {\n" +
+ " }\n" +
"}\n";
formatSource(source, source);
}
@@ -3268,139 +3268,139 @@ public void testBug239130_96696_block_clearBlankLines() throws JavaModelExceptio
useOldCommentWidthCounting();
this.formatterPrefs.join_wrapped_lines = false;
this.formatterPrefs.comment_clear_blank_lines_in_block_comment = true;
- String source =
- "public class Test {\n" +
- "\n" +
- " /*\n" +
- " * Conceptually, all viewers perform two primary tasks:\n" +
- " * \n" +
- " * - They help adapt your domain objects into viewable entities\n" +
- " * \n" +
- " * - They provide notifications when the viewable entities are selected or\n" +
- " * changed through the UI\n" +
- " */\n" +
- " public void foo() {\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "public class Test {\n" +
- "\n" +
- " /*\n" +
- " * Conceptually, all viewers perform two primary tasks: - They help adapt\n" +
- " * your domain objects into viewable entities - They provide notifications\n" +
- " * when the viewable entities are selected or changed through the UI\n" +
- " */\n" +
- " public void foo() {\n" +
- " }\n" +
+ String source =
+ "public class Test {\n" +
+ "\n" +
+ " /*\n" +
+ " * Conceptually, all viewers perform two primary tasks:\n" +
+ " * \n" +
+ " * - They help adapt your domain objects into viewable entities\n" +
+ " * \n" +
+ " * - They provide notifications when the viewable entities are selected or\n" +
+ " * changed through the UI\n" +
+ " */\n" +
+ " public void foo() {\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "public class Test {\n" +
+ "\n" +
+ " /*\n" +
+ " * Conceptually, all viewers perform two primary tasks: - They help adapt\n" +
+ " * your domain objects into viewable entities - They provide notifications\n" +
+ " * when the viewable entities are selected or changed through the UI\n" +
+ " */\n" +
+ " public void foo() {\n" +
+ " }\n" +
"}\n"
);
}
public void testBug239130_96696_block_clearBlankLines_preserveLineBreaks() throws JavaModelException {
this.formatterPrefs.join_lines_in_comments = false;
this.formatterPrefs.comment_clear_blank_lines_in_block_comment = true;
- String source =
- "public class Test {\n" +
- "\n" +
- " /*\n" +
- " * Conceptually, all viewers perform two primary tasks:\n" +
- " * \n" +
- " * - They help adapt your domain objects into viewable entities\n" +
- " * \n" +
- " * - They provide notifications when the viewable entities are selected or\n" +
- " * changed through the UI\n" +
- " */\n" +
- " public void foo() {\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "public class Test {\n" +
- "\n" +
- " /*\n" +
- " * Conceptually, all viewers perform two primary tasks:\n" +
- " * - They help adapt your domain objects into viewable entities\n" +
- " * - They provide notifications when the viewable entities are selected or\n" +
- " * changed through the UI\n" +
- " */\n" +
- " public void foo() {\n" +
- " }\n" +
+ String source =
+ "public class Test {\n" +
+ "\n" +
+ " /*\n" +
+ " * Conceptually, all viewers perform two primary tasks:\n" +
+ " * \n" +
+ " * - They help adapt your domain objects into viewable entities\n" +
+ " * \n" +
+ " * - They provide notifications when the viewable entities are selected or\n" +
+ " * changed through the UI\n" +
+ " */\n" +
+ " public void foo() {\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "public class Test {\n" +
+ "\n" +
+ " /*\n" +
+ " * Conceptually, all viewers perform two primary tasks:\n" +
+ " * - They help adapt your domain objects into viewable entities\n" +
+ " * - They provide notifications when the viewable entities are selected or\n" +
+ " * changed through the UI\n" +
+ " */\n" +
+ " public void foo() {\n" +
+ " }\n" +
"}\n"
);
}
public void testBug239130_96696_javadoc_default() throws JavaModelException {
- String source =
- "public class Test {\n" +
- "\n" +
- " /**\n" +
- " * Conceptually, all viewers perform two primary tasks:\n" +
- " * \n" +
- " * - They help adapt your domain objects into viewable entities\n" +
- " * \n" +
- " * - They provide notifications when the viewable entities are selected or\n" +
- " * changed through the UI\n" +
- " */\n" +
- " public void foo() {\n" +
- " }\n" +
+ String source =
+ "public class Test {\n" +
+ "\n" +
+ " /**\n" +
+ " * Conceptually, all viewers perform two primary tasks:\n" +
+ " * \n" +
+ " * - They help adapt your domain objects into viewable entities\n" +
+ " * \n" +
+ " * - They provide notifications when the viewable entities are selected or\n" +
+ " * changed through the UI\n" +
+ " */\n" +
+ " public void foo() {\n" +
+ " }\n" +
"}\n";
formatSource(source, source);
}
public void testBug239130_96696_javadoc_clearBlankLines() throws JavaModelException {
useOldCommentWidthCounting();
this.formatterPrefs.comment_clear_blank_lines_in_javadoc_comment = true;
- String source =
- "public class Test {\n" +
- "\n" +
- " /**\n" +
- " * Conceptually, all viewers perform two primary tasks:\n" +
- " * \n" +
- " * - They help adapt your domain objects into viewable entities\n" +
- " * \n" +
- " * - They provide notifications when the viewable entities are selected or\n" +
- " * changed through the UI\n" +
- " */\n" +
- " public void foo() {\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "public class Test {\n" +
- "\n" +
- " /**\n" +
- " * Conceptually, all viewers perform two primary tasks: - They help adapt\n" +
- " * your domain objects into viewable entities - They provide notifications\n" +
- " * when the viewable entities are selected or changed through the UI\n" +
- " */\n" +
- " public void foo() {\n" +
- " }\n" +
+ String source =
+ "public class Test {\n" +
+ "\n" +
+ " /**\n" +
+ " * Conceptually, all viewers perform two primary tasks:\n" +
+ " * \n" +
+ " * - They help adapt your domain objects into viewable entities\n" +
+ " * \n" +
+ " * - They provide notifications when the viewable entities are selected or\n" +
+ " * changed through the UI\n" +
+ " */\n" +
+ " public void foo() {\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "public class Test {\n" +
+ "\n" +
+ " /**\n" +
+ " * Conceptually, all viewers perform two primary tasks: - They help adapt\n" +
+ " * your domain objects into viewable entities - They provide notifications\n" +
+ " * when the viewable entities are selected or changed through the UI\n" +
+ " */\n" +
+ " public void foo() {\n" +
+ " }\n" +
"}\n"
);
}
public void testBug239130_96696_javadoc_clearBlankLines_preserveLineBreaks() throws JavaModelException {
this.formatterPrefs.join_lines_in_comments = false;
this.formatterPrefs.comment_clear_blank_lines_in_javadoc_comment = true;
- String source =
- "public class Test {\n" +
- "\n" +
- " /**\n" +
- " * Conceptually, all viewers perform two primary tasks:\n" +
- " * \n" +
- " * - They help adapt your domain objects into viewable entities\n" +
- " * \n" +
- " * - They provide notifications when the viewable entities are selected or\n" +
- " * changed through the UI\n" +
- " */\n" +
- " public void foo() {\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "public class Test {\n" +
- "\n" +
- " /**\n" +
- " * Conceptually, all viewers perform two primary tasks:\n" +
- " * - They help adapt your domain objects into viewable entities\n" +
- " * - They provide notifications when the viewable entities are selected or\n" +
- " * changed through the UI\n" +
- " */\n" +
- " public void foo() {\n" +
- " }\n" +
+ String source =
+ "public class Test {\n" +
+ "\n" +
+ " /**\n" +
+ " * Conceptually, all viewers perform two primary tasks:\n" +
+ " * \n" +
+ " * - They help adapt your domain objects into viewable entities\n" +
+ " * \n" +
+ " * - They provide notifications when the viewable entities are selected or\n" +
+ " * changed through the UI\n" +
+ " */\n" +
+ " public void foo() {\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "public class Test {\n" +
+ "\n" +
+ " /**\n" +
+ " * Conceptually, all viewers perform two primary tasks:\n" +
+ " * - They help adapt your domain objects into viewable entities\n" +
+ " * - They provide notifications when the viewable entities are selected or\n" +
+ " * changed through the UI\n" +
+ " */\n" +
+ " public void foo() {\n" +
+ " }\n" +
"}\n"
);
}
@@ -3411,84 +3411,84 @@ public void testBug239130_96696_javadoc_clearBlankLines_preserveLineBreaks() thr
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=239719"
*/
public void testBug239719() throws JavaModelException {
- String source =
- "/**\n" +
- " * <pre>\n" +
- " * public class Test implements Runnable\n" +
- " * {\n" +
- " * @Override\n" +
- " * public void run()\n" +
- " * { \n" +
- " * // Hello really bad Ganymede formatter !!!\n" +
- " * // Shit happens when somebody tries to change a running system\n" +
- " * System.out.println(\"Press Shift+Ctrl+F to format\");\n" +
- " * }\n" +
- " * }</pre>\n" +
- " */\n" +
- " public class Test \n" +
- " {\n" +
+ String source =
+ "/**\n" +
+ " * <pre>\n" +
+ " * public class Test implements Runnable\n" +
+ " * {\n" +
+ " * @Override\n" +
+ " * public void run()\n" +
+ " * { \n" +
+ " * // Hello really bad Ganymede formatter !!!\n" +
+ " * // Shit happens when somebody tries to change a running system\n" +
+ " * System.out.println(\"Press Shift+Ctrl+F to format\");\n" +
+ " * }\n" +
+ " * }</pre>\n" +
+ " */\n" +
+ " public class Test \n" +
+ " {\n" +
" }\n";
formatSource(source,
- "/**\n" +
- " * <pre>\n" +
- " * public class Test implements Runnable {\n" +
- " * &#64;Override\n" +
- " * public void run() {\n" +
- " * // Hello really bad Ganymede formatter !!!\n" +
- " * // Shit happens when somebody tries to change a running system\n" +
- " * System.out.println(\"Press Shift+Ctrl+F to format\");\n" +
- " * }\n" +
- " * }\n" +
- " * </pre>\n" +
- " */\n" +
- "public class Test {\n" +
+ "/**\n" +
+ " * <pre>\n" +
+ " * public class Test implements Runnable {\n" +
+ " * &#64;Override\n" +
+ " * public void run() {\n" +
+ " * // Hello really bad Ganymede formatter !!!\n" +
+ " * // Shit happens when somebody tries to change a running system\n" +
+ " * System.out.println(\"Press Shift+Ctrl+F to format\");\n" +
+ " * }\n" +
+ " * }\n" +
+ " * </pre>\n" +
+ " */\n" +
+ "public class Test {\n" +
"}\n"
);
}
public void testBug239719b() throws JavaModelException {
useOldCommentWidthCounting();
- String source =
- "public class X01 {\n" +
- " \n" +
- " private int fLength;\n" +
- " private int fOffset;\n" +
- "\n" +
- " /**\n" +
- " * Returns the inclusive end position of this edit. The inclusive end\n" +
- " * position denotes the last character of the region manipulated by\n" +
- " * this edit. The returned value is the result of the following\n" +
- " * calculation:\n" +
- " * <pre>\n" +
- " * getOffset() + getLength() - 1;\n" +
- " * <pre>\n" +
- " * \n" +
- " * @return the inclusive end position\n" +
- " */\n" +
- " public final int getInclusiveEnd() {\n" +
- " return fOffset + fLength - 1;\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "public class X01 {\n" +
- "\n" +
- " private int fLength;\n" +
- " private int fOffset;\n" +
- "\n" +
- " /**\n" +
- " * Returns the inclusive end position of this edit. The inclusive end\n" +
- " * position denotes the last character of the region manipulated by this\n" +
- " * edit. The returned value is the result of the following calculation:\n" +
- " * \n" +
- " * <pre>\n" +
- " * getOffset() + getLength() - 1;\n" +
- " * \n" +
- " * <pre>\n" +
- " * \n" +
- " * @return the inclusive end position\n" +
- " */\n" +
- " public final int getInclusiveEnd() {\n" +
- " return fOffset + fLength - 1;\n" +
- " }\n" +
+ String source =
+ "public class X01 {\n" +
+ " \n" +
+ " private int fLength;\n" +
+ " private int fOffset;\n" +
+ "\n" +
+ " /**\n" +
+ " * Returns the inclusive end position of this edit. The inclusive end\n" +
+ " * position denotes the last character of the region manipulated by\n" +
+ " * this edit. The returned value is the result of the following\n" +
+ " * calculation:\n" +
+ " * <pre>\n" +
+ " * getOffset() + getLength() - 1;\n" +
+ " * <pre>\n" +
+ " * \n" +
+ " * @return the inclusive end position\n" +
+ " */\n" +
+ " public final int getInclusiveEnd() {\n" +
+ " return fOffset + fLength - 1;\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "public class X01 {\n" +
+ "\n" +
+ " private int fLength;\n" +
+ " private int fOffset;\n" +
+ "\n" +
+ " /**\n" +
+ " * Returns the inclusive end position of this edit. The inclusive end\n" +
+ " * position denotes the last character of the region manipulated by this\n" +
+ " * edit. The returned value is the result of the following calculation:\n" +
+ " * \n" +
+ " * <pre>\n" +
+ " * getOffset() + getLength() - 1;\n" +
+ " * \n" +
+ " * <pre>\n" +
+ " * \n" +
+ " * @return the inclusive end position\n" +
+ " */\n" +
+ " public final int getInclusiveEnd() {\n" +
+ " return fOffset + fLength - 1;\n" +
+ " }\n" +
"}\n"
);
}
@@ -3499,43 +3499,43 @@ public void testBug239719b() throws JavaModelException {
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=239941"
*/
public void testBug239941() throws JavaModelException {
- String source =
- "public class X01 {\n" +
- "\n" +
- " /**\n" +
- " * <pre>\n" +
- " * Unclosed pre tag\n" +
- " */\n" +
- " int foo;\n" +
- "\n" +
- " /**\n" +
- " * Gets the signers of this class.\n" +
- " *\n" +
- " * @return the signers of this class, or null if there are no signers. In\n" +
- " * particular, this method returns null if this object represents\n" +
- " * a primitive type or void.\n" +
- " * @since JDK1.1\n" +
- " */\n" +
- " public native Object[] getSigners();\n" +
- "}\n";
- formatSource(source,
- "public class X01 {\n" +
- "\n" +
- " /**\n" +
- " * <pre>\n" +
- " * Unclosed pre tag\n" +
- " */\n" +
- " int foo;\n" +
- "\n" +
- " /**\n" +
- " * Gets the signers of this class.\n" +
- " *\n" +
- " * @return the signers of this class, or null if there are no signers. In\n" +
- " * particular, this method returns null if this object represents a\n" +
- " * primitive type or void.\n" +
- " * @since JDK1.1\n" +
- " */\n" +
- " public native Object[] getSigners();\n" +
+ String source =
+ "public class X01 {\n" +
+ "\n" +
+ " /**\n" +
+ " * <pre>\n" +
+ " * Unclosed pre tag\n" +
+ " */\n" +
+ " int foo;\n" +
+ "\n" +
+ " /**\n" +
+ " * Gets the signers of this class.\n" +
+ " *\n" +
+ " * @return the signers of this class, or null if there are no signers. In\n" +
+ " * particular, this method returns null if this object represents\n" +
+ " * a primitive type or void.\n" +
+ " * @since JDK1.1\n" +
+ " */\n" +
+ " public native Object[] getSigners();\n" +
+ "}\n";
+ formatSource(source,
+ "public class X01 {\n" +
+ "\n" +
+ " /**\n" +
+ " * <pre>\n" +
+ " * Unclosed pre tag\n" +
+ " */\n" +
+ " int foo;\n" +
+ "\n" +
+ " /**\n" +
+ " * Gets the signers of this class.\n" +
+ " *\n" +
+ " * @return the signers of this class, or null if there are no signers. In\n" +
+ " * particular, this method returns null if this object represents a\n" +
+ " * primitive type or void.\n" +
+ " * @since JDK1.1\n" +
+ " */\n" +
+ " public native Object[] getSigners();\n" +
"}\n"
);
}
@@ -3546,38 +3546,38 @@ public void testBug239941() throws JavaModelException {
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=240686"
*/
public void testBug240686() throws JavaModelException {
- String source =
- "public class Test {\n" +
- "\n" +
- "/** \n" +
- " * <pre>{ }</pre>\n" +
- " * \n" +
- " * <table>\n" +
- " * <tr>{ \"1\",\n" +
- " * \"2\"}\n" +
- " * </tr>\n" +
- " * </table>\n" +
- " */\n" +
- "void foo() {}\n" +
+ String source =
+ "public class Test {\n" +
+ "\n" +
+ "/** \n" +
+ " * <pre>{ }</pre>\n" +
+ " * \n" +
+ " * <table>\n" +
+ " * <tr>{ \"1\",\n" +
+ " * \"2\"}\n" +
+ " * </tr>\n" +
+ " * </table>\n" +
+ " */\n" +
+ "void foo() {}\n" +
"}\n";
// output is different than 3.3 one: <tr> is considered as new line tag
// hence the text inside the tag is put on a new line
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " /**\n" +
- " * <pre>\n" +
- " * {}\n" +
- " * </pre>\n" +
- " * \n" +
- " * <table>\n" +
- " * <tr>\n" +
- " * { \"1\", \"2\"}\n" +
- " * </tr>\n" +
- " * </table>\n" +
- " */\n" +
- " void foo() {\n" +
- " }\n" +
+ "public class Test {\n" +
+ "\n" +
+ " /**\n" +
+ " * <pre>\n" +
+ " * {}\n" +
+ " * </pre>\n" +
+ " * \n" +
+ " * <table>\n" +
+ " * <tr>\n" +
+ " * { \"1\", \"2\"}\n" +
+ " * </tr>\n" +
+ " * </table>\n" +
+ " */\n" +
+ " void foo() {\n" +
+ " }\n" +
"}\n"
);
}
@@ -3589,31 +3589,31 @@ public void testBug240686() throws JavaModelException {
*/
public void testBug241345() throws JavaModelException {
this.formatterPrefs.comment_format_html = false;
- String source =
- "/**\n" +
- " * <p>Should not format HTML paragraph</p>\n" +
- " */\n" +
- "public interface Test {\n" +
- " /**\n" +
- " * \n" +
- " * These possibilities include: <ul><li>Formatting of header\n" +
- " * comments.</li><li>Formatting of Javadoc tags</li></ul>\n" +
- " */\n" +
- " int bar();\n" +
- "\n" +
- "}\n";
- formatSource(source,
- "/**\n" +
- " * <p>Should not format HTML paragraph</p>\n" +
- " */\n" +
- "public interface Test {\n" +
- " /**\n" +
- " * \n" +
- " * These possibilities include: <ul><li>Formatting of header\n" +
- " * comments.</li><li>Formatting of Javadoc tags</li></ul>\n" +
- " */\n" +
- " int bar();\n" +
- "\n" +
+ String source =
+ "/**\n" +
+ " * <p>Should not format HTML paragraph</p>\n" +
+ " */\n" +
+ "public interface Test {\n" +
+ " /**\n" +
+ " * \n" +
+ " * These possibilities include: <ul><li>Formatting of header\n" +
+ " * comments.</li><li>Formatting of Javadoc tags</li></ul>\n" +
+ " */\n" +
+ " int bar();\n" +
+ "\n" +
+ "}\n";
+ formatSource(source,
+ "/**\n" +
+ " * <p>Should not format HTML paragraph</p>\n" +
+ " */\n" +
+ "public interface Test {\n" +
+ " /**\n" +
+ " * \n" +
+ " * These possibilities include: <ul><li>Formatting of header\n" +
+ " * comments.</li><li>Formatting of Javadoc tags</li></ul>\n" +
+ " */\n" +
+ " int bar();\n" +
+ "\n" +
"}\n"
);
}
@@ -3624,29 +3624,29 @@ public void testBug241345() throws JavaModelException {
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=241687"
*/
public void testBug241687() throws JavaModelException {
- String source =
- "public interface Test {\n" +
- "\n" +
- "/*---------------------\n" +
- " * END OF SETS AND GETS\n" +
- " * test test test test test test test\n" +
- "test test test test test test \n" +
- " * \n" +
- "*\n" +
- " *---------------------*/\n" +
- "void foo();\n" +
- "}\n";
- formatSource(source,
- "public interface Test {\n" +
- "\n" +
- " /*---------------------\n" +
- " * END OF SETS AND GETS\n" +
- " * test test test test test test test\n" +
- " test test test test test test \n" +
- " * \n" +
- " *\n" +
- " *---------------------*/\n" +
- " void foo();\n" +
+ String source =
+ "public interface Test {\n" +
+ "\n" +
+ "/*---------------------\n" +
+ " * END OF SETS AND GETS\n" +
+ " * test test test test test test test\n" +
+ "test test test test test test \n" +
+ " * \n" +
+ "*\n" +
+ " *---------------------*/\n" +
+ "void foo();\n" +
+ "}\n";
+ formatSource(source,
+ "public interface Test {\n" +
+ "\n" +
+ " /*---------------------\n" +
+ " * END OF SETS AND GETS\n" +
+ " * test test test test test test test\n" +
+ " test test test test test test \n" +
+ " * \n" +
+ " *\n" +
+ " *---------------------*/\n" +
+ " void foo();\n" +
"}\n"
);
}
@@ -3658,15 +3658,15 @@ public void testBug241687() throws JavaModelException {
*/
public void testBug251133() throws JavaModelException {
setFormatLineCommentOnFirstColumn();
- String source =
- "public class X01 {\n" +
- "// int a = 1;\n" +
- "// int b = 2;\n" +
+ String source =
+ "public class X01 {\n" +
+ "// int a = 1;\n" +
+ "// int b = 2;\n" +
"}";
formatSource(source,
- "public class X01 {\n" +
- " // int a = 1;\n" +
- " // int b = 2;\n" +
+ "public class X01 {\n" +
+ " // int a = 1;\n" +
+ " // int b = 2;\n" +
"}"
);
}
@@ -3674,13 +3674,13 @@ public void testBug251133a() throws JavaModelException {
this.formatterPrefs.comment_format_line_comment = true;
this.formatterPrefs.comment_format_line_comment_starting_on_first_column = true;
this.formatterPrefs.never_indent_line_comments_on_first_column = false;
- String source =
- "public class X {\n" +
- "// first column comment \n" +
+ String source =
+ "public class X {\n" +
+ "// first column comment \n" +
"}";
formatSource(source,
- "public class X {\n" +
- " // first column comment\n" +
+ "public class X {\n" +
+ " // first column comment\n" +
"}"
);
}
@@ -3688,13 +3688,13 @@ public void testBug251133b() throws JavaModelException {
this.formatterPrefs.comment_format_line_comment = true;
this.formatterPrefs.comment_format_line_comment_starting_on_first_column = true;
this.formatterPrefs.never_indent_line_comments_on_first_column = true;
- String source =
- "public class X {\n" +
- "// first column comment \n" +
+ String source =
+ "public class X {\n" +
+ "// first column comment \n" +
"}";
formatSource(source,
- "public class X {\n" +
- "// first column comment\n" +
+ "public class X {\n" +
+ "// first column comment\n" +
"}"
);
}
@@ -3702,9 +3702,9 @@ public void testBug251133c() throws JavaModelException {
this.formatterPrefs.comment_format_line_comment = true;
this.formatterPrefs.comment_format_line_comment_starting_on_first_column = false;
this.formatterPrefs.never_indent_line_comments_on_first_column = false;
- String source =
- "public class X {\n" +
- "// first column comment \n" +
+ String source =
+ "public class X {\n" +
+ "// first column comment \n" +
"}";
formatSource(source);
}
@@ -3712,9 +3712,9 @@ public void testBug251133d() throws JavaModelException {
this.formatterPrefs.comment_format_line_comment = true;
this.formatterPrefs.comment_format_line_comment_starting_on_first_column = false;
this.formatterPrefs.never_indent_line_comments_on_first_column = true;
- String source =
- "public class X {\n" +
- "// first column comment \n" +
+ String source =
+ "public class X {\n" +
+ "// first column comment \n" +
"}";
formatSource(source);
}
@@ -3722,13 +3722,13 @@ public void testBug251133e() throws JavaModelException {
this.formatterPrefs.comment_format_line_comment = false;
this.formatterPrefs.comment_format_line_comment_starting_on_first_column = true;
this.formatterPrefs.never_indent_line_comments_on_first_column = false;
- String source =
- "public class X {\n" +
- "// first column comment \n" +
+ String source =
+ "public class X {\n" +
+ "// first column comment \n" +
"}";
formatSource(source,
- "public class X {\n" +
- " // first column comment \n" +
+ "public class X {\n" +
+ " // first column comment \n" +
"}"
);
}
@@ -3736,13 +3736,13 @@ public void testBug251133f() throws JavaModelException {
this.formatterPrefs.comment_format_line_comment = false;
this.formatterPrefs.comment_format_line_comment_starting_on_first_column = true;
this.formatterPrefs.never_indent_line_comments_on_first_column = true;
- String source =
- "public class X {\n" +
- "// first column comment \n" +
+ String source =
+ "public class X {\n" +
+ "// first column comment \n" +
"}";
formatSource(source,
- "public class X {\n" +
- "// first column comment \n" +
+ "public class X {\n" +
+ "// first column comment \n" +
"}"
);
}
@@ -3750,13 +3750,13 @@ public void testBug251133g() throws JavaModelException {
this.formatterPrefs.comment_format_line_comment = false;
this.formatterPrefs.comment_format_line_comment_starting_on_first_column = false;
this.formatterPrefs.never_indent_line_comments_on_first_column = false;
- String source =
- "public class X {\n" +
- "// first column comment \n" +
+ String source =
+ "public class X {\n" +
+ "// first column comment \n" +
"}";
formatSource(source,
- "public class X {\n" +
- " // first column comment \n" +
+ "public class X {\n" +
+ " // first column comment \n" +
"}"
);
}
@@ -3764,9 +3764,9 @@ public void testBug251133h() throws JavaModelException {
this.formatterPrefs.comment_format_line_comment = false;
this.formatterPrefs.comment_format_line_comment_starting_on_first_column = false;
this.formatterPrefs.never_indent_line_comments_on_first_column = true;
- String source =
- "public class X {\n" +
- "// first column comment \n" +
+ String source =
+ "public class X {\n" +
+ "// first column comment \n" +
"}";
formatSource(source);
}
@@ -3777,254 +3777,254 @@ public void testBug251133h() throws JavaModelException {
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=256799"
*/
public void testBug256799_Line01() throws JavaModelException {
- String source =
- "public class X01 {\n" +
- " int foo(int value) {\n" +
- " int test = 0;\n" +
- " switch (value) {\n" +
- " case 1:\n" +
- " test = value;\n" +
- " //$FALL-THROUGH$\n" +
- " case 2:\n" +
- " test = value;\n" +
- " // $FALL-THROUGH$\n" +
- " case 3:\n" +
- " test = value;\n" +
- " // $FALL-THROUGH$\n" +
- " case 4:\n" +
- " test = value;\n" +
- " // $FALL-THROUGH$ \n" +
- " default:\n" +
- " test = -1;\n" +
- " break;\n" +
- " }\n" +
- " return test;\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "public class X01 {\n" +
- " int foo(int value) {\n" +
- " int test = 0;\n" +
- " switch (value) {\n" +
- " case 1:\n" +
- " test = value;\n" +
- " //$FALL-THROUGH$\n" +
- " case 2:\n" +
- " test = value;\n" +
- " // $FALL-THROUGH$\n" +
- " case 3:\n" +
- " test = value;\n" +
- " // $FALL-THROUGH$\n" +
- " case 4:\n" +
- " test = value;\n" +
- " // $FALL-THROUGH$\n" +
- " default:\n" +
- " test = -1;\n" +
- " break;\n" +
- " }\n" +
- " return test;\n" +
- " }\n" +
+ String source =
+ "public class X01 {\n" +
+ " int foo(int value) {\n" +
+ " int test = 0;\n" +
+ " switch (value) {\n" +
+ " case 1:\n" +
+ " test = value;\n" +
+ " //$FALL-THROUGH$\n" +
+ " case 2:\n" +
+ " test = value;\n" +
+ " // $FALL-THROUGH$\n" +
+ " case 3:\n" +
+ " test = value;\n" +
+ " // $FALL-THROUGH$\n" +
+ " case 4:\n" +
+ " test = value;\n" +
+ " // $FALL-THROUGH$ \n" +
+ " default:\n" +
+ " test = -1;\n" +
+ " break;\n" +
+ " }\n" +
+ " return test;\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "public class X01 {\n" +
+ " int foo(int value) {\n" +
+ " int test = 0;\n" +
+ " switch (value) {\n" +
+ " case 1:\n" +
+ " test = value;\n" +
+ " //$FALL-THROUGH$\n" +
+ " case 2:\n" +
+ " test = value;\n" +
+ " // $FALL-THROUGH$\n" +
+ " case 3:\n" +
+ " test = value;\n" +
+ " // $FALL-THROUGH$\n" +
+ " case 4:\n" +
+ " test = value;\n" +
+ " // $FALL-THROUGH$\n" +
+ " default:\n" +
+ " test = -1;\n" +
+ " break;\n" +
+ " }\n" +
+ " return test;\n" +
+ " }\n" +
"}\n"
);
}
public void testBug256799_Line02() throws JavaModelException {
- String source =
- "public class X01 {\n" +
- " int foo(int value) {\n" +
- " int test = 0;\n" +
- " switch (value) {\n" +
- " case 1:\n" +
- " test = value;\n" +
- " //$FALL-THROUGH$ with text after \n" +
- " case 2:\n" +
- " test = value;\n" +
- " // $FALL-THROUGH$ with text after \n" +
- " case 3:\n" +
- " test = value;\n" +
- " // $FALL-THROUGH$ with text after \n" +
- " case 4:\n" +
- " test = value;\n" +
- " // $FALL-THROUGH$ with text after \n" +
- " default:\n" +
- " test = -1;\n" +
- " break;\n" +
- " }\n" +
- " return test;\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "public class X01 {\n" +
- " int foo(int value) {\n" +
- " int test = 0;\n" +
- " switch (value) {\n" +
- " case 1:\n" +
- " test = value;\n" +
- " //$FALL-THROUGH$ with text after\n" +
- " case 2:\n" +
- " test = value;\n" +
- " // $FALL-THROUGH$ with text after\n" +
- " case 3:\n" +
- " test = value;\n" +
- " // $FALL-THROUGH$ with text after\n" +
- " case 4:\n" +
- " test = value;\n" +
- " // $FALL-THROUGH$ with text after\n" +
- " default:\n" +
- " test = -1;\n" +
- " break;\n" +
- " }\n" +
- " return test;\n" +
- " }\n" +
+ String source =
+ "public class X01 {\n" +
+ " int foo(int value) {\n" +
+ " int test = 0;\n" +
+ " switch (value) {\n" +
+ " case 1:\n" +
+ " test = value;\n" +
+ " //$FALL-THROUGH$ with text after \n" +
+ " case 2:\n" +
+ " test = value;\n" +
+ " // $FALL-THROUGH$ with text after \n" +
+ " case 3:\n" +
+ " test = value;\n" +
+ " // $FALL-THROUGH$ with text after \n" +
+ " case 4:\n" +
+ " test = value;\n" +
+ " // $FALL-THROUGH$ with text after \n" +
+ " default:\n" +
+ " test = -1;\n" +
+ " break;\n" +
+ " }\n" +
+ " return test;\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "public class X01 {\n" +
+ " int foo(int value) {\n" +
+ " int test = 0;\n" +
+ " switch (value) {\n" +
+ " case 1:\n" +
+ " test = value;\n" +
+ " //$FALL-THROUGH$ with text after\n" +
+ " case 2:\n" +
+ " test = value;\n" +
+ " // $FALL-THROUGH$ with text after\n" +
+ " case 3:\n" +
+ " test = value;\n" +
+ " // $FALL-THROUGH$ with text after\n" +
+ " case 4:\n" +
+ " test = value;\n" +
+ " // $FALL-THROUGH$ with text after\n" +
+ " default:\n" +
+ " test = -1;\n" +
+ " break;\n" +
+ " }\n" +
+ " return test;\n" +
+ " }\n" +
"}\n"
);
}
public void testBug256799_Block01() throws JavaModelException {
- String source =
- "public class X01 {\n" +
- " int foo(int value) {\n" +
- " int test = 0;\n" +
- " switch (value) {\n" +
- " case 1:\n" +
- " test = value;\n" +
- " /*$FALL-THROUGH$*/\n" +
- " case 2:\n" +
- " test = value;\n" +
- " /* $FALL-THROUGH$*/\n" +
- " case 3:\n" +
- " test = value;\n" +
- " /*$FALL-THROUGH$ */\n" +
- " case 4:\n" +
- " test = value;\n" +
- " /* $FALL-THROUGH$ */\n" +
- " case 5:\n" +
- " test = value;\n" +
- " /* $FALL-THROUGH$*/\n" +
- " case 6:\n" +
- " test = value;\n" +
- " /* $FALL-THROUGH$ */\n" +
- " case 7:\n" +
- " test = value;\n" +
- " /*$FALL-THROUGH$ */\n" +
- " case 8:\n" +
- " test = value;\n" +
- " /* $FALL-THROUGH$ */\n" +
- " default:\n" +
- " test = -1;\n" +
- " break;\n" +
- " }\n" +
- " return test;\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "public class X01 {\n" +
- " int foo(int value) {\n" +
- " int test = 0;\n" +
- " switch (value) {\n" +
- " case 1:\n" +
- " test = value;\n" +
- " /* $FALL-THROUGH$ */\n" +
- " case 2:\n" +
- " test = value;\n" +
- " /* $FALL-THROUGH$ */\n" +
- " case 3:\n" +
- " test = value;\n" +
- " /* $FALL-THROUGH$ */\n" +
- " case 4:\n" +
- " test = value;\n" +
- " /* $FALL-THROUGH$ */\n" +
- " case 5:\n" +
- " test = value;\n" +
- " /* $FALL-THROUGH$ */\n" +
- " case 6:\n" +
- " test = value;\n" +
- " /* $FALL-THROUGH$ */\n" +
- " case 7:\n" +
- " test = value;\n" +
- " /* $FALL-THROUGH$ */\n" +
- " case 8:\n" +
- " test = value;\n" +
- " /* $FALL-THROUGH$ */\n" +
- " default:\n" +
- " test = -1;\n" +
- " break;\n" +
- " }\n" +
- " return test;\n" +
- " }\n" +
+ String source =
+ "public class X01 {\n" +
+ " int foo(int value) {\n" +
+ " int test = 0;\n" +
+ " switch (value) {\n" +
+ " case 1:\n" +
+ " test = value;\n" +
+ " /*$FALL-THROUGH$*/\n" +
+ " case 2:\n" +
+ " test = value;\n" +
+ " /* $FALL-THROUGH$*/\n" +
+ " case 3:\n" +
+ " test = value;\n" +
+ " /*$FALL-THROUGH$ */\n" +
+ " case 4:\n" +
+ " test = value;\n" +
+ " /* $FALL-THROUGH$ */\n" +
+ " case 5:\n" +
+ " test = value;\n" +
+ " /* $FALL-THROUGH$*/\n" +
+ " case 6:\n" +
+ " test = value;\n" +
+ " /* $FALL-THROUGH$ */\n" +
+ " case 7:\n" +
+ " test = value;\n" +
+ " /*$FALL-THROUGH$ */\n" +
+ " case 8:\n" +
+ " test = value;\n" +
+ " /* $FALL-THROUGH$ */\n" +
+ " default:\n" +
+ " test = -1;\n" +
+ " break;\n" +
+ " }\n" +
+ " return test;\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "public class X01 {\n" +
+ " int foo(int value) {\n" +
+ " int test = 0;\n" +
+ " switch (value) {\n" +
+ " case 1:\n" +
+ " test = value;\n" +
+ " /* $FALL-THROUGH$ */\n" +
+ " case 2:\n" +
+ " test = value;\n" +
+ " /* $FALL-THROUGH$ */\n" +
+ " case 3:\n" +
+ " test = value;\n" +
+ " /* $FALL-THROUGH$ */\n" +
+ " case 4:\n" +
+ " test = value;\n" +
+ " /* $FALL-THROUGH$ */\n" +
+ " case 5:\n" +
+ " test = value;\n" +
+ " /* $FALL-THROUGH$ */\n" +
+ " case 6:\n" +
+ " test = value;\n" +
+ " /* $FALL-THROUGH$ */\n" +
+ " case 7:\n" +
+ " test = value;\n" +
+ " /* $FALL-THROUGH$ */\n" +
+ " case 8:\n" +
+ " test = value;\n" +
+ " /* $FALL-THROUGH$ */\n" +
+ " default:\n" +
+ " test = -1;\n" +
+ " break;\n" +
+ " }\n" +
+ " return test;\n" +
+ " }\n" +
"}\n"
);
}
public void testBug256799_Block02() throws JavaModelException {
- String source =
- "public class X01 {\n" +
- " int foo(int value) {\n" +
- " int test = 0;\n" +
- " switch (value) {\n" +
- " case 1:\n" +
- " test = value;\n" +
- " /*$FALL-THROUGH$with text after*/\n" +
- " case 2:\n" +
- " test = value;\n" +
- " /* $FALL-THROUGH$with text after*/\n" +
- " case 3:\n" +
- " test = value;\n" +
- " /*$FALL-THROUGH$ with text after */\n" +
- " case 4:\n" +
- " test = value;\n" +
- " /* $FALL-THROUGH$ with text after */\n" +
- " case 5:\n" +
- " test = value;\n" +
- " /* $FALL-THROUGH$ with text after*/\n" +
- " case 6:\n" +
- " test = value;\n" +
- " /* $FALL-THROUGH$ with text after */\n" +
- " case 7:\n" +
- " test = value;\n" +
- " /*$FALL-THROUGH$ with text after */\n" +
- " case 8:\n" +
- " test = value;\n" +
- " /* $FALL-THROUGH$ with text after */\n" +
- " default:\n" +
- " test = -1;\n" +
- " break;\n" +
- " }\n" +
- " return test;\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "public class X01 {\n" +
- " int foo(int value) {\n" +
- " int test = 0;\n" +
- " switch (value) {\n" +
- " case 1:\n" +
- " test = value;\n" +
- " /* $FALL-THROUGH$with text after */\n" +
- " case 2:\n" +
- " test = value;\n" +
- " /* $FALL-THROUGH$with text after */\n" +
- " case 3:\n" +
- " test = value;\n" +
- " /* $FALL-THROUGH$ with text after */\n" +
- " case 4:\n" +
- " test = value;\n" +
- " /* $FALL-THROUGH$ with text after */\n" +
- " case 5:\n" +
- " test = value;\n" +
- " /* $FALL-THROUGH$ with text after */\n" +
- " case 6:\n" +
- " test = value;\n" +
- " /* $FALL-THROUGH$ with text after */\n" +
- " case 7:\n" +
- " test = value;\n" +
- " /* $FALL-THROUGH$ with text after */\n" +
- " case 8:\n" +
- " test = value;\n" +
- " /* $FALL-THROUGH$ with text after */\n" +
- " default:\n" +
- " test = -1;\n" +
- " break;\n" +
- " }\n" +
- " return test;\n" +
- " }\n" +
+ String source =
+ "public class X01 {\n" +
+ " int foo(int value) {\n" +
+ " int test = 0;\n" +
+ " switch (value) {\n" +
+ " case 1:\n" +
+ " test = value;\n" +
+ " /*$FALL-THROUGH$with text after*/\n" +
+ " case 2:\n" +
+ " test = value;\n" +
+ " /* $FALL-THROUGH$with text after*/\n" +
+ " case 3:\n" +
+ " test = value;\n" +
+ " /*$FALL-THROUGH$ with text after */\n" +
+ " case 4:\n" +
+ " test = value;\n" +
+ " /* $FALL-THROUGH$ with text after */\n" +
+ " case 5:\n" +
+ " test = value;\n" +
+ " /* $FALL-THROUGH$ with text after*/\n" +
+ " case 6:\n" +
+ " test = value;\n" +
+ " /* $FALL-THROUGH$ with text after */\n" +
+ " case 7:\n" +
+ " test = value;\n" +
+ " /*$FALL-THROUGH$ with text after */\n" +
+ " case 8:\n" +
+ " test = value;\n" +
+ " /* $FALL-THROUGH$ with text after */\n" +
+ " default:\n" +
+ " test = -1;\n" +
+ " break;\n" +
+ " }\n" +
+ " return test;\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "public class X01 {\n" +
+ " int foo(int value) {\n" +
+ " int test = 0;\n" +
+ " switch (value) {\n" +
+ " case 1:\n" +
+ " test = value;\n" +
+ " /* $FALL-THROUGH$with text after */\n" +
+ " case 2:\n" +
+ " test = value;\n" +
+ " /* $FALL-THROUGH$with text after */\n" +
+ " case 3:\n" +
+ " test = value;\n" +
+ " /* $FALL-THROUGH$ with text after */\n" +
+ " case 4:\n" +
+ " test = value;\n" +
+ " /* $FALL-THROUGH$ with text after */\n" +
+ " case 5:\n" +
+ " test = value;\n" +
+ " /* $FALL-THROUGH$ with text after */\n" +
+ " case 6:\n" +
+ " test = value;\n" +
+ " /* $FALL-THROUGH$ with text after */\n" +
+ " case 7:\n" +
+ " test = value;\n" +
+ " /* $FALL-THROUGH$ with text after */\n" +
+ " case 8:\n" +
+ " test = value;\n" +
+ " /* $FALL-THROUGH$ with text after */\n" +
+ " default:\n" +
+ " test = -1;\n" +
+ " break;\n" +
+ " }\n" +
+ " return test;\n" +
+ " }\n" +
"}\n"
);
}
@@ -4039,32 +4039,32 @@ public void testBug254998() throws JavaModelException {
this.formatterPrefs.comment_format_block_comment = false;
this.formatterPrefs.comment_format_line_comment = false;
this.formatterPrefs.comment_format_header = true;
- String source =
- "/**\n" +
- " * Test for\n" +
- " * bug 254998\n" +
- " */\n" +
- "package javadoc;\n" +
- "\n" +
- "/**\n" +
- " * Test for\n" +
- " * bug 254998\n" +
- " */\n" +
- "public class Test {\n" +
- "\n" +
- "}\n";
- formatSource(source,
- "/**\n" +
- " * Test for bug 254998\n" +
- " */\n" +
- "package javadoc;\n" +
- "\n" +
- "/**\n" +
- " * Test for\n" +
- " * bug 254998\n" +
- " */\n" +
- "public class Test {\n" +
- "\n" +
+ String source =
+ "/**\n" +
+ " * Test for\n" +
+ " * bug 254998\n" +
+ " */\n" +
+ "package javadoc;\n" +
+ "\n" +
+ "/**\n" +
+ " * Test for\n" +
+ " * bug 254998\n" +
+ " */\n" +
+ "public class Test {\n" +
+ "\n" +
+ "}\n";
+ formatSource(source,
+ "/**\n" +
+ " * Test for bug 254998\n" +
+ " */\n" +
+ "package javadoc;\n" +
+ "\n" +
+ "/**\n" +
+ " * Test for\n" +
+ " * bug 254998\n" +
+ " */\n" +
+ "public class Test {\n" +
+ "\n" +
"}\n"
);
}
@@ -4073,37 +4073,37 @@ public void testBug254998b() throws JavaModelException {
this.formatterPrefs.comment_format_block_comment = false;
this.formatterPrefs.comment_format_line_comment = false;
this.formatterPrefs.comment_format_header = true;
- String source =
- "/*\n" +
- " * Test for\n" +
- " * bug 254998\n" +
- " */\n" +
- "package block;\n" +
- "\n" +
- "/*\n" +
- " * Test for\n" +
- " * bug 254998\n" +
- " */\n" +
- "public class Test {\n" +
- "/*\n" +
- " * Test for\n" +
- " * bug 254998\n" +
- " */\n" +
- "}\n";
- formatSource(source,
- "/*\n" +
- " * Test for bug 254998\n" +
- " */\n" +
- "package block;\n" +
- "\n" +
- "/*\n" +
- " * Test for bug 254998\n" +
- " */\n" +
- "public class Test {\n" +
- " /*\n" +
- " * Test for\n" +
- " * bug 254998\n" +
- " */\n" +
+ String source =
+ "/*\n" +
+ " * Test for\n" +
+ " * bug 254998\n" +
+ " */\n" +
+ "package block;\n" +
+ "\n" +
+ "/*\n" +
+ " * Test for\n" +
+ " * bug 254998\n" +
+ " */\n" +
+ "public class Test {\n" +
+ "/*\n" +
+ " * Test for\n" +
+ " * bug 254998\n" +
+ " */\n" +
+ "}\n";
+ formatSource(source,
+ "/*\n" +
+ " * Test for bug 254998\n" +
+ " */\n" +
+ "package block;\n" +
+ "\n" +
+ "/*\n" +
+ " * Test for bug 254998\n" +
+ " */\n" +
+ "public class Test {\n" +
+ " /*\n" +
+ " * Test for\n" +
+ " * bug 254998\n" +
+ " */\n" +
"}\n"
);
}
@@ -4112,21 +4112,21 @@ public void testBug254998c() throws JavaModelException {
this.formatterPrefs.comment_format_block_comment = false;
this.formatterPrefs.comment_format_line_comment = false;
this.formatterPrefs.comment_format_header = true;
- String source =
- "// Test for bug 254998\n" +
- "package line;\n" +
- "\n" +
- "// Test for bug 254998\n" +
- "public class Test {\n" +
- "// Test for bug 254998\n" +
+ String source =
+ "// Test for bug 254998\n" +
+ "package line;\n" +
+ "\n" +
+ "// Test for bug 254998\n" +
+ "public class Test {\n" +
+ "// Test for bug 254998\n" +
"}\n";
formatSource(source,
- "// Test for bug 254998\n" +
- "package line;\n" +
- "\n" +
- "// Test for bug 254998\n" +
- "public class Test {\n" +
- " // Test for bug 254998\n" +
+ "// Test for bug 254998\n" +
+ "package line;\n" +
+ "\n" +
+ "// Test for bug 254998\n" +
+ "public class Test {\n" +
+ " // Test for bug 254998\n" +
"}\n"
);
}
@@ -4137,344 +4137,344 @@ public void testBug254998c() throws JavaModelException {
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=260011"
*/
public void testBug260011() throws JavaModelException {
- String source =
- "public class Test {\n" +
- " /**\n" +
- " * some comment text here\n" +
- " * <p style=\"font-variant:small-caps;\">\n" +
- " * some text to be styled a certain way\n" +
- " * </p>\n" +
- " */\n" +
- " void foo() {}\n" +
- "\n" +
- "}\n";
- formatSource(source,
- "public class Test {\n" +
- " /**\n" +
- " * some comment text here\n" +
- " * <p style=\"font-variant:small-caps;\">\n" +
- " * some text to be styled a certain way\n" +
- " * </p>\n" +
- " */\n" +
- " void foo() {\n" +
- " }\n" +
- "\n" +
+ String source =
+ "public class Test {\n" +
+ " /**\n" +
+ " * some comment text here\n" +
+ " * <p style=\"font-variant:small-caps;\">\n" +
+ " * some text to be styled a certain way\n" +
+ " * </p>\n" +
+ " */\n" +
+ " void foo() {}\n" +
+ "\n" +
+ "}\n";
+ formatSource(source,
+ "public class Test {\n" +
+ " /**\n" +
+ " * some comment text here\n" +
+ " * <p style=\"font-variant:small-caps;\">\n" +
+ " * some text to be styled a certain way\n" +
+ " * </p>\n" +
+ " */\n" +
+ " void foo() {\n" +
+ " }\n" +
+ "\n" +
"}\n"
);
}
public void testBug260011_01() throws JavaModelException {
- String source =
- "public class Test {\n" +
- " /**\n" +
- " * some comment text here\n" +
- " * <ul style=\"font-variant:small-caps;\"><li style=\"font-variant:small-caps;\">\n" +
- " * some text to be styled a certain way</li></ul>\n" +
- " * end of comment\n" +
- " */\n" +
- " void foo() {}\n" +
- "\n" +
- "}\n";
- formatSource(source,
- "public class Test {\n" +
- " /**\n" +
- " * some comment text here\n" +
- " * <ul style=\"font-variant:small-caps;\">\n" +
- " * <li style=\"font-variant:small-caps;\">some text to be styled a certain\n" +
- " * way</li>\n" +
- " * </ul>\n" +
- " * end of comment\n" +
- " */\n" +
- " void foo() {\n" +
- " }\n" +
- "\n" +
+ String source =
+ "public class Test {\n" +
+ " /**\n" +
+ " * some comment text here\n" +
+ " * <ul style=\"font-variant:small-caps;\"><li style=\"font-variant:small-caps;\">\n" +
+ " * some text to be styled a certain way</li></ul>\n" +
+ " * end of comment\n" +
+ " */\n" +
+ " void foo() {}\n" +
+ "\n" +
+ "}\n";
+ formatSource(source,
+ "public class Test {\n" +
+ " /**\n" +
+ " * some comment text here\n" +
+ " * <ul style=\"font-variant:small-caps;\">\n" +
+ " * <li style=\"font-variant:small-caps;\">some text to be styled a certain\n" +
+ " * way</li>\n" +
+ " * </ul>\n" +
+ " * end of comment\n" +
+ " */\n" +
+ " void foo() {\n" +
+ " }\n" +
+ "\n" +
"}\n"
);
}
public void testBug260011_02() throws JavaModelException {
- String source =
- "public class Test {\n" +
- " /**\n" +
- " * some comment text here\n" +
- " * <pre style=\"font-variant:small-caps;\">\n" +
- " * some text\n" +
- " * to be styled\n" +
- " * a certain way\n" +
- " * \n" +
- " * </pre>\n" +
- " * end of comment\n" +
- " */\n" +
- " void foo() {}\n" +
- "\n" +
- "}\n";
- formatSource(source,
- "public class Test {\n" +
- " /**\n" +
- " * some comment text here\n" +
- " * \n" +
- " * <pre style=\"font-variant:small-caps;\">\n" +
- " * some text\n" +
- " * to be styled\n" +
- " * a certain way\n" +
- " * \n" +
- " * </pre>\n" +
- " * \n" +
- " * end of comment\n" +
- " */\n" +
- " void foo() {\n" +
- " }\n" +
- "\n" +
+ String source =
+ "public class Test {\n" +
+ " /**\n" +
+ " * some comment text here\n" +
+ " * <pre style=\"font-variant:small-caps;\">\n" +
+ " * some text\n" +
+ " * to be styled\n" +
+ " * a certain way\n" +
+ " * \n" +
+ " * </pre>\n" +
+ " * end of comment\n" +
+ " */\n" +
+ " void foo() {}\n" +
+ "\n" +
+ "}\n";
+ formatSource(source,
+ "public class Test {\n" +
+ " /**\n" +
+ " * some comment text here\n" +
+ " * \n" +
+ " * <pre style=\"font-variant:small-caps;\">\n" +
+ " * some text\n" +
+ " * to be styled\n" +
+ " * a certain way\n" +
+ " * \n" +
+ " * </pre>\n" +
+ " * \n" +
+ " * end of comment\n" +
+ " */\n" +
+ " void foo() {\n" +
+ " }\n" +
+ "\n" +
"}\n"
);
}
public void testBug260011_03() throws JavaModelException {
- String source =
- "public class Test {\n" +
- "\n" +
- " /**\n" +
- " * Indent char is a space char but not a line delimiters.\n" +
- " * <code>== Character.isWhitespace(ch) && ch != \'\\n\' && ch != \'\\r\'</code>\n" +
- " */\n" +
- " public void foo() {\n" +
- " }\n" +
+ String source =
+ "public class Test {\n" +
+ "\n" +
+ " /**\n" +
+ " * Indent char is a space char but not a line delimiters.\n" +
+ " * <code>== Character.isWhitespace(ch) && ch != \'\\n\' && ch != \'\\r\'</code>\n" +
+ " */\n" +
+ " public void foo() {\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " /**\n" +
- " * Indent char is a space char but not a line delimiters.\n" +
- " * <code>== Character.isWhitespace(ch) && ch != \'\\n\' && ch != \'\\r\'</code>\n" +
- " */\n" +
- " public void foo() {\n" +
- " }\n" +
+ "public class Test {\n" +
+ "\n" +
+ " /**\n" +
+ " * Indent char is a space char but not a line delimiters.\n" +
+ " * <code>== Character.isWhitespace(ch) && ch != \'\\n\' && ch != \'\\r\'</code>\n" +
+ " */\n" +
+ " public void foo() {\n" +
+ " }\n" +
"}\n"
);
}
public void testBug260011_04() throws JavaModelException {
- String source =
- "public class Test {\n" +
- "\n" +
- " /**\n" +
- " * The list of variable declaration fragments (element type: \n" +
- " * <code VariableDeclarationFragment</code>). Defaults to an empty list.\n" +
- " */\n" +
- " int field;\n" +
+ String source =
+ "public class Test {\n" +
+ "\n" +
+ " /**\n" +
+ " * The list of variable declaration fragments (element type: \n" +
+ " * <code VariableDeclarationFragment</code>). Defaults to an empty list.\n" +
+ " */\n" +
+ " int field;\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " /**\n" +
- " * The list of variable declaration fragments (element type: <code\n" +
- " * VariableDeclarationFragment</code>). Defaults to an empty list.\n" +
- " */\n" +
- " int field;\n" +
+ "public class Test {\n" +
+ "\n" +
+ " /**\n" +
+ " * The list of variable declaration fragments (element type: <code\n" +
+ " * VariableDeclarationFragment</code>). Defaults to an empty list.\n" +
+ " */\n" +
+ " int field;\n" +
"}\n"
);
}
public void testBug260011_05() throws JavaModelException {
- String source =
- "public class Test {\n" +
- "\n" +
- " /**\n" +
- " * Compares version strings.\n" +
- " * \n" +
- " * @return result of comparison, as integer;\n" +
- " * <code><0 if left is less than right </code>\n" +
- " * <code>0 if left is equals to right</code>\n" +
- " * <code>>0 if left is greater than right</code>\n" +
- " */\n" +
- " int foo() {\n" +
- " return 0;\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "public class Test {\n" +
- "\n" +
- " /**\n" +
- " * Compares version strings.\n" +
- " * \n" +
- " * @return result of comparison, as integer;\n" +
- " * <code><0 if left is less than right </code>\n" +
- " * <code>0 if left is equals to right</code>\n" +
- " * <code>>0 if left is greater than right</code>\n" +
- " */\n" +
- " int foo() {\n" +
- " return 0;\n" +
- " }\n" +
+ String source =
+ "public class Test {\n" +
+ "\n" +
+ " /**\n" +
+ " * Compares version strings.\n" +
+ " * \n" +
+ " * @return result of comparison, as integer;\n" +
+ " * <code><0 if left is less than right </code>\n" +
+ " * <code>0 if left is equals to right</code>\n" +
+ " * <code>>0 if left is greater than right</code>\n" +
+ " */\n" +
+ " int foo() {\n" +
+ " return 0;\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "public class Test {\n" +
+ "\n" +
+ " /**\n" +
+ " * Compares version strings.\n" +
+ " * \n" +
+ " * @return result of comparison, as integer;\n" +
+ " * <code><0 if left is less than right </code>\n" +
+ " * <code>0 if left is equals to right</code>\n" +
+ " * <code>>0 if left is greater than right</code>\n" +
+ " */\n" +
+ " int foo() {\n" +
+ " return 0;\n" +
+ " }\n" +
"}\n"
);
}
public void testBug260011_06() throws JavaModelException {
useOldCommentWidthCounting();
useOldJavadocTagsFormatting();
- String source =
- "public interface Test {\n" +
- "\n" +
- " /**\n" +
- " * Returns the length of this array.\n" +
- " * \n" +
- " * @return the length of this array\n" +
- " * @exception DebugException if this method fails. Reasons include:<ul>\n" +
- " * <li>Failure communicating with the VM. The DebugException\'s\n" +
- " * status code contains the underlying exception responsible for\n" +
- " * the failure.</li>\n" +
- " * </ul\n" +
- " */\n" +
- " public int getLength();\n" +
- "}\n";
- formatSource(source,
- "public interface Test {\n" +
- "\n" +
- " /**\n" +
- " * Returns the length of this array.\n" +
- " * \n" +
- " * @return the length of this array\n" +
- " * @exception DebugException\n" +
- " * if this method fails. Reasons include:\n" +
- " * <ul>\n" +
- " * <li>Failure communicating with the VM. The\n" +
- " * DebugException\'s status code contains the underlying\n" +
- " * exception responsible for the failure.</li> </ul\n" +
- " */\n" +
- " public int getLength();\n" +
+ String source =
+ "public interface Test {\n" +
+ "\n" +
+ " /**\n" +
+ " * Returns the length of this array.\n" +
+ " * \n" +
+ " * @return the length of this array\n" +
+ " * @exception DebugException if this method fails. Reasons include:<ul>\n" +
+ " * <li>Failure communicating with the VM. The DebugException\'s\n" +
+ " * status code contains the underlying exception responsible for\n" +
+ " * the failure.</li>\n" +
+ " * </ul\n" +
+ " */\n" +
+ " public int getLength();\n" +
+ "}\n";
+ formatSource(source,
+ "public interface Test {\n" +
+ "\n" +
+ " /**\n" +
+ " * Returns the length of this array.\n" +
+ " * \n" +
+ " * @return the length of this array\n" +
+ " * @exception DebugException\n" +
+ " * if this method fails. Reasons include:\n" +
+ " * <ul>\n" +
+ " * <li>Failure communicating with the VM. The\n" +
+ " * DebugException\'s status code contains the underlying\n" +
+ " * exception responsible for the failure.</li> </ul\n" +
+ " */\n" +
+ " public int getLength();\n" +
"}\n"
);
}
public void testBug260011_07() throws JavaModelException {
- String source =
- "public interface Test {\n" +
- "\n" +
- " \n" +
- " /**\n" +
- " * Returns the change directly associated with this change element or <code\n" +
- " * null</code> if the element isn\'t associated with a change.\n" +
- " * \n" +
- " * @return the change or <code>null</code>\n" +
- " */\n" +
- " public String getChange();\n" +
- "}\n";
- formatSource(source,
- "public interface Test {\n" +
- "\n" +
- " /**\n" +
- " * Returns the change directly associated with this change element or <code\n" +
- " * null</code> if the element isn\'t associated with a change.\n" +
- " * \n" +
- " * @return the change or <code>null</code>\n" +
- " */\n" +
- " public String getChange();\n" +
+ String source =
+ "public interface Test {\n" +
+ "\n" +
+ " \n" +
+ " /**\n" +
+ " * Returns the change directly associated with this change element or <code\n" +
+ " * null</code> if the element isn\'t associated with a change.\n" +
+ " * \n" +
+ " * @return the change or <code>null</code>\n" +
+ " */\n" +
+ " public String getChange();\n" +
+ "}\n";
+ formatSource(source,
+ "public interface Test {\n" +
+ "\n" +
+ " /**\n" +
+ " * Returns the change directly associated with this change element or <code\n" +
+ " * null</code> if the element isn\'t associated with a change.\n" +
+ " * \n" +
+ " * @return the change or <code>null</code>\n" +
+ " */\n" +
+ " public String getChange();\n" +
"}\n"
);
}
public void testBug260011_08() throws JavaModelException {
- String source =
- "public interface Test {\n" +
- "\n" +
- " /**\n" +
- " * Answer the element factory for an id, or <code>null</code. if not found.\n" +
- " * @param targetID\n" +
- " * @return\n" +
- " */\n" +
- " public int foo(String targetID);\n" +
+ String source =
+ "public interface Test {\n" +
+ "\n" +
+ " /**\n" +
+ " * Answer the element factory for an id, or <code>null</code. if not found.\n" +
+ " * @param targetID\n" +
+ " * @return\n" +
+ " */\n" +
+ " public int foo(String targetID);\n" +
"}\n";
formatSource(source,
- "public interface Test {\n" +
- "\n" +
- " /**\n" +
- " * Answer the element factory for an id, or <code>null</code. if not found.\n" +
- " * \n" +
- " * @param targetID\n" +
- " * @return\n" +
- " */\n" +
- " public int foo(String targetID);\n" +
+ "public interface Test {\n" +
+ "\n" +
+ " /**\n" +
+ " * Answer the element factory for an id, or <code>null</code. if not found.\n" +
+ " * \n" +
+ " * @param targetID\n" +
+ " * @return\n" +
+ " */\n" +
+ " public int foo(String targetID);\n" +
"}\n"
);
}
public void testBug260011_09() throws JavaModelException {
- String source =
- "public class Test {\n" +
- "\n" +
- " /**\n" +
- " * o Example: baseCE < a << b <<< q << c < d < e * nextCE(X,1) \n" +
- " */\n" +
- " int field;\n" +
+ String source =
+ "public class Test {\n" +
+ "\n" +
+ " /**\n" +
+ " * o Example: baseCE < a << b <<< q << c < d < e * nextCE(X,1) \n" +
+ " */\n" +
+ " int field;\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " /**\n" +
- " * o Example: baseCE < a << b <<< q << c < d < e * nextCE(X,1)\n" +
- " */\n" +
- " int field;\n" +
+ "public class Test {\n" +
+ "\n" +
+ " /**\n" +
+ " * o Example: baseCE < a << b <<< q << c < d < e * nextCE(X,1)\n" +
+ " */\n" +
+ " int field;\n" +
"}\n"
);
}
public void testBug260011_09b() throws JavaModelException {
- String source =
- "public class Test {\n" +
- "\n" +
- " /**\n" +
- " * o Example: baseCE < a < b < q < c < p < e * nextCE(X,1) \n" +
- " */\n" +
- " int field;\n" +
+ String source =
+ "public class Test {\n" +
+ "\n" +
+ " /**\n" +
+ " * o Example: baseCE < a < b < q < c < p < e * nextCE(X,1) \n" +
+ " */\n" +
+ " int field;\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- "\n" +
- " /**\n" +
- " * o Example: baseCE < a < b < q < c < p < e * nextCE(X,1)\n" +
- " */\n" +
- " int field;\n" +
+ "public class Test {\n" +
+ "\n" +
+ " /**\n" +
+ " * o Example: baseCE < a < b < q < c < p < e * nextCE(X,1)\n" +
+ " */\n" +
+ " int field;\n" +
"}\n"
);
}
public void testBug260011_10() throws JavaModelException {
- String source =
- "public interface Test {\n" +
- "\n" +
- " /**\n" +
- " * Creates and opens a dialog to edit the given template.\n" +
- " * <p\n" +
- " * Subclasses may override this method to provide a custom dialog.</p>\n" +
- " */\n" +
- " void foo();\n" +
+ String source =
+ "public interface Test {\n" +
+ "\n" +
+ " /**\n" +
+ " * Creates and opens a dialog to edit the given template.\n" +
+ " * <p\n" +
+ " * Subclasses may override this method to provide a custom dialog.</p>\n" +
+ " */\n" +
+ " void foo();\n" +
"}\n";
formatSource(source,
- "public interface Test {\n" +
- "\n" +
- " /**\n" +
- " * Creates and opens a dialog to edit the given template. <p Subclasses may\n" +
- " * override this method to provide a custom dialog.\n" +
- " * </p>\n" +
- " */\n" +
- " void foo();\n" +
+ "public interface Test {\n" +
+ "\n" +
+ " /**\n" +
+ " * Creates and opens a dialog to edit the given template. <p Subclasses may\n" +
+ " * override this method to provide a custom dialog.\n" +
+ " * </p>\n" +
+ " */\n" +
+ " void foo();\n" +
"}\n"
);
}
public void testBug260011_11() throws JavaModelException {
- String source =
- "public class Test {\n" +
- "\n" +
- " /** \n" +
- " * <p>Binary property IDS_Trinary_Operator (new).</p> \n" +
- " * <p?For programmatic determination of Ideographic Description \n" +
- " * Sequences.</p> \n" +
- " * @stable ICU 2.6\n" +
- " */ \n" +
- " public static final int IDS_TRINARY_OPERATOR = 19; \n" +
- "}\n";
- formatSource(source,
- "public class Test {\n" +
- "\n" +
- " /**\n" +
- " * <p>\n" +
- " * Binary property IDS_Trinary_Operator (new).\n" +
- " * </p>\n" +
- " * <p?For programmatic determination of Ideographic Description Sequences.\n" +
- " * </p>\n" +
- " * \n" +
- " * @stable ICU 2.6\n" +
- " */\n" +
- " public static final int IDS_TRINARY_OPERATOR = 19;\n" +
+ String source =
+ "public class Test {\n" +
+ "\n" +
+ " /** \n" +
+ " * <p>Binary property IDS_Trinary_Operator (new).</p> \n" +
+ " * <p?For programmatic determination of Ideographic Description \n" +
+ " * Sequences.</p> \n" +
+ " * @stable ICU 2.6\n" +
+ " */ \n" +
+ " public static final int IDS_TRINARY_OPERATOR = 19; \n" +
+ "}\n";
+ formatSource(source,
+ "public class Test {\n" +
+ "\n" +
+ " /**\n" +
+ " * <p>\n" +
+ " * Binary property IDS_Trinary_Operator (new).\n" +
+ " * </p>\n" +
+ " * <p?For programmatic determination of Ideographic Description Sequences.\n" +
+ " * </p>\n" +
+ " * \n" +
+ " * @stable ICU 2.6\n" +
+ " */\n" +
+ " public static final int IDS_TRINARY_OPERATOR = 19;\n" +
"}\n"
);
}
@@ -4485,172 +4485,172 @@ public void testBug260011_11() throws JavaModelException {
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=260274"
*/
public void testBug260274() throws JavaModelException {
- String source =
- "class X {\n" +
- "/*\n" +
- " * The formatter should NOT remove * character\n" +
- " * in block comments!\n" +
- " */\n" +
+ String source =
+ "class X {\n" +
+ "/*\n" +
+ " * The formatter should NOT remove * character\n" +
+ " * in block comments!\n" +
+ " */\n" +
"}\n";
formatSource(source,
- "class X {\n" +
- " /*\n" +
- " * The formatter should NOT remove * character in block comments!\n" +
- " */\n" +
+ "class X {\n" +
+ " /*\n" +
+ " * The formatter should NOT remove * character in block comments!\n" +
+ " */\n" +
"}\n"
);
}
public void testBug260274b() throws JavaModelException {
- String source =
- "class X {\n" +
- "/*\n" +
- " * The formatter should keep \'*\' characters\n" +
- " * in block comments!\n" +
- " */\n" +
+ String source =
+ "class X {\n" +
+ "/*\n" +
+ " * The formatter should keep \'*\' characters\n" +
+ " * in block comments!\n" +
+ " */\n" +
"}\n";
formatSource(source,
- "class X {\n" +
- " /*\n" +
- " * The formatter should keep \'*\' characters in block comments!\n" +
- " */\n" +
+ "class X {\n" +
+ " /*\n" +
+ " * The formatter should keep \'*\' characters in block comments!\n" +
+ " */\n" +
"}\n"
);
}
public void testBug260274c() throws JavaModelException {
this.formatterPrefs.join_lines_in_comments = false;
- String source =
- "class X {\n" +
- "/* *********************************************\n" +
- " * Test \n" +
- " */\n" +
+ String source =
+ "class X {\n" +
+ "/* *********************************************\n" +
+ " * Test \n" +
+ " */\n" +
"}\n";
formatSource(source,
- "class X {\n" +
- " /*\n" +
- " * *********************************************\n" +
- " * Test\n" +
- " */\n" +
+ "class X {\n" +
+ " /*\n" +
+ " * *********************************************\n" +
+ " * Test\n" +
+ " */\n" +
"}\n"
);
}
public void testBug260274d() throws JavaModelException {
- String source =
- "class X {\n" +
- "/* *********************************************\n" +
- " * Test \n" +
- " */\n" +
+ String source =
+ "class X {\n" +
+ "/* *********************************************\n" +
+ " * Test \n" +
+ " */\n" +
"}\n";
formatSource(source,
- "class X {\n" +
- " /*\n" +
- " * ********************************************* Test\n" +
- " */\n" +
+ "class X {\n" +
+ " /*\n" +
+ " * ********************************************* Test\n" +
+ " */\n" +
"}\n"
);
}
public void testBug260274e() throws JavaModelException {
useOldCommentWidthCounting();
- String source =
- "class X {\n" +
- "/*\n" +
- " * **************************************************\n" +
- " * ********** Test ********** Test **************\n" +
- " * **************************************************\n" +
- " */\n" +
+ String source =
+ "class X {\n" +
+ "/*\n" +
+ " * **************************************************\n" +
+ " * ********** Test ********** Test **************\n" +
+ " * **************************************************\n" +
+ " */\n" +
"}\n";
formatSource(source,
- "class X {\n" +
- " /*\n" +
- " * ************************************************** ********** Test\n" +
- " * ********** Test **************\n" +
- " * **************************************************\n" +
- " */\n" +
+ "class X {\n" +
+ " /*\n" +
+ " * ************************************************** ********** Test\n" +
+ " * ********** Test **************\n" +
+ " * **************************************************\n" +
+ " */\n" +
"}\n"
);
}
public void testBug260274f() throws JavaModelException {
useOldCommentWidthCounting();
- String source =
- "class X {\n" +
- "/* *****************************************************************************\n" +
- " * Action that allows changing the model providers sort order.\n" +
- " */\n" +
- "void foo() {\n" +
- "}\n" +
+ String source =
+ "class X {\n" +
+ "/* *****************************************************************************\n" +
+ " * Action that allows changing the model providers sort order.\n" +
+ " */\n" +
+ "void foo() {\n" +
+ "}\n" +
"}\n";
formatSource(source,
- "class X {\n" +
- " /*\n" +
- " * *************************************************************************\n" +
- " * **** Action that allows changing the model providers sort order.\n" +
- " */\n" +
- " void foo() {\n" +
- " }\n" +
+ "class X {\n" +
+ " /*\n" +
+ " * *************************************************************************\n" +
+ " * **** Action that allows changing the model providers sort order.\n" +
+ " */\n" +
+ " void foo() {\n" +
+ " }\n" +
"}\n"
);
}
public void testBug260274g() throws JavaModelException {
useOldCommentWidthCounting();
- String source =
- "class X {\n" +
- "/*\n" +
- " * **********************************************************************************\n" +
- " * **********************************************************************************\n" +
- " * **********************************************************************************\n" +
- " * The code below was added to track the view with focus\n" +
- " * in order to support save actions from a view. Remove this\n" +
- " * experimental code if the decision is to not allow views to \n" +
- " * participate in save actions (see bug 10234) \n" +
- " */\n" +
- "}\n";
- formatSource(source,
- "class X {\n" +
- " /*\n" +
- " * *************************************************************************\n" +
- " * *********\n" +
- " * *************************************************************************\n" +
- " * *********\n" +
- " * *************************************************************************\n" +
- " * ********* The code below was added to track the view with focus in order\n" +
- " * to support save actions from a view. Remove this experimental code if the\n" +
- " * decision is to not allow views to participate in save actions (see bug\n" +
- " * 10234)\n" +
- " */\n" +
+ String source =
+ "class X {\n" +
+ "/*\n" +
+ " * **********************************************************************************\n" +
+ " * **********************************************************************************\n" +
+ " * **********************************************************************************\n" +
+ " * The code below was added to track the view with focus\n" +
+ " * in order to support save actions from a view. Remove this\n" +
+ " * experimental code if the decision is to not allow views to \n" +
+ " * participate in save actions (see bug 10234) \n" +
+ " */\n" +
+ "}\n";
+ formatSource(source,
+ "class X {\n" +
+ " /*\n" +
+ " * *************************************************************************\n" +
+ " * *********\n" +
+ " * *************************************************************************\n" +
+ " * *********\n" +
+ " * *************************************************************************\n" +
+ " * ********* The code below was added to track the view with focus in order\n" +
+ " * to support save actions from a view. Remove this experimental code if the\n" +
+ " * decision is to not allow views to participate in save actions (see bug\n" +
+ " * 10234)\n" +
+ " */\n" +
"}\n"
);
}
public void testBug260274h() throws JavaModelException {
- String source =
- "class X {\n" +
- " /**\n" +
- " * @see #spacing(Point)\n" +
- " * * @see #spacing(int, int)\n" +
- " */\n" +
- " public void foo() {\n" +
- " }\n" +
+ String source =
+ "class X {\n" +
+ " /**\n" +
+ " * @see #spacing(Point)\n" +
+ " * * @see #spacing(int, int)\n" +
+ " */\n" +
+ " public void foo() {\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "class X {\n" +
- " /**\n" +
- " * @see #spacing(Point) * @see #spacing(int, int)\n" +
- " */\n" +
- " public void foo() {\n" +
- " }\n" +
+ "class X {\n" +
+ " /**\n" +
+ " * @see #spacing(Point) * @see #spacing(int, int)\n" +
+ " */\n" +
+ " public void foo() {\n" +
+ " }\n" +
"}\n"
);
}
public void testBug260274i() throws JavaModelException {
- String source =
- "class X {\n" +
- "/***********************************************\n" +
- " * Test \n" +
- " */\n" +
+ String source =
+ "class X {\n" +
+ "/***********************************************\n" +
+ " * Test \n" +
+ " */\n" +
"}\n";
formatSource(source,
- "class X {\n" +
- " /***********************************************\n" +
- " * Test\n" +
- " */\n" +
+ "class X {\n" +
+ " /***********************************************\n" +
+ " * Test\n" +
+ " */\n" +
"}\n"
);
}
@@ -4661,44 +4661,44 @@ public void testBug260274i() throws JavaModelException {
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=260276"
*/
public void testBug260276() throws JavaModelException {
- String source =
- "class X {\n" +
- "/* a\n" +
- "comment */\n" +
+ String source =
+ "class X {\n" +
+ "/* a\n" +
+ "comment */\n" +
"}\n";
formatSource(source,
- "class X {\n" +
- " /*\n" +
- " * a comment\n" +
- " */\n" +
+ "class X {\n" +
+ " /*\n" +
+ " * a comment\n" +
+ " */\n" +
"}\n"
);
}
public void testBug260276b() throws JavaModelException {
- String source =
- "class X {\n" +
- "/* a\n" +
- " comment */\n" +
+ String source =
+ "class X {\n" +
+ "/* a\n" +
+ " comment */\n" +
"}\n";
formatSource(source,
- "class X {\n" +
- " /*\n" +
- " * a comment\n" +
- " */\n" +
+ "class X {\n" +
+ " /*\n" +
+ " * a comment\n" +
+ " */\n" +
"}\n"
);
}
public void testBug260276c() throws JavaModelException {
- String source =
- "class X {\n" +
- "/* a\n" +
- " * comment */\n" +
+ String source =
+ "class X {\n" +
+ "/* a\n" +
+ " * comment */\n" +
"}\n";
formatSource(source,
- "class X {\n" +
- " /*\n" +
- " * a comment\n" +
- " */\n" +
+ "class X {\n" +
+ " /*\n" +
+ " * a comment\n" +
+ " */\n" +
"}\n"
);
}
@@ -4709,214 +4709,214 @@ public void testBug260276c() throws JavaModelException {
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=260381"
*/
public void testBug260381() throws JavaModelException {
- String source =
- "/**\n" +
- " * Comments that can be formated in several lines...\n" +
- " * \n" +
- " * @author Myself\n" +
- " * @version {@code The text here should not be formatted.... }\n" +
- " */\n" +
- "public class X01 {\n" +
+ String source =
+ "/**\n" +
+ " * Comments that can be formated in several lines...\n" +
+ " * \n" +
+ " * @author Myself\n" +
+ " * @version {@code The text here should not be formatted.... }\n" +
+ " */\n" +
+ "public class X01 {\n" +
"}\n";
formatSource(source);
}
public void testBug260381a() throws JavaModelException {
- String source =
- "/**\n" +
- " * Comments that can be formated in several lines...\n" +
- " * \n" +
- " * @author Myself\n" +
+ String source =
+ "/**\n" +
+ " * Comments that can be formated in several lines...\n" +
+ " * \n" +
+ " * @author Myself\n" +
" * @version {@code " +
- " * The text here should not be formatted.... }\n" +
- " */\n" +
- "public class X01a {\n" +
+ " * The text here should not be formatted.... }\n" +
+ " */\n" +
+ "public class X01a {\n" +
"}\n";
formatSource(source);
}
public void testBug260381b() throws JavaModelException {
- String source =
- "/**\n" +
- " * Comments that can be formated in several lines...\n" +
- " * \n" +
- " * @author Myself\n" +
- " * @version {@code\n" +
- " * The text here should not be formatted.... }\n" +
- " */\n" +
- "public class X01b {\n" +
+ String source =
+ "/**\n" +
+ " * Comments that can be formated in several lines...\n" +
+ " * \n" +
+ " * @author Myself\n" +
+ " * @version {@code\n" +
+ " * The text here should not be formatted.... }\n" +
+ " */\n" +
+ "public class X01b {\n" +
"}\n";
formatSource(source,
- "/**\n" +
- " * Comments that can be formated in several lines...\n" +
- " * \n" +
- " * @author Myself\n" +
- " * @version {@code\n" +
- " * The text here should not be formatted.... }\n" +
- " */\n" +
- "public class X01b {\n" +
+ "/**\n" +
+ " * Comments that can be formated in several lines...\n" +
+ " * \n" +
+ " * @author Myself\n" +
+ " * @version {@code\n" +
+ " * The text here should not be formatted.... }\n" +
+ " */\n" +
+ "public class X01b {\n" +
"}\n"
);
}
public void testBug260381c() throws JavaModelException {
- String source =
- "/**\n" +
- " * Comments that can be formated in several lines...\n" +
- " * \n" +
- " * @author Myself\n" +
- " * @version {@code \n" +
- " * \n" +
- " \n" +
- " * The text here should not be formatted.... }\n" +
- " */\n" +
- "public class X01c {\n" +
- "}\n";
- formatSource(source,
- "/**\n" +
- " * Comments that can be formated in several lines...\n" +
- " * \n" +
- " * @author Myself\n" +
- " * @version {@code \n" +
- " * \n" +
- " \n" +
- " * The text here should not be formatted.... }\n" +
- " */\n" +
- "public class X01c {\n" +
+ String source =
+ "/**\n" +
+ " * Comments that can be formated in several lines...\n" +
+ " * \n" +
+ " * @author Myself\n" +
+ " * @version {@code \n" +
+ " * \n" +
+ " \n" +
+ " * The text here should not be formatted.... }\n" +
+ " */\n" +
+ "public class X01c {\n" +
+ "}\n";
+ formatSource(source,
+ "/**\n" +
+ " * Comments that can be formated in several lines...\n" +
+ " * \n" +
+ " * @author Myself\n" +
+ " * @version {@code \n" +
+ " * \n" +
+ " \n" +
+ " * The text here should not be formatted.... }\n" +
+ " */\n" +
+ "public class X01c {\n" +
"}\n"
);
}
public void testBug260381d() throws JavaModelException {
- String source =
- "/**\n" +
- " * Comments that can be formated in several lines...\n" +
- " * \n" +
- " * @author Myself\n" +
- " * @version <code> The text here should not be formatted.... </code>\n" +
- " */\n" +
- "public class X02 {\n" +
+ String source =
+ "/**\n" +
+ " * Comments that can be formated in several lines...\n" +
+ " * \n" +
+ " * @author Myself\n" +
+ " * @version <code> The text here should not be formatted.... </code>\n" +
+ " */\n" +
+ "public class X02 {\n" +
"}\n";
formatSource(source);
}
public void testBug260381e() throws JavaModelException {
- String source =
- "/**\n" +
- " * Comments that can be formated in several lines...\n" +
- " * \n" +
- " * @author Myself\n" +
- " * @version\n" +
- " * <code> The text here should not be formatted.... </code>\n" +
- " */\n" +
- "public class X02b {\n" +
+ String source =
+ "/**\n" +
+ " * Comments that can be formated in several lines...\n" +
+ " * \n" +
+ " * @author Myself\n" +
+ " * @version\n" +
+ " * <code> The text here should not be formatted.... </code>\n" +
+ " */\n" +
+ "public class X02b {\n" +
"}\n";
formatSource(source,
- "/**\n" +
- " * Comments that can be formated in several lines...\n" +
- " * \n" +
- " * @author Myself\n" +
- " * @version <code> The text here should not be formatted.... </code>\n" +
- " */\n" +
- "public class X02b {\n" +
+ "/**\n" +
+ " * Comments that can be formated in several lines...\n" +
+ " * \n" +
+ " * @author Myself\n" +
+ " * @version <code> The text here should not be formatted.... </code>\n" +
+ " */\n" +
+ "public class X02b {\n" +
"}\n"
);
}
public void testBug260381f() throws JavaModelException {
- String source =
- "/**\n" +
- " * Comments that can be formated in several lines...\n" +
- " * \n" +
- " * @author Myself\n" +
- " * @see Object <code> The text here should not be formatted.... </code>\n" +
- " */\n" +
- "public class X02c {\n" +
+ String source =
+ "/**\n" +
+ " * Comments that can be formated in several lines...\n" +
+ " * \n" +
+ " * @author Myself\n" +
+ " * @see Object <code> The text here should not be formatted.... </code>\n" +
+ " */\n" +
+ "public class X02c {\n" +
"}\n";
formatSource(source,
- "/**\n" +
- " * Comments that can be formated in several lines...\n" +
- " * \n" +
- " * @author Myself\n" +
- " * @see Object\n" +
- " * <code> The text here should not be formatted.... </code>\n" +
- " */\n" +
- "public class X02c {\n" +
+ "/**\n" +
+ " * Comments that can be formated in several lines...\n" +
+ " * \n" +
+ " * @author Myself\n" +
+ " * @see Object\n" +
+ " * <code> The text here should not be formatted.... </code>\n" +
+ " */\n" +
+ "public class X02c {\n" +
"}\n"
);
}
public void testBug260381g() throws JavaModelException {
- String source =
- "/**\n" +
- " * Comments that can be formated in several lines...\n" +
- " * \n" +
- " * {@code The text here should not be formatted.... }\n" +
- " */\n" +
- "public class X03 {\n" +
+ String source =
+ "/**\n" +
+ " * Comments that can be formated in several lines...\n" +
+ " * \n" +
+ " * {@code The text here should not be formatted.... }\n" +
+ " */\n" +
+ "public class X03 {\n" +
"}\n";
formatSource(source);
}
public void testBug260381h() throws JavaModelException {
- String source =
- "/**\n" +
- " * Comments that can be formated in several lines...\n" +
- " * \n" +
- " * <code> The text here should \n" +
- " * not be formatted.... </code>\n" +
- " */\n" +
- "public class X03b {\n" +
+ String source =
+ "/**\n" +
+ " * Comments that can be formated in several lines...\n" +
+ " * \n" +
+ " * <code> The text here should \n" +
+ " * not be formatted.... </code>\n" +
+ " */\n" +
+ "public class X03b {\n" +
"}\n";
formatSource(source);
}
public void testBug260381i() throws JavaModelException {
- String source =
- "/**\n" +
- " * Comments that can be formated in several lines...\n" +
- " * \n" +
- " * {@code The text here should\n" +
- " * not be formatted.... }\n" +
- " */\n" +
- "public class X03c {\n" +
+ String source =
+ "/**\n" +
+ " * Comments that can be formated in several lines...\n" +
+ " * \n" +
+ " * {@code The text here should\n" +
+ " * not be formatted.... }\n" +
+ " */\n" +
+ "public class X03c {\n" +
"}\n";
formatSource(source,
- "/**\n" +
- " * Comments that can be formated in several lines...\n" +
- " * \n" +
- " * {@code The text here should\n" +
- " * not be formatted.... }\n" +
- " */\n" +
- "public class X03c {\n" +
+ "/**\n" +
+ " * Comments that can be formated in several lines...\n" +
+ " * \n" +
+ " * {@code The text here should\n" +
+ " * not be formatted.... }\n" +
+ " */\n" +
+ "public class X03c {\n" +
"}\n"
);
}
public void testBug260381j() throws JavaModelException {
- String source =
- "/**\n" +
- " * Comments that can be formated in several lines...\n" +
- " * \n" +
- " * {@code \n" +
- " * The text here should\n" +
- " * not \n" +
- " * be formatted.... }\n" +
- " */\n" +
- "public class X03d {\n" +
- "}\n";
- formatSource(source,
- "/**\n" +
- " * Comments that can be formated in several lines...\n" +
- " * \n" +
- " * {@code \n" +
- " * The text here should\n" +
- " * not \n" +
- " * be formatted.... }\n" +
- " */\n" +
- "public class X03d {\n" +
+ String source =
+ "/**\n" +
+ " * Comments that can be formated in several lines...\n" +
+ " * \n" +
+ " * {@code \n" +
+ " * The text here should\n" +
+ " * not \n" +
+ " * be formatted.... }\n" +
+ " */\n" +
+ "public class X03d {\n" +
+ "}\n";
+ formatSource(source,
+ "/**\n" +
+ " * Comments that can be formated in several lines...\n" +
+ " * \n" +
+ " * {@code \n" +
+ " * The text here should\n" +
+ " * not \n" +
+ " * be formatted.... }\n" +
+ " */\n" +
+ "public class X03d {\n" +
"}\n"
);
}
public void testBug260381k() throws JavaModelException {
- String source =
- "/**\n" +
- " * Literal inline tag should also be untouched by the formatter\n" +
- " * \n" +
- " * @version {@literal The text here should not be formatted.... }\n" +
- " */\n" +
- "public class X04 {\n" +
- "\n" +
+ String source =
+ "/**\n" +
+ " * Literal inline tag should also be untouched by the formatter\n" +
+ " * \n" +
+ " * @version {@literal The text here should not be formatted.... }\n" +
+ " */\n" +
+ "public class X04 {\n" +
+ "\n" +
"}\n";
formatSource(source);
}
@@ -4963,508 +4963,508 @@ public void testBug260381_wksp1_01() throws JavaModelException {
}
public void testBug260381_wksp2_01() throws JavaModelException {
useOldJavadocTagsFormatting();
- String source =
- "package wksp2;\n" +
- "public interface I01 {\n" +
- " /**\n" +
- " * Returns the composition of two functions. For {@code f: A->B} and\n" +
- " * {@code g: B->C}, composition is defined as the function h such that\n" +
- " * {@code h(a) == g(f(a))} for each {@code a}.\n" +
- " *\n" +
- " * @see <a href=\"//en.wikipedia.org/wiki/Function_composition\">\n" +
- " * function composition</a>\n" +
- " *\n" +
- " * @param g the second function to apply\n" +
- " * @param f the first function to apply\n" +
- " * @return the composition of {@code f} and {@code g}\n" +
- " */\n" +
- " void foo();\n" +
- "}\n";
- formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public interface I01 {\n" +
- " /**\n" +
- " * Returns the composition of two functions. For {@code f: A->B} and\n" +
- " * {@code g: B->C}, composition is defined as the function h such that\n" +
- " * {@code h(a) == g(f(a))} for each {@code a}.\n" +
- " *\n" +
- " * @see <a href=\"//en.wikipedia.org/wiki/Function_composition\"> function\n" +
- " * composition</a>\n" +
- " *\n" +
- " * @param g\n" +
- " * the second function to apply\n" +
- " * @param f\n" +
- " * the first function to apply\n" +
- " * @return the composition of {@code f} and {@code g}\n" +
- " */\n" +
- " void foo();\n" +
+ String source =
+ "package wksp2;\n" +
+ "public interface I01 {\n" +
+ " /**\n" +
+ " * Returns the composition of two functions. For {@code f: A->B} and\n" +
+ " * {@code g: B->C}, composition is defined as the function h such that\n" +
+ " * {@code h(a) == g(f(a))} for each {@code a}.\n" +
+ " *\n" +
+ " * @see <a href=\"//en.wikipedia.org/wiki/Function_composition\">\n" +
+ " * function composition</a>\n" +
+ " *\n" +
+ " * @param g the second function to apply\n" +
+ " * @param f the first function to apply\n" +
+ " * @return the composition of {@code f} and {@code g}\n" +
+ " */\n" +
+ " void foo();\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp2;\n" +
+ "\n" +
+ "public interface I01 {\n" +
+ " /**\n" +
+ " * Returns the composition of two functions. For {@code f: A->B} and\n" +
+ " * {@code g: B->C}, composition is defined as the function h such that\n" +
+ " * {@code h(a) == g(f(a))} for each {@code a}.\n" +
+ " *\n" +
+ " * @see <a href=\"//en.wikipedia.org/wiki/Function_composition\"> function\n" +
+ " * composition</a>\n" +
+ " *\n" +
+ " * @param g\n" +
+ " * the second function to apply\n" +
+ " * @param f\n" +
+ " * the first function to apply\n" +
+ " * @return the composition of {@code f} and {@code g}\n" +
+ " */\n" +
+ " void foo();\n" +
"}\n"
);
}
public void testBug260381_wksp2_01b() throws JavaModelException {
useOldJavadocTagsFormatting();
- String source =
- "package wksp2;\n" +
- "public interface I01b {\n" +
- " /**\n" +
- " * Returns the composition of two functions. For <code> f: A->B</code> and\n" +
- " * <code> g: B->C</code>, composition is defined as the function h such that\n" +
- " * <code> h(a) == g(f(a))</code> for each <code> a</code>.\n" +
- " *\n" +
- " * @see <a href=\"//en.wikipedia.org/wiki/Function_composition\">\n" +
- " * function composition</a>\n" +
- " *\n" +
- " * @param g the second function to apply\n" +
- " * @param f the first function to apply\n" +
- " * @return the composition of <code> f</code> and <code> g</code>\n" +
- " */\n" +
- " void foo();\n" +
- "}\n";
- formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public interface I01b {\n" +
- " /**\n" +
- " * Returns the composition of two functions. For <code> f: A->B</code> and\n" +
- " * <code> g: B->C</code>, composition is defined as the function h such that\n" +
- " * <code> h(a) == g(f(a))</code> for each <code> a</code>.\n" +
- " *\n" +
- " * @see <a href=\"//en.wikipedia.org/wiki/Function_composition\"> function\n" +
- " * composition</a>\n" +
- " *\n" +
- " * @param g\n" +
- " * the second function to apply\n" +
- " * @param f\n" +
- " * the first function to apply\n" +
- " * @return the composition of <code> f</code> and <code> g</code>\n" +
- " */\n" +
- " void foo();\n" +
+ String source =
+ "package wksp2;\n" +
+ "public interface I01b {\n" +
+ " /**\n" +
+ " * Returns the composition of two functions. For <code> f: A->B</code> and\n" +
+ " * <code> g: B->C</code>, composition is defined as the function h such that\n" +
+ " * <code> h(a) == g(f(a))</code> for each <code> a</code>.\n" +
+ " *\n" +
+ " * @see <a href=\"//en.wikipedia.org/wiki/Function_composition\">\n" +
+ " * function composition</a>\n" +
+ " *\n" +
+ " * @param g the second function to apply\n" +
+ " * @param f the first function to apply\n" +
+ " * @return the composition of <code> f</code> and <code> g</code>\n" +
+ " */\n" +
+ " void foo();\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp2;\n" +
+ "\n" +
+ "public interface I01b {\n" +
+ " /**\n" +
+ " * Returns the composition of two functions. For <code> f: A->B</code> and\n" +
+ " * <code> g: B->C</code>, composition is defined as the function h such that\n" +
+ " * <code> h(a) == g(f(a))</code> for each <code> a</code>.\n" +
+ " *\n" +
+ " * @see <a href=\"//en.wikipedia.org/wiki/Function_composition\"> function\n" +
+ " * composition</a>\n" +
+ " *\n" +
+ " * @param g\n" +
+ " * the second function to apply\n" +
+ " * @param f\n" +
+ " * the first function to apply\n" +
+ " * @return the composition of <code> f</code> and <code> g</code>\n" +
+ " */\n" +
+ " void foo();\n" +
"}\n"
);
}
public void testBug260381_wksp2_01c() throws JavaModelException {
useOldJavadocTagsFormatting();
- String source =
- "package wksp2;\n" +
- "public interface I01c {\n" +
- " /**\n" +
- " * Returns the composition of two functions. For <code> f: A->B</code> and\n" +
- " * <code>\n" +
- " * g: B->C\n" +
- " * </code>,\n" +
- " * composition is defined as the function h such that\n" +
- " * <code>\n" +
- " * h(a) == g(f(a))\n" +
- " * </code>\n" +
- " * for each\n" +
- " * <code>\n" +
- " * a\n" +
- " * </code>.\n" +
- " *\n" +
- " * @see <a href=\"//en.wikipedia.org/wiki/Function_composition\">\n" +
- " * function composition</a>\n" +
- " *\n" +
- " * @param g the second function to apply\n" +
- " * @param f the first function to apply\n" +
- " * @return the composition of <code> f</code> and <code> g</code>\n" +
- " */\n" +
- " void foo();\n" +
- "}\n";
- formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public interface I01c {\n" +
- " /**\n" +
- " * Returns the composition of two functions. For <code> f: A->B</code> and\n" +
- " * <code>\n" +
- " * g: B->C\n" +
- " * </code>, composition is defined as the function h such that <code>\n" +
- " * h(a) == g(f(a))\n" +
- " * </code> for each <code>\n" +
- " * a\n" +
- " * </code>.\n" +
- " *\n" +
- " * @see <a href=\"//en.wikipedia.org/wiki/Function_composition\"> function\n" +
- " * composition</a>\n" +
- " *\n" +
- " * @param g\n" +
- " * the second function to apply\n" +
- " * @param f\n" +
- " * the first function to apply\n" +
- " * @return the composition of <code> f</code> and <code> g</code>\n" +
- " */\n" +
- " void foo();\n" +
+ String source =
+ "package wksp2;\n" +
+ "public interface I01c {\n" +
+ " /**\n" +
+ " * Returns the composition of two functions. For <code> f: A->B</code> and\n" +
+ " * <code>\n" +
+ " * g: B->C\n" +
+ " * </code>,\n" +
+ " * composition is defined as the function h such that\n" +
+ " * <code>\n" +
+ " * h(a) == g(f(a))\n" +
+ " * </code>\n" +
+ " * for each\n" +
+ " * <code>\n" +
+ " * a\n" +
+ " * </code>.\n" +
+ " *\n" +
+ " * @see <a href=\"//en.wikipedia.org/wiki/Function_composition\">\n" +
+ " * function composition</a>\n" +
+ " *\n" +
+ " * @param g the second function to apply\n" +
+ " * @param f the first function to apply\n" +
+ " * @return the composition of <code> f</code> and <code> g</code>\n" +
+ " */\n" +
+ " void foo();\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp2;\n" +
+ "\n" +
+ "public interface I01c {\n" +
+ " /**\n" +
+ " * Returns the composition of two functions. For <code> f: A->B</code> and\n" +
+ " * <code>\n" +
+ " * g: B->C\n" +
+ " * </code>, composition is defined as the function h such that <code>\n" +
+ " * h(a) == g(f(a))\n" +
+ " * </code> for each <code>\n" +
+ " * a\n" +
+ " * </code>.\n" +
+ " *\n" +
+ " * @see <a href=\"//en.wikipedia.org/wiki/Function_composition\"> function\n" +
+ " * composition</a>\n" +
+ " *\n" +
+ " * @param g\n" +
+ " * the second function to apply\n" +
+ " * @param f\n" +
+ " * the first function to apply\n" +
+ " * @return the composition of <code> f</code> and <code> g</code>\n" +
+ " */\n" +
+ " void foo();\n" +
"}\n"
);
}
public void testBug260381_wksp2_02() throws JavaModelException {
useOldCommentWidthCounting();
- String source =
- "package wksp2;\n" +
- "\n" +
- "public interface I02 {\n" +
- "\n" +
- " /**\n" +
- " * Implementations of {@code computeNext} <b>must</b> invoke this method when\n" +
- " * there are no elements left in the iteration.\n" +
- " *\n" +
- " * @return {@code null}; a convenience so your {@link #computeNext}\n" +
- " * implementation can use the simple statement {@code return endOfData();}\n" +
- " */\n" +
- " void foo();\n" +
- "}\n";
- formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public interface I02 {\n" +
- "\n" +
- " /**\n" +
- " * Implementations of {@code computeNext} <b>must</b> invoke this method\n" +
- " * when there are no elements left in the iteration.\n" +
- " *\n" +
- " * @return {@code null}; a convenience so your {@link #computeNext}\n" +
- " * implementation can use the simple statement\n" +
- " * {@code return endOfData();}\n" +
- " */\n" +
- " void foo();\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public interface I02 {\n" +
+ "\n" +
+ " /**\n" +
+ " * Implementations of {@code computeNext} <b>must</b> invoke this method when\n" +
+ " * there are no elements left in the iteration.\n" +
+ " *\n" +
+ " * @return {@code null}; a convenience so your {@link #computeNext}\n" +
+ " * implementation can use the simple statement {@code return endOfData();}\n" +
+ " */\n" +
+ " void foo();\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp2;\n" +
+ "\n" +
+ "public interface I02 {\n" +
+ "\n" +
+ " /**\n" +
+ " * Implementations of {@code computeNext} <b>must</b> invoke this method\n" +
+ " * when there are no elements left in the iteration.\n" +
+ " *\n" +
+ " * @return {@code null}; a convenience so your {@link #computeNext}\n" +
+ " * implementation can use the simple statement\n" +
+ " * {@code return endOfData();}\n" +
+ " */\n" +
+ " void foo();\n" +
"}\n"
);
}
public void testBug260381_wksp2_03() throws JavaModelException {
useOldCommentWidthCounting();
- String source =
- "package wksp2;\n" +
- "\n" +
- "public interface I03 {\n" +
- " /**\n" +
- " * A builder for creating immutable bimap instances, especially {@code public\n" +
- " * static final} bimaps (\"constant bimaps\"). Example: <pre> {@code\n" +
- " *\n" +
- " * static final ImmutableBiMap<String, Integer> WORD_TO_INT =\n" +
- " * new ImmutableBiMap.Builder<String, Integer>()\n" +
- " * .put(\"one\", 1)\n" +
- " * .put(\"two\", 2)\n" +
- " * .put(\"three\", 3)\n" +
- " * .build();}</pre>\n" +
- " *\n" +
- " * For <i>small</i> immutable bimaps, the {@code ImmutableBiMap.of()} methods\n" +
- " * are even more convenient.\n" +
- " *\n" +
- " * <p>Builder instances can be reused - it is safe to call {@link #build}\n" +
- " * multiple times to build multiple bimaps in series. Each bimap is a superset\n" +
- " * of the bimaps created before it.\n" +
- " */\n" +
- " void foo();\n" +
- "}\n";
- formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public interface I03 {\n" +
- " /**\n" +
- " * A builder for creating immutable bimap instances, especially\n" +
- " * {@code public\n" +
- " * static final} bimaps (\"constant bimaps\"). Example:\n" +
- " * \n" +
- " * <pre>\n" +
- " * {\n" +
- " * &#64;code\n" +
- " *\n" +
- " * static final ImmutableBiMap<String, Integer> WORD_TO_INT = new ImmutableBiMap.Builder<String, Integer>()\n" +
- " * .put(\"one\", 1).put(\"two\", 2).put(\"three\", 3).build();\n" +
- " * }\n" +
- " * </pre>\n" +
- " *\n" +
- " * For <i>small</i> immutable bimaps, the {@code ImmutableBiMap.of()}\n" +
- " * methods are even more convenient.\n" +
- " *\n" +
- " * <p>\n" +
- " * Builder instances can be reused - it is safe to call {@link #build}\n" +
- " * multiple times to build multiple bimaps in series. Each bimap is a\n" +
- " * superset of the bimaps created before it.\n" +
- " */\n" +
- " void foo();\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public interface I03 {\n" +
+ " /**\n" +
+ " * A builder for creating immutable bimap instances, especially {@code public\n" +
+ " * static final} bimaps (\"constant bimaps\"). Example: <pre> {@code\n" +
+ " *\n" +
+ " * static final ImmutableBiMap<String, Integer> WORD_TO_INT =\n" +
+ " * new ImmutableBiMap.Builder<String, Integer>()\n" +
+ " * .put(\"one\", 1)\n" +
+ " * .put(\"two\", 2)\n" +
+ " * .put(\"three\", 3)\n" +
+ " * .build();}</pre>\n" +
+ " *\n" +
+ " * For <i>small</i> immutable bimaps, the {@code ImmutableBiMap.of()} methods\n" +
+ " * are even more convenient.\n" +
+ " *\n" +
+ " * <p>Builder instances can be reused - it is safe to call {@link #build}\n" +
+ " * multiple times to build multiple bimaps in series. Each bimap is a superset\n" +
+ " * of the bimaps created before it.\n" +
+ " */\n" +
+ " void foo();\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp2;\n" +
+ "\n" +
+ "public interface I03 {\n" +
+ " /**\n" +
+ " * A builder for creating immutable bimap instances, especially\n" +
+ " * {@code public\n" +
+ " * static final} bimaps (\"constant bimaps\"). Example:\n" +
+ " * \n" +
+ " * <pre>\n" +
+ " * {\n" +
+ " * &#64;code\n" +
+ " *\n" +
+ " * static final ImmutableBiMap<String, Integer> WORD_TO_INT = new ImmutableBiMap.Builder<String, Integer>()\n" +
+ " * .put(\"one\", 1).put(\"two\", 2).put(\"three\", 3).build();\n" +
+ " * }\n" +
+ " * </pre>\n" +
+ " *\n" +
+ " * For <i>small</i> immutable bimaps, the {@code ImmutableBiMap.of()}\n" +
+ " * methods are even more convenient.\n" +
+ " *\n" +
+ " * <p>\n" +
+ " * Builder instances can be reused - it is safe to call {@link #build}\n" +
+ " * multiple times to build multiple bimaps in series. Each bimap is a\n" +
+ " * superset of the bimaps created before it.\n" +
+ " */\n" +
+ " void foo();\n" +
"}\n"
);
}
public void testBug260381_wksp2_03b() throws JavaModelException {
- String source =
- "package wksp2;\n" +
- "\n" +
- "public interface I03b {\n" +
- " /**\n" +
- " * A builder for creating immutable bimap instances, xxxxxxxx {@code public\n" +
- " * static final} bimaps (\"constant bimaps\").\n" +
- " */\n" +
- " void foo();\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public interface I03b {\n" +
+ " /**\n" +
+ " * A builder for creating immutable bimap instances, xxxxxxxx {@code public\n" +
+ " * static final} bimaps (\"constant bimaps\").\n" +
+ " */\n" +
+ " void foo();\n" +
"}\n";
formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public interface I03b {\n" +
- " /**\n" +
- " * A builder for creating immutable bimap instances, xxxxxxxx {@code public\n" +
- " * static final} bimaps (\"constant bimaps\").\n" +
- " */\n" +
- " void foo();\n" +
+ "package wksp2;\n" +
+ "\n" +
+ "public interface I03b {\n" +
+ " /**\n" +
+ " * A builder for creating immutable bimap instances, xxxxxxxx {@code public\n" +
+ " * static final} bimaps (\"constant bimaps\").\n" +
+ " */\n" +
+ " void foo();\n" +
"}\n"
);
}
public void testBug260381_wksp2_04() throws JavaModelException {
useOldCommentWidthCounting();
useOldJavadocTagsFormatting();
- String source =
- "package wksp2;\n" +
- "\n" +
- "public interface I04 {\n" +
- "\n" +
- " /**\n" +
- " * Returns an immutable multiset containing the given elements.\n" +
- " * \n" +
- " * <p>The multiset is ordered by the first occurrence of each element. For\n" +
- " * example, {@code ImmutableMultiset.copyOf(Arrays.asList(2, 3, 1, 3))} yields\n" +
- " * a multiset with elements in the order {@code 2, 3, 3, 1}.\n" +
- " *\n" +
- " * <p>Note that if {@code c} is a {@code Collection<String>}, then {@code\n" +
- " * ImmutableMultiset.copyOf(c)} returns an {@code ImmutableMultiset<String>}\n" +
- " * containing each of the strings in {@code c}, while\n" +
- " * {@code ImmutableMultiset.of(c)} returns an\n" +
- " * {@code ImmutableMultiset<Collection<String>>} containing one element\n" +
- " * (the given collection itself).\n" +
- " *\n" +
- " * <p><b>Note:</b> Despite what the method name suggests, if {@code elements}\n" +
- " * is an {@code ImmutableMultiset}, no copy will actually be performed, and\n" +
- " * the given multiset itself will be returned.\n" +
- " *\n" +
- " * @throws NullPointerException if any of {@code elements} is null\n" +
- " */\n" +
- " void foo();\n" +
- "}\n";
- formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public interface I04 {\n" +
- "\n" +
- " /**\n" +
- " * Returns an immutable multiset containing the given elements.\n" +
- " * \n" +
- " * <p>\n" +
- " * The multiset is ordered by the first occurrence of each element. For\n" +
- " * example, {@code ImmutableMultiset.copyOf(Arrays.asList(2, 3, 1, 3))}\n" +
- " * yields a multiset with elements in the order {@code 2, 3, 3, 1}.\n" +
- " *\n" +
- " * <p>\n" +
- " * Note that if {@code c} is a {@code Collection<String>}, then {@code\n" +
- " * ImmutableMultiset.copyOf(c)} returns an {@code ImmutableMultiset<String>}\n" +
- " * containing each of the strings in {@code c}, while\n" +
- " * {@code ImmutableMultiset.of(c)} returns an\n" +
- " * {@code ImmutableMultiset<Collection<String>>} containing one element (the\n" +
- " * given collection itself).\n" +
- " *\n" +
- " * <p>\n" +
- " * <b>Note:</b> Despite what the method name suggests, if {@code elements}\n" +
- " * is an {@code ImmutableMultiset}, no copy will actually be performed, and\n" +
- " * the given multiset itself will be returned.\n" +
- " *\n" +
- " * @throws NullPointerException\n" +
- " * if any of {@code elements} is null\n" +
- " */\n" +
- " void foo();\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public interface I04 {\n" +
+ "\n" +
+ " /**\n" +
+ " * Returns an immutable multiset containing the given elements.\n" +
+ " * \n" +
+ " * <p>The multiset is ordered by the first occurrence of each element. For\n" +
+ " * example, {@code ImmutableMultiset.copyOf(Arrays.asList(2, 3, 1, 3))} yields\n" +
+ " * a multiset with elements in the order {@code 2, 3, 3, 1}.\n" +
+ " *\n" +
+ " * <p>Note that if {@code c} is a {@code Collection<String>}, then {@code\n" +
+ " * ImmutableMultiset.copyOf(c)} returns an {@code ImmutableMultiset<String>}\n" +
+ " * containing each of the strings in {@code c}, while\n" +
+ " * {@code ImmutableMultiset.of(c)} returns an\n" +
+ " * {@code ImmutableMultiset<Collection<String>>} containing one element\n" +
+ " * (the given collection itself).\n" +
+ " *\n" +
+ " * <p><b>Note:</b> Despite what the method name suggests, if {@code elements}\n" +
+ " * is an {@code ImmutableMultiset}, no copy will actually be performed, and\n" +
+ " * the given multiset itself will be returned.\n" +
+ " *\n" +
+ " * @throws NullPointerException if any of {@code elements} is null\n" +
+ " */\n" +
+ " void foo();\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp2;\n" +
+ "\n" +
+ "public interface I04 {\n" +
+ "\n" +
+ " /**\n" +
+ " * Returns an immutable multiset containing the given elements.\n" +
+ " * \n" +
+ " * <p>\n" +
+ " * The multiset is ordered by the first occurrence of each element. For\n" +
+ " * example, {@code ImmutableMultiset.copyOf(Arrays.asList(2, 3, 1, 3))}\n" +
+ " * yields a multiset with elements in the order {@code 2, 3, 3, 1}.\n" +
+ " *\n" +
+ " * <p>\n" +
+ " * Note that if {@code c} is a {@code Collection<String>}, then {@code\n" +
+ " * ImmutableMultiset.copyOf(c)} returns an {@code ImmutableMultiset<String>}\n" +
+ " * containing each of the strings in {@code c}, while\n" +
+ " * {@code ImmutableMultiset.of(c)} returns an\n" +
+ " * {@code ImmutableMultiset<Collection<String>>} containing one element (the\n" +
+ " * given collection itself).\n" +
+ " *\n" +
+ " * <p>\n" +
+ " * <b>Note:</b> Despite what the method name suggests, if {@code elements}\n" +
+ " * is an {@code ImmutableMultiset}, no copy will actually be performed, and\n" +
+ " * the given multiset itself will be returned.\n" +
+ " *\n" +
+ " * @throws NullPointerException\n" +
+ " * if any of {@code elements} is null\n" +
+ " */\n" +
+ " void foo();\n" +
"}\n"
);
}
public void testBug260381_wksp2_05() throws JavaModelException {
useOldCommentWidthCounting();
useOldJavadocTagsFormatting();
- String source =
- "package wksp2;\n" +
- "\n" +
- "public interface I05 {\n" +
- "\n" +
- " /**\n" +
- " * Indexes the specified values into a {@code Multimap} by applying a\n" +
- " * specified function to each item in an {@code Iterable} of values. Each\n" +
- " * value will be stored as a value in the specified multimap. The key used to\n" +
- " * store that value in the multimap will be the result of calling the function\n" +
- " * on that value. Depending on the multimap implementation, duplicate entries\n" +
- " * (equal keys and equal values) may be collapsed.\n" +
- " *\n" +
- " * <p>For example,\n" +
- " *\n" +
- " * <pre class=\"code\">\n" +
- " * List&lt;String> badGuys =\n" +
- " * Arrays.asList(\"Inky\", \"Blinky\", \"Pinky\", \"Pinky\", \"Clyde\");\n" +
- " * Function&lt;String, Integer> stringLengthFunction = ...;\n" +
- " * Multimap&lt;Integer, String> index = Multimaps.newHashMultimap();\n" +
- " * Multimaps.index(badGuys, stringLengthFunction, index);\n" +
- " * System.out.println(index); </pre>\n" +
- " *\n" +
- " * prints\n" +
- " *\n" +
- " * <pre class=\"code\">\n" +
- " * {4=[Inky], 5=[Pinky, Clyde], 6=[Blinky]} </pre>\n" +
- " *\n" +
- " * The {@link HashMultimap} collapses the duplicate occurrence of\n" +
- " * {@code (5, \"Pinky\")}.\n" +
- " *\n" +
- " * @param values the values to add to the multimap\n" +
- " * @param keyFunction the function used to produce the key for each value\n" +
- " * @param multimap the multimap to store the key value pairs\n" +
- " */\n" +
- " void foo();\n" +
- "}\n";
- formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public interface I05 {\n" +
- "\n" +
- " /**\n" +
- " * Indexes the specified values into a {@code Multimap} by applying a\n" +
- " * specified function to each item in an {@code Iterable} of values. Each\n" +
- " * value will be stored as a value in the specified multimap. The key used\n" +
- " * to store that value in the multimap will be the result of calling the\n" +
- " * function on that value. Depending on the multimap implementation,\n" +
- " * duplicate entries (equal keys and equal values) may be collapsed.\n" +
- " *\n" +
- " * <p>\n" +
- " * For example,\n" +
- " *\n" +
- " * <pre class=\"code\">\n" +
- " * List&lt;String> badGuys =\n" +
- " * Arrays.asList(\"Inky\", \"Blinky\", \"Pinky\", \"Pinky\", \"Clyde\");\n" +
- " * Function&lt;String, Integer> stringLengthFunction = ...;\n" +
- " * Multimap&lt;Integer, String> index = Multimaps.newHashMultimap();\n" +
- " * Multimaps.index(badGuys, stringLengthFunction, index);\n" +
- " * System.out.println(index);\n" +
- " * </pre>\n" +
- " *\n" +
- " * prints\n" +
- " *\n" +
- " * <pre class=\"code\">\n" +
- " * {4=[Inky], 5=[Pinky, Clyde], 6=[Blinky]}\n" +
- " * </pre>\n" +
- " *\n" +
- " * The {@link HashMultimap} collapses the duplicate occurrence of\n" +
- " * {@code (5, \"Pinky\")}.\n" +
- " *\n" +
- " * @param values\n" +
- " * the values to add to the multimap\n" +
- " * @param keyFunction\n" +
- " * the function used to produce the key for each value\n" +
- " * @param multimap\n" +
- " * the multimap to store the key value pairs\n" +
- " */\n" +
- " void foo();\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public interface I05 {\n" +
+ "\n" +
+ " /**\n" +
+ " * Indexes the specified values into a {@code Multimap} by applying a\n" +
+ " * specified function to each item in an {@code Iterable} of values. Each\n" +
+ " * value will be stored as a value in the specified multimap. The key used to\n" +
+ " * store that value in the multimap will be the result of calling the function\n" +
+ " * on that value. Depending on the multimap implementation, duplicate entries\n" +
+ " * (equal keys and equal values) may be collapsed.\n" +
+ " *\n" +
+ " * <p>For example,\n" +
+ " *\n" +
+ " * <pre class=\"code\">\n" +
+ " * List&lt;String> badGuys =\n" +
+ " * Arrays.asList(\"Inky\", \"Blinky\", \"Pinky\", \"Pinky\", \"Clyde\");\n" +
+ " * Function&lt;String, Integer> stringLengthFunction = ...;\n" +
+ " * Multimap&lt;Integer, String> index = Multimaps.newHashMultimap();\n" +
+ " * Multimaps.index(badGuys, stringLengthFunction, index);\n" +
+ " * System.out.println(index); </pre>\n" +
+ " *\n" +
+ " * prints\n" +
+ " *\n" +
+ " * <pre class=\"code\">\n" +
+ " * {4=[Inky], 5=[Pinky, Clyde], 6=[Blinky]} </pre>\n" +
+ " *\n" +
+ " * The {@link HashMultimap} collapses the duplicate occurrence of\n" +
+ " * {@code (5, \"Pinky\")}.\n" +
+ " *\n" +
+ " * @param values the values to add to the multimap\n" +
+ " * @param keyFunction the function used to produce the key for each value\n" +
+ " * @param multimap the multimap to store the key value pairs\n" +
+ " */\n" +
+ " void foo();\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp2;\n" +
+ "\n" +
+ "public interface I05 {\n" +
+ "\n" +
+ " /**\n" +
+ " * Indexes the specified values into a {@code Multimap} by applying a\n" +
+ " * specified function to each item in an {@code Iterable} of values. Each\n" +
+ " * value will be stored as a value in the specified multimap. The key used\n" +
+ " * to store that value in the multimap will be the result of calling the\n" +
+ " * function on that value. Depending on the multimap implementation,\n" +
+ " * duplicate entries (equal keys and equal values) may be collapsed.\n" +
+ " *\n" +
+ " * <p>\n" +
+ " * For example,\n" +
+ " *\n" +
+ " * <pre class=\"code\">\n" +
+ " * List&lt;String> badGuys =\n" +
+ " * Arrays.asList(\"Inky\", \"Blinky\", \"Pinky\", \"Pinky\", \"Clyde\");\n" +
+ " * Function&lt;String, Integer> stringLengthFunction = ...;\n" +
+ " * Multimap&lt;Integer, String> index = Multimaps.newHashMultimap();\n" +
+ " * Multimaps.index(badGuys, stringLengthFunction, index);\n" +
+ " * System.out.println(index);\n" +
+ " * </pre>\n" +
+ " *\n" +
+ " * prints\n" +
+ " *\n" +
+ " * <pre class=\"code\">\n" +
+ " * {4=[Inky], 5=[Pinky, Clyde], 6=[Blinky]}\n" +
+ " * </pre>\n" +
+ " *\n" +
+ " * The {@link HashMultimap} collapses the duplicate occurrence of\n" +
+ " * {@code (5, \"Pinky\")}.\n" +
+ " *\n" +
+ " * @param values\n" +
+ " * the values to add to the multimap\n" +
+ " * @param keyFunction\n" +
+ " * the function used to produce the key for each value\n" +
+ " * @param multimap\n" +
+ " * the multimap to store the key value pairs\n" +
+ " */\n" +
+ " void foo();\n" +
"}\n"
);
}
public void testBug260381_wksp2_06() throws JavaModelException {
useOldCommentWidthCounting();
useOldJavadocTagsFormatting();
- String source =
- "package wksp2;\n" +
- "\n" +
- "public interface I06 {\n" +
- "\n" +
- " /**\n" +
- " * Adds a number of occurrences of an element to this multiset. Note that if\n" +
- " * {@code occurrences == 1}, this method has the identical effect to {@link\n" +
- " * #add(Object)}. This method is functionally equivalent (except in the case\n" +
- " * of overflow) to the call {@code addAll(Collections.nCopies(element,\n" +
- " * occurrences))}, which would presumably perform much more poorly.\n" +
- " *\n" +
- " * @param element the element to add occurrences of; may be {@code null} only\n" +
- " * if explicitly allowed by the implementation\n" +
- " * @param occurrences the number of occurrences of this element to add. May\n" +
- " * be zero, in which case no change will be made.\n" +
- " * @return the previous count of this element before the operation; possibly\n" +
- " * zero - TODO: make this the actual behavior!\n" +
- " * @throws IllegalArgumentException if {@code occurrences} is negative, or if\n" +
- " * this operation would result in more than {@link Integer#MAX_VALUE}\n" +
- " * occurrences of the element \n" +
- " * @throws NullPointerException if {@code element} is null and this\n" +
- " * implementation does not permit null elements. Note that if {@code\n" +
- " * occurrences} is zero, the implementation may opt to return normally.\n" +
- " */\n" +
- " boolean /*int*/ add(E element, int occurrences);\n" +
- "}\n";
- formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public interface I06 {\n" +
- "\n" +
- " /**\n" +
- " * Adds a number of occurrences of an element to this multiset. Note that if\n" +
- " * {@code occurrences == 1}, this method has the identical effect to\n" +
- " * {@link #add(Object)}. This method is functionally equivalent (except in\n" +
- " * the case of overflow) to the call\n" +
- " * {@code addAll(Collections.nCopies(element,\n" +
- " * occurrences))}, which would presumably perform much more poorly.\n" +
- " *\n" +
- " * @param element\n" +
- " * the element to add occurrences of; may be {@code null} only if\n" +
- " * explicitly allowed by the implementation\n" +
- " * @param occurrences\n" +
- " * the number of occurrences of this element to add. May be zero,\n" +
- " * in which case no change will be made.\n" +
- " * @return the previous count of this element before the operation; possibly\n" +
- " * zero - TODO: make this the actual behavior!\n" +
- " * @throws IllegalArgumentException\n" +
- " * if {@code occurrences} is negative, or if this operation\n" +
- " * would result in more than {@link Integer#MAX_VALUE}\n" +
- " * occurrences of the element\n" +
- " * @throws NullPointerException\n" +
- " * if {@code element} is null and this implementation does not\n" +
- " * permit null elements. Note that if {@code\n" +
- " * occurrences} is zero, the implementation may opt to return normally.\n" +
- " */\n" +
- " boolean /* int */ add(E element, int occurrences);\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public interface I06 {\n" +
+ "\n" +
+ " /**\n" +
+ " * Adds a number of occurrences of an element to this multiset. Note that if\n" +
+ " * {@code occurrences == 1}, this method has the identical effect to {@link\n" +
+ " * #add(Object)}. This method is functionally equivalent (except in the case\n" +
+ " * of overflow) to the call {@code addAll(Collections.nCopies(element,\n" +
+ " * occurrences))}, which would presumably perform much more poorly.\n" +
+ " *\n" +
+ " * @param element the element to add occurrences of; may be {@code null} only\n" +
+ " * if explicitly allowed by the implementation\n" +
+ " * @param occurrences the number of occurrences of this element to add. May\n" +
+ " * be zero, in which case no change will be made.\n" +
+ " * @return the previous count of this element before the operation; possibly\n" +
+ " * zero - TODO: make this the actual behavior!\n" +
+ " * @throws IllegalArgumentException if {@code occurrences} is negative, or if\n" +
+ " * this operation would result in more than {@link Integer#MAX_VALUE}\n" +
+ " * occurrences of the element \n" +
+ " * @throws NullPointerException if {@code element} is null and this\n" +
+ " * implementation does not permit null elements. Note that if {@code\n" +
+ " * occurrences} is zero, the implementation may opt to return normally.\n" +
+ " */\n" +
+ " boolean /*int*/ add(E element, int occurrences);\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp2;\n" +
+ "\n" +
+ "public interface I06 {\n" +
+ "\n" +
+ " /**\n" +
+ " * Adds a number of occurrences of an element to this multiset. Note that if\n" +
+ " * {@code occurrences == 1}, this method has the identical effect to\n" +
+ " * {@link #add(Object)}. This method is functionally equivalent (except in\n" +
+ " * the case of overflow) to the call\n" +
+ " * {@code addAll(Collections.nCopies(element,\n" +
+ " * occurrences))}, which would presumably perform much more poorly.\n" +
+ " *\n" +
+ " * @param element\n" +
+ " * the element to add occurrences of; may be {@code null} only if\n" +
+ " * explicitly allowed by the implementation\n" +
+ " * @param occurrences\n" +
+ " * the number of occurrences of this element to add. May be zero,\n" +
+ " * in which case no change will be made.\n" +
+ " * @return the previous count of this element before the operation; possibly\n" +
+ " * zero - TODO: make this the actual behavior!\n" +
+ " * @throws IllegalArgumentException\n" +
+ " * if {@code occurrences} is negative, or if this operation\n" +
+ " * would result in more than {@link Integer#MAX_VALUE}\n" +
+ " * occurrences of the element\n" +
+ " * @throws NullPointerException\n" +
+ " * if {@code element} is null and this implementation does not\n" +
+ " * permit null elements. Note that if {@code\n" +
+ " * occurrences} is zero, the implementation may opt to return normally.\n" +
+ " */\n" +
+ " boolean /* int */ add(E element, int occurrences);\n" +
"}\n"
);
}
public void testBug260381_wksp2_07() throws JavaModelException {
useOldCommentWidthCounting();
useOldJavadocTagsFormatting();
- String source =
- "package wksp2;\n" +
- "\n" +
- "public interface I07 {\n" +
- "\n" +
- " /**\n" +
- " * Constructs a new, empty multiset, sorted according to the specified\n" +
- " * comparator. All elements inserted into the multiset must be <i>mutually\n" +
- " * comparable</i> by the specified comparator: {@code comparator.compare(e1,\n" +
- " * e2)} must not throw a {@code ClassCastException} for any elements {@code\n" +
- " * e1} and {@code e2} in the multiset. If the user attempts to add an element\n" +
- " * to the multiset that violates this constraint, the {@code add(Object)} call\n" +
- " * will throw a {@code ClassCastException}.\n" +
- " *\n" +
- " * @param comparator the comparator that will be used to sort this multiset. A\n" +
- " * null value indicates that the elements\' <i>natural ordering</i> should\n" +
- " * be used.\n" +
- " */\n" +
- " void foo();\n" +
- "}\n";
- formatSource(source,
- "package wksp2;\n" +
- "\n" +
- "public interface I07 {\n" +
- "\n" +
- " /**\n" +
- " * Constructs a new, empty multiset, sorted according to the specified\n" +
- " * comparator. All elements inserted into the multiset must be <i>mutually\n" +
- " * comparable</i> by the specified comparator: {@code comparator.compare(e1,\n" +
- " * e2)} must not throw a {@code ClassCastException} for any elements {@code\n" +
- " * e1} and {@code e2} in the multiset. If the user attempts to add an\n" +
- " * element to the multiset that violates this constraint, the\n" +
- " * {@code add(Object)} call will throw a {@code ClassCastException}.\n" +
- " *\n" +
- " * @param comparator\n" +
- " * the comparator that will be used to sort this multiset. A null\n" +
- " * value indicates that the elements\' <i>natural ordering</i>\n" +
- " * should be used.\n" +
- " */\n" +
- " void foo();\n" +
+ String source =
+ "package wksp2;\n" +
+ "\n" +
+ "public interface I07 {\n" +
+ "\n" +
+ " /**\n" +
+ " * Constructs a new, empty multiset, sorted according to the specified\n" +
+ " * comparator. All elements inserted into the multiset must be <i>mutually\n" +
+ " * comparable</i> by the specified comparator: {@code comparator.compare(e1,\n" +
+ " * e2)} must not throw a {@code ClassCastException} for any elements {@code\n" +
+ " * e1} and {@code e2} in the multiset. If the user attempts to add an element\n" +
+ " * to the multiset that violates this constraint, the {@code add(Object)} call\n" +
+ " * will throw a {@code ClassCastException}.\n" +
+ " *\n" +
+ " * @param comparator the comparator that will be used to sort this multiset. A\n" +
+ " * null value indicates that the elements\' <i>natural ordering</i> should\n" +
+ " * be used.\n" +
+ " */\n" +
+ " void foo();\n" +
+ "}\n";
+ formatSource(source,
+ "package wksp2;\n" +
+ "\n" +
+ "public interface I07 {\n" +
+ "\n" +
+ " /**\n" +
+ " * Constructs a new, empty multiset, sorted according to the specified\n" +
+ " * comparator. All elements inserted into the multiset must be <i>mutually\n" +
+ " * comparable</i> by the specified comparator: {@code comparator.compare(e1,\n" +
+ " * e2)} must not throw a {@code ClassCastException} for any elements {@code\n" +
+ " * e1} and {@code e2} in the multiset. If the user attempts to add an\n" +
+ " * element to the multiset that violates this constraint, the\n" +
+ " * {@code add(Object)} call will throw a {@code ClassCastException}.\n" +
+ " *\n" +
+ " * @param comparator\n" +
+ " * the comparator that will be used to sort this multiset. A null\n" +
+ " * value indicates that the elements\' <i>natural ordering</i>\n" +
+ " * should be used.\n" +
+ " */\n" +
+ " void foo();\n" +
"}\n"
);
}
@@ -5558,100 +5558,100 @@ public void testBug260381_wksp2_09() throws JavaModelException {
*/
public void testBug260798() throws JavaModelException {
this.formatterPrefs.join_wrapped_lines = false;
- String source =
- "class X {\n" +
- " @Override\n" +
- " public void addSelectionListener(SelectionListener listener) {\n" +
- " super.addSelectionListener(new SelectionListener() {\n" +
- " @Override\n" +
- " public void widgetSelected(SelectionEvent e) {\n" +
- " }\n" +
- "\n" +
- " @Override\n" +
- " public void widgetDefaultSelected(SelectionEvent e) {\n" +
- " };\n" +
- " });\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "class X {\n" +
- " @Override\n" +
- " public void addSelectionListener(SelectionListener listener) {\n" +
- " super.addSelectionListener(new SelectionListener() {\n" +
- " @Override\n" +
- " public void widgetSelected(SelectionEvent e) {\n" +
- " }\n" +
- "\n" +
- " @Override\n" +
- " public void widgetDefaultSelected(SelectionEvent e) {\n" +
- " };\n" +
- " });\n" +
- " }\n" +
+ String source =
+ "class X {\n" +
+ " @Override\n" +
+ " public void addSelectionListener(SelectionListener listener) {\n" +
+ " super.addSelectionListener(new SelectionListener() {\n" +
+ " @Override\n" +
+ " public void widgetSelected(SelectionEvent e) {\n" +
+ " }\n" +
+ "\n" +
+ " @Override\n" +
+ " public void widgetDefaultSelected(SelectionEvent e) {\n" +
+ " };\n" +
+ " });\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "class X {\n" +
+ " @Override\n" +
+ " public void addSelectionListener(SelectionListener listener) {\n" +
+ " super.addSelectionListener(new SelectionListener() {\n" +
+ " @Override\n" +
+ " public void widgetSelected(SelectionEvent e) {\n" +
+ " }\n" +
+ "\n" +
+ " @Override\n" +
+ " public void widgetDefaultSelected(SelectionEvent e) {\n" +
+ " };\n" +
+ " });\n" +
+ " }\n" +
"}\n"
);
}
public void testBug260798b() throws JavaModelException {
this.formatterPrefs.join_wrapped_lines = false;
- String source =
- "class X {\n" +
- "\n" +
- " void foo() {\n" +
- " this.bar(new Object() {\n" +
- " @Override\n" +
- " public String toString() {\n" +
- " return \"\";\n" +
- " }\n" +
- " });\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "class X {\n" +
- "\n" +
- " void foo() {\n" +
- " this.bar(new Object() {\n" +
- " @Override\n" +
- " public String toString() {\n" +
- " return \"\";\n" +
- " }\n" +
- " });\n" +
- " }\n" +
+ String source =
+ "class X {\n" +
+ "\n" +
+ " void foo() {\n" +
+ " this.bar(new Object() {\n" +
+ " @Override\n" +
+ " public String toString() {\n" +
+ " return \"\";\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "class X {\n" +
+ "\n" +
+ " void foo() {\n" +
+ " this.bar(new Object() {\n" +
+ " @Override\n" +
+ " public String toString() {\n" +
+ " return \"\";\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
"}\n"
);
}
public void testBug260798c() throws JavaModelException {
this.formatterPrefs.join_wrapped_lines = false;
- String source =
- "class X {\n" +
- "\n" +
- "{\n" +
- " this.bar(new Object() {\n" +
- " @Override\n" +
- " public String toString() {\n" +
- " return \"\";\n" +
- " }\n" +
- " });\n" +
- "}\n" +
- " void bar(Object object) {\n" +
- " \n" +
- " }\n" +
- "\n" +
- "}\n";
- formatSource(source,
- "class X {\n" +
- "\n" +
- " {\n" +
- " this.bar(new Object() {\n" +
- " @Override\n" +
- " public String toString() {\n" +
- " return \"\";\n" +
- " }\n" +
- " });\n" +
- " }\n" +
- "\n" +
- " void bar(Object object) {\n" +
- "\n" +
- " }\n" +
- "\n" +
+ String source =
+ "class X {\n" +
+ "\n" +
+ "{\n" +
+ " this.bar(new Object() {\n" +
+ " @Override\n" +
+ " public String toString() {\n" +
+ " return \"\";\n" +
+ " }\n" +
+ " });\n" +
+ "}\n" +
+ " void bar(Object object) {\n" +
+ " \n" +
+ " }\n" +
+ "\n" +
+ "}\n";
+ formatSource(source,
+ "class X {\n" +
+ "\n" +
+ " {\n" +
+ " this.bar(new Object() {\n" +
+ " @Override\n" +
+ " public String toString() {\n" +
+ " return \"\";\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
+ "\n" +
+ " void bar(Object object) {\n" +
+ "\n" +
+ " }\n" +
+ "\n" +
"}\n"
);
}
@@ -5662,18 +5662,18 @@ public void testBug260798c() throws JavaModelException {
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=267551"
*/
public void testBug267551() throws JavaModelException {
- String source =
- "import java.lang.annotation.*;\n" +
- "\n" +
- "@Target({ ElementType.ANNOTATION_TYPE })\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ String source =
+ "import java.lang.annotation.*;\n" +
+ "\n" +
+ "@Target({ ElementType.ANNOTATION_TYPE })\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"public @interface Foo { }\n";
formatSource(source,
- "import java.lang.annotation.*;\n" +
- "\n" +
- "@Target({ ElementType.ANNOTATION_TYPE })\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "public @interface Foo {\n" +
+ "import java.lang.annotation.*;\n" +
+ "\n" +
+ "@Target({ ElementType.ANNOTATION_TYPE })\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "public @interface Foo {\n" +
"}\n"
);
}
@@ -5688,41 +5688,41 @@ public void testBug267658() throws JavaModelException {
this.formatterPrefs.comment_format_javadoc_comment = false;
this.formatterPrefs.comment_format_block_comment = true;
this.formatterPrefs.comment_format_line_comment = false;
- String source =
- "/**\n" +
- " * Test for\n" +
- " * bug 267658\n" +
- " */\n" +
- "package javadoc;\n" +
- "\n" +
- "/**\n" +
- " * Test for\n" +
- " * bug 267658\n" +
- " */\n" +
- "public class Test {\n" +
- "/**\n" +
- " * Test for\n" +
- " * bug 267658\n" +
- " */\n" +
- "int field;\n" +
- "}\n";
- formatSource(source,
- "/**\n" +
- " * Test for\n" +
- " * bug 267658\n" +
- " */\n" +
- "package javadoc;\n" +
- "\n" +
- "/**\n" +
- " * Test for\n" +
- " * bug 267658\n" +
- " */\n" +
- "public class Test {\n" +
- " /**\n" +
- " * Test for\n" +
- " * bug 267658\n" +
- " */\n" +
- " int field;\n" +
+ String source =
+ "/**\n" +
+ " * Test for\n" +
+ " * bug 267658\n" +
+ " */\n" +
+ "package javadoc;\n" +
+ "\n" +
+ "/**\n" +
+ " * Test for\n" +
+ " * bug 267658\n" +
+ " */\n" +
+ "public class Test {\n" +
+ "/**\n" +
+ " * Test for\n" +
+ " * bug 267658\n" +
+ " */\n" +
+ "int field;\n" +
+ "}\n";
+ formatSource(source,
+ "/**\n" +
+ " * Test for\n" +
+ " * bug 267658\n" +
+ " */\n" +
+ "package javadoc;\n" +
+ "\n" +
+ "/**\n" +
+ " * Test for\n" +
+ " * bug 267658\n" +
+ " */\n" +
+ "public class Test {\n" +
+ " /**\n" +
+ " * Test for\n" +
+ " * bug 267658\n" +
+ " */\n" +
+ " int field;\n" +
"}\n"
);
}
@@ -5730,19 +5730,19 @@ public void testBug267658b() throws JavaModelException {
this.formatterPrefs.comment_format_javadoc_comment = false;
this.formatterPrefs.comment_format_block_comment = true;
this.formatterPrefs.comment_format_line_comment = false;
- String source =
- "public class Test {\n" +
- "/**\n" +
- " * @test bug\n" +
- " */\n" +
- "int field;\n" +
+ String source =
+ "public class Test {\n" +
+ "/**\n" +
+ " * @test bug\n" +
+ " */\n" +
+ "int field;\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- " /**\n" +
- " * @test bug\n" +
- " */\n" +
- " int field;\n" +
+ "public class Test {\n" +
+ " /**\n" +
+ " * @test bug\n" +
+ " */\n" +
+ " int field;\n" +
"}\n"
);
}
@@ -5755,121 +5755,121 @@ public void testBug267658b() throws JavaModelException {
*/
public void testBug270209_Block01() throws JavaModelException {
this.formatterPrefs.comment_new_lines_at_block_boundaries = false;
- String source =
- "public interface X01 {\n" +
- "\n" +
- "/* Instead of like this. I use these a lot and\n" +
- " * this can take up a lot of space. */\n" +
- "void foo();\n" +
+ String source =
+ "public interface X01 {\n" +
+ "\n" +
+ "/* Instead of like this. I use these a lot and\n" +
+ " * this can take up a lot of space. */\n" +
+ "void foo();\n" +
"}\n";
formatSource(source,
- "public interface X01 {\n" +
- "\n" +
- " /* Instead of like this. I use these a lot and this can take up a lot of\n" +
- " * space. */\n" +
- " void foo();\n" +
+ "public interface X01 {\n" +
+ "\n" +
+ " /* Instead of like this. I use these a lot and this can take up a lot of\n" +
+ " * space. */\n" +
+ " void foo();\n" +
"}\n"
);
}
public void testBug270209_Block02() throws JavaModelException {
this.formatterPrefs.comment_new_lines_at_block_boundaries = false;
- String source =
- "public interface X02 {\n" +
- "\n" +
- "/*\n" +
- " * Instead of like this. I use these a lot and\n" +
- " * this can take up a lot of space.\n" +
- " */\n" +
- "void foo();\n" +
+ String source =
+ "public interface X02 {\n" +
+ "\n" +
+ "/*\n" +
+ " * Instead of like this. I use these a lot and\n" +
+ " * this can take up a lot of space.\n" +
+ " */\n" +
+ "void foo();\n" +
"}\n";
formatSource(source,
- "public interface X02 {\n" +
- "\n" +
- " /* Instead of like this. I use these a lot and this can take up a lot of\n" +
- " * space. */\n" +
- " void foo();\n" +
+ "public interface X02 {\n" +
+ "\n" +
+ " /* Instead of like this. I use these a lot and this can take up a lot of\n" +
+ " * space. */\n" +
+ " void foo();\n" +
"}\n"
);
}
public void testBug270209_Block03() throws JavaModelException {
this.formatterPrefs.comment_new_lines_at_block_boundaries = false;
- String source =
- "public interface X03 {\n" +
- "\n" +
- "/*\n" +
- " * \n" +
- " * Instead of like this. I use these a lot and\n" +
- " * this can take up a lot of space.\n" +
- " * \n" +
- " */\n" +
- "void foo();\n" +
+ String source =
+ "public interface X03 {\n" +
+ "\n" +
+ "/*\n" +
+ " * \n" +
+ " * Instead of like this. I use these a lot and\n" +
+ " * this can take up a lot of space.\n" +
+ " * \n" +
+ " */\n" +
+ "void foo();\n" +
"}\n";
formatSource(source,
- "public interface X03 {\n" +
- "\n" +
- " /* Instead of like this. I use these a lot and this can take up a lot of\n" +
- " * space. */\n" +
- " void foo();\n" +
+ "public interface X03 {\n" +
+ "\n" +
+ " /* Instead of like this. I use these a lot and this can take up a lot of\n" +
+ " * space. */\n" +
+ " void foo();\n" +
"}\n"
);
}
public void testBug270209_Javadoc01() throws JavaModelException {
this.formatterPrefs.comment_new_lines_at_javadoc_boundaries = false;
- String source =
- "public interface X01 {\n" +
- "\n" +
- "/** Instead of like this. I use these a lot and\n" +
- " * this can take up a lot of space. */\n" +
- "void foo();\n" +
+ String source =
+ "public interface X01 {\n" +
+ "\n" +
+ "/** Instead of like this. I use these a lot and\n" +
+ " * this can take up a lot of space. */\n" +
+ "void foo();\n" +
"}\n";
formatSource(source,
- "public interface X01 {\n" +
- "\n" +
- " /** Instead of like this. I use these a lot and this can take up a lot of\n" +
- " * space. */\n" +
- " void foo();\n" +
+ "public interface X01 {\n" +
+ "\n" +
+ " /** Instead of like this. I use these a lot and this can take up a lot of\n" +
+ " * space. */\n" +
+ " void foo();\n" +
"}\n"
);
}
public void testBug270209_Javadoc02() throws JavaModelException {
this.formatterPrefs.comment_new_lines_at_javadoc_boundaries = false;
- String source =
- "public interface X02 {\n" +
- "\n" +
- "/**\n" +
- " * Instead of like this. I use these a lot and\n" +
- " * this can take up a lot of space.\n" +
- " */\n" +
- "void foo();\n" +
+ String source =
+ "public interface X02 {\n" +
+ "\n" +
+ "/**\n" +
+ " * Instead of like this. I use these a lot and\n" +
+ " * this can take up a lot of space.\n" +
+ " */\n" +
+ "void foo();\n" +
"}\n";
formatSource(source,
- "public interface X02 {\n" +
- "\n" +
- " /** Instead of like this. I use these a lot and this can take up a lot of\n" +
- " * space. */\n" +
- " void foo();\n" +
+ "public interface X02 {\n" +
+ "\n" +
+ " /** Instead of like this. I use these a lot and this can take up a lot of\n" +
+ " * space. */\n" +
+ " void foo();\n" +
"}\n"
);
}
public void testBug270209_Javadoc03() throws JavaModelException {
this.formatterPrefs.comment_new_lines_at_javadoc_boundaries = false;
- String source =
- "public interface X03 {\n" +
- "\n" +
- "/**\n" +
- " * \n" +
- " * Instead of like this. I use these a lot and\n" +
- " * this can take up a lot of space.\n" +
- " * \n" +
- " */\n" +
- "void foo();\n" +
+ String source =
+ "public interface X03 {\n" +
+ "\n" +
+ "/**\n" +
+ " * \n" +
+ " * Instead of like this. I use these a lot and\n" +
+ " * this can take up a lot of space.\n" +
+ " * \n" +
+ " */\n" +
+ "void foo();\n" +
"}\n";
formatSource(source,
- "public interface X03 {\n" +
- "\n" +
- " /** Instead of like this. I use these a lot and this can take up a lot of\n" +
- " * space. */\n" +
- " void foo();\n" +
+ "public interface X03 {\n" +
+ "\n" +
+ " /** Instead of like this. I use these a lot and this can take up a lot of\n" +
+ " * space. */\n" +
+ " void foo();\n" +
"}\n"
);
}
@@ -5880,40 +5880,40 @@ public void testBug270209_Javadoc03() throws JavaModelException {
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=273619"
*/
public void testBug273619a() throws JavaModelException {
- String source =
- "/**\n" +
- " * <ul>\n" +
- " * <li>{@code *}</li>\n" +
- " * </ul>\n" +
- " */\n" +
+ String source =
+ "/**\n" +
+ " * <ul>\n" +
+ " * <li>{@code *}</li>\n" +
+ " * </ul>\n" +
+ " */\n" +
"public class X {\n" +
"}\n";
formatSource(source,
- "/**\n" +
- " * <ul>\n" +
- " * <li>{@code *}</li>\n" +
- " * </ul>\n" +
- " */\n" +
- "public class X {\n" +
+ "/**\n" +
+ " * <ul>\n" +
+ " * <li>{@code *}</li>\n" +
+ " * </ul>\n" +
+ " */\n" +
+ "public class X {\n" +
"}\n"
);
}
public void testBug273619b() throws JavaModelException {
- String source =
- "/**\n" +
- " * <p>\n" +
- " * {@link *}\n" +
- " * </p>\n" +
- " */\n" +
+ String source =
+ "/**\n" +
+ " * <p>\n" +
+ " * {@link *}\n" +
+ " * </p>\n" +
+ " */\n" +
"public class X {\n" +
"}\n";
formatSource(source,
- "/**\n" +
- " * <p>\n" +
- " * {@link *}\n" +
- " * </p>\n" +
- " */\n" +
- "public class X {\n" +
+ "/**\n" +
+ " * <p>\n" +
+ " * {@link *}\n" +
+ " * </p>\n" +
+ " */\n" +
+ "public class X {\n" +
"}\n"
);
}
@@ -5926,35 +5926,35 @@ public void testBug273619b() throws JavaModelException {
*/
public void testBug279359() throws JavaModelException {
this.formatterPrefs.join_wrapped_lines = false;
- String source =
- "public class Formatter {\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- "\n" +
- " Executors.newCachedThreadPool().execute(new Runnable() {\n" +
- "\n" +
- " public void run() {\n" +
- " throw new UnsupportedOperationException(\"stub\");\n" +
- " }\n" +
- "\n" +
- " });\n" +
- "\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "public class Formatter {\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- "\n" +
- " Executors.newCachedThreadPool().execute(new Runnable() {\n" +
- "\n" +
- " public void run() {\n" +
- " throw new UnsupportedOperationException(\"stub\");\n" +
- " }\n" +
- "\n" +
- " });\n" +
- "\n" +
- " }\n" +
+ String source =
+ "public class Formatter {\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ "\n" +
+ " Executors.newCachedThreadPool().execute(new Runnable() {\n" +
+ "\n" +
+ " public void run() {\n" +
+ " throw new UnsupportedOperationException(\"stub\");\n" +
+ " }\n" +
+ "\n" +
+ " });\n" +
+ "\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "public class Formatter {\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ "\n" +
+ " Executors.newCachedThreadPool().execute(new Runnable() {\n" +
+ "\n" +
+ " public void run() {\n" +
+ " throw new UnsupportedOperationException(\"stub\");\n" +
+ " }\n" +
+ "\n" +
+ " });\n" +
+ "\n" +
+ " }\n" +
"}\n"
);
}
@@ -5966,49 +5966,49 @@ public void testBug279359() throws JavaModelException {
*/
public void testBug280061() throws JavaModelException {
this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_3);
- String source =
- "public interface X {\n" +
- "/**\n" +
- " * <pre>\n" +
- " * void solve(Executor e,\n" +
- " * Collection&lt;Callable&lt;Result&gt;&gt; solvers)\n" +
- " * throws InterruptedException, ExecutionException {\n" +
- " * CompletionService&lt;Result&gt; ecs\n" +
- " * = new ExecutorCompletionService&lt;Result&gt;(e);\n" +
- " * for (Callable&lt;Result&gt; s : solvers)\n" +
- " * ecs.submit(s);\n" +
- " * int n = solvers.size();\n" +
- " * for (int i = 0; i &lt; n; ++i) {\n" +
- " * Result r = ecs.take().get();\n" +
- " * if (r != null)\n" +
- " * use(r);\n" +
- " * }\n" +
- " * }\n" +
- " * </pre>\n" +
- " */\n" +
- " void foo();\n" +
- "}\n";
- formatSource(source,
- "public interface X {\n" +
- " /**\n" +
- " * <pre>\n" +
- " * void solve(Executor e,\n" +
- " * Collection&lt;Callable&lt;Result&gt;&gt; solvers)\n" +
- " * throws InterruptedException, ExecutionException {\n" +
- " * CompletionService&lt;Result&gt; ecs\n" +
- " * = new ExecutorCompletionService&lt;Result&gt;(e);\n" +
- " * for (Callable&lt;Result&gt; s : solvers)\n" +
- " * ecs.submit(s);\n" +
- " * int n = solvers.size();\n" +
- " * for (int i = 0; i &lt; n; ++i) {\n" +
- " * Result r = ecs.take().get();\n" +
- " * if (r != null)\n" +
- " * use(r);\n" +
- " * }\n" +
- " * }\n" +
- " * </pre>\n" +
- " */\n" +
- " void foo();\n" +
+ String source =
+ "public interface X {\n" +
+ "/**\n" +
+ " * <pre>\n" +
+ " * void solve(Executor e,\n" +
+ " * Collection&lt;Callable&lt;Result&gt;&gt; solvers)\n" +
+ " * throws InterruptedException, ExecutionException {\n" +
+ " * CompletionService&lt;Result&gt; ecs\n" +
+ " * = new ExecutorCompletionService&lt;Result&gt;(e);\n" +
+ " * for (Callable&lt;Result&gt; s : solvers)\n" +
+ " * ecs.submit(s);\n" +
+ " * int n = solvers.size();\n" +
+ " * for (int i = 0; i &lt; n; ++i) {\n" +
+ " * Result r = ecs.take().get();\n" +
+ " * if (r != null)\n" +
+ " * use(r);\n" +
+ " * }\n" +
+ " * }\n" +
+ " * </pre>\n" +
+ " */\n" +
+ " void foo();\n" +
+ "}\n";
+ formatSource(source,
+ "public interface X {\n" +
+ " /**\n" +
+ " * <pre>\n" +
+ " * void solve(Executor e,\n" +
+ " * Collection&lt;Callable&lt;Result&gt;&gt; solvers)\n" +
+ " * throws InterruptedException, ExecutionException {\n" +
+ " * CompletionService&lt;Result&gt; ecs\n" +
+ " * = new ExecutorCompletionService&lt;Result&gt;(e);\n" +
+ " * for (Callable&lt;Result&gt; s : solvers)\n" +
+ " * ecs.submit(s);\n" +
+ " * int n = solvers.size();\n" +
+ " * for (int i = 0; i &lt; n; ++i) {\n" +
+ " * Result r = ecs.take().get();\n" +
+ " * if (r != null)\n" +
+ " * use(r);\n" +
+ " * }\n" +
+ " * }\n" +
+ " * </pre>\n" +
+ " */\n" +
+ " void foo();\n" +
"}\n"
);
}
@@ -6021,61 +6021,61 @@ public void testBug280061() throws JavaModelException {
*/
public void testBug280255() throws JavaModelException {
this.formatterPrefs.indent_empty_lines = true;
- String source =
- "public class X {\n" +
- " private void foo(int val) {\n" +
- " switch (val) {\n" +
- " case 0:\n" +
- " {\n" +
- "\n" +
- "\n" +
- "[# return ;#]\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
- formatSource(source,
- "public class X {\n" +
- " private void foo(int val) {\n" +
- " switch (val) {\n" +
- " case 0:\n" +
- " {\n" +
- "\n" +
- "\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ String source =
+ "public class X {\n" +
+ " private void foo(int val) {\n" +
+ " switch (val) {\n" +
+ " case 0:\n" +
+ " {\n" +
+ "\n" +
+ "\n" +
+ "[# return ;#]\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "}\n";
+ formatSource(source,
+ "public class X {\n" +
+ " private void foo(int val) {\n" +
+ " switch (val) {\n" +
+ " case 0:\n" +
+ " {\n" +
+ "\n" +
+ "\n" +
+ " return;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
public void testBug280255b() throws JavaModelException {
this.formatterPrefs.indent_empty_lines = true;
- String source =
- "public class X {\r\n" +
- " private void foo(int val) {\r\n" +
- " switch (val) {\r\n" +
- " case 0:\r\n" +
- " {\r\n" +
- "\r\n" +
- "\r\n" +
- "[# return ;#]\r\n" +
- " }\r\n" +
- " }\r\n" +
- " }\r\n" +
+ String source =
+ "public class X {\r\n" +
+ " private void foo(int val) {\r\n" +
+ " switch (val) {\r\n" +
+ " case 0:\r\n" +
+ " {\r\n" +
+ "\r\n" +
+ "\r\n" +
+ "[# return ;#]\r\n" +
+ " }\r\n" +
+ " }\r\n" +
+ " }\r\n" +
"}\r\n";
formatSource(source,
- "public class X {\r\n" +
- " private void foo(int val) {\r\n" +
- " switch (val) {\r\n" +
- " case 0:\r\n" +
- " {\r\n" +
- "\r\n" +
- "\r\n" +
- " return;\r\n" +
- " }\r\n" +
- " }\r\n" +
- " }\r\n" +
+ "public class X {\r\n" +
+ " private void foo(int val) {\r\n" +
+ " switch (val) {\r\n" +
+ " case 0:\r\n" +
+ " {\r\n" +
+ "\r\n" +
+ "\r\n" +
+ " return;\r\n" +
+ " }\r\n" +
+ " }\r\n" +
+ " }\r\n" +
"}\r\n"
);
}
@@ -6087,59 +6087,59 @@ public void testBug280255b() throws JavaModelException {
*/
public void testBug280616() throws JavaModelException {
setPageWidth80();
- String source =
- "public interface X {\n" +
- "/**\n" +
- " * <pre>\n" +
- " * void solve(Executor e,\n" +
- " * Collection&lt;Callable&lt;Result&gt;&gt; solvers)\n" +
- " * throws InterruptedException, ExecutionException {\n" +
- " * CompletionService&lt;Result&gt; ecs\n" +
- " * = new ExecutorCompletionService&lt;Result&gt;(e);\n" +
- " * for (Callable&lt;Result&gt; s : solvers)\n" +
- " * ecs.submit(s);\n" +
- " * int n = solvers.size();\n" +
- " * for (int i = 0; i &lt; n; ++i) {\n" +
- " * Result r = ecs.take().get();\n" +
- " * if (r != null)\n" +
- " * use(r);\n" +
- " * }\n" +
- " * }\n" +
- " * </pre>\n" +
- " */\n" +
- " void foo();\n" +
- "}\n";
- formatSource(source,
- "public interface X {\n" +
- " /**\n" +
- " * <pre>\n" +
- " * void solve(Executor e, Collection&lt;Callable&lt;Result&gt;&gt; solvers)\n" +
- " * throws InterruptedException, ExecutionException {\n" +
- " * CompletionService&lt;Result&gt; ecs = new ExecutorCompletionService&lt;Result&gt;(\n" +
- " * e);\n" +
- " * for (Callable&lt;Result&gt; s : solvers)\n" +
- " * ecs.submit(s);\n" +
- " * int n = solvers.size();\n" +
- " * for (int i = 0; i &lt; n; ++i) {\n" +
- " * Result r = ecs.take().get();\n" +
- " * if (r != null)\n" +
- " * use(r);\n" +
- " * }\n" +
- " * }\n" +
- " * </pre>\n" +
- " */\n" +
- " void foo();\n" +
+ String source =
+ "public interface X {\n" +
+ "/**\n" +
+ " * <pre>\n" +
+ " * void solve(Executor e,\n" +
+ " * Collection&lt;Callable&lt;Result&gt;&gt; solvers)\n" +
+ " * throws InterruptedException, ExecutionException {\n" +
+ " * CompletionService&lt;Result&gt; ecs\n" +
+ " * = new ExecutorCompletionService&lt;Result&gt;(e);\n" +
+ " * for (Callable&lt;Result&gt; s : solvers)\n" +
+ " * ecs.submit(s);\n" +
+ " * int n = solvers.size();\n" +
+ " * for (int i = 0; i &lt; n; ++i) {\n" +
+ " * Result r = ecs.take().get();\n" +
+ " * if (r != null)\n" +
+ " * use(r);\n" +
+ " * }\n" +
+ " * }\n" +
+ " * </pre>\n" +
+ " */\n" +
+ " void foo();\n" +
+ "}\n";
+ formatSource(source,
+ "public interface X {\n" +
+ " /**\n" +
+ " * <pre>\n" +
+ " * void solve(Executor e, Collection&lt;Callable&lt;Result&gt;&gt; solvers)\n" +
+ " * throws InterruptedException, ExecutionException {\n" +
+ " * CompletionService&lt;Result&gt; ecs = new ExecutorCompletionService&lt;Result&gt;(\n" +
+ " * e);\n" +
+ " * for (Callable&lt;Result&gt; s : solvers)\n" +
+ " * ecs.submit(s);\n" +
+ " * int n = solvers.size();\n" +
+ " * for (int i = 0; i &lt; n; ++i) {\n" +
+ " * Result r = ecs.take().get();\n" +
+ " * if (r != null)\n" +
+ " * use(r);\n" +
+ " * }\n" +
+ " * }\n" +
+ " * </pre>\n" +
+ " */\n" +
+ " void foo();\n" +
"}\n"
);
}
/**
- * @bug 287833: [formatter] Formatter removes the first character after the * in the <pre> tag
+ * @bug 287833: [formatter] Formatter removes the first character after the * in the <pre> tag
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=287833"
*/
public void testBug287833a() {
- String source =
- "public class test1 {\n" +
+ String source =
+ "public class test1 {\n" +
"/**\n"+
"* <pre>\n"+
"*void foo() {\n"+
@@ -6149,8 +6149,8 @@ public void testBug287833a() {
"void foo() {\n"+
"}\n"+
"}\n";
-
- formatSource(source,
+
+ formatSource(source,
"public class test1 {\n"+
" /**\n"+
" * <pre>\n"+
@@ -6163,8 +6163,8 @@ public void testBug287833a() {
"}\n");
}
public void testBug287833b() {
- String source =
- "public class test1 {\n" +
+ String source =
+ "public class test1 {\n" +
"/**\n"+
"* <pre>\n"+
"* void foo() {\n"+
@@ -6175,8 +6175,8 @@ public void testBug287833b() {
"void foo() {\n"+
"}\n"+
"}\n";
-
- formatSource(source,
+
+ formatSource(source,
"public class test1 {\n"+
" /**\n"+
" * <pre>\n"+
@@ -6190,8 +6190,8 @@ public void testBug287833b() {
"}\n");
}
public void testBug287833c() {
- String source =
- "public class test1 {\n" +
+ String source =
+ "public class test1 {\n" +
"/**\n"+
"* <pre>\n"+
"* void foo() {\n"+
@@ -6202,8 +6202,8 @@ public void testBug287833c() {
"void foo() {\n"+
"}\n"+
"}\n";
-
- formatSource(source,
+
+ formatSource(source,
"public class test1 {\n"+
" /**\n"+
" * <pre>\n"+
@@ -6223,11 +6223,11 @@ public void testBug287833c() {
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=295825"
*/
public void testBug295825() {
- String source =
- "public class A {\n" +
- " /* * command */\n" +
- " void method() {\n" +
- " }\n" +
+ String source =
+ "public class A {\n" +
+ " /* * command */\n" +
+ " void method() {\n" +
+ " }\n" +
"}\n";
formatSource(source);
}
@@ -6238,58 +6238,58 @@ public void testBug295825() {
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=300379"
*/
public void testBug300379() {
- String source =
- "public class X {\n" +
- " /**\n" +
- " * <pre> {@code\n" +
- " * \n" +
- " * public class X {\n" +
- " * }}</pre>\n" +
- " */\n" +
- " public void foo() {}\n" +
+ String source =
+ "public class X {\n" +
+ " /**\n" +
+ " * <pre> {@code\n" +
+ " * \n" +
+ " * public class X {\n" +
+ " * }}</pre>\n" +
+ " */\n" +
+ " public void foo() {}\n" +
"}\n";
-
- formatSource(source,
- "public class X {\n" +
- " /**\n" +
- " * <pre>\n" +
- " * {\n" +
- " * &#64;code\n" +
- " * \n" +
- " * public class X {\n" +
- " * }\n" +
- " * }\n" +
- " * </pre>\n" +
- " */\n" +
- " public void foo() {\n" +
- " }\n" +
+
+ formatSource(source,
+ "public class X {\n" +
+ " /**\n" +
+ " * <pre>\n" +
+ " * {\n" +
+ " * &#64;code\n" +
+ " * \n" +
+ " * public class X {\n" +
+ " * }\n" +
+ " * }\n" +
+ " * </pre>\n" +
+ " */\n" +
+ " public void foo() {\n" +
+ " }\n" +
"}\n");
}
public void testBug300379b() {
- String source =
- "public class X {\n" +
- " /**\n" +
- " * <pre> {@code\n" +
- " * \n" +
- " * public class X {}}</pre>\n" +
- " */\n" +
- " public void foo() {}\n" +
+ String source =
+ "public class X {\n" +
+ " /**\n" +
+ " * <pre> {@code\n" +
+ " * \n" +
+ " * public class X {}}</pre>\n" +
+ " */\n" +
+ " public void foo() {}\n" +
"}\n";
-
- formatSource(source,
- "public class X {\n" +
- " /**\n" +
- " * <pre>\n" +
- " * {\n" +
- " * &#64;code\n" +
- " * \n" +
- " * public class X {\n" +
- " * }\n" +
- " * }\n" +
- " * </pre>\n" +
- " */\n" +
- " public void foo() {\n" +
- " }\n" +
+
+ formatSource(source,
+ "public class X {\n" +
+ " /**\n" +
+ " * <pre>\n" +
+ " * {\n" +
+ " * &#64;code\n" +
+ " * \n" +
+ " * public class X {\n" +
+ " * }\n" +
+ " * }\n" +
+ " * </pre>\n" +
+ " */\n" +
+ " public void foo() {\n" +
+ " }\n" +
"}\n");
}
@@ -6301,32 +6301,32 @@ public void testBug300379b() {
public void testBug304705() {
setFormatLineCommentOnFirstColumn();
this.formatterPrefs.never_indent_line_comments_on_first_column = true;
- String source =
- "public interface Example {\n" +
- "// This is a long comment with whitespace that should be split in multiple line comments in case the line comment formatting is enabled\n" +
- " int foo();\n" +
+ String source =
+ "public interface Example {\n" +
+ "// This is a long comment with whitespace that should be split in multiple line comments in case the line comment formatting is enabled\n" +
+ " int foo();\n" +
"}\n";
- formatSource(source,
- "public interface Example {\n" +
- "// This is a long comment with whitespace that should be split in multiple line\n" +
- "// comments in case the line comment formatting is enabled\n" +
- " int foo();\n" +
+ formatSource(source,
+ "public interface Example {\n" +
+ "// This is a long comment with whitespace that should be split in multiple line\n" +
+ "// comments in case the line comment formatting is enabled\n" +
+ " int foo();\n" +
"}\n");
}
public void testBug304705b() {
this.formatterPrefs.never_indent_block_comments_on_first_column = true;
- String source =
- "public interface Example {\n" +
- "/* This is a long comment with whitespace that should be split in multiple line comments in case the line comment formatting is enabled */\n" +
- " int foo();\n" +
+ String source =
+ "public interface Example {\n" +
+ "/* This is a long comment with whitespace that should be split in multiple line comments in case the line comment formatting is enabled */\n" +
+ " int foo();\n" +
"}\n";
- formatSource(source,
- "public interface Example {\n" +
- "/*\n" +
- " * This is a long comment with whitespace that should be split in multiple line\n" +
- " * comments in case the line comment formatting is enabled\n" +
- " */\n" +
- " int foo();\n" +
+ formatSource(source,
+ "public interface Example {\n" +
+ "/*\n" +
+ " * This is a long comment with whitespace that should be split in multiple line\n" +
+ " * comments in case the line comment formatting is enabled\n" +
+ " */\n" +
+ " int foo();\n" +
"}\n");
}
@@ -6340,35 +6340,35 @@ public void testBug305281() {
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_USE_ON_OFF_TAGS, DefaultCodeFormatterConstants.TRUE);
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_DISABLING_TAG, "format: OFF");
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_ENABLING_TAG, "format: ON");
- String source =
- "public class test {\n" +
- "\n" +
- " /**\n" +
- " * @param args\n" +
- " * format: OFF\n" +
- " */\n" +
- " public static void main(String[] args) {\n" +
- " do {\n" +
- " } while (false);\n" +
- " for (;;) {\n" +
- " }\n" +
- " // format: ON\n" +
- " }\n" +
+ String source =
+ "public class test {\n" +
+ "\n" +
+ " /**\n" +
+ " * @param args\n" +
+ " * format: OFF\n" +
+ " */\n" +
+ " public static void main(String[] args) {\n" +
+ " do {\n" +
+ " } while (false);\n" +
+ " for (;;) {\n" +
+ " }\n" +
+ " // format: ON\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class test {\n" +
- "\n" +
- " /**\n" +
- " * @param args\n" +
- " * format: OFF\n" +
- " */\n" +
- " public static void main(String[] args) {\n" +
- " do {\n" +
- " } while (false);\n" +
- " for (;;) {\n" +
- " }\n" +
- " // format: ON\n" +
- " }\n" +
+ "public class test {\n" +
+ "\n" +
+ " /**\n" +
+ " * @param args\n" +
+ " * format: OFF\n" +
+ " */\n" +
+ " public static void main(String[] args) {\n" +
+ " do {\n" +
+ " } while (false);\n" +
+ " for (;;) {\n" +
+ " }\n" +
+ " // format: ON\n" +
+ " }\n" +
"}\n");
}
@@ -6380,53 +6380,53 @@ public void testBug305281() {
public void testBug305371() {
this.formatterPrefs = null;
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_LINE_COMMENT_STARTING_ON_FIRST_COLUMN, DefaultCodeFormatterConstants.FALSE);
- String source =
- "class X01 {\n" +
- "// unformatted comment !\n" +
- " // formatted comment !\n" +
+ String source =
+ "class X01 {\n" +
+ "// unformatted comment !\n" +
+ " // formatted comment !\n" +
"}\n";
formatSource(source,
- "class X01 {\n" +
- "// unformatted comment !\n" +
- " // formatted comment !\n" +
+ "class X01 {\n" +
+ "// unformatted comment !\n" +
+ " // formatted comment !\n" +
"}\n");
}
public void testBug305371b() {
this.formatterPrefs = null;
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_LINE_COMMENT_STARTING_ON_FIRST_COLUMN, DefaultCodeFormatterConstants.FALSE);
- String source =
- "class X02 {\n" +
- " // formatted comment !\n" +
- "// unformatted comment !\n" +
+ String source =
+ "class X02 {\n" +
+ " // formatted comment !\n" +
+ "// unformatted comment !\n" +
"}\n";
formatSource(source,
- "class X02 {\n" +
- " // formatted comment !\n" +
- "// unformatted comment !\n" +
+ "class X02 {\n" +
+ " // formatted comment !\n" +
+ "// unformatted comment !\n" +
"}\n");
}
public void testBug305371c() {
- String source =
- "class X03 {\n" +
- " // formatted comment 1\n" +
- " // formatted comment 2\n" +
+ String source =
+ "class X03 {\n" +
+ " // formatted comment 1\n" +
+ " // formatted comment 2\n" +
"}\n";
formatSource(source,
- "class X03 {\n" +
- " // formatted comment 1\n" +
- " // formatted comment 2\n" +
+ "class X03 {\n" +
+ " // formatted comment 1\n" +
+ " // formatted comment 2\n" +
"}\n");
}
public void testBug305371d() {
- String source =
- "class X04 {\n" +
- " // formatted comment 1\n" +
- " // formatted comment 2\n" +
+ String source =
+ "class X04 {\n" +
+ " // formatted comment 1\n" +
+ " // formatted comment 2\n" +
"}\n";
formatSource(source,
- "class X04 {\n" +
- " // formatted comment 1\n" +
- " // formatted comment 2\n" +
+ "class X04 {\n" +
+ " // formatted comment 1\n" +
+ " // formatted comment 2\n" +
"}\n");
}
@@ -6436,118 +6436,118 @@ public void testBug305371d() {
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=305518"
*/
public void testBug305518() {
- String source =
- "public interface Test {\n" +
- "/**\n" +
- " * <pre>\n" +
- " * A\n" +
- " * / \\\n" +
- " * B C\n" +
- " * / \\ / \\\n" +
- " *D E F G\n" +
- " * </pre>\n" +
- " */\n" +
- "public void foo();\n" +
+ String source =
+ "public interface Test {\n" +
+ "/**\n" +
+ " * <pre>\n" +
+ " * A\n" +
+ " * / \\\n" +
+ " * B C\n" +
+ " * / \\ / \\\n" +
+ " *D E F G\n" +
+ " * </pre>\n" +
+ " */\n" +
+ "public void foo();\n" +
"}\n";
formatSource(source,
- "public interface Test {\n" +
- " /**\n" +
- " * <pre>\n" +
- " * A\n" +
- " * / \\\n" +
- " * B C\n" +
- " * / \\ / \\\n" +
- " *D E F G\n" +
- " * </pre>\n" +
- " */\n" +
- " public void foo();\n" +
+ "public interface Test {\n" +
+ " /**\n" +
+ " * <pre>\n" +
+ " * A\n" +
+ " * / \\\n" +
+ " * B C\n" +
+ " * / \\ / \\\n" +
+ " *D E F G\n" +
+ " * </pre>\n" +
+ " */\n" +
+ " public void foo();\n" +
"}\n");
}
public void testBug305518_wksp2_01() {
useOldCommentWidthCounting();
- String source =
- "public class X01 {\n" +
- "/**\n" +
- " <P> This is an example of starting and shutting down the Network Server in the example\n" +
- " above with the API.\n" +
- " <PRE>\n" +
- " \n" +
- " NetworkServerControl serverControl = new NetworkServerControl(InetAddress.getByName(\"myhost\"),1621)\n" +
- "\n" +
- " serverControl.shutdown();\n" +
- " </PRE>\n" +
- "\n" +
- " \n" +
- "*/\n" +
- "public void foo() {}\n" +
+ String source =
+ "public class X01 {\n" +
+ "/**\n" +
+ " <P> This is an example of starting and shutting down the Network Server in the example\n" +
+ " above with the API.\n" +
+ " <PRE>\n" +
+ " \n" +
+ " NetworkServerControl serverControl = new NetworkServerControl(InetAddress.getByName(\"myhost\"),1621)\n" +
+ "\n" +
+ " serverControl.shutdown();\n" +
+ " </PRE>\n" +
+ "\n" +
+ " \n" +
+ "*/\n" +
+ "public void foo() {}\n" +
"}\n";
formatSource(source,
- "public class X01 {\n" +
- " /**\n" +
- " * <P>\n" +
- " * This is an example of starting and shutting down the Network Server in\n" +
- " * the example above with the API.\n" +
- " * \n" +
- " * <PRE>\n" +
- " \n" +
- " NetworkServerControl serverControl = new NetworkServerControl(InetAddress.getByName(\"myhost\"),1621)\n" +
- " \n" +
- " serverControl.shutdown();\n" +
- " * </PRE>\n" +
- " * \n" +
- " * \n" +
- " */\n" +
- " public void foo() {\n" +
- " }\n" +
+ "public class X01 {\n" +
+ " /**\n" +
+ " * <P>\n" +
+ " * This is an example of starting and shutting down the Network Server in\n" +
+ " * the example above with the API.\n" +
+ " * \n" +
+ " * <PRE>\n" +
+ " \n" +
+ " NetworkServerControl serverControl = new NetworkServerControl(InetAddress.getByName(\"myhost\"),1621)\n" +
+ " \n" +
+ " serverControl.shutdown();\n" +
+ " * </PRE>\n" +
+ " * \n" +
+ " * \n" +
+ " */\n" +
+ " public void foo() {\n" +
+ " }\n" +
"}\n");
}
public void testBug305518_wksp2_02() {
- String source =
- "public class X02 {\n" +
- "/**\n" +
- " * Represents namespace name:\n" +
- " * <pre>e.g.<pre>MyNamespace;\n" +
- " *MyProject\\Sub\\Level;\n" +
- " *namespace\\MyProject\\Sub\\Level;\n" +
- " */\n" +
- "public void foo() {}\n" +
+ String source =
+ "public class X02 {\n" +
+ "/**\n" +
+ " * Represents namespace name:\n" +
+ " * <pre>e.g.<pre>MyNamespace;\n" +
+ " *MyProject\\Sub\\Level;\n" +
+ " *namespace\\MyProject\\Sub\\Level;\n" +
+ " */\n" +
+ "public void foo() {}\n" +
"}\n";
formatSource(source,
- "public class X02 {\n" +
- " /**\n" +
- " * Represents namespace name:\n" +
- " * \n" +
- " * <pre>\n" +
- " * e.g.\n" +
- " * \n" +
- " * <pre>\n" +
- " * MyNamespace; MyProject\\Sub\\Level; namespace\\MyProject\\Sub\\Level;\n" +
- " */\n" +
- " public void foo() {\n" +
- " }\n" +
+ "public class X02 {\n" +
+ " /**\n" +
+ " * Represents namespace name:\n" +
+ " * \n" +
+ " * <pre>\n" +
+ " * e.g.\n" +
+ " * \n" +
+ " * <pre>\n" +
+ " * MyNamespace; MyProject\\Sub\\Level; namespace\\MyProject\\Sub\\Level;\n" +
+ " */\n" +
+ " public void foo() {\n" +
+ " }\n" +
"}\n");
}
public void testBug305518_wksp2_03() {
- String source =
- "public class X03 {\n" +
- "/**\n" +
- "* <PRE>\n" +
- "* String s = ... ; // get string from somewhere\n" +
- "* byte [] compressed = UnicodeCompressor.compress(s);\n" +
- "* </PRE>\n" +
- " */\n" +
- "public void foo() {}\n" +
+ String source =
+ "public class X03 {\n" +
+ "/**\n" +
+ "* <PRE>\n" +
+ "* String s = ... ; // get string from somewhere\n" +
+ "* byte [] compressed = UnicodeCompressor.compress(s);\n" +
+ "* </PRE>\n" +
+ " */\n" +
+ "public void foo() {}\n" +
"}\n";
formatSource(source,
- "public class X03 {\n" +
- " /**\n" +
- " * <PRE>\n" +
- " * String s = ... ; // get string from somewhere\n" +
- " * byte [] compressed = UnicodeCompressor.compress(s);\n" +
- " * </PRE>\n" +
- " */\n" +
- " public void foo() {\n" +
- " }\n" +
+ "public class X03 {\n" +
+ " /**\n" +
+ " * <PRE>\n" +
+ " * String s = ... ; // get string from somewhere\n" +
+ " * byte [] compressed = UnicodeCompressor.compress(s);\n" +
+ " * </PRE>\n" +
+ " */\n" +
+ " public void foo() {\n" +
+ " }\n" +
"}\n");
}
@@ -6560,23 +6560,23 @@ public void testBug305830() {
this.formatterPrefs = null;
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "40");
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "40");
- String source =
- "public class X01 {\n" +
- "void foo() {\n" +
- "bar(\"a non-nls string\", 0 /*a comment*/); //$NON-NLS-1$\n" +
- "}\n" +
- "void bar(String string, int i) {\n" +
- "}\n" +
+ String source =
+ "public class X01 {\n" +
+ "void foo() {\n" +
+ "bar(\"a non-nls string\", 0 /*a comment*/); //$NON-NLS-1$\n" +
+ "}\n" +
+ "void bar(String string, int i) {\n" +
+ "}\n" +
"}\n";
formatSource(source,
- "public class X01 {\n" +
- " void foo() {\n" +
- " bar(\"a non-nls string\", //$NON-NLS-1$\n" +
- " 0 /* a comment */);\n" +
- " }\n" +
- "\n" +
- " void bar(String string, int i) {\n" +
- " }\n" +
+ "public class X01 {\n" +
+ " void foo() {\n" +
+ " bar(\"a non-nls string\", //$NON-NLS-1$\n" +
+ " 0 /* a comment */);\n" +
+ " }\n" +
+ "\n" +
+ " void bar(String string, int i) {\n" +
+ " }\n" +
"}\n"
);
}
@@ -6584,22 +6584,22 @@ public void testBug305830b() {
this.formatterPrefs = null;
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "40");
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "40");
- String source =
- "public class X02 {\n" +
- "void foo() {\n" +
- "bar(\"str\", 0 /*a comment*/); //$NON-NLS-1$\n" +
- "}\n" +
- "void bar(String string, int i) {\n" +
- "}\n" +
+ String source =
+ "public class X02 {\n" +
+ "void foo() {\n" +
+ "bar(\"str\", 0 /*a comment*/); //$NON-NLS-1$\n" +
+ "}\n" +
+ "void bar(String string, int i) {\n" +
+ "}\n" +
"}\n";
formatSource(source,
- "public class X02 {\n" +
- " void foo() {\n" +
- " bar(\"str\", 0 /* a comment */); //$NON-NLS-1$\n" +
- " }\n" +
- "\n" +
- " void bar(String string, int i) {\n" +
- " }\n" +
+ "public class X02 {\n" +
+ " void foo() {\n" +
+ " bar(\"str\", 0 /* a comment */); //$NON-NLS-1$\n" +
+ " }\n" +
+ "\n" +
+ " void bar(String string, int i) {\n" +
+ " }\n" +
"}\n"
);
}
@@ -6607,22 +6607,22 @@ public void testBug305830c() {
this.formatterPrefs = null;
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "40");
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "40");
- String source =
- "public class X03 {\n" +
- "void foo() {\n" +
- "bar(\"str\", 0 /* a comment */); //$NON-NLS-1$\n" +
- "}\n" +
- "void bar(String string, int i) {\n" +
- "}\n" +
+ String source =
+ "public class X03 {\n" +
+ "void foo() {\n" +
+ "bar(\"str\", 0 /* a comment */); //$NON-NLS-1$\n" +
+ "}\n" +
+ "void bar(String string, int i) {\n" +
+ "}\n" +
"}\n";
formatSource(source,
- "public class X03 {\n" +
- " void foo() {\n" +
- " bar(\"str\", 0 /* a comment */); //$NON-NLS-1$\n" +
- " }\n" +
- "\n" +
- " void bar(String string, int i) {\n" +
- " }\n" +
+ "public class X03 {\n" +
+ " void foo() {\n" +
+ " bar(\"str\", 0 /* a comment */); //$NON-NLS-1$\n" +
+ " }\n" +
+ "\n" +
+ " void bar(String string, int i) {\n" +
+ " }\n" +
"}\n"
);
}
@@ -6630,23 +6630,23 @@ public void testBug305830d() {
this.formatterPrefs = null;
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "40");
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "40");
- String source =
- "public class X01 {\n" +
- "void foo() {\n" +
- "bar(\"a non-nls string\" /*a comment*/, 0); //$NON-NLS-1$\n" +
- "}\n" +
- "void bar(String string, int i) {\n" +
- "}\n" +
+ String source =
+ "public class X01 {\n" +
+ "void foo() {\n" +
+ "bar(\"a non-nls string\" /*a comment*/, 0); //$NON-NLS-1$\n" +
+ "}\n" +
+ "void bar(String string, int i) {\n" +
+ "}\n" +
"}\n";
formatSource(source,
- "public class X01 {\n" +
- " void foo() {\n" +
- " bar(\"a non-nls string\" /* a comment */, //$NON-NLS-1$\n" +
- " 0);\n" +
- " }\n" +
- "\n" +
- " void bar(String string, int i) {\n" +
- " }\n" +
+ "public class X01 {\n" +
+ " void foo() {\n" +
+ " bar(\"a non-nls string\" /* a comment */, //$NON-NLS-1$\n" +
+ " 0);\n" +
+ " }\n" +
+ "\n" +
+ " void bar(String string, int i) {\n" +
+ " }\n" +
"}\n"
);
}
@@ -6659,199 +6659,199 @@ public void testBug305830d() {
public void testBug309835() {
this.formatterPrefs.join_lines_in_comments = false;
this.formatterPrefs.comment_line_length = 120;
- String source =
- "package org.eclipse.bug.test;\n" +
- "\n" +
- "/**\n" +
- " * @author Bug Reporter\n" +
- " * ThisIsAVeryLongCommentWithoutSpaces_TheFormatterTriesToBreakTheLine_ButTheResultOfItIsThatANewLineIsAdded_____\n" +
- " * \n" +
- " * Try to press Ctrl+Shift+F to format the code. If the unbreakable line is exactly 121 characters long,\n" +
- " * a blank line is inserted on each formating.\n" +
- " * Check project preferences to see the format settings\n" +
- " * (max. line length 80 chars, max. comment line length 120 chars)\n" +
- " */\n" +
- "public class FormatterBug {\n" +
+ String source =
+ "package org.eclipse.bug.test;\n" +
+ "\n" +
+ "/**\n" +
+ " * @author Bug Reporter\n" +
+ " * ThisIsAVeryLongCommentWithoutSpaces_TheFormatterTriesToBreakTheLine_ButTheResultOfItIsThatANewLineIsAdded_____\n" +
+ " * \n" +
+ " * Try to press Ctrl+Shift+F to format the code. If the unbreakable line is exactly 121 characters long,\n" +
+ " * a blank line is inserted on each formating.\n" +
+ " * Check project preferences to see the format settings\n" +
+ " * (max. line length 80 chars, max. comment line length 120 chars)\n" +
+ " */\n" +
+ "public class FormatterBug {\n" +
"}\n";
formatSource(source);
}
public void testBug309835b() {
this.formatterPrefs.comment_line_length = 120;
- String source =
- "package org.eclipse.bug.test;\n" +
- "\n" +
- "/**\n" +
- " * @author Bug Reporter\n" +
- " * ThisIsAVeryLongCommentWithoutSpaces_TheFormatterTriesToBreakTheLine_ButTheResultOfItIsThatANewLineIsAdded_____\n" +
- " * \n" +
- " * Try to press Ctrl+Shift+F to format the code. If the unbreakable line is exactly 121 characters long,\n" +
- " * a blank line is inserted on each formating.\n" +
- " * Check project preferences to see the format settings\n" +
- " * (max. line length 80 chars, max. comment line length 120 chars)\n" +
- " */\n" +
- "public class FormatterBug {\n" +
+ String source =
+ "package org.eclipse.bug.test;\n" +
+ "\n" +
+ "/**\n" +
+ " * @author Bug Reporter\n" +
+ " * ThisIsAVeryLongCommentWithoutSpaces_TheFormatterTriesToBreakTheLine_ButTheResultOfItIsThatANewLineIsAdded_____\n" +
+ " * \n" +
+ " * Try to press Ctrl+Shift+F to format the code. If the unbreakable line is exactly 121 characters long,\n" +
+ " * a blank line is inserted on each formating.\n" +
+ " * Check project preferences to see the format settings\n" +
+ " * (max. line length 80 chars, max. comment line length 120 chars)\n" +
+ " */\n" +
+ "public class FormatterBug {\n" +
"}\n";
formatSource(source,
- "package org.eclipse.bug.test;\n" +
- "\n" +
- "/**\n" +
- " * @author Bug Reporter\n" +
- " * ThisIsAVeryLongCommentWithoutSpaces_TheFormatterTriesToBreakTheLine_ButTheResultOfItIsThatANewLineIsAdded_____\n" +
- " * \n" +
- " * Try to press Ctrl+Shift+F to format the code. If the unbreakable line is exactly 121 characters long, a blank\n" +
- " * line is inserted on each formating. Check project preferences to see the format settings (max. line length 80\n" +
- " * chars, max. comment line length 120 chars)\n" +
- " */\n" +
- "public class FormatterBug {\n" +
+ "package org.eclipse.bug.test;\n" +
+ "\n" +
+ "/**\n" +
+ " * @author Bug Reporter\n" +
+ " * ThisIsAVeryLongCommentWithoutSpaces_TheFormatterTriesToBreakTheLine_ButTheResultOfItIsThatANewLineIsAdded_____\n" +
+ " * \n" +
+ " * Try to press Ctrl+Shift+F to format the code. If the unbreakable line is exactly 121 characters long, a blank\n" +
+ " * line is inserted on each formating. Check project preferences to see the format settings (max. line length 80\n" +
+ " * chars, max. comment line length 120 chars)\n" +
+ " */\n" +
+ "public class FormatterBug {\n" +
"}\n"
);
}
public void testBug309835c() {
this.formatterPrefs.join_lines_in_comments = false;
- String source =
- "package org.eclipse.bug.test;\n" +
- "\n" +
- "/**\n" +
- " * @author Bug Reporter\n" +
- " * ThisIsAVeryLongCommentWithoutSpaces_TheFormatterTriesToBreakTheLine_ButTheResultOfItIsThatANewLineIsAdded_____\n" +
- " * \n" +
- " * Try to press Ctrl+Shift+F to format the code. If the unbreakable line is exactly 121 characters long,\n" +
- " * a blank line is inserted on each formating.\n" +
- " * Check project preferences to see the format settings\n" +
- " * (max. line length 80 chars, max. comment line length 120 chars)\n" +
- " */\n" +
- "public class FormatterBug {\n" +
+ String source =
+ "package org.eclipse.bug.test;\n" +
+ "\n" +
+ "/**\n" +
+ " * @author Bug Reporter\n" +
+ " * ThisIsAVeryLongCommentWithoutSpaces_TheFormatterTriesToBreakTheLine_ButTheResultOfItIsThatANewLineIsAdded_____\n" +
+ " * \n" +
+ " * Try to press Ctrl+Shift+F to format the code. If the unbreakable line is exactly 121 characters long,\n" +
+ " * a blank line is inserted on each formating.\n" +
+ " * Check project preferences to see the format settings\n" +
+ " * (max. line length 80 chars, max. comment line length 120 chars)\n" +
+ " */\n" +
+ "public class FormatterBug {\n" +
"}\n";
formatSource(source,
- "package org.eclipse.bug.test;\n" +
- "\n" +
- "/**\n" +
- " * @author Bug Reporter\n" +
- " * ThisIsAVeryLongCommentWithoutSpaces_TheFormatterTriesToBreakTheLine_ButTheResultOfItIsThatANewLineIsAdded_____\n" +
- " * \n" +
- " * Try to press Ctrl+Shift+F to format the code. If the unbreakable line\n" +
- " * is exactly 121 characters long,\n" +
- " * a blank line is inserted on each formating.\n" +
- " * Check project preferences to see the format settings\n" +
- " * (max. line length 80 chars, max. comment line length 120 chars)\n" +
- " */\n" +
- "public class FormatterBug {\n" +
+ "package org.eclipse.bug.test;\n" +
+ "\n" +
+ "/**\n" +
+ " * @author Bug Reporter\n" +
+ " * ThisIsAVeryLongCommentWithoutSpaces_TheFormatterTriesToBreakTheLine_ButTheResultOfItIsThatANewLineIsAdded_____\n" +
+ " * \n" +
+ " * Try to press Ctrl+Shift+F to format the code. If the unbreakable line\n" +
+ " * is exactly 121 characters long,\n" +
+ " * a blank line is inserted on each formating.\n" +
+ " * Check project preferences to see the format settings\n" +
+ " * (max. line length 80 chars, max. comment line length 120 chars)\n" +
+ " */\n" +
+ "public class FormatterBug {\n" +
"}\n"
);
}
public void testBug309835d() {
- String source =
- "package org.eclipse.bug.test;\n" +
- "\n" +
- "/**\n" +
- " * @author Bug Reporter\n" +
- " * ThisIsAVeryLongCommentWithoutSpaces_TheFormatterTriesToBreakTheLine_ButTheResultOfItIsThatANewLineIsAdded_____\n" +
- " * \n" +
- " * Try to press Ctrl+Shift+F to format the code. If the unbreakable line is exactly 121 characters long,\n" +
- " * a blank line is inserted on each formating.\n" +
- " * Check project preferences to see the format settings\n" +
- " * (max. line length 80 chars, max. comment line length 120 chars)\n" +
- " */\n" +
- "public class FormatterBug {\n" +
+ String source =
+ "package org.eclipse.bug.test;\n" +
+ "\n" +
+ "/**\n" +
+ " * @author Bug Reporter\n" +
+ " * ThisIsAVeryLongCommentWithoutSpaces_TheFormatterTriesToBreakTheLine_ButTheResultOfItIsThatANewLineIsAdded_____\n" +
+ " * \n" +
+ " * Try to press Ctrl+Shift+F to format the code. If the unbreakable line is exactly 121 characters long,\n" +
+ " * a blank line is inserted on each formating.\n" +
+ " * Check project preferences to see the format settings\n" +
+ " * (max. line length 80 chars, max. comment line length 120 chars)\n" +
+ " */\n" +
+ "public class FormatterBug {\n" +
"}\n";
formatSource(source,
- "package org.eclipse.bug.test;\n" +
- "\n" +
- "/**\n" +
- " * @author Bug Reporter\n" +
- " * ThisIsAVeryLongCommentWithoutSpaces_TheFormatterTriesToBreakTheLine_ButTheResultOfItIsThatANewLineIsAdded_____\n" +
- " * \n" +
- " * Try to press Ctrl+Shift+F to format the code. If the unbreakable line\n" +
- " * is exactly 121 characters long, a blank line is inserted on each\n" +
- " * formating. Check project preferences to see the format settings (max.\n" +
- " * line length 80 chars, max. comment line length 120 chars)\n" +
- " */\n" +
- "public class FormatterBug {\n" +
+ "package org.eclipse.bug.test;\n" +
+ "\n" +
+ "/**\n" +
+ " * @author Bug Reporter\n" +
+ " * ThisIsAVeryLongCommentWithoutSpaces_TheFormatterTriesToBreakTheLine_ButTheResultOfItIsThatANewLineIsAdded_____\n" +
+ " * \n" +
+ " * Try to press Ctrl+Shift+F to format the code. If the unbreakable line\n" +
+ " * is exactly 121 characters long, a blank line is inserted on each\n" +
+ " * formating. Check project preferences to see the format settings (max.\n" +
+ " * line length 80 chars, max. comment line length 120 chars)\n" +
+ " */\n" +
+ "public class FormatterBug {\n" +
"}\n"
);
}
public void testBug309835_wksp1_01() {
useOldJavadocTagsFormatting();
- String source =
- "public class X01 {\n" +
- "\n" +
- " /**\n" +
- " * @param severity the severity to search for. Must be one of <code>FATAL\n" +
- " * </code>, <code>ERROR</code>, <code>WARNING</code> or <code>INFO</code>\n" +
- " */\n" +
- " public void foo(int severity) {\n" +
- " }\n" +
+ String source =
+ "public class X01 {\n" +
+ "\n" +
+ " /**\n" +
+ " * @param severity the severity to search for. Must be one of <code>FATAL\n" +
+ " * </code>, <code>ERROR</code>, <code>WARNING</code> or <code>INFO</code>\n" +
+ " */\n" +
+ " public void foo(int severity) {\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X01 {\n" +
- "\n" +
- " /**\n" +
- " * @param severity\n" +
- " * the severity to search for. Must be one of <code>FATAL\n" +
- " * </code>, <code>ERROR</code>, <code>WARNING</code> or <code>INFO</code>\n" +
- " */\n" +
- " public void foo(int severity) {\n" +
- " }\n" +
+ "public class X01 {\n" +
+ "\n" +
+ " /**\n" +
+ " * @param severity\n" +
+ " * the severity to search for. Must be one of <code>FATAL\n" +
+ " * </code>, <code>ERROR</code>, <code>WARNING</code> or <code>INFO</code>\n" +
+ " */\n" +
+ " public void foo(int severity) {\n" +
+ " }\n" +
"}\n"
);
}
public void testBug309835_wksp1_02() {
useOldCommentWidthCounting();
useOldJavadocTagsFormatting();
- String source =
- "public class X02 {\n" +
- "\n" +
- " /**\n" +
- " * INTERNAL USE-ONLY\n" +
- " * Generate the byte for a problem method info that correspond to a boggus method.\n" +
- " *\n" +
- " * @param method org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration\n" +
- " * @param methodBinding org.eclipse.jdt.internal.compiler.nameloopkup.MethodBinding\n" +
- " */\n" +
- " public void foo(int severity) {\n" +
- " }\n" +
+ String source =
+ "public class X02 {\n" +
+ "\n" +
+ " /**\n" +
+ " * INTERNAL USE-ONLY\n" +
+ " * Generate the byte for a problem method info that correspond to a boggus method.\n" +
+ " *\n" +
+ " * @param method org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration\n" +
+ " * @param methodBinding org.eclipse.jdt.internal.compiler.nameloopkup.MethodBinding\n" +
+ " */\n" +
+ " public void foo(int severity) {\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X02 {\n" +
- "\n" +
- " /**\n" +
- " * INTERNAL USE-ONLY Generate the byte for a problem method info that\n" +
- " * correspond to a boggus method.\n" +
- " *\n" +
- " * @param method\n" +
- " * org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration\n" +
- " * @param methodBinding\n" +
- " * org.eclipse.jdt.internal.compiler.nameloopkup.MethodBinding\n" +
- " */\n" +
- " public void foo(int severity) {\n" +
- " }\n" +
+ "public class X02 {\n" +
+ "\n" +
+ " /**\n" +
+ " * INTERNAL USE-ONLY Generate the byte for a problem method info that\n" +
+ " * correspond to a boggus method.\n" +
+ " *\n" +
+ " * @param method\n" +
+ " * org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration\n" +
+ " * @param methodBinding\n" +
+ " * org.eclipse.jdt.internal.compiler.nameloopkup.MethodBinding\n" +
+ " */\n" +
+ " public void foo(int severity) {\n" +
+ " }\n" +
"}\n"
);
}
public void testBug309835_wksp2_01() {
- String source =
- "public class X01 {\n" +
- "\n" +
- " /**\n" +
- " * Given a jar file, get the names of any AnnotationProcessorFactory\n" +
- " * implementations it offers. The information is based on the Sun\n" +
- " * <a href=\"http://download.oracle.com/javase/6/docs/technotes/guides/jar/jar.html#Service%20Provider\">\n" +
- " * Jar Service Provider spec</a>: the jar file contains a META-INF/services\n" +
- " */\n" +
- " public void foo() {\n" +
- " }\n" +
+ String source =
+ "public class X01 {\n" +
+ "\n" +
+ " /**\n" +
+ " * Given a jar file, get the names of any AnnotationProcessorFactory\n" +
+ " * implementations it offers. The information is based on the Sun\n" +
+ " * <a href=\"http://download.oracle.com/javase/6/docs/technotes/guides/jar/jar.html#Service%20Provider\">\n" +
+ " * Jar Service Provider spec</a>: the jar file contains a META-INF/services\n" +
+ " */\n" +
+ " public void foo() {\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X01 {\n" +
- "\n" +
- " /**\n" +
- " * Given a jar file, get the names of any AnnotationProcessorFactory\n" +
- " * implementations it offers. The information is based on the Sun <a href=\n" +
- " * \"http://download.oracle.com/javase/6/docs/technotes/guides/jar/jar.html#Service%20Provider\">\n" +
- " * Jar Service Provider spec</a>: the jar file contains a META-INF/services\n" +
- " */\n" +
- " public void foo() {\n" +
- " }\n" +
+ "public class X01 {\n" +
+ "\n" +
+ " /**\n" +
+ " * Given a jar file, get the names of any AnnotationProcessorFactory\n" +
+ " * implementations it offers. The information is based on the Sun <a href=\n" +
+ " * \"http://download.oracle.com/javase/6/docs/technotes/guides/jar/jar.html#Service%20Provider\">\n" +
+ " * Jar Service Provider spec</a>: the jar file contains a META-INF/services\n" +
+ " */\n" +
+ " public void foo() {\n" +
+ " }\n" +
"}\n"
);
}
@@ -6866,38 +6866,38 @@ public void testBug311864() throws JavaModelException {
useOldJavadocTagsFormatting();
this.formatterPrefs.use_tags = true;
String source =
- "public class Test {\n" +
- "\n" +
- "/**\n" +
- "* Compares two property values. For font or color the <i>description</i> of\n" +
- "* the resource, {@link FontData} or {@link RGB}, is used for comparison.\n" +
- "*\n" +
- "* @param value1\n" +
- "* first property value\n" +
- "* @param value2\n" +
- "* second property value\n" +
- "* @return {@code true} if the values are equals; otherwise {@code}\n" +
- "*/\n" +
- "boolean foo(int value1, int value2) {\n" +
- " return value1 > value2;\n" +
- "}\n" +
- "}\n";
- formatSource(source,
- "public class Test {\n" +
- "\n" +
- " /**\n" +
- " * Compares two property values. For font or color the <i>description</i> of\n" +
- " * the resource, {@link FontData} or {@link RGB}, is used for comparison.\n" +
- " *\n" +
- " * @param value1\n" +
- " * first property value\n" +
- " * @param value2\n" +
- " * second property value\n" +
- " * @return {@code true} if the values are equals; otherwise {@code}\n" +
- " */\n" +
- " boolean foo(int value1, int value2) {\n" +
- " return value1 > value2;\n" +
- " }\n" +
+ "public class Test {\n" +
+ "\n" +
+ "/**\n" +
+ "* Compares two property values. For font or color the <i>description</i> of\n" +
+ "* the resource, {@link FontData} or {@link RGB}, is used for comparison.\n" +
+ "*\n" +
+ "* @param value1\n" +
+ "* first property value\n" +
+ "* @param value2\n" +
+ "* second property value\n" +
+ "* @return {@code true} if the values are equals; otherwise {@code}\n" +
+ "*/\n" +
+ "boolean foo(int value1, int value2) {\n" +
+ " return value1 > value2;\n" +
+ "}\n" +
+ "}\n";
+ formatSource(source,
+ "public class Test {\n" +
+ "\n" +
+ " /**\n" +
+ " * Compares two property values. For font or color the <i>description</i> of\n" +
+ " * the resource, {@link FontData} or {@link RGB}, is used for comparison.\n" +
+ " *\n" +
+ " * @param value1\n" +
+ " * first property value\n" +
+ " * @param value2\n" +
+ " * second property value\n" +
+ " * @return {@code true} if the values are equals; otherwise {@code}\n" +
+ " */\n" +
+ " boolean foo(int value1, int value2) {\n" +
+ " return value1 > value2;\n" +
+ " }\n" +
"}\n"
);
}
@@ -6909,18 +6909,18 @@ public void testBug311864() throws JavaModelException {
*/
public void testBug315577() throws JavaModelException {
String source =
- "public class C {\n" +
- "\n" +
- " /**\n" +
- " * aaaa aaa aaa.<br>\n" +
- " * {@link C}: aaaa.<br>\n" +
- " * {@link C}: aaaa.<br>\n" +
- " * aaa {@link C}: aaaa.<br>\n" +
- " * {@link C}: aaaa<br>\n" +
- " * {@link C}: aaaa.<br>\n" +
- " */\n" +
- " public C() {\n" +
- " }\n" +
+ "public class C {\n" +
+ "\n" +
+ " /**\n" +
+ " * aaaa aaa aaa.<br>\n" +
+ " * {@link C}: aaaa.<br>\n" +
+ " * {@link C}: aaaa.<br>\n" +
+ " * aaa {@link C}: aaaa.<br>\n" +
+ " * {@link C}: aaaa<br>\n" +
+ " * {@link C}: aaaa.<br>\n" +
+ " */\n" +
+ " public C() {\n" +
+ " }\n" +
"}\n";
formatSource(source);
}
@@ -6937,8 +6937,8 @@ public void testBug315732() throws JavaModelException {
"// /*-*/\r\n" +
"// ============================================================================\r\n";
formatSource(source,
- " // ============================================================================\n" +
- " // /*-*/\n" +
+ " // ============================================================================\n" +
+ " // /*-*/\n" +
" // ============================================================================\n",
CodeFormatter.K_UNKNOWN,
1,
@@ -6955,15 +6955,15 @@ public void testBug313651_01() {
this.formatterPrefs = null;
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_LINE_COMMENT, DefaultCodeFormatterConstants.FALSE);
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_NEVER_INDENT_LINE_COMMENTS_ON_FIRST_COLUMN, DefaultCodeFormatterConstants.TRUE);
- String source =
- "public class X01 {\n" +
- " public void testMethod() {\n" +
- " // Comment 1\n" +
- " System.out.println(\"start\");\n" +
- "// System.out.println(\"next\");\n" +
- " // Comment 1\n" +
- " System.out.println(\"end\");\n" +
- " }\n" +
+ String source =
+ "public class X01 {\n" +
+ " public void testMethod() {\n" +
+ " // Comment 1\n" +
+ " System.out.println(\"start\");\n" +
+ "// System.out.println(\"next\");\n" +
+ " // Comment 1\n" +
+ " System.out.println(\"end\");\n" +
+ " }\n" +
"}\n";
formatSource(source);
}
@@ -6972,39 +6972,39 @@ public void testBug313651_01b() {
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_LINE_COMMENT, DefaultCodeFormatterConstants.TRUE);
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_LINE_COMMENT_STARTING_ON_FIRST_COLUMN, DefaultCodeFormatterConstants.FALSE);
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_NEVER_INDENT_LINE_COMMENTS_ON_FIRST_COLUMN, DefaultCodeFormatterConstants.TRUE);
- String source =
- "public class X01 {\n" +
- " public void testMethod() {\n" +
- " // Comment 1\n" +
- " System.out.println(\"start\");\n" +
- "// System.out.println(\"next\");\n" +
- " // Comment 1\n" +
- " System.out.println(\"end\");\n" +
- " }\n" +
+ String source =
+ "public class X01 {\n" +
+ " public void testMethod() {\n" +
+ " // Comment 1\n" +
+ " System.out.println(\"start\");\n" +
+ "// System.out.println(\"next\");\n" +
+ " // Comment 1\n" +
+ " System.out.println(\"end\");\n" +
+ " }\n" +
"}\n";
formatSource(source);
}
public void testBug313651_01c() {
setFormatLineCommentOnFirstColumn();
- String source =
- "public class X01 {\n" +
- " public void testMethod() {\n" +
- " // Comment 1\n" +
- " System.out.println(\"start\");\n" +
- "// System.out.println(\"next\");\n" +
- " // Comment 1\n" +
- " System.out.println(\"end\");\n" +
- " }\n" +
+ String source =
+ "public class X01 {\n" +
+ " public void testMethod() {\n" +
+ " // Comment 1\n" +
+ " System.out.println(\"start\");\n" +
+ "// System.out.println(\"next\");\n" +
+ " // Comment 1\n" +
+ " System.out.println(\"end\");\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X01 {\n" +
- " public void testMethod() {\n" +
- " // Comment 1\n" +
- " System.out.println(\"start\");\n" +
- " // System.out.println(\"next\");\n" +
- " // Comment 1\n" +
- " System.out.println(\"end\");\n" +
- " }\n" +
+ "public class X01 {\n" +
+ " public void testMethod() {\n" +
+ " // Comment 1\n" +
+ " System.out.println(\"start\");\n" +
+ " // System.out.println(\"next\");\n" +
+ " // Comment 1\n" +
+ " System.out.println(\"end\");\n" +
+ " }\n" +
"}\n"
);
}
@@ -7012,15 +7012,15 @@ public void testBug313651_02() {
this.formatterPrefs = null;
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_LINE_COMMENT, DefaultCodeFormatterConstants.FALSE);
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_NEVER_INDENT_LINE_COMMENTS_ON_FIRST_COLUMN, DefaultCodeFormatterConstants.TRUE);
- String source =
- "public class X02 {\n" +
- " public void testMethod() {\n" +
- " // Comment 1\n" +
- " System.out.println(\"start\");\n" +
- " System.out.println(\"next\");\n" +
- " // Comment 1\n" +
- "// System.out.println(\"end\");\n" +
- " }\n" +
+ String source =
+ "public class X02 {\n" +
+ " public void testMethod() {\n" +
+ " // Comment 1\n" +
+ " System.out.println(\"start\");\n" +
+ " System.out.println(\"next\");\n" +
+ " // Comment 1\n" +
+ "// System.out.println(\"end\");\n" +
+ " }\n" +
"}\n";
formatSource(source);
}
@@ -7029,39 +7029,39 @@ public void testBug313651_02b() {
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_LINE_COMMENT, DefaultCodeFormatterConstants.TRUE);
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_LINE_COMMENT_STARTING_ON_FIRST_COLUMN, DefaultCodeFormatterConstants.FALSE);
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_NEVER_INDENT_LINE_COMMENTS_ON_FIRST_COLUMN, DefaultCodeFormatterConstants.TRUE);
- String source =
- "public class X02 {\n" +
- " public void testMethod() {\n" +
- " // Comment 1\n" +
- " System.out.println(\"start\");\n" +
- " System.out.println(\"next\");\n" +
- " // Comment 1\n" +
- "// System.out.println(\"end\");\n" +
- " }\n" +
+ String source =
+ "public class X02 {\n" +
+ " public void testMethod() {\n" +
+ " // Comment 1\n" +
+ " System.out.println(\"start\");\n" +
+ " System.out.println(\"next\");\n" +
+ " // Comment 1\n" +
+ "// System.out.println(\"end\");\n" +
+ " }\n" +
"}\n";
formatSource(source);
}
public void testBug313651_02c() {
setFormatLineCommentOnFirstColumn();
- String source =
- "public class X02 {\n" +
- " public void testMethod() {\n" +
- " // Comment 1\n" +
- " System.out.println(\"start\");\n" +
- " System.out.println(\"next\");\n" +
- " // Comment 1\n" +
- "// System.out.println(\"end\");\n" +
- " }\n" +
+ String source =
+ "public class X02 {\n" +
+ " public void testMethod() {\n" +
+ " // Comment 1\n" +
+ " System.out.println(\"start\");\n" +
+ " System.out.println(\"next\");\n" +
+ " // Comment 1\n" +
+ "// System.out.println(\"end\");\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X02 {\n" +
- " public void testMethod() {\n" +
- " // Comment 1\n" +
- " System.out.println(\"start\");\n" +
- " System.out.println(\"next\");\n" +
- " // Comment 1\n" +
- " // System.out.println(\"end\");\n" +
- " }\n" +
+ "public class X02 {\n" +
+ " public void testMethod() {\n" +
+ " // Comment 1\n" +
+ " System.out.println(\"start\");\n" +
+ " System.out.println(\"next\");\n" +
+ " // Comment 1\n" +
+ " // System.out.println(\"end\");\n" +
+ " }\n" +
"}\n"
);
}
@@ -7069,15 +7069,15 @@ public void testBug313651_03() {
this.formatterPrefs = null;
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_LINE_COMMENT, DefaultCodeFormatterConstants.FALSE);
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_NEVER_INDENT_LINE_COMMENTS_ON_FIRST_COLUMN, DefaultCodeFormatterConstants.TRUE);
- String source =
- "public class X03 {\n" +
- " public void testMethod() {\n" +
- " // Comment 1\n" +
- " System.out.println(\"start\");\n" +
- "// System.out.println(\"next\");\n" +
- " // Comment 1\n" +
- "// System.out.println(\"end\");\n" +
- " }\n" +
+ String source =
+ "public class X03 {\n" +
+ " public void testMethod() {\n" +
+ " // Comment 1\n" +
+ " System.out.println(\"start\");\n" +
+ "// System.out.println(\"next\");\n" +
+ " // Comment 1\n" +
+ "// System.out.println(\"end\");\n" +
+ " }\n" +
"}\n";
formatSource(source);
}
@@ -7086,130 +7086,130 @@ public void testBug313651_03b() {
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_LINE_COMMENT, DefaultCodeFormatterConstants.TRUE);
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_LINE_COMMENT_STARTING_ON_FIRST_COLUMN, DefaultCodeFormatterConstants.FALSE);
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_NEVER_INDENT_LINE_COMMENTS_ON_FIRST_COLUMN, DefaultCodeFormatterConstants.TRUE);
- String source =
- "public class X03 {\n" +
- " public void testMethod() {\n" +
- " // Comment 1\n" +
- " System.out.println(\"start\");\n" +
- "// System.out.println(\"next\");\n" +
- " // Comment 1\n" +
- "// System.out.println(\"end\");\n" +
- " }\n" +
+ String source =
+ "public class X03 {\n" +
+ " public void testMethod() {\n" +
+ " // Comment 1\n" +
+ " System.out.println(\"start\");\n" +
+ "// System.out.println(\"next\");\n" +
+ " // Comment 1\n" +
+ "// System.out.println(\"end\");\n" +
+ " }\n" +
"}\n";
formatSource(source);
}
public void testBug313651_03c() {
setFormatLineCommentOnFirstColumn();
- String source =
- "public class X03 {\n" +
- " public void testMethod() {\n" +
- " // Comment 1\n" +
- " System.out.println(\"start\");\n" +
- "// System.out.println(\"next\");\n" +
- " // Comment 1\n" +
- "// System.out.println(\"end\");\n" +
- " }\n" +
+ String source =
+ "public class X03 {\n" +
+ " public void testMethod() {\n" +
+ " // Comment 1\n" +
+ " System.out.println(\"start\");\n" +
+ "// System.out.println(\"next\");\n" +
+ " // Comment 1\n" +
+ "// System.out.println(\"end\");\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X03 {\n" +
- " public void testMethod() {\n" +
- " // Comment 1\n" +
- " System.out.println(\"start\");\n" +
- " // System.out.println(\"next\");\n" +
- " // Comment 1\n" +
- " // System.out.println(\"end\");\n" +
- " }\n" +
+ "public class X03 {\n" +
+ " public void testMethod() {\n" +
+ " // Comment 1\n" +
+ " System.out.println(\"start\");\n" +
+ " // System.out.println(\"next\");\n" +
+ " // Comment 1\n" +
+ " // System.out.println(\"end\");\n" +
+ " }\n" +
"}\n"
);
}
public void testBug313651_wksp3_01() {
setFormatLineCommentOnFirstColumn();
- String source =
- "package wksp3;\n" +
- "public class X01 implements\n" +
- "// start of comment\n" +
- "// MyFirstInterface {\n" +
- " MySecondInterface {\n" +
- "// end of comment\n" +
+ String source =
+ "package wksp3;\n" +
+ "public class X01 implements\n" +
+ "// start of comment\n" +
+ "// MyFirstInterface {\n" +
+ " MySecondInterface {\n" +
+ "// end of comment\n" +
"}\n";
formatSource(source,
- "package wksp3;\n" +
- "\n" +
- "public class X01 implements\n" +
- " // start of comment\n" +
- " // MyFirstInterface {\n" +
- " MySecondInterface {\n" +
- " // end of comment\n" +
+ "package wksp3;\n" +
+ "\n" +
+ "public class X01 implements\n" +
+ " // start of comment\n" +
+ " // MyFirstInterface {\n" +
+ " MySecondInterface {\n" +
+ " // end of comment\n" +
"}\n"
);
}
public void testBug313651_wksp3_02() {
setFormatLineCommentOnFirstColumn();
- String source =
- "package wksp3;\n" +
- "public class X02 implements MyOtherInterface, \n" +
- "// start of comment\n" +
- "// MyFirstInterface {\n" +
- " MySecondInterface {\n" +
- "// end of comment\n" +
+ String source =
+ "package wksp3;\n" +
+ "public class X02 implements MyOtherInterface, \n" +
+ "// start of comment\n" +
+ "// MyFirstInterface {\n" +
+ " MySecondInterface {\n" +
+ "// end of comment\n" +
"}\n";
formatSource(source,
- "package wksp3;\n" +
- "\n" +
- "public class X02 implements MyOtherInterface,\n" +
- " // start of comment\n" +
- " // MyFirstInterface {\n" +
- " MySecondInterface {\n" +
- " // end of comment\n" +
+ "package wksp3;\n" +
+ "\n" +
+ "public class X02 implements MyOtherInterface,\n" +
+ " // start of comment\n" +
+ " // MyFirstInterface {\n" +
+ " MySecondInterface {\n" +
+ " // end of comment\n" +
"}\n"
);
}
public void testBug348338() {
useOldCommentWidthCounting();
- String source =
- "public class X03 {\n" +
- " /**\n" +
- " * Check wrapping of javadoc tags surrounded wit punctuation [{@code marks}].\n" +
- " * <p>\n" +
- " * Check wrapping of string literals surrounded with punctuation marks (\"e.g. in parenthesis\" wraps).\n" +
- " * <p>\n" +
- " * {@code Sometimes wrapping on punctuation is necessary because line is too}. long otherwise.\n" +
- " */\n" +
- " public void test() {\n" +
- "\n" +
- " /*\n" +
- " * Check wrapping of string literals surrounded with punctuation marks (\"e.g. in parenthesis\" wraps).\n" +
- " * \n" +
- " * The dot at the end of this sentence is beyond the line \"length limit\".\n" +
- " * \n" +
- " * But this sentence should fit in the line length limit \"with the dot\".\n" +
- " */\n" +
- " }\n" +
+ String source =
+ "public class X03 {\n" +
+ " /**\n" +
+ " * Check wrapping of javadoc tags surrounded wit punctuation [{@code marks}].\n" +
+ " * <p>\n" +
+ " * Check wrapping of string literals surrounded with punctuation marks (\"e.g. in parenthesis\" wraps).\n" +
+ " * <p>\n" +
+ " * {@code Sometimes wrapping on punctuation is necessary because line is too}. long otherwise.\n" +
+ " */\n" +
+ " public void test() {\n" +
+ "\n" +
+ " /*\n" +
+ " * Check wrapping of string literals surrounded with punctuation marks (\"e.g. in parenthesis\" wraps).\n" +
+ " * \n" +
+ " * The dot at the end of this sentence is beyond the line \"length limit\".\n" +
+ " * \n" +
+ " * But this sentence should fit in the line length limit \"with the dot\".\n" +
+ " */\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class X03 {\n" +
- " /**\n" +
- " * Check wrapping of javadoc tags surrounded wit punctuation\n" +
- " * [{@code marks}].\n" +
- " * <p>\n" +
- " * Check wrapping of string literals surrounded with punctuation marks\n" +
- " * (\"e.g. in parenthesis\" wraps).\n" +
- " * <p>\n" +
- " * {@code Sometimes wrapping on punctuation is necessary because line is too}.\n" +
- " * long otherwise.\n" +
- " */\n" +
- " public void test() {\n" +
- "\n" +
- " /*\n" +
- " * Check wrapping of string literals surrounded with punctuation marks\n" +
- " * (\"e.g. in parenthesis\" wraps).\n" +
- " * \n" +
- " * The dot at the end of this sentence is beyond the line\n" +
- " * \"length limit\".\n" +
- " * \n" +
- " * But this sentence should fit in the line length limit \"with the dot\".\n" +
- " */\n" +
- " }\n" +
+ "public class X03 {\n" +
+ " /**\n" +
+ " * Check wrapping of javadoc tags surrounded wit punctuation\n" +
+ " * [{@code marks}].\n" +
+ " * <p>\n" +
+ " * Check wrapping of string literals surrounded with punctuation marks\n" +
+ " * (\"e.g. in parenthesis\" wraps).\n" +
+ " * <p>\n" +
+ " * {@code Sometimes wrapping on punctuation is necessary because line is too}.\n" +
+ " * long otherwise.\n" +
+ " */\n" +
+ " public void test() {\n" +
+ "\n" +
+ " /*\n" +
+ " * Check wrapping of string literals surrounded with punctuation marks\n" +
+ " * (\"e.g. in parenthesis\" wraps).\n" +
+ " * \n" +
+ " * The dot at the end of this sentence is beyond the line\n" +
+ " * \"length limit\".\n" +
+ " * \n" +
+ " * But this sentence should fit in the line length limit \"with the dot\".\n" +
+ " */\n" +
+ " }\n" +
"}\n"
);
}
@@ -7217,39 +7217,39 @@ public void testBug470986() {
this.formatterPrefs.comment_format_line_comment = false;
this.formatterPrefs.comment_preserve_white_space_between_code_and_line_comments = true;
String source =
- "class Example { // test\n" +
- "\n" +
- " void method1() { // test\n" +
- " int a = 1; // test\n" +
- " }// test\n" +
- "\n" +
+ "class Example { // test\n" +
+ "\n" +
+ " void method1() { // test\n" +
+ " int a = 1; // test\n" +
+ " }// test\n" +
+ "\n" +
"}";
formatSource(source);
}
public void testBug471062() {
this.formatterPrefs.comment_preserve_white_space_between_code_and_line_comments = true;
- String source =
- "class C {\r\n" +
- " void method() {\r\n" +
- " Arrays.asList(1, 2, // test\r\n" +
- " 3, 4);\r\n" +
- " if (condition) // test\r\n" +
- " operation();\r\n" +
- " }\r\n" +
+ String source =
+ "class C {\r\n" +
+ " void method() {\r\n" +
+ " Arrays.asList(1, 2, // test\r\n" +
+ " 3, 4);\r\n" +
+ " if (condition) // test\r\n" +
+ " operation();\r\n" +
+ " }\r\n" +
"}";
formatSource(source);
}
public void testBug471918() {
- String source =
- "class C {\n" +
- "\n" +
- " /** Returns a new foo instance. */\n" +
- " public Foo createFoo1() {\n" +
- " }\n" +
- "\n" +
- " /** @return a new foo instance. */\n" +
- " public Foo createFoo2() {\n" +
- " }\n" +
+ String source =
+ "class C {\n" +
+ "\n" +
+ " /** Returns a new foo instance. */\n" +
+ " public Foo createFoo1() {\n" +
+ " }\n" +
+ "\n" +
+ " /** @return a new foo instance. */\n" +
+ " public Foo createFoo2() {\n" +
+ " }\n" +
"}";
formatSource(source);
}
@@ -7258,27 +7258,27 @@ public void testBug471918() {
*/
public void testBug474011() {
useOldCommentWidthCounting();
- String source =
- "class A {\n" +
- " String aaaaaaaaaaaaaaaa = \"11111111111111111111111111111111111111\"; //$NON-NLS-1$ aaa bbb ccc\n" +
- " String bbbbbbbbbbbbbbbb = \"22222222222222222222222222222222222222\"; //$NON-NLS-1$ //$NON-NLS-1$\n" +
- " String cccccccccccccccc = \"33333333333333333333333333333333333333\"; //$NON-NLS-1$ //$NON-NLS-2$\n" +
- " String dddddddddddddddd = \"44444444444444444444444444444444444444\"; //$NON-NLS-1$ // $NON-NLS-2$\n" +
- " String eeeeeeeeeeeeeeee = \"55555555555555555555555555555555555555\"; //$NON-NLS-1$ // aaa // bbb\n" +
+ String source =
+ "class A {\n" +
+ " String aaaaaaaaaaaaaaaa = \"11111111111111111111111111111111111111\"; //$NON-NLS-1$ aaa bbb ccc\n" +
+ " String bbbbbbbbbbbbbbbb = \"22222222222222222222222222222222222222\"; //$NON-NLS-1$ //$NON-NLS-1$\n" +
+ " String cccccccccccccccc = \"33333333333333333333333333333333333333\"; //$NON-NLS-1$ //$NON-NLS-2$\n" +
+ " String dddddddddddddddd = \"44444444444444444444444444444444444444\"; //$NON-NLS-1$ // $NON-NLS-2$\n" +
+ " String eeeeeeeeeeeeeeee = \"55555555555555555555555555555555555555\"; //$NON-NLS-1$ // aaa // bbb\n" +
"}";
formatSource(source,
- "class A {\n" +
- " String aaaaaaaaaaaaaaaa = \"11111111111111111111111111111111111111\"; //$NON-NLS-1$ aaa\n" +
- " // bbb\n" +
- " // ccc\n" +
- " String bbbbbbbbbbbbbbbb = \"22222222222222222222222222222222222222\"; //$NON-NLS-1$\n" +
- " String cccccccccccccccc = \"33333333333333333333333333333333333333\"; //$NON-NLS-1$ //$NON-NLS-2$\n" +
- " String dddddddddddddddd = \"44444444444444444444444444444444444444\"; //$NON-NLS-1$ //\n" +
- " // $NON-NLS-2$\n" +
- " String eeeeeeeeeeeeeeee = \"55555555555555555555555555555555555555\"; //$NON-NLS-1$ //\n" +
- " // aaa\n" +
- " // //\n" +
- " // bbb\n" +
+ "class A {\n" +
+ " String aaaaaaaaaaaaaaaa = \"11111111111111111111111111111111111111\"; //$NON-NLS-1$ aaa\n" +
+ " // bbb\n" +
+ " // ccc\n" +
+ " String bbbbbbbbbbbbbbbb = \"22222222222222222222222222222222222222\"; //$NON-NLS-1$\n" +
+ " String cccccccccccccccc = \"33333333333333333333333333333333333333\"; //$NON-NLS-1$ //$NON-NLS-2$\n" +
+ " String dddddddddddddddd = \"44444444444444444444444444444444444444\"; //$NON-NLS-1$ //\n" +
+ " // $NON-NLS-2$\n" +
+ " String eeeeeeeeeeeeeeee = \"55555555555555555555555555555555555555\"; //$NON-NLS-1$ //\n" +
+ " // aaa\n" +
+ " // //\n" +
+ " // bbb\n" +
"}");
}
/**
@@ -7287,48 +7287,48 @@ public void testBug474011() {
public void testBug475294() {
useOldCommentWidthCounting();
this.formatterPrefs.comment_preserve_white_space_between_code_and_line_comments = true;
- String source =
- "public class A {\n" +
- " void a() {\n" +
- " System.out.println();// aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " }\n" +
+ String source =
+ "public class A {\n" +
+ " void a() {\n" +
+ " System.out.println();// aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " }\n" +
"}";
formatSource(source,
- "public class A {\n" +
- " void a() {\n" +
- " System.out.println();// aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
- " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
- " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
- " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
- " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
- " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
- " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
- " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
- " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
- " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
- " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
- " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " }\n" +
+ "public class A {\n" +
+ " void a() {\n" +
+ " System.out.println();// aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
+ " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
+ " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
+ " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
+ " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
+ " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
+ " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
+ " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
+ " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
+ " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
+ " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
+ " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " }\n" +
"}");
}
/**
@@ -7338,63 +7338,63 @@ public void testBug475294b() {
useOldCommentWidthCounting();
this.formatterPrefs.comment_preserve_white_space_between_code_and_line_comments = true;
this.formatterPrefs.use_tabs_only_for_leading_indentations = true;
- String source =
- "public class A {\n" +
- " void a() {\n" +
- " System.out.println();// aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " }\n" +
+ String source =
+ "public class A {\n" +
+ " void a() {\n" +
+ " System.out.println();// aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " }\n" +
"}";
formatSource(source,
- "public class A {\n" +
- " void a() {\n" +
- " System.out.println();// aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
- " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
- " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
- " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
- " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
- " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
- " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
- " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
- " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
- " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
- " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
- " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
- " }\n" +
+ "public class A {\n" +
+ " void a() {\n" +
+ " System.out.println();// aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
+ " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
+ " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
+ " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
+ " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
+ " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
+ " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
+ " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
+ " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
+ " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
+ " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " System.out.println(); // aaaaaaa bbbbbbbbbbbbbbb ccccccccccccc\n" +
+ " // ddddddddddddddd eeeeeeeeeeeeeee\n" +
+ " }\n" +
"}");
}
/**
* https://bugs.eclipse.org/479292 - [formatter] Header comment formatting for package-info.java occurs even when "Format header comment" is unchecked
*/
public void testBug479292() {
- String source =
- "/** This is a header comment */\n" +
- "\n" +
- "/** This is a package javadoc */\n" +
+ String source =
+ "/** This is a header comment */\n" +
+ "\n" +
+ "/** This is a package javadoc */\n" +
"package test;";
formatSource(source,
- "/** This is a header comment */\n" +
- "\n" +
- "/** This is a package javadoc */\n" +
+ "/** This is a header comment */\n" +
+ "\n" +
+ "/** This is a package javadoc */\n" +
"package test;"
);
}
@@ -7403,15 +7403,15 @@ public void testBug479292() {
*/
public void testBug479292b() {
this.formatterPrefs.comment_format_header = true;
- String source =
- "/** This is a header comment */\n" +
- "\n" +
- "/** This is a package javadoc */\n" +
+ String source =
+ "/** This is a header comment */\n" +
+ "\n" +
+ "/** This is a package javadoc */\n" +
"package test;";
formatSource(source,
- "/** This is a header comment */\n" +
- "\n" +
- "/** This is a package javadoc */\n" +
+ "/** This is a header comment */\n" +
+ "\n" +
+ "/** This is a package javadoc */\n" +
"package test;"
);
}
@@ -7419,13 +7419,13 @@ public void testBug479292b() {
* https://bugs.eclipse.org/121728 - [formatter] Code formatter thinks <P> generic class parameter is a HTML <p> tag
*/
public void testBug121728() {
- String source =
- "/**\n" +
- " * Test Class\n" +
- " *\n" +
- " * @param <P> Some generic class parameter\n" +
- " */\n" +
- "public class Test<P> {\n" +
+ String source =
+ "/**\n" +
+ " * Test Class\n" +
+ " *\n" +
+ " * @param <P> Some generic class parameter\n" +
+ " */\n" +
+ "public class Test<P> {\n" +
"}";
formatSource(source);
}
@@ -7433,31 +7433,31 @@ public void testBug121728() {
* https://bugs.eclipse.org/479469 - [formatter] Line wrap for long @see references
*/
public void testBug479469() {
- String source =
- "/**\n" +
- " * Test Class\n" +
- " * @see a.very.loong.reference.with.a.fully.qualified.paackage.that.should.not.be.wrapped.Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n" +
- " *\n" +
- " * @see a.very.loong.reference.with.a.fully.qualified.paackage.that.should.not.be.wrapped.Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa Label can be wrapped\n" +
- " *\n" +
- " * @see <a href=\"a.very.loong.reference.with.a.fully.qualified.paackage.that.should.not.be.wrapped.Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\">Label can be wrapped</a>\n" +
- " */\n" +
- "public class Test {\n" +
+ String source =
+ "/**\n" +
+ " * Test Class\n" +
+ " * @see a.very.loong.reference.with.a.fully.qualified.paackage.that.should.not.be.wrapped.Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n" +
+ " *\n" +
+ " * @see a.very.loong.reference.with.a.fully.qualified.paackage.that.should.not.be.wrapped.Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa Label can be wrapped\n" +
+ " *\n" +
+ " * @see <a href=\"a.very.loong.reference.with.a.fully.qualified.paackage.that.should.not.be.wrapped.Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\">Label can be wrapped</a>\n" +
+ " */\n" +
+ "public class Test {\n" +
"}";
formatSource(source,
- "/**\n" +
- " * Test Class\n" +
- " * \n" +
- " * @see a.very.loong.reference.with.a.fully.qualified.paackage.that.should.not.be.wrapped.Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n" +
- " *\n" +
- " * @see a.very.loong.reference.with.a.fully.qualified.paackage.that.should.not.be.wrapped.Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n" +
- " * Label can be wrapped\n" +
- " *\n" +
- " * @see <a href=\n" +
- " * \"a.very.loong.reference.with.a.fully.qualified.paackage.that.should.not.be.wrapped.Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\">Label\n" +
- " * can be wrapped</a>\n" +
- " */\n" +
- "public class Test {\n" +
+ "/**\n" +
+ " * Test Class\n" +
+ " * \n" +
+ " * @see a.very.loong.reference.with.a.fully.qualified.paackage.that.should.not.be.wrapped.Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n" +
+ " *\n" +
+ " * @see a.very.loong.reference.with.a.fully.qualified.paackage.that.should.not.be.wrapped.Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n" +
+ " * Label can be wrapped\n" +
+ " *\n" +
+ " * @see <a href=\n" +
+ " * \"a.very.loong.reference.with.a.fully.qualified.paackage.that.should.not.be.wrapped.Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\">Label\n" +
+ " * can be wrapped</a>\n" +
+ " */\n" +
+ "public class Test {\n" +
"}"
);
}
@@ -7465,23 +7465,23 @@ public void testBug479469() {
* https://bugs.eclipse.org/480029 - [formatter] Comments indentation error in javadoc @return statements
*/
public void testBug480029() {
- String source =
- "public class JavadocCommentIssue\n" +
- "{\n" +
- " /** @return <ul><li>Case 1</b></li></ul> */\n" +
- " public int foo() {return 0;}\n" +
+ String source =
+ "public class JavadocCommentIssue\n" +
+ "{\n" +
+ " /** @return <ul><li>Case 1</b></li></ul> */\n" +
+ " public int foo() {return 0;}\n" +
"}\n";
formatSource(source,
- "public class JavadocCommentIssue {\n" +
- " /**\n" +
- " * @return\n" +
- " * <ul>\n" +
- " * <li>Case 1</b></li>\n" +
- " * </ul>\n" +
- " */\n" +
- " public int foo() {\n" +
- " return 0;\n" +
- " }\n" +
+ "public class JavadocCommentIssue {\n" +
+ " /**\n" +
+ " * @return\n" +
+ " * <ul>\n" +
+ " * <li>Case 1</b></li>\n" +
+ " * </ul>\n" +
+ " */\n" +
+ " public int foo() {\n" +
+ " return 0;\n" +
+ " }\n" +
"}\n"
);
}
@@ -7489,28 +7489,28 @@ public void testBug480029() {
* https://bugs.eclipse.org/480030 - [formatter] Comments indentation error in switch statements
*/
public void testBug480030() {
- String source =
- "public class SwitchCommentIssue {\n" +
- " public void switchIssue(int a) {\n" +
- " while (a > 0) {\n" +
- " switch (a) {\n" +
- " // Test\n" +
- " case 1:\n" +
- " break;\n" +
- " // Test\n" +
- " case 2:\n" +
- " continue;\n" +
- " // Test\n" +
- " case 3:\n" +
- " return;\n" +
- " // Test\n" +
- " case 4: {\n" +
- " return;\n" +
- " }\n" +
- " // test\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ String source =
+ "public class SwitchCommentIssue {\n" +
+ " public void switchIssue(int a) {\n" +
+ " while (a > 0) {\n" +
+ " switch (a) {\n" +
+ " // Test\n" +
+ " case 1:\n" +
+ " break;\n" +
+ " // Test\n" +
+ " case 2:\n" +
+ " continue;\n" +
+ " // Test\n" +
+ " case 3:\n" +
+ " return;\n" +
+ " // Test\n" +
+ " case 4: {\n" +
+ " return;\n" +
+ " }\n" +
+ " // test\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n";
formatSource(source);
}
@@ -7523,20 +7523,20 @@ public void testBug479474() {
Hashtable<String, String> newParserOptions = JavaCore.getOptions();
newParserOptions.put(CompilerOptions.OPTION_DocCommentSupport, CompilerOptions.DISABLED);
JavaCore.setOptions(newParserOptions);
- String source =
- "/**\n" +
- " * Test\n" +
- " * @author mr.awesome\n" +
- " */\n" +
- "public class Test {\n" +
+ String source =
+ "/**\n" +
+ " * Test\n" +
+ " * @author mr.awesome\n" +
+ " */\n" +
+ "public class Test {\n" +
"}";
formatSource(source,
- "/**\n" +
- " * Test\n" +
- " * \n" +
- " * @author mr.awesome\n" +
- " */\n" +
- "public class Test {\n" +
+ "/**\n" +
+ " * Test\n" +
+ " * \n" +
+ " * @author mr.awesome\n" +
+ " */\n" +
+ "public class Test {\n" +
"}"
);
} finally {
@@ -7547,32 +7547,32 @@ public void testBug479474() {
* https://bugs.eclipse.org/484957 - [formatter] Extra blank lines between consecutive javadoc comments
*/
public void testBug484957() {
- String source =
- "import java.io.Serializable;\n" +
- "\n" +
- "/**********/\n" +
- "/*** A ****/\n" +
- "/**********/\n" +
- "\n" +
- "public class MyClass implements Serializable {\n" +
- "\tprivate int field1;\n" +
- "\n" +
- "\t/**********/\n" +
- "\t/*** B ****/\n" +
- "\t/**********/\n" +
- "\tpublic void foo() {\n" +
- "\t}\n" +
- "\n" +
- "\t/**********/\n" +
- "\t/*** C ****/\n" +
- "\t/**********/\n" +
- "\tprivate int field2;\n" +
- "\n" +
- "\t/**********/\n" +
- "\t/*** D ****/\n" +
- "\t/**********/\n" +
- "\tprivate class NestedType {\n" +
- "\t}\n" +
+ String source =
+ "import java.io.Serializable;\n" +
+ "\n" +
+ "/**********/\n" +
+ "/*** A ****/\n" +
+ "/**********/\n" +
+ "\n" +
+ "public class MyClass implements Serializable {\n" +
+ "\tprivate int field1;\n" +
+ "\n" +
+ "\t/**********/\n" +
+ "\t/*** B ****/\n" +
+ "\t/**********/\n" +
+ "\tpublic void foo() {\n" +
+ "\t}\n" +
+ "\n" +
+ "\t/**********/\n" +
+ "\t/*** C ****/\n" +
+ "\t/**********/\n" +
+ "\tprivate int field2;\n" +
+ "\n" +
+ "\t/**********/\n" +
+ "\t/*** D ****/\n" +
+ "\t/**********/\n" +
+ "\tprivate class NestedType {\n" +
+ "\t}\n" +
"}";
formatSource(source);
}
@@ -7581,20 +7581,20 @@ public void testBug484957() {
*/
public void testBug93459() {
this.formatterPrefs.comment_line_length = 120;
- String source =
- "class Example {\n" +
- " /**\n" +
- " * This is similar to <a href=\"http://java.sun.com/j2se/1.4.2/docs/api/java/nio/charset/Charset.html#isSupported(java.lang.String)\">java.nio.charset.Charset.isSupported(String)</a>\n" +
- " */\n" +
- " int a;\n" +
+ String source =
+ "class Example {\n" +
+ " /**\n" +
+ " * This is similar to <a href=\"http://java.sun.com/j2se/1.4.2/docs/api/java/nio/charset/Charset.html#isSupported(java.lang.String)\">java.nio.charset.Charset.isSupported(String)</a>\n" +
+ " */\n" +
+ " int a;\n" +
"}";
formatSource(source,
- "class Example {\n" +
- " /**\n" +
- " * This is similar to <a href=\n" +
- " * \"http://java.sun.com/j2se/1.4.2/docs/api/java/nio/charset/Charset.html#isSupported(java.lang.String)\">java.nio.charset.Charset.isSupported(String)</a>\n" +
- " */\n" +
- " int a;\n" +
+ "class Example {\n" +
+ " /**\n" +
+ " * This is similar to <a href=\n" +
+ " * \"http://java.sun.com/j2se/1.4.2/docs/api/java/nio/charset/Charset.html#isSupported(java.lang.String)\">java.nio.charset.Charset.isSupported(String)</a>\n" +
+ " */\n" +
+ " int a;\n" +
"}"
);
}
@@ -7602,13 +7602,13 @@ public void testBug93459() {
* https://bugs.eclipse.org/510995 - NPE at CommentsPreparator.translateFormattedTokens when using $NON-NLS-1$ in Javadoc
*/
public void testBug510995() {
- String source =
- "/**\n" +
- " * <pre>\n" +
- " * NAME = &quot;org.test....&quot; //$NON-NLS-1$\n" +
- " * </pre>\n" +
- " */\n" +
- "class Test {\n" +
+ String source =
+ "/**\n" +
+ " * <pre>\n" +
+ " * NAME = &quot;org.test....&quot; //$NON-NLS-1$\n" +
+ " * </pre>\n" +
+ " */\n" +
+ "class Test {\n" +
"}";
formatSource(source);
}
@@ -7616,22 +7616,22 @@ public void testBug510995() {
* https://bugs.eclipse.org/510995 - NPE at CommentsPreparator.translateFormattedTokens when using $NON-NLS-1$ in Javadoc
*/
public void testBug510995b() {
- String source =
- "/**\n" +
- " * <pre>\n" +
- " * NAME = \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\" + \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"; //$NON-NLS-1$ //$NON-NLS-2$\n" +
- " * </pre>\n" +
- " */\n" +
- "class Test {\n" +
+ String source =
+ "/**\n" +
+ " * <pre>\n" +
+ " * NAME = \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\" + \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"; //$NON-NLS-1$ //$NON-NLS-2$\n" +
+ " * </pre>\n" +
+ " */\n" +
+ "class Test {\n" +
"}";
formatSource(source,
- "/**\n" +
- " * <pre>\n" +
- " * NAME = \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\" //$NON-NLS-1$\n" +
- " * + \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"; //$NON-NLS-1$\n" +
- " * </pre>\n" +
- " */\n" +
- "class Test {\n" +
+ "/**\n" +
+ " * <pre>\n" +
+ " * NAME = \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\" //$NON-NLS-1$\n" +
+ " * + \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"; //$NON-NLS-1$\n" +
+ " * </pre>\n" +
+ " */\n" +
+ "class Test {\n" +
"}"
);
}
@@ -7640,21 +7640,21 @@ public void testBug510995b() {
*/
public void testBug512095() {
useOldCommentWidthCounting();
- String source =
- "class Test1 {\n" +
- " void f() {\n" +
- " String c = \"aaaaaaaaaaaaaaaa\" + \"aaaaaaaaaaaaaaa\"; /* 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 */\n" +
- " }\n" +
+ String source =
+ "class Test1 {\n" +
+ " void f() {\n" +
+ " String c = \"aaaaaaaaaaaaaaaa\" + \"aaaaaaaaaaaaaaa\"; /* 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 */\n" +
+ " }\n" +
"}";
formatSource(source,
- "class Test1 {\n" +
- " void f() {\n" +
- " String c = \"aaaaaaaaaaaaaaaa\"\n" +
- " + \"aaaaaaaaaaaaaaa\"; /*\n" +
- " * 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15\n" +
- " * 16 17\n" +
- " */\n" +
- " }\n" +
+ "class Test1 {\n" +
+ " void f() {\n" +
+ " String c = \"aaaaaaaaaaaaaaaa\"\n" +
+ " + \"aaaaaaaaaaaaaaa\"; /*\n" +
+ " * 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15\n" +
+ " * 16 17\n" +
+ " */\n" +
+ " }\n" +
"}"
);
}
@@ -7663,11 +7663,11 @@ public void testBug512095() {
*/
public void testBug545898() {
useOldCommentWidthCounting();
- String source =
- "/**\n" +
- " * @param\n" +
- " */\n" +
- "void foo() {\n" +
+ String source =
+ "/**\n" +
+ " * @param\n" +
+ " */\n" +
+ "void foo() {\n" +
"}";
formatSource(source);
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsTests.java
index 6a97e9cb9..9cb6aefd8 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsTests.java
@@ -417,7 +417,7 @@ public void testHtmlPre02() throws JavaModelException {
formatUnit("html.pre", "X02.java");
}
public void testHtmlPre02b() throws JavaModelException {
- formatUnit("html.pre", "X02b.java");
+ formatUnit("html.pre", "X02b.java");
}
public void testHtmlPre03() throws JavaModelException {
formatUnit("html.pre", "X03.java");
@@ -765,13 +765,13 @@ public void testLineComments01() throws JavaModelException {
public void testLineComments02() throws JavaModelException {
useOldCommentWidthCounting();
String source =
- "public class X02 {\r\n" +
- " int field; // This is a long comment that should be split in multiple line comments in case the line comment formatting is enabled\r\n" +
+ "public class X02 {\r\n" +
+ " int field; // This is a long comment that should be split in multiple line comments in case the line comment formatting is enabled\r\n" +
"}\r\n";
formatSource(source,
- "public class X02 {\n" +
- " int field; // This is a long comment that should be split in multiple line\n" +
- " // comments in case the line comment formatting is enabled\n" +
+ "public class X02 {\n" +
+ " int field; // This is a long comment that should be split in multiple line\n" +
+ " // comments in case the line comment formatting is enabled\n" +
"}\n",
false /* do not repeat */
);
@@ -779,19 +779,19 @@ public void testLineComments02() throws JavaModelException {
public void testLineComments02b() throws JavaModelException {
useOldCommentWidthCounting();
String source =
- "public interface X02b {\r\n" +
- "\r\n" +
- " int foo(); // This is a long comment that should be split in multiple line comments in case the line comment formatting is enabled\r\n" +
- "\r\n" +
- " int bar();\r\n" +
+ "public interface X02b {\r\n" +
+ "\r\n" +
+ " int foo(); // This is a long comment that should be split in multiple line comments in case the line comment formatting is enabled\r\n" +
+ "\r\n" +
+ " int bar();\r\n" +
"}\r\n";
formatSource(source,
- "public interface X02b {\n" +
- "\n" +
- " int foo(); // This is a long comment that should be split in multiple line\n" +
- " // comments in case the line comment formatting is enabled\n" +
- "\n" +
- " int bar();\n" +
+ "public interface X02b {\n" +
+ "\n" +
+ " int foo(); // This is a long comment that should be split in multiple line\n" +
+ " // comments in case the line comment formatting is enabled\n" +
+ "\n" +
+ " int bar();\n" +
"}\n",
false /* do not repeat */
);
@@ -812,41 +812,41 @@ public void testLineComments06() throws JavaModelException {
public void testLineComments07() throws JavaModelException {
useOldCommentWidthCounting();
String source =
- "package test.comments.line;\r\n" +
- "\r\n" +
- "public class X07 {\r\n" +
- "\r\n" +
- "boolean inTitle;\r\n" +
- "boolean inMetaTag;\r\n" +
- "boolean inStyle;\r\n" +
- "boolean inImg;\r\n" +
- "\r\n" +
- "void foo(String tagName) {\r\n" +
- " inTitle = tagName.equalsIgnoreCase(\"<title\"); // keep track if in <TITLE>\r\n" +
- " inMetaTag = tagName.equalsIgnoreCase(\"<META\"); // keep track if in <META>\r\n" +
- " inStyle = tagName.equalsIgnoreCase(\"<STYLE\"); // keep track if in <STYLE>\r\n" +
- " inImg = tagName.equalsIgnoreCase(\"<img\"); // keep track if in <IMG>\r\n" +
- "}\r\n" +
+ "package test.comments.line;\r\n" +
+ "\r\n" +
+ "public class X07 {\r\n" +
+ "\r\n" +
+ "boolean inTitle;\r\n" +
+ "boolean inMetaTag;\r\n" +
+ "boolean inStyle;\r\n" +
+ "boolean inImg;\r\n" +
+ "\r\n" +
+ "void foo(String tagName) {\r\n" +
+ " inTitle = tagName.equalsIgnoreCase(\"<title\"); // keep track if in <TITLE>\r\n" +
+ " inMetaTag = tagName.equalsIgnoreCase(\"<META\"); // keep track if in <META>\r\n" +
+ " inStyle = tagName.equalsIgnoreCase(\"<STYLE\"); // keep track if in <STYLE>\r\n" +
+ " inImg = tagName.equalsIgnoreCase(\"<img\"); // keep track if in <IMG>\r\n" +
+ "}\r\n" +
"}\r\n";
formatSource(source,
- "package test.comments.line;\r\n" +
- "\r\n" +
- "public class X07 {\r\n" +
- "\r\n" +
- " boolean inTitle;\r\n" +
- " boolean inMetaTag;\r\n" +
- " boolean inStyle;\r\n" +
- " boolean inImg;\r\n" +
- "\r\n" +
- " void foo(String tagName) {\r\n" +
- " inTitle = tagName.equalsIgnoreCase(\"<title\"); // keep track if in\r\n" +
- " // <TITLE>\r\n" +
- " inMetaTag = tagName.equalsIgnoreCase(\"<META\"); // keep track if in\r\n" +
- " // <META>\r\n" +
- " inStyle = tagName.equalsIgnoreCase(\"<STYLE\"); // keep track if in\r\n" +
- " // <STYLE>\r\n" +
- " inImg = tagName.equalsIgnoreCase(\"<img\"); // keep track if in <IMG>\r\n" +
- " }\r\n" +
+ "package test.comments.line;\r\n" +
+ "\r\n" +
+ "public class X07 {\r\n" +
+ "\r\n" +
+ " boolean inTitle;\r\n" +
+ " boolean inMetaTag;\r\n" +
+ " boolean inStyle;\r\n" +
+ " boolean inImg;\r\n" +
+ "\r\n" +
+ " void foo(String tagName) {\r\n" +
+ " inTitle = tagName.equalsIgnoreCase(\"<title\"); // keep track if in\r\n" +
+ " // <TITLE>\r\n" +
+ " inMetaTag = tagName.equalsIgnoreCase(\"<META\"); // keep track if in\r\n" +
+ " // <META>\r\n" +
+ " inStyle = tagName.equalsIgnoreCase(\"<STYLE\"); // keep track if in\r\n" +
+ " // <STYLE>\r\n" +
+ " inImg = tagName.equalsIgnoreCase(\"<img\"); // keep track if in <IMG>\r\n" +
+ " }\r\n" +
"}\r\n",
false /* do not repeat */
);
@@ -863,17 +863,17 @@ public void testLineComments10() throws JavaModelException {
public void testLineComments11() throws JavaModelException {
useOldCommentWidthCounting();
this.formatterPrefs.comment_line_length = 40;
- String source =
- "package test.comments.line;\r\n" +
- "\r\n" +
- "public class X11 { // This comment will go____over the max line length\r\n" +
+ String source =
+ "package test.comments.line;\r\n" +
+ "\r\n" +
+ "public class X11 { // This comment will go____over the max line length\r\n" +
"}\r\n";
formatSource(source,
- "package test.comments.line;\r\n" +
- "\r\n" +
- "public class X11 { // This comment will\r\n" +
- " // go____over the\r\n" +
- " // max line length\r\n" +
+ "package test.comments.line;\r\n" +
+ "\r\n" +
+ "public class X11 { // This comment will\r\n" +
+ " // go____over the\r\n" +
+ " // max line length\r\n" +
"}\r\n",
false /* do not repeat */
);
@@ -944,28 +944,28 @@ public void testBlockComments12() throws JavaModelException {
public void testBlockComments13() throws JavaModelException {
setPageWidth80();
String source =
- "package test.comments.block;\r\n" +
- "\r\n" +
- "public class X13 {\r\n" +
- "\r\n" +
- "protected void handleWarningToken(String token, boolean isEnabling) {\r\n" +
- " if (token.equals(\"pkgDefaultMethod___\") || token.equals(\"packageDefaultMethod___\")/*_backward_ _compatible_*/ ) {\r\n" +
- " }\r\n" +
- "}\r\n" +
+ "package test.comments.block;\r\n" +
+ "\r\n" +
+ "public class X13 {\r\n" +
+ "\r\n" +
+ "protected void handleWarningToken(String token, boolean isEnabling) {\r\n" +
+ " if (token.equals(\"pkgDefaultMethod___\") || token.equals(\"packageDefaultMethod___\")/*_backward_ _compatible_*/ ) {\r\n" +
+ " }\r\n" +
+ "}\r\n" +
"}\r\n";
// Difference with old formatter:
// 1) split comment block starts one tab before to avoid possible words over the max line length
// note that in this peculiar this was not necessary as even the first word is over the max line length!
formatSource(source,
- "package test.comments.block;\n" +
- "\n" +
- "public class X13 {\n" +
- "\n" +
- " protected void handleWarningToken(String token, boolean isEnabling) {\n" +
- " if (token.equals(\"pkgDefaultMethod___\") || token.equals(\n" +
- " \"packageDefaultMethod___\")/* _backward_ _compatible_ */ ) {\n" +
- " }\n" +
- " }\n" +
+ "package test.comments.block;\n" +
+ "\n" +
+ "public class X13 {\n" +
+ "\n" +
+ " protected void handleWarningToken(String token, boolean isEnabling) {\n" +
+ " if (token.equals(\"pkgDefaultMethod___\") || token.equals(\n" +
+ " \"packageDefaultMethod___\")/* _backward_ _compatible_ */ ) {\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterJSR308Tests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterJSR308Tests.java
index c01bd5fe9..6a077a6a2 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterJSR308Tests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterJSR308Tests.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Jesper Steen Moller - initial API and implementation
* Contribution for bug 403881
@@ -41,7 +41,7 @@ public class FormatterJSR308Tests extends AbstractJavaModelTests {
public static final String OUT = "_out";
public static final boolean DEBUG = false;
static final String LINE_SEPARATOR = System.getProperty("line.separator");
- private static final String PROJECT_NAME = "FormatterJSR308";
+ private static final String PROJECT_NAME = "FormatterJSR308";
private long time;
DefaultCodeFormatterOptions formatterPrefs;
@@ -60,7 +60,7 @@ public class FormatterJSR308Tests extends AbstractJavaModelTests {
super(name);
}
- /*
+ /*
* helper function for tests that are compatible with earlier page width
*/
private void setPageWidth80() {
@@ -189,12 +189,12 @@ public class FormatterJSR308Tests extends AbstractJavaModelTests {
assertTrue(false);
}
}
-
+
public void testLambda() {
setPageWidth80();
runTest("testLambda", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
}
-
+
public void testReferenceExpression() {
setPageWidth80();
runTest("testReferenceExpression", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
@@ -363,7 +363,7 @@ public class FormatterJSR308Tests extends AbstractJavaModelTests {
public void test039() {
runTest("test039", "X.java");//$NON-NLS-1$ //$NON-NLS-2$
}
-
+
public void testBug403881() {
runTest("testBugs", "Bug403881.java");//$NON-NLS-1$ //$NON-NLS-2$
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterJSR335Tests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterJSR335Tests.java
index a1b1c8d9d..ca501e946 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterJSR335Tests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterJSR335Tests.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Jesper Steen Moller - initial API and implementation
* Contribution for bug 402819
@@ -42,7 +42,7 @@ public class FormatterJSR335Tests extends AbstractJavaModelTests {
public static final String OUT = "_out";
public static final boolean DEBUG = false;
static final String LINE_SEPARATOR = System.getProperty("line.separator");
- private static final String PROJECT_NAME = "FormatterJSR335";
+ private static final String PROJECT_NAME = "FormatterJSR335";
DefaultCodeFormatterOptions formatterPrefs;
Map formatterOptions;
@@ -98,14 +98,14 @@ public class FormatterJSR335Tests extends AbstractJavaModelTests {
super.tearDownSuite();
}
- /*
+ /*
* helper function for tests that are compatible with earlier page width
*/
private void setPageWidth80() {
this.formatterPrefs.page_width = 80;
}
- /*
+ /*
* helper function for tests that are compatible with earlier page width
*/
private void setPageWidth80(DefaultCodeFormatterOptions preferences) {
@@ -154,7 +154,7 @@ public class FormatterJSR335Tests extends AbstractJavaModelTests {
DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(codeFormatterOptions, this.formatterOptions);
runTest(codeFormatter, packageName, compilationUnitName, CodeFormatter.K_COMPILATION_UNIT, 0);
}
-
+
private void runTest(String packageName, String compilationUnitName) {
DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(this.formatterPrefs, this.formatterOptions);
runTest(codeFormatter, packageName, compilationUnitName, CodeFormatter.K_COMPILATION_UNIT, 0);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterMassiveRegressionTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterMassiveRegressionTests.java
index 94f05598d..0234b4c93 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterMassiveRegressionTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterMassiveRegressionTests.java
@@ -164,7 +164,7 @@ import org.eclipse.text.edits.TextEdit;
* loaded JDT/Core version.
* </p><p>
* For example, copy the previous launch config and rename it
- * <b>FormatterMassiveRegressionTests (Eclipse 3.0)</b>. Change the VM
+ * <b>FormatterMassiveRegressionTests (Eclipse 3.0)</b>. Change the VM
* arguments as follows (<i>note that the <code>clean</code> has been removed
* from the <code>outputDir</code> system property</i>):
* <pre>
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java
index 43b4907ec..1748de17b 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java
@@ -90,28 +90,28 @@ public class FormatterRegressionTests extends AbstractJavaModelTests {
this.formatterOptions.put(CompilerOptions.OPTION_Source, level);
}
- /*
+ /*
* helper function for tests that are compatible with earlier page width
*/
protected void setPageWidth80() {
this.formatterPrefs.page_width = 80;
}
- /*
+ /*
* helper function for tests that are compatible with earlier page width
*/
protected void setPageWidth80(DefaultCodeFormatterOptions preferences) {
preferences.page_width = 80;
}
- /*
+ /*
* helper function for tests that are compatible with earlier page width
*/
private void setFormatterOptions80() {
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, Integer.toString(80));
}
-
- /*
+
+ /*
* helper function for tests that are compatible with earlier Javadoc formatting rules
*/
protected void useOldJavadocTagsFormatting() {
@@ -204,7 +204,7 @@ public class FormatterRegressionTests extends AbstractJavaModelTests {
return org.eclipse.jdt.internal.core.util.Util.editedString(source, edit);
}
-
+
/**
* Init formatter preferences with Eclipse default settings.
*/
@@ -296,11 +296,11 @@ public class FormatterRegressionTests extends AbstractJavaModelTests {
void formatSource(String source, String formattedOutput, int kind) {
formatSource(source, formattedOutput, kind, 0, true /*repeat formatting twice*/);
}
-
+
void formatSource(String source, String formattedOutput, boolean repeat) {
formatSource(source, formattedOutput, CodeFormatter.K_COMPILATION_UNIT | CodeFormatter.F_INCLUDE_COMMENTS, 0, repeat);
}
-
+
void formatSource(String source, String formattedOutput, int kind, int indentationLevel, boolean repeat) {
int regionStart = source.indexOf("[#");
if (regionStart != -1) {
@@ -332,7 +332,7 @@ public class FormatterRegressionTests extends AbstractJavaModelTests {
formatSource(source, formattedOutput, kind, indentationLevel, 0, -1, null, repeat);
}
}
-
+
void formatSource(String source, String formattedOutput, int kind, int indentationLevel, int offset, int length, String lineSeparator, boolean repeat) {
DefaultCodeFormatter codeFormatter = codeFormatter();
String result;
@@ -9671,21 +9671,21 @@ public class FormatterRegressionTests extends AbstractJavaModelTests {
};
runTest(codeFormatter, "test671", "A.java", CodeFormatter.K_COMPILATION_UNIT, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
*/
- String source =
- "public class A {\n" +
- " public static void main(String[] args) {\n" +
- "[# int a = 1;#]\n" +
- " int b = 2;\n" +
- "[# int c = 3;#]\n" +
- " }\n" +
+ String source =
+ "public class A {\n" +
+ " public static void main(String[] args) {\n" +
+ "[# int a = 1;#]\n" +
+ " int b = 2;\n" +
+ "[# int c = 3;#]\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "public class A {\n" +
- " public static void main(String[] args) {\n" +
- " int a = 1;\n" +
- " int b = 2;\n" +
- " int c = 3;\n" +
- " }\n" +
+ "public class A {\n" +
+ " public static void main(String[] args) {\n" +
+ " int a = 1;\n" +
+ " int b = 2;\n" +
+ " int c = 3;\n" +
+ " }\n" +
"}\n",
CodeFormatter.K_COMPILATION_UNIT,
0 /*no indentation*/,
@@ -9729,58 +9729,58 @@ public class FormatterRegressionTests extends AbstractJavaModelTests {
};
runTest(codeFormatter, "test674", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
*/
- String source =
- "public class A {\n" +
- " \n" +
- " \n" +
- " private class Inner1 {[#\n" +
- " \n" +
- " \n" +
- " void bar () { }\n" +
- " \n" +
- " void i()\n" +
- " {\n" +
- " \n" +
- " }\n" +
- " #]}\n" +
- " \n" +
- " \n" +
- " private class Inner2 {\n" +
- " void xy() {\n" +
- " \n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "class B {[#\n" +
- " private void foo() {\n" +
- " \n" +
- " }\n" +
+ String source =
+ "public class A {\n" +
+ " \n" +
+ " \n" +
+ " private class Inner1 {[#\n" +
+ " \n" +
+ " \n" +
+ " void bar () { }\n" +
+ " \n" +
+ " void i()\n" +
+ " {\n" +
+ " \n" +
+ " }\n" +
+ " #]}\n" +
+ " \n" +
+ " \n" +
+ " private class Inner2 {\n" +
+ " void xy() {\n" +
+ " \n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "class B {[#\n" +
+ " private void foo() {\n" +
+ " \n" +
+ " }\n" +
"#]}\n";
formatSource(source,
- "public class A {\n" +
- " \n" +
- " \n" +
- " private class Inner1 {\n" +
- "\n" +
- " void bar() {\n" +
- " }\n" +
- "\n" +
- " void i() {\n" +
- "\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " \n" +
- " private class Inner2 {\n" +
- " void xy() {\n" +
- " \n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "class B {\n" +
- " private void foo() {\n" +
- "\n" +
- " }\n" +
+ "public class A {\n" +
+ " \n" +
+ " \n" +
+ " private class Inner1 {\n" +
+ "\n" +
+ " void bar() {\n" +
+ " }\n" +
+ "\n" +
+ " void i() {\n" +
+ "\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
+ " \n" +
+ " private class Inner2 {\n" +
+ " void xy() {\n" +
+ " \n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "class B {\n" +
+ " private void foo() {\n" +
+ "\n" +
+ " }\n" +
"}\n",
CodeFormatter.K_CLASS_BODY_DECLARATIONS,
0 /*no indentation*/,
@@ -9926,16 +9926,16 @@ public class FormatterRegressionTests extends AbstractJavaModelTests {
};
runTest(codeFormatter, "test685", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
*/
- String source =
- "public class A {\n" +
- " [# int i=1; #] \n" +
+ String source =
+ "public class A {\n" +
+ " [# int i=1; #] \n" +
"}\n";
// Note that whitespaces outside the region are kept after the formatting
// This is intentional since fix for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=234583
// The formatter should not touch code outside the given region(s)...
formatSource(source,
- "public class A {\n" +
- " int i = 1; \n" +
+ "public class A {\n" +
+ " int i = 1; \n" +
"}\n",
CodeFormatter.K_UNKNOWN,
0 /*no indentation*/,
@@ -9973,16 +9973,16 @@ public class FormatterRegressionTests extends AbstractJavaModelTests {
};
runTest(codeFormatter, "test688", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
*/
- String source =
- "public class A {\n" +
- " [# int i=1; \n" +
+ String source =
+ "public class A {\n" +
+ " [# int i=1; \n" +
"}#]\n";
// Note that whitespaces outside the region are kept after the formatting
// This is intentional since fix for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=234583
// The formatter should not touch code outside the given region(s)...
formatSource(source,
- "public class A {\n" +
- " int i = 1;\n" +
+ "public class A {\n" +
+ " int i = 1;\n" +
"}\n",
CodeFormatter.K_UNKNOWN,
0 /*no indentation*/,
@@ -10000,16 +10000,16 @@ public class FormatterRegressionTests extends AbstractJavaModelTests {
};
runTest(codeFormatter, "test688", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
*/
- String source =
- "public class A {\n" +
- " [# int i=1; \n" +
+ String source =
+ "public class A {\n" +
+ " [# int i=1; \n" +
"}\n#]";
// Note that whitespaces outside the region are kept after the formatting
// This is intentional since fix for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=234583
// The formatter should not touch code outside the given region(s)...
formatSource(source,
- "public class A {\n" +
- " int i = 1;\n" +
+ "public class A {\n" +
+ " int i = 1;\n" +
"}\n"
);
}
@@ -10039,20 +10039,20 @@ public class FormatterRegressionTests extends AbstractJavaModelTests {
runTest(codeFormatter, "test689", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\r");//$NON-NLS-1$ //$NON-NLS-2$
*/
this.formatterPrefs.line_separator = "\r";//$NON-NLS-1$
- String source =
- "package pkg1;\n" +
- "public class A {\n" +
- "[# int i = 1; #]\n" +
- "\n" +
+ String source =
+ "package pkg1;\n" +
+ "public class A {\n" +
+ "[# int i = 1; #]\n" +
+ "\n" +
"}\n";
// Note that whitespaces outside the region are kept after the formatting
// This is intentional since fix for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=234583
// The formatter should not touch code outside the given region(s)...
formatSource(source,
- "package pkg1;\n" +
- "public class A {\n" +
- " int i = 1;\n" +
- "\n" +
+ "package pkg1;\n" +
+ "public class A {\n" +
+ " int i = 1;\n" +
+ "\n" +
"}\n",
CodeFormatter.K_UNKNOWN,
0 /*no indentation*/,
@@ -10073,20 +10073,20 @@ public class FormatterRegressionTests extends AbstractJavaModelTests {
runTest(codeFormatter, "test689", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\r\n");//$NON-NLS-1$ //$NON-NLS-2$
*/
this.formatterPrefs.line_separator = "\r\n";//$NON-NLS-1$
- String source =
- "package pkg1;\n" +
- "public class A {\n" +
- "[# int i = 1; #] \n" +
- "\n" +
+ String source =
+ "package pkg1;\n" +
+ "public class A {\n" +
+ "[# int i = 1; #] \n" +
+ "\n" +
"}\n";
// Note that whitespaces outside the region are kept after the formatting
// This is intentional since fix for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=234583
// The formatter should not touch code outside the given region(s)...
formatSource(source,
- "package pkg1;\n" +
- "public class A {\n" +
- " int i = 1; \n" +
- "\n" +
+ "package pkg1;\n" +
+ "public class A {\n" +
+ " int i = 1; \n" +
+ "\n" +
"}\n",
CodeFormatter.K_UNKNOWN,
0 /*no indentation*/,
@@ -10152,7 +10152,7 @@ public class FormatterRegressionTests extends AbstractJavaModelTests {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=213284
public void test695() {
- /* old version
+ /* old version
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
preferences.line_separator = "\n";//$NON-NLS-1$
@@ -10162,23 +10162,23 @@ public class FormatterRegressionTests extends AbstractJavaModelTests {
};
runTest(codeFormatter, "test695", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
*/
- String source =
- "package test1;\n" +
- "public class A {\n" +
- "\n" +
- " public int field;\n" +
- "[#\n#]" +
- "\n" +
+ String source =
+ "package test1;\n" +
+ "public class A {\n" +
+ "\n" +
+ " public int field;\n" +
+ "[#\n#]" +
+ "\n" +
"}\r\n";
// Note that whitespaces outside the region are kept after the formatting
// This is intentional since fix for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=234583
// The formatter should not touch code outside the given region(s)...
formatSource(source,
- "package test1;\n" +
- "public class A {\n" +
- "\n" +
- " public int field;\n" +
- "\n" +
+ "package test1;\n" +
+ "public class A {\n" +
+ "\n" +
+ " public int field;\n" +
+ "\n" +
"}\r\n",
CodeFormatter.K_UNKNOWN,
0 /*no indentation*/,
@@ -10222,27 +10222,27 @@ public class FormatterRegressionTests extends AbstractJavaModelTests {
};
runTest(codeFormatter, "test697", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
*/
- String source =
- "public class A {\n" +
- "[# \n" +
- " \n" +
- " \n" +
- " int i = 1; #]\n" +
- "\n" +
- "\n" +
- "\n" +
- "}\n" +
+ String source =
+ "public class A {\n" +
+ "[# \n" +
+ " \n" +
+ " \n" +
+ " int i = 1; #]\n" +
+ "\n" +
+ "\n" +
+ "\n" +
+ "}\n" +
"";
// Note that whitespaces outside the region are kept after the formatting
// This is intentional since fix for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=234583
// The formatter should not touch code outside the given region(s)...
formatSource(source,
- "public class A {\n" +
- "\n" +
- " int i = 1;\n" +
- "\n" +
- "\n" +
- "\n" +
+ "public class A {\n" +
+ "\n" +
+ " int i = 1;\n" +
+ "\n" +
+ "\n" +
+ "\n" +
"}\n",
CodeFormatter.K_UNKNOWN,
0 /*no indentation*/,
@@ -10262,26 +10262,26 @@ public class FormatterRegressionTests extends AbstractJavaModelTests {
};
runTest(codeFormatter, "test697", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
*/
- String source =
- "public class A {\n" +
- "[# \n" +
- " \n" +
- " \n" +
- " int i = 1; \n" +
- "#]\n" +
- "\n" +
- "\n" +
- "}\n" +
+ String source =
+ "public class A {\n" +
+ "[# \n" +
+ " \n" +
+ " \n" +
+ " int i = 1; \n" +
+ "#]\n" +
+ "\n" +
+ "\n" +
+ "}\n" +
"";
// Note that whitespaces outside the region are kept after the formatting
// This is intentional since fix for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=234583
// The formatter should not touch code outside the given region(s)...
formatSource(source,
- "public class A {\n" +
- "\n" +
- " int i = 1;\n" +
- "\n" +
- "\n" +
+ "public class A {\n" +
+ "\n" +
+ " int i = 1;\n" +
+ "\n" +
+ "\n" +
"}\n",
CodeFormatter.K_UNKNOWN,
0 /*no indentation*/,
@@ -10621,24 +10621,24 @@ public class FormatterRegressionTests extends AbstractJavaModelTests {
runTest(codeFormatter, "test713", "A.java", CodeFormatter.K_COMPILATION_UNIT, 0, false, 76, 27);//$NON-NLS-1$ //$NON-NLS-2$
*/
this.formatterPrefs = new DefaultCodeFormatterOptions(options);
- String source =
- "package pack;\n" +
- "\n" +
- "public class A {\n" +
- " /**\n" +
- " * @see A.Inner\n" +
- " */\n" +
- "[# public class Inner { }\n" +
+ String source =
+ "package pack;\n" +
+ "\n" +
+ "public class A {\n" +
+ " /**\n" +
+ " * @see A.Inner\n" +
+ " */\n" +
+ "[# public class Inner { }\n" +
"#]}";
formatSource(source,
- "package pack;\n" +
- "\n" +
- "public class A {\n" +
- " /**\n" +
- " * @see A.Inner\n" +
- " */\n" +
- " public class Inner {\n" +
- " }\n" +
+ "package pack;\n" +
+ "\n" +
+ "public class A {\n" +
+ " /**\n" +
+ " * @see A.Inner\n" +
+ " */\n" +
+ " public class Inner {\n" +
+ " }\n" +
"}"
);
}
@@ -10743,22 +10743,22 @@ public void test723() {
public void test724() {
this.formatterPrefs.insert_new_line_after_label = true;
String source =
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " LABEL:for (int i = 0; i < 10; i++) {\n" +
- " }\n" +
- " }\n" +
- "\n" +
- "}\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " LABEL:for (int i = 0; i < 10; i++) {\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ "}\n" +
"";
formatSource(source,
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " LABEL:\n" +
- " for (int i = 0; i < 10; i++) {\n" +
- " }\n" +
- " }\n" +
- "\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " LABEL:\n" +
+ " for (int i = 0; i < 10; i++) {\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
"}\n"
);
}
@@ -10769,32 +10769,32 @@ public void test725() {
this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6);
this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6);
String source =
- "@Deprecated package pack;\n" +
- "public class Test {\n" +
- " @Deprecated Test(String s) {}\n" +
- " @Deprecated String label;\n" +
- " @Deprecated void foo() {}\n" +
- " @Deprecated interface I {}\n" +
+ "@Deprecated package pack;\n" +
+ "public class Test {\n" +
+ " @Deprecated Test(String s) {}\n" +
+ " @Deprecated String label;\n" +
+ " @Deprecated void foo() {}\n" +
+ " @Deprecated interface I {}\n" +
"}\n";
formatSource(source,
"@Deprecated\n" +
- "package pack;\n" +
- "\n" +
- "public class Test {\n" +
- " @Deprecated\n" +
- " Test(String s) {\n" +
- " }\n" +
- "\n" +
- " @Deprecated\n" +
- " String label;\n" +
- "\n" +
- " @Deprecated\n" +
- " void foo() {\n" +
- " }\n" +
- "\n" +
- " @Deprecated\n" +
- " interface I {\n" +
- " }\n" +
+ "package pack;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " @Deprecated\n" +
+ " Test(String s) {\n" +
+ " }\n" +
+ "\n" +
+ " @Deprecated\n" +
+ " String label;\n" +
+ "\n" +
+ " @Deprecated\n" +
+ " void foo() {\n" +
+ " }\n" +
+ "\n" +
+ " @Deprecated\n" +
+ " interface I {\n" +
+ " }\n" +
"}\n"
);
}
@@ -10808,27 +10808,27 @@ public void test726() {
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_METHOD, DefaultCodeFormatterConstants.FALSE);
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PACKAGE, DefaultCodeFormatterConstants.FALSE);
String source =
- "@Deprecated package pack;\n" +
- "public class Test {\n" +
- " @Deprecated Test(String s) {}\n" +
- " @Deprecated String label;\n" +
- " @Deprecated void foo() {}\n" +
- " @Deprecated interface I {}\n" +
+ "@Deprecated package pack;\n" +
+ "public class Test {\n" +
+ " @Deprecated Test(String s) {}\n" +
+ " @Deprecated String label;\n" +
+ " @Deprecated void foo() {}\n" +
+ " @Deprecated interface I {}\n" +
"}\n";
formatSource(source,
- "@Deprecated package pack;\n" +
- "\n" +
- "public class Test {\n" +
- " @Deprecated Test(String s) {\n" +
- " }\n" +
- "\n" +
- " @Deprecated String label;\n" +
- "\n" +
- " @Deprecated void foo() {\n" +
- " }\n" +
- "\n" +
- " @Deprecated interface I {\n" +
- " }\n" +
+ "@Deprecated package pack;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " @Deprecated Test(String s) {\n" +
+ " }\n" +
+ "\n" +
+ " @Deprecated String label;\n" +
+ "\n" +
+ " @Deprecated void foo() {\n" +
+ " }\n" +
+ "\n" +
+ " @Deprecated interface I {\n" +
+ " }\n" +
"}\n"
);
}
@@ -10847,27 +10847,27 @@ public void test727() {
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_TYPE, DefaultCodeFormatterConstants.FALSE);
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PARAMETER, DefaultCodeFormatterConstants.FALSE);
String source =
- "@Deprecated package pack;\n" +
- "public class Test {\n" +
- " @Deprecated Test(String s) {}\n" +
- " @Deprecated String label;\n" +
- " @Deprecated void foo() {}\n" +
- " @Deprecated interface I {}\n" +
+ "@Deprecated package pack;\n" +
+ "public class Test {\n" +
+ " @Deprecated Test(String s) {}\n" +
+ " @Deprecated String label;\n" +
+ " @Deprecated void foo() {}\n" +
+ " @Deprecated interface I {}\n" +
"}\n";
formatSource(source,
- "@Deprecated package pack;\n" +
- "\n" +
- "public class Test {\n" +
- " @Deprecated Test(String s) {\n" +
- " }\n" +
- "\n" +
- " @Deprecated String label;\n" +
- "\n" +
- " @Deprecated void foo() {\n" +
- " }\n" +
- "\n" +
- " @Deprecated interface I {\n" +
- " }\n" +
+ "@Deprecated package pack;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " @Deprecated Test(String s) {\n" +
+ " }\n" +
+ "\n" +
+ " @Deprecated String label;\n" +
+ "\n" +
+ " @Deprecated void foo() {\n" +
+ " }\n" +
+ "\n" +
+ " @Deprecated interface I {\n" +
+ " }\n" +
"}\n"
);
}
@@ -10888,27 +10888,27 @@ public void test728() {
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION, DefaultCodeFormatterConstants.FALSE);
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_MEMBER, JavaCore.DO_NOT_INSERT);
String source =
- "@Deprecated package pack;\n" +
- "public class Test {\n" +
- " @Deprecated Test(String s) {}\n" +
- " @Deprecated String label;\n" +
- " @Deprecated void foo() {}\n" +
- " @Deprecated interface I {}\n" +
+ "@Deprecated package pack;\n" +
+ "public class Test {\n" +
+ " @Deprecated Test(String s) {}\n" +
+ " @Deprecated String label;\n" +
+ " @Deprecated void foo() {}\n" +
+ " @Deprecated interface I {}\n" +
"}\n";
formatSource(source,
- "@Deprecated package pack;\n" +
- "\n" +
- "public class Test {\n" +
- " @Deprecated Test(String s) {\n" +
- " }\n" +
- "\n" +
- " @Deprecated String label;\n" +
- "\n" +
- " @Deprecated void foo() {\n" +
- " }\n" +
- "\n" +
- " @Deprecated interface I {\n" +
- " }\n" +
+ "@Deprecated package pack;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " @Deprecated Test(String s) {\n" +
+ " }\n" +
+ "\n" +
+ " @Deprecated String label;\n" +
+ "\n" +
+ " @Deprecated void foo() {\n" +
+ " }\n" +
+ "\n" +
+ " @Deprecated interface I {\n" +
+ " }\n" +
"}\n"
);
}
@@ -10918,23 +10918,23 @@ public void test729() {
this.formatterOptions = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(profilePath, "b308000");
assertNotNull("No preferences", this.formatterOptions);
String source =
- "package p;\n" +
- "\n" +
- "@Deprecated public class C {\n" +
- " @Deprecated public static void main(@Deprecated String[] args) {\n" +
- " @Deprecated int i= 2;\n" +
- " System.out.println(i);\n" +
- " }\n" +
+ "package p;\n" +
+ "\n" +
+ "@Deprecated public class C {\n" +
+ " @Deprecated public static void main(@Deprecated String[] args) {\n" +
+ " @Deprecated int i= 2;\n" +
+ " System.out.println(i);\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "package p;\n" +
- "\n" +
- "@Deprecated public class C {\n" +
- " @Deprecated public static void main(@Deprecated String[] args) {\n" +
- " @Deprecated\n" +
- " int i = 2;\n" +
- " System.out.println(i);\n" +
- " }\n" +
+ "package p;\n" +
+ "\n" +
+ "@Deprecated public class C {\n" +
+ " @Deprecated public static void main(@Deprecated String[] args) {\n" +
+ " @Deprecated\n" +
+ " int i = 2;\n" +
+ " System.out.println(i);\n" +
+ " }\n" +
"}\n"
);
}
@@ -10946,12 +10946,12 @@ public void test730() {
String source = "enum Fail1 {A;;{}}";
formatSource(
source,
- "enum Fail1 {\n" +
- " A;\n" +
- " ;\n" +
- "\n" +
- " {\n" +
- " }\n" +
+ "enum Fail1 {\n" +
+ " A;\n" +
+ " ;\n" +
+ "\n" +
+ " {\n" +
+ " }\n" +
"}"
);
}
@@ -10963,12 +10963,12 @@ public void test731() {
String source = "enum Fail2 {A,B;;{}}";
formatSource(
source,
- "enum Fail2 {\n" +
- " A, B;\n" +
- " ;\n" +
- "\n" +
- " {\n" +
- " }\n" +
+ "enum Fail2 {\n" +
+ " A, B;\n" +
+ " ;\n" +
+ "\n" +
+ " {\n" +
+ " }\n" +
"}"
);
}
@@ -10980,12 +10980,12 @@ public void test732() {
String source = "enum Fail3 {A;;public void foo() {}}";
formatSource(
source,
- "enum Fail3 {\n" +
- " A;\n" +
- " ;\n" +
- "\n" +
- " public void foo() {\n" +
- " }\n" +
+ "enum Fail3 {\n" +
+ " A;\n" +
+ " ;\n" +
+ "\n" +
+ " public void foo() {\n" +
+ " }\n" +
"}"
);
}
@@ -10997,11 +10997,11 @@ public void test733() {
String source = "enum Fail4 {A;;public int i = 0;}";
formatSource(
source,
- "enum Fail4 {\n" +
- " A;\n" +
- " ;\n" +
- "\n" +
- " public int i = 0;\n" +
+ "enum Fail4 {\n" +
+ " A;\n" +
+ " ;\n" +
+ "\n" +
+ " public int i = 0;\n" +
"}"
);
}
@@ -11010,28 +11010,28 @@ public void test734() {
this.formatterPrefs = null;
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_PRESERVE_WHITE_SPACE_BETWEEN_CODE_AND_LINE_COMMENT, DefaultCodeFormatterConstants.TRUE);
String source =
- "package p;\n" +
- "\n" +
- "public class Comment {\n" +
+ "package p;\n" +
+ "\n" +
+ "public class Comment {\n" +
" public static void main(String[] args) {\n" +
" // internal indentation\n" +
- " int i = 1; // tabs\n" +
+ " int i = 1; // tabs\n" +
" int j = 2; // spaces\n" +
" int k = 3; // mixed tabs and spaces\n" +
" System.out.print(i); /* does not affect block comments */\n" +
- " }\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "package p;\n" +
- "\n" +
- "public class Comment {\n" +
+ "package p;\n" +
+ "\n" +
+ "public class Comment {\n" +
" public static void main(String[] args) {\n" +
" // internal indentation\n" +
- " int i = 1; // tabs\n" +
+ " int i = 1; // tabs\n" +
" int j = 2; // spaces\n" +
" int k = 3; // mixed tabs and spaces\n" +
" System.out.print(i); /* does not affect block comments */\n" +
- " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -11040,28 +11040,28 @@ public void test735() {
this.formatterPrefs = null;
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_PRESERVE_WHITE_SPACE_BETWEEN_CODE_AND_LINE_COMMENT, DefaultCodeFormatterConstants.FALSE);
String source =
- "package p;\n" +
- "\n" +
- "public class Comment {\n" +
+ "package p;\n" +
+ "\n" +
+ "public class Comment {\n" +
" public static void main(String[] args) {\n" +
" // internal indentation\n" +
- " int i = 1; // tabs\n" +
+ " int i = 1; // tabs\n" +
" int j = 2; // spaces\n" +
" int k = 3; // mixed tabs and spaces\n" +
" System.out.print(i); /* does not affect block comments */\n" +
- " }\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "package p;\n" +
- "\n" +
- "public class Comment {\n" +
+ "package p;\n" +
+ "\n" +
+ "public class Comment {\n" +
" public static void main(String[] args) {\n" +
" // internal indentation\n" +
- " int i = 1; // tabs\n" +
+ " int i = 1; // tabs\n" +
" int j = 2; // spaces\n" +
" int k = 3; // mixed tabs and spaces\n" +
" System.out.print(i); /* does not affect block comments */\n" +
- " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -11070,28 +11070,28 @@ public void test736() {
this.formatterPrefs = null;
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_PRESERVE_WHITE_SPACE_BETWEEN_CODE_AND_LINE_COMMENT, DefaultCodeFormatterConstants.TRUE);
String source =
- "package p;\n" +
- "\n" +
- "public class Comment {\n" +
+ "package p;\n" +
+ "\n" +
+ "public class Comment {\n" +
" public static void main(String[] args) {\n" +
" // internal indentation\n" +
- " int i = 1;// tabs\n" +
+ " int i = 1;// tabs\n" +
" int j = 2;// spaces\n" +
" int k = 3;// mixed tabs and spaces\n" +
" System.out.print(i); /* does not affect block comments */\n" +
- " }\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "package p;\n" +
- "\n" +
- "public class Comment {\n" +
+ "package p;\n" +
+ "\n" +
+ "public class Comment {\n" +
" public static void main(String[] args) {\n" +
" // internal indentation\n" +
- " int i = 1;// tabs\n" +
+ " int i = 1;// tabs\n" +
" int j = 2;// spaces\n" +
" int k = 3;// mixed tabs and spaces\n" +
" System.out.print(i); /* does not affect block comments */\n" +
- " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -11100,28 +11100,28 @@ public void test737() {
this.formatterPrefs = null;
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_PRESERVE_WHITE_SPACE_BETWEEN_CODE_AND_LINE_COMMENT, DefaultCodeFormatterConstants.FALSE);
String source =
- "package p;\n" +
- "\n" +
- "public class Comment {\n" +
+ "package p;\n" +
+ "\n" +
+ "public class Comment {\n" +
" public static void main(String[] args) {\n" +
" // internal indentation\n" +
- " int i = 1;// tabs\n" +
+ " int i = 1;// tabs\n" +
" int j = 2;// spaces\n" +
" int k = 3;// mixed tabs and spaces\n" +
" System.out.print(i); /* does not affect block comments */\n" +
- " }\n" +
+ " }\n" +
"}\n";
formatSource(source,
- "package p;\n" +
- "\n" +
- "public class Comment {\n" +
+ "package p;\n" +
+ "\n" +
+ "public class Comment {\n" +
" public static void main(String[] args) {\n" +
" // internal indentation\n" +
- " int i = 1;// tabs\n" +
+ " int i = 1;// tabs\n" +
" int j = 2;// spaces\n" +
" int k = 3;// mixed tabs and spaces\n" +
" System.out.print(i); /* does not affect block comments */\n" +
- " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -11144,17 +11144,17 @@ public void test738() {
" }\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- " int i = 0b0001;\n" +
- " int j = 0b0_0_0_1;\n" +
- "\n" +
- " void foo(String s) {\n" +
- " try {\n" +
- " FileReader reader = new FileReader(s);\n" +
- " } catch (FileNotFoundException | IOException | Exception e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ "public class Test {\n" +
+ " int i = 0b0001;\n" +
+ " int j = 0b0_0_0_1;\n" +
+ "\n" +
+ " void foo(String s) {\n" +
+ " try {\n" +
+ " FileReader reader = new FileReader(s);\n" +
+ " } catch (FileNotFoundException | IOException | Exception e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -11175,14 +11175,14 @@ public void test739() {
" }\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- " void foo(String s) {\n" +
- " try (FileReader reader = new FileReader(s)) {\n" +
- " reader.read();\n" +
- " } catch (IOException e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ "public class Test {\n" +
+ " void foo(String s) {\n" +
+ " try (FileReader reader = new FileReader(s)) {\n" +
+ " reader.read();\n" +
+ " } catch (IOException e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -11203,14 +11203,14 @@ public void test740() {
" }\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- " void foo(String s) {\n" +
- " try (FileReader reader = new FileReader(s)) {\n" +
- " reader.read();\n" +
- " } catch (IOException e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ "public class Test {\n" +
+ " void foo(String s) {\n" +
+ " try (FileReader reader = new FileReader(s)) {\n" +
+ " reader.read();\n" +
+ " } catch (IOException e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -11233,16 +11233,16 @@ public void test741() {
" }\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- " void foo(String s) {\n" +
- " try (FileReader reader = new FileReader(s)) {\n" +
- " reader.read();\n" +
- " } catch (IOException e) {\n" +
- " e.printStackTrace();\n" +
- " } finally {\n" +
- " System.out.println(\"finally block\");\n" +
- " }\n" +
- " }\n" +
+ "public class Test {\n" +
+ " void foo(String s) {\n" +
+ " try (FileReader reader = new FileReader(s)) {\n" +
+ " reader.read();\n" +
+ " } catch (IOException e) {\n" +
+ " e.printStackTrace();\n" +
+ " } finally {\n" +
+ " System.out.println(\"finally block\");\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -11265,16 +11265,16 @@ public void test742() {
" }\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- " void foo(String s) {\n" +
- " try (FileReader reader = new FileReader(s)) {\n" +
- " reader.read();\n" +
- " } catch (FileNotFoundException | IOException | Exception e) {\n" +
- " e.printStackTrace();\n" +
- " } finally {\n" +
- " System.out.println(\"finally block\");\n" +
- " }\n" +
- " }\n" +
+ "public class Test {\n" +
+ " void foo(String s) {\n" +
+ " try (FileReader reader = new FileReader(s)) {\n" +
+ " reader.read();\n" +
+ " } catch (FileNotFoundException | IOException | Exception e) {\n" +
+ " e.printStackTrace();\n" +
+ " } finally {\n" +
+ " System.out.println(\"finally block\");\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -11297,16 +11297,16 @@ public void test743() {
" }\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- " void foo(String s) {\n" +
- " try (FileReader reader = new FileReader(s);) {\n" +
- " reader.read();\n" +
- " } catch (FileNotFoundException | IOException | Exception e) {\n" +
- " e.printStackTrace();\n" +
- " } finally {\n" +
- " System.out.println(\"finally block\");\n" +
- " }\n" +
- " }\n" +
+ "public class Test {\n" +
+ " void foo(String s) {\n" +
+ " try (FileReader reader = new FileReader(s);) {\n" +
+ " reader.read();\n" +
+ " } catch (FileNotFoundException | IOException | Exception e) {\n" +
+ " e.printStackTrace();\n" +
+ " } finally {\n" +
+ " System.out.println(\"finally block\");\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -11331,18 +11331,18 @@ public void test744() {
" }\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- " void foo(String s) {\n" +
+ "public class Test {\n" +
+ " void foo(String s) {\n" +
" try (FileReader reader = new FileReader(s);\n" +
- " FileReader reader2 = new FileReader(s)) {\n" +
- " reader.read();\n" +
- " reader2.read();\n" +
- " } catch (FileNotFoundException | IOException | Exception e) {\n" +
- " e.printStackTrace();\n" +
- " } finally {\n" +
- " System.out.println(\"finally block\");\n" +
- " }\n" +
- " }\n" +
+ " FileReader reader2 = new FileReader(s)) {\n" +
+ " reader.read();\n" +
+ " reader2.read();\n" +
+ " } catch (FileNotFoundException | IOException | Exception e) {\n" +
+ " e.printStackTrace();\n" +
+ " } finally {\n" +
+ " System.out.println(\"finally block\");\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -11367,18 +11367,18 @@ public void test745() {
" }\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- " void foo(String s) {\n" +
+ "public class Test {\n" +
+ " void foo(String s) {\n" +
" try (FileReader reader = new FileReader(s);\n" +
- " FileReader reader2 = new FileReader(s);) {\n" +
- " reader.read();\n" +
- " reader2.read();\n" +
- " } catch (FileNotFoundException | IOException | Exception e) {\n" +
- " e.printStackTrace();\n" +
- " } finally {\n" +
- " System.out.println(\"finally block\");\n" +
- " }\n" +
- " }\n" +
+ " FileReader reader2 = new FileReader(s);) {\n" +
+ " reader.read();\n" +
+ " reader2.read();\n" +
+ " } catch (FileNotFoundException | IOException | Exception e) {\n" +
+ " e.printStackTrace();\n" +
+ " } finally {\n" +
+ " System.out.println(\"finally block\");\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -11397,12 +11397,12 @@ public void test746() {
" }\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- " List foo(String s) {\n" +
- " List<String> l = new ArrayList<>();\n" +
- " l.add(s);\n" +
- " return l;\n" +
- " }\n" +
+ "public class Test {\n" +
+ " List foo(String s) {\n" +
+ " List<String> l = new ArrayList<>();\n" +
+ " l.add(s);\n" +
+ " return l;\n" +
+ " }\n" +
"}\n"
);
}
@@ -11421,12 +11421,12 @@ public void test747() {
" }\n" +
"}\n";
formatSource(source,
- "public class Test {\n" +
- " List foo(String s) {\n" +
- " List<String> l = new java.util.ArrayList<>();\n" +
- " l.add(s);\n" +
- " return l;\n" +
- " }\n" +
+ "public class Test {\n" +
+ " List foo(String s) {\n" +
+ " List<String> l = new java.util.ArrayList<>();\n" +
+ " l.add(s);\n" +
+ " return l;\n" +
+ " }\n" +
"}\n"
);
}
@@ -11456,15 +11456,15 @@ public void test749() throws Exception {
" }\n" +
"}\n";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void storeSomething(String s) throws Exception {\n" +
- " try (FileReader fis = new FileReader(s);\n" +
- " FileReader fis2 = new FileReader(s);\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void storeSomething(String s) throws Exception {\n" +
+ " try (FileReader fis = new FileReader(s);\n" +
+ " FileReader fis2 = new FileReader(s);\n" +
" FileReader fis3 = new FileReader(s)) {\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -11489,15 +11489,15 @@ public void test750() throws Exception {
" }\n" +
"}\n";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void storeSomething(String s) throws Exception {\n" +
- " try( FileReader fis = new FileReader(s) ;\n" +
- " FileReader fis2 = new FileReader(s) ;\n" +
- " FileReader fis3 = new FileReader(s) ; ) {\n" +
- " }\n" +
- " }\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void storeSomething(String s) throws Exception {\n" +
+ " try( FileReader fis = new FileReader(s) ;\n" +
+ " FileReader fis2 = new FileReader(s) ;\n" +
+ " FileReader fis3 = new FileReader(s) ; ) {\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -11522,15 +11522,15 @@ public void test751() throws Exception {
" }\n" +
"}\n";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void storeSomething(String s) throws Exception {\n" +
- " try (FileReader fis = new FileReader(\n" +
- " s); FileReader fis2 = new FileReader(\n" +
- " s); FileReader fis3 = new FileReader(s);) {\n" +
- " }\n" +
- " }\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void storeSomething(String s) throws Exception {\n" +
+ " try (FileReader fis = new FileReader(\n" +
+ " s); FileReader fis2 = new FileReader(\n" +
+ " s); FileReader fis3 = new FileReader(s);) {\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -11554,15 +11554,15 @@ public void test752() throws Exception {
" }\n" +
"}\n";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void storeSomething(String s) throws Exception {\n" +
- " try ( FileReader fis = new FileReader(s);\n" +
- " FileReader fis2 = new FileReader(s);\n" +
- " FileReader fis3 = new FileReader(s);) {\n" +
- " }\n" +
- " }\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void storeSomething(String s) throws Exception {\n" +
+ " try ( FileReader fis = new FileReader(s);\n" +
+ " FileReader fis2 = new FileReader(s);\n" +
+ " FileReader fis3 = new FileReader(s);) {\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -11586,15 +11586,15 @@ public void test753() throws Exception {
" }\n" +
"}\n";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void storeSomething(String s) throws Exception {\n" +
- " try (FileReader fis = new FileReader(s);\n" +
- " FileReader fis2 = new FileReader(s);\n" +
- " FileReader fis3 = new FileReader(s);) {\n" +
- " }\n" +
- " }\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void storeSomething(String s) throws Exception {\n" +
+ " try (FileReader fis = new FileReader(s);\n" +
+ " FileReader fis2 = new FileReader(s);\n" +
+ " FileReader fis3 = new FileReader(s);) {\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -11619,14 +11619,14 @@ public void test754() throws Exception {
" }\n" +
"}\n";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void storeSomething(String s) throws Exception {\n" +
- " try (FileReader fis = new FileReader(s); FileReader fis2 = new FileReader(s);\n" +
- " FileReader fis3 = new FileReader(s);) {\n" +
- " }\n" +
- " }\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void storeSomething(String s) throws Exception {\n" +
+ " try (FileReader fis = new FileReader(s); FileReader fis2 = new FileReader(s);\n" +
+ " FileReader fis3 = new FileReader(s);) {\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -11651,14 +11651,14 @@ public void test755() throws Exception {
" }\n" +
"}\n";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void storeSomething(String s) throws Exception {\n" +
- " try ( FileReader fis = new FileReader(s); FileReader fis2 = new FileReader(s);\n" +
- " FileReader fis3 = new FileReader(s);) {\n" +
- " }\n" +
- " }\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void storeSomething(String s) throws Exception {\n" +
+ " try ( FileReader fis = new FileReader(s); FileReader fis2 = new FileReader(s);\n" +
+ " FileReader fis3 = new FileReader(s);) {\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -11683,14 +11683,14 @@ public void test756() throws Exception {
" }\n" +
"}\n";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void storeSomething(String s) throws Exception {\n" +
- " try (FileReader fis = new FileReader(s); FileReader fis2 = new FileReader(s);\n" +
- " FileReader fis3 = new FileReader(s);) {\n" +
- " }\n" +
- " }\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void storeSomething(String s) throws Exception {\n" +
+ " try (FileReader fis = new FileReader(s); FileReader fis2 = new FileReader(s);\n" +
+ " FileReader fis3 = new FileReader(s);) {\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -11715,15 +11715,15 @@ public void test757() throws Exception {
" }\n" +
"}\n";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void storeSomething(String s) throws Exception {\n" +
- " try (\n" +
- " FileReader fis = new FileReader(s); FileReader fis2 = new FileReader(s);\n" +
- " FileReader fis3 = new FileReader(s);) {\n" +
- " }\n" +
- " }\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void storeSomething(String s) throws Exception {\n" +
+ " try (\n" +
+ " FileReader fis = new FileReader(s); FileReader fis2 = new FileReader(s);\n" +
+ " FileReader fis3 = new FileReader(s);) {\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -11748,15 +11748,15 @@ public void test758() throws Exception {
" }\n" +
"}\n";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void storeSomething(String s) throws Exception {\n" +
- " try (\n" +
- " FileReader fis = new FileReader(s); FileReader fis2 = new FileReader(s);\n" +
- " FileReader fis3 = new FileReader(s);) {\n" +
- " }\n" +
- " }\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void storeSomething(String s) throws Exception {\n" +
+ " try (\n" +
+ " FileReader fis = new FileReader(s); FileReader fis2 = new FileReader(s);\n" +
+ " FileReader fis3 = new FileReader(s);) {\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -11781,15 +11781,15 @@ public void test759() throws Exception {
" }\n" +
"}\n";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void storeSomething(String s) throws Exception {\n" +
- " try (\n" +
- " FileReader fis = new FileReader(s); FileReader fis2 = new FileReader(s);\n" +
- " FileReader fis3 = new FileReader(s);) {\n" +
- " }\n" +
- " }\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void storeSomething(String s) throws Exception {\n" +
+ " try (\n" +
+ " FileReader fis = new FileReader(s); FileReader fis2 = new FileReader(s);\n" +
+ " FileReader fis3 = new FileReader(s);) {\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -11814,16 +11814,16 @@ public void test760() throws Exception {
" }\n" +
"}\n";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void storeSomething(String s) throws Exception {\n" +
- " try (\n" +
- " FileReader fis = new FileReader(s);\n" +
- " FileReader fis2 = new FileReader(s);\n" +
- " FileReader fis3 = new FileReader(s);) {\n" +
- " }\n" +
- " }\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void storeSomething(String s) throws Exception {\n" +
+ " try (\n" +
+ " FileReader fis = new FileReader(s);\n" +
+ " FileReader fis2 = new FileReader(s);\n" +
+ " FileReader fis3 = new FileReader(s);) {\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -11848,16 +11848,16 @@ public void test761() throws Exception {
" }\n" +
"}\n";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void storeSomething(String s) throws Exception {\n" +
- " try (\n" +
- " FileReader fis = new FileReader(s);\n" +
- " FileReader fis2 = new FileReader(s);\n" +
- " FileReader fis3 = new FileReader(s);) {\n" +
- " }\n" +
- " }\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void storeSomething(String s) throws Exception {\n" +
+ " try (\n" +
+ " FileReader fis = new FileReader(s);\n" +
+ " FileReader fis2 = new FileReader(s);\n" +
+ " FileReader fis3 = new FileReader(s);) {\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -11882,16 +11882,16 @@ public void test762() throws Exception {
" }\n" +
"}\n";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void storeSomething(String s) throws Exception {\n" +
- " try (\n" +
- " FileReader fis = new FileReader(s);\n" +
- " FileReader fis2 = new FileReader(s);\n" +
- " FileReader fis3 = new FileReader(s);) {\n" +
- " }\n" +
- " }\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void storeSomething(String s) throws Exception {\n" +
+ " try (\n" +
+ " FileReader fis = new FileReader(s);\n" +
+ " FileReader fis2 = new FileReader(s);\n" +
+ " FileReader fis3 = new FileReader(s);) {\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -11916,16 +11916,16 @@ public void test763() throws Exception {
" }\n" +
"}\n";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void storeSomething(String s) throws Exception {\n" +
- " try (\n" +
- " FileReader fis = new FileReader(s);\n" +
- " FileReader fis2 = new FileReader(s);\n" +
- " FileReader fis3 = new FileReader(s);) {\n" +
- " }\n" +
- " }\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void storeSomething(String s) throws Exception {\n" +
+ " try (\n" +
+ " FileReader fis = new FileReader(s);\n" +
+ " FileReader fis2 = new FileReader(s);\n" +
+ " FileReader fis3 = new FileReader(s);) {\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -11950,16 +11950,16 @@ public void test764() throws Exception {
" }\n" +
"}\n";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void storeSomething(String s) throws Exception {\n" +
- " try (\n" +
- " FileReader fis = new FileReader(s);\n" +
- " FileReader fis2 = new FileReader(s);\n" +
- " FileReader fis3 = new FileReader(s);) {\n" +
- " }\n" +
- " }\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void storeSomething(String s) throws Exception {\n" +
+ " try (\n" +
+ " FileReader fis = new FileReader(s);\n" +
+ " FileReader fis2 = new FileReader(s);\n" +
+ " FileReader fis3 = new FileReader(s);) {\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -11984,16 +11984,16 @@ public void test765() throws Exception {
" }\n" +
"}\n";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void storeSomething(String s) throws Exception {\n" +
- " try (\n" +
- " FileReader fis = new FileReader(s);\n" +
- " FileReader fis2 = new FileReader(s);\n" +
- " FileReader fis3 = new FileReader(s);) {\n" +
- " }\n" +
- " }\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void storeSomething(String s) throws Exception {\n" +
+ " try (\n" +
+ " FileReader fis = new FileReader(s);\n" +
+ " FileReader fis2 = new FileReader(s);\n" +
+ " FileReader fis3 = new FileReader(s);) {\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -12023,21 +12023,21 @@ public void test766() throws Exception {
"}\n" +
"class MyE extends Exception {}";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void foo(boolean a) {\n" +
- " try {\n" +
- " if (a)\n" +
- " throw new FileNotFoundException();\n" +
- " else\n" +
- " throw new MyE();\n" +
- " } catch (MyE | FileNotFoundException | ArrayIndexOutOfBoundsException | IllegalArgumentException ex) {\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class MyE extends Exception {\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void foo(boolean a) {\n" +
+ " try {\n" +
+ " if (a)\n" +
+ " throw new FileNotFoundException();\n" +
+ " else\n" +
+ " throw new MyE();\n" +
+ " } catch (MyE | FileNotFoundException | ArrayIndexOutOfBoundsException | IllegalArgumentException ex) {\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class MyE extends Exception {\n" +
"}"
);
}
@@ -12065,22 +12065,22 @@ public void test767() throws Exception {
"}\n" +
"class MyE extends Exception {}";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void foo(boolean a) {\n" +
- " try {\n" +
- " if (a)\n" +
- " throw new FileNotFoundException();\n" +
- " else\n" +
- " throw new MyE();\n" +
- " } catch (MyE | FileNotFoundException | ArrayIndexOutOfBoundsException\n" +
- " | IllegalArgumentException ex) {\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class MyE extends Exception {\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void foo(boolean a) {\n" +
+ " try {\n" +
+ " if (a)\n" +
+ " throw new FileNotFoundException();\n" +
+ " else\n" +
+ " throw new MyE();\n" +
+ " } catch (MyE | FileNotFoundException | ArrayIndexOutOfBoundsException\n" +
+ " | IllegalArgumentException ex) {\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class MyE extends Exception {\n" +
"}"
);
}
@@ -12108,23 +12108,23 @@ public void test767a() throws Exception {
"}\n" +
"class MyE extends Exception {}";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void foo(boolean a) {\n" +
- " try {\n" +
- " if (a)\n" +
- " throw new FileNotFoundException();\n" +
- " else\n" +
- " throw new MyE();\n" +
- " } catch (MyE | FileNotFoundException\n" +
- " | ArrayIndexOutOfBoundsException\n" +
- " | IllegalArgumentException ex) {\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class MyE extends Exception {\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void foo(boolean a) {\n" +
+ " try {\n" +
+ " if (a)\n" +
+ " throw new FileNotFoundException();\n" +
+ " else\n" +
+ " throw new MyE();\n" +
+ " } catch (MyE | FileNotFoundException\n" +
+ " | ArrayIndexOutOfBoundsException\n" +
+ " | IllegalArgumentException ex) {\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class MyE extends Exception {\n" +
"}"
);
}
@@ -12154,22 +12154,22 @@ public void test767b() throws Exception {
"}\n" +
"class MyE extends Exception {}";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void foo(boolean a) {\n" +
- " try {\n" +
- " if (a)\n" +
- " throw new FileNotFoundException();\n" +
- " else\n" +
- " throw new MyE();\n" +
- " } catch (MyE |FileNotFoundException |ArrayIndexOutOfBoundsException\n" +
- " |IllegalArgumentException ex) {\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class MyE extends Exception {\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void foo(boolean a) {\n" +
+ " try {\n" +
+ " if (a)\n" +
+ " throw new FileNotFoundException();\n" +
+ " else\n" +
+ " throw new MyE();\n" +
+ " } catch (MyE |FileNotFoundException |ArrayIndexOutOfBoundsException\n" +
+ " |IllegalArgumentException ex) {\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class MyE extends Exception {\n" +
"}"
);
}
@@ -12200,22 +12200,22 @@ public void test768() throws Exception {
"}\n" +
"class MyE extends Exception {}";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void foo(boolean a) {\n" +
- " try {\n" +
- " if (a)\n" +
- " throw new FileNotFoundException();\n" +
- " else\n" +
- " throw new MyE();\n" +
- " } catch ( MyE | FileNotFoundException | ArrayIndexOutOfBoundsException\n" +
- " | IllegalArgumentException ex) {\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class MyE extends Exception {\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void foo(boolean a) {\n" +
+ " try {\n" +
+ " if (a)\n" +
+ " throw new FileNotFoundException();\n" +
+ " else\n" +
+ " throw new MyE();\n" +
+ " } catch ( MyE | FileNotFoundException | ArrayIndexOutOfBoundsException\n" +
+ " | IllegalArgumentException ex) {\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class MyE extends Exception {\n" +
"}"
);
}
@@ -12246,22 +12246,22 @@ public void test769() throws Exception {
"}\n" +
"class MyE extends Exception {}";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void foo(boolean a) {\n" +
- " try {\n" +
- " if (a)\n" +
- " throw new FileNotFoundException();\n" +
- " else\n" +
- " throw new MyE();\n" +
- " } catch (MyE | FileNotFoundException | ArrayIndexOutOfBoundsException\n" +
- " | IllegalArgumentException ex) {\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class MyE extends Exception {\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void foo(boolean a) {\n" +
+ " try {\n" +
+ " if (a)\n" +
+ " throw new FileNotFoundException();\n" +
+ " else\n" +
+ " throw new MyE();\n" +
+ " } catch (MyE | FileNotFoundException | ArrayIndexOutOfBoundsException\n" +
+ " | IllegalArgumentException ex) {\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class MyE extends Exception {\n" +
"}"
);
}
@@ -12292,23 +12292,23 @@ public void test770() throws Exception {
"}\n" +
"class MyE extends Exception {}";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void foo(boolean a) {\n" +
- " try {\n" +
- " if (a)\n" +
- " throw new FileNotFoundException();\n" +
- " else\n" +
- " throw new MyE();\n" +
- " } catch (\n" +
- " MyE | FileNotFoundException | ArrayIndexOutOfBoundsException\n" +
- " | IllegalArgumentException ex) {\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class MyE extends Exception {\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void foo(boolean a) {\n" +
+ " try {\n" +
+ " if (a)\n" +
+ " throw new FileNotFoundException();\n" +
+ " else\n" +
+ " throw new MyE();\n" +
+ " } catch (\n" +
+ " MyE | FileNotFoundException | ArrayIndexOutOfBoundsException\n" +
+ " | IllegalArgumentException ex) {\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class MyE extends Exception {\n" +
"}"
);
}
@@ -12339,23 +12339,23 @@ public void test771() throws Exception {
"}\n" +
"class MyE extends Exception {}";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void foo(boolean a) {\n" +
- " try {\n" +
- " if (a)\n" +
- " throw new FileNotFoundException();\n" +
- " else\n" +
- " throw new MyE();\n" +
- " } catch (\n" +
- " MyE | FileNotFoundException | ArrayIndexOutOfBoundsException\n" +
- " | IllegalArgumentException ex) {\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class MyE extends Exception {\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void foo(boolean a) {\n" +
+ " try {\n" +
+ " if (a)\n" +
+ " throw new FileNotFoundException();\n" +
+ " else\n" +
+ " throw new MyE();\n" +
+ " } catch (\n" +
+ " MyE | FileNotFoundException | ArrayIndexOutOfBoundsException\n" +
+ " | IllegalArgumentException ex) {\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class MyE extends Exception {\n" +
"}"
);
}
@@ -12386,23 +12386,23 @@ public void test772() throws Exception {
"}\n" +
"class MyE extends Exception {}";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void foo(boolean a) {\n" +
- " try {\n" +
- " if (a)\n" +
- " throw new FileNotFoundException();\n" +
- " else\n" +
- " throw new MyE();\n" +
- " } catch (\n" +
- " MyE | FileNotFoundException | ArrayIndexOutOfBoundsException\n" +
- " | IllegalArgumentException ex) {\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class MyE extends Exception {\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void foo(boolean a) {\n" +
+ " try {\n" +
+ " if (a)\n" +
+ " throw new FileNotFoundException();\n" +
+ " else\n" +
+ " throw new MyE();\n" +
+ " } catch (\n" +
+ " MyE | FileNotFoundException | ArrayIndexOutOfBoundsException\n" +
+ " | IllegalArgumentException ex) {\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class MyE extends Exception {\n" +
"}"
);
}
@@ -12434,24 +12434,24 @@ public void test773() throws Exception {
"}\n" +
"class MyE extends Exception {}";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void foo(boolean a) {\n" +
- " try {\n" +
- " if (a)\n" +
- " throw new FileNotFoundException();\n" +
- " else\n" +
- " throw new MyE();\n" +
- " } catch (MyE\n" +
- " | FileNotFoundException\n" +
- " | ArrayIndexOutOfBoundsException\n" +
- " | IllegalArgumentException ex) {\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class MyE extends Exception {\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void foo(boolean a) {\n" +
+ " try {\n" +
+ " if (a)\n" +
+ " throw new FileNotFoundException();\n" +
+ " else\n" +
+ " throw new MyE();\n" +
+ " } catch (MyE\n" +
+ " | FileNotFoundException\n" +
+ " | ArrayIndexOutOfBoundsException\n" +
+ " | IllegalArgumentException ex) {\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class MyE extends Exception {\n" +
"}"
);
}
@@ -12482,24 +12482,24 @@ public void test774() throws Exception {
"}\n" +
"class MyE extends Exception {}";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void foo(boolean a) {\n" +
- " try {\n" +
- " if (a)\n" +
- " throw new FileNotFoundException();\n" +
- " else\n" +
- " throw new MyE();\n" +
- " } catch ( MyE\n" +
- " | FileNotFoundException\n" +
- " | ArrayIndexOutOfBoundsException\n" +
- " | IllegalArgumentException ex) {\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class MyE extends Exception {\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void foo(boolean a) {\n" +
+ " try {\n" +
+ " if (a)\n" +
+ " throw new FileNotFoundException();\n" +
+ " else\n" +
+ " throw new MyE();\n" +
+ " } catch ( MyE\n" +
+ " | FileNotFoundException\n" +
+ " | ArrayIndexOutOfBoundsException\n" +
+ " | IllegalArgumentException ex) {\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class MyE extends Exception {\n" +
"}"
);
}
@@ -12530,24 +12530,24 @@ public void test775() throws Exception {
"}\n" +
"class MyE extends Exception {}";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void foo(boolean a) {\n" +
- " try {\n" +
- " if (a)\n" +
- " throw new FileNotFoundException();\n" +
- " else\n" +
- " throw new MyE();\n" +
- " } catch (MyE\n" +
- " | FileNotFoundException\n" +
- " | ArrayIndexOutOfBoundsException\n" +
- " | IllegalArgumentException ex) {\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class MyE extends Exception {\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void foo(boolean a) {\n" +
+ " try {\n" +
+ " if (a)\n" +
+ " throw new FileNotFoundException();\n" +
+ " else\n" +
+ " throw new MyE();\n" +
+ " } catch (MyE\n" +
+ " | FileNotFoundException\n" +
+ " | ArrayIndexOutOfBoundsException\n" +
+ " | IllegalArgumentException ex) {\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class MyE extends Exception {\n" +
"}"
);
}
@@ -12578,25 +12578,25 @@ public void test776() throws Exception {
"}\n" +
"class MyE extends Exception {}";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void foo(boolean a) {\n" +
- " try {\n" +
- " if (a)\n" +
- " throw new FileNotFoundException();\n" +
- " else\n" +
- " throw new MyE();\n" +
- " } catch (\n" +
- " MyE\n" +
- " | FileNotFoundException\n" +
- " | ArrayIndexOutOfBoundsException\n" +
- " | IllegalArgumentException ex) {\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class MyE extends Exception {\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void foo(boolean a) {\n" +
+ " try {\n" +
+ " if (a)\n" +
+ " throw new FileNotFoundException();\n" +
+ " else\n" +
+ " throw new MyE();\n" +
+ " } catch (\n" +
+ " MyE\n" +
+ " | FileNotFoundException\n" +
+ " | ArrayIndexOutOfBoundsException\n" +
+ " | IllegalArgumentException ex) {\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class MyE extends Exception {\n" +
"}"
);
}
@@ -12627,25 +12627,25 @@ public void test777() throws Exception {
"}\n" +
"class MyE extends Exception {}";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void foo(boolean a) {\n" +
- " try {\n" +
- " if (a)\n" +
- " throw new FileNotFoundException();\n" +
- " else\n" +
- " throw new MyE();\n" +
- " } catch (\n" +
- " MyE\n" +
- " | FileNotFoundException\n" +
- " | ArrayIndexOutOfBoundsException\n" +
- " | IllegalArgumentException ex) {\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class MyE extends Exception {\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void foo(boolean a) {\n" +
+ " try {\n" +
+ " if (a)\n" +
+ " throw new FileNotFoundException();\n" +
+ " else\n" +
+ " throw new MyE();\n" +
+ " } catch (\n" +
+ " MyE\n" +
+ " | FileNotFoundException\n" +
+ " | ArrayIndexOutOfBoundsException\n" +
+ " | IllegalArgumentException ex) {\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class MyE extends Exception {\n" +
"}"
);
}
@@ -12676,25 +12676,25 @@ public void test778() throws Exception {
"}\n" +
"class MyE extends Exception {}";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void foo(boolean a) {\n" +
- " try {\n" +
- " if (a)\n" +
- " throw new FileNotFoundException();\n" +
- " else\n" +
- " throw new MyE();\n" +
- " } catch (\n" +
- " MyE\n" +
- " | FileNotFoundException\n" +
- " | ArrayIndexOutOfBoundsException\n" +
- " | IllegalArgumentException ex) {\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class MyE extends Exception {\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void foo(boolean a) {\n" +
+ " try {\n" +
+ " if (a)\n" +
+ " throw new FileNotFoundException();\n" +
+ " else\n" +
+ " throw new MyE();\n" +
+ " } catch (\n" +
+ " MyE\n" +
+ " | FileNotFoundException\n" +
+ " | ArrayIndexOutOfBoundsException\n" +
+ " | IllegalArgumentException ex) {\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class MyE extends Exception {\n" +
"}"
);
}
@@ -12725,25 +12725,25 @@ public void test779() throws Exception {
"}\n" +
"class MyE extends Exception {}";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void foo(boolean a) {\n" +
- " try {\n" +
- " if (a)\n" +
- " throw new FileNotFoundException();\n" +
- " else\n" +
- " throw new MyE();\n" +
- " } catch (\n" +
- " MyE\n" +
- " | FileNotFoundException\n" +
- " | ArrayIndexOutOfBoundsException\n" +
- " | IllegalArgumentException ex) {\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class MyE extends Exception {\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void foo(boolean a) {\n" +
+ " try {\n" +
+ " if (a)\n" +
+ " throw new FileNotFoundException();\n" +
+ " else\n" +
+ " throw new MyE();\n" +
+ " } catch (\n" +
+ " MyE\n" +
+ " | FileNotFoundException\n" +
+ " | ArrayIndexOutOfBoundsException\n" +
+ " | IllegalArgumentException ex) {\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class MyE extends Exception {\n" +
"}"
);
}
@@ -12774,25 +12774,25 @@ public void test780() throws Exception {
"}\n" +
"class MyE extends Exception {}";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void foo(boolean a) {\n" +
- " try {\n" +
- " if (a)\n" +
- " throw new FileNotFoundException();\n" +
- " else\n" +
- " throw new MyE();\n" +
- " } catch (\n" +
- " MyE\n" +
- " | FileNotFoundException\n" +
- " | ArrayIndexOutOfBoundsException\n" +
- " | IllegalArgumentException ex) {\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class MyE extends Exception {\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void foo(boolean a) {\n" +
+ " try {\n" +
+ " if (a)\n" +
+ " throw new FileNotFoundException();\n" +
+ " else\n" +
+ " throw new MyE();\n" +
+ " } catch (\n" +
+ " MyE\n" +
+ " | FileNotFoundException\n" +
+ " | ArrayIndexOutOfBoundsException\n" +
+ " | IllegalArgumentException ex) {\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class MyE extends Exception {\n" +
"}"
);
}
@@ -12823,25 +12823,25 @@ public void test781() throws Exception {
"}\n" +
"class MyE extends Exception {}";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void foo(boolean a) {\n" +
- " try {\n" +
- " if (a)\n" +
- " throw new FileNotFoundException();\n" +
- " else\n" +
- " throw new MyE();\n" +
- " } catch (\n" +
- " MyE\n" +
- " | FileNotFoundException\n" +
- " | ArrayIndexOutOfBoundsException\n" +
- " | IllegalArgumentException ex) {\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class MyE extends Exception {\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void foo(boolean a) {\n" +
+ " try {\n" +
+ " if (a)\n" +
+ " throw new FileNotFoundException();\n" +
+ " else\n" +
+ " throw new MyE();\n" +
+ " } catch (\n" +
+ " MyE\n" +
+ " | FileNotFoundException\n" +
+ " | ArrayIndexOutOfBoundsException\n" +
+ " | IllegalArgumentException ex) {\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class MyE extends Exception {\n" +
"}"
);
}
@@ -12870,22 +12870,22 @@ public void test782() throws Exception {
"}\n" +
"class MyE extends Exception {}";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " public void foo(boolean a) {\n" +
- " try {\n" +
- " if (a)\n" +
- " throw new FileNotFoundException();\n" +
- " else\n" +
- " throw new MyE();\n" +
- " } catch (MyE | FileNotFoundException | ArrayIndexOutOfBoundsException |\n" +
- " IllegalArgumentException ex) {\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class MyE extends Exception {\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " public void foo(boolean a) {\n" +
+ " try {\n" +
+ " if (a)\n" +
+ " throw new FileNotFoundException();\n" +
+ " else\n" +
+ " throw new MyE();\n" +
+ " } catch (MyE | FileNotFoundException | ArrayIndexOutOfBoundsException |\n" +
+ " IllegalArgumentException ex) {\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class MyE extends Exception {\n" +
"}"
);
}
@@ -12893,17 +12893,17 @@ public void test782() throws Exception {
public void test783() throws Exception {
this.formatterPrefs = null;
String source =
- "public class X {public static void main(String[] args) {\n" +
- " long x = 0x8000000000000000L;\n" +
- " System.out.println(x);\n" +
- " }\n" +
+ "public class X {public static void main(String[] args) {\n" +
+ " long x = 0x8000000000000000L;\n" +
+ " System.out.println(x);\n" +
+ " }\n" +
"}";
formatSource(source,
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " long x = 0x8000000000000000L;\n" +
- " System.out.println(x);\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " long x = 0x8000000000000000L;\n" +
+ " System.out.println(x);\n" +
+ " }\n" +
"}"
);
}
@@ -12946,24 +12946,24 @@ public void testBug379793() throws Exception {
" }\n" +
"}\n";
formatSource(source,
- "package test;\n" +
- "\n" +
- "public class FormatterError {\n" +
- " void jbtnJDBCTest_actionPerformed(final ActionEvent e) {\n" +
- " if ((driverClasses != null) && (JDBCURL != null)) {\n" +
- " if (test == true) {\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FormatterError {\n" +
+ " void jbtnJDBCTest_actionPerformed(final ActionEvent e) {\n" +
+ " if ((driverClasses != null) && (JDBCURL != null)) {\n" +
+ " if (test == true) {\n" +
" try (\n" +
- " final Connection connection = DriverManager.getConnection(JDBCURL);) {\n" +
- " test = (connection != null);\n" +
- " if (test == true) {\n" +
- " jTextArea1.setText(\"The test was completeted successfully!\");\n" +
- " }\n" +
- " } catch (final SQLException sx) {\n" +
- " jTextArea1.setText(\"\");\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ " final Connection connection = DriverManager.getConnection(JDBCURL);) {\n" +
+ " test = (connection != null);\n" +
+ " if (test == true) {\n" +
+ " jTextArea1.setText(\"The test was completeted successfully!\");\n" +
+ " }\n" +
+ " } catch (final SQLException sx) {\n" +
+ " jTextArea1.setText(\"\");\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
}
@@ -12975,15 +12975,15 @@ public void testBug405038() throws Exception {
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ADDITIVE_OPERATOR, JavaCore.DO_NOT_INSERT);
String source =
"public class FormatterError {\n" +
- " int foo(int a, int b, int c) {\n" +
- " return a + b + ++c;\n" +
+ " int foo(int a, int b, int c) {\n" +
+ " return a + b + ++c;\n" +
" }\n" +
"}\n";
formatSource(source,
- "public class FormatterError {\n" +
- " int foo(int a, int b, int c) {\n" +
- " return a+b+ ++c;\n" +
- " }\n" +
+ "public class FormatterError {\n" +
+ " int foo(int a, int b, int c) {\n" +
+ " return a+b+ ++c;\n" +
+ " }\n" +
"}\n"
);
}
@@ -12995,15 +12995,15 @@ public void testBug405038_2() throws Exception {
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ADDITIVE_OPERATOR, JavaCore.DO_NOT_INSERT);
String source =
"public class FormatterError {\n" +
- " int foo(int a, int b, int c) {\n" +
- " return a + ++b + c;\n" +
+ " int foo(int a, int b, int c) {\n" +
+ " return a + ++b + c;\n" +
" }\n" +
"}\n";
formatSource(source,
- "public class FormatterError {\n" +
- " int foo(int a, int b, int c) {\n" +
- " return a+ ++b+c;\n" +
- " }\n" +
+ "public class FormatterError {\n" +
+ " int foo(int a, int b, int c) {\n" +
+ " return a+ ++b+c;\n" +
+ " }\n" +
"}\n"
);
}
@@ -13015,15 +13015,15 @@ public void testBug405038_3() throws Exception {
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ADDITIVE_OPERATOR, JavaCore.DO_NOT_INSERT);
String source =
"public class FormatterError {\n" +
- " int foo(int a, int b, int c) {\n" +
- " return a - --b + c;\n" +
+ " int foo(int a, int b, int c) {\n" +
+ " return a - --b + c;\n" +
" }\n" +
"}\n";
formatSource(source,
- "public class FormatterError {\n" +
- " int foo(int a, int b, int c) {\n" +
- " return a- --b+c;\n" +
- " }\n" +
+ "public class FormatterError {\n" +
+ " int foo(int a, int b, int c) {\n" +
+ " return a- --b+c;\n" +
+ " }\n" +
"}\n"
);
}
@@ -13035,15 +13035,15 @@ public void testBug405038_4() throws Exception {
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ADDITIVE_OPERATOR, JavaCore.DO_NOT_INSERT);
String source =
"public class FormatterError {\n" +
- " int foo(int a, int b, int c) {\n" +
- " return a - -b + c;\n" +
+ " int foo(int a, int b, int c) {\n" +
+ " return a - -b + c;\n" +
" }\n" +
"}\n";
formatSource(source,
- "public class FormatterError {\n" +
- " int foo(int a, int b, int c) {\n" +
- " return a- -b+c;\n" +
- " }\n" +
+ "public class FormatterError {\n" +
+ " int foo(int a, int b, int c) {\n" +
+ " return a- -b+c;\n" +
+ " }\n" +
"}\n"
);
}
@@ -13055,15 +13055,15 @@ public void testBug405038_5() throws Exception {
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ADDITIVE_OPERATOR, JavaCore.DO_NOT_INSERT);
String source =
"public class FormatterError {\n" +
- " int foo(int a, int b, int c) {\n" +
- " return a - -b + ++c;\n" +
+ " int foo(int a, int b, int c) {\n" +
+ " return a - -b + ++c;\n" +
" }\n" +
"}\n";
formatSource(source,
- "public class FormatterError {\n" +
- " int foo(int a, int b, int c) {\n" +
- " return a- -b+ ++c;\n" +
- " }\n" +
+ "public class FormatterError {\n" +
+ " int foo(int a, int b, int c) {\n" +
+ " return a- -b+ ++c;\n" +
+ " }\n" +
"}\n"
);
}
@@ -13085,7 +13085,7 @@ public void testBug432593() throws IOException {
assertTrue(edit != null);
} catch (JavaModelException e) {
e.printStackTrace();
- }
+ }
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=467229
public void testBug467229() throws IOException {
@@ -13154,49 +13154,49 @@ public void testBug477476b() {
public void testBug485495() {
this.formatterPrefs.insert_space_before_semicolon = true;
String source =
- "package test ;\n" +
- "\n" +
- "import java.util.ArrayList ;\n" +
- "\n" +
- "public class Test {\n" +
- "\n" +
- " interface I {\n" +
- " void method() ;\n" +
- " }\n" +
- "\n" +
- " ArrayList<String> e = null ;\n" +
- " int i ;\n" +
- "\n" +
- " void foo() {\n" +
- " int i = 0 ;\n" +
- " String s ;\n" +
- " if (i > 0)\n" +
- " return ;\n" +
- " for (int j = 0; j < 5; j++) {\n" +
- " Object o ;\n" +
- " while (i < 0)\n" +
- " o = new Object() {\n" +
- " int f ;\n" +
- "\n" +
- " void bar() {\n" +
- " if (f > 0)\n" +
- " f = 5 ;\n" +
- " else\n" +
- " f = 16 ;\n" +
- " try {\n" +
- " f = 14 ;\n" +
- " } catch (Exception e) {\n" +
- " bar() ;\n" +
- " }\n" +
- " }\n" +
- " } ;\n" +
- " while (i < 0)\n" +
- " switch (i) {\n" +
- " case 4:\n" +
- " foo() ;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "package test ;\n" +
+ "\n" +
+ "import java.util.ArrayList ;\n" +
+ "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " interface I {\n" +
+ " void method() ;\n" +
+ " }\n" +
+ "\n" +
+ " ArrayList<String> e = null ;\n" +
+ " int i ;\n" +
+ "\n" +
+ " void foo() {\n" +
+ " int i = 0 ;\n" +
+ " String s ;\n" +
+ " if (i > 0)\n" +
+ " return ;\n" +
+ " for (int j = 0; j < 5; j++) {\n" +
+ " Object o ;\n" +
+ " while (i < 0)\n" +
+ " o = new Object() {\n" +
+ " int f ;\n" +
+ "\n" +
+ " void bar() {\n" +
+ " if (f > 0)\n" +
+ " f = 5 ;\n" +
+ " else\n" +
+ " f = 16 ;\n" +
+ " try {\n" +
+ " f = 14 ;\n" +
+ " } catch (Exception e) {\n" +
+ " bar() ;\n" +
+ " }\n" +
+ " }\n" +
+ " } ;\n" +
+ " while (i < 0)\n" +
+ " switch (i) {\n" +
+ " case 4:\n" +
+ " foo() ;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}";
formatSource(source);
}
@@ -13207,21 +13207,21 @@ public void testBug479109a() {
this.formatterPrefs.align_type_members_on_columns = true;
this.formatterPrefs.align_fields_grouping_blank_lines = 1;
String source =
- "public class Test {\n" +
- " String field1 = \"1\"; //\n" +
- "\n" +
- " public String field2 = \"2222\"; //\n" +
- "\n" +
- "\n" +
- " protected final String field3 = \"333333333\"; //\n" +
+ "public class Test {\n" +
+ " String field1 = \"1\"; //\n" +
+ "\n" +
+ " public String field2 = \"2222\"; //\n" +
+ "\n" +
+ "\n" +
+ " protected final String field3 = \"333333333\"; //\n" +
"}";
formatSource(source,
- "public class Test {\n" +
- " String field1 = \"1\"; //\n" +
- "\n" +
- " public String field2 = \"2222\"; //\n" +
- "\n" +
- " protected final String field3 = \"333333333\"; //\n" +
+ "public class Test {\n" +
+ " String field1 = \"1\"; //\n" +
+ "\n" +
+ " public String field2 = \"2222\"; //\n" +
+ "\n" +
+ " protected final String field3 = \"333333333\"; //\n" +
"}"
);
}
@@ -13232,21 +13232,21 @@ public void testBug479109b() {
this.formatterPrefs.align_type_members_on_columns = true;
this.formatterPrefs.align_fields_grouping_blank_lines = 2;
String source =
- "public class Test {\n" +
- " String field1 = \"1\";\n" +
- "\n" +
- " public String field2222 = \"2222\";\n" +
- "\n" +
- "\n" +
- " protected final String field3 = \"333333333\";\n" +
+ "public class Test {\n" +
+ " String field1 = \"1\";\n" +
+ "\n" +
+ " public String field2222 = \"2222\";\n" +
+ "\n" +
+ "\n" +
+ " protected final String field3 = \"333333333\";\n" +
"}";
formatSource(source,
- "public class Test {\n" +
- " String field1 = \"1\";\n" +
- "\n" +
- " public String field2222 = \"2222\";\n" +
- "\n" +
- " protected final String field3 = \"333333333\";\n" +
+ "public class Test {\n" +
+ " String field1 = \"1\";\n" +
+ "\n" +
+ " public String field2222 = \"2222\";\n" +
+ "\n" +
+ " protected final String field3 = \"333333333\";\n" +
"}"
);
}
@@ -13258,22 +13258,22 @@ public void testBug479109c() {
this.formatterPrefs.align_fields_grouping_blank_lines = 2;
this.formatterPrefs.number_of_empty_lines_to_preserve = 2;
String source =
- "public class Test {\n" +
- " String field1 = \"1\"; //\n" +
- "\n" +
- " public String field2222 = \"2222\"; //\n" +
- "\n" +
- "\n" +
- " protected final String field3 = \"333333333\"; //\n" +
+ "public class Test {\n" +
+ " String field1 = \"1\"; //\n" +
+ "\n" +
+ " public String field2222 = \"2222\"; //\n" +
+ "\n" +
+ "\n" +
+ " protected final String field3 = \"333333333\"; //\n" +
"}";
formatSource(source,
- "public class Test {\n" +
- " String field1 = \"1\"; //\n" +
- "\n" +
- " public String field2222 = \"2222\"; //\n" +
- "\n" +
- "\n" +
- " protected final String field3 = \"333333333\"; //\n" +
+ "public class Test {\n" +
+ " String field1 = \"1\"; //\n" +
+ "\n" +
+ " public String field2222 = \"2222\"; //\n" +
+ "\n" +
+ "\n" +
+ " protected final String field3 = \"333333333\"; //\n" +
"}"
);
}
@@ -13285,24 +13285,24 @@ public void testBug479109d() {
this.formatterPrefs.align_type_members_on_columns = true;
this.formatterPrefs.align_fields_grouping_blank_lines = 2;
String source =
- "public class Test {\n" +
- " String field1 = \"1\";\n" +
- "\n" +
- " public String field2222 = \"2222\";\n" +
- "\n" +
- "// group separator\n" +
- "\n" +
- " protected final String field3 = \"333333333\";\n" +
+ "public class Test {\n" +
+ " String field1 = \"1\";\n" +
+ "\n" +
+ " public String field2222 = \"2222\";\n" +
+ "\n" +
+ "// group separator\n" +
+ "\n" +
+ " protected final String field3 = \"333333333\";\n" +
"}";
formatSource(source,
- "public class Test {\n" +
- " String field1 = \"1\";\n" +
- "\n" +
- " public String field2222 = \"2222\";\n" +
- "\n" +
- " // group separator\n" +
- "\n" +
- " protected final String field3 = \"333333333\";\n" +
+ "public class Test {\n" +
+ " String field1 = \"1\";\n" +
+ "\n" +
+ " public String field2222 = \"2222\";\n" +
+ "\n" +
+ " // group separator\n" +
+ "\n" +
+ " protected final String field3 = \"333333333\";\n" +
"}"
);
}
@@ -13312,12 +13312,12 @@ public void testBug479109d() {
public void testBug486719() {
this.formatterPrefs.page_width = 80;
String source =
- "public class Example {\n" +
- " int foo(Object a, Object b, Object c) {\n" +
- " if (a == b) return 1;if (a == c) return 2; //$IDENTITY-COMPARISON$\n" +
- " boolean aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = a == b && a == c; //$IDENTITY-COMPARISON$\n" +
- " return 3;\n" +
- " }\n" +
+ "public class Example {\n" +
+ " int foo(Object a, Object b, Object c) {\n" +
+ " if (a == b) return 1;if (a == c) return 2; //$IDENTITY-COMPARISON$\n" +
+ " boolean aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = a == b && a == c; //$IDENTITY-COMPARISON$\n" +
+ " return 3;\n" +
+ " }\n" +
"}";
formatSource(source);
}
@@ -13328,8 +13328,8 @@ public void testBug432628a() {
setComplianceLevel(CompilerOptions.VERSION_1_5);
this.formatterPrefs.insert_new_line_after_annotation_on_enum_constant = false;
String source =
- "public enum SomeEnum {\n" +
- " @XmlEnumValue(\"val1\") VAL_1(\"val1\"), @XmlEnumValue(\"val2\") VAL_2(\"val2\");\n" +
+ "public enum SomeEnum {\n" +
+ " @XmlEnumValue(\"val1\") VAL_1(\"val1\"), @XmlEnumValue(\"val2\") VAL_2(\"val2\");\n" +
"}";
formatSource(source);
}
@@ -13340,10 +13340,10 @@ public void testBug432628b() {
setComplianceLevel(CompilerOptions.VERSION_1_5);
this.formatterPrefs.insert_new_line_after_annotation_on_enum_constant = true;
String source =
- "public enum SomeEnum {\n" +
- " @XmlEnumValue(\"val1\")\n" +
- " VAL_1(\"val1\"), @XmlEnumValue(\"val2\")\n" +
- " VAL_2(\"val2\");\n" +
+ "public enum SomeEnum {\n" +
+ " @XmlEnumValue(\"val1\")\n" +
+ " VAL_1(\"val1\"), @XmlEnumValue(\"val2\")\n" +
+ " VAL_2(\"val2\");\n" +
"}";
formatSource(source);
}
@@ -13355,11 +13355,11 @@ public void testBug432628c() {
this.formatterPrefs.insert_new_line_after_annotation_on_enum_constant = true;
this.formatterPrefs.alignment_for_enum_constants = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE;
String source =
- "public enum SomeEnum {\n" +
- " @XmlEnumValue(\"val1\")\n" +
- " VAL_1(\"val1\"),\n" +
- " @XmlEnumValue(\"val2\")\n" +
- " VAL_2(\"val2\");\n" +
+ "public enum SomeEnum {\n" +
+ " @XmlEnumValue(\"val1\")\n" +
+ " VAL_1(\"val1\"),\n" +
+ " @XmlEnumValue(\"val2\")\n" +
+ " VAL_2(\"val2\");\n" +
"}";
formatSource(source);
}
@@ -13371,9 +13371,9 @@ public void testBug432628d() {
this.formatterPrefs.insert_new_line_after_annotation_on_enum_constant = false;
this.formatterPrefs.alignment_for_enum_constants = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE;
String source =
- "public enum SomeEnum {\n" +
- " @XmlEnumValue(\"val1\") VAL_1(\"val1\"),\n" +
- " @XmlEnumValue(\"val2\") VAL_2(\"val2\");\n" +
+ "public enum SomeEnum {\n" +
+ " @XmlEnumValue(\"val1\") VAL_1(\"val1\"),\n" +
+ " @XmlEnumValue(\"val2\") VAL_2(\"val2\");\n" +
"}";
formatSource(source);
}
@@ -13383,12 +13383,12 @@ public void testBug432628d() {
public void testBug118264a() {
this.formatterPrefs.page_width = 50;
String source =
- "class Example {\n" +
- " int foo(int argument) {\n" +
- " for (int counter = 0; counter < argument; counter++) {\n" +
- " doSomething(counter);\n" +
- " }\n" +
- " }\n" +
+ "class Example {\n" +
+ " int foo(int argument) {\n" +
+ " for (int counter = 0; counter < argument; counter++) {\n" +
+ " doSomething(counter);\n" +
+ " }\n" +
+ " }\n" +
"}";
formatSource(source);
}
@@ -13399,21 +13399,21 @@ public void testBug118264b() {
this.formatterPrefs.alignment_for_expressions_in_for_loop_header = Alignment.M_COMPACT_SPLIT;
this.formatterPrefs.page_width = 50;
String source =
- "class Example {\n" +
- " int foo(int argument) {\n" +
- " for (int counter = 0; counter < argument; counter++) {\n" +
- " doSomething(counter);\n" +
- " }\n" +
- " }\n" +
+ "class Example {\n" +
+ " int foo(int argument) {\n" +
+ " for (int counter = 0; counter < argument; counter++) {\n" +
+ " doSomething(counter);\n" +
+ " }\n" +
+ " }\n" +
"}";
formatSource(source,
- "class Example {\n" +
- " int foo(int argument) {\n" +
- " for (int counter = 0; counter < argument;\n" +
- " counter++) {\n" +
- " doSomething(counter);\n" +
- " }\n" +
- " }\n" +
+ "class Example {\n" +
+ " int foo(int argument) {\n" +
+ " for (int counter = 0; counter < argument;\n" +
+ " counter++) {\n" +
+ " doSomething(counter);\n" +
+ " }\n" +
+ " }\n" +
"}"
);
}
@@ -13423,23 +13423,23 @@ public void testBug118264b() {
public void testBug118264c() {
this.formatterPrefs.alignment_for_expressions_in_for_loop_header = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE;
String source =
- "class Example {\n" +
- " int foo(int argument) {\n" +
- " for (int counter = 0; counter < argument; counter++) {\n" +
- " doSomething(counter);\n" +
- " }\n" +
- " }\n" +
+ "class Example {\n" +
+ " int foo(int argument) {\n" +
+ " for (int counter = 0; counter < argument; counter++) {\n" +
+ " doSomething(counter);\n" +
+ " }\n" +
+ " }\n" +
"}";
formatSource(source,
- "class Example {\n" +
- " int foo(int argument) {\n" +
- " for (\n" +
- " int counter = 0;\n" +
- " counter < argument;\n" +
- " counter++) {\n" +
- " doSomething(counter);\n" +
- " }\n" +
- " }\n" +
+ "class Example {\n" +
+ " int foo(int argument) {\n" +
+ " for (\n" +
+ " int counter = 0;\n" +
+ " counter < argument;\n" +
+ " counter++) {\n" +
+ " doSomething(counter);\n" +
+ " }\n" +
+ " }\n" +
"}"
);
}
@@ -13449,21 +13449,21 @@ public void testBug118264c() {
public void testBug118264d() {
this.formatterPrefs.alignment_for_expressions_in_for_loop_header = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE;
String source =
- "class Example {\n" +
- " int foo(int argument) {\n" +
- " for (int counter = 0; ; ) {\n" +
- " doSomething(counter);\n" +
- " }\n" +
- " }\n" +
+ "class Example {\n" +
+ " int foo(int argument) {\n" +
+ " for (int counter = 0; ; ) {\n" +
+ " doSomething(counter);\n" +
+ " }\n" +
+ " }\n" +
"}";
formatSource(source,
- "class Example {\n" +
- " int foo(int argument) {\n" +
- " for (\n" +
- " int counter = 0;;) {\n" +
- " doSomething(counter);\n" +
- " }\n" +
- " }\n" +
+ "class Example {\n" +
+ " int foo(int argument) {\n" +
+ " for (\n" +
+ " int counter = 0;;) {\n" +
+ " doSomething(counter);\n" +
+ " }\n" +
+ " }\n" +
"}"
);
}
@@ -13473,21 +13473,21 @@ public void testBug118264d() {
public void testBug118264e() {
this.formatterPrefs.alignment_for_expressions_in_for_loop_header = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE;
String source =
- "class Example {\n" +
- " int foo(int argument) {\n" +
- " for (;;argument--, argument--) {\n" +
- " doSomething(counter);\n" +
- " }\n" +
- " }\n" +
+ "class Example {\n" +
+ " int foo(int argument) {\n" +
+ " for (;;argument--, argument--) {\n" +
+ " doSomething(counter);\n" +
+ " }\n" +
+ " }\n" +
"}";
formatSource(source,
- "class Example {\n" +
- " int foo(int argument) {\n" +
- " for (;;\n" +
- " argument--, argument--) {\n" +
- " doSomething(counter);\n" +
- " }\n" +
- " }\n" +
+ "class Example {\n" +
+ " int foo(int argument) {\n" +
+ " for (;;\n" +
+ " argument--, argument--) {\n" +
+ " doSomething(counter);\n" +
+ " }\n" +
+ " }\n" +
"}"
);
}
@@ -13497,12 +13497,12 @@ public void testBug118264e() {
public void testBug118264f() {
this.formatterPrefs.alignment_for_expressions_in_for_loop_header = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE;
String source =
- "class Example {\n" +
- " int foo(int argument) {\n" +
- " for (;;) {\n" +
- " doSomething(counter);\n" +
- " }\n" +
- " }\n" +
+ "class Example {\n" +
+ " int foo(int argument) {\n" +
+ " for (;;) {\n" +
+ " doSomething(counter);\n" +
+ " }\n" +
+ " }\n" +
"}";
formatSource(source);
}
@@ -13512,28 +13512,28 @@ public void testBug118264f() {
public void testBug465910() {
this.formatterPrefs.alignment_for_conditional_expression = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE;
String source =
- "class Example {\n" +
- " Result foo(boolean argument) {\n" +
- " return argument ? doOneThing() : doOtherThing();\n" +
- " }\n" +
+ "class Example {\n" +
+ " Result foo(boolean argument) {\n" +
+ " return argument ? doOneThing() : doOtherThing();\n" +
+ " }\n" +
"}";
formatSource(source,
- "class Example {\n" +
- " Result foo(boolean argument) {\n" +
- " return argument\n" +
- " ? doOneThing()\n" +
- " : doOtherThing();\n" +
- " }\n" +
+ "class Example {\n" +
+ " Result foo(boolean argument) {\n" +
+ " return argument\n" +
+ " ? doOneThing()\n" +
+ " : doOtherThing();\n" +
+ " }\n" +
"}"
);
this.formatterPrefs.wrap_before_conditional_operator = false;
formatSource(source,
- "class Example {\n" +
- " Result foo(boolean argument) {\n" +
- " return argument ?\n" +
- " doOneThing() :\n" +
- " doOtherThing();\n" +
- " }\n" +
+ "class Example {\n" +
+ " Result foo(boolean argument) {\n" +
+ " return argument ?\n" +
+ " doOneThing() :\n" +
+ " doOtherThing();\n" +
+ " }\n" +
"}"
);
}
@@ -13543,35 +13543,35 @@ public void testBug465910() {
public void testBug325631() {
this.formatterPrefs.alignment_for_assignment = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE;
String source =
- "class Example {\n" +
- " String value = \"\";\n" +
- " void foo(boolean argument) {\n" +
- " if (\"test\".equals(value = artument))\n" +
- " doSomething();\n" +
- " }\n" +
+ "class Example {\n" +
+ " String value = \"\";\n" +
+ " void foo(boolean argument) {\n" +
+ " if (\"test\".equals(value = artument))\n" +
+ " doSomething();\n" +
+ " }\n" +
"}";
formatSource(source,
- "class Example {\n" +
- " String value =\n" +
- " \"\";\n" +
- "\n" +
- " void foo(boolean argument) {\n" +
- " if (\"test\".equals(value =\n" +
- " artument))\n" +
- " doSomething();\n" +
- " }\n" +
+ "class Example {\n" +
+ " String value =\n" +
+ " \"\";\n" +
+ "\n" +
+ " void foo(boolean argument) {\n" +
+ " if (\"test\".equals(value =\n" +
+ " artument))\n" +
+ " doSomething();\n" +
+ " }\n" +
"}");
this.formatterPrefs.wrap_before_assignment_operator = true;
formatSource(source,
- "class Example {\n" +
- " String value\n" +
- " = \"\";\n" +
- "\n" +
- " void foo(boolean argument) {\n" +
- " if (\"test\".equals(value\n" +
- " = artument))\n" +
- " doSomething();\n" +
- " }\n" +
+ "class Example {\n" +
+ " String value\n" +
+ " = \"\";\n" +
+ "\n" +
+ " void foo(boolean argument) {\n" +
+ " if (\"test\".equals(value\n" +
+ " = artument))\n" +
+ " doSomething();\n" +
+ " }\n" +
"}"
);
}
@@ -13732,14 +13732,14 @@ public void testBug370540p() throws JavaModelException {
*/
public void testBug370540q() throws JavaModelException {
this.formatterPrefs.parenthesis_positions_in_for_statement = DefaultCodeFormatterConstants.SEPARATE_LINES;
- String source =
- "public class Test {\n" +
- " void foo() {\n" +
- " for (\n" +
- " String s : Arrays.asList(\"aa\")\n" +
- " ) {\n" +
- " }\n" +
- " }\n" +
+ String source =
+ "public class Test {\n" +
+ " void foo() {\n" +
+ " for (\n" +
+ " String s : Arrays.asList(\"aa\")\n" +
+ " ) {\n" +
+ " }\n" +
+ " }\n" +
"}";
formatSource(source);
}
@@ -13748,28 +13748,28 @@ public void testBug370540q() throws JavaModelException {
*/
public void testBug370540r() throws JavaModelException {
this.formatterPrefs.parenthesis_positions_in_method_invocation = DefaultCodeFormatterConstants.SEPARATE_LINES;
- String source =
- "public class Test extends Exception {\n" +
- " Test instance = new Test(\n" +
- " 1\n" +
- " );\n" +
- "\n" +
- " Test(int a) {\n" +
- " this(\n" +
- " a, 0\n" +
- " );\n" +
- " }\n" +
- "\n" +
- " Test(int a, int b) {\n" +
- " super(\n" +
- " a + \"=\" + b\n" +
- " );\n" +
- " }\n" +
- "\n" +
- " public void printStackTrace() {\n" +
- " super.printStackTrace(\n" +
- " );\n" +
- " }\n" +
+ String source =
+ "public class Test extends Exception {\n" +
+ " Test instance = new Test(\n" +
+ " 1\n" +
+ " );\n" +
+ "\n" +
+ " Test(int a) {\n" +
+ " this(\n" +
+ " a, 0\n" +
+ " );\n" +
+ " }\n" +
+ "\n" +
+ " Test(int a, int b) {\n" +
+ " super(\n" +
+ " a + \"=\" + b\n" +
+ " );\n" +
+ " }\n" +
+ "\n" +
+ " public void printStackTrace() {\n" +
+ " super.printStackTrace(\n" +
+ " );\n" +
+ " }\n" +
"}";
formatSource(source);
}
@@ -13778,12 +13778,12 @@ public void testBug370540r() throws JavaModelException {
*/
public void testBug370540s() throws JavaModelException {
this.formatterPrefs.parenthesis_positions_in_method_invocation = DefaultCodeFormatterConstants.SEPARATE_LINES_IF_WRAPPED;
- String source =
- "public class Test extends Exception {\n" +
- " void foo() {\n" +
- " new StringBuilder().append(\"aaaaaaaaa\" + \"bbbbbbbbbbbbbbb\" + \"cccccccccccccc\" + \"dddddddddd\")\n" +
- " .append(\"aaaaaaa\" + \"bbbbbbbbbbbbb\" + \"cccccccccccccc\" + \"ddddddddd\");\n" +
- " }\n" +
+ String source =
+ "public class Test extends Exception {\n" +
+ " void foo() {\n" +
+ " new StringBuilder().append(\"aaaaaaaaa\" + \"bbbbbbbbbbbbbbb\" + \"cccccccccccccc\" + \"dddddddddd\")\n" +
+ " .append(\"aaaaaaa\" + \"bbbbbbbbbbbbb\" + \"cccccccccccccc\" + \"ddddddddd\");\n" +
+ " }\n" +
"}";
formatSource(source);
}
@@ -13853,13 +13853,13 @@ public void testBug384959f() throws JavaModelException {
public void testBug384959g() throws JavaModelException {
setComplianceLevel(CompilerOptions.VERSION_1_8);
this.formatterPrefs.alignment_for_type_parameters = Alignment.M_COMPACT_SPLIT;
- String source =
- "public interface IteratedDescribeLinkList<\n" +
- " T extends IteratedDescribeLinkList<T, E, A, B, C, D, F, G, H, I, X, Y, Z, J, K>, E extends IteratedDescribeLink,\n" +
- " A extends Iterated, B extends Iterated, C extends IteratedList<C, A, F, H, Y, J>,\n" +
- " D extends IteratedList<D, B, G, I, Z, K>, F extends MasteredList<F, H, C, A, J, Y>,\n" +
- " G extends MasteredList<G, I, D, B, K, Z>, H extends Mastered, I extends Mastered, X extends T, Y extends C,\n" +
- " Z extends D, J extends F, K extends G> extends ObjectToObjectLinkList<T, E, A, B, C, D, X, Y, Z> {\n" +
+ String source =
+ "public interface IteratedDescribeLinkList<\n" +
+ " T extends IteratedDescribeLinkList<T, E, A, B, C, D, F, G, H, I, X, Y, Z, J, K>, E extends IteratedDescribeLink,\n" +
+ " A extends Iterated, B extends Iterated, C extends IteratedList<C, A, F, H, Y, J>,\n" +
+ " D extends IteratedList<D, B, G, I, Z, K>, F extends MasteredList<F, H, C, A, J, Y>,\n" +
+ " G extends MasteredList<G, I, D, B, K, Z>, H extends Mastered, I extends Mastered, X extends T, Y extends C,\n" +
+ " Z extends D, J extends F, K extends G> extends ObjectToObjectLinkList<T, E, A, B, C, D, X, Y, Z> {\n" +
"}";
formatSource(source);
}
@@ -13869,20 +13869,20 @@ public void testBug384959g() throws JavaModelException {
public void testBug488642a() {
this.formatterPrefs.use_tabs_only_for_leading_indentations = true;
String source =
- "public class Test {\n" +
- " Object o = new Object() {\n" +
- " int a = 0;\n" +
- " /*\n" +
- " * comment\n" +
- " */\n" +
- " int b = 9; /*\n" +
- " * comment\n" +
- " */\n" +
- " String ssssssss = \"aaaaaaaaaaaaaaaaaaaaaaaa\" //\n" +
- " + \"ddddddddddddddddddddddd\" /*\n" +
- " * comment\n" +
- " */;\n" +
- " };\n" +
+ "public class Test {\n" +
+ " Object o = new Object() {\n" +
+ " int a = 0;\n" +
+ " /*\n" +
+ " * comment\n" +
+ " */\n" +
+ " int b = 9; /*\n" +
+ " * comment\n" +
+ " */\n" +
+ " String ssssssss = \"aaaaaaaaaaaaaaaaaaaaaaaa\" //\n" +
+ " + \"ddddddddddddddddddddddd\" /*\n" +
+ " * comment\n" +
+ " */;\n" +
+ " };\n" +
"}";
formatSource(source);
}
@@ -13893,20 +13893,20 @@ public void testBug488642b() {
this.formatterPrefs.use_tabs_only_for_leading_indentations = true;
this.formatterPrefs.align_type_members_on_columns = true;
String source =
- "public class Test {\n" +
- " Object o = new Object() {\n" +
- " int a = 0;\n" +
- " /*\n" +
- " * comment\n" +
- " */\n" +
- " int b = 9; /*\n" +
- " * comment\n" +
- " */\n" +
- " String ssssssss = \"aaaaaaaaaaaaaaaaaaaaaaaa\" //\n" +
- " + \"ddddddddddddddddddddddd\" /*\n" +
- " * comment\n" +
- " */;\n" +
- " };\n" +
+ "public class Test {\n" +
+ " Object o = new Object() {\n" +
+ " int a = 0;\n" +
+ " /*\n" +
+ " * comment\n" +
+ " */\n" +
+ " int b = 9; /*\n" +
+ " * comment\n" +
+ " */\n" +
+ " String ssssssss = \"aaaaaaaaaaaaaaaaaaaaaaaa\" //\n" +
+ " + \"ddddddddddddddddddddddd\" /*\n" +
+ " * comment\n" +
+ " */;\n" +
+ " };\n" +
"}";
formatSource(source);
}
@@ -14042,14 +14042,14 @@ public void testBug506430c() throws JavaModelException {
*/
public void testBug518235() throws JavaModelException {
String source =
- "public class Base<T> {\n" +
- " class Base2 {\n" +
- " Base2(Base<T> Base.this) {\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " T foo(@Deprecated Base<T> this, final Base<T> bar1, final Base<T> bar2) {\n" +
- " }\n" +
+ "public class Base<T> {\n" +
+ " class Base2 {\n" +
+ " Base2(Base<T> Base.this) {\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " T foo(@Deprecated Base<T> this, final Base<T> bar1, final Base<T> bar2) {\n" +
+ " }\n" +
"}";
formatSource(source);
}
@@ -14556,24 +14556,24 @@ public void testBug541133a() {
this.formatterPrefs.comment_indent_parameter_description = false;
this.formatterPrefs.comment_indent_tag_description = true;
String source =
- "class C {\n" +
- " /**\n" +
- " * @param bar param description should NOT get additional indentation when it's wrapped\n" +
- " * @return return description should get additional indentation when it's wrapped\n" +
- " */\n" +
- " String foo(String bar) {\n" +
- " }\n" +
+ "class C {\n" +
+ " /**\n" +
+ " * @param bar param description should NOT get additional indentation when it's wrapped\n" +
+ " * @return return description should get additional indentation when it's wrapped\n" +
+ " */\n" +
+ " String foo(String bar) {\n" +
+ " }\n" +
"}";
formatSource(source,
- "class C {\n" +
- " /**\n" +
- " * @param bar param description should NOT get additional indentation when it's\n" +
- " * wrapped\n" +
- " * @return return description should get additional indentation when it's\n" +
- " * wrapped\n" +
- " */\n" +
- " String foo(String bar) {\n" +
- " }\n" +
+ "class C {\n" +
+ " /**\n" +
+ " * @param bar param description should NOT get additional indentation when it's\n" +
+ " * wrapped\n" +
+ " * @return return description should get additional indentation when it's\n" +
+ " * wrapped\n" +
+ " */\n" +
+ " String foo(String bar) {\n" +
+ " }\n" +
"}");
}
/**
@@ -14584,21 +14584,21 @@ public void testBug541133b() {
this.formatterPrefs.comment_indent_parameter_description = false;
this.formatterPrefs.comment_indent_tag_description = true;
String source =
- "class C {\n" +
- " /**\n" +
- " * @deprecated Do not use this class, it's only to test formatting on. One two three four five six seven eight nine ten\n" +
- " */\n" +
- " void foo() {\n" +
- " }\n" +
+ "class C {\n" +
+ " /**\n" +
+ " * @deprecated Do not use this class, it's only to test formatting on. One two three four five six seven eight nine ten\n" +
+ " */\n" +
+ " void foo() {\n" +
+ " }\n" +
"}";
formatSource(source,
- "class C {\n" +
- " /**\n" +
- " * @deprecated Do not use this class, it's only to test formatting on. One two\n" +
- " * three four five six seven eight nine ten\n" +
- " */\n" +
- " void foo() {\n" +
- " }\n" +
+ "class C {\n" +
+ " /**\n" +
+ " * @deprecated Do not use this class, it's only to test formatting on. One two\n" +
+ " * three four five six seven eight nine ten\n" +
+ " */\n" +
+ " void foo() {\n" +
+ " }\n" +
"}");
}
/**
@@ -14607,20 +14607,20 @@ public void testBug541133b() {
public void testBug541133c() {
this.formatterPrefs.comment_indent_tag_description = true;
String source =
- "/**\n" +
- " * Mensagens SMTP tem o seguinte formato:\n" +
- " * \n" +
- " * <pre>\n" +
- " * resposta de uma linha só:\n" +
- " * </pre>\n" +
- " * \n" +
+ "/**\n" +
+ " * Mensagens SMTP tem o seguinte formato:\n" +
+ " * \n" +
+ " * <pre>\n" +
+ " * resposta de uma linha só:\n" +
+ " * </pre>\n" +
+ " * \n" +
" * {@link java.lang.String </code>a simple string<code>}.\n" +
- " * \n" +
- " * @deprecated Mensagens SMTP tem o seguinte formato:\n" +
- " * \n" +
- " * <pre>\n" +
- " * resposta de uma linha só:\n" +
- " * </pre>\n" +
+ " * \n" +
+ " * @deprecated Mensagens SMTP tem o seguinte formato:\n" +
+ " * \n" +
+ " * <pre>\n" +
+ " * resposta de uma linha só:\n" +
+ " * </pre>\n" +
" */";
formatSource(source);
}
@@ -14629,25 +14629,25 @@ public void testBug541133c() {
*/
public void testBug541133d() {
String source =
- "/**\n" +
- " * @return something <pre>\n" +
- " * class Runnable {\n" +
- " * // Hello really bad Ganymede formatter !!!\n" +
- " * // Shit happens when somebody tries to change a running system\n" +
- " * }</pre> something\n" +
+ "/**\n" +
+ " * @return something <pre>\n" +
+ " * class Runnable {\n" +
+ " * // Hello really bad Ganymede formatter !!!\n" +
+ " * // Shit happens when somebody tries to change a running system\n" +
+ " * }</pre> something\n" +
" */";
formatSource(source,
- "/**\n" +
- " * @return something\n" +
- " * \n" +
- " * <pre>\n" +
- " * class Runnable {\n" +
- " * // Hello really bad Ganymede formatter !!!\n" +
- " * // Shit happens when somebody tries to change a running system\n" +
- " * }\n" +
- " * </pre>\n" +
- " * \n" +
- " * something\n" +
+ "/**\n" +
+ " * @return something\n" +
+ " * \n" +
+ " * <pre>\n" +
+ " * class Runnable {\n" +
+ " * // Hello really bad Ganymede formatter !!!\n" +
+ " * // Shit happens when somebody tries to change a running system\n" +
+ " * }\n" +
+ " * </pre>\n" +
+ " * \n" +
+ " * something\n" +
" */");
}
@@ -14722,7 +14722,7 @@ public void testBug543079g() throws JavaModelException {
formatSource(input, getCompilationUnit("Formatter", "", "test543079", "G_out.java").getSource());
}
/**
- * https://bugs.eclipse.org/159565 - [formatter] Separate white space preferences for separate operators
+ * https://bugs.eclipse.org/159565 - [formatter] Separate white space preferences for separate operators
*/
public void testBug159565a() throws JavaModelException {
this.formatterPrefs.insert_space_before_multiplicative_operator = false;
@@ -14731,7 +14731,7 @@ public void testBug159565a() throws JavaModelException {
formatSource(input, getCompilationUnit("Formatter", "", "test159565", "A_out.java").getSource());
}
/**
- * https://bugs.eclipse.org/159565 - [formatter] Separate white space preferences for separate operators
+ * https://bugs.eclipse.org/159565 - [formatter] Separate white space preferences for separate operators
*/
public void testBug159565b() throws JavaModelException {
this.formatterPrefs.insert_space_after_multiplicative_operator = false;
@@ -14740,7 +14740,7 @@ public void testBug159565b() throws JavaModelException {
formatSource(input, getCompilationUnit("Formatter", "", "test159565", "B_out.java").getSource());
}
/**
- * https://bugs.eclipse.org/159565 - [formatter] Separate white space preferences for separate operators
+ * https://bugs.eclipse.org/159565 - [formatter] Separate white space preferences for separate operators
*/
public void testBug159565c() throws JavaModelException {
this.formatterPrefs.insert_space_before_additive_operator = false;
@@ -14749,7 +14749,7 @@ public void testBug159565c() throws JavaModelException {
formatSource(input, getCompilationUnit("Formatter", "", "test159565", "C_out.java").getSource());
}
/**
- * https://bugs.eclipse.org/159565 - [formatter] Separate white space preferences for separate operators
+ * https://bugs.eclipse.org/159565 - [formatter] Separate white space preferences for separate operators
*/
public void testBug159565d() throws JavaModelException {
this.formatterPrefs.insert_space_before_string_concatenation = false;
@@ -14758,7 +14758,7 @@ public void testBug159565d() throws JavaModelException {
formatSource(input, getCompilationUnit("Formatter", "", "test159565", "D_out.java").getSource());
}
/**
- * https://bugs.eclipse.org/159565 - [formatter] Separate white space preferences for separate operators
+ * https://bugs.eclipse.org/159565 - [formatter] Separate white space preferences for separate operators
*/
public void testBug159565e() throws JavaModelException {
this.formatterPrefs.insert_space_after_string_concatenation = false;
@@ -14767,7 +14767,7 @@ public void testBug159565e() throws JavaModelException {
formatSource(input, getCompilationUnit("Formatter", "", "test159565", "E_out.java").getSource());
}
/**
- * https://bugs.eclipse.org/159565 - [formatter] Separate white space preferences for separate operators
+ * https://bugs.eclipse.org/159565 - [formatter] Separate white space preferences for separate operators
*/
public void testBug159565f() throws JavaModelException {
this.formatterPrefs.insert_space_after_shift_operator = false;
@@ -14776,7 +14776,7 @@ public void testBug159565f() throws JavaModelException {
formatSource(input, getCompilationUnit("Formatter", "", "test159565", "F_out.java").getSource());
}
/**
- * https://bugs.eclipse.org/159565 - [formatter] Separate white space preferences for separate operators
+ * https://bugs.eclipse.org/159565 - [formatter] Separate white space preferences for separate operators
*/
public void testBug159565g() throws JavaModelException {
this.formatterPrefs.insert_space_before_relational_operator = false;
@@ -15058,13 +15058,13 @@ public void testBug169131c() throws JavaModelException {
setComplianceLevel(CompilerOptions.VERSION_9);
this.formatterPrefs.blank_lines_after_last_class_body_declaration = 1;
String input =
- "module aaaaaaaaaa.bbbbbbbbbb {\n" +
- " requires aaaaaaaaaa.cccccccccc; // a comment\n" +
+ "module aaaaaaaaaa.bbbbbbbbbb {\n" +
+ " requires aaaaaaaaaa.cccccccccc; // a comment\n" +
"}";
formatSource(input,
- "module aaaaaaaaaa.bbbbbbbbbb {\n" +
- " requires aaaaaaaaaa.cccccccccc; // a comment\n" +
- "\n" +
+ "module aaaaaaaaaa.bbbbbbbbbb {\n" +
+ " requires aaaaaaaaaa.cccccccccc; // a comment\n" +
+ "\n" +
"}",
CodeFormatter.K_MODULE_INFO | CodeFormatter.F_INCLUDE_COMMENTS);
}
@@ -15075,13 +15075,13 @@ public void testBug169131d() throws JavaModelException {
setComplianceLevel(CompilerOptions.VERSION_9);
this.formatterPrefs.blank_lines_after_last_class_body_declaration = ~0;
String input =
- "module aaaaaaaaaa.bbbbbbbbbb {\n" +
- " requires aaaaaaaaaa.cccccccccc;\n" +
- "\n" +
+ "module aaaaaaaaaa.bbbbbbbbbb {\n" +
+ " requires aaaaaaaaaa.cccccccccc;\n" +
+ "\n" +
"}";
formatSource(input,
- "module aaaaaaaaaa.bbbbbbbbbb {\n" +
- " requires aaaaaaaaaa.cccccccccc;\n" +
+ "module aaaaaaaaaa.bbbbbbbbbb {\n" +
+ " requires aaaaaaaaaa.cccccccccc;\n" +
"}",
CodeFormatter.K_MODULE_INFO | CodeFormatter.F_INCLUDE_COMMENTS);
}
@@ -15115,26 +15115,26 @@ public void testBug549774() throws JavaModelException {
this.formatterPrefs.blank_lines_before_field = 2;
this.formatterPrefs.blank_lines_before_method = 3;
String input =
- "class C {\n" +
- " int a;\n" +
- " String s;\n" +
- " void foo() {}\n" +
- " String bar(int a) {}\n" +
+ "class C {\n" +
+ " int a;\n" +
+ " String s;\n" +
+ " void foo() {}\n" +
+ " String bar(int a) {}\n" +
"}";
formatSource(input,
- "class C {\n" +
- " int a;\n" +
- "\n" +
- "\n" +
- " String s;\n" +
- "\n" +
- " void foo() {\n" +
- " }\n" +
- "\n" +
- "\n" +
- "\n" +
- " String bar(int a) {\n" +
- " }\n" +
+ "class C {\n" +
+ " int a;\n" +
+ "\n" +
+ "\n" +
+ " String s;\n" +
+ "\n" +
+ " void foo() {\n" +
+ " }\n" +
+ "\n" +
+ "\n" +
+ "\n" +
+ " String bar(int a) {\n" +
+ " }\n" +
"}");
}
/**
@@ -15393,49 +15393,49 @@ public void testBug549436k() throws JavaModelException {
public void testBug54627a() throws JavaModelException {
this.formatterPrefs.comment_insert_empty_line_between_different_tags = true;
String input =
- "public class Test {\n" +
- " /**\n" +
- " * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.\n" +
- " * @param a Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n" +
- " * @param b Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n" +
- " * @param c Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n" +
- " * @throws IOException Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium.\n" +
- " * @throws SQLException Totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.\n" +
- " * @return Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.\n" +
- " */\n" +
- " public String f(int a, int b, int c) throws IOException, SQLException {\n" +
- " return \"\";\n" +
- " }\n" +
+ "public class Test {\n" +
+ " /**\n" +
+ " * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.\n" +
+ " * @param a Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n" +
+ " * @param b Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n" +
+ " * @param c Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n" +
+ " * @throws IOException Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium.\n" +
+ " * @throws SQLException Totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.\n" +
+ " * @return Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.\n" +
+ " */\n" +
+ " public String f(int a, int b, int c) throws IOException, SQLException {\n" +
+ " return \"\";\n" +
+ " }\n" +
"}";
formatSource(input,
- "public class Test {\n" +
- " /**\n" +
- " * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod\n" +
- " * tempor incididunt ut labore et dolore magna aliqua. Neque porro quisquam est,\n" +
- " * qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia\n" +
- " * non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam\n" +
- " * quaerat voluptatem.\n" +
- " * \n" +
- " * @param a Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris\n" +
- " * nisi ut aliquip ex ea commodo consequat.\n" +
- " * @param b Duis aute irure dolor in reprehenderit in voluptate velit esse\n" +
- " * cillum dolore eu fugiat nulla pariatur.\n" +
- " * @param c Excepteur sint occaecat cupidatat non proident, sunt in culpa qui\n" +
- " * officia deserunt mollit anim id est laborum.\n" +
- " * \n" +
- " * @throws IOException Sed ut perspiciatis unde omnis iste natus error sit\n" +
- " * voluptatem accusantium doloremque laudantium.\n" +
- " * @throws SQLException Totam rem aperiam, eaque ipsa quae ab illo inventore\n" +
- " * veritatis et quasi architecto beatae vitae dicta sunt\n" +
- " * explicabo.\n" +
- " * \n" +
- " * @return Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut\n" +
- " * fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem\n" +
- " * sequi nesciunt.\n" +
- " */\n" +
- " public String f(int a, int b, int c) throws IOException, SQLException {\n" +
- " return \"\";\n" +
- " }\n" +
+ "public class Test {\n" +
+ " /**\n" +
+ " * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod\n" +
+ " * tempor incididunt ut labore et dolore magna aliqua. Neque porro quisquam est,\n" +
+ " * qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia\n" +
+ " * non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam\n" +
+ " * quaerat voluptatem.\n" +
+ " * \n" +
+ " * @param a Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris\n" +
+ " * nisi ut aliquip ex ea commodo consequat.\n" +
+ " * @param b Duis aute irure dolor in reprehenderit in voluptate velit esse\n" +
+ " * cillum dolore eu fugiat nulla pariatur.\n" +
+ " * @param c Excepteur sint occaecat cupidatat non proident, sunt in culpa qui\n" +
+ " * officia deserunt mollit anim id est laborum.\n" +
+ " * \n" +
+ " * @throws IOException Sed ut perspiciatis unde omnis iste natus error sit\n" +
+ " * voluptatem accusantium doloremque laudantium.\n" +
+ " * @throws SQLException Totam rem aperiam, eaque ipsa quae ab illo inventore\n" +
+ " * veritatis et quasi architecto beatae vitae dicta sunt\n" +
+ " * explicabo.\n" +
+ " * \n" +
+ " * @return Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut\n" +
+ " * fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem\n" +
+ " * sequi nesciunt.\n" +
+ " */\n" +
+ " public String f(int a, int b, int c) throws IOException, SQLException {\n" +
+ " return \"\";\n" +
+ " }\n" +
"}");
}
/**
@@ -15444,58 +15444,58 @@ public void testBug54627a() throws JavaModelException {
public void testBug54627b() throws JavaModelException {
this.formatterPrefs.comment_insert_empty_line_between_different_tags = true;
String input =
- "public class Test {\n" +
- " \n" +
- " /**\n" +
- " * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.\n" +
- " * @param a Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n" +
- " * @param b Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n" +
- " * @return Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.\n" +
- " * @@org.example.transaction.interceptor.RuleBasedTransactionAttribute()\n" +
- " * @@org.example.transaction.interceptor.RollbackRuleAttribute(Exception.class)\n" +
- " * @@org.example.transaction.interceptor.NoRollbackRuleAttribute(\"ServletException\")\n" +
- " */\n" +
- " public String f(int a, int b, int c) {\n" +
- " return \"\";\n" +
- " }\n" +
+ "public class Test {\n" +
+ " \n" +
+ " /**\n" +
+ " * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.\n" +
+ " * @param a Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n" +
+ " * @param b Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n" +
+ " * @return Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.\n" +
+ " * @@org.example.transaction.interceptor.RuleBasedTransactionAttribute()\n" +
+ " * @@org.example.transaction.interceptor.RollbackRuleAttribute(Exception.class)\n" +
+ " * @@org.example.transaction.interceptor.NoRollbackRuleAttribute(\"ServletException\")\n" +
+ " */\n" +
+ " public String f(int a, int b, int c) {\n" +
+ " return \"\";\n" +
+ " }\n" +
"}";
formatSource(input,
- "public class Test {\n" +
- "\n" +
- " /**\n" +
- " * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod\n" +
- " * tempor incididunt ut labore et dolore magna aliqua. Neque porro quisquam est,\n" +
- " * qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia\n" +
- " * non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam\n" +
- " * quaerat voluptatem.\n" +
- " * \n" +
- " * @param a Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris\n" +
- " * nisi ut aliquip ex ea commodo consequat.\n" +
- " * @param b Duis aute irure dolor in reprehenderit in voluptate velit esse\n" +
- " * cillum dolore eu fugiat nulla pariatur.\n" +
- " * \n" +
- " * @return Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut\n" +
- " * fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem\n" +
- " * sequi nesciunt.\n" +
- " * \n" +
- " * @@org.example.transaction.interceptor.RuleBasedTransactionAttribute()\n" +
- " * @@org.example.transaction.interceptor.RollbackRuleAttribute(Exception.class)\n" +
- " * @@org.example.transaction.interceptor.NoRollbackRuleAttribute(\"ServletException\")\n" +
- " */\n" +
- " public String f(int a, int b, int c) {\n" +
- " return \"\";\n" +
- " }\n" +
+ "public class Test {\n" +
+ "\n" +
+ " /**\n" +
+ " * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod\n" +
+ " * tempor incididunt ut labore et dolore magna aliqua. Neque porro quisquam est,\n" +
+ " * qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia\n" +
+ " * non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam\n" +
+ " * quaerat voluptatem.\n" +
+ " * \n" +
+ " * @param a Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris\n" +
+ " * nisi ut aliquip ex ea commodo consequat.\n" +
+ " * @param b Duis aute irure dolor in reprehenderit in voluptate velit esse\n" +
+ " * cillum dolore eu fugiat nulla pariatur.\n" +
+ " * \n" +
+ " * @return Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut\n" +
+ " * fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem\n" +
+ " * sequi nesciunt.\n" +
+ " * \n" +
+ " * @@org.example.transaction.interceptor.RuleBasedTransactionAttribute()\n" +
+ " * @@org.example.transaction.interceptor.RollbackRuleAttribute(Exception.class)\n" +
+ " * @@org.example.transaction.interceptor.NoRollbackRuleAttribute(\"ServletException\")\n" +
+ " */\n" +
+ " public String f(int a, int b, int c) {\n" +
+ " return \"\";\n" +
+ " }\n" +
"}");
}
/**
- * https://bugs.eclipse.org/547261 - [formatter] Separate option for space after not (!) operator
+ * https://bugs.eclipse.org/547261 - [formatter] Separate option for space after not (!) operator
*/
public void testBug547261() throws JavaModelException {
this.formatterPrefs.insert_space_after_not_operator = true;
String input = "class C {boolean b=!a&&!(c||d)&&(f!=-5);}";
formatSource(input,
- "class C {\n" +
- " boolean b = ! a && ! (c || d) && (f != -5);\n" +
+ "class C {\n" +
+ " boolean b = ! a && ! (c || d) && (f != -5);\n" +
"}");
}
/**
@@ -15617,8 +15617,8 @@ public void testBug553155o() throws JavaModelException {
this.formatterPrefs.keep_record_constructor_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
String source = "record Range(int lo, int hi) {public Range {foo();}}";
formatSource(source,
- "record Range(int lo, int hi) {\n" +
- " public Range { foo(); }\n" +
+ "record Range(int lo, int hi) {\n" +
+ " public Range { foo(); }\n" +
"}");
}
/**
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/RunFormatterMassiveTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/RunFormatterMassiveTests.java
index 9791acd25..f1c6791f6 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/RunFormatterMassiveTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/RunFormatterMassiveTests.java
@@ -79,7 +79,7 @@ public static Test suite() {
private static void addClass(TestSuite ts, File inputDir, String profile, Map workspaces) {
Class testClass = FormatterMassiveRegressionTests.class;
-
+
// call the suite() method and add the resulting suite to the suite
try {
Method suiteMethod = testClass.getDeclaredMethod("suite", new Class[] { File.class, String.class, Map.class }); //$NON-NLS-1$
@@ -92,7 +92,7 @@ private static void addClass(TestSuite ts, File inputDir, String profile, Map wo
} catch (NoSuchMethodException e) {
e.printStackTrace();
}
-
+
}
public RunFormatterMassiveTests(String name) {
super(name);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java
index 7bf00c189..aeefbb44d 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java
@@ -152,13 +152,13 @@ public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
* @deprecated
*/
protected static final int AST_INTERNAL_JLS12 = AST.JLS12;
-
+
/**
* Internal synonym for constant AST.JSL13
* to alleviate deprecation warnings once AST.JLS13 is deprecated in future.
*/
protected static final int AST_INTERNAL_JLS13 = AST.JLS13;
-
+
/**
* Internal synonym for constant AST.JSL14
* to alleviate deprecation warnings once AST.JLS14 is deprecated in future.
@@ -174,7 +174,7 @@ public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
/**
* Internal synonym for the latest AST level.
- *
+ *
*/
protected static final int AST_INTERNAL_LATEST = AST.JLS14;
@@ -233,7 +233,7 @@ public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
private int eventType;
private ByteArrayOutputStream stackTraces;
-
+
private boolean gotResourceDelta;
public DeltaListener() {
@@ -251,7 +251,7 @@ public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
System.arraycopy(this.deltas, 0, copy, 0, this.deltas.length);
copy[this.deltas.length]= event.getDelta();
this.deltas= copy;
-
+
new Throwable("Caller of IElementChangedListener#elementChanged").printStackTrace(new PrintStream(this.stackTraces));
}
}
@@ -268,14 +268,14 @@ public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
return delta.getCompilationUnitAST();
return null;
}
-
+
/**
* Returns the last delta for the given element from the cached delta.
*/
public IJavaElementDelta getDeltaFor(IJavaElement element) {
return getDeltaFor(element, false);
}
-
+
/**
* Returns the delta for the given element from the cached delta.
* If the boolean is true returns the first delta found.
@@ -294,7 +294,7 @@ public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
}
return result;
}
-
+
public synchronized IJavaElementDelta getLastDelta() {
return this.deltas[this.deltas.length - 1];
}
@@ -624,7 +624,7 @@ public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
static IClasspathAttribute[] externalAnnotationExtraAttributes(String path) {
return new IClasspathAttribute[] {
- new ClasspathAttribute(IClasspathAttribute.EXTERNAL_ANNOTATION_PATH, path)
+ new ClasspathAttribute(IClasspathAttribute.EXTERNAL_ANNOTATION_PATH, path)
};
}
@@ -1175,7 +1175,7 @@ public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
if (!actual.equals(expected)) {
System.out.print(displayString(actual, 2));
}
- assertEquals(expected, actual);
+ assertEquals(expected, actual);
}
/**
* Ensures the element is present after creation.
@@ -1253,7 +1253,7 @@ public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
StringBuilder buf = new StringBuilder();
String[] lines = text.split("\n");
int idx = 0;
-
+
// prefix before first module:
while (idx < lines.length) {
String line = lines[idx];
@@ -1499,7 +1499,7 @@ public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
protected void createJar(String[] javaPathsAndContents, String jarPath) throws IOException {
org.eclipse.jdt.core.tests.util.Util.createJar(javaPathsAndContents, jarPath, "1.4");
}
-
+
protected void createJar(String[] javaPathsAndContents, String jarPath, Map options) throws IOException {
org.eclipse.jdt.core.tests.util.Util.createJar(javaPathsAndContents, null, jarPath, null, "1.4", options);
}
@@ -1820,22 +1820,22 @@ public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
final String compliance,
final boolean simulateImport) throws CoreException {
return createJavaProject(
- projectName,
- sourceFolders,
- libraries,
- librariesInclusionPatterns,
- librariesExclusionPatterns,
- projects,
- projectsInclusionPatterns,
- projectsExclusionPatterns,
- combineAccessRestrictions,
- exportedProjects,
- projectOutput,
- sourceOutputs,
- inclusionPatterns,
- exclusionPatterns,
- compliance,
- false,
+ projectName,
+ sourceFolders,
+ libraries,
+ librariesInclusionPatterns,
+ librariesExclusionPatterns,
+ projects,
+ projectsInclusionPatterns,
+ projectsExclusionPatterns,
+ combineAccessRestrictions,
+ exportedProjects,
+ projectOutput,
+ sourceOutputs,
+ inclusionPatterns,
+ exclusionPatterns,
+ compliance,
+ false,
simulateImport);
}
protected IJavaProject createJavaProject(
@@ -1972,7 +1972,7 @@ public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
if (lib.indexOf(File.separatorChar) == -1 && lib.charAt(0) != '/' && lib.equals(lib.toUpperCase())) { // all upper case is a var
char[][] vars = CharOperation.splitOn(',', lib.toCharArray());
IClasspathAttribute[] extraAttributes = ClasspathEntry.NO_EXTRA_ATTRIBUTES;
- if (CompilerOptions.versionToJdkLevel(compliance) >= ClassFileConstants.JDK9
+ if (CompilerOptions.versionToJdkLevel(compliance) >= ClassFileConstants.JDK9
&& (lib.startsWith("JCL") || lib.startsWith("CONVERTER_JCL"))) {
extraAttributes = new IClasspathAttribute[] {
JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true")
@@ -3330,7 +3330,7 @@ public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
new String[] {"JCL18_FULL", "JCL18_SRC", "JCL_SRCROOT"},
new IPath[] {new Path(getExternalJCLPathString("1.8", true)), getExternalJCLSourcePath("1.8"), getExternalJCLRootSourcePath()},
null);
- }
+ }
} else if (JavaCore.getClasspathVariable("JCL18_LIB") == null) {
setupExternalJCL("jclMin1.8");
JavaCore.setClasspathVariables(
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaSearchTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaSearchTests.java
index 877a5505f..07b673fd9 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaSearchTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaSearchTests.java
@@ -74,7 +74,7 @@ public class AbstractJavaSearchTests extends ModifyingResourceTests implements I
public static class ConstructorDeclarationsCollector implements IRestrictedAccessConstructorRequestor {
Vector results = new Vector();
-
+
public void acceptConstructor(
int modifiers,
char[] simpleTypeName,
@@ -88,9 +88,9 @@ public class AbstractJavaSearchTests extends ModifyingResourceTests implements I
String path,
AccessRestriction access) {
StringBuffer buffer = new StringBuffer();
-
+
boolean isMemberType = (extraFlags & ExtraFlags.IsMemberType) != 0;
-
+
buffer.append(packageName == null ? CharOperation.NO_CHAR : packageName);
if (isMemberType) {
buffer.append('.');
@@ -103,12 +103,12 @@ public class AbstractJavaSearchTests extends ModifyingResourceTests implements I
buffer.append('#');
buffer.append(simpleTypeName);
buffer.append('(');
-
+
parameterTypes = signature == null ? parameterTypes : Signature.getParameterTypes(signature);
-
+
for (int i = 0; i < parameterCount; i++) {
if (i != 0) buffer.append(',');
-
+
if (parameterTypes != null) {
char[] parameterType;
if (signature != null) {
@@ -131,14 +131,14 @@ public class AbstractJavaSearchTests extends ModifyingResourceTests implements I
}
}
buffer.append(')');
-
+
if (parameterCount < 0) {
buffer.append('*');
}
-
+
this.results.addElement(buffer.toString());
}
-
+
public String toString(){
int length = this.results.size();
String[] strings = new String[length];
@@ -157,7 +157,7 @@ public class AbstractJavaSearchTests extends ModifyingResourceTests implements I
return this.results.size();
}
}
-
+
static void checkAndAddtoBuffer(StringBuffer buffer, char[] precond, char c) {
if (precond == null || precond.length == 0) return;
buffer.append(precond);
@@ -168,17 +168,17 @@ public class AbstractJavaSearchTests extends ModifyingResourceTests implements I
@Override
public void acceptMethod(
- char[] methodName,
- int parameterCount,
+ char[] methodName,
+ int parameterCount,
char[] declaringQualifier,
- char[] simpleTypeName,
- int typeModifiers,
- char[] packageName,
- char[] signature,
+ char[] simpleTypeName,
+ int typeModifiers,
+ char[] packageName,
+ char[] signature,
char[][] parameterTypes,
- char[][] parameterNames,
- char[] returnType,
- int modifiers,
+ char[][] parameterNames,
+ char[] returnType,
+ int modifiers,
String path,
AccessRestriction access,
int methodIndex) {
@@ -229,12 +229,12 @@ public class AbstractJavaSearchTests extends ModifyingResourceTests implements I
private char[] getTypeErasure(char[] typeName) {
int index;
if ((index = CharOperation.indexOf('<', typeName)) == -1) return typeName;
-
+
int length = typeName.length;
char[] typeErasurename = new char[length - 2];
-
+
System.arraycopy(typeName, 0, typeErasurename, 0, index);
-
+
int depth = 1;
for (int i = index + 1; i < length; i++) {
switch (typeName[i]) {
@@ -251,7 +251,7 @@ public class AbstractJavaSearchTests extends ModifyingResourceTests implements I
break;
}
}
-
+
System.arraycopy(typeErasurename, 0, typeErasurename = new char[index], 0, index);
return typeErasurename;
}
@@ -670,7 +670,7 @@ public class AbstractJavaSearchTests extends ModifyingResourceTests implements I
if (isLocal && !(type instanceof LambdaExpression)) { // don't want occurrence counts for lambdas. it can be confusing at best, as not all are built.
this.line.append("#");
this.line.append(((SourceRefElement)type).occurrenceCount);
- }
+ }
}
protected IJavaElement getElement(SearchMatch searchMatch) {
return (IJavaElement) searchMatch.getElement();
@@ -787,7 +787,7 @@ public class AbstractJavaSearchTests extends ModifyingResourceTests implements I
parameterNames = new String[] {Util.EMPTY_STRING};
}
int nParameterNames = parameterNames.length;
-
+
StringBuffer buf = new StringBuffer();
buf.append(path);
buf.append(' ');
@@ -1088,10 +1088,10 @@ protected JavaSearchResultCollector resultCollector;
}
protected void searchAllMethodNames(String pattern, int matchRule, IRestrictedAccessMethodRequestor requestor) throws JavaModelException {
new BasicSearchEngine(this.workingCopies).searchAllMethodNames(
- null, SearchPattern.R_EXACT_MATCH,
- null, SearchPattern.R_EXACT_MATCH,
- null, SearchPattern.R_EXACT_MATCH,
- pattern.toCharArray(), matchRule,
+ null, SearchPattern.R_EXACT_MATCH,
+ null, SearchPattern.R_EXACT_MATCH,
+ null, SearchPattern.R_EXACT_MATCH,
+ pattern.toCharArray(), matchRule,
getJavaSearchScope(),
requestor,
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
@@ -1099,34 +1099,34 @@ protected JavaSearchResultCollector resultCollector;
}
protected void searchAllMethodNames(String pattern, int matchRule, IJavaSearchScope scope, IRestrictedAccessMethodRequestor requestor) throws JavaModelException {
searchAllMethodNames(
- null, SearchPattern.R_EXACT_MATCH,
- pattern, matchRule,
+ null, SearchPattern.R_EXACT_MATCH,
+ pattern, matchRule,
scope,
requestor);
}
protected void searchAllMethodNames(
String declSimpleNamePattern, int declSimpleNameMatchRule,
- String patternMethod, int methodMatchRule,
- IJavaSearchScope scope,
+ String patternMethod, int methodMatchRule,
+ IJavaSearchScope scope,
IRestrictedAccessMethodRequestor requestor) throws JavaModelException {
searchAllMethodNames(
- null, SearchPattern.R_EXACT_MATCH,
- declSimpleNamePattern, declSimpleNameMatchRule,
- patternMethod, methodMatchRule,
+ null, SearchPattern.R_EXACT_MATCH,
+ declSimpleNamePattern, declSimpleNameMatchRule,
+ patternMethod, methodMatchRule,
scope,
requestor);
}
protected void searchAllMethodNames(
String declQualificationPattern, int declQualificationMatchRule,
String declSimpleNamePattern, int declSimpleNameMatchRule,
- String patternMethod, int methodMatchRule,
- IJavaSearchScope scope,
+ String patternMethod, int methodMatchRule,
+ IJavaSearchScope scope,
IRestrictedAccessMethodRequestor requestor) throws JavaModelException {
searchAllMethodNames(
- null, SearchPattern.R_EXACT_MATCH,
- declQualificationPattern, declQualificationMatchRule,
- declSimpleNamePattern, declSimpleNameMatchRule,
- patternMethod, methodMatchRule,
+ null, SearchPattern.R_EXACT_MATCH,
+ declQualificationPattern, declQualificationMatchRule,
+ declSimpleNamePattern, declSimpleNameMatchRule,
+ patternMethod, methodMatchRule,
scope,
requestor);
}
@@ -1134,14 +1134,14 @@ protected JavaSearchResultCollector resultCollector;
String patternPackage, int pkgMatchRule,
String declQualificationPattern, int declQualificationMatchRule,
String declSimpleNamePattern, int declSimpleNameMatchRule,
- String patternMethod, int methodMatchRule,
- IJavaSearchScope scope,
+ String patternMethod, int methodMatchRule,
+ IJavaSearchScope scope,
IRestrictedAccessMethodRequestor requestor) throws JavaModelException {
new BasicSearchEngine(this.workingCopies).searchAllMethodNames(
- patternPackage == null ? null : patternPackage.toCharArray(), pkgMatchRule,
- declQualificationPattern == null ? null : declQualificationPattern.toCharArray(), declQualificationMatchRule,
- declSimpleNamePattern == null ? null : declSimpleNamePattern.toCharArray(), declSimpleNameMatchRule,
- patternMethod == null ? null : patternMethod.toCharArray(), methodMatchRule,
+ patternPackage == null ? null : patternPackage.toCharArray(), pkgMatchRule,
+ declQualificationPattern == null ? null : declQualificationPattern.toCharArray(), declQualificationMatchRule,
+ declSimpleNamePattern == null ? null : declSimpleNamePattern.toCharArray(), declSimpleNameMatchRule,
+ patternMethod == null ? null : patternMethod.toCharArray(), methodMatchRule,
scope,
requestor,
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
@@ -1161,17 +1161,17 @@ protected JavaSearchResultCollector resultCollector;
final MethodNameMatchRequestor nameRequestor) {
try {
new SearchEngine(this.workingCopies).searchAllMethodNames(
- packageName != null ? packageName.toCharArray() : null, pkgMatchRule,
- declaringQualification != null ? declaringQualification.toCharArray() : null, declQualificationMatchRule,
- declaringSimpleName != null ? declaringSimpleName.toCharArray() : null, declSimpleNameMatchRule,
- methodName != null ? methodName.toCharArray() : null, methodMatchRule,
- scope, nameRequestor,
- IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
+ packageName != null ? packageName.toCharArray() : null, pkgMatchRule,
+ declaringQualification != null ? declaringQualification.toCharArray() : null, declQualificationMatchRule,
+ declaringSimpleName != null ? declaringSimpleName.toCharArray() : null, declSimpleNameMatchRule,
+ methodName != null ? methodName.toCharArray() : null, methodMatchRule,
+ scope, nameRequestor,
+ IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
null);
} catch (JavaModelException e) {
e.printStackTrace();
}
-
+
}
public void searchAllMethodNames(
@@ -1183,15 +1183,15 @@ protected JavaSearchResultCollector resultCollector;
final MethodNameMatchRequestor nameRequestor) {
try {
new SearchEngine(this.workingCopies).searchAllMethodNames(
- qualifier != null ? qualifier.toCharArray() : null, qualifierMatchRule,
- methodName != null ? methodName.toCharArray() : null, methodMatchRule,
- scope, nameRequestor,
- IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
+ qualifier != null ? qualifier.toCharArray() : null, qualifierMatchRule,
+ methodName != null ? methodName.toCharArray() : null, methodMatchRule,
+ scope, nameRequestor,
+ IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
null);
} catch (JavaModelException e) {
e.printStackTrace();
}
-
+
}
protected void searchAllTypeNames(String pattern, int matchRule, TypeNameRequestor requestor) throws JavaModelException {
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AccessRestrictionsTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AccessRestrictionsTests.java
index ec59a8e6f..fd297d78f 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AccessRestrictionsTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AccessRestrictionsTests.java
@@ -145,11 +145,11 @@ public void test001() throws CoreException {
);
assertProblems(
"Unexpected problems value",
- "----------\n" +
- "1. ERROR in /P2/src/p/Z.java (at line 2)\n" +
- " public class Z extends X1 {\n" +
- " ^^\n" +
- "Access restriction: The type \'X1\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "1. ERROR in /P2/src/p/Z.java (at line 2)\n" +
+ " public class Z extends X1 {\n" +
+ " ^^\n" +
+ "Access restriction: The type \'X1\' is not API (restriction on required project \'P1\')\n" +
"----------\n"
);
// check the specifics of this test case
@@ -168,11 +168,11 @@ public void test001() throws CoreException {
);
assertProblems(
"Unexpected problems value",
- "----------\n" +
- "1. ERROR in /P2/src/p/Y.java (at line 4)\n" +
- " foo(); // accesses X1.foo, should trigger an error\n" +
- " ^^^\n" +
- "Access restriction: The method \'X1.foo()\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "1. ERROR in /P2/src/p/Y.java (at line 4)\n" +
+ " foo(); // accesses X1.foo, should trigger an error\n" +
+ " ^^^\n" +
+ "Access restriction: The method \'X1.foo()\' is not API (restriction on required project \'P1\')\n" +
"----------\n"
);
} finally {
@@ -250,11 +250,11 @@ public void test002() throws CoreException {
);
assertProblems(
"Unexpected problems value",
- "----------\n" +
- "1. ERROR in /P2/src/p/Y.java (at line 4)\n" +
- " int l1 = m1; // accesses X1.m1, should trigger an error\n" +
- " ^^\n" +
- "Access restriction: The field \'X1.m1\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "1. ERROR in /P2/src/p/Y.java (at line 4)\n" +
+ " int l1 = m1; // accesses X1.m1, should trigger an error\n" +
+ " ^^\n" +
+ "Access restriction: The field \'X1.m1\' is not API (restriction on required project \'P1\')\n" +
"----------\n"
);
} finally {
@@ -343,36 +343,36 @@ public void test003() throws CoreException {
);
assertProblems(
"Unexpected problems value",
- "----------\n" +
- "1. ERROR in /P2/src/p/Y.java (at line 3)\n" +
- " class C3a extends C1 { // error\n" +
- " ^^\n" +
- "Access restriction: The type \'X1.C1\' is not API (restriction on required project \'P1\')\n" +
- "----------\n" +
- "2. ERROR in /P2/src/p/Y.java (at line 5)\n" +
- " super(0);\n" +
- " ^^^^^^^^^\n" +
- "Access restriction: The constructor \'X1.C1(int)\' is not API (restriction on required project \'P1\')\n" +
- "----------\n" +
- "3. ERROR in /P2/src/p/Y.java (at line 6)\n" +
- " foo(); // error\n" +
- " ^^^\n" +
- "Access restriction: The method \'X1.C1.foo()\' is not API (restriction on required project \'P1\')\n" +
- "----------\n" +
- "4. ERROR in /P2/src/p/Y.java (at line 11)\n" +
- " C1 m1 = // error\n" +
- " ^^\n" +
- "Access restriction: The type \'X1.C1\' is not API (restriction on required project \'P1\')\n" +
- "----------\n" +
- "5. ERROR in /P2/src/p/Y.java (at line 12)\n" +
- " new C1(0); // error\n" +
- " ^^\n" +
- "Access restriction: The type \'X1.C1\' is not API (restriction on required project \'P1\')\n" +
- "----------\n" +
- "6. ERROR in /P2/src/p/Y.java (at line 12)\n" +
- " new C1(0); // error\n" +
- " ^^\n" +
- "Access restriction: The constructor \'X1.C1(int)\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "1. ERROR in /P2/src/p/Y.java (at line 3)\n" +
+ " class C3a extends C1 { // error\n" +
+ " ^^\n" +
+ "Access restriction: The type \'X1.C1\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "2. ERROR in /P2/src/p/Y.java (at line 5)\n" +
+ " super(0);\n" +
+ " ^^^^^^^^^\n" +
+ "Access restriction: The constructor \'X1.C1(int)\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "3. ERROR in /P2/src/p/Y.java (at line 6)\n" +
+ " foo(); // error\n" +
+ " ^^^\n" +
+ "Access restriction: The method \'X1.C1.foo()\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "4. ERROR in /P2/src/p/Y.java (at line 11)\n" +
+ " C1 m1 = // error\n" +
+ " ^^\n" +
+ "Access restriction: The type \'X1.C1\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "5. ERROR in /P2/src/p/Y.java (at line 12)\n" +
+ " new C1(0); // error\n" +
+ " ^^\n" +
+ "Access restriction: The type \'X1.C1\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "6. ERROR in /P2/src/p/Y.java (at line 12)\n" +
+ " new C1(0); // error\n" +
+ " ^^\n" +
+ "Access restriction: The constructor \'X1.C1(int)\' is not API (restriction on required project \'P1\')\n" +
"----------\n"
);
} finally {
@@ -429,11 +429,11 @@ public void test004() throws CoreException {
);
assertProblems(
"Unexpected problems value",
- "----------\n" +
- "1. WARNING in /P2/src/p/Z.java (at line 2)\n" +
- " public class Z extends X1 {\n" +
- " ^^\n" +
- "Discouraged access: The type \'X1\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "1. WARNING in /P2/src/p/Z.java (at line 2)\n" +
+ " public class Z extends X1 {\n" +
+ " ^^\n" +
+ "Discouraged access: The type \'X1\' is not API (restriction on required project \'P1\')\n" +
"----------\n"
);
} finally {
@@ -532,11 +532,11 @@ public void test005() throws CoreException {
);
assertProblems(
"Unexpected problems value",
- "----------\n" +
- "1. ERROR in /P2/src/r/Y.java (at line 4)\n" +
- " (new q.X2()).foo(); // accesses p.X1#foo, should trigger an error\n" +
- " ^^^\n" +
- "Access restriction: The method \'X1.foo()\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "1. ERROR in /P2/src/r/Y.java (at line 4)\n" +
+ " (new q.X2()).foo(); // accesses p.X1#foo, should trigger an error\n" +
+ " ^^^\n" +
+ "Access restriction: The method \'X1.foo()\' is not API (restriction on required project \'P1\')\n" +
"----------\n"
);
} finally {
@@ -608,26 +608,26 @@ public void test006() throws CoreException {
);
assertProblems(
"Unexpected problems value",
- "----------\n" +
- "1. ERROR in /P2/src/p/Y.java (at line 3)\n" +
- " X x1;\n" +
- " ^\n" +
- "Access restriction: The type \'X<T>\' is not API (restriction on required project \'P1\')\n" +
- "----------\n" +
- "2. ERROR in /P2/src/p/Y.java (at line 4)\n" +
- " X<String> x2 = new X<String>();\n" +
- " ^\n" +
- "Access restriction: The type \'X<String>\' is not API (restriction on required project \'P1\')\n" +
- "----------\n" +
- "3. ERROR in /P2/src/p/Y.java (at line 4)\n" +
- " X<String> x2 = new X<String>();\n" +
- " ^\n" +
- "Access restriction: The type \'X<String>\' is not API (restriction on required project \'P1\')\n" +
- "----------\n" +
- "4. ERROR in /P2/src/p/Y.java (at line 4)\n" +
- " X<String> x2 = new X<String>();\n" +
- " ^\n" +
- "Access restriction: The constructor \'X<String>()\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "1. ERROR in /P2/src/p/Y.java (at line 3)\n" +
+ " X x1;\n" +
+ " ^\n" +
+ "Access restriction: The type \'X<T>\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "2. ERROR in /P2/src/p/Y.java (at line 4)\n" +
+ " X<String> x2 = new X<String>();\n" +
+ " ^\n" +
+ "Access restriction: The type \'X<String>\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "3. ERROR in /P2/src/p/Y.java (at line 4)\n" +
+ " X<String> x2 = new X<String>();\n" +
+ " ^\n" +
+ "Access restriction: The type \'X<String>\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "4. ERROR in /P2/src/p/Y.java (at line 4)\n" +
+ " X<String> x2 = new X<String>();\n" +
+ " ^\n" +
+ "Access restriction: The constructor \'X<String>()\' is not API (restriction on required project \'P1\')\n" +
"----------\n");
} finally {
if (x != null) {
@@ -700,26 +700,26 @@ public void test007() throws CoreException {
);
assertProblems(
"Unexpected problems value",
- "----------\n" +
- "1. ERROR in /P2/src/p/Y.java (at line 3)\n" +
- " X x1;\n" +
- " ^\n" +
- "Access restriction: The type \'X<T>\' is not API (restriction on required project \'P1\')\n" +
- "----------\n" +
- "2. ERROR in /P2/src/p/Y.java (at line 4)\n" +
- " X<String> x2 = new X<String>(\"\");\n" +
- " ^\n" +
- "Access restriction: The type \'X<String>\' is not API (restriction on required project \'P1\')\n" +
- "----------\n" +
- "3. ERROR in /P2/src/p/Y.java (at line 4)\n" +
- " X<String> x2 = new X<String>(\"\");\n" +
- " ^\n" +
- "Access restriction: The type \'X<String>\' is not API (restriction on required project \'P1\')\n" +
- "----------\n" +
- "4. ERROR in /P2/src/p/Y.java (at line 4)\n" +
- " X<String> x2 = new X<String>(\"\");\n" +
- " ^\n" +
- "Access restriction: The constructor \'X<String>(String)\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "1. ERROR in /P2/src/p/Y.java (at line 3)\n" +
+ " X x1;\n" +
+ " ^\n" +
+ "Access restriction: The type \'X<T>\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "2. ERROR in /P2/src/p/Y.java (at line 4)\n" +
+ " X<String> x2 = new X<String>(\"\");\n" +
+ " ^\n" +
+ "Access restriction: The type \'X<String>\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "3. ERROR in /P2/src/p/Y.java (at line 4)\n" +
+ " X<String> x2 = new X<String>(\"\");\n" +
+ " ^\n" +
+ "Access restriction: The type \'X<String>\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "4. ERROR in /P2/src/p/Y.java (at line 4)\n" +
+ " X<String> x2 = new X<String>(\"\");\n" +
+ " ^\n" +
+ "Access restriction: The constructor \'X<String>(String)\' is not API (restriction on required project \'P1\')\n" +
"----------\n");
} finally {
if (x != null) {
@@ -801,11 +801,11 @@ public void test008() throws CoreException {
);
assertProblems(
"Unexpected problems value",
- "----------\n" +
- "1. ERROR in /P2/src/p/Y.java (at line 4)\n" +
- " foo(); // accesses X1.foo, should trigger an error\n" +
- " ^^^\n" +
- "Access restriction: The method \'X1.foo()\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "1. ERROR in /P2/src/p/Y.java (at line 4)\n" +
+ " foo(); // accesses X1.foo, should trigger an error\n" +
+ " ^^^\n" +
+ "Access restriction: The method \'X1.foo()\' is not API (restriction on required project \'P1\')\n" +
"----------\n"
);
} finally {
@@ -887,11 +887,11 @@ public void test009() throws CoreException {
);
assertProblems(
"Unexpected problems value",
- "----------\n" +
- "1. ERROR in /P2/src/p/Y.java (at line 4)\n" +
- " int l1 = m1; // accesses X1.m1, should trigger an error\n" +
- " ^^\n" +
- "Access restriction: The field \'X1.m1\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "1. ERROR in /P2/src/p/Y.java (at line 4)\n" +
+ " int l1 = m1; // accesses X1.m1, should trigger an error\n" +
+ " ^^\n" +
+ "Access restriction: The field \'X1.m1\' is not API (restriction on required project \'P1\')\n" +
"----------\n"
);
} finally {
@@ -987,36 +987,36 @@ public void test010() throws CoreException {
);
assertProblems(
"Unexpected problems value",
- "----------\n" +
- "1. ERROR in /P2/src/p/Y.java (at line 3)\n" +
- " class C3a extends C1 { // error\n" +
- " ^^\n" +
- "Access restriction: The type \'X1.C1\' is not API (restriction on required project \'P1\')\n" +
- "----------\n" +
- "2. ERROR in /P2/src/p/Y.java (at line 5)\n" +
- " super(0);\n" +
- " ^^^^^^^^^\n" +
- "Access restriction: The constructor \'X1.C1(int)\' is not API (restriction on required project \'P1\')\n" +
- "----------\n" +
- "3. ERROR in /P2/src/p/Y.java (at line 6)\n" +
- " foo(); // error\n" +
- " ^^^\n" +
- "Access restriction: The method \'X1.C1.foo()\' is not API (restriction on required project \'P1\')\n" +
- "----------\n" +
- "4. ERROR in /P2/src/p/Y.java (at line 11)\n" +
- " C1 m1 = // error\n" +
- " ^^\n" +
- "Access restriction: The type \'X1.C1\' is not API (restriction on required project \'P1\')\n" +
- "----------\n" +
- "5. ERROR in /P2/src/p/Y.java (at line 12)\n" +
- " new C1(0); // error\n" +
- " ^^\n" +
- "Access restriction: The type \'X1.C1\' is not API (restriction on required project \'P1\')\n" +
- "----------\n" +
- "6. ERROR in /P2/src/p/Y.java (at line 12)\n" +
- " new C1(0); // error\n" +
- " ^^\n" +
- "Access restriction: The constructor \'X1.C1(int)\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "1. ERROR in /P2/src/p/Y.java (at line 3)\n" +
+ " class C3a extends C1 { // error\n" +
+ " ^^\n" +
+ "Access restriction: The type \'X1.C1\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "2. ERROR in /P2/src/p/Y.java (at line 5)\n" +
+ " super(0);\n" +
+ " ^^^^^^^^^\n" +
+ "Access restriction: The constructor \'X1.C1(int)\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "3. ERROR in /P2/src/p/Y.java (at line 6)\n" +
+ " foo(); // error\n" +
+ " ^^^\n" +
+ "Access restriction: The method \'X1.C1.foo()\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "4. ERROR in /P2/src/p/Y.java (at line 11)\n" +
+ " C1 m1 = // error\n" +
+ " ^^\n" +
+ "Access restriction: The type \'X1.C1\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "5. ERROR in /P2/src/p/Y.java (at line 12)\n" +
+ " new C1(0); // error\n" +
+ " ^^\n" +
+ "Access restriction: The type \'X1.C1\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "6. ERROR in /P2/src/p/Y.java (at line 12)\n" +
+ " new C1(0); // error\n" +
+ " ^^\n" +
+ "Access restriction: The constructor \'X1.C1(int)\' is not API (restriction on required project \'P1\')\n" +
"----------\n"
);
} finally {
@@ -1066,31 +1066,31 @@ public void test011() throws CoreException {
);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. ERROR in /P1/src/q/Y.java (at line 4)\n" +
- " p.X x = new p.X();\n" +
- " ^^^\n" +
- "Access restriction: The type \'X\' is not API (restriction on required library \'AccessRestrictions/lib.jar\')\n" +
- "----------\n" +
- "2. ERROR in /P1/src/q/Y.java (at line 4)\n" +
- " p.X x = new p.X();\n" +
- " ^^^\n" +
- "Access restriction: The type \'X\' is not API (restriction on required library \'AccessRestrictions/lib.jar\')\n" +
- "----------\n" +
- "3. ERROR in /P1/src/q/Y.java (at line 4)\n" +
- " p.X x = new p.X();\n" +
- " ^^^\n" +
- "Access restriction: The constructor \'X()\' is not API (restriction on required library \'AccessRestrictions/lib.jar\')\n" +
- "----------\n" +
- "4. ERROR in /P1/src/q/Y.java (at line 5)\n" +
- " x.foo();\n" +
- " ^^^\n" +
- "Access restriction: The method \'X.foo()\' is not API (restriction on required library \'AccessRestrictions/lib.jar\')\n" +
- "----------\n" +
- "5. ERROR in /P1/src/q/Y.java (at line 6)\n" +
- " if (x.m > 0) {}\n" +
- " ^\n" +
- "Access restriction: The field \'X.m\' is not API (restriction on required library \'AccessRestrictions/lib.jar\')\n" +
+ "----------\n" +
+ "1. ERROR in /P1/src/q/Y.java (at line 4)\n" +
+ " p.X x = new p.X();\n" +
+ " ^^^\n" +
+ "Access restriction: The type \'X\' is not API (restriction on required library \'AccessRestrictions/lib.jar\')\n" +
+ "----------\n" +
+ "2. ERROR in /P1/src/q/Y.java (at line 4)\n" +
+ " p.X x = new p.X();\n" +
+ " ^^^\n" +
+ "Access restriction: The type \'X\' is not API (restriction on required library \'AccessRestrictions/lib.jar\')\n" +
+ "----------\n" +
+ "3. ERROR in /P1/src/q/Y.java (at line 4)\n" +
+ " p.X x = new p.X();\n" +
+ " ^^^\n" +
+ "Access restriction: The constructor \'X()\' is not API (restriction on required library \'AccessRestrictions/lib.jar\')\n" +
+ "----------\n" +
+ "4. ERROR in /P1/src/q/Y.java (at line 5)\n" +
+ " x.foo();\n" +
+ " ^^^\n" +
+ "Access restriction: The method \'X.foo()\' is not API (restriction on required library \'AccessRestrictions/lib.jar\')\n" +
+ "----------\n" +
+ "5. ERROR in /P1/src/q/Y.java (at line 6)\n" +
+ " if (x.m > 0) {}\n" +
+ " ^\n" +
+ "Access restriction: The field \'X.m\' is not API (restriction on required library \'AccessRestrictions/lib.jar\')\n" +
"----------\n"
);
} finally {
@@ -1132,44 +1132,44 @@ public void testBug545766() throws CoreException {
" X1.E e = X1.E.E1;" +
"}";
String expectedProblems =
- "1. ERROR in /P2/src/p2/Z.java (at line 2)\n" +
- " import p.X1;\n" +
- " ^^^^\n" +
- "Access restriction: The type \'X1\' is not API (restriction on required project \'P1\')\n" +
- "----------\n" +
- "2. ERROR in /P2/src/p2/Z.java (at line 4)\n" +
- " X1.E e = X1.E.E1;}\n" +
- " ^^^^\n" +
- "Access restriction: The type \'X1\' is not API (restriction on required project \'P1\')\n" +
- "----------\n" +
- "3. ERROR in /P2/src/p2/Z.java (at line 4)\n" +
- " X1.E e = X1.E.E1;}\n" +
- " ^^^^\n" +
- "Access restriction: The type \'X1.E\' is not API (restriction on required project \'P1\')\n" +
- "----------\n" +
- "4. ERROR in /P2/src/p2/Z.java (at line 4)\n" +
- " X1.E e = X1.E.E1;}\n" +
- " ^^^^^^^\n" +
- "Access restriction: The type \'X1\' is not API (restriction on required project \'P1\')\n" +
- "----------\n" +
- "5. ERROR in /P2/src/p2/Z.java (at line 4)\n" +
- " X1.E e = X1.E.E1;}\n" +
- " ^^^^^^^\n" +
- "Access restriction: The type \'X1.E\' is not API (restriction on required project \'P1\')\n" +
- "----------\n" +
- "6. ERROR in /P2/src/p2/Z.java (at line 4)\n" +
- " X1.E e = X1.E.E1;}\n" +
- " ^^\n" +
- "Access restriction: The field \'X1.E.E1\' is not API (restriction on required project \'P1\')\n" +
+ "1. ERROR in /P2/src/p2/Z.java (at line 2)\n" +
+ " import p.X1;\n" +
+ " ^^^^\n" +
+ "Access restriction: The type \'X1\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "2. ERROR in /P2/src/p2/Z.java (at line 4)\n" +
+ " X1.E e = X1.E.E1;}\n" +
+ " ^^^^\n" +
+ "Access restriction: The type \'X1\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "3. ERROR in /P2/src/p2/Z.java (at line 4)\n" +
+ " X1.E e = X1.E.E1;}\n" +
+ " ^^^^\n" +
+ "Access restriction: The type \'X1.E\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "4. ERROR in /P2/src/p2/Z.java (at line 4)\n" +
+ " X1.E e = X1.E.E1;}\n" +
+ " ^^^^^^^\n" +
+ "Access restriction: The type \'X1\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "5. ERROR in /P2/src/p2/Z.java (at line 4)\n" +
+ " X1.E e = X1.E.E1;}\n" +
+ " ^^^^^^^\n" +
+ "Access restriction: The type \'X1.E\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "6. ERROR in /P2/src/p2/Z.java (at line 4)\n" +
+ " X1.E e = X1.E.E1;}\n" +
+ " ^^\n" +
+ "Access restriction: The field \'X1.E.E1\' is not API (restriction on required project \'P1\')\n" +
"----------\n";
this.problemRequestor = new ProblemRequestor(src);
z = getWorkingCopy("/P2/src/p2/Z.java", src);
assertProblems("Unexpected problems value", "----------\n" + expectedProblems);
-
+
int start = src.indexOf("E1");
IJavaElement[] elements = z.codeSelect(start, 2);
assertElementsEqual("Unexpected elements", "E1 [in E [in X1 [in X1.java [in p [in src [in P1]]]]]]", elements);
-
+
createFolder("/P2/src/p2");
createFile("/P2/src/p2/Z.java", src);
ASTParser parser = ASTParser.newParser(AST_INTERNAL_LATEST);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AllJavaModelTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AllJavaModelTests.java
index 8318f7b9e..f6ba112b7 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AllJavaModelTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AllJavaModelTests.java
@@ -203,13 +203,13 @@ private static Class[] getAllTestClasses() {
// Creation of imports
CreateImportsTests.class,
-
+
// Util tests
UtilTests.class,
-
+
JavaCoreOptionsTests.class,
JavaCorePreferenceModifyListenerTest.class,
-
+
// Tests regarding null-annotations:
NullAnnotationModelTests.class,
ExternalAnnotations17Test.class,
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AttachSourceTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AttachSourceTests.java
index ba4462e60..ea9574fd3 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AttachSourceTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AttachSourceTests.java
@@ -172,12 +172,12 @@ private void setUpGenericJar() throws IOException, CoreException {
"class AType<E> {\n" + // type name containing character 'T'
"}",
"Container.java",
- "public class Container {\n" +
- " class Inner<S> {\n" +
- " Inner(String st, Class<S> s) {\n" +
- " super();\n" +
- " }\n" +
- " }\n" +
+ "public class Container {\n" +
+ " class Inner<S> {\n" +
+ " Inner(String st, Class<S> s) {\n" +
+ " super();\n" +
+ " }\n" +
+ " }\n" +
"}"
};
addLibrary("generic.jar", "genericsrc.zip", pathAndContents, JavaCore.VERSION_1_5);
@@ -377,7 +377,7 @@ public void testClassFileGetElementAt04() throws JavaModelException {
/*
* Ensures that the source of a .class file is implicetely attached when prj=src=bin
* (regression test for bug 41444 [navigation] error dialog on opening class file)
- *
+ *
* Note: The test case is being modified as part of fix for bug
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=398490
*/
@@ -921,16 +921,16 @@ public void testInnerClass1() throws JavaModelException {
" V(String s) {\n" +
" }\n" +
" }\n" +
- " class Inner {\n" +
- " Inner() {\n" +
- " }\n" +
- " class WW {\n" +
- " WW() {}\n" +
- " class WWW {\n" +
- " WWW() {}\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ " class Inner {\n" +
+ " Inner() {\n" +
+ " }\n" +
+ " class WW {\n" +
+ " WW() {}\n" +
+ " class WWW {\n" +
+ " WWW() {}\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}",
type.getSource());
attachSource(root, null, null); // detach source
@@ -1086,18 +1086,18 @@ public void testInnerClass10() throws JavaModelException {
IType type = fragment.getOrdinaryClassFile("X$Inner$WW.class").getType();
assertSourceEquals(
"Unexpected source",
- "class WW {\n" +
- " WW() {}\n" +
- " class WWW {\n" +
- " WWW() {}\n" +
- " }\n" +
+ "class WW {\n" +
+ " WW() {}\n" +
+ " class WWW {\n" +
+ " WWW() {}\n" +
+ " }\n" +
" }",
type.getSource());
type = fragment.getOrdinaryClassFile("X$Inner$WW$WWW.class").getType();
assertSourceEquals(
"Unexpected source",
- "class WWW {\n" +
- " WWW() {}\n" +
+ "class WWW {\n" +
+ " WWW() {}\n" +
" }",
type.getSource());
attachSource(root, null, null); // detach source
@@ -1629,7 +1629,7 @@ public void testRootPath13() throws JavaModelException {
IJavaProject project = this.getJavaProject("/AttachSourceTests");
IPackageFragmentRoot root = project.getPackageFragmentRoot(this.getFile("/AttachSourceTests/test7.jar"));
attachSource(root, "/AttachSourceTests/test7src/", null);
-
+
IOrdinaryClassFile cf = root.getPackageFragment("p1.p2").getOrdinaryClassFile("X.class");
assertSourceEquals(
"Unexpected source for class file",
@@ -1698,28 +1698,28 @@ public void test267046() throws JavaModelException {
IOrdinaryClassFile cf = root.getPackageFragment("test").getOrdinaryClassFile("Foo.class");
assertSourceEquals(
"Unexpected source for class file",
- "package test;\n" +
- "\n" +
- "public class Foo {\n" +
- " public static class Bar<A, B> {\n" +
- " }\n" +
- "\n" +
- " public static void gotchaFunc1(Bar<byte[], Object> bar) {\n" +
- " }\n" +
- " public static void gotchaFunc2(Bar<boolean[], Object> bar) {\n" +
- " }\n" +
- " public static void gotchaFunc3(Bar<char[], Object> bar) {\n" +
- " }\n" +
- " public static void gotchaFunc4(Bar<double[], Object> bar) {\n" +
- " }\n" +
- " public static void gotchaFunc5(Bar<float[], Object> bar) {\n" +
- " }\n" +
- " public static void gotchaFunc6(Bar<int[], Object> bar) {\n" +
- " }\n" +
- " public static void gotchaFunc7(Bar<long[], Object> bar) {\n" +
- " }\n" +
- " public static void gotchaFunc8(Bar<short[], Object> bar) {\n" +
- " }\n" +
+ "package test;\n" +
+ "\n" +
+ "public class Foo {\n" +
+ " public static class Bar<A, B> {\n" +
+ " }\n" +
+ "\n" +
+ " public static void gotchaFunc1(Bar<byte[], Object> bar) {\n" +
+ " }\n" +
+ " public static void gotchaFunc2(Bar<boolean[], Object> bar) {\n" +
+ " }\n" +
+ " public static void gotchaFunc3(Bar<char[], Object> bar) {\n" +
+ " }\n" +
+ " public static void gotchaFunc4(Bar<double[], Object> bar) {\n" +
+ " }\n" +
+ " public static void gotchaFunc5(Bar<float[], Object> bar) {\n" +
+ " }\n" +
+ " public static void gotchaFunc6(Bar<int[], Object> bar) {\n" +
+ " }\n" +
+ " public static void gotchaFunc7(Bar<long[], Object> bar) {\n" +
+ " }\n" +
+ " public static void gotchaFunc8(Bar<short[], Object> bar) {\n" +
+ " }\n" +
"}\n",
cf.getSource());
IType type = cf.getType();
@@ -1769,7 +1769,7 @@ public void testConstructorAccess() throws JavaModelException {
IJavaProject project = this.getJavaProject("/AttachSourceTests");
IPackageFragmentRoot root = project.getPackageFragmentRoot(getFile("/AttachSourceTests/generic.jar"));
attachSource(root, "/AttachSourceTests/genericsrc.zip", null);
-
+
IOrdinaryClassFile cf = root.getPackageFragment("").getOrdinaryClassFile("Container$Inner.class");
final IType type = cf.getType();
final IMethod[] methods = type.getMethods();
@@ -1777,8 +1777,8 @@ public void testConstructorAccess() throws JavaModelException {
assertTrue("Not a constructor", methods[0].isConstructor());
assertSourceEquals(
"Unexpected source for generic constructor",
- "Inner(String st, Class<S> s) {\n" +
- " super();\n" +
+ "Inner(String st, Class<S> s) {\n" +
+ " super();\n" +
" }",
methods[0].getSource());
attachSource(root, null, null); // detach source
@@ -1792,17 +1792,17 @@ public void testBug336046() throws Exception {
Hashtable<String, String> javaCoreOptions = JavaCore.getOptions();
IJavaProject importedProject = null;
try {
-
+
String classpathContent = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<classpath>\n" +
" <classpathentry kind=\"lib\" path=\"attach.jar\"/>\n" +
" <classpathentry kind=\"lib\" path=\"attach2.jar\"/>\n" +
- " <classpathentry kind=\"lib\" path=\"test.jar\"/>\n" +
- " <classpathentry kind=\"lib\" path=\"update.jar\"/>\n" +
+ " <classpathentry kind=\"lib\" path=\"test.jar\"/>\n" +
+ " <classpathentry kind=\"lib\" path=\"update.jar\"/>\n" +
" <classpathentry kind=\"lib\" path=\"full.jar\"/>\n" +
- " <classpathentry kind=\"lib\" path=\"test2.jar\"/>\n" +
- " <classpathentry kind=\"lib\" path=\"test4.jar\"/> \n" +
- " <classpathentry kind=\"lib\" path=\"test5.jar\"/> \n" +
+ " <classpathentry kind=\"lib\" path=\"test2.jar\"/>\n" +
+ " <classpathentry kind=\"lib\" path=\"test4.jar\"/> \n" +
+ " <classpathentry kind=\"lib\" path=\"test5.jar\"/> \n" +
" <classpathentry kind=\"lib\" path=\"test6.jar\"/>\n" +
" <classpathentry kind=\"lib\" path=\"test7.jar\"/>\n" +
" <classpathentry kind=\"lib\" path=\"267046.jar\"/>\n" +
@@ -1813,7 +1813,7 @@ public void testBug336046() throws Exception {
" <classpathentry kind=\"output\" path=\"bin\"/>\n" +
"</classpath>";
IWorkspace workspace = ResourcesPlugin.getWorkspace();
-
+
IPath sourceLocation = project.getProject().getLocation();
IPath destination = new Path(getExternalFolder()).append("ImportedProject");
String classpathLocation = destination.append(".classpath").toString();
@@ -1866,7 +1866,7 @@ public void testModule1() throws CoreException, IOException {
" exports test1;\n" +
"}\n");
- String modOneSrc =
+ String modOneSrc =
"\n" +
"/** The no. one module. */\n" +
"module mod.one {\n" +
@@ -1877,7 +1877,7 @@ public void testModule1() throws CoreException, IOException {
modOneSrc,
"m/o/p/C.java",
"package m.o.p;\n" +
- "public class C {\n" +
+ "public class C {\n" +
"}"
};
addLibrary(javaProject, "mod.one.jar", "mod.onesrc.zip", pathAndContents, JavaCore.VERSION_9);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AttachedJavadocTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AttachedJavadocTests.java
index dbdcfb67f..99b9f3941 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AttachedJavadocTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AttachedJavadocTests.java
@@ -599,7 +599,7 @@ public class AttachedJavadocTests extends ModifyingResourceTests {
* @bug 304394: IJavaElement#getAttachedJavadoc(IProgressMonitor) should support referenced entries
* Test that javadoc is picked up from the referenced classpath entry when the javadoc location is added
* to that entry
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=304394"
* @throws Exception
*/
@@ -618,7 +618,7 @@ public class AttachedJavadocTests extends ModifyingResourceTests {
&& "/AttachedJavadocProject/lib/test6.jar".equals(entry.getPath().toString())) { //$NON-NLS-1$
chainedJar = entries[i];
- addLibrary(this.project, "/lib/chaining.jar", null, new String[0],
+ addLibrary(this.project, "/lib/chaining.jar", null, new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n" +
@@ -630,10 +630,10 @@ public class AttachedJavadocTests extends ModifyingResourceTests {
break;
}
}
-
+
this.project.setRawClasspath(entries, new IClasspathEntry[]{chainedJar}, this.project.getOutputLocation(), null);
waitForAutoBuild();
-
+
IPackageFragment packageFragment = this.root.getPackageFragment("p1.p2"); //$NON-NLS-1$
IOrdinaryClassFile classFile = packageFragment.getOrdinaryClassFile("X.class"); //$NON-NLS-1$
IType type = classFile.getType();
@@ -650,9 +650,9 @@ public class AttachedJavadocTests extends ModifyingResourceTests {
}
/**
* Additional test for bug 304394.
- * Test that javadoc is picked up from the raw classpath entry when the referenced entry doesn't
+ * Test that javadoc is picked up from the raw classpath entry when the referenced entry doesn't
* contain the javadoc location attrribute.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=304394"
* @throws Exception
*/
@@ -671,7 +671,7 @@ public class AttachedJavadocTests extends ModifyingResourceTests {
&& "/AttachedJavadocProject/lib/test6.jar".equals(entry.getPath().toString())) { //$NON-NLS-1$
chainedJar = entries[i];
- addLibrary(this.project, "/lib/chaining.jar", null, new String[0],
+ addLibrary(this.project, "/lib/chaining.jar", null, new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n" +
@@ -683,11 +683,11 @@ public class AttachedJavadocTests extends ModifyingResourceTests {
break;
}
}
-
+
chainedJar = JavaCore.newLibraryEntry(chainedJar.getPath(), null, null, null, null, chainedJar.isExported());
this.project.setRawClasspath(entries, new IClasspathEntry[]{chainedJar}, this.project.getOutputLocation(), null);
waitForAutoBuild();
-
+
IPackageFragment packageFragment = this.root.getPackageFragment("p1.p2"); //$NON-NLS-1$
IOrdinaryClassFile classFile = packageFragment.getOrdinaryClassFile("X.class"); //$NON-NLS-1$
IType type = classFile.getType();
@@ -814,16 +814,16 @@ public class AttachedJavadocTests extends ModifyingResourceTests {
String javadoc = method.getAttachedJavadoc(null);
assertNotNull(javadoc);
- assertEquals("Wrong contents", "<H3>\r\n" +
- "PublicAbstractClass.InnerFinalException</H3>\r\n" +
- "<PRE>\r\n" +
- "public <B>PublicAbstractClass.InnerFinalException</B>(java.lang.String&nbsp;property,\r\n" +
- " java.lang.String&nbsp;msg)</PRE>\r\n" +
- "<DL>\r\n" +
- "<DD>javadoc for InnerFinalException(String property, String msg)\r\n" +
- "<P>\r\n" +
- "<DL>\r\n" +
- "<DT><B>Parameters:</B><DD><CODE>property</CODE> - the property argument<DD><CODE>msg</CODE> - the message argument</DL>\r\n" +
+ assertEquals("Wrong contents", "<H3>\r\n" +
+ "PublicAbstractClass.InnerFinalException</H3>\r\n" +
+ "<PRE>\r\n" +
+ "public <B>PublicAbstractClass.InnerFinalException</B>(java.lang.String&nbsp;property,\r\n" +
+ " java.lang.String&nbsp;msg)</PRE>\r\n" +
+ "<DL>\r\n" +
+ "<DD>javadoc for InnerFinalException(String property, String msg)\r\n" +
+ "<P>\r\n" +
+ "<DL>\r\n" +
+ "<DT><B>Parameters:</B><DD><CODE>property</CODE> - the property argument<DD><CODE>msg</CODE> - the message argument</DL>\r\n" +
"</DL>\r\n", javadoc);
} finally {
this.project.setRawClasspath(entries, null);
@@ -850,16 +850,16 @@ public class AttachedJavadocTests extends ModifyingResourceTests {
String javadoc = method.getAttachedJavadoc(null);
assertNotNull(javadoc);
- assertEquals("Wrong contents", "<H3>\r\n" +
- "PublicAbstractClass.InnerFinalException</H3>\r\n" +
- "<PRE>\r\n" +
- "public <B>PublicAbstractClass.InnerFinalException</B>(java.lang.String&nbsp;property,\r\n" +
- " java.lang.String&nbsp;msg)</PRE>\r\n" +
- "<DL>\r\n" +
- "<DD>javadoc for InnerFinalException(String property, String msg)\r\n" +
- "<P>\r\n" +
- "<DL>\r\n" +
- "<DT><B>Parameters:</B><DD><CODE>property</CODE> - the property argument<DD><CODE>msg</CODE> - the message argument</DL>\r\n" +
+ assertEquals("Wrong contents", "<H3>\r\n" +
+ "PublicAbstractClass.InnerFinalException</H3>\r\n" +
+ "<PRE>\r\n" +
+ "public <B>PublicAbstractClass.InnerFinalException</B>(java.lang.String&nbsp;property,\r\n" +
+ " java.lang.String&nbsp;msg)</PRE>\r\n" +
+ "<DL>\r\n" +
+ "<DD>javadoc for InnerFinalException(String property, String msg)\r\n" +
+ "<P>\r\n" +
+ "<DL>\r\n" +
+ "<DT><B>Parameters:</B><DD><CODE>property</CODE> - the property argument<DD><CODE>msg</CODE> - the message argument</DL>\r\n" +
"</DL>\r\n", javadoc);
} finally {
this.project.setRawClasspath(entries, null);
@@ -887,16 +887,16 @@ public class AttachedJavadocTests extends ModifyingResourceTests {
String javadoc = method.getAttachedJavadoc(null);
assertNotNull(javadoc);
assertEquals("Wrong contents",
- "<H3>\r\n" +
- "PublicAbstractClass.A.InnerFinalException</H3>\r\n" +
- "<PRE>\r\n" +
- "public <B>PublicAbstractClass.A.InnerFinalException</B>(java.lang.String&nbsp;property,\r\n" +
- " java.lang.String&nbsp;msg)</PRE>\r\n" +
- "<DL>\r\n" +
- "<DD>javadoc for InnerFinalException(String property, String msg)\r\n" +
- "<P>\r\n" +
- "<DL>\r\n" +
- "<DT><B>Parameters:</B><DD><CODE>property</CODE> - the property argument<DD><CODE>msg</CODE> - the message argument</DL>\r\n" +
+ "<H3>\r\n" +
+ "PublicAbstractClass.A.InnerFinalException</H3>\r\n" +
+ "<PRE>\r\n" +
+ "public <B>PublicAbstractClass.A.InnerFinalException</B>(java.lang.String&nbsp;property,\r\n" +
+ " java.lang.String&nbsp;msg)</PRE>\r\n" +
+ "<DL>\r\n" +
+ "<DD>javadoc for InnerFinalException(String property, String msg)\r\n" +
+ "<P>\r\n" +
+ "<DL>\r\n" +
+ "<DT><B>Parameters:</B><DD><CODE>property</CODE> - the property argument<DD><CODE>msg</CODE> - the message argument</DL>\r\n" +
"</DL>\r\n", javadoc);
} finally {
this.project.setRawClasspath(entries, null);
@@ -923,16 +923,16 @@ public class AttachedJavadocTests extends ModifyingResourceTests {
String javadoc = method.getAttachedJavadoc(null);
assertNotNull(javadoc);
- assertEquals("Wrong contents", "<H3>\r\n" +
- "PublicAbstractClass.A.InnerFinalException</H3>\r\n" +
- "<PRE>\r\n" +
- "public <B>PublicAbstractClass.A.InnerFinalException</B>(java.lang.String&nbsp;property,\r\n" +
- " java.lang.String&nbsp;msg)</PRE>\r\n" +
- "<DL>\r\n" +
- "<DD>javadoc for InnerFinalException(String property, String msg)\r\n" +
- "<P>\r\n" +
- "<DL>\r\n" +
- "<DT><B>Parameters:</B><DD><CODE>property</CODE> - the property argument<DD><CODE>msg</CODE> - the message argument</DL>\r\n" +
+ assertEquals("Wrong contents", "<H3>\r\n" +
+ "PublicAbstractClass.A.InnerFinalException</H3>\r\n" +
+ "<PRE>\r\n" +
+ "public <B>PublicAbstractClass.A.InnerFinalException</B>(java.lang.String&nbsp;property,\r\n" +
+ " java.lang.String&nbsp;msg)</PRE>\r\n" +
+ "<DL>\r\n" +
+ "<DD>javadoc for InnerFinalException(String property, String msg)\r\n" +
+ "<P>\r\n" +
+ "<DL>\r\n" +
+ "<DT><B>Parameters:</B><DD><CODE>property</CODE> - the property argument<DD><CODE>msg</CODE> - the message argument</DL>\r\n" +
"</DL>\r\n", javadoc);
} finally {
this.project.setRawClasspath(entries, null);
@@ -961,16 +961,16 @@ public class AttachedJavadocTests extends ModifyingResourceTests {
assertNotNull(javadoc);
assertEquals(
"Wrong contents",
- "<H3>\r\n" +
- "foo</H3>\r\n" +
- "<PRE>\r\n" +
- "public void <B>foo</B>()</PRE>\r\n" +
- "<DL>\r\n" +
- "<DD>Test method\r\n" +
- "<P>\r\n" +
- "<DD><DL>\r\n" +
- "</DL>\r\n" +
- "</DD>\r\n" +
+ "<H3>\r\n" +
+ "foo</H3>\r\n" +
+ "<PRE>\r\n" +
+ "public void <B>foo</B>()</PRE>\r\n" +
+ "<DL>\r\n" +
+ "<DD>Test method\r\n" +
+ "<P>\r\n" +
+ "<DD><DL>\r\n" +
+ "</DL>\r\n" +
+ "</DD>\r\n" +
"</DL>\r\n",
javadoc);
} finally {
@@ -1000,16 +1000,16 @@ public class AttachedJavadocTests extends ModifyingResourceTests {
assertNotNull(javadoc);
assertEquals(
"Wrong contents",
- "<H3>\r\n" +
- "PublicAbstractClass.InnerFinalException</H3>\r\n" +
- "<PRE>\r\n" +
- "public <B>PublicAbstractClass.InnerFinalException</B>()</PRE>\r\n" +
- "<DL>\r\n" +
- "<DD>javadoc for InnerFinalException()\r\n" +
- "<P>\r\n" +
- "</DL>\r\n" +
- "\r\n" +
- "<!-- ============ METHOD DETAIL ========== -->\r\n" +
+ "<H3>\r\n" +
+ "PublicAbstractClass.InnerFinalException</H3>\r\n" +
+ "<PRE>\r\n" +
+ "public <B>PublicAbstractClass.InnerFinalException</B>()</PRE>\r\n" +
+ "<DL>\r\n" +
+ "<DD>javadoc for InnerFinalException()\r\n" +
+ "<P>\r\n" +
+ "</DL>\r\n" +
+ "\r\n" +
+ "<!-- ============ METHOD DETAIL ========== -->\r\n" +
"\r\n",
javadoc);
} finally {
@@ -1203,37 +1203,37 @@ public class AttachedJavadocTests extends ModifyingResourceTests {
} catch (Exception e) {
fail("Should not be an exception");
}
- addLibrary(this.project, "valid.jar", null,
+ addLibrary(this.project, "valid.jar", null,
new String[]{
"p/X.java",
"package p;\n" +
"/** Javadoc for class X */\n" +
- "public class X {}" },
+ "public class X {}" },
JavaCore.VERSION_1_4);
- addLibrary(this.project, "invalid.jar", null,
+ addLibrary(this.project, "invalid.jar", null,
new String[]{
"q/Y.java",
"package q;\n" +
"/** Javadoc for class Y */\n" +
- "public class Y {}" },
+ "public class Y {}" },
JavaCore.VERSION_1_4);
IClasspathAttribute attribute = JavaCore.newClasspathAttribute(IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME, validUrl.toExternalForm());
- IClasspathEntry validEntry =
- JavaCore.newLibraryEntry(new Path("/AttachedJavadocProject/valid.jar"),
- null,
- null,
- new IAccessRule[]{},
- new IClasspathAttribute[] { attribute },
+ IClasspathEntry validEntry =
+ JavaCore.newLibraryEntry(new Path("/AttachedJavadocProject/valid.jar"),
+ null,
+ null,
+ new IAccessRule[]{},
+ new IClasspathAttribute[] { attribute },
false);
-
+
attribute = JavaCore.newClasspathAttribute(IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME, invalidUrl.toExternalForm());
- IClasspathEntry invalidEntry =
- JavaCore.newLibraryEntry(new Path("/AttachedJavadocProject/invalid.jar"),
- null,
- null,
- new IAccessRule[]{},
- new IClasspathAttribute[] { attribute },
+ IClasspathEntry invalidEntry =
+ JavaCore.newLibraryEntry(new Path("/AttachedJavadocProject/invalid.jar"),
+ null,
+ null,
+ new IAccessRule[]{},
+ new IClasspathAttribute[] { attribute },
false);
IClasspathEntry[] newClasspath = new IClasspathEntry[oldClasspath.length + 2];
@@ -1265,7 +1265,7 @@ public class AttachedJavadocTests extends ModifyingResourceTests {
fail("Should not throw JavaModelException");
}
assertNull("Should not have a javadoc", javadoc);
-
+
packageFragment = invalidRoot.getPackageFragment("q");
classFile = packageFragment.getOrdinaryClassFile("Y.class");
type = classFile.getType();
@@ -1353,7 +1353,7 @@ public class AttachedJavadocTests extends ModifyingResourceTests {
IPackageFragment packageFragment = jarRoot.getPackageFragment("org.eclipse.pub");
javadoc = packageFragment.getAttachedJavadoc(new NullProgressMonitor());
assertNotNull("Should have a javadoc", javadoc); //$NON-NLS-1$
- assertTrue("Should contain", javadoc.contains("Some package description"));
+ assertTrue("Should contain", javadoc.contains("Some package description"));
} catch (IndexOutOfBoundsException e) {
assertTrue("Should not happen", false);
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/BindingKeyTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/BindingKeyTests.java
index 09261ce48..3f93a49f4 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/BindingKeyTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/BindingKeyTests.java
@@ -281,7 +281,7 @@ public class BindingKeyTests extends AbstractJavaModelTests {
private String getWildcardBindingKey(String typeKey, char kind) {
return BindingKey.createWilcardTypeBindingKey(typeKey, kind);
}
-
+
/*
* Create a wildcard type binding key
*/
@@ -306,7 +306,7 @@ public class BindingKeyTests extends AbstractJavaModelTests {
assertBindingKeyEquals(BindingKey.createWildcardTypeBindingKey(
BindingKey.createTypeBindingKey("java.util.ArrayList"), Signature.C_SUPER,
BindingKey.createTypeBindingKey("java.lang.String"), 0),
- "Ljava/util/ArrayList;{0}-Ljava/lang/String;"
+ "Ljava/util/ArrayList;{0}-Ljava/lang/String;"
);
}
@@ -321,7 +321,7 @@ public class BindingKeyTests extends AbstractJavaModelTests {
assertBindingKeyEquals(BindingKey.createWildcardTypeBindingKey(
BindingKey.createTypeBindingKey("java.util.ArrayList"), Signature.C_EXTENDS,
BindingKey.createTypeBindingKey("java.lang.String"), 0),
- "Ljava/util/ArrayList;{0}+Ljava/lang/String;"
+ "Ljava/util/ArrayList;{0}+Ljava/lang/String;"
);
}
@@ -684,7 +684,7 @@ public class BindingKeyTests extends AbstractJavaModelTests {
"Ljava/util/ArrayList<Ljava/lang/String;>;.()V"
);
}
-
+
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=351165
* getDeclaringType should return null for a type
@@ -697,7 +697,7 @@ public class BindingKeyTests extends AbstractJavaModelTests {
}
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=351165
- * getDeclaringType should return the correct type for
+ * getDeclaringType should return the correct type for
* methods of a secondary type
*/
public void test061() {
@@ -718,7 +718,7 @@ public class BindingKeyTests extends AbstractJavaModelTests {
}
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=351165
- * getDeclaringType should return the correct type for
+ * getDeclaringType should return the correct type for
* methods of a secondary's inner type
*/
public void test063() {
@@ -729,7 +729,7 @@ public class BindingKeyTests extends AbstractJavaModelTests {
}
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=351165
- * getDeclaringType should return the correct type for
+ * getDeclaringType should return the correct type for
* for a secondary's inner type
*/
public void test064() {
@@ -740,7 +740,7 @@ public class BindingKeyTests extends AbstractJavaModelTests {
}
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=351165
- * getDeclaringType should return the correct type for
+ * getDeclaringType should return the correct type for
* methods of an inner type
*/
public void test065() {
@@ -761,7 +761,7 @@ public class BindingKeyTests extends AbstractJavaModelTests {
}
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=351165
- * getDeclaringType should return the correct type for
+ * getDeclaringType should return the correct type for
* methods of an inner type's inner type
*/
public void test067() {
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/Bug376673Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/Bug376673Test.java
index 010f0dea6..8f9965505 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/Bug376673Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/Bug376673Test.java
@@ -68,13 +68,13 @@ public class Bug376673Test extends ModifyingResourceTests {
List<String> errors = new ArrayList<>();
StringBuilder markersToString = new StringBuilder();
for (IMarker marker : markers) {
-
+
Integer severity = (Integer) marker.getAttribute(IMarker.SEVERITY);
String message = (String) marker.getAttribute(IMarker.MESSAGE);
if (severity.intValue() == IMarker.SEVERITY_ERROR) {
errors.add(message);
}
-
+
markersToString.append("Marker with severity: ");
markersToString.append(severity);
markersToString.append(", and message: ");
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClassFileTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClassFileTests.java
index 01c79bc13..c869defbd 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClassFileTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClassFileTests.java
@@ -92,7 +92,7 @@ public void setUpSuite() throws Exception {
"package generic;\n" +
"import java.util.Collection;\n" +
"public class GenericField {\n" +
- " protected Collection<String> myField;\n" +
+ " protected Collection<String> myField;\n" +
"}",
"annotated/X.java",
"package annotated;\n" +
@@ -164,12 +164,12 @@ public void setUpSuite() throws Exception {
"annotated/Y.java",
"package annotated;\n" +
"import java.lang.annotation.*;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
"@Deprecated\n" +
- "@Documented\n" +
+ "@Documented\n" +
"@Inherited\n" +
- "@Retention(SOURCE)\n" +
+ "@Retention(SOURCE)\n" +
"@Target({PACKAGE, TYPE, ANNOTATION_TYPE, METHOD, CONSTRUCTOR, FIELD, LOCAL_VARIABLE, PARAMETER})\n" +
"public @interface Y {\n" +
"}",
@@ -196,34 +196,34 @@ public void setUpSuite() throws Exception {
"annotated/MyAnnotation.java",
"package annotated;\n" +
"import java.lang.annotation.Retention;\n" +
- "import java.lang.annotation.RetentionPolicy;\n" +
- "@Retention(value = RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.RetentionPolicy;\n" +
+ "@Retention(value = RetentionPolicy.RUNTIME)\n" +
"public @interface MyAnnotation {}",
"annotated/MyAnnotation2.java",
"package annotated;\n" +
"import java.lang.annotation.Retention;\n" +
- "import java.lang.annotation.RetentionPolicy;\n" +
- "@Retention(value = RetentionPolicy.SOURCE)\n" +
+ "import java.lang.annotation.RetentionPolicy;\n" +
+ "@Retention(value = RetentionPolicy.SOURCE)\n" +
"public @interface MyAnnotation2 {}",
"annotated/MyAnnotation3.java",
"package annotated;\n" +
"import java.lang.annotation.Retention;\n" +
- "import java.lang.annotation.RetentionPolicy;\n" +
- "@Retention(value = RetentionPolicy.CLASS)\n" +
+ "import java.lang.annotation.RetentionPolicy;\n" +
+ "@Retention(value = RetentionPolicy.CLASS)\n" +
"public @interface MyAnnotation3 {}",
"test342757/X.java",
"package test342757;\n" +
- "public class X {\n" +
- " class B {\n" +
- " public B(@Deprecated @Annot String s) {}\n" +
- " public void foo(@Deprecated @Annot int j) {}\n" +
- " }\n" +
+ "public class X {\n" +
+ " class B {\n" +
+ " public B(@Deprecated @Annot String s) {}\n" +
+ " public void foo(@Deprecated @Annot int j) {}\n" +
+ " }\n" +
"}",
"test342757/Annot.java",
"package test342757;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Retention(CLASS)\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Retention(CLASS)\n" +
"@interface Annot {}",
};
addLibrary(javaProject, "lib.jar", "libsrc.zip", pathAndContents, JavaCore.VERSION_1_5);
@@ -434,10 +434,10 @@ public void testAnnotations16() throws JavaModelException {
public void testAnnotations17() throws JavaModelException {
IType type = this.jarRoot.getPackageFragment("annotated").getOrdinaryClassFile("Y.class").getType();
assertAnnotationsEqual(
- "@java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.ANNOTATION_TYPE, java.lang.annotation.ElementType.PACKAGE})\n" +
- "@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE)\n" +
- "@java.lang.Deprecated\n" +
- "@java.lang.annotation.Documented\n" +
+ "@java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.ANNOTATION_TYPE, java.lang.annotation.ElementType.PACKAGE})\n" +
+ "@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE)\n" +
+ "@java.lang.Deprecated\n" +
+ "@java.lang.annotation.Documented\n" +
"@java.lang.annotation.Inherited\n",
type.getAnnotations());
}
@@ -539,9 +539,9 @@ public void testAnnotations26() throws JavaModelException {
IType type = this.jarRoot.getPackageFragment("test342757").getOrdinaryClassFile("X$B.class").getType();
IMethod[] methods = type.getMethods();
String expected =
- "@test342757.Annot\n" +
- "@java.lang.Deprecated\n" +
- "@test342757.Annot\n" +
+ "@test342757.Annot\n" +
+ "@java.lang.Deprecated\n" +
+ "@test342757.Annot\n" +
"@java.lang.Deprecated\n";
StringBuffer buffer = new StringBuffer();
for (int i = 0, max = methods.length; i < max; i++) {
@@ -1579,7 +1579,7 @@ public void testGenericFieldGetTypeSignature() throws JavaModelException {
assertNotNull(typeParam);
assertStringsEqual("Type parameter bounds signatures",
"Ljava.lang.Object;\n" +
- "Lgeneric.I<-TT;>;\n",
+ "Lgeneric.I<-TT;>;\n",
typeParam.getBoundsSignatures());
}
@@ -1588,7 +1588,7 @@ public void testGenericFieldGetTypeSignature() throws JavaModelException {
"X.class").getType();
IMethod method = type.getMethod("foo", new String[] { "TK;", "TV;" });
ITypeParameter typeParam = method.getTypeParameter("V");
- assertStringsEqual("Type parameter bounds signatures",
+ assertStringsEqual("Type parameter bounds signatures",
"TT;\n", typeParam.getBoundsSignatures());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=316937
@@ -1646,9 +1646,9 @@ public void testGenericFieldGetTypeSignature() throws JavaModelException {
* Ensures that if more than one thread try to open a class file at the same time, the children are correct.
*/
public void testBug372687() throws CoreException {
- String expected = "X.class\n" +
- " class X\n" +
- " X()\n" +
+ String expected = "X.class\n" +
+ " class X\n" +
+ " X()\n" +
" void foo()";
class GetClassThread extends Thread {
public String childString;
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClassNameTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClassNameTests.java
index b07baee0a..c0771038d 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClassNameTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClassNameTests.java
@@ -1274,7 +1274,7 @@ public void testBug302455() throws CoreException, InterruptedException {
assertNotNull("We should have got a Java Source content type!", javaContentType);
javaContentType.addFileSpec("b302455", IContentType.FILE_EXTENSION_SPEC);
IJavaProject javaProject = createJavaProject("P");
- createFolder("/P/p");
+ createFolder("/P/p");
String filePath = "/P/p/Bug.b302455";
createFile(
filePath,
@@ -1284,14 +1284,14 @@ public void testBug302455() throws CoreException, InterruptedException {
""
);
waitUntilIndexesReady();
-
+
// Get the secondary type
IType type = javaProject.findType("p.Secondary", new NullProgressMonitor());
assertNotNull("We should have found the secondary type!", type);
-
+
// Remove file extension
javaContentType.removeFileSpec("b302455", IContentType.FILE_EXTENSION_SPEC);
-
+
// As there's no specific event fo
type = javaProject.findType("p.Secondary", new NullProgressMonitor());
assertNull("We should have not found the secondary type!", type);
@@ -1312,19 +1312,19 @@ public void testBug306477() throws Exception {
createFolder("/P/p");
createFile(
"/P/p/Alice.java",
- "package p;\n" +
- "class Alice {\n" +
- " Object j = Bob.CHARLIE;\n" +
+ "package p;\n" +
+ "class Alice {\n" +
+ " Object j = Bob.CHARLIE;\n" +
"}\n"
);
createFile(
"/P/p/Misc.java",
- "package p;\n" +
- "enum Bob {\n" +
- " CHARLIE;\n" +
+ "package p;\n" +
+ "enum Bob {\n" +
+ " CHARLIE;\n" +
"}\n"
);
-
+
// find secondary enum
IType type = project.findType("p.Bob", new NullProgressMonitor());
assertElementEquals("We should have found the secondary enum 'Bob'!",
@@ -1343,7 +1343,7 @@ public void testBug351498() throws CoreException, InterruptedException {
assertNotNull("We should have got a Java Source content type!", javaContentType);
javaContentType.addFileSpec("b351498", IContentType.FILE_EXTENSION_SPEC);
IJavaProject javaProject = createJavaProject("P");
- createFolder("/P/p");
+ createFolder("/P/p");
String filePath = "/P/p/Bug.b351498";
createFile(
filePath,
@@ -1354,14 +1354,14 @@ public void testBug351498() throws CoreException, InterruptedException {
""
);
waitUntilIndexesReady();
-
+
// Get the secondary type
IType type = javaProject.findType("p.Secondary", new NullProgressMonitor());
assertNotNull("We should have found the secondary type!", type);
-
+
// Remove file extension
javaContentType.removeFileSpec("b351498", IContentType.FILE_EXTENSION_SPEC);
-
+
// As there's no specific event fo
type = javaProject.findType("p.Secondary", new NullProgressMonitor());
assertNull("We should have not found the secondary type!", type);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathInitializerTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathInitializerTests.java
index 2cbf889bd..3e75d99af 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathInitializerTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathInitializerTests.java
@@ -1061,12 +1061,12 @@ public void testContainerInitializer26() throws CoreException {
new String[] {"org.eclipse.jdt.core.tests.model.TEST_CONTAINER"},
"");
ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"P2", "/P1"}));
-
+
waitForAutoBuild();
- getWorkspace().save(true/*full save*/, null/*no progress*/);
+ getWorkspace().save(true/*full save*/, null/*no progress*/);
p2.getProject().close(null); // close the project after the save and before the shutdown
JavaModelManager.getJavaModelManager().shutdown();
-
+
startLogListening();
simulateRestart();
assertLogEquals(""); // no error should be logged
@@ -1371,8 +1371,8 @@ public void testVariableInitializerDeprecated() throws CoreException, IOExceptio
// Create project
IJavaProject project = createJavaProject("P1");
addLibrary(project, "lib.jar", null, new String[0],
- new String[]{"META-INF/MANIFEST.MF",
- "Manifest-Version: 1.0\n"} ,
+ new String[]{"META-INF/MANIFEST.MF",
+ "Manifest-Version: 1.0\n"} ,
JavaCore.VERSION_1_4);
IClasspathEntry variable = JavaCore.newVariableEntry(new Path("TEST_DEPRECATED"), null, null);
IJavaModelStatus status = JavaConventions.validateClasspathEntry(project, variable, false);
@@ -1428,8 +1428,8 @@ public void testVariableInitializerReadOnly() throws CoreException, IOException
// Create project
IJavaProject project = createJavaProject("P1");
addLibrary(project, "lib.jar", null, new String[0],
- new String[]{"META-INF/MANIFEST.MF",
- "Manifest-Version: 1.0\n"} ,
+ new String[]{"META-INF/MANIFEST.MF",
+ "Manifest-Version: 1.0\n"} ,
JavaCore.VERSION_1_4);
IClasspathEntry variable = JavaCore.newVariableEntry(new Path("TEST_READ_ONLY"), null, null);
IJavaModelStatus status = JavaConventions.validateClasspathEntry(project, variable, false);
@@ -1456,8 +1456,8 @@ public void testVariableInitializerDeprecatedAndReadOnly() throws CoreException,
// Create project
IJavaProject project = createJavaProject("P1");
addLibrary(project, "lib.jar", null, new String[0],
- new String[]{"META-INF/MANIFEST.MF",
- "Manifest-Version: 1.0\n"} ,
+ new String[]{"META-INF/MANIFEST.MF",
+ "Manifest-Version: 1.0\n"} ,
JavaCore.VERSION_1_4);
IClasspathEntry variable = JavaCore.newVariableEntry(new Path("TEST_DEPRECATED_READ_ONLY"), null, null);
IJavaModelStatus status = JavaConventions.validateClasspathEntry(project, variable, false);
@@ -1490,8 +1490,8 @@ public void testVariableInitializerBug172207() throws CoreException, IOException
// Create project
IJavaProject project = createJavaProject("P1");
addLibrary(project, "lib.jar", null, new String[0],
- new String[]{"META-INF/MANIFEST.MF",
- "Manifest-Version: 1.0\n"} ,
+ new String[]{"META-INF/MANIFEST.MF",
+ "Manifest-Version: 1.0\n"} ,
JavaCore.VERSION_1_4);
IClasspathEntry variable = JavaCore.newVariableEntry(new Path("TEST_DEPRECATED_READ_ONLY"), null, null);
IClasspathEntry[] entries = project.getRawClasspath();
@@ -1666,7 +1666,7 @@ public void testBug346002() throws Exception {
}
/*
- * Ensures that when multiple threads enter the batch container initialization,
+ * Ensures that when multiple threads enter the batch container initialization,
* a second thread does not initialize a container if the first thread has already completed it
*/
public void testBug525597() throws CoreException {
@@ -1759,7 +1759,7 @@ public void testBug525597() throws CoreException {
}
}
/*
- * Ensures that when multiple threads enter the batch container initialization,
+ * Ensures that when multiple threads enter the batch container initialization,
* and two threads both initialize a container, only one result is used.
*/
public void testBug525597B() throws CoreException {
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathTests.java
index bf51da4f8..4b8edbcae 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathTests.java
@@ -212,12 +212,12 @@ public void test124117() throws CoreException {
IClasspathEntry newClasspath = JavaCore.newContainerEntry(new Path("container/default"));
IJavaModelStatus status = JavaConventions.validateClasspathEntry(p, newClasspath, true);
-
+
assertStatus(
"should NOT have complained about missing library as it is optional",
"OK",
status);
-
+
} finally {
deleteProject ("P0");
}
@@ -225,15 +225,15 @@ public void test124117() throws CoreException {
/* https://bugs.eclipse.org/bugs/show_bug.cgi?id=232816: Misleading problem text for missing jar in user
* library. We now mention the container name in this and related diagnostics so the context and connection is clearer.
- * The bunch of tests with names of the form test232816*() test several paths in the function
+ * The bunch of tests with names of the form test232816*() test several paths in the function
* org.eclipse.jdt.internal.core.ClasspathEntry.validateLibraryEntry(IPath, IJavaProject, String, IPath, String)
* with the sole objective of eliciting the various messages under the different conditions (internal/external,
* file/folder, problem with library/sources etc). The tests probably make not much sense other than to trigger
* errors.
*/
-
+
public void test232816() throws Exception {
-
+
IJavaProject p = null;
try {
p = createJavaProject("P");
@@ -248,7 +248,7 @@ public void test232816() throws Exception {
null);
IClasspathEntry newClasspath = JavaCore.newContainerEntry(new Path("container/default"));
-
+
IJavaModelStatus status = JavaConventions.validateClasspathEntry(p, newClasspath, true);
assertStatus(
"should have complained about missing library",
@@ -261,11 +261,11 @@ public void test232816() throws Exception {
public void test232816a() throws Exception {
-
+
IJavaProject p = null;
try {
p = createJavaProject("P");
- addExternalLibrary(p, getExternalResourcePath("lib1.jar"), new String[0],
+ addExternalLibrary(p, getExternalResourcePath("lib1.jar"), new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n" +
@@ -285,7 +285,7 @@ public void test232816a() throws Exception {
null);
IClasspathEntry newClasspath = JavaCore.newContainerEntry(new Path("container/default"));
-
+
IJavaModelStatus status = JavaConventions.validateClasspathEntry(p, newClasspath, true);
assertStatus(
"should have complained about source attachment",
@@ -298,7 +298,7 @@ public void test232816a() throws Exception {
}
public void test232816b() throws Exception {
-
+
try {
IJavaProject p = createJavaProject("Project");
// Create new user library "SomeUserLibrary"
@@ -317,8 +317,8 @@ public void test232816b() throws Exception {
propertyValue.append("\"/>\r\n</userlibrary>\r\n");
preferences.put(propertyName, propertyValue.toString());
preferences.flush();
-
-
+
+
IClasspathEntry[] entries = p.getRawClasspath();
int length = entries.length;
System.arraycopy(entries, 0, entries = new IClasspathEntry[length+1], 0, length);
@@ -338,7 +338,7 @@ public void test232816c() throws CoreException {
try {
p = this.createJavaProject("P0", new String[] {"src0", "src1"}, "bin0");
-
+
JavaCore.setClasspathContainer(
new Path("container/default"),
new IJavaProject[]{ p },
@@ -350,7 +350,7 @@ public void test232816c() throws CoreException {
null);
IClasspathEntry newClasspath = JavaCore.newContainerEntry(new Path("container/default"));
-
+
IJavaModelStatus status = JavaConventions.validateClasspathEntry(p, newClasspath, true);
assertStatus(
"should have complained about missing library",
@@ -381,7 +381,7 @@ public void test232816d() throws CoreException {
null);
IClasspathEntry newClasspath = JavaCore.newContainerEntry(new Path("container/default"));
-
+
IJavaModelStatus status = JavaConventions.validateClasspathEntry(p, newClasspath, true);
assertStatus(
"should have complained about source attachment",
@@ -410,7 +410,7 @@ public void test232816e() throws CoreException {
null);
IClasspathEntry newClasspath = JavaCore.newContainerEntry(new Path("container/default"));
-
+
IJavaModelStatus status = JavaConventions.validateClasspathEntry(p, newClasspath, true);
assertStatus(
"should have complained about source attachment",
@@ -423,14 +423,14 @@ public void test232816e() throws CoreException {
}
public void test232816f() throws Exception {
-
+
IJavaProject p = null;
try {
p = createJavaProject("P");
-
+
p.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_4);
p.setOption(JavaCore.CORE_INCOMPATIBLE_JDK_LEVEL, JavaCore.WARNING);
-
+
JavaCore.setClasspathContainer(
new Path("container/default"),
new IJavaProject[]{ p },
@@ -442,7 +442,7 @@ public void test232816f() throws Exception {
null);
IClasspathEntry newClasspath = JavaCore.newContainerEntry(new Path("container/default"));
-
+
IJavaModelStatus status = JavaConventions.validateClasspathEntry(p, newClasspath, true);
assertStatus(
"should have complained about jdk level mismatch",
@@ -687,8 +687,8 @@ public void testAddZIPArchive7() throws CoreException, IOException {
refreshExternalArchives(p);
waitForAutoBuild();
addLibrary(p, "internalLib.abc", null, new String[0],
- new String[]{"META-INF/MANIFEST.MF",
- "Manifest-Version: 1.0\n"} ,
+ new String[]{"META-INF/MANIFEST.MF",
+ "Manifest-Version: 1.0\n"} ,
JavaCore.VERSION_1_4);
setClasspath(p, new IClasspathEntry[] {JavaCore.newLibraryEntry(new Path("/P/internalLib.abc"), null, null)});
assertBuildPathMarkers("Unexpected markers", "", p);
@@ -1031,10 +1031,10 @@ public void testClasspathCreateLocalJarLibraryEntry() throws CoreException {
try {
assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN | CONTENT | RAW CLASSPATH CHANGED | RESOLVED CLASSPATH CHANGED}\n" +
- " <project root>[*]: {REMOVED FROM CLASSPATH}\n" +
- " "+ getExternalJCLPathString() + "[+]: {}\n" +
+ "Unexpected delta",
+ "P[*]: {CHILDREN | CONTENT | RAW CLASSPATH CHANGED | RESOLVED CLASSPATH CHANGED}\n" +
+ " <project root>[*]: {REMOVED FROM CLASSPATH}\n" +
+ " "+ getExternalJCLPathString() + "[+]: {}\n" +
" ResourceDelta(/P/.classpath)[*]"
);
} finally {
@@ -1273,10 +1273,10 @@ public void testClasspathReordering() throws CoreException {
startDeltas();
setClasspath(proj, newEntries);
assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN | CONTENT | RAW CLASSPATH CHANGED | RESOLVED CLASSPATH CHANGED}\n" +
- " src[*]: {REORDERED}\n" +
- " "+ getExternalJCLPathString() + "[*]: {REORDERED}\n" +
+ "Unexpected delta",
+ "P[*]: {CHILDREN | CONTENT | RAW CLASSPATH CHANGED | RESOLVED CLASSPATH CHANGED}\n" +
+ " src[*]: {REORDERED}\n" +
+ " "+ getExternalJCLPathString() + "[*]: {REORDERED}\n" +
" ResourceDelta(/P/.classpath)[*]"
);
} finally {
@@ -2645,8 +2645,8 @@ public void testDotDotContainerEntry1() throws Exception {
setClasspath(p, new IClasspathEntry[] {JavaCore.newContainerEntry(new Path("org.eclipse.jdt.core.tests.model.TEST_CONTAINER"))});
assertElementDescendants(
"Unexpected project content",
- "P\n" +
- " "+ getExternalPath() + "external.jar\n" +
+ "P\n" +
+ " "+ getExternalPath() + "external.jar\n" +
" <default> (...)",
p
);
@@ -2666,7 +2666,7 @@ public void testDotDotContainerEntry2() throws Exception {
ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"P", "../../nonExisting.jar"}));
setClasspath(p, new IClasspathEntry[] {JavaCore.newContainerEntry(new Path("org.eclipse.jdt.core.tests.model.TEST_CONTAINER"))});
assertBuildPathMarkers(
- "Unexpected markers",
+ "Unexpected markers",
"The container 'Test container' references non existing library \'" + getExternalPath() + "nonExisting.jar\'",
p);
} finally {
@@ -2688,8 +2688,8 @@ public void testDotDotLibraryEntry1() throws Exception {
setClasspath(p, new IClasspathEntry[] {JavaCore.newLibraryEntry(new Path("../external.jar"), null, null)});
assertElementDescendants(
"Unexpected project content",
- "P\n" +
- " "+ getWorkspacePath() + "external.jar\n" +
+ "P\n" +
+ " "+ getWorkspacePath() + "external.jar\n" +
" <default> (...)",
p
);
@@ -2712,8 +2712,8 @@ public void testDotDotLibraryEntry2() throws Exception {
setClasspath(p, new IClasspathEntry[] {JavaCore.newLibraryEntry(new Path("../../external.jar"), null, null)});
assertElementDescendants(
"Unexpected project content",
- "P\n" +
- " "+ getExternalPath() + "external.jar\n" +
+ "P\n" +
+ " "+ getExternalPath() + "external.jar\n" +
" <default> (...)",
p
);
@@ -2736,8 +2736,8 @@ public void testDotDotLibraryEntry3() throws Exception {
setClasspath(p, new IClasspathEntry[] {JavaCore.newLibraryEntry(new Path("src/../../../external.jar"), null, null)});
assertElementDescendants(
"Unexpected project content",
- "P\n" +
- " "+ getExternalPath() + "external.jar\n" +
+ "P\n" +
+ " "+ getExternalPath() + "external.jar\n" +
" <default> (...)",
p
);
@@ -2754,16 +2754,16 @@ public void testDotDotLibraryEntry4() throws Exception {
try {
IJavaProject p1 = createJavaProject("P1");
IJavaProject p2 = createJavaProject("P2");
-
+
addLibrary(p1, "internal.jar", null, new String[0],
- new String[]{"META-INF/MANIFEST.MF",
- "Manifest-Version: 1.0\n"} ,
- JavaCore.VERSION_1_4);
+ new String[]{"META-INF/MANIFEST.MF",
+ "Manifest-Version: 1.0\n"} ,
+ JavaCore.VERSION_1_4);
setClasspath(p2, new IClasspathEntry[] {JavaCore.newLibraryEntry(new Path("../P1/internal.jar"), null, null)});
assertElementDescendants(
"Unexpected project content",
- "P2\n" +
- " /P1/internal.jar\n" +
+ "P2\n" +
+ " /P1/internal.jar\n" +
" <default> (...)",
p2
);
@@ -2785,8 +2785,8 @@ public void testDotDotLibraryEntry5() throws Exception {
JavaCore.VERSION_1_4);
setClasspath(p, new IClasspathEntry[] {JavaCore.newLibraryEntry(new Path("../external.jar"), null, null)});
assertBuildPathMarkers(
- "Unexpected markers",
- "",
+ "Unexpected markers",
+ "",
p);
} finally {
deleteResource(new File(externalJarPath));
@@ -2802,7 +2802,7 @@ public void testDotDotLibraryEntry6() throws Exception {
IJavaProject p = createJavaProject("P");
setClasspath(p, new IClasspathEntry[] {JavaCore.newLibraryEntry(new Path("../external.jar"), null, null)});
assertBuildPathMarkers(
- "Unexpected markers",
+ "Unexpected markers",
"Project \'P\' is missing required library: \'"+ getWorkspacePath() + "external.jar\'",
p);
} finally {
@@ -2822,18 +2822,18 @@ public void testDotDotLibraryEntry7() throws Exception {
JavaCore.VERSION_1_4);
editFile(
"/P/.classpath",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry kind=\"src\" path=\"\"/>\n" +
- " <classpathentry kind=\"lib\" path=\"../external.jar\"/>\n" +
- " <classpathentry kind=\"output\" path=\"\"/>\n" +
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
+ "<classpath>\n" +
+ " <classpathentry kind=\"src\" path=\"\"/>\n" +
+ " <classpathentry kind=\"lib\" path=\"../external.jar\"/>\n" +
+ " <classpathentry kind=\"output\" path=\"\"/>\n" +
"</classpath>");
assertElementDescendants(
"Unexpected project content",
- "P\n" +
- " <project root>\n" +
- " <default> (...)\n" +
- " "+ getWorkspacePath() + "external.jar\n" +
+ "P\n" +
+ " <project root>\n" +
+ " <default> (...)\n" +
+ " "+ getWorkspacePath() + "external.jar\n" +
" <default> (...)",
p
);
@@ -2851,15 +2851,15 @@ public void testDotDotLibraryEntry8() throws Exception {
IJavaProject p = createJavaProject("P");
editFile(
"/P/.classpath",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry kind=\"src\" path=\"\"/>\n" +
- " <classpathentry kind=\"lib\" path=\"../external.jar\"/>\n" +
- " <classpathentry kind=\"output\" path=\"\"/>\n" +
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
+ "<classpath>\n" +
+ " <classpathentry kind=\"src\" path=\"\"/>\n" +
+ " <classpathentry kind=\"lib\" path=\"../external.jar\"/>\n" +
+ " <classpathentry kind=\"output\" path=\"\"/>\n" +
"</classpath>");
assertClasspathEquals(
- p.getRawClasspath(),
- "/P[CPE_SOURCE][K_SOURCE][isExported:false]\n" +
+ p.getRawClasspath(),
+ "/P[CPE_SOURCE][K_SOURCE][isExported:false]\n" +
"../external.jar[CPE_LIBRARY][K_BINARY][isExported:false]"
);
} finally {
@@ -2881,8 +2881,8 @@ public void testDotDotVariableEntry1() throws Exception {
setClasspath(p, new IClasspathEntry[] {JavaCore.newVariableEntry(new Path("TWO_UP/external.jar"), null, null)});
assertElementDescendants(
"Unexpected project content",
- "P\n" +
- " "+ getExternalPath() + "external.jar\n" +
+ "P\n" +
+ " "+ getExternalPath() + "external.jar\n" +
" <default> (...)",
p
);
@@ -2902,7 +2902,7 @@ public void testDotDotVariableEntry2() throws Exception {
IJavaProject p = createJavaProject("P");
setClasspath(p, new IClasspathEntry[] {JavaCore.newVariableEntry(new Path("TWO_UP/nonExisting.jar"), null, null)});
assertBuildPathMarkers(
- "Unexpected markers",
+ "Unexpected markers",
"Project \'P\' is missing required library: \'"+ getExternalPath() + "nonExisting.jar\'",
p);
} finally {
@@ -2982,9 +2982,9 @@ public void testEncoding2() throws Exception {
output.close();
}
file.refreshLocal(IResource.DEPTH_ONE, null);
-
+
assertClasspathEquals(
- p.getResolvedClasspath(false),
+ p.getResolvedClasspath(false),
"/P/src[CPE_SOURCE][K_SOURCE][isExported:false]"
);
} finally {
@@ -3331,7 +3331,7 @@ public void testExtraAttributes4() throws CoreException {
public void testExtraLibraries01() throws Exception {
try {
IJavaProject p = createJavaProject("P");
- addLibrary(p, "lib1.jar", null, new String[0],
+ addLibrary(p, "lib1.jar", null, new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n" +
@@ -3340,10 +3340,10 @@ public void testExtraLibraries01() throws Exception {
JavaCore.VERSION_1_4);
createFile("/P/lib2.jar", "");
assertClasspathEquals(
- p.getResolvedClasspath(true),
- "/P[CPE_SOURCE][K_SOURCE][isExported:false]\n" +
- ""+ getExternalJCLPathString() + "[CPE_LIBRARY][K_BINARY][isExported:false]\n" +
- "/P/lib2.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
+ p.getResolvedClasspath(true),
+ "/P[CPE_SOURCE][K_SOURCE][isExported:false]\n" +
+ ""+ getExternalJCLPathString() + "[CPE_LIBRARY][K_BINARY][isExported:false]\n" +
+ "/P/lib2.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
"/P/lib1.jar[CPE_LIBRARY][K_BINARY][isExported:true]"
);
} finally {
@@ -3356,7 +3356,7 @@ public void testExtraLibraries01() throws Exception {
public void testExtraLibraries02() throws Exception {
try {
IJavaProject p = createJavaProject("P");
- addLibrary(p, "lib1.jar", null, new String[0],
+ addLibrary(p, "lib1.jar", null, new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n" +
@@ -3366,11 +3366,11 @@ public void testExtraLibraries02() throws Exception {
createFile("/P/lib2.jar", "");
createFile("/P/lib3.jar", "");
assertClasspathEquals(
- p.getResolvedClasspath(true),
- "/P[CPE_SOURCE][K_SOURCE][isExported:false]\n" +
- ""+ getExternalJCLPathString() + "[CPE_LIBRARY][K_BINARY][isExported:false]\n" +
- "/P/lib2.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
- "/P/lib3.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
+ p.getResolvedClasspath(true),
+ "/P[CPE_SOURCE][K_SOURCE][isExported:false]\n" +
+ ""+ getExternalJCLPathString() + "[CPE_LIBRARY][K_BINARY][isExported:false]\n" +
+ "/P/lib2.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
+ "/P/lib3.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
"/P/lib1.jar[CPE_LIBRARY][K_BINARY][isExported:true]"
);
} finally {
@@ -3391,7 +3391,7 @@ public void testExtraLibraries03() throws Exception {
"Class-Path: lib3.jar\n",
},
JavaCore.VERSION_1_4);
- addLibrary(p, "lib1.jar", null, new String[0],
+ addLibrary(p, "lib1.jar", null, new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n" +
@@ -3399,11 +3399,11 @@ public void testExtraLibraries03() throws Exception {
},
JavaCore.VERSION_1_4);
assertClasspathEquals(
- p.getResolvedClasspath(true),
- "/P[CPE_SOURCE][K_SOURCE][isExported:false]\n" +
- ""+ getExternalJCLPathString() + "[CPE_LIBRARY][K_BINARY][isExported:false]\n" +
- "/P/lib3.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
- "/P/lib2.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
+ p.getResolvedClasspath(true),
+ "/P[CPE_SOURCE][K_SOURCE][isExported:false]\n" +
+ ""+ getExternalJCLPathString() + "[CPE_LIBRARY][K_BINARY][isExported:false]\n" +
+ "/P/lib3.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
+ "/P/lib2.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
"/P/lib1.jar[CPE_LIBRARY][K_BINARY][isExported:true]"
);
} finally {
@@ -3416,7 +3416,7 @@ public void testExtraLibraries03() throws Exception {
public void testExtraLibraries04() throws Exception {
try {
IJavaProject p = createJavaProject("P");
- addLibrary(p, "lib1.jar", null, new String[0],
+ addLibrary(p, "lib1.jar", null, new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n" +
@@ -3432,11 +3432,11 @@ public void testExtraLibraries04() throws Exception {
JavaCore.VERSION_1_4);
createFile("/P/lib3.jar", "");
assertClasspathEquals(
- p.getResolvedClasspath(true),
- "/P[CPE_SOURCE][K_SOURCE][isExported:false]\n" +
- ""+ getExternalJCLPathString() + "[CPE_LIBRARY][K_BINARY][isExported:false]\n" +
- "/P/lib3.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
- "/P/lib2.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
+ p.getResolvedClasspath(true),
+ "/P[CPE_SOURCE][K_SOURCE][isExported:false]\n" +
+ ""+ getExternalJCLPathString() + "[CPE_LIBRARY][K_BINARY][isExported:false]\n" +
+ "/P/lib3.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
+ "/P/lib2.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
"/P/lib1.jar[CPE_LIBRARY][K_BINARY][isExported:true]"
);
} finally {
@@ -3449,7 +3449,7 @@ public void testExtraLibraries04() throws Exception {
public void testExtraLibraries05() throws Exception {
try {
IJavaProject p = createJavaProject("P");
- addLibrary(p, "lib1.jar", null, new String[0],
+ addLibrary(p, "lib1.jar", null, new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n" +
@@ -3472,7 +3472,7 @@ public void testExtraLibraries05() throws Exception {
public void testExtraLibraries06() throws Exception {
try {
IJavaProject p = createJavaProject("P");
- addLibrary(p, "lib1.jar", null, new String[0],
+ addLibrary(p, "lib1.jar", null, new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n" +
@@ -3493,7 +3493,7 @@ public void testExtraLibraries06() throws Exception {
public void testExtraLibraries07() throws Exception {
try {
IJavaProject p = createJavaProject("P");
- addExternalLibrary(p, getExternalResourcePath("lib1.jar"), new String[0],
+ addExternalLibrary(p, getExternalResourcePath("lib1.jar"), new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n" +
@@ -3502,10 +3502,10 @@ public void testExtraLibraries07() throws Exception {
JavaCore.VERSION_1_4);
createExternalFile("lib2.jar", "");
assertClasspathEquals(
- p.getResolvedClasspath(true),
- "/P[CPE_SOURCE][K_SOURCE][isExported:false]\n" +
- ""+ getExternalJCLPathString() + "[CPE_LIBRARY][K_BINARY][isExported:false]\n" +
- ""+ getExternalPath() + "lib2.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
+ p.getResolvedClasspath(true),
+ "/P[CPE_SOURCE][K_SOURCE][isExported:false]\n" +
+ ""+ getExternalJCLPathString() + "[CPE_LIBRARY][K_BINARY][isExported:false]\n" +
+ ""+ getExternalPath() + "lib2.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
""+ getExternalPath() + "lib1.jar[CPE_LIBRARY][K_BINARY][isExported:true]"
);
} finally {
@@ -3520,7 +3520,7 @@ public void testExtraLibraries07() throws Exception {
public void testExtraLibraries08() throws Exception {
try {
IJavaProject p = createJavaProject("P");
- addExternalLibrary(p, getExternalResourcePath("lib1.jar"), new String[0],
+ addExternalLibrary(p, getExternalResourcePath("lib1.jar"), new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n" +
@@ -3546,7 +3546,7 @@ public void testExtraLibraries08() throws Exception {
public void testExtraLibraries09() throws Exception {
try {
IJavaProject p = createJavaProject("P");
- addExternalLibrary(p, getExternalResourcePath("lib1.jar"), new String[0],
+ addExternalLibrary(p, getExternalResourcePath("lib1.jar"), new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n" +
@@ -3570,7 +3570,7 @@ public void testExtraLibraries09() throws Exception {
public void testExtraLibraries10() throws Exception {
try {
IJavaProject p = createJavaProject("P");
- addExternalLibrary(p, getExternalResourcePath("lib1.jar"), new String[0],
+ addExternalLibrary(p, getExternalResourcePath("lib1.jar"), new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n" +
@@ -3580,7 +3580,7 @@ public void testExtraLibraries10() throws Exception {
createExternalFile("lib2.jar", "");
refreshExternalArchives(p);
waitForAutoBuild(); // wait until classpath is validated -> no markers
-
+
deleteExternalResource("lib2.jar");
refreshExternalArchives(p);
assertBuildPathMarkers(
@@ -3599,7 +3599,7 @@ public void testExtraLibraries10() throws Exception {
public void testExtraLibraries11() throws Exception {
try {
IJavaProject p = createJavaProject("P");
- addLibrary(p, "lib1.jar", null, new String[0],
+ addLibrary(p, "lib1.jar", null, new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n" +
@@ -3608,7 +3608,7 @@ public void testExtraLibraries11() throws Exception {
JavaCore.VERSION_1_4);
createFile("/P/lib2.jar", "");
startDeltas();
- createLibrary(p, "lib1.jar", null, new String[0],
+ createLibrary(p, "lib1.jar", null, new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n" +
@@ -3617,8 +3617,8 @@ public void testExtraLibraries11() throws Exception {
JavaCore.VERSION_1_4);
assertDeltas(
"Unexpected delta",
- "P[*]: {CHILDREN | RESOLVED CLASSPATH CHANGED}\n" +
- " lib1.jar[*]: {CONTENT | ARCHIVE CONTENT CHANGED}\n" +
+ "P[*]: {CHILDREN | RESOLVED CLASSPATH CHANGED}\n" +
+ " lib1.jar[*]: {CONTENT | ARCHIVE CONTENT CHANGED}\n" +
" lib2.jar[*]: {REMOVED FROM CLASSPATH}"
);
} finally {
@@ -3632,7 +3632,7 @@ public void testExtraLibraries11() throws Exception {
public void testExtraLibraries12() throws Exception {
try {
IJavaProject p = createJavaProject("P");
- addExternalLibrary(p, getExternalResourcePath("lib1.jar"), new String[0],
+ addExternalLibrary(p, getExternalResourcePath("lib1.jar"), new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n" +
@@ -3641,7 +3641,7 @@ public void testExtraLibraries12() throws Exception {
JavaCore.VERSION_1_4);
createExternalFile("lib2.jar", "");
refreshExternalArchives(p);
-
+
startDeltas();
org.eclipse.jdt.core.tests.util.Util.createJar(new String[0],
new String[] {
@@ -3654,8 +3654,8 @@ public void testExtraLibraries12() throws Exception {
refreshExternalArchives(p);
assertDeltas(
"Unexpected delta",
- "P[*]: {CHILDREN | RESOLVED CLASSPATH CHANGED}\n" +
- " "+ getExternalPath() + "lib1.jar[*]: {CONTENT | ARCHIVE CONTENT CHANGED}\n" +
+ "P[*]: {CHILDREN | RESOLVED CLASSPATH CHANGED}\n" +
+ " "+ getExternalPath() + "lib1.jar[*]: {CONTENT | ARCHIVE CONTENT CHANGED}\n" +
" "+ getExternalPath() + "lib2.jar[*]: {REMOVED FROM CLASSPATH}"
);
} finally {
@@ -3671,7 +3671,7 @@ public void testExtraLibraries12() throws Exception {
public void testExtraLibraries13() throws Exception {
try {
IJavaProject p = createJavaProject("P");
- addExternalLibrary(p, getExternalResourcePath("lib1.jar"), new String[0],
+ addExternalLibrary(p, getExternalResourcePath("lib1.jar"), new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n" +
@@ -3680,14 +3680,14 @@ public void testExtraLibraries13() throws Exception {
JavaCore.VERSION_1_4);
createExternalFile("lib2.jar", "");
refreshExternalArchives(p);
-
+
startDeltas();
deleteExternalResource("lib1.jar");
refreshExternalArchives(p);
assertDeltas(
"Unexpected delta",
- "P[*]: {CHILDREN | RESOLVED CLASSPATH CHANGED}\n" +
- " "+ getExternalPath() + "lib1.jar[-]: {}\n" +
+ "P[*]: {CHILDREN | RESOLVED CLASSPATH CHANGED}\n" +
+ " "+ getExternalPath() + "lib1.jar[-]: {}\n" +
" "+ getExternalPath() + "lib2.jar[*]: {REMOVED FROM CLASSPATH}"
);
} finally {
@@ -3742,7 +3742,7 @@ public void testExtraLibraries15() throws Exception {
ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"P", getExternalResourcePath("lib1.jar")}));
IJavaProject p = createJavaProject("P", new String[0], new String[] {"org.eclipse.jdt.core.tests.model.TEST_CONTAINER"}, "");
assertClasspathEquals(
- p.getResolvedClasspath(true),
+ p.getResolvedClasspath(true),
""+ getExternalPath() + "lib1.jar[CPE_LIBRARY][K_BINARY][isExported:false]"
);
} finally {
@@ -3782,7 +3782,7 @@ public void testExtraLibraries16() throws Exception {
public void testExtraLibraries17() throws Exception {
try {
IJavaProject p = createJavaProject("P");
- addExternalLibrary(p, getExternalResourcePath("lib.jar"), new String[0],
+ addExternalLibrary(p, getExternalResourcePath("lib.jar"), new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n" +
@@ -3790,7 +3790,7 @@ public void testExtraLibraries17() throws Exception {
},
JavaCore.VERSION_1_4);
waitForAutoBuild();
-
+
org.eclipse.jdt.core.tests.util.Util.createJar(
null/*no classes*/,
new String[] {
@@ -3821,10 +3821,10 @@ public void testFixClasspath1() throws CoreException, IOException {
IJavaProject project = createJavaProject("P2", new String[0], new String[0], "bin");
waitForAutoBuild();
addLibrary(project, "lib.jar", null, new String[0],
- new String[]{"META-INF/MANIFEST.MF",
- "Manifest-Version: 1.0\n"} ,
+ new String[]{"META-INF/MANIFEST.MF",
+ "Manifest-Version: 1.0\n"} ,
JavaCore.VERSION_1_4);
-
+
assertBuildPathMarkers(
"Unexpected markers",
"",
@@ -3845,10 +3845,10 @@ public void testFixClasspath2() throws CoreException, IOException {
org.eclipse.jdt.core.tests.util.Util.createEmptyJar(
getExternalResourcePath("externalLib.abc"),
JavaCore.VERSION_1_4);
-
+
simulateExitRestart();
refreshExternalArchives(p);
-
+
assertBuildPathMarkers("Unexpected markers", "", p);
} finally {
deleteExternalResource("externalLib.abc");
@@ -4006,13 +4006,13 @@ public void testTransitionFromInvalidToValidJar() throws CoreException, IOExcept
Util.createFile(transitioningJar, "");
Util.createFile(invalidJar, "");
IJavaProject proj = createJavaProject("P", new String[] {}, new String[] {transitioningJar, invalidJar}, "bin");
-
+
IJavaModelStatus status1 = ClasspathEntry.validateClasspathEntry(proj, transitioningEntry, false, false);
IJavaModelStatus status2 = ClasspathEntry.validateClasspathEntry(proj, nonExistingEntry, false, false);
assertFalse("Non-existing jar should be invalid", status1.isOK());
assertFalse("Non-existing jar should be invalid", status2.isOK());
- Util.createJar(
+ Util.createJar(
new String[0],
new String[] {
"META-INF/MANIFEST.MF",
@@ -4051,10 +4051,10 @@ public void testInvalidInternalJar1() throws CoreException {
public void testInvalidInternalJar2() throws CoreException, IOException {
try {
IJavaProject proj = createJavaProject("P1", new String[] {}, new String[0], "bin");
-
+
addLibrary(proj, "existing.txt", null, new String[0],
- new String[]{"META-INF/MANIFEST.MF",
- "Manifest-Version: 1.0\n"} ,
+ new String[]{"META-INF/MANIFEST.MF",
+ "Manifest-Version: 1.0\n"} ,
JavaCore.VERSION_1_4);
proj = createJavaProject("P2", new String[] {}, new String[] {"/P1/existing.txt"}, "bin");
assertBuildPathMarkers(
@@ -4190,12 +4190,12 @@ public void testMissingPrereq4() throws CoreException {
"");
this.assertBuildPathMarkers(
"Unexpected markers for project A",
- "One or more cycles were detected in the build path of project 'A'. The paths towards the cycle and cycle are:\n" +
+ "One or more cycles were detected in the build path of project 'A'. The paths towards the cycle and cycle are:\n" +
"->{A, B}",
projectA);
this.assertBuildPathMarkers(
"Unexpected markers for project B",
- "One or more cycles were detected in the build path of project 'B'. The paths towards the cycle and cycle are:\n" +
+ "One or more cycles were detected in the build path of project 'B'. The paths towards the cycle and cycle are:\n" +
"->{A, B}",
projectB);
@@ -4216,12 +4216,12 @@ public void testMissingPrereq4() throws CoreException {
"");
this.assertBuildPathMarkers(
"Unexpected markers for project A after adding project B back",
- "One or more cycles were detected in the build path of project 'A'. The paths towards the cycle and cycle are:\n" +
+ "One or more cycles were detected in the build path of project 'A'. The paths towards the cycle and cycle are:\n" +
"->{A, B}",
projectA);
this.assertBuildPathMarkers(
"Unexpected markers for project B after adding project B back",
- "One or more cycles were detected in the build path of project 'B'. The paths towards the cycle and cycle are:\n" +
+ "One or more cycles were detected in the build path of project 'B'. The paths towards the cycle and cycle are:\n" +
"->{A, B}",
projectB);
@@ -4256,7 +4256,7 @@ public void testPessimisticProvider() throws CoreException {
IClasspathEntry[] rawClasspath = new IClasspathEntry[] {JavaCore.newSourceEntry(new Path("/P/src2"))};
setClasspath(javaProject, rawClasspath);
assertClasspathEquals(
- javaProject.getRawClasspath(),
+ javaProject.getRawClasspath(),
"/P/src2[CPE_SOURCE][K_SOURCE][isExported:false]"
);
} finally {
@@ -4306,7 +4306,7 @@ public void testReadOnly() throws CoreException {
IClasspathEntry[] newCP= new IClasspathEntry[originalCP.length + 1];
System.arraycopy(originalCP, 0 , newCP, 0, originalCP.length);
newCP[originalCP.length]= newEntry;
-
+
classpathFile = getFile("/P/.classpath");
org.eclipse.jdt.internal.core.util.Util.setReadOnly(classpathFile, true);
JavaModelException expected = null;
@@ -4824,7 +4824,7 @@ public void testCycleDetection3() throws CoreException {
assertCycleMarkers(p[i], p, expectedCycleParticipants[i], false);
assertCycleMarkers(p[i], p, expectedCycleParticipants[i], true);
}
-
+
IMarker[] markers = p[0].getProject().findMarkers(IJavaModelMarker.BUILDPATH_PROBLEM_MARKER, false, IResource.DEPTH_ZERO);
// additionally see that we actually have 2 cycles for P0!
assertMarkers("Markers of P0",
@@ -5075,8 +5075,8 @@ public void testDuplicateEntries2() throws CoreException, IOException {
VariablesInitializer.setInitializer(new DefaultVariableInitializer(new String[] {"TEST_LIB", "/P/lib.jar"}));
ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"P", "/P/lib.jar"}));
addLibrary(project, "lib.jar", null, new String[0],
- new String[]{"META-INF/MANIFEST.MF",
- "Manifest-Version: 1.0\n"} ,
+ new String[]{"META-INF/MANIFEST.MF",
+ "Manifest-Version: 1.0\n"} ,
JavaCore.VERSION_1_4);
editFile(
"/P/.classpath",
@@ -5640,10 +5640,10 @@ public void testRemoveZIPArchive5() throws CoreException {
public void testRemoveZIPArchive6() throws CoreException, IOException {
try {
IJavaProject p = createJavaProject("P", new String[0], new String[0], "");
-
+
addLibrary(p, "internalLib.abc", null, new String[0],
- new String[]{"META-INF/MANIFEST.MF",
- "Manifest-Version: 1.0\n"} ,
+ new String[]{"META-INF/MANIFEST.MF",
+ "Manifest-Version: 1.0\n"} ,
JavaCore.VERSION_1_4);
waitForAutoBuild();
@@ -5668,8 +5668,8 @@ public void testRenameJar() throws CoreException, IOException {
final IJavaProject p = createJavaProject("P", new String[0], new String[0], "");
createFolder("/P/lib");
addLibrary(p, "lib/test1.jar", null, new String[0],
- new String[]{"META-INF/MANIFEST.MF",
- "Manifest-Version: 1.0\n"} ,
+ new String[]{"META-INF/MANIFEST.MF",
+ "Manifest-Version: 1.0\n"} ,
JavaCore.VERSION_1_4);
// at this point no markers exist
@@ -5980,7 +5980,7 @@ public void testForceNullArgumentsToEmptySet2() throws CoreException {
/**
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=170197"
- * Make sure null references don't make their way into ClasspathEntry's state
+ * Make sure null references don't make their way into ClasspathEntry's state
*/
public void testForceNullArgumentsToEmptySet3() throws CoreException {
IClasspathEntry e = JavaCore.newProjectEntry(new Path("/P2"), null, false, null, false);
@@ -6007,7 +6007,7 @@ public void testForceNullArgumentsToEmptySet4() throws CoreException {
* Make sure null references don't make their way into ClasspathEntry's state
*/
public void testForceNullArgumentsToEmptySet5() throws CoreException {
- IClasspathEntry e = JavaCore.newVariableEntry(new Path("JCL_LIB"), new Path("JCL_SRC"), null, null, null, false);
+ IClasspathEntry e = JavaCore.newVariableEntry(new Path("JCL_LIB"), new Path("JCL_SRC"), null, null, null, false);
assertTrue("Access rule was null", e.getAccessRules() != null);
assertTrue("Extra attributes was null", e.getExtraAttributes() != null);
assertTrue("Inclusion pattern was null", e.getInclusionPatterns() != null);
@@ -6019,7 +6019,7 @@ public void testForceNullArgumentsToEmptySet5() throws CoreException {
* 1. Variable Entry
* 2. User Library
* 3. External Jar file
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=276373"
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=280497"
* @throws Exception
@@ -6043,7 +6043,7 @@ public void testBug276373() throws Exception {
libJar = new File(libDir, "userLib.jar");
libJar.createNewFile();
-
+
ClasspathContainerInitializer initializer= JavaCore.getClasspathContainerInitializer(JavaCore.USER_LIBRARY_CONTAINER_ID);
String libraryName = "TestUserLibrary";
IPath containerPath = new Path(JavaCore.USER_LIBRARY_CONTAINER_ID);
@@ -6056,17 +6056,17 @@ public void testBug276373() throws Exception {
propertyValue.append(" path=\"" + libJar.getAbsolutePath());
propertyValue.append("\"/>\r\n</userlibrary>\r\n");
preferences.put(propertyName, propertyValue.toString());
- preferences.flush();
-
+ preferences.flush();
+
classpath[2] = JavaCore.newContainerEntry(containerSuggestion.getPath());
proj.setRawClasspath(classpath, null);
-
+
IResource resource = getWorkspaceRoot().getProject("P").getFile("lib/variableLib.jar");
assertTrue(proj.isOnClasspath(resource));
IJavaElement element = proj.getPackageFragmentRoot(resource);
assertTrue(proj.isOnClasspath(element));
assertNotNull(((JavaProject)proj).getClasspathEntryFor(resource.getFullPath()));
-
+
resource = getWorkspaceRoot().getProject("P").getFile("lib/externalLib.jar");
assertTrue(proj.isOnClasspath(resource));
element = proj.getPackageFragmentRoot(resource);
@@ -6085,13 +6085,13 @@ public void testBug276373() throws Exception {
}
this.deleteProject("P");
JavaCore.removeClasspathVariable("MyVar", null);
- }
+ }
}
/**
* @bug 248661:Axis2: Missing required libraries in Axis 2 WS Client Projects
* @test that a variable classpath entry that is mappped to a folder/jar with external path (but still
- * inside the project folder) can be validated using both system absolute path and relative path.
- *
+ * inside the project folder) can be validated using both system absolute path and relative path.
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=248661"
*/
public void testBug248661() throws Exception {
@@ -6104,11 +6104,11 @@ public void testBug248661() throws Exception {
IClasspathEntry[] classpath = new IClasspathEntry[1];
classpath[0] = JavaCore.newVariableEntry(folderPath, null, null);
setClasspath(proj, classpath);
-
+
IClasspathEntry cpe = JavaCore.newLibraryEntry(folder.getFullPath(), null, null);
IJavaModelStatus status = JavaConventions.validateClasspathEntry(proj, cpe, true);
assertEquals(IStatus.OK, status.getCode());
-
+
cpe = JavaCore.newLibraryEntry(folder.getLocation(), null, null);
status = JavaConventions.validateClasspathEntry(proj, cpe, true);
assertEquals(IStatus.OK, status.getCode());
@@ -6122,10 +6122,10 @@ public void testBug248661() throws Exception {
}
/**
* @bug 300136:classpathentry OPTIONAL attribute not honored for var entries
- *
- * Test that classpath entries (CPE_LIB, CPE_CONTAINER and CPE_VARIABLE) that are marked as optional
+ *
+ * Test that classpath entries (CPE_LIB, CPE_CONTAINER and CPE_VARIABLE) that are marked as optional
* in the .classpath file are not reported for errors.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=300136"
*/
public void testBug300136() throws Exception {
@@ -6138,22 +6138,22 @@ public void testBug300136() throws Exception {
new String[] {"INVALID_LIB",},
new IPath[] {new Path("/lib/tmp.jar")},
null);
-
+
StringBuffer buffer = new StringBuffer(
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<classpath>\n" +
" <classpathentry kind=\"var\" path=\"INVALID_LIB\">\n" +
- " <attributes>\n" +
+ " <attributes>\n" +
" <attribute name=\"optional\" value=\"true\"/>" +
" </attributes>\n" +
" </classpathentry>\n" +
" <classpathentry kind=\"var\" path=\"UNBOUND_VAR\">\n" +
- " <attributes>\n" +
+ " <attributes>\n" +
" <attribute name=\"optional\" value=\"true\"/>" +
" </attributes>\n" +
" </classpathentry>\n" +
" <classpathentry kind=\"con\" path=\"org.eclipse.jdt.core.tests.model.TEST_CONTAINER\">\n" +
- " <attributes>\n" +
+ " <attributes>\n" +
" <attribute name=\"optional\" value=\"true\"/>" +
" </attributes>\n" +
" </classpathentry>\n" +
@@ -6172,12 +6172,12 @@ public void testBug300136() throws Exception {
preferences.setAutoBuilding(autoBuild);
deleteProject("P");
JavaCore.removeClasspathVariable("INVALID_LIB", null);
- }
+ }
}
/**
- * Additional test for bug 300136 - Test that the errors are reported when the
+ * Additional test for bug 300136 - Test that the errors are reported when the
* optional attribute is not used.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=300136"
*/
public void testBug300136a() throws Exception {
@@ -6191,7 +6191,7 @@ public void testBug300136a() throws Exception {
new String[] {"INVALID_LIB",},
new IPath[] {libPath},
null);
-
+
StringBuffer buffer = new StringBuffer(
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<classpath>\n" +
@@ -6208,27 +6208,27 @@ public void testBug300136a() throws Exception {
);
assertBuildPathMarkers(
"Unexpected markers",
- "Project \'P\' is missing required library: \'" + libPath.toOSString() + "'\n" +
- "Unbound classpath container: \'org.eclipse.jdt.core.tests.model.TEST_CONTAINER\' in project \'P\'\n" +
+ "Project \'P\' is missing required library: \'" + libPath.toOSString() + "'\n" +
+ "Unbound classpath container: \'org.eclipse.jdt.core.tests.model.TEST_CONTAINER\' in project \'P\'\n" +
"Unbound classpath variable: \'UNBOUND_VAR\' in project \'P\'",
project);
} finally {
preferences.setAutoBuilding(autoBuild);
deleteProject("P");
JavaCore.removeClasspathVariable("INVALID_LIB", null);
- }
+ }
}
/**
- * @bug 294360:Duplicate entries in Classpath Resolution when importing dependencies from parent project
+ * @bug 294360:Duplicate entries in Classpath Resolution when importing dependencies from parent project
* Test that duplicate entries are not added to the resolved classpath
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=294360"
* @throws Exception
- */
+ */
public void testBug294360a() throws Exception {
try {
IJavaProject p = createJavaProject("P");
- addExternalLibrary(p, getExternalResourcePath("lib.jar"), new String[0],
+ addExternalLibrary(p, getExternalResourcePath("lib.jar"), new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n",
@@ -6245,20 +6245,20 @@ public void testBug294360a() throws Exception {
"<classpath>\n" +
" <classpathentry kind=\"con\" path=\"org.eclipse.jdt.core.tests.model.TEST_CONTAINER\"/>\n" +
" <classpathentry kind=\"lib\" path=\""+ getExternalResourcePath("lib.jar") + "\">\n" +
- " <attributes>\n" +
+ " <attributes>\n" +
" <attribute name=\"optional\" value=\"true\"/>\n" +
" </attributes>\n" +
- " </classpathentry>\n" +
+ " </classpathentry>\n" +
" <classpathentry kind=\"output\" path=\"\"/>\n" +
"</classpath>\n");
-
+
editFile(
"/P/.classpath",
buffer.toString()
- );
+ );
IClasspathEntry[] resolvedClasspath = p.getResolvedClasspath(true);
- assertClasspathEquals(resolvedClasspath,
+ assertClasspathEquals(resolvedClasspath,
""+ getExternalPath() + "lib.jar[CPE_LIBRARY][K_BINARY][isExported:false]");
} finally {
deleteProject("P");
@@ -6270,16 +6270,16 @@ public void testBug294360a() throws Exception {
* Test that 1) referenced libraries are added to the resolved classpath in the right order
* 2) referenced libraries are added to the appropriate referencing library in the correct order
* 3) referenced libraries and top-level libraries retain the source attachment and source attachment root path
- * 4) referenced libraries point to the correct entry as their referencingEntry.
+ * 4) referenced libraries point to the correct entry as their referencingEntry.
* 5) referenced libraries and their attributes are persisted in the .classpath file
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=252431"
* @throws Exception
- */
+ */
public void testBug252341a() throws Exception {
try {
IJavaProject p = createJavaProject("P");
- addLibrary(p, "lib1.jar", "abc.zip", new String[0],
+ addLibrary(p, "lib1.jar", "abc.zip", new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n" +
@@ -6288,42 +6288,42 @@ public void testBug252341a() throws Exception {
JavaCore.VERSION_1_4);
createFile("/P/lib2.jar", "");
createFile("/P/lib3.jar", "");
-
+
// Test referenced entries are included in the right order in the resolved classpath
IClasspathEntry[] resolvedClasspath = p.getResolvedClasspath(true);
- assertClasspathEquals(resolvedClasspath,
- "/P[CPE_SOURCE][K_SOURCE][isExported:false]\n" +
- ""+ getExternalJCLPathString() + "[CPE_LIBRARY][K_BINARY][isExported:false]\n" +
- "/P/lib2.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
- "/P/lib3.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
+ assertClasspathEquals(resolvedClasspath,
+ "/P[CPE_SOURCE][K_SOURCE][isExported:false]\n" +
+ ""+ getExternalJCLPathString() + "[CPE_LIBRARY][K_BINARY][isExported:false]\n" +
+ "/P/lib2.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
+ "/P/lib3.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
"/P/lib1.jar[CPE_LIBRARY][K_BINARY][sourcePath:/P/abc.zip][isExported:true]");
-
+
IClasspathEntry[] rawClasspath = p.getRawClasspath();
assertClasspathEquals(rawClasspath,
- "/P[CPE_SOURCE][K_SOURCE][isExported:false]\n" +
- "JCL_LIB[CPE_VARIABLE][K_SOURCE][isExported:false]\n" +
+ "/P[CPE_SOURCE][K_SOURCE][isExported:false]\n" +
+ "JCL_LIB[CPE_VARIABLE][K_SOURCE][isExported:false]\n" +
"/P/lib1.jar[CPE_LIBRARY][K_BINARY][sourcePath:/P/abc.zip][isExported:true]");
// Test referenced entries for a particular entry appear in the right order and the referencingEntry
// attribute has the correct value
IClasspathEntry[] chains = JavaCore.getReferencedClasspathEntries(rawClasspath[2], null);
- assertClasspathEquals(chains,
- "/P/lib2.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
+ assertClasspathEquals(chains,
+ "/P/lib2.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
"/P/lib3.jar[CPE_LIBRARY][K_BINARY][isExported:true]");
chains = JavaCore.getReferencedClasspathEntries(rawClasspath[2], p);
- assertClasspathEquals(chains,
- "/P/lib2.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
+ assertClasspathEquals(chains,
+ "/P/lib2.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
"/P/lib3.jar[CPE_LIBRARY][K_BINARY][isExported:true]");
assertSame("Referencing Entry", rawClasspath[2], chains[0].getReferencingEntry());
assertSame("Referencing Entry", rawClasspath[2], chains[1].getReferencingEntry());
-
- // Test a newly created library entry with similar attributes but without any referencing entry is equal to
+
+ // Test a newly created library entry with similar attributes but without any referencing entry is equal to
// the original referenced entry
IClasspathEntry tempLibEntry = JavaCore.newLibraryEntry(chains[0].getPath(), chains[0].getSourceAttachmentPath(), chains[0].getSourceAttachmentRootPath(), true);
assertEquals("Library Entry", tempLibEntry, chains[0]);
-
+
// Test the source attachment and other attributes added to the referenced entries are stored and retrieved properly
assertEquals("source attachment", resolvedClasspath[4].getSourceAttachmentPath().toPortableString(), "/P/abc.zip");
assertNull("source attachment", chains[0].getSourceAttachmentPath());
@@ -6338,45 +6338,45 @@ public void testBug252341a() throws Exception {
IClasspathAttribute javadocLoc = JavaCore.newClasspathAttribute("javadoc_location", "/P/efg.zip");
((ClasspathEntry)chains[0]).extraAttributes = new IClasspathAttribute[]{javadocLoc};
-
+
p.setRawClasspath(rawClasspath, chains, p.getOutputLocation(), null);
-
+
// Test the .classpath file contains all the referenced entries and their attributes
String contents = new String (org.eclipse.jdt.internal.core.util.Util.getResourceContentsAsCharArray(getFile("/P/.classpath")));
assertSourceEquals(
"Unexpected content",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry kind=\"src\" path=\"\"/>\n" +
- " <classpathentry kind=\"var\" path=\"JCL_LIB\"/>\n" +
- " <classpathentry exported=\"true\" kind=\"lib\" path=\"lib1.jar\" sourcepath=\"abc.zip\"/>\n" +
- " <classpathentry kind=\"output\" path=\"\"/>\n" +
- " <referencedentry exported=\"true\" kind=\"lib\" path=\"lib2.jar\" rootpath=\"/src2\" sourcepath=\"efg.zip\">\n" +
- " <attributes>\n" +
- " <attribute name=\"javadoc_location\" value=\"/P/efg.zip\"/>\n" +
- " </attributes>\n" +
- " </referencedentry>\n" +
- " <referencedentry exported=\"true\" kind=\"lib\" path=\"lib3.jar\" rootpath=\"/src3\" sourcepath=\"xyz.zip\"/>\n" +
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
+ "<classpath>\n" +
+ " <classpathentry kind=\"src\" path=\"\"/>\n" +
+ " <classpathentry kind=\"var\" path=\"JCL_LIB\"/>\n" +
+ " <classpathentry exported=\"true\" kind=\"lib\" path=\"lib1.jar\" sourcepath=\"abc.zip\"/>\n" +
+ " <classpathentry kind=\"output\" path=\"\"/>\n" +
+ " <referencedentry exported=\"true\" kind=\"lib\" path=\"lib2.jar\" rootpath=\"/src2\" sourcepath=\"efg.zip\">\n" +
+ " <attributes>\n" +
+ " <attribute name=\"javadoc_location\" value=\"/P/efg.zip\"/>\n" +
+ " </attributes>\n" +
+ " </referencedentry>\n" +
+ " <referencedentry exported=\"true\" kind=\"lib\" path=\"lib3.jar\" rootpath=\"/src3\" sourcepath=\"xyz.zip\"/>\n" +
"</classpath>\n",
contents);
-
+
p.close();
p.open(null);
rawClasspath = p.getRawClasspath();
resolvedClasspath = p.getResolvedClasspath(true);
assertClasspathEquals(rawClasspath,
- "/P[CPE_SOURCE][K_SOURCE][isExported:false]\n" +
- "JCL_LIB[CPE_VARIABLE][K_SOURCE][isExported:false]\n" +
+ "/P[CPE_SOURCE][K_SOURCE][isExported:false]\n" +
+ "JCL_LIB[CPE_VARIABLE][K_SOURCE][isExported:false]\n" +
"/P/lib1.jar[CPE_LIBRARY][K_BINARY][sourcePath:/P/abc.zip][isExported:true]");
- assertClasspathEquals(resolvedClasspath,
- "/P[CPE_SOURCE][K_SOURCE][isExported:false]\n" +
- ""+ getExternalJCLPathString() + "[CPE_LIBRARY][K_BINARY][isExported:false]\n" +
- "/P/lib2.jar[CPE_LIBRARY][K_BINARY][sourcePath:/P/efg.zip][rootPath:/src2][isExported:true][attributes:javadoc_location=/P/efg.zip]\n" +
- "/P/lib3.jar[CPE_LIBRARY][K_BINARY][sourcePath:/P/xyz.zip][rootPath:/src3][isExported:true]\n" +
+ assertClasspathEquals(resolvedClasspath,
+ "/P[CPE_SOURCE][K_SOURCE][isExported:false]\n" +
+ ""+ getExternalJCLPathString() + "[CPE_LIBRARY][K_BINARY][isExported:false]\n" +
+ "/P/lib2.jar[CPE_LIBRARY][K_BINARY][sourcePath:/P/efg.zip][rootPath:/src2][isExported:true][attributes:javadoc_location=/P/efg.zip]\n" +
+ "/P/lib3.jar[CPE_LIBRARY][K_BINARY][sourcePath:/P/xyz.zip][rootPath:/src3][isExported:true]\n" +
"/P/lib1.jar[CPE_LIBRARY][K_BINARY][sourcePath:/P/abc.zip][isExported:true]");
-
+
} finally {
deleteProject("P");
}
@@ -6389,23 +6389,23 @@ public void testBug252341a() throws Exception {
* entry that was commonly referenced by another entry and the referenced entry's source
* attachment and other attributes are retained.
* 3) Passing a NULL referencedEntries array retains the referenced entries
- * 4) Passing an empty array as referencedEntries clears the earlier referenced entries
- *
+ * 4) Passing an empty array as referencedEntries clears the earlier referenced entries
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=252431"
* @throws Exception
*/
public void testBug252341b() throws Exception {
try {
IJavaProject p = createJavaProject("P");
- addLibrary(p, "lib1.jar", null, new String[0],
+ addLibrary(p, "lib1.jar", null, new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n" +
"Class-Path: lib3.jar lib4.jar\n",
},
JavaCore.VERSION_1_4);
-
- addLibrary(p, "lib2.jar", null, new String[0],
+
+ addLibrary(p, "lib2.jar", null, new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n" +
@@ -6415,49 +6415,49 @@ public void testBug252341b() throws Exception {
createFile("/P/lib3.jar", "");
createFile("/P/lib4.jar", "");
createFile("/P/lib5.jar", "");
-
+
// Test that the referenced entries are not included in the raw classpath
IClasspathEntry[] rawClasspath = p.getRawClasspath();
assertClasspathEquals(
rawClasspath,
- "/P[CPE_SOURCE][K_SOURCE][isExported:false]\n" +
- "JCL_LIB[CPE_VARIABLE][K_SOURCE][isExported:false]\n" +
- "/P/lib1.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
+ "/P[CPE_SOURCE][K_SOURCE][isExported:false]\n" +
+ "JCL_LIB[CPE_VARIABLE][K_SOURCE][isExported:false]\n" +
+ "/P/lib1.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
"/P/lib2.jar[CPE_LIBRARY][K_BINARY][isExported:true]");
IClasspathEntry[] rawEntries = new IClasspathEntry[2];
rawEntries[0] = JavaCore.newLibraryEntry(new Path("/P/lib1.jar"), null, null, true);
rawEntries[1] = JavaCore.newLibraryEntry(new Path("/P/lib2.jar"), null, null, true);
-
+
// Test that the referenced entries are included in the raw classpath and in the right order
IClasspathEntry[] resolvedClasspath = p.getResolvedClasspath(true);
- assertClasspathEquals(resolvedClasspath,
- "/P[CPE_SOURCE][K_SOURCE][isExported:false]\n" +
- ""+ getExternalJCLPathString() + "[CPE_LIBRARY][K_BINARY][isExported:false]\n" +
- "/P/lib3.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
- "/P/lib4.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
- "/P/lib1.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
- "/P/lib5.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
+ assertClasspathEquals(resolvedClasspath,
+ "/P[CPE_SOURCE][K_SOURCE][isExported:false]\n" +
+ ""+ getExternalJCLPathString() + "[CPE_LIBRARY][K_BINARY][isExported:false]\n" +
+ "/P/lib3.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
+ "/P/lib4.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
+ "/P/lib1.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
+ "/P/lib5.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
"/P/lib2.jar[CPE_LIBRARY][K_BINARY][isExported:true]");
// Test that the referenced classpath entries has the appropriate referencingEntry value
- IClasspathEntry[] chains = JavaCore.getReferencedClasspathEntries(rawEntries[0], p);
+ IClasspathEntry[] chains = JavaCore.getReferencedClasspathEntries(rawEntries[0], p);
assertClasspathEquals(
- chains,
- "/P/lib3.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
+ chains,
+ "/P/lib3.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
"/P/lib4.jar[CPE_LIBRARY][K_BINARY][isExported:true]");
- assertEquals("Referencing Entry" , rawEntries[0], chains[0].getReferencingEntry());
- assertEquals("Referencing Entry" , rawEntries[0], chains[1].getReferencingEntry());
+ assertEquals("Referencing Entry" , rawEntries[0], chains[0].getReferencingEntry());
+ assertEquals("Referencing Entry" , rawEntries[0], chains[1].getReferencingEntry());
chains = JavaCore.getReferencedClasspathEntries(rawEntries[1], p);
assertClasspathEquals(
- chains,
- "/P/lib3.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
+ chains,
+ "/P/lib3.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
"/P/lib5.jar[CPE_LIBRARY][K_BINARY][isExported:true]");
-
+
assertEquals("Referencing Entry" , rawEntries[0], chains[0].getReferencingEntry());
assertEquals("Referencing Entry" , rawEntries[1], chains[1].getReferencingEntry());
-
+
// // Test IPackageFragmentRoot#getResolvedClasspathEntry
IPackageFragmentRoot[] roots = p.getPackageFragmentRoots();
assertEquals("Package fragment root", roots[2].getResolvedClasspathEntry(), resolvedClasspath[2]);
@@ -6465,7 +6465,7 @@ public void testBug252341b() throws Exception {
assertEquals("Package fragment root", roots[4].getResolvedClasspathEntry(), resolvedClasspath[4]);
assertEquals("Package fragment root", roots[5].getResolvedClasspathEntry(), resolvedClasspath[5]);
assertEquals("Package fragment root", roots[6].getResolvedClasspathEntry(), resolvedClasspath[6]);
-
+
// Test the attributes added to the referenced classpath entries are stored and retrieved properly
((ClasspathEntry)chains[0]).sourceAttachmentPath = new Path("/P/efg.zip");
((ClasspathEntry)chains[1]).sourceAttachmentPath = new Path("/P/xyz.zip");
@@ -6477,7 +6477,7 @@ public void testBug252341b() throws Exception {
p.setRawClasspath(rawClasspath, chains, p.getOutputLocation(), null);
resolvedClasspath = p.getResolvedClasspath(true);
-
+
assertClasspathEquals(resolvedClasspath,
"/P[CPE_SOURCE][K_SOURCE][isExported:false]\n" +
""+ getExternalJCLPathString() + "[CPE_LIBRARY][K_BINARY][isExported:false]\n" +
@@ -6486,8 +6486,8 @@ public void testBug252341b() throws Exception {
"/P/lib1.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
"/P/lib5.jar[CPE_LIBRARY][K_BINARY][sourcePath:/P/xyz.zip][rootPath:/src3][isExported:true]\n" +
"/P/lib2.jar[CPE_LIBRARY][K_BINARY][isExported:true]");
-
- // Test that removing any of the referencing entry from the raw classpath has the correct effect
+
+ // Test that removing any of the referencing entry from the raw classpath has the correct effect
// on the resolved classpath. Also test passing referencedEntries = null retains the existing
// referenced entries
IClasspathEntry[] newRawClasspath = new IClasspathEntry[rawClasspath.length-1];
@@ -6502,7 +6502,7 @@ public void testBug252341b() throws Exception {
"/P/lib5.jar[CPE_LIBRARY][K_BINARY][sourcePath:/P/xyz.zip][rootPath:/src3][isExported:true]\n" +
"/P/lib2.jar[CPE_LIBRARY][K_BINARY][isExported:true]");
- // Test that passing empty array of referencedEntries clears all the earlier ones.
+ // Test that passing empty array of referencedEntries clears all the earlier ones.
p.setRawClasspath(newRawClasspath, new IClasspathEntry[]{}, p.getOutputLocation(), null);
resolvedClasspath = p.getResolvedClasspath(true);
assertClasspathEquals(resolvedClasspath,
@@ -6519,24 +6519,24 @@ public void testBug252341b() throws Exception {
/**
* Additional tests for bug 252431.
* Test that duplicate referenced entries or entries that are already present in the raw classpath
- * are excluded from the referenced entries when invoking
+ * are excluded from the referenced entries when invoking
* {@link IJavaProject#setRawClasspath(IClasspathEntry[], IClasspathEntry[], IPath, IProgressMonitor)}
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=252431"
* @throws Exception
*/
public void testBug252341c() throws Exception {
try {
IJavaProject p = createJavaProject("P");
- addLibrary(p, "lib1.jar", null, new String[0],
+ addLibrary(p, "lib1.jar", null, new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n" +
"Class-Path: lib3.jar lib4.jar\n",
},
JavaCore.VERSION_1_4);
-
- addLibrary(p, "lib2.jar", null, new String[0],
+
+ addLibrary(p, "lib2.jar", null, new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n" +
@@ -6546,35 +6546,35 @@ public void testBug252341c() throws Exception {
createFile("/P/lib3.jar", "");
createFile("/P/lib4.jar", "");
createFile("/P/lib5.jar", "");
-
+
IClasspathEntry[] rawClasspath = p.getRawClasspath();
-
+
IClasspathEntry[] rawEntries = new IClasspathEntry[2];
rawEntries[0] = JavaCore.newLibraryEntry(new Path("/P/lib1.jar"), null, null, true);
rawEntries[1] = JavaCore.newLibraryEntry(new Path("/P/lib2.jar"), null, null, true);
-
+
// Test that the referenced classpath entries has the appropriate referencingEntry value
IClasspathEntry[] chains = JavaCore.getReferencedClasspathEntries(rawEntries[0], p);
IClasspathEntry[] referencedEntries = new IClasspathEntry[5];
- referencedEntries[0] = chains[0];
- referencedEntries[1] = chains[1];
-
+ referencedEntries[0] = chains[0];
+ referencedEntries[1] = chains[1];
+
chains = JavaCore.getReferencedClasspathEntries(rawEntries[1], p);
referencedEntries[2] = chains[0];
referencedEntries[3] = chains[1];
referencedEntries[4] = chains[1];
-
+
p.setRawClasspath(rawClasspath, referencedEntries, p.getOutputLocation(), null);
-
+
p.close();
p.open(null);
-
+
IClasspathEntry[] storedReferencedEnties = p.getReferencedClasspathEntries();
- assertClasspathEquals(storedReferencedEnties,
- "/P/lib3.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
- "/P/lib4.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
+ assertClasspathEquals(storedReferencedEnties,
+ "/P/lib3.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
+ "/P/lib4.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
"/P/lib5.jar[CPE_LIBRARY][K_BINARY][isExported:true]");
}
finally {
@@ -6585,8 +6585,8 @@ public void testBug252341c() throws Exception {
* @bug 304081:IJavaProject#isOnClasspath(IJavaElement) returns false for type from referenced JAR
* When the JAR, which a variable classpath entry resolves to, references other JAR via
* MANIFEST, test that {@link IJavaProject#isOnClasspath(IJavaElement)} returns true
- * for the referenced classpath entries.
- *
+ * for the referenced classpath entries.
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=304081"
* @throws Exception
*/
@@ -6601,20 +6601,20 @@ public void testBug304081() throws Exception {
IClasspathEntry[] classpath = new IClasspathEntry[1];
File libJar = new File(libDir, "variable.jar");
libJar.createNewFile();
-
- addLibrary(proj, "variable.jar", null, new String[0],
+
+ addLibrary(proj, "variable.jar", null, new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n" +
"Class-Path: lib1.jar\n",
},
- JavaCore.VERSION_1_4);
+ JavaCore.VERSION_1_4);
createFile("/P/lib1.jar", "");
-
+
classpath[0] = JavaCore.newVariableEntry(new Path(
"/MyVar/variable.jar"), null, null);
-
+
proj.setRawClasspath(classpath, null);
waitForAutoBuild();
IProject project = getWorkspaceRoot().getProject("P");
@@ -6636,8 +6636,8 @@ public void testBug304081() throws Exception {
* Additional tests for 304081
* When the JAR, which is in the raw classpath, references other JAR via
* MANIFEST, test that {@link IJavaProject#isOnClasspath(IJavaElement)} returns true
- * for the referenced classpath entries.
- *
+ * for the referenced classpath entries.
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=304081"
* @throws Exception
*/
@@ -6647,16 +6647,16 @@ public void testBug304081a() throws Exception {
IJavaProject proj = this.createJavaProject("P", new String[] {}, "bin");
IClasspathEntry[] classpath = new IClasspathEntry[1];
- addLibrary(proj, "library.jar", null, new String[0],
+ addLibrary(proj, "library.jar", null, new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n" +
"Class-Path: lib1.jar\n",
},
JavaCore.VERSION_1_4);
- createFile("/P/lib1.jar", "");
+ createFile("/P/lib1.jar", "");
classpath[0] = JavaCore.newLibraryEntry(new Path("/P/library.jar"), null, null);
-
+
proj.setRawClasspath(classpath, null);
waitForAutoBuild();
IProject project = getWorkspaceRoot().getProject("P");
@@ -6675,11 +6675,11 @@ public void testBug304081a() throws Exception {
}
/**
* @bug 302949: FUP of 302949
- * Test that
+ * Test that
* 1) non-chaining jars are cached during classpath resolution and can be retrieved later on
* 2) A full save (after resetting the non chaining jars cache) caches the non-chaining jars information
* 3) when a project is deleted, the non-chaining jar cache is reset.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=305122"
* @throws Exception
*/
@@ -6689,13 +6689,13 @@ public void testBug305122() throws Exception {
IJavaProject proj = this.createJavaProject("P", new String[] {}, "bin");
IClasspathEntry[] classpath = new IClasspathEntry[2];
- addLibrary(proj, "nonchaining.jar", null, new String[0],
+ addLibrary(proj, "nonchaining.jar", null, new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n",
},
JavaCore.VERSION_1_4);
- addLibrary(proj, "chaining.jar", null, new String[0],
+ addLibrary(proj, "chaining.jar", null, new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n" +
@@ -6706,13 +6706,13 @@ public void testBug305122() throws Exception {
classpath[0] = JavaCore.newLibraryEntry(new Path("/P/nonchaining.jar"), null, null);
classpath[1] = JavaCore.newLibraryEntry(new Path("/P/chaining.jar"), null, null);
createFile("/P/chained.jar", "");
-
+
proj.setRawClasspath(classpath, null);
waitForAutoBuild();
JavaModelManager manager = JavaModelManager.getJavaModelManager();
assertTrue("Non chaining Jar", manager.isNonChainingJar(classpath[0].getPath()));
assertFalse("Chaining Jar", manager.isNonChainingJar(classpath[1].getPath()));
-
+
((JavaProject)proj).resetResolvedClasspath();
proj.getResolvedClasspath(true);
manager = JavaModelManager.getJavaModelManager();
@@ -6724,11 +6724,11 @@ public void testBug305122() throws Exception {
workspace.save(true, null);
assertTrue("Non chaining Jar", manager.isNonChainingJar(classpath[0].getPath()));
assertFalse("Chaining Jar", manager.isNonChainingJar(classpath[1].getPath()));
-
+
this.deleteProject("P");
assertFalse("Chaining Jar", manager.isNonChainingJar(classpath[0].getPath()));
assertFalse("Chaining Jar", manager.isNonChainingJar(classpath[1].getPath()));
-
+
} finally {
IProject proj = this.getProject("P");
if ( proj != null && proj.exists())
@@ -6739,7 +6739,7 @@ public void testBug305122() throws Exception {
* @bug 308150: JAR with invalid Class-Path entry in MANIFEST.MF crashes the project
* Test that an invalid referenced library entry in the Class-Path of the MANIFEST doesn't
* create any exceptions and is NOT added to the resolved classpath.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=308150"
* @throws Exception
*/
@@ -6750,7 +6750,7 @@ public void testBug308150() throws Exception {
IClasspathEntry[] classpath = new IClasspathEntry[1];
// The Class-Path references an entry that points to the workspace root (hence invalid)
- addLibrary(proj, "invalid.jar", null, new String[0],
+ addLibrary(proj, "invalid.jar", null, new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n" +
@@ -6763,7 +6763,7 @@ public void testBug308150() throws Exception {
waitForAutoBuild();
IClasspathEntry[] resolvedClasspath = proj.getResolvedClasspath(true);
- assertClasspathEquals(resolvedClasspath,
+ assertClasspathEquals(resolvedClasspath,
"/P/invalid.jar[CPE_LIBRARY][K_BINARY][isExported:false]");
} finally {
this.deleteProject("P");
@@ -6771,9 +6771,9 @@ public void testBug308150() throws Exception {
}
/**
* @bug 305037: missing story for attributes of referenced JARs in classpath containers
- * Test that attributes set on referenced libraries of variable entries via MANIFEST are persisted
+ * Test that attributes set on referenced libraries of variable entries via MANIFEST are persisted
* and can be retrieved
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=305037"
* @throws Exception
*/
@@ -6788,22 +6788,22 @@ public void testBug305037() throws Exception {
IClasspathEntry[] classpath = new IClasspathEntry[1];
File libJar = new File(libDir, "variable.jar");
libJar.createNewFile();
-
- addLibrary(proj, "variable.jar", null, new String[0],
+
+ addLibrary(proj, "variable.jar", null, new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n" +
"Class-Path: lib1.jar\n",
},
- JavaCore.VERSION_1_4);
+ JavaCore.VERSION_1_4);
createFile("/P/lib1.jar", "");
-
+
classpath = proj.getResolvedClasspath(true);
- assertClasspathEquals(classpath,
- "/P/lib1.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
+ assertClasspathEquals(classpath,
+ "/P/lib1.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" +
"/P/variable.jar[CPE_LIBRARY][K_BINARY][isExported:true]");
-
+
IClasspathEntry[] chains = JavaCore.getReferencedClasspathEntries(classpath[1], null);
assertClasspathEquals(chains, "/P/lib1.jar[CPE_LIBRARY][K_BINARY][isExported:true]");
((ClasspathEntry)chains[0]).sourceAttachmentPath = new Path("/P/efg.zip");
@@ -6811,11 +6811,11 @@ public void testBug305037() throws Exception {
IClasspathAttribute javadocLoc = JavaCore.newClasspathAttribute("javadoc_location", "/P/efg.zip");
((ClasspathEntry)chains[0]).extraAttributes = new IClasspathAttribute[]{javadocLoc};
-
+
proj.setRawClasspath(proj.getRawClasspath(), chains, proj.getOutputLocation(), null);
classpath = proj.getResolvedClasspath(true);
- assertClasspathEquals(classpath,
- "/P/lib1.jar[CPE_LIBRARY][K_BINARY][sourcePath:/P/efg.zip][rootPath:/src2][isExported:true][attributes:javadoc_location=/P/efg.zip]\n" +
+ assertClasspathEquals(classpath,
+ "/P/lib1.jar[CPE_LIBRARY][K_BINARY][sourcePath:/P/efg.zip][rootPath:/src2][isExported:true][attributes:javadoc_location=/P/efg.zip]\n" +
"/P/variable.jar[CPE_LIBRARY][K_BINARY][isExported:true]");
} finally {
this.deleteProject("P");
@@ -6823,10 +6823,10 @@ public void testBug305037() throws Exception {
}
}
/**
- * @bug 313965: Breaking change in classpath container API
+ * @bug 313965: Breaking change in classpath container API
* Test that when the resolveReferencedLibrariesForContainers system property is set to true, the referenced libraries
* for JARs from containers are resolved.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=313965"
* @throws Exception
*/
@@ -6840,13 +6840,13 @@ public void testBug313965() throws Exception {
simulateRestart();
}
IJavaProject p = this.createJavaProject("P", new String[] {}, "bin");
- addLibrary(p, "lib.jar", null, new String[0],
+ addLibrary(p, "lib.jar", null, new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n" +
"Class-Path: lib1.jar\n",
},
- JavaCore.VERSION_1_4);
+ JavaCore.VERSION_1_4);
IClasspathEntry[] classpath = new IClasspathEntry[1];
ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"P", "/P/lib.jar"}));
classpath[0] = JavaCore.newContainerEntry(new Path("org.eclipse.jdt.core.tests.model.TEST_CONTAINER"));
@@ -6854,8 +6854,8 @@ public void testBug313965() throws Exception {
createFile("/P/lib1.jar", "");
IClasspathEntry[] resolvedClasspath = p.getResolvedClasspath(true);
- assertClasspathEquals(resolvedClasspath,
- "/P/lib1.jar[CPE_LIBRARY][K_BINARY][isExported:false]\n" +
+ assertClasspathEquals(resolvedClasspath,
+ "/P/lib1.jar[CPE_LIBRARY][K_BINARY][isExported:false]\n" +
"/P/lib.jar[CPE_LIBRARY][K_BINARY][isExported:false]");
} finally {
deleteProject("P");
@@ -6866,10 +6866,10 @@ public void testBug313965() throws Exception {
}
}
/**
- * @bug 313965: Breaking change in classpath container API
- * Test that when the resolveReferencedLibrariesForContainers system property is set to false (or default),
+ * @bug 313965: Breaking change in classpath container API
+ * Test that when the resolveReferencedLibrariesForContainers system property is set to false (or default),
* the referenced libraries for JARs from containers are NOT resolved or added to the project's classpath.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=313965"
* @throws Exception
*/
@@ -6877,13 +6877,13 @@ public void testBug313965a() throws Exception {
try {
// Do not set the resolveReferencedLibrariesForContainers system property (the default value is false)
IJavaProject p = this.createJavaProject("P", new String[] {}, "bin");
- addLibrary(p, "lib.jar", null, new String[0],
+ addLibrary(p, "lib.jar", null, new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n" +
"Class-Path: lib1.jar\n",
},
- JavaCore.VERSION_1_4);
+ JavaCore.VERSION_1_4);
IClasspathEntry[] classpath = new IClasspathEntry[1];
ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"P", "/P/lib.jar"}));
classpath[0] = JavaCore.newContainerEntry(new Path("org.eclipse.jdt.core.tests.model.TEST_CONTAINER"));
@@ -6892,7 +6892,7 @@ public void testBug313965a() throws Exception {
createFile("/P/lib1.jar", "");
IClasspathEntry[] resolvedClasspath = p.getResolvedClasspath(true);
- assertClasspathEquals(resolvedClasspath,
+ assertClasspathEquals(resolvedClasspath,
"/P/lib.jar[CPE_LIBRARY][K_BINARY][isExported:false]");
} finally {
deleteProject("P");
@@ -6902,9 +6902,9 @@ public void testBug313965a() throws Exception {
public void testBug321170() throws Exception {
try {
IJavaProject p = this.createJavaProject("P", new String[] {}, "bin");
-
+
IFile file = this.createFile("/P/bin/X.java", "public class X {}");
-
+
IClasspathEntry[] classpath = new IClasspathEntry[1];
classpath[0] = JavaCore.newLibraryEntry(new Path("/P/bin/X.java"), null, null);
setClasspath(p, classpath);
@@ -6921,9 +6921,9 @@ public void testBug321170() throws Exception {
}
/**
* @bug 229042: [buildpath] could create build path error in case of invalid external JAR format
- *
+ *
* Test that an invalid archive (JAR) creates a buildpath error
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=229042"
* @throws Exception
*/
@@ -6932,10 +6932,10 @@ public void testBug229042() throws Exception {
IJavaProject p = createJavaProject("P");
createFile("/P/library.jar", "");
setClasspath(p, new IClasspathEntry[] { JavaCore.newLibraryEntry(new Path("/P/library.jar"), null,null)});
- assertBuildPathMarkers("Expected marker",
+ assertBuildPathMarkers("Expected marker",
"Archive for required library: \'library.jar\' in project \'P\' cannot be read or is not a valid ZIP file", p);
setClasspath(p, new IClasspathEntry[0]);
- addLibrary(p, "library.jar", null, new String[0],
+ addLibrary(p, "library.jar", null, new String[0],
new String[] {
"p/X.java",
"package p;\n" +
@@ -6948,18 +6948,18 @@ public void testBug229042() throws Exception {
assertNotNull(file);
file.touch(null);
waitForAutoBuild();
- assertBuildPathMarkers("Unexpected marker",
+ assertBuildPathMarkers("Unexpected marker",
"", p);
-
+
} finally {
deleteProject("P");
}
}
/**
* @bug 274737: Relative Classpath entries should not be resolved relative to the workspace
- *
+ *
* Test that for an external project, relative paths are resolve relative to the project location.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=274737"
* @throws Exception
*/
@@ -6974,7 +6974,7 @@ public void testBug274737() throws Exception {
if (!project.isOpen()) {
project.open(null);
}
-
+
addJavaNature("ExternalProject");
IJavaProject javaProject = JavaCore.create(project);
IClasspathEntry[] classpath = new IClasspathEntry[2];
@@ -6992,25 +6992,25 @@ public void testBug274737() throws Exception {
classpath[0] = JavaCore.newSourceEntry(new Path("/ExternalProject/src"), null, null);
classpath[1] = JavaCore.newLibraryEntry(new Path("../third_party/lib.jar"), null, null);
javaProject.setRawClasspath(classpath, new Path("/ExternalProject/bin"), null);
-
+
refresh(javaProject);
waitForAutoBuild();
assertBuildPathMarkers("Unexpected markers", "", javaProject);
-
+
} finally {
deleteProject("ExternalProject");
deleteExternalResource("development");
- }
+ }
}
/**
* @bug 338006: IJavaProject#getPackageFragmentRoots() should return roots in order
- *
+ *
* Test whether the {@link IJavaProject#getPackageFragmentRoots()} returns the package fragment
- * roots in the same order as defined by the .classpath even when the elements are added in a
+ * roots in the same order as defined by the .classpath even when the elements are added in a
* different order.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=338006"
*/
public void testBug338006() throws Exception {
@@ -7034,9 +7034,9 @@ public void testBug338006() throws Exception {
createFolder("/P/src a");
IPackageFragmentRoot[] roots = p.getPackageFragmentRoots();
- assertPackageFragmentRootsEqual(roots,
- "src a (not open) [in P]\n" +
- "src x (not open) [in P]\n" +
+ assertPackageFragmentRootsEqual(roots,
+ "src a (not open) [in P]\n" +
+ "src x (not open) [in P]\n" +
""+ getExternalJCLPathString() + " (not open)");
} finally {
@@ -7045,20 +7045,20 @@ public void testBug338006() throws Exception {
}
/*
- * Ensures that the correct delta is reported when changing the Class-Path: clause
+ * Ensures that the correct delta is reported when changing the Class-Path: clause
* of an external jar from not containing a chained jar to containing a chained jar.
* (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=357425)
*/
public void testBug357425() throws Exception {
try {
IJavaProject p = createJavaProject("P");
- addExternalLibrary(p, getExternalResourcePath("lib357425_a.jar"), new String[0],
+ addExternalLibrary(p, getExternalResourcePath("lib357425_a.jar"), new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n"
},
JavaCore.VERSION_1_4);
- refreshExternalArchives(p);
+ refreshExternalArchives(p);
startDeltas();
org.eclipse.jdt.core.tests.util.Util.createJar(new String[0],
@@ -7074,8 +7074,8 @@ public void testBug357425() throws Exception {
refreshExternalArchives(p);
assertDeltas(
"Unexpected delta",
- "P[*]: {CHILDREN | RESOLVED CLASSPATH CHANGED}\n" +
- " "+ getExternalPath() + "lib357425_a.jar[*]: {CONTENT | REORDERED | ARCHIVE CONTENT CHANGED}\n" +
+ "P[*]: {CHILDREN | RESOLVED CLASSPATH CHANGED}\n" +
+ " "+ getExternalPath() + "lib357425_a.jar[*]: {CONTENT | REORDERED | ARCHIVE CONTENT CHANGED}\n" +
" "+ getExternalPath() + "lib357425_b.jar[+]: {}"
);
} finally {
@@ -7087,13 +7087,13 @@ public void testBug357425() throws Exception {
}
/**
* @bug287164: Report build path error if source folder has other source folder as output folder
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=287164"
*/
public void testBug287164() throws CoreException {
try {
IJavaProject proj = this.createJavaProject("P", new String[] {}, "");
-
+
// Test that with the option set to IGNORE, the Java model status returns OK
proj.setOption(JavaCore.CORE_OUTPUT_LOCATION_OVERLAPPING_ANOTHER_SOURCE, JavaCore.IGNORE);
IClasspathEntry[] originalCP = proj.getRawClasspath();
@@ -7111,10 +7111,10 @@ public void testBug287164() throws CoreException {
assertStatus(
"OK",
status);
-
+
proj.setRawClasspath(newCP, null);
assertBuildPathMarkers("Unexpected markers", "", proj);
-
+
// Test that with the option set to WARNING, status.isOK() returns true
proj.setOption(JavaCore.CORE_OUTPUT_LOCATION_OVERLAPPING_ANOTHER_SOURCE, JavaCore.WARNING);
@@ -7124,9 +7124,9 @@ public void testBug287164() throws CoreException {
"Source folder \'src\' in project \'P\' cannot output to distinct source folder \'src2\'",
status);
- assertBuildPathMarkers("Unexpected markers",
+ assertBuildPathMarkers("Unexpected markers",
"Source folder \'src\' in project \'P\' cannot output to distinct source folder \'src2\'", proj);
-
+
// Test that with the option set to WARNING and the presence of a more severe error scenario, the error status
// is returned
IClasspathEntry[] newCP2 = new IClasspathEntry[newCP.length+1];
@@ -7139,14 +7139,14 @@ public void testBug287164() throws CoreException {
assertStatus(
"Source folder \'src2\' in project 'P' cannot output to library \'lib2\'",
status);
-
+
proj.setOption(JavaCore.CORE_OUTPUT_LOCATION_OVERLAPPING_ANOTHER_SOURCE, JavaCore.ERROR);
status = JavaConventions.validateClasspath(proj, newCP, proj.getOutputLocation());
assertStatus(
"Source folder \'src\' in project \'P\' cannot output to distinct source folder \'src2\'",
status);
-
+
} finally {
this.deleteProject("P");
}
@@ -7154,10 +7154,10 @@ public void testBug287164() throws CoreException {
/**
* @bug220928: [buildpath] Should be able to ignore warnings from certain source folders
- *
+ *
* Verify that adding the {@link IClasspathAttribute#IGNORE_OPTIONAL_PROBLEMS} attribute is
* correctly reflected by the {@link ClasspathEntry#ignoreOptionalProblems()} method.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=220928"
*/
public void testBug220928a() throws CoreException {
@@ -7177,10 +7177,10 @@ public void testBug220928a() throws CoreException {
/**
* @bug220928: [buildpath] Should be able to ignore warnings from certain source folders
- *
+ *
* Verify that value of the {@link IClasspathAttribute#IGNORE_OPTIONAL_PROBLEMS} attribute is
* correctly saved on workspace save.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=220928"
*/
public void testBug220928b() throws CoreException {
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompilationUnitTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompilationUnitTests.java
index 8b3d8c798..a5d1739db 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompilationUnitTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompilationUnitTests.java
@@ -494,37 +494,37 @@ public void testDeprecatedFlag09() throws JavaModelException {
}
/*
- * Bug 337868 - [compiler][model] incomplete support for package-info.java when using SearchableEnvironment
+ * Bug 337868 - [compiler][model] incomplete support for package-info.java when using SearchableEnvironment
* Ensure that package level annotation is evaluated during AST creation.
*/
public void testDeprecatedFlag10() throws CoreException {
try {
createFolder("/P/src/p2");
-
+
createFile(
"/P/src/p2/package-info.java",
"@java.lang.Deprecated package p2;\n"
);
-
+
// workaround for missing type in jclMin:
createFolder("/P/src/java/lang");
createFile(
"/P/src/java/lang/Deprecated.java",
"package java.lang;\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "public @interface Deprecated {\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "public @interface Deprecated {\n" +
"}\n"
);
-
- createFile("/P/src/p2/C.java",
+
+ createFile("/P/src/p2/C.java",
"package p2;\n" +
"public class C {}\n");
-
- createFile("/P/src/p/D.java",
+
+ createFile("/P/src/p/D.java",
"package p;\n" +
"public class D extends p2.C {}\n");
ICompilationUnit cuD = getCompilationUnit("/P/src/p/D.java");
-
+
ASTParser parser = ASTParser.newParser(JLS3_INTERNAL);
parser.setProject(this.testProject);
parser.setSource(cuD);
@@ -541,8 +541,8 @@ public void testDeprecatedFlag10() throws CoreException {
}
/*
- * Bug 337868 - [compiler][model] incomplete support for package-info.java when using SearchableEnvironment
- * Ensure that package level annotation is evaluated during AST creation.
+ * Bug 337868 - [compiler][model] incomplete support for package-info.java when using SearchableEnvironment
+ * Ensure that package level annotation is evaluated during AST creation.
* a working copy for package-info exists and must be used.
*/
public void testDeprecatedFlag11() throws CoreException {
@@ -566,11 +566,11 @@ public void testDeprecatedFlag11() throws CoreException {
"public @interface Deprecated {\n" +
"}\n"
);
-
+
createFile("/P/src/p2/C.java",
"package p2;\n" +
"public class C {}\n");
-
+
createFile("/P/src/p/D.java",
"package p;\n" +
"public class D extends p2.C {}\n");
@@ -2431,25 +2431,25 @@ public void test120902() throws CoreException {
public void test543266() throws CoreException {
try {
- String source =
- "/**\r\n" +
- " * enum A\r\n" +
- " */\r\n" +
- " public /** V1 */ enum /** V2 */ A /** V3 */ {\r\n" +
- " /** A */\r\n" +
- " a /**/, /**/ //\r\n" +
- " /** B */\r\n" +
- " b,\r\n" +
- " /** C */\r\n" +
- " /*\r\n" +
- " * \r\n" +
- " */\r\n" +
- " /** Real C */\r\n" +
- " c\r\n" +
+ String source =
+ "/**\r\n" +
+ " * enum A\r\n" +
+ " */\r\n" +
+ " public /** V1 */ enum /** V2 */ A /** V3 */ {\r\n" +
+ " /** A */\r\n" +
+ " a /**/, /**/ //\r\n" +
+ " /** B */\r\n" +
+ " b,\r\n" +
+ " /** C */\r\n" +
+ " /*\r\n" +
+ " * \r\n" +
+ " */\r\n" +
+ " /** Real C */\r\n" +
+ " c\r\n" +
" }";
createFile("/P/src/X.java", source);
final ICompilationUnit compilationUnit = getCompilationUnit("/P/src/X.java");
-
+
IType type = compilationUnit.getType("A");
final ISourceRange javadocRangeClass = type.getJavadocRange();
final int startClass = javadocRangeClass.getOffset();
@@ -2461,7 +2461,7 @@ public void test543266() throws CoreException {
for(IJavaElement child : children) {
final ISourceRange javadocRange = ((IMember) child).getJavadocRange();
final String elementName = child.getElementName();
-
+
if("a".equals(elementName)) {
final int start = javadocRange.getOffset();
final int end = javadocRange.getLength() + start - 1;
@@ -2566,9 +2566,9 @@ public void testApplyEdit3() throws CoreException {
});
this.workingCopy.createType("class Y {}", null, false, null);
assertSourceEquals(
- "Unexpeted source",
- "public class X {}\n" +
- "\n" +
+ "Unexpeted source",
+ "public class X {}\n" +
+ "\n" +
"class Y {}",
this.workingCopy.getSource());
}
@@ -2620,9 +2620,9 @@ public void testBug246594() throws CoreException {
IType type = this.workingCopy.getType("Z");
ITypeParameter[] typeParameters = type.getTypeParameters();
assertStringsEqual("Type parameter signature", "T:QObject;:QI<-QT;>;\n", type.getTypeParameterSignatures());
- assertStringsEqual("Type parameter bounds signatures",
+ assertStringsEqual("Type parameter bounds signatures",
"QObject;\n" +
- "QI<-QT;>;\n",
+ "QI<-QT;>;\n",
typeParameters[0].getBoundsSignatures());
}
public void testBug246594a() throws CoreException {
@@ -2635,28 +2635,28 @@ public void testBug246594a() throws CoreException {
"public interface I<T> {}");
IMethod[] methods = this.workingCopy.getType("Collection").getMethods();//<T:TE;>
ITypeParameter[] typeParameters = methods[1].getTypeParameters();
- assertStringsEqual("Type parameter bounds signatures",
+ assertStringsEqual("Type parameter bounds signatures",
"QE;\n" +
- "QI<-QString;>;\n",
+ "QI<-QString;>;\n",
typeParameters[0].getBoundsSignatures());
-
+
}
public void testBug495598_001() throws CoreException {
try {
createFolder("/P/src/a/b/C");
createFile("/P/src/a/b/C/readme.txt", "This is not a Java file");
-
+
createFile(
"/P/src/a/b/C.java",
"package a.b;\n" +
"public class C{};\n"
);
-
- createFile("/P/src/X.java",
+
+ createFile("/P/src/X.java",
"import a.b.C;\n" +
"public class X {}\n");
ICompilationUnit cuD = getCompilationUnit("/P/src/X.java");
-
+
ASTParser parser = ASTParser.newParser(AST_INTERNAL_LATEST);
parser.setProject(this.testProject);
parser.setSource(cuD);
@@ -2677,7 +2677,7 @@ public void testBug526615() throws CoreException {
createFile("/P/src/test1/B.java",
"package test1;\n" +
"public abstract class B {}");
-
+
StringBuffer buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("/**\n");
@@ -2691,7 +2691,7 @@ public void testBug526615() throws CoreException {
buf.append("}\n");
String contents= buf.toString();
createFile("/P/src/test1/A.java", contents);
-
+
ICompilationUnit cuA= getCompilationUnit("/P/src/test1/A.java");
IType typeA = cuA.getTypes()[0];
ISourceRange rangeA = typeA.getSourceRange();
@@ -2734,7 +2734,7 @@ public void testBug559618_2() throws CoreException { // Same as testBug559618_1,
createFile("/P/src/p/C.java",
"package p;\n" +
"public class C{};\n");
-
+
createFile("/P/src/p/D.java",
"package p;\n" +
"import p.*;\n" +
@@ -2744,7 +2744,7 @@ public void testBug559618_2() throws CoreException { // Same as testBug559618_1,
" }\n" +
"}\n");
ICompilationUnit cuD = getCompilationUnit("/P/src/p/D.java");
-
+
ASTParser parser = ASTParser.newParser(AST_INTERNAL_LATEST);
parser.setProject(this.testProject);
parser.setSource(cuD);
@@ -2765,7 +2765,7 @@ public void testBug559618_3() throws CoreException { // Nested class imports mus
"public class C{\n" +
" public class C1{};\n" +
"};\n");
-
+
createFile("/P/src/p/D.java",
"package p;\n" +
"import p.C.C1;\n" +
@@ -2775,7 +2775,7 @@ public void testBug559618_3() throws CoreException { // Nested class imports mus
" }\n" +
"}\n");
ICompilationUnit cuD = getCompilationUnit("/P/src/p/D.java");
-
+
ASTParser parser = ASTParser.newParser(AST_INTERNAL_LATEST);
parser.setProject(this.testProject);
parser.setSource(cuD);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionContextTests_1_5.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionContextTests_1_5.java
index 2a4c92e73..9c552788f 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionContextTests_1_5.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionContextTests_1_5.java
@@ -1313,7 +1313,7 @@ public void test0041() throws JavaModelException {
" @TestAnnot(value=\"\")\n" +
" public int field = 0;\n" +
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/Completion/src3/test/TestAnnot.java",
"package test;\n" +
@@ -1348,7 +1348,7 @@ public void test0042() throws JavaModelException {
" @TestAnnot(\"\")\n" +
" public int field = 0;\n" +
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/Completion/src3/test/TestAnnot.java",
"package test;\n" +
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests.java
index 3f8a2ccd2..421f9377d 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests.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
*******************************************************************************/
@@ -90,7 +90,7 @@ public void testAbortCompletion1() throws JavaModelException {
"}\n");
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
-
+
String str = this.workingCopies[0].getSource();
String completeBehind = "Objec";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -103,7 +103,7 @@ public void testAbortCompletion1() throws JavaModelException {
} catch (OperationCanceledException e) {
assertTrue("Should not be cancelled", false);
}
-
+
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=247941
@@ -118,11 +118,11 @@ public void testAbortCompletion2() throws JavaModelException {
"}\n");
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
-
+
String str = this.workingCopies[0].getSource();
String completeBehind = "Objec";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
-
+
try {
IProgressMonitor monitor = new NullProgressMonitor();
monitor.setCanceled(true); /*force completion to abort*/
@@ -150,12 +150,12 @@ public void testArrayInitializer1() throws JavaModelException {
"}\n");
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
-
+
String str = this.workingCopies[0].getSource();
String completeBehind = "bar(";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
assertResults(
"bar[METHOD_REF]{, LArrayInitializer;, ()I, bar, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
requestor.getResults());
@@ -188,7 +188,7 @@ public void testBug132679() throws JavaModelException {
" };\n" +
" }\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
String str = this.workingCopies[0].getSource();
String completeBehind = "foo.equ";
@@ -316,7 +316,7 @@ public void testBug99811() throws JavaModelException {
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=169682
public void testBug169682a() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
-
+
String source =
"package test;\n"+
"\n"+
@@ -414,9 +414,9 @@ public void testBug169682a() throws JavaModelException {
" }\n"+
" } \n"+
" }\n"+
- " }; \n"+
+ " }; \n"+
"}";
-
+
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/test/Test.java",
source);
@@ -433,7 +433,7 @@ public void testBug169682a() throws JavaModelException {
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=169682
public void testBug169682b() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
-
+
String source =
"package test;\n"+
"public class Test\n"+
@@ -442,7 +442,7 @@ public void testBug169682b() throws JavaModelException {
" int[] i;\n"+
" Obj x; // do ctrl+space at |\n"+
"}";
-
+
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/test/Test.java",
source);
@@ -460,7 +460,7 @@ public void testBug169682b() throws JavaModelException {
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=275518
public void testBug275518a() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
-
+
String source =
"package test;\n"+
"public class Test {\n"+
@@ -470,7 +470,7 @@ public void testBug275518a() throws JavaModelException {
" }\n"+
"\n"+
"}";
-
+
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/test/Test.java",
source);
@@ -499,7 +499,7 @@ public void testBug275518a() throws JavaModelException {
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=275518
public void testBug275518b() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
-
+
String source =
"package test;\n"+
"public class Test {\n"+
@@ -509,7 +509,7 @@ public void testBug275518b() throws JavaModelException {
" }\n"+
"\n"+
"}";
-
+
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/test/Test.java",
source);
@@ -538,7 +538,7 @@ public void testBug275518b() throws JavaModelException {
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=275518
public void testBug275518c() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
-
+
String source =
"package test;\n"+
"public class Test {\n"+
@@ -548,7 +548,7 @@ public void testBug275518c() throws JavaModelException {
" }\n"+
"\n"+
"}";
-
+
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/test/Test.java",
source);
@@ -5452,7 +5452,7 @@ public void testCompletionFieldName2() throws JavaModelException {
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=38111
-public void testCompletionFieldName3() throws JavaModelException {
+public void testCompletionFieldName3() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/test/TypeNameRequestor.java",
@@ -5475,7 +5475,7 @@ public void testCompletionFieldName3() throws JavaModelException {
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=38111
-public void testCompletionFieldName4() throws JavaModelException {
+public void testCompletionFieldName4() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/test/TypeNameRequestor.java",
@@ -5498,7 +5498,7 @@ public void testCompletionFieldName4() throws JavaModelException {
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=38111
-public void testCompletionFieldName5() throws JavaModelException {
+public void testCompletionFieldName5() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/test/TypeNameRequestor.java",
@@ -5521,7 +5521,7 @@ public void testCompletionFieldName5() throws JavaModelException {
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=38111
-public void testCompletionFieldName6() throws JavaModelException {
+public void testCompletionFieldName6() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/test/TypeNameRequestor.java",
@@ -5544,7 +5544,7 @@ public void testCompletionFieldName6() throws JavaModelException {
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=38111
-public void testCompletionFieldName7() throws JavaModelException {
+public void testCompletionFieldName7() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/test/TypeNameRequestor.java",
@@ -11453,7 +11453,7 @@ public void testCompletionKeywordThis15() throws JavaModelException {
assertResults(
"CompletionKeywordThis15.InnerClass[TYPE_REF]{InnerClass, , LCompletionKeywordThis15$InnerClass;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_INHERITED + R_NON_RESTRICTED) + "}\n" +
"class[FIELD_REF]{class, null, Ljava.lang.Class;, class, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_INHERITED + R_NON_RESTRICTED) + "}\n"+
- "super[KEYWORD]{super, null, null, super, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_INHERITED + R_NON_RESTRICTED) +"}\n"+
+ "super[KEYWORD]{super, null, null, super, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_INHERITED + R_NON_RESTRICTED) +"}\n"+
"this[KEYWORD]{this, null, null, this, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_INHERITED + R_NON_RESTRICTED) + "}",
requestor.getResults());
}
@@ -12735,23 +12735,23 @@ public void testCompletionMethodDeclaration17() throws JavaModelException {
System.arraycopy(classpath, 0, newClasspath, 1, length);
newClasspath[0] = JavaCore.newLibraryEntry(new Path("/Completion/bug325270.jar"), null, null);
this.currentProject.setRawClasspath(newClasspath, null);
-
+
this.wc = getWorkingCopy(
"/Completion/src/CompletionMethodDeclaration17.java",
- "class CompletionMethodDeclaration17 {\n" +
- " void test() {\n" +
- " new pkg.Foo1.Bar1(\n" +
- " }\n" +
+ "class CompletionMethodDeclaration17 {\n" +
+ " void test() {\n" +
+ " new pkg.Foo1.Bar1(\n" +
+ " }\n" +
"}" +
"}");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "new pkg.Foo1.Bar1(";
int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
assertResults(
"Bar1[METHOD_REF<CONSTRUCTOR>]{, Lpkg.Foo1$Bar1;, (II)V, Bar1, (a, b), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED)+ "}\n" +
"Foo1.Bar1[ANONYMOUS_CLASS_DECLARATION]{, Lpkg.Foo1$Bar1;, (II)V, null, (a, b), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED)+"}",
@@ -14251,10 +14251,10 @@ public void testCompletionUnresolvedSuperclass() throws JavaModelException {
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/test/Test.java",
"package test;"+
- "public class Test {\n" +
- " public void foo(pack.Bin4 b) {\n" +
- " b.bar\n" +
- " }\n" +
+ "public class Test {\n" +
+ " public void foo(pack.Bin4 b) {\n" +
+ " b.bar\n" +
+ " }\n" +
"}\n");
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
@@ -14272,10 +14272,10 @@ public void testCompletionUnresolvedSuperinteface() throws JavaModelException {
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/test/Test.java",
"package test;"+
- "public class Test {\n" +
- " public void foo(pack.Bin5 b) {\n" +
- " b.bar\n" +
- " }\n" +
+ "public class Test {\n" +
+ " public void foo(pack.Bin5 b) {\n" +
+ " b.bar\n" +
+ " }\n" +
"}\n");
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
@@ -15798,7 +15798,7 @@ public void testCompletionVisibilityCheckEnabled() throws JavaModelException {
try {
ICompilationUnit cu= getCompilationUnit("Completion", "src", "", "CompletionVisibilityCheck.java");
-
+
String str = cu.getSource();
String completeBehind = "x.p";
int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
@@ -19808,7 +19808,7 @@ public void testCompletionOnExtendFinalClass () throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults(
- "ThisClassIsNotFinal[TYPE_REF]{ThisClassIsNotFinal, test, Ltest.ThisClassIsNotFinal;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CLASS) + "}",
+ "ThisClassIsNotFinal[TYPE_REF]{ThisClassIsNotFinal, test, Ltest.ThisClassIsNotFinal;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CLASS) + "}",
requestor.getResults());
}
@@ -19873,11 +19873,11 @@ public void test203060a() throws JavaModelException {
String str = this.workingCopies[0].getSource();
String completeBehind = "as";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
-
+
// Save current compliance settings
Map<String, String> options = COMPLETION_PROJECT.getOptions(true);
String savedOptionCompliance = options.get(CompilerOptions.OPTION_Compliance);
-
+
try {
// Verify that at 1.3 assert is not proposed.
options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_3);
@@ -19887,7 +19887,7 @@ public void test203060a() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
@@ -19907,11 +19907,11 @@ public void test203060b() throws JavaModelException {
String str = this.workingCopies[0].getSource();
String completeBehind = "as";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
-
+
// Save current compliance settings
Map<String, String> options = COMPLETION_PROJECT.getOptions(true);
String savedOptionCompliance = options.get(CompilerOptions.OPTION_Compliance);
-
+
try {
options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_4);
COMPLETION_PROJECT.setOptions(options);
@@ -19922,7 +19922,7 @@ public void test203060b() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
@@ -19941,16 +19941,16 @@ public void test203060c() throws JavaModelException {
" }\n" +
" }\n" +
"}\n");
-
+
CompletionTestsRequestor requestor = new CompletionTestsRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "as";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
-
+
// Save current compliance settings
Map<String, String> options = COMPLETION_PROJECT.getOptions(true);
String savedOptionCompliance = options.get(CompilerOptions.OPTION_Compliance);
-
+
try {
// Verify that at 1.3 assert is not proposed.
options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_3);
@@ -19960,7 +19960,7 @@ public void test203060c() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
@@ -19979,16 +19979,16 @@ public void test203060d() throws JavaModelException {
" }\n" +
" }\n" +
"}\n");
-
+
CompletionTestsRequestor requestor = new CompletionTestsRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "as";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
-
+
// Save current compliance settings
Map<String, String> options = COMPLETION_PROJECT.getOptions(true);
String savedOptionCompliance = options.get(CompilerOptions.OPTION_Compliance);
-
+
try {
options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_4);
COMPLETION_PROJECT.setOptions(options);
@@ -19999,7 +19999,7 @@ public void test203060d() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
@@ -20018,8 +20018,8 @@ public void test269493() throws JavaModelException {
" }\n" +
"}\n" +
"}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
+
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
String str = this.workingCopies[0].getSource();
String completeBehind = "ass";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -20027,7 +20027,7 @@ public void test269493() throws JavaModelException {
// Save current compliance settings
Map<String, String> options = COMPLETION_PROJECT.getOptions(true);
String savedOptionCompliance = options.get(CompilerOptions.OPTION_Compliance);
-
+
try {
options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_4);
COMPLETION_PROJECT.setOptions(options);
@@ -20038,7 +20038,7 @@ public void test269493() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
@@ -20055,7 +20055,7 @@ public void test269493b() throws JavaModelException {
" }\n" +
"}\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
String str = this.workingCopies[0].getSource();
String completeBehind = "ret";
@@ -20080,7 +20080,7 @@ public void test269493c() throws JavaModelException {
" }\n" +
"}\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
String str = this.workingCopies[0].getSource();
String completeBehind = "bre";
@@ -20105,7 +20105,7 @@ public void test269493d() throws JavaModelException {
" }\n" +
"}\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
String str = this.workingCopies[0].getSource();
String completeBehind = "cont";
@@ -20132,7 +20132,7 @@ public void test269493e() throws JavaModelException {
" }\n" +
"}\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
String str = this.workingCopies[0].getSource();
String completeBehind = "ret";
@@ -20158,7 +20158,7 @@ public void test269493f() throws JavaModelException {
" }\n" +
"}\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
String str = this.workingCopies[0].getSource();
String completeBehind = "els";
@@ -20182,7 +20182,7 @@ public void test269493g() throws JavaModelException {
" }\n" +
"}\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
String str = this.workingCopies[0].getSource();
String completeBehind = "els";
@@ -20209,7 +20209,7 @@ public void test269493h() throws JavaModelException {
" }\n" +
"}\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
String str = this.workingCopies[0].getSource();
String completeBehind = "els";
@@ -20237,7 +20237,7 @@ public void test269493i() throws JavaModelException {
" }\n" +
"}\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
String str = this.workingCopies[0].getSource();
String completeBehind = "els";
@@ -20264,7 +20264,7 @@ public void test253008() throws JavaModelException {
" }\n" +
" }\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
String str = this.workingCopies[0].getSource();
String completeBehind = "methodR";
@@ -20291,7 +20291,7 @@ public void test253008b() throws JavaModelException {
" }\n" +
" }\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
String str = this.workingCopies[0].getSource();
String completeBehind = "methodR";
@@ -20317,7 +20317,7 @@ public void test253008c() throws JavaModelException {
" } while (methodR);\n" +
" }\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
String str = this.workingCopies[0].getSource();
String completeBehind = "methodR";
@@ -20343,7 +20343,7 @@ public void test253008d() throws JavaModelException {
" }\n" +
" }\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
String str = this.workingCopies[0].getSource();
String completeBehind = "methodR";
@@ -20369,7 +20369,7 @@ public void test253008e() throws JavaModelException {
" }\n" +
" }\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
String str = this.workingCopies[0].getSource();
String completeBehind = "methodR";
@@ -20395,7 +20395,7 @@ public void test253008f() throws JavaModelException {
" }\n" +
" }\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
String str = this.workingCopies[0].getSource();
String completeBehind = "methodR";
@@ -20435,20 +20435,20 @@ public void test201762() throws JavaModelException {
" while (!shell.isDisposed()) { }\n" +
" }\n" +
"}\n");
-
+
this.workingCopies[1] = getWorkingCopy(
"/Completion/src/test/AnObject.java",
"package test;\n" +
"public class AnObject {\n" +
" public void setLineCap(int capZz) {}\n" +
"}\n");
-
+
this.workingCopies[2] = getWorkingCopy(
"/Completion/src/test/ControlAdapter.java",
"package test;\n" +
"public class ControlAdapter {\n" +
"}\n");
-
+
this.workingCopies[3] = getWorkingCopy(
"/Completion/src/test/Label.java",
"package test;\n" +
@@ -20458,20 +20458,20 @@ public void test201762() throws JavaModelException {
" public void addPaintListener(PaintListener paintListener) {\n" +
" }\n" +
"}\n");
-
+
this.workingCopies[4] = getWorkingCopy(
"/Completion/src/test/Label.java",
"package test;\n" +
"public class PaintEvent {\n" +
" public AnObject gc;\n" +
"}\n");
-
+
this.workingCopies[5] = getWorkingCopy(
"/Completion/src/test/PaintListener.java",
"package test;\n" +
"public interface PaintListener {\n" +
"}\n");
-
+
this.workingCopies[6] = getWorkingCopy(
"/Completion/src/test/Shell.java",
"package test;\n" +
@@ -20482,7 +20482,7 @@ public void test201762() throws JavaModelException {
" public void addControlListener(ControlAdapter controlAdapter) {\n" +
" }\n" +
"}\n");
-
+
this.workingCopies[7] = getWorkingCopy(
"/Completion/src/test/SWT.java",
"package test;\n" +
@@ -20490,7 +20490,7 @@ public void test201762() throws JavaModelException {
" int WRAP = 0;\n" +
" int CAP_ZZ = 0;\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
String str = this.workingCopies[0].getSource();
String completeBehind = "SWT.CAP_";
@@ -20516,14 +20516,14 @@ public void test270437a() throws JavaModelException {
"public class Test270437a extends Test270437a. {\n" +
" public class Inner {}\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
String str = this.workingCopies[0].getSource();
String completeBehind = "Test270437a.";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
// In the absence of the fix, the results would be as follows, which is wrong:
//"Test270437a.Inner[TYPE_REF]{Inner, test, Ltest.Test270437a$Inner;, null, 39}",
assertResults(
@@ -20544,14 +20544,14 @@ public void test270437b() throws JavaModelException {
"public class Test270437b implements Test270437b. {\n" +
" public interface Inner {}\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
String str = this.workingCopies[0].getSource();
String completeBehind = "Test270437b.";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
// In the absence of the fix, the results would be as follows, which is wrong:
//"Test270437b.Inner[TYPE_REF]{Inner, test, Ltest.Test270437b$Inner;, null, 39}",
assertResults(
@@ -20575,14 +20575,14 @@ public void test270437c() throws JavaModelException {
" }\n" +
" }\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
String str = this.workingCopies[0].getSource();
String completeBehind = "X.MyClass1.";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
// In the absence of the fix, the results would be as follows, which is wrong:
//"X.MyClass1.MyClass2[TYPE_REF]{MyClass2, test, Ltest.X$MyClass1$MyClass2;, null, 39}",
assertResults(
@@ -20602,7 +20602,7 @@ public void test285379a() throws JavaModelException {
int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
cu.codeComplete(cursorLocation, requestor);
- // just not hang...
+ // just not hang...
}
/*
@@ -20617,7 +20617,7 @@ public void test285379b() throws JavaModelException {
int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
cu.codeComplete(cursorLocation, requestor);
- // just not hang...
+ // just not hang...
}
/*
@@ -20632,7 +20632,7 @@ public void test285379c() throws JavaModelException {
int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
cu.codeComplete(cursorLocation, requestor);
- // just not hang...
+ // just not hang...
}
/*
@@ -20647,7 +20647,7 @@ public void test285379d() throws JavaModelException {
int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
cu.codeComplete(cursorLocation, requestor);
- // just not hang...
+ // just not hang...
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=270436
@@ -20660,7 +20660,7 @@ public void test270436a() throws JavaModelException {
"public final class TestClass {}\n" +
"interface TestInterface {}\n" +
"class Subclass extends test.Test {}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
String str = this.workingCopies[0].getSource();
String completeBehind = "test.Test";
@@ -20684,7 +20684,7 @@ public void test270436b() throws JavaModelException {
"public final class TestClass {}\n" +
"interface TestInterface {}\n" +
"class Subclass extends test.Sub {}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
String str = this.workingCopies[0].getSource();
String completeBehind = "test.Sub";
@@ -20709,7 +20709,7 @@ public void test270436c() throws JavaModelException {
"interface TestInterface {}\n" +
"class Subclass {}\n" +
"interface Subinterface extends test.");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
String str = this.workingCopies[0].getSource();
String completeBehind = "test.";
@@ -20735,7 +20735,7 @@ public void test276526a() throws JavaModelException {
"interface IFoo {}\n" +
"interface IBar {}\n" +
"class Foo implements IFoo, test. {}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
String str = this.workingCopies[0].getSource();
String completeBehind = "test.";
@@ -20759,17 +20759,17 @@ public void test276526b() throws JavaModelException {
"/Completion/src/test/Test276526b1.java",
"package test;\n" +
"public class TestClazz implements Interface1, test. {}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/Completion/src/test/Test276526b2.java",
"package test;\n" +
"public interface Interface1 {}");
-
+
this.workingCopies[2] = getWorkingCopy(
"/Completion/src/test/Test276526b3.java",
"package test;\n" +
"public interface Interface2 {}");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
String str = this.workingCopies[0].getSource();
String completeBehind = "test.";
@@ -20795,11 +20795,11 @@ public void test276526c() throws JavaModelException {
" public interface Interface1 {}\n" +
" public interface Interface2 {}\n" +
"}\n");
-
+
this.workingCopies[1] = getWorkingCopy(
"/Completion/src/TestClazz.java",
"public class TestClazz implements p.Enclosing.Interface1, Interf {}");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
String str = this.workingCopies[1].getSource();
String completeBehind = "Interf";
@@ -20825,16 +20825,16 @@ public void test276526d() throws JavaModelException {
" public interface Interface1 {}\n" +
" public interface Interface2 {}\n" +
"}\n");
-
+
this.workingCopies[1] = getWorkingCopy(
"/Completion/src/p/Interface1.java",
"package p;\n" +
"public interface Interface1 {}");
-
+
this.workingCopies[2] = getWorkingCopy(
"/Completion/src/TestClazz.java",
"public class TestClazz implements p.Interface1, Interf {}");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
String str = this.workingCopies[2].getSource();
String completeBehind = "Interf";
@@ -20883,7 +20883,7 @@ public void testBug287939a() throws JavaModelException {
int end2 = start2 + "this.a.r".length();
int start3 = str.lastIndexOf("this.a.");
int end3 = start3 + "this.a".length();
-
+
assertResults(
"expectedTypesSignatures={I}\n" +
"expectedTypesKeys={I}",
@@ -20925,7 +20925,7 @@ public void testBug287939b() throws JavaModelException {
int end2 = start2 + "this.a.r".length();
int start3 = str.lastIndexOf("this.a.");
int end3 = start3 + "this.a".length();
-
+
assertResults(
"expectedTypesSignatures={I}\n" +
"expectedTypesKeys={I}",
@@ -20966,7 +20966,7 @@ public void testBug287939c() throws JavaModelException {
int end2 = start2 + "a.r".length();
int start3 = str.lastIndexOf("a.");
int end3 = start3 + "a".length();
-
+
assertResults(
"expectedTypesSignatures={I}\n" +
"expectedTypesKeys={I}",
@@ -21006,7 +21006,7 @@ public void testBug287939d() throws JavaModelException {
int end2 = start2 + "a.r".length();
int start3 = str.lastIndexOf("a.");
int end3 = start3 + "a".length();
-
+
assertResults(
"expectedTypesSignatures={I}\n" +
"expectedTypesKeys={I}",
@@ -21037,10 +21037,10 @@ public void testBug202634a() throws JavaModelException {
String completeBehind = "sup";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
int start1 = str.lastIndexOf("sup");
int end1 = start1 + "sup".length();
-
+
assertResults(
"super[KEYWORD]{super, null, null, super, null, replace[" + start1 + ", " + end1 +"], token[" + start1 + ", " + end1 + "], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE+ R_NON_RESTRICTED) + "}",
requestor.getResults());
@@ -21067,10 +21067,10 @@ public void testBug202634b() throws JavaModelException {
String completeBehind = "sup";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
int start1 = str.lastIndexOf("sup");
int end1 = start1 + "sup".length();
-
+
assertResults(
"super[KEYWORD]{super, null, null, super, null, replace[" + start1 + ", " + end1 +"], token[" + start1 + ", " + end1 + "], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE+ R_NON_RESTRICTED) + "}",
requestor.getResults());
@@ -21097,10 +21097,10 @@ public void testBug202634c() throws JavaModelException {
String completeBehind = "sup";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
int start1 = str.lastIndexOf("sup");
int end1 = start1 + "sup".length();
-
+
assertResults(
"super[KEYWORD]{super, null, null, super, null, replace[" + start1 + ", " + end1 +"], token[" + start1 + ", " + end1 + "], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE+ R_NON_RESTRICTED) + "}",
requestor.getResults());
@@ -21127,10 +21127,10 @@ public void testBug202634d() throws JavaModelException {
String completeBehind = "sup";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
int start1 = str.lastIndexOf("sup");
int end1 = start1 + "sup".length();
-
+
assertResults(
"super[KEYWORD]{super, null, null, super, null, replace[" + start1 + ", " + end1 +"], token[" + start1 + ", " + end1 + "], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE+ R_NON_RESTRICTED) + "}\n" +
"super[METHOD_REF<CONSTRUCTOR>]{super(), Ljava.lang.Object;, ()V, super, null, replace[" + start1 + ", " + end1 + "], token[" + start1 + ", " + end1 + "], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE+ R_NON_RESTRICTED) + "}",
@@ -21158,10 +21158,10 @@ public void testBug202634e() throws JavaModelException {
String completeBehind = "thi";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
int start1 = str.lastIndexOf("thi");
int end1 = start1 + "thi".length();
-
+
assertResults(
"this[KEYWORD]{this, null, null, this, null, replace[" + start1 + ", " + end1 +"], token[" + start1 + ", " + end1 + "], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE+ R_NON_RESTRICTED) + "}",
requestor.getResults());
@@ -21188,10 +21188,10 @@ public void testBug202634f() throws JavaModelException {
String completeBehind = "thi";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
int start1 = str.lastIndexOf("thi");
int end1 = start1 + "thi".length();
-
+
assertResults(
"this[KEYWORD]{this, null, null, this, null, replace[" + start1 + ", " + end1 +"], token[" + start1 + ", " + end1 + "], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE+ R_NON_RESTRICTED) + "}",
requestor.getResults());
@@ -21204,7 +21204,7 @@ public void testBug307337() throws JavaModelException {
"package test;\n" +
"public class TestBug307337 {\n" +
" Object obj = new Object() {\n" +
- " TestBug307337\n" +
+ " TestBug307337\n" +
" };\n" +
"}\n");
@@ -21216,7 +21216,7 @@ public void testBug307337() throws JavaModelException {
String completeBehind = "TestBug307337";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
assertResults(
"expectedTypesSignatures=null\n" +
"expectedTypesKeys=null\n" +
@@ -21340,7 +21340,7 @@ public void testBug244820() throws JavaModelException {
int end2 = start2 + "chars.to".length();
int start3 = str.lastIndexOf("chars.");
int end3 = start3 + "chars".length();
-
+
assertResults(
"toString[METHOD_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, null, null, toString, null, replace[" + start1 + ", " + end1 + "], token[" + start1 + ", " + end1 +"], " + relevance1 + "}\n" +
"toWelcome[METHOD_REF_WITH_CASTED_RECEIVER]{((MyString)chars).toWelcome(), Ltest.MyString;, ()Ljava.lang.String;, Ltest.MyString;, null, null, toWelcome, null, replace[" + start2 +", " + end2 + "], token[" + start1 + ", " + end1 + "], receiver[" + start3 + ", " + end3 + "], " + relevance1 + "}",
@@ -21591,7 +21591,7 @@ public void testBug261534a() throws JavaModelException {
int end2 = start2 + "chars.to".length();
int start3 = str.lastIndexOf("chars.");
int end3 = start3 + "chars".length();
-
+
assertResults(
"toString[METHOD_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, null, null, toString, null, replace[" + start1 + ", " + end1 + "], token[" + start1 + ", " + end1 +"], " + relevance1 + "}\n" +
"toWelcome[METHOD_REF_WITH_CASTED_RECEIVER]{((MyString)chars).toWelcome(), Ltest.MyString;, ()Ljava.lang.String;, Ltest.MyString;, null, null, toWelcome, null, replace[" + start2 +", " + end2 + "], token[" + start1 + ", " + end1 + "], receiver[" + start3 + ", " + end3 + "], " + relevance1 + "}",
@@ -21629,7 +21629,7 @@ public void testBug261534b() throws JavaModelException {
int relevance1 = R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED;
int start1 = str.lastIndexOf("to") + "".length();
int end1 = start1 + "to".length();
-
+
assertResults(
"toString[METHOD_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, null, null, toString, null, replace[" + start1 + ", " + end1 + "], token[" + start1 + ", " + end1 +"], " + relevance1 + "}",
requestor.getResults());
@@ -21800,7 +21800,7 @@ public void testBug304006a() throws JavaModelException {
int end2 = start2 + "a.r".length();
int start3 = str.lastIndexOf("a.");
int end3 = start3 + "a".length();
-
+
assertResults(
"expectedTypesSignatures={I}\n" +
"expectedTypesKeys={I}",
@@ -21843,7 +21843,7 @@ public void testBug304006b() throws JavaModelException {
int end2 = start2 + "a.r".length();
int start3 = str.lastIndexOf("a.");
int end3 = start3 + "a".length();
-
+
assertResults(
"returnZero[METHOD_REF_WITH_CASTED_RECEIVER]{((CompletionAfterInstanceOf)a).returnZero(), Ltest.CompletionAfterInstanceOf;, ()I, Ltest.CompletionAfterInstanceOf;, returnZero, null, replace["+start2+", "+end2+"], token["+start1+", "+end1+"], receiver["+start3+", "+end3+"], " + (relevance1) + "}",
requestor.getResults());
@@ -21886,7 +21886,7 @@ public void testBug304006c() throws JavaModelException {
int end2 = start2 + "abc.r".length();
int start3 = str.lastIndexOf("abc.");
int end3 = start3 + "abc".length();
-
+
assertResults(
"expectedTypesSignatures={I}\n" +
"expectedTypesKeys={I}",
@@ -21897,8 +21897,8 @@ public void testBug304006c() throws JavaModelException {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=304006
-// To verify that autocast works correctly even when the completion node is preceeded by a number
-// of unrelated instanceof expressions. This case has errors in compilation unit.
+// To verify that autocast works correctly even when the completion node is preceeded by a number
+// of unrelated instanceof expressions. This case has errors in compilation unit.
public void testBug304006d() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
@@ -21934,7 +21934,7 @@ public void testBug304006d() throws JavaModelException {
int end2 = start2 + "xyz.r".length();
int start3 = str.lastIndexOf("xyz.");
int end3 = start3 + "xyz".length();
-
+
assertResults(
"returnZero[METHOD_REF_WITH_CASTED_RECEIVER]{((CompletionAfterInstanceOf)xyz).returnZero(), Ltest.CompletionAfterInstanceOf;, ()I, Ltest.CompletionAfterInstanceOf;, returnZero, null, replace["+start2+", "+end2+"], token["+start1+", "+end1+"], receiver["+start3+", "+end3+"], " + (relevance1) + "}",
requestor.getResults());
@@ -21974,7 +21974,7 @@ public void testBug304006e() throws JavaModelException {
int end2 = start2 + "a.r".length();
int start3 = str.lastIndexOf("a.");
int end3 = start3 + "a".length();
-
+
assertResults(
"expectedTypesSignatures={I}\n" +
"expectedTypesKeys={I}",
@@ -22008,8 +22008,8 @@ public void test325481() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults(
- "MyClass[TYPE_REF]{mypackage.MyClass, mypackage, Lmypackage.MyClass;, null, null, " + (R_DEFAULT + 9) + "}\n" +
- "mypackage[PACKAGE_REF]{mypackage, mypackage, null, null, null, " + (R_DEFAULT + 19) + "}\n" +
+ "MyClass[TYPE_REF]{mypackage.MyClass, mypackage, Lmypackage.MyClass;, null, null, " + (R_DEFAULT + 9) + "}\n" +
+ "mypackage[PACKAGE_REF]{mypackage, mypackage, null, null, null, " + (R_DEFAULT + 19) + "}\n" +
"myString[FIELD_REF]{myString, Ltest.X;, Ljava.lang.String;, myString, null, " + (R_DEFAULT + 22) + "}\n" +
"myString2[FIELD_REF]{myString2, Ltest.X;, Ljava.lang.String;, myString2, null, " + (R_DEFAULT + 22) + "}",
requestor.getResults());
@@ -22035,8 +22035,8 @@ public void test312603() throws JavaModelException {
this.wcOwner);
assertResults(
- "MyClass[TYPE_REF]{mypackage.MyClass, mypackage, Lmypackage.MyClass;, null, null, " + (R_DEFAULT + 9) + "}\n" +
- "mypackage[PACKAGE_REF]{mypackage, mypackage, null, null, null, " + (R_DEFAULT + 19) + "}\n" +
+ "MyClass[TYPE_REF]{mypackage.MyClass, mypackage, Lmypackage.MyClass;, null, null, " + (R_DEFAULT + 9) + "}\n" +
+ "mypackage[PACKAGE_REF]{mypackage, mypackage, null, null, null, " + (R_DEFAULT + 19) + "}\n" +
"myString[FIELD_REF]{myString, Ltest.X;, Ljava.lang.String;, myString, null, " + (R_DEFAULT + 52) + "}",
requestor.getResults());
}
@@ -22067,8 +22067,8 @@ public void test328674a() throws JavaModelException {
this.wcOwner);
assertResults(
- "MyClass[TYPE_REF]{mypackage.MyClass, mypackage, Lmypackage.MyClass;, null, null, " + (R_DEFAULT + 9) + "}\n" +
- "mypackage[PACKAGE_REF]{mypackage, mypackage, null, null, null, " + (R_DEFAULT + 19) + "}\n" +
+ "MyClass[TYPE_REF]{mypackage.MyClass, mypackage, Lmypackage.MyClass;, null, null, " + (R_DEFAULT + 9) + "}\n" +
+ "mypackage[PACKAGE_REF]{mypackage, mypackage, null, null, null, " + (R_DEFAULT + 19) + "}\n" +
"myString[LOCAL_VARIABLE_REF]{myString, null, Ljava.lang.String;, myString, null, " + (R_DEFAULT + 52) + "}\n" +
"myString2[LOCAL_VARIABLE_REF]{myString2, null, Ljava.lang.String;, myString2, null, " + (R_DEFAULT + 52) + "}",
requestor.getResults());
@@ -22100,8 +22100,8 @@ public void test328674b() throws JavaModelException {
this.wcOwner);
assertResults(
- "MyClass[TYPE_REF]{mypackage.MyClass, mypackage, Lmypackage.MyClass;, null, null, " + (R_DEFAULT + 9) + "}\n" +
- "mypackage[PACKAGE_REF]{mypackage, mypackage, null, null, null, " + (R_DEFAULT + 19) + "}\n" +
+ "MyClass[TYPE_REF]{mypackage.MyClass, mypackage, Lmypackage.MyClass;, null, null, " + (R_DEFAULT + 9) + "}\n" +
+ "mypackage[PACKAGE_REF]{mypackage, mypackage, null, null, null, " + (R_DEFAULT + 19) + "}\n" +
"myString[LOCAL_VARIABLE_REF]{myString, null, Ljava.lang.String;, myString, null, " + (R_DEFAULT + 52) + "}\n" +
"myString1[LOCAL_VARIABLE_REF]{myString1, null, Ljava.lang.String;, myString1, null, " + (R_DEFAULT + 52) + "}",
requestor.getResults());
@@ -22122,24 +22122,24 @@ public void test325481b() throws JavaModelException {
String str = cu.getSource();
String completeBehind = "_IAttributeDefinitionDescriptor.";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
-
+
cu.codeComplete(cursorLocation, requestor);
int relevance = R_DEFAULT + 21;
assumeEquals(
"should have two completions",
- "element:ADD_CUSTOM_ATTRIBUTES completion:ADD_CUSTOM_ATTRIBUTES relevance:" + relevance +"\n" +
- "element:ATTRIBUTE completion:ATTRIBUTE relevance:" + relevance +"\n" +
- "element:BUILT_ATTRIBUTE completion:BUILT_ATTRIBUTE relevance:" + relevance +"\n" +
- "element:RANKING_ATTRIBUTE completion:RANKING_ATTRIBUTE relevance:" + relevance +"\n" +
- "element:RANKING_ATTRIBUTE_V2 completion:RANKING_ATTRIBUTE_V2 relevance:" + relevance +"\n" +
- "element:REFERENCE_ATTRIBUTE completion:REFERENCE_ATTRIBUTE relevance:" + relevance +"\n" +
- "element:WORK_ATTRIBUTE completion:WORK_ATTRIBUTE relevance:" + relevance +"\n" +
+ "element:ADD_CUSTOM_ATTRIBUTES completion:ADD_CUSTOM_ATTRIBUTES relevance:" + relevance +"\n" +
+ "element:ATTRIBUTE completion:ATTRIBUTE relevance:" + relevance +"\n" +
+ "element:BUILT_ATTRIBUTE completion:BUILT_ATTRIBUTE relevance:" + relevance +"\n" +
+ "element:RANKING_ATTRIBUTE completion:RANKING_ATTRIBUTE relevance:" + relevance +"\n" +
+ "element:RANKING_ATTRIBUTE_V2 completion:RANKING_ATTRIBUTE_V2 relevance:" + relevance +"\n" +
+ "element:REFERENCE_ATTRIBUTE completion:REFERENCE_ATTRIBUTE relevance:" + relevance +"\n" +
+ "element:WORK_ATTRIBUTE completion:WORK_ATTRIBUTE relevance:" + relevance +"\n" +
"element:class completion:class relevance:" + relevance,
requestor.getResults());
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
@@ -22256,7 +22256,7 @@ public void testBug338789() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=338789
@@ -22315,7 +22315,7 @@ public void testBug338789b() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=338789
@@ -22362,7 +22362,7 @@ public void testBug338789c() throws JavaModelException {
"public class IZZException extends Exception implements CommonInt {\n" +
" public void myMethod(){}\n" +
"}\n");
-
+
this.workingCopies[4] = getWorkingCopy(
"/Completion/src/test/CommonInt.java",
"package test;"+
@@ -22382,7 +22382,7 @@ public void testBug338789c() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
@@ -22442,7 +22442,7 @@ public void testBug338789d() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=338789
@@ -22500,7 +22500,7 @@ public void testBug338789e() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=343342
@@ -22658,7 +22658,7 @@ public void testBug343476() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=343476
@@ -22708,7 +22708,7 @@ public void testBug343476a() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=343637
@@ -22763,7 +22763,7 @@ public void testBug343637() throws JavaModelException {
"expectedTypesSignatures={Ltest.IZZBException;,Ltest.IZZAException;}\n" +
"expectedTypesKeys={Ltest/IZZBException;,Ltest/IZZAException;}",
requestor.getContext());
-
+
assertResults(
"IZZAException[TYPE_REF]{IZZAException, test, Ltest.IZZAException;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED + R_EXACT_EXPECTED_TYPE) + "}\n" +
"IZZBException[TYPE_REF]{IZZBException, test, Ltest.IZZBException;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED + R_EXACT_EXPECTED_TYPE) + "}",
@@ -22771,7 +22771,7 @@ public void testBug343637() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=343637
@@ -22827,14 +22827,14 @@ public void testBug343637b() throws JavaModelException {
"expectedTypesSignatures={Ltest.IZZBException;}\n" +
"expectedTypesKeys={Ltest/IZZBException;}",
requestor.getContext());
-
+
assertResults(
"IZZBException[TYPE_REF]{IZZBException, test, Ltest.IZZBException;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED + R_EXACT_EXPECTED_TYPE) + "}",
requestor.getResults());
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=343637
@@ -22881,7 +22881,7 @@ public void testBug343637c() throws JavaModelException {
"package test;"+
"public class IZZException extends Exception {\n" +
"}\n");
-
+
this.workingCopies[4] = getWorkingCopy(
"/Completion/src/test/IZZRuntimeException.java",
"package test;"+
@@ -22901,7 +22901,7 @@ public void testBug343637c() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=343637
@@ -22948,13 +22948,13 @@ public void testBug343637d() throws JavaModelException {
"package test;"+
"public class IZZException extends Exception {\n" +
"}\n");
-
+
this.workingCopies[4] = getWorkingCopy(
"/Completion/src/test/IZZRuntimeException.java",
"package test;"+
"public class IZZRuntimeException extends RuntimeException {\n" +
"}\n");
-
+
this.workingCopies[5] = getWorkingCopy(
"/Completion/src/test/IZZCException.java",
"package test;"+
@@ -22966,7 +22966,7 @@ public void testBug343637d() throws JavaModelException {
String str = this.workingCopies[0].getSource();
String completeBehind = "IZZAException | IZZ";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults(
"IZZCException[TYPE_REF]{IZZCException, test, Ltest.IZZCException;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED) + "}\n" +
"IZZException[TYPE_REF]{IZZException, test, Ltest.IZZException;, null, null, " + (R_DEFAULT + R_RESOLVED + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED + R_EXACT_EXPECTED_TYPE) + "}\n" +
@@ -22976,7 +22976,7 @@ public void testBug343637d() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=343637
@@ -23023,13 +23023,13 @@ public void testBug343637e() throws JavaModelException {
"package test;"+
"public class IZZException extends Exception {\n" +
"}\n");
-
+
this.workingCopies[4] = getWorkingCopy(
"/Completion/src/test/IZZRuntimeException.java",
"package test;"+
"public class IZZRuntimeException extends RuntimeException {\n" +
"}\n");
-
+
this.workingCopies[5] = getWorkingCopy(
"/Completion/src/test/IZZSuperException.java",
"package test;"+
@@ -23042,7 +23042,7 @@ public void testBug343637e() throws JavaModelException {
String completeBehind = "IZZAException | IZZ";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
assertResults(
"IZZSuperException[TYPE_REF]{IZZSuperException, test, Ltest.IZZSuperException;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED) + "}\n" +
"IZZException[TYPE_REF]{IZZException, test, Ltest.IZZException;, null, null, " + (R_DEFAULT + R_RESOLVED + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED + R_EXACT_EXPECTED_TYPE) + "}\n" +
@@ -23052,7 +23052,7 @@ public void testBug343637e() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=343637
@@ -23098,7 +23098,7 @@ public void testBug343637f() throws JavaModelException {
"package test;"+
"public class IZZException extends Exception {\n" +
"}\n");
-
+
this.workingCopies[4] = getWorkingCopy(
"/Completion/src/test/IZZRuntimeException.java",
"package test;"+
@@ -23116,7 +23116,7 @@ public void testBug343637f() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=343637
@@ -23164,7 +23164,7 @@ public void testBug343637g() throws JavaModelException {
"package test;"+
"public class IZZException extends Exception {\n" +
"}\n");
-
+
this.workingCopies[4] = getWorkingCopy(
"/Completion/src/test/IZZRuntimeException.java",
"package test;"+
@@ -23185,7 +23185,7 @@ public void testBug343637g() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=343637
@@ -23233,7 +23233,7 @@ public void testBug343637h() throws JavaModelException {
"package test;"+
"public class IZZException extends Exception {\n" +
"}\n");
-
+
this.workingCopies[4] = getWorkingCopy(
"/Completion/src/test/IZZRuntimeException.java",
"package test;"+
@@ -23251,7 +23251,7 @@ public void testBug343637h() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=346454
@@ -23283,7 +23283,7 @@ public void testBug346454() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=346454
@@ -23315,7 +23315,7 @@ public void testBug346454b() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=346454
@@ -23353,7 +23353,7 @@ public void testBug346454c() throws JavaModelException {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
options.put(CompilerOptions.OPTION_Source, savedOptionSource);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=346454
@@ -23393,7 +23393,7 @@ public void testBug346454c_2() throws JavaModelException {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
options.put(CompilerOptions.OPTION_Source, savedOptionSource);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=346454
@@ -23416,7 +23416,7 @@ public void testBug346454d() throws JavaModelException {
" new pack.Test<>()\n" +
" }" +
"}\n");
-
+
this.workingCopies[1] = getWorkingCopy(
"/Completion/src/pack/Test.java",
"package pack;"+
@@ -23440,7 +23440,7 @@ public void testBug346454d() throws JavaModelException {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
options.put(CompilerOptions.OPTION_Source, savedOptionSource);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=346454
@@ -23462,7 +23462,7 @@ public void testBug346454e() throws JavaModelException {
" new pack.Test<>.\n" +
" }" +
"}\n");
-
+
this.workingCopies[1] = getWorkingCopy(
"/Completion/src/pack/Test.java",
"package pack;"+
@@ -23483,7 +23483,7 @@ public void testBug346454e() throws JavaModelException {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
options.put(CompilerOptions.OPTION_Source, savedOptionSource);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=346454
@@ -23507,7 +23507,7 @@ public void testBug346454f() throws JavaModelException {
" Test<String>.T2<String> t = new Test<>().new T2<>()\n" +
" }" +
"}\n");
-
+
this.workingCopies[1] = getWorkingCopy(
"/Completion/src/pack/Test.java",
"package pack;"+
@@ -23530,7 +23530,7 @@ public void testBug346454f() throws JavaModelException {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
options.put(CompilerOptions.OPTION_Source, savedOptionSource);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=346454
@@ -23553,7 +23553,7 @@ public void testBug346454g() throws JavaModelException {
" new pack.Test<>().new T2<>()\n" +
" }" +
"}\n");
-
+
this.workingCopies[1] = getWorkingCopy(
"/Completion/src/pack/Test.java",
"package pack;"+
@@ -23577,7 +23577,7 @@ public void testBug346454g() throws JavaModelException {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
options.put(CompilerOptions.OPTION_Source, savedOptionSource);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=346454
@@ -23601,7 +23601,7 @@ public void testBug346454h() throws JavaModelException {
" new <String> Test<>()\n" +
" }" +
"}\n");
-
+
this.workingCopies[1] = getWorkingCopy(
"/Completion/src/pack/Test.java",
"package pack;"+
@@ -23617,13 +23617,13 @@ public void testBug346454h() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults(
"Test[METHOD_REF<CONSTRUCTOR>]{, Lpack.Test<>;, <Z:Ljava.lang.Object;>(TT;TZ;)V, Test, (t, z), " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED) + "}\n" +
- "Test<>[ANONYMOUS_CLASS_DECLARATION]{, Lpack.Test<>;, <Z:Ljava.lang.Object;>(TT;TZ;)V, null, (t, z), " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED) + "}",
+ "Test<>[ANONYMOUS_CLASS_DECLARATION]{, Lpack.Test<>;, <Z:Ljava.lang.Object;>(TT;TZ;)V, null, (t, z), " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED) + "}",
requestor.getResults());
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
options.put(CompilerOptions.OPTION_Source, savedOptionSource);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=346454
@@ -23647,7 +23647,7 @@ public void testBug346454i() throws JavaModelException {
" new <String> Test<>().new T2<>()\n" +
" }" +
"}\n");
-
+
this.workingCopies[1] = getWorkingCopy(
"/Completion/src/pack/Test.java",
"package pack;"+
@@ -23667,13 +23667,13 @@ public void testBug346454i() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults(
"T2[METHOD_REF<CONSTRUCTOR>]{, Lpack.Test<>.T2<>;, (TU;)V, T2, (u), " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED) + "}\n" +
- "Test<>.T2<>[ANONYMOUS_CLASS_DECLARATION]{, Lpack.Test<>.T2<>;, (TU;)V, null, (u), " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED) + "}",
+ "Test<>.T2<>[ANONYMOUS_CLASS_DECLARATION]{, Lpack.Test<>.T2<>;, (TU;)V, null, (u), " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED) + "}",
requestor.getResults());
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
options.put(CompilerOptions.OPTION_Source, savedOptionSource);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=346415
@@ -23718,7 +23718,7 @@ public void testBug346415() throws JavaModelException {
"package test;"+
"public class IZZException extends Exception {\n" +
"}\n");
-
+
this.workingCopies[4] = getWorkingCopy(
"/Completion/src/test/IZZRuntimeException.java",
"package test;"+
@@ -23738,7 +23738,7 @@ public void testBug346415() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=346415
@@ -23784,7 +23784,7 @@ public void testBug346415a() throws JavaModelException {
"package test;"+
"public class IZZException extends Exception {\n" +
"}\n");
-
+
this.workingCopies[4] = getWorkingCopy(
"/Completion/src/test/IZZRuntimeException.java",
"package test;"+
@@ -23803,7 +23803,7 @@ public void testBug346415a() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=350767
@@ -23834,7 +23834,7 @@ public void testBug350767() throws JavaModelException {
"package test;"+
"public class IZZException extends Exception {\n" +
"}\n");
-
+
this.workingCopies[2] = getWorkingCopy(
"/Completion/src/test/IZZException.java",
"package test;"+
@@ -23853,7 +23853,7 @@ public void testBug350767() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=350767
@@ -23908,19 +23908,19 @@ public void testBug350652() throws JavaModelException {
"package test;"+
"public class IZZException extends Exception {\n" +
"}\n");
-
+
this.workingCopies[2] = getWorkingCopy(
"/Completion/src/test/IZZAnnotation.java",
"package test;"+
"public @interface IZZAnnotation{\n" +
"}\n");
-
+
this.workingCopies[3] = getWorkingCopy(
"/Completion/src/test/IZZInterface.java",
"package test;"+
"public interface IZZInterface{\n" +
"}\n");
-
+
this.workingCopies[4] = getWorkingCopy(
"/Completion/src/test/IZZEnum.java",
"package test;"+
@@ -23995,7 +23995,7 @@ public void testBug350652c() throws JavaModelException {
"package test;"+
"public class IZZException extends Exception {\n" +
"}\n");
-
+
this.workingCopies[2] = getWorkingCopy(
"/Completion/src/test/IZZAException.java",
"package test;"+
@@ -24008,14 +24008,14 @@ public void testBug350652c() throws JavaModelException {
String completeBehind = "IZZAException | IZZ";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
assertResults(
"IZZException[TYPE_REF]{IZZException, test, Ltest.IZZException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_RESOLVED + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED) + "}",
requestor.getResults());
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
@@ -24042,7 +24042,7 @@ public void testBug401487a() throws JavaModelException {
String completeBehind = " def";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
assertResults(
"def[POTENTIAL_METHOD_DECLARATION]{def, Ltest.P;, ()V, def, null, " + (R_DEFAULT + 9) + "}\n" + "default[KEYWORD]{default, null, null, default, null, " + (R_DEFAULT + 19) + "}" ,
requestor.getResults());
@@ -24050,7 +24050,7 @@ public void testBug401487a() throws JavaModelException {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
options.put(CompilerOptions.OPTION_Source, savedOptionSource);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
public void testBug401487b() throws JavaModelException {
@@ -24074,7 +24074,7 @@ public void testBug401487b() throws JavaModelException {
String completeBehind = " def";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
assertResults(
"" ,
requestor.getResults());
@@ -24082,7 +24082,7 @@ public void testBug401487b() throws JavaModelException {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
options.put(CompilerOptions.OPTION_Source, savedOptionSource);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
public void testBug401487c() throws JavaModelException {
@@ -24106,7 +24106,7 @@ public void testBug401487c() throws JavaModelException {
String completeBehind = " def";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
assertResults(
"def[POTENTIAL_METHOD_DECLARATION]{def, Ltest.P;, ()V, def, null, " + (R_DEFAULT + 9) + "}" ,
requestor.getResults());
@@ -24114,7 +24114,7 @@ public void testBug401487c() throws JavaModelException {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
options.put(CompilerOptions.OPTION_Source, savedOptionSource);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
public void testBug401487d() throws JavaModelException {
@@ -24138,7 +24138,7 @@ public void testBug401487d() throws JavaModelException {
String completeBehind = " def";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
assertResults(
"" ,
requestor.getResults());
@@ -24146,7 +24146,7 @@ public void testBug401487d() throws JavaModelException {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
options.put(CompilerOptions.OPTION_Source, savedOptionSource);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
public void testBug401487e() throws JavaModelException {
@@ -24172,7 +24172,7 @@ public void testBug401487e() throws JavaModelException {
String completeBehind = " def";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
assertResults(
"def[POTENTIAL_METHOD_DECLARATION]{def, Ltest.ZZ$I;, ()V, def, null, " + (R_DEFAULT + 9) + "}\n" + "default[KEYWORD]{default, null, null, default, null, " + (R_DEFAULT + 19) + "}" ,
requestor.getResults());
@@ -24180,7 +24180,7 @@ public void testBug401487e() throws JavaModelException {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
options.put(CompilerOptions.OPTION_Source, savedOptionSource);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=350652
@@ -24214,14 +24214,14 @@ public void testBug350652d() throws JavaModelException {
String completeBehind = "IZZAException | IZZ";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
assertResults(
"IZZException[TYPE_REF]{IZZException, test, Ltest.IZZException;, null, null, " + (R_DEFAULT + R_RESOLVED + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED) + "}",
requestor.getResults());
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=350652
@@ -24246,7 +24246,7 @@ public void testBug350652e() throws JavaModelException {
"package test;"+
"public class IZZException extends Exception {\n" +
"}\n");
-
+
this.workingCopies[2] = getWorkingCopy(
"/Completion/src/test/IZZAException.java",
"package test;"+
@@ -24289,7 +24289,7 @@ public void testBug350652f() throws JavaModelException {
"package test;"+
"public class IZZException extends Exception {\n" +
"}\n");
-
+
this.workingCopies[2] = getWorkingCopy(
"/Completion/src/test/IZZAException.java",
"package test;"+
@@ -24302,14 +24302,14 @@ public void testBug350652f() throws JavaModelException {
String completeBehind = "IZZException | IZZ";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
assertResults(
"IZZAException[TYPE_REF]{IZZAException, test, Ltest.IZZAException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_RESOLVED + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED) + "}",
requestor.getResults());
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=350652
@@ -24343,14 +24343,14 @@ public void testBug350652g() throws JavaModelException {
String completeBehind = "IZZException | IZZ";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
assertResults(
"IZZAException[TYPE_REF]{IZZAException, test, Ltest.IZZAException;, null, null, " + (R_DEFAULT + R_RESOLVED + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED) + "}",
requestor.getResults());
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=350652
@@ -24375,7 +24375,7 @@ public void testBug350652h() throws JavaModelException {
"package test;"+
"public class IZZSuperException extends Exception {\n" +
"}\n");
-
+
this.workingCopies[2] = getWorkingCopy(
"/Completion/src/test/IZZBaseException.java",
"package test;"+
@@ -24438,7 +24438,7 @@ public void testBug350652j() throws JavaModelException {
" }\n" +
" }" +
"}\n");
-
+
this.workingCopies[1] = getWorkingCopy(
"/Completion/src/test2/IZZGeneral.java",
"package test2;"+
@@ -24488,7 +24488,7 @@ public void testBug350652k() throws JavaModelException {
String completeBehind = "catch (IZZAException |";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
assertResults(
"Exception[TYPE_REF]{Exception, java.lang, Ljava.lang.Exception;, null, null, " + (R_DEFAULT + R_EXACT_EXPECTED_TYPE + R_RESOLVED + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED) + "}\n" +
"IZZException[TYPE_REF]{IZZException, test, Ltest.IZZException;, null, null, " + (R_DEFAULT + R_EXACT_EXPECTED_TYPE + R_RESOLVED + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED) + "}",
@@ -24496,7 +24496,7 @@ public void testBug350652k() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=350652
@@ -24530,19 +24530,19 @@ public void testBug350652l() throws JavaModelException {
String completeBehind = "IZZException |";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
assertResults(
"IZZAException[TYPE_REF]{IZZAException, test, Ltest.IZZAException;, null, null, " + (R_DEFAULT + R_RESOLVED + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED) + "}",
requestor.getResults());
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=350652
// superclass exception types allowed in different catch blocks
-// Test filtration of super-type from expected types when no prefix before caret (IZZException is expected here because of the
+// Test filtration of super-type from expected types when no prefix before caret (IZZException is expected here because of the
// throw and is a valid proposal even though a child, IZZAException is present in an earlier catch).
// types in same CU
public void testBug350652m() throws JavaModelException {
@@ -24576,7 +24576,7 @@ public void testBug350652m() throws JavaModelException {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=350652
// subclass exception types not allowed in different catch blocks
-// Test relevance of sub-type from expected types when no prefix before caret (IZZAException is expected here because of the
+// Test relevance of sub-type from expected types when no prefix before caret (IZZAException is expected here because of the
// throw, yet is a less relevant proposal since a parent, IZZException is present in an earlier catch).
// Also, sub-type should not be an expected type.
// types in same CU
@@ -24636,7 +24636,7 @@ public void testBug351444() throws JavaModelException {
String completeBehind = "new TXY";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"TXYU[CONSTRUCTOR_INVOCATION]{(), Ltest.TXYU<TT;>;, (Ljava.lang.String;Ljava.lang.String;)V, TXYU, (s, s2), " + (R_DEFAULT + R_EXACT_EXPECTED_TYPE + 25) + "}\n" +
" TXYU[TYPE_REF]{TXYU, test, Ltest.TXYU;, null, null, " + (R_DEFAULT + R_EXACT_EXPECTED_TYPE + 25) + "}\n" +
@@ -24648,7 +24648,7 @@ public void testBug351444() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Source, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=351444
@@ -24679,7 +24679,7 @@ public void testBug351444a() throws JavaModelException {
String completeBehind = "new TXY";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"TXYU[CONSTRUCTOR_INVOCATION]{(), Ltest.TXYU<TT;>;, (Ljava.lang.String;Ljava.lang.String;)V, TXYU, (s, s2), " + (R_DEFAULT + R_EXACT_EXPECTED_TYPE + 25) + "}\n" +
" TXYU[TYPE_REF]{TXYU, test, Ltest.TXYU;, null, null, " + (R_DEFAULT + R_EXACT_EXPECTED_TYPE + 25) + "}\n" +
@@ -24691,7 +24691,7 @@ public void testBug351444a() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Source, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=351444
@@ -24725,7 +24725,7 @@ public void testBug351444b() throws JavaModelException {
String completeBehind = "new TXY";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"TXYU[CONSTRUCTOR_INVOCATION]{(), Ltest.Test<Ljava.lang.Object;>.TXYU;, (Ljava.lang.String;Ljava.lang.String;)V, TXYU, (s, s2), " + (R_DEFAULT + R_EXACT_EXPECTED_TYPE + 25) + "}\n" +
" Test.TXYU[TYPE_REF]{TXYU, test, Ltest.Test$TXYU;, null, null, " + (R_DEFAULT + R_EXACT_EXPECTED_TYPE + 25) + "}\n" +
@@ -24737,7 +24737,7 @@ public void testBug351444b() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Source, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=351444
@@ -24771,7 +24771,7 @@ public void testBug351444c() throws JavaModelException {
String completeBehind = "new TXY";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"TXYU[CONSTRUCTOR_INVOCATION]{(), Ltest.Test<Ljava.lang.Object;>.TXYU;, (Ljava.lang.String;Ljava.lang.String;)V, TXYU, (s, s2), " + (R_DEFAULT + R_EXACT_EXPECTED_TYPE + 25) + "}\n" +
" Test.TXYU[TYPE_REF]{TXYU, test, Ltest.Test$TXYU;, null, null, " + (R_DEFAULT + R_EXACT_EXPECTED_TYPE + 25) + "}\n" +
@@ -24783,7 +24783,7 @@ public void testBug351444c() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Source, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=351444
@@ -24820,7 +24820,7 @@ public void testBug351444d() throws JavaModelException {
String completeBehind = "new TXY";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"TXYU[CONSTRUCTOR_INVOCATION]{(), Ltest.TXYU<LNumber;>;, (LNumber;)V, TXYU, (t), " + (R_DEFAULT + 55) + "}\n" +
" TXYU[TYPE_REF]{TXYU, test, Ltest.TXYU;, null, null, " + (R_DEFAULT + 55) + "}\n" +
@@ -24832,7 +24832,7 @@ public void testBug351444d() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Source, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=351444
@@ -24869,7 +24869,7 @@ public void testBug351444e() throws JavaModelException {
String completeBehind = "new TXY";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"TXYU[CONSTRUCTOR_INVOCATION]{(), Ltest.TXYU<LNumber;>;, (LNumber;)V, TXYU, (t), " + (R_DEFAULT + 55) + "}\n" +
" TXYU[TYPE_REF]{TXYU, test, Ltest.TXYU;, null, null, " + (R_DEFAULT + 55) + "}\n" +
@@ -24881,7 +24881,7 @@ public void testBug351444e() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Source, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=292087
@@ -25039,7 +25039,7 @@ public void testBug385858a() throws JavaModelException {
String completeBehind = "new C";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
assertResults(
"completion offset=74\n" +
"completion range=[73, 73]\n" +
@@ -25066,7 +25066,7 @@ public void testBug385858b() throws JavaModelException {
String completeBehind = "new C";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
assertResults(
"completion offset=61\n" +
"completion range=[60, 60]\n" +
@@ -25096,7 +25096,7 @@ public void testBug385858c() throws JavaModelException {
String completeBehind = "new Completion.";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
assertResults(
"completion offset=102\n" +
"completion range=[102, 101]\n" +
@@ -25126,7 +25126,7 @@ public void testBug385858d() throws JavaModelException {
String completeBehind = "new ";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
assertResults(
"completion offset=92\n" +
"completion range=[92, 91]\n" +
@@ -25148,7 +25148,7 @@ public void testBug402574() throws JavaModelException {
this.workingCopies = new ICompilationUnit[2];
this.workingCopies[1] = getWorkingCopy(
"/Completion/src/test/ExampleEnumNoAutocomplete.java",
- "public enum ExampleEnumNoAutocomplete {\n" +
+ "public enum ExampleEnumNoAutocomplete {\n" +
" STUFF(\"a\", \"b\") {\n" +
" @Override\n" +
" public String getProperty1() {\n"+
@@ -25208,9 +25208,9 @@ public void testBug402574() throws JavaModelException {
" public String getSomething() {\n" +
" throw new UnsupportedOperationException(\"What is this, I don't even?!\");\n" +
" }\n" +
- " };\n" +
+ " };\n" +
" private final String property1;\n" +
- " private final String property2;\n" +
+ " private final String property2;\n" +
" ExampleEnumNoAutocomplete(final String property1, final String property2) {\n" +
" this.property1 = property1;\n" +
" this.property2 = property2;\n" +
@@ -25244,7 +25244,7 @@ public void testBug402574() throws JavaModelException {
String completeBehind = " ExampleEnumNoAutocomplete.";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"IT_MAY_BE_DUE_TO_MIXING_PERHAPS[FIELD_REF]{IT_MAY_BE_DUE_TO_MIXING_PERHAPS, Ltest.ExampleEnumNoAutocomplete;, Ltest.ExampleEnumNoAutocomplete;, IT_MAY_BE_DUE_TO_MIXING_PERHAPS, null, " + (R_DEFAULT + 21) + "}\n" +
"MORE_STUFF[FIELD_REF]{MORE_STUFF, Ltest.ExampleEnumNoAutocomplete;, Ltest.ExampleEnumNoAutocomplete;, MORE_STUFF, null, " + (R_DEFAULT + 21) + "}\n" +
@@ -25261,7 +25261,7 @@ public void testBug402574() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Source, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=402812
@@ -25270,22 +25270,22 @@ public void testBug402812a() throws Exception {
Hashtable<String, String> javaCoreOldOptions = JavaCore.getOptions();
Map<String, String> completionProjectOptions = COMPLETION_PROJECT.getOptions(true);
String savedOptionCompliance = completionProjectOptions.get(CompilerOptions.OPTION_Compliance);
- String savedOptionSource = completionProjectOptions.get(CompilerOptions.OPTION_Source);
+ String savedOptionSource = completionProjectOptions.get(CompilerOptions.OPTION_Source);
try {
Hashtable<String, String> options = new Hashtable<>(javaCoreOldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
completionProjectOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_8);
completionProjectOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_8);
COMPLETION_PROJECT.setOptions(completionProjectOptions);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib402812.jar"}, "bin");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
@@ -25305,39 +25305,39 @@ public void testBug402812a() throws Exception {
String completeBehind = " stat";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"staticMethod[METHOD_REF]{staticMethod(), Ltest.Test;, ()V, staticMethod, null, " + (R_DEFAULT + 22) + "}",
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(javaCoreOldOptions);
completionProjectOptions.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
completionProjectOptions.put(CompilerOptions.OPTION_Source, savedOptionSource);
- COMPLETION_PROJECT.setOptions(completionProjectOptions);
+ COMPLETION_PROJECT.setOptions(completionProjectOptions);
}
}
public void testBug402812b() throws Exception {
Hashtable<String, String> javaCoreOldOptions = JavaCore.getOptions();
Map<String, String> completionProjectOptions = COMPLETION_PROJECT.getOptions(true);
String savedOptionCompliance = completionProjectOptions.get(CompilerOptions.OPTION_Compliance);
- String savedOptionSource = completionProjectOptions.get(CompilerOptions.OPTION_Source);
+ String savedOptionSource = completionProjectOptions.get(CompilerOptions.OPTION_Source);
try {
Hashtable<String, String> options = new Hashtable<>(javaCoreOldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
completionProjectOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_8);
completionProjectOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_8);
COMPLETION_PROJECT.setOptions(completionProjectOptions);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib402812.jar"}, "bin");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
@@ -25360,39 +25360,39 @@ public void testBug402812b() throws Exception {
String completeBehind = "I.stat";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"staticMethod[METHOD_REF]{staticMethod(), Ltest.I;, ()V, staticMethod, null, " + (R_DEFAULT + 21) + "}",
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(javaCoreOldOptions);
completionProjectOptions.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
completionProjectOptions.put(CompilerOptions.OPTION_Source, savedOptionSource);
- COMPLETION_PROJECT.setOptions(completionProjectOptions);
+ COMPLETION_PROJECT.setOptions(completionProjectOptions);
}
}
public void testBug402812c() throws Exception {
Hashtable<String, String> javaCoreOldOptions = JavaCore.getOptions();
Map<String, String> completionProjectOptions = COMPLETION_PROJECT.getOptions(true);
String savedOptionCompliance = completionProjectOptions.get(CompilerOptions.OPTION_Compliance);
- String savedOptionSource = completionProjectOptions.get(CompilerOptions.OPTION_Source);
+ String savedOptionSource = completionProjectOptions.get(CompilerOptions.OPTION_Source);
try {
Hashtable<String, String> options = new Hashtable<>(javaCoreOldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
completionProjectOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_8);
completionProjectOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_8);
COMPLETION_PROJECT.setOptions(completionProjectOptions);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib402812.jar"}, "bin");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
@@ -25416,39 +25416,39 @@ public void testBug402812c() throws Exception {
String completeBehind = "this.defa";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"defaultMethod[METHOD_REF]{defaultMethod(), Ltest.I;, ()V, defaultMethod, null, " + (R_DEFAULT + 30) + "}",
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(javaCoreOldOptions);
completionProjectOptions.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
completionProjectOptions.put(CompilerOptions.OPTION_Source, savedOptionSource);
- COMPLETION_PROJECT.setOptions(completionProjectOptions);
+ COMPLETION_PROJECT.setOptions(completionProjectOptions);
}
}
public void testBug402812d() throws Exception {
Hashtable<String, String> javaCoreOldOptions = JavaCore.getOptions();
Map<String, String> completionProjectOptions = COMPLETION_PROJECT.getOptions(true);
String savedOptionCompliance = completionProjectOptions.get(CompilerOptions.OPTION_Compliance);
- String savedOptionSource = completionProjectOptions.get(CompilerOptions.OPTION_Source);
+ String savedOptionSource = completionProjectOptions.get(CompilerOptions.OPTION_Source);
try {
Hashtable<String, String> options = new Hashtable<>(javaCoreOldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
completionProjectOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_8);
completionProjectOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_8);
COMPLETION_PROJECT.setOptions(completionProjectOptions);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib402812.jar"}, "bin");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
@@ -25471,17 +25471,17 @@ public void testBug402812d() throws Exception {
String completeBehind = "defaultM";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"defaultMethod[METHOD_REF]{defaultMethod(), Ltest.I;, ()V, defaultMethod, null, " + (R_DEFAULT + 22) + "}",
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(javaCoreOldOptions);
completionProjectOptions.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
completionProjectOptions.put(CompilerOptions.OPTION_Source, savedOptionSource);
- COMPLETION_PROJECT.setOptions(completionProjectOptions);
+ COMPLETION_PROJECT.setOptions(completionProjectOptions);
}
}
//Bug 370971 - Content Assist autocomplete broken within an array of anonymous classes instances
@@ -25515,7 +25515,7 @@ public void testBug370971() throws JavaModelException {
String completeBehind = "return super.toS";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"toString[METHOD_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, " + (R_DEFAULT + 60) + "}",
requestor.getResults());
@@ -25524,7 +25524,7 @@ public void testBug370971() throws JavaModelException {
} finally {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Source, savedOptionCompliance);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// Bug 406468 - [1.8][code assist] No completion proposals after the use of a constructor reference
@@ -25548,7 +25548,7 @@ public void testBug406468a() throws JavaModelException {
" I i = X[][][]::new;\n" +
" X[][][] x = i.copy(136);\n" +
" System.out.println(x.length);\n" +
- " \n" +
+ " \n" +
" }\n" +
"}\n");
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
@@ -25568,7 +25568,7 @@ public void testBug406468a() throws JavaModelException {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
options.put(CompilerOptions.OPTION_Source, savedOptionSource);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
public void testBug406468b() throws JavaModelException {
@@ -25590,7 +25590,7 @@ public void testBug406468b() throws JavaModelException {
" I i = X<java.lang.String>::new;\n" +
" X x = i.copy();\n" +
" System.out.println(x);\n" +
- " \n" +
+ " \n" +
" }\n" +
"}\n");
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
@@ -25611,7 +25611,7 @@ public void testBug406468b() throws JavaModelException {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
options.put(CompilerOptions.OPTION_Source, savedOptionSource);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// Bug 405250 - [1.8][code assist] Annotations getting suggested at import statements
@@ -25640,7 +25640,7 @@ public void testBug405250a() throws JavaModelException {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
options.put(CompilerOptions.OPTION_Source, savedOptionSource);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
public void testBug405250b() throws JavaModelException {
@@ -25667,7 +25667,7 @@ public void testBug405250b() throws JavaModelException {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
options.put(CompilerOptions.OPTION_Source, savedOptionSource);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
public void testBug405250c() throws JavaModelException {
@@ -25694,7 +25694,7 @@ public void testBug405250c() throws JavaModelException {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
options.put(CompilerOptions.OPTION_Source, savedOptionSource);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
public void testBug405250d() throws JavaModelException {
@@ -25721,7 +25721,7 @@ public void testBug405250d() throws JavaModelException {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
options.put(CompilerOptions.OPTION_Source, savedOptionSource);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=421469, [1.8][code assist] NPE in LocalDeclaration.resolve with anonymous class in lambda body
@@ -25765,7 +25765,7 @@ public void testBug421469() throws JavaModelException {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
options.put(CompilerOptions.OPTION_Source, savedOptionSource);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=421469, [1.8][code assist] NPE in LocalDeclaration.resolve with anonymous class in lambda body
@@ -25810,7 +25810,7 @@ public void testBug421469a() throws JavaModelException {
// Restore compliance settings.
options.put(CompilerOptions.OPTION_Compliance, savedOptionCompliance);
options.put(CompilerOptions.OPTION_Source, savedOptionSource);
- COMPLETION_PROJECT.setOptions(options);
+ COMPLETION_PROJECT.setOptions(options);
}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=508951, Stackoverflow in RecoveredBlock.add during content assist
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests10.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests10.java
index 3f5453b0d..74af66b2b 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests10.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests10.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
* bug 529556 - [18.3] Add content assist support for 'var' as a type
@@ -201,7 +201,7 @@ public void test0007_not_inside_expression() throws JavaModelException {
"+ ");
assertResults(
- "expectedTypesSignatures={S,I,J,F,D,C,B,Ljava.lang.String;}\n" +
+ "expectedTypesSignatures={S,I,J,F,D,C,B,Ljava.lang.String;}\n" +
"expectedTypesKeys={S,I,J,F,D,C,B,Ljava/lang/String;}",
result.context);
@@ -240,7 +240,7 @@ public void test0008_not_in_class_scope() throws JavaModelException {
" }\n" +
"}",
"x(");
-
+
assertResults(
"expectedTypesSignatures=null\n" +
"expectedTypesKeys=null",
@@ -278,7 +278,7 @@ public void testBug532476a() throws JavaModelException {
"package p;\n" +
"public class X {\n" +
" public static void main(String[] args) {\n" +
- " var i_jk = 0;\n" +
+ " var i_jk = 0;\n" +
" System.out.println(i_);/n"+
" }\n" +
"}",
@@ -293,7 +293,7 @@ public void testBug532476b() throws JavaModelException {
"package p;\n" +
"public class X {\n" +
" public static void main(String[] args) {\n" +
- " for (var i_jkl : args) {\n" +
+ " for (var i_jkl : args) {\n" +
" System.out.println(i_);/n"+
" }\n" +
" }\n" +
@@ -337,7 +337,7 @@ public void testBug532476e() throws JavaModelException {
"package p;\n" +
"public class X {\n" +
" public static void main(String[] args) {\n" +
- " for (var i_jkl : args) {\n" +
+ " for (var i_jkl : args) {\n" +
" System.out.println(i_jkl.fin);/n"+
" }\n" +
" }\n" +
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests11.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests11.java
index 2c57808f3..bf955c8ba 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests11.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests11.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.core.tests.model;
@@ -36,9 +36,9 @@ public void test_var_in_parameter_in_lambda() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/test/X.java",
- "package test;\n" +
+ "package test;\n" +
"public class X {\n" +
- " public static void main(String[] args) { \n" +
+ " public static void main(String[] args) { \n" +
" I lambda = (va ) -> {}; \n" +
" lambda.apply(10); \n" +
" }\n" +
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests14.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests14.java
index 29958323f..b0abee2df 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests14.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests14.java
@@ -48,7 +48,7 @@ public class CompletionTests14 extends AbstractJavaModelCompletionTests {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/Point.java",
- "public record Point() imple {\n" +
+ "public record Point() imple {\n" +
"}");
this.workingCopies[0].getJavaProject(); //assuming single project for all working copies
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
@@ -67,7 +67,7 @@ public class CompletionTests14 extends AbstractJavaModelCompletionTests {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/Point.java",
- "public record Point() exte {\n" +
+ "public record Point() exte {\n" +
"}");
IJavaProject javaProject = this.workingCopies[0].getJavaProject(); //assuming single project for all working copies
String old = javaProject.getOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, true);
@@ -88,7 +88,7 @@ public class CompletionTests14 extends AbstractJavaModelCompletionTests {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/Point.java",
- "public record Point<U>() imple {\n" +
+ "public record Point<U>() imple {\n" +
"}");
this.workingCopies[0].getJavaProject(); //assuming single project for all working copies
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
@@ -105,7 +105,7 @@ public class CompletionTests14 extends AbstractJavaModelCompletionTests {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/Point.java",
- "public record Point<U>() exte {\n" +
+ "public record Point<U>() exte {\n" +
"}");
this.workingCopies[0].getJavaProject(); //assuming single project for all working copies
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
@@ -121,7 +121,7 @@ public class CompletionTests14 extends AbstractJavaModelCompletionTests {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/Point.java",
- "public record Point<U extends Thread>() imple {\n" +
+ "public record Point<U extends Thread>() imple {\n" +
"}");
this.workingCopies[0].getJavaProject(); //assuming single project for all working copies
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
@@ -139,7 +139,7 @@ public class CompletionTests14 extends AbstractJavaModelCompletionTests {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/Point.java",
- "public record Point<U extends Thread>() /*here*/exte {\n" +
+ "public record Point<U extends Thread>() /*here*/exte {\n" +
"}");
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
@@ -170,7 +170,7 @@ public class CompletionTests14 extends AbstractJavaModelCompletionTests {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/Point.java",
- "public record Point(int comp) exte {\n" +
+ "public record Point(int comp) exte {\n" +
"}");
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
@@ -185,7 +185,7 @@ public class CompletionTests14 extends AbstractJavaModelCompletionTests {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/Point.java",
- "public record Point<U>(int comp) imple {\n" +
+ "public record Point<U>(int comp) imple {\n" +
"}");
this.workingCopies[0].getJavaProject(); //assuming single project for all working copies
@@ -204,7 +204,7 @@ public class CompletionTests14 extends AbstractJavaModelCompletionTests {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/Point.java",
- "public record Point<U>(int comp) exte {\n" +
+ "public record Point<U>(int comp) exte {\n" +
"}");
this.workingCopies[0].getJavaProject(); //assuming single project for all working copies
@@ -221,7 +221,7 @@ public class CompletionTests14 extends AbstractJavaModelCompletionTests {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/Point.java",
- "public record Point<U extends Thread>(int comp) imple {\n" +
+ "public record Point<U extends Thread>(int comp) imple {\n" +
"}");
IJavaProject javaProject = this.workingCopies[0].getJavaProject(); //assuming single project for all working copies
String old = javaProject.getOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, true);
@@ -246,7 +246,7 @@ public class CompletionTests14 extends AbstractJavaModelCompletionTests {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/Point.java",
- "public record Point<U extends Thread>(int comp) /*here*/exte {\n" +
+ "public record Point<U extends Thread>(int comp) /*here*/exte {\n" +
"}");
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
@@ -278,7 +278,7 @@ public class CompletionTests14 extends AbstractJavaModelCompletionTests {
int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults("", requestor.getResults());
- }
+ }
public void test0014() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
@@ -289,7 +289,7 @@ public class CompletionTests14 extends AbstractJavaModelCompletionTests {
" * @par \n" +
" *\n"+
" */\n" +
- "public record Point() {\n" +
+ "public record Point() {\n" +
"}");
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
@@ -310,7 +310,7 @@ public class CompletionTests14 extends AbstractJavaModelCompletionTests {
" * @par \n" +
" *\n"+
" */\n" +
- "public record Point(int a) {\n" +
+ "public record Point(int a) {\n" +
"}");
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
@@ -330,7 +330,7 @@ public class CompletionTests14 extends AbstractJavaModelCompletionTests {
"/Completion/src/Point.java",
"public record Point(int comp_) { \n" +
"}\n"+
- "class MyClass extends /*here*/Poin \n"
+ "class MyClass extends /*here*/Poin \n"
);
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests18.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests18.java
index 0b8b1c092..e0d277c3d 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests18.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests18.java
@@ -243,7 +243,7 @@ public void test006b() throws JavaModelException {
"argument[LOCAL_VARIABLE_REF]{argument, null, Ljava.lang.Object;, argument, null, " + (R_DEFAULT + 21) + "}", // FIXME should be "I" and 22 like test006
requestor.getResults());
}
-// 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 test007() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
@@ -621,7 +621,7 @@ public void test017() throws JavaModelException { // ensure higher relevance for
requestor.setComputeEnclosingElement(false);
requestor.setComputeVisibleElements(true);
requestor.setAssignableType("LX;");
-
+
String str = this.workingCopies[0].getSource();
String completeBehind = "xyz";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -666,7 +666,7 @@ public void test018() throws JavaModelException { // computing visible elements
requestor.setComputeEnclosingElement(false);
requestor.setComputeVisibleElements(true);
requestor.setAssignableType("LX;");
-
+
String str = this.workingCopies[0].getSource();
String completeBehind = "xyz.";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -719,7 +719,7 @@ public void test018a() throws JavaModelException { // computing visible elements
requestor.setComputeEnclosingElement(false);
requestor.setComputeVisibleElements(true);
requestor.setAssignableType("LX;");
-
+
String str = this.workingCopies[0].getSource();
String completeBehind = "xyz.";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -901,12 +901,12 @@ public void testBug405125a() throws JavaModelException {
requestor.setRequireExtendedContext(true);
requestor.setComputeVisibleElements(true);
requestor.allowAllRequiredProposals();
-
+
String str = this.workingCopies[0].getSource();
String completeBehind = "(int x5, int x2) -> bar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
assertResults(
"bars[METHOD_REF]{bars(), LB;, ()I, bars, null, " + (R_DEFAULT + 22) + "}",
requestor.getResults());
@@ -934,7 +934,7 @@ public void testBug405125b() throws JavaModelException {
String completeBehind = "(int x5, int x2) -> anot";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
assertResults(
"another[FIELD_REF]{another, LB;, I, another, null, " + (R_DEFAULT + 22) + "}",
requestor.getResults());
@@ -964,7 +964,7 @@ public void test425084() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults(
"tryit[LOCAL_VARIABLE_REF]{tryit, null, I, null, null, tryit, null, [99, 102], " + (R_DEFAULT + 22) + "}\n" +
- "try[KEYWORD]{try, null, null, null, null, try, null, [99, 102], " + (R_DEFAULT + 23) + "}",
+ "try[KEYWORD]{try, null, null, null, null, try, null, [99, 102], " + (R_DEFAULT + 23) + "}",
requestor.getResults());
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=422901, [1.8][code assist] Code assistant sensitive to scope.referenceContext type identity.
@@ -1144,7 +1144,7 @@ public void test427532b() throws JavaModelException {
"expectedTypesKeys=null\n" +
"completion token location={STATEMENT_START}", requestor.getContext());
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427464, [1.8][content assist] CCE : MethodDeclaration incompatible with CompletionOnAnnotationOfType
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427464, [1.8][content assist] CCE : MethodDeclaration incompatible with CompletionOnAnnotationOfType
public void test427464() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
@@ -1234,7 +1234,7 @@ public void test428735b() throws JavaModelException {
" 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.get));\n" +
+ " people.sort((x,y) -> x.getLastName().compareTo(y.get));\n" +
" }\n" +
"}\n");
@@ -1261,7 +1261,7 @@ public void test428735c() throws JavaModelException {
" people.stream().forEach(p -> System.out.println(p.)); // NOK\n" +
" }\n" +
" void test2(List<Person> people) {\n" +
- " people.sort((x,y) -> x.getLastName() + y.get);\n" +
+ " people.sort((x,y) -> x.getLastName() + y.get);\n" +
" }\n" +
"}\n");
@@ -1288,7 +1288,7 @@ public void test428735d() throws JavaModelException {
" people.stream().forEach(p -> System.out.println(p.)); // NOK\n" +
" }\n" +
" void test2(List<Person> people) {\n" +
- " people.sort((x,y) -> \"\" + x.get); \n" +
+ " people.sort((x,y) -> \"\" + x.get); \n" +
" }\n" +
"}\n");
@@ -1523,7 +1523,7 @@ public void test431402() throws JavaModelException {
"asList[LOCAL_VARIABLE_REF]{asList, null, Ljava.lang.Object;, asList, null, " + (R_DEFAULT + 42) + "}",
requestor.getResults());
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=432527, Content Assist crashes sometimes using JDK8
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=432527, Content Assist crashes sometimes using JDK8
public void test432527() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
@@ -1615,7 +1615,7 @@ public void test430441() throws JavaModelException {
javaProject.setOptions(options);
}
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430656, [1.8][content assist] Content assist does not work for method reference argument
+// 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() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
@@ -1671,7 +1671,7 @@ public void test433178() throws JavaModelException {
String completeBehind = "ne";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
- assertResults("new[KEYWORD]{new, null, null, null, null, new, null, [183, 185], " +
+ assertResults("new[KEYWORD]{new, null, null, null, null, new, null, [183, 185], " +
(RelevanceConstants.R_DEFAULT + RelevanceConstants.R_RESOLVED + RelevanceConstants.R_INTERESTING + RelevanceConstants.R_NON_RESTRICTED
+ RelevanceConstants.R_CASE + RelevanceConstants.R_UNQUALIFIED) + "}", requestor.getResults());
}
@@ -1702,7 +1702,7 @@ public void test433178a() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults("", requestor.getResults());
}
-// 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() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
@@ -1721,7 +1721,7 @@ public void test435219() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults("out[FIELD_REF]{out, Ljava.lang.System;, Ljava.io.PrintStream;, null, null, out, null, [83, 84], " + (R_DEFAULT + 21) + "}", requestor.getResults());
}
-// 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 test435219a() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
@@ -1760,7 +1760,7 @@ public void test435219a() throws JavaModelException {
"println[METHOD_REF]{println(), Ljava.io.PrintStream;, (Z)V, null, null, println, (arg0), [87, 88], " + (R_DEFAULT + 30) + "}\n" +
"println[METHOD_REF]{println(), Ljava.io.PrintStream;, ([C)V, null, null, println, (arg0), [87, 88], " + (R_DEFAULT + 30) + "}", requestor.getResults());
}
-// 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 test435219b() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
@@ -1781,7 +1781,7 @@ public void test435219b() throws JavaModelException {
"stop[METHOD_REF]{stop(), Ljava.lang.Thread;, ()V, null, null, stop, null, [103, 105], " + (R_DEFAULT + 30) + "}\n" +
"stop[METHOD_REF]{stop(), Ljava.lang.Thread;, (Ljava.lang.Throwable;)V, null, null, stop, (arg0), [103, 105], " + (R_DEFAULT + 30) + "}", requestor.getResults());
}
-// 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 test435219c() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
@@ -1805,7 +1805,7 @@ public void test435219c() throws JavaModelException {
"highestOneBit[METHOD_REF]{highestOneBit(), Ljava.lang.Integer;, (I)I, null, null, highestOneBit, (arg0), [187, 188], " + (R_DEFAULT + 49) + "}\n" +
"hashCode[METHOD_REF]{hashCode(), Ljava.lang.Integer;, ()I, null, null, hashCode, null, [187, 188], " + (R_DEFAULT + 60) + "}", requestor.getResults());
}
-// 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 test435219d() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
@@ -1847,7 +1847,7 @@ public void test435219d() throws JavaModelException {
"printf[METHOD_NAME_REFERENCE]{printf, Ljava.io.PrintStream;, (Ljava.lang.String;[Ljava.lang.Object;)Ljava.io.PrintStream;, null, null, printf, null, [219, 222], " + (R_DEFAULT + 30) + "}\n" +
"printf[METHOD_NAME_REFERENCE]{printf, Ljava.io.PrintStream;, (Ljava.util.Locale;Ljava.lang.String;[Ljava.lang.Object;)Ljava.io.PrintStream;, null, null, printf, null, [219, 222], " + (R_DEFAULT + 30) + "}", requestor.getResults());
}
-// 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 test435219e() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
@@ -1873,7 +1873,7 @@ public void test435219e() throws JavaModelException {
"doubleToRawLongBits[METHOD_REF]{doubleToRawLongBits(), Ljava.lang.Double;, (D)J, null, null, doubleToRawLongBits, (arg0), [355, 358], " + (R_DEFAULT + 19) + "}\n" +
"doubleValue[METHOD_REF]{doubleValue(), Ljava.lang.Double;, ()D, null, null, doubleValue, null, [355, 358], " + (R_DEFAULT + 30) + "}", requestor.getResults());
}
-// 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 test435219f() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
@@ -1898,7 +1898,7 @@ public void test435219f() throws JavaModelException {
assertResults("getClass[METHOD_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class<*>;, null, null, getClass, null, [391, 392], " + (R_DEFAULT + 30) + "}\n" +
"get[METHOD_REF]{get(), Ljava.util.Optional<Ljava.lang.Double;>;, ()Ljava.lang.Double;, null, null, get, null, [391, 392], " + (R_DEFAULT + 50) + "}", requestor.getResults());
}
-// 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 test435219g() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
@@ -1924,7 +1924,7 @@ public void test435219g() throws JavaModelException {
"doubleToRawLongBits[METHOD_REF]{doubleToRawLongBits(), Ljava.lang.Double;, (D)J, null, null, doubleToRawLongBits, (arg0), [376, 379], " + (R_DEFAULT + 49) + "}\n" +
"doubleValue[METHOD_REF]{doubleValue(), Ljava.lang.Double;, ()D, null, null, doubleValue, null, [376, 379], " + (R_DEFAULT + 60) + "}", requestor.getResults());
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=435682, [1.8] content assist not working inside lambda expression
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=435682, [1.8] content assist not working inside lambda expression
public void test435682() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
@@ -1946,7 +1946,7 @@ public void test435682() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults("trim[METHOD_REF]{trim(), Ljava.lang.String;, ()Ljava.lang.String;, null, null, trim, null, [237, 239], " + (R_DEFAULT + 30) + "}", requestor.getResults());
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=435682, [1.8] content assist not working inside lambda expression
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=435682, [1.8] content assist not working inside lambda expression
public void test435682a() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
@@ -1968,7 +1968,7 @@ public void test435682a() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults("trim[METHOD_REF]{trim(), Ljava.lang.String;, ()Ljava.lang.String;, null, null, trim, null, [246, 248], " + (R_DEFAULT + 30) + "}", requestor.getResults());
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430667, [1.8][content assist] no proposals around lambda as a field
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430667, [1.8][content assist] no proposals around lambda as a field
public void test430667() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
@@ -1995,7 +1995,7 @@ public void test430667() throws JavaModelException {
assertResults("D_F[POTENTIAL_METHOD_DECLARATION]{D_F, LD_DemoRefactorings;, ()V, null, null, D_F, null, [195, 198], " + (R_DEFAULT + 9) + "}\n" +
"D_FI[TYPE_REF]{D_FI, , LD_FI;, null, null, null, null, [195, 198], " + (R_DEFAULT + 22) + "}", requestor.getResults());
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430667, [1.8][content assist] no proposals around lambda as a field
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430667, [1.8][content assist] no proposals around lambda as a field
public void test430667a() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
@@ -2023,7 +2023,7 @@ public void test430667a() throws JavaModelException {
assertResults("D_F[POTENTIAL_METHOD_DECLARATION]{D_F, LD_DemoRefactorings;, ()V, null, null, D_F, null, [150, 153], " + (R_DEFAULT + 9) + "}\n" +
"D_FI[TYPE_REF]{D_FI, , LD_FI;, null, null, null, null, [150, 153], " + (R_DEFAULT + 22) + "}", requestor.getResults());
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430667, [1.8][content assist] no proposals around lambda as a field
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430667, [1.8][content assist] no proposals around lambda as a field
public void test430667b() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
@@ -2076,7 +2076,7 @@ public void test443932() throws JavaModelException {
"toUnsignedString[METHOD_NAME_REFERENCE]{toUnsignedString, Ljava.lang.Integer;, (II)Ljava.lang.String;, null, null, toUnsignedString, null, [90, 98], " + (R_DEFAULT + 19) + "}\n" +
"toString[METHOD_NAME_REFERENCE]{toString, Ljava.lang.Integer;, ()Ljava.lang.String;, null, null, toString, null, [90, 98], " + (R_DEFAULT + 30) + "}", requestor.getResults());
assertTrue(str.substring(90, 98).equals("toString"));
-
+
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=444300, [1.8] content assist not working inside lambda expression in case of fields
public void test444300() throws JavaModelException {
@@ -2100,7 +2100,7 @@ public void test444300() throws JavaModelException {
assertResults("charAt[METHOD_REF]{charAt(), Ljava.lang.String;, (I)C, null, null, charAt, (arg0), [232, 234], " + (R_DEFAULT + 30) + "}\n" +
"chars[METHOD_REF]{chars(), Ljava.lang.CharSequence;, ()Ljava.util.stream.IntStream;, null, null, chars, null, [232, 234], " + (R_DEFAULT + 30) + "}", requestor.getResults());
}
-// 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
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=444300, [1.8] content assist not working inside lambda expression in case of fields
public void test435219h() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
@@ -2123,7 +2123,7 @@ public void test435219h() throws JavaModelException {
"highestOneBit[METHOD_REF]{highestOneBit(), Ljava.lang.Integer;, (I)I, null, null, highestOneBit, (arg0), [164, 165], " + (R_DEFAULT + 49) + "}\n" +
"hashCode[METHOD_REF]{hashCode(), Ljava.lang.Integer;, ()I, null, null, hashCode, null, [164, 165], " + (R_DEFAULT + 60) + "}", requestor.getResults());
}
-// 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
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=444300, [1.8] content assist not working inside lambda expression in case of fields
public void test435219i() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
@@ -2164,7 +2164,7 @@ public void test435219i() throws JavaModelException {
"printf[METHOD_NAME_REFERENCE]{printf, Ljava.io.PrintStream;, (Ljava.lang.String;[Ljava.lang.Object;)Ljava.io.PrintStream;, null, null, printf, null, [188, 191], " + (R_DEFAULT + 30) + "}\n" +
"printf[METHOD_NAME_REFERENCE]{printf, Ljava.io.PrintStream;, (Ljava.util.Locale;Ljava.lang.String;[Ljava.lang.Object;)Ljava.io.PrintStream;, null, null, printf, null, [188, 191], " + (R_DEFAULT + 30) + "}", requestor.getResults());
}
-// 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
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=444300, [1.8] content assist not working inside lambda expression in case of fields
public void test435219j() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
@@ -2188,7 +2188,7 @@ public void test435219j() throws JavaModelException {
"doubleToRawLongBits[METHOD_REF]{doubleToRawLongBits(), Ljava.lang.Double;, (D)J, null, null, doubleToRawLongBits, (arg0), [235, 238], " + (R_DEFAULT + 19) + "}\n" +
"doubleValue[METHOD_REF]{doubleValue(), Ljava.lang.Double;, ()D, null, null, doubleValue, null, [235, 238], " + (R_DEFAULT + 30) + "}", requestor.getResults());
}
-// 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
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=444300, [1.8] content assist not working inside lambda expression in case of fields
public void test435219k() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
@@ -2211,7 +2211,7 @@ public void test435219k() throws JavaModelException {
assertResults("getClass[METHOD_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class<*>;, null, null, getClass, null, [271, 272], " + (R_DEFAULT + 30) + "}\n" +
"get[METHOD_REF]{get(), Ljava.util.Optional<Ljava.lang.Double;>;, ()Ljava.lang.Double;, null, null, get, null, [271, 272], " + (R_DEFAULT + 50) + "}", requestor.getResults());
}
-// 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
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=444300, [1.8] content assist not working inside lambda expression in case of fields
public void test435219l() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
@@ -2333,7 +2333,7 @@ public void test447774() throws JavaModelException {
"expectedTypesKeys=null\n" +
"completion token location={STATEMENT_START}", requestor.getContext());
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=449358, Content assist inside lambda broken in all methods except last
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=449358, Content assist inside lambda broken in all methods except last
public void test449358() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
@@ -2365,9 +2365,9 @@ public void test449358() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults("localmethod1[METHOD_REF]{localmethod1(), LLambdaBug;, ()V, null, null, localmethod1, null, [181, 190], " + (R_DEFAULT + 12) + "}\n" +
"localmethod2[METHOD_REF]{localmethod2(), LLambdaBug;, ()V, null, null, localmethod2, null, [181, 190], " + (R_DEFAULT + 12) + "}", requestor.getResults());
-
+
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=449358, Content assist inside lambda broken in all methods except last
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=449358, Content assist inside lambda broken in all methods except last
public void test449358a() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
@@ -2398,7 +2398,7 @@ public void test449358a() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults("localmethod1[METHOD_REF]{localmethod1(), LLambdaBug;, ()V, null, null, localmethod1, null, [282, 291], " + (R_DEFAULT + 12) + "}\n" +
"localmethod2[METHOD_REF]{localmethod2(), LLambdaBug;, ()V, null, null, localmethod2, null, [282, 291], " + (R_DEFAULT + 12) + "}", requestor.getResults());
-
+
}
public void testBug459189_001() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
@@ -2720,8 +2720,8 @@ public void test484479() throws JavaModelException {
String completeBehind = "::pr";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
- assertResults("print[METHOD_NAME_REFERENCE]{print, LBar;, ()LBar;, null, null, print, null, [160, 162], " +
- (RelevanceConstants.R_DEFAULT + RelevanceConstants.R_RESOLVED +
+ assertResults("print[METHOD_NAME_REFERENCE]{print, LBar;, ()LBar;, null, null, print, null, [160, 162], " +
+ (RelevanceConstants.R_DEFAULT + RelevanceConstants.R_RESOLVED +
RelevanceConstants.R_INTERESTING + RelevanceConstants.R_NON_RESTRICTED +
RelevanceConstants.R_CASE) + "}", requestor.getResults());
}
@@ -2748,7 +2748,7 @@ public void test473008a() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
int relevance = R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED + R_CASE;
assertResults(
- "StringBufferInputStream[TYPE_REF]{java.io.StringBufferInputStream, java.io, Ljava.io.StringBufferInputStream;, null, null, null, null, [147, 159], " + relevance + "}\n" +
+ "StringBufferInputStream[TYPE_REF]{java.io.StringBufferInputStream, java.io, Ljava.io.StringBufferInputStream;, null, null, null, null, [147, 159], " + relevance + "}\n" +
"StringBuffer[TYPE_REF]{StringBuffer, java.lang, Ljava.lang.StringBuffer;, null, null, null, null, [147, 159], " + (relevance + R_UNQUALIFIED + R_EXACT_NAME) + "}"
, requestor.getResults());
}
@@ -2774,7 +2774,7 @@ public void test473008b() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
int relevance = R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED + R_CASE;
assertResults(
- "StringBufferInputStream[TYPE_REF]{java.io.StringBufferInputStream, java.io, Ljava.io.StringBufferInputStream;, null, null, null, null, [149, 161], " + relevance + "}\n" +
+ "StringBufferInputStream[TYPE_REF]{java.io.StringBufferInputStream, java.io, Ljava.io.StringBufferInputStream;, null, null, null, null, [149, 161], " + relevance + "}\n" +
"StringBuffer[TYPE_REF]{StringBuffer, java.lang, Ljava.lang.StringBuffer;, null, null, null, null, [149, 161], " + (relevance + R_UNQUALIFIED + R_EXACT_NAME) + "}"
, requestor.getResults());
}
@@ -2800,7 +2800,7 @@ public void test473008c() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
int relevance = R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED + R_CASE;
assertResults(
- "StringBufferInputStream[TYPE_REF]{java.io.StringBufferInputStream, java.io, Ljava.io.StringBufferInputStream;, null, null, null, null, [151, 163], " + relevance + "}\n" +
+ "StringBufferInputStream[TYPE_REF]{java.io.StringBufferInputStream, java.io, Ljava.io.StringBufferInputStream;, null, null, null, null, [151, 163], " + relevance + "}\n" +
"StringBuffer[TYPE_REF]{StringBuffer, java.lang, Ljava.lang.StringBuffer;, null, null, null, null, [151, 163], " + (relevance + R_UNQUALIFIED + R_EXACT_NAME) + "}"
, requestor.getResults());
}
@@ -2943,46 +2943,46 @@ public void testBug493705() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/HelloWorld.java",
- "package b493705;\n" +
- "\n" +
- "import java.util.function.BiFunction;\n" +
- "\n" +
- "class Control { }\n" +
- "class Composite extends Control { }\n" +
- "class Label extends Control {\n" +
- " public Label(Composite p, int i) {}\n" +
- "}\n" +
- "\n" +
- "class Viewer { }\n" +
- "interface ViewerSupplier {\n" +
- " ViewerUI<? extends Viewer> getViewerUI();\n" +
- "}\n" +
- "class ViewerUI<V extends Viewer> extends SwtUI<Control>{\n" +
- "\n" +
- "}\n" +
- "interface ControlSupplier {\n" +
- " SwtUI<? extends Control> getControlUI();\n" +
- "}\n" +
- "class SwtUI<T> {\n" +
- " public SwtUI<T> child(ControlSupplier supplier) {\n" +
- " return null;\n" +
- " }\n" +
- " public SwtUI<T> child(ViewerSupplier supplier) {\n" +
- " return null;\n" +
- " }\n" +
- " public static <T extends Control> SwtUI<T> create(BiFunction<Composite, Integer, T> ctor) {\n" +
- " return null;\n" +
- " }\n" +
- " public SwtUI<T> text(String text) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "public class HelloWorld {\n" +
- " void test(SwtUI<Composite> root) {\n" +
- " root.child(() -> SwtUI.create(Label::new)\n" +
- " .text(\"Selection\").\n" +
- " );\n" +
- " }\n" +
+ "package b493705;\n" +
+ "\n" +
+ "import java.util.function.BiFunction;\n" +
+ "\n" +
+ "class Control { }\n" +
+ "class Composite extends Control { }\n" +
+ "class Label extends Control {\n" +
+ " public Label(Composite p, int i) {}\n" +
+ "}\n" +
+ "\n" +
+ "class Viewer { }\n" +
+ "interface ViewerSupplier {\n" +
+ " ViewerUI<? extends Viewer> getViewerUI();\n" +
+ "}\n" +
+ "class ViewerUI<V extends Viewer> extends SwtUI<Control>{\n" +
+ "\n" +
+ "}\n" +
+ "interface ControlSupplier {\n" +
+ " SwtUI<? extends Control> getControlUI();\n" +
+ "}\n" +
+ "class SwtUI<T> {\n" +
+ " public SwtUI<T> child(ControlSupplier supplier) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public SwtUI<T> child(ViewerSupplier supplier) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public static <T extends Control> SwtUI<T> create(BiFunction<Composite, Integer, T> ctor) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public SwtUI<T> text(String text) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n" +
+ "public class HelloWorld {\n" +
+ " void test(SwtUI<Composite> root) {\n" +
+ " root.child(() -> SwtUI.create(Label::new)\n" +
+ " .text(\"Selection\").\n" +
+ " );\n" +
+ " }\n" +
"}\n");
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, true, true, false);
@@ -2995,21 +2995,21 @@ public void testBug493705() throws JavaModelException {
int relevance1 = R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED;
int relevance2 = R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_NON_STATIC;
assertResults(
- "create[METHOD_REF]{create(), LSwtUI<LLabel;>;, <T:LControl;>(Ljava.util.function.BiFunction<LComposite;Ljava.lang.Integer;TT;>;)LSwtUI<TT;>;, null, null, create, (ctor), [853, 853], "+relevance1+"}\n" +
- "new[KEYWORD]{new, null, null, null, null, new, null, [853, 853], "+relevance1+"}\n" +
- "child[METHOD_REF]{child(), LSwtUI<LLabel;>;, (LControlSupplier;)LSwtUI<LLabel;>;, null, null, child, (supplier), [853, 853], "+relevance2+"}\n" +
- "child[METHOD_REF]{child(), LSwtUI<LLabel;>;, (LViewerSupplier;)LSwtUI<LLabel;>;, null, null, child, (supplier), [853, 853], "+relevance2+"}\n" +
- "clone[METHOD_REF]{clone(), Ljava.lang.Object;, ()Ljava.lang.Object;, null, null, clone, null, [853, 853], "+relevance2+"}\n" +
- "equals[METHOD_REF]{equals(), Ljava.lang.Object;, (Ljava.lang.Object;)Z, null, null, equals, (obj), [853, 853], "+relevance2+"}\n" +
- "finalize[METHOD_REF]{finalize(), Ljava.lang.Object;, ()V, null, null, finalize, null, [853, 853], "+relevance2+"}\n" +
- "getClass[METHOD_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class<*>;, null, null, getClass, null, [853, 853], "+relevance2+"}\n" +
- "hashCode[METHOD_REF]{hashCode(), Ljava.lang.Object;, ()I, null, null, hashCode, null, [853, 853], "+relevance2+"}\n" +
- "notify[METHOD_REF]{notify(), Ljava.lang.Object;, ()V, null, null, notify, null, [853, 853], "+relevance2+"}\n" +
- "notifyAll[METHOD_REF]{notifyAll(), Ljava.lang.Object;, ()V, null, null, notifyAll, null, [853, 853], "+relevance2+"}\n" +
- "text[METHOD_REF]{text(), LSwtUI<LLabel;>;, (Ljava.lang.String;)LSwtUI<LLabel;>;, null, null, text, (text), [853, 853], "+relevance2+"}\n" +
- "toString[METHOD_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, null, null, toString, null, [853, 853], "+relevance2+"}\n" +
- "wait[METHOD_REF]{wait(), Ljava.lang.Object;, ()V, null, null, wait, null, [853, 853], "+relevance2+"}\n" +
- "wait[METHOD_REF]{wait(), Ljava.lang.Object;, (J)V, null, null, wait, (millis), [853, 853], "+relevance2+"}\n" +
+ "create[METHOD_REF]{create(), LSwtUI<LLabel;>;, <T:LControl;>(Ljava.util.function.BiFunction<LComposite;Ljava.lang.Integer;TT;>;)LSwtUI<TT;>;, null, null, create, (ctor), [853, 853], "+relevance1+"}\n" +
+ "new[KEYWORD]{new, null, null, null, null, new, null, [853, 853], "+relevance1+"}\n" +
+ "child[METHOD_REF]{child(), LSwtUI<LLabel;>;, (LControlSupplier;)LSwtUI<LLabel;>;, null, null, child, (supplier), [853, 853], "+relevance2+"}\n" +
+ "child[METHOD_REF]{child(), LSwtUI<LLabel;>;, (LViewerSupplier;)LSwtUI<LLabel;>;, null, null, child, (supplier), [853, 853], "+relevance2+"}\n" +
+ "clone[METHOD_REF]{clone(), Ljava.lang.Object;, ()Ljava.lang.Object;, null, null, clone, null, [853, 853], "+relevance2+"}\n" +
+ "equals[METHOD_REF]{equals(), Ljava.lang.Object;, (Ljava.lang.Object;)Z, null, null, equals, (obj), [853, 853], "+relevance2+"}\n" +
+ "finalize[METHOD_REF]{finalize(), Ljava.lang.Object;, ()V, null, null, finalize, null, [853, 853], "+relevance2+"}\n" +
+ "getClass[METHOD_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class<*>;, null, null, getClass, null, [853, 853], "+relevance2+"}\n" +
+ "hashCode[METHOD_REF]{hashCode(), Ljava.lang.Object;, ()I, null, null, hashCode, null, [853, 853], "+relevance2+"}\n" +
+ "notify[METHOD_REF]{notify(), Ljava.lang.Object;, ()V, null, null, notify, null, [853, 853], "+relevance2+"}\n" +
+ "notifyAll[METHOD_REF]{notifyAll(), Ljava.lang.Object;, ()V, null, null, notifyAll, null, [853, 853], "+relevance2+"}\n" +
+ "text[METHOD_REF]{text(), LSwtUI<LLabel;>;, (Ljava.lang.String;)LSwtUI<LLabel;>;, null, null, text, (text), [853, 853], "+relevance2+"}\n" +
+ "toString[METHOD_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, null, null, toString, null, [853, 853], "+relevance2+"}\n" +
+ "wait[METHOD_REF]{wait(), Ljava.lang.Object;, ()V, null, null, wait, null, [853, 853], "+relevance2+"}\n" +
+ "wait[METHOD_REF]{wait(), Ljava.lang.Object;, (J)V, null, null, wait, (millis), [853, 853], "+relevance2+"}\n" +
"wait[METHOD_REF]{wait(), Ljava.lang.Object;, (JI)V, null, null, wait, (millis, nanos), [853, 853], "+relevance2+"}"
, requestor.getResults());
}
@@ -3177,8 +3177,8 @@ public void testBug529349a() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults(
- "Y.Super[TYPE_REF]{p.Y.Super, p, Lp.Y$Super;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CLASS ) + "}\n" +
- "Super[TYPE_REF]{Super, p, Lp.Super;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_CLASS) + "}\n" +
+ "Y.Super[TYPE_REF]{p.Y.Super, p, Lp.Y$Super;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CLASS ) + "}\n" +
+ "Super[TYPE_REF]{Super, p, Lp.Super;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_CLASS) + "}\n" +
"SuperSuper[TYPE_REF]{SuperSuper, p, Lp.SuperSuper;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_CLASS) + "}",
requestor.getResults());
}
@@ -3186,16 +3186,16 @@ public void testBug473654() throws Exception {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/Foo.java",
- "class Foo {\n" +
- " Runnable foo() {\n" +
- " return () -> new Object() {\n" +
- " // press Ctrl+Space before the comment\n" +
- " };\n" +
- " }\n" +
- " \n" +
- " static void bar() { /**/ }\n" +
+ "class Foo {\n" +
+ " Runnable foo() {\n" +
+ " return () -> new Object() {\n" +
+ " // press Ctrl+Space before the comment\n" +
+ " };\n" +
+ " }\n" +
+ " \n" +
+ " static void bar() { /**/ }\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.workingCopies[0].getSource();
String completeBefore = "// press Ctrl+Space before the comment";
@@ -3206,30 +3206,30 @@ public void testBug473654() throws Exception {
int overrideRelevance = R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED + R_CASE + R_METHOD_OVERIDE;
assertResults(
- "[POTENTIAL_METHOD_DECLARATION]{, LObject;, ()V, , null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED)+"}\n" +
+ "[POTENTIAL_METHOD_DECLARATION]{, LObject;, ()V, , null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED)+"}\n" +
"abstract[KEYWORD]{abstract, null, null, abstract, null, "+keywordRelevance+"}\n" +
//{ObjectTeams:
"callin[KEYWORD]{callin, null, null, callin, null, "+keywordRelevance+"}\n" +
// SH}
- "class[KEYWORD]{class, null, null, class, null, "+keywordRelevance+"}\n" +
- "enum[KEYWORD]{enum, null, null, enum, null, "+keywordRelevance+"}\n" +
- "final[KEYWORD]{final, null, null, final, null, "+keywordRelevance+"}\n" +
- "interface[KEYWORD]{interface, null, null, interface, null, "+keywordRelevance+"}\n" +
- "native[KEYWORD]{native, null, null, native, null, "+keywordRelevance+"}\n" +
- "private[KEYWORD]{private, null, null, private, null, "+keywordRelevance+"}\n" +
- "protected[KEYWORD]{protected, null, null, protected, null, "+keywordRelevance+"}\n" +
- "public[KEYWORD]{public, null, null, public, null, "+keywordRelevance+"}\n" +
- "static[KEYWORD]{static, null, null, static, null, "+keywordRelevance+"}\n" +
- "strictfp[KEYWORD]{strictfp, null, null, strictfp, null, "+keywordRelevance+"}\n" +
- "synchronized[KEYWORD]{synchronized, null, null, synchronized, null, "+keywordRelevance+"}\n" +
- "team[KEYWORD]{team, null, null, team, null, "+keywordRelevance+"}\n" +
- "transient[KEYWORD]{transient, null, null, transient, null, "+keywordRelevance+"}\n" +
- "volatile[KEYWORD]{volatile, null, null, volatile, null, "+keywordRelevance+"}\n" +
- "Foo[TYPE_REF]{Foo, , LFoo;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED + R_CASE + R_UNQUALIFIED)+"}\n" +
- "clone[METHOD_DECLARATION]{protected Object clone() throws CloneNotSupportedException, Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, "+overrideRelevance+"}\n" +
- "equals[METHOD_DECLARATION]{public boolean equals(Object obj), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), "+overrideRelevance+"}\n" +
- "finalize[METHOD_DECLARATION]{protected void finalize() throws Throwable, Ljava.lang.Object;, ()V, finalize, null, "+overrideRelevance+"}\n" +
- "hashCode[METHOD_DECLARATION]{public int hashCode(), Ljava.lang.Object;, ()I, hashCode, null, "+overrideRelevance+"}\n" +
+ "class[KEYWORD]{class, null, null, class, null, "+keywordRelevance+"}\n" +
+ "enum[KEYWORD]{enum, null, null, enum, null, "+keywordRelevance+"}\n" +
+ "final[KEYWORD]{final, null, null, final, null, "+keywordRelevance+"}\n" +
+ "interface[KEYWORD]{interface, null, null, interface, null, "+keywordRelevance+"}\n" +
+ "native[KEYWORD]{native, null, null, native, null, "+keywordRelevance+"}\n" +
+ "private[KEYWORD]{private, null, null, private, null, "+keywordRelevance+"}\n" +
+ "protected[KEYWORD]{protected, null, null, protected, null, "+keywordRelevance+"}\n" +
+ "public[KEYWORD]{public, null, null, public, null, "+keywordRelevance+"}\n" +
+ "static[KEYWORD]{static, null, null, static, null, "+keywordRelevance+"}\n" +
+ "strictfp[KEYWORD]{strictfp, null, null, strictfp, null, "+keywordRelevance+"}\n" +
+ "synchronized[KEYWORD]{synchronized, null, null, synchronized, null, "+keywordRelevance+"}\n" +
+ "team[KEYWORD]{team, null, null, team, null, "+keywordRelevance+"}\n" +
+ "transient[KEYWORD]{transient, null, null, transient, null, "+keywordRelevance+"}\n" +
+ "volatile[KEYWORD]{volatile, null, null, volatile, null, "+keywordRelevance+"}\n" +
+ "Foo[TYPE_REF]{Foo, , LFoo;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED + R_CASE + R_UNQUALIFIED)+"}\n" +
+ "clone[METHOD_DECLARATION]{protected Object clone() throws CloneNotSupportedException, Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, "+overrideRelevance+"}\n" +
+ "equals[METHOD_DECLARATION]{public boolean equals(Object obj), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), "+overrideRelevance+"}\n" +
+ "finalize[METHOD_DECLARATION]{protected void finalize() throws Throwable, Ljava.lang.Object;, ()V, finalize, null, "+overrideRelevance+"}\n" +
+ "hashCode[METHOD_DECLARATION]{public int hashCode(), Ljava.lang.Object;, ()I, hashCode, null, "+overrideRelevance+"}\n" +
"toString[METHOD_DECLARATION]{public String toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+overrideRelevance+"}",
requestor.getResults());
}
@@ -3237,18 +3237,18 @@ public void testBug537679() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/p/SuperSuper.java",
- "import static java.util.stream.Collectors.toList;\n" +
- "import java.util.List;\n" +
- "\n" +
- "public class Test {\n" +
- " void foo(List<Object> list) {\n" +
- " bar(list.stream().map(m -> new Object() {\n" +
- " // here\n" +
- " }).collect(toList()));\n" +
- " }\n" +
- "\n" +
- " private void bar(List<Object> collect) {\n" +
- " }\n" +
+ "import static java.util.stream.Collectors.toList;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " void foo(List<Object> list) {\n" +
+ " bar(list.stream().map(m -> new Object() {\n" +
+ " // here\n" +
+ " }).collect(toList()));\n" +
+ " }\n" +
+ "\n" +
+ " private void bar(List<Object> collect) {\n" +
+ " }\n" +
"}\n");
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
@@ -3259,32 +3259,32 @@ public void testBug537679() throws JavaModelException {
int keywordRelevance = R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED + R_CASE;
int overrideRelevance = R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED + R_CASE + R_METHOD_OVERIDE;
assertResults(
- "[POTENTIAL_METHOD_DECLARATION]{, LObject;, ()V, , null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED)+"}\n" +
+ "[POTENTIAL_METHOD_DECLARATION]{, LObject;, ()V, , null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED)+"}\n" +
"abstract[KEYWORD]{abstract, null, null, abstract, null, "+keywordRelevance+"}\n" +
//{ObjectTeams:
- "callin[KEYWORD]{callin, null, null, callin, null, "+keywordRelevance+"}\n" +
+ "callin[KEYWORD]{callin, null, null, callin, null, "+keywordRelevance+"}\n" +
// SH}
- "class[KEYWORD]{class, null, null, class, null, "+keywordRelevance+"}\n" +
- "enum[KEYWORD]{enum, null, null, enum, null, "+keywordRelevance+"}\n" +
- "final[KEYWORD]{final, null, null, final, null, "+keywordRelevance+"}\n" +
- "interface[KEYWORD]{interface, null, null, interface, null, "+keywordRelevance+"}\n" +
- "native[KEYWORD]{native, null, null, native, null, "+keywordRelevance+"}\n" +
- "private[KEYWORD]{private, null, null, private, null, "+keywordRelevance+"}\n" +
- "protected[KEYWORD]{protected, null, null, protected, null, "+keywordRelevance+"}\n" +
- "public[KEYWORD]{public, null, null, public, null, "+keywordRelevance+"}\n" +
- "static[KEYWORD]{static, null, null, static, null, "+keywordRelevance+"}\n" +
- "strictfp[KEYWORD]{strictfp, null, null, strictfp, null, "+keywordRelevance+"}\n" +
- "synchronized[KEYWORD]{synchronized, null, null, synchronized, null, "+keywordRelevance+"}\n" +
+ "class[KEYWORD]{class, null, null, class, null, "+keywordRelevance+"}\n" +
+ "enum[KEYWORD]{enum, null, null, enum, null, "+keywordRelevance+"}\n" +
+ "final[KEYWORD]{final, null, null, final, null, "+keywordRelevance+"}\n" +
+ "interface[KEYWORD]{interface, null, null, interface, null, "+keywordRelevance+"}\n" +
+ "native[KEYWORD]{native, null, null, native, null, "+keywordRelevance+"}\n" +
+ "private[KEYWORD]{private, null, null, private, null, "+keywordRelevance+"}\n" +
+ "protected[KEYWORD]{protected, null, null, protected, null, "+keywordRelevance+"}\n" +
+ "public[KEYWORD]{public, null, null, public, null, "+keywordRelevance+"}\n" +
+ "static[KEYWORD]{static, null, null, static, null, "+keywordRelevance+"}\n" +
+ "strictfp[KEYWORD]{strictfp, null, null, strictfp, null, "+keywordRelevance+"}\n" +
+ "synchronized[KEYWORD]{synchronized, null, null, synchronized, null, "+keywordRelevance+"}\n" +
//{ObjectTeams:
- "team[KEYWORD]{team, null, null, team, null, "+keywordRelevance+"}\n" +
+ "team[KEYWORD]{team, null, null, team, null, "+keywordRelevance+"}\n" +
// SH}
- "transient[KEYWORD]{transient, null, null, transient, null, "+keywordRelevance+"}\n" +
- "volatile[KEYWORD]{volatile, null, null, volatile, null, "+keywordRelevance+"}\n" +
- "Test[TYPE_REF]{Test, p, Lp.Test;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED + R_CASE + R_UNQUALIFIED)+"}\n" +
- "clone[METHOD_DECLARATION]{protected Object clone() throws CloneNotSupportedException, Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, "+overrideRelevance+"}\n" +
- "equals[METHOD_DECLARATION]{public boolean equals(Object obj), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), "+overrideRelevance+"}\n" +
- "finalize[METHOD_DECLARATION]{protected void finalize() throws Throwable, Ljava.lang.Object;, ()V, finalize, null, "+overrideRelevance+"}\n" +
- "hashCode[METHOD_DECLARATION]{public int hashCode(), Ljava.lang.Object;, ()I, hashCode, null, "+overrideRelevance+"}\n" +
+ "transient[KEYWORD]{transient, null, null, transient, null, "+keywordRelevance+"}\n" +
+ "volatile[KEYWORD]{volatile, null, null, volatile, null, "+keywordRelevance+"}\n" +
+ "Test[TYPE_REF]{Test, p, Lp.Test;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED + R_CASE + R_UNQUALIFIED)+"}\n" +
+ "clone[METHOD_DECLARATION]{protected Object clone() throws CloneNotSupportedException, Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, "+overrideRelevance+"}\n" +
+ "equals[METHOD_DECLARATION]{public boolean equals(Object obj), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), "+overrideRelevance+"}\n" +
+ "finalize[METHOD_DECLARATION]{protected void finalize() throws Throwable, Ljava.lang.Object;, ()V, finalize, null, "+overrideRelevance+"}\n" +
+ "hashCode[METHOD_DECLARATION]{public int hashCode(), Ljava.lang.Object;, ()I, hashCode, null, "+overrideRelevance+"}\n" +
"toString[METHOD_DECLARATION]{public String toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+overrideRelevance+"}",
requestor.getResults());
}
@@ -3301,7 +3301,7 @@ public void testBug460750a() throws JavaModelException {
" }\n" +
" public void meth() {\n" +
" this.setMyEnumValue(new String().isEmpty() ? MyEnum.FOO:BAR);\n" +
- " }\n" +
+ " }\n" +
"}\n");
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
@@ -3310,7 +3310,7 @@ public void testBug460750a() throws JavaModelException {
String completeBehind = "FOO:BAR";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
assertResults(
"BAR[FIELD_REF]{MyEnum.BAR, LFoo$MyEnum;, LFoo$MyEnum;, BAR, null, 108}",
requestor.getResults());
@@ -3330,8 +3330,8 @@ public void testBug460750b() throws JavaModelException {
" this.setMyEnumValue(new String().isEmpty() ? MyEnum.FOO:BAR);\n" +
" MyEnum e= MyEnum.FOO;\n" +
" if(e !=QUZ) { \n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}\n");
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
@@ -3347,15 +3347,15 @@ public void testBug460750b() throws JavaModelException {
}
/*
-* Test that completion doesn't throw NPE
+* Test that completion doesn't throw NPE
*/
public void testBug535743a() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/test/FooNPE.java",
- "package test;\n" +
+ "package test;\n" +
"public class FooNPE {\n" +
- " public static void main(String[] args) { \n" +
+ " public static void main(String[] args) { \n" +
" java.util.function.Consumer<Object> consumer = object -> {new SomeClass().something(obj -> {/*nop*/}).\n" +
" };\n" +
" }\n" +
@@ -3382,9 +3382,9 @@ public void testBug535743b() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/test/FooNPE.java",
- "package test;\n" +
+ "package test;\n" +
"public class FooNPE {\n" +
- " public static void main(String[] args) { \n" +
+ " public static void main(String[] args) { \n" +
" java.util.function.Consumer<Object> consumer = object -> {new SomeClass().something(obj -> {}).\n" +
" };\n" +
" }\n" +
@@ -3419,10 +3419,10 @@ public void testBug526044() throws Exception {
"}\n" +
"public class Test {\n" +
" void foo() {\n" +
- " ProcessHandle.allProcesses().forEach(p -> {\n" +
- " p.info().command().ifPresent(o -> {\n" +
- " System.out.println(o);\n" +
- " }).\n" +
+ " ProcessHandle.allProcesses().forEach(p -> {\n" +
+ " p.info().command().ifPresent(o -> {\n" +
+ " System.out.println(o);\n" +
+ " }).\n" +
" });" +
" }\n" +
"}\n");
@@ -3442,18 +3442,18 @@ public void testBug539546() throws Exception {
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/p/Test.java",
"package p;\n" +
- "public class Test {\n" +
- " public Test(Runnable run) {}\n" +
+ "public class Test {\n" +
+ " public Test(Runnable run) {}\n" +
"}\n");
this.workingCopies[1] = getWorkingCopy(
"/Completion/src/p/Test.java",
"package p;\n" +
- "public class Main {\n" +
- " public void myTestOfStackOverflow() {\n" +
- " () -> {\n" +
- " new Test(() -> {}).\n" +
- " }\n" +
- " }\n" +
+ "public class Main {\n" +
+ " public void myTestOfStackOverflow() {\n" +
+ " () -> {\n" +
+ " new Test(() -> {}).\n" +
+ " }\n" +
+ " }\n" +
"}\n");
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
@@ -3464,102 +3464,102 @@ public void testBug539546() throws Exception {
assertResults(
"",
- requestor.getResults());
+ requestor.getResults());
}
public void testBug477626() throws Exception {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/p/Snippet29.java",
"package p;\n" +
- "import java.util.Arrays;\n" +
- "import java.util.function.Consumer;\n" +
- "\n" +
- "public class Snippet29 {\n" +
- "\n" +
- "class Display {\n" +
- " public void asyncExec(Runnable runnable) { }\n" +
- "}\n" +
- "class Shell {\n" +
- " Shell(Display display) {}\n" +
- " public Shell(Shell shell, int i) { }\n" +
- " public void setLayout(GridLayout gridLayout) { }\n" +
- " public void setText(String string) { }\n" +
- " public void pack() { }\n" +
- " public Point getLocation() { return null; }\n" +
- " public void open() { }\n" +
- " public void close() { }\n" +
- " public void setLocation(int i, int j) { }\n" +
- "}\n" +
- "class Point {\n" +
- " int x, y;\n" +
- "}\n" +
- "class GridLayout {\n" +
- " public GridLayout() { }\n" +
- " public GridLayout(int i, boolean b) { }\n" +
- "}\n" +
- "class GridData {\n" +
- " public GridData(int fill, int fill2, boolean b, boolean c, int i, int j) { }\n" +
- " public GridData(int fill, int fill2, boolean b, boolean c) { }\n" +
- "}\n" +
- "class Widget {\n" +
- " public void setText(String string) { }\n" +
- " public void setLayoutData(GridData gridData) { }\n" +
- "}\n" +
- "class Button extends Widget {\n" +
- " Button(Shell shell, int style) { }\n" +
- " public void addListener(int selection, Consumer<Event> listener) { }\n" +
- "}\n" +
- "class Label extends Widget {\n" +
- " public Label(Shell dialog, int none) { }\n" +
- "}\n" +
- "class Event {}\n" +
- "class SWT {\n" +
- " public static final int PUSH = 1;\n" +
- " public static final int Selection = 2;\n" +
- " protected static final int DIALOG_TRIM = 3;\n" +
- " protected static final int APPLICATION_MODAL = 4;\n" +
- " protected static final int NONE = 5;\n" +
- " protected static final int FILL = 6;\n" +
- "}\n" +
- "class Timer {\n" +
- " public void schedule(TimerTask timerTask, int i) { }\n" +
- "}\n" +
- "abstract class TimerTask implements Runnable {}\n" +
- "public static void main (String [] args) {\n" +
- " Display display = new Display ();\n" +
- " Shell shell = new Shell (display);\n" +
- " shell.setLayout(new GridLayout());\n" +
- " Button b = new Button(shell, SWT.PUSH);\n" +
- " b.setText(\"Open dialog in 3s\");\n" +
- " b.addListener(SWT.Selection, e -> {\n" +
- " new Timer().schedule(new TimerTask() {\n" +
- " @Override\n" +
- " public void run() {\n" +
- " display.asyncExec(new Runnable() {\n" +
- " @Override\n" +
- " public void run() {\n" +
- " Shell dialog = new Shell(shell, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);\n" +
- " dialog.setText(\"Question\");\n" +
- " dialog.setLayout(new GridLayout(3, true));\n" +
- " Label label = new Label(dialog, SWT.NONE);\n" +
- " label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1));\n" +
- " label.setText(\"Do you really want to clear the runtime workspace?\");\n" +
- " Arrays.asList(\"Yes\", \"No\", \"Cancel\").forEach(t -> {\n" +
- " Button button = new Button(dialog, SWT.PUSH);\n" +
- " button.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));\n" +
- " button.setText(t);\n" +
- " button.addListener(SWT.Selection, e -> { dialog.close(); });\n" +
- " });\n" +
- " dialog.pack();\n" +
- " dialog.setLocation(shell.getLocation().x + 40, shell.getLocation().y + 80);\n" +
- " dialog.open();\n" +
- " }\n" +
- " }).;\n" +
- " }\n" +
- " }, 2000);\n" +
- " });\n" +
- "}\n" +
- "\n" +
+ "import java.util.Arrays;\n" +
+ "import java.util.function.Consumer;\n" +
+ "\n" +
+ "public class Snippet29 {\n" +
+ "\n" +
+ "class Display {\n" +
+ " public void asyncExec(Runnable runnable) { }\n" +
+ "}\n" +
+ "class Shell {\n" +
+ " Shell(Display display) {}\n" +
+ " public Shell(Shell shell, int i) { }\n" +
+ " public void setLayout(GridLayout gridLayout) { }\n" +
+ " public void setText(String string) { }\n" +
+ " public void pack() { }\n" +
+ " public Point getLocation() { return null; }\n" +
+ " public void open() { }\n" +
+ " public void close() { }\n" +
+ " public void setLocation(int i, int j) { }\n" +
+ "}\n" +
+ "class Point {\n" +
+ " int x, y;\n" +
+ "}\n" +
+ "class GridLayout {\n" +
+ " public GridLayout() { }\n" +
+ " public GridLayout(int i, boolean b) { }\n" +
+ "}\n" +
+ "class GridData {\n" +
+ " public GridData(int fill, int fill2, boolean b, boolean c, int i, int j) { }\n" +
+ " public GridData(int fill, int fill2, boolean b, boolean c) { }\n" +
+ "}\n" +
+ "class Widget {\n" +
+ " public void setText(String string) { }\n" +
+ " public void setLayoutData(GridData gridData) { }\n" +
+ "}\n" +
+ "class Button extends Widget {\n" +
+ " Button(Shell shell, int style) { }\n" +
+ " public void addListener(int selection, Consumer<Event> listener) { }\n" +
+ "}\n" +
+ "class Label extends Widget {\n" +
+ " public Label(Shell dialog, int none) { }\n" +
+ "}\n" +
+ "class Event {}\n" +
+ "class SWT {\n" +
+ " public static final int PUSH = 1;\n" +
+ " public static final int Selection = 2;\n" +
+ " protected static final int DIALOG_TRIM = 3;\n" +
+ " protected static final int APPLICATION_MODAL = 4;\n" +
+ " protected static final int NONE = 5;\n" +
+ " protected static final int FILL = 6;\n" +
+ "}\n" +
+ "class Timer {\n" +
+ " public void schedule(TimerTask timerTask, int i) { }\n" +
+ "}\n" +
+ "abstract class TimerTask implements Runnable {}\n" +
+ "public static void main (String [] args) {\n" +
+ " Display display = new Display ();\n" +
+ " Shell shell = new Shell (display);\n" +
+ " shell.setLayout(new GridLayout());\n" +
+ " Button b = new Button(shell, SWT.PUSH);\n" +
+ " b.setText(\"Open dialog in 3s\");\n" +
+ " b.addListener(SWT.Selection, e -> {\n" +
+ " new Timer().schedule(new TimerTask() {\n" +
+ " @Override\n" +
+ " public void run() {\n" +
+ " display.asyncExec(new Runnable() {\n" +
+ " @Override\n" +
+ " public void run() {\n" +
+ " Shell dialog = new Shell(shell, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);\n" +
+ " dialog.setText(\"Question\");\n" +
+ " dialog.setLayout(new GridLayout(3, true));\n" +
+ " Label label = new Label(dialog, SWT.NONE);\n" +
+ " label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1));\n" +
+ " label.setText(\"Do you really want to clear the runtime workspace?\");\n" +
+ " Arrays.asList(\"Yes\", \"No\", \"Cancel\").forEach(t -> {\n" +
+ " Button button = new Button(dialog, SWT.PUSH);\n" +
+ " button.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));\n" +
+ " button.setText(t);\n" +
+ " button.addListener(SWT.Selection, e -> { dialog.close(); });\n" +
+ " });\n" +
+ " dialog.pack();\n" +
+ " dialog.setLocation(shell.getLocation().x + 40, shell.getLocation().y + 80);\n" +
+ " dialog.open();\n" +
+ " }\n" +
+ " }).;\n" +
+ " }\n" +
+ " }, 2000);\n" +
+ " });\n" +
+ "}\n" +
+ "\n" +
"} \n");
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
@@ -3575,20 +3575,20 @@ public void testBug477626() throws Exception {
public void testBug490096() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy("/Completion/src/ShowSOEInEclipseMars2.java",
- "import java.util.concurrent.CompletableFuture;\n" +
- "\n" +
- "public class ShowSOEInEclipseMars2 {\n" +
- " \n" +
- "public void crashWithStackOverflowError() {\n" +
- " \n" +
- " CompletableFuture<Double> intermediate = CompletableFuture.supplyAsync(() -> {\n" +
- " try {\n" +
- " CompletableFuture.supplyAsync(() -> { return 0D; }).;\n" +
- " } catch (Exception e) {\n" +
- " }\n" +
- " return 1D;\n" +
- " });\n" +
- " }\n" +
+ "import java.util.concurrent.CompletableFuture;\n" +
+ "\n" +
+ "public class ShowSOEInEclipseMars2 {\n" +
+ " \n" +
+ "public void crashWithStackOverflowError() {\n" +
+ " \n" +
+ " CompletableFuture<Double> intermediate = CompletableFuture.supplyAsync(() -> {\n" +
+ " try {\n" +
+ " CompletableFuture.supplyAsync(() -> { return 0D; }).;\n" +
+ " } catch (Exception e) {\n" +
+ " }\n" +
+ " return 1D;\n" +
+ " });\n" +
+ " }\n" +
"}\n");
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.workingCopies[0].getSource();
@@ -3598,95 +3598,95 @@ public void testBug490096() throws JavaModelException {
int relevance1 = R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED;
int relevance2 = relevance1 + R_NON_STATIC;
assertResults(
- "allOf[METHOD_REF]{allOf(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, ([Ljava.util.concurrent.CompletableFuture<*>;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, allOf, (arg0), " + relevance1 + "}\n" +
- "anyOf[METHOD_REF]{anyOf(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, ([Ljava.util.concurrent.CompletableFuture<*>;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Object;>;, anyOf, (arg0), " + relevance1 + "}\n" +
- "completedFuture[METHOD_REF]{completedFuture(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(TU;)Ljava.util.concurrent.CompletableFuture<TU;>;, completedFuture, (arg0), " + relevance1 + "}\n" +
- "new[KEYWORD]{new, null, null, new, null, " + relevance1 + "}\n" +
- "runAsync[METHOD_REF]{runAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.lang.Runnable;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, runAsync, (arg0), " + relevance1 + "}\n" +
- "runAsync[METHOD_REF]{runAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.lang.Runnable;Ljava.util.concurrent.Executor;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, runAsync, (arg0, arg1), " + relevance1 + "}\n" +
- "supplyAsync[METHOD_REF]{supplyAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.function.Supplier<TU;>;)Ljava.util.concurrent.CompletableFuture<TU;>;, supplyAsync, (arg0), " + relevance1 + "}\n" +
- "supplyAsync[METHOD_REF]{supplyAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.function.Supplier<TU;>;Ljava.util.concurrent.Executor;)Ljava.util.concurrent.CompletableFuture<TU;>;, supplyAsync, (arg0, arg1), " + relevance1 + "}\n" +
- "acceptEither[METHOD_REF]{acceptEither(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.concurrent.CompletionStage<+Ljava.lang.Double;>;Ljava.util.function.Consumer<-Ljava.lang.Double;>;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, acceptEither, (arg0, arg1), " + relevance2 + "}\n" +
- "acceptEitherAsync[METHOD_REF]{acceptEitherAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.concurrent.CompletionStage<+Ljava.lang.Double;>;Ljava.util.function.Consumer<-Ljava.lang.Double;>;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, acceptEitherAsync, (arg0, arg1), " + relevance2 + "}\n" +
- "acceptEitherAsync[METHOD_REF]{acceptEitherAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.concurrent.CompletionStage<+Ljava.lang.Double;>;Ljava.util.function.Consumer<-Ljava.lang.Double;>;Ljava.util.concurrent.Executor;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, acceptEitherAsync, (arg0, arg1, arg2), " + relevance2 + "}\n" +
- "applyToEither[METHOD_REF]{applyToEither(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.concurrent.CompletionStage<+Ljava.lang.Double;>;Ljava.util.function.Function<-Ljava.lang.Double;TU;>;)Ljava.util.concurrent.CompletableFuture<TU;>;, applyToEither, (arg0, arg1), " + relevance2 + "}\n" +
- "applyToEitherAsync[METHOD_REF]{applyToEitherAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.concurrent.CompletionStage<+Ljava.lang.Double;>;Ljava.util.function.Function<-Ljava.lang.Double;TU;>;)Ljava.util.concurrent.CompletableFuture<TU;>;, applyToEitherAsync, (arg0, arg1), " + relevance2 + "}\n" +
- "applyToEitherAsync[METHOD_REF]{applyToEitherAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.concurrent.CompletionStage<+Ljava.lang.Double;>;Ljava.util.function.Function<-Ljava.lang.Double;TU;>;Ljava.util.concurrent.Executor;)Ljava.util.concurrent.CompletableFuture<TU;>;, applyToEitherAsync, (arg0, arg1, arg2), " + relevance2 + "}\n" +
- "cancel[METHOD_REF]{cancel(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Z)Z, cancel, (arg0), " + relevance2 + "}\n" +
- "clone[METHOD_REF]{clone(), Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, " + relevance2 + "}\n" +
- "complete[METHOD_REF]{complete(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.lang.Double;)Z, complete, (arg0), " + relevance2 + "}\n" +
- "completeExceptionally[METHOD_REF]{completeExceptionally(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.lang.Throwable;)Z, completeExceptionally, (arg0), " + relevance2 + "}\n" +
- "equals[METHOD_REF]{equals(), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), " + relevance2 + "}\n" +
- "exceptionally[METHOD_REF]{exceptionally(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.function.Function<Ljava.lang.Throwable;+Ljava.lang.Double;>;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, exceptionally, (arg0), " + relevance2 + "}\n" +
- "finalize[METHOD_REF]{finalize(), Ljava.lang.Object;, ()V, finalize, null, " + relevance2 + "}\n" +
- "get[METHOD_REF]{get(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, ()Ljava.lang.Double;, get, null, " + relevance2 + "}\n" +
- "get[METHOD_REF]{get(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (JLjava.util.concurrent.TimeUnit;)Ljava.lang.Double;, get, (arg0, arg1), " + relevance2 + "}\n" +
- "getClass[METHOD_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class<*>;, getClass, null, " + relevance2 + "}\n" +
- "getNow[METHOD_REF]{getNow(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.lang.Double;)Ljava.lang.Double;, getNow, (arg0), " + relevance2 + "}\n" +
- "getNumberOfDependents[METHOD_REF]{getNumberOfDependents(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, ()I, getNumberOfDependents, null, " + relevance2 + "}\n" +
- "handle[METHOD_REF]{handle(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.function.BiFunction<-Ljava.lang.Double;Ljava.lang.Throwable;+TU;>;)Ljava.util.concurrent.CompletableFuture<TU;>;, handle, (arg0), " + relevance2 + "}\n" +
- "handleAsync[METHOD_REF]{handleAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.function.BiFunction<-Ljava.lang.Double;Ljava.lang.Throwable;+TU;>;)Ljava.util.concurrent.CompletableFuture<TU;>;, handleAsync, (arg0), " + relevance2 + "}\n" +
- "handleAsync[METHOD_REF]{handleAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.function.BiFunction<-Ljava.lang.Double;Ljava.lang.Throwable;+TU;>;Ljava.util.concurrent.Executor;)Ljava.util.concurrent.CompletableFuture<TU;>;, handleAsync, (arg0, arg1), " + relevance2 + "}\n" +
- "hashCode[METHOD_REF]{hashCode(), Ljava.lang.Object;, ()I, hashCode, null, " + relevance2 + "}\n" +
- "isCancelled[METHOD_REF]{isCancelled(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, ()Z, isCancelled, null, " + relevance2 + "}\n" +
- "isCompletedExceptionally[METHOD_REF]{isCompletedExceptionally(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, ()Z, isCompletedExceptionally, null, " + relevance2 + "}\n" +
- "isDone[METHOD_REF]{isDone(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, ()Z, isDone, null, " + relevance2 + "}\n" +
- "join[METHOD_REF]{join(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, ()Ljava.lang.Double;, join, null, " + relevance2 + "}\n" +
- "notify[METHOD_REF]{notify(), Ljava.lang.Object;, ()V, notify, null, " + relevance2 + "}\n" +
- "notifyAll[METHOD_REF]{notifyAll(), Ljava.lang.Object;, ()V, notifyAll, null, " + relevance2 + "}\n" +
- "obtrudeException[METHOD_REF]{obtrudeException(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.lang.Throwable;)V, obtrudeException, (arg0), " + relevance2 + "}\n" +
- "obtrudeValue[METHOD_REF]{obtrudeValue(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.lang.Double;)V, obtrudeValue, (arg0), " + relevance2 + "}\n" +
- "runAfterBoth[METHOD_REF]{runAfterBoth(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.concurrent.CompletionStage<*>;Ljava.lang.Runnable;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, runAfterBoth, (arg0, arg1), " + relevance2 + "}\n" +
- "runAfterBothAsync[METHOD_REF]{runAfterBothAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.concurrent.CompletionStage<*>;Ljava.lang.Runnable;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, runAfterBothAsync, (arg0, arg1), " + relevance2 + "}\n" +
- "runAfterBothAsync[METHOD_REF]{runAfterBothAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.concurrent.CompletionStage<*>;Ljava.lang.Runnable;Ljava.util.concurrent.Executor;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, runAfterBothAsync, (arg0, arg1, arg2), " + relevance2 + "}\n" +
- "runAfterEither[METHOD_REF]{runAfterEither(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.concurrent.CompletionStage<*>;Ljava.lang.Runnable;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, runAfterEither, (arg0, arg1), " + relevance2 + "}\n" +
- "runAfterEitherAsync[METHOD_REF]{runAfterEitherAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.concurrent.CompletionStage<*>;Ljava.lang.Runnable;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, runAfterEitherAsync, (arg0, arg1), " + relevance2 + "}\n" +
- "runAfterEitherAsync[METHOD_REF]{runAfterEitherAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.concurrent.CompletionStage<*>;Ljava.lang.Runnable;Ljava.util.concurrent.Executor;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, runAfterEitherAsync, (arg0, arg1, arg2), " + relevance2 + "}\n" +
- "thenAccept[METHOD_REF]{thenAccept(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.function.Consumer<-Ljava.lang.Double;>;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, thenAccept, (arg0), " + relevance2 + "}\n" +
- "thenAcceptAsync[METHOD_REF]{thenAcceptAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.function.Consumer<-Ljava.lang.Double;>;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, thenAcceptAsync, (arg0), " + relevance2 + "}\n" +
- "thenAcceptAsync[METHOD_REF]{thenAcceptAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.function.Consumer<-Ljava.lang.Double;>;Ljava.util.concurrent.Executor;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, thenAcceptAsync, (arg0, arg1), " + relevance2 + "}\n" +
- "thenAcceptBoth[METHOD_REF]{thenAcceptBoth(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.concurrent.CompletionStage<+TU;>;Ljava.util.function.BiConsumer<-Ljava.lang.Double;-TU;>;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, thenAcceptBoth, (arg0, arg1), " + relevance2 + "}\n" +
- "thenAcceptBothAsync[METHOD_REF]{thenAcceptBothAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.concurrent.CompletionStage<+TU;>;Ljava.util.function.BiConsumer<-Ljava.lang.Double;-TU;>;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, thenAcceptBothAsync, (arg0, arg1), " + relevance2 + "}\n" +
- "thenAcceptBothAsync[METHOD_REF]{thenAcceptBothAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.concurrent.CompletionStage<+TU;>;Ljava.util.function.BiConsumer<-Ljava.lang.Double;-TU;>;Ljava.util.concurrent.Executor;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, thenAcceptBothAsync, (arg0, arg1, arg2), " + relevance2 + "}\n" +
- "thenApply[METHOD_REF]{thenApply(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.function.Function<-Ljava.lang.Double;+TU;>;)Ljava.util.concurrent.CompletableFuture<TU;>;, thenApply, (arg0), " + relevance2 + "}\n" +
- "thenApplyAsync[METHOD_REF]{thenApplyAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.function.Function<-Ljava.lang.Double;+TU;>;)Ljava.util.concurrent.CompletableFuture<TU;>;, thenApplyAsync, (arg0), " + relevance2 + "}\n" +
- "thenApplyAsync[METHOD_REF]{thenApplyAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.function.Function<-Ljava.lang.Double;+TU;>;Ljava.util.concurrent.Executor;)Ljava.util.concurrent.CompletableFuture<TU;>;, thenApplyAsync, (arg0, arg1), " + relevance2 + "}\n" +
- "thenCombine[METHOD_REF]{thenCombine(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;V:Ljava.lang.Object;>(Ljava.util.concurrent.CompletionStage<+TU;>;Ljava.util.function.BiFunction<-Ljava.lang.Double;-TU;+TV;>;)Ljava.util.concurrent.CompletableFuture<TV;>;, thenCombine, (arg0, arg1), " + relevance2 + "}\n" +
- "thenCombineAsync[METHOD_REF]{thenCombineAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;V:Ljava.lang.Object;>(Ljava.util.concurrent.CompletionStage<+TU;>;Ljava.util.function.BiFunction<-Ljava.lang.Double;-TU;+TV;>;)Ljava.util.concurrent.CompletableFuture<TV;>;, thenCombineAsync, (arg0, arg1), " + relevance2 + "}\n" +
- "thenCombineAsync[METHOD_REF]{thenCombineAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;V:Ljava.lang.Object;>(Ljava.util.concurrent.CompletionStage<+TU;>;Ljava.util.function.BiFunction<-Ljava.lang.Double;-TU;+TV;>;Ljava.util.concurrent.Executor;)Ljava.util.concurrent.CompletableFuture<TV;>;, thenCombineAsync, (arg0, arg1, arg2), " + relevance2 + "}\n" +
- "thenCompose[METHOD_REF]{thenCompose(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.function.Function<-Ljava.lang.Double;+Ljava.util.concurrent.CompletionStage<TU;>;>;)Ljava.util.concurrent.CompletableFuture<TU;>;, thenCompose, (arg0), " + relevance2 + "}\n" +
- "thenComposeAsync[METHOD_REF]{thenComposeAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.function.Function<-Ljava.lang.Double;+Ljava.util.concurrent.CompletionStage<TU;>;>;)Ljava.util.concurrent.CompletableFuture<TU;>;, thenComposeAsync, (arg0), " + relevance2 + "}\n" +
- "thenComposeAsync[METHOD_REF]{thenComposeAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.function.Function<-Ljava.lang.Double;+Ljava.util.concurrent.CompletionStage<TU;>;>;Ljava.util.concurrent.Executor;)Ljava.util.concurrent.CompletableFuture<TU;>;, thenComposeAsync, (arg0, arg1), " + relevance2 + "}\n" +
- "thenRun[METHOD_REF]{thenRun(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.lang.Runnable;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, thenRun, (arg0), " + relevance2 + "}\n" +
- "thenRunAsync[METHOD_REF]{thenRunAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.lang.Runnable;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, thenRunAsync, (arg0), " + relevance2 + "}\n" +
- "thenRunAsync[METHOD_REF]{thenRunAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.lang.Runnable;Ljava.util.concurrent.Executor;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, thenRunAsync, (arg0, arg1), " + relevance2 + "}\n" +
- "toCompletableFuture[METHOD_REF]{toCompletableFuture(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, ()Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, toCompletableFuture, null, " + relevance2 + "}\n" +
- "toString[METHOD_REF]{toString(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, ()Ljava.lang.String;, toString, null, " + relevance2 + "}\n" +
- "wait[METHOD_REF]{wait(), Ljava.lang.Object;, ()V, wait, null, " + relevance2 + "}\n" +
- "wait[METHOD_REF]{wait(), Ljava.lang.Object;, (J)V, wait, (millis), " + relevance2 + "}\n" +
- "wait[METHOD_REF]{wait(), Ljava.lang.Object;, (JI)V, wait, (millis, nanos), " + relevance2 + "}\n" +
- "whenComplete[METHOD_REF]{whenComplete(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.function.BiConsumer<-Ljava.lang.Double;-Ljava.lang.Throwable;>;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, whenComplete, (arg0), " + relevance2 + "}\n" +
- "whenCompleteAsync[METHOD_REF]{whenCompleteAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.function.BiConsumer<-Ljava.lang.Double;-Ljava.lang.Throwable;>;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, whenCompleteAsync, (arg0), " + relevance2 + "}\n" +
+ "allOf[METHOD_REF]{allOf(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, ([Ljava.util.concurrent.CompletableFuture<*>;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, allOf, (arg0), " + relevance1 + "}\n" +
+ "anyOf[METHOD_REF]{anyOf(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, ([Ljava.util.concurrent.CompletableFuture<*>;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Object;>;, anyOf, (arg0), " + relevance1 + "}\n" +
+ "completedFuture[METHOD_REF]{completedFuture(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(TU;)Ljava.util.concurrent.CompletableFuture<TU;>;, completedFuture, (arg0), " + relevance1 + "}\n" +
+ "new[KEYWORD]{new, null, null, new, null, " + relevance1 + "}\n" +
+ "runAsync[METHOD_REF]{runAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.lang.Runnable;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, runAsync, (arg0), " + relevance1 + "}\n" +
+ "runAsync[METHOD_REF]{runAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.lang.Runnable;Ljava.util.concurrent.Executor;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, runAsync, (arg0, arg1), " + relevance1 + "}\n" +
+ "supplyAsync[METHOD_REF]{supplyAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.function.Supplier<TU;>;)Ljava.util.concurrent.CompletableFuture<TU;>;, supplyAsync, (arg0), " + relevance1 + "}\n" +
+ "supplyAsync[METHOD_REF]{supplyAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.function.Supplier<TU;>;Ljava.util.concurrent.Executor;)Ljava.util.concurrent.CompletableFuture<TU;>;, supplyAsync, (arg0, arg1), " + relevance1 + "}\n" +
+ "acceptEither[METHOD_REF]{acceptEither(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.concurrent.CompletionStage<+Ljava.lang.Double;>;Ljava.util.function.Consumer<-Ljava.lang.Double;>;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, acceptEither, (arg0, arg1), " + relevance2 + "}\n" +
+ "acceptEitherAsync[METHOD_REF]{acceptEitherAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.concurrent.CompletionStage<+Ljava.lang.Double;>;Ljava.util.function.Consumer<-Ljava.lang.Double;>;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, acceptEitherAsync, (arg0, arg1), " + relevance2 + "}\n" +
+ "acceptEitherAsync[METHOD_REF]{acceptEitherAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.concurrent.CompletionStage<+Ljava.lang.Double;>;Ljava.util.function.Consumer<-Ljava.lang.Double;>;Ljava.util.concurrent.Executor;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, acceptEitherAsync, (arg0, arg1, arg2), " + relevance2 + "}\n" +
+ "applyToEither[METHOD_REF]{applyToEither(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.concurrent.CompletionStage<+Ljava.lang.Double;>;Ljava.util.function.Function<-Ljava.lang.Double;TU;>;)Ljava.util.concurrent.CompletableFuture<TU;>;, applyToEither, (arg0, arg1), " + relevance2 + "}\n" +
+ "applyToEitherAsync[METHOD_REF]{applyToEitherAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.concurrent.CompletionStage<+Ljava.lang.Double;>;Ljava.util.function.Function<-Ljava.lang.Double;TU;>;)Ljava.util.concurrent.CompletableFuture<TU;>;, applyToEitherAsync, (arg0, arg1), " + relevance2 + "}\n" +
+ "applyToEitherAsync[METHOD_REF]{applyToEitherAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.concurrent.CompletionStage<+Ljava.lang.Double;>;Ljava.util.function.Function<-Ljava.lang.Double;TU;>;Ljava.util.concurrent.Executor;)Ljava.util.concurrent.CompletableFuture<TU;>;, applyToEitherAsync, (arg0, arg1, arg2), " + relevance2 + "}\n" +
+ "cancel[METHOD_REF]{cancel(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Z)Z, cancel, (arg0), " + relevance2 + "}\n" +
+ "clone[METHOD_REF]{clone(), Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, " + relevance2 + "}\n" +
+ "complete[METHOD_REF]{complete(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.lang.Double;)Z, complete, (arg0), " + relevance2 + "}\n" +
+ "completeExceptionally[METHOD_REF]{completeExceptionally(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.lang.Throwable;)Z, completeExceptionally, (arg0), " + relevance2 + "}\n" +
+ "equals[METHOD_REF]{equals(), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), " + relevance2 + "}\n" +
+ "exceptionally[METHOD_REF]{exceptionally(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.function.Function<Ljava.lang.Throwable;+Ljava.lang.Double;>;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, exceptionally, (arg0), " + relevance2 + "}\n" +
+ "finalize[METHOD_REF]{finalize(), Ljava.lang.Object;, ()V, finalize, null, " + relevance2 + "}\n" +
+ "get[METHOD_REF]{get(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, ()Ljava.lang.Double;, get, null, " + relevance2 + "}\n" +
+ "get[METHOD_REF]{get(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (JLjava.util.concurrent.TimeUnit;)Ljava.lang.Double;, get, (arg0, arg1), " + relevance2 + "}\n" +
+ "getClass[METHOD_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class<*>;, getClass, null, " + relevance2 + "}\n" +
+ "getNow[METHOD_REF]{getNow(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.lang.Double;)Ljava.lang.Double;, getNow, (arg0), " + relevance2 + "}\n" +
+ "getNumberOfDependents[METHOD_REF]{getNumberOfDependents(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, ()I, getNumberOfDependents, null, " + relevance2 + "}\n" +
+ "handle[METHOD_REF]{handle(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.function.BiFunction<-Ljava.lang.Double;Ljava.lang.Throwable;+TU;>;)Ljava.util.concurrent.CompletableFuture<TU;>;, handle, (arg0), " + relevance2 + "}\n" +
+ "handleAsync[METHOD_REF]{handleAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.function.BiFunction<-Ljava.lang.Double;Ljava.lang.Throwable;+TU;>;)Ljava.util.concurrent.CompletableFuture<TU;>;, handleAsync, (arg0), " + relevance2 + "}\n" +
+ "handleAsync[METHOD_REF]{handleAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.function.BiFunction<-Ljava.lang.Double;Ljava.lang.Throwable;+TU;>;Ljava.util.concurrent.Executor;)Ljava.util.concurrent.CompletableFuture<TU;>;, handleAsync, (arg0, arg1), " + relevance2 + "}\n" +
+ "hashCode[METHOD_REF]{hashCode(), Ljava.lang.Object;, ()I, hashCode, null, " + relevance2 + "}\n" +
+ "isCancelled[METHOD_REF]{isCancelled(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, ()Z, isCancelled, null, " + relevance2 + "}\n" +
+ "isCompletedExceptionally[METHOD_REF]{isCompletedExceptionally(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, ()Z, isCompletedExceptionally, null, " + relevance2 + "}\n" +
+ "isDone[METHOD_REF]{isDone(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, ()Z, isDone, null, " + relevance2 + "}\n" +
+ "join[METHOD_REF]{join(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, ()Ljava.lang.Double;, join, null, " + relevance2 + "}\n" +
+ "notify[METHOD_REF]{notify(), Ljava.lang.Object;, ()V, notify, null, " + relevance2 + "}\n" +
+ "notifyAll[METHOD_REF]{notifyAll(), Ljava.lang.Object;, ()V, notifyAll, null, " + relevance2 + "}\n" +
+ "obtrudeException[METHOD_REF]{obtrudeException(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.lang.Throwable;)V, obtrudeException, (arg0), " + relevance2 + "}\n" +
+ "obtrudeValue[METHOD_REF]{obtrudeValue(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.lang.Double;)V, obtrudeValue, (arg0), " + relevance2 + "}\n" +
+ "runAfterBoth[METHOD_REF]{runAfterBoth(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.concurrent.CompletionStage<*>;Ljava.lang.Runnable;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, runAfterBoth, (arg0, arg1), " + relevance2 + "}\n" +
+ "runAfterBothAsync[METHOD_REF]{runAfterBothAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.concurrent.CompletionStage<*>;Ljava.lang.Runnable;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, runAfterBothAsync, (arg0, arg1), " + relevance2 + "}\n" +
+ "runAfterBothAsync[METHOD_REF]{runAfterBothAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.concurrent.CompletionStage<*>;Ljava.lang.Runnable;Ljava.util.concurrent.Executor;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, runAfterBothAsync, (arg0, arg1, arg2), " + relevance2 + "}\n" +
+ "runAfterEither[METHOD_REF]{runAfterEither(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.concurrent.CompletionStage<*>;Ljava.lang.Runnable;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, runAfterEither, (arg0, arg1), " + relevance2 + "}\n" +
+ "runAfterEitherAsync[METHOD_REF]{runAfterEitherAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.concurrent.CompletionStage<*>;Ljava.lang.Runnable;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, runAfterEitherAsync, (arg0, arg1), " + relevance2 + "}\n" +
+ "runAfterEitherAsync[METHOD_REF]{runAfterEitherAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.concurrent.CompletionStage<*>;Ljava.lang.Runnable;Ljava.util.concurrent.Executor;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, runAfterEitherAsync, (arg0, arg1, arg2), " + relevance2 + "}\n" +
+ "thenAccept[METHOD_REF]{thenAccept(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.function.Consumer<-Ljava.lang.Double;>;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, thenAccept, (arg0), " + relevance2 + "}\n" +
+ "thenAcceptAsync[METHOD_REF]{thenAcceptAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.function.Consumer<-Ljava.lang.Double;>;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, thenAcceptAsync, (arg0), " + relevance2 + "}\n" +
+ "thenAcceptAsync[METHOD_REF]{thenAcceptAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.function.Consumer<-Ljava.lang.Double;>;Ljava.util.concurrent.Executor;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, thenAcceptAsync, (arg0, arg1), " + relevance2 + "}\n" +
+ "thenAcceptBoth[METHOD_REF]{thenAcceptBoth(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.concurrent.CompletionStage<+TU;>;Ljava.util.function.BiConsumer<-Ljava.lang.Double;-TU;>;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, thenAcceptBoth, (arg0, arg1), " + relevance2 + "}\n" +
+ "thenAcceptBothAsync[METHOD_REF]{thenAcceptBothAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.concurrent.CompletionStage<+TU;>;Ljava.util.function.BiConsumer<-Ljava.lang.Double;-TU;>;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, thenAcceptBothAsync, (arg0, arg1), " + relevance2 + "}\n" +
+ "thenAcceptBothAsync[METHOD_REF]{thenAcceptBothAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.concurrent.CompletionStage<+TU;>;Ljava.util.function.BiConsumer<-Ljava.lang.Double;-TU;>;Ljava.util.concurrent.Executor;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, thenAcceptBothAsync, (arg0, arg1, arg2), " + relevance2 + "}\n" +
+ "thenApply[METHOD_REF]{thenApply(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.function.Function<-Ljava.lang.Double;+TU;>;)Ljava.util.concurrent.CompletableFuture<TU;>;, thenApply, (arg0), " + relevance2 + "}\n" +
+ "thenApplyAsync[METHOD_REF]{thenApplyAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.function.Function<-Ljava.lang.Double;+TU;>;)Ljava.util.concurrent.CompletableFuture<TU;>;, thenApplyAsync, (arg0), " + relevance2 + "}\n" +
+ "thenApplyAsync[METHOD_REF]{thenApplyAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.function.Function<-Ljava.lang.Double;+TU;>;Ljava.util.concurrent.Executor;)Ljava.util.concurrent.CompletableFuture<TU;>;, thenApplyAsync, (arg0, arg1), " + relevance2 + "}\n" +
+ "thenCombine[METHOD_REF]{thenCombine(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;V:Ljava.lang.Object;>(Ljava.util.concurrent.CompletionStage<+TU;>;Ljava.util.function.BiFunction<-Ljava.lang.Double;-TU;+TV;>;)Ljava.util.concurrent.CompletableFuture<TV;>;, thenCombine, (arg0, arg1), " + relevance2 + "}\n" +
+ "thenCombineAsync[METHOD_REF]{thenCombineAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;V:Ljava.lang.Object;>(Ljava.util.concurrent.CompletionStage<+TU;>;Ljava.util.function.BiFunction<-Ljava.lang.Double;-TU;+TV;>;)Ljava.util.concurrent.CompletableFuture<TV;>;, thenCombineAsync, (arg0, arg1), " + relevance2 + "}\n" +
+ "thenCombineAsync[METHOD_REF]{thenCombineAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;V:Ljava.lang.Object;>(Ljava.util.concurrent.CompletionStage<+TU;>;Ljava.util.function.BiFunction<-Ljava.lang.Double;-TU;+TV;>;Ljava.util.concurrent.Executor;)Ljava.util.concurrent.CompletableFuture<TV;>;, thenCombineAsync, (arg0, arg1, arg2), " + relevance2 + "}\n" +
+ "thenCompose[METHOD_REF]{thenCompose(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.function.Function<-Ljava.lang.Double;+Ljava.util.concurrent.CompletionStage<TU;>;>;)Ljava.util.concurrent.CompletableFuture<TU;>;, thenCompose, (arg0), " + relevance2 + "}\n" +
+ "thenComposeAsync[METHOD_REF]{thenComposeAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.function.Function<-Ljava.lang.Double;+Ljava.util.concurrent.CompletionStage<TU;>;>;)Ljava.util.concurrent.CompletableFuture<TU;>;, thenComposeAsync, (arg0), " + relevance2 + "}\n" +
+ "thenComposeAsync[METHOD_REF]{thenComposeAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.function.Function<-Ljava.lang.Double;+Ljava.util.concurrent.CompletionStage<TU;>;>;Ljava.util.concurrent.Executor;)Ljava.util.concurrent.CompletableFuture<TU;>;, thenComposeAsync, (arg0, arg1), " + relevance2 + "}\n" +
+ "thenRun[METHOD_REF]{thenRun(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.lang.Runnable;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, thenRun, (arg0), " + relevance2 + "}\n" +
+ "thenRunAsync[METHOD_REF]{thenRunAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.lang.Runnable;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, thenRunAsync, (arg0), " + relevance2 + "}\n" +
+ "thenRunAsync[METHOD_REF]{thenRunAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.lang.Runnable;Ljava.util.concurrent.Executor;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, thenRunAsync, (arg0, arg1), " + relevance2 + "}\n" +
+ "toCompletableFuture[METHOD_REF]{toCompletableFuture(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, ()Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, toCompletableFuture, null, " + relevance2 + "}\n" +
+ "toString[METHOD_REF]{toString(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, ()Ljava.lang.String;, toString, null, " + relevance2 + "}\n" +
+ "wait[METHOD_REF]{wait(), Ljava.lang.Object;, ()V, wait, null, " + relevance2 + "}\n" +
+ "wait[METHOD_REF]{wait(), Ljava.lang.Object;, (J)V, wait, (millis), " + relevance2 + "}\n" +
+ "wait[METHOD_REF]{wait(), Ljava.lang.Object;, (JI)V, wait, (millis, nanos), " + relevance2 + "}\n" +
+ "whenComplete[METHOD_REF]{whenComplete(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.function.BiConsumer<-Ljava.lang.Double;-Ljava.lang.Throwable;>;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, whenComplete, (arg0), " + relevance2 + "}\n" +
+ "whenCompleteAsync[METHOD_REF]{whenCompleteAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.function.BiConsumer<-Ljava.lang.Double;-Ljava.lang.Throwable;>;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, whenCompleteAsync, (arg0), " + relevance2 + "}\n" +
"whenCompleteAsync[METHOD_REF]{whenCompleteAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.function.BiConsumer<-Ljava.lang.Double;-Ljava.lang.Throwable;>;Ljava.util.concurrent.Executor;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, whenCompleteAsync, (arg0, arg1), " + relevance2 + "}",
requestor.getResults());
}
public void testBug490096a() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy("/Completion/src/ShowSOEInEclipseMars2.java",
- "import java.util.concurrent.CompletableFuture;\n" +
- "\n" +
- "public class ShowSOEInEclipseMars2 {\n" +
- " \n" +
- "public void crashWithStackOverflowError() {\n" +
- " \n" +
- " CompletableFuture<Double> intermediate = CompletableFuture.supplyAsync(() -> {\n" +
- " try {\n" +
- " CompletableFuture.supplyAsync(() -> { return 0D; }).a;\n" +
- " } catch (Exception e) {\n" +
- " }\n" +
- " return 1D;\n" +
- " });\n" +
- " }\n" +
+ "import java.util.concurrent.CompletableFuture;\n" +
+ "\n" +
+ "public class ShowSOEInEclipseMars2 {\n" +
+ " \n" +
+ "public void crashWithStackOverflowError() {\n" +
+ " \n" +
+ " CompletableFuture<Double> intermediate = CompletableFuture.supplyAsync(() -> {\n" +
+ " try {\n" +
+ " CompletableFuture.supplyAsync(() -> { return 0D; }).a;\n" +
+ " } catch (Exception e) {\n" +
+ " }\n" +
+ " return 1D;\n" +
+ " });\n" +
+ " }\n" +
"}\n");
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.workingCopies[0].getSource();
@@ -3696,13 +3696,13 @@ public void testBug490096a() throws JavaModelException {
int relevance1 = R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED;
int relevance2 = relevance1 + R_NON_STATIC;
assertResults(
- "allOf[METHOD_REF]{allOf(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, ([Ljava.util.concurrent.CompletableFuture<*>;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, allOf, (arg0), " + relevance1 + "}\n" +
- "anyOf[METHOD_REF]{anyOf(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, ([Ljava.util.concurrent.CompletableFuture<*>;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Object;>;, anyOf, (arg0), " + relevance1 + "}\n" +
- "acceptEither[METHOD_REF]{acceptEither(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.concurrent.CompletionStage<+Ljava.lang.Double;>;Ljava.util.function.Consumer<-Ljava.lang.Double;>;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, acceptEither, (arg0, arg1), " + relevance2 + "}\n" +
- "acceptEitherAsync[METHOD_REF]{acceptEitherAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.concurrent.CompletionStage<+Ljava.lang.Double;>;Ljava.util.function.Consumer<-Ljava.lang.Double;>;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, acceptEitherAsync, (arg0, arg1), " + relevance2 + "}\n" +
- "acceptEitherAsync[METHOD_REF]{acceptEitherAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.concurrent.CompletionStage<+Ljava.lang.Double;>;Ljava.util.function.Consumer<-Ljava.lang.Double;>;Ljava.util.concurrent.Executor;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, acceptEitherAsync, (arg0, arg1, arg2), " + relevance2 + "}\n" +
- "applyToEither[METHOD_REF]{applyToEither(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.concurrent.CompletionStage<+Ljava.lang.Double;>;Ljava.util.function.Function<-Ljava.lang.Double;TU;>;)Ljava.util.concurrent.CompletableFuture<TU;>;, applyToEither, (arg0, arg1), " + relevance2 + "}\n" +
- "applyToEitherAsync[METHOD_REF]{applyToEitherAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.concurrent.CompletionStage<+Ljava.lang.Double;>;Ljava.util.function.Function<-Ljava.lang.Double;TU;>;)Ljava.util.concurrent.CompletableFuture<TU;>;, applyToEitherAsync, (arg0, arg1), " + relevance2 + "}\n" +
+ "allOf[METHOD_REF]{allOf(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, ([Ljava.util.concurrent.CompletableFuture<*>;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, allOf, (arg0), " + relevance1 + "}\n" +
+ "anyOf[METHOD_REF]{anyOf(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, ([Ljava.util.concurrent.CompletableFuture<*>;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Object;>;, anyOf, (arg0), " + relevance1 + "}\n" +
+ "acceptEither[METHOD_REF]{acceptEither(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.concurrent.CompletionStage<+Ljava.lang.Double;>;Ljava.util.function.Consumer<-Ljava.lang.Double;>;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, acceptEither, (arg0, arg1), " + relevance2 + "}\n" +
+ "acceptEitherAsync[METHOD_REF]{acceptEitherAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.concurrent.CompletionStage<+Ljava.lang.Double;>;Ljava.util.function.Consumer<-Ljava.lang.Double;>;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, acceptEitherAsync, (arg0, arg1), " + relevance2 + "}\n" +
+ "acceptEitherAsync[METHOD_REF]{acceptEitherAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, (Ljava.util.concurrent.CompletionStage<+Ljava.lang.Double;>;Ljava.util.function.Consumer<-Ljava.lang.Double;>;Ljava.util.concurrent.Executor;)Ljava.util.concurrent.CompletableFuture<Ljava.lang.Void;>;, acceptEitherAsync, (arg0, arg1, arg2), " + relevance2 + "}\n" +
+ "applyToEither[METHOD_REF]{applyToEither(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.concurrent.CompletionStage<+Ljava.lang.Double;>;Ljava.util.function.Function<-Ljava.lang.Double;TU;>;)Ljava.util.concurrent.CompletableFuture<TU;>;, applyToEither, (arg0, arg1), " + relevance2 + "}\n" +
+ "applyToEitherAsync[METHOD_REF]{applyToEitherAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.concurrent.CompletionStage<+Ljava.lang.Double;>;Ljava.util.function.Function<-Ljava.lang.Double;TU;>;)Ljava.util.concurrent.CompletableFuture<TU;>;, applyToEitherAsync, (arg0, arg1), " + relevance2 + "}\n" +
"applyToEitherAsync[METHOD_REF]{applyToEitherAsync(), Ljava.util.concurrent.CompletableFuture<Ljava.lang.Double;>;, <U:Ljava.lang.Object;>(Ljava.util.concurrent.CompletionStage<+Ljava.lang.Double;>;Ljava.util.function.Function<-Ljava.lang.Double;TU;>;Ljava.util.concurrent.Executor;)Ljava.util.concurrent.CompletableFuture<TU;>;, applyToEitherAsync, (arg0, arg1, arg2), " + relevance2 + "}",
requestor.getResults());
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests2.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests2.java
index c9ed85bdb..6efe0c5b1 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests2.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests2.java
@@ -56,7 +56,7 @@ import org.eclipse.jdt.internal.core.search.indexing.IndexManager;
@SuppressWarnings({"rawtypes", "unchecked", "hiding"})
public class CompletionTests2 extends AbstractJavaModelCompletionTests {
-
+
static {
// TESTS_NAMES = new String[]{"testBug373409"};
}
@@ -444,14 +444,14 @@ public void testBug33560() throws Exception {
}
public void testBug6930_01() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin");
-
+
createFolder("/P/src/p6930");
-
+
this.workingCopies = new ICompilationUnit[3];
-
+
this.workingCopies[1] = getWorkingCopy("/P/src/p6930/AllConstructors01.java",
"package p6930;\n" +
"public class AllConstructors01 {\n" +
@@ -461,17 +461,17 @@ public void testBug6930_01() throws Exception {
" public AllConstructors01(Object o, String s) {}\n" +
"}\n"
);
-
+
this.workingCopies[2] = getWorkingCopy("/P/src/p6930/AllConstructors01b.java",
"package p6930;\n" +
"public class AllConstructors01b {\n" +
"}\n"
);
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
"package test;"+
@@ -490,7 +490,7 @@ public void testBug6930_01() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"AllConstructors01[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors01;, ()V, AllConstructors01, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
" AllConstructors01[TYPE_REF]{p6930.AllConstructors01, p6930, Lp6930.AllConstructors01;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
@@ -505,20 +505,20 @@ public void testBug6930_01() throws Exception {
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_02() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib6930.jar"}, "bin");
-
+
createJar(new String[] {
"p6930/AllConstructors02.java",
"package p6930;\n" +
@@ -533,11 +533,11 @@ public void testBug6930_02() throws Exception {
"public class AllConstructors02b {\n" +
"}"
}, p.getProject().getLocation().append("lib6930.jar").toOSString());
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -557,7 +557,7 @@ public void testBug6930_02() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"AllConstructors02[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors02;, ()V, AllConstructors02, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
" AllConstructors02[TYPE_REF]{p6930.AllConstructors02, p6930, Lp6930.AllConstructors02;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
@@ -572,22 +572,22 @@ public void testBug6930_02() throws Exception {
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_03() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin");
-
+
createFolder("/P/src/p6930");
-
+
createFile(
"/P/src/p6930/AllConstructors03.java",
"package p6930;\n" +
@@ -597,16 +597,16 @@ public void testBug6930_03() throws Exception {
" public AllConstructors03(int o) {}\n" +
" public AllConstructors03(Object o, String s) {}\n" +
"}");
-
+
createFile(
"/P/src/p6930/AllConstructors03b.java",
"package p6930;\n" +
"public class AllConstructors03b {\n" +
"}");
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -626,7 +626,7 @@ public void testBug6930_03() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"AllConstructors03[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors03;, ()V, AllConstructors03, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
" AllConstructors03[TYPE_REF]{p6930.AllConstructors03, p6930, Lp6930.AllConstructors03;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
@@ -641,24 +641,24 @@ public void testBug6930_03() throws Exception {
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_04() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[2];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -680,7 +680,7 @@ public void testBug6930_04() throws Exception {
" new AllConstructors\n" +
" }\n" +
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/P/src/test/AllConstructors04g.java",
"package test;"+
@@ -698,7 +698,7 @@ public void testBug6930_04() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"AllConstructors04a[CONSTRUCTOR_INVOCATION]{(), Ltest.AllConstructors04a;, ()V, AllConstructors04a, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
" AllConstructors04a[TYPE_REF]{AllConstructors04a, test, Ltest.AllConstructors04a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
@@ -711,24 +711,24 @@ public void testBug6930_04() throws Exception {
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_05() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[2];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -746,7 +746,7 @@ public void testBug6930_05() throws Exception {
" new AllConstructors\n" +
" }\n" +
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/P/src/test/AllConstructors05g.java",
"package test;"+
@@ -764,7 +764,7 @@ public void testBug6930_05() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"AllConstructors05a[TYPE_REF]{AllConstructors05a, test, Ltest.AllConstructors05a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" +
"AllConstructors05g[TYPE_REF]{AllConstructors05g, test, Ltest.AllConstructors05g;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" +
@@ -778,39 +778,39 @@ public void testBug6930_05() throws Exception {
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_06() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib6930.jar"}, "bin");
-
+
createFolder("/P/src/p6930");
-
+
createFile(
"/P/src/p6930/AllConstructors06a.java",
"package p6930;\n" +
"public class AllConstructors06a {\n" +
"}");
-
+
createJar(new String[] {
"p6930/AllConstructors06b.java",
"package p6930;\n" +
"public class AllConstructors06b {\n" +
"}"
}, p.getProject().getLocation().append("lib6930.jar").toOSString());
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[2];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -823,7 +823,7 @@ public void testBug6930_06() throws Exception {
" new AllConstructors\n" +
" }\n" +
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/P/src/p6930/AllConstructors06c.java",
"package p6930;"+
@@ -839,7 +839,7 @@ public void testBug6930_06() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"AllConstructors06a[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors06a;, ()V, AllConstructors06a, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
" AllConstructors06a[TYPE_REF]{AllConstructors06a, p6930, Lp6930.AllConstructors06a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
@@ -851,22 +851,22 @@ public void testBug6930_06() throws Exception {
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_07() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib6930.jar"}, "bin");
-
+
createFolder("/P/src/p6930");
-
+
createFile(
"/P/src/p6930/AllConstructors07a.java",
"package p6930;\n" +
@@ -876,7 +876,7 @@ public void testBug6930_07() throws Exception {
" public static class AllConstructors07c {\n" +
" }\n" +
"}");
-
+
createFile(
"/P/src/p6930/AllConstructors07d.java",
"package p6930;\n" +
@@ -886,11 +886,11 @@ public void testBug6930_07() throws Exception {
" public static class AllConstructors07f {\n" +
" }\n" +
"}");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -911,7 +911,7 @@ public void testBug6930_07() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"AllConstructors07a[TYPE_REF]{p6930.AllConstructors07a, p6930, Lp6930.AllConstructors07a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" +
"AllConstructors07d[TYPE_REF]{p6930.AllConstructors07d, p6930, Lp6930.AllConstructors07d;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" +
@@ -922,22 +922,22 @@ public void testBug6930_07() throws Exception {
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_08() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL15_LIB", "/P/lib6930.jar"}, "bin", "1.5");
-
+
createFolder("/P/src/p6930");
-
+
createFile(
"/P/src/p6930/AllConstructors08a.java",
"package p6930;\n" +
@@ -947,7 +947,7 @@ public void testBug6930_08() throws Exception {
" public static class AllConstructors08c {\n" +
" }\n" +
"}");
-
+
createFile(
"/P/src/p6930/AllConstructors08d.java",
"package p6930;\n" +
@@ -957,11 +957,11 @@ public void testBug6930_08() throws Exception {
" public static class AllConstructors08f {\n" +
" }\n" +
"}");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -982,7 +982,7 @@ public void testBug6930_08() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"AllConstructors08d[TYPE_REF]{p6930.AllConstructors08d, p6930, Lp6930.AllConstructors08d;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" +
"AllConstructors08a[TYPE_REF]{AllConstructors08a, p6930, Lp6930.AllConstructors08a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" +
@@ -993,23 +993,23 @@ public void testBug6930_08() throws Exception {
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_09() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL15_LIB", "/P/lib6930.jar"}, "bin", "1.5");
-
+
createFolder("/P/src/p6930");
-
+
createFile(
"/P/src/p6930/AllConstructors09a.java",
"package p6930;\n" +
@@ -1019,7 +1019,7 @@ public void testBug6930_09() throws Exception {
" public static class AllConstructors09c {\n" +
" }\n" +
"}");
-
+
createFile(
"/P/src/p6930/AllConstructors09d.java",
"package p6930;\n" +
@@ -1031,11 +1031,11 @@ public void testBug6930_09() throws Exception {
" }\n" +
" }\n" +
"}");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -1057,7 +1057,7 @@ public void testBug6930_09() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"AllConstructors09a[TYPE_REF]{p6930.AllConstructors09a, p6930, Lp6930.AllConstructors09a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" +
"AllConstructors09d[TYPE_REF]{p6930.AllConstructors09d, p6930, Lp6930.AllConstructors09d;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" +
@@ -1071,22 +1071,22 @@ public void testBug6930_09() throws Exception {
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_10() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL15_LIB", "/P/lib6930.jar"}, "bin", "1.5");
-
+
createFolder("/P/src/p6930");
-
+
createFile(
"/P/src/p6930/AllConstructors10a.java",
"package p6930;\n" +
@@ -1100,7 +1100,7 @@ public void testBug6930_10() throws Exception {
" }\n" +
" }\n" +
"}");
-
+
createFile(
"/P/src/p6930/AllConstructors10d.java",
"package p6930;\n" +
@@ -1114,11 +1114,11 @@ public void testBug6930_10() throws Exception {
" }\n" +
" }\n" +
"}");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -1142,7 +1142,7 @@ public void testBug6930_10() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"AllConstructors10a[TYPE_REF]{p6930.AllConstructors10a, p6930, Lp6930.AllConstructors10a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" +
"AllConstructors10d[TYPE_REF]{p6930.AllConstructors10d, p6930, Lp6930.AllConstructors10d;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" +
@@ -1159,33 +1159,33 @@ public void testBug6930_10() throws Exception {
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_11() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib6930.jar"}, "bin");
-
+
createFolder("/P/src/p6930");
-
+
createFile(
"/P/src/p6930/AllConstructors11a.java",
"package p6930;\n" +
"public class AllConstructors11a {\n" +
"}");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -1205,7 +1205,7 @@ public void testBug6930_11() throws Exception {
String completeBehind = "new ";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"Test[CONSTRUCTOR_INVOCATION]{(), Ltest.Test;, ()V, Test, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
" Test[TYPE_REF]{Test, test, Ltest.Test;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
@@ -1214,22 +1214,22 @@ public void testBug6930_11() throws Exception {
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_12() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib6930.jar"}, "bin");
-
+
createFolder("/P/src/p6930");
-
+
createFile(
"/P/src/p6930/AllConstructors12a.java",
"package p6930;\n" +
@@ -1237,11 +1237,11 @@ public void testBug6930_12() throws Exception {
" public static class AllConstructors12b {\n" +
" }\n" +
"}");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -1261,7 +1261,7 @@ public void testBug6930_12() throws Exception {
String completeBehind = "new ";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"Test[CONSTRUCTOR_INVOCATION]{(), Ltest.Test;, ()V, Test, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
" Test[TYPE_REF]{Test, test, Ltest.Test;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
@@ -1271,33 +1271,33 @@ public void testBug6930_12() throws Exception {
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_13() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib6930.jar"}, "bin");
-
+
createFolder("/P/src/p6930");
-
+
createFile(
"/P/src/p6930/AllConstructors13a.java",
"package p6930;\n" +
"public class AllConstructors13a {\n" +
"}");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -1317,29 +1317,29 @@ public void testBug6930_13() throws Exception {
String completeBehind = "new AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"AllConstructors13a[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors13a;, ()V, AllConstructors13a, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
" AllConstructors13a[TYPE_REF]{p6930.AllConstructors13a, p6930, Lp6930.AllConstructors13a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}",
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_14() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib6930.jar"}, "bin");
-
+
createFolder("/P/src/p6930");
-
+
createFile(
"/P/src/p6930/AllConstructors14a.java",
"package p6930;\n" +
@@ -1347,11 +1347,11 @@ public void testBug6930_14() throws Exception {
" public static class AllConstructors14b {\n" +
" }\n" +
"}");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -1371,7 +1371,7 @@ public void testBug6930_14() throws Exception {
String completeBehind = "new AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"AllConstructors14a[TYPE_REF]{p6930.AllConstructors14a, p6930, Lp6930.AllConstructors14a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"}\n" +
"AllConstructors14a[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors14a;, ()V, AllConstructors14a, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
@@ -1379,28 +1379,28 @@ public void testBug6930_14() throws Exception {
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_15() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL15_LIB", "/P/lib6930.jar"}, "bin", "1.5");
-
+
createFolder("/P/src/p6930");
-
+
createFile(
"/P/src/p6930/AllConstructors15a.java",
"package p6930;\n" +
"public class AllConstructors15a<T> {\n" +
"}");
-
+
createJar(
new String[] {
"p6930/AllConstructors15b.java",
@@ -1411,11 +1411,11 @@ public void testBug6930_15() throws Exception {
p.getProject().getLocation().append("lib6930.jar").toOSString(),
new String[]{getExternalJCLPathString("1.5")},
"1.5");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[2];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -1425,7 +1425,7 @@ public void testBug6930_15() throws Exception {
" new AllConstructors\n" +
" }\n" +
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/P/src/p6930/AllConstructors15c.java",
"package p6930;"+
@@ -1441,7 +1441,7 @@ public void testBug6930_15() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"AllConstructors15a[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors15a;, ()V, AllConstructors15a, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
" AllConstructors15a[TYPE_REF]{p6930.AllConstructors15a, p6930, Lp6930.AllConstructors15a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
@@ -1452,29 +1452,29 @@ public void testBug6930_15() throws Exception {
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_16() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL15_LIB", "/P/lib6930.jar"}, "bin", "1.5");
-
+
createFolder("/P/src/p6930");
-
+
createFile(
"/P/src/p6930/AllConstructors16a.java",
"package p6930;\n" +
"public class AllConstructors16a{\n" +
" public <T> AllConstructors16a(){}\n" +
"}");
-
+
createJar(
new String[] {
"p6930/AllConstructors16b.java",
@@ -1486,11 +1486,11 @@ public void testBug6930_16() throws Exception {
p.getProject().getLocation().append("lib6930.jar").toOSString(),
new String[]{getExternalJCLPathString("1.5")},
"1.5");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[2];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -1500,7 +1500,7 @@ public void testBug6930_16() throws Exception {
" new AllConstructors\n" +
" }\n" +
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/P/src/p6930/AllConstructors16c.java",
"package p6930;"+
@@ -1517,7 +1517,7 @@ public void testBug6930_16() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"AllConstructors16a[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors16a;, ()V, AllConstructors16a, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
" AllConstructors16a[TYPE_REF]{p6930.AllConstructors16a, p6930, Lp6930.AllConstructors16a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
@@ -1528,29 +1528,29 @@ public void testBug6930_16() throws Exception {
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_17() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL15_LIB", "/P/lib6930.jar"}, "bin", "1.5");
-
+
createFolder("/P/src/p6930");
-
+
createFile(
"/P/src/p6930/AllConstructors17a.java",
"package p6930;\n" +
"public class AllConstructors17a{\n" +
" public AllConstructors17a(java.util.Collection<Object> o){}\n" +
"}");
-
+
createJar(
new String[] {
"p6930/AllConstructors17b.java",
@@ -1562,11 +1562,11 @@ public void testBug6930_17() throws Exception {
p.getProject().getLocation().append("lib6930.jar").toOSString(),
new String[]{getExternalJCLPathString("1.5")},
"1.5");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[2];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -1576,7 +1576,7 @@ public void testBug6930_17() throws Exception {
" new AllConstructors\n" +
" }\n" +
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/P/src/p6930/AllConstructors17c.java",
"package p6930;"+
@@ -1593,7 +1593,7 @@ public void testBug6930_17() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"AllConstructors17a[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors17a;, (Ljava.util.Collection<Ljava.lang.Object;>;)V, AllConstructors17a, (o), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
" AllConstructors17a[TYPE_REF]{p6930.AllConstructors17a, p6930, Lp6930.AllConstructors17a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
@@ -1604,39 +1604,39 @@ public void testBug6930_17() throws Exception {
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_18() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib6930.jar"}, "bin");
-
+
createFolder("/P/src/p6930");
-
+
createFile(
"/P/src/p6930/AllConstructors18a.java",
"package p6930;\n" +
"public interface AllConstructors18a {\n" +
"}");
-
+
createJar(new String[] {
"p6930/AllConstructors18b.java",
"package p6930;\n" +
"public interface AllConstructors18b {\n" +
"}"
}, p.getProject().getLocation().append("lib6930.jar").toOSString());
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[2];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -1646,7 +1646,7 @@ public void testBug6930_18() throws Exception {
" new AllConstructors\n" +
" }\n" +
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/P/src/p6930/AllConstructors18c.java",
"package p6930;"+
@@ -1662,7 +1662,7 @@ public void testBug6930_18() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"AllConstructors18a[ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors18a;, ()V, AllConstructors18a, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
" AllConstructors18a[TYPE_REF]{p6930.AllConstructors18a, p6930, Lp6930.AllConstructors18a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
@@ -1673,39 +1673,39 @@ public void testBug6930_18() throws Exception {
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_19() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib6930.jar"}, "bin");
-
+
createFolder("/P/src/p6930");
-
+
createFile(
"/P/src/p6930/AllConstructors19a.java",
"package p6930;\n" +
"public interface AllConstructors19a {\n" +
"}");
-
+
createJar(new String[] {
"p6930/AllConstructors19b.java",
"package p6930;\n" +
"public interface AllConstructors19b {\n" +
"}"
}, p.getProject().getLocation().append("lib6930.jar").toOSString());
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[2];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -1718,7 +1718,7 @@ public void testBug6930_19() throws Exception {
" new AllConstructors\n" +
" }\n" +
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/P/src/p6930/AllConstructors19c.java",
"package p6930;"+
@@ -1734,7 +1734,7 @@ public void testBug6930_19() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"AllConstructors19a[ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors19a;, ()V, AllConstructors19a, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" +
" AllConstructors19a[TYPE_REF]{AllConstructors19a, p6930, Lp6930.AllConstructors19a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" +
@@ -1745,29 +1745,29 @@ public void testBug6930_19() throws Exception {
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_20() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL15_LIB", "/P/lib6930.jar"}, "bin", "1.5");
-
+
createFolder("/P/src/p6930");
-
+
createFile(
"/P/src/p6930/AllConstructors20a.java",
"package p6930;\n" +
"public enum AllConstructors20a {\n" +
" ZZZ;\n" +
"}");
-
+
createJar(new String[] {
"p6930/AllConstructors20b.java",
"package p6930;\n" +
@@ -1778,11 +1778,11 @@ public void testBug6930_20() throws Exception {
p.getProject().getLocation().append("lib6930.jar").toOSString(),
new String[]{getExternalJCLPathString("1.5")},
"1.5");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[2];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -1792,7 +1792,7 @@ public void testBug6930_20() throws Exception {
" new AllConstructors\n" +
" }\n" +
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/P/src/p6930/AllConstructors20c.java",
"package p6930;"+
@@ -1809,35 +1809,35 @@ public void testBug6930_20() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"",
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_21() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL15_LIB", "/P/lib6930.jar"}, "bin", "1.5");
-
+
createFolder("/P/src/p6930");
-
+
createFile(
"/P/src/p6930/AllConstructors21a.java",
"package p6930;\n" +
"public enum AllConstructors21a {\n" +
" ZZZ;\n" +
"}");
-
+
createJar(
new String[] {
"p6930/AllConstructors21b.java",
@@ -1849,11 +1849,11 @@ public void testBug6930_21() throws Exception {
p.getProject().getLocation().append("lib6930.jar").toOSString(),
new String[]{getExternalJCLPathString("1.5")},
"1.5");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[2];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -1866,7 +1866,7 @@ public void testBug6930_21() throws Exception {
" new AllConstructors\n" +
" }\n" +
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/P/src/p6930/AllConstructors21c.java",
"package p6930;"+
@@ -1883,28 +1883,28 @@ public void testBug6930_21() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"",
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_22() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib6930.jar"}, "bin");
-
+
createFolder("/P/src/p6930");
-
+
createFile(
"/P/src/p6930/AllConstructors22a.java",
"package p6930;\n" +
@@ -1912,7 +1912,7 @@ public void testBug6930_22() throws Exception {
" private AllConstructors22a(){}\n" +
" public static class AllConstructorsInner{}\n" +
"}");
-
+
createJar(new String[] {
"p6930/AllConstructors22b.java",
"package p6930;\n" +
@@ -1921,11 +1921,11 @@ public void testBug6930_22() throws Exception {
" public static class AllConstructorsInner{}\n" +
"}"
}, p.getProject().getLocation().append("lib6930.jar").toOSString());
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[2];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -1935,7 +1935,7 @@ public void testBug6930_22() throws Exception {
" new AllConstructors\n" +
" }\n" +
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/P/src/p6930/AllConstructors22c.java",
"package p6930;"+
@@ -1953,7 +1953,7 @@ public void testBug6930_22() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"AllConstructors22a[TYPE_REF]{p6930.AllConstructors22a, p6930, Lp6930.AllConstructors22a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" +
"AllConstructors22b[TYPE_REF]{p6930.AllConstructors22b, p6930, Lp6930.AllConstructors22b;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" +
@@ -1961,22 +1961,22 @@ public void testBug6930_22() throws Exception {
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_23() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib6930.jar"}, "bin");
-
+
createFolder("/P/src/p6930");
-
+
createFile(
"/P/src/p6930/AllConstructors23a.java",
"package p6930;\n" +
@@ -1984,7 +1984,7 @@ public void testBug6930_23() throws Exception {
" private AllConstructors23a(){}\n" +
" public static class AllConstructorsInner{}\n" +
"}");
-
+
createJar(new String[] {
"p6930/AllConstructors23b.java",
"package p6930;\n" +
@@ -1993,11 +1993,11 @@ public void testBug6930_23() throws Exception {
" public static class AllConstructorsInner{}\n" +
"}"
}, p.getProject().getLocation().append("lib6930.jar").toOSString());
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[2];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -2010,7 +2010,7 @@ public void testBug6930_23() throws Exception {
" new AllConstructors\n" +
" }\n" +
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/P/src/p6930/AllConstructors23c.java",
"package p6930;"+
@@ -2028,7 +2028,7 @@ public void testBug6930_23() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"AllConstructors23a[TYPE_REF]{AllConstructors23a, p6930, Lp6930.AllConstructors23a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" +
"AllConstructors23b[TYPE_REF]{AllConstructors23b, p6930, Lp6930.AllConstructors23b;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" +
@@ -2036,22 +2036,22 @@ public void testBug6930_23() throws Exception {
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_24() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib6930.jar"}, "bin");
-
+
createFolder("/P/src/p6930");
-
+
createFile(
"/P/src/p6930/AllConstructors24a.java",
"package p6930;\n" +
@@ -2059,7 +2059,7 @@ public void testBug6930_24() throws Exception {
" public AllConstructors24a(){}\n" +
" private static class AllConstructorsInner{}\n" +
"}");
-
+
createJar(new String[] {
"p6930/AllConstructors24b.java",
"package p6930;\n" +
@@ -2068,11 +2068,11 @@ public void testBug6930_24() throws Exception {
" private static class AllConstructorsInner{}\n" +
"}"
}, p.getProject().getLocation().append("lib6930.jar").toOSString());
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[2];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -2082,7 +2082,7 @@ public void testBug6930_24() throws Exception {
" new AllConstructors\n" +
" }\n" +
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/P/src/p6930/AllConstructors24c.java",
"package p6930;"+
@@ -2100,7 +2100,7 @@ public void testBug6930_24() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"AllConstructors24a[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors24a;, ()V, AllConstructors24a, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
" AllConstructors24a[TYPE_REF]{p6930.AllConstructors24a, p6930, Lp6930.AllConstructors24a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
@@ -2111,22 +2111,22 @@ public void testBug6930_24() throws Exception {
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_25() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib6930.jar"}, "bin");
-
+
createFolder("/P/src/p6930");
-
+
createFile(
"/P/src/p6930/AllConstructors25a.java",
"package p6930;\n" +
@@ -2134,7 +2134,7 @@ public void testBug6930_25() throws Exception {
" public AllConstructors25a(){}\n" +
" private static class AllConstructorsInner{}\n" +
"}");
-
+
createJar(new String[] {
"p6930/AllConstructors25b.java",
"package p6930;\n" +
@@ -2143,11 +2143,11 @@ public void testBug6930_25() throws Exception {
" private static class AllConstructorsInner{}\n" +
"}"
}, p.getProject().getLocation().append("lib6930.jar").toOSString());
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[2];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -2160,7 +2160,7 @@ public void testBug6930_25() throws Exception {
" new AllConstructors\n" +
" }\n" +
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/P/src/p6930/AllConstructors25c.java",
"package p6930;"+
@@ -2178,7 +2178,7 @@ public void testBug6930_25() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"AllConstructors25a[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors25a;, ()V, AllConstructors25a, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
" AllConstructors25a[TYPE_REF]{AllConstructors25a, p6930, Lp6930.AllConstructors25a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
@@ -2189,24 +2189,24 @@ public void testBug6930_25() throws Exception {
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_26() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[2];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -2216,7 +2216,7 @@ public void testBug6930_26() throws Exception {
" var.new AllConstructors\n" +
" }\n" +
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/P/src/p6930/AllConstructors26a.java",
"package p6930;"+
@@ -2235,31 +2235,31 @@ public void testBug6930_26() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"AllConstructors26b[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors26a$AllConstructors26b;, (I)V, AllConstructors26b, (i), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
" AllConstructors26a.AllConstructors26b[TYPE_REF]{AllConstructors26b, p6930, Lp6930.AllConstructors26a$AllConstructors26b;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}",
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_27() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[2];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -2269,7 +2269,7 @@ public void testBug6930_27() throws Exception {
" new p6930.AllConstructors27a.AllConstructors\n" +
" }\n" +
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/P/src/p6930/AllConstructors27a.java",
"package p6930;"+
@@ -2288,31 +2288,31 @@ public void testBug6930_27() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"AllConstructors27b[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors27a$AllConstructors27b;, (I)V, AllConstructors27b, (i), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
" AllConstructors27a.AllConstructors27b[TYPE_REF]{AllConstructors27b, p6930, Lp6930.AllConstructors27a$AllConstructors27b;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}",
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_28() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[3];
this.workingCopies[0] = getWorkingCopy(
"/P/src/p6930/Test.java",
@@ -2325,14 +2325,14 @@ public void testBug6930_28() throws Exception {
" new p6930.AllConstructors\n" +
" }\n" +
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/P/src/p6930/AllConstructors28b.java",
"package p6930;"+
"public class AllConstructors28b {\n" +
" public AllConstructors28b(int i) {}\n" +
"}");
-
+
this.workingCopies[2] = getWorkingCopy(
"/P/src/p6930b/AllConstructors28c.java",
"package p6930b;"+
@@ -2349,7 +2349,7 @@ public void testBug6930_28() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"AllConstructors28a[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors28a;, (I)V, AllConstructors28a, (i), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
" AllConstructors28a[TYPE_REF]{AllConstructors28a, p6930, Lp6930.AllConstructors28a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
@@ -2358,20 +2358,20 @@ public void testBug6930_28() throws Exception {
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_29() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib6930.jar"}, "bin");
-
+
createJar(new String[] {
"p6930/AllConstructors29.java",
"package p6930;\n" +
@@ -2381,11 +2381,11 @@ public void testBug6930_29() throws Exception {
" public AllConstructors29(Object o, String s) {}\n" +
"}"
}, p.getProject().getLocation().append("lib6930.jar").toOSString());
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -2405,7 +2405,7 @@ public void testBug6930_29() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"AllConstructors29[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors29;, ()V, AllConstructors29, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
" AllConstructors29[TYPE_REF]{p6930.AllConstructors29, p6930, Lp6930.AllConstructors29;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
@@ -2416,24 +2416,24 @@ public void testBug6930_29() throws Exception {
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_30() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/AllConstructors30.java",
@@ -2457,7 +2457,7 @@ public void testBug6930_30() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"AllConstructors30[TYPE_REF]{AllConstructors30, test, Ltest.AllConstructors30;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" +
"AllConstructors30[CONSTRUCTOR_INVOCATION]{(), Ltest.AllConstructors30;, ()V, AllConstructors30, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
@@ -2467,24 +2467,24 @@ public void testBug6930_30() throws Exception {
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_31() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/AllConstructors31.java",
@@ -2509,7 +2509,7 @@ public void testBug6930_31() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"AllConstructors31[TYPE_REF]{AllConstructors31, test, Ltest.AllConstructors31;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" +
"AllConstructors31[CONSTRUCTOR_INVOCATION]{(), Ltest.AllConstructors31;, ()V, AllConstructors31, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
@@ -2519,24 +2519,24 @@ public void testBug6930_31() throws Exception {
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_32() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -2562,7 +2562,7 @@ public void testBug6930_32() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"Test.AllConstructors32[TYPE_REF]{AllConstructors32, test, Ltest.Test$AllConstructors32;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" +
"AllConstructors32[CONSTRUCTOR_INVOCATION]{(), Ltest.Test$AllConstructors32;, ()V, AllConstructors32, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
@@ -2572,24 +2572,24 @@ public void testBug6930_32() throws Exception {
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_33() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin");
-
+
createFolder("/P/src/p6930");
createFolder("/P/src/p6930_1");
createFolder("/P/src/p6930_2");
-
+
createFile(
"/P/src/p6930/AllConstructors33.java",
"package p6930;\n" +
@@ -2598,23 +2598,23 @@ public void testBug6930_33() throws Exception {
" public AllConstructors33(ParamType p11, ParamType p12) {}\n" +
" public AllConstructors33(p6930_1.ParamType p21, ParamType p22) {}\n" +
"}");
-
+
createFile(
"/P/src/p6930_1/ParamType.java",
"package p6930_1;\n" +
"public class ParamType {\n" +
"}");
-
+
createFile(
"/P/src/p6930_2/ParamType.java",
"package p6930_2;\n" +
"public class ParamType {\n" +
"}");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -2634,7 +2634,7 @@ public void testBug6930_33() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"AllConstructors33[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors33;, (Lp6930_1.ParamType;Lp6930_2.ParamType;)V, AllConstructors33, (p21, p22), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
" AllConstructors33[TYPE_REF]{p6930.AllConstructors33, p6930, Lp6930.AllConstructors33;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
@@ -2643,23 +2643,23 @@ public void testBug6930_33() throws Exception {
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_34() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin");
-
+
Map compileOptions = new HashMap();
compileOptions.put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.DO_NOT_GENERATE);
-
+
String[] pathsAndContents =
new String[] {
"p6930/AllConstructors34.java",
@@ -2672,13 +2672,13 @@ public void testBug6930_34() throws Exception {
pathsAndContents,
p.getProject().getLocation().append("lib6930.jar").toOSString(),
compileOptions);
-
+
addLibraryEntry(p, "/P/lib6930.jar", null);
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -2698,30 +2698,30 @@ public void testBug6930_34() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"AllConstructors34[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors34;, (Ljava.lang.Object;)V, AllConstructors34, (arg0), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
" AllConstructors34[TYPE_REF]{p6930.AllConstructors34, p6930, Lp6930.AllConstructors34;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}",
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
public void testBug6930_35() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin");
-
+
Map compileOptions = new HashMap();
compileOptions.put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.DO_NOT_GENERATE);
-
+
String[] pathsAndContents =
new String[] {
"p6930/AllConstructors35.java",
@@ -2734,17 +2734,17 @@ public void testBug6930_35() throws Exception {
pathsAndContents,
p.getProject().getLocation().append("lib6930.jar").toOSString(),
compileOptions);
-
+
createSourceZip(
pathsAndContents,
p.getProject().getLocation().append("lib6930src.zip").toOSString());
-
+
addLibraryEntry(p, "/P/lib6930.jar", "/P/lib6930src.zip");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -2764,14 +2764,14 @@ public void testBug6930_35() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"AllConstructors35[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors35;, (Ljava.lang.Object;)V, AllConstructors35, (o), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
" AllConstructors35[TYPE_REF]{p6930.AllConstructors35, p6930, Lp6930.AllConstructors35;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}",
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
@@ -4615,16 +4615,16 @@ public void testBug96950() throws Exception {
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=276890
public void testBug276890_01() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL15_LIB"}, "bin", "1.5");
-
+
createFolder("/P/src/p276890");
-
+
createFile(
"/P/src/p276890/Stuff.java",
"package p276890;\n" +
@@ -4634,11 +4634,11 @@ public void testBug276890_01() throws Exception {
" public Stuff(Stuff<E> ees) {}\n"+
" public Stuff() {}\n"+
"}");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -4658,7 +4658,7 @@ public void testBug276890_01() throws Exception {
String completeBehind = "Stuf";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"Stuff[CONSTRUCTOR_INVOCATION]{(), Lp276890.Stuff;, ()V, Stuff, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
" Stuff[TYPE_REF]{p276890.Stuff, p276890, Lp276890.Stuff;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
@@ -4671,27 +4671,27 @@ public void testBug276890_01() throws Exception {
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=276890
public void testBug276890_02() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL15_LIB"}, "bin", "1.5");
-
+
createFolder("/P/src/p276890");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[2];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -4701,7 +4701,7 @@ public void testBug276890_02() throws Exception {
" new Stuf\n" +
" }\n" +
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/P/src/p276890/Stuff.java",
"package p276890;\n" +
@@ -4721,7 +4721,7 @@ public void testBug276890_02() throws Exception {
String completeBehind = "Stuf";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"Stuff[CONSTRUCTOR_INVOCATION]{(), Lp276890.Stuff;, ()V, Stuff, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
" Stuff[TYPE_REF]{p276890.Stuff, p276890, Lp276890.Stuff;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
@@ -4734,23 +4734,23 @@ public void testBug276890_02() throws Exception {
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=276890
public void testBug276890_03() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL15_LIB", "/P/lib276890.jar"}, "bin", "1.5");
-
+
createFolder("/P/src/p276890");
-
+
createJar(
new String[] {
"p276890/Stuff.java",
@@ -4765,11 +4765,11 @@ public void testBug276890_03() throws Exception {
p.getProject().getLocation().append("lib276890.jar").toOSString(),
new String[]{getExternalJCLPathString("1.5")},
"1.5");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -4789,7 +4789,7 @@ public void testBug276890_03() throws Exception {
String completeBehind = "Stuf";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"Stuff[CONSTRUCTOR_INVOCATION]{(), Lp276890.Stuff;, ()V, Stuff, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
" Stuff[TYPE_REF]{p276890.Stuff, p276890, Lp276890.Stuff;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
@@ -4802,7 +4802,7 @@ public void testBug276890_03() throws Exception {
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
@@ -4894,15 +4894,15 @@ public void testChangeInternalJar() throws CoreException, IOException {
public void testBug237469a() throws Exception {
String externalJar1 = Util.getOutputDirectory() + File.separator + "bug237469a.jar"; //$NON-NLS-1$
String externalJar2 = Util.getOutputDirectory() + File.separator + "bug237469b.jar"; //$NON-NLS-1$
-
+
try {
// create variable
// JavaCore.setClasspathVariables(
// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
// null);
-
-
+
+
// create external jar 1
Util.createJar(
new String[] {
@@ -4913,7 +4913,7 @@ public void testBug237469a() throws Exception {
},
new HashMap(),
externalJar1);
-
+
// create external jar 2
Util.createJar(
new String[] {
@@ -4990,15 +4990,15 @@ public void testBug237469a() throws Exception {
public void testBug237469b() throws Exception {
String externalJar1 = Util.getOutputDirectory() + File.separator + "bug237469a.jar"; //$NON-NLS-1$
String externalJar2 = Util.getOutputDirectory() + File.separator + "bug237469b.jar"; //$NON-NLS-1$
-
+
try {
// create variable
// JavaCore.setClasspathVariables(
// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
// null);
-
-
+
+
// create external jar 1
Util.createJar(
new String[] {
@@ -5009,7 +5009,7 @@ public void testBug237469b() throws Exception {
},
new HashMap(),
externalJar1);
-
+
// create external jar 2
Util.createJar(
new String[] {
@@ -5070,17 +5070,17 @@ public void testBug237469b() throws Exception {
requestor.setComputeEnclosingElement(false);
requestor.setComputeVisibleElements(true);
requestor.setAssignableType("Ltest/X;");
-
+
ICompilationUnit cu= getCompilationUnit("PS2", "src", "test", "X.java");
String str = cu.getSource();
String completeBehind = "equals";
-
+
int tokenStart = str.lastIndexOf(completeBehind);
int tokenEnd = tokenStart + completeBehind.length() - 1;
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
cu.codeComplete(cursorLocation, requestor);
-
+
assertResults(
"completion offset="+(cursorLocation)+"\n" +
"completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
@@ -5103,14 +5103,14 @@ public void testBug237469b() throws Exception {
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=270113
public void testBug270113_01() throws Exception {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib270113.jar"}, "bin");
-
+
createJar(new String[] {
"p270113/AllConstructors01.java",
"package p270113;\n" +
@@ -5118,11 +5118,11 @@ public void testBug270113_01() throws Exception {
" protected AllConstructors01(int i) {}\n" +
"}"
}, p.getProject().getLocation().append("lib270113.jar").toOSString());
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -5142,14 +5142,14 @@ public void testBug270113_01() throws Exception {
String completeBehind = "AllConstructors";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"AllConstructors01[ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION]{(), Lp270113.AllConstructors01;, (I)V, AllConstructors01, (i), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
" AllConstructors01[TYPE_REF]{p270113.AllConstructors01, p270113, Lp270113.AllConstructors01;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}",
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
@@ -5184,14 +5184,14 @@ public void testBug281598() throws Exception {
long time = System.currentTimeMillis() - this.start;
return time > 1000; // cancel after 1 sec
}
-
+
};
String str = this.workingCopies[0].getSource();
String completeBehind = "sys";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
// no results expected, just verify that no cancel operation exception occurs...
assertResults("", requestor.getResults());
} finally {
@@ -5227,14 +5227,14 @@ public void testBug281598b() throws Exception {
long time = System.currentTimeMillis() - this.start;
return time > 1000; // cancel after 1 sec
}
-
+
};
String str = this.workingCopies[0].getSource();
String completeBehind = "String";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"String[CONSTRUCTOR_INVOCATION]{(), Ljava.lang.String;, ()V, String, null, "+(R_DEFAULT+R_RESOLVED+R_INTERESTING+R_CASE+R_EXACT_NAME+R_UNQUALIFIED+R_NON_RESTRICTED)+"}\n" +
" String[TYPE_REF]{java.lang.String, java.lang, Ljava.lang.String;, null, null, "+(R_DEFAULT+R_RESOLVED+R_INTERESTING+R_CASE+R_EXACT_NAME+R_UNQUALIFIED+R_NON_RESTRICTED)+"}",
@@ -5249,7 +5249,7 @@ public void testBug281598c() throws Exception {
// Create project
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin", "1.4");
waitUntilIndexesReady();
-
+
// Disable indexing
indexManager.disable();
@@ -5275,14 +5275,14 @@ public void testBug281598c() throws Exception {
long time = System.currentTimeMillis() - this.start;
return time > 1000; // cancel after 1 sec
}
-
+
};
String completeBehind = "Strin";
int cursorLocation = source.lastIndexOf(completeBehind) + completeBehind.length();
IType type = p.findType("test.Test");
type.getTypeRoot().codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"String[TYPE_REF]{String, java.lang, Ljava.lang.String;, null, null, "+(R_DEFAULT+R_RESOLVED+R_INTERESTING+R_CASE+R_UNQUALIFIED+R_NON_RESTRICTED)+"}",
requestor.getResults());
@@ -5317,11 +5317,11 @@ public void testBug151500a() throws Exception {
p.getProject().getLocation().append("lib151500.jar").toOSString(),
new String[]{getExternalJCLPathString("1.3")},
"1.3");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -5342,7 +5342,7 @@ public void testBug151500a() throws Exception {
String completeBehind = "f.bar.s";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"someMethod[METHOD_REF]{someMethod(), Lfoo.Foo$Bar;, (Ljava.lang.String;)V, someMethod, (paramName), " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_NON_STATIC)+ "}",
requestor.getResults());
@@ -5352,7 +5352,7 @@ public void testBug151500a() throws Exception {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=151500
-public void testBug151500b() throws Exception {
+public void testBug151500b() throws Exception {
try {
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL15_LIB", "/P/lib151500.jar"}, "bin", "1.4");
createJar(
@@ -5376,11 +5376,11 @@ public void testBug151500b() throws Exception {
p.getProject().getLocation().append("lib151500.jar").toOSString(),
new String[]{getExternalJCLPathString("1.3")},
"1.3");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -5400,7 +5400,7 @@ public void testBug151500b() throws Exception {
String completeBehind = "new foo.Foo(1).new B";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"Bar[CONSTRUCTOR_INVOCATION]{(), Lfoo.Foo$Bar;, (II)V, Bar, (a, b), " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED + R_CONSTRUCTOR) + "}\n" +
" Foo.Bar[TYPE_REF]{Bar, foo, Lfoo.Foo$Bar;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED + R_CONSTRUCTOR) + "}",
@@ -5411,7 +5411,7 @@ public void testBug151500b() throws Exception {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=151500
-public void testBug151500c() throws Exception {
+public void testBug151500c() throws Exception {
try {
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL15_LIB", "/P/lib151500.jar"}, "bin", "1.4");
createJar(
@@ -5435,11 +5435,11 @@ public void testBug151500c() throws Exception {
p.getProject().getLocation().append("lib151500.jar").toOSString(),
new String[]{getExternalJCLPathString("1.3")},
"1.3");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/P/src/test/Test.java",
@@ -5459,7 +5459,7 @@ public void testBug151500c() throws Exception {
String completeBehind = "new foo.Foo.B";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"Bar[CONSTRUCTOR_INVOCATION]{(), Lfoo.Foo$Bar;, (II)V, Bar, (a, b), " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR) + "}\n" +
" Foo.Bar[TYPE_REF]{Bar, foo, Lfoo.Foo$Bar;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR) + "}",
@@ -5476,7 +5476,7 @@ public void testBug317264a() throws CoreException {
{
project = createJavaProject("P2", new String[] {""}, new String[] {"JCL15_LIB"}, "", "1.5");
addClasspathEntry(project, JavaCore.newLibraryEntry(new Path("/Completion/b317264/org.apache.commons.lang_2.modified.jar"), null, null));
-
+
createFile(
"/P2/X.java",
"import org.apache.commons.lang.*;\n"+
@@ -5486,7 +5486,7 @@ public void testBug317264a() throws CoreException {
" }\n"+
"}");
waitUntilIndexesReady();
-
+
ICompilationUnit cu= getCompilationUnit("P2", "", "", "X.java");
String str = cu.getSource();
@@ -5497,7 +5497,7 @@ public void testBug317264a() throws CoreException {
assertResults(
"Enum[TYPE_REF]{Enum, java.lang, Ljava.lang.Enum;, null, null, " + (R_DEFAULT + 12) + "}",
requestor.getResults());
-
+
} finally {
deleteProject(project);
}
@@ -5509,7 +5509,7 @@ public void testBug317264b() throws CoreException {
{
project = createJavaProject("P2", new String[] {""}, new String[] {"JCL_LIB"}, "", "1.4");
addClasspathEntry(project, JavaCore.newLibraryEntry(new Path("/Completion/b317264/org.apache.commons.lang_2.modified.jar"), null, null));
-
+
createFile(
"/P2/X.java",
"import org.apache.commons.lang.*;\n"+
@@ -5519,7 +5519,7 @@ public void testBug317264b() throws CoreException {
" }\n"+
"}");
waitUntilIndexesReady();
-
+
ICompilationUnit cu= getCompilationUnit("P2", "", "", "X.java");
String str = cu.getSource();
@@ -5530,7 +5530,7 @@ public void testBug317264b() throws CoreException {
assertResults(
"Enum[TYPE_REF]{org.apache.commons.lang.enum.Enum, org.apache.commons.lang.enum, Lorg.apache.commons.lang.enum.Enum;, null, null, " + (R_DEFAULT + 9) + "}",
requestor.getResults());
-
+
} finally {
deleteProject(project);
}
@@ -5542,16 +5542,16 @@ public void testBug317264c() throws CoreException {
{
project = createJavaProject("P2", new String[] {""}, new String[] {"JCL15_LIB"}, "", "1.5");
addClasspathEntry(project, JavaCore.newLibraryEntry(new Path("/Completion/b317264/org.apache.commons.lang_2.modified.jar"), null, null));
-
+
createFile(
"/P2/X.java",
"import org.apache.commons.lang.enu;\n"+
"public class X {\n"+
- " public void foo() {\n"+
+ " public void foo() {\n"+
" }\n"+
"}");
waitUntilIndexesReady();
-
+
ICompilationUnit cu= getCompilationUnit("P2", "", "", "X.java");
String str = cu.getSource();
@@ -5560,7 +5560,7 @@ public void testBug317264c() throws CoreException {
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
cu.codeComplete(cursorLocation, requestor);
assertResults("", requestor.getResults());
-
+
} finally {
deleteProject(project);
}
@@ -5572,16 +5572,16 @@ public void testBug317264d() throws CoreException {
{
project = createJavaProject("P2", new String[] {""}, new String[] {"JCL_LIB"}, "", "1.4");
addClasspathEntry(project, JavaCore.newLibraryEntry(new Path("/Completion/b317264/org.apache.commons.lang_2.modified.jar"), null, null));
-
+
createFile(
"/P2/X.java",
"import org.apache.commons.lang.enu;\n"+
"public class X {\n"+
- " public void foo() {\n"+
+ " public void foo() {\n"+
" }\n"+
"}");
waitUntilIndexesReady();
-
+
ICompilationUnit cu= getCompilationUnit("P2", "", "", "X.java");
String str = cu.getSource();
@@ -5592,7 +5592,7 @@ public void testBug317264d() throws CoreException {
assertResults(
"org.apache.commons.lang.enum[PACKAGE_REF]{org.apache.commons.lang.enum.*;, org.apache.commons.lang.enum, null, null, null, " + (R_DEFAULT + 19) + "}",
requestor.getResults());
-
+
} finally {
deleteProject(project);
}
@@ -5649,7 +5649,7 @@ public void testBug340945() throws JavaModelException {
"public final void notifyAll() throws java.lang.IllegalMonitorStateException\n" +
"public final void notify() throws java.lang.IllegalMonitorStateException\n" +
"public int hashCode() \n" +
- "public final java.lang.Class getClass() \n" +
+ "public final java.lang.Class getClass() \n" +
"protected void finalize() throws java.lang.Throwable\n" +
"public boolean equals(java.lang.Object) \n" +
"protected java.lang.Object clone() throws java.lang.CloneNotSupportedException\n" +
@@ -5698,7 +5698,7 @@ public void testBug340945a() throws JavaModelException {
"public final void notifyAll() throws java.lang.IllegalMonitorStateException\n" +
"public final void notify() throws java.lang.IllegalMonitorStateException\n" +
"public int hashCode() \n" +
- "public final java.lang.Class getClass() \n" +
+ "public final java.lang.Class getClass() \n" +
"protected void finalize() throws java.lang.Throwable\n" +
"public boolean equals(java.lang.Object) \n" +
"protected java.lang.Object clone() throws java.lang.CloneNotSupportedException\n",
@@ -5750,10 +5750,10 @@ public void testBug340945b() throws JavaModelException {
"public final void notifyAll() throws java.lang.IllegalMonitorStateException\n" +
"public final void notify() throws java.lang.IllegalMonitorStateException\n" +
"public int hashCode() \n" +
- "public final java.lang.Class getClass() \n" +
+ "public final java.lang.Class getClass() \n" +
"protected void finalize() throws java.lang.Throwable\n" +
"public boolean equals(java.lang.Object) \n" +
- "protected java.lang.Object clone() throws java.lang.CloneNotSupportedException\n",
+ "protected java.lang.Object clone() throws java.lang.CloneNotSupportedException\n",
requestor.getVisibleMethods());
}
@@ -5804,10 +5804,10 @@ public void testBug340945c() throws JavaModelException {
"public final void notifyAll() throws java.lang.IllegalMonitorStateException\n" +
"public final void notify() throws java.lang.IllegalMonitorStateException\n" +
"public int hashCode() \n" +
- "public final java.lang.Class getClass() \n" +
+ "public final java.lang.Class getClass() \n" +
"protected void finalize() throws java.lang.Throwable\n" +
"public boolean equals(java.lang.Object) \n" +
- "protected java.lang.Object clone() throws java.lang.CloneNotSupportedException\n",
+ "protected java.lang.Object clone() throws java.lang.CloneNotSupportedException\n",
requestor.getVisibleMethods());
}
@@ -5850,7 +5850,7 @@ public void testBug340945d() throws JavaModelException {
"",
requestor.getVisibleFields());
assertResults(
- "static void foo() \n",
+ "static void foo() \n",
requestor.getVisibleMethods());
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=326610
@@ -5890,7 +5890,7 @@ public void testBug326610() throws Exception {
"element:NonNullByDefault completion:org.eclipse.jdt.annotation.NonNullByDefault relevance:"+ (R_DEFAULT + R_INTERESTING + R_CASE + R_QUALIFIED + R_EXACT_NAME + R_NON_RESTRICTED + R_ANNOTATION),
requestor.getResults());
-
+
} finally {
this.deleteProject("P1");
}
@@ -5903,9 +5903,9 @@ public void testBug373409() throws Exception {
// Create project and jar
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin");
refresh(p);
-
+
createFolder("/P/src/java/llang");
-
+
createFile(
"/P/src/java/llang/Thread.java",
"package java.llang;\n"+
@@ -5917,14 +5917,14 @@ public void testBug373409() throws Exception {
" public Thread(String s, int i) {\n" +
" }\n" +
"}");
-
+
createFile(
"/P/src/java/llang/ThreadLocal.java",
"package java.llang;\n"+
"public class ThreadLocal {\n" +
" static class ThreadLocalMap {}\n" + // non private static member class necessary for ThreadLocal to be proposed as a type
"}");
-
+
createFile(
"/P/src/java/llang/ThreadGroup.java",
"package java.llang;\n"+
@@ -5934,9 +5934,9 @@ public void testBug373409() throws Exception {
" public ThreadGroup(String s) {\n" +
" }\n" +
"}");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
// Create working copy
@@ -5950,8 +5950,8 @@ public void testBug373409() throws Exception {
" new Threa\n" +
" }\n" +
"}");
-
-
+
+
// do completion
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true);
@@ -5962,7 +5962,7 @@ public void testBug373409() throws Exception {
String completeBehind = "Threa";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"ThreadLocal[TYPE_REF]{java.llang.ThreadLocal, java.llang, Ljava.llang.ThreadLocal;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
"Thread[CONSTRUCTOR_INVOCATION]{(), Ljava.llang.Thread;, ()V, Thread, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_CONSTRUCTOR) + "}\n" +
@@ -6076,7 +6076,7 @@ public void testBug392581() throws CoreException {
String completeBehind = "super.";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"clone[METHOD_REF]{clone(), Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, "+ (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED) + "}\n"
+ "equals[METHOD_REF]{equals(), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), "+ (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED) + "}\n"
@@ -6347,7 +6347,7 @@ public void testBug418011() throws CoreException {
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
requestor.getContext();
-
+
} finally {
deleteProject("P");
}
@@ -6356,18 +6356,18 @@ public void testBug418011() throws CoreException {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=376977
public void testBug376977() throws CoreException {
Hashtable oldOptions = JavaCore.getOptions();
-
+
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin");
-
+
refresh(p);
-
+
waitUntilIndexesReady();
-
+
this.workingCopies = new ICompilationUnit[3];
this.workingCopies[0] = getWorkingCopy(
"/P/src/myannotations/Nested.java",
@@ -6400,13 +6400,13 @@ public void testBug376977() throws CoreException {
String completeBehind = "nest= {@Nes";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[2].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
-
+
assertResults(
"Nested[TYPE_REF]{Nested, myannotations, Lmyannotations.Nested;, null, null, " + (R_DEFAULT + 42) + "}",
requestor.getResults());
} finally {
deleteProject("P");
-
+
JavaCore.setOptions(oldOptions);
}
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests3.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests3.java
index bdae7244d..a6130f06d 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests3.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests3.java
@@ -50,7 +50,7 @@ public void testBug338398a() throws CoreException {
" assertno\n" +
" }" +
"}\n");
-
+
this.workingCopies[1] = getWorkingCopy(
"/P/src/b/B.java",
"package b;\n"+
@@ -85,7 +85,7 @@ public void _testBug338398b() throws CoreException {
" * A_CLASS#a_cl" +
" */\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.workingCopies[0].getSource();
String completeBehind = "A_CLASS#a_cl";
@@ -111,7 +111,7 @@ public void _testBug338398c() throws CoreException {
" */\n" +
" public A_CLASS(String MY_STring) {}\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.workingCopies[0].getSource();
String completeBehind = "@param my_s";
@@ -140,7 +140,7 @@ public void testBug504095() throws CoreException {
" }\n" +
" }\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.workingCopies[0].getSource();
String completeBehind = "memb";
@@ -176,7 +176,7 @@ public void testBug425035a() throws CoreException {
"@Annotation()\n" +
"public class Test {\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
requestor.setAllowsRequiredProposals(CompletionProposal.FIELD_REF, CompletionProposal.TYPE_IMPORT, true);
String str = this.workingCopies[2].getSource();
@@ -184,10 +184,10 @@ public void testBug425035a() throws CoreException {
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[2].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults(
- "Test[TYPE_REF]{Test, b, Lb.Test;, null, null, 52}\n" +
- "value[ANNOTATION_ATTRIBUTE_REF]{value = , La.Annotation;, [La.Values;, value, null, 52}\n" +
- "Values[TYPE_REF]{a.Values, a, La.Values;, null, null, 99}\n" +
- "OTHER_VALUE[FIELD_REF]{Values.OTHER_VALUE, La.Values;, La.Values;, OTHER_VALUE, null, 104}\n" +
+ "Test[TYPE_REF]{Test, b, Lb.Test;, null, null, 52}\n" +
+ "value[ANNOTATION_ATTRIBUTE_REF]{value = , La.Annotation;, [La.Values;, value, null, 52}\n" +
+ "Values[TYPE_REF]{a.Values, a, La.Values;, null, null, 99}\n" +
+ "OTHER_VALUE[FIELD_REF]{Values.OTHER_VALUE, La.Values;, La.Values;, OTHER_VALUE, null, 104}\n" +
"SOME_VALUE[FIELD_REF]{Values.SOME_VALUE, La.Values;, La.Values;, SOME_VALUE, null, 104}",
requestor.getResults());
} finally {
@@ -217,7 +217,7 @@ public void testBug425035b() throws CoreException {
"@Annotation({})\n" +
"public class Test {\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
requestor.setAllowsRequiredProposals(CompletionProposal.FIELD_REF, CompletionProposal.TYPE_IMPORT, true);
String str = this.workingCopies[2].getSource();
@@ -225,9 +225,9 @@ public void testBug425035b() throws CoreException {
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[2].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults(
- "Test[TYPE_REF]{Test, b, Lb.Test;, null, null, 52}\n" +
- "Values[TYPE_REF]{a.Values, a, La.Values;, null, null, 99}\n" +
- "OTHER_VALUE[FIELD_REF]{Values.OTHER_VALUE, La.Values;, La.Values;, OTHER_VALUE, null, 104}\n" +
+ "Test[TYPE_REF]{Test, b, Lb.Test;, null, null, 52}\n" +
+ "Values[TYPE_REF]{a.Values, a, La.Values;, null, null, 99}\n" +
+ "OTHER_VALUE[FIELD_REF]{Values.OTHER_VALUE, La.Values;, La.Values;, OTHER_VALUE, null, 104}\n" +
"SOME_VALUE[FIELD_REF]{Values.SOME_VALUE, La.Values;, La.Values;, SOME_VALUE, null, 104}",
requestor.getResults());
} finally {
@@ -258,7 +258,7 @@ public void testBug425035c() throws CoreException {
"@Annotation({Values.SOME_VALUE, })\n" +
"public class Test {\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
requestor.setAllowsRequiredProposals(CompletionProposal.FIELD_REF, CompletionProposal.TYPE_IMPORT, true);
String str = this.workingCopies[2].getSource();
@@ -266,9 +266,9 @@ public void testBug425035c() throws CoreException {
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[2].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults(
- "Test[TYPE_REF]{Test, b, Lb.Test;, null, null, 52}\n" +
- "Values[TYPE_REF]{Values, a, La.Values;, null, null, 102}\n" +
- "OTHER_VALUE[FIELD_REF]{Values.OTHER_VALUE, La.Values;, La.Values;, OTHER_VALUE, null, 104}\n" +
+ "Test[TYPE_REF]{Test, b, Lb.Test;, null, null, 52}\n" +
+ "Values[TYPE_REF]{Values, a, La.Values;, null, null, 102}\n" +
+ "OTHER_VALUE[FIELD_REF]{Values.OTHER_VALUE, La.Values;, La.Values;, OTHER_VALUE, null, 104}\n" +
"SOME_VALUE[FIELD_REF]{Values.SOME_VALUE, La.Values;, La.Values;, SOME_VALUE, null, 104}",
requestor.getResults());
} finally {
@@ -298,7 +298,7 @@ public void testBug425035d() throws CoreException {
"@Annotation(x=)\n" +
"public class Test {\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
requestor.setAllowsRequiredProposals(CompletionProposal.FIELD_REF, CompletionProposal.TYPE_IMPORT, true);
String str = this.workingCopies[2].getSource();
@@ -306,9 +306,9 @@ public void testBug425035d() throws CoreException {
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[2].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults(
- "Test[TYPE_REF]{Test, b, Lb.Test;, null, null, 52}\n" +
- "Values[TYPE_REF]{a.Values, a, La.Values;, null, null, 99}\n" +
- "OTHER_VALUE[FIELD_REF]{Values.OTHER_VALUE, La.Values;, La.Values;, OTHER_VALUE, null, 104}\n" +
+ "Test[TYPE_REF]{Test, b, Lb.Test;, null, null, 52}\n" +
+ "Values[TYPE_REF]{a.Values, a, La.Values;, null, null, 99}\n" +
+ "OTHER_VALUE[FIELD_REF]{Values.OTHER_VALUE, La.Values;, La.Values;, OTHER_VALUE, null, 104}\n" +
"SOME_VALUE[FIELD_REF]{Values.SOME_VALUE, La.Values;, La.Values;, SOME_VALUE, null, 104}",
requestor.getResults());
} finally {
@@ -338,7 +338,7 @@ public void testBug425035e() throws CoreException {
"@Annotation(x={})\n" +
"public class Test {\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
requestor.setAllowsRequiredProposals(CompletionProposal.FIELD_REF, CompletionProposal.TYPE_IMPORT, true);
String str = this.workingCopies[2].getSource();
@@ -346,9 +346,9 @@ public void testBug425035e() throws CoreException {
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[2].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults(
- "Test[TYPE_REF]{Test, b, Lb.Test;, null, null, 52}\n" +
- "Values[TYPE_REF]{a.Values, a, La.Values;, null, null, 99}\n" +
- "OTHER_VALUE[FIELD_REF]{Values.OTHER_VALUE, La.Values;, La.Values;, OTHER_VALUE, null, 104}\n" +
+ "Test[TYPE_REF]{Test, b, Lb.Test;, null, null, 52}\n" +
+ "Values[TYPE_REF]{a.Values, a, La.Values;, null, null, 99}\n" +
+ "OTHER_VALUE[FIELD_REF]{Values.OTHER_VALUE, La.Values;, La.Values;, OTHER_VALUE, null, 104}\n" +
"SOME_VALUE[FIELD_REF]{Values.SOME_VALUE, La.Values;, La.Values;, SOME_VALUE, null, 104}",
requestor.getResults());
} finally {
@@ -379,7 +379,7 @@ public void testBug425035f() throws CoreException {
"@Annotation(x={Values.SOME_VALUE, })\n" +
"public class Test {\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
requestor.setAllowsRequiredProposals(CompletionProposal.FIELD_REF, CompletionProposal.TYPE_IMPORT, true);
String str = this.workingCopies[2].getSource();
@@ -387,9 +387,9 @@ public void testBug425035f() throws CoreException {
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[2].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults(
- "Test[TYPE_REF]{Test, b, Lb.Test;, null, null, 52}\n" +
- "Values[TYPE_REF]{Values, a, La.Values;, null, null, 102}\n" +
- "OTHER_VALUE[FIELD_REF]{Values.OTHER_VALUE, La.Values;, La.Values;, OTHER_VALUE, null, 104}\n" +
+ "Test[TYPE_REF]{Test, b, Lb.Test;, null, null, 52}\n" +
+ "Values[TYPE_REF]{Values, a, La.Values;, null, null, 102}\n" +
+ "OTHER_VALUE[FIELD_REF]{Values.OTHER_VALUE, La.Values;, La.Values;, OTHER_VALUE, null, 104}\n" +
"SOME_VALUE[FIELD_REF]{Values.SOME_VALUE, La.Values;, La.Values;, SOME_VALUE, null, 104}",
requestor.getResults());
} finally {
@@ -421,7 +421,7 @@ public void testBug425035_method_a() throws CoreException {
" @Annotation()\n" +
" void f() {}\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
requestor.setAllowsRequiredProposals(CompletionProposal.FIELD_REF, CompletionProposal.TYPE_IMPORT, true);
String str = this.workingCopies[2].getSource();
@@ -429,11 +429,11 @@ public void testBug425035_method_a() throws CoreException {
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[2].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults(
- "Test[TYPE_REF]{Test, b, Lb.Test;, null, null, 52}\n" +
+ "Test[TYPE_REF]{Test, b, Lb.Test;, null, null, 52}\n" +
"i[FIELD_REF]{i, Lb.Test;, I, i, null, 52}\n" +
- "value[ANNOTATION_ATTRIBUTE_REF]{value = , La.Annotation;, [La.Values;, value, null, 52}\n" +
- "Values[TYPE_REF]{a.Values, a, La.Values;, null, null, 99}\n" +
- "OTHER_VALUE[FIELD_REF]{Values.OTHER_VALUE, La.Values;, La.Values;, OTHER_VALUE, null, 104}\n" +
+ "value[ANNOTATION_ATTRIBUTE_REF]{value = , La.Annotation;, [La.Values;, value, null, 52}\n" +
+ "Values[TYPE_REF]{a.Values, a, La.Values;, null, null, 99}\n" +
+ "OTHER_VALUE[FIELD_REF]{Values.OTHER_VALUE, La.Values;, La.Values;, OTHER_VALUE, null, 104}\n" +
"SOME_VALUE[FIELD_REF]{Values.SOME_VALUE, La.Values;, La.Values;, SOME_VALUE, null, 104}",
requestor.getResults());
} finally {
@@ -465,7 +465,7 @@ public void testBug425035_method_b() throws CoreException {
" @Annotation({})\n" +
" void f() {}\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
requestor.setAllowsRequiredProposals(CompletionProposal.FIELD_REF, CompletionProposal.TYPE_IMPORT, true);
String str = this.workingCopies[2].getSource();
@@ -473,10 +473,10 @@ public void testBug425035_method_b() throws CoreException {
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[2].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults(
- "Test[TYPE_REF]{Test, b, Lb.Test;, null, null, 52}\n" +
+ "Test[TYPE_REF]{Test, b, Lb.Test;, null, null, 52}\n" +
"i[FIELD_REF]{i, Lb.Test;, I, i, null, 52}\n" +
- "Values[TYPE_REF]{a.Values, a, La.Values;, null, null, 99}\n" +
- "OTHER_VALUE[FIELD_REF]{Values.OTHER_VALUE, La.Values;, La.Values;, OTHER_VALUE, null, 104}\n" +
+ "Values[TYPE_REF]{a.Values, a, La.Values;, null, null, 99}\n" +
+ "OTHER_VALUE[FIELD_REF]{Values.OTHER_VALUE, La.Values;, La.Values;, OTHER_VALUE, null, 104}\n" +
"SOME_VALUE[FIELD_REF]{Values.SOME_VALUE, La.Values;, La.Values;, SOME_VALUE, null, 104}",
requestor.getResults());
} finally {
@@ -509,7 +509,7 @@ public void testBug425035_method_c() throws CoreException {
" @Annotation({Values.SOME_VALUE, })\n" +
" void f() {}\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
requestor.setAllowsRequiredProposals(CompletionProposal.FIELD_REF, CompletionProposal.TYPE_IMPORT, true);
String str = this.workingCopies[2].getSource();
@@ -517,10 +517,10 @@ public void testBug425035_method_c() throws CoreException {
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[2].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults(
- "Test[TYPE_REF]{Test, b, Lb.Test;, null, null, 52}\n" +
+ "Test[TYPE_REF]{Test, b, Lb.Test;, null, null, 52}\n" +
"i[FIELD_REF]{i, Lb.Test;, I, i, null, 52}\n" +
- "Values[TYPE_REF]{Values, a, La.Values;, null, null, 102}\n" +
- "OTHER_VALUE[FIELD_REF]{Values.OTHER_VALUE, La.Values;, La.Values;, OTHER_VALUE, null, 104}\n" +
+ "Values[TYPE_REF]{Values, a, La.Values;, null, null, 102}\n" +
+ "OTHER_VALUE[FIELD_REF]{Values.OTHER_VALUE, La.Values;, La.Values;, OTHER_VALUE, null, 104}\n" +
"SOME_VALUE[FIELD_REF]{Values.SOME_VALUE, La.Values;, La.Values;, SOME_VALUE, null, 104}",
requestor.getResults());
} finally {
@@ -552,7 +552,7 @@ public void testBug425035_method_d() throws CoreException {
" @Annotation(x=)\n" +
" void f() {}\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
requestor.setAllowsRequiredProposals(CompletionProposal.FIELD_REF, CompletionProposal.TYPE_IMPORT, true);
String str = this.workingCopies[2].getSource();
@@ -560,10 +560,10 @@ public void testBug425035_method_d() throws CoreException {
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[2].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults(
- "Test[TYPE_REF]{Test, b, Lb.Test;, null, null, 52}\n" +
+ "Test[TYPE_REF]{Test, b, Lb.Test;, null, null, 52}\n" +
"i[FIELD_REF]{i, Lb.Test;, I, i, null, 52}\n" +
- "Values[TYPE_REF]{a.Values, a, La.Values;, null, null, 99}\n" +
- "OTHER_VALUE[FIELD_REF]{Values.OTHER_VALUE, La.Values;, La.Values;, OTHER_VALUE, null, 104}\n" +
+ "Values[TYPE_REF]{a.Values, a, La.Values;, null, null, 99}\n" +
+ "OTHER_VALUE[FIELD_REF]{Values.OTHER_VALUE, La.Values;, La.Values;, OTHER_VALUE, null, 104}\n" +
"SOME_VALUE[FIELD_REF]{Values.SOME_VALUE, La.Values;, La.Values;, SOME_VALUE, null, 104}",
requestor.getResults());
} finally {
@@ -595,7 +595,7 @@ public void testBug425035_method_e() throws CoreException {
" @Annotation(x={})\n" +
" void f() {}\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
requestor.setAllowsRequiredProposals(CompletionProposal.FIELD_REF, CompletionProposal.TYPE_IMPORT, true);
String str = this.workingCopies[2].getSource();
@@ -603,10 +603,10 @@ public void testBug425035_method_e() throws CoreException {
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[2].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults(
- "Test[TYPE_REF]{Test, b, Lb.Test;, null, null, 52}\n" +
+ "Test[TYPE_REF]{Test, b, Lb.Test;, null, null, 52}\n" +
"i[FIELD_REF]{i, Lb.Test;, I, i, null, 52}\n" +
- "Values[TYPE_REF]{a.Values, a, La.Values;, null, null, 99}\n" +
- "OTHER_VALUE[FIELD_REF]{Values.OTHER_VALUE, La.Values;, La.Values;, OTHER_VALUE, null, 104}\n" +
+ "Values[TYPE_REF]{a.Values, a, La.Values;, null, null, 99}\n" +
+ "OTHER_VALUE[FIELD_REF]{Values.OTHER_VALUE, La.Values;, La.Values;, OTHER_VALUE, null, 104}\n" +
"SOME_VALUE[FIELD_REF]{Values.SOME_VALUE, La.Values;, La.Values;, SOME_VALUE, null, 104}",
requestor.getResults());
} finally {
@@ -639,7 +639,7 @@ public void testBug425035_method_f() throws CoreException {
" @Annotation(x={Values.SOME_VALUE, })\n" +
" void f() {}\n" +
"}\n");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
requestor.setAllowsRequiredProposals(CompletionProposal.FIELD_REF, CompletionProposal.TYPE_IMPORT, true);
String str = this.workingCopies[2].getSource();
@@ -647,10 +647,10 @@ public void testBug425035_method_f() throws CoreException {
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[2].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults(
- "Test[TYPE_REF]{Test, b, Lb.Test;, null, null, 52}\n" +
+ "Test[TYPE_REF]{Test, b, Lb.Test;, null, null, 52}\n" +
"i[FIELD_REF]{i, Lb.Test;, I, i, null, 52}\n" +
- "Values[TYPE_REF]{Values, a, La.Values;, null, null, 102}\n" +
- "OTHER_VALUE[FIELD_REF]{Values.OTHER_VALUE, La.Values;, La.Values;, OTHER_VALUE, null, 104}\n" +
+ "Values[TYPE_REF]{Values, a, La.Values;, null, null, 102}\n" +
+ "OTHER_VALUE[FIELD_REF]{Values.OTHER_VALUE, La.Values;, La.Values;, OTHER_VALUE, null, 104}\n" +
"SOME_VALUE[FIELD_REF]{Values.SOME_VALUE, La.Values;, La.Values;, SOME_VALUE, null, 104}",
requestor.getResults());
} finally {
@@ -663,18 +663,18 @@ public void testBug547256() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/P/src/jdt/Something.java",
- "package jdt;\n" +
- "public class Something {\n" +
- " public static void main(String[] args) {\n" +
- " done: for (int i = 0; i < 5; ++i) {\n" +
- " if (i == 3) {\n" +
- " break done;\n" +
- " }\n" +
- " System.out.println(i);\n" +
+ "package jdt;\n" +
+ "public class Something {\n" +
+ " public static void main(String[] args) {\n" +
+ " done: for (int i = 0; i < 5; ++i) {\n" +
+ " if (i == 3) {\n" +
+ " break done;\n" +
+ " }\n" +
+ " System.out.println(i);\n" +
" }\n" +
- " arg\n" +
- " System.out.println(\"done\");\n" +
- " }\n" +
+ " arg\n" +
+ " System.out.println(\"done\");\n" +
+ " }\n" +
"}\n");
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
requestor.setAllowsRequiredProposals(CompletionProposal.FIELD_REF, CompletionProposal.TYPE_REF, true);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests9.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests9.java
index bd0dbec7b..598fb3706 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests9.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests9.java
@@ -217,7 +217,7 @@ public void test486988_0007() throws JavaModelException {
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/module-info.java", fileContent);
-
+
this.workingCopies[1] = getWorkingCopy(
"/Completion/src/mypack1/Y.java",
"package pack1;\n" +
@@ -249,7 +249,7 @@ public void test486988_0007() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
String expected = "mypack1[PACKAGE_REF]{mypack1, mypack1, null, null, null, 49}\n"
- + "mypack2[PACKAGE_REF]{mypack2, mypack2, null, null, null, 49}\n"
+ + "mypack2[PACKAGE_REF]{mypack2, mypack2, null, null, null, 49}\n"
+ "mypackage[PACKAGE_REF]{mypackage, mypackage, null, null, null, 49}";
assertResults(expected, requestor.getResults());
JavaCore.setOptions(tmpOld);
@@ -380,7 +380,7 @@ public void test486988_0010() throws Exception {
String pack = "/Completion9_2/src/mypack1";
createFolder(pack);
filePath = pack + "/Y.java";
- fileContent = "package pack1;\n" +
+ fileContent = "package pack1;\n" +
"public class Y {}\n";
createFile(filePath, fileContent);
@@ -605,7 +605,7 @@ public void test486988_0015() throws Exception {
String fileContent2 = "module second { "
+ "exports pack21 to first;\n"
- + "exports pack22 to first;\n"
+ + "exports pack22 to first;\n"
+ "}\n";
String filePath2 = "/Completion9_2/src/module-info.java";
createFile(filePath2, fileContent2);
@@ -662,7 +662,7 @@ public void testBug518618_001() throws Exception {
String fileContent2 = "module second { "
+ "exports pack21 to first;\n"
- + "exports pack22 to first;\n"
+ + "exports pack22 to first;\n"
+ "}\n";
String filePath2 = "/Completion9_2/src/module-info.java";
createFile(filePath2, fileContent2);
@@ -712,7 +712,7 @@ public void testBug522164_src() throws Exception {
project1.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
IClasspathAttribute[] attributes = {
- JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true")
+ JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true")
};
addClasspathEntry(project2, JavaCore.newProjectEntry(new Path("/Completion9_1"), null, false, attributes, false));
createFolder("/Completion9_2/src/x");
@@ -770,7 +770,7 @@ public void testBug522164_jar() throws Exception {
refresh(project1);
IClasspathAttribute[] attributes = {
- JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true")
+ JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true")
};
addClasspathEntry(project1, JavaCore.newLibraryEntry(new Path("/Completion9_1/lib/mod.one.jar"), null, null, null, attributes, false));
@@ -839,7 +839,7 @@ public void test540591() throws Exception {
createTypePlus("/Completion9_1/src/", "pack11", "AbstractService", "implements pack11.IService", true /* isClass */, false /* createFolder */);
createTypePlus("/Completion9_1/src/", "pack11", "CCC2", "extends pack11.AbstractService", true /* isClass */, false /* createFolder */);
createTypePlus("/Completion9_1/src/", "pack11", "CCC3", "extends pack11.AbstractService", true /* isClass */, false /* createFolder */);
-
+
String filePath1 = "/Completion9_1/src/module-info.java";
String completeBehind = "CC";
String fileContent1 = "module first {\n"
@@ -857,8 +857,8 @@ public void test540591() throws Exception {
ICompilationUnit unit = getCompilationUnit(filePath1);
unit.codeComplete(cursorLocation, requestor);
- String expected = "CCC[TYPE_REF]{pack11.CCC, pack11, Lpack11.CCC;, null, 49}\n" +
- "CCC2[TYPE_REF]{pack11.CCC2, pack11, Lpack11.CCC2;, null, 49}\n" +
+ String expected = "CCC[TYPE_REF]{pack11.CCC, pack11, Lpack11.CCC;, null, 49}\n" +
+ "CCC2[TYPE_REF]{pack11.CCC2, pack11, Lpack11.CCC2;, null, 49}\n" +
"CCC3[TYPE_REF]{pack11.CCC3, pack11, Lpack11.CCC3;, null, 49}"
;
assertResults(expected, requestor.getResults());
@@ -877,7 +877,7 @@ public void test540591_mismatchedCase() throws Exception {
createTypePlus("/Completion9_1/src/", "pack11", "AbstractService", "implements pack11.IService", true /* isClass */, false /* createFolder */);
createTypePlus("/Completion9_1/src/", "pack11", "CCC2", "extends pack11.AbstractService", true /* isClass */, false /* createFolder */);
createTypePlus("/Completion9_1/src/", "pack11", "CCC3", "extends pack11.AbstractService", true /* isClass */, false /* createFolder */);
-
+
String filePath1 = "/Completion9_1/src/module-info.java";
String completeBehind = "cc";
String fileContent1 = "module first {\n"
@@ -895,8 +895,8 @@ public void test540591_mismatchedCase() throws Exception {
ICompilationUnit unit = getCompilationUnit(filePath1);
unit.codeComplete(cursorLocation, requestor);
- String expected = "CCC[TYPE_REF]{pack11.CCC, pack11, Lpack11.CCC;, null, 39}\n" +
- "CCC2[TYPE_REF]{pack11.CCC2, pack11, Lpack11.CCC2;, null, 39}\n" +
+ String expected = "CCC[TYPE_REF]{pack11.CCC, pack11, Lpack11.CCC;, null, 39}\n" +
+ "CCC2[TYPE_REF]{pack11.CCC2, pack11, Lpack11.CCC2;, null, 39}\n" +
"CCC3[TYPE_REF]{pack11.CCC3, pack11, Lpack11.CCC3;, null, 39}"
;
assertResults(expected, requestor.getResults());
@@ -914,7 +914,7 @@ public void test540591_withoutPrefix() throws Exception {
createTypePlus("/Completion9_1/src/", "pack11", "AbstractService", "implements pack11.IService", true /* isClass */, false /* createFolder */);
createTypePlus("/Completion9_1/src/", "pack11", "CCC2", "extends pack11.AbstractService", true /* isClass */, false /* createFolder */);
createTypePlus("/Completion9_1/src/", "pack11", "CCC3", "extends pack11.AbstractService", true /* isClass */, false /* createFolder */);
-
+
String filePath1 = "/Completion9_1/src/module-info.java";
String completeBehind = "with ";
String fileContent1 = "module first {\n"
@@ -933,12 +933,12 @@ public void test540591_withoutPrefix() throws Exception {
unit.codeComplete(cursorLocation, requestor);
String expected = "AbstractService[TYPE_REF]{pack11.AbstractService, pack11, Lpack11.AbstractService;, null, 39}\n" +
- "CCC[TYPE_REF]{pack11.CCC, pack11, Lpack11.CCC;, null, 39}\n" +
- "CCC2[TYPE_REF]{pack11.CCC2, pack11, Lpack11.CCC2;, null, 39}\n" +
+ "CCC[TYPE_REF]{pack11.CCC, pack11, Lpack11.CCC;, null, 39}\n" +
+ "CCC2[TYPE_REF]{pack11.CCC2, pack11, Lpack11.CCC2;, null, 39}\n" +
"CCC3[TYPE_REF]{pack11.CCC3, pack11, Lpack11.CCC3;, null, 39}\n"+
"pack11[PACKAGE_REF]{pack11, pack11, null, null, 39}"
;
-
+
assertResults(expected, requestor.getResults());
} finally {
@@ -972,7 +972,7 @@ public void test527099_001() throws Exception {
String fileContent2 = "module second { "
+ "exports pack21 to first;\n"
- + "exports pack22 to first;\n"
+ + "exports pack22 to first;\n"
+ "}\n";
String filePath2 = "/Completion9_2/src/module-info.java";
createFile(filePath2, fileContent2);
@@ -1025,7 +1025,7 @@ public void test527873_001() throws Exception {
String fileContent2 = "module second { "
+ "exports pack21 to first;\n"
- + "exports pack22 to first;\n"
+ + "exports pack22 to first;\n"
+ "}\n";
String filePath2 = "/Completion9_2/src/module-info.java";
createFile(filePath2, fileContent2);
@@ -1043,7 +1043,7 @@ public void test527873_001() throws Exception {
ICompilationUnit unit = getCompilationUnit(filePath1);
unit.codeComplete(cursorLocation, requestor);
- String expected =
+ String expected =
"Y12[TYPE_REF]{pack12.Y12, pack12, Lpack12.Y12;, null, 39}\n" +
"Z12[TYPE_REF]{pack11.packinternal.Z12, pack11.packinternal, Lpack11.packinternal.Z12;, null, 39}\n" +
"pack11[PACKAGE_REF]{pack11, pack11, null, null, 39}\n" +
@@ -1082,7 +1082,7 @@ public void test527873_002() throws Exception {
String fileContent2 = "module second { "
+ "exports pack21 to first;\n"
- + "exports pack22 to first;\n"
+ + "exports pack22 to first;\n"
+ "}\n";
String filePath2 = "/Completion9_2/src/module-info.java";
createFile(filePath2, fileContent2);
@@ -1100,7 +1100,7 @@ public void test527873_002() throws Exception {
ICompilationUnit unit = getCompilationUnit(filePath1);
unit.codeComplete(cursorLocation, requestor);
- String expected =
+ String expected =
"Y12[TYPE_REF]{pack12.Y12, pack12, Lpack12.Y12;, null, 39}\n" +
"Z12[TYPE_REF]{pack11.packinternal.Z12, pack11.packinternal, Lpack11.packinternal.Z12;, null, 39}\n" +
"pack11[PACKAGE_REF]{pack11, pack11, null, null, 39}\n" +
@@ -1168,7 +1168,7 @@ public void testBug529123_001() throws Exception {
}
}
public void testBug529123_002() throws Exception {
- String pName = "Completion9-1"; // with a -,
+ String pName = "Completion9-1"; // with a -,
IJavaProject project1 = createJavaProject(pName, new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "9");
try {
project1.open(null);
@@ -1302,7 +1302,7 @@ public void testBug528948_001() throws Exception {
assertTrue(end > 0);
}
assertTrue("Incorrect Number of Proposals", count == 2);
- String expected = "X11[TYPE_REF]{pack11.X11, pack11, Lpack11.X11;, null, 39}\n" +
+ String expected = "X11[TYPE_REF]{pack11.X11, pack11, Lpack11.X11;, null, 39}\n" +
"X12[TYPE_REF]{pack12.X12, pack12, Lpack12.X12;, null, 39}";
assertResults(expected, requestor.getResults());
} finally {
@@ -1359,7 +1359,7 @@ public void testBug528948_002() throws Exception {
assertTrue(end > 0);
}
assertTrue("Incorrect Number of Proposals", count == 2);
- String expected = "X11[TYPE_REF]{pack11.X11, pack11, Lpack11.X11;, null, 39}\n" +
+ String expected = "X11[TYPE_REF]{pack11.X11, pack11, Lpack11.X11;, null, 39}\n" +
"X12[TYPE_REF]{pack12.X12, pack12, Lpack12.X12;, null, 39}";
assertResults(expected, requestor.getResults());
} finally {
@@ -1423,7 +1423,7 @@ public void testBug517417_001() throws Exception {
createType("/Completion9_2/src/", "pack21", "X21");
createType("/Completion9_2/src/", "pack2internal", "X22");
- createFile("/Completion9_2/src/module-info.java",
+ createFile("/Completion9_2/src/module-info.java",
"module second { \n" +
" requires transitive third;\n" +
" exports pack21 to first;\n" +
@@ -1434,7 +1434,7 @@ public void testBug517417_001() throws Exception {
project3.open(null);
createType("/Completion9_3/src/", "pack31", "X31");
- createFile("/Completion9_3/src/module-info.java",
+ createFile("/Completion9_3/src/module-info.java",
"module third { " +
" exports pack31;\n" +
"}\n");
@@ -1453,9 +1453,9 @@ public void testBug517417_001() throws Exception {
ICompilationUnit unit = getCompilationUnit(filePath);
unit.codeComplete(cursorLocation, requestor);
- String expected = "pack0[PACKAGE_REF]{pack0.*;, pack0, null, null, 49}\n" + // local
+ String expected = "pack0[PACKAGE_REF]{pack0.*;, pack0, null, null, 49}\n" + // local
"pack11[PACKAGE_REF]{pack11.*;, pack11, null, null, 49}\n" + // local
- "pack21[PACKAGE_REF]{pack21.*;, pack21, null, null, 49}\n" + // exported
+ "pack21[PACKAGE_REF]{pack21.*;, pack21, null, null, 49}\n" + // exported
"pack31[PACKAGE_REF]{pack31.*;, pack31, null, null, 49}"; // exported in transitively required third
// package pack2internal is exported only to another module
assertResults(expected, requestor.getResults());
@@ -1494,7 +1494,7 @@ public void testBug517417_002() throws Exception {
createType("/Completion9_2/src/", "pack21", "X21");
createType("/Completion9_2/src/", "pack2internal", "X22");
- createFile("/Completion9_2/src/module-info.java",
+ createFile("/Completion9_2/src/module-info.java",
"module second { \n" +
" requires transitive third;\n" +
" requires four;\n" +
@@ -1506,7 +1506,7 @@ public void testBug517417_002() throws Exception {
project3.open(null);
createType("/Completion9_3/src/", "pack31", "X31");
- createFile("/Completion9_3/src/module-info.java",
+ createFile("/Completion9_3/src/module-info.java",
"module third { " +
" exports pack31;\n" +
"}\n");
@@ -1515,7 +1515,7 @@ public void testBug517417_002() throws Exception {
project4.open(null);
createType("/Completion9_4/src/", "pack41", "X41");
- createFile("/Completion9_4/src/module-info.java",
+ createFile("/Completion9_4/src/module-info.java",
"module four { " +
" exports pack41;\n" +
"}\n");
@@ -1536,9 +1536,9 @@ public void testBug517417_002() throws Exception {
ICompilationUnit unit = getCompilationUnit(filePath);
unit.codeComplete(cursorLocation, requestor);
- String expected = "pack0[PACKAGE_REF]{pack0.*;, pack0, null, null, 49}\n" + // local
+ String expected = "pack0[PACKAGE_REF]{pack0.*;, pack0, null, null, 49}\n" + // local
"pack11[PACKAGE_REF]{pack11.*;, pack11, null, null, 49}\n" + // local
- "pack21[PACKAGE_REF]{pack21.*;, pack21, null, null, 49}\n" + // exported
+ "pack21[PACKAGE_REF]{pack21.*;, pack21, null, null, 49}\n" + // exported
"pack31[PACKAGE_REF]{pack31.*;, pack31, null, null, 49}"; // exported in transitively required third
// package pack2internal is exported only to another module
assertResults(expected, requestor.getResults());
@@ -1556,14 +1556,14 @@ public void testBug530911() throws Exception {
createFile("/Completion9_1/src/module-info.java",
"module first {}\n");
- String content = "package annotation;\n" +
- "\n" +
- "import java.lang.annotation.ElementType;\n" +
- "import java.lang.annotation.Target;\n" +
- "\n" +
- "@Target()\n" +
- "public @interface NonNull {\n" +
- "}\n" +
+ String content = "package annotation;\n" +
+ "\n" +
+ "import java.lang.annotation.ElementType;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "\n" +
+ "@Target()\n" +
+ "public @interface NonNull {\n" +
+ "}\n" +
"";
createFolder("/Completion9_1/src/p");
String filePath = "/Completion9_1/src/p/NonNull.java";
@@ -1577,19 +1577,19 @@ public void testBug530911() throws Exception {
ICompilationUnit unit = getCompilationUnit(filePath);
unit.codeComplete(cursorLocation, requestor);
- String expected = "NonNull[TYPE_REF]{NonNull, p, Lp.NonNull;, null, 52}\n" +
- "value[ANNOTATION_ATTRIBUTE_REF]{value = , Ljava.lang.annotation.Target;, [Ljava.lang.annotation.ElementType;, value, 52}\n" +
- "ElementType[TYPE_REF]{ElementType, java.lang.annotation, Ljava.lang.annotation.ElementType;, null, 102}\n" +
- "ANNOTATION_TYPE[FIELD_REF]{ElementType.ANNOTATION_TYPE, Ljava.lang.annotation.ElementType;, Ljava.lang.annotation.ElementType;, ANNOTATION_TYPE, 104}\n" +
- "CONSTRUCTOR[FIELD_REF]{ElementType.CONSTRUCTOR, Ljava.lang.annotation.ElementType;, Ljava.lang.annotation.ElementType;, CONSTRUCTOR, 104}\n" +
- "FIELD[FIELD_REF]{ElementType.FIELD, Ljava.lang.annotation.ElementType;, Ljava.lang.annotation.ElementType;, FIELD, 104}\n" +
- "LOCAL_VARIABLE[FIELD_REF]{ElementType.LOCAL_VARIABLE, Ljava.lang.annotation.ElementType;, Ljava.lang.annotation.ElementType;, LOCAL_VARIABLE, 104}\n" +
- "METHOD[FIELD_REF]{ElementType.METHOD, Ljava.lang.annotation.ElementType;, Ljava.lang.annotation.ElementType;, METHOD, 104}\n" +
- "MODULE[FIELD_REF]{ElementType.MODULE, Ljava.lang.annotation.ElementType;, Ljava.lang.annotation.ElementType;, MODULE, 104}\n" +
- "PACKAGE[FIELD_REF]{ElementType.PACKAGE, Ljava.lang.annotation.ElementType;, Ljava.lang.annotation.ElementType;, PACKAGE, 104}\n" +
- "PARAMETER[FIELD_REF]{ElementType.PARAMETER, Ljava.lang.annotation.ElementType;, Ljava.lang.annotation.ElementType;, PARAMETER, 104}\n" +
- "TYPE[FIELD_REF]{ElementType.TYPE, Ljava.lang.annotation.ElementType;, Ljava.lang.annotation.ElementType;, TYPE, 104}\n" +
- "TYPE_PARAMETER[FIELD_REF]{ElementType.TYPE_PARAMETER, Ljava.lang.annotation.ElementType;, Ljava.lang.annotation.ElementType;, TYPE_PARAMETER, 104}\n" +
+ String expected = "NonNull[TYPE_REF]{NonNull, p, Lp.NonNull;, null, 52}\n" +
+ "value[ANNOTATION_ATTRIBUTE_REF]{value = , Ljava.lang.annotation.Target;, [Ljava.lang.annotation.ElementType;, value, 52}\n" +
+ "ElementType[TYPE_REF]{ElementType, java.lang.annotation, Ljava.lang.annotation.ElementType;, null, 102}\n" +
+ "ANNOTATION_TYPE[FIELD_REF]{ElementType.ANNOTATION_TYPE, Ljava.lang.annotation.ElementType;, Ljava.lang.annotation.ElementType;, ANNOTATION_TYPE, 104}\n" +
+ "CONSTRUCTOR[FIELD_REF]{ElementType.CONSTRUCTOR, Ljava.lang.annotation.ElementType;, Ljava.lang.annotation.ElementType;, CONSTRUCTOR, 104}\n" +
+ "FIELD[FIELD_REF]{ElementType.FIELD, Ljava.lang.annotation.ElementType;, Ljava.lang.annotation.ElementType;, FIELD, 104}\n" +
+ "LOCAL_VARIABLE[FIELD_REF]{ElementType.LOCAL_VARIABLE, Ljava.lang.annotation.ElementType;, Ljava.lang.annotation.ElementType;, LOCAL_VARIABLE, 104}\n" +
+ "METHOD[FIELD_REF]{ElementType.METHOD, Ljava.lang.annotation.ElementType;, Ljava.lang.annotation.ElementType;, METHOD, 104}\n" +
+ "MODULE[FIELD_REF]{ElementType.MODULE, Ljava.lang.annotation.ElementType;, Ljava.lang.annotation.ElementType;, MODULE, 104}\n" +
+ "PACKAGE[FIELD_REF]{ElementType.PACKAGE, Ljava.lang.annotation.ElementType;, Ljava.lang.annotation.ElementType;, PACKAGE, 104}\n" +
+ "PARAMETER[FIELD_REF]{ElementType.PARAMETER, Ljava.lang.annotation.ElementType;, Ljava.lang.annotation.ElementType;, PARAMETER, 104}\n" +
+ "TYPE[FIELD_REF]{ElementType.TYPE, Ljava.lang.annotation.ElementType;, Ljava.lang.annotation.ElementType;, TYPE, 104}\n" +
+ "TYPE_PARAMETER[FIELD_REF]{ElementType.TYPE_PARAMETER, Ljava.lang.annotation.ElementType;, Ljava.lang.annotation.ElementType;, TYPE_PARAMETER, 104}\n" +
"TYPE_USE[FIELD_REF]{ElementType.TYPE_USE, Ljava.lang.annotation.ElementType;, Ljava.lang.annotation.ElementType;, TYPE_USE, 104}";
assertResults(expected, requestor.getResults());
} finally {
@@ -1601,11 +1601,11 @@ public void testBug548888() throws Exception {
try {
project1.open(null);
- String content =
+ String content =
"/**\n" +
- " * @see List\n" +
- " */\n" +
- "module firstmod {\n" +
+ " * @see List\n" +
+ " */\n" +
+ "module firstmod {\n" +
"}\n";
String filePath = "/Completion9_1/src/module-info.java";
String completeBehind="List";
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java
index 3f916597c..148f8756c 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.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
*******************************************************************************/
@@ -624,60 +624,60 @@ public class CompletionTestsRequestor2 extends CompletionRequestor {
public void setComputeEnclosingElement(boolean computeEnclosingElement) {
this.computeEnclosingElement = computeEnclosingElement;
}
-
+
public boolean canUseDiamond(int proposalNo) {
if (proposalNo < this.proposals.length && this.proposals[proposalNo] != null) {
return this.proposals[proposalNo].canUseDiamond(this.context);
}
return false;
}
-
+
public String getCompletionNode() {
if (this.context instanceof InternalCompletionContext) {
InternalCompletionContext internalCompletionContext = (InternalCompletionContext) this.context;
ASTNode astNode = internalCompletionContext.getCompletionNode();
if (astNode != null) return astNode.toString();
-
+
}
return null;
}
-
+
public String getCompletionNodeParent() {
if (this.context instanceof InternalCompletionContext) {
InternalCompletionContext internalCompletionContext = (InternalCompletionContext) this.context;
ASTNode astNode = internalCompletionContext.getCompletionNodeParent();
if (astNode != null) return astNode.toString();
-
+
}
return null;
}
-
+
public String getVisibleLocalVariables() {
if (this.context instanceof InternalCompletionContext) {
InternalCompletionContext internalCompletionContext = (InternalCompletionContext) this.context;
ObjectVector locals = internalCompletionContext.getVisibleLocalVariables();
if (locals != null) return locals.toString();
-
+
}
return null;
}
-
+
public String getVisibleFields() {
if (this.context instanceof InternalCompletionContext) {
InternalCompletionContext internalCompletionContext = (InternalCompletionContext) this.context;
ObjectVector fields = internalCompletionContext.getVisibleFields();
if (fields != null) return fields.toString();
-
+
}
return null;
}
-
+
public String getVisibleMethods() {
if (this.context instanceof InternalCompletionContext) {
InternalCompletionContext internalCompletionContext = (InternalCompletionContext) this.context;
ObjectVector methods = internalCompletionContext.getVisibleMethods();
if (methods != null) return methods.toString();
-
+
}
return null;
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java
index af87bd54b..0cd6699f5 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java
@@ -4384,7 +4384,7 @@ public void test0154() throws JavaModelException {
"expectedTypesKeys={I}",
result.context);
- assertResults(
+ assertResults(
"ZZAnnotation[TYPE_REF]{ZZAnnotation, test0154, Ltest0154.ZZAnnotation;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
"ZZClass[TYPE_REF]{ZZClass, test0154, Ltest0154.ZZClass;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
"zzint[FIELD_REF]{zzint, Ltest0154.Test;, I, zzint, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
@@ -11994,7 +11994,7 @@ public void test0374() throws JavaModelException {
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=106821
public void test0375() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
-
+
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/test/Test.java",
"package test;\n"+
@@ -12027,20 +12027,20 @@ public void test0375() throws JavaModelException {
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=114116
public void test0376() throws JavaModelException {
this.workingCopies = new ICompilationUnit[2];
-
+
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/test/Test.java",
"package test;\n"+
"public class Test {\n"+
" MyCollection<String> \n"+
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/Completion/src/test/MyCollection.java",
"package test;\n"+
"public abstract class MyCollection<T> implements java.util.Collection<T> {\n"+
"}");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.workingCopies[0].getSource();
String completeBehind = "MyCollection<String> ";
@@ -12056,20 +12056,20 @@ public void test0376() throws JavaModelException {
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=114116
public void test0377() throws JavaModelException {
this.workingCopies = new ICompilationUnit[2];
-
+
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/test/Test.java",
"package test;\n"+
"public class Test {\n"+
" MyCollection \n"+
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/Completion/src/test/MyCollection.java",
"package test;\n"+
"public abstract class MyCollection<T> implements java.util.Collection<T> {\n"+
"}");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.workingCopies[0].getSource();
String completeBehind = "MyCollection ";
@@ -12084,20 +12084,20 @@ public void test0377() throws JavaModelException {
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=114116
public void test0378() throws JavaModelException {
this.workingCopies = new ICompilationUnit[2];
-
+
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/test/Test.java",
"package test;\n"+
"public class Test {\n"+
" MyCollection<String, String> \n"+
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/Completion/src/test/MyCollection.java",
"package test;\n"+
"public abstract class MyCollection<T, U> implements java.util.Collection<T> {\n"+
"}");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.workingCopies[0].getSource();
String completeBehind = "MyCollection<String, String> ";
@@ -13588,7 +13588,7 @@ public void testCompletionOnExtends4() throws JavaModelException {
}
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=246832
- * To test whether camel case completion works for imported static methods
+ * To test whether camel case completion works for imported static methods
*/
public void testCamelCaseStaticMethodImport() throws JavaModelException {
this.oldOptions = JavaCore.getOptions();
@@ -13603,7 +13603,7 @@ public void testCamelCaseStaticMethodImport() throws JavaModelException {
"package a;\n" +
"public class A{\n" +
"public static void testMethodWithLongName(){}\n" +
- "public static void testMethodWithLongName2(){}\n" +
+ "public static void testMethodWithLongName2(){}\n" +
"}}");
this.workingCopies[1] = getWorkingCopy(
@@ -13613,7 +13613,7 @@ public void testCamelCaseStaticMethodImport() throws JavaModelException {
"public void b() {\n" +
"tMWLN \n" +
"}}");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(
true);
String str = this.workingCopies[1].getSource();
@@ -13623,7 +13623,7 @@ public void testCamelCaseStaticMethodImport() throws JavaModelException {
assertResults(
"testMethodWithLongName[METHOD_REF]{testMethodWithLongName(), La.A;, ()V, testMethodWithLongName, null, " +
- (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CAMEL_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
+ (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CAMEL_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
requestor.getResults());
} finally {
JavaCore.setOptions(this.oldOptions);
@@ -13631,7 +13631,7 @@ public void testCamelCaseStaticMethodImport() throws JavaModelException {
}
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=84720
- * to test that the methods with Boxed/unboxed return types get higher relevance than the ones that return void
+ * to test that the methods with Boxed/unboxed return types get higher relevance than the ones that return void
*/
public void testCompletionWithUnboxing() throws JavaModelException {
this.workingCopies = new ICompilationUnit[2];
@@ -13668,12 +13668,12 @@ public void testCompletionWithUnboxing() throws JavaModelException {
(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_EXPECTED_TYPE + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
"myMethod3[METHOD_REF]{myMethod3(), Ltest.C;, ()I, myMethod3, null, " +
(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_EXACT_EXPECTED_TYPE + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
+ requestor.getResults());
}
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=84720
- * Additional tests for bug 84720
- *
+ * Additional tests for bug 84720
+ *
* @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=273991 also
*/
public void testCompletionWithUnboxing_1() throws JavaModelException {
@@ -13701,7 +13701,7 @@ public void testCompletionWithUnboxing_1() throws JavaModelException {
"package java.lang;\n" +
"public class Float {\n" +
"}");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.workingCopies[0].getSource();
@@ -13720,11 +13720,11 @@ public void testCompletionWithUnboxing_1() throws JavaModelException {
(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_EXPECTED_TYPE + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
"myMethod3[METHOD_REF]{myMethod3(), Ltest.C;, ()Ljava.lang.Long;, myMethod3, null, " +
(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_EXACT_EXPECTED_TYPE + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}" ,
- requestor.getResults());
+ requestor.getResults());
}
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=84720
- * Additional tests for bug 84720
+ * Additional tests for bug 84720
*/
public void testCompletionWithUnboxing_2() throws JavaModelException {
this.workingCopies = new ICompilationUnit[2];
@@ -13740,7 +13740,7 @@ public void testCompletionWithUnboxing_2() throws JavaModelException {
" if(myVar \n" +
"}\n" +
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/Completion/src3/java/lang/Test.java",
"package java.lang;\n" +
@@ -13762,7 +13762,7 @@ public void testCompletionWithUnboxing_2() throws JavaModelException {
(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_EXPECTED_TYPE + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
"myVariable3[FIELD_REF]{myVariable3, Ltest.C;, Z, myVariable3, null, " +
(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_EXACT_EXPECTED_TYPE + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
+ requestor.getResults());
}
//bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=274466
//Check for boolean methods with higher relevance in assert statement's conditional part
@@ -13773,7 +13773,7 @@ public void test274466() throws JavaModelException {
"package test;" +
"public class Test274466 {\n" +
" boolean methodReturningBoolean() { return true; }\n" +
- " Boolean methodReturningBooleanB() { return true; }\n" +
+ " Boolean methodReturningBooleanB() { return true; }\n" +
" void methodReturningBlah() { return; }\n" +
" int foo(int p) {\n" +
" assert methodR : \"Exception Message\";" +
@@ -13784,7 +13784,7 @@ public void test274466() throws JavaModelException {
"package java.lang;\n" +
"public class Boolean {\n" +
"}");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
String str = this.workingCopies[0].getSource();
String completeBehind = "methodR";
@@ -13792,13 +13792,13 @@ public void test274466() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults(
- "methodReturningBlah[METHOD_REF]{methodReturningBlah(), Ltest.Test274466;, ()V, methodReturningBlah, " +
+ "methodReturningBlah[METHOD_REF]{methodReturningBlah(), Ltest.Test274466;, ()V, methodReturningBlah, " +
(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_VOID + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "methodReturningBooleanB[METHOD_REF]{methodReturningBooleanB(), Ltest.Test274466;, ()Ljava.lang.Boolean;, methodReturningBooleanB, " +
+ "methodReturningBooleanB[METHOD_REF]{methodReturningBooleanB(), Ltest.Test274466;, ()Ljava.lang.Boolean;, methodReturningBooleanB, " +
(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXPECTED_TYPE + R_NON_RESTRICTED) + "}\n" +
- "methodReturningBoolean[METHOD_REF]{methodReturningBoolean(), Ltest.Test274466;, ()Z, methodReturningBoolean, " +
+ "methodReturningBoolean[METHOD_REF]{methodReturningBoolean(), Ltest.Test274466;, ()Z, methodReturningBoolean, " +
(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
+ requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=307486
public void testLabel() throws JavaModelException {
@@ -13809,9 +13809,9 @@ public void testLabel() throws JavaModelException {
"public class Test {\n" +
" void foo() {\n" +
" \ud842\udf9fabc :\n" +
- " while (true) {\n" +
- " break \ud842\udf9fabc;\n" +
- " }\n" +
+ " while (true) {\n" +
+ " break \ud842\udf9fabc;\n" +
+ " }\n" +
" }\n" +
"}\n");
@@ -13894,9 +13894,9 @@ public void testBug343865a() throws JavaModelException {
cu.codeComplete(cursorLocation, requestor);
assertResults(
- "name[ANNOTATION_ATTRIBUTE_REF]{name = , Ltestxxx.YAAnnot;, Ljava.lang.String;, name, null, " +
+ "name[ANNOTATION_ATTRIBUTE_REF]{name = , Ltestxxx.YAAnnot;, Ljava.lang.String;, name, null, " +
(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "val[ANNOTATION_ATTRIBUTE_REF]{val = , Ltestxxx.YAAnnot;, I, val, null, " +
+ "val[ANNOTATION_ATTRIBUTE_REF]{val = , Ltestxxx.YAAnnot;, I, val, null, " +
(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
requestor.getResults());
}
@@ -13916,11 +13916,11 @@ public void testBug343865b() throws JavaModelException {
"expectedTypesSignatures={Ljava.lang.String;}\n" +
"expectedTypesKeys={Ljava/lang/String;}",
requestor.getContext());
-
+
assertResults(
- "xxyy[FIELD_REF]{xxyy, Ltestxxx.TestType2;, I, xxyy, null, " +
+ "xxyy[FIELD_REF]{xxyy, Ltestxxx.TestType2;, I, xxyy, null, " +
(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "xxyy1[FIELD_REF]{xxyy1, Ltestxxx.TestType2;, Ljava.lang.String;, xxyy1, null, " +
+ "xxyy1[FIELD_REF]{xxyy1, Ltestxxx.TestType2;, Ljava.lang.String;, xxyy1, null, " +
(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_EXACT_EXPECTED_TYPE) + "}",
requestor.getResults());
}
@@ -13944,7 +13944,7 @@ public void testBug351426() throws JavaModelException {
int relevance = R_DEFAULT + R_RESOLVED + R_INTERESTING + R_EXACT_NAME + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_EXACT_EXPECTED_TYPE;
-
+
assertResults(
"expectedTypesSignatures={Ltest.X<Ljava.lang.String;>;}\n" +
"expectedTypesKeys={Ltest/X<Ljava/lang/String;>;}",
@@ -13973,7 +13973,7 @@ public void testBug351426b() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
int relevance = R_DEFAULT + R_RESOLVED + R_INTERESTING + R_EXACT_NAME + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_EXACT_EXPECTED_TYPE;
-
+
assertResults(
"expectedTypesSignatures={Ltest.X<Ljava.lang.String;>;}\n" +
"expectedTypesKeys={Ltest/X<Ljava/lang/String;>;}",
@@ -14004,7 +14004,7 @@ public void testBug351426c() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
int relevance = R_DEFAULT + R_RESOLVED + R_INTERESTING + R_EXACT_NAME + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_EXACT_EXPECTED_TYPE;
-
+
assertResults(
"expectedTypesSignatures={Ltest.X<Ljava.lang.String;>.X1<Ljava.lang.String;>;}\n" +
"expectedTypesKeys={Ltest/X<Ljava/lang/String;>.X1<Ljava/lang/String;>;}",
@@ -14037,7 +14037,7 @@ public void testBug351426d() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
int relevance = R_DEFAULT + R_RESOLVED + R_INTERESTING + R_EXACT_NAME + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_EXACT_EXPECTED_TYPE;
-
+
assertResults(
"expectedTypesSignatures={Ltest.X<Ljava.lang.String;>.X1<Ljava.lang.Object;>.X11<Ljava.lang.String;>;}\n" +
"expectedTypesKeys={Ltest/X<Ljava/lang/String;>.X1<Ljava/lang/Object;>.X11<Ljava/lang/String;>;}",
@@ -14069,7 +14069,7 @@ public void testBug351426e() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
int relevance = R_DEFAULT + R_RESOLVED + R_INTERESTING + R_EXACT_NAME + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_EXACT_EXPECTED_TYPE;
-
+
assertResults(
"expectedTypesSignatures={Ltest.X$X1<Ljava.lang.String;>;}\n" +
"expectedTypesKeys={Ltest/X$X1<Ljava/lang/String;>;}",
@@ -14099,7 +14099,7 @@ public void testBug351426f() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
int relevance = R_DEFAULT + R_RESOLVED + R_INTERESTING + R_EXACT_NAME + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_EXACT_EXPECTED_TYPE;
-
+
assertResults(
"expectedTypesSignatures={Ltest.X<Ljava.lang.String;>;}\n" +
"expectedTypesKeys={Ltest/X<Ljava/lang/String;>;}",
@@ -14130,7 +14130,7 @@ public void testBug351426g() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
int relevance = R_DEFAULT + R_RESOLVED + R_INTERESTING + R_EXACT_NAME + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_EXACT_EXPECTED_TYPE;
-
+
assertResults(
"expectedTypesSignatures={Ltest.X<TT;>.X1<Ljava.lang.String;>;}\n" +
"expectedTypesKeys={Ltest/X<Ltest/X;:TT;>.X1<Ljava/lang/String;>;}",
@@ -14161,7 +14161,7 @@ public void testBug351426h() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
int relevance = R_DEFAULT + R_RESOLVED + R_INTERESTING + R_EXACT_NAME + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_EXACT_EXPECTED_TYPE;
-
+
assertResults(
"expectedTypesSignatures={Ltest.X$X1<Ljava.lang.String;>;}\n" +
"expectedTypesKeys={Ltest/X$X1<Ljava/lang/String;>;}",
@@ -14189,7 +14189,7 @@ public void testBug351426i() throws JavaModelException {
int relevance = R_DEFAULT + R_RESOLVED + R_INTERESTING + R_EXACT_NAME + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_EXACT_EXPECTED_TYPE;
-
+
assertResults(
"expectedTypesSignatures={Ltest.X<Ljava.lang.String;>;}\n" +
"expectedTypesKeys={Ltest/X<Ljava/lang/String;>;}",
@@ -14221,7 +14221,7 @@ public void testBug351426j() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
int relevance = R_DEFAULT + R_RESOLVED + R_INTERESTING + R_EXACT_NAME + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_EXACT_EXPECTED_TYPE;
-
+
assertResults(
"expectedTypesSignatures={Ltest.X$X1<Ljava.lang.String;>;}\n" +
"expectedTypesKeys={Ltest/X$X1<Ljava/lang/String;>;}",
@@ -14251,7 +14251,7 @@ public void testBug351426k() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
int relevance = R_DEFAULT + R_RESOLVED + R_INTERESTING + R_EXACT_NAME + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_EXACT_EXPECTED_TYPE;
-
+
assertResults(
"expectedTypesSignatures={Ltest.X<Ljava.lang.String;Ljava.lang.String;>;}\n" +
"expectedTypesKeys={Ltest/X<Ljava/lang/String;Ljava/lang/String;>;}",
@@ -14286,7 +14286,7 @@ public void testBug351426l() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
int relevance = R_DEFAULT + R_RESOLVED + R_INTERESTING + R_EXACT_NAME + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_EXACT_EXPECTED_TYPE;
-
+
assertResults(
"expectedTypesSignatures={Ltest.X1<Ljava.lang.String;>;}\n" +
"expectedTypesKeys={Ltest/X1<Ljava/lang/String;>;}",
@@ -14353,7 +14353,7 @@ public void testBug326610a() throws JavaModelException {
"final[KEYWORD]{final, null, null, final, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) +"}\n" +
"import[KEYWORD]{import, null, null, import, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) +"}\n" +
"interface[KEYWORD]{interface, null, null, interface, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) +"}\n" +
- "public[KEYWORD]{public, null, null, public, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) +"}"
+ "public[KEYWORD]{public, null, null, public, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) +"}"
//{ObjectTeams: one more keyword:
+ "\nteam[KEYWORD]{team, null, null, team, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) +"}",
// SH}
@@ -14503,26 +14503,26 @@ public void testBug525421() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/Complete.java",
- "class List<T> {\n" +
- "}\n" +
- "\n" +
- "enum Flag {\n" +
- " YES, NO;\n" +
- "}\n" +
- "\n" +
- "public class Complete {\n" +
- " private <T> List<T> emptyList() {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " static boolean f(List<String> generic, Flag e) {\n" +
- " return generic != null && e == Flag.YES;\n" +
- " }\n" +
- "\n" +
- " void fails() {\n" +
- " f(emptyList(), Y);\n" +
- " }\n" +
- "}\n" +
+ "class List<T> {\n" +
+ "}\n" +
+ "\n" +
+ "enum Flag {\n" +
+ " YES, NO;\n" +
+ "}\n" +
+ "\n" +
+ "public class Complete {\n" +
+ " private <T> List<T> emptyList() {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " static boolean f(List<String> generic, Flag e) {\n" +
+ " return generic != null && e == Flag.YES;\n" +
+ " }\n" +
+ "\n" +
+ " void fails() {\n" +
+ " f(emptyList(), Y);\n" +
+ " }\n" +
+ "}\n" +
"");
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
@@ -14532,7 +14532,7 @@ public void testBug525421() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults(
- "YES[FIELD_REF]{Flag.YES, LFlag;, LFlag;, YES, null, 104}",
+ "YES[FIELD_REF]{Flag.YES, LFlag;, LFlag;, YES, null, 104}",
requestor.getResults());
}
@@ -14563,7 +14563,7 @@ public void testBug526590() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults(
- "Bug526590[TYPE_REF]{Bug526590, testbug526590, Ltestbug526590.Bug526590;, null, null, 52}\n" +
+ "Bug526590[TYPE_REF]{Bug526590, testbug526590, Ltestbug526590.Bug526590;, null, null, 52}\n" +
"value[ANNOTATION_ATTRIBUTE_REF]{value = , Ltestbug526590.QQAnnotation;, [Ljava.lang.String;, value, null, 52}\n" +
"String[TYPE_REF]{String, java.lang, Ljava.lang.String;, null, null, 82}",
requestor.getResults());
@@ -14595,7 +14595,7 @@ public void testBug526590b() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults(
- "Bug526590[TYPE_REF]{Bug526590, testbug526590, Ltestbug526590.Bug526590;, null, null, 52}\n" +
+ "Bug526590[TYPE_REF]{Bug526590, testbug526590, Ltestbug526590.Bug526590;, null, null, 52}\n" +
"value[ANNOTATION_ATTRIBUTE_REF]{value = , Ltestbug526590.QQAnnotation;, [Ljava.lang.String;, value, null, 52}\n" +
"String[TYPE_REF]{String, java.lang, Ljava.lang.String;, null, null, 82}",
requestor.getResults());
@@ -14605,11 +14605,11 @@ public void test536983() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/test/SingleLineForEach.java",
- "package test;\n" +
+ "package test;\n" +
"public class SingleLineForEach {\n" +
- " private void meth() { \n" +
+ " private void meth() { \n" +
" Object[] f= {new Object(), new Object() };\n" +
- " for (Object abc : f) abc.\n" +
+ " for (Object abc : f) abc.\n" +
"}\n" +
"}\n");
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, true, true, true, true, true);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CopyMoveResourcesTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CopyMoveResourcesTests.java
index cc6204682..67cc712be 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CopyMoveResourcesTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CopyMoveResourcesTests.java
@@ -1009,7 +1009,7 @@ public void testMoveCU10() throws CoreException {
ICompilationUnit cuSource = getCompilationUnit("/P/src/p1/X.java");
IPackageFragment pkgDest = getPackage("/P/src");
cuSource.move(pkgDest, null/*no sibling*/, null/*no rename*/, false/*don't replace*/, null/*no progress*/);
-
+
ICompilationUnit cuDest = getCompilationUnit("/P/src/X.java");
assertSourceEquals(
"Unexpected source",
@@ -1036,7 +1036,7 @@ public void testMoveCU11() throws CoreException {
ICompilationUnit cuSource = getCompilationUnit("/P/src/p1/X.java");
IPackageFragment pkgDest = getPackage("/P/src");
cuSource.move(pkgDest, null/*no sibling*/, null/*no rename*/, false/*don't replace*/, null/*no progress*/);
-
+
ICompilationUnit cuDest = getCompilationUnit("/P/src/X.java");
assertSourceEquals(
"Unexpected source",
@@ -1063,13 +1063,13 @@ public void testMoveCU12() throws CoreException {
ICompilationUnit cuSource = getCompilationUnit("/P/src/p1/X.java");
IPackageFragment pkgDest = getPackage("/P/src");
cuSource.move(pkgDest, null/*no sibling*/, null/*no rename*/, false/*don't replace*/, null/*no progress*/);
-
+
ICompilationUnit cuDest = getCompilationUnit("/P/src/X.java");
assertSourceEquals(
"Unexpected source",
- "/** some Javadoc */\n" +
- "\n" +
- "public class X {\n" +
+ "/** some Javadoc */\n" +
+ "\n" +
+ "public class X {\n" +
"}",
cuDest.getSource());
}
@@ -1090,14 +1090,14 @@ public void testMoveCU13() throws CoreException {
ICompilationUnit cuSource = getCompilationUnit("/P/src/p1/X.java");
IPackageFragment pkgDest = getPackage("/P/src");
cuSource.move(pkgDest, null/*no sibling*/, null/*no rename*/, false/*don't replace*/, null/*no progress*/);
-
+
ICompilationUnit cuDest = getCompilationUnit("/P/src/X.java");
assertSourceEquals(
"Unexpected source",
- "/** some Javadoc */\n" +
+ "/** some Javadoc */\n" +
"// some line comment\n" +
- "\n" +
- "public class X {\n" +
+ "\n" +
+ "public class X {\n" +
"}",
cuDest.getSource());
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/EncodingTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/EncodingTests.java
index 3ed27ae30..3534c1087 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/EncodingTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/EncodingTests.java
@@ -484,7 +484,7 @@ public class EncodingTests extends ModifyingResourceTests {
assertFalse("Sources should not be the same as they were decoded with different encoding!", encodedContents.equals(source));
}
finally{
- this.encodingProject.setDefaultCharset(oldEncoding, null);
+ this.encodingProject.setDefaultCharset(oldEncoding, null);
}
}
@@ -729,7 +729,7 @@ public class EncodingTests extends ModifyingResourceTests {
deleteFile("Encoding/Test34.txt");
}
}
-
+
/**
* Bug 66898: refactor-rename: encoding is not preserved
* @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=66898"
@@ -943,7 +943,7 @@ public class EncodingTests extends ModifyingResourceTests {
preferences.flush();
}
}
-
+
/**
* Bug 303511: Allow to specify encoding for source attachments
* Test whether the source mapper picks the right encoding for the source attachment as a ZIP in workspace.
@@ -953,7 +953,7 @@ public class EncodingTests extends ModifyingResourceTests {
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=303511"
*/
public void testBug303511() throws JavaModelException, CoreException {
-
+
try {
// Set file encoding
String encoding = "Shift-JIS";
@@ -961,7 +961,7 @@ public class EncodingTests extends ModifyingResourceTests {
getWorkspaceRoot().setDefaultCharset("UTF-8", null);
IFile zipFile = (IFile) this.encodingProject.findMember("testShiftJIS.zip"); //$NON-NLS-1$
IFile sourceFile = (IFile) this.encodingProject.findMember("src/testShiftJIS/A.java");
-
+
assertNotNull("Cannot find class file!", zipFile);
zipFile.setCharset(encoding, null);
@@ -994,7 +994,7 @@ public class EncodingTests extends ModifyingResourceTests {
charArray = source.toCharArray();
source = new String(CharOperation.remove(charArray, '\r'));
assertTrue("Sources should be decoded the same way", encodedContents.equals(source));
-
+
this.encodingProject.setDefaultCharset(null, null);
root = getPackageFragmentRoot("Encoding", "testShiftJIS.jar");
@@ -1007,7 +1007,7 @@ public class EncodingTests extends ModifyingResourceTests {
encodedContents = new String(CharOperation.remove(charArray, '\r'));
charArray = source.toCharArray();
source = new String(CharOperation.remove(charArray, '\r'));
- assertFalse("Sources should be decoded the same way", encodedContents.equals(source));
+ assertFalse("Sources should be decoded the same way", encodedContents.equals(source));
// Reset zip file encoding
zipFile.setCharset(null, null);
@@ -1021,9 +1021,9 @@ public class EncodingTests extends ModifyingResourceTests {
/**
* Bug 303511: Allow to specify encoding for source attachments
* Test whether the source mapper picks the right encoding for an external source attachment
- * The attachment could be an external folder or external archive and have the encoding
+ * The attachment could be an external folder or external archive and have the encoding
* explicitly set. In the absence of encoding for the source attachment resource, the default
- * encoding from the workspace is applied.
+ * encoding from the workspace is applied.
*
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=303511"
*/
@@ -1036,7 +1036,7 @@ public class EncodingTests extends ModifyingResourceTests {
String externalPath = this.encodingProject.getLocation().toOSString() + File.separator + "testShiftJIS.zip";
IFile sourceFile = (IFile) this.encodingProject.findMember("src/testShiftJIS/A.java");
getWorkspaceRoot().setDefaultCharset(encoding, null);
-
+
IClasspathEntry[] entries = this.encodingJavaProject.getRawClasspath();
IClasspathEntry oldEntry = null;
for (int index = 0; index < entries.length; index++) {
@@ -1044,12 +1044,12 @@ public class EncodingTests extends ModifyingResourceTests {
if (entry.getPath().toOSString().endsWith("testShiftJIS.jar")) {
oldEntry = entry;
IClasspathEntry newEntry = JavaCore.newLibraryEntry(entry.getPath(), new Path(externalPath), null);
- entries[index] = newEntry;
+ entries[index] = newEntry;
}
}
this.encodingJavaProject.setRawClasspath(entries, null);
this.encodingJavaProject.getResolvedClasspath(true);
-
+
// Get class file and compare source (should not be the same as modify charset on zip file has no effect...)
IPackageFragmentRoot root = getPackageFragmentRoot("Encoding", "testShiftJIS.jar");
ISourceReference sourceRef = root.getPackageFragment("testShiftJIS").getClassFile("A.class");
@@ -1069,12 +1069,12 @@ public class EncodingTests extends ModifyingResourceTests {
IClasspathEntry entry = entries[index];
if (entry.getPath().toOSString().endsWith("testShiftJIS.jar")) {
IClasspathEntry newEntry = JavaCore.newLibraryEntry(entry.getPath(), new Path(sourcePath), null);
- entries[index] = newEntry;
+ entries[index] = newEntry;
}
}
this.encodingJavaProject.setRawClasspath(entries, null);
this.encodingJavaProject.getResolvedClasspath(true);
-
+
entries = this.encodingJavaProject.getRawClasspath();
for (int index = 0; index < entries.length; index++) {
IClasspathEntry entry = entries[index];
@@ -1093,7 +1093,7 @@ public class EncodingTests extends ModifyingResourceTests {
/**
* Bug 303511: Allow to specify encoding for source attachments
* Test that, for a source attachment in form of archives from another project (in the same workspace), the
- * encoding of the archive (IResource), if set, is used. In the absence of explicit encoding, the encoding
+ * encoding of the archive (IResource), if set, is used. In the absence of explicit encoding, the encoding
* of the project that contains this archive is used.
*
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=303511"
@@ -1116,7 +1116,7 @@ public class EncodingTests extends ModifyingResourceTests {
for (int index = 0; index < entries.length; index++) {
IClasspathEntry entry = entries[index];
if (entry.getPath().toOSString().endsWith("testShiftJIS.jar")) {
- newEntry = entries[index];
+ newEntry = entries[index];
}
}
project.setRawClasspath(new IClasspathEntry[]{JavaCore.newLibraryEntry(newEntry.getPath(), new Path("/Encoding/testShiftJIS.zip"), null)}, null);
@@ -1147,7 +1147,7 @@ public class EncodingTests extends ModifyingResourceTests {
charArray = source.toCharArray();
source = new String(CharOperation.remove(charArray, '\r'));
assertTrue("Sources should be decoded the same way", encodedContents.equals(source));
-
+
this.encodingProject.setDefaultCharset(oldEncoding, null);
}
finally {
@@ -1158,7 +1158,7 @@ public class EncodingTests extends ModifyingResourceTests {
/**
* Bug 303511: Allow to specify encoding for source attachments
* Test that, for a source attachment in form of folder from another project (in the same workspace), the
- * encoding of the folder (IResource), if set, is used. In the absence of explicit encoding, the encoding
+ * encoding of the folder (IResource), if set, is used. In the absence of explicit encoding, the encoding
* of the project which contains this folder is used.
*
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=303511"
@@ -1173,20 +1173,20 @@ public class EncodingTests extends ModifyingResourceTests {
IFile zipFile = (IFile) this.encodingProject.findMember("testShiftJIS.zip"); //$NON-NLS-1$
IFile sourceFile = (IFile) this.encodingProject.findMember("src/testShiftJIS/A.java");
assertNotNull("Cannot find class file!", zipFile);
-
+
IClasspathEntry[] entries = this.encodingJavaProject.getRawClasspath();
IClasspathEntry newEntry = null;
for (int index = 0; index < entries.length; index++) {
IClasspathEntry entry = entries[index];
if (entry.getPath().toOSString().endsWith("testShiftJIS.jar")) {
- newEntry = entries[index];
+ newEntry = entries[index];
}
}
project.setRawClasspath(new IClasspathEntry[]{JavaCore.newLibraryEntry(newEntry.getPath(), new Path("/Encoding/src"), null)}, null);
this.encodingProject.setDefaultCharset(encoding, null);
sourceFile.setCharset(null, null);
-
+
IPackageFragmentRoot root = getPackageFragmentRoot("Encoding2", "testShiftJIS.jar");
ISourceReference sourceRef = root.getPackageFragment("testShiftJIS").getClassFile("A.class");
assertNotNull(sourceRef);
@@ -1198,7 +1198,7 @@ public class EncodingTests extends ModifyingResourceTests {
charArray = source.toCharArray();
source = new String(CharOperation.remove(charArray, '\r'));
assertTrue("Sources should be decoded the same way", encodedContents.equals(source));
-
+
this.encodingProject.setDefaultCharset(oldEncoding, null);
sourceFile.setCharset(encoding, null);
@@ -1212,8 +1212,8 @@ public class EncodingTests extends ModifyingResourceTests {
encodedContents = new String(CharOperation.remove(charArray, '\r'));
charArray = source.toCharArray();
source = new String(CharOperation.remove(charArray, '\r'));
- assertTrue("Sources should be decoded the same way", encodedContents.equals(source));
-
+ assertTrue("Sources should be decoded the same way", encodedContents.equals(source));
+
sourceFile.setCharset(null, null);
}
finally {
@@ -1231,20 +1231,20 @@ public class EncodingTests extends ModifyingResourceTests {
IJavaProject project = this.createJavaProject("Encoding2", new String[] {""}, "");
IFile zipFile = (IFile) this.encodingProject.findMember("testShiftJIS.zip"); //$NON-NLS-1$
IFile sourceFile = (IFile) this.encodingProject.findMember("src/testShiftJIS/A.java");
-
+
IClasspathEntry[] entries = this.encodingJavaProject.getRawClasspath();
IClasspathEntry newEntry = null;
for (int index = 0; index < entries.length; index++) {
IClasspathEntry entry = entries[index];
if (entry.getPath().toOSString().endsWith("testShiftJIS.jar")) {
- newEntry = entries[index];
+ newEntry = entries[index];
}
}
IClasspathAttribute attribute = JavaCore.newClasspathAttribute(IClasspathAttribute.SOURCE_ATTACHMENT_ENCODING, encoding);
project.setRawClasspath(new IClasspathEntry[]{JavaCore.newLibraryEntry(newEntry.getPath(), new Path("/Encoding/src"), null, null, new IClasspathAttribute[]{attribute}, false)}, null);
sourceFile.setCharset(null, null);
-
+
IPackageFragmentRoot root = getPackageFragmentRoot("Encoding2", "testShiftJIS.jar");
ISourceReference sourceRef = root.getPackageFragment("testShiftJIS").getClassFile("A.class");
assertNotNull(sourceRef);
@@ -1260,7 +1260,7 @@ public class EncodingTests extends ModifyingResourceTests {
attribute = JavaCore.newClasspathAttribute(IClasspathAttribute.SOURCE_ATTACHMENT_ENCODING, "UTF-8");
project.setRawClasspath(new IClasspathEntry[]{JavaCore.newLibraryEntry(newEntry.getPath(), new Path("/Encoding/src"), null, null, new IClasspathAttribute[]{attribute}, false)}, null);
sourceFile.setCharset(encoding, null);
-
+
root = getPackageFragmentRoot("Encoding2", "testShiftJIS.jar");
sourceRef = root.getPackageFragment("testShiftJIS").getClassFile("A.class");
assertNotNull(sourceRef);
@@ -1276,7 +1276,7 @@ public class EncodingTests extends ModifyingResourceTests {
attribute = JavaCore.newClasspathAttribute(IClasspathAttribute.SOURCE_ATTACHMENT_ENCODING, encoding);
project.setRawClasspath(new IClasspathEntry[]{JavaCore.newLibraryEntry(newEntry.getPath(), new Path("/Encoding/testShiftJIS.zip"), null, null, new IClasspathAttribute[]{attribute}, false)}, null);
zipFile.setCharset(null, null);
-
+
root = getPackageFragmentRoot("Encoding2", "testShiftJIS.jar");
sourceRef = root.getPackageFragment("testShiftJIS").getClassFile("A.class");
assertNotNull(sourceRef);
@@ -1292,7 +1292,7 @@ public class EncodingTests extends ModifyingResourceTests {
attribute = JavaCore.newClasspathAttribute(IClasspathAttribute.SOURCE_ATTACHMENT_ENCODING, "UTF-8");
project.setRawClasspath(new IClasspathEntry[]{JavaCore.newLibraryEntry(newEntry.getPath(), new Path("/Encoding/testShiftJIS.zip"), null, null, new IClasspathAttribute[]{attribute}, false)}, null);
zipFile.setCharset(encoding, null);
-
+
root = getPackageFragmentRoot("Encoding2", "testShiftJIS.jar");
sourceRef = root.getPackageFragment("testShiftJIS").getClassFile("A.class");
assertNotNull(sourceRef);
@@ -1310,7 +1310,7 @@ public class EncodingTests extends ModifyingResourceTests {
this.encodingProject.setDefaultCharset(oldEncoding, null);
deleteProject("Encoding2");
getWorkspaceRoot().setDefaultCharset(wkspEncoding, null);
- }
+ }
}
public void testBug361356a() throws Exception {
String oldEncoding = this.encodingProject.getDefaultCharset();
@@ -1322,13 +1322,13 @@ public class EncodingTests extends ModifyingResourceTests {
IJavaProject project = this.createJavaProject("Encoding2", new String[] {""}, "");
IFile zipFile = (IFile) this.encodingProject.findMember("testShiftJIS.zip"); //$NON-NLS-1$
IFile sourceFile = (IFile) this.encodingProject.findMember("src/testShiftJIS/A.java");
-
+
IClasspathEntry[] entries = this.encodingJavaProject.getRawClasspath();
IClasspathEntry newEntry = null;
for (int index = 0; index < entries.length; index++) {
IClasspathEntry entry = entries[index];
if (entry.getPath().toOSString().endsWith("testShiftJIS.jar")) {
- newEntry = entries[index];
+ newEntry = entries[index];
}
}
@@ -1336,7 +1336,7 @@ public class EncodingTests extends ModifyingResourceTests {
attribute = JavaCore.newClasspathAttribute(IClasspathAttribute.SOURCE_ATTACHMENT_ENCODING, encoding);
project.setRawClasspath(new IClasspathEntry[]{JavaCore.newLibraryEntry(newEntry.getPath(), new Path("/Encoding/testShiftJIS.zip"), null, null, new IClasspathAttribute[]{attribute}, false)}, null);
zipFile.setCharset(null, null);
-
+
IPackageFragmentRoot root = getPackageFragmentRoot("Encoding2", "testShiftJIS.jar");
ISourceReference sourceRef = root.getPackageFragment("testShiftJIS").getClassFile("A.class");
assertNotNull(sourceRef);
@@ -1352,7 +1352,7 @@ public class EncodingTests extends ModifyingResourceTests {
attribute = JavaCore.newClasspathAttribute(IClasspathAttribute.SOURCE_ATTACHMENT_ENCODING, "UTF-8");
project.setRawClasspath(new IClasspathEntry[]{JavaCore.newLibraryEntry(newEntry.getPath(), new Path("/Encoding/testShiftJIS.zip"), null, null, new IClasspathAttribute[]{attribute}, false)}, null);
zipFile.setCharset(encoding, null);
-
+
root = getPackageFragmentRoot("Encoding2", "testShiftJIS.jar");
sourceRef = root.getPackageFragment("testShiftJIS").getClassFile("A.class");
assertNotNull(sourceRef);
@@ -1369,7 +1369,7 @@ public class EncodingTests extends ModifyingResourceTests {
this.encodingProject.setDefaultCharset(oldEncoding, null);
deleteProject("Encoding2");
getWorkspaceRoot().setDefaultCharset(wkspEncoding, null);
- }
+ }
}
public void testBug361356b() throws Exception {
String oldEncoding = this.encodingProject.getDefaultCharset();
@@ -1382,7 +1382,7 @@ public class EncodingTests extends ModifyingResourceTests {
this.encodingProject.setDefaultCharset("UTF-8", null);
IJavaProject project = this.createJavaProject("Encoding2", new String[] {""}, "");
IFile sourceFile = (IFile) this.encodingProject.findMember("src/testShiftJIS/A.java");
-
+
File internalSourceZip = new File(getWorkspacePath(), "/Encoding/testShiftJIS.zip");
externalSourceZip = new File(getExternalPath(), "testShiftJIS.zip");
File internalSource = new File(getWorkspacePath(), "/Encoding/src");
@@ -1390,20 +1390,20 @@ public class EncodingTests extends ModifyingResourceTests {
copyDirectory(internalSource, externalSource);
copy(internalSourceZip, externalSourceZip);
-
+
IClasspathEntry[] entries = this.encodingJavaProject.getRawClasspath();
IClasspathEntry newEntry = null;
for (int index = 0; index < entries.length; index++) {
IClasspathEntry entry = entries[index];
if (entry.getPath().toOSString().endsWith("testShiftJIS.jar")) {
- newEntry = entries[index];
+ newEntry = entries[index];
}
}
IClasspathAttribute attribute = JavaCore.newClasspathAttribute(IClasspathAttribute.SOURCE_ATTACHMENT_ENCODING, encoding);
attribute = JavaCore.newClasspathAttribute(IClasspathAttribute.SOURCE_ATTACHMENT_ENCODING, encoding);
project.setRawClasspath(new IClasspathEntry[]{JavaCore.newLibraryEntry(newEntry.getPath(), new Path(getExternalResourcePath("testShiftJIS.zip")), null, null, new IClasspathAttribute[]{attribute}, false)}, null);
-
+
IPackageFragmentRoot root = getPackageFragmentRoot("Encoding2", "testShiftJIS.jar");
ISourceReference sourceRef = root.getPackageFragment("testShiftJIS").getClassFile("A.class");
assertNotNull(sourceRef);
@@ -1418,7 +1418,7 @@ public class EncodingTests extends ModifyingResourceTests {
attribute = JavaCore.newClasspathAttribute(IClasspathAttribute.SOURCE_ATTACHMENT_ENCODING, "UTF-8");
project.setRawClasspath(new IClasspathEntry[]{JavaCore.newLibraryEntry(newEntry.getPath(), new Path(getExternalResourcePath("testShiftJIS.zip")), null, null, new IClasspathAttribute[]{attribute}, false)}, null);
-
+
root = getPackageFragmentRoot("Encoding2", "testShiftJIS.jar");
sourceRef = root.getPackageFragment("testShiftJIS").getClassFile("A.class");
assertNotNull(sourceRef);
@@ -1430,11 +1430,11 @@ public class EncodingTests extends ModifyingResourceTests {
charArray = source.toCharArray();
source = new String(CharOperation.remove(charArray, '\r'));
assertFalse("Sources should not be decoded the same way", encodedContents.equals(source));
-
+
attribute = JavaCore.newClasspathAttribute(IClasspathAttribute.SOURCE_ATTACHMENT_ENCODING, encoding);
project.setRawClasspath(new IClasspathEntry[]{JavaCore.newLibraryEntry(newEntry.getPath(), new Path(getExternalResourcePath("testShiftJIS")), null, null, new IClasspathAttribute[]{attribute}, false)}, null);
sourceFile.setCharset(null, null);
-
+
root = getPackageFragmentRoot("Encoding2", "testShiftJIS.jar");
sourceRef = root.getPackageFragment("testShiftJIS").getClassFile("A.class");
assertNotNull(sourceRef);
@@ -1450,7 +1450,7 @@ public class EncodingTests extends ModifyingResourceTests {
attribute = JavaCore.newClasspathAttribute(IClasspathAttribute.SOURCE_ATTACHMENT_ENCODING, "UTF-8");
project.setRawClasspath(new IClasspathEntry[]{JavaCore.newLibraryEntry(newEntry.getPath(), new Path(getExternalResourcePath("testShiftJIS")), null, null, new IClasspathAttribute[]{attribute}, false)}, null);
sourceFile.setCharset(encoding, null);
-
+
root = getPackageFragmentRoot("Encoding2", "testShiftJIS.jar");
sourceRef = root.getPackageFragment("testShiftJIS").getClassFile("A.class");
assertNotNull(sourceRef);
@@ -1469,7 +1469,7 @@ public class EncodingTests extends ModifyingResourceTests {
this.encodingProject.setDefaultCharset(oldEncoding, null);
deleteProject("Encoding2");
getWorkspaceRoot().setDefaultCharset(wkspEncoding, null);
- }
+ }
}
private void verifyUtf8BOM(IFile file) throws CoreException {
assertNull("File should not have any explicit charset", file.getCharset(false));
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ExternalAnnotations17Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ExternalAnnotations17Test.java
index 82183a236..3a619130b 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ExternalAnnotations17Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ExternalAnnotations17Test.java
@@ -49,7 +49,7 @@ public class ExternalAnnotations17Test extends ExternalAnnotations18Test {
public ExternalAnnotations17Test(String name) {
super(name, "1.7", "JCL17_LIB");
}
-
+
// Use this static initializer to specify subset for tests
// All specified tests which do not belong to the class are skipped...
static {
@@ -76,7 +76,7 @@ public class ExternalAnnotations17Test extends ExternalAnnotations18Test {
protected Bundle[] getAnnotationBundles() {
return org.eclipse.jdt.core.tests.Activator.getPackageAdmin().getBundles("org.eclipse.jdt.annotation", "[1.1.0,2.0.0)");
}
-
+
public String getSourceWorkspacePath() {
// we read individual projects from within this folder:
return super.getSourceWorkspacePathBase()+"/ExternalAnnotations17";
@@ -92,7 +92,7 @@ public class ExternalAnnotations17Test extends ExternalAnnotations18Test {
this.project.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = this.project.getProject().findMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, false, IResource.DEPTH_INFINITE);
sortMarkers(markers);
- assertMarkers("Unexpected markers",
+ assertMarkers("Unexpected markers",
"Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
"Null type mismatch: required \'@NonNull Test1\' but the provided value is null\n" +
"Potential null pointer access: The variable v may be null at this location",
@@ -112,7 +112,7 @@ public class ExternalAnnotations17Test extends ExternalAnnotations18Test {
this.project.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = this.project.getProject().findMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, false, IResource.DEPTH_INFINITE);
sortMarkers(markers);
- assertMarkers("Unexpected markers",
+ assertMarkers("Unexpected markers",
"Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
"Null type mismatch: required \'@NonNull Test1\' but the provided value is null\n" +
"Potential null pointer access: The variable v may be null at this location",
@@ -127,37 +127,37 @@ public class ExternalAnnotations17Test extends ExternalAnnotations18Test {
myCreateJavaProject("TestLibs");
addLibraryWithExternalAnnotations(this.project, "lib1.jar", "/TestLibs", new String[] {
"/UnannotatedLib/libs/Lib1.java",
- "package libs;\n" +
+ "package libs;\n" +
"\n" +
- "public interface Lib1 {\n" +
- " String one = \"1\";\n" +
- " String none = null;\n" +
+ "public interface Lib1 {\n" +
+ " String one = \"1\";\n" +
+ " String none = null;\n" +
"}\n"
}, null);
- createFileInProject("libs", "Lib1.eea",
+ createFileInProject("libs", "Lib1.eea",
"class libs/Lib1\n" +
- "\n" +
- "one\n" +
- " Ljava/lang/String;\n" +
- " L1java/lang/String;\n" +
- "\n" +
- "none\n" +
+ "\n" +
+ "one\n" +
+ " Ljava/lang/String;\n" +
+ " L1java/lang/String;\n" +
+ "\n" +
+ "none\n" +
" Ljava/lang/String;\n" +
" L0java/lang/String;\n" +
"\n");
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
- ICompilationUnit unit = fragment.createCompilationUnit("Test1.java",
- "package tests;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "import libs.Lib1;\n" +
- "\n" +
- "public class Test1 {\n" +
- " @NonNull String test0() {\n" +
- " return Lib1.none;\n" +
+ ICompilationUnit unit = fragment.createCompilationUnit("Test1.java",
+ "package tests;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "import libs.Lib1;\n" +
+ "\n" +
+ "public class Test1 {\n" +
+ " @NonNull String test0() {\n" +
+ " return Lib1.none;\n" +
" }\n" +
- " @NonNull String test1() {\n" +
- " return Lib1.one;\n" +
+ " @NonNull String test1() {\n" +
+ " return Lib1.one;\n" +
" }\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
@@ -175,21 +175,21 @@ public class ExternalAnnotations17Test extends ExternalAnnotations18Test {
myCreateJavaProject("TestLibs1");
addLibraryWithExternalAnnotations(this.project, "lib1.jar", "/TestLibs1", new String[] {
"/UnannotatedLib/libs/Lib1.java",
- "package libs;\n" +
+ "package libs;\n" +
"\n" +
- "public class Lib1 {\n" +
+ "public class Lib1 {\n" +
" public static String one = \"1\";\n" + // not final!
- " public static String none = null;\n" +
+ " public static String none = null;\n" +
"}\n"
}, null);
- createFileInProject("libs", "Lib1.eea",
+ createFileInProject("libs", "Lib1.eea",
"class libs/Lib1\n" +
- "\n" +
- "one\n" +
- " Ljava/lang/String;\n" +
- " L1java/lang/String;\n" +
- "\n" +
- "none\n" +
+ "\n" +
+ "one\n" +
+ " Ljava/lang/String;\n" +
+ " L1java/lang/String;\n" +
+ "\n" +
+ "none\n" +
" Ljava/lang/String;\n" +
" L0java/lang/String;\n" +
"\n");
@@ -205,17 +205,17 @@ public class ExternalAnnotations17Test extends ExternalAnnotations18Test {
// test project #1:
ICompilationUnit unit = fragment1.createCompilationUnit("Test1.java",
- "package tests;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "import libs.Lib1;\n" +
- "\n" +
- "public class Test1 {\n" +
- " @NonNull String test0() {\n" +
- " return Lib1.none;\n" +
+ "package tests;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "import libs.Lib1;\n" +
+ "\n" +
+ "public class Test1 {\n" +
+ " @NonNull String test0() {\n" +
+ " return Lib1.none;\n" +
" }\n" +
- " @NonNull String test1() {\n" +
- " return Lib1.one;\n" +
+ " @NonNull String test1() {\n" +
+ " return Lib1.one;\n" +
" }\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
@@ -227,17 +227,17 @@ public class ExternalAnnotations17Test extends ExternalAnnotations18Test {
// test project #2:
unit = fragment2.createCompilationUnit("Test1.java",
- "package tests;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "import libs.Lib1;\n" +
- "\n" +
- "public class Test1 {\n" +
- " @NonNull String test0() {\n" +
- " return Lib1.none;\n" +
+ "package tests;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "import libs.Lib1;\n" +
+ "\n" +
+ "public class Test1 {\n" +
+ " @NonNull String test0() {\n" +
+ " return Lib1.none;\n" +
" }\n" +
- " @NonNull String test1() {\n" +
- " return Lib1.one;\n" +
+ " @NonNull String test1() {\n" +
+ " return Lib1.one;\n" +
" }\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
@@ -261,21 +261,21 @@ public class ExternalAnnotations17Test extends ExternalAnnotations18Test {
myCreateJavaProject("TestLibs1");
addLibraryWithExternalAnnotations(this.project, "lib1.jar", "/TestLibs1", new String[] {
"/UnannotatedLib/libs/Lib1.java",
- "package libs;\n" +
+ "package libs;\n" +
"\n" +
- "public class Lib1 {\n" +
- " public static String one = \"1\";\n" + // not final!
- " public static String none = null;\n" +
+ "public class Lib1 {\n" +
+ " public static String one = \"1\";\n" + // not final!
+ " public static String none = null;\n" +
"}\n"
}, null);
- createFileInProject("libs", "Lib1.eea",
+ createFileInProject("libs", "Lib1.eea",
"class libs/Lib1\n" +
- "\n" +
- "one\n" +
- " Ljava/lang/String;\n" +
- " L1java/lang/String;\n" +
- "\n" +
- "none\n" +
+ "\n" +
+ "one\n" +
+ " Ljava/lang/String;\n" +
+ " L1java/lang/String;\n" +
+ "\n" +
+ "none\n" +
" Ljava/lang/String;\n" +
" L0java/lang/String;\n" +
"\n");
@@ -290,18 +290,18 @@ public class ExternalAnnotations17Test extends ExternalAnnotations18Test {
IPackageFragment fragment2 = prj2.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
// test project #2:
- ICompilationUnit unit = fragment2.createCompilationUnit("Test1.java",
- "package tests;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "import libs.Lib1;\n" +
- "\n" +
- "public class Test1 {\n" +
- " @NonNull String test0() {\n" +
- " return Lib1.none;\n" +
+ ICompilationUnit unit = fragment2.createCompilationUnit("Test1.java",
+ "package tests;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "import libs.Lib1;\n" +
+ "\n" +
+ "public class Test1 {\n" +
+ " @NonNull String test0() {\n" +
+ " return Lib1.none;\n" +
" }\n" +
- " @NonNull String test1() {\n" +
- " return Lib1.one;\n" +
+ " @NonNull String test1() {\n" +
+ " return Lib1.one;\n" +
" }\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
@@ -315,17 +315,17 @@ public class ExternalAnnotations17Test extends ExternalAnnotations18Test {
// test project #1:
unit = fragment1.createCompilationUnit("Test1.java",
- "package tests;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "import libs.Lib1;\n" +
- "\n" +
- "public class Test1 {\n" +
- " @NonNull String test0() {\n" +
- " return Lib1.none;\n" +
+ "package tests;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "import libs.Lib1;\n" +
+ "\n" +
+ "public class Test1 {\n" +
+ " @NonNull String test0() {\n" +
+ " return Lib1.none;\n" +
" }\n" +
- " @NonNull String test1() {\n" +
- " return Lib1.one;\n" +
+ " @NonNull String test1() {\n" +
+ " return Lib1.one;\n" +
" }\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
@@ -357,7 +357,7 @@ public class ExternalAnnotations17Test extends ExternalAnnotations18Test {
"Pb(910) Null type mismatch: required \'@NonNull Test1\' but the provided value is null",
"Pb(910) Null type mismatch: required \'@NonNull Object\' but the provided value is null",
"Pb(452) Potential null pointer access: The variable v may be null at this location"
- },
+ },
new int[]{ 7, 8, 9});
}
@@ -365,37 +365,37 @@ public class ExternalAnnotations17Test extends ExternalAnnotations18Test {
myCreateJavaProject("TestLibs");
addLibraryWithExternalAnnotations(this.project, "lib1.jar", "annots", new String[] {
"/UnannotatedLib/libs/Lib1.java",
- "package libs;\n" +
+ "package libs;\n" +
"\n" +
- "public interface Lib1 {\n" +
- " String one = \"1\";\n" +
- " String none = null;\n" +
+ "public interface Lib1 {\n" +
+ " String one = \"1\";\n" +
+ " String none = null;\n" +
"}\n"
}, null);
- createFileInProject("annots/libs", "Lib1.eea",
+ createFileInProject("annots/libs", "Lib1.eea",
"class libs/Lib1\n" +
- "\n" +
- "one\n" +
- " Ljava/lang/String;\n" +
- " L1java/lang/String;\n" +
- "\n" +
- "none\n" +
+ "\n" +
+ "one\n" +
+ " Ljava/lang/String;\n" +
+ " L1java/lang/String;\n" +
+ "\n" +
+ "none\n" +
" Ljava/lang/String;\n" +
" L0java/lang/String;\n" +
"\n");
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
- ICompilationUnit unit = fragment.createCompilationUnit("Test1.java",
- "package tests;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "import libs.Lib1;\n" +
- "\n" +
- "public class Test1 {\n" +
- " @NonNull String test0() {\n" +
- " return Lib1.none;\n" +
+ ICompilationUnit unit = fragment.createCompilationUnit("Test1.java",
+ "package tests;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "import libs.Lib1;\n" +
+ "\n" +
+ "public class Test1 {\n" +
+ " @NonNull String test0() {\n" +
+ " return Lib1.none;\n" +
" }\n" +
- " @NonNull String test1() {\n" +
- " return Lib1.one;\n" +
+ " @NonNull String test1() {\n" +
+ " return Lib1.one;\n" +
" }\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
@@ -412,25 +412,25 @@ public class ExternalAnnotations17Test extends ExternalAnnotations18Test {
myCreateJavaProject("TestLibs");
addLibraryWithExternalAnnotations(this.project, "lib1.jar", "annots", new String[] {
"/UnannotatedLib/libs/Lib1.java",
- "package libs;\n" +
+ "package libs;\n" +
"\n" +
"public interface Lib1 {\n" +
- " public static class Nested {\n" +
- " public static String one = \"1\";\n" +
- " }\n" +
+ " public static class Nested {\n" +
+ " public static String one = \"1\";\n" +
+ " }\n" +
"}\n"
}, null);
// acquire source AST:
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
- String test1Content = "package tests;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "import libs.Lib1;\n" +
- "\n" +
- "public class Test1 {\n" +
- " @NonNull String test0() {\n" +
- " return Lib1.Nested.one;\n" +
+ String test1Content = "package tests;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "import libs.Lib1;\n" +
+ "\n" +
+ "public class Test1 {\n" +
+ " @NonNull String test0() {\n" +
+ " return Lib1.Nested.one;\n" +
" }\n" +
"}\n";
ICompilationUnit cu = fragment.createCompilationUnit("Test1.java", test1Content,
@@ -445,13 +445,13 @@ public class ExternalAnnotations17Test extends ExternalAnnotations18Test {
assertProblems(problems, new String[] {
"Pb(912) Null type safety: The expression of type 'String' needs unchecked conversion to conform to '@NonNull String'",
}, new int[] { 8 });
-
+
// find type binding:
int start = test1Content.indexOf("one");
ASTNode name = NodeFinder.perform(unit, start, 0);
assertTrue("should be simple name", name.getNodeType() == ASTNode.SIMPLE_NAME);
IVariableBinding fieldBinding = (IVariableBinding) ((SimpleName)name).resolveBinding();
-
+
// find annotation file (not yet existing):
IFile annotationFile = ExternalAnnotationUtil.getAnnotationFile(this.project, fieldBinding.getDeclaringClass(), null);
assertFalse("file should not exist", annotationFile.exists());
@@ -468,7 +468,7 @@ public class ExternalAnnotations17Test extends ExternalAnnotations18Test {
// check that the error is gone:
CompilationUnit reconciled = cu.reconcile(getJLS8(), true, null, new NullProgressMonitor());
- assertNoProblems(reconciled.getProblems());
+ assertNoProblems(reconciled.getProblems());
}
@@ -476,7 +476,7 @@ public class ExternalAnnotations17Test extends ExternalAnnotations18Test {
myCreateJavaProject("TestLibs");
addLibraryWithExternalAnnotations(this.project, "lib1.jar", "annots", new String[] {
"/UnannotatedLib/libs/Lib1.java",
- "package libs;\n" +
+ "package libs;\n" +
"\n" +
"public class Lib1<T> {\n" +
" public Lib1<T> one;\n" +
@@ -485,14 +485,14 @@ public class ExternalAnnotations17Test extends ExternalAnnotations18Test {
// acquire source AST:
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
- String test1Content = "package tests;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "import libs.Lib1;\n" +
- "\n" +
- "public class Test1 {\n" +
- " @NonNull Lib1<String> test0(Lib1<String> stringLib) {\n" +
- " return stringLib.one;\n" +
+ String test1Content = "package tests;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "import libs.Lib1;\n" +
+ "\n" +
+ "public class Test1 {\n" +
+ " @NonNull Lib1<String> test0(Lib1<String> stringLib) {\n" +
+ " return stringLib.one;\n" +
" }\n" +
"}\n";
ICompilationUnit cu = fragment.createCompilationUnit("Test1.java", test1Content,
@@ -507,13 +507,13 @@ public class ExternalAnnotations17Test extends ExternalAnnotations18Test {
assertProblems(problems, new String[] {
"Pb(912) Null type safety: The expression of type 'Lib1<String>' needs unchecked conversion to conform to '@NonNull Lib1<String>'",
}, new int[] { 8 });
-
+
// find type binding:
int start = test1Content.indexOf("one");
ASTNode name = NodeFinder.perform(unit, start, 0);
assertTrue("should be simple name", name.getNodeType() == ASTNode.SIMPLE_NAME);
IVariableBinding fieldBinding = (IVariableBinding) ((SimpleName)name).resolveBinding();
-
+
// find annotation file (not yet existing):
IFile annotationFile = ExternalAnnotationUtil.getAnnotationFile(this.project, fieldBinding.getDeclaringClass(), null);
assertFalse("file should not exist", annotationFile.exists());
@@ -522,9 +522,9 @@ public class ExternalAnnotations17Test extends ExternalAnnotations18Test {
// annotate:
String originalSignature = ExternalAnnotationUtil.extractGenericTypeSignature(fieldBinding.getVariableDeclaration().getType());
ExternalAnnotationUtil.annotateMember("libs/Lib1", annotationFile,
- "one",
- originalSignature,
- "L0libs/Lib1<TT;>;",
+ "one",
+ originalSignature,
+ "L0libs/Lib1<TT;>;",
MergeStrategy.OVERWRITE_ANNOTATIONS, null);
assertTrue("file should exist", annotationFile.exists());
@@ -538,8 +538,8 @@ public class ExternalAnnotations17Test extends ExternalAnnotations18Test {
public void testAnnotateMethodReturn() throws Exception {
myCreateJavaProject("TestLibs");
- String lib1Content =
- "package libs;\n" +
+ String lib1Content =
+ "package libs;\n" +
"\n" +
"public interface Lib1<T> {\n" +
" public Lib1<T> getLib();\n" +
@@ -552,14 +552,14 @@ public class ExternalAnnotations17Test extends ExternalAnnotations18Test {
// type check sources:
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
ICompilationUnit cu = fragment.createCompilationUnit("Test1.java",
- "package tests;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "import libs.Lib1;\n" +
- "\n" +
- "public class Test1 {\n" +
- " @NonNull Lib1<String> test0(Lib1<String> stringLib) {\n" +
- " return stringLib.getLib();\n" +
+ "package tests;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "import libs.Lib1;\n" +
+ "\n" +
+ "public class Test1 {\n" +
+ " @NonNull Lib1<String> test0(Lib1<String> stringLib) {\n" +
+ " return stringLib.getLib();\n" +
" }\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
@@ -579,14 +579,14 @@ public class ExternalAnnotations17Test extends ExternalAnnotations18Test {
parser.setBindingsRecovery(false);
CompilationUnit unit = (CompilationUnit) parser.createAST(null);
libWorkingCopy.discardWorkingCopy();
-
+
// find method binding:
int start = lib1Content.indexOf("getLib");
ASTNode name = NodeFinder.perform(unit, start, 0);
assertTrue("should be simple name", name.getNodeType() == ASTNode.SIMPLE_NAME);
ASTNode method = name.getParent();
IMethodBinding methodBinding = ((MethodDeclaration)method).resolveBinding();
-
+
// find annotation file (not yet existing):
IFile annotationFile = ExternalAnnotationUtil.getAnnotationFile(this.project, methodBinding.getDeclaringClass(), null);
assertFalse("file should not exist", annotationFile.exists());
@@ -595,9 +595,9 @@ public class ExternalAnnotations17Test extends ExternalAnnotations18Test {
// annotate:
String originalSignature = ExternalAnnotationUtil.extractGenericSignature(methodBinding);
ExternalAnnotationUtil.annotateMember("libs/Lib1", annotationFile,
- "getLib",
- originalSignature,
- "()L1libs/Lib1<TT;>;",
+ "getLib",
+ originalSignature,
+ "()L1libs/Lib1<TT;>;",
MergeStrategy.OVERWRITE_ANNOTATIONS, null);
assertTrue("file should exist", annotationFile.exists());
@@ -607,7 +607,7 @@ public class ExternalAnnotations17Test extends ExternalAnnotations18Test {
}
// ==== error scenarii: ====
-
+
// annotation file is empty
public void testBogusAnnotationFile1() throws Exception {
LogListener listener = new LogListener();
@@ -615,8 +615,8 @@ public class ExternalAnnotations17Test extends ExternalAnnotations18Test {
Platform.addLogListener(listener);
myCreateJavaProject("TestLibs");
- String lib1Content =
- "package libs;\n" +
+ String lib1Content =
+ "package libs;\n" +
"\n" +
"public interface Lib1<T> {\n" +
" public Lib1<T> getLib();\n" +
@@ -625,20 +625,20 @@ public class ExternalAnnotations17Test extends ExternalAnnotations18Test {
"/UnannotatedLib/libs/Lib1.java",
lib1Content
}, null);
- createFileInProject("annots/libs", "Lib1.eea",
+ createFileInProject("annots/libs", "Lib1.eea",
"");
-
+
// type check sources:
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
ICompilationUnit cu = fragment.createCompilationUnit("Test1.java",
- "package tests;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "import libs.Lib1;\n" +
- "\n" +
- "public class Test1 {\n" +
- " @NonNull Lib1<String> test0(Lib1<String> stringLib) {\n" +
- " return stringLib.getLib();\n" +
+ "package tests;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "import libs.Lib1;\n" +
+ "\n" +
+ "public class Test1 {\n" +
+ " @NonNull Lib1<String> test0(Lib1<String> stringLib) {\n" +
+ " return stringLib.getLib();\n" +
" }\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
@@ -647,7 +647,7 @@ public class ExternalAnnotations17Test extends ExternalAnnotations18Test {
assertProblems(problems, new String[] {
"Pb(912) Null type safety: The expression of type 'Lib1<String>' needs unchecked conversion to conform to '@NonNull Lib1<String>'",
}, new int[] { 8 });
-
+
assertEquals("number of log entries", 1, listener.loggedStatus.size());
final Throwable exception = listener.loggedStatus.get(0).getException();
assertEquals("logged message", "missing class header in annotation file for libs/Lib1", exception.getMessage());
@@ -663,8 +663,8 @@ public class ExternalAnnotations17Test extends ExternalAnnotations18Test {
Platform.addLogListener(listener);
myCreateJavaProject("TestLibs");
- String lib1Content =
- "package libs;\n" +
+ String lib1Content =
+ "package libs;\n" +
"\n" +
"public interface Lib1<T> {\n" +
" public Lib1<T> getLib();\n" +
@@ -673,20 +673,20 @@ public class ExternalAnnotations17Test extends ExternalAnnotations18Test {
"/UnannotatedLib/libs/Lib1.java",
lib1Content
}, null);
- createFileInProject("annots/libs", "Lib1.eea",
+ createFileInProject("annots/libs", "Lib1.eea",
"type Lib1\n");
-
+
// type check sources:
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
ICompilationUnit cu = fragment.createCompilationUnit("Test1.java",
- "package tests;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "import libs.Lib1;\n" +
- "\n" +
- "public class Test1 {\n" +
- " @NonNull Lib1<String> test0(Lib1<String> stringLib) {\n" +
- " return stringLib.getLib();\n" +
+ "package tests;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "import libs.Lib1;\n" +
+ "\n" +
+ "public class Test1 {\n" +
+ " @NonNull Lib1<String> test0(Lib1<String> stringLib) {\n" +
+ " return stringLib.getLib();\n" +
" }\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ExternalAnnotations18Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ExternalAnnotations18Test.java
index a4f0234b0..36b24d82c 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ExternalAnnotations18Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ExternalAnnotations18Test.java
@@ -77,10 +77,10 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
/** Use this container name in test projects. */
private static final String TEST_CONTAINER_NAME = "org.eclipse.jdt.core.tests.model.TEST_CONTAINER";
-
+
/** Simulate workspace-settings for rt.jar. */
public static String RT_JAR_ANNOTATION_PATH = null;
-
+
static class TestContainer implements IClasspathContainer {
IPath path;
IClasspathEntry[] entries;
@@ -116,7 +116,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
return false;
}
}
-
+
static class LogListener implements ILogListener {
List<IStatus> loggedStatus = new ArrayList<>();
public void logging(IStatus status, String plugin) {
@@ -131,19 +131,19 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
protected final String compliance;
protected final String jclLib;
- protected static final String MY_MAP_CONTENT =
- "package libs;\n" +
- "\n" +
- "public interface MyMap<K,V> {\n" +
- " V get(Object key);\n" +
- " V put(K key, V val);\n" +
- " V remove(Object key);\n" +
+ protected static final String MY_MAP_CONTENT =
+ "package libs;\n" +
+ "\n" +
+ "public interface MyMap<K,V> {\n" +
+ " V get(Object key);\n" +
+ " V put(K key, V val);\n" +
+ " V remove(Object key);\n" +
"}\n";
public ExternalAnnotations18Test(String name) {
this(name, "1.8", "JCL18_LIB");
}
-
+
protected ExternalAnnotations18Test(String name, String compliance, String jclLib) {
super(name);
this.compliance = compliance;
@@ -165,7 +165,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
public void setUpSuite() throws Exception {
super.setUpSuite();
-
+
Bundle[] bundles = getAnnotationBundles();
File bundleFile = FileLocator.getBundleFile(bundles[0]);
this.ANNOTATION_LIB = bundleFile.isDirectory() ? bundleFile.getPath()+"/bin" : bundleFile.getPath();
@@ -196,7 +196,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
super.tearDownSuite();
ContainerInitializer.setInitializer(null);
}
-
+
public String getSourceWorkspacePath() {
// we read individual projects from within this folder:
return super.getSourceWorkspacePath()+"/ExternalAnnotations18";
@@ -234,7 +234,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
assertEquals("Wrong value", 1, count); //$NON-NLS-1$
assertNotNull("Should not be null", this.root); //$NON-NLS-1$
}
-
+
void myCreateJavaProject(String name) throws CoreException {
this.project = createJavaProject(name, new String[]{"src"}, new String[]{this.jclLib}, null, null, "bin", null, null, null, this.compliance);
addLibraryEntry(this.project, this.ANNOTATION_LIB, false);
@@ -257,7 +257,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
assertEquals("Wrong value", 1, count); //$NON-NLS-1$
assertNotNull("Should not be null", this.root); //$NON-NLS-1$
}
-
+
protected void tearDown() throws Exception {
if (this.project != null)
this.project.getProject().delete(true, true, null);
@@ -298,7 +298,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
entry.getSourceAttachmentRootPath(),
entry.getAccessRules(),
new IClasspathAttribute[] {
- new ClasspathAttribute(IClasspathAttribute.EXTERNAL_ANNOTATION_PATH, annotationPath)
+ new ClasspathAttribute(IClasspathAttribute.EXTERNAL_ANNOTATION_PATH, annotationPath)
},
entry.isExported());
found = true;
@@ -320,7 +320,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
System.err.println("Unexpected marker: "+markers[i].getAttributes().entrySet());
assertEquals("Number of markers", 0, markers.length);
}
-
+
protected void assertNoProblems(IProblem[] problems) throws CoreException {
for (int i = 0; i < problems.length; i++)
System.err.println("Unexpected marker: "+problems[i]);
@@ -362,19 +362,19 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
switch(severities[j] & ProblemSeverities.CoreSeverityMASK ) {
case ProblemSeverities.Error:
if (!problems[i].isError()) {
- System.err.println("Not an error as expected: "+messages[j]);
+ System.err.println("Not an error as expected: "+messages[j]);
continue;
}
break;
case ProblemSeverities.Warning:
if (!problems[i].isWarning()) {
- System.err.println("Not a warning as expected: "+messages[j]);
+ System.err.println("Not a warning as expected: "+messages[j]);
continue;
}
break;
case ProblemSeverities.Info:
if (!problems[i].isInfo()) {
- System.err.println("Not an info as expected: "+messages[j]);
+ System.err.println("Not an info as expected: "+messages[j]);
continue;
}
break;
@@ -460,33 +460,33 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
IProblem[] problems = reconciled.getProblems();
assertNoProblems(problems);
}
-
+
public void testLibs1() throws Exception {
myCreateJavaProject("TestLibs");
addLibraryWithExternalAnnotations(this.project, "lib1.jar", "annots", new String[] {
"/UnannotatedLib/libs/Lib1.java",
- "package libs;\n" +
- "\n" +
- "import java.util.Collection;\n" +
- "import java.util.Iterator;\n" +
- "\n" +
- "public interface Lib1 {\n" +
- " <T> Iterator<T> unconstrainedTypeArguments1(Collection<T> in);\n" +
- " Iterator<String> unconstrainedTypeArguments2(Collection<String> in);\n" +
- " <T> Iterator<? extends T> constrainedWildcards(Collection<? extends T> in);\n" +
- " <T extends Collection<?>> T constrainedTypeParameter(T in);\n" +
+ "package libs;\n" +
+ "\n" +
+ "import java.util.Collection;\n" +
+ "import java.util.Iterator;\n" +
+ "\n" +
+ "public interface Lib1 {\n" +
+ " <T> Iterator<T> unconstrainedTypeArguments1(Collection<T> in);\n" +
+ " Iterator<String> unconstrainedTypeArguments2(Collection<String> in);\n" +
+ " <T> Iterator<? extends T> constrainedWildcards(Collection<? extends T> in);\n" +
+ " <T extends Collection<?>> T constrainedTypeParameter(T in);\n" +
"}\n"
}, null);
// annotations on type variables & class type in various positions:
createFileInProject("annots/libs", "Lib1.eea",
- "class libs/Lib1\n" +
- "\n" +
- "unconstrainedTypeArguments1\n" +
- " <T:Ljava/lang/Object;>(Ljava/util/Collection<TT;>;)Ljava/util/Iterator<TT;>;\n" +
+ "class libs/Lib1\n" +
+ "\n" +
+ "unconstrainedTypeArguments1\n" +
+ " <T:Ljava/lang/Object;>(Ljava/util/Collection<TT;>;)Ljava/util/Iterator<TT;>;\n" +
" <T:Ljava/lang/Object;>(Ljava/util/Collection<T0T;>;)Ljava/util/Iterator<TT;>;\n" + // position: type argument
- "\n" +
- "unconstrainedTypeArguments2\n" +
- " (Ljava/util/Collection<Ljava/lang/String;>;)Ljava/util/Iterator<Ljava/lang/String;>;\n" +
+ "\n" +
+ "unconstrainedTypeArguments2\n" +
+ " (Ljava/util/Collection<Ljava/lang/String;>;)Ljava/util/Iterator<Ljava/lang/String;>;\n" +
" (Ljava/util/Collection<Ljava/lang/String;>;)Ljava/util/Iterator<L1java/lang/String;>;\n" + // position: type argument bound (class type)
"constrainedWildcards\n" +
" <T:Ljava/lang/Object;>(Ljava/util/Collection<+TT;>;)Ljava/util/Iterator<+TT;>;\n" +
@@ -495,28 +495,28 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
" <T::Ljava/util/Collection<*>;>(TT;)TT;\n" +
" <T::Ljava/util/Collection<*>;>(T0T;)T1T;\n"); // position: top-level type
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
- ICompilationUnit unit = fragment.createCompilationUnit("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" +
+ ICompilationUnit unit = fragment.createCompilationUnit("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" +
" }\n" +
" Iterator<? extends @NonNull String> test3(Lib1 lib, Collection<String> coll) {\n" +
" return lib.constrainedWildcards(coll);\n" +
" }\n" +
" @NonNull Collection<String> test4(Lib1 lib, @Nullable Collection<String> in) {\n" +
" return lib.constrainedTypeParameter(in);\n" +
- " }\n" +
+ " }\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
CompilationUnit reconciled = unit.reconcile(getJLS8(), true, null, new NullProgressMonitor());
@@ -528,61 +528,61 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
myCreateJavaProject("TestLibs");
addLibraryWithExternalAnnotations(this.project, "lib1.jar", "annots", new String[] {
"/UnannotatedLib/libs/Lib1.java",
- "package libs;\n" +
- "\n" +
- "import java.util.Collection;\n" +
- "import java.util.Iterator;\n" +
- "\n" +
- "public interface Lib1 {\n" +
- " Iterator<?> unconstrainedWildcard1(Collection<?> in);\n" +
- " Iterator<?> unconstrainedWildcard2(Collection<?> in);\n" +
- " Iterator<? extends CharSequence> constrainedWildcard1(Collection<? extends CharSequence> in);\n" +
- " Iterator<? super CharSequence> constrainedWildcard2(Collection<? super CharSequence> in);\n" +
+ "package libs;\n" +
+ "\n" +
+ "import java.util.Collection;\n" +
+ "import java.util.Iterator;\n" +
+ "\n" +
+ "public interface Lib1 {\n" +
+ " Iterator<?> unconstrainedWildcard1(Collection<?> in);\n" +
+ " Iterator<?> unconstrainedWildcard2(Collection<?> in);\n" +
+ " Iterator<? extends CharSequence> constrainedWildcard1(Collection<? extends CharSequence> in);\n" +
+ " Iterator<? super CharSequence> constrainedWildcard2(Collection<? super CharSequence> in);\n" +
"}\n"
}, null);
// annotations directly on a wildcard (*, +, -)
createFileInProject("annots/libs", "Lib1.eea",
- "class libs/Lib1\n" +
- "\n" +
- "unconstrainedWildcard1\n" +
- " (Ljava/util/Collection<*>;)Ljava/util/Iterator<*>;\n" +
+ "class libs/Lib1\n" +
+ "\n" +
+ "unconstrainedWildcard1\n" +
+ " (Ljava/util/Collection<*>;)Ljava/util/Iterator<*>;\n" +
" (Ljava/util/Collection<*>;)Ljava/util/Iterator<*1>;\n" +
- "\n" +
- "unconstrainedWildcard2\n" +
- " (Ljava/util/Collection<*>;)Ljava/util/Iterator<*>;\n" +
- " (Ljava/util/Collection<*>;)Ljava/util/Iterator<*0>;\n" +
- "\n" +
- "constrainedWildcard1\n" +
- " (Ljava/util/Collection<+Ljava/lang/CharSequence;>;)Ljava/util/Iterator<+Ljava/lang/CharSequence;>;\n" +
- " (Ljava/util/Collection<+Ljava/lang/CharSequence;>;)Ljava/util/Iterator<+0Ljava/lang/CharSequence;>;\n" +
- "\n" +
- "constrainedWildcard2\n" +
- " (Ljava/util/Collection<-Ljava/lang/CharSequence;>;)Ljava/util/Iterator<-Ljava/lang/CharSequence;>;\n" +
- " (Ljava/util/Collection<-Ljava/lang/CharSequence;>;)Ljava/util/Iterator<-0Ljava/lang/CharSequence;>;\n" +
- "\n" +
+ "\n" +
+ "unconstrainedWildcard2\n" +
+ " (Ljava/util/Collection<*>;)Ljava/util/Iterator<*>;\n" +
+ " (Ljava/util/Collection<*>;)Ljava/util/Iterator<*0>;\n" +
+ "\n" +
+ "constrainedWildcard1\n" +
+ " (Ljava/util/Collection<+Ljava/lang/CharSequence;>;)Ljava/util/Iterator<+Ljava/lang/CharSequence;>;\n" +
+ " (Ljava/util/Collection<+Ljava/lang/CharSequence;>;)Ljava/util/Iterator<+0Ljava/lang/CharSequence;>;\n" +
+ "\n" +
+ "constrainedWildcard2\n" +
+ " (Ljava/util/Collection<-Ljava/lang/CharSequence;>;)Ljava/util/Iterator<-Ljava/lang/CharSequence;>;\n" +
+ " (Ljava/util/Collection<-Ljava/lang/CharSequence;>;)Ljava/util/Iterator<-0Ljava/lang/CharSequence;>;\n" +
+ "\n" +
"\n");
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
- ICompilationUnit unit = fragment.createCompilationUnit("Test1.java",
- "package tests;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "import java.util.Collection;\n" +
- "\n" +
- "import libs.Lib1;\n" +
- "\n" +
- "public class Test1 {\n" +
- " @NonNull Object test1(Lib1 lib, Collection<@Nullable String> coll) {\n" +
+ ICompilationUnit unit = fragment.createCompilationUnit("Test1.java",
+ "package tests;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "import java.util.Collection;\n" +
+ "\n" +
+ "import libs.Lib1;\n" +
+ "\n" +
+ "public class Test1 {\n" +
+ " @NonNull Object test1(Lib1 lib, Collection<@Nullable String> coll) {\n" +
" return lib.unconstrainedWildcard1(coll).next();\n" + // OK
- " }\n" +
- " @NonNull Object test2(Lib1 lib, Collection<@Nullable String> coll) {\n" +
+ " }\n" +
+ " @NonNull Object test2(Lib1 lib, Collection<@Nullable String> coll) {\n" +
" return lib.unconstrainedWildcard2(coll).next();\n" + // return is nullable -> error
- " }\n" +
- " @NonNull CharSequence test3(Lib1 lib, Collection<@Nullable String> coll) {\n" +
+ " }\n" +
+ " @NonNull CharSequence test3(Lib1 lib, Collection<@Nullable String> coll) {\n" +
" return lib.constrainedWildcard1(coll).next();\n" + // '@Nullable ? extends CharSequence' -> error
- " }\n" +
- " @NonNull Object test4(Lib1 lib, Collection<@Nullable CharSequence> coll) {\n" +
+ " }\n" +
+ " @NonNull Object test4(Lib1 lib, Collection<@Nullable CharSequence> coll) {\n" +
" return lib.constrainedWildcard2(coll).next();\n" + // return is '@Nullable ? super CharSequence' -> error
- " }\n" +
+ " }\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
CompilationUnit reconciled = unit.reconcile(getJLS8(), true, null, new NullProgressMonitor());
@@ -594,30 +594,30 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
"Pb(953) Null type mismatch (type annotations): required '@NonNull Object' but this expression has type '@Nullable capture#of ? super CharSequence'"
}, new int[] { 10, 13, 16, 19 });
}
-
+
public void testLibsWithArrays() throws Exception {
myCreateJavaProject("TestLibs");
addLibraryWithExternalAnnotations(this.project, "lib1.jar", "annots", new String[] {
"/UnannotatedLib/libs/Lib1.java",
- "package libs;\n" +
- "\n" +
- "import java.util.Collection;\n" +
- "import java.util.Iterator;\n" +
- "\n" +
- "public interface Lib1 {\n" +
- " String[] constraintArrayTop(String[] in);\n" +
- " String[] constraintArrayFull(String[] in);\n" +
- " String[][] constraintDeep(String[][] in);\n" +
+ "package libs;\n" +
+ "\n" +
+ "import java.util.Collection;\n" +
+ "import java.util.Iterator;\n" +
+ "\n" +
+ "public interface Lib1 {\n" +
+ " String[] constraintArrayTop(String[] in);\n" +
+ " String[] constraintArrayFull(String[] in);\n" +
+ " String[][] constraintDeep(String[][] in);\n" +
"}\n"
}, null);
- createFileInProject("annots/libs", "Lib1.eea",
- "class libs/Lib1\n" +
- "\n" +
- "constraintArrayTop\n" +
- " ([Ljava/lang/String;)[Ljava/lang/String;\n" +
- " ([0Ljava/lang/String;)[1Ljava/lang/String;\n" +
- "\n" +
- "constraintArrayFull\n" +
+ createFileInProject("annots/libs", "Lib1.eea",
+ "class libs/Lib1\n" +
+ "\n" +
+ "constraintArrayTop\n" +
+ " ([Ljava/lang/String;)[Ljava/lang/String;\n" +
+ " ([0Ljava/lang/String;)[1Ljava/lang/String;\n" +
+ "\n" +
+ "constraintArrayFull\n" +
" ([Ljava/lang/String;)[Ljava/lang/String;\n" +
" ([0L0java/lang/String;)[1L1java/lang/String;\n" +
"\n" +
@@ -625,25 +625,25 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
" ([[Ljava/lang/String;)[[Ljava/lang/String;\n" +
" ([0[1L0java/lang/String;)[1[0L1java/lang/String;\n");
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
- ICompilationUnit unit = fragment.createCompilationUnit("Test1.java",
- "package tests;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "import libs.Lib1;\n" +
- "\n" +
- "public class Test1 {\n" +
- " String @NonNull[] test1(Lib1 lib, String @Nullable[] ok, String[] nok) {\n" +
- " lib.constraintArrayTop(nok);\n" +
- " return lib.constraintArrayTop(ok);\n" +
+ ICompilationUnit unit = fragment.createCompilationUnit("Test1.java",
+ "package tests;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "import libs.Lib1;\n" +
+ "\n" +
+ "public class Test1 {\n" +
+ " String @NonNull[] test1(Lib1 lib, String @Nullable[] ok, String[] nok) {\n" +
+ " lib.constraintArrayTop(nok);\n" +
+ " return lib.constraintArrayTop(ok);\n" +
+ " }\n" +
+ " @NonNull String @NonNull[] test2(Lib1 lib, @Nullable String @Nullable[] ok, String[] nok) {\n" +
+ " lib.constraintArrayFull(nok);\n" +
+ " return lib.constraintArrayFull(ok);\n" +
+ " }\n" +
+ " @NonNull String @NonNull[] @Nullable[] test3(Lib1 lib, @Nullable String @Nullable[] @NonNull[] ok, String[][] nok) {\n" +
+ " lib.constraintDeep(nok);\n" +
+ " return lib.constraintDeep(ok);\n" +
" }\n" +
- " @NonNull String @NonNull[] test2(Lib1 lib, @Nullable String @Nullable[] ok, String[] nok) {\n" +
- " lib.constraintArrayFull(nok);\n" +
- " return lib.constraintArrayFull(ok);\n" +
- " }\n" +
- " @NonNull String @NonNull[] @Nullable[] test3(Lib1 lib, @Nullable String @Nullable[] @NonNull[] ok, String[][] nok) {\n" +
- " lib.constraintDeep(nok);\n" +
- " return lib.constraintDeep(ok);\n" +
- " }\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
CompilationUnit reconciled = unit.reconcile(getJLS8(), true, null, new NullProgressMonitor());
@@ -658,37 +658,37 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
myCreateJavaProject("TestLibs");
addLibraryWithExternalAnnotations(this.project, "lib1.jar", "annots", new String[] {
"/UnannotatedLib/libs/Lib1.java",
- "package libs;\n" +
+ "package libs;\n" +
"\n" +
- "public interface Lib1 {\n" +
- " String one = \"1\";\n" +
- " String none = null;\n" +
+ "public interface Lib1 {\n" +
+ " String one = \"1\";\n" +
+ " String none = null;\n" +
"}\n"
}, null);
- createFileInProject("annots/libs", "Lib1.eea",
+ createFileInProject("annots/libs", "Lib1.eea",
"class libs/Lib1\n" +
- "\n" +
- "one\n" +
- " Ljava/lang/String;\n" +
- " L1java/lang/String;\n" +
- "\n" +
- "none\n" +
+ "\n" +
+ "one\n" +
+ " Ljava/lang/String;\n" +
+ " L1java/lang/String;\n" +
+ "\n" +
+ "none\n" +
" Ljava/lang/String;\n" +
" L0java/lang/String;\n" +
"\n");
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
- ICompilationUnit unit = fragment.createCompilationUnit("Test1.java",
- "package tests;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "import libs.Lib1;\n" +
- "\n" +
- "public class Test1 {\n" +
- " @NonNull String test0() {\n" +
- " return Lib1.none;\n" +
+ ICompilationUnit unit = fragment.createCompilationUnit("Test1.java",
+ "package tests;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "import libs.Lib1;\n" +
+ "\n" +
+ "public class Test1 {\n" +
+ " @NonNull String test0() {\n" +
+ " return Lib1.none;\n" +
" }\n" +
- " @NonNull String test1() {\n" +
- " return Lib1.one;\n" +
+ " @NonNull String test1() {\n" +
+ " return Lib1.one;\n" +
" }\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
@@ -703,23 +703,23 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
myCreateJavaProject("TestLibs");
addLibraryWithExternalAnnotations(this.project, "lib1.jar", "annots.zip", new String[] {
"/UnannotatedLib/libs/Lib1.java",
- "package libs;\n" +
+ "package libs;\n" +
"\n" +
- "public interface Lib1 {\n" +
- " String one = \"1\";\n" +
- " String none = null;\n" +
+ "public interface Lib1 {\n" +
+ " String one = \"1\";\n" +
+ " String none = null;\n" +
"}\n"
}, null);
Util.createSourceZip(
new String[] {
- "libs/Lib1.eea",
+ "libs/Lib1.eea",
"class libs/Lib1\n" +
- "\n" +
- "one\n" +
- " Ljava/lang/String;\n" +
- " L1java/lang/String;\n" +
- "\n" +
- "none\n" +
+ "\n" +
+ "one\n" +
+ " Ljava/lang/String;\n" +
+ " L1java/lang/String;\n" +
+ "\n" +
+ "none\n" +
" Ljava/lang/String;\n" +
" L0java/lang/String;\n" +
"\n"
@@ -728,18 +728,18 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
this.project.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
- ICompilationUnit unit = fragment.createCompilationUnit("Test1.java",
- "package tests;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "import libs.Lib1;\n" +
- "\n" +
- "public class Test1 {\n" +
- " @NonNull String test0() {\n" +
- " return Lib1.none;\n" +
+ ICompilationUnit unit = fragment.createCompilationUnit("Test1.java",
+ "package tests;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "import libs.Lib1;\n" +
+ "\n" +
+ "public class Test1 {\n" +
+ " @NonNull String test0() {\n" +
+ " return Lib1.none;\n" +
" }\n" +
- " @NonNull String test1() {\n" +
- " return Lib1.one;\n" +
+ " @NonNull String test1() {\n" +
+ " return Lib1.one;\n" +
" }\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
@@ -755,23 +755,23 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
String zipPath = Util.getOutputDirectory() + '/' + "annots.zip";
addLibraryWithExternalAnnotations(this.project, "lib1.jar", zipPath, new String[] {
"/UnannotatedLib/libs/Lib1.java",
- "package libs;\n" +
+ "package libs;\n" +
"\n" +
- "public interface Lib1 {\n" +
- " String one = \"1\";\n" +
- " String none = null;\n" +
+ "public interface Lib1 {\n" +
+ " String one = \"1\";\n" +
+ " String none = null;\n" +
"}\n"
}, null);
Util.createSourceZip(
new String[] {
- "libs/Lib1.eea",
+ "libs/Lib1.eea",
"class libs/Lib1\n" +
- "\n" +
- "one\n" +
- " Ljava/lang/String;\n" +
- " L1java/lang/String;\n" +
- "\n" +
- "none\n" +
+ "\n" +
+ "one\n" +
+ " Ljava/lang/String;\n" +
+ " L1java/lang/String;\n" +
+ "\n" +
+ "none\n" +
" Ljava/lang/String;\n" +
" L0java/lang/String;\n" +
"\n"
@@ -779,18 +779,18 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
zipPath);
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
- ICompilationUnit unit = fragment.createCompilationUnit("Test1.java",
- "package tests;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "import libs.Lib1;\n" +
- "\n" +
- "public class Test1 {\n" +
- " @NonNull String test0() {\n" +
- " return Lib1.none;\n" +
+ ICompilationUnit unit = fragment.createCompilationUnit("Test1.java",
+ "package tests;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "import libs.Lib1;\n" +
+ "\n" +
+ "public class Test1 {\n" +
+ " @NonNull String test0() {\n" +
+ " return Lib1.none;\n" +
" }\n" +
- " @NonNull String test1() {\n" +
- " return Lib1.one;\n" +
+ " @NonNull String test1() {\n" +
+ " return Lib1.one;\n" +
" }\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
@@ -805,16 +805,16 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
myCreateJavaProject("TestLibs");
addLibraryWithExternalAnnotations(this.project, "lib1.jar", "annots", new String[] {
"/UnannotatedLib/libs/Lib1.java",
- "package libs;\n" +
+ "package libs;\n" +
"\n" +
- "public interface Lib1<U,V,W extends U> {\n" +
- " U getU();\n" +
+ "public interface Lib1<U,V,W extends U> {\n" +
+ " U getU();\n" +
" V getV();\n" +
" W getW();\n" +
- " <X,Y extends CharSequence> Y fun(X x);\n" +
+ " <X,Y extends CharSequence> Y fun(X x);\n" +
"}\n"
}, null);
- createFileInProject("annots/libs", "Lib1.eea",
+ createFileInProject("annots/libs", "Lib1.eea",
"class libs/Lib1\n" +
" <U:Ljava/lang/Object;V:Ljava/lang/Object;W:TU;>\n" +
" <0U:Ljava/lang/Object;1V:Ljava/lang/Object;W:T1U;>\n" +
@@ -824,20 +824,20 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
" <1X:Ljava/lang/Object;Y::L1java/lang/CharSequence;>(TX;)TY;\n" +
"\n");
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
- ICompilationUnit unit = fragment.createCompilationUnit("Test1.java",
- "package tests;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "import libs.Lib1;\n" +
- "\n" +
- "public class Test1 {\n" +
- " @NonNull String test0(Lib1<@Nullable String,@NonNull String,@NonNull String> l) {\n" +
- " return l.getU();\n" + // mismatch: U is nullable
+ ICompilationUnit unit = fragment.createCompilationUnit("Test1.java",
+ "package tests;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "import libs.Lib1;\n" +
+ "\n" +
+ "public class Test1 {\n" +
+ " @NonNull String test0(Lib1<@Nullable String,@NonNull String,@NonNull String> l) {\n" +
+ " return l.getU();\n" + // mismatch: U is nullable
" }\n" +
- " @NonNull String test1(Lib1<@Nullable String,@NonNull String,@NonNull String> l) {\n" +
+ " @NonNull String test1(Lib1<@Nullable String,@NonNull String,@NonNull String> l) {\n" +
" return l.getV();\n" + // OK: V is nonnull
" }\n" +
- " @NonNull String test2(Lib1<@Nullable String,@NonNull String,@NonNull String> l) {\n" +
+ " @NonNull String test2(Lib1<@Nullable String,@NonNull String,@NonNull String> l) {\n" +
" return l.getW();\n" + // OK: V is nonnull
" }\n" +
" Lib1<@NonNull String, @NonNull String, @NonNull String> f1;\n" + // mismatch at U
@@ -864,34 +864,34 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
myCreateJavaProject("TestLibs");
addLibraryWithExternalAnnotations(this.project, "lib1.jar", "annots", new String[] {
"/UnannotatedLib/libs/LibSuper.java",
- "package libs;\n" +
+ "package libs;\n" +
"\n" +
- "public interface LibSuper<T,U> {\n" +
- " U apply(T t);\n" +
+ "public interface LibSuper<T,U> {\n" +
+ " U apply(T t);\n" +
"}\n",
"/UnannotatedLib/libs/Lib1.java",
- "package libs;\n" +
+ "package libs;\n" +
"\n" +
- "public interface Lib1 extends LibSuper<String,Exception> {\n" +
+ "public interface Lib1 extends LibSuper<String,Exception> {\n" +
"}\n"
}, null);
- createFileInProject("annots/libs", "Lib1.eea",
+ createFileInProject("annots/libs", "Lib1.eea",
"class libs/Lib1\n" +
"super libs/LibSuper\n" +
" <Ljava/lang/String;Ljava/lang/Exception;>\n" +
" <L1java/lang/String;L0java/lang/Exception;>\n" +
"\n");
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
- ICompilationUnit unit = fragment.createCompilationUnit("Test1.java",
- "package tests;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "import libs.Lib1;\n" +
- "\n" +
- "public class Test1 {\n" +
- " @NonNull Exception test0(Lib1 lib, @Nullable String str) {\n" +
+ ICompilationUnit unit = fragment.createCompilationUnit("Test1.java",
+ "package tests;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "import libs.Lib1;\n" +
+ "\n" +
+ "public class Test1 {\n" +
+ " @NonNull Exception test0(Lib1 lib, @Nullable String str) {\n" +
" return lib\n" +
- " .apply(str);\n" +
+ " .apply(str);\n" +
" }\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
@@ -947,7 +947,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
public void testAnnotateFieldWithParameterizedType() throws Exception {
myCreateJavaProject("TestLibs");
String lib1Content =
- "package libs;\n" +
+ "package libs;\n" +
"\n" +
"public abstract class Lib1<T> {\n" +
" public Lib1<T> one;\n" +
@@ -961,14 +961,14 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
// type check sources:
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
ICompilationUnit cu = fragment.createCompilationUnit("Test1.java",
- "package tests;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "import libs.Lib1;\n" +
- "\n" +
- "public class Test1 {\n" +
- " @NonNull String test0(Lib1<String> stringLib) {\n" +
- " return stringLib.one.get();\n" +
+ "package tests;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "import libs.Lib1;\n" +
+ "\n" +
+ "public class Test1 {\n" +
+ " @NonNull String test0(Lib1<String> stringLib) {\n" +
+ " return stringLib.one.get();\n" +
" }\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
@@ -987,13 +987,13 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
parser.setBindingsRecovery(false);
CompilationUnit unit = (CompilationUnit) parser.createAST(null);
libWorkingCopy.discardWorkingCopy();
-
+
// find type binding:
int start = lib1Content.indexOf("one");
ASTNode name = NodeFinder.perform(unit, start, 0);
assertTrue("should be simple name", name.getNodeType() == ASTNode.SIMPLE_NAME);
IVariableBinding fieldBinding = (IVariableBinding) ((SimpleName)name).resolveBinding();
-
+
// find annotation file (not yet existing):
IFile annotationFile = ExternalAnnotationUtil.getAnnotationFile(this.project, fieldBinding.getDeclaringClass(), null);
assertFalse("file should not exist", annotationFile.exists());
@@ -1002,9 +1002,9 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
// annotate:
String originalSignature = ExternalAnnotationUtil.extractGenericTypeSignature(fieldBinding.getVariableDeclaration().getType());
ExternalAnnotationUtil.annotateMember("libs/Lib1", annotationFile,
- "one",
- originalSignature,
- "Llibs/Lib1<T0T;>;",
+ "one",
+ originalSignature,
+ "Llibs/Lib1<T0T;>;",
MergeStrategy.OVERWRITE_ANNOTATIONS, null);
assertTrue("file should exist", annotationFile.exists());
@@ -1014,12 +1014,12 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
"Pb(953) Null type mismatch (type annotations): required '@NonNull String' but this expression has type '@Nullable String'",
}, new int[] { 8 });
}
-
+
public void testAnnotateMethodParameter() throws Exception {
myCreateJavaProject("TestLibs");
String lib1Content =
- "package libs;\n" +
+ "package libs;\n" +
"\n" +
"public abstract class Lib1<T,U> {\n" +
" public abstract void take(Lib1<X,U> lx);\n" +
@@ -1033,13 +1033,13 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
// type check sources:
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
ICompilationUnit cu = fragment.createCompilationUnit("Test1.java",
- "package tests;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "import libs.Lib1;\n" +
- "\n" +
- "public class Test1 {\n" +
- " void test0(Lib1<Lib1.X,@Nullable String> xLib1, Lib1<Lib1.@Nullable X,@NonNull String> xLib2) {\n" +
- " xLib1.take(xLib2);\n" +
+ "package tests;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "import libs.Lib1;\n" +
+ "\n" +
+ "public class Test1 {\n" +
+ " void test0(Lib1<Lib1.X,@Nullable String> xLib1, Lib1<Lib1.@Nullable X,@NonNull String> xLib2) {\n" +
+ " xLib1.take(xLib2);\n" +
" }\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
@@ -1058,14 +1058,14 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
parser.setBindingsRecovery(false);
CompilationUnit unit = (CompilationUnit) parser.createAST(null);
libWorkingCopy.discardWorkingCopy();
-
+
// find type binding:
int start = lib1Content.indexOf("take");
ASTNode name = NodeFinder.perform(unit, start, 0);
assertTrue("should be simple name", name.getNodeType() == ASTNode.SIMPLE_NAME);
ASTNode method = name.getParent();
IMethodBinding methodBinding = ((MethodDeclaration)method).resolveBinding();
-
+
// find annotation file (not yet existing):
IFile annotationFile = ExternalAnnotationUtil.getAnnotationFile(this.project, methodBinding.getDeclaringClass(), null);
assertFalse("file should not exist", annotationFile.exists());
@@ -1074,8 +1074,8 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
// annotate:
String originalSignature = ExternalAnnotationUtil.extractGenericSignature(methodBinding);
ExternalAnnotationUtil.annotateMember("libs/Lib1", annotationFile,
- "take",
- originalSignature,
+ "take",
+ originalSignature,
"(Llibs/Lib1<L0libs/Lib1$X;T1U;>;)V", // <- two annotations: @Nullable X and @NonNull U
MergeStrategy.OVERWRITE_ANNOTATIONS, null);
assertTrue("file should exist", annotationFile.exists());
@@ -1084,12 +1084,12 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
reconciled = cu.reconcile(getJLS8(), true, null, new NullProgressMonitor());
assertNoProblems(reconciled.getProblems());
}
-
+
public void testAnnotateConstructorParameter() throws Exception {
myCreateJavaProject("TestLibs");
String lib1Content =
- "package libs;\n" +
+ "package libs;\n" +
"\n" +
"public class Lib1<U> {\n" +
" public Lib1(int ignore, U string) {}\n" +
@@ -1102,14 +1102,14 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
// type check sources:
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
ICompilationUnit cu = fragment.createCompilationUnit("Test1.java",
- "package tests;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "import libs.Lib1;\n" +
- "\n" +
- "public class Test1 {\n" +
- " Object test0() {\n" +
+ "package tests;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "import libs.Lib1;\n" +
+ "\n" +
+ "public class Test1 {\n" +
+ " Object test0() {\n" +
" Lib1<@NonNull String> lib = new Lib1<>(1, null);\n" +
- " return lib;\n" +
+ " return lib;\n" +
" }\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
@@ -1128,14 +1128,14 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
parser.setBindingsRecovery(false);
CompilationUnit unit = (CompilationUnit) parser.createAST(null);
libWorkingCopy.discardWorkingCopy();
-
+
// find method binding:
int start = lib1Content.indexOf("U string");
ASTNode name = NodeFinder.perform(unit, start, 0);
assertTrue("should be simple name", name.getNodeType() == ASTNode.SIMPLE_NAME);
ASTNode method = name.getParent().getParent().getParent();
IMethodBinding methodBinding = ((MethodDeclaration)method).resolveBinding();
-
+
// find annotation file (not yet existing):
IFile annotationFile = ExternalAnnotationUtil.getAnnotationFile(this.project, methodBinding.getDeclaringClass(), null);
assertFalse("file should not exist", annotationFile.exists());
@@ -1144,8 +1144,8 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
// annotate:
String originalSignature = ExternalAnnotationUtil.extractGenericSignature(methodBinding);
ExternalAnnotationUtil.annotateMember("libs/Lib1", annotationFile,
- "<init>",
- originalSignature,
+ "<init>",
+ originalSignature,
"(IT0U;)V", // <- @Nullable U
MergeStrategy.OVERWRITE_ANNOTATIONS, null);
assertTrue("file should exist", annotationFile.exists());
@@ -1153,13 +1153,13 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
// check that the error is resolved now:
reconciled = cu.reconcile(getJLS8(), true, null, new NullProgressMonitor());
assertNoProblems(reconciled.getProblems());
-
+
// invert annotation:
ExternalAnnotationUtil.annotateMethodParameterType("libs/Lib1", annotationFile,
- "<init>",
- originalSignature,
+ "<init>",
+ originalSignature,
"T1U;", // <- @NonNull U
- 1, // position
+ 1, // position
MergeStrategy.OVERWRITE_ANNOTATIONS, null);
assertTrue("file should exist", annotationFile.exists());
@@ -1171,9 +1171,9 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
// check that the previous entry has been overwritten:
assertEquals(
- "class libs/Lib1\n" +
- "<init>\n" +
- " (ITU;)V\n" +
+ "class libs/Lib1\n" +
+ "<init>\n" +
+ " (ITU;)V\n" +
" (IT1U;)V\n",
readFully(annotationFile));
}
@@ -1182,7 +1182,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
myCreateJavaProject("TestLibs");
String lib1Content =
"package libs;\n" +
- "import java.util.List;\n" +
+ "import java.util.List;\n" +
"\n" +
"public abstract class Lib1 {\n" +
" public abstract <S extends Throwable, T, U extends List<T>, V> U method(S s, T t, V v);\n" +
@@ -1195,14 +1195,14 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
// type check sources:
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
ICompilationUnit cu = fragment.createCompilationUnit("Test1.java",
- "package tests;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "import libs.Lib1;\n" +
- "\n" +
- "public class Test1 {\n" +
- " @NonNull Object test0(Lib1 xLib1) {\n" +
+ "package tests;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "import libs.Lib1;\n" +
+ "\n" +
+ "public class Test1 {\n" +
+ " @NonNull Object test0(Lib1 xLib1) {\n" +
" return xLib1.method(\n" +
- " (Error) null, this, xLib1);\n" +
+ " (Error) null, this, xLib1);\n" +
" }\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
@@ -1239,7 +1239,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
ExternalAnnotationUtil.annotateMethodTypeParameter("libs/Lib1", annotationFile,
"method",
originalSignature,
- "1U::Ljava/util/List<TT;>;", // <- @NonNull U
+ "1U::Ljava/util/List<TT;>;", // <- @NonNull U
2, // annotate 3rd type parameter (U)
MergeStrategy.OVERWRITE_ANNOTATIONS, null);
assertTrue("file should exist", annotationFile.exists());
@@ -1252,7 +1252,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
ExternalAnnotationUtil.annotateMethodTypeParameter("libs/Lib1", annotationFile,
"method",
originalSignature,
- "1S:Ljava/lang/Throwable;", // <- @NonNull S
+ "1S:Ljava/lang/Throwable;", // <- @NonNull S
0, // annotate 1st type parameter (S)
MergeStrategy.OVERWRITE_ANNOTATIONS, null);
@@ -1261,11 +1261,11 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
assertProblems(reconciled.getProblems(), new String[] {
"Pb(910) Null type mismatch: required '@NonNull Error' but the provided value is null",
}, new int[] { 8 });
-
+
assertEquals("file content",
- "class libs/Lib1\n" +
- "method\n" +
- " <S:Ljava/lang/Throwable;T:Ljava/lang/Object;U::Ljava/util/List<TT;>;V:Ljava/lang/Object;>(TS;TT;TV;)TU;\n" +
+ "class libs/Lib1\n" +
+ "method\n" +
+ " <S:Ljava/lang/Throwable;T:Ljava/lang/Object;U::Ljava/util/List<TT;>;V:Ljava/lang/Object;>(TS;TT;TV;)TU;\n" +
" <1S:Ljava/lang/Throwable;T:Ljava/lang/Object;1U::Ljava/util/List<TT;>;V:Ljava/lang/Object;>(TS;TT;TV;)TU;\n",
readFully(annotationFile));
}
@@ -1274,7 +1274,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
myCreateJavaProject("TestLibs");
String lib1Content =
"package libs;\n" +
- "import java.util.List;\n" +
+ "import java.util.List;\n" +
"\n" +
"public abstract class Entry<KK,VV> {\n" +
" public static <K, V extends Comparable<? super V>> Comparator<Entry<K,V>> comparingByValue() { return null; }\n" +
@@ -1314,12 +1314,12 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
String originalSignature = ExternalAnnotationUtil.extractGenericSignature(methodBinding);
// preview:
String[] annotatedSign = ExternalAnnotationUtil.annotateTypeParameter(
- originalSignature,
+ originalSignature,
"1K:Ljava/lang/Object;", // <- @NonNull K
0,
MergeStrategy.OVERWRITE_ANNOTATIONS);
- assertEquals("dry-run result", "[<, " +
- "K:Ljava/lang/Object;, " +
+ assertEquals("dry-run result", "[<, " +
+ "K:Ljava/lang/Object;, " +
"1K:Ljava/lang/Object;, " + // <- K
"V::Ljava/lang/Comparable<-TV;>;>()Llibs/Comparator<Llibs/Entry<TK;TV;>;>;]",
Arrays.toString(annotatedSign));
@@ -1335,14 +1335,14 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
// type check sources:
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
ICompilationUnit cu = fragment.createCompilationUnit("Test1.java",
- "package tests;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "import libs.*;\n" +
- "\n" +
- "public class Test1 {\n" +
- " Object test0() {\n" +
+ "package tests;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "import libs.*;\n" +
+ "\n" +
+ "public class Test1 {\n" +
+ " Object test0() {\n" +
" Comparator<Entry<@Nullable String,String>> c = Entry.comparingByValue();\n" +
- " return c;\n" +
+ " return c;\n" +
" }\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
@@ -1350,14 +1350,14 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
assertProblems(reconciled.getProblems(), new String[] {
"Pb(953) Null type mismatch (type annotations): required 'Comparator<Entry<@Nullable String,String>>' but this expression has type 'Comparator<Entry<@NonNull String,String>>'",
}, new int[] { 7 });
-
+
// un-annotate:
annotatedSign = ExternalAnnotationUtil.annotateTypeParameter(
- originalSignature,
+ originalSignature,
"@K:Ljava/lang/Object;", // <- <del>1</del> K
0, MergeStrategy.OVERWRITE_ANNOTATIONS);
- assertEquals("dry-run result", "[<, " +
- "K:Ljava/lang/Object;, " +
+ assertEquals("dry-run result", "[<, " +
+ "K:Ljava/lang/Object;, " +
"K:Ljava/lang/Object;, " + // <- K
"V::Ljava/lang/Comparable<-TV;>;>()Llibs/Comparator<Llibs/Entry<TK;TV;>;>;]",
Arrays.toString(annotatedSign));
@@ -1367,7 +1367,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
myCreateJavaProject("TestLibs");
String lib1Content =
"package libs;\n" +
- "import java.util.List;\n" +
+ "import java.util.List;\n" +
"\n" +
"public abstract class Lib1 <S extends Throwable, T, U extends List<T>, V> {\n" +
" public abstract U method(S s, T t, V v);\n" +
@@ -1380,15 +1380,15 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
// type check sources:
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
ICompilationUnit cu = fragment.createCompilationUnit("Test1.java",
- "package tests;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
+ "package tests;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
"import libs.Lib1;\n" +
- "import java.util.List;\n" +
- "\n" +
- "public class Test1 {\n" +
- " @NonNull List<Test1> test0(Lib1<Error,Test1,@NonNull List<Test1>,String> xLib1) {\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "public class Test1 {\n" +
+ " @NonNull List<Test1> test0(Lib1<Error,Test1,@NonNull List<Test1>,String> xLib1) {\n" +
" return xLib1.method(\n" +
- " (Error) null, this, \"1\");\n" +
+ " (Error) null, this, \"1\");\n" +
" }\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
@@ -1424,7 +1424,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
String originalSignature = ExternalAnnotationUtil.extractGenericTypeParametersSignature(typeBinding);
ExternalAnnotationUtil.annotateTypeTypeParameter("libs/Lib1", annotationFile,
originalSignature,
- "1U::Ljava/util/List<TT;>;", // <- @NonNull U
+ "1U::Ljava/util/List<TT;>;", // <- @NonNull U
2, // annotate 3rd type parameter (U)
MergeStrategy.OVERWRITE_ANNOTATIONS, null);
assertTrue("file should exist", annotationFile.exists());
@@ -1436,7 +1436,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
// add one more annotation:
ExternalAnnotationUtil.annotateTypeTypeParameter("libs/Lib1", annotationFile,
originalSignature,
- "1S:Ljava/lang/Throwable;", // <- @NonNull S
+ "1S:Ljava/lang/Throwable;", // <- @NonNull S
0, // annotate 1st type parameter (S)
MergeStrategy.OVERWRITE_ANNOTATIONS, null);
@@ -1446,10 +1446,10 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
"Pb(964) Null constraint mismatch: The type 'Error' is not a valid substitute for the type parameter '@NonNull S extends Throwable'",
"Pb(910) Null type mismatch: required '@NonNull Error' but the provided value is null",
}, new int[] { 7, 9 });
-
+
assertEquals("file content",
- "class libs/Lib1\n" +
- " <S:Ljava/lang/Throwable;T:Ljava/lang/Object;U::Ljava/util/List<TT;>;V:Ljava/lang/Object;>\n" +
+ "class libs/Lib1\n" +
+ " <S:Ljava/lang/Throwable;T:Ljava/lang/Object;U::Ljava/util/List<TT;>;V:Ljava/lang/Object;>\n" +
" <1S:Ljava/lang/Throwable;T:Ljava/lang/Object;1U::Ljava/util/List<TT;>;V:Ljava/lang/Object;>\n",
readFully(annotationFile));
}
@@ -1459,13 +1459,13 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
public void testBug470666a() throws CoreException, IOException {
myCreateJavaProject("TestAnnot");
String lib1Content =
- "package libs;\n" +
+ "package libs;\n" +
"\n" +
"interface Function<T,U> {}\n" +
"interface Collector<T,A,R> {}\n" +
"public class Collectors {\n" +
- " public static <T, U, A, R>\n" +
- " Collector<T, ?, R> mapping(Function<? super T, ? extends U> mapper,\n" +
+ " public static <T, U, A, R>\n" +
+ " Collector<T, ?, R> mapping(Function<? super T, ? extends U> mapper,\n" +
" Collector<? super U, A, R> downstream) { return null; }\n" +
"}\n";
addLibraryWithExternalAnnotations(this.project, "lib1.jar", "annots", new String[] {
@@ -1483,7 +1483,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
parser.setBindingsRecovery(false);
CompilationUnit unit = (CompilationUnit) parser.createAST(null);
libWorkingCopy.discardWorkingCopy();
-
+
// find type binding:
int start = lib1Content.indexOf("T, ? extends U>"); // bound of type param of method param
ASTNode name = NodeFinder.perform(unit, start, 0);
@@ -1492,7 +1492,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
while (!(method instanceof MethodDeclaration))
method = method.getParent();
IMethodBinding methodBinding = ((MethodDeclaration)method).resolveBinding();
-
+
// find annotation file (not yet existing):
IFile annotationFile = ExternalAnnotationUtil.getAnnotationFile(this.project, methodBinding.getDeclaringClass(), null);
assertFalse("file should not exist", annotationFile.exists());
@@ -1501,11 +1501,11 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
// annotate:
String originalSignature = ExternalAnnotationUtil.extractGenericSignature(methodBinding);
String[] annotatedSign = ExternalAnnotationUtil.annotateParameterType(
- originalSignature,
+ originalSignature,
"Llibs/Function<-T1T;+TU;>;", // <- @NonNull T
0, MergeStrategy.OVERWRITE_ANNOTATIONS);
- assertEquals("dry-run result", "[<T:Ljava/lang/Object;U:Ljava/lang/Object;A:Ljava/lang/Object;R:Ljava/lang/Object;>(, " +
- "Llibs/Function<-TT;+TU;>;, " +
+ assertEquals("dry-run result", "[<T:Ljava/lang/Object;U:Ljava/lang/Object;A:Ljava/lang/Object;R:Ljava/lang/Object;>(, " +
+ "Llibs/Function<-TT;+TU;>;, " +
"Llibs/Function<-T1T;+TU;>;, " + // <- @NonNull T
"Llibs/Collector<-TU;TA;TR;>;)Llibs/Collector<TT;*TR;>;]",
Arrays.toString(annotatedSign));
@@ -1514,13 +1514,13 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
public void testBug470666b() throws CoreException, IOException {
myCreateJavaProject("TestAnnot");
String lib1Content =
- "package libs;\n" +
+ "package libs;\n" +
"\n" +
"interface Function<T,U> {}\n" +
"interface Collector<T,A,R> {}\n" +
"public class Collectors {\n" +
- " public static <T, U, A, R>\n" +
- " Collector<T, ?, R> mapping(Function<? super T, ? extends U> mapper,\n" +
+ " public static <T, U, A, R>\n" +
+ " Collector<T, ?, R> mapping(Function<? super T, ? extends U> mapper,\n" +
" Collector<? super U, A, R> downstream) { return null; }\n" +
"}\n";
addLibraryWithExternalAnnotations(this.project, "lib1.jar", "annots", new String[] {
@@ -1538,7 +1538,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
parser.setBindingsRecovery(false);
CompilationUnit unit = (CompilationUnit) parser.createAST(null);
libWorkingCopy.discardWorkingCopy();
-
+
// find type binding:
int start = lib1Content.indexOf("T, ?, R>"); // bound of return type
ASTNode name = NodeFinder.perform(unit, start, 0);
@@ -1547,7 +1547,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
while (!(method instanceof MethodDeclaration))
method = method.getParent();
IMethodBinding methodBinding = ((MethodDeclaration)method).resolveBinding();
-
+
// find annotation file (not yet existing):
IFile annotationFile = ExternalAnnotationUtil.getAnnotationFile(this.project, methodBinding.getDeclaringClass(), null);
assertFalse("file should not exist", annotationFile.exists());
@@ -1556,10 +1556,10 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
// annotate:
String originalSignature = ExternalAnnotationUtil.extractGenericSignature(methodBinding);
String[] annotatedSign = ExternalAnnotationUtil.annotateReturnType(
- originalSignature,
+ originalSignature,
"Llibs/Collector<T1T;*TR;>;", // <- @NonNull T
MergeStrategy.OVERWRITE_ANNOTATIONS);
- assertEquals("dry-run result", "[<T:Ljava/lang/Object;U:Ljava/lang/Object;A:Ljava/lang/Object;R:Ljava/lang/Object;>(Llibs/Function<-TT;+TU;>;Llibs/Collector<-TU;TA;TR;>;), " +
+ assertEquals("dry-run result", "[<T:Ljava/lang/Object;U:Ljava/lang/Object;A:Ljava/lang/Object;R:Ljava/lang/Object;>(Llibs/Function<-TT;+TU;>;Llibs/Collector<-TU;TA;TR;>;), " +
"Llibs/Collector<TT;*TR;>;, " +
"Llibs/Collector<T1T;*TR;>;, " + // <- @NonNull T
"]",
@@ -1569,7 +1569,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
public void testBug464081() throws CoreException, IOException {
myCreateJavaProject("TestAnnot");
String lib1Content =
- "package libs;\n" +
+ "package libs;\n" +
"\n" +
"interface List<T> {}\n" +
"public class Collections {\n" +
@@ -1590,7 +1590,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
parser.setBindingsRecovery(false);
CompilationUnit unit = (CompilationUnit) parser.createAST(null);
libWorkingCopy.discardWorkingCopy();
-
+
// find type binding:
int start = lib1Content.indexOf("List<? extends T>");
ASTNode name = NodeFinder.perform(unit, start, 0);
@@ -1599,7 +1599,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
while (!(method instanceof MethodDeclaration))
method = method.getParent();
IMethodBinding methodBinding = ((MethodDeclaration)method).resolveBinding();
-
+
// find annotation file (not yet existing):
IFile annotationFile = ExternalAnnotationUtil.getAnnotationFile(this.project, methodBinding.getDeclaringClass(), null);
assertFalse("file should not exist", annotationFile.exists());
@@ -1608,12 +1608,12 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
// annotate:
String originalSignature = ExternalAnnotationUtil.extractGenericSignature(methodBinding);
String[] annotatedSign = ExternalAnnotationUtil.annotateParameterType(
- originalSignature,
+ originalSignature,
"Llibs/List<+T1T;>;", // <- @NonNull T
0, MergeStrategy.OVERWRITE_ANNOTATIONS);
assertEquals("dry-run result",
"[<T:Ljava/lang/Object;>(, " +
- "Llibs/List<+TT;>;, " +
+ "Llibs/List<+TT;>;, " +
"Llibs/List<+T1T;>;, " + // <- @NonNull T
")Llibs/List<TT;>;]",
Arrays.toString(annotatedSign));
@@ -1622,7 +1622,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
public void testBug471352() throws CoreException, IOException {
myCreateJavaProject("TestAnnot");
String lib1Content =
- "package libs;\n" +
+ "package libs;\n" +
"\n" +
"interface List<T> {}\n" +
"class Random {}\n" +
@@ -1644,7 +1644,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
parser.setBindingsRecovery(false);
CompilationUnit unit = (CompilationUnit) parser.createAST(null);
libWorkingCopy.discardWorkingCopy();
-
+
// find type binding:
int start = lib1Content.indexOf("Random rnd");
ASTNode name = NodeFinder.perform(unit, start, 0);
@@ -1653,7 +1653,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
while (!(method instanceof MethodDeclaration))
method = method.getParent();
IMethodBinding methodBinding = ((MethodDeclaration)method).resolveBinding();
-
+
// find annotation file (not yet existing):
IFile annotationFile = ExternalAnnotationUtil.getAnnotationFile(this.project, methodBinding.getDeclaringClass(), null);
assertFalse("file should not exist", annotationFile.exists());
@@ -1662,12 +1662,12 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
// annotate:
String originalSignature = ExternalAnnotationUtil.extractGenericSignature(methodBinding);
String[] annotatedSign = ExternalAnnotationUtil.annotateParameterType(
- originalSignature,
+ originalSignature,
"L1libs/Random;", // <- @NonNull Random
1, MergeStrategy.OVERWRITE_ANNOTATIONS);
assertEquals("dry-run result",
"[(Llibs/List<*>;, " +
- "Llibs/Random;, " +
+ "Llibs/Random;, " +
"L1libs/Random;, " + // <- @NonNull Random
")V]",
Arrays.toString(annotatedSign));
@@ -1677,12 +1677,12 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
public void testBug471034a() throws CoreException, IOException {
myCreateJavaProject("TestAnnot");
String lib1Content =
- "package libs;\n" +
+ "package libs;\n" +
"\n" +
"interface List<T> {}\n" +
"class Random {}\n" +
"public class Thread {\n" +
- " public static int enumerate(Thread tarray[]) { return 1; }\n" +
+ " public static int enumerate(Thread tarray[]) { return 1; }\n" +
"}\n";
addLibraryWithExternalAnnotations(this.project, "lib1.jar", "annots", new String[] {
"/UnannotatedLib/libs/Thread.java",
@@ -1699,7 +1699,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
parser.setBindingsRecovery(false);
CompilationUnit unit = (CompilationUnit) parser.createAST(null);
libWorkingCopy.discardWorkingCopy();
-
+
// find type binding:
int start = lib1Content.indexOf("Thread tarray[]");
ASTNode name = NodeFinder.perform(unit, start, 0);
@@ -1708,7 +1708,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
while (!(method instanceof MethodDeclaration))
method = method.getParent();
IMethodBinding methodBinding = ((MethodDeclaration)method).resolveBinding();
-
+
// find annotation file (not yet existing):
IFile annotationFile = ExternalAnnotationUtil.getAnnotationFile(this.project, methodBinding.getDeclaringClass(), null);
assertFalse("file should not exist", annotationFile.exists());
@@ -1717,12 +1717,12 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
// annotate:
String originalSignature = ExternalAnnotationUtil.extractGenericSignature(methodBinding);
String[] annotatedSign = ExternalAnnotationUtil.annotateParameterType(
- originalSignature,
+ originalSignature,
"[L1libs/Thread;", // <- @NonNull Thread
0, MergeStrategy.OVERWRITE_ANNOTATIONS);
assertEquals("dry-run result",
"[(, " +
- "[Llibs/Thread;, " +
+ "[Llibs/Thread;, " +
"[L1libs/Thread;, " + // <- @NonNull Thread
")I]",
Arrays.toString(annotatedSign));
@@ -1732,12 +1732,12 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
public void testBug471034b() throws CoreException, IOException {
myCreateJavaProject("TestAnnot");
String lib1Content =
- "package libs;\n" +
+ "package libs;\n" +
"\n" +
"interface List<T> {}\n" +
"class Random {}\n" +
"public class Thread {\n" +
- " public static int enumerate(Thread tarray[][]) { return 1; }\n" +
+ " public static int enumerate(Thread tarray[][]) { return 1; }\n" +
"}\n";
addLibraryWithExternalAnnotations(this.project, "lib1.jar", "annots", new String[] {
"/UnannotatedLib/libs/Thread.java",
@@ -1754,7 +1754,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
parser.setBindingsRecovery(false);
CompilationUnit unit = (CompilationUnit) parser.createAST(null);
libWorkingCopy.discardWorkingCopy();
-
+
// find type binding:
int start = lib1Content.indexOf("[][]");
ASTNode name = NodeFinder.perform(unit, start, 0);
@@ -1763,7 +1763,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
while (!(method instanceof MethodDeclaration))
method = method.getParent();
IMethodBinding methodBinding = ((MethodDeclaration)method).resolveBinding();
-
+
// find annotation file (not yet existing):
IFile annotationFile = ExternalAnnotationUtil.getAnnotationFile(this.project, methodBinding.getDeclaringClass(), null);
assertFalse("file should not exist", annotationFile.exists());
@@ -1772,12 +1772,12 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
// annotate:
String originalSignature = ExternalAnnotationUtil.extractGenericSignature(methodBinding);
String[] annotatedSign = ExternalAnnotationUtil.annotateParameterType(
- originalSignature,
+ originalSignature,
"[1[Llibs/Thread;", // <- @NonNull array
0, MergeStrategy.OVERWRITE_ANNOTATIONS);
assertEquals("dry-run result",
"[(, " +
- "[[Llibs/Thread;, " +
+ "[[Llibs/Thread;, " +
"[1[Llibs/Thread;, " + // <- @NonNull array
")I]",
Arrays.toString(annotatedSign));
@@ -1787,12 +1787,12 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
public void testBug471034c() throws CoreException, IOException {
myCreateJavaProject("TestAnnot");
String lib1Content =
- "package libs;\n" +
+ "package libs;\n" +
"\n" +
"interface List<T> {}\n" +
"class Random {}\n" +
"public class Thread {\n" +
- " public static int enumerate(Thread ... tarray) { return 1; }\n" +
+ " public static int enumerate(Thread ... tarray) { return 1; }\n" +
"}\n";
addLibraryWithExternalAnnotations(this.project, "lib1.jar", "annots", new String[] {
"/UnannotatedLib/libs/Thread.java",
@@ -1809,7 +1809,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
parser.setBindingsRecovery(false);
CompilationUnit unit = (CompilationUnit) parser.createAST(null);
libWorkingCopy.discardWorkingCopy();
-
+
// find type binding:
int start = lib1Content.indexOf("...");
ASTNode name = NodeFinder.perform(unit, start, 0);
@@ -1818,7 +1818,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
while (!(method instanceof MethodDeclaration))
method = method.getParent();
IMethodBinding methodBinding = ((MethodDeclaration)method).resolveBinding();
-
+
// find annotation file (not yet existing):
IFile annotationFile = ExternalAnnotationUtil.getAnnotationFile(this.project, methodBinding.getDeclaringClass(), null);
assertFalse("file should not exist", annotationFile.exists());
@@ -1827,12 +1827,12 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
// annotate:
String originalSignature = ExternalAnnotationUtil.extractGenericSignature(methodBinding);
String[] annotatedSign = ExternalAnnotationUtil.annotateParameterType(
- originalSignature,
+ originalSignature,
"[1Llibs/Thread;", // <- @NonNull array
0, MergeStrategy.OVERWRITE_ANNOTATIONS);
assertEquals("dry-run result",
"[(, " +
- "[Llibs/Thread;, " +
+ "[Llibs/Thread;, " +
"[1Llibs/Thread;, " + // <- @NonNull array
")I]",
Arrays.toString(annotatedSign));
@@ -1842,20 +1842,20 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
LogListener listener = new LogListener();
try {
Platform.addLogListener(listener);
-
+
myCreateJavaProject("TestBrokenConfig1");
addLibraryWithExternalAnnotations(this.project, "lib1.jar", "/NoProject", new String[] {
"/UnannotatedLib/libs/Lib1.java",
- "package libs;\n" +
- "\n" +
- "import java.util.Collection;\n" +
- "import java.util.Iterator;\n" +
- "\n" +
- "public interface Lib1 {\n" +
- " <T> Iterator<T> unconstrainedTypeArguments1(Collection<T> in);\n" +
- " Iterator<String> unconstrainedTypeArguments2(Collection<String> in);\n" +
- " <T> Iterator<? extends T> constrainedWildcards(Collection<? extends T> in);\n" +
- " <T extends Collection<?>> T constrainedTypeParameter(T in);\n" +
+ "package libs;\n" +
+ "\n" +
+ "import java.util.Collection;\n" +
+ "import java.util.Iterator;\n" +
+ "\n" +
+ "public interface Lib1 {\n" +
+ " <T> Iterator<T> unconstrainedTypeArguments1(Collection<T> in);\n" +
+ " Iterator<String> unconstrainedTypeArguments2(Collection<String> in);\n" +
+ " <T> Iterator<? extends T> constrainedWildcards(Collection<? extends T> in);\n" +
+ " <T extends Collection<?>> T constrainedTypeParameter(T in);\n" +
"}\n",
"/UnannotatedLib/libs/Lib2.java",
"package libs;\n" +
@@ -1864,28 +1864,28 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
"}\n"
}, null);
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
- ICompilationUnit unit = fragment.createCompilationUnit("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" +
+ ICompilationUnit unit = fragment.createCompilationUnit("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" +
" }\n" +
" Iterator<? extends @NonNull String> test3(Lib1 lib, Collection<String> coll) {\n" +
" return lib.constrainedWildcards(coll);\n" +
" }\n" +
" @NonNull Collection<String> test4(Lib1 lib, @Nullable Collection<String> in) {\n" +
" return lib.constrainedTypeParameter(in);\n" +
- " }\n" +
+ " }\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
CompilationUnit reconciled = unit.reconcile(getJLS8(), true, null, new NullProgressMonitor());
@@ -1893,19 +1893,19 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
assertEquals("number of problems", 4, problems.length);
// second class to test if problem is logged more than once
- ICompilationUnit unit2 = fragment.createCompilationUnit("Test2.java",
- "package tests;\n" +
- "import libs.Lib2;\n" +
- "\n" +
- "public class Test2 {\n" +
+ ICompilationUnit unit2 = fragment.createCompilationUnit("Test2.java",
+ "package tests;\n" +
+ "import libs.Lib2;\n" +
+ "\n" +
+ "public class Test2 {\n" +
" void test1(Lib2 lib) {\n" +
- " lib.test(null);\n" +
- " }\n" +
+ " lib.test(null);\n" +
+ " }\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
CompilationUnit reconciled2 = unit2.reconcile(getJLS8(), true, null, new NullProgressMonitor());
assertNoProblems(reconciled2.getProblems());
-
+
assertEquals("number of log entries", 0, listener.loggedStatus.size());
} finally {
Platform.removeLogListener(listener);
@@ -1917,7 +1917,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
try {
setupJavaProject("Lib");
this.project.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
-
+
setupJavaProject("Test1");
addProjectDependencyWithExternalAnnotations(this.project, "/Lib", "annots", null);
this.project.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
@@ -1934,7 +1934,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
setupJavaProject("Lib");
this.project.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
this.root = null; // prepare to get the root from project Test1
-
+
setupJavaProject("Test1");
addProjectDependencyWithExternalAnnotations(this.project, "/Lib", "annots", null);
IPackageFragment fragment = this.root.getPackageFragment("test1");
@@ -1953,25 +1953,25 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
setupJavaProject("Lib");
this.project.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
this.root = null; // prepare to get the root from project Test1
-
+
setupJavaProject("Test3b");
Util.createSourceZip(
new String[] {
- "libs/MyFunction.eea",
- "class libs/MyFunction\n" +
- " <T:R:>\n" +
- "\n" +
- "compose\n" +
- " <V:Ljava/lang/Object;>(Llibs/MyFunction<-TV;+TT;>;)Llibs/MyFunction<TV;TR;>;\n" +
- " <V:Ljava/lang/Object;>(Llibs/MyFunction<-TV;+T0T;>;)Llibs/MyFunction<TV;TR;>;\n" +
+ "libs/MyFunction.eea",
+ "class libs/MyFunction\n" +
+ " <T:R:>\n" +
+ "\n" +
+ "compose\n" +
+ " <V:Ljava/lang/Object;>(Llibs/MyFunction<-TV;+TT;>;)Llibs/MyFunction<TV;TR;>;\n" +
+ " <V:Ljava/lang/Object;>(Llibs/MyFunction<-TV;+T0T;>;)Llibs/MyFunction<TV;TR;>;\n" +
"\n",
- "libs/Arrays.eea",
- "class libs/Arrays\n" +
+ "libs/Arrays.eea",
+ "class libs/Arrays\n" +
"\n" +
"array\n" +
" [Ljava/lang/String;\n" +
" [1L0java/lang/String;\n" +
- "\n" +
+ "\n" +
"getArray\n" +
" ()[[Ljava/lang/String;\n" +
" ()[0[1L0java/lang/String;\n"
@@ -1996,18 +1996,18 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
setupJavaProject("Lib");
this.project.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
this.root = null; // prepare to get the root from project Test1
-
+
setupJavaProject("Test3b");
Util.createSourceZip(
new String[] {
- "libs/MyFunction.eea",
- "class libs/MyFunction\n" +
- " <T:R:>\n" +
- " <T:1R:>\n" +
- "\n" +
- "compose\n" +
- " <V:Ljava/lang/Object;>(Llibs/MyFunction<-TV;+TT;>;)Llibs/MyFunction<TV;TR;>;\n" +
- " <1V:Ljava/lang/Object;>(Llibs/MyFunction<-TV;+TT;>;)Llibs/MyFunction<TV;TR;>;\n" +
+ "libs/MyFunction.eea",
+ "class libs/MyFunction\n" +
+ " <T:R:>\n" +
+ " <T:1R:>\n" +
+ "\n" +
+ "compose\n" +
+ " <V:Ljava/lang/Object;>(Llibs/MyFunction<-TV;+TT;>;)Llibs/MyFunction<TV;TR;>;\n" +
+ " <1V:Ljava/lang/Object;>(Llibs/MyFunction<-TV;+TT;>;)Llibs/MyFunction<TV;TR;>;\n" +
"\n",
},
this.project.getProject().getLocation().toString()+"/annots.zip");
@@ -2025,31 +2025,31 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
deleteProject("Lib");
}
}
-
+
public void testFreeTypeVariableReturn() throws Exception {
myCreateJavaProject("TestLibs");
addLibraryWithExternalAnnotations(this.project, "lib1.jar", "annots", new String[] {
"/UnannotatedLib/libs/Lib1.java",
- "package libs;\n" +
- "\n" +
- "public interface Lib1<T> {\n" +
- " T get();\n" +
+ "package libs;\n" +
+ "\n" +
+ "public interface Lib1<T> {\n" +
+ " T get();\n" +
"}\n"
}, null);
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
- ICompilationUnit unit = fragment.createCompilationUnit("Test1.java",
- "package tests;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "import libs.Lib1;\n" +
- "\n" +
- "public class Test1 {\n" +
- " @NonNull String test0(Lib1<@Nullable String> lib) {\n" +
- " return lib.get();\n" +
- " }\n" +
- " @NonNull String test1(Lib1<@NonNull String> lib) {\n" +
- " return lib.get();\n" +
- " }\n" +
+ ICompilationUnit unit = fragment.createCompilationUnit("Test1.java",
+ "package tests;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "import libs.Lib1;\n" +
+ "\n" +
+ "public class Test1 {\n" +
+ " @NonNull String test0(Lib1<@Nullable String> lib) {\n" +
+ " return lib.get();\n" +
+ " }\n" +
+ " @NonNull String test1(Lib1<@NonNull String> lib) {\n" +
+ " return lib.get();\n" +
+ " }\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
CompilationUnit reconciled = unit.reconcile(getJLS8(), true, null, new NullProgressMonitor());
@@ -2060,59 +2060,59 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
// just mark that Lib1 now has null annotations:
createFileInProject("annots/libs", "Lib1.eea",
"class libs/Lib1\n" +
- " <T:Ljava/lang/Object;>\n" +
- " <T:Ljava/lang/Object;>\n" +
+ " <T:Ljava/lang/Object;>\n" +
+ " <T:Ljava/lang/Object;>\n" +
"\n");
reconciled = unit.reconcile(getJLS8(), true, null, new NullProgressMonitor());
assertProblems(reconciled.getProblems(), new String[] {
"Pb(953) Null type mismatch (type annotations): required '@NonNull String' but this expression has type '@Nullable String'",
}, new int[] { 8 });
}
-
+
public void testFreeTypeVariableReturnSeverities() throws Exception {
myCreateJavaProject("TestLibs");
addLibraryWithExternalAnnotations(this.project, "lib1.jar", "annots", new String[] {
"/UnannotatedLib/libs/Lib1.java",
- "package libs;\n" +
- "\n" +
- "public interface Lib1<T> {\n" +
- " T get();\n" +
+ "package libs;\n" +
+ "\n" +
+ "public interface Lib1<T> {\n" +
+ " T get();\n" +
"}\n"
}, null);
this.currentProject = this.project;
addLibrary("lib2.jar", null, new String[] {
"/UnanntatedLib2/libs/Lib2.java",
- "package libs;\n" +
- "\n" +
- "public interface Lib2<T> {\n" +
- " T get();\n" +
- "}\n"
+ "package libs;\n" +
+ "\n" +
+ "public interface Lib2<T> {\n" +
+ " T get();\n" +
+ "}\n"
}, "1.8");
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
- fragment.createCompilationUnit("Lib3.java",
+ fragment.createCompilationUnit("Lib3.java",
"package tests;\n" +
"public interface Lib3<T> {\n" +
" T get();\n" +
"}\n",
true, new NullProgressMonitor());
this.project.getProject().build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
- ICompilationUnit unit = fragment.createCompilationUnit("Test1.java",
- "package tests;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "import libs.Lib1;\n" +
- "import libs.Lib2;\n" +
- "\n" +
- "public class Test1 {\n" +
- " @NonNull String test1(Lib1<@NonNull String> lib) {\n" +
+ ICompilationUnit unit = fragment.createCompilationUnit("Test1.java",
+ "package tests;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "import libs.Lib1;\n" +
+ "import libs.Lib2;\n" +
+ "\n" +
+ "public class Test1 {\n" +
+ " @NonNull String test1(Lib1<@NonNull String> lib) {\n" +
" return lib.get();\n" + // legacy, prepared for .eea but still not annotated (=> Warning)
- " }\n" +
- " @NonNull String test2(Lib2<@NonNull String> lib) {\n" +
+ " }\n" +
+ " @NonNull String test2(Lib2<@NonNull String> lib) {\n" +
" return lib.get();\n" + // legacy, not prepared for .eea (=> Info)
- " }\n" +
- " @NonNull String test3(Lib3<@NonNull String> lib) {\n" +
+ " }\n" +
+ " @NonNull String test3(Lib3<@NonNull String> lib) {\n" +
" return lib.get();\n" + // not legacy, is from the same project
- " }\n" +
+ " }\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
CompilationUnit reconciled = unit.reconcile(getJLS8(), true, null, new NullProgressMonitor());
@@ -2142,13 +2142,13 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
"}\n"
}, null);
createFileInProject("annots/libs", "Map$Entry.eea",
- "class libs/Map$Entry\n" +
+ "class libs/Map$Entry\n" +
"comparingByKey\n" +
" <K::Llibs/Comparable<-TK;>;V:Ljava/lang/Object;>()Llibs/Comparator<Llibs/Map$Entry<TK;TV;>;>;\n" +
" <K::Llibs/Comparable<-TK;>;V:Ljava/lang/Object;>()L1libs/Comparator<Llibs/Map$Entry<TK;TV;>;>;\n"
);
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
- ICompilationUnit unit = fragment.createCompilationUnit("Test.java",
+ ICompilationUnit unit = fragment.createCompilationUnit("Test.java",
"package tests;\n" +
"\n" +
"import libs.Map;\n" +
@@ -2174,30 +2174,30 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
myCreateJavaProject("TestLibs");
addLibraryWithExternalAnnotations(this.project, "lib1.jar", "annots", new String[] {
"/UnannotatedLib/libs/Lib1.java",
- "package libs;\n" +
- "\n" +
- "public interface Lib1 {\n" +
- " void methodWithParamAfterWildcard(Class<?> c, Object s);\n" +
+ "package libs;\n" +
+ "\n" +
+ "public interface Lib1 {\n" +
+ " void methodWithParamAfterWildcard(Class<?> c, Object s);\n" +
"}\n"
}, null);
// annotations directly on a wildcard (*, +, -)
createFileInProject("annots/libs", "Lib1.eea",
- "class libs/Lib1\n" +
- "\n" +
- "methodWithParamAfterWildcard\n" +
- " (Ljava/lang/Class<*>;Ljava/lang/Object;)V\n" +
+ "class libs/Lib1\n" +
+ "\n" +
+ "methodWithParamAfterWildcard\n" +
+ " (Ljava/lang/Class<*>;Ljava/lang/Object;)V\n" +
" (L1java/lang/Class<*>;L1java/lang/Object;)V\n" +
- "\n" +
+ "\n" +
"\n");
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
- ICompilationUnit unit = fragment.createCompilationUnit("Test1.java",
- "package tests;\n" +
- "import libs.Lib1;\n" +
- "\n" +
- "public class Test1 {\n" +
- " void test1(Lib1 lib) {\n" +
+ ICompilationUnit unit = fragment.createCompilationUnit("Test1.java",
+ "package tests;\n" +
+ "import libs.Lib1;\n" +
+ "\n" +
+ "public class Test1 {\n" +
+ " void test1(Lib1 lib) {\n" +
" lib.methodWithParamAfterWildcard(Object.class, null);\n" + // error, second param must not be null
- " }\n" +
+ " }\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
CompilationUnit reconciled = unit.reconcile(AST.JLS8, true, null, new NullProgressMonitor());
@@ -2206,7 +2206,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
"Pb(910) Null type mismatch: required '@NonNull Object' but the provided value is null"
}, new int[] { 6 });
}
-
+
/** assert that per-workspace configuration re rt.jar is overridden by per-project configuration for JRE container. */
public void testBug465296() throws Exception {
// library type used: j.u.Map (no need for JRE8)
@@ -2233,11 +2233,11 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
try {
setupJavaProject("Bug509715ProjA");
this.project.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
-
+
setupJavaProject("Bug509715ProjB");
// local eea should not shadow those configured in ProjA:
addProjectDependencyWithExternalAnnotations(this.project, "/Bug509715ProjA", "/Bug509715ProjB/eea", null);
-
+
this.project.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = this.project.getProject().findMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, false, IResource.DEPTH_INFINITE);
assertNoMarkers(markers);
@@ -2249,7 +2249,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
}
/**
- * Assert that external annotations configured for project A's library are considered also while compiling dependent project B.
+ * Assert that external annotations configured for project A's library are considered also while compiling dependent project B.
* Reconcile.
*/
@SuppressWarnings("deprecation")
@@ -2257,7 +2257,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
try {
setupJavaProject("Bug509715ProjA");
this.project.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
-
+
setupJavaProject("Bug509715ProjB");
// local eea should not shadow those configured in ProjA:
addProjectDependencyWithExternalAnnotations(this.project, "/Bug509715ProjA", "/Bug509715ProjB/eea", null);
@@ -2278,25 +2278,25 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
try {
String projectName = "Bug500024";
setupJavaProject(projectName, true, true);
-
+
addEeaToVariableEntry("JCL18_FULL", "/"+projectName+"/annots");
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("test1", true, null);
ICompilationUnit unit = fragment.getCompilationUnit("Test1.java").getWorkingCopy(new NullProgressMonitor());
CompilationUnit reconciled = unit.reconcile(AST.JLS8, true, null, new NullProgressMonitor());
IProblem[] problems = reconciled.getProblems();
- assertProblems(problems,
+ assertProblems(problems,
new String[] {
"Pb(980) 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",
- "Pb(149) Dead code",
- "Pb(915) Illegal redefinition of parameter other, inherited method from Object declares this parameter as @Nullable"
+ "Pb(149) Dead code",
+ "Pb(915) Illegal redefinition of parameter other, inherited method from Object declares this parameter as @Nullable"
},
new int[] {9, 11, 13},
new int[] { ProblemSeverities.Warning, ProblemSeverities.Warning, ProblemSeverities.Error });
-
+
this.project.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = this.project.getProject().findMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, false, IResource.DEPTH_INFINITE);
sortMarkers(markers);
- assertMarkers("Markers after full build",
+ assertMarkers("Markers after full build",
"Dead code\n" +
"Illegal redefinition of parameter other, inherited method from Object declares this parameter as @Nullable\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",
@@ -2317,7 +2317,7 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
try {
String projectName = "Bug500024";
setupJavaProject(projectName, true, true);
-
+
String projectLoc = this.project.getResource().getLocation().toString();
String annotsZip = "/annots.zip";
String zipFile = projectLoc + annotsZip;
@@ -2328,22 +2328,22 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
addEeaToVariableEntry("JCL18_FULL", "/"+projectName+annotsZip);
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("test1", true, null);
ICompilationUnit unit = fragment.getCompilationUnit("Test1.java").getWorkingCopy(new NullProgressMonitor());
-
+
CompilationUnit reconciled = unit.reconcile(AST.JLS8, true, null, new NullProgressMonitor());
IProblem[] problems = reconciled.getProblems();
- assertProblems(problems,
+ assertProblems(problems,
new String[] {
"Pb(980) 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",
- "Pb(149) Dead code",
- "Pb(915) Illegal redefinition of parameter other, inherited method from Object declares this parameter as @Nullable"
+ "Pb(149) Dead code",
+ "Pb(915) Illegal redefinition of parameter other, inherited method from Object declares this parameter as @Nullable"
},
new int[] {9, 11, 13},
new int[] { ProblemSeverities.Warning, ProblemSeverities.Warning, ProblemSeverities.Error });
-
+
this.project.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = this.project.getProject().findMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, false, IResource.DEPTH_INFINITE);
sortMarkers(markers);
- assertMarkers("Markers after full build",
+ assertMarkers("Markers after full build",
"Dead code\n" +
"Illegal redefinition of parameter other, inherited method from Object declares this parameter as @Nullable\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",
@@ -2365,15 +2365,15 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
addLibraryWithExternalAnnotations(this.project, "lib1.jar", "annots",
new String[] {
"/UnannotatedLib/libs/Collectors.java",
- "package libs;\n" +
- "public interface Collectors {\n" +
- " Collector<CharSequence, ?, String> joining(CharSequence delimiter);\n" +
- "\n" +
+ "package libs;\n" +
+ "public interface Collectors {\n" +
+ " Collector<CharSequence, ?, String> joining(CharSequence delimiter);\n" +
+ "\n" +
"}\n",
"/UnannotatedLib/libs/Stream.java",
"package libs;\n" +
"public interface Stream<T> {\n" +
- " <R, A> R collect(Collector<? super T, A, R> collector);\n" +
+ " <R, A> R collect(Collector<? super T, A, R> collector);\n" +
"}\n",
"/UnannotatedLib/libs/List.java",
"package libs;\n" +
@@ -2385,25 +2385,25 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
"public interface Collector<T, A, R> { }\n"
}, null);
createFileInProject("annots/libs", "Collectors.eea",
- "class libs/Collectors\n" +
- "\n" +
- "joining\n" +
- " (Ljava/lang/CharSequence;)Llibs/Collector<Ljava/lang/CharSequence;*Ljava/lang/String;>;\n" +
+ "class libs/Collectors\n" +
+ "\n" +
+ "joining\n" +
+ " (Ljava/lang/CharSequence;)Llibs/Collector<Ljava/lang/CharSequence;*Ljava/lang/String;>;\n" +
" (Ljava/lang/CharSequence;)L1libs/Collector<L1java/lang/CharSequence;*1L1java/lang/String;>;\n" +
- "\n" +
+ "\n" +
"\n");
createFile(this.project.getElementName()+"/annots/libs/Stream.eea",
- "class libs/Stream\n" +
+ "class libs/Stream\n" +
"\n");
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
- ICompilationUnit unit = fragment.createCompilationUnit("Example.java",
- "package tests;\n" +
+ ICompilationUnit unit = fragment.createCompilationUnit("Example.java",
+ "package tests;\n" +
"import libs.*;\n" +
- "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
- "public class Example {\n" +
- " public String func(List<String> list, Collectors collectors){\n" +
- " return list.stream().collect(collectors.joining(\",\"));\n" +
- " }\n" +
+ "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
+ "public class Example {\n" +
+ " public String func(List<String> list, Collectors collectors){\n" +
+ " return list.stream().collect(collectors.joining(\",\"));\n" +
+ " }\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
CompilationUnit reconciled = unit.reconcile(AST.JLS8, true, null, new NullProgressMonitor());
@@ -2417,15 +2417,15 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
addLibraryWithExternalAnnotations(this.project, "lib1.jar", "annots",
new String[] {
"/UnannotatedLib/libs/Collectors.java",
- "package libs;\n" +
- "public interface Collectors {\n" +
- " Collector<CharSequence, ? extends Object, String> joining(CharSequence delimiter);\n" +
- "\n" +
+ "package libs;\n" +
+ "public interface Collectors {\n" +
+ " Collector<CharSequence, ? extends Object, String> joining(CharSequence delimiter);\n" +
+ "\n" +
"}\n",
"/UnannotatedLib/libs/Stream.java",
"package libs;\n" +
"public interface Stream<T> {\n" +
- " <R, A> R collect(Collector<? super T, A, R> collector);\n" +
+ " <R, A> R collect(Collector<? super T, A, R> collector);\n" +
"}\n",
"/UnannotatedLib/libs/List.java",
"package libs;\n" +
@@ -2437,25 +2437,25 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
"public interface Collector<T, A, R> { }\n"
}, null);
createFileInProject("annots/libs", "Collectors.eea",
- "class libs/Collectors\n" +
- "\n" +
- "joining\n" +
- " (Ljava/lang/CharSequence;)Llibs/Collector<Ljava/lang/CharSequence;+Ljava/lang/Object;Ljava/lang/String;>;\n" +
+ "class libs/Collectors\n" +
+ "\n" +
+ "joining\n" +
+ " (Ljava/lang/CharSequence;)Llibs/Collector<Ljava/lang/CharSequence;+Ljava/lang/Object;Ljava/lang/String;>;\n" +
" (Ljava/lang/CharSequence;)L1libs/Collector<L1java/lang/CharSequence;+1L1java/lang/Object;L1java/lang/String;>;\n" +
- "\n" +
+ "\n" +
"\n");
createFile(this.project.getElementName()+"/annots/libs/Stream.eea",
- "class libs/Stream\n" +
+ "class libs/Stream\n" +
"\n");
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
- ICompilationUnit unit = fragment.createCompilationUnit("Example.java",
- "package tests;\n" +
+ ICompilationUnit unit = fragment.createCompilationUnit("Example.java",
+ "package tests;\n" +
"import libs.*;\n" +
- "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
- "public class Example {\n" +
- " public String func(List<String> list, Collectors collectors){\n" +
- " return list.stream().collect(collectors.joining(\",\"));\n" +
- " }\n" +
+ "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
+ "public class Example {\n" +
+ " public String func(List<String> list, Collectors collectors){\n" +
+ " return list.stream().collect(collectors.joining(\",\"));\n" +
+ " }\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
CompilationUnit reconciled = unit.reconcile(AST.JLS8, true, null, new NullProgressMonitor());
@@ -2476,25 +2476,25 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
public void testBug525715() throws Exception {
myCreateJavaProject("TestLibs");
String lib1Content =
- "package libs;\n" +
+ "package libs;\n" +
"\n" +
"public abstract class Lib1<T,U> {\n" +
" public abstract Lib1<T,U> take(Lib1<T,U> x, Object y);\n" +
"}\n";
addLibraryWithExternalAnnotations(this.project, "lib1.jar", "annots", new String[] {
"/UnannotatedLib/libs/Lib1.java",
- lib1Content
+ lib1Content
}, null);
// type check sources:
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
ICompilationUnit cu = fragment.createCompilationUnit("Test1.java",
- "package tests;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "import libs.Lib1;\n" +
- "\n" +
- "@NonNullByDefault\n" +
- "public abstract class Test1 extends Lib1<String,String> {\n" +
+ "package tests;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "import libs.Lib1;\n" +
+ "\n" +
+ "@NonNullByDefault\n" +
+ "public abstract class Test1 extends Lib1<String,String> {\n" +
" public abstract Lib1<String,String> take(Lib1<String,String> x, Object y);\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
@@ -2514,14 +2514,14 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
parser.setBindingsRecovery(false);
CompilationUnit unit = (CompilationUnit) parser.createAST(null);
libWorkingCopy.discardWorkingCopy();
-
+
// find type binding:
int start = lib1Content.indexOf("take");
ASTNode name = NodeFinder.perform(unit, start, 0);
assertTrue("should be simple name", name.getNodeType() == ASTNode.SIMPLE_NAME);
ASTNode method = name.getParent();
IMethodBinding methodBinding = ((MethodDeclaration)method).resolveBinding();
-
+
// find annotation file (not yet existing):
IFile annotationFile = ExternalAnnotationUtil.getAnnotationFile(this.project, methodBinding.getDeclaringClass(), null);
assertFalse("file should not exist", annotationFile.exists());
@@ -2530,8 +2530,8 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
// annotate:
String originalSignature = ExternalAnnotationUtil.extractGenericSignature(methodBinding);
ExternalAnnotationUtil.annotateMember("libs/Lib1", annotationFile,
- "take",
- originalSignature,
+ "take",
+ originalSignature,
"(L1libs/Lib1<TT;TU;>;L1java/lang/Object;)Llibs/Lib1<TT;TU;>;",
MergeStrategy.OVERWRITE_ANNOTATIONS, null);
assertTrue("file should exist", annotationFile.exists());
@@ -2543,42 +2543,42 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
public void testBug517275() throws Exception {
myCreateJavaProject("TestLibs");
String lib1Content =
- "package libs;\n" +
+ "package libs;\n" +
"import java.util.List;\n" +
"public abstract class Collections {\n" +
- " public static final <T> List<T> emptyList() {\n" +
+ " public static final <T> List<T> emptyList() {\n" +
" return null;\n" +
" }\n" +
"}\n";
addLibraryWithExternalAnnotations(this.project, "lib1.jar", "annots", new String[] {
"/UnannotatedLib/libs/Collections.java",
- lib1Content
+ lib1Content
}, null);
createFileInProject("annots/libs", "Collections.eea",
- "class libs/Collections\n" +
- "\n" +
- "emptyList\n" +
- " <T:Ljava/lang/Object;>()Ljava/util/List<TT;>;\n" +
- " <T:Ljava/lang/Object;>()L1java/util/List<T1T;>;\n" +
+ "class libs/Collections\n" +
+ "\n" +
+ "emptyList\n" +
+ " <T:Ljava/lang/Object;>()Ljava/util/List<TT;>;\n" +
+ " <T:Ljava/lang/Object;>()L1java/util/List<T1T;>;\n" +
"\n");
// type check sources:
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
ICompilationUnit cu = fragment.createCompilationUnit("Test1.java",
"package tests;\n" +
- "import libs.Collections;\n" +
- "import java.util.List;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
- "\n" +
- "@NonNullByDefault\n" +
- "public class Test1 {\n" +
- " List<@NonNull String> strings;\n" +
- "\n" +
- " public Test1() {\n" +
- " strings = Collections.emptyList(); // <<<<< WARNING\n" +
- " }\n" +
+ "import libs.Collections;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+ "\n" +
+ "@NonNullByDefault\n" +
+ "public class Test1 {\n" +
+ " List<@NonNull String> strings;\n" +
+ "\n" +
+ " public Test1() {\n" +
+ " strings = Collections.emptyList(); // <<<<< WARNING\n" +
+ " }\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
CompilationUnit reconciled = cu.reconcile(getJSL9(), true, null, new NullProgressMonitor());
@@ -2589,36 +2589,36 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
public void testVargs() throws CoreException, IOException {
myCreateJavaProject("TestLibs");
String lib1Content =
- "package libs;\n" +
+ "package libs;\n" +
"public abstract class MyString {\n" +
- " public static String format(String format, Object... args) {\n" +
+ " public static String format(String format, Object... args) {\n" +
" return null;\n" +
" }\n" +
"}\n";
addLibraryWithExternalAnnotations(this.project, "lib1.jar", "annots", new String[] {
"/UnannotatedLib/libs/MyString.java",
- lib1Content
+ lib1Content
}, null);
createFileInProject("annots/libs", "MyString.eea",
- "class libs/MyString\n" +
- "\n" +
- "format\n" +
- " (Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;\n" +
- " (Ljava/lang/String;[Ljava/lang/Object;)L1java/lang/String;\n" +
+ "class libs/MyString\n" +
+ "\n" +
+ "format\n" +
+ " (Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;\n" +
+ " (Ljava/lang/String;[Ljava/lang/Object;)L1java/lang/String;\n" +
"\n");
// type check sources:
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
ICompilationUnit cu = fragment.createCompilationUnit("Test1.java",
"package tests;\n" +
- "import libs.MyString;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "public class Test1 {\n" +
- " public @NonNull String test(int var) {\n" +
- " return MyString.format(\"que%03d\", var);\n" +
- " }\n" +
+ "import libs.MyString;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "public class Test1 {\n" +
+ " public @NonNull String test(int var) {\n" +
+ " return MyString.format(\"que%03d\", var);\n" +
+ " }\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
CompilationUnit reconciled = cu.reconcile(getJSL9(), true, null, new NullProgressMonitor());
@@ -2636,18 +2636,18 @@ public class ExternalAnnotations18Test extends ModifyingResourceTests {
ICompilationUnit unit = fragment.getCompilationUnit("Test.java").getWorkingCopy(new NullProgressMonitor());
CompilationUnit reconciled = unit.reconcile(AST.JLS8, true, null, new NullProgressMonitor());
IProblem[] problems = reconciled.getProblems();
- assertProblems(problems,
+ assertProblems(problems,
new String[] {
"Pb(983) Unsafe null type conversion (type annotations): The value of type 'Collector<@NonNull String,capture#of ?,Set<@NonNull String>>' " +
"is made accessible using the less-annotated type 'Collector<? super String,Object,Set<@NonNull String>>'",
},
new int[] {11},
new int[] { ProblemSeverities.Warning });
-
+
this.project.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = this.project.getProject().findMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, false, IResource.DEPTH_INFINITE);
sortMarkers(markers);
- assertMarkers("Markers after full build",
+ assertMarkers("Markers after full build",
"Unsafe null type conversion (type annotations): The value of type 'Collector<@NonNull String,capture#of ?,Set<@NonNull String>>' is made accessible using the less-annotated type 'Collector<? super String,Object,Set<@NonNull String>>'",
markers);
int[] severities = new int[] { IMarker.SEVERITY_WARNING };
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ExternalAnnotations9Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ExternalAnnotations9Test.java
index 9a21107aa..5083ab3bd 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ExternalAnnotations9Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ExternalAnnotations9Test.java
@@ -44,7 +44,7 @@ public class ExternalAnnotations9Test extends ExternalAnnotations18Test {
public ExternalAnnotations9Test(String name) {
super(name, "9", "JCL19_LIB");
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which do not belong to the class are skipped...
static {
@@ -88,37 +88,37 @@ public class ExternalAnnotations9Test extends ExternalAnnotations18Test {
public void testBug525712() throws Exception {
myCreateJavaProject("TestLibs");
String lib1Content =
- "package libs;\n" +
+ "package libs;\n" +
"\n" +
"public abstract class Lib1 {\n" +
" public abstract void take(X x);\n" +
"}\n";
addLibraryWithExternalAnnotations(this.project, "lib1.jar", "annots", new String[] {
"/UnannotatedLib/module-info.java",
- "module testlib {\n" +
- " exports libs;\n" +
+ "module testlib {\n" +
+ " exports libs;\n" +
"}\n",
"/UnannotatedLib/libs/Lib1.java",
lib1Content,
"/UnannotatedLib/libs/X.java",
- "package libs;\n" +
+ "package libs;\n" +
"public abstract class X {\n" +
- "}\n",
-
-
+ "}\n",
+
+
}, null);
// type check sources:
IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
ICompilationUnit cu = fragment.createCompilationUnit("Test1.java",
- "package tests;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "import libs.Lib1;\n" +
- "import libs.X;\n" +
- "\n" +
- "@NonNullByDefault\n" +
- "public abstract class Test1 extends Lib1 {\n" +
+ "package tests;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "import libs.Lib1;\n" +
+ "import libs.X;\n" +
+ "\n" +
+ "@NonNullByDefault\n" +
+ "public abstract class Test1 extends Lib1 {\n" +
" public abstract void take(X x);\n" +
"}\n",
true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
@@ -137,14 +137,14 @@ public class ExternalAnnotations9Test extends ExternalAnnotations18Test {
parser.setBindingsRecovery(false);
CompilationUnit unit = (CompilationUnit) parser.createAST(null);
libWorkingCopy.discardWorkingCopy();
-
+
// find type binding:
int start = lib1Content.indexOf("take");
ASTNode name = NodeFinder.perform(unit, start, 0);
assertTrue("should be simple name", name.getNodeType() == ASTNode.SIMPLE_NAME);
ASTNode method = name.getParent();
IMethodBinding methodBinding = ((MethodDeclaration)method).resolveBinding();
-
+
// find annotation file (not yet existing):
IFile annotationFile = ExternalAnnotationUtil.getAnnotationFile(this.project, methodBinding.getDeclaringClass(), null);
assertFalse("file should not exist", annotationFile.exists());
@@ -153,8 +153,8 @@ public class ExternalAnnotations9Test extends ExternalAnnotations18Test {
// annotate:
String originalSignature = ExternalAnnotationUtil.extractGenericSignature(methodBinding);
ExternalAnnotationUtil.annotateMember("libs/Lib1", annotationFile,
- "take",
- originalSignature,
+ "take",
+ originalSignature,
"(L1libs/X;)V",
MergeStrategy.OVERWRITE_ANNOTATIONS, null);
assertTrue("file should exist", annotationFile.exists());
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/FreezeMonitor.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/FreezeMonitor.java
index 5b67f655d..5aa116f07 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/FreezeMonitor.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/FreezeMonitor.java
@@ -25,7 +25,7 @@ import org.eclipse.core.runtime.jobs.Job;
public class FreezeMonitor {
- private static /* @Nullable */ Job monitorJob;
+ private static /* @Nullable */ Job monitorJob;
public static void expectCompletionIn(final long millis) {
done();
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/HierarchyOnWorkingCopiesTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/HierarchyOnWorkingCopiesTests.java
index b50e14e85..71956490c 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/HierarchyOnWorkingCopiesTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/HierarchyOnWorkingCopiesTests.java
@@ -118,19 +118,19 @@ public void testSimpleSuperTypeHierarchy() throws CoreException {
}
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=228845
-//make sure uncommitted changes to primary working copy shows up in hierarchy
+//make sure uncommitted changes to primary working copy shows up in hierarchy
public void test228845() throws CoreException {
String newContents =
"package x.y;\n" +
"public class A extends B {\n" +
"}";
-
+
ICompilationUnit primaryCu = this.copy.getPrimary();
primaryCu.becomeWorkingCopy(null);
-
+
primaryCu.getBuffer().setContents(newContents);
primaryCu.reconcile(ICompilationUnit.NO_AST, false, null, null);
-
+
IFile file = null;
try {
file = this.createFile(
@@ -161,7 +161,7 @@ public void test228845() throws CoreException {
//make sure uncommitted changes to primary working copy shows up in hierarchy
//created out of a BinaryType.
public void test228845b() throws CoreException, IOException {
-
+
addLibrary(getJavaProject("P"), "myLib.jar", "myLibsrc.zip", new String[] {
"my/pkg/X.java",
"package my.pkg;\n" +
@@ -172,11 +172,11 @@ public void test228845b() throws CoreException, IOException {
"public class Y {\n" +
" }\n",
}, JavaCore.VERSION_1_4);
-
-
+
+
IFile file = null;
ICompilationUnit primaryCu = null;
-
+
try {
file = this.createFile(
"P/src/Q.java",
@@ -184,21 +184,21 @@ public void test228845b() throws CoreException, IOException {
primaryCu = this.getCompilationUnit("P/src/Q.java").getWorkingCopy(null).getPrimary();
primaryCu.becomeWorkingCopy(null);
-
+
String newContents =
"public class Q extends my.pkg.X {\n" +
"}";
-
+
primaryCu.getBuffer().setContents(newContents);
primaryCu.reconcile(ICompilationUnit.NO_AST, false, null, null);
-
+
IOrdinaryClassFile cf = getClassFile("P", "myLib.jar", "my.pkg", "X.class");
IType typ = cf.getType();
-
- ITypeHierarchy h = typ.newTypeHierarchy(null);
-
+
+ ITypeHierarchy h = typ.newTypeHierarchy(null);
+
assertHierarchyEquals(
- "Focus: X [in X.class [in my.pkg [in myLib.jar [in P]]]]\n" +
+ "Focus: X [in X.class [in my.pkg [in myLib.jar [in P]]]]\n" +
"Super types:\n" +
" Object [in Object.class [in java.lang [in "+ getExternalJCLPathString() + "]]]\n" +
"Sub types:\n" +
@@ -215,7 +215,7 @@ public void test228845b() throws CoreException, IOException {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=228845
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=400905
-// Fix for 228845 does not seem to work for anonymous/local/functional types.
+// Fix for 228845 does not seem to work for anonymous/local/functional types.
public void test400905() throws CoreException {
String newContents =
"package x.y;\n" +
@@ -224,13 +224,13 @@ public void test400905() throws CoreException {
" class X extends B {}\n" +
" }\n" +
"}";
-
+
ICompilationUnit primaryCu = this.copy.getPrimary();
primaryCu.becomeWorkingCopy(null);
-
+
primaryCu.getBuffer().setContents(newContents);
primaryCu.reconcile(ICompilationUnit.NO_AST, false, null, null);
-
+
IFile file = null;
try {
file = this.createFile(
@@ -243,10 +243,10 @@ public void test400905() throws CoreException {
ITypeHierarchy h = type.newTypeHierarchy(null); // no working copies explicitly passed, should still honor primary working copies.
assertHierarchyEquals(
- "Focus: B [in B.java [in x.y [in src [in P]]]]\n" +
- "Super types:\n" +
- " Object [in Object.class [in java.lang [in "+ getExternalJCLPathString() + "]]]\n" +
- "Sub types:\n" +
+ "Focus: B [in B.java [in x.y [in src [in P]]]]\n" +
+ "Super types:\n" +
+ " Object [in Object.class [in java.lang [in "+ getExternalJCLPathString() + "]]]\n" +
+ "Sub types:\n" +
" X [in foo() [in A [in [Working copy] A.java [in x.y [in src [in P]]]]]]\n",
h);
} finally {
@@ -258,7 +258,7 @@ public void test400905() throws CoreException {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=228845
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=400905
-// Fix for 228845 does not seem to work for anonymous/local/functional types.
+// Fix for 228845 does not seem to work for anonymous/local/functional types.
public void test400905a() throws CoreException {
String newContents =
"package x.y;\n" +
@@ -267,13 +267,13 @@ public void test400905a() throws CoreException {
" X x = new B() {}\n" +
" }\n" +
"}";
-
+
ICompilationUnit primaryCu = this.copy.getPrimary();
primaryCu.becomeWorkingCopy(null);
-
+
primaryCu.getBuffer().setContents(newContents);
primaryCu.reconcile(ICompilationUnit.NO_AST, false, null, null);
-
+
IFile file = null;
try {
file = this.createFile(
@@ -286,10 +286,10 @@ public void test400905a() throws CoreException {
ITypeHierarchy h = type.newTypeHierarchy(null); // no working copies explicitly passed, should still honor primary working copies.
assertHierarchyEquals(
- "Focus: B [in B.java [in x.y [in src [in P]]]]\n" +
- "Super types:\n" +
- " Object [in Object.class [in java.lang [in "+ getExternalJCLPathString() + "]]]\n" +
- "Sub types:\n" +
+ "Focus: B [in B.java [in x.y [in src [in P]]]]\n" +
+ "Super types:\n" +
+ " Object [in Object.class [in java.lang [in "+ getExternalJCLPathString() + "]]]\n" +
+ "Sub types:\n" +
" <anonymous #1> [in foo() [in A [in [Working copy] A.java [in x.y [in src [in P]]]]]]\n",
h);
} finally {
@@ -301,7 +301,7 @@ public void test400905a() throws CoreException {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=228845
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=400905
-// Fix for 228845 does not seem to work for anonymous/local/functional types.
+// Fix for 228845 does not seem to work for anonymous/local/functional types.
public void test400905b() throws CoreException, IOException {
IJavaProject javaProject = getJavaProject("P");
String oldCompliance = javaProject.getOption(JavaCore.COMPILER_COMPLIANCE, true);
@@ -348,11 +348,11 @@ public void test400905b() throws CoreException, IOException {
ITypeHierarchy h = type.newTypeHierarchy(null); // no working copies explicitly passed, should still honor primary working copies.
assertHierarchyEquals(
- "Focus: I [in [Working copy] A.java [in x.y [in src [in P]]]]\n" +
- "Super types:\n" +
- "Sub types:\n" +
- " <lambda #1> [in i [in X [in [Working copy] A.java [in x.y [in src [in P]]]]]]\n" +
- " <lambda #1> [in main(String[]) [in X [in [Working copy] A.java [in x.y [in src [in P]]]]]]\n" +
+ "Focus: I [in [Working copy] A.java [in x.y [in src [in P]]]]\n" +
+ "Super types:\n" +
+ "Sub types:\n" +
+ " <lambda #1> [in i [in X [in [Working copy] A.java [in x.y [in src [in P]]]]]]\n" +
+ " <lambda #1> [in main(String[]) [in X [in [Working copy] A.java [in x.y [in src [in P]]]]]]\n" +
" <lambda #1> [in main(String[]) [in X [in [Working copy] A.java [in x.y [in src [in P]]]]]]\n",
h);
} finally {
@@ -414,15 +414,15 @@ public void test429435() throws CoreException, IOException {
ITypeHierarchy h = type.newTypeHierarchy(null); // no working copies explicitly passed, should still honor primary working copies.
assertHierarchyEquals(
- "Focus: I [in [Working copy] A.java [in x.y [in src [in P]]]]\n" +
- "Super types:\n" +
- "Sub types:\n" +
- " <lambda #1> [in doit() [in <anonymous #1> [in doit() [in <lambda #1> [in zoo() [in X [in [Working copy] A.java [in x.y [in src [in P]]]]]]]]]]\n" +
- " <lambda #1> [in doit() [in <lambda #1> [in doit() [in <lambda #1> [in doit() [in <lambda #1> [in doit() [in <lambda #1> [in zoo() [in X [in [Working copy] A.java [in x.y [in src [in P]]]]]]]]]]]]]]\n" +
- " <lambda #1> [in doit() [in <lambda #1> [in doit() [in <lambda #1> [in doit() [in <lambda #1> [in zoo() [in X [in [Working copy] A.java [in x.y [in src [in P]]]]]]]]]]]]\n" +
- " <lambda #1> [in doit() [in <lambda #1> [in doit() [in <lambda #1> [in zoo() [in X [in [Working copy] A.java [in x.y [in src [in P]]]]]]]]]]\n" +
- " <lambda #1> [in doit() [in <lambda #1> [in zoo() [in X [in [Working copy] A.java [in x.y [in src [in P]]]]]]]]\n" +
- " <lambda #1> [in zoo() [in X [in [Working copy] A.java [in x.y [in src [in P]]]]]]\n" +
+ "Focus: I [in [Working copy] A.java [in x.y [in src [in P]]]]\n" +
+ "Super types:\n" +
+ "Sub types:\n" +
+ " <lambda #1> [in doit() [in <anonymous #1> [in doit() [in <lambda #1> [in zoo() [in X [in [Working copy] A.java [in x.y [in src [in P]]]]]]]]]]\n" +
+ " <lambda #1> [in doit() [in <lambda #1> [in doit() [in <lambda #1> [in doit() [in <lambda #1> [in doit() [in <lambda #1> [in zoo() [in X [in [Working copy] A.java [in x.y [in src [in P]]]]]]]]]]]]]]\n" +
+ " <lambda #1> [in doit() [in <lambda #1> [in doit() [in <lambda #1> [in doit() [in <lambda #1> [in zoo() [in X [in [Working copy] A.java [in x.y [in src [in P]]]]]]]]]]]]\n" +
+ " <lambda #1> [in doit() [in <lambda #1> [in doit() [in <lambda #1> [in zoo() [in X [in [Working copy] A.java [in x.y [in src [in P]]]]]]]]]]\n" +
+ " <lambda #1> [in doit() [in <lambda #1> [in zoo() [in X [in [Working copy] A.java [in x.y [in src [in P]]]]]]]]\n" +
+ " <lambda #1> [in zoo() [in X [in [Working copy] A.java [in x.y [in src [in P]]]]]]\n" +
" Y [in [Working copy] A.java [in x.y [in src [in P]]]]\n",
h);
} finally {
@@ -435,7 +435,7 @@ public void test429435() throws CoreException, IOException {
javaProject.setOption(JavaCore.COMPILER_SOURCE, oldSource);
}
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=429537, [1.8][hierarchy]NPE in hierarchy resolution
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=429537, [1.8][hierarchy]NPE in hierarchy resolution
public void test429537() throws CoreException, IOException {
IJavaProject javaProject = getJavaProject("P");
String oldCompliance = javaProject.getOption(JavaCore.COMPILER_COMPLIANCE, true);
@@ -470,12 +470,12 @@ public void test429537() throws CoreException, IOException {
ITypeHierarchy h = type.newTypeHierarchy(null); // no working copies explicitly passed, should still honor primary working copies.
assertHierarchyEquals(
- "Focus: I [in [Working copy] A.java [in x.y [in src [in P]]]]\n" +
- "Super types:\n" +
- "Sub types:\n" +
- " <lambda #1> [in main(String[]) [in X [in [Working copy] A.java [in x.y [in src [in P]]]]]]\n" +
- " <lambda #1> [in main(String[]) [in X [in [Working copy] A.java [in x.y [in src [in P]]]]]]\n" +
- " <lambda #1> [in main(String[]) [in X [in [Working copy] A.java [in x.y [in src [in P]]]]]]\n" +
+ "Focus: I [in [Working copy] A.java [in x.y [in src [in P]]]]\n" +
+ "Super types:\n" +
+ "Sub types:\n" +
+ " <lambda #1> [in main(String[]) [in X [in [Working copy] A.java [in x.y [in src [in P]]]]]]\n" +
+ " <lambda #1> [in main(String[]) [in X [in [Working copy] A.java [in x.y [in src [in P]]]]]]\n" +
+ " <lambda #1> [in main(String[]) [in X [in [Working copy] A.java [in x.y [in src [in P]]]]]]\n" +
" <lambda #1> [in main(String[]) [in X [in [Working copy] A.java [in x.y [in src [in P]]]]]]\n",
h);
} finally {
@@ -582,11 +582,11 @@ public void test450442() throws CoreException, IOException {
ITypeHierarchy h = project.findType("Claxx").newSupertypeHierarchy(null);
assertHierarchyEquals(
- "Focus: Claxx [in Claxx.java [in <default> [in src [in Bug450442]]]]\n" +
- "Super types:\n" +
- " Object [in Object.class [in java.lang [in "+ getExternalJCLPathString() + "]]]\n" +
+ "Focus: Claxx [in Claxx.java [in <default> [in src [in Bug450442]]]]\n" +
+ "Super types:\n" +
+ " Object [in Object.class [in java.lang [in "+ getExternalJCLPathString() + "]]]\n" +
"Sub types:\n",
- h);
+ h);
} finally {
if (project != null)
this.deleteProject(project);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/IgnoreOptionalProblemsFromSourceFoldersTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/IgnoreOptionalProblemsFromSourceFoldersTests.java
index 2d34fdae8..a0f875d74 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/IgnoreOptionalProblemsFromSourceFoldersTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/IgnoreOptionalProblemsFromSourceFoldersTests.java
@@ -40,7 +40,7 @@ public class IgnoreOptionalProblemsFromSourceFoldersTests extends ModifyingResou
public IgnoreOptionalProblemsFromSourceFoldersTests(String name) {
super(name);
}
-
+
/**
* Internal synonym for deprecated constant AST.JSL3
* to alleviate deprecation warnings.
@@ -301,7 +301,7 @@ public class IgnoreOptionalProblemsFromSourceFoldersTests extends ModifyingResou
deleteProject("P");
}
}
-
+
/**
* createASTs() should not respect this option.
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=372377
@@ -327,12 +327,12 @@ public class IgnoreOptionalProblemsFromSourceFoldersTests extends ModifyingResou
" }\n" +
"}");
ICompilationUnit unit = (ICompilationUnit) JavaCore.create(file);
-
+
ASTParser parser = ASTParser.newParser(JLS3_INTERNAL);
parser.setProject(project);
parser.setSource(unit);
parser.setResolveBindings(true);
-
+
class Requestor extends ASTRequestor {
CompilationUnit cuAST;
public void acceptAST(ICompilationUnit source,
@@ -342,7 +342,7 @@ public class IgnoreOptionalProblemsFromSourceFoldersTests extends ModifyingResou
}
Requestor requestor = new Requestor();
parser.createASTs(new ICompilationUnit[] {unit}, new String[0], requestor, null);
- IProblem[] problems = requestor.cuAST.getProblems();
+ IProblem[] problems = requestor.cuAST.getProblems();
assertEquals("Should have 1 problem", 1, problems.length);
} finally {
deleteProject("P");
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/Java9ElementTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/Java9ElementTests.java
index 29ce20f5a..aa359029b 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/Java9ElementTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/Java9ElementTests.java
@@ -106,7 +106,7 @@ public class Java9ElementTests extends AbstractJavaModelTests {
try {
IJavaProject project = createJavaProject("Java9Elements", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project.open(null);
- String fileContent =
+ String fileContent =
"module my.mod{\n" +
" exports p.q.r;" +
" exports a.b.c;\n" +
@@ -115,15 +115,15 @@ public class Java9ElementTests extends AbstractJavaModelTests {
createFolder("/Java9Elements/src/p/q/r");
createFolder("/Java9Elements/src/a/b/c");
- createFile( "/Java9Elements/src/p/q/package-info.java",
+ createFile( "/Java9Elements/src/p/q/package-info.java",
"/** Javadoc for package p.q */"
+ "package p.q;");
- createFile( "/Java9Elements/src/a/b/c/package-info.java",
+ createFile( "/Java9Elements/src/a/b/c/package-info.java",
"/** Javadoc for package a.b.c */"
+ "package a.b.c;");
ICompilationUnit unit = getCompilationUnit("/Java9Elements/src/module-info.java");
-
+
int start = fileContent.indexOf("p.q");
IJavaElement[] elements = unit.codeSelect(start, 3);
assertEquals("Incorrect no of elements", 1, elements.length);
@@ -144,7 +144,7 @@ public class Java9ElementTests extends AbstractJavaModelTests {
try {
IJavaProject project = createJavaProject("Java9Elements", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project.open(null);
- String fileContent =
+ String fileContent =
"module my.mod{\n" +
" provides com.socket.spi.NetworkSocketProvider\n" +
" with org.fastsocket.FastNetworkSocketProvider;\n" +
@@ -163,7 +163,7 @@ public class Java9ElementTests extends AbstractJavaModelTests {
try {
IJavaProject project = createJavaProject("Java9Elements", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project.open(null);
- String fileContent =
+ String fileContent =
"module my.mod{\n" +
" uses com.socket.spi.NetworkSocketProvider;\n" +
"}";
@@ -181,7 +181,7 @@ public class Java9ElementTests extends AbstractJavaModelTests {
try {
IJavaProject project = createJavaProject("Java9Elements", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project.open(null);
- String fileContent =
+ String fileContent =
"module my.mod{\n" +
" exports p.q.r;" +
" exports a.b.c;\n" +
@@ -214,7 +214,7 @@ public class Java9ElementTests extends AbstractJavaModelTests {
try {
IJavaProject project = createJavaProject("Java9Elements", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project.open(null);
- String fileContent =
+ String fileContent =
"module my.mod{\n" +
" exports p.q.r;" +
" exports a.b.c;\n" +
@@ -223,7 +223,7 @@ public class Java9ElementTests extends AbstractJavaModelTests {
project = createJavaProject("Java9Elements2", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project.open(null);
- fileContent =
+ fileContent =
"module your.mod{\n" +
" requires my.mod;\n" +
"}";
@@ -239,7 +239,7 @@ public class Java9ElementTests extends AbstractJavaModelTests {
finally {
deleteProject("Java9Elements");
deleteProject("Java9Elements2");
- }
+ }
}
public void test008() throws Exception {
try {
@@ -269,7 +269,7 @@ public class Java9ElementTests extends AbstractJavaModelTests {
finally {
deleteProject("Java9Elements");
deleteProject("Java9Elements2");
- }
+ }
}
public void test009() throws Exception {
try {
@@ -293,7 +293,7 @@ public class Java9ElementTests extends AbstractJavaModelTests {
}
finally {
deleteProject("Java9Elements");
- }
+ }
}
public void test010() throws Exception {
try {
@@ -321,15 +321,15 @@ public class Java9ElementTests extends AbstractJavaModelTests {
IJavaProject project = createJavaProject("Java9Elements", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project.open(null);
String fileContent = "module my.mod{" +
- " provides a.b.C with a.b.CImpl, a.b.DImpl;\n" +
+ " provides a.b.C with a.b.CImpl, a.b.DImpl;\n" +
" opens a.b;" +
"}\n";
createFolder("/Java9Elements/src/a/b");
createFile("/Java9Elements/src/a/b/C.java",
- "package a.b;\n" +
+ "package a.b;\n" +
"public interface C {}");
createFile("/Java9Elements/src/a/b/CImpl.java",
- "package a.b;\n" +
+ "package a.b;\n" +
"public class CImpl implements C {}");
createFile( "/Java9Elements/src/module-info.java", fileContent);
@@ -346,14 +346,14 @@ public class Java9ElementTests extends AbstractJavaModelTests {
IJavaProject project = createJavaProject("Java9Elements", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project.open(null);
String fileContent = "module my.mod{" +
- " provides a.b.C with a.b.CImpl, a.b.DImpl;\n" +
+ " provides a.b.C with a.b.CImpl, a.b.DImpl;\n" +
"}\n";
createFolder("/Java9Elements/src/a/b");
createFile("/Java9Elements/src/a/b/C.java",
- "package a.b;\n" +
+ "package a.b;\n" +
"public interface C {}");
createFile("/Java9Elements/src/a/b/CImpl.java",
- "package a.b;\n" +
+ "package a.b;\n" +
"public class CImpl implements C {}");
createFile( "/Java9Elements/src/module-info.java", fileContent);
@@ -916,7 +916,7 @@ public class Java9ElementTests extends AbstractJavaModelTests {
IJavaProject libPrj= createJavaProject("Java9Lib", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
createFile("Java9Lib/src/module-info.java", "module java9.lib {}\n");
libPrj.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
-
+
IJavaProject project = createJavaProject("Java9Elements",
new String[] {"src"},
new String[] {"JCL19_LIB", "/Java9Lib/bin"},
@@ -962,7 +962,7 @@ public class Java9ElementTests extends AbstractJavaModelTests {
" exports test1;\n" +
"}\n");
- String modOneSrc =
+ String modOneSrc =
"\n" +
"/** The no. one module. */\n" +
"module mod.one {\n" +
@@ -1048,14 +1048,14 @@ public class Java9ElementTests extends AbstractJavaModelTests {
content);
ICompilationUnit unit = getCompilationUnit("/Test/src/module-info.java");
-
+
int start = content.indexOf("ABCD");
IJavaElement[] elements = unit.codeSelect(start, 4);
assertEquals("Incorrect no of elements", 1, elements.length);
assertEquals("Incorrect element type", IJavaElement.JAVA_MODULE, elements[0].getElementType());
- assertElementEquals("Incorrect Java element",
+ assertElementEquals("Incorrect Java element",
"ABCD [in module-info.java [in <default> [in src [in mod.zero]]]]", elements[0]);
-
+
} finally {
deleteProject("Test");
deleteProject("mod.zero");
@@ -1091,14 +1091,14 @@ public class Java9ElementTests extends AbstractJavaModelTests {
"}\n");
ICompilationUnit unit = getCompilationUnit("/mod.zero/src/module-info.java");
-
+
int start = content.indexOf("PQRS");
IJavaElement[] elements = unit.codeSelect(start, 4);
assertEquals("Incorrect no of elements", 1, elements.length);
assertEquals("Incorrect element type", IJavaElement.JAVA_MODULE, elements[0].getElementType());
- assertElementEquals("Incorrect Java element",
+ assertElementEquals("Incorrect Java element",
"PQRS [in module-info.java [in <default> [in src [in Test]]]]", elements[0]);
-
+
} finally {
deleteProject("Test");
deleteProject("mod.zero");
@@ -1316,7 +1316,7 @@ public class Java9ElementTests extends AbstractJavaModelTests {
IJavaProject project1 = createJavaProject("my_mod", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
createFolder("/my_mod/src/p/q");
- createFile("/my_mod/src/p/q/R.java",
+ createFile("/my_mod/src/p/q/R.java",
"package p.q;\n" +
"public class R {\n" +
"}");
@@ -1363,7 +1363,7 @@ public class Java9ElementTests extends AbstractJavaModelTests {
finally {
deleteProject("my_mod");
deleteProject("your.mod");
- }
+ }
}
public void testSystemModule() throws Exception {
try {
@@ -1379,18 +1379,18 @@ public class Java9ElementTests extends AbstractJavaModelTests {
mod = project1.getModuleDescription();
assertFalse("should not be a system module", mod.isSystemModule());
- addModularLibrary(project1, "mod.two.jar", "mod.two-sources.zip",
+ addModularLibrary(project1, "mod.two.jar", "mod.two-sources.zip",
new String[] {
"module-info.java",
"module mod.two {}\n"
}, JavaCore.VERSION_9);
-
+
mod = project1.findModule("mod.two", this.wcOwner);
assertFalse("should not be a system module", mod.isSystemModule());
-
+
} finally {
deleteProject("my_mod");
- }
+ }
}
public void test526761a() throws Exception {
try {
@@ -1457,7 +1457,7 @@ public class Java9ElementTests extends AbstractJavaModelTests {
try {
IJavaProject project = createJavaProjectWithBaseSql();
project.open(null);
- String fileContent =
+ String fileContent =
"import java.sql.Driver;\n" +
"import p.q.Main;\n" +
"module my.mod{\n" +
@@ -1490,13 +1490,13 @@ public class Java9ElementTests extends AbstractJavaModelTests {
IJavaElement[] elements = unit.codeSelect(start, "Driver".length());
assertEquals("Incorrect no of elements", 1, elements.length);
assertEquals("Incorrect element type", IJavaElement.TYPE, elements[0].getElementType());
- assertElementEquals("Incorrect Java element",
+ assertElementEquals("Incorrect Java element",
"Driver [in Driver.class [in java.sql [in <module:java.sql>]]]", elements[0]);
start = fileContent.lastIndexOf("Main");
elements = unit.codeSelect(start, "Main".length());
assertEquals("Incorrect no of elements", 1, elements.length);
assertEquals("Incorrect element type", IJavaElement.TYPE, elements[0].getElementType());
- assertElementEquals("Incorrect Java element",
+ assertElementEquals("Incorrect Java element",
"Main [in Main.java [in p.q [in src [in Java9Elements]]]]", elements[0]);
}
finally {
@@ -1507,7 +1507,7 @@ public class Java9ElementTests extends AbstractJavaModelTests {
try {
IJavaProject project = createJavaProjectWithBaseSql();
project.open(null);
- String fileContent =
+ String fileContent =
"import java.sql.Driver;\n" +
"import p.q.Main;\n" +
"module my.mod{\n" +
@@ -1540,13 +1540,13 @@ public class Java9ElementTests extends AbstractJavaModelTests {
IJavaElement[] elements = unit.codeSelect(start, "Driver".length());
assertEquals("Incorrect no of elements", 1, elements.length);
assertEquals("Incorrect element type", IJavaElement.TYPE, elements[0].getElementType());
- assertElementEquals("Incorrect Java element",
+ assertElementEquals("Incorrect Java element",
"Driver [in Driver.class [in java.sql [in <module:java.sql>]]]", elements[0]);
start = fileContent.lastIndexOf("Main");
elements = unit.codeSelect(start, "Main".length());
assertEquals("Incorrect no of elements", 1, elements.length);
assertEquals("Incorrect element type", IJavaElement.TYPE, elements[0].getElementType());
- assertElementEquals("Incorrect Java element",
+ assertElementEquals("Incorrect Java element",
"Main [in Main.java [in p.q [in src [in Java9Elements]]]]", elements[0]);
}
finally {
@@ -1557,7 +1557,7 @@ public class Java9ElementTests extends AbstractJavaModelTests {
try {
IJavaProject project = createJavaProjectWithBaseSql();
project.open(null);
- String fileContent =
+ String fileContent =
"module my.mod{\n" +
" exports p.q;" +
" requires java.sql;\n" +
@@ -1588,13 +1588,13 @@ public class Java9ElementTests extends AbstractJavaModelTests {
IJavaElement[] elements = unit.codeSelect(start, "Driver".length());
assertEquals("Incorrect no of elements", 1, elements.length);
assertEquals("Incorrect element type", IJavaElement.TYPE, elements[0].getElementType());
- assertElementEquals("Incorrect Java element",
+ assertElementEquals("Incorrect Java element",
"Driver [in Driver.class [in java.sql [in <module:java.sql>]]]", elements[0]);
start = fileContent.lastIndexOf("Main");
elements = unit.codeSelect(start, "Main".length());
assertEquals("Incorrect no of elements", 1, elements.length);
assertEquals("Incorrect element type", IJavaElement.TYPE, elements[0].getElementType());
- assertElementEquals("Incorrect Java element",
+ assertElementEquals("Incorrect Java element",
"Main [in Main.java [in p.q [in src [in Java9Elements]]]]", elements[0]);
}
finally {
@@ -1725,7 +1725,7 @@ public class Java9ElementTests extends AbstractJavaModelTests {
assertNotNull("Should find module M", mod);
categories = mod.getCategories();
assertEquals("Expect category", "[library]", Arrays.toString(categories));
-
+
// source module with categories:
mod = project.getModuleDescription();
categories = mod.getCategories();
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaCoreOptionsTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaCoreOptionsTests.java
index 0fb4f79cd..a37b2713d 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaCoreOptionsTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaCoreOptionsTests.java
@@ -45,7 +45,7 @@ public void test1() {
currentOptions.put(JavaCore.COMPILER_TASK_PRIORITIES, "HIGH,HIGH");
currentOptions.put(JavaCore.COMPILER_TASK_TAGS, "TODO");
JavaCore.setOptions(currentOptions);
-
+
Hashtable options2 = JavaCore.getOptions();
String taskTagsValue = (String) options2.get(JavaCore.COMPILER_TASK_TAGS);
String taskPrioritiesValue = (String) options2.get(JavaCore.COMPILER_TASK_PRIORITIES);
@@ -64,7 +64,7 @@ public void test2() {
currentOptions.remove(JavaCore.COMPILER_TASK_PRIORITIES);
currentOptions.remove(JavaCore.COMPILER_TASK_TAGS);
JavaCore.setOptions(currentOptions);
-
+
Hashtable options2 = JavaCore.getOptions();
String taskTagsValue = (String) options2.get(JavaCore.COMPILER_TASK_TAGS);
String taskPrioritiesValue = (String) options2.get(JavaCore.COMPILER_TASK_PRIORITIES);
@@ -81,7 +81,7 @@ public void test3() {
currentOptions.put(JavaCore.COMPILER_TASK_PRIORITIES, "HIGH,HIGH");
currentOptions.remove(JavaCore.COMPILER_TASK_TAGS);
JavaCore.setOptions(currentOptions);
-
+
Hashtable options2 = JavaCore.getOptions();
String taskTagsValue = (String) options2.get(JavaCore.COMPILER_TASK_TAGS);
String taskPrioritiesValue = (String) options2.get(JavaCore.COMPILER_TASK_PRIORITIES);
@@ -98,7 +98,7 @@ public void test4() {
currentOptions.remove(JavaCore.COMPILER_TASK_PRIORITIES);
currentOptions.put(JavaCore.COMPILER_TASK_TAGS, "TODO");
JavaCore.setOptions(currentOptions);
-
+
Hashtable options2 = JavaCore.getOptions();
String taskTagsValue = (String) options2.get(JavaCore.COMPILER_TASK_TAGS);
String taskPrioritiesValue = (String) options2.get(JavaCore.COMPILER_TASK_PRIORITIES);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaElement8Tests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaElement8Tests.java
index 331f5dd79..851423c58 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaElement8Tests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaElement8Tests.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
*******************************************************************************/
@@ -44,7 +44,7 @@ import org.eclipse.jdt.internal.core.LambdaMethod;
import org.eclipse.jdt.internal.core.SourceMethod;
@SuppressWarnings({"rawtypes", "unchecked"})
-public class JavaElement8Tests extends AbstractJavaModelTests {
+public class JavaElement8Tests extends AbstractJavaModelTests {
static {
// TESTS_NAMES = new String[] {"testBug428178"};
@@ -93,9 +93,9 @@ public class JavaElement8Tests extends AbstractJavaModelTests {
" System.out.println(\"Hello\");\n" +
" }\n" +
"}";
- addLibrary(project,
- "lib.jar",
- "src.zip", new
+ addLibrary(project,
+ "lib.jar",
+ "src.zip", new
String[] {"p/Test.java", fileContent},
JavaCore.VERSION_1_8);
IType type = getPackageFragmentRoot("Bug428178", "lib.jar").getPackageFragment("p").getOrdinaryClassFile("Test.class").getType();
@@ -116,8 +116,8 @@ public class JavaElement8Tests extends AbstractJavaModelTests {
" static void main(String[] args) {\n" +
" I i = (x) -> {};\n" +
" }\n" +
- "}\n" +
- "interface I {\n" +
+ "}\n" +
+ "interface I {\n" +
" public void foo(int x);\n" +
"}";
createFolder("/Bug429641/src/p");
@@ -143,8 +143,8 @@ public class JavaElement8Tests extends AbstractJavaModelTests {
" static void main(String[] args) {\n" +
" I i = (x) -> {};\n" +
" }\n" +
- "}\n" +
- "interface I {\n" +
+ "}\n" +
+ "interface I {\n" +
" public void foo(int x);\n" +
"}";
createFolder("/Bug429641/src/p");
@@ -166,7 +166,7 @@ public class JavaElement8Tests extends AbstractJavaModelTests {
try {
IJavaProject project = createJavaProject("Bug429948", new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "1.8");
project.open(null);
- String fileContent =
+ String fileContent =
"interface Supplier<T> {\n" +
" T get();\n" +
"}\n" +
@@ -192,9 +192,9 @@ public class JavaElement8Tests extends AbstractJavaModelTests {
IType type = getCompilationUnit("/Bug429948/src/X.java").getType("X");
ITypeHierarchy h = type.newSupertypeHierarchy(null);
assertHierarchyEquals(
- "Focus: X [in X.java [in <default> [in src [in Bug429948]]]]\n" +
- "Super types:\n" +
- " Object [in Object.class [in java.lang [in "+ getExternalPath() + "jclMin1.8.jar]]]\n" +
+ "Focus: X [in X.java [in <default> [in src [in Bug429948]]]]\n" +
+ "Super types:\n" +
+ " Object [in Object.class [in java.lang [in "+ getExternalPath() + "jclMin1.8.jar]]]\n" +
"Sub types:\n",
h);
}
@@ -207,7 +207,7 @@ public class JavaElement8Tests extends AbstractJavaModelTests {
try {
IJavaProject project = createJavaProject("Bug429948", new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "1.8");
project.open(null);
- String fileContent =
+ String fileContent =
"interface Supplier<T> {\n" +
" T get();\n" +
"}\n" +
@@ -237,9 +237,9 @@ public class JavaElement8Tests extends AbstractJavaModelTests {
IType type = getCompilationUnit("/Bug429948/src/X.java").getType("X");
ITypeHierarchy h = type.newSupertypeHierarchy(null);
assertHierarchyEquals(
- "Focus: X [in X.java [in <default> [in src [in Bug429948]]]]\n" +
- "Super types:\n" +
- " Object [in Object.class [in java.lang [in "+ getExternalPath() + "jclMin1.8.jar]]]\n" +
+ "Focus: X [in X.java [in <default> [in src [in Bug429948]]]]\n" +
+ "Super types:\n" +
+ " Object [in Object.class [in java.lang [in "+ getExternalPath() + "jclMin1.8.jar]]]\n" +
"Sub types:\n",
h);
}
@@ -253,7 +253,7 @@ public class JavaElement8Tests extends AbstractJavaModelTests {
try {
IJavaProject project = createJavaProject(projectName, new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "1.8");
project.open(null);
- String fileContent =
+ String fileContent =
"interface Supplier<T> {\n" +
" T get();\n" +
"}\n" +
@@ -283,10 +283,10 @@ public class JavaElement8Tests extends AbstractJavaModelTests {
IType type = getCompilationUnit(fileName).getType("Runnable");
ITypeHierarchy h = type.newTypeHierarchy(null);
assertHierarchyEquals(
- "Focus: Runnable [in X.java [in <default> [in src [in Bug429966]]]]\n" +
- "Super types:\n" +
- "Sub types:\n" +
- " <lambda #1> [in get() [in <lambda #1> [in main(String[]) [in X [in X.java [in <default> [in src [in Bug429966]]]]]]]]\n" +
+ "Focus: Runnable [in X.java [in <default> [in src [in Bug429966]]]]\n" +
+ "Super types:\n" +
+ "Sub types:\n" +
+ " <lambda #1> [in get() [in <lambda #1> [in main(String[]) [in X [in X.java [in <default> [in src [in Bug429966]]]]]]]]\n" +
" <lambda #1> [in run() [in <lambda #1> [in get() [in <lambda #1> [in main(String[]) [in X [in X.java [in <default> [in src [in Bug429966]]]]]]]]]]\n",
h);
}
@@ -305,8 +305,8 @@ public class JavaElement8Tests extends AbstractJavaModelTests {
" static void main(String[] args) {\n" +
" I<String> i = (x) -> {};\n" +
" }\n" +
- "}\n" +
- "interface I<T> {\n" +
+ "}\n" +
+ "interface I<T> {\n" +
" public void foo(List<T> x);\n" +
"}";
createFolder("/Bug429910/src/p");
@@ -366,7 +366,7 @@ public class JavaElement8Tests extends AbstractJavaModelTests {
try {
IJavaProject project = createJavaProject(projectName, new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "1.8");
project.open(null);
- String fileContent =
+ String fileContent =
"interface MyFunction<T, R> {\n" +
" R apply(T t);\n" +
" default <V> MyFunction<V, R> compose(MyFunction<? super V, ? extends T> before) {\n" +
@@ -375,7 +375,7 @@ public class JavaElement8Tests extends AbstractJavaModelTests {
"}\n";
String fileName = "/" + projectName + "/src/X.java";
createFile(fileName, fileContent);
-
+
ICompilationUnit unit = getCompilationUnit(fileName);
int start = fileContent.indexOf("v");
IJavaElement[] elements = unit.codeSelect(start, 1);
@@ -391,7 +391,7 @@ public class JavaElement8Tests extends AbstractJavaModelTests {
try {
IJavaProject project = createJavaProject(projectName, new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "1.8");
project.open(null);
- String fileContent =
+ String fileContent =
"interface MyFunction<T, R> {\n" +
" R apply(T t);\n" +
" default <V> MyFunction<V, R> compose(MyFunction<? super V, ? extends T> before) {\n" +
@@ -400,7 +400,7 @@ public class JavaElement8Tests extends AbstractJavaModelTests {
"}\n";
String fileName = "/" + projectName + "/src/X.java";
createFile(fileName, fileContent);
-
+
ICompilationUnit unit = getCompilationUnit(fileName);
int start = fileContent.indexOf("v");
IJavaElement[] elements = unit.codeSelect(start, 1);
@@ -410,9 +410,9 @@ public class JavaElement8Tests extends AbstractJavaModelTests {
deleteProject(projectName);
}
}
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=430033, [1.8][model] Lambda elements missing in ancestry for binary elements
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=430033, [1.8][model] Lambda elements missing in ancestry for binary elements
public void test430033() throws CoreException, IOException {
-
+
String jarName = "Elements.jar";
String srcName = "Elements_src.zip";
String projectName = "Bug430033";
@@ -420,7 +420,7 @@ public class JavaElement8Tests extends AbstractJavaModelTests {
try {
project = createJavaProject(projectName, new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "1.8");
project.open(null);
-
+
String[] pathAndContents = new String[] {
"IntPredicate.java",
"public interface IntPredicate {\n" +
@@ -430,12 +430,12 @@ public class JavaElement8Tests extends AbstractJavaModelTests {
" }\n" +
"}\n"
};
-
+
HashMap libraryOptions = new HashMap(project.getOptions(true));
libraryOptions.put(CompilerOptions.OPTION_Store_Annotations, CompilerOptions.ENABLED);
addLibrary(project, jarName, srcName, pathAndContents, JavaCore.VERSION_1_8, libraryOptions);
-
-
+
+
IPackageFragmentRoot[] packageFragmentRoots = project.getPackageFragmentRoots();
IPackageFragment packageFragment = packageFragmentRoots[2].getPackageFragment("");
IClassFile classFile = packageFragment.getClassFile("IntPredicate.class");
@@ -454,7 +454,7 @@ public class JavaElement8Tests extends AbstractJavaModelTests {
try {
IJavaProject project = createJavaProject("Bug430141", new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "1.8");
project.open(null);
- String fileContent =
+ String fileContent =
"interface I {\n" +
" void doit();\n" +
"}\n" +
@@ -470,10 +470,10 @@ public class JavaElement8Tests extends AbstractJavaModelTests {
IType type = getCompilationUnit("/Bug430141/src/X.java").getType("I");
ITypeHierarchy h = type.newTypeHierarchy(null);
assertHierarchyEquals(
- "Focus: I [in X.java [in <default> [in src [in Bug430141]]]]\n" +
- "Super types:\n" +
- "Sub types:\n" +
- " J [in X.java [in <default> [in src [in Bug430141]]]]\n" +
+ "Focus: I [in X.java [in <default> [in src [in Bug430141]]]]\n" +
+ "Super types:\n" +
+ "Sub types:\n" +
+ " J [in X.java [in <default> [in src [in Bug430141]]]]\n" +
" <lambda #1> [in main(String[]) [in X [in X.java [in <default> [in src [in Bug430141]]]]]]\n",
h);
}
@@ -486,7 +486,7 @@ public class JavaElement8Tests extends AbstractJavaModelTests {
try {
IJavaProject project = createJavaProject("Bug430141", new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "1.8");
project.open(null);
- String fileContent =
+ String fileContent =
"interface I {\n" +
" void doit();\n" +
"}\n" +
@@ -502,10 +502,10 @@ public class JavaElement8Tests extends AbstractJavaModelTests {
IType type = getCompilationUnit("/Bug430141/src/X.java").getType("J");
ITypeHierarchy h = type.newTypeHierarchy(null);
assertHierarchyEquals(
- "Focus: J [in X.java [in <default> [in src [in Bug430141]]]]\n" +
- "Super types:\n" +
- " I [in X.java [in <default> [in src [in Bug430141]]]]\n" +
- "Sub types:\n" +
+ "Focus: J [in X.java [in <default> [in src [in Bug430141]]]]\n" +
+ "Super types:\n" +
+ " I [in X.java [in <default> [in src [in Bug430141]]]]\n" +
+ "Sub types:\n" +
" <lambda #1> [in main(String[]) [in X [in X.java [in <default> [in src [in Bug430141]]]]]]\n",
h);
}
@@ -519,7 +519,7 @@ public class JavaElement8Tests extends AbstractJavaModelTests {
try {
IJavaProject project = createJavaProject(projectName, new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "1.8");
project.open(null);
- String fileContent =
+ String fileContent =
"interface MyFunction<T, R> {\n" +
" R apply(T t);\n" +
" default <V> MyFunction<V, R> compose(MyFunction<? super V, ? extends T> before) {\n" +
@@ -528,7 +528,7 @@ public class JavaElement8Tests extends AbstractJavaModelTests {
"}\n";
String fileName = "/" + projectName + "/src/X.java";
createFile(fileName, fileContent);
-
+
ICompilationUnit unit = getCompilationUnit(fileName);
int start = fileContent.indexOf("v");
IJavaElement[] elements = unit.codeSelect(start, 1);
@@ -550,7 +550,7 @@ public class JavaElement8Tests extends AbstractJavaModelTests {
try {
IJavaProject project = createJavaProject(projectName, new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "1.8");
project.open(null);
- String fileContent =
+ String fileContent =
"public interface X<T> {\n" +
" default void asIntStream() {\n" +
" mapToInt((long l) -> (int) l);" +
@@ -561,7 +561,7 @@ public class JavaElement8Tests extends AbstractJavaModelTests {
"}\n";
String fileName = "/" + projectName + "/src/X.java";
createFile(fileName, fileContent);
-
+
ICompilationUnit unit = getCompilationUnit(fileName);
int start = fileContent.indexOf("l)");
IJavaElement[] elements = unit.codeSelect(start, 1);
@@ -608,7 +608,7 @@ public class JavaElement8Tests extends AbstractJavaModelTests {
try {
IJavaProject project = createJavaProject(projectName, new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "1.8");
project.open(null);
- String fileContent =
+ String fileContent =
"interface MyFunction<T, R> {\n" +
" R apply(T t);\n" +
" default <V> MyFunction<V, R> compose(MyFunction<? super V, ? extends T> before) {\n" +
@@ -617,7 +617,7 @@ public class JavaElement8Tests extends AbstractJavaModelTests {
"}\n";
String fileName = "/" + projectName + "/src/X.java";
createFile(fileName, fileContent);
-
+
ICompilationUnit unit = getCompilationUnit(fileName);
int start = fileContent.indexOf("v");
IJavaElement[] elements = unit.codeSelect(start, 1);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaElementDeltaTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaElementDeltaTests.java
index 32817cf13..bad8abb28 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaElementDeltaTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaElementDeltaTests.java
@@ -999,7 +999,7 @@ public void testChangeJRE9_8() throws CoreException, IOException {
for (int i = 0; i < rawClasspath.length; i++) {
IClasspathEntry entry = rawClasspath[i];
if (entry.getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
- rawClasspath[i] = JavaCore.newVariableEntry(new Path("JCL18_LIB"), new Path("JCL18_SRC"), null, null, null, false);
+ rawClasspath[i] = JavaCore.newVariableEntry(new Path("JCL18_LIB"), new Path("JCL18_SRC"), null, null, null, false);
break;
}
}
@@ -1030,7 +1030,7 @@ public void testChangeJRE8_9() throws CoreException, IOException {
for (int i = 0; i < rawClasspath.length; i++) {
IClasspathEntry entry = rawClasspath[i];
if (entry.getEntryKind() == IClasspathEntry.CPE_VARIABLE) {
- rawClasspath[i] = JavaCore.newVariableEntry(new Path("JCL19_LIB"), new Path("JCL19_SRC"), null, null, null, false);
+ rawClasspath[i] = JavaCore.newVariableEntry(new Path("JCL19_LIB"), new Path("JCL19_SRC"), null, null, null, false);
break;
}
}
@@ -1039,9 +1039,9 @@ public void testChangeJRE8_9() throws CoreException, IOException {
assertDeltas(
"Unexpected delta",
- "P[*]: {CHILDREN | CONTENT | RESOLVED CLASSPATH CHANGED}\n" +
- " "+ getExternalPath() + "jclMin1.8.jar[*]: {REMOVED FROM CLASSPATH}\n" +
- " "+ getExternalPath() + "jclMin9.jar[+]: {}\n" +
+ "P[*]: {CHILDREN | CONTENT | RESOLVED CLASSPATH CHANGED}\n" +
+ " "+ getExternalPath() + "jclMin1.8.jar[*]: {REMOVED FROM CLASSPATH}\n" +
+ " "+ getExternalPath() + "jclMin9.jar[+]: {}\n" +
" ResourceDelta(/P/.classpath)[*]",
true);
} finally {
@@ -2513,8 +2513,8 @@ public void testRemoveExternalLibFolder2() throws CoreException {
setClasspath(p, new IClasspathEntry[] {});
assertDeltas(
"Unexpected delta",
- "P[*]: {CHILDREN | CONTENT | RAW CLASSPATH CHANGED | RESOLVED CLASSPATH CHANGED}\n" +
- " "+ getExternalPath() + "externalLib[*]: {REMOVED FROM CLASSPATH}\n" +
+ "P[*]: {CHILDREN | CONTENT | RAW CLASSPATH CHANGED | RESOLVED CLASSPATH CHANGED}\n" +
+ " "+ getExternalPath() + "externalLib[*]: {REMOVED FROM CLASSPATH}\n" +
" ResourceDelta(/P/.classpath)[*]"
);
} finally {
@@ -2605,8 +2605,8 @@ public void testRemoveZIPArchive2() throws CoreException {
setClasspath(p, new IClasspathEntry[] {});
assertDeltas(
"Unexpected delta",
- "P[*]: {CHILDREN | CONTENT | RAW CLASSPATH CHANGED | RESOLVED CLASSPATH CHANGED}\n" +
- " "+ getExternalPath() + "externalLib.abc[*]: {REMOVED FROM CLASSPATH}\n" +
+ "P[*]: {CHILDREN | CONTENT | RAW CLASSPATH CHANGED | RESOLVED CLASSPATH CHANGED}\n" +
+ " "+ getExternalPath() + "externalLib.abc[*]: {REMOVED FROM CLASSPATH}\n" +
" ResourceDelta(/P/.classpath)[*]" );
} finally {
stopDeltas();
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaIndexTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaIndexTests.java
index ddfaa7ac6..dc6fba9ef 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaIndexTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaIndexTests.java
@@ -66,7 +66,7 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
"public class Test {\n" +
" protected Test(int i) {}\n" +
"}"}, jarFilePath);
-
+
JavaIndexer.generateIndexForJar(jarFilePath, indexFilePath);
assertTrue(new File(indexFilePath).exists());
} finally {
@@ -74,7 +74,7 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
new File(jarFilePath).delete();
}
}
-
+
// Test that the index file and the jar can be deleted after the indexing is done
// This is to ensure that the files are closed
public void testDeleteIndexedFile() {
@@ -94,7 +94,7 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
assertFalse("Test failed", true);
}
}
-
+
// Test that search works fine with the index file
public void testUseIndex() throws CoreException, IOException {
String indexFilePath = getExternalResourcePath("Test.index");
@@ -108,23 +108,23 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
"}"}, jarFilePath);
JavaIndexer.generateIndexForJar(jarFilePath, indexFilePath);
long modified = new File(indexFilePath).lastModified();
-
+
IJavaProject p = createJavaProject("P");
Path libPath = new Path(jarFilePath);
IClasspathAttribute attribute = JavaCore.newClasspathAttribute(IClasspathAttribute.INDEX_LOCATION_ATTRIBUTE_NAME, "file:///"+indexFilePath);
IClasspathEntry entry = JavaCore.newLibraryEntry(libPath, null, null, null, new IClasspathAttribute[]{attribute}, false);
setClasspath(p, new IClasspathEntry[] {entry});
-
+
waitUntilIndexesReady();
-
+
// Test that specified index file is really used
java.io.File indexFile = JavaModelManager.getIndexManager().getIndex(libPath, false, false).getIndexFile();
assertEquals("Specified index file is not being used", indexFilePath,indexFile.toString());
-
- // Test that search works properly
+
+ // Test that search works properly
search("Test", TYPE, DECLARATIONS, EXACT_RULE, SearchEngine.createJavaSearchScope(new IJavaElement[]{p}));
assertSearchResults(getExternalPath() + "Test.jar pkg.Test");
-
+
// Ensure that the index file is not modified
assertEquals(modified, new File(indexFilePath).lastModified());
} finally {
@@ -133,7 +133,7 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
new File(jarFilePath).delete();
}
}
-
+
// Test that the same index file is used even after restarting
public void testUseIndexAfterRestart() throws IOException, CoreException {
String indexFilePath = getExternalResourcePath("Test.index");
@@ -153,18 +153,18 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
IClasspathEntry entry = JavaCore.newLibraryEntry(libPath, null, null, null, new IClasspathAttribute[]{attribute}, false);
setClasspath(p, new IClasspathEntry[] {entry});
waitUntilIndexesReady();
-
+
search("Test", TYPE, DECLARATIONS, EXACT_RULE, SearchEngine.createJavaSearchScope(new IJavaElement[]{p}));
assertSearchResults(getExternalPath() + "Test.jar pkg.Test");
-
+
simulateExitRestart();
getJavaModel().refreshExternalArchives(null, null);
waitUntilIndexesReady();
-
+
this.resultCollector = new JavaSearchResultCollector();
search("Test", TYPE, DECLARATIONS, EXACT_RULE, SearchEngine.createJavaSearchScope(new IJavaElement[]{p}));
assertSearchResults(getExternalPath() + "Test.jar pkg.Test");
-
+
java.io.File indexFile = JavaModelManager.getIndexManager().getIndex(libPath, false, false).getIndexFile();
assertEquals(indexFilePath,indexFile.toString());
// Ensure that the file is not modified
@@ -175,7 +175,7 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
new File(jarFilePath).delete();
}
}
-
+
// Test that the same index file is used even after restarting
public void testUseIndexInternalJarAfterRestart() throws IOException, CoreException {
String indexFilePath = getExternalResourcePath("Test.index");
@@ -197,19 +197,19 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
IClasspathEntry entry = JavaCore.newLibraryEntry(libPath, null, null, null, new IClasspathAttribute[]{attribute}, false);
setClasspath(p, new IClasspathEntry[] {entry});
waitUntilIndexesReady();
-
+
search("Test", TYPE, DECLARATIONS, EXACT_RULE, SearchEngine.createJavaSearchScope(new IJavaElement[]{p}));
assertSearchResults("Test.jar pkg.Test [No source]");
java.io.File indexFile = JavaModelManager.getIndexManager().getIndex(libPath, false, false).getIndexFile();
assertEquals(indexFilePath,indexFile.toString());
-
+
simulateExitRestart();
waitUntilIndexesReady();
-
+
this.resultCollector = new JavaSearchResultCollector();
search("Test", TYPE, DECLARATIONS, EXACT_RULE, SearchEngine.createJavaSearchScope(new IJavaElement[]{p}));
assertSearchResults("Test.jar pkg.Test [No source]");
-
+
indexFile = JavaModelManager.getIndexManager().getIndex(libPath, false, false).getIndexFile();
assertEquals(indexFilePath,indexFile.toString());
// Ensure that the file is not modified
@@ -219,9 +219,9 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
new File(indexFilePath).delete();
}
}
-
- // Test that a jar file that gets modified after the index is created doesn't return new changes.
- // This behavior might have to be modified but..
+
+ // Test that a jar file that gets modified after the index is created doesn't return new changes.
+ // This behavior might have to be modified but..
public void testModifyJarAfterIndex() throws CoreException, IOException {
String indexFilePath = getExternalResourcePath("Test.index");
String jarFilePath = getExternalResourcePath("Test.jar");
@@ -238,7 +238,7 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
"package pkg;\n" +
"public class Test {\n" +
" protected Test(int i) {}\n" +
- "}",
+ "}",
"pkg/NewTest.java",
"package pkg;\n" +
"public class NewTest {\n" +
@@ -279,14 +279,14 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
waitUntilIndexesReady();
search("Test", TYPE, DECLARATIONS, EXACT_RULE, SearchEngine.createJavaSearchScope(new IJavaElement[]{p}));
assertSearchResults(getExternalPath() + "Test.jar pkg.Test");
-
+
} finally {
deleteProject("P");
new File(indexFilePath).delete();
new File(jarFilePath).delete();
}
}
-
+
// test a non-existent index
public void testNonExistentIndexRestart() throws CoreException, IOException {
String indexFilePath = getExternalResourcePath("Test.index");
@@ -298,31 +298,31 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
"public class Test {\n" +
" protected Test(int i) {}\n" +
"}"}, jarFilePath);
-
+
new File(indexFilePath).delete();
-
+
IJavaProject p = createJavaProject("P");
Path libPath = new Path(jarFilePath);
IClasspathAttribute attribute = JavaCore.newClasspathAttribute(IClasspathAttribute.INDEX_LOCATION_ATTRIBUTE_NAME, "file:///"+indexFilePath);
IClasspathEntry entry = JavaCore.newLibraryEntry(libPath, null, null, null, new IClasspathAttribute[]{attribute}, false);
setClasspath(p, new IClasspathEntry[] {entry});
waitUntilIndexesReady();
-
+
search("Test", TYPE, DECLARATIONS, EXACT_RULE, SearchEngine.createJavaSearchScope(new IJavaElement[]{p}));
assertSearchResults(getExternalPath() + "Test.jar pkg.Test");
-
+
java.io.File indexFile = JavaModelManager.getIndexManager().getIndex(libPath, false, false).getIndexFile();
long modified = indexFile.lastModified();
assertEquals(modified, indexFile.lastModified());
-
+
simulateExitRestart();
getJavaModel().refreshExternalArchives(null,null);
waitUntilIndexesReady();
-
+
this.resultCollector = new JavaSearchResultCollector();
search("Test", TYPE, DECLARATIONS, EXACT_RULE, SearchEngine.createJavaSearchScope(new IJavaElement[]{p}));
assertSearchResults(getExternalPath() + "Test.jar pkg.Test");
-
+
indexFile = JavaModelManager.getIndexManager().getIndex(libPath, false, false).getIndexFile();
assertEquals("Index File should not have got modified",modified, indexFile.lastModified());
} finally {
@@ -331,7 +331,7 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
new File(jarFilePath).delete();
}
}
-
+
// test that if the index is not existent after restart, it should build up a new index
public void testNonExistentIndexAfterRestart() throws CoreException, IOException {
String indexFilePath = getExternalResourcePath("Test.index");
@@ -339,40 +339,40 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
try {
createJar(new String[] {
"pkg/Test.java",
- "package pkg;\n" +
+ "package pkg;\n" +
"public class Test {\n" +
- "protected Test(int i) {}\n" + "}"
+ "protected Test(int i) {}\n" + "}"
},jarFilePath);
JavaIndexer.generateIndexForJar(jarFilePath, indexFilePath);
-
+
IJavaProject p = createJavaProject("P");
Path libPath = new Path(jarFilePath);
IClasspathAttribute attribute = JavaCore.newClasspathAttribute(IClasspathAttribute.INDEX_LOCATION_ATTRIBUTE_NAME, "file:///"+indexFilePath);
IClasspathEntry entry = JavaCore.newLibraryEntry(libPath, null, null, null, new IClasspathAttribute[]{attribute}, false);
setClasspath(p, new IClasspathEntry[] {entry});
waitUntilIndexesReady();
-
+
search("Test", TYPE, DECLARATIONS, EXACT_RULE, SearchEngine.createJavaSearchScope(new IJavaElement[]{p}));
assertSearchResults(getExternalPath() + "Test.jar pkg.Test");
-
+
simulateExitRestart();
File indexFile = new File(indexFilePath);
indexFile.delete();
assertTrue(!indexFile.exists());
getJavaModel().refreshExternalArchives(null,null);
waitUntilIndexesReady();
-
+
this.resultCollector = new JavaSearchResultCollector();
search("Test", TYPE, DECLARATIONS, EXACT_RULE, SearchEngine.createJavaSearchScope(new IJavaElement[]{p}));
assertSearchResults(getExternalPath() + "Test.jar pkg.Test");
-
+
} finally {
deleteProject("P");
new File(indexFilePath).delete();
new File(jarFilePath).delete();
}
}
-
+
// test a non-existent index which becomes existent after restart
public void testExistentIndexAfterRestart() throws CoreException, IOException {
String indexFilePath = getExternalResourcePath("Test.index");
@@ -384,30 +384,30 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
"public class Test {\n" +
" protected Test(int i) {}\n" +
"}"}, jarFilePath);
-
+
File indexFile = new File(indexFilePath);
indexFile.delete();
assertTrue(!indexFile.exists());
-
+
IJavaProject p = createJavaProject("P");
Path libPath = new Path(jarFilePath);
IClasspathAttribute attribute = JavaCore.newClasspathAttribute(IClasspathAttribute.INDEX_LOCATION_ATTRIBUTE_NAME, "file:///"+indexFilePath);
IClasspathEntry entry = JavaCore.newLibraryEntry(libPath, null, null, null, new IClasspathAttribute[]{attribute}, false);
setClasspath(p, new IClasspathEntry[] {entry});
waitUntilIndexesReady();
-
+
search("Test", TYPE, DECLARATIONS, EXACT_RULE, SearchEngine.createJavaSearchScope(new IJavaElement[]{p}));
assertSearchResults(getExternalPath() + "Test.jar pkg.Test");
-
+
JavaIndexer.generateIndexForJar(jarFilePath, indexFilePath);
simulateExitRestart();
getJavaModel().refreshExternalArchives(null,null);
waitUntilIndexesReady();
-
+
this.resultCollector = new JavaSearchResultCollector();
search("Test", TYPE, DECLARATIONS, EXACT_RULE, SearchEngine.createJavaSearchScope(new IJavaElement[]{p}));
assertSearchResults(getExternalPath() + "Test.jar pkg.Test");
-
+
indexFile = JavaModelManager.getIndexManager().getIndex(libPath, false, false).getIndexFile();
assertEquals(indexFilePath,indexFile.toString());
} finally {
@@ -416,7 +416,7 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
new File(jarFilePath).delete();
}
}
-
+
// Test that the index file is not deleted when the project is deleted
public void testDeleteProject() throws CoreException, IOException {
String indexFilePath = getExternalResourcePath("Test.index");
@@ -444,9 +444,9 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
new File(jarFilePath).delete();
}
}
-
-
+
+
// Test index file in platform
public void testPlatformIndexFile() throws CoreException, IOException {
String indexFilePath = null;
@@ -459,32 +459,32 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
"public class Test {\n" +
" protected Test(int i) {}\n" +
"}"}, jarFilePath);
-
+
IJavaProject p = createJavaProject("P");
indexFilePath = p.getProject().getLocation().append("Test.index").toFile().getAbsolutePath();
JavaIndexer.generateIndexForJar(jarFilePath, indexFilePath);
long modified = new File(indexFilePath).lastModified();
-
+
Path libPath = new Path(jarFilePath);
IClasspathAttribute attribute = JavaCore.newClasspathAttribute(IClasspathAttribute.INDEX_LOCATION_ATTRIBUTE_NAME, indexUrl);
IClasspathEntry entry = JavaCore.newLibraryEntry(libPath, null, null, null, new IClasspathAttribute[]{attribute}, false);
setClasspath(p, new IClasspathEntry[] {entry});
waitUntilIndexesReady();
-
+
search("Test", TYPE, DECLARATIONS, EXACT_RULE, SearchEngine.createJavaSearchScope(new IJavaElement[]{p}));
assertSearchResults(getExternalPath() + "Test.jar pkg.Test");
-
+
String indexFileName = JavaModelManager.getIndexManager().getIndex(libPath, false, false).getIndexFile().getName();
assertEquals(indexFileName, "Test.index");
-
+
simulateExitRestart();
getJavaModel().refreshExternalArchives(null,null);
waitUntilIndexesReady();
-
+
this.resultCollector = new JavaSearchResultCollector();
search("Test", TYPE, DECLARATIONS, EXACT_RULE, SearchEngine.createJavaSearchScope(new IJavaElement[]{p}));
assertSearchResults(getExternalPath() + "Test.jar pkg.Test");
-
+
indexFileName = JavaModelManager.getIndexManager().getIndex(libPath, false, false).getIndexFile().getName();
assertEquals(indexFileName, "Test.index");
@@ -495,8 +495,8 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
new File(jarFilePath).delete();
}
}
-
-
+
+
public void testEditClasspath() throws CoreException, IOException {
String indexFilePath = getExternalResourcePath("Test.index");
String jarFilePath = getExternalResourcePath("Test.jar");
@@ -523,10 +523,10 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
+ "<classpathentry kind=\"lib\" path=\""
+ jarFilePath
+ "\">"
- + "<attributes>\n"
+ + "<attributes>\n"
+ " <attribute name=\"index_location\" value=\"file:///"
+ indexFilePath
- +"\"/>\n"
+ +"\"/>\n"
+ "</attributes>\n"
+ "</classpathentry>\n"
+ "<classpathentry kind=\"output\" path=\"bin\"/>\n"
@@ -547,8 +547,8 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
new File(jarFilePath).delete();
}
}
-
- // Test changing the classpath
+
+ // Test changing the classpath
public void testChangeClasspath() throws CoreException, IOException {
String indexFilePath = getExternalResourcePath("Test.index");
String jarFilePath = getExternalResourcePath("Test.jar");
@@ -565,7 +565,7 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
"package pkg;\n" +
"public class Test {\n" +
" protected Test(int i) {}\n" +
- "}",
+ "}",
"pkg/NewTest.java",
"package pkg;\n" +
"public class NewTest {\n" +
@@ -573,13 +573,13 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
"}"}, jarFilePath);
IJavaProject p = createJavaProject("P");
Path libPath = new Path(jarFilePath);
-
+
IClasspathEntry entry = JavaCore.newLibraryEntry(libPath, null, null, null, null, false);
setClasspath(p, new IClasspathEntry[] {entry});
waitUntilIndexesReady();
search("NewTest", TYPE, DECLARATIONS, EXACT_RULE, SearchEngine.createJavaSearchScope(new IJavaElement[]{p}));
assertSearchResults(getExternalPath() + "Test.jar pkg.NewTest");
-
+
IClasspathAttribute attribute = JavaCore.newClasspathAttribute(IClasspathAttribute.INDEX_LOCATION_ATTRIBUTE_NAME, "file:///"+indexFilePath);
entry = JavaCore.newLibraryEntry(libPath, null, null, null, new IClasspathAttribute[]{attribute}, false);
setClasspath(p, new IClasspathEntry[] {entry});
@@ -587,23 +587,23 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
this.resultCollector = new JavaSearchResultCollector();
search("NewTest", TYPE, DECLARATIONS, EXACT_RULE, SearchEngine.createJavaSearchScope(new IJavaElement[]{p}));
assertSearchResults("");
-
+
entry = JavaCore.newLibraryEntry(libPath, null, null, null, null, false);
setClasspath(p, new IClasspathEntry[] {entry});
waitUntilIndexesReady();
this.resultCollector = new JavaSearchResultCollector();
search("NewTest", TYPE, DECLARATIONS, EXACT_RULE, SearchEngine.createJavaSearchScope(new IJavaElement[]{p}));
assertSearchResults(getExternalPath() + "Test.jar pkg.NewTest");
-
-
+
+
} finally {
deleteProject("P");
new File(indexFilePath).delete();
new File(jarFilePath).delete();
}
}
-
- // Test changing the classpath
+
+ // Test changing the classpath
public void testChangeClasspathForInternalJar() throws CoreException, IOException {
String indexFilePath = getExternalResourcePath("Test.index");
String jarFilePath = "/P/Test.jar";
@@ -622,7 +622,7 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
"package pkg;\n" +
"public class Test {\n" +
" protected Test(int i) {}\n" +
- "}",
+ "}",
"pkg/NewTest.java",
"package pkg;\n" +
"public class NewTest {\n" +
@@ -630,13 +630,13 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
"}"}, fullJarPath);
p.getProject().refreshLocal(1, null);
Path libPath = new Path(jarFilePath);
-
+
IClasspathEntry entry = JavaCore.newLibraryEntry(libPath, null, null, null, null, false);
setClasspath(p, new IClasspathEntry[] {entry});
waitUntilIndexesReady();
search("NewTest", TYPE, DECLARATIONS, EXACT_RULE, SearchEngine.createJavaSearchScope(new IJavaElement[]{p}));
assertSearchResults("Test.jar pkg.NewTest [No source]");
-
+
IClasspathAttribute attribute = JavaCore.newClasspathAttribute(IClasspathAttribute.INDEX_LOCATION_ATTRIBUTE_NAME, "file:///"+indexFilePath);
entry = JavaCore.newLibraryEntry(libPath, null, null, null, new IClasspathAttribute[]{attribute}, false);
setClasspath(p, new IClasspathEntry[] {entry});
@@ -644,19 +644,19 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
this.resultCollector = new JavaSearchResultCollector();
search("NewTest", TYPE, DECLARATIONS, EXACT_RULE, SearchEngine.createJavaSearchScope(new IJavaElement[]{p}));
assertSearchResults("");
-
+
entry = JavaCore.newLibraryEntry(libPath, null, null, null, null, false);
setClasspath(p, new IClasspathEntry[] {entry});
waitUntilIndexesReady();
this.resultCollector = new JavaSearchResultCollector();
search("NewTest", TYPE, DECLARATIONS, EXACT_RULE, SearchEngine.createJavaSearchScope(new IJavaElement[]{p}));
- assertSearchResults("Test.jar pkg.NewTest [No source]");
+ assertSearchResults("Test.jar pkg.NewTest [No source]");
} finally {
deleteProject("P");
new File(indexFilePath).delete();
}
}
-
+
public void testMultipleProjects() throws CoreException, IOException {
String indexFilePath = getExternalResourcePath("Test.index");
String jarFilePath = getExternalResourcePath("Test.jar");
@@ -668,25 +668,25 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
" protected Test(int i) {}\n" +
"}"}, jarFilePath);
JavaIndexer.generateIndexForJar(jarFilePath, indexFilePath);
-
+
IJavaProject p1 = createJavaProject("P1");
Path libPath = new Path(jarFilePath);
IClasspathEntry entry = JavaCore.newLibraryEntry(libPath, null, null, null, null, false);
setClasspath(p1, new IClasspathEntry[] {entry});
waitUntilIndexesReady();
-
+
IJavaProject p2 = createJavaProject("P2");
IClasspathAttribute attribute = JavaCore.newClasspathAttribute(IClasspathAttribute.INDEX_LOCATION_ATTRIBUTE_NAME, "file:///"+indexFilePath);
entry = JavaCore.newLibraryEntry(libPath, null, null, null, new IClasspathAttribute[]{attribute}, false);
setClasspath(p2, new IClasspathEntry[] {entry});
waitUntilIndexesReady();
-
+
search("Test", TYPE, DECLARATIONS, EXACT_RULE, SearchEngine.createJavaSearchScope(new IJavaElement[]{p1}));
assertSearchResults(getExternalPath() + "Test.jar pkg.Test");
-
+
File indexFile = JavaModelManager.getIndexManager().getIndex(libPath, false, false).getIndexFile();
assertEquals(indexFilePath,indexFile.toString());
-
+
} finally {
deleteProject("P1");
deleteProject("P2");
@@ -694,7 +694,7 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
new File(jarFilePath).delete();
}
}
-
+
public void setContainerPath(IJavaProject p, IPath jarPath, String indexLocation) throws CoreException, BackingStoreException {
// Create new user library "SomeUserLibrary"
ClasspathContainerInitializer initializer= JavaCore.getClasspathContainerInitializer(JavaCore.USER_LIBRARY_CONTAINER_ID);
@@ -717,14 +717,14 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
propertyValue.append("</userlibrary>\r\n");
preferences.put(propertyName, propertyValue.toString());
preferences.flush();
-
+
IClasspathEntry[] entries = p.getRawClasspath();
int length = entries.length;
System.arraycopy(entries, 0, entries = new IClasspathEntry[length+1], 0, length);
entries[length] = JavaCore.newContainerEntry(containerSuggestion.getPath());
p.setRawClasspath(entries, null);
}
-
+
public void testUserLibraryIndex() throws IOException, CoreException, BackingStoreException {
String indexFilePath = getExternalResourcePath("Test.index");
String jarFilePath = getExternalResourcePath("Test.jar");
@@ -737,32 +737,32 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
"}"}, jarFilePath);
JavaIndexer.generateIndexForJar(jarFilePath, indexFilePath);
long modified = new File(indexFilePath).lastModified();
-
+
IJavaProject p = createJavaProject("P");
-
+
Path libPath = new Path(jarFilePath);
setContainerPath(p, libPath, "file:///"+indexFilePath);
-
+
waitUntilIndexesReady();
-
+
// Test that specified index file is really used
java.io.File indexFile = JavaModelManager.getIndexManager().getIndex(libPath, false, false).getIndexFile();
assertEquals("Specified index file is not being used", indexFilePath,indexFile.toString());
-
- // Test that search works properly
+
+ // Test that search works properly
search("Test", TYPE, DECLARATIONS, EXACT_RULE, SearchEngine.createJavaSearchScope(new IJavaElement[]{p}));
assertSearchResults(getExternalPath() + "Test.jar pkg.Test");
// Ensure that the index file is not modified
assertEquals(modified, new File(indexFilePath).lastModified());
-
+
simulateExitRestart();
getJavaModel().refreshExternalArchives(null,null);
waitUntilIndexesReady();
-
+
// Test that specified index file is really used
indexFile = JavaModelManager.getIndexManager().getIndex(libPath, false, false).getIndexFile();
assertEquals("Specified index file is not being used", indexFilePath,indexFile.toString());
-
+
// Test that search works properly
this.resultCollector = new JavaSearchResultCollector();
search("Test", TYPE, DECLARATIONS, EXACT_RULE, SearchEngine.createJavaSearchScope(new IJavaElement[]{p}));
@@ -773,9 +773,9 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
deleteProject("P");
new File(indexFilePath).delete();
new File(jarFilePath).delete();
- }
+ }
}
-
+
// Test that it works if the index file is in the jar file
public void testIndexInJar() throws IOException, CoreException {
String indexFilePath = getExternalResourcePath("Test.index");
@@ -788,10 +788,10 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
"public class Test {\n" +
" protected Test(int i) {}\n" +
"}"}, jarFilePath);
-
+
JavaIndexer.generateIndexForJar(jarFilePath, indexFilePath);
Util.zipFiles(new File[]{new File(indexFilePath)}, indexZipPath);
-
+
IJavaProject p = createJavaProject("P");
Path libPath = new Path(jarFilePath);
String url = "jar:file:"+indexZipPath+"!/Test.index";
@@ -799,16 +799,16 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
IClasspathEntry entry = JavaCore.newLibraryEntry(libPath, null, null, null, new IClasspathAttribute[]{attribute}, false);
setClasspath(p, new IClasspathEntry[] {entry});
waitUntilIndexesReady();
-
+
assertEquals(url,JavaModelManager.getIndexManager().getIndex(libPath, false, false).getIndexLocation().getUrl().toString());
-
+
search("Test", TYPE, DECLARATIONS, EXACT_RULE, SearchEngine.createJavaSearchScope(new IJavaElement[]{p}));
assertSearchResults(getExternalPath() + "Test.jar pkg.Test");
-
+
simulateExitRestart();
getJavaModel().refreshExternalArchives(null,null);
waitUntilIndexesReady();
-
+
this.resultCollector = new JavaSearchResultCollector();
assertEquals(url,JavaModelManager.getIndexManager().getIndex(libPath, false, false).getIndexLocation().getUrl().toString());
search("Test", TYPE, DECLARATIONS, EXACT_RULE, SearchEngine.createJavaSearchScope(new IJavaElement[]{p}));
@@ -832,33 +832,33 @@ public class JavaIndexTests extends AbstractJavaSearchTests {
"public class Test {\n" +
" protected Test(int i) {}\n" +
"}"}, jarFilePath);
-
+
IProject indexProj = createProject("ForIndex");
indexFilePath = indexProj.getProject().getLocation().append("Test.index").toFile().getAbsolutePath();
JavaIndexer.generateIndexForJar(jarFilePath, indexFilePath);
Util.zipFiles(new File[]{new File(indexFilePath)}, indexFilePath+".zip");
-
+
IJavaProject p = createJavaProject("P");
Path libPath = new Path(jarFilePath);
IClasspathAttribute attribute = JavaCore.newClasspathAttribute(IClasspathAttribute.INDEX_LOCATION_ATTRIBUTE_NAME, indexUrl);
IClasspathEntry entry = JavaCore.newLibraryEntry(libPath, null, null, null, new IClasspathAttribute[]{attribute}, false);
setClasspath(p, new IClasspathEntry[] {entry});
waitUntilIndexesReady();
-
+
search("Test", TYPE, DECLARATIONS, EXACT_RULE, SearchEngine.createJavaSearchScope(new IJavaElement[]{p}));
assertSearchResults(getExternalPath() + "Test.jar pkg.Test");
-
+
URL url = JavaModelManager.getIndexManager().getIndex(libPath, false, false).getIndexLocation().getUrl();
assertEquals(indexUrl, url.toString());
-
+
simulateExitRestart();
getJavaModel().refreshExternalArchives(null,null);
waitUntilIndexesReady();
-
+
this.resultCollector = new JavaSearchResultCollector();
search("Test", TYPE, DECLARATIONS, EXACT_RULE, SearchEngine.createJavaSearchScope(new IJavaElement[]{p}));
assertSearchResults(getExternalPath() + "Test.jar pkg.Test");
-
+
url = JavaModelManager.getIndexManager().getIndex(libPath, false, false).getIndexLocation().getUrl();
assertEquals(indexUrl, url.toString());
} finally {
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaProjectTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaProjectTests.java
index 5e0199ca5..9ca6a7e24 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaProjectTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaProjectTests.java
@@ -233,7 +233,7 @@ public void testAddExternalLibFolder6() throws CoreException, IOException {
// setup a project depending on the classpath container:
IJavaProject javaProject = setUpJavaProject("ExternalContainer");
IProject p = javaProject.getProject();
-
+
// build should find no errors:
p.build(IncrementalProjectBuilder.FULL_BUILD, null);
waitForAutoBuild();
@@ -241,7 +241,7 @@ public void testAddExternalLibFolder6() throws CoreException, IOException {
for (int i=0; i<markers.length; i++)
System.out.println("unexpected marker: "+markers[i].getType()+": "+markers[i].getAttribute(IMarker.MESSAGE));
assertEquals("Unexpected markers", markers.length, 0);
-
+
} finally {
deleteExternalResource("TestContainer");
deleteProject("ExternalContainer");
@@ -265,7 +265,7 @@ public void testAddExternalLibFolder6() throws CoreException, IOException {
// setup a project depending on the classpath container:
IJavaProject javaProject = setUpJavaProject("ExternalContainer");
IProject p = javaProject.getProject();
-
+
// build should find no errors:
p.build(IncrementalProjectBuilder.FULL_BUILD, null);
waitForAutoBuild();
@@ -273,7 +273,7 @@ public void testAddExternalLibFolder6() throws CoreException, IOException {
for (int i=0; i<markers.length; i++)
System.out.println("unexpected marker: "+markers[i].getType()+": "+markers[i].getAttribute(IMarker.MESSAGE));
assertEquals("Unexpected markers", markers.length, 0);
-
+
} finally {
deleteExternalResource("TestContainer");
deleteProject("ExternalContainer");
@@ -286,7 +286,7 @@ public void testAddExternalLibFolder6() throws CoreException, IOException {
public void testAddExternalLibFolder7() throws CoreException {
String firstSegmentOfExternalPath = new Path(getExternalPath()).segment(0);
try {
-
+
IJavaProject p = createJavaProject(firstSegmentOfExternalPath, new String[0], new String[] {getExternalResourcePath("externalLib")}, "");
expandAll(p);
createExternalFolder("externalLib");
@@ -378,8 +378,8 @@ public void testAddZIPArchive1() throws Exception {
setClasspath(p, new IClasspathEntry[] {JavaCore.newLibraryEntry(new Path(getExternalResourcePath("externalLib.abc")), null, null)});
assertElementDescendants(
"Unexpected project content",
- "P\n" +
- " "+ getExternalPath() + "externalLib.abc\n" +
+ "P\n" +
+ " "+ getExternalPath() + "externalLib.abc\n" +
" <default> (...)",
p
);
@@ -455,8 +455,8 @@ public void testAddZIPArchive4() throws Exception {
refreshExternalArchives(p);
assertElementDescendants(
"Unexpected project content",
- "P\n" +
- " "+ getExternalPath() + "externalLib.abc\n" +
+ "P\n" +
+ " "+ getExternalPath() + "externalLib.abc\n" +
" <default> (...)",
p
);
@@ -505,7 +505,7 @@ public void testAddZIPArchive5() throws Exception {
public void testAddZIPArchive6() throws Exception {
try {
IJavaProject p = createJavaProject("P");
- addLibrary(p, "internalLib.abc", null, new String[0],
+ addLibrary(p, "internalLib.abc", null, new String[0],
new String[] {
"META-INF/MANIFEST.MF",
"Manifest-Version: 1.0\n" +
@@ -516,8 +516,8 @@ public void testAddZIPArchive6() throws Exception {
waitForAutoBuild();
assertElementDescendants(
"Unexpected project content",
- "P\n" +
- " internalLib.abc\n" +
+ "P\n" +
+ " internalLib.abc\n" +
" <default> (...)",
p
);
@@ -1031,8 +1031,8 @@ public void testFolderWithDotName() throws JavaModelException, CoreException {
startDeltas(listener);
folder.getFolder(new Path("org.eclipse")).create(false, true, null);
assertDeltas(
- "Unexpected delta",
- "JavaProjectTests[*]: {CONTENT}\n" +
+ "Unexpected delta",
+ "JavaProjectTests[*]: {CONTENT}\n" +
" ResourceDelta(/JavaProjectTests/org.eclipse)[+]",
listener);
stopDeltas(listener);
@@ -1153,7 +1153,7 @@ public void testGetNonJavaResources5() throws CoreException {
addLibraryEntry(project, file.getLocation(), false/*not exported*/);
assertResourcesEqual(
"Unexpected non-java resources for project",
- "/P/.classpath\n" +
+ "/P/.classpath\n" +
"/P/.project",
project.getNonJavaResources());
} finally {
@@ -1266,7 +1266,7 @@ public void testOutputLocationNotAddedAsPackageFragment() throws JavaModelExcept
startDeltas(listener);
newFolder.create(false, true, null);
assertDeltas(
- "Unexpected delta",
+ "Unexpected delta",
"", listener);
} finally {
stopDeltas(listener);
@@ -2513,7 +2513,7 @@ public void testBug360164() throws IOException, CoreException {
String libPath = getWorkspacePath()+"JavaProjectTests/bin/bug360164.jar";
try {
this.createJavaProject("P", new String[] {"src"}, new String[] {"JCL_LIB", libPath}, "bin", JavaCore.VERSION_1_4);
- IFile file = createFile("/P/src/X.java",
+ IFile file = createFile("/P/src/X.java",
"import p360164.Provider;\n" +
"import p360164.MyEnum;\n" +
"public class X {\n" +
@@ -2526,14 +2526,14 @@ public void testBug360164() throws IOException, CoreException {
" return 0;\n" +
" }\n" +
"}"
- );
+ );
ICompilationUnit unit = (ICompilationUnit)JavaCore.create(file);
ProblemRequestor problemRequestor = new ProblemRequestor();
WorkingCopyOwner owner = newWorkingCopyOwner(problemRequestor);
unit.getWorkingCopy(owner, null);
- assertProblems("Unexpected problems",
- "----------\n" +
- "----------\n",
+ assertProblems("Unexpected problems",
+ "----------\n" +
+ "----------\n",
problemRequestor);
} finally {
this.deleteProject("P");
@@ -2545,7 +2545,7 @@ public void testBug360164a() throws IOException, CoreException {
String libPath = getWorkspacePath()+"JavaProjectTests/bin/bug360164.jar";
try {
this.createJavaProject("P", new String[] {"src"}, new String[] {"JCL_LIB", libPath}, "bin", JavaCore.VERSION_1_4);
- IFile file = createFile("/P/src/X.java",
+ IFile file = createFile("/P/src/X.java",
"import p360164.Provider;\n" +
"import p360164.MyEnum;\n" +
"public class X {\n" +
@@ -2554,16 +2554,16 @@ public void testBug360164a() throws IOException, CoreException {
" return e.toString();\n" +
" }\n" +
"}"
- );
+ );
ICompilationUnit unit = (ICompilationUnit)JavaCore.create(file);
ProblemRequestor problemRequestor = new ProblemRequestor();
WorkingCopyOwner owner = newWorkingCopyOwner(problemRequestor);
unit.getWorkingCopy(owner, null);
- assertProblems("Unexpected problems",
- "----------\n" +
- "1. ERROR in /P/src/X.java\n" +
- "The type java.lang.Enum cannot be resolved. It is indirectly referenced from required .class files\n" +
- "----------\n",
+ assertProblems("Unexpected problems",
+ "----------\n" +
+ "1. ERROR in /P/src/X.java\n" +
+ "The type java.lang.Enum cannot be resolved. It is indirectly referenced from required .class files\n" +
+ "----------\n",
problemRequestor);
} finally {
this.deleteProject("P");
@@ -2587,13 +2587,13 @@ public void testBug360317() throws IOException, CoreException {
" return 0;\n" +
" }\n" +
"}";
- IFile file = createFile("/P/src/X.java", sourceX);
+ IFile file = createFile("/P/src/X.java", sourceX);
ICompilationUnit unit = (ICompilationUnit)JavaCore.create(file);
ProblemRequestor problemRequestor = new ProblemRequestor();
problemRequestor.initialize(sourceX.toCharArray());
WorkingCopyOwner owner = newWorkingCopyOwner(problemRequestor);
unit.getWorkingCopy(owner, null);
- assertProblems("Unexpected problems",
+ assertProblems("Unexpected problems",
"----------\n" +
"1. ERROR in /P/src/X.java (at line 6)\n" +
" switch (e) {\n" +
@@ -2701,7 +2701,7 @@ public void testBug351697() throws Exception {
/**
* Test that conflicting rules between refreshLocal and IProject.touch() invoked by
* JDT don't cause an IAE.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=462756"
*/
public void testBug462756() throws CoreException {
@@ -2777,7 +2777,7 @@ public void testBug490724() throws CoreException {
project14.setRawClasspath(newClasspath, null);
createFolder("/BugBug490724_14/src/p1");
- String source =
+ String source =
"package p1;\n" +
"public final class J13 {\n" +
" private p2.Klass c; \n" +
@@ -2814,35 +2814,35 @@ public void testBug491354() throws CoreException {
createFile(
"/Bug491354_15/src/p/ServiceTracker.java",
"package p;\n" +
- "public class ServiceTracker<S, T> {\n" +
- " private Tracked tracked() { return null; }\n" +
- " private class Tracked { }\n" +
- "}\n" +
+ "public class ServiceTracker<S, T> {\n" +
+ " private Tracked tracked() { return null; }\n" +
+ " private class Tracked { }\n" +
+ "}\n" +
""
);
project15.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5);
project15.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5);
project15.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5);
-
+
project14 = createJavaProject("Bug491354_14", new String[] {"src"}, new String[] {"JCL_LIB"}, "bin");
project14.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_3);
project14.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_3);
project14.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_3);
-
+
IClasspathEntry[] oldClasspath = project14.getRawClasspath();
int oldLength = oldClasspath.length;
IClasspathEntry[] newClasspath = new IClasspathEntry[oldLength+1];
System.arraycopy(oldClasspath, 0, newClasspath, 0, oldLength);
newClasspath[oldLength] = JavaCore.newProjectEntry(new Path("/Bug491354_15"));
project14.setRawClasspath(newClasspath, null);
-
+
createFolder("/Bug491354_14/src/p1");
- String source =
+ String source =
"package p1;\n" +
"import p.ServiceTracker;\n" +
"public final class HttpServiceTracker extends ServiceTracker {\n" +
"}";
-
+
createFile(
"/Bug491354_14/src/p1/HttpServiceTracker.java",
source
@@ -2867,57 +2867,57 @@ public void testBug501220() throws CoreException {
jdkPrj = createJavaProject("JDK8", new String[]{"src"}, new String[] {"JCL_LIB"}, null, null, "bin", new String[]{"bin"}, null, null, "1.8");
createFolder("/JDK8/src/jdk8");
createFile("/JDK8/src/jdk8/MyConsumer.java",
- "package jdk8;\n" +
- "@FunctionalInterface\n" +
- "public interface MyConsumer<T> {\n" +
- " void accept(T t);\n" +
+ "package jdk8;\n" +
+ "@FunctionalInterface\n" +
+ "public interface MyConsumer<T> {\n" +
+ " void accept(T t);\n" +
"}\n");
-
+
swtPrj = createJavaProject("SWT", new String[]{"src"}, new String[] {"JCL_LIB"}, new String[]{"/JDK8"}, null, "bin", new String[]{"bin"}, null, null, "1.8");
createFolder("/SWT/src/swt");
createFile("/SWT/src/swt/EventObject.java",
- "package swt;\n" +
- "\n" +
- "import jdk8.MyConsumer;\n" +
- "\n" +
- "public class EventObject {\n" +
+ "package swt;\n" +
+ "\n" +
+ "import jdk8.MyConsumer;\n" +
+ "\n" +
+ "public class EventObject {\n" +
"}");
createFile("/SWT/src/swt/SelectionListener.java",
- "package swt;\n" +
- "\n" +
- "import java.util.EventObject;\n" +
- "\n" +
- "import jdk8.MyConsumer;\n" +
- "\n" +
- "public interface SelectionListener {\n" +
- " void widgetSelected(EventObject event);\n" +
- "\n" +
- " static SelectionListener widgetSelected(MyConsumer<EventObject> c) {\n" +
- " return new SelectionListener() {\n" +
- " public void widgetSelected(EventObject e) {\n" +
- " c.accept(e);\n" +
- " }\n" +
- " };\n" +
- " }\n" +
+ "package swt;\n" +
+ "\n" +
+ "import java.util.EventObject;\n" +
+ "\n" +
+ "import jdk8.MyConsumer;\n" +
+ "\n" +
+ "public interface SelectionListener {\n" +
+ " void widgetSelected(EventObject event);\n" +
+ "\n" +
+ " static SelectionListener widgetSelected(MyConsumer<EventObject> c) {\n" +
+ " return new SelectionListener() {\n" +
+ " public void widgetSelected(EventObject e) {\n" +
+ " c.accept(e);\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
"}");
egitPrj = createJavaProject("EGit", new String[]{"src"}, new String[] {"JCL_LIB"}, new String[]{"/SWT"}, null, "bin", new String[]{"bin"}, null, null, "1.8");
egitPrj.setOption(JavaCore.COMPILER_ANNOTATION_NULL_ANALYSIS, JavaCore.ENABLED);
createFolder("/EGit/src/egit");
createFile("/EGit/src/egit/UIUtils.java",
- "package egit; // Error: The type jdk8.MyConsumer cannot be resolved. It is indirectly referenced from required .class files\n" +
- "\n" +
- "import swt.EventObject;\n" +
- "\n" +
- "import swt.SelectionListener;\n" +
- "\n" +
- "public class UIUtils {\n" +
- " void foo() {\n" +
- " SelectionListener listener = new SelectionListener() {\n" +
- " public void widgetSelected(EventObject event) {\n" +
- " }\n" +
- " };\n" +
- " listener.toString();\n" +
- " }\n" +
+ "package egit; // Error: The type jdk8.MyConsumer cannot be resolved. It is indirectly referenced from required .class files\n" +
+ "\n" +
+ "import swt.EventObject;\n" +
+ "\n" +
+ "import swt.SelectionListener;\n" +
+ "\n" +
+ "public class UIUtils {\n" +
+ " void foo() {\n" +
+ " SelectionListener listener = new SelectionListener() {\n" +
+ " public void widgetSelected(EventObject event) {\n" +
+ " }\n" +
+ " };\n" +
+ " listener.toString();\n" +
+ " }\n" +
"}\n");
egitPrj.getProject().getWorkspace().build(IncrementalProjectBuilder.AUTO_BUILD, null);
IMarker[] markers = egitPrj.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs10Tests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs10Tests.java
index a1e1d67ef..c040ab619 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs10Tests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs10Tests.java
@@ -132,7 +132,7 @@ public void testBug529434_001() throws CoreException {
"}\n"
);
search("B", CONSTRUCTOR, REFERENCES, EXACT_RULE);
- assertSearchResults("src/X.java void X.main(String[]) [new B()] EXACT_MATCH");
+ assertSearchResults("src/X.java void X.main(String[]) [new B()] EXACT_MATCH");
}
// Add more tests here
} \ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs13Tests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs13Tests.java
index 6311ed7e3..8bdd8eff4 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs13Tests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs13Tests.java
@@ -195,7 +195,7 @@ public class JavaSearchBugs13Tests extends AbstractJavaSearchTests {
assertSearchResults(
"src/X.java int X.foo(int).localVar [localVar] EXACT_MATCH");
}
-
+
// add non-preview stuff involving yield field and method
public void testBug549413_019() throws CoreException {
//old style switch case without preview search for yield field.
@@ -226,7 +226,7 @@ public class JavaSearchBugs13Tests extends AbstractJavaSearchTests {
try {
search("yield", FIELD, REFERENCES);
- assertSearchResults("src/X.java void X.main(String[]) [yield] EXACT_MATCH\n" +
+ assertSearchResults("src/X.java void X.main(String[]) [yield] EXACT_MATCH\n" +
"src/X.java void X.main(String[]) [yield] EXACT_MATCH\n" +
"src/X.java void X.main(String[]) [yield] EXACT_MATCH\n" +
"src/X.java void X.main(String[]) [yield] EXACT_MATCH");
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs14SwitchExpressionTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs14SwitchExpressionTests.java
index 0db06df14..3dcf9d3c9 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs14SwitchExpressionTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs14SwitchExpressionTests.java
@@ -1007,7 +1007,7 @@ public void testBug549413_019() throws CoreException {
try {
search("yield", FIELD, REFERENCES);
- assertSearchResults("src/X.java void X.main(String[]) [yield] EXACT_MATCH\n" +
+ assertSearchResults("src/X.java void X.main(String[]) [yield] EXACT_MATCH\n" +
"src/X.java void X.main(String[]) [yield] EXACT_MATCH\n" +
"src/X.java void X.main(String[]) [yield] EXACT_MATCH\n" +
"src/X.java void X.main(String[]) [yield] EXACT_MATCH");
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs14Tests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs14Tests.java
index 92728697f..231c55cf5 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs14Tests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs14Tests.java
@@ -193,7 +193,7 @@ public class JavaSearchBugs14Tests extends AbstractJavaSearchTests {
"public record Point(int comp_) { \n" +
" public Point {\n" +
" comp_=11;\n" +
- " this.comp_=11;\n" +
+ " this.comp_=11;\n" +
" }\n" +
"}\n"
);
@@ -216,7 +216,7 @@ public class JavaSearchBugs14Tests extends AbstractJavaSearchTests {
"public record Point(int comp_) { \n" +
" public Point {\n" +
" comp_=11;\n" +
- " this.comp_=comp_;\n" +
+ " this.comp_=comp_;\n" +
" }\n" +
"}\n"
);
@@ -281,7 +281,7 @@ public class JavaSearchBugs14Tests extends AbstractJavaSearchTests {
"public record Point(int comp_) { \n" +
" public Point (int a) {\n" +
" // comp_=11;\n" +
- " this.comp_=a;\n" +
+ " this.comp_=a;\n" +
" }\n" +
"}\n"
);
@@ -521,8 +521,8 @@ public class JavaSearchBugs14Tests extends AbstractJavaSearchTests {
assertTrue(elements[0] instanceof LocalVariable);
search(elements[0], REFERENCES, EXACT_RULE);
assertSearchResults(
- "src/X.java Point(int) [comp_] EXACT_MATCH\n" +
- "src/X.java void Point.method() [comp_] EXACT_MATCH\n" +
+ "src/X.java Point(int) [comp_] EXACT_MATCH\n" +
+ "src/X.java void Point.method() [comp_] EXACT_MATCH\n" +
"src/X.java void Point.method() [comp_] EXACT_MATCH");
}
@@ -551,9 +551,9 @@ public class JavaSearchBugs14Tests extends AbstractJavaSearchTests {
assertTrue(elements[0] instanceof LocalVariable);
search(elements[0], REFERENCES, EXACT_RULE);
assertSearchResults(
- "src/X.java Point(int) [comp_] EXACT_MATCH\n" +
- "src/X.java void Point.method() [comp_] EXACT_MATCH\n" +
- "src/X.java void Point.method() [comp_] EXACT_MATCH\n" +
+ "src/X.java Point(int) [comp_] EXACT_MATCH\n" +
+ "src/X.java void Point.method() [comp_] EXACT_MATCH\n" +
+ "src/X.java void Point.method() [comp_] EXACT_MATCH\n" +
"src/X.java void Point.method() [comp_] EXACT_MATCH");
}
@@ -825,7 +825,7 @@ public class JavaSearchBugs14Tests extends AbstractJavaSearchTests {
assertTrue(elements.length ==1);
assertTrue(elements[0] instanceof ResolvedSourceType);
boolean record = ((ResolvedSourceType)elements[0]).isRecord();
- assertTrue(record);
+ assertTrue(record);
} finally {
deleteProject(project1);
}
@@ -886,7 +886,7 @@ public class JavaSearchBugs14Tests extends AbstractJavaSearchTests {
"public class cl {\n"+
"public cl() {\n"+
" method1();\n"+
- "}\n"+
+ "}\n"+
"private void method1() {\n"+
" String y= this.toString();\n"+
" if (y instanceof String /*here*/yz) {\n"+
@@ -913,7 +913,7 @@ public class JavaSearchBugs14Tests extends AbstractJavaSearchTests {
"public class cl {\n"+
"public cl() {\n"+
" method1();\n"+
- "}\n"+
+ "}\n"+
"private void method1() {\n"+
" String y= this.toString();\n"+
" if (y instanceof String /*here*/yz) {\n"+
@@ -942,7 +942,7 @@ public class JavaSearchBugs14Tests extends AbstractJavaSearchTests {
"public class cl {\n"+
"public cl() {\n"+
" method1();\n"+
- "}\n"+
+ "}\n"+
"private void method1() {\n"+
" String y= this.toString();\n"+
" if (y instanceof String /*here*/yz) {\n"+
@@ -963,7 +963,7 @@ public class JavaSearchBugs14Tests extends AbstractJavaSearchTests {
assertTrue((elements[0] instanceof LocalVariable));
search(elements[0], REFERENCES, EXACT_RULE);
assertSearchResults(
- "src/X.java void cl.method1() [yz] EXACT_MATCH\n" +
+ "src/X.java void cl.method1() [yz] EXACT_MATCH\n" +
"src/X.java void cl.method1() [yz] EXACT_MATCH");
}
@@ -974,7 +974,7 @@ public class JavaSearchBugs14Tests extends AbstractJavaSearchTests {
"public record cl() {\n"+
"public cl{\n"+
" method1();\n"+
- "}\n"+
+ "}\n"+
"private void method1() {\n"+
" String y= this.toString();\n"+
" if (y instanceof String /*here*/yz) {\n"+
@@ -995,7 +995,7 @@ public class JavaSearchBugs14Tests extends AbstractJavaSearchTests {
assertTrue((elements[0] instanceof LocalVariable));
search(elements[0], REFERENCES, EXACT_RULE);
assertSearchResults(
- "src/X.java void cl.method1() [yz] EXACT_MATCH\n" +
+ "src/X.java void cl.method1() [yz] EXACT_MATCH\n" +
"src/X.java void cl.method1() [yz] EXACT_MATCH");
}
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs8Tests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs8Tests.java
index 85c47310e..8cd212717 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs8Tests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs8Tests.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
*******************************************************************************/
@@ -142,7 +142,7 @@ protected void setUp () throws Exception {
/**
* @bug 400899: [1.8][search] Search engine/indexer should evolve to support Java 8 constructs
* @test Ensures that the search for type use annotation finds matches in the following
- * FieldDeclaration ::= Modifiersopt Type VariableDeclarators ';'
+ * FieldDeclaration ::= Modifiersopt Type VariableDeclarators ';'
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=400899"
*/
public void testBug400899g1() throws CoreException {
@@ -153,7 +153,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
"public class X {\n" +
" @Marker int x;\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -168,13 +168,13 @@ this.resultCollector,
null);
assertSearchResults(
"src/b400899/X.java b400899.X.x [Marker] EXACT_MATCH"
-);
+);
}
/**
* @bug 400899: [1.8][search] Search engine/indexer should evolve to support Java 8 constructs
* @test Ensures that the search for type use annotation finds matches in the following
- * TYPE: MethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '('
+ * TYPE: MethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '('
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=400899"
*/
public void testBug400899g2() throws CoreException {
@@ -185,7 +185,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
"public class X {\n" +
" @Marker <T> int x() { return 10; };\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -200,13 +200,13 @@ this.resultCollector,
null);
assertSearchResults(
"src/b400899/X.java int b400899.X.x() [Marker] EXACT_MATCH"
-);
+);
}
/**
* @bug 400899: [1.8][search] Search engine/indexer should evolve to support Java 8 constructs
* @test Ensures that the search for type use annotation finds matches in the following
- * FormalParameter ::= Modifiersopt Type VariableDeclaratorIdOrThis
+ * FormalParameter ::= Modifiersopt Type VariableDeclaratorIdOrThis
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=400899"
*/
public void testBug400899g3() throws CoreException {
@@ -217,7 +217,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
"public class X {\n" +
" int x(@Marker int p) { return 10; };\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -232,13 +232,13 @@ this.resultCollector,
null);
assertSearchResults(
"src/b400899/X.java int b400899.X.x(int) [Marker] EXACT_MATCH"
-);
+);
}
/**
* @bug 400899: [1.8][search] Search engine/indexer should evolve to support Java 8 constructs
* @test Ensures that the search for type use annotation finds matches in the following
- * FormalParameter ::= Modifiersopt Type PushZeroTypeAnnotations '...' VariableDeclaratorIdOrThis
+ * FormalParameter ::= Modifiersopt Type PushZeroTypeAnnotations '...' VariableDeclaratorIdOrThis
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=400899"
*/
public void testBug400899g4() throws CoreException {
@@ -249,7 +249,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
"public class X {\n" +
" int x(@Marker int ... p) { return 10; };\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -264,13 +264,13 @@ this.resultCollector,
null);
assertSearchResults(
"src/b400899/X.java int b400899.X.x(int ...) [Marker] EXACT_MATCH"
-);
+);
}
/**
* @bug 400899: [1.8][search] Search engine/indexer should evolve to support Java 8 constructs
* @test Ensures that the search for type use annotation finds matches in the following
- * FormalParameter ::= Modifiersopt Type @308... TypeAnnotations '...' VariableDeclaratorIdOrThis
+ * FormalParameter ::= Modifiersopt Type @308... TypeAnnotations '...' VariableDeclaratorIdOrThis
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=400899"
*/
public void testBug400899g5() throws CoreException {
@@ -281,7 +281,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
"public class X {\n" +
" int x(@Marker int [] @Marker ... p) { return 10; };\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -297,7 +297,7 @@ null);
assertSearchResults(
"src/b400899/X.java int b400899.X.x(int[] ...) [Marker] EXACT_MATCH\n" +
"src/b400899/X.java int b400899.X.x(int[] ...) [Marker] EXACT_MATCH"
-);
+);
}
/**
@@ -320,7 +320,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
" return 10;\n" +
" }\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -336,7 +336,7 @@ null);
assertSearchResults(
"src/b400899/X.java int b400899.X.x() [Marker] EXACT_MATCH\n" +
"src/b400899/X.java int b400899.X.x() [Marker] EXACT_MATCH"
-);
+);
}
/**
@@ -359,7 +359,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
" return 10;\n" +
" }\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -376,7 +376,7 @@ assertSearchResults(
"src/b400899/X.java int b400899.X.x() [Marker] EXACT_MATCH\n" +
"src/b400899/X.java int b400899.X.x() [Marker] EXACT_MATCH\n" +
"src/b400899/X.java int b400899.X.x() [Marker] EXACT_MATCH"
-);
+);
}
/**
@@ -398,7 +398,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
" return 10;\n" +
" }\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -415,7 +415,7 @@ assertSearchResults(
"src/b400899/X.java int b400899.X.x() [Marker] EXACT_MATCH\n" +
"src/b400899/X.java int b400899.X.x() [Marker] EXACT_MATCH\n" +
"src/b400899/X.java int b400899.X.x() [Marker] EXACT_MATCH"
-);
+);
}
/**
@@ -438,7 +438,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
" return 10;\n" +
" }\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -455,7 +455,7 @@ assertSearchResults(
"src/b400899/X.java int b400899.X.x() [Marker] EXACT_MATCH\n" +
"src/b400899/X.java int b400899.X.x() [Marker] EXACT_MATCH\n" +
"src/b400899/X.java int b400899.X.x() [Marker] EXACT_MATCH"
-);
+);
}
/**
@@ -475,7 +475,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
" @Marker String value2(); \n" +
" @Marker public String value3(); \n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -492,7 +492,7 @@ assertSearchResults(
"src/b400899/X.java String b400899.X.value() [Marker] EXACT_MATCH\n" +
"src/b400899/X.java String b400899.X.value2() [Marker] EXACT_MATCH\n" +
"src/b400899/X.java String b400899.X.value3() [Marker] EXACT_MATCH"
-);
+);
}
@@ -515,7 +515,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
" I i = @Marker int @Marker []::<String>clone;\n" +
" }\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -530,8 +530,8 @@ this.resultCollector,
null);
assertSearchResults(
"src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH\n" +
- "src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH"
-);
+ "src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH"
+);
}
/**
@@ -552,7 +552,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
" int j [] = new @Marker int @Marker [] { 10 };\n" +
" }\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -566,11 +566,11 @@ getJavaSearchWorkingCopiesScope(),
this.resultCollector,
null);
assertSearchResults(
- "src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH\n" +
- "src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH\n" +
- "src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH\n" +
"src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH"
-);
+);
}
/**
@@ -590,7 +590,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
" int j [] = (@Marker int @Marker []) null;\n" +
" }\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -604,10 +604,10 @@ getJavaSearchWorkingCopiesScope(),
this.resultCollector,
null);
assertSearchResults(
- "src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH\n" +
- "src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH\n" +
"src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH"
-);
+);
}
/**
@@ -627,7 +627,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
" }\n" +
" }\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -642,7 +642,7 @@ this.resultCollector,
null);
assertSearchResults(
"src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH"
-);
+);
}
/**
@@ -659,7 +659,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
"public class X extends Y<@Marker Integer, String> {}\n" +
"class Y<T, V> {\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -674,7 +674,7 @@ this.resultCollector,
null);
assertSearchResults(
"src/b400899/X.java b400899.X [Marker] EXACT_MATCH"
-);
+);
}
/**
@@ -691,7 +691,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
"public class X extends Y<@Marker Integer> {}\n" +
"class Y<T> {\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -706,7 +706,7 @@ this.resultCollector,
null);
assertSearchResults(
"src/b400899/X.java b400899.X [Marker] EXACT_MATCH"
-);
+);
}
/**
@@ -723,7 +723,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
"public class X<T extends @Marker Object & @Marker Comparable<@Marker ? super @Marker String>> {}\n" +
"class Y<T> {\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -737,11 +737,11 @@ getJavaSearchWorkingCopiesScope(),
this.resultCollector,
null);
assertSearchResults(
- "src/b400899/X.java b400899.X [Marker] EXACT_MATCH\n" +
- "src/b400899/X.java b400899.X [Marker] EXACT_MATCH\n" +
- "src/b400899/X.java b400899.X [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java b400899.X [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java b400899.X [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java b400899.X [Marker] EXACT_MATCH\n" +
"src/b400899/X.java b400899.X [Marker] EXACT_MATCH"
-);
+);
}
/**
@@ -761,7 +761,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
" 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" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -775,15 +775,15 @@ getJavaSearchWorkingCopiesScope(),
this.resultCollector,
null);
assertSearchResults(
- "src/b400899/X.java void b400899.X.foo(Map<? super Object,? extends String>) [Marker] EXACT_MATCH\n" +
- "src/b400899/X.java void b400899.X.foo(Map<? super Object,? extends String>) [Marker] EXACT_MATCH\n" +
- "src/b400899/X.java void b400899.X.foo(Map<? super Object,? extends String>) [Marker] EXACT_MATCH\n" +
- "src/b400899/X.java void b400899.X.foo(Map<? super Object,? extends String>) [Marker] EXACT_MATCH\n" +
- "src/b400899/X.java void b400899.X.goo(Map<? extends Object,? super String>) [Marker] EXACT_MATCH\n" +
- "src/b400899/X.java void b400899.X.goo(Map<? extends Object,? super String>) [Marker] EXACT_MATCH\n" +
- "src/b400899/X.java void b400899.X.goo(Map<? extends Object,? super String>) [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java void b400899.X.foo(Map<? super Object,? extends String>) [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java void b400899.X.foo(Map<? super Object,? extends String>) [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java void b400899.X.foo(Map<? super Object,? extends String>) [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java void b400899.X.foo(Map<? super Object,? extends String>) [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java void b400899.X.goo(Map<? extends Object,? super String>) [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java void b400899.X.goo(Map<? extends Object,? super String>) [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java void b400899.X.goo(Map<? extends Object,? super String>) [Marker] EXACT_MATCH\n" +
"src/b400899/X.java void b400899.X.goo(Map<? extends Object,? super String>) [Marker] EXACT_MATCH"
-);
+);
}
/**
@@ -811,7 +811,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
" U extends CJ<T, U> & J<T>>\n" +
" implements J<T> {\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -825,12 +825,12 @@ getJavaSearchWorkingCopiesScope(),
this.resultCollector,
null);
assertSearchResults(
- "src/b400899/X.java b400899.CI [Marker] EXACT_MATCH\n" +
- "src/b400899/X.java b400899.CI [Marker] EXACT_MATCH\n" +
- "src/b400899/X.java b400899.CI [Marker] EXACT_MATCH\n" +
- "src/b400899/X.java b400899.CJ [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java b400899.CI [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java b400899.CI [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java b400899.CI [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java b400899.CJ [Marker] EXACT_MATCH\n" +
"src/b400899/X.java b400899.CJ [Marker] EXACT_MATCH"
-);
+);
}
/**
@@ -853,7 +853,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
" }\n" +
" }\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -867,7 +867,7 @@ getJavaSearchWorkingCopiesScope(),
this.resultCollector,
null);
assertSearchResults(
- "src/b400899/X.java E b400899.X$Y.getOtherElement(Object) [Marker] EXACT_MATCH");
+ "src/b400899/X.java E b400899.X$Y.getOtherElement(Object) [Marker] EXACT_MATCH");
}
/**
@@ -886,7 +886,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
" if (!(this instanceof @Marker X)) {}\n" +
" }\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -901,7 +901,7 @@ this.resultCollector,
null);
assertSearchResults(
"src/b400899/X.java b400899.X() [Marker] EXACT_MATCH"
-);
+);
}
/**
@@ -917,9 +917,9 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
"import java.lang.annotation.ElementType;\n" +
"import java.lang.annotation.Target;\n" +
"public class X {\n" +
- " public class Z <@Marker T extends @Marker Y<@Marker ?>, @Marker Q extends @Marker CharSequence> {\n" +
+ " public class Z <@Marker T extends @Marker Y<@Marker ?>, @Marker Q extends @Marker CharSequence> {\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n" +
"interface Y<U> {}\n"
);
@@ -939,7 +939,7 @@ assertSearchResults(
"src/b400899/X.java b400899.X$Z [Marker] EXACT_MATCH\n" +
"src/b400899/X.java b400899.X$Z [Marker] EXACT_MATCH\n" +
"src/b400899/X.java b400899.X$Z [Marker] EXACT_MATCH"
-);
+);
}
/**
@@ -960,7 +960,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
" X [] x2 = new @Marker X @Marker [] { null };\n" +
" }\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -974,11 +974,11 @@ getJavaSearchWorkingCopiesScope(),
this.resultCollector,
null);
assertSearchResults(
- "src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH\n" +
- "src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH\n" +
- "src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH\n" +
"src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH"
-);
+);
}
/**
@@ -997,7 +997,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
" java.util.Map.Entry [] e = (java.util.Map<String, String>.@Marker Entry []) null;\n" +
" }\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -1012,7 +1012,7 @@ this.resultCollector,
null);
assertSearchResults(
"src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH"
-);
+);
}
/**
@@ -1031,7 +1031,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
"public class X<T extends Comparable<T> & Serializable> {\n" +
" void foo(List<? extends @Marker Comparable<T>> p) {} \n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -1046,7 +1046,7 @@ this.resultCollector,
null);
assertSearchResults(
"src/b400899/X.java void b400899.X.foo(List<? extends Comparable<T>>) [Marker] EXACT_MATCH"
-);
+);
}
/**
@@ -1066,7 +1066,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
"}\n" +
"class Bar<E extends Base, F extends Foo<E, @Marker Bar<E, F>>> {\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -1082,7 +1082,7 @@ null);
assertSearchResults(
"src/b400899/X.java b400899.Foo [Marker] EXACT_MATCH\n" +
"src/b400899/X.java b400899.Bar [Marker] EXACT_MATCH"
-);
+);
}
/**
@@ -1098,7 +1098,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
"import java.lang.annotation.Target;\n" +
"public class X extends @Marker Object {\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -1113,7 +1113,7 @@ this.resultCollector,
null);
assertSearchResults(
"src/b400899/X.java b400899.X [Marker] EXACT_MATCH"
-);
+);
}
/**
@@ -1130,9 +1130,9 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
"import java.lang.annotation.Target;\n" +
"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" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -1146,9 +1146,9 @@ getJavaSearchWorkingCopiesScope(),
this.resultCollector,
null);
assertSearchResults(
- "src/b400899/X.java b400899.X.x [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java b400899.X.x [Marker] EXACT_MATCH\n" +
"src/b400899/X.java b400899.X.y [Marker] EXACT_MATCH"
-);
+);
}
/**
@@ -1169,7 +1169,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
" Y y1 = new @Marker X().new @Marker Y();\n" +
" Y y2 = new @Marker X().new <String> @Marker Y();\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -1183,11 +1183,11 @@ getJavaSearchWorkingCopiesScope(),
this.resultCollector,
null);
assertSearchResults(
- "src/b400899/X.java b400899.X.y1 [Marker] EXACT_MATCH\n" +
- "src/b400899/X.java b400899.X.y1 [Marker] EXACT_MATCH\n" +
- "src/b400899/X.java b400899.X.y2 [Marker] POTENTIAL_MATCH\n" +
+ "src/b400899/X.java b400899.X.y1 [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java b400899.X.y1 [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java b400899.X.y2 [Marker] POTENTIAL_MATCH\n" +
"src/b400899/X.java b400899.X.y2 [Marker] EXACT_MATCH"
-);
+);
}
/**
@@ -1209,7 +1209,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
" Y y1 = x.new @Marker Y();\n" +
" Y y2 = x.new <String> @Marker Y();\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -1223,9 +1223,9 @@ getJavaSearchWorkingCopiesScope(),
this.resultCollector,
null);
assertSearchResults(
- "src/b400899/X.java b400899.X.y1 [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java b400899.X.y1 [Marker] EXACT_MATCH\n" +
"src/b400899/X.java b400899.X.y2 [Marker] EXACT_MATCH"
-);
+);
}
/**
@@ -1245,7 +1245,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
"public class X {\n" +
" void foo() throws @Marker NullPointerException, @Marker ArrayIndexOutOfBoundsException {}\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -1259,9 +1259,9 @@ getJavaSearchWorkingCopiesScope(),
this.resultCollector,
null);
assertSearchResults(
- "src/b400899/X.java void b400899.X.foo() [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java void b400899.X.foo() [Marker] EXACT_MATCH\n" +
"src/b400899/X.java void b400899.X.foo() [Marker] EXACT_MATCH"
-);
+);
}
/**
@@ -1285,7 +1285,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
"interface L {}\n" +
"public class X implements @Marker K, @Marker L {\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -1299,11 +1299,11 @@ getJavaSearchWorkingCopiesScope(),
this.resultCollector,
null);
assertSearchResults(
- "src/b400899/X.java b400899.K [Marker] EXACT_MATCH\n" +
- "src/b400899/X.java b400899.K [Marker] EXACT_MATCH\n" +
- "src/b400899/X.java b400899.X [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java b400899.K [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java b400899.K [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java b400899.X [Marker] EXACT_MATCH\n" +
"src/b400899/X.java b400899.X [Marker] EXACT_MATCH"
-);
+);
}
/**
@@ -1325,7 +1325,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
" I i = @Marker Y. @Marker Z @Marker [] [] @Marker [] ::foo;\n" +
" i.foo(10); \n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -1339,11 +1339,11 @@ getJavaSearchWorkingCopiesScope(),
this.resultCollector,
null);
assertSearchResults(
- "src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH\n" +
- "src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH\n" +
- "src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH\n" +
"src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH"
-);
+);
}
/**
@@ -1382,7 +1382,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
" System.out.println(x);\n" +
" }\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -1396,10 +1396,10 @@ getJavaSearchWorkingCopiesScope(),
this.resultCollector,
null);
assertSearchResults(
- "src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH\n" +
- "src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH\n" +
"src/b400899/X.java void b400899.X.main(String[]) [Marker] EXACT_MATCH"
-);
+);
}
/**
@@ -1422,7 +1422,7 @@ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
" Object q = (java.util. @Marker List<@Marker String> []) null;\n" +
" Object r = (java.util.Map.@Marker Entry @Marker []) null;\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -1436,21 +1436,21 @@ getJavaSearchWorkingCopiesScope(),
this.resultCollector,
null);
assertSearchResults(
- "src/b400899/X.java b400899.X.o [Marker] EXACT_MATCH\n" +
- "src/b400899/X.java b400899.X.p [Marker] EXACT_MATCH\n" +
- "src/b400899/X.java b400899.X.p [Marker] EXACT_MATCH\n" +
- "src/b400899/X.java b400899.X.q [Marker] EXACT_MATCH\n" +
- "src/b400899/X.java b400899.X.q [Marker] EXACT_MATCH\n" +
- "src/b400899/X.java b400899.X.r [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java b400899.X.o [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java b400899.X.p [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java b400899.X.p [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java b400899.X.q [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java b400899.X.q [Marker] EXACT_MATCH\n" +
+ "src/b400899/X.java b400899.X.r [Marker] EXACT_MATCH\n" +
"src/b400899/X.java b400899.X.r [Marker] EXACT_MATCH"
-);
+);
}
/**
* @bug 402902: [1.8][search] Search engine fails to annotation matches in extends/implements clauses
- * @test Ensures that the search for type use annotation finds matches
- * in extends and implements clauses.
- *
+ * @test Ensures that the search for type use annotation finds matches
+ * in extends and implements clauses.
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=402902"
*/
public void testBug400902() throws CoreException {
@@ -1464,9 +1464,9 @@ public void testBug400902() throws CoreException {
" int x = (@Marker int) 0;\n" +
" @Marker public class Y {}\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n" +
- "@Target(ElementType.TYPE)\n" +
+ "@Target(ElementType.TYPE)\n" +
"@interface Marker1 {}"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -1484,15 +1484,15 @@ public void testBug400902() throws CoreException {
"src/b400902/X.java b400902.X [Marker] EXACT_MATCH\n" +
"src/b400902/X.java b400902.X [Marker] EXACT_MATCH\n" +
"src/b400902/X.java b400902.X.x [Marker] EXACT_MATCH\n" +
- "src/b400902/X.java b400902.X$Y [Marker] EXACT_MATCH"
- );
+ "src/b400902/X.java b400902.X$Y [Marker] EXACT_MATCH"
+ );
}
/**
* @bug 424119: [1.8][search] CCE in search for references to TYPE_USE annotation on array dimension
- * @test Ensures that the search for type use annotation finds matches
+ * @test Ensures that the search for type use annotation finds matches
* in local variable declaration dimensions.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=424119"
*/
public void testBug424119_001() throws CoreException {
@@ -1509,7 +1509,7 @@ public void testBug424119_001() throws CoreException {
" String t @Annot() [] @Annot()[] = null, s @Annot() [];\n" +
"}\n" +
"String tab @Annot() [] = null;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Annot {}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -1528,15 +1528,15 @@ public void testBug424119_001() throws CoreException {
"src/b424119/X.java void b424119.X.foo() [Annot] EXACT_MATCH\n" +
"src/b424119/X.java void b424119.X.foo() [Annot] EXACT_MATCH\n" +
"src/b424119/X.java void b424119.X.foo() [Annot] EXACT_MATCH"
- );
+ );
}
/**
* @bug 424119: [1.8][search] CCE in search for references to TYPE_USE annotation on array dimension
- * @test Ensures that the search for type use single variable annotation finds matches
- * in local variable declaration inside initializer - ref bug 424119 comment 1
- * - checks for non-existence of CCE.
- *
+ * @test Ensures that the search for type use single variable annotation finds matches
+ * in local variable declaration inside initializer - ref bug 424119 comment 1
+ * - checks for non-existence of CCE.
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=424119"
*/
public void testBug424119_002() throws CoreException {
@@ -1549,7 +1549,7 @@ public void testBug424119_002() throws CoreException {
"{\n" +
" String tab @Annot(int[].class) [] = null;\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Annot {\n" +
" Class<int[]> value();\n" +
"}\n"
@@ -1569,10 +1569,10 @@ public void testBug424119_002() throws CoreException {
}
/**
* @bug 424119: [1.8][search] CCE in search for references to TYPE_USE annotation on array dimension
- * @test Ensures that the search for type use single variable annotation finds matches
+ * @test Ensures that the search for type use single variable annotation finds matches
* in local variable declaration inside initializer - ref bug 424119 comment 1 - checks
- * for indexing issue (ie not finding the references as mentioned in comment 1)
- *
+ * for indexing issue (ie not finding the references as mentioned in comment 1)
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=424119"
*/
@@ -1612,8 +1612,8 @@ public void testBug424119_003() throws CoreException {
}
/**
* @bug 427537: [1.8][search] CCE with search match location set to cast type and intersection casts
- * @test Ensures that the search for type use annotation does not cause CCE and returns correct results
- *
+ * @test Ensures that the search for type use annotation does not cause CCE and returns correct results
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=427537"
*/
public void testBug427537a() throws CoreException {
@@ -1630,7 +1630,7 @@ public void testBug427537a() throws CoreException {
" I j = (J & I) () -> {};\n" +
" j.foo();\n" +
" }\n" +
- "}\n"
+ "}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
"I",
@@ -1675,9 +1675,9 @@ public void testBug427677() throws CoreException {
/**
* @bug 400904
* @test tests search for Reference expression - super:: form, without type arguments
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=400904"
- *
+ *
*/
public void testBug400904_0001() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
@@ -1705,7 +1705,7 @@ public void testBug400904_0001() throws CoreException {
search(method, REFERENCES, EXACT_RULE);
assertSearchResults(
"src/b400904/X.java void b400904.X.doit() [foo] EXACT_MATCH"
- );
+ );
}
public void testBug400904_0001a() throws CoreException {
@@ -1734,15 +1734,15 @@ public void testBug400904_0001a() throws CoreException {
search(method, SUPER_REFERENCE);
assertSearchResults(
"src/b400904/X.java void b400904.X.doit() [foo] EXACT_MATCH"
- );
+ );
}
/**
* @bug 400904
* @test tests search for Reference expression - super:: form, with type arguments
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=400904"
- *
+ *
*/
public void testBug400904_0002() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
@@ -1770,15 +1770,15 @@ public void testBug400904_0002() throws CoreException {
search(method, REFERENCES, EXACT_RULE);
assertSearchResults(
"src/b400904/X.java void b400904.X.doit() [foo] EXACT_MATCH"
- );
+ );
}
/**
* @bug 400904
* @test tests search for Reference expression - SimpleName:: form, without type arguments.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=400904"
- *
+ *
*/
public void testBug400904_0003() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
@@ -1786,7 +1786,7 @@ public void testBug400904_0003() throws CoreException {
"interface I {\n" +
" public void doit();\n" +
"}\n" +
- "class Y {\n" +
+ "class Y {\n" +
" Y() {}\n" +
" Y(int i) {}\n" +
"}\n" +
@@ -1807,17 +1807,17 @@ public void testBug400904_0003() throws CoreException {
IMethod method = type.getMethod("foo", null);
search(method, REFERENCES, EXACT_RULE);
assertSearchResults(
- "src/b400904/X.java b400904.X.i [foo] EXACT_MATCH\n" +
+ "src/b400904/X.java b400904.X.i [foo] EXACT_MATCH\n" +
"src/b400904/X.java void b400904.X.main() [foo()] EXACT_MATCH"
- );
+ );
}
/**
* @bug 400904
* @test tests search for Reference expression - SimpleName:: form, with type arguments.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=400904"
- *
+ *
*/
public void testBug400904_0004() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
@@ -1842,15 +1842,15 @@ public void testBug400904_0004() throws CoreException {
search(method, REFERENCES, EXACT_RULE);
assertSearchResults(
"src/b400904/X.java void b400904.X.main(String[]) [foo] EXACT_MATCH"
- );
+ );
}
/**
* @bug 400904
* @test tests search for Reference expression - QualifiedName:: form, without type arguments.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=400904"
- *
+ *
*/
public void testBug400904_0005() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
@@ -1877,15 +1877,15 @@ public void testBug400904_0005() throws CoreException {
search(method, REFERENCES, EXACT_RULE);
assertSearchResults(
"src/b400904/X.java void b400904.X.main(String[]) [foo] EXACT_MATCH"
- );
+ );
}
/**
* @bug 400904
* @test tests search for Reference expression - QualifiedName:: form, with type arguments.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=400904"
- *
+ *
*/
public void testBug400904_0006() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
@@ -1912,15 +1912,15 @@ public void testBug400904_0006() throws CoreException {
search(method, REFERENCES, EXACT_RULE);
assertSearchResults(
"src/b400904/X.java void b400904.X.main(String[]) [foo] EXACT_MATCH"
- );
+ );
}
/**
* @bug 400904
* @test tests search for Reference expression - Primary:: form, without type arguments.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=400904"
- *
+ *
*/
public void testBug400904_0007() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
@@ -1945,15 +1945,15 @@ public void testBug400904_0007() throws CoreException {
search(method, REFERENCES, EXACT_RULE);
assertSearchResults(
"src/b400904/X.java void b400904.X.main(String[]) [foo] EXACT_MATCH"
- );
+ );
}
/**
* @bug 400904
* @test tests search for Reference expression - Primary:: form, with type arguments.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=400904"
- *
+ *
*/
public void testBug400904_0008() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
@@ -1978,38 +1978,38 @@ public void testBug400904_0008() throws CoreException {
search(method, REFERENCES, EXACT_RULE);
assertSearchResults(
"src/b400904/X.java void b400904.X.main(String[]) [foo] EXACT_MATCH"
- );
+ );
}
/**
* @bug 400904
* @test tests search for Reference expression - X<T>:: form, without type arguments
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=400904"
- *
+ *
*/
public void testBug400904_0009() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400904/X.java",
- "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" +
+ "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"
);
IType type = this.workingCopies[0].getType("Y");
@@ -2024,32 +2024,32 @@ public void testBug400904_0009() throws CoreException {
/**
* @bug 400904
* @test tests search for Reference expression - X<T>:: form, with type arguments
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=400904"
- *
+ *
*/
public void testBug400904_0010() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400904/X.java",
- "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" +
+ "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"
);
IType type = this.workingCopies[0].getType("Y");
@@ -2063,9 +2063,9 @@ public void testBug400904_0010() throws CoreException {
/**
* @bug 400904
* @test tests search for Reference expression - X<T>.Name :: form, without type arguments
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=400904"
- *
+ *
*/
public void testBug400904_0011() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
@@ -2101,9 +2101,9 @@ public void testBug400904_0011() throws CoreException {
/**
* @bug 400904
* @test tests search for Reference expression - X<T>.Name :: form, with type arguments
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=400904"
- *
+ *
*/
public void testBug400904_0012() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
@@ -2139,9 +2139,9 @@ public void testBug400904_0012() throws CoreException {
/**
* @bug 400904
* @test tests search for Reference expression - X<T>.Y<K> :: form, without type arguments
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=400904"
- *
+ *
*/
public void testBug400904_0013() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
@@ -2176,9 +2176,9 @@ public void testBug400904_0013() throws CoreException {
/**
* @bug 400904
* @test tests search for Reference expression - X<T>.Y<K> :: form, with type arguments
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=400904"
- *
+ *
*/
public void testBug400904_0014() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
@@ -2213,9 +2213,9 @@ public void testBug400904_0014() throws CoreException {
/**
* @bug 400904
* @test tests search for Reference expression - X<T>.Y<K> :: new form, with type arguments
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=400904"
- *
+ *
*/
public void testBug400904_0015() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
@@ -2251,9 +2251,9 @@ public void testBug400904_0015() throws CoreException {
/**
* @bug 400905
* @test lambda expression search on a) field b)parameter
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=400905"
- *
+ *
*/
public void testBug400905_0001() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
@@ -2276,16 +2276,16 @@ public void testBug400905_0001() throws CoreException {
search(method, DECLARATIONS, EXACT_RULE);
assertSearchResults(
"src/b400905/X.java int b400905.I.foo() [foo] EXACT_MATCH\n" +
- "src/b400905/X.java int void b400905.X.main(String[]):<lambda #1>.foo() [() ->] EXACT_MATCH\n" +
- "src/b400905/X.java int void b400905.X.doit():<lambda #1>.foo() [() ->] EXACT_MATCH");
+ "src/b400905/X.java int void b400905.X.main(String[]):<lambda #1>.foo() [() ->] EXACT_MATCH\n" +
+ "src/b400905/X.java int void b400905.X.doit():<lambda #1>.foo() [() ->] EXACT_MATCH");
}
/**
* @bug 400905
* @test lambda expression search on a set of contexts with
* interface declaration and usage being in different files.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=400905"
- *
+ *
*/
public void testBug400905_0002() throws CoreException {
this.workingCopies = new ICompilationUnit[3];
@@ -2316,19 +2316,19 @@ public void testBug400905_0002() throws CoreException {
IMethod method = type.getMethod("foo", new String[] {});
search(method, DECLARATIONS, EXACT_RULE);
assertSearchResults(
- "src/b400905/I.java int b400905.I.foo() [foo] EXACT_MATCH\n" +
- "src/b400905/X.java int void b400905.X.main(String[]):<lambda #1>.foo() [() ->] EXACT_MATCH\n" +
- "src/b400905/X.java int void b400905.X.main(String[]):<lambda #1>.foo() [() ->] EXACT_MATCH\n" +
- "src/b400905/X.java int void b400905.X.main(String[]):<lambda #1>.foo() [()->] EXACT_MATCH\n" +
- "src/b400905/X.java int I b400905.X.bar():<lambda #1>.foo() [() ->] EXACT_MATCH");
+ "src/b400905/I.java int b400905.I.foo() [foo] EXACT_MATCH\n" +
+ "src/b400905/X.java int void b400905.X.main(String[]):<lambda #1>.foo() [() ->] EXACT_MATCH\n" +
+ "src/b400905/X.java int void b400905.X.main(String[]):<lambda #1>.foo() [() ->] EXACT_MATCH\n" +
+ "src/b400905/X.java int void b400905.X.main(String[]):<lambda #1>.foo() [()->] EXACT_MATCH\n" +
+ "src/b400905/X.java int I b400905.X.bar():<lambda #1>.foo() [() ->] EXACT_MATCH");
}
/**
* @bug 400905
- * @test lambda expression search on a set of contexts with the
+ * @test lambda expression search on a set of contexts with the
* interface declaration and usage being in different files.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=400905"
- *
+ *
*/
public void testBug400905_0003() throws CoreException {
this.workingCopies = new ICompilationUnit[3];
@@ -2353,19 +2353,19 @@ public void testBug400905_0003() throws CoreException {
IMethod method = type.getMethod("foo", new String[] {"QY;"});
search(method, DECLARATIONS, EXACT_RULE);
assertSearchResults(
- "src/b400905/I.java boolean b400905.I.foo(Y) [foo] EXACT_MATCH\n" +
- "src/b400905/X.java boolean void b400905.X.main(String[]):<lambda #1>.foo(b400905.Y) [y->] EXACT_MATCH\n" +
- "src/b400905/X.java boolean void b400905.X.main(String[]):<lambda #1>.foo(b400905.Y) [y ->] EXACT_MATCH\n" +
+ "src/b400905/I.java boolean b400905.I.foo(Y) [foo] EXACT_MATCH\n" +
+ "src/b400905/X.java boolean void b400905.X.main(String[]):<lambda #1>.foo(b400905.Y) [y->] EXACT_MATCH\n" +
+ "src/b400905/X.java boolean void b400905.X.main(String[]):<lambda #1>.foo(b400905.Y) [y ->] EXACT_MATCH\n" +
"src/b400905/X.java boolean void b400905.X.main(String[]):<lambda #1>.foo(b400905.Y) [y ->] EXACT_MATCH"
- );
+ );
}
/**
* @bug 400905
- * @test lambda expression search on a set of contexts with the
+ * @test lambda expression search on a set of contexts with the
* interface declaration and usage being in different files.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=400905"
- *
+ *
*/
public void testBug400905_0004() throws CoreException {
this.workingCopies = new ICompilationUnit[3];
@@ -2390,20 +2390,20 @@ public void testBug400905_0004() throws CoreException {
IMethod method = type.getMethod("foo", new String[] {});
search(method, DECLARATIONS, EXACT_RULE);
assertSearchResults(
- "src/b400905/I.java T b400905.I.foo() [foo] EXACT_MATCH\n" +
- "src/b400905/X.java b400905.Y void b400905.X.main(String[]):<lambda #1>.foo() [() /* foo */ ->] EXACT_MATCH\n" +
- "src/b400905/X.java b400905.Y void b400905.X.main(String[]):<lambda #1>.foo() [(() /* true */->] EXACT_MATCH\n" +
- "src/b400905/X.java b400905.Y void b400905.X.main(String[]):<lambda #1>.foo() [(() /* false */ ->] EXACT_MATCH\n" +
+ "src/b400905/I.java T b400905.I.foo() [foo] EXACT_MATCH\n" +
+ "src/b400905/X.java b400905.Y void b400905.X.main(String[]):<lambda #1>.foo() [() /* foo */ ->] EXACT_MATCH\n" +
+ "src/b400905/X.java b400905.Y void b400905.X.main(String[]):<lambda #1>.foo() [(() /* true */->] EXACT_MATCH\n" +
+ "src/b400905/X.java b400905.Y void b400905.X.main(String[]):<lambda #1>.foo() [(() /* false */ ->] EXACT_MATCH\n" +
"src/b400905/X.java java.lang.Object void b400905.X.main(String[]):<lambda #1>.foo() [() /* cast */ ->] EXACT_MATCH"
- );
+ );
}
/**
* @bug 400905
- * @test lambda expression search on a set of contexts with the
+ * @test lambda expression search on a set of contexts with the
* interface declaration and usage being in different files.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=400905"
- *
+ *
*/
public void testBug400905_0005() throws CoreException {
this.workingCopies = new ICompilationUnit[3];
@@ -2422,22 +2422,22 @@ public void testBug400905_0005() throws CoreException {
"public interface Y {\n" +
" public abstract void bar() { };\n" +
"}\n") ;
-
+
IType type = this.workingCopies[2].getType("Y");
IMethod method = type.getMethod("bar", new String[] {});
search(method, DECLARATIONS, EXACT_RULE);
assertSearchResults(
- "src/b400905/X.java void b400905.Y void b400905.X.main(String[]):<lambda #1>.foo():<lambda #1>.bar() [() /* bar */ ->] EXACT_MATCH\n" +
+ "src/b400905/X.java void b400905.Y void b400905.X.main(String[]):<lambda #1>.foo():<lambda #1>.bar() [() /* bar */ ->] EXACT_MATCH\n" +
"src/b400905/Y.java void b400905.Y.bar() [bar] EXACT_MATCH"
- );
+ );
}
/**
* @bug 400905
- * @test lambda expression search on a set of contexts with the
+ * @test lambda expression search on a set of contexts with the
* interface declaration and usage being in different files.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=400905"
- *
+ *
*/
public void testBug400905_0006() throws CoreException {
try {
@@ -2465,7 +2465,7 @@ public void testBug400905_0006() throws CoreException {
IMethod method = getCompilationUnit("/P/src/I.java").getType("I").getMethod("foo", new String[0]);
search(method, DECLARATIONS, EXACT_RULE, SearchEngine.createJavaSearchScope(new IJavaProject[] {project}), this.resultCollector);
assertSearchResults(
- "src/I.java void I.foo() [foo] EXACT_MATCH\n" +
+ "src/I.java void I.foo() [foo] EXACT_MATCH\n" +
"src/X.java void void X.main(String[]):<lambda #1>.foo() [()->] EXACT_MATCH"
);
}
@@ -2476,11 +2476,11 @@ public void testBug400905_0006() throws CoreException {
/**
* @bug 400905
- * @test lambda expression search on a set of contexts with the
+ * @test lambda expression search on a set of contexts with the
* interface declaration and usage being in different files.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=400905"
- *
+ *
*/
public void testBug400905_0007() throws CoreException {
try {
@@ -2489,7 +2489,7 @@ public void testBug400905_0007() throws CoreException {
"/P/src/X.java",
"public class X {\n" +
" void foo() {\n" +
- " I i = Y::new;\n" +
+ " I i = Y::new;\n" +
" }\n" +
"}\n"
);
@@ -2520,7 +2520,7 @@ public void testBug400905_0007a() throws CoreException {
"/P/src/X.java",
"public class X {\n" +
" void foo() {\n" +
- " I i = Y::new;\n" +
+ " I i = Y::new;\n" +
" }\n" +
"}\n"
);
@@ -2638,7 +2638,7 @@ public void testBug400905_0010() throws CoreException {
);
IMethod method = getCompilationUnit("/P/src/Y.java").getType("Y").getMethod("goo", new String[0]);
search(method, REFERENCES, EXACT_RULE, SearchEngine.createJavaSearchScope(new IJavaProject[] {project}), this.resultCollector);
- assertSearchResults("src/J.java void J.main(String[]) [goo] EXACT_MATCH\n" +
+ assertSearchResults("src/J.java void J.main(String[]) [goo] EXACT_MATCH\n" +
"src/J.java void J.foo() [goo] EXACT_MATCH");
}
finally {
@@ -2703,12 +2703,12 @@ public void testBug400905_0012() throws CoreException {
" public void doit();\n" +
"}\n"
);
-
+
IType type = getCompilationUnit("/P/src/I.java").getType("I");
IMethod method = type.getMethod("doit", new String[0]);
search(method, DECLARATIONS|IGNORE_DECLARING_TYPE|IGNORE_RETURN_TYPE, SearchPattern.R_CASE_SENSITIVE | SearchPattern.R_ERASURE_MATCH, SearchEngine.createHierarchyScope(type), this.resultCollector);
- assertSearchResults("src/I.java void I.doit() [doit] EXACT_MATCH\n" +
- "src/X.java void X.i:<lambda #1>.doit() [() ->] EXACT_MATCH\n" +
+ assertSearchResults("src/I.java void I.doit() [doit] EXACT_MATCH\n" +
+ "src/X.java void X.i:<lambda #1>.doit() [() ->] EXACT_MATCH\n" +
"src/X.java void X.i2:<anonymous>#1.doit() [doit] EXACT_MATCH");
}
finally {
@@ -2738,12 +2738,12 @@ public void testBug400905_0013() throws CoreException {
" public int doit();\n" +
"}\n"
);
-
+
IType type = getCompilationUnit("/P/src/I.java").getType("I");
IMethod method = type.getMethod("doit", new String[0]);
search(method, DECLARATIONS|IGNORE_DECLARING_TYPE|IGNORE_RETURN_TYPE, SearchPattern.R_CASE_SENSITIVE | SearchPattern.R_ERASURE_MATCH, SearchEngine.createHierarchyScope(type), this.resultCollector);
- assertSearchResults("src/I.java int I.doit() [doit] EXACT_MATCH\n" +
- "src/X.java int void X.zoo():<lambda #1>.doit() [() ->] EXACT_MATCH\n" +
+ assertSearchResults("src/I.java int I.doit() [doit] EXACT_MATCH\n" +
+ "src/X.java int void X.zoo():<lambda #1>.doit() [() ->] EXACT_MATCH\n" +
"src/X.java int void X.zoo():<anonymous>#1.doit() [doit] EXACT_MATCH");
}
finally {
@@ -2772,12 +2772,12 @@ public void testBug400905_0013a() throws CoreException {
" public int doit();\n" +
"}\n"
);
-
+
IType type = getCompilationUnit("/P/src/I.java").getType("I");
IMethod method = type.getMethod("doit", new String[0]);
search(method, DECLARATIONS|IGNORE_DECLARING_TYPE|IGNORE_RETURN_TYPE, SearchPattern.R_CASE_SENSITIVE | SearchPattern.R_ERASURE_MATCH, SearchEngine.createHierarchyScope(type), this.resultCollector);
- assertSearchResults("src/I.java int I.doit() [doit] EXACT_MATCH\n" +
- "src/X.java int void X.zoo():<lambda #1>.doit() [() /*1*/->] EXACT_MATCH\n" +
+ assertSearchResults("src/I.java int I.doit() [doit] EXACT_MATCH\n" +
+ "src/X.java int void X.zoo():<lambda #1>.doit() [() /*1*/->] EXACT_MATCH\n" +
"src/X.java int int void X.zoo():<lambda #1>.doit():<lambda #1>.doit() [() /*2*/->] EXACT_MATCH");
}
finally {
@@ -2806,10 +2806,10 @@ public void testBug400905_0013b() throws CoreException {
" public int doit(X x1);\n" +
"}\n"
);
-
+
IType type = getCompilationUnit("/P/src/X.java").getType("X");
search(type, REFERENCES, SearchPattern.R_CASE_SENSITIVE | SearchPattern.R_ERASURE_MATCH, SearchEngine.createHierarchyScope(type), this.resultCollector);
- assertSearchResults("src/X.java int int void X.zoo():<lambda #1>.doit(X):<lambda #1>.doit(X) [X] EXACT_MATCH\n" +
+ assertSearchResults("src/X.java int int void X.zoo():<lambda #1>.doit(X):<lambda #1>.doit(X) [X] EXACT_MATCH\n" +
"src/X.java int void X.zoo():<lambda #1>.doit(X) [X] EXACT_MATCH");
}
finally {
@@ -2838,10 +2838,10 @@ public void testBug400905_0013c() throws CoreException {
" public int doit(X x1);\n" +
"}\n"
);
-
+
IType type = getCompilationUnit("/P/src/X.java").getType("X");
search(type, REFERENCES, SearchEngine.createJavaSearchScope(new IJavaElement[] {type}), this.resultCollector);
- assertSearchResults("src/X.java int int void X.zoo():<lambda #1>.doit(X):<lambda #1>.doit(X) [X] EXACT_MATCH\n" +
+ assertSearchResults("src/X.java int int void X.zoo():<lambda #1>.doit(X):<lambda #1>.doit(X) [X] EXACT_MATCH\n" +
"src/X.java int void X.zoo():<lambda #1>.doit(X) [X] EXACT_MATCH");
}
finally {
@@ -2870,11 +2870,11 @@ public void testBug400905_0013d() throws CoreException {
" public int doit(X x1);\n" +
"}\n"
);
-
+
IType type = getCompilationUnit("/P/src/X.java").getType("X");
search(type, REFERENCES, SearchEngine.createJavaSearchScope(new IJavaElement[] {project}), this.resultCollector);
- assertSearchResults("src/I.java int I.doit(X) [X] EXACT_MATCH\n" +
- "src/X.java int int void X.zoo():<lambda #1>.doit(X):<lambda #1>.doit(X) [X] EXACT_MATCH\n" +
+ assertSearchResults("src/I.java int I.doit(X) [X] EXACT_MATCH\n" +
+ "src/X.java int int void X.zoo():<lambda #1>.doit(X):<lambda #1>.doit(X) [X] EXACT_MATCH\n" +
"src/X.java int void X.zoo():<lambda #1>.doit(X) [X] EXACT_MATCH");
}
finally {
@@ -2906,12 +2906,12 @@ public void testBug400905_0013e() throws CoreException {
" public int doit(X x1);\n" +
"}\n"
);
-
+
IType type = getCompilationUnit("/P/src/X.java").getType("X");
search(type, REFERENCES, SearchEngine.createJavaSearchScope(new IJavaElement[] {project}), this.resultCollector);
- assertSearchResults("src/I.java int I.doit(X) [X] EXACT_MATCH\n" +
- "src/X.java int int void X.zoo():<lambda #1>.doit(X):<lambda #1>.doit(X) [X] EXACT_MATCH\n" +
- "src/X.java int void X.zoo():<lambda #1>.doit(X):Q#1.x [X] EXACT_MATCH\n" +
+ assertSearchResults("src/I.java int I.doit(X) [X] EXACT_MATCH\n" +
+ "src/X.java int int void X.zoo():<lambda #1>.doit(X):<lambda #1>.doit(X) [X] EXACT_MATCH\n" +
+ "src/X.java int void X.zoo():<lambda #1>.doit(X):Q#1.x [X] EXACT_MATCH\n" +
"src/X.java int void X.zoo():<lambda #1>.doit(X) [X] EXACT_MATCH");
}
finally {
@@ -2944,13 +2944,13 @@ public void testBug400905_0013f() throws CoreException {
" public int doit(X x1);\n" +
"}\n"
);
-
+
IType type = getCompilationUnit("/P/src/X.java").getType("X");
search(type, REFERENCES, SearchEngine.createJavaSearchScope(new IJavaElement[] {project}), this.resultCollector);
- assertSearchResults("src/I.java int I.doit(X) [X] EXACT_MATCH\n" +
- "src/X.java int int void X.zoo():<lambda #1>.doit(X):<lambda #1>.doit(X) [X] EXACT_MATCH\n" +
- "src/X.java int void X.zoo():<lambda #1>.doit(X):Q#1.x [X] EXACT_MATCH\n" +
- "src/X.java int void X.zoo():<lambda #1>.doit(X) [X] EXACT_MATCH\n" +
+ assertSearchResults("src/I.java int I.doit(X) [X] EXACT_MATCH\n" +
+ "src/X.java int int void X.zoo():<lambda #1>.doit(X):<lambda #1>.doit(X) [X] EXACT_MATCH\n" +
+ "src/X.java int void X.zoo():<lambda #1>.doit(X):Q#1.x [X] EXACT_MATCH\n" +
+ "src/X.java int void X.zoo():<lambda #1>.doit(X) [X] EXACT_MATCH\n" +
"src/X.java int void X.zoo():<lambda #1>.doit(X) [X] EXACT_MATCH");
}
finally {
@@ -2979,11 +2979,11 @@ public void testBug400905_0014() throws CoreException {
" public int doit(int x);\n" +
"}\n"
);
-
+
IType type = getCompilationUnit("/P/src/I.java").getType("I");
IMethod method = type.getMethod("doit", new String[] {"I"});
search(method, DECLARATIONS|IGNORE_DECLARING_TYPE|IGNORE_RETURN_TYPE, SearchPattern.R_CASE_SENSITIVE | SearchPattern.R_ERASURE_MATCH, SearchEngine.createHierarchyScope(type), this.resultCollector);
- assertSearchResults("src/I.java int I.doit(int) [doit] EXACT_MATCH\n" +
+ assertSearchResults("src/I.java int I.doit(int) [doit] EXACT_MATCH\n" +
"src/X.java int void X.zoo():<lambda #1>.doit(int) [(x) ->] EXACT_MATCH");
}
finally {
@@ -3018,7 +3018,7 @@ public void testBug400905_0015() throws CoreException {
" public int doit(int x);\n" +
"}\n"
);
-
+
IType type = getCompilationUnit("/P/src/I.java").getType("I");
IMethod method = type.getMethod("doit", new String[] {"I"});
search(method, DECLARATIONS|IGNORE_DECLARING_TYPE|IGNORE_RETURN_TYPE, SearchPattern.R_CASE_SENSITIVE | SearchPattern.R_ERASURE_MATCH, SearchEngine.createHierarchyScope(type), this.resultCollector);
@@ -3058,11 +3058,11 @@ public void testBug400905_0016() throws CoreException {
" public int doit(int x);\n" +
"}\n"
);
-
+
IType type = getCompilationUnit("/P/src/I.java").getType("I");
IMethod method = type.getMethod("doit", new String[] {"I"});
search(method, DECLARATIONS|IGNORE_DECLARING_TYPE|IGNORE_RETURN_TYPE, SearchPattern.R_CASE_SENSITIVE | SearchPattern.R_ERASURE_MATCH, SearchEngine.createHierarchyScope(type), this.resultCollector);
- assertSearchResults("src/I.java int I.doit(int) [doit] EXACT_MATCH\n" +
+ assertSearchResults("src/I.java int I.doit(int) [doit] EXACT_MATCH\n" +
"src/X.java int void X.zoo():<lambda #1>.doit(int) [(x) ->] EXACT_MATCH");
}
finally {
@@ -3090,7 +3090,7 @@ public void testBug400905_0017() throws CoreException {
IType type = getCompilationUnit("/P/src/Function.java").getType("Function");
IMethod method = type.getMethods()[0];
search(method, DECLARATIONS|IGNORE_DECLARING_TYPE|IGNORE_RETURN_TYPE, SearchPattern.R_CASE_SENSITIVE | SearchPattern.R_ERASURE_MATCH, SearchEngine.createHierarchyScope(type), this.resultCollector);
- assertSearchResults("src/Function.java R Function.apply(T) [apply] EXACT_MATCH\n" +
+ assertSearchResults("src/Function.java R Function.apply(T) [apply] EXACT_MATCH\n" +
"src/Y.java R Function<I,R> Collectors.castingIdentity():<lambda #1>.apply(I) [i ->] EXACT_MATCH");
}
finally {
@@ -3118,7 +3118,7 @@ public void testBug400905_0018() throws CoreException {
IType type = getCompilationUnit("/P/src/Function.java").getType("Function");
IMethod method = type.getMethods()[0];
search(method, DECLARATIONS|IGNORE_DECLARING_TYPE|IGNORE_RETURN_TYPE, SearchPattern.R_CASE_SENSITIVE | SearchPattern.R_ERASURE_MATCH, SearchEngine.createHierarchyScope(type), this.resultCollector);
- assertSearchResults("src/Function.java R Function.apply(T) [apply] EXACT_MATCH\n" +
+ assertSearchResults("src/Function.java R Function.apply(T) [apply] EXACT_MATCH\n" +
"src/Y.java java.lang.String Function<String,String> Collectors.castingIdentity():<lambda #1>.apply(java.lang.String) [i ->] EXACT_MATCH");
}
finally {
@@ -3182,7 +3182,7 @@ public void testBug400905_0021() throws CoreException {
" return i -> (R) i;\n" +
" }\n" +
"}\n") ;
-
+
IPath path = new Path("/JavaSearchBugs/src/p400905");
try {
createFolder(path);
@@ -3192,9 +3192,9 @@ public void testBug400905_0021() throws CoreException {
IType type = this.workingCopies[0].getType("Function");
IMethod method = type.getMethods()[0];
search(method, DECLARATIONS|IGNORE_DECLARING_TYPE|IGNORE_RETURN_TYPE, SearchPattern.R_CASE_SENSITIVE | SearchPattern.R_ERASURE_MATCH, SearchEngine.createHierarchyScope(type), this.resultCollector);
- assertSearchResults("src/p400905/Function.java R p400905.Function.apply(T) [apply] EXACT_MATCH\n" +
+ assertSearchResults("src/p400905/Function.java R p400905.Function.apply(T) [apply] EXACT_MATCH\n" +
"src/p400905/Collectors.java R Function<I,R> p400905.Collectors.castingIdentity():<lambda #1>.apply(I) [i ->] EXACT_MATCH");
- } finally {
+ } finally {
deleteFolder(path);
}
}
@@ -3216,7 +3216,7 @@ public void testBug400905_0022() throws CoreException {
);
search("thrice", METHOD, DECLARATIONS, ERASURE_RULE, getJavaSearchScope(), this.resultCollector);
assertSearchResults(
- "src/test/Test.java int test.FunctionalInterface.thrice(int) [thrice] EXACT_MATCH\n" +
+ "src/test/Test.java int test.FunctionalInterface.thrice(int) [thrice] EXACT_MATCH\n" +
"src/test/Test.java int test.X.i:<lambda #1>.thrice(int) [(x) ->] EXACT_MATCH"
);
}
@@ -3251,9 +3251,9 @@ public void testBug400905_0023() throws CoreException {
);
search("thrice", METHOD, DECLARATIONS, ERASURE_RULE, getJavaSearchScope(), this.resultCollector);
assertSearchResults(
- "src/test/Test.java int test.I.thrice(int) [thrice] EXACT_MATCH\n" +
- "src/test/Test.java int test.X.i:<lambda #1>.thrice(int) [(x) /* field */ ->] EXACT_MATCH\n" +
- "src/test/Test.java int void test.X.main(String[]):<lambda #1>.thrice(int) [(x) /*call*/ ->] EXACT_MATCH\n" +
+ "src/test/Test.java int test.I.thrice(int) [thrice] EXACT_MATCH\n" +
+ "src/test/Test.java int test.X.i:<lambda #1>.thrice(int) [(x) /* field */ ->] EXACT_MATCH\n" +
+ "src/test/Test.java int void test.X.main(String[]):<lambda #1>.thrice(int) [(x) /*call*/ ->] EXACT_MATCH\n" +
"src/test/Test.java int void test.X.main(String[]):<lambda #1>.thrice(int) [(x) /* local */ ->] EXACT_MATCH"
);
}
@@ -3270,7 +3270,7 @@ public void testBug400905_0024() throws CoreException {
" }\n" +
"}\n"
);
-
+
search(this.workingCopies[0].getType("X").getMethod("goo", new String[] { "I" }), THIS_REFERENCE);
assertSearchResults("");
}
@@ -3290,7 +3290,7 @@ public void testBug400905_0025() throws CoreException {
" }\n" +
"}\n"
);
-
+
search(this.workingCopies[0].getType("Y").getMethod("goo", new String[] { "I" }), THIS_REFERENCE);
assertSearchResults("src/test/Test.java void test.X.main(String[]) [goo] EXACT_MATCH");
}
@@ -3310,7 +3310,7 @@ public void testBug400905_0026() throws CoreException {
" }\n" +
"}\n"
);
-
+
search(this.workingCopies[0].getType("Y").getMethod("goo", new String[] { "I" }), SUPER_REFERENCE);
assertSearchResults("src/test/Test.java void test.X.main(String[]) [goo] EXACT_MATCH");
}
@@ -3330,7 +3330,7 @@ public void testBug400905_0027() throws CoreException {
" }\n" +
"}\n"
);
-
+
search(this.workingCopies[0].getType("Y").getMethod("goo", new String[] { "I" }), QUALIFIED_REFERENCE);
assertSearchResults("");
}
@@ -3352,7 +3352,7 @@ public void testBug400905_0028() throws CoreException {
" }\n" +
"}\n"
);
-
+
search(this.workingCopies[0].getType("Y").getType("Z").getMethod("goo", new String[] { "I" }), THIS_REFERENCE | SUPER_REFERENCE | QUALIFIED_REFERENCE);
assertSearchResults("src/test/Test.java void test.X.main(String[]) [goo] EXACT_MATCH");
}
@@ -3374,9 +3374,9 @@ public void testBug400905_0029() throws CoreException {
" }\n" +
"}\n"
);
-
+
search(this.workingCopies[0].getType("Y").getType("Z").getMethod("goo", new String[] { "I" }), REFERENCES, EXACT_RULE);
- assertSearchResults("src/test/Test.java test.Y$Z.i [goo] EXACT_MATCH\n" +
+ assertSearchResults("src/test/Test.java test.Y$Z.i [goo] EXACT_MATCH\n" +
"src/test/Test.java void test.X.main(String[]) [goo] EXACT_MATCH");
}
public void testBug400905_0030() throws CoreException {
@@ -3397,11 +3397,11 @@ public void testBug400905_0030() throws CoreException {
" }\n" +
"}\n"
);
-
+
search(this.workingCopies[0].getType("Y").getType("Z").getMethod("goo", new String[] { "I" }), IMPLICIT_THIS_REFERENCE);
assertSearchResults("");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=429738, [1.8][search] Find Declarations (Ctrl + G) shows no result for type-less lambda parameter
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=429738, [1.8][search] Find Declarations (Ctrl + G) shows no result for type-less lambda parameter
public void test429738() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400905/X.java",
@@ -3415,7 +3415,7 @@ public void test429738() throws CoreException {
" Foo f2= (int x) -> x; //[2]\n" +
"}\n"
);
-
+
String str = this.workingCopies[0].getSource();
String selection = "/* here*/ x";
int start = str.indexOf(selection);
@@ -3425,9 +3425,9 @@ public void test429738() throws CoreException {
ILocalVariable local = (ILocalVariable) elements[0];
search(local, DECLARATIONS, EXACT_RULE);
assertSearchResults(
- "src/b400905/X.java int b400905.X.f1:<lambda #1>.foo(int).x [x] EXACT_MATCH");
+ "src/b400905/X.java int b400905.X.f1:<lambda #1>.foo(int).x [x] EXACT_MATCH");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=429738, [1.8][search] Find Declarations (Ctrl + G) shows no result for type-less lambda parameter
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=429738, [1.8][search] Find Declarations (Ctrl + G) shows no result for type-less lambda parameter
public void test429738a() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400905/X.java",
@@ -3441,7 +3441,7 @@ public void test429738a() throws CoreException {
" Foo f2= (int x) -> /* here*/ x; //[2]\n" +
"}\n"
);
-
+
String str = this.workingCopies[0].getSource();
String selection = "/* here*/ x";
int start = str.indexOf(selection);
@@ -3451,9 +3451,9 @@ public void test429738a() throws CoreException {
ILocalVariable local = (ILocalVariable) elements[0];
search(local, DECLARATIONS, EXACT_RULE);
assertSearchResults(
- "src/b400905/X.java int b400905.X.f2:<lambda #1>.foo(int).x [x] EXACT_MATCH");
+ "src/b400905/X.java int b400905.X.f2:<lambda #1>.foo(int).x [x] EXACT_MATCH");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=429836, [1.8][search] Search implementors in workspace does not show lambda expressions.
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=429836, [1.8][search] Search implementors in workspace does not show lambda expressions.
public void testBug429836() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
String buffer = "@FunctionalInterface\n" +
@@ -3493,7 +3493,7 @@ public void test429934() throws CoreException {
" } \n" +
"}\n"
);
-
+
String str = this.workingCopies[0].getSource();
String selection = "Function";
int start = str.indexOf(selection);
@@ -3503,12 +3503,12 @@ public void test429934() throws CoreException {
IType type = (IType) elements[0];
search(type, REFERENCES, ERASURE_RULE);
assertSearchResults(
- "src/b400905/X.java void b400905.X.main(String[]) [Function] EXACT_MATCH\n" +
- "src/b400905/X.java void b400905.X.main(String[]) [Function] EXACT_MATCH\n" +
- "src/b400905/X.java void b400905.X.main(String[]) [Function] EXACT_MATCH\n" +
- "src/b400905/X.java void b400905.X.main(String[]) [Function] EXACT_MATCH");
+ "src/b400905/X.java void b400905.X.main(String[]) [Function] EXACT_MATCH\n" +
+ "src/b400905/X.java void b400905.X.main(String[]) [Function] EXACT_MATCH\n" +
+ "src/b400905/X.java void b400905.X.main(String[]) [Function] EXACT_MATCH\n" +
+ "src/b400905/X.java void b400905.X.main(String[]) [Function] EXACT_MATCH");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430159, [1.8][search] Lambda Expression not found when searching using OrPattern or AndPattern
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430159, [1.8][search] Lambda Expression not found when searching using OrPattern or AndPattern
public void test430159a() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b429498/X.java",
@@ -3527,7 +3527,7 @@ public void test430159a() throws CoreException {
IJavaElement[] elements = this.workingCopies[0].codeSelect(start, length);
SearchPattern leftPattern = SearchPattern.createPattern(elements[0], ALL_OCCURRENCES, ERASURE_RULE);
-
+
selection = "xyz";
start = str.lastIndexOf(selection);
length = selection.length();
@@ -3542,11 +3542,11 @@ public void test430159a() throws CoreException {
this.resultCollector,
null);
assertSearchResults(
- "src/b429498/X.java void b429498.I.doit(int) [doit] EXACT_MATCH\n" +
+ "src/b429498/X.java void b429498.I.doit(int) [doit] EXACT_MATCH\n" +
"src/b429498/X.java void b429498.X.i:<lambda #1>.doit(int) [(int xyz) ->] EXACT_MATCH"
- );
+ );
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430159, [1.8][search] Lambda Expression not found when searching using OrPattern or AndPattern
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430159, [1.8][search] Lambda Expression not found when searching using OrPattern or AndPattern
public void test430159b() throws CoreException { // this test basically checks that and pattern locator does not a lambda from being found.
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b429498/X.java",
@@ -3557,7 +3557,7 @@ public void test430159b() throws CoreException { // this test basically checks t
" I i = () -> {};\n" +
"}\n"
);
-
+
String str = this.workingCopies[0].getSource();
String selection = "doit";
int start = str.indexOf(selection);
@@ -3565,7 +3565,7 @@ public void test430159b() throws CoreException { // this test basically checks t
IJavaElement[] elements = this.workingCopies[0].codeSelect(start, length);
SearchPattern leftPattern = SearchPattern.createPattern(elements[0], ALL_OCCURRENCES, ERASURE_RULE);
-
+
selection = "->";
start = str.indexOf(selection);
length = selection.length();
@@ -3580,12 +3580,12 @@ public void test430159b() throws CoreException { // this test basically checks t
this.resultCollector,
null);
assertSearchResults(
- "src/b429498/X.java void b429498.I.doit() [doit] EXACT_MATCH\n" +
+ "src/b429498/X.java void b429498.I.doit() [doit] EXACT_MATCH\n" +
"src/b429498/X.java void b429498.X.i:<lambda #1>.doit() [() ->] EXACT_MATCH"
- );
+ );
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430159, [1.8][search] Lambda Expression not found when searching using OrPattern or AndPattern
-public void test430159c() throws CoreException {
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430159, [1.8][search] Lambda Expression not found when searching using OrPattern or AndPattern
+public void test430159c() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b429498/X.java",
"interface I {\n" +
@@ -3604,7 +3604,7 @@ public void test430159c() throws CoreException {
IJavaElement[] elements = this.workingCopies[0].codeSelect(start, length);
SearchPattern leftPattern = SearchPattern.createPattern(elements[0], ALL_OCCURRENCES, ERASURE_RULE);
-
+
selection = "::";
start = str.indexOf(selection);
length = selection.length();
@@ -3619,12 +3619,12 @@ public void test430159c() throws CoreException {
this.resultCollector,
null);
assertSearchResults(
- "src/b429498/X.java void b429498.I.doit() [doit] EXACT_MATCH\n" +
- "src/b429498/X.java b429498.X.i [foo] EXACT_MATCH\n" +
+ "src/b429498/X.java void b429498.I.doit() [doit] EXACT_MATCH\n" +
+ "src/b429498/X.java b429498.X.i [foo] EXACT_MATCH\n" +
"src/b429498/X.java void b429498.X.foo() [foo] EXACT_MATCH"
- );
+ );
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430159, [1.8][search] Lambda Expression not found when searching using OrPattern or AndPattern
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430159, [1.8][search] Lambda Expression not found when searching using OrPattern or AndPattern
public void test430159d() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b429498/X.java",
@@ -3644,7 +3644,7 @@ public void test430159d() throws CoreException {
IJavaElement[] elements = this.workingCopies[0].codeSelect(start, length);
SearchPattern leftPattern = SearchPattern.createPattern(elements[0], ALL_OCCURRENCES, ERASURE_RULE);
-
+
selection = "::";
start = str.indexOf(selection);
length = selection.length();
@@ -3664,9 +3664,9 @@ public void test430159d() throws CoreException {
/**
* @bug 429012
* @test tests search for Reference expression - super:: form, without type arguments
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=429012"
- *
+ *
*/
public void testBug429012_0001() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
@@ -3695,15 +3695,15 @@ public void testBug429012_0001() throws CoreException {
search(method, METHOD_REFERENCE_EXPRESSION, EXACT_RULE);
assertSearchResults(
"src/b429012/X.java void b429012.X.doit() [foo] EXACT_MATCH"
- );
+ );
}
/**
* @bug 429012
* @test tests search for Reference expression - super:: form, with type arguments
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=429012"
- *
+ *
*/
public void testBug429012_0002() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
@@ -3732,15 +3732,15 @@ public void testBug429012_0002() throws CoreException {
search(method, METHOD_REFERENCE_EXPRESSION, EXACT_RULE);
assertSearchResults(
"src/b429012/X.java void b429012.X.doit() [foo] EXACT_MATCH"
- );
+ );
}
/**
* @bug 429012
* @test tests search for Reference expression - SimpleName:: form, without type arguments.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=429012"
- *
+ *
*/
public void testBug429012_0003() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
@@ -3748,7 +3748,7 @@ public void testBug429012_0003() throws CoreException {
"interface I {\n" +
" public void doit();\n" +
"}\n" +
- "class Y {\n" +
+ "class Y {\n" +
" Y() {}\n" +
" Y(int i) {}\n" +
"}\n" +
@@ -3770,15 +3770,15 @@ public void testBug429012_0003() throws CoreException {
search(method, METHOD_REFERENCE_EXPRESSION, EXACT_RULE);
assertSearchResults(
"src/b429012/X.java b429012.X.i [foo] EXACT_MATCH"
- );
+ );
}
/**
* @bug 429012
* @test tests search for Reference expression - SimpleName:: form, with type arguments.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=429012"
- *
+ *
*/
public void testBug429012_0004() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
@@ -3804,15 +3804,15 @@ public void testBug429012_0004() throws CoreException {
search(method, METHOD_REFERENCE_EXPRESSION, EXACT_RULE);
assertSearchResults(
"src/b429012/X.java void b429012.X.main(String[]) [foo] EXACT_MATCH"
- );
+ );
}
/**
* @bug 429012
* @test tests search for Reference expression - QualifiedName:: form, without type arguments.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=429012"
- *
+ *
*/
public void testBug429012_0005() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
@@ -3840,15 +3840,15 @@ public void testBug429012_0005() throws CoreException {
search(method, METHOD_REFERENCE_EXPRESSION, EXACT_RULE);
assertSearchResults(
"src/b429012/X.java void b429012.X.main(String[]) [foo] EXACT_MATCH"
- );
+ );
}
/**
* @bug 429012
* @test tests search for Reference expression - QualifiedName:: form, with type arguments.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=429012"
- *
+ *
*/
public void testBug429012_0006() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
@@ -3876,15 +3876,15 @@ public void testBug429012_0006() throws CoreException {
search(method, METHOD_REFERENCE_EXPRESSION, EXACT_RULE);
assertSearchResults(
"src/b429012/X.java void b429012.X.main(String[]) [foo] EXACT_MATCH"
- );
+ );
}
/**
* @bug 429012
* @test tests search for Reference expression - Primary:: form, without type arguments.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=429012"
- *
+ *
*/
public void testBug429012_0007() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
@@ -3910,15 +3910,15 @@ public void testBug429012_0007() throws CoreException {
search(method, METHOD_REFERENCE_EXPRESSION, EXACT_RULE);
assertSearchResults(
"src/b429012/X.java void b429012.X.main(String[]) [foo] EXACT_MATCH"
- );
+ );
}
/**
* @bug 429012
* @test tests search for Reference expression - Primary:: form, with type arguments.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=429012"
- *
+ *
*/
public void testBug429012_0008() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
@@ -3944,39 +3944,39 @@ public void testBug429012_0008() throws CoreException {
search(method, METHOD_REFERENCE_EXPRESSION, EXACT_RULE);
assertSearchResults(
"src/b429012/X.java void b429012.X.main(String[]) [foo] EXACT_MATCH"
- );
+ );
}
/**
* @bug 429012
* @test tests search for Reference expression - X<T>:: form, without type arguments
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=429012"
- *
+ *
*/
public void testBug429012_0009() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b429012/X.java",
- "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" +
+ "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" +
" new Y<String>().foo(0);\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" +
+ " 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"
);
IType type = this.workingCopies[0].getType("Y");
@@ -3991,33 +3991,33 @@ public void testBug429012_0009() throws CoreException {
/**
* @bug 429012
* @test tests search for Reference expression - X<T>:: form, with type arguments
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=429012"
- *
+ *
*/
public void testBug429012_0010() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b429012/X.java",
- "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" +
+ "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" +
" new Y<String>().foo(0);\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" +
+ " 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"
);
IType type = this.workingCopies[0].getType("Y");
@@ -4031,9 +4031,9 @@ public void testBug429012_0010() throws CoreException {
/**
* @bug 429012
* @test tests search for Reference expression - X<T>.Name :: form, without type arguments
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=429012"
- *
+ *
*/
public void testBug429012_0011() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
@@ -4070,9 +4070,9 @@ public void testBug429012_0011() throws CoreException {
/**
* @bug 429012
* @test tests search for Reference expression - X<T>.Name :: form, with type arguments
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=429012"
- *
+ *
*/
public void testBug429012_0012() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
@@ -4109,9 +4109,9 @@ public void testBug429012_0012() throws CoreException {
/**
* @bug 429012
* @test tests search for Reference expression - X<T>.Y<K> :: form, without type arguments
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=429012"
- *
+ *
*/
public void testBug429012_0013() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
@@ -4147,9 +4147,9 @@ public void testBug429012_0013() throws CoreException {
/**
* @bug 429012
* @test tests search for Reference expression - X<T>.Y<K> :: form, with type arguments
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=429012"
- *
+ *
*/
public void testBug429012_0014() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
@@ -4185,9 +4185,9 @@ public void testBug429012_0014() throws CoreException {
/**
* @bug 429012
* @test tests search for Reference expression - X<T>.Y<K> :: new form, with type arguments
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=429012"
- *
+ *
*/
public void testBug429012_0015() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
@@ -4268,7 +4268,7 @@ public void testBug429012_0017() throws CoreException {
search(this.workingCopies[0].getType("Y").getMethod("goo", new String[] { "I" }), METHOD_REFERENCE_EXPRESSION);
assertSearchResults(
- "src/test/Test.java void test.X.main(String[]) [goo] EXACT_MATCH\n" +
+ "src/test/Test.java void test.X.main(String[]) [goo] EXACT_MATCH\n" +
"src/test/Test.java void test.X.main(String[]) [goo] EXACT_MATCH"
);
}
@@ -4295,11 +4295,11 @@ public void testBug429012_0018() throws CoreException {
search(this.workingCopies[0].getType("Y").getType("Z").getMethod("goo", new String[] { "I" }), METHOD_REFERENCE_EXPRESSION);
assertSearchResults(
- "src/test/Test.java test.Y$Z.i [goo] EXACT_MATCH\n" +
+ "src/test/Test.java test.Y$Z.i [goo] EXACT_MATCH\n" +
"src/test/Test.java void test.X.main(String[]) [goo] EXACT_MATCH"
);
}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=31716, [1.8][compiler] NPE when creating LambdaMethod element for lambda expressions with errors
+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=31716, [1.8][compiler] NPE when creating LambdaMethod element for lambda expressions with errors
public void testBug431716() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/X.java",
@@ -4325,7 +4325,7 @@ public void testBug431716() throws CoreException {
" }\n" +
"}\n"
);
-
+
String str = this.workingCopies[0].getSource();
String selection = "/* here */toLongFunction";
int start = str.indexOf(selection);
@@ -4349,7 +4349,7 @@ this.workingCopies = new ICompilationUnit[8];
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Constants.java",
"final class Constants {\n" +
" static final String BUG_NAME = \"BUG 432541\";\n" +
- "}\n"
+ "}\n"
);
this.workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/Constants.java",
"package test;\n" +
@@ -4451,7 +4451,7 @@ public void testBug435480_0002() throws CoreException {
try
{
IJavaProject project = createJavaProject("P", new String[] { "", "src"}, new String[] {"JCL18_LIB"}, null, null, "bin", null, null, new String[][] {new String[] {"src/"}, new String[0]}, "1.8");
- createFile("/P/src/X.java",
+ createFile("/P/src/X.java",
"import java.lang.annotation.*;\n" +
"@Documented\n" +
"@Retention(RetentionPolicy.RUNTIME)\n" +
@@ -4507,10 +4507,10 @@ public void testBug454401() throws CoreException, JavaModelException {
waitUntilIndexesReady();
IType type = getCompilationUnit("/P/src/com/test/X.java").getType("X").getType("Y");
IMethod[] methods = type.getMethods();
-
+
search(methods[1], REFERENCES, EXACT_RULE, SearchEngine.createWorkspaceScope(), this.resultCollector);
- assertSearchResults("src/com/test/X.java void com.test.X.foo() [t2(y.new P())] EXACT_MATCH\n" +
+ assertSearchResults("src/com/test/X.java void com.test.X.foo() [t2(y.new P())] EXACT_MATCH\n" +
"src/com/test/X.java void com.test.X$Y.t1(P) [t2(p)] EXACT_MATCH");
} finally {
deleteProject("P");
@@ -4518,7 +4518,7 @@ public void testBug454401() throws CoreException, JavaModelException {
}
public void testBug454411_001() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
- String content =
+ String content =
"package com.test;\n" +
"interface Function<T, R> { \n"+
" R apply(T t); \n"+
@@ -4677,8 +4677,8 @@ getJavaSearchWorkingCopiesScope(),
this.resultCollector,
null);
assertSearchResults(
- "src/X.java void X.m1() [X::new] EXACT_MATCH"
-);
+ "src/X.java void X.m1() [X::new] EXACT_MATCH"
+);
}
public void testBug468127_0001() throws CoreException {
try {
@@ -4698,11 +4698,11 @@ public void testBug468127_0001() throws CoreException {
addLibraryEntry(project, "/JavaSearchBugs/lib/b468127.jar", false);
waitUntilIndexesReady();
-
+
SearchPattern pattern = SearchPattern.createPattern("IY.accept(T)", METHOD, REFERENCES, ERASURE_RULE);
search(pattern, SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, IJavaSearchScope.APPLICATION_LIBRARIES | IJavaSearchScope.SOURCES), this.resultCollector);
assertSearchResults(
- "src/X.java void X.main(String[]) [accept(0)] EXACT_MATCH\n" +
+ "src/X.java void X.main(String[]) [accept(0)] EXACT_MATCH\n" +
"lib/b468127.jar void <anonymous>.accept(java.lang.Object) EXACT_MATCH");
}
finally {
@@ -4759,7 +4759,7 @@ public void testBug485805_001() throws CoreException {
try {
search(type, IMPLEMENTORS);
assertSearchResults(
- "src/X.java X [I] EXACT_MATCH\n" +
+ "src/X.java X [I] EXACT_MATCH\n" +
"src/X.java int J X.bar():<lambda #1>.foo(int, int) [(e1, e2) ->] EXACT_MATCH"
);
} catch (UnsupportedOperationException e) {
@@ -4788,15 +4788,15 @@ public void testBug484367_0001() throws CoreException {
" Foo foo1 = (bar)->bar.print();\n" +
" Foo foo2 = Bar::print;\n" +
" }\n" +
- "}\n"
+ "}\n"
);
IType type = this.workingCopies[0].getType("BarImpl");
IMethod method = type.getMethod("print", null);
search(method, REFERENCES, EXACT_RULE);
assertSearchResults(
- "src/X.java void void X.test():<lambda #1>.process(Bar) [print()] EXACT_MATCH\n" +
+ "src/X.java void void X.test():<lambda #1>.process(Bar) [print()] EXACT_MATCH\n" +
"src/X.java void X.test() [print] EXACT_MATCH"
- );
+ );
}
public void testBug484367_0002() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
@@ -4833,9 +4833,9 @@ public void testBug484367_0002() throws CoreException {
IMethod method = type.getMethod("print", null);
search(method, REFERENCES, EXACT_RULE);
assertSearchResults(
- "src/X.java void void X.test():<lambda #1>.process(Bar) [print()] EXACT_MATCH\n" +
+ "src/X.java void void X.test():<lambda #1>.process(Bar) [print()] EXACT_MATCH\n" +
"src/X.java void X.test() [print] EXACT_MATCH"
- );
+ );
}
public void testBug484367_0003() throws CoreException {
@@ -4870,9 +4870,9 @@ public void testBug484367_0003() throws CoreException {
IMethod method = type.getMethod("print", null);
search(method, REFERENCES, EXACT_RULE);
assertSearchResults(
- "src/X.java void void X.test():<lambda #1>.process(Bar) [print()] EXACT_MATCH\n" +
+ "src/X.java void void X.test():<lambda #1>.process(Bar) [print()] EXACT_MATCH\n" +
"src/X.java void X.test() [print] EXACT_MATCH"
- );
+ );
}
public void testBug531641() throws CoreException {
@@ -4883,17 +4883,17 @@ public void testBug531641() throws CoreException {
" void accept(T t);\n" +
"}\n");
createFile("/P/src/C.java",
- "import java.util.*;\n" +
- "\n" +
- "public class C {\n" +
- " void test() {\n" +
- " Consumer<String> fun =\n" +
+ "import java.util.*;\n" +
+ "\n" +
+ "public class C {\n" +
+ " void test() {\n" +
+ " Consumer<String> fun =\n" +
" (Map.Entry<String, Collection<String>> it) -> {\n" + // type error here, but shouldn't prevent indexing of the lambda
- " print(it);\n" +
- " };\n" +
- " print(fun);\n" +
+ " print(it);\n" +
+ " };\n" +
+ " print(fun);\n" +
" }\n" +
- " void print(Object o) {}\n" +
+ " void print(Object o) {}\n" +
"}\n"
);
waitUntilIndexesReady();
@@ -4902,7 +4902,7 @@ public void testBug531641() throws CoreException {
SearchPattern pattern = SearchPattern.createPattern(method, DECLARATIONS, EXACT_RULE);
search(pattern, SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, IJavaSearchScope.SOURCES), this.resultCollector);
assertSearchResults(
- "src/C.java void void C.test():<lambda #1>.accept(java.lang.String) [(Map.Entry<String, Collection<String>> it) ->] EXACT_MATCH\n" +
+ "src/C.java void void C.test():<lambda #1>.accept(java.lang.String) [(Map.Entry<String, Collection<String>> it) ->] EXACT_MATCH\n" +
"src/Consumer.java void Consumer.accept(T) [accept] EXACT_MATCH"
);
} finally {
@@ -4912,19 +4912,19 @@ public void testBug531641() throws CoreException {
public void testBug493433a() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/X.java",
- "import java.util.stream.IntStream;\n" +
- "public class CallerHierarchyExample {\n" +
- " interface Interface {\n" +
- " void method(int i);\n" +
- " }\n" +
- " class Implementation implements Interface {\n" +
- " public void method(int i) {}\n" +
- " }\n" +
- " void caller() {\n" +
- " Interface pred = new Implementation();\n" +
- " IntStream.range(0, 3).forEach(pred::method);\n" +
- " }\n" +
- "}"
+ "import java.util.stream.IntStream;\n" +
+ "public class CallerHierarchyExample {\n" +
+ " interface Interface {\n" +
+ " void method(int i);\n" +
+ " }\n" +
+ " class Implementation implements Interface {\n" +
+ " public void method(int i) {}\n" +
+ " }\n" +
+ " void caller() {\n" +
+ " Interface pred = new Implementation();\n" +
+ " IntStream.range(0, 3).forEach(pred::method);\n" +
+ " }\n" +
+ "}"
);
IType type = this.workingCopies[0].getType("CallerHierarchyExample");
IJavaElement[] children = type.getChildren();
@@ -4949,24 +4949,24 @@ public void testBug493433a() throws CoreException {
search(method, REFERENCES, EXACT_RULE);
assertSearchResults(
"src/X.java void CallerHierarchyExample.caller() [method] EXACT_MATCH"
- );
+ );
}
public void testBug493433b() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/X.java",
- "import java.util.stream.IntStream;\n" +
- "public class CallerHierarchyExample {\n" +
- " interface Interface {\n" +
- " void method(int i);\n" +
- " }\n" +
- " class Implementation implements Interface {\n" +
- " public void method(int i) {}\n" +
- " }\n" +
- " void caller() {\n" +
- " Interface pred = new Implementation();\n" +
- " IntStream.range(0, 3).forEach(pred::method);\n" +
- " }\n" +
- "}"
+ "import java.util.stream.IntStream;\n" +
+ "public class CallerHierarchyExample {\n" +
+ " interface Interface {\n" +
+ " void method(int i);\n" +
+ " }\n" +
+ " class Implementation implements Interface {\n" +
+ " public void method(int i) {}\n" +
+ " }\n" +
+ " void caller() {\n" +
+ " Interface pred = new Implementation();\n" +
+ " IntStream.range(0, 3).forEach(pred::method);\n" +
+ " }\n" +
+ "}"
);
IType type = this.workingCopies[0].getType("CallerHierarchyExample");
IJavaElement[] children = type.getChildren();
@@ -4991,7 +4991,7 @@ public void testBug493433b() throws CoreException {
search(method, REFERENCES, EXACT_RULE);
assertSearchResults(
"src/X.java void CallerHierarchyExample.caller() [method] EXACT_MATCH"
- );
+ );
}
// Add new tests in JavaSearchBugs8Tests
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs9Tests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs9Tests.java
index 51b9379b5..a8c0148eb 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs9Tests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs9Tests.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
*******************************************************************************/
@@ -177,13 +177,13 @@ public void _testBug499338_001() throws CoreException {
String selection = "z1";
int start = str.indexOf(selection);
int length = selection.length();
-
+
IJavaElement[] elements = this.workingCopies[0].codeSelect(start, length);
ILocalVariable local = (ILocalVariable) elements[0];
search(local, REFERENCES, EXACT_RULE);
- assertSearchResults(
- "src/X.java void X.main(String[]) [z1] EXACT_MATCH\n" +
- "src/X.java void X.main(String[]) [z1] EXACT_MATCH");
+ assertSearchResults(
+ "src/X.java void X.main(String[]) [z1] EXACT_MATCH\n" +
+ "src/X.java void X.main(String[]) [z1] EXACT_MATCH");
}
public void testBug501162_001() throws Exception {
@@ -192,7 +192,7 @@ public void testBug501162_001() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module first {\n" +
" exports pack1 to second;\n" +
"}\n";
@@ -205,7 +205,7 @@ public void testBug501162_001() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module second {\n" +
" requires first;\n" +
"}\n";
@@ -216,9 +216,9 @@ public void testBug501162_001() throws Exception {
project2.close();
project2.open(null);
project1.open(null);
-
+
IPackageFragment pkg = getPackageFragment("JavaSearchBugs9", "src", "pack1");
- IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
{getJavaProject("JavaSearchBugs9")});
search(
@@ -227,7 +227,7 @@ public void testBug501162_001() throws Exception {
scope,
this.resultCollector);
assertSearchResults(
- "src/module-info.java first [pack1] EXACT_MATCH\n" +
+ "src/module-info.java first [pack1] EXACT_MATCH\n" +
"src/pack1 pack1 EXACT_MATCH",
this.resultCollector);
@@ -243,7 +243,7 @@ public void testBug501162_002() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module first {\n" +
" exports pack1 to second;\n" +
" exports pack1 to third;\n" +
@@ -258,7 +258,7 @@ public void testBug501162_002() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module second {\n" +
" requires first;\n" +
"}\n";
@@ -269,9 +269,9 @@ public void testBug501162_002() throws Exception {
project2.close();
project2.open(null);
project1.open(null);
-
+
IPackageFragment pkg = getPackageFragment("JavaSearchBugs9", "src", "pack1");
- IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
{getJavaProject("JavaSearchBugs9")});
search(
@@ -280,9 +280,9 @@ public void testBug501162_002() throws Exception {
scope,
this.resultCollector);
assertSearchResults(
- "src/module-info.java first [pack1] EXACT_MATCH\n" +
- "src/module-info.java first [pack1] EXACT_MATCH\n" +
- "src/module-info.java first [pack1] EXACT_MATCH\n" +
+ "src/module-info.java first [pack1] EXACT_MATCH\n" +
+ "src/module-info.java first [pack1] EXACT_MATCH\n" +
+ "src/module-info.java first [pack1] EXACT_MATCH\n" +
"src/pack1 pack1 EXACT_MATCH",
this.resultCollector);
@@ -298,7 +298,7 @@ public void testBug501162_003() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module first {\n" +
" requires second;" +
" provides pack22.I22 with pack1.X11;" +
@@ -312,7 +312,7 @@ public void testBug501162_003() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module second {\n" +
" exports pack22 to first;\n" +
"}\n";
@@ -329,7 +329,7 @@ public void testBug501162_003() throws Exception {
project1.open(null);
IPackageFragment pkg = getPackageFragment("second", "src", "pack22");
- IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
{getJavaProject("JavaSearchBugs9")});
search(
@@ -338,8 +338,8 @@ public void testBug501162_003() throws Exception {
scope,
this.resultCollector);
assertSearchResults(
- "src/module-info.java first [pack22] EXACT_MATCH\n" +
- "src/pack1/X11.java pack1.X11 [pack22] EXACT_MATCH\n" +
+ "src/module-info.java first [pack22] EXACT_MATCH\n" +
+ "src/pack1/X11.java pack1.X11 [pack22] EXACT_MATCH\n" +
"src/module-info.java second [pack22] EXACT_MATCH",
this.resultCollector);
}
@@ -360,11 +360,11 @@ public void testBug501162_005() throws CoreException {
String selection = "first";
int start = str.indexOf(selection);
int length = selection.length();
-
+
IJavaElement[] elements = this.workingCopies[0].codeSelect(start, length);
IModuleDescription module = (IModuleDescription) elements[0];
search(module, ALL_OCCURRENCES, EXACT_RULE);
- assertSearchResults(
+ assertSearchResults(
"src/module-info.java first [first] EXACT_MATCH");
}
public void testBug501162_006() throws Exception {
@@ -373,7 +373,7 @@ public void testBug501162_006() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module first {\n" +
" requires second;" +
" provides pack22.I22 with pack1.X11;" +
@@ -387,7 +387,7 @@ public void testBug501162_006() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module second {\n" +
" exports pack22 to first;\n" +
"}\n";
@@ -422,7 +422,7 @@ public void testBug501162_007() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module first.test.org {\n" +
" requires second;" +
" provides pack22.I22 with pack1.X11;" +
@@ -436,7 +436,7 @@ public void testBug501162_007() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module second {\n" +
" exports pack22 to first.test.org;\n" +
"}\n";
@@ -471,7 +471,7 @@ public void testBug501162_008() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module first {\n" +
" requires second;" +
" provides pack22.I22 with pack1.X11;" +
@@ -485,7 +485,7 @@ public void testBug501162_008() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module second {\n" +
" exports pack22 to first;\n" +
"}\n";
@@ -521,7 +521,7 @@ public void testBug501162_009() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module first {\n" +
" exports pack1;\n" +
" exports pack2;\n" +
@@ -540,7 +540,7 @@ public void testBug501162_009() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module second {\n" +
" requires first;\n" +
"}\n";
@@ -551,9 +551,9 @@ public void testBug501162_009() throws Exception {
project2.close();
project2.open(null);
project1.open(null);
-
+
IPackageFragment pkg = getPackageFragment("JavaSearchBugs9", "src", "pack2");
- IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
{getJavaProject("JavaSearchBugs9")});
search(
@@ -562,7 +562,7 @@ public void testBug501162_009() throws Exception {
scope,
this.resultCollector);
assertSearchResults(
- "src/module-info.java first [pack2] EXACT_MATCH\n" +
+ "src/module-info.java first [pack2] EXACT_MATCH\n" +
"src/pack2 pack2 EXACT_MATCH",
this.resultCollector);
@@ -578,7 +578,7 @@ public void testBug501162_010() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module first {\n" +
" requires second;" +
" provides pack22.I22 with pack1.X11;" +
@@ -592,7 +592,7 @@ public void testBug501162_010() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module second {\n" +
" exports pack22 to first, zero;\n" +
"}\n";
@@ -627,7 +627,7 @@ public void testBug501162_011() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module first {\n" +
" requires second;" +
" provides pack22.I22 with pack1.X11;" +
@@ -641,7 +641,7 @@ public void testBug501162_011() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module second {\n" +
" opens pack22 to first, zero;\n" +
"}\n";
@@ -675,7 +675,7 @@ public void testBug501162_012() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module first {\n" +
" exports pack1 to one;\n" +
" exports pack2;\n" +
@@ -693,7 +693,7 @@ public void testBug501162_012() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module second {\n" +
" requires first;\n" +
"}\n";
@@ -704,9 +704,9 @@ public void testBug501162_012() throws Exception {
project2.close();
project2.open(null);
project1.open(null);
-
+
IPackageFragment pkg = getPackageFragment("JavaSearchBugs9", "src", "pack1");
- IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
{getJavaProject("JavaSearchBugs9")});
search(
@@ -715,7 +715,7 @@ public void testBug501162_012() throws Exception {
scope,
this.resultCollector);
assertSearchResults(
- "src/module-info.java first [pack1] EXACT_MATCH\n" +
+ "src/module-info.java first [pack1] EXACT_MATCH\n" +
"src/pack1 pack1 EXACT_MATCH",
this.resultCollector);
@@ -730,7 +730,7 @@ public void testBug501162_013() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module first {\n" +
" opens pack1 to one;\n" +
" opens pack2;\n" +
@@ -748,7 +748,7 @@ public void testBug501162_013() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module second {\n" +
" requires first;\n" +
"}\n";
@@ -759,9 +759,9 @@ public void testBug501162_013() throws Exception {
project2.close();
project2.open(null);
project1.open(null);
-
+
IPackageFragment pkg = getPackageFragment("JavaSearchBugs9", "src", "pack1");
- IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
{getJavaProject("JavaSearchBugs9")});
search(
@@ -770,7 +770,7 @@ public void testBug501162_013() throws Exception {
scope,
this.resultCollector);
assertSearchResults(
- "src/module-info.java first [pack1] EXACT_MATCH\n" +
+ "src/module-info.java first [pack1] EXACT_MATCH\n" +
"src/pack1 pack1 EXACT_MATCH",
this.resultCollector);
@@ -785,7 +785,7 @@ public void testBug501162_014() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module first {\n" +
" opens pack1;\n" +
" opens pack2;\n" +
@@ -803,7 +803,7 @@ public void testBug501162_014() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module second {\n" +
" requires first;\n" +
"}\n";
@@ -814,9 +814,9 @@ public void testBug501162_014() throws Exception {
project2.close();
project2.open(null);
project1.open(null);
-
+
IPackageFragment pkg = getPackageFragment("JavaSearchBugs9", "src", "pack2");
- IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
{getJavaProject("JavaSearchBugs9")});
search(
@@ -825,7 +825,7 @@ public void testBug501162_014() throws Exception {
scope,
this.resultCollector);
assertSearchResults(
- "src/module-info.java first [pack2] EXACT_MATCH\n" +
+ "src/module-info.java first [pack2] EXACT_MATCH\n" +
"src/pack2 pack2 EXACT_MATCH",
this.resultCollector);
@@ -840,7 +840,7 @@ public void testBug501162_015() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module first {\n" +
" opens pack1;\n" +
" exports pack2;\n" +
@@ -858,7 +858,7 @@ public void testBug501162_015() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module second {\n" +
" requires first;\n" +
"}\n";
@@ -869,9 +869,9 @@ public void testBug501162_015() throws Exception {
project2.close();
project2.open(null);
project1.open(null);
-
+
IPackageFragment pkg = getPackageFragment("JavaSearchBugs9", "src", "pack2");
- IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
{getJavaProject("JavaSearchBugs9")});
search(
@@ -880,7 +880,7 @@ public void testBug501162_015() throws Exception {
scope,
this.resultCollector);
assertSearchResults(
- "src/module-info.java first [pack2] EXACT_MATCH\n" +
+ "src/module-info.java first [pack2] EXACT_MATCH\n" +
"src/pack2 pack2 EXACT_MATCH",
this.resultCollector);
@@ -895,7 +895,7 @@ public void testBug501162_016() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module first {\n" +
" opens pack1 to one;\n" +
" exports pack2;\n" +
@@ -913,7 +913,7 @@ public void testBug501162_016() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module second {\n" +
" requires first;\n" +
"}\n";
@@ -924,9 +924,9 @@ public void testBug501162_016() throws Exception {
project2.close();
project2.open(null);
project1.open(null);
-
+
IPackageFragment pkg = getPackageFragment("JavaSearchBugs9", "src", "pack2");
- IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
{getJavaProject("JavaSearchBugs9")});
search(
@@ -935,7 +935,7 @@ public void testBug501162_016() throws Exception {
scope,
this.resultCollector);
assertSearchResults(
- "src/module-info.java first [pack2] EXACT_MATCH\n" +
+ "src/module-info.java first [pack2] EXACT_MATCH\n" +
"src/pack2 pack2 EXACT_MATCH",
this.resultCollector);
@@ -950,7 +950,7 @@ public void testBug501162_017() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module first {\n" +
" exports pack1 to one;\n" +
" opens pack2;\n" +
@@ -968,7 +968,7 @@ public void testBug501162_017() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module second {\n" +
" requires first;\n" +
"}\n";
@@ -979,9 +979,9 @@ public void testBug501162_017() throws Exception {
project2.close();
project2.open(null);
project1.open(null);
-
+
IPackageFragment pkg = getPackageFragment("JavaSearchBugs9", "src", "pack2");
- IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
{getJavaProject("JavaSearchBugs9")});
search(
@@ -990,7 +990,7 @@ public void testBug501162_017() throws Exception {
scope,
this.resultCollector);
assertSearchResults(
- "src/module-info.java first [pack2] EXACT_MATCH\n" +
+ "src/module-info.java first [pack2] EXACT_MATCH\n" +
"src/pack2 pack2 EXACT_MATCH",
this.resultCollector);
@@ -1005,7 +1005,7 @@ public void testBug501162_018() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module first {\n" +
" opens pack2;\n" +
"}\n";
@@ -1022,7 +1022,7 @@ public void testBug501162_018() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module second {\n" +
" requires first;\n" +
"}\n";
@@ -1033,9 +1033,9 @@ public void testBug501162_018() throws Exception {
project2.close();
project2.open(null);
project1.open(null);
-
+
IPackageFragment pkg = getPackageFragment("JavaSearchBugs9", "src", "pack2");
- IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
{getJavaProject("JavaSearchBugs9")});
search(
@@ -1044,7 +1044,7 @@ public void testBug501162_018() throws Exception {
scope,
this.resultCollector);
assertSearchResults(
- "src/module-info.java first [pack2] EXACT_MATCH\n" +
+ "src/module-info.java first [pack2] EXACT_MATCH\n" +
"src/pack2 pack2 EXACT_MATCH",
this.resultCollector);
@@ -1382,14 +1382,14 @@ public void testBug501162_027() throws Exception {
project1.close(); // sync
project1.open(null);
SearchPattern pattern = SearchPattern.createPattern("XOne",
- IJavaSearchConstants.TYPE, IJavaSearchConstants.REFERENCES, EXACT_RULE);
+ IJavaSearchConstants.TYPE, IJavaSearchConstants.REFERENCES, EXACT_RULE);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
{getJavaProject("JavaSearchBugs9")});
search(pattern, scope, this.resultCollector);
assertSearchResults(
- "src/pack1/X.java [XOne] EXACT_MATCH\n" +
+ "src/pack1/X.java [XOne] EXACT_MATCH\n" +
"src/pack1/X.java pack1.X.X1 [XOne] EXACT_MATCH\n" +
"lib/bzero501162.jar zero [No source] EXACT_MATCH",
this.resultCollector);
@@ -1913,14 +1913,14 @@ public void testBug501162_041() throws Exception {
project1.close(); // sync
project1.open(null);
SearchPattern pattern = SearchPattern.createPattern("XOne",
- IJavaSearchConstants.TYPE, IJavaSearchConstants.REFERENCES, EXACT_RULE);
+ IJavaSearchConstants.TYPE, IJavaSearchConstants.REFERENCES, EXACT_RULE);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
{getJavaProject("JavaSearchBugs9")});
search(pattern, scope, this.resultCollector);
assertSearchResults(
- "src/pack1/X.java [XOne] EXACT_MATCH\n" +
+ "src/pack1/X.java [XOne] EXACT_MATCH\n" +
"src/pack1/X.java pack1.X.X1 [XOne] EXACT_MATCH\n" +
"lib/bzero.src.501162.jar zero EXACT_MATCH",
this.resultCollector);
@@ -1998,7 +1998,7 @@ public void testBug501162_043() throws Exception {
assertSearchResults(
"src/pack1/X.java [ITwo] EXACT_MATCH\n" +
"src/pack1/X.java pack1.X.i2 [ITwo] EXACT_MATCH\n" +
- "lib/bzero.src.501162.jar zero EXACT_MATCH\n" +
+ "lib/bzero.src.501162.jar zero EXACT_MATCH\n" +
"lib/bzero.src.501162.jar pack.one.XOne EXACT_MATCH\n" +
"lib/bzero.src.501162.jar pack.one.XOne.itwo EXACT_MATCH\n" +
"lib/bzero.src.501162.jar pack.two.XTwo EXACT_MATCH",
@@ -2142,7 +2142,7 @@ public void _testBug501162_047() throws Exception {
IJavaProject project2 = createJavaProject("split.first", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String file =
+ String file =
"module split.first {\n" +
" exports pack.first;\n" +
"}\n";
@@ -2156,7 +2156,7 @@ public void _testBug501162_047() throws Exception {
IJavaProject project3 = createJavaProject("split.second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project3.open(null);
- file =
+ file =
"module split.second {\n" +
" exports pack.first.second;\n" +
"}\n";
@@ -2212,7 +2212,7 @@ public void testBug519211_001() throws CoreException {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module second {\n" +
" exports pack22 to first;\n" +
"}\n";
@@ -2250,7 +2250,7 @@ public void testBug519980_001() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module first {\n" +
" requires second;" +
" provides pack22.I22 with pack1.X11;" +
@@ -2264,7 +2264,7 @@ public void testBug519980_001() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module second {\n" +
" exports pack22 to first;\n" +
"}\n";
@@ -2281,7 +2281,7 @@ public void testBug519980_001() throws Exception {
project1.open(null);
SearchPattern pattern = SearchPattern.createPattern("pack1.X11", IJavaSearchConstants.CLASS, REFERENCES, ERASURE_RULE);
- IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
{getJavaProject("JavaSearchBugs9"), getJavaProject("second")});
search(pattern, scope, this.resultCollector);
assertSearchResults("src/module-info.java first [pack1.X11] EXACT_MATCH",
@@ -2298,7 +2298,7 @@ public void testBug519980_002() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module first {\n" +
" requires second;" +
" provides pack22.I22 with pack1.X11;" +
@@ -2312,7 +2312,7 @@ public void testBug519980_002() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module second {\n" +
" exports pack22 to first;\n" +
"}\n";
@@ -2329,10 +2329,10 @@ public void testBug519980_002() throws Exception {
project1.open(null);
SearchPattern pattern = SearchPattern.createPattern("pack22.I22", IJavaSearchConstants.INTERFACE, REFERENCES, ERASURE_RULE);
- IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
{getJavaProject("JavaSearchBugs9"), getJavaProject("second")});
search(pattern, scope, this.resultCollector);
- assertSearchResults( "src/module-info.java first [pack22.I22] EXACT_MATCH\n" +
+ assertSearchResults( "src/module-info.java first [pack22.I22] EXACT_MATCH\n" +
"src/pack1/X11.java pack1.X11 [pack22.I22] EXACT_MATCH",
this.resultCollector);
}
@@ -2415,14 +2415,14 @@ public void testBug522455_001() throws CoreException {
"package pack;\n" +
"import java.lang.annotation.ElementType;\n" +
"import java.lang.annotation.Target;\n" +
- "@Target({ElementType.MODULE})\n" +
+ "@Target({ElementType.MODULE})\n" +
"@interface MyAnnot {}\n"
);
this.workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/module-info.java",
"import pack.*;\n" +
"@MyAnnot\n" +
"module mod.one {}");
-
+
SearchPattern pattern = SearchPattern.createPattern(
"MyAnnot",
ANNOTATION_TYPE,
@@ -2494,7 +2494,7 @@ public void testBug519151_004() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module first {\n" +
"}\n";
createFile("/JavaSearchBugs9/src/module-info.java", fileContent);
@@ -2506,7 +2506,7 @@ public void testBug519151_004() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module second {\n" +
"}\n";
createFile("/second/src/module-info.java", secondFile);
@@ -2521,7 +2521,7 @@ public void testBug519151_004() throws Exception {
project2.close();
project2.open(null);
project1.open(null);
-
+
String needle = "first" + this.module_separator + "pack.X";
SearchPattern pattern = SearchPattern.createPattern(needle, IJavaSearchConstants.TYPE, DECLARATIONS, ERASURE_RULE);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
@@ -2543,7 +2543,7 @@ public void testBug519151_005() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module first {\n" +
"}\n";
createFile("/JavaSearchBugs9/src/module-info.java", fileContent);
@@ -2555,7 +2555,7 @@ public void testBug519151_005() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module second {\n" +
"}\n";
createFile("/second/src/module-info.java", secondFile);
@@ -2570,7 +2570,7 @@ public void testBug519151_005() throws Exception {
project2.close();
project2.open(null);
project1.open(null);
-
+
SearchPattern pattern = SearchPattern.createPattern("pack.X", IJavaSearchConstants.TYPE, DECLARATIONS, ERASURE_RULE);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
{getJavaProject("JavaSearchBugs9")});
@@ -2592,7 +2592,7 @@ public void testBug519151_006() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module first {\n" +
"}\n";
createFile("/JavaSearchBugs9/src/module-info.java", fileContent);
@@ -2604,7 +2604,7 @@ public void testBug519151_006() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module second {\n" +
"}\n";
createFile("/second/src/module-info.java", secondFile);
@@ -2619,7 +2619,7 @@ public void testBug519151_006() throws Exception {
project2.close();
project2.open(null);
project1.open(null);
-
+
String needle = this.module_separator + "pack.X";
SearchPattern pattern = SearchPattern.createPattern(needle, IJavaSearchConstants.TYPE, DECLARATIONS, ERASURE_RULE);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
@@ -2640,7 +2640,7 @@ public void testBug519151_007() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module first {\n" +
"}\n";
createFile("/JavaSearchBugs9/src/module-info.java", fileContent);
@@ -2663,7 +2663,7 @@ public void testBug519151_007() throws Exception {
project2.close();
project2.open(null);
project1.open(null);
-
+
SearchPattern pattern = SearchPattern.createPattern("pack.X", IJavaSearchConstants.TYPE, DECLARATIONS, ERASURE_RULE);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
{getJavaProject("JavaSearchBugs9")});
@@ -2703,7 +2703,7 @@ public void testBug519151_008() throws Exception {
project2.close();
project2.open(null);
project1.open(null);
-
+
SearchPattern pattern = SearchPattern.createPattern("pack.X", IJavaSearchConstants.TYPE, DECLARATIONS, ERASURE_RULE);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
{getJavaProject("JavaSearchBugs9")});
@@ -2724,7 +2724,7 @@ public void testBug519151_009() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module first {\n" +
"}\n";
createFile("/JavaSearchBugs9/src/module-info.java", fileContent);
@@ -2736,7 +2736,7 @@ public void testBug519151_009() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module second {\n" +
"}\n";
createFile("/second/src/module-info.java", secondFile);
@@ -2751,7 +2751,7 @@ public void testBug519151_009() throws Exception {
project2.close();
project2.open(null);
project1.open(null);
-
+
String needle = "first,second" + this.module_separator + "pack.X";
SearchPattern pattern = SearchPattern.createPattern(needle, IJavaSearchConstants.TYPE, DECLARATIONS, ERASURE_RULE);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
@@ -2773,7 +2773,7 @@ public void testBug519151_010() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module first {\n" +
"}\n";
createFile("/JavaSearchBugs9/src/module-info.java", fileContent);
@@ -2785,7 +2785,7 @@ public void testBug519151_010() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module second {\n" +
"}\n";
createFile("/second/src/module-info.java", secondFile);
@@ -2800,7 +2800,7 @@ public void testBug519151_010() throws Exception {
project2.close();
project2.open(null);
project1.open(null);
-
+
String needle = " first, second"+ this.module_separator +"pack.X"; // with white space
SearchPattern pattern = SearchPattern.createPattern(needle, IJavaSearchConstants.TYPE, DECLARATIONS, ERASURE_RULE);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
@@ -2822,7 +2822,7 @@ public void testBug519151_011() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module mod.first {\n" +
"}\n";
createFile("/JavaSearchBugs9/src/module-info.java", fileContent);
@@ -2834,7 +2834,7 @@ public void testBug519151_011() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module mod.second {\n" +
"}\n";
createFile("/second/src/module-info.java", secondFile);
@@ -2849,7 +2849,7 @@ public void testBug519151_011() throws Exception {
project2.close();
project2.open(null);
project1.open(null);
-
+
String needle = "mod."+ this.module_separator +"pack.X";
SearchPattern pattern = SearchPattern.createPattern(needle, IJavaSearchConstants.TYPE, DECLARATIONS, SearchPattern.R_PREFIX_MATCH);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
@@ -2872,7 +2872,7 @@ public void testBug519151_012() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module mod.first {\n" +
"}\n";
createFile("/JavaSearchBugs9/src/module-info.java", fileContent);
@@ -2884,7 +2884,7 @@ public void testBug519151_012() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module mod.second {\n" +
"}\n";
createFile("/second/src/module-info.java", secondFile);
@@ -2899,7 +2899,7 @@ public void testBug519151_012() throws Exception {
project2.close();
project2.open(null);
project1.open(null);
-
+
String needle = "mod.*" + this.module_separator + "pack.X";
SearchPattern pattern = SearchPattern.createPattern(needle, IJavaSearchConstants.TYPE, DECLARATIONS, SearchPattern.R_PATTERN_MATCH);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
@@ -2921,7 +2921,7 @@ public void testBug519151_013() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module first {\n" +
" requires second;\n" +
"}\n";
@@ -2934,7 +2934,7 @@ public void testBug519151_013() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module second {\n" +
"}\n";
createFile("/second/src/module-info.java", secondFile);
@@ -2949,7 +2949,7 @@ public void testBug519151_013() throws Exception {
project2.close();
project2.open(null);
project1.open(null);
-
+
String needle = "first" + this.module_separator + "pack.Y";
SearchPattern pattern = SearchPattern.createPattern(needle, IJavaSearchConstants.TYPE, IJavaSearchConstants.MODULE_GRAPH, SearchPattern.R_PATTERN_MATCH);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
@@ -2970,7 +2970,7 @@ public void testBug519151_014() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module mod.first {\n" +
" requires mod.second {\n" +
"}\n";
@@ -2983,7 +2983,7 @@ public void testBug519151_014() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module mod.second {\n" +
" requires third;\n" +
"}\n";
@@ -2997,7 +2997,7 @@ public void testBug519151_014() throws Exception {
IJavaProject project3 = createJavaProject("third", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project3.open(null);
addClasspathEntry(project3, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String thirdFile =
+ String thirdFile =
"module third {\n" +
"}\n";
createFile("/third/src/module-info.java", thirdFile);
@@ -3013,7 +3013,7 @@ public void testBug519151_014() throws Exception {
project3.open(null);
project2.open(null);
project1.open(null);
-
+
String needle = "third" + this.module_separator + "pack.X";
SearchPattern pattern = SearchPattern.createPattern(needle, IJavaSearchConstants.TYPE, IJavaSearchConstants.MODULE_GRAPH, SearchPattern.R_PATTERN_MATCH);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
@@ -3036,7 +3036,7 @@ public void testBug519151_015() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module mod.first {\n" +
" requires mod.second {\n" +
"}\n";
@@ -3049,7 +3049,7 @@ public void testBug519151_015() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module mod.second {\n" +
" requires third;\n" +
"}\n";
@@ -3063,7 +3063,7 @@ public void testBug519151_015() throws Exception {
IJavaProject project3 = createJavaProject("third", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project3.open(null);
addClasspathEntry(project3, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String thirdFile =
+ String thirdFile =
"module third {\n" +
"}\n";
createFile("/third/src/module-info.java", thirdFile);
@@ -3079,7 +3079,7 @@ public void testBug519151_015() throws Exception {
project3.open(null);
project2.open(null);
project1.open(null);
-
+
String needle = "mod.second,third" + this.module_separator + "pack.X";
SearchPattern pattern = SearchPattern.createPattern(needle, IJavaSearchConstants.TYPE, IJavaSearchConstants.MODULE_GRAPH, SearchPattern.R_PATTERN_MATCH);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
@@ -3103,7 +3103,7 @@ public void testBug519151_016() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module mod.first {\n" +
" requires mod.second {\n" +
"}\n";
@@ -3116,7 +3116,7 @@ public void testBug519151_016() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module mod.second {\n" +
" requires third;\n" +
"}\n";
@@ -3130,7 +3130,7 @@ public void testBug519151_016() throws Exception {
IJavaProject project3 = createJavaProject("third", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project3.open(null);
addClasspathEntry(project3, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String thirdFile =
+ String thirdFile =
"module third {\n" +
"}\n";
createFile("/third/src/module-info.java", thirdFile);
@@ -3146,7 +3146,7 @@ public void testBug519151_016() throws Exception {
project3.open(null);
project2.open(null);
project1.open(null);
-
+
String needle = "non.existant.module" + this.module_separator + "pack.X";
SearchPattern pattern = SearchPattern.createPattern(needle, IJavaSearchConstants.TYPE, IJavaSearchConstants.MODULE_GRAPH, SearchPattern.R_PATTERN_MATCH);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
@@ -3167,7 +3167,7 @@ public void testBug519151_017() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module mod.first {\n" +
" requires mod.second {\n" +
"}\n";
@@ -3180,7 +3180,7 @@ public void testBug519151_017() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module mod.second {\n" +
" requires third;\n" +
"}\n";
@@ -3194,7 +3194,7 @@ public void testBug519151_017() throws Exception {
IJavaProject project3 = createJavaProject("third", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project3.open(null);
addClasspathEntry(project3, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String thirdFile =
+ String thirdFile =
"module third {\n" +
"}\n";
createFile("/third/src/module-info.java", thirdFile);
@@ -3210,7 +3210,7 @@ public void testBug519151_017() throws Exception {
project3.open(null);
project2.open(null);
project1.open(null);
-
+
String needle = this.module_separator + "pack.X";
SearchPattern pattern = SearchPattern.createPattern(needle, IJavaSearchConstants.TYPE, IJavaSearchConstants.MODULE_GRAPH, SearchPattern.R_PATTERN_MATCH);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
@@ -3238,7 +3238,7 @@ public void testBug519151_018() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module mod.second {\n" +
"}\n";
createFile("/second/src/module-info.java", secondFile);
@@ -3261,7 +3261,7 @@ public void testBug519151_018() throws Exception {
project3.open(null);
project2.open(null);
project1.open(null);
-
+
String needle = this.module_separator + "pack.X";
SearchPattern pattern = SearchPattern.createPattern(needle, IJavaSearchConstants.TYPE, IJavaSearchConstants.MODULE_GRAPH, SearchPattern.R_PATTERN_MATCH);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
@@ -3290,7 +3290,7 @@ public void testBug519151_019() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module mod.second {\n" +
"}\n";
createFile("/second/src/module-info.java", secondFile);
@@ -3313,7 +3313,7 @@ public void testBug519151_019() throws Exception {
project3.open(null);
project2.open(null);
project1.open(null);
-
+
String needle = this.explicit_unnamed + this.module_separator + "pack.X"; // "ALL-UNNAMED/pack.X"
SearchPattern pattern = SearchPattern.createPattern(needle, IJavaSearchConstants.TYPE, IJavaSearchConstants.MODULE_GRAPH, SearchPattern.R_PATTERN_MATCH);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
@@ -3342,7 +3342,7 @@ public void testBug519151_020() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module mod.second {\n" +
"}\n";
createFile("/second/src/module-info.java", secondFile);
@@ -3365,7 +3365,7 @@ public void testBug519151_020() throws Exception {
project3.open(null);
project2.open(null);
project1.open(null);
-
+
String module1 = this.explicit_unnamed; // "ALL-UNNAMED/pack.X"
String module2 = "mod.second";
String needle = module1 + "," + module2 + this.module_separator + "pack.X"; // "ALL-UNNAMED,second/pack.X"
@@ -3397,7 +3397,7 @@ public void testBug519151_021() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module mod.second {\n" +
" requires third;\n"+
"}\n";
@@ -3411,7 +3411,7 @@ public void testBug519151_021() throws Exception {
IJavaProject project3 = createJavaProject("third", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project3.open(null);
addClasspathEntry(project3, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String thirdFile =
+ String thirdFile =
"module third {\n" +
"}\n";
createFile("/third/src/module-info.java", thirdFile);
@@ -3427,7 +3427,7 @@ public void testBug519151_021() throws Exception {
project3.open(null);
project2.open(null);
project1.open(null);
-
+
String module1 = this.explicit_unnamed; // "ALL-UNNAMED/pack.X"
String module2 = "mod.second";
String needle = module1 + "," + module2 + this.module_separator + "pack.X"; // "ALL-UNNAMED,second/pack.X"
@@ -3454,7 +3454,7 @@ public void testBug519151_022() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module first {\n" +
"}\n";
createFile("/JavaSearchBugs9/src/module-info.java", fileContent);
@@ -3466,7 +3466,7 @@ public void testBug519151_022() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module second {\n" +
"}\n";
createFile("/second/src/module-info.java", secondFile);
@@ -3481,7 +3481,7 @@ public void testBug519151_022() throws Exception {
project2.close();
project2.open(null);
project1.open(null);
-
+
SearchPattern pattern = SearchPattern.createPattern("first/X", IJavaSearchConstants.TYPE, DECLARATIONS, ERASURE_RULE);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
{getJavaProject("JavaSearchBugs9")});
@@ -3503,7 +3503,7 @@ public void testBug519151_023() throws Exception {
addLibraryEntry(project1, "/JavaSearchBugs/lib/lib519151.jar", false);
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
- String secondFile =
+ String secondFile =
"module second {\n" +
"}\n";
createFile("/second/src/module-info.java", secondFile);
@@ -3531,7 +3531,7 @@ public void _testBug519151_0X1() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module mod.first {\n" +
"}\n";
createFile("/JavaSearchBugs9/src/module-info.java", fileContent);
@@ -3543,7 +3543,7 @@ public void _testBug519151_0X1() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module mod.second {\n" +
"}\n";
createFile("/second/src/module-info.java", secondFile);
@@ -3558,7 +3558,7 @@ public void _testBug519151_0X1() throws Exception {
project2.close();
project2.open(null);
project1.open(null);
-
+
String needle = "0mod.*" + this.module_separator + "pack.X"; // Pattern
SearchPattern pattern = SearchPattern.createPattern(needle, IJavaSearchConstants.CLASS, DECLARATIONS, ERASURE_RULE);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
@@ -3581,7 +3581,7 @@ public void _testBug519151_0X2() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module mod.first {\n" +
"}\n";
createFile("/JavaSearchBugs9/src/module-info.java", fileContent);
@@ -3593,7 +3593,7 @@ public void _testBug519151_0X2() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module mod.second {\n" +
"}\n";
createFile("/second/src/module-info.java", secondFile);
@@ -3608,7 +3608,7 @@ public void _testBug519151_0X2() throws Exception {
project2.close();
project2.open(null);
project1.open(null);
-
+
String needle = "0mod\\.s.*" + this.module_separator + "pack.X"; // Pattern
SearchPattern pattern = SearchPattern.createPattern(needle, IJavaSearchConstants.CLASS, DECLARATIONS, ERASURE_RULE);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
@@ -3630,7 +3630,7 @@ public void _testBug519151_0X3() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module mod.first {\n" +
"}\n";
createFile("/JavaSearchBugs9/src/module-info.java", fileContent);
@@ -3642,7 +3642,7 @@ public void _testBug519151_0X3() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module mod.second {\n" +
"}\n";
createFile("/second/src/module-info.java", secondFile);
@@ -3655,7 +3655,7 @@ public void _testBug519151_0X3() throws Exception {
IJavaProject project3 = createJavaProject("third", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project3.open(null);
addClasspathEntry(project3, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String thirdFile =
+ String thirdFile =
"module third {\n" +
"}\n";
createFile("/third/src/module-info.java", thirdFile);
@@ -3671,7 +3671,7 @@ public void _testBug519151_0X3() throws Exception {
project3.open(null);
project2.open(null);
project1.open(null);
-
+
String needle = "0mod\\.f.*,mod\\.s.*" + this.module_separator + "pack.X"; // Pattern
SearchPattern pattern = SearchPattern.createPattern(needle, IJavaSearchConstants.CLASS, DECLARATIONS, ERASURE_RULE);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
@@ -3695,7 +3695,7 @@ public void _testBug519151_0X4() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module mod.first {\n" +
"}\n";
createFile("/JavaSearchBugs9/src/module-info.java", fileContent);
@@ -3707,7 +3707,7 @@ public void _testBug519151_0X4() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module mod.second {\n" +
"}\n";
createFile("/second/src/module-info.java", secondFile);
@@ -3720,7 +3720,7 @@ public void _testBug519151_0X4() throws Exception {
IJavaProject project3 = createJavaProject("third", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project3.open(null);
addClasspathEntry(project3, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String thirdFile =
+ String thirdFile =
"module third {\n" +
"}\n";
createFile("/third/src/module-info.java", thirdFile);
@@ -3736,7 +3736,7 @@ public void _testBug519151_0X4() throws Exception {
project3.open(null);
project2.open(null);
project1.open(null);
-
+
String needle = "0mod\\.f.*,mod\\.s.*" + this.module_separator + "pack.X"; // Pattern
SearchPattern pattern = SearchPattern.createPattern(needle, IJavaSearchConstants.CLASS, DECLARATIONS, ERASURE_RULE);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
@@ -3760,7 +3760,7 @@ public void testBug528059_001() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module mod.first {\n" +
"}\n";
createFile("/JavaSearchBugs9/src/module-info.java", fileContent);
@@ -3772,7 +3772,7 @@ public void testBug528059_001() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module mod.second {\n" +
"}\n";
createFile("/second/src/module-info.java", secondFile);
@@ -3787,14 +3787,14 @@ public void testBug528059_001() throws Exception {
project2.close();
project2.open(null);
project1.open(null);
-
+
String needle = "mod.*"; // Pattern
SearchPattern pattern = SearchPattern.createPattern(needle, IJavaSearchConstants.MODULE, DECLARATIONS, SearchPattern.R_REGEXP_MATCH);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
{getJavaProject("JavaSearchBugs9")});
search(pattern, scope, this.resultCollector);
assertSearchResults(
- "src/module-info.java mod.first [mod.first] EXACT_MATCH\n" +
+ "src/module-info.java mod.first [mod.first] EXACT_MATCH\n" +
"src/module-info.java mod.second [mod.second] EXACT_MATCH",
this.resultCollector);
}
@@ -3810,7 +3810,7 @@ public void testBug528059_002() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module mod.first {\n" +
"}\n";
createFile("/JavaSearchBugs9/src/module-info.java", fileContent);
@@ -3822,7 +3822,7 @@ public void testBug528059_002() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module mod.second {\n" +
"}\n";
createFile("/second/src/module-info.java", secondFile);
@@ -3837,7 +3837,7 @@ public void testBug528059_002() throws Exception {
project2.close();
project2.open(null);
project1.open(null);
-
+
String needle = "mod.*"; // Pattern
SearchPattern pattern = SearchPattern.createPattern(needle, IJavaSearchConstants.MODULE, DECLARATIONS, SearchPattern.R_REGEXP_MATCH);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
@@ -3859,7 +3859,7 @@ public void testBug528059_003() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module mod.first {\n" +
"}\n";
createFile("/JavaSearchBugs9/src/module-info.java", fileContent);
@@ -3871,7 +3871,7 @@ public void testBug528059_003() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module mod.second {\n" +
"}\n";
createFile("/second/src/module-info.java", secondFile);
@@ -3886,7 +3886,7 @@ public void testBug528059_003() throws Exception {
project2.close();
project2.open(null);
project1.open(null);
-
+
String needle = "mod\\.f.*"; // Pattern
SearchPattern pattern = SearchPattern.createPattern(needle, IJavaSearchConstants.MODULE, DECLARATIONS, SearchPattern.R_REGEXP_MATCH);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
@@ -3908,7 +3908,7 @@ public void testBug528059_004() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module mod.first {\n" +
"}\n";
createFile("/JavaSearchBugs9/src/module-info.java", fileContent);
@@ -3920,7 +3920,7 @@ public void testBug528059_004() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module mod.second {\n" +
"}\n";
createFile("/second/src/module-info.java", secondFile);
@@ -3935,7 +3935,7 @@ public void testBug528059_004() throws Exception {
project2.close();
project2.open(null);
project1.open(null);
-
+
String needle = "mod.f.+"; // Pattern
SearchPattern pattern = SearchPattern.createPattern(needle, IJavaSearchConstants.MODULE, DECLARATIONS, SearchPattern.R_REGEXP_MATCH);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
@@ -3957,7 +3957,7 @@ public void testBug528059_005() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module mod.first {\n" +
"}\n";
createFile("/JavaSearchBugs9/src/module-info.java", fileContent);
@@ -3969,7 +3969,7 @@ public void testBug528059_005() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module mod.second {\n" +
"}\n";
createFile("/second/src/module-info.java", secondFile);
@@ -3984,7 +3984,7 @@ public void testBug528059_005() throws Exception {
project2.close();
project2.open(null);
project1.open(null);
-
+
String needle = ".*f.+"; // Pattern
SearchPattern pattern = SearchPattern.createPattern(needle, IJavaSearchConstants.MODULE, DECLARATIONS, SearchPattern.R_REGEXP_MATCH);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
@@ -4006,7 +4006,7 @@ public void testBug528059_006() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module mod.first {\n" +
"}\n";
createFile("/JavaSearchBugs9/src/module-info.java", fileContent);
@@ -4018,7 +4018,7 @@ public void testBug528059_006() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module mod.second {\n" +
"}\n";
createFile("/second/src/module-info.java", secondFile);
@@ -4033,14 +4033,14 @@ public void testBug528059_006() throws Exception {
project2.close();
project2.open(null);
project1.open(null);
-
+
String needle = ".*m+.*"; // Pattern
SearchPattern pattern = SearchPattern.createPattern(needle, IJavaSearchConstants.MODULE, DECLARATIONS, SearchPattern.R_REGEXP_MATCH);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
{getJavaProject("JavaSearchBugs9")});
search(pattern, scope, this.resultCollector);
assertSearchResults(
- "src/module-info.java mod.first [mod.first] EXACT_MATCH\n" +
+ "src/module-info.java mod.first [mod.first] EXACT_MATCH\n" +
"src/module-info.java mod.second [mod.second] EXACT_MATCH",
this.resultCollector);
}
@@ -4056,7 +4056,7 @@ public void testBug528059_007() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module mod.first {\n" +
" requires second;\n" +
"}\n";
@@ -4069,7 +4069,7 @@ public void testBug528059_007() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module mod.second {\n" +
" requires third;\n"+
"}\n";
@@ -4083,7 +4083,7 @@ public void testBug528059_007() throws Exception {
IJavaProject project3 = createJavaProject("third", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project3.open(null);
addClasspathEntry(project3, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String thirdFile =
+ String thirdFile =
"module third {\n" +
"}\n";
createFile("/third/src/module-info.java", thirdFile);
@@ -4099,14 +4099,14 @@ public void testBug528059_007() throws Exception {
project3.open(null);
project2.open(null);
project1.open(null);
-
+
String needle = "mod\\.[fs]+.*"; // Pattern
SearchPattern pattern = SearchPattern.createPattern(needle, IJavaSearchConstants.MODULE, DECLARATIONS, SearchPattern.R_REGEXP_MATCH);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
{getJavaProject("JavaSearchBugs9")});
search(pattern, scope, this.resultCollector);
assertSearchResults(
- "src/module-info.java mod.first [mod.first] EXACT_MATCH\n" +
+ "src/module-info.java mod.first [mod.first] EXACT_MATCH\n" +
"src/module-info.java mod.second [mod.second] EXACT_MATCH",
this.resultCollector);
}
@@ -4123,7 +4123,7 @@ public void testBug530016_001() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module mod.first {\n" +
"}\n";
createFile("/JavaSearchBugs9/src/module-info.java", fileContent);
@@ -4135,7 +4135,7 @@ public void testBug530016_001() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module mod.second {\n" +
"}\n";
createFile("/second/src/module-info.java", secondFile);
@@ -4157,7 +4157,7 @@ public void testBug530016_001() throws Exception {
{getJavaProject("JavaSearchBugs9")});
search(pattern, scope, this.resultCollector);
assertSearchResults(
- "src/module-info.java mod.first [mod.first] EXACT_MATCH\n" +
+ "src/module-info.java mod.first [mod.first] EXACT_MATCH\n" +
"src/module-info.java mod.second [mod.second] EXACT_MATCH",
this.resultCollector);
}
@@ -4173,7 +4173,7 @@ public void testBug530016_002() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module mod.first {\n" +
"}\n";
createFile("/JavaSearchBugs9/src/module-info.java", fileContent);
@@ -4185,7 +4185,7 @@ public void testBug530016_002() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module mod.second {\n" +
"}\n";
createFile("/second/src/module-info.java", secondFile);
@@ -4222,7 +4222,7 @@ public void testBug530016_003() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module mod.first {\n" +
"}\n";
createFile("/JavaSearchBugs9/src/module-info.java", fileContent);
@@ -4234,7 +4234,7 @@ public void testBug530016_003() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module mod.second {\n" +
"}\n";
createFile("/second/src/module-info.java", secondFile);
@@ -4271,7 +4271,7 @@ public void testBug530016_004() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module mod.first {\n" +
"}\n";
createFile("/JavaSearchBugs9/src/module-info.java", fileContent);
@@ -4283,7 +4283,7 @@ public void testBug530016_004() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module mod.second {\n" +
"}\n";
createFile("/second/src/module-info.java", secondFile);
@@ -4320,7 +4320,7 @@ public void testBug530016_005() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module mod.first {\n" +
"}\n";
createFile("/JavaSearchBugs9/src/module-info.java", fileContent);
@@ -4332,7 +4332,7 @@ public void testBug530016_005() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module mod.second {\n" +
"}\n";
createFile("/second/src/module-info.java", secondFile);
@@ -4369,7 +4369,7 @@ public void testBug530016_006() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module mod.first {\n" +
"}\n";
createFile("/JavaSearchBugs9/src/module-info.java", fileContent);
@@ -4381,7 +4381,7 @@ public void testBug530016_006() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module mod.second {\n" +
"}\n";
createFile("/second/src/module-info.java", secondFile);
@@ -4403,7 +4403,7 @@ public void testBug530016_006() throws Exception {
{getJavaProject("JavaSearchBugs9")});
search(pattern, scope, this.resultCollector);
assertSearchResults(
- "src/module-info.java mod.first [mod.first] EXACT_MATCH\n" +
+ "src/module-info.java mod.first [mod.first] EXACT_MATCH\n" +
"src/module-info.java mod.second [mod.second] EXACT_MATCH",
this.resultCollector);
}
@@ -4419,7 +4419,7 @@ public void testBug530016_007() throws Exception {
IJavaProject project1 = createJavaProject("JavaSearchBugs9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String fileContent =
+ String fileContent =
"module mod.first {\n" +
" requires second;\n" +
"}\n";
@@ -4432,7 +4432,7 @@ public void testBug530016_007() throws Exception {
IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String secondFile =
+ String secondFile =
"module mod.second {\n" +
" requires third;\n"+
"}\n";
@@ -4446,7 +4446,7 @@ public void testBug530016_007() throws Exception {
IJavaProject project3 = createJavaProject("third", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
project3.open(null);
addClasspathEntry(project3, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
- String thirdFile =
+ String thirdFile =
"module third {\n" +
"}\n";
createFile("/third/src/module-info.java", thirdFile);
@@ -4469,7 +4469,7 @@ public void testBug530016_007() throws Exception {
{getJavaProject("JavaSearchBugs9")});
search(pattern, scope, this.resultCollector);
assertSearchResults(
- "src/module-info.java mod.first [mod.first] EXACT_MATCH\n" +
+ "src/module-info.java mod.first [mod.first] EXACT_MATCH\n" +
"src/module-info.java mod.second [mod.second] EXACT_MATCH",
this.resultCollector);
}
@@ -4487,8 +4487,8 @@ public void testBug529367() throws Exception {
createFolder("/Library/src/javax/xml/bind");
createFile("/Library/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" +
@@ -4501,17 +4501,17 @@ public void testBug529367() throws Exception {
project2.open(null);
addClasspathEntry(project2, JavaCore.newProjectEntry(project1.getPath()));
createFolder("/second/src/p1");
- createFile("/second/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" +
+ createFile("/second/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");
project1.close(); // sync
@@ -4525,9 +4525,9 @@ public void testBug529367() throws Exception {
{project2});
search(pattern, scope, this.resultCollector);
assertSearchResults(
- "src/javax/xml/bind/JAXBContext.java JAXBContext javax.xml.bind.JAXBContext.newInstance(String) [JAXBContext] EXACT_MATCH\n" +
- "src/p1/ImportJAXBType.java [JAXBContext] EXACT_MATCH\n" +
- "src/p1/ImportJAXBType.java void p1.ImportJAXBType.main(String[]) [JAXBContext] EXACT_MATCH\n" +
+ "src/javax/xml/bind/JAXBContext.java JAXBContext javax.xml.bind.JAXBContext.newInstance(String) [JAXBContext] EXACT_MATCH\n" +
+ "src/p1/ImportJAXBType.java [JAXBContext] EXACT_MATCH\n" +
+ "src/p1/ImportJAXBType.java void p1.ImportJAXBType.main(String[]) [JAXBContext] EXACT_MATCH\n" +
"src/p1/ImportJAXBType.java void p1.ImportJAXBType.main(String[]) [JAXBContext] EXACT_MATCH",
this.resultCollector);
}
@@ -4566,7 +4566,7 @@ public void testBug545293() throws Exception {
// Note: this test only failed (without the fix for bug 545293) if it was
// executed exactly with a JDK 11
-
+
IJavaProject p = createJava9Project("P");
IJavaProject p1 = createJava9Project("P1");
try {
@@ -4585,8 +4585,8 @@ public void testBug545293() throws Exception {
"javax/dummy/Dummy.java",
"package javax.dummy;\n" + //
"\n" + //
- "public class Dummy {\n" + //
- " public Dummy(String s) {\n" +//
+ "public class Dummy {\n" + //
+ " public Dummy(String s) {\n" +//
" }\n" + //
"}"
},
@@ -4594,35 +4594,35 @@ public void testBug545293() throws Exception {
);
addClasspathEntry(p, JavaCore.newLibraryEntry(dummyJarPath, null, null));
- String content = "import javax.dummy.Dummy;\n" +
- "import com.example.Bar;\n" +
- "\n" +
- "public class Hello {\n" +
- " public void run() {\n" +
- " String str = null;\n" +
- " foo();\n" +
- " }\n" +
- " \n" +
- " private Object foo() {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
+ String content = "import javax.dummy.Dummy;\n" +
+ "import com.example.Bar;\n" +
+ "\n" +
+ "public class Hello {\n" +
+ " public void run() {\n" +
+ " String str = null;\n" +
+ " foo();\n" +
+ " }\n" +
+ " \n" +
+ " private Object foo() {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n" +
"";
String filePath = "/P/src/Hello.java";
createFile(filePath, content);
-
+
createFolder("/P1/src/com/example");
- createFile("/P1/src/com/example/Bar.java",
- "package com.example.bar;\n" +
- "public class Bar {\n" +
+ createFile("/P1/src/com/example/Bar.java",
+ "package com.example.bar;\n" +
+ "public class Bar {\n" +
"}\n");
-
-
+
+
p.close();
p1.close();
p1.open(null);
p.open(null);
-
+
waitUntilIndexesReady();
IType type = p.findType("Hello");
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java
index f35deb4a7..bcafaf6de 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.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
* Technical University Berlin - adapted for Object Teams
@@ -249,19 +249,19 @@ public void testBug6930_AllConstructorDeclarations01() throws Exception {
" public AllConstructorDeclarations01(Object o, String s) {}\n" +
"}\n"
);
-
+
this.workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/p6930/AllConstructorDeclarations01b.java",
"package p6930;\n" +
"public class AllConstructorDeclarations01b {\n" +
"}\n"
);
-
+
ConstructorDeclarationsCollector requestor = new ConstructorDeclarationsCollector();
searchAllConstructorDeclarations("AllConstructorDeclarations", SearchPattern.R_PREFIX_MATCH, requestor);
assertSearchResults(
- "p6930.AllConstructorDeclarations01#AllConstructorDeclarations01()\n" +
- "p6930.AllConstructorDeclarations01#AllConstructorDeclarations01(Object o)\n" +
- "p6930.AllConstructorDeclarations01#AllConstructorDeclarations01(Object o,String s)\n" +
+ "p6930.AllConstructorDeclarations01#AllConstructorDeclarations01()\n" +
+ "p6930.AllConstructorDeclarations01#AllConstructorDeclarations01(Object o)\n" +
+ "p6930.AllConstructorDeclarations01#AllConstructorDeclarations01(Object o,String s)\n" +
"p6930.AllConstructorDeclarations01b#AllConstructorDeclarations01b()*",
requestor
);
@@ -270,7 +270,7 @@ public void testBug6930_AllConstructorDeclarations01() throws Exception {
public void testBug6930_AllConstructorDeclarations02() throws Exception {
try {
IJavaProject p = createJavaProject("P", new String[] {}, new String[] {"/P/lib6930.jar"}, "");
-
+
createJar(new String[] {
"p6930/AllConstructorDeclarations02.java",
"package p6930;\n" +
@@ -285,13 +285,13 @@ public void testBug6930_AllConstructorDeclarations02() throws Exception {
"}"
}, p.getProject().getLocation().append("lib6930.jar").toOSString());
refresh(p);
-
+
ConstructorDeclarationsCollector requestor = new ConstructorDeclarationsCollector();
searchAllConstructorDeclarations("AllConstructorDeclarations", SearchPattern.R_PREFIX_MATCH, requestor);
assertSearchResults(
- "p6930.AllConstructorDeclarations02#AllConstructorDeclarations02()\n" +
- "p6930.AllConstructorDeclarations02#AllConstructorDeclarations02(java.lang.Object o)\n" +
- "p6930.AllConstructorDeclarations02#AllConstructorDeclarations02(java.lang.Object o,java.lang.String s)\n" +
+ "p6930.AllConstructorDeclarations02#AllConstructorDeclarations02()\n" +
+ "p6930.AllConstructorDeclarations02#AllConstructorDeclarations02(java.lang.Object o)\n" +
+ "p6930.AllConstructorDeclarations02#AllConstructorDeclarations02(java.lang.Object o,java.lang.String s)\n" +
"p6930.AllConstructorDeclarations02b#AllConstructorDeclarations02b()",
requestor
);
@@ -303,9 +303,9 @@ public void testBug6930_AllConstructorDeclarations02() throws Exception {
public void testBug6930_AllConstructorDeclarations03() throws Exception {
try {
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[] {}, "bin");
-
+
createFolder("/P/src/p6930");
-
+
createFile(
"/P/src/p6930/AllConstructorDeclarations03.java",
"package p6930;\n" +
@@ -314,20 +314,20 @@ public void testBug6930_AllConstructorDeclarations03() throws Exception {
" public AllConstructorDeclarations03(Object o) {}\n" +
" public AllConstructorDeclarations03(Object o, String s) {}\n" +
"}");
-
+
createFile(
"/P/src/p6930/AllConstructorDeclarations03b.java",
"package p6930;\n" +
"public class AllConstructorDeclarations03b {\n" +
"}");
refresh(p);
-
+
ConstructorDeclarationsCollector requestor = new ConstructorDeclarationsCollector();
searchAllConstructorDeclarations("AllConstructorDeclarations", SearchPattern.R_PREFIX_MATCH, requestor);
assertSearchResults(
- "p6930.AllConstructorDeclarations03#AllConstructorDeclarations03()\n" +
- "p6930.AllConstructorDeclarations03#AllConstructorDeclarations03(Object o)\n" +
- "p6930.AllConstructorDeclarations03#AllConstructorDeclarations03(Object o,String s)\n" +
+ "p6930.AllConstructorDeclarations03#AllConstructorDeclarations03()\n" +
+ "p6930.AllConstructorDeclarations03#AllConstructorDeclarations03(Object o)\n" +
+ "p6930.AllConstructorDeclarations03#AllConstructorDeclarations03(Object o,String s)\n" +
"p6930.AllConstructorDeclarations03b#AllConstructorDeclarations03b()*",
requestor
);
@@ -339,7 +339,7 @@ public void testBug6930_AllConstructorDeclarations03() throws Exception {
public void testBug6930_AllConstructorDeclarations04() throws Exception {
try {
IJavaProject p = createJavaProject("P", new String[] {}, new String[] {"/P/lib6930.jar"}, "","1.5");
-
+
createJar(
new String[] {
"p6930/AllConstructorDeclarations04.java",
@@ -352,7 +352,7 @@ public void testBug6930_AllConstructorDeclarations04() throws Exception {
new String[]{getExternalJCLPathString("1.5")},
"1.5");
refresh(p);
-
+
ConstructorDeclarationsCollector requestor = new ConstructorDeclarationsCollector();
searchAllConstructorDeclarations("AllConstructorDeclarations", SearchPattern.R_PREFIX_MATCH, requestor);
assertSearchResults(
@@ -367,7 +367,7 @@ public void testBug6930_AllConstructorDeclarations04() throws Exception {
public void testBug6930_AllConstructorDeclarations05() throws Exception {
try {
IJavaProject p = createJavaProject("P", new String[] {}, new String[] {"/P/lib6930.jar"}, "");
-
+
createJar(new String[] {
"p6930/AllConstructorDeclarations05.java",
"package p6930;\n" +
@@ -378,7 +378,7 @@ public void testBug6930_AllConstructorDeclarations05() throws Exception {
"}"
}, p.getProject().getLocation().append("lib6930.jar").toOSString());
refresh(p);
-
+
ConstructorDeclarationsCollector requestor = new ConstructorDeclarationsCollector();
searchAllConstructorDeclarations("AllConstructorDeclarations", SearchPattern.R_PREFIX_MATCH, requestor);
assertSearchResults(
@@ -5983,11 +5983,11 @@ public void testBug110336a() throws CoreException {
TypeReferenceCollector collector = new TypeReferenceCollector();
search(type, REFERENCES, EXACT_RULE, getJavaSearchScope(), collector);
assertSearchResults(
- "src/b110336/Test.java void b110336.Test.method(Class<Test>) [Test]+[TP]\n" +
- "src/b110336/Test.java void b110336.Test.method(Class<Test>) [Test]+[clazz]\n" +
- "src/b110336/Test.java void b110336.Test.method(Class<Test>) [Test]+[localVar1]\n" +
- "src/b110336/Test.java void b110336.Test.method(Class<Test>) [Test]+[localVar1]\n" +
- "src/b110336/Test.java void b110336.Test.method(Class<Test>) [Test]+[localVar2]\n" +
+ "src/b110336/Test.java void b110336.Test.method(Class<Test>) [Test]+[TP]\n" +
+ "src/b110336/Test.java void b110336.Test.method(Class<Test>) [Test]+[clazz]\n" +
+ "src/b110336/Test.java void b110336.Test.method(Class<Test>) [Test]+[localVar1]\n" +
+ "src/b110336/Test.java void b110336.Test.method(Class<Test>) [Test]+[localVar1]\n" +
+ "src/b110336/Test.java void b110336.Test.method(Class<Test>) [Test]+[localVar2]\n" +
"src/b110336/Test.java void b110336.Test.method(Class<Test>) [Test]+[localVar2]",
collector
);
@@ -6011,12 +6011,12 @@ public void testBug110336b() throws CoreException {
TypeReferenceCollector collector = new TypeReferenceCollector();
search(type, REFERENCES, EXACT_RULE, getJavaSearchScope(), collector);
assertSearchResults(
- "src/b110336/Test.java void b110336.Test.method1(Test):<anonymous>#1 [Test]\n" +
- "src/b110336/Test.java void b110336.Test.method1(Test):<anonymous>#1.c [Test]\n" +
- "src/b110336/Test.java void void b110336.Test.method1(Test):<anonymous>#1.foo() [Test]+[TP]\n" +
- "src/b110336/Test.java void void b110336.Test.method1(Test):<anonymous>#1.foo() [Test]+[o]\n" +
- "src/b110336/Test.java void void b110336.Test.method1(Test):<anonymous>#1.foo() [Test]+[o]\n" +
- "src/b110336/Test.java void b110336.Test.method1(Test) [Test]+[methodParam]\n" +
+ "src/b110336/Test.java void b110336.Test.method1(Test):<anonymous>#1 [Test]\n" +
+ "src/b110336/Test.java void b110336.Test.method1(Test):<anonymous>#1.c [Test]\n" +
+ "src/b110336/Test.java void void b110336.Test.method1(Test):<anonymous>#1.foo() [Test]+[TP]\n" +
+ "src/b110336/Test.java void void b110336.Test.method1(Test):<anonymous>#1.foo() [Test]+[o]\n" +
+ "src/b110336/Test.java void void b110336.Test.method1(Test):<anonymous>#1.foo() [Test]+[o]\n" +
+ "src/b110336/Test.java void b110336.Test.method1(Test) [Test]+[methodParam]\n" +
"src/b110336/Test.java void b110336.Test.method1(Test) [Test]+[localVar1]",
collector
);
@@ -6035,7 +6035,7 @@ public void testBug110336c() throws CoreException {
TypeReferenceCollector collector = new TypeReferenceCollector();
search(type, REFERENCES, EXACT_RULE, getJavaSearchScope(), collector);
assertSearchResults(
- "src/b110336/Test.java b110336.Test [X]+[TP]\n" +
+ "src/b110336/Test.java b110336.Test [X]+[TP]\n" +
"src/b110336/Test.java b110336.Test.x [X]",
collector
);
@@ -6079,11 +6079,11 @@ public void testBug110336e() throws CoreException {
TypeReferenceCollector collector = new TypeReferenceCollector();
search(type, REFERENCES, EXACT_RULE, getJavaSearchScope(), collector);
assertSearchResults(
- "src/b110336/Test.java void b110336.Test.foo() [Test]+[lv1]+[lv2,lv3]\n" +
- "src/b110336/Test.java void b110336.Test.foo() [Test]+[lv2]\n" +
- "src/b110336/Test.java void b110336.Test.foo() [Test]+[lv4]+[lv5,lv6]\n" +
- "src/b110336/Test.java void b110336.Test.foo() [Test]+[lv4]\n" +
- "src/b110336/Test.java void b110336.Test.foo() [Test]+[lv7]+[lv8,lv9]\n" +
+ "src/b110336/Test.java void b110336.Test.foo() [Test]+[lv1]+[lv2,lv3]\n" +
+ "src/b110336/Test.java void b110336.Test.foo() [Test]+[lv2]\n" +
+ "src/b110336/Test.java void b110336.Test.foo() [Test]+[lv4]+[lv5,lv6]\n" +
+ "src/b110336/Test.java void b110336.Test.foo() [Test]+[lv4]\n" +
+ "src/b110336/Test.java void b110336.Test.foo() [Test]+[lv7]+[lv8,lv9]\n" +
"src/b110336/Test.java void b110336.Test.foo() [Test]+[lv9]",
collector
);
@@ -6109,10 +6109,10 @@ public void testBug110336f() throws CoreException {
TypeReferenceCollector collector = new TypeReferenceCollector();
search(type, REFERENCES, EXACT_RULE, getJavaSearchScope(), collector);
assertSearchResults(
- "src/b110336/Test.java void b110336.Test.foo(Test) [Test]+[test1]\n" +
- "src/b110336/Test.java void b110336.Test.foo(Test) [Test]+[test2]\n" +
- "src/b110336/Test.java void b110336.Test.foo(Test) [Test]\n" +
- "src/b110336/Test.java void b110336.Test.foo(Test) [Test]+[test4]\n" +
+ "src/b110336/Test.java void b110336.Test.foo(Test) [Test]+[test1]\n" +
+ "src/b110336/Test.java void b110336.Test.foo(Test) [Test]+[test2]\n" +
+ "src/b110336/Test.java void b110336.Test.foo(Test) [Test]\n" +
+ "src/b110336/Test.java void b110336.Test.foo(Test) [Test]+[test4]\n" +
"src/b110336/Test.java void b110336.Test.foo(Test) [Test]+[test3]",
collector
);
@@ -6133,11 +6133,11 @@ public void testBug110336g() throws CoreException {
TypeReferenceCollector collector = new TypeReferenceCollector();
search(type, REFERENCES, EXACT_RULE, getJavaSearchScope(), collector);
assertSearchResults(
- "src/b110336/Test.java b110336.Test.{} [Test]+[lv1]+[lv2,lv3]\n" +
- "src/b110336/Test.java b110336.Test.{} [Test]+[lv2]\n" +
- "src/b110336/Test.java b110336.Test.{} [Test]+[lv4]+[lv5,lv6]\n" +
- "src/b110336/Test.java b110336.Test.{} [Test]+[lv4]\n" +
- "src/b110336/Test.java b110336.Test.{} [Test]+[lv7]+[lv8,lv9]\n" +
+ "src/b110336/Test.java b110336.Test.{} [Test]+[lv1]+[lv2,lv3]\n" +
+ "src/b110336/Test.java b110336.Test.{} [Test]+[lv2]\n" +
+ "src/b110336/Test.java b110336.Test.{} [Test]+[lv4]+[lv5,lv6]\n" +
+ "src/b110336/Test.java b110336.Test.{} [Test]+[lv4]\n" +
+ "src/b110336/Test.java b110336.Test.{} [Test]+[lv7]+[lv8,lv9]\n" +
"src/b110336/Test.java b110336.Test.{} [Test]+[lv9]",
collector
);
@@ -6158,11 +6158,11 @@ public void testBug110336h() throws CoreException {
TypeReferenceCollector collector = new TypeReferenceCollector();
search(type, REFERENCES, EXACT_RULE, getJavaSearchScope(), collector);
assertSearchResults(
- "src/b110336/Test.java b110336.Test.static {} [Test]+[lv1]+[lv2,lv3]\n" +
- "src/b110336/Test.java b110336.Test.static {} [Test]+[lv2]\n" +
- "src/b110336/Test.java b110336.Test.static {} [Test]+[lv4]+[lv5,lv6]\n" +
- "src/b110336/Test.java b110336.Test.static {} [Test]+[lv4]\n" +
- "src/b110336/Test.java b110336.Test.static {} [Test]+[lv7]+[lv8,lv9]\n" +
+ "src/b110336/Test.java b110336.Test.static {} [Test]+[lv1]+[lv2,lv3]\n" +
+ "src/b110336/Test.java b110336.Test.static {} [Test]+[lv2]\n" +
+ "src/b110336/Test.java b110336.Test.static {} [Test]+[lv4]+[lv5,lv6]\n" +
+ "src/b110336/Test.java b110336.Test.static {} [Test]+[lv4]\n" +
+ "src/b110336/Test.java b110336.Test.static {} [Test]+[lv7]+[lv8,lv9]\n" +
"src/b110336/Test.java b110336.Test.static {} [Test]+[lv9]",
collector
);
@@ -7909,7 +7909,7 @@ public void testBug156491() throws CoreException {
assertSearchResults(
"src/pack/Test.java void pack.Test.validMatches(X) [toString()] EXACT_MATCH\n" +
"src/pack/Test.java void pack.Test.superInvocationMatches(Object) [toString()] EXACT_MATCH SUPER INVOCATION\n" +
- "src/pack/Test.java void pack.Test.subtypeMatches(Sub) [toString()] EXACT_MATCH\n" +
+ "src/pack/Test.java void pack.Test.subtypeMatches(Sub) [toString()] EXACT_MATCH\n" +
"lib/b125178.jar java.lang.String pack.age.Test.foo(int) EXACT_MATCH SUPER INVOCATION"
);
}
@@ -9438,27 +9438,27 @@ public void testBug204652() throws CoreException {
public void testBug207657() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/test/Relationship.java",
- "package test;\n" +
- "public class Relationship {\n" +
+ "package test;\n" +
+ "public class Relationship {\n" +
" static public class End extends ConnectionEnd<Visitor> {\n" +
- " public void accept(Visitor visitor) {\n" +
- " visitor.visitRelationshipEnd(this);\n" +
- " }\n" +
- " }\n" +
+ " public void accept(Visitor visitor) {\n" +
+ " visitor.visitRelationshipEnd(this);\n" +
+ " }\n" +
+ " }\n" +
"}\n" +
- "interface Visitor {\n" +
- " boolean visitRelationshipEnd(Relationship.End end);\n" +
- " boolean visitAssociationEnd(Association.End end);\n" +
+ "interface Visitor {\n" +
+ " boolean visitRelationshipEnd(Relationship.End end);\n" +
+ " boolean visitAssociationEnd(Association.End end);\n" +
"}\n" +
- "abstract class ConnectionEnd<V extends Visitor> {\n" +
- " public abstract void accept( V visitor );\n" +
+ "abstract class ConnectionEnd<V extends Visitor> {\n" +
+ " public abstract void accept( V visitor );\n" +
"}\n" +
- "class Association extends Relationship {\n" +
- " static public class RelEnd extends Relationship.End {\n" +
- " public void accept(Visitor visitor) {\n" +
- " visitor.visitAssociationEnd(this);\n" +
- " }\n" +
- " }\n" +
+ "class Association extends Relationship {\n" +
+ " static public class RelEnd extends Relationship.End {\n" +
+ " public void accept(Visitor visitor) {\n" +
+ " visitor.visitAssociationEnd(this);\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
IType type = this.workingCopies[0].getType("Relationship").getType("End");
@@ -9518,7 +9518,7 @@ public void testBug209778() throws CoreException {
TypeReferenceCollector collector = new TypeReferenceCollector();
search(type, REFERENCES, EXACT_RULE, getJavaSearchScope(), collector);
assertSearchResults(
- "src/xy/Try.java xy.Try.fTryA [Try]+[@Constants on fTryA]+[@Constants on fTryB]\n" +
+ "src/xy/Try.java xy.Try.fTryA [Try]+[@Constants on fTryA]+[@Constants on fTryB]\n" +
"src/xy/Try.java void xy.Try.tryB(int) [Try]+[@Constants on tryCopy]+[@Constants on tryCopy2]",
collector
);
@@ -9589,10 +9589,10 @@ public void testBug209996_c5() throws CoreException {
collector.showSelection();
search(type, REFERENCES, EXACT_RULE, getJavaSearchScope(), collector);
assertSearchResults(
- "src/comment5/Ref.java void comment5.Ref.doA(Ref) [ void doA(!|Ref|! ref) {}]+[ref]\n" +
- "src/comment5/Ref.java void comment5.Ref.doB(List<Ref>) [ void doB(List<!|Ref|!> ref) {}]+[ref]\n" +
- "src/comment5/Ref.java void comment5.Ref.doC(Ref) [ void doC(@Tag(!|Ref|!.class) Ref ref) {}]+[@Tag on ref]\n" +
- "src/comment5/Ref.java void comment5.Ref.doC(Ref) [ void doC(@Tag(Ref.class) !|Ref|! ref) {}]+[ref]\n" +
+ "src/comment5/Ref.java void comment5.Ref.doA(Ref) [ void doA(!|Ref|! ref) {}]+[ref]\n" +
+ "src/comment5/Ref.java void comment5.Ref.doB(List<Ref>) [ void doB(List<!|Ref|!> ref) {}]+[ref]\n" +
+ "src/comment5/Ref.java void comment5.Ref.doC(Ref) [ void doC(@Tag(!|Ref|!.class) Ref ref) {}]+[@Tag on ref]\n" +
+ "src/comment5/Ref.java void comment5.Ref.doC(Ref) [ void doC(@Tag(Ref.class) !|Ref|! ref) {}]+[ref]\n" +
"src/comment5/Ref.java void comment5.Ref.dontD(Object) [ void dontD(@Tag(!|Ref|!.class) Object ref) {}]+[@Tag on ref]",
collector
);
@@ -9634,8 +9634,8 @@ public void testBug209996_c22_3() throws CoreException {
collector.showSelection();
search(type, REFERENCES, EXACT_RULE, getJavaSearchScope(), collector);
assertSearchResults(
- "src/comment22/Test.java comment22.Test.test1 [ @!|Tag|! Test test1, test2, test3;]+[@Tag on test1]+[@Tag on test2,@Tag on test3]\n" +
- "src/comment22/Test.java void comment22.Test.method() [ @!|Tag|! Test local= null;]+[@Tag on local]\n" +
+ "src/comment22/Test.java comment22.Test.test1 [ @!|Tag|! Test test1, test2, test3;]+[@Tag on test1]+[@Tag on test2,@Tag on test3]\n" +
+ "src/comment22/Test.java void comment22.Test.method() [ @!|Tag|! Test local= null;]+[@Tag on local]\n" +
"src/comment22/Test.java void comment22.Test.method() [ @!|Tag|! Test local1, local2, local3;]+[@Tag on local1]+[@Tag on local2,@Tag on local3]",
collector
);
@@ -10515,14 +10515,14 @@ public void testBug231622() throws Exception {
public void testBug236520() throws CoreException {
this.workingCopies = new ICompilationUnit[2];
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/pack1/I.java",
- "package pack1;\n" +
- "public interface I<V> {\n" +
+ "package pack1;\n" +
+ "public interface I<V> {\n" +
"}\n"
);
this.workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/pack2/X.java",
- "package pack2;\n" +
- "public class X {\n" +
- " public I<A> foo() {}\n" +
+ "package pack2;\n" +
+ "public class X {\n" +
+ " public I<A> foo() {}\n" +
"}\n"
);
this.resultCollector.showRule();
@@ -10553,7 +10553,7 @@ public void testBug250083() throws Exception {
waitUntilIndexesReady();
deleteExternalFile(libPath);
deleteProject("P");
-
+
Util.createJar(
new String[] {
"p250083/X250083.java",
@@ -10608,7 +10608,7 @@ public void testBug251827a() throws CoreException {
this.resultCollector.showSelection();
search("B251827*", TYPE, REFERENCES);
assertSearchResults(
- "src/b251827/X.java [import static b251827.!|B251827|!.VAL;] EXACT_MATCH\n" +
+ "src/b251827/X.java [import static b251827.!|B251827|!.VAL;] EXACT_MATCH\n" +
"src/b251827/X.java [import static b251827.!|B251827|!.foo;] EXACT_MATCH"
);
}
@@ -10729,12 +10729,12 @@ public void testBug261722() throws Exception {
Thread.sleep(10);
}
deleteProject(javaProject);
-
+
// Wait until search thread is finished
while (thread.isAlive()) {
Thread.sleep(100);
}
-
+
// Verify search results
assertEquals("Unexpected matches count", MAX+1, requestor.count);
} finally {
@@ -10753,26 +10753,26 @@ public void testBug261722() throws Exception {
public void testBug265065() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/MyClass.java",
- "public class MyClass {\n" +
- " class MyPrivateClass {\n" +
- " public String type = TYPE_A;\n" +
- " public Object value = null;\n" +
- " public MyPrivateClass(String type, Object value) {\n" +
- " this.type = type;\n" +
- " this.value = value;\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " private static final String TYPE_A = \"A\";\n" +
- " private static final String TYPE_B = \"B\";\n" +
- " private static final String TYPE_C = \"C\";\n" +
- "\n" +
- " void foo (Object value) {\n" +
- " MyPrivateClass mpc = new MyPrivateClass(TYPE_B, value);\n" +
- " if (mpc.value == null) {\n" +
- " mpc.type = TYPE_C;\n" +
- " }\n" +
- " }\n" +
+ "public class MyClass {\n" +
+ " class MyPrivateClass {\n" +
+ " public String type = TYPE_A;\n" +
+ " public Object value = null;\n" +
+ " public MyPrivateClass(String type, Object value) {\n" +
+ " this.type = type;\n" +
+ " this.value = value;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " private static final String TYPE_A = \"A\";\n" +
+ " private static final String TYPE_B = \"B\";\n" +
+ " private static final String TYPE_C = \"C\";\n" +
+ "\n" +
+ " void foo (Object value) {\n" +
+ " MyPrivateClass mpc = new MyPrivateClass(TYPE_B, value);\n" +
+ " if (mpc.value == null) {\n" +
+ " mpc.type = TYPE_C;\n" +
+ " }\n" +
+ " }\n" +
"}\n"
);
this.resultCollector.showRule();
@@ -10786,11 +10786,11 @@ public void testBug265065() throws CoreException {
this.resultCollector,
null);
assertSearchResults(
- "src/MyClass.java void MyClass.foo(Object) [value] EXACT_MATCH READ ACCESS\n" +
- "src/MyClass.java void MyClass.foo(Object) [type] EXACT_MATCH READ ACCESS\n" +
- "src/MyClass.java MyClass$MyPrivateClass.type [type] EXACT_MATCH\n" +
- "src/MyClass.java MyClass$MyPrivateClass.value [value] EXACT_MATCH\n" +
- "src/MyClass.java MyClass$MyPrivateClass(String, Object) [type] EXACT_MATCH WRITE ACCESS\n" +
+ "src/MyClass.java void MyClass.foo(Object) [value] EXACT_MATCH READ ACCESS\n" +
+ "src/MyClass.java void MyClass.foo(Object) [type] EXACT_MATCH READ ACCESS\n" +
+ "src/MyClass.java MyClass$MyPrivateClass.type [type] EXACT_MATCH\n" +
+ "src/MyClass.java MyClass$MyPrivateClass.value [value] EXACT_MATCH\n" +
+ "src/MyClass.java MyClass$MyPrivateClass(String, Object) [type] EXACT_MATCH WRITE ACCESS\n" +
"src/MyClass.java MyClass$MyPrivateClass(String, Object) [value] EXACT_MATCH WRITE ACCESS"
);
}
@@ -10825,17 +10825,17 @@ public void testBug265065b() throws CoreException {
this.resultCollector,
null);
assertSearchResults(
- "src/test/X.java void test.X.foo(Test, Test) [t1] EXACT_MATCH WRITE ACCESS\n" +
- "src/test/X.java void test.X.foo(Test, Test) [t2] EXACT_MATCH READ ACCESS\n" +
- "src/test/X.java void test.X.foo(Test, Test) [t1] EXACT_MATCH READ ACCESS\n" +
- "src/test/X.java void test.X.foo(Test, Test) [t1] EXACT_MATCH READ ACCESS\n" +
- "src/test/X.java void test.X.foo(Test, Test) [t2] EXACT_MATCH READ ACCESS\n" +
+ "src/test/X.java void test.X.foo(Test, Test) [t1] EXACT_MATCH WRITE ACCESS\n" +
+ "src/test/X.java void test.X.foo(Test, Test) [t2] EXACT_MATCH READ ACCESS\n" +
+ "src/test/X.java void test.X.foo(Test, Test) [t1] EXACT_MATCH READ ACCESS\n" +
+ "src/test/X.java void test.X.foo(Test, Test) [t1] EXACT_MATCH READ ACCESS\n" +
+ "src/test/X.java void test.X.foo(Test, Test) [t2] EXACT_MATCH READ ACCESS\n" +
"src/test/X.java void test.X.foo(Test, Test) [t1] EXACT_MATCH READ ACCESS"
);
}
/**
- * @bug 266582: [search] NPE finding references
+ * @bug 266582: [search] NPE finding references
* @test Ensure that no NPE occurs when searching for type references
* in a project which has the same jar twice on its classpath
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=266582"
@@ -10845,15 +10845,15 @@ public void testBug266582() throws Exception {
addLibraryEntry(JAVA_PROJECT, "/JavaSearchBugs/lib/b266582b.jar", false);
try {
createFile("/JavaSearchBugs/src/A.java",
- "import foo.JohnsonException;\n" +
- "class A {\n" +
- " void foo() throws JohnsonException {}\n" +
+ "import foo.JohnsonException;\n" +
+ "class A {\n" +
+ " void foo() throws JohnsonException {}\n" +
"}"
);
IType type = getClassFile("JavaSearchBugs", "/JavaSearchBugs/lib/b266582a.jar", "foo", "JohnsonException.class").getType();
search(type, REFERENCES);
assertSearchResults(
- "src/A.java [foo.JohnsonException] EXACT_MATCH\n" +
+ "src/A.java [foo.JohnsonException] EXACT_MATCH\n" +
"src/A.java void A.foo() [JohnsonException] EXACT_MATCH"
);
}
@@ -10871,8 +10871,8 @@ public void testBug266582() throws Exception {
public void testBug266837() throws Exception {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java",
- "public class Test {\n" +
- " private static final java.lang.String f266837 = \"myString\";\n" +
+ "public class Test {\n" +
+ " private static final java.lang.String f266837 = \"myString\";\n" +
"}\n"
);
SearchRequestor requestor = new SearchRequestor() {
@@ -10896,7 +10896,7 @@ public void testBug286379a() throws CoreException {
assertNotNull("We should have got a Java Source content type!", javaContentType);
javaContentType.addFileSpec("torem", IContentType.FILE_EXTENSION_SPEC);
createJavaProject("P");
- createFolder("/P/p");
+ createFolder("/P/p");
createFile(
"/P/p/Xtorem.torem",
"package p;\n" +
@@ -10907,7 +10907,7 @@ public void testBug286379a() throws CoreException {
cu = getCompilationUnit("/P/p/Xtorem.torem");
cu.becomeWorkingCopy(null);
IType type = cu.getType("Xtorem");
-
+
// Ensure that the Xtorem class is really found
TestCollector collector = new TestCollector();
new SearchEngine().search(
@@ -10918,10 +10918,10 @@ public void testBug286379a() throws CoreException {
null
);
assertSearchResults("p/Xtorem.torem p.Xtorem", collector);
-
+
// Ensure that removal of the content type doesn't cause any further exception
// during the search and also ensure that the search doesn't return any result
- javaContentType.removeFileSpec("torem", IContentType.FILE_EXTENSION_SPEC);
+ javaContentType.removeFileSpec("torem", IContentType.FILE_EXTENSION_SPEC);
collector = new TestCollector();
new SearchEngine().search(
SearchPattern.createPattern(type, IJavaSearchConstants.DECLARATIONS),
@@ -10941,7 +10941,7 @@ public void testBug286379a() throws CoreException {
}
/**
- * This is similar to testBug286379a, except that it ensures that IAE doesn't occur
+ * This is similar to testBug286379a, except that it ensures that IAE doesn't occur
* at a different place
*/
public void testBug286379b() throws CoreException {
@@ -10950,14 +10950,14 @@ public void testBug286379b() throws CoreException {
assertNotNull("We should have got a Java Source a content type!", javaContentType);
javaContentType.addFileSpec("torem", IContentType.FILE_EXTENSION_SPEC);
createJavaProject("P");
- createFolder("/P/p");
+ createFolder("/P/p");
createFile(
"/P/p/Xtorem.torem",
"package p;\n" +
"public class Xtorem {\n" +
"}"
- );
-
+ );
+
// Ensure that the class Xtorem is really found
TypeNameMatchCollector collector = new TypeNameMatchCollector();
new SearchEngine().searchAllTypeNames(
@@ -10968,7 +10968,7 @@ public void testBug286379b() throws CoreException {
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
null);
assertSearchResults("Xtorem (not open) [in Xtorem.torem [in p [in <project root> [in P]]]]", collector);
-
+
// Ensure that removal of the content type doesn't cause any further exception
// during the search and also ensure that the search doesn't return any result
javaContentType.removeFileSpec("torem", IContentType.FILE_EXTENSION_SPEC);
@@ -10989,8 +10989,8 @@ public void testBug286379b() throws CoreException {
}
/**
- * If any javaLikeNames are added, this ensures that such files can get searched
- * at least on the restart of the workspace.
+ * If any javaLikeNames are added, this ensures that such files can get searched
+ * at least on the restart of the workspace.
* If any javaLikeNames are deleted, this ensures that the index file is regenerated.
*/
public void testBug286379c() throws CoreException {
@@ -11020,13 +11020,13 @@ public void testBug286379c() throws CoreException {
return false;
}
}
-
+
IContentType javaContentType = Platform.getContentTypeManager().getContentType(JavaCore.JAVA_SOURCE_CONTENT_TYPE);
TestResourceChangeListener changeListener = new TestResourceChangeListener();
try {
// Create resource
createJavaProject("P");
- createFolder("/P/p");
+ createFolder("/P/p");
createFile(
"/P/p/Xtorem.torem",
"package p;\n" +
@@ -11043,7 +11043,7 @@ public void testBug286379c() throws CoreException {
// Change the file extension
assertNotNull("We should have got a Java Source a content type!", javaContentType);
javaContentType.addFileSpec("torem", IContentType.FILE_EXTENSION_SPEC);
-
+
// Wait for all the resource event before continuing
// Note that if we are not waiting for this event occurring then the search may
// fail as we don't get any specific event from the platform to refresh the indexes.
@@ -11080,7 +11080,7 @@ public void testBug286379c() throws CoreException {
"Xtorem (not open) [in Xtorem.torem [in p [in <project root> [in P]]]]",
collector,
false /*only assume*/);
-
+
// Delete the file specification
changeListener.toRemPresent = true;
javaContentType.removeFileSpec("torem", IContentType.FILE_EXTENSION_SPEC);
@@ -11095,7 +11095,7 @@ public void testBug286379c() throws CoreException {
assertTrue("We should have got a resource event within a 10s delay!", counter++ < 100);
}
waitUntilIndexesReady();
-
+
// Restarting should update the index file to remove the references of any .torem files
simulateExit();
simulateRestart();
@@ -11121,23 +11121,23 @@ public void testBug286379c() throws CoreException {
/**
* @bug 295894: Search shows focus type implementation for nested types even though the scope is restricted to subtypes.
- * @test using the hierarchy with the old API includes the focus type.
+ * @test using the hierarchy with the old API includes the focus type.
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=295894"
*/
public void testBug295894() throws Exception {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java",
- "public class Test {\n" +
- " void test() {\n" +
- " Test t = new Test();\n" +
- " t.foo();\n" +
- " }\n" +
- " public void foo() {\n" +
- " }\n" +
- " public class Sub extends Test {\n" +
- " public void foo() {}\n" +
- " }\n" +
- "}\n" +
+ "public class Test {\n" +
+ " void test() {\n" +
+ " Test t = new Test();\n" +
+ " t.foo();\n" +
+ " }\n" +
+ " public void foo() {\n" +
+ " }\n" +
+ " public class Sub extends Test {\n" +
+ " public void foo() {}\n" +
+ " }\n" +
+ "}\n" +
""
);
search(
@@ -11147,7 +11147,7 @@ public void testBug295894() throws Exception {
SearchEngine.createHierarchyScope(this.workingCopies[0].findPrimaryType()),
this.resultCollector);
assertSearchResults(
- "src/Test.java void Test.foo() [foo] EXACT_MATCH\n" +
+ "src/Test.java void Test.foo() [foo] EXACT_MATCH\n" +
"src/Test.java void Test$Sub.foo() [foo] EXACT_MATCH"
);
}
@@ -11159,17 +11159,17 @@ public void testBug295894() throws Exception {
public void testBug295894a() throws Exception {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java",
- "public class Test {\n" +
- " void test() {\n" +
- " Test t = new Test();\n" +
- " t.foo();\n" +
- " }\n" +
- " public void foo() {\n" +
- " }\n" +
- " public class Sub extends Test {\n" +
- " public void foo() {}\n" +
- " }\n" +
- "}\n" +
+ "public class Test {\n" +
+ " void test() {\n" +
+ " Test t = new Test();\n" +
+ " t.foo();\n" +
+ " }\n" +
+ " public void foo() {\n" +
+ " }\n" +
+ " public class Sub extends Test {\n" +
+ " public void foo() {}\n" +
+ " }\n" +
+ "}\n" +
""
);
search(
@@ -11191,17 +11191,17 @@ public void testBug295894a() throws Exception {
public void testBug295894b() throws Exception {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java",
- "public class Test {\n" +
- " void test() {\n" +
- " Test t = new Test();\n" +
- " t.foo();\n" +
- " }\n" +
- " public void foo() {\n" +
- " }\n" +
- " public class Sub extends Test {\n" +
- " public void foo() {}\n" +
- " }\n" +
- "}\n" +
+ "public class Test {\n" +
+ " void test() {\n" +
+ " Test t = new Test();\n" +
+ " t.foo();\n" +
+ " }\n" +
+ " public void foo() {\n" +
+ " }\n" +
+ " public class Sub extends Test {\n" +
+ " public void foo() {}\n" +
+ " }\n" +
+ "}\n" +
""
);
search(
@@ -11212,7 +11212,7 @@ public void testBug295894b() throws Exception {
this.resultCollector);
// Same results as with the old API
assertSearchResults(
- "src/Test.java void Test.foo() [foo] EXACT_MATCH\n" +
+ "src/Test.java void Test.foo() [foo] EXACT_MATCH\n" +
"src/Test.java void Test$Sub.foo() [foo] EXACT_MATCH"
);
}
@@ -11225,16 +11225,16 @@ public void testBug295894b() throws Exception {
public void testBug295894c() throws Exception {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/A.java",
- "public class A {\n" +
- " void test() {\n" +
- " A a= new A();\n" +
- " a.toString();\n" +
- " }\n" +
+ "public class A {\n" +
+ " void test() {\n" +
+ " A a= new A();\n" +
+ " a.toString();\n" +
+ " }\n" +
" @Override\n" +
" public String toString() {\n" +
- " return \"\";\n" +
- " }\n" +
- "}\n" +
+ " return \"\";\n" +
+ " }\n" +
+ "}\n" +
""
);
search(
@@ -11253,15 +11253,15 @@ public void testBug295894c2() throws Exception {
createJavaProject("P");
createFile(
"/P/A.java",
- "public class A {\n" +
- " void test() {\n" +
- " A a= new A();\n" +
- " a.toString();\n" +
- " }\n" +
+ "public class A {\n" +
+ " void test() {\n" +
+ " A a= new A();\n" +
+ " a.toString();\n" +
+ " }\n" +
" @Override\n" +
" public String toString() {\n" +
- " return \"\";\n" +
- " }\n" +
+ " return \"\";\n" +
+ " }\n" +
"}\n"
);
final ICompilationUnit cu = getCompilationUnit("/P/A.java");
@@ -11284,17 +11284,17 @@ public void testBug295894c3() throws Exception {
createJavaProject("P");
createFile(
"/P/A.java",
- "public class A {\n" +
- " void test() {\n" +
- " A a= new A();\n" +
- " a.toString();\n" +
- " }\n" +
+ "public class A {\n" +
+ " void test() {\n" +
+ " A a= new A();\n" +
+ " a.toString();\n" +
+ " }\n" +
" @Override\n" +
" public String toString() {\n" +
- " return \"\";\n" +
- " }\n" +
- "}\n" +
- "class B extends A {\n" +
+ " return \"\";\n" +
+ " }\n" +
+ "}\n" +
+ "class B extends A {\n" +
"}\n"
);
final ICompilationUnit cu = getCompilationUnit("/P/A.java");
@@ -11317,15 +11317,15 @@ public void testBug295894c4() throws Exception {
createJavaProject("P");
createFile(
"/P/A.java",
- "public class A {\n" +
- " void test() {\n" +
- " A a= new A();\n" +
- " a.toString();\n" +
- " }\n" +
+ "public class A {\n" +
+ " void test() {\n" +
+ " A a= new A();\n" +
+ " a.toString();\n" +
+ " }\n" +
" @Override\n" +
" public String toString() {\n" +
- " return \"\";\n" +
- " }\n" +
+ " return \"\";\n" +
+ " }\n" +
"}\n"
);
final ICompilationUnit cu = getCompilationUnit("/P/A.java");
@@ -11348,20 +11348,20 @@ public void testBug295894c5() throws Exception {
createJavaProject("P");
createFile(
"/P/A.java",
- "public class A {\n" +
- " void test() {\n" +
- " A a= new A();\n" +
- " a.toString();\n" +
- " }\n" +
+ "public class A {\n" +
+ " void test() {\n" +
+ " A a= new A();\n" +
+ " a.toString();\n" +
+ " }\n" +
" @Override\n" +
" public String toString() {\n" +
- " return \"\";\n" +
- " }\n" +
+ " return \"\";\n" +
+ " }\n" +
"}"
);
createFile(
"/P/B.java",
- "class B extends A {\n" +
+ "class B extends A {\n" +
"}\n"
);
final ICompilationUnit cu = getCompilationUnit("/P/A.java");
@@ -11392,19 +11392,19 @@ public void testBug288174() throws Exception {
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { root });
search("*", TYPE, REFERENCES, scope);
assertSearchResults(
- "lib/b288174.jar pack.<anonymous> EXACT_MATCH\n" +
- "lib/b288174.jar E[] pack.<anonymous>.bar1(java.lang.Class<E>) EXACT_MATCH\n" +
- "lib/b288174.jar E[] pack.<anonymous>.bar1(java.lang.Class<E>) EXACT_MATCH\n" +
- "lib/b288174.jar E[] pack.<anonymous>.bar1(java.lang.Class<E>) EXACT_MATCH\n" +
- "lib/b288174.jar E[] pack.<anonymous>.bar1(java.lang.Class<E>) EXACT_MATCH\n" +
- "lib/b288174.jar E[] pack.<anonymous>.bar1(java.lang.Class<E>) EXACT_MATCH\n" +
- "lib/b288174.jar void pack.Test.foo1() EXACT_MATCH\n" +
- "lib/b288174.jar pack.<anonymous> EXACT_MATCH\n" +
- "lib/b288174.jar F[] pack.<anonymous>.bar2(java.lang.Class<F>) EXACT_MATCH\n" +
- "lib/b288174.jar F[] pack.<anonymous>.bar2(java.lang.Class<F>) EXACT_MATCH\n" +
- "lib/b288174.jar F[] pack.<anonymous>.bar2(java.lang.Class<F>) EXACT_MATCH\n" +
- "lib/b288174.jar F[] pack.<anonymous>.bar2(java.lang.Class<F>) EXACT_MATCH\n" +
- "lib/b288174.jar F[] pack.<anonymous>.bar2(java.lang.Class<F>) EXACT_MATCH\n" +
+ "lib/b288174.jar pack.<anonymous> EXACT_MATCH\n" +
+ "lib/b288174.jar E[] pack.<anonymous>.bar1(java.lang.Class<E>) EXACT_MATCH\n" +
+ "lib/b288174.jar E[] pack.<anonymous>.bar1(java.lang.Class<E>) EXACT_MATCH\n" +
+ "lib/b288174.jar E[] pack.<anonymous>.bar1(java.lang.Class<E>) EXACT_MATCH\n" +
+ "lib/b288174.jar E[] pack.<anonymous>.bar1(java.lang.Class<E>) EXACT_MATCH\n" +
+ "lib/b288174.jar E[] pack.<anonymous>.bar1(java.lang.Class<E>) EXACT_MATCH\n" +
+ "lib/b288174.jar void pack.Test.foo1() EXACT_MATCH\n" +
+ "lib/b288174.jar pack.<anonymous> EXACT_MATCH\n" +
+ "lib/b288174.jar F[] pack.<anonymous>.bar2(java.lang.Class<F>) EXACT_MATCH\n" +
+ "lib/b288174.jar F[] pack.<anonymous>.bar2(java.lang.Class<F>) EXACT_MATCH\n" +
+ "lib/b288174.jar F[] pack.<anonymous>.bar2(java.lang.Class<F>) EXACT_MATCH\n" +
+ "lib/b288174.jar F[] pack.<anonymous>.bar2(java.lang.Class<F>) EXACT_MATCH\n" +
+ "lib/b288174.jar F[] pack.<anonymous>.bar2(java.lang.Class<F>) EXACT_MATCH\n" +
"lib/b288174.jar void pack.Test.foo2() EXACT_MATCH"
);
}
@@ -11418,13 +11418,13 @@ public void testBug288174() throws Exception {
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=293861"
*/
public void testBug293861a() throws CoreException {
- try
+ try
{
IJavaProject project = createJavaProject("P");
addClasspathEntry(project, JavaCore.newLibraryEntry(new Path("/JavaSearchBugs/lib/b293861.jar"), null, null));
int mask = IJavaSearchScope.APPLICATION_LIBRARIES | IJavaSearchScope.SOURCES | IJavaSearchScope.REFERENCED_PROJECTS;
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, mask);
-
+
search("b293861TestFunc", IJavaSearchConstants.METHOD, IJavaSearchConstants.DECLARATIONS, scope);
assertSearchResults("No search results expected", "", this.resultCollector);
} finally {
@@ -11442,7 +11442,7 @@ public void testBug293861b() throws CoreException {
addClasspathEntry(project, JavaCore.newLibraryEntry(new Path("/JavaSearchBugs/lib/b293861.jar"), null, null));
int mask = IJavaSearchScope.APPLICATION_LIBRARIES | IJavaSearchScope.SOURCES | IJavaSearchScope.REFERENCED_PROJECTS;
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, mask);
-
+
TypeNameMatchCollector collector = new TypeNameMatchCollector();
new SearchEngine().searchAllTypeNames(
null,
@@ -11451,7 +11451,7 @@ public void testBug293861b() throws CoreException {
collector,
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
null);
- assertSearchResults("No search results expected", "", collector);
+ assertSearchResults("No search results expected", "", collector);
} finally {
deleteProject("P");
}
@@ -11467,7 +11467,7 @@ public void testBug293861c() throws CoreException {
addClasspathEntry(project, JavaCore.newLibraryEntry(new Path("/JavaSearchBugs/lib/b293861.jar"), null, null));
int mask = IJavaSearchScope.APPLICATION_LIBRARIES | IJavaSearchScope.SOURCES | IJavaSearchScope.REFERENCED_PROJECTS;
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, mask);
-
+
TypeNameMatchCollector collector = new TypeNameMatchCollector();
new SearchEngine().searchAllTypeNames(
null,
@@ -11476,7 +11476,7 @@ public void testBug293861c() throws CoreException {
collector,
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
null);
- assertSearchResults("Unexpected search results!", "InEnumPackage (not open) [in InEnumPackage.class [in enum [in /JavaSearchBugs/lib/b293861.jar [in P]]]]", collector);
+ assertSearchResults("Unexpected search results!", "InEnumPackage (not open) [in InEnumPackage.class [in enum [in /JavaSearchBugs/lib/b293861.jar [in P]]]]", collector);
} finally {
deleteProject("P");
}
@@ -11500,7 +11500,7 @@ public void testBug296343() throws Exception {
// set the thread context class loader
Thread.currentThread().setContextClassLoader(tcl);
simulateRestart();
-
+
// get the indexing thread
class TestIndexRequest extends IndexRequest {
public Thread indexingThread = null;
@@ -11531,7 +11531,7 @@ public void testBug296343() throws Exception {
assertFalse(tir.indexingThread.getContextClassLoader() == tcl);
} finally {
Thread.currentThread().setContextClassLoader(cl);
- }
+ }
}
/**
@@ -11546,27 +11546,27 @@ public void testBug304841() throws Exception {
// ensure that the workspace auto-build is ON
preferences.setAutoBuilding(true);
getWorkspace().setDescription(preferences);
-
+
// create test case
IJavaProject project = createJavaProject("P");
createFolder("/P/p");
createFile(
"/P/p/Hello.java",
- "package p;\n" +
- "class One {\n" +
- "}\n" +
- "class Two {\n" +
+ "package p;\n" +
+ "class One {\n" +
+ "}\n" +
+ "class Two {\n" +
"}\n"
);
createFile(
"/P/p/Ref.java",
- "package p;\n" +
- "class Three {\n" +
- " Two two;\n" +
+ "package p;\n" +
+ "class Three {\n" +
+ " Two two;\n" +
"}\n"
);
waitUntilIndexesReady();
-
+
// perform search
final ICompilationUnit cu = getCompilationUnit("/P/p/Hello.java");
IType type = cu.getType("Two");
@@ -11595,7 +11595,7 @@ public void testBug304841b() throws Exception {
// ensure that the workspace auto-build is ON
preferences.setAutoBuilding(true);
getWorkspace().setDescription(preferences);
-
+
// perform search
IType type = getClassFile("/JavaSearchBugs/lib/Bug148380.class").getType();
SearchPattern pattern = SearchPattern.createPattern(type, REFERENCES);
@@ -11649,24 +11649,24 @@ public void testBug306196() throws Exception {
/**
* @bug 306223: [search] Searching for annotation references report all type references
- * @test Ensures the following -
+ * @test Ensures the following -
* 1. Search for annotation references does not report type references
* 2. Search for annotation references even report a non-annotation references to an annotation type
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=306223"
*/
public void testBug306223a() throws CoreException {
this.workingCopies = new ICompilationUnit[2];
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b306223/Test.java",
"import b306223.MyAnnot;\n"+
- "@MyAnnot\n" +
+ "@MyAnnot\n" +
"public class TestAnnot {\n" +
"MyAnnot annon;\n" +
"String test;\n" +
"void foo(String str) {\n" +
"this.test = str;\n" +
"}\n" +
- "}\n"
+ "}\n"
);
this.workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b306223/MyAnnot.java",
"@interface MyAnnot {}\n");
@@ -11681,27 +11681,27 @@ public void testBug306223a() throws CoreException {
this.resultCollector,
null);
assertSearchResults(
- "src/b306223/Test.java [b306223.MyAnnot] EXACT_MATCH\n" +
- "src/b306223/Test.java b306223.TestAnnot [MyAnnot] EXACT_MATCH\n" +
+ "src/b306223/Test.java [b306223.MyAnnot] EXACT_MATCH\n" +
+ "src/b306223/Test.java b306223.TestAnnot [MyAnnot] EXACT_MATCH\n" +
"src/b306223/Test.java b306223.TestAnnot.annon [MyAnnot] EXACT_MATCH"
);
}
/**
- * This ensures that using ANNOTATION_TYPE_REFERENCE as fine grain constant reports only
+ * This ensures that using ANNOTATION_TYPE_REFERENCE as fine grain constant reports only
* annotations and not any other references to an annotation type
*/
public void testBug306223b() throws CoreException {
this.workingCopies = new ICompilationUnit[2];
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b306223/Test.java",
"import b306223.MyAnnot;\n"+
- "@MyAnnot\n" +
+ "@MyAnnot\n" +
"public class TestAnnot {\n" +
"MyAnnot annon;\n" +
"String test;\n" +
"void foo(String str) {\n" +
"this.test = str;\n" +
"}\n" +
- "}\n"
+ "}\n"
);
this.workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b306223/MyAnnot.java",
"@interface MyAnnot {}\n");
@@ -11761,13 +11761,13 @@ public void testBug306223c() throws CoreException {
/**
* This test ensures that a reference search of ANNOTATION_TYPE should report POTENTIAL_MATCH
* for unknown references types.
- */
+ */
public void testBug306223d() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b306223/Test.java",
"public class TestAnnot {\n" +
"Zork annon;\n" +
- "}\n"
+ "}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
"*",
@@ -11780,7 +11780,7 @@ public void testBug306223d() throws CoreException {
this.resultCollector,
null);
assertSearchResults(
- "src/b306223/Test.java b306223.TestAnnot.annon [Zork] POTENTIAL_MATCH"
+ "src/b306223/Test.java b306223.TestAnnot.annon [Zork] POTENTIAL_MATCH"
);
}
/**
@@ -11792,7 +11792,7 @@ public void testBug306223e() throws CoreException {
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b306223/Test.java",
"public class Test {\n" +
" Zork x;\n" +
- "}\n"
+ "}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
"abc",
@@ -11815,7 +11815,7 @@ public void testBug306223f() throws CoreException {
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b306223/Test.java",
"public class Test {\n" +
" Zork x;\n" +
- "}\n"
+ "}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
"*",
@@ -11840,7 +11840,7 @@ public void testBug306223g() throws CoreException {
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b306223/Test.java",
"public class Test {\n" +
" Zork x;\n" +
- "}\n"
+ "}\n"
);
SearchPattern pattern = SearchPattern.createPattern(
"abc",
@@ -11867,7 +11867,7 @@ public void testBug310213() throws CoreException {
// ensure that the workspace auto-build is ON
preferences.setAutoBuilding(true);
getWorkspace().setDescription(preferences);
-
+
// create files
createFolder("/JavaSearchBugs/src/java/lang");
createFile("/JavaSearchBugs/src/java/lang/Throwable.java",
@@ -11881,14 +11881,14 @@ public void testBug310213() throws CoreException {
"}"
);
waitUntilIndexesReady();
-
+
// search
IType type = getCompilationUnit("/JavaSearchBugs/src/java/lang/Throwable.java").getType("Throwable");
search(type, REFERENCES);
assertSearchResults(
- "src/b310213/test/Test.java b310213.test.Test [Throwable] EXACT_MATCH\n" +
- ""+ getExternalJCLPathString("1.5") + " java.lang.Error EXACT_MATCH\n" +
- ""+ getExternalJCLPathString("1.5") + " java.lang.Exception EXACT_MATCH\n" +
+ "src/b310213/test/Test.java b310213.test.Test [Throwable] EXACT_MATCH\n" +
+ ""+ getExternalJCLPathString("1.5") + " java.lang.Error EXACT_MATCH\n" +
+ ""+ getExternalJCLPathString("1.5") + " java.lang.Exception EXACT_MATCH\n" +
""+ getExternalJCLPathString("1.5") + " void java.lang.Object.finalize() EXACT_MATCH"
);
}
@@ -11916,11 +11916,11 @@ public void testBug313668() throws CoreException {
// ensure that the workspace auto-build is ON
preferences.setAutoBuilding(true);
getWorkspace().setDescription(preferences);
-
+
// create the common project and create an interface
- commonProject = createJavaProject("common");
+ commonProject = createJavaProject("common");
createFolder("/common/com/db");
- createFile("/common/com/db/Repo.java",
+ createFile("/common/com/db/Repo.java",
"package com.db;\n" +
"public interface Repo {\n"+
"public void find();\n}");
@@ -11930,27 +11930,27 @@ public void testBug313668() throws CoreException {
IClasspathEntry entry = JavaCore.newProjectEntry(new Path("/common"));
addClasspathEntry(clientProject, entry);
createFolder("/client/com/db");
- createFile("/client/com/db/ClientRepo.java",
+ createFile("/client/com/db/ClientRepo.java",
"package com.db;\n" +
"public class ClientRepo implements Repo {\n"+
"public void find(){};\n}");
- createFile("/client/com/db/CallerClient.java",
+ createFile("/client/com/db/CallerClient.java",
"package com.db;\n" +
"public class CallerClient{\n"+
"public static void main(String[] args) {\n"+
"Repo r = null;\n"+
"r.find();}}\n");
-
+
// create the server project, create the class and the reference
serverProject = createJavaProject("server");
entry = JavaCore.newProjectEntry(new Path("/common"));
addClasspathEntry(serverProject, entry);
createFolder("/server/com/db");
- createFile("/server/com/db/ServerRepo.java",
+ createFile("/server/com/db/ServerRepo.java",
"package com.db;\n" +
"public class ServerRepo implements Repo{\n"+
"public void find(){};\n");
- createFile("/server/com/db/CallerServer.java",
+ createFile("/server/com/db/CallerServer.java",
"package com.db;\n" +
"public class CallerServer {\n"+
"public static void main(String[] args) {\n"+
@@ -11958,7 +11958,7 @@ public void testBug313668() throws CoreException {
"r.find();}}\n");
waitUntilIndexesReady();
-
+
// search
IType type = getCompilationUnit("/server/com/db/ServerRepo.java").getType("ServerRepo");
IMethod method = type.getMethod("find", new String[]{});
@@ -11991,7 +11991,7 @@ public void testBug317264a() throws CoreException {
addClasspathEntry(project, JavaCore.newLibraryEntry(new Path("/JavaSearchBugs/lib/b317264/org.apache.commons.lang_2.modified.jar"), null, null));
int mask = IJavaSearchScope.APPLICATION_LIBRARIES | IJavaSearchScope.SOURCES | IJavaSearchScope.REFERENCED_PROJECTS;
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, mask);
-
+
waitUntilIndexesReady();
TypeNameMatchCollector collector = new TypeNameMatchCollector();
new SearchEngine().searchAllTypeNames(
@@ -12004,7 +12004,7 @@ public void testBug317264a() throws CoreException {
collector,
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
null);
- assertSearchResults("Unexpected search results!", "", collector);
+ assertSearchResults("Unexpected search results!", "", collector);
} finally {
deleteProject(project);
}
@@ -12018,7 +12018,7 @@ public void testBug317264b() throws CoreException {
addClasspathEntry(project, JavaCore.newLibraryEntry(new Path("/JavaSearchBugs/lib/b317264/org.apache.commons.lang_2.modified.jar"), null, null));
int mask = IJavaSearchScope.APPLICATION_LIBRARIES | IJavaSearchScope.SOURCES | IJavaSearchScope.REFERENCED_PROJECTS;
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, mask);
-
+
waitUntilIndexesReady();
TypeNameMatchCollector collector = new TypeNameMatchCollector();
new SearchEngine().searchAllTypeNames(
@@ -12033,7 +12033,7 @@ public void testBug317264b() throws CoreException {
null);
assertSearchResults("Unexpected search results!",
"Enum (not open) [in Enum.class [in org.apache.commons.lang.enum [in /JavaSearchBugs/lib/b317264/org.apache.commons.lang_2.modified.jar [in P]]]]",
- collector);
+ collector);
} finally {
deleteProject(project);
}
@@ -12048,7 +12048,7 @@ public void testBug317264c() throws CoreException {
int mask = IJavaSearchScope.APPLICATION_LIBRARIES | IJavaSearchScope.SOURCES ;
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, mask);
search("org.apache.commons.lang.enum*", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, scope, this.resultCollector);
- assertSearchResults("Unexpected search results!", "", this.resultCollector);
+ assertSearchResults("Unexpected search results!", "", this.resultCollector);
} finally {
deleteProject("P");
}
@@ -12063,9 +12063,9 @@ public void testBug317264d() throws CoreException {
int mask = IJavaSearchScope.APPLICATION_LIBRARIES | IJavaSearchScope.SOURCES ;
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, mask);
search("org.apache.commons.lang.enum.*", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, scope, this.resultCollector);
- assertSearchResults("Unexpected search results!",
+ assertSearchResults("Unexpected search results!",
"lib/b317264/org.apache.commons.lang_2.modified.jar org.apache.commons.lang.enum.Enum EXACT_MATCH",
- this.resultCollector);
+ this.resultCollector);
} finally {
deleteProject("P");
}
@@ -12080,7 +12080,7 @@ public void testBug317264e() throws CoreException {
int mask = IJavaSearchScope.APPLICATION_LIBRARIES | IJavaSearchScope.SOURCES ;
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, mask);
search("org.apache.commons.lang.enum*", IJavaSearchConstants.PACKAGE, IJavaSearchConstants.DECLARATIONS, scope, this.resultCollector);
- assertSearchResults("Unexpected search results!", "", this.resultCollector);
+ assertSearchResults("Unexpected search results!", "", this.resultCollector);
} finally {
deleteProject("P");
}
@@ -12095,9 +12095,9 @@ public void testBug317264f() throws CoreException {
int mask = IJavaSearchScope.APPLICATION_LIBRARIES | IJavaSearchScope.SOURCES ;
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, mask);
search("org.apache.commons.lang.enum*", IJavaSearchConstants.PACKAGE, IJavaSearchConstants.DECLARATIONS, scope, this.resultCollector);
- assertSearchResults("Unexpected search results!",
+ assertSearchResults("Unexpected search results!",
"lib/b317264/org.apache.commons.lang_2.modified.jar org.apache.commons.lang.enum [No source] EXACT_MATCH",
- this.resultCollector);
+ this.resultCollector);
} finally {
deleteProject("P");
}
@@ -12112,7 +12112,7 @@ public void testBug322979a() throws CoreException {
try
{
IJavaProject project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "", "1.5");
- createFile("/P/Test.java",
+ createFile("/P/Test.java",
"public class Test extends Object implements Comparable<Object>{\n"+
"public int compareTo(Object o) {\n"+
"return 0;\n"+
@@ -12136,7 +12136,7 @@ public void testBug322979b() throws CoreException {
try
{
IJavaProject project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "", "1.5");
- createFile("/P/Test.java",
+ createFile("/P/Test.java",
"public class Test extends java.lang.Object implements Comparable<Object>{\n"+
"public int compareTo(Object o) {\n"+
"return 0;\n"+
@@ -12161,11 +12161,11 @@ public void testBug322979c() throws CoreException {
try
{
IJavaProject project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "", "1.5");
- createFile("/P/Test.java",
- "public class Test extends Object implements I01a<Object>, I01b<String>, I01c<Object> {\n" +
- "}\n" +
- "interface I01a<T> {}\n" +
- "interface I01b<T> {}\n" +
+ createFile("/P/Test.java",
+ "public class Test extends Object implements I01a<Object>, I01b<String>, I01c<Object> {\n" +
+ "}\n" +
+ "interface I01a<T> {}\n" +
+ "interface I01b<T> {}\n" +
"interface I01c<T> {}\n"
);
waitUntilIndexesReady();
@@ -12185,17 +12185,17 @@ public void testBug322979d() throws CoreException {
try
{
IJavaProject project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "", "1.5");
- createFile("/P/Test.java",
- "public class Test extends Object implements I01<\n" +
- " I02<\n" +
- " I03<Object,\n" +
- " I02<Object, I01<Object>>,\n" +
- " I03<Object, I01<Object>, I02<Object, I01<Object>>>\n" +
- " >,\n" +
- " I01<Object>>> {\n" +
- "}\n" +
- "interface I01<T> {}\n" +
- "interface I02<T, U> {}\n" +
+ createFile("/P/Test.java",
+ "public class Test extends Object implements I01<\n" +
+ " I02<\n" +
+ " I03<Object,\n" +
+ " I02<Object, I01<Object>>,\n" +
+ " I03<Object, I01<Object>, I02<Object, I01<Object>>>\n" +
+ " >,\n" +
+ " I01<Object>>> {\n" +
+ "}\n" +
+ "interface I01<T> {}\n" +
+ "interface I02<T, U> {}\n" +
"interface I03<T, U, V> {}\n"
);
waitUntilIndexesReady();
@@ -12215,17 +12215,17 @@ public void testBug322979e() throws CoreException {
try
{
IJavaProject project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "", "1.5");
- createFile("/P/Test.java",
- "public class Test extends Object implements I01<\n" +
- " I02<\n" +
- " I03<Object,\n" +
- " I02<Object, I01<Object>>,\n" +
- " I03<Object, I01<Object>, I02<Object, I01<Object>>>\n" +
- " >,\n" +
- " I01<Object>>> {\n" +
- "}\n" +
- "interface I01<T> {}\n" +
- "interface I02<T, U> {}\n" +
+ createFile("/P/Test.java",
+ "public class Test extends Object implements I01<\n" +
+ " I02<\n" +
+ " I03<Object,\n" +
+ " I02<Object, I01<Object>>,\n" +
+ " I03<Object, I01<Object>, I02<Object, I01<Object>>>\n" +
+ " >,\n" +
+ " I01<Object>>> {\n" +
+ "}\n" +
+ "interface I01<T> {}\n" +
+ "interface I02<T, U> {}\n" +
"interface I03<T, U, V> {}\n"
);
waitUntilIndexesReady();
@@ -12234,17 +12234,17 @@ public void testBug322979e() throws CoreException {
this.resultCollector.showSelection();
search("Object", TYPE, REFERENCES, scope);
assertSearchResults(
- "Test.java Test [public class Test extends !|Object|! implements I01<] EXACT_MATCH\n" +
- "Test.java Test [ I03<!|Object|!,] EXACT_MATCH\n" +
- "Test.java Test [ I02<!|Object|!, I01<Object>>,] EXACT_MATCH\n" +
- "Test.java Test [ I02<Object, I01<!|Object|!>>,] EXACT_MATCH\n" +
- "Test.java Test [ I03<!|Object|!, I01<Object>, I02<Object, I01<Object>>>] EXACT_MATCH\n" +
- "Test.java Test [ I03<Object, I01<!|Object|!>, I02<Object, I01<Object>>>] EXACT_MATCH\n" +
- "Test.java Test [ I03<Object, I01<Object>, I02<!|Object|!, I01<Object>>>] EXACT_MATCH\n" +
- "Test.java Test [ I03<Object, I01<Object>, I02<Object, I01<!|Object|!>>>] EXACT_MATCH\n" +
- "Test.java Test [ I01<!|Object|!>>> {] EXACT_MATCH\n" +
- ""+ getExternalJCLPathString("1.5") + " java.lang.Object java.lang.Object.clone() EXACT_MATCH\n" +
- ""+ getExternalJCLPathString("1.5") + " boolean java.lang.Object.equals(java.lang.Object) EXACT_MATCH\n" +
+ "Test.java Test [public class Test extends !|Object|! implements I01<] EXACT_MATCH\n" +
+ "Test.java Test [ I03<!|Object|!,] EXACT_MATCH\n" +
+ "Test.java Test [ I02<!|Object|!, I01<Object>>,] EXACT_MATCH\n" +
+ "Test.java Test [ I02<Object, I01<!|Object|!>>,] EXACT_MATCH\n" +
+ "Test.java Test [ I03<!|Object|!, I01<Object>, I02<Object, I01<Object>>>] EXACT_MATCH\n" +
+ "Test.java Test [ I03<Object, I01<!|Object|!>, I02<Object, I01<Object>>>] EXACT_MATCH\n" +
+ "Test.java Test [ I03<Object, I01<Object>, I02<!|Object|!, I01<Object>>>] EXACT_MATCH\n" +
+ "Test.java Test [ I03<Object, I01<Object>, I02<Object, I01<!|Object|!>>>] EXACT_MATCH\n" +
+ "Test.java Test [ I01<!|Object|!>>> {] EXACT_MATCH\n" +
+ ""+ getExternalJCLPathString("1.5") + " java.lang.Object java.lang.Object.clone() EXACT_MATCH\n" +
+ ""+ getExternalJCLPathString("1.5") + " boolean java.lang.Object.equals(java.lang.Object) EXACT_MATCH\n" +
""+ getExternalJCLPathString("1.5") + " java.lang.Class<? extends java.lang.Object> java.lang.Object.getClass() EXACT_MATCH"
);
} finally {
@@ -12256,17 +12256,17 @@ public void testBug322979f() throws CoreException {
try
{
IJavaProject project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "", "1.5");
- createFile("/P/Test.java",
- "public class Test extends Object implements I01<\n" +
- " I02<\n" +
- " I03<Object,\n" +
- " I02<Object, I01<Object>>,\n" +
- " I03<Object, I01<Object>, I02<Object, I01<Object>>>\n" +
- " >,\n" +
- " I01<Object>>> {\n" +
- "}\n" +
- "interface I01<T> {}\n" +
- "interface I02<T, U> {}\n" +
+ createFile("/P/Test.java",
+ "public class Test extends Object implements I01<\n" +
+ " I02<\n" +
+ " I03<Object,\n" +
+ " I02<Object, I01<Object>>,\n" +
+ " I03<Object, I01<Object>, I02<Object, I01<Object>>>\n" +
+ " >,\n" +
+ " I01<Object>>> {\n" +
+ "}\n" +
+ "interface I01<T> {}\n" +
+ "interface I02<T, U> {}\n" +
"interface I03<T, U, V> {}\n"
);
waitUntilIndexesReady();
@@ -12286,15 +12286,15 @@ public void testBug322979g() throws CoreException {
try
{
IJavaProject project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "", "1.5");
- createFile("/P/Test.java",
- "public class Test extends Object implements I<A<Object>.B<I<Object>>.C<I<A<Object>.B<Object>.C<Object>>>> {\n" +
- "}\n" +
- "interface I<T> {\n" +
- "}\n" +
- "class A<T> {\n" +
- " class B<U> {\n" +
- " class C<V> {}\n" +
- " }\n" +
+ createFile("/P/Test.java",
+ "public class Test extends Object implements I<A<Object>.B<I<Object>>.C<I<A<Object>.B<Object>.C<Object>>>> {\n" +
+ "}\n" +
+ "interface I<T> {\n" +
+ "}\n" +
+ "class A<T> {\n" +
+ " class B<U> {\n" +
+ " class C<V> {}\n" +
+ " }\n" +
"}\n"
);
waitUntilIndexesReady();
@@ -12313,7 +12313,7 @@ public void testBug322979h() throws CoreException {
try
{
IJavaProject project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "", "1.5");
- createFile("/P/Test.java",
+ createFile("/P/Test.java",
"public class Test extends Object implements I1<String>, I2<Object>{\n"+
"}\n"+
"Interface I1<T> {}\n"+
@@ -12335,7 +12335,7 @@ public void testBug322979h() throws CoreException {
EXACT_RULE);
search(SearchPattern.createOrPattern(leftPattern, rightPattern), scope, this.resultCollector);
assertSearchResults(
- "Test.java Test [public class Test extends !|Object|! implements I1<String>, I2<Object>{] EXACT_MATCH\n" +
+ "Test.java Test [public class Test extends !|Object|! implements I1<String>, I2<Object>{] EXACT_MATCH\n" +
"Test.java Test [public class Test extends Object implements I1<!|String|!>, I2<Object>{] EXACT_MATCH"
);
} finally {
@@ -12363,12 +12363,12 @@ public void testBug323514() throws Exception {
libPath);
IJavaProject javaProject = createJavaProject("P", new String[0], new String[] {libPath}, "");
waitUntilIndexesReady();
-
+
// Close the project
IProject project = javaProject.getProject();
project.close(null);
assertNotNull("External jar file index should not have been removed!!!", JavaModelManager.getIndexManager().getIndex(new Path(libPath), false, false));
-
+
// Reopen the project
project.open(null);
project.refreshLocal(IResource.DEPTH_INFINITE, null);
@@ -12406,7 +12406,7 @@ public void testBug323514a() throws Exception {
libPath);
IJavaProject javaProject = createJavaProject("P", new String[0], new String[] {libPath}, "");
waitUntilIndexesReady();
-
+
// Close project and delete external jar file
IProject project = javaProject.getProject();
waitUntilIndexesReady();
@@ -12428,7 +12428,7 @@ public void testBug323514a() throws Exception {
// in the workspace to see external files changes.
project.refreshLocal(IResource.DEPTH_INFINITE, null);
waitUntilIndexesReady();
-
+
// Search
TypeNameMatchCollector collector = new TypeNameMatchCollector();
new SearchEngine().searchAllTypeNames(
@@ -12463,7 +12463,7 @@ public void testBug323514b() throws Exception {
libPath);
IJavaProject javaProject = createJavaProject("P", new String[0], new String[] {libPath}, "");
waitUntilIndexesReady();
-
+
// Close project
IProject project = javaProject.getProject();
project.close(null);
@@ -12484,7 +12484,7 @@ public void testBug323514b() throws Exception {
// in the workspace to see external files changes.
project.refreshLocal(IResource.DEPTH_INFINITE, null);
waitUntilIndexesReady();
-
+
// Search
TypeNameMatchCollector collector = new TypeNameMatchCollector();
new SearchEngine().searchAllTypeNames(
@@ -12524,8 +12524,8 @@ public void testBug324109() throws CoreException {
/**
* @bug 329727 Invalid check in the isConstructor() method of the IMethod implementation.
* @test check that in a binary type, method's name doesn't contain the enclosing type name and
- * that IMethod#isContructor returns correct value
- *
+ * that IMethod#isContructor returns correct value
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=329727"
* @throws CoreException
* @throws IOException
@@ -12563,7 +12563,7 @@ public void testBug329727() throws CoreException, IOException {
throws CoreException {
assertTrue("Incorrect Element", match.getElement() instanceof IMethod);
assertTrue("Must be a constructor", ((IMethod) match.getElement()).isConstructor());
- assertEquals("Incorrect Constructor name", "InnerClass", ((IMethod)match.getElement()).getElementName());
+ assertEquals("Incorrect Constructor name", "InnerClass", ((IMethod)match.getElement()).getElementName());
}
};
@@ -12590,7 +12590,7 @@ public void testBug327654() throws CoreException {
addClasspathEntry(project, JavaCore.newLibraryEntry(new Path("/JavaSearchBugs/lib/b327654/commons-lang.jar"), null, null));
int mask = IJavaSearchScope.APPLICATION_LIBRARIES | IJavaSearchScope.SOURCES | IJavaSearchScope.REFERENCED_PROJECTS;
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, mask);
-
+
waitUntilIndexesReady();
TypeNameMatchCollector collector = new TypeNameMatchCollector();
new SearchEngine().searchAllTypeNames(
@@ -12603,14 +12603,14 @@ public void testBug327654() throws CoreException {
collector,
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
null);
- assertSearchResults("Unexpected search results!", "", collector);
+ assertSearchResults("Unexpected search results!", "", collector);
} finally {
deleteProject(project);
}
}
/**
* @bug 325418: [search] Search for method declarations returns spurious potential matches for anonymous classes
- * @test search of method declarations of binary anonymous classes using
+ * @test search of method declarations of binary anonymous classes using
* enclosing method's type variables should yield correct results.
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=325418"
*/
@@ -12621,13 +12621,13 @@ public void testBug325418a() throws Exception {
org.eclipse.jdt.core.tests.util.Util.createJar(new String[] {
"p325418/Test.java",
"package p325418;\n" +
- "public class Test{\n"+
- " public <T> T foo() {\n"+
- " return new Inner<T>() {T run() { return null; }}.run();\n"+
- " }\n"+
- "}\n"+
- "abstract class Inner <T> {\n"+
- " abstract T run();\n"+
+ "public class Test{\n"+
+ " public <T> T foo() {\n"+
+ " return new Inner<T>() {T run() { return null; }}.run();\n"+
+ " }\n"+
+ "}\n"+
+ "abstract class Inner <T> {\n"+
+ " abstract T run();\n"+
"}\n"
}, p.getProject().getLocation().append("lib325418.jar").toOSString(), "1.5");
refresh(p);
@@ -12635,10 +12635,10 @@ public void testBug325418a() throws Exception {
int mask = IJavaSearchScope.APPLICATION_LIBRARIES | IJavaSearchScope.SOURCES ;
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { p }, mask);
search("Inner.run()", IJavaSearchConstants.METHOD, IJavaSearchConstants.DECLARATIONS, scope, this.resultCollector);
- assertSearchResults("Unexpected search results!",
- "lib325418.jar T p325418.Inner.run() [No source] EXACT_MATCH\n" +
+ assertSearchResults("Unexpected search results!",
+ "lib325418.jar T p325418.Inner.run() [No source] EXACT_MATCH\n" +
"lib325418.jar T p325418.<anonymous>.run() [No source] EXACT_MATCH",
- this.resultCollector);
+ this.resultCollector);
} finally {
deleteProject("P");
}
@@ -12651,12 +12651,12 @@ public void testBug325418b() throws Exception {
org.eclipse.jdt.core.tests.util.Util.createJar(new String[] {
"p325418/Test.java",
"package p325418;\n" +
- "public class Test {\n" +
+ "public class Test {\n" +
" public <T> T foo() {\n" +
" class ExtendsInner extends Inner<T> {\n" +
" T run() { return null; } \n" +
" } \n" +
- " return null; \n" +
+ " return null; \n" +
" } \n" +
"} \n" +
"abstract class Inner <T> {\n" +
@@ -12668,10 +12668,10 @@ public void testBug325418b() throws Exception {
int mask = IJavaSearchScope.APPLICATION_LIBRARIES | IJavaSearchScope.SOURCES ;
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { p }, mask);
search("Inner.run", IJavaSearchConstants.METHOD, IJavaSearchConstants.DECLARATIONS, scope, this.resultCollector);
- assertSearchResults("Unexpected search results!",
- "lib325418.jar T p325418.Inner.run() [No source] EXACT_MATCH\n" +
+ assertSearchResults("Unexpected search results!",
+ "lib325418.jar T p325418.Inner.run() [No source] EXACT_MATCH\n" +
"lib325418.jar T p325418.ExtendsInner.run() [No source] EXACT_MATCH",
- this.resultCollector);
+ this.resultCollector);
} finally {
deleteProject("P");
}
@@ -12684,13 +12684,13 @@ public void testBug325418c() throws Exception {
org.eclipse.jdt.core.tests.util.Util.createJar(new String[] {
"p325418/Test.java",
"package p325418;\n" +
- "public class Test {\n" +
+ "public class Test {\n" +
" public <T> T foo() {\n" +
" class ExtendsInner<U> extends Inner<T, U> {\n" +
" T run() { return null; } \n" +
" T run(U obj) { return null; } \n" +
" } \n" +
- " return null; \n" +
+ " return null; \n" +
" } \n" +
"} \n" +
"abstract class Inner <T, U> {\n" +
@@ -12703,12 +12703,12 @@ public void testBug325418c() throws Exception {
int mask = IJavaSearchScope.APPLICATION_LIBRARIES | IJavaSearchScope.SOURCES ;
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { p }, mask);
search("Inner.run", IJavaSearchConstants.METHOD, IJavaSearchConstants.DECLARATIONS, scope, this.resultCollector);
- assertSearchResults("Unexpected search results!",
- "lib325418.jar T p325418.Inner.run() [No source] EXACT_MATCH\n" +
- "lib325418.jar T p325418.Inner.run(U) [No source] EXACT_MATCH\n" +
- "lib325418.jar T p325418.ExtendsInner.run() [No source] EXACT_MATCH\n" +
+ assertSearchResults("Unexpected search results!",
+ "lib325418.jar T p325418.Inner.run() [No source] EXACT_MATCH\n" +
+ "lib325418.jar T p325418.Inner.run(U) [No source] EXACT_MATCH\n" +
+ "lib325418.jar T p325418.ExtendsInner.run() [No source] EXACT_MATCH\n" +
"lib325418.jar T p325418.ExtendsInner.run(U) [No source] EXACT_MATCH",
- this.resultCollector);
+ this.resultCollector);
} finally {
deleteProject("P");
}
@@ -12740,10 +12740,10 @@ public void testBug325418d() throws Exception {
int mask = IJavaSearchScope.APPLICATION_LIBRARIES | IJavaSearchScope.SOURCES ;
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { p }, mask);
search("TwoLevelInner.run", IJavaSearchConstants.METHOD, IJavaSearchConstants.DECLARATIONS, scope, this.resultCollector);
- assertSearchResults("Unexpected search results!",
- "lib325418.jar T p325418.<anonymous>.run() [No source] EXACT_MATCH\n" +
+ assertSearchResults("Unexpected search results!",
+ "lib325418.jar T p325418.<anonymous>.run() [No source] EXACT_MATCH\n" +
"lib325418.jar T p325418.TwoLevelInner.run() [No source] EXACT_MATCH",
- this.resultCollector);
+ this.resultCollector);
} finally {
deleteProject("P");
}
@@ -12760,7 +12760,7 @@ public void testBug324189a() throws CoreException {
"package b324189;\n" +
"public class TestWorker{\n" +
" public void run() {}\n" +
- "class AWorker {\n" +
+ "class AWorker {\n" +
" public void run() {}\n" +
"}\n"+
"}\n"
@@ -12822,7 +12822,7 @@ public void testBug324189d() throws CoreException, IOException {
this.resultCollector.showSelection();
search("Worker.run()", METHOD, DECLARATIONS, scope);
assertSearchResults(
- getExternalPath() + "lib324189.jar void b324189.TestWorker$Worker.run() EXACT_MATCH\n" +
+ getExternalPath() + "lib324189.jar void b324189.TestWorker$Worker.run() EXACT_MATCH\n" +
getExternalPath() + "lib324189.jar void b324189.Worker.run() EXACT_MATCH"
);
} finally {
@@ -12854,11 +12854,11 @@ public void testBug336322a() throws CoreException{
try
{
IJavaProject project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "", "1.7");
- createFile("/P/Test.java",
+ createFile("/P/Test.java",
"public class Test {\n"+
"public void foo(Object o) {\n"+
" try {\n"+
- " }\n"+
+ " }\n"+
" catch(Exception|RuntimeException exc) {\n" +
" }\n"+
"}\n"+
@@ -12866,21 +12866,21 @@ public void testBug336322a() throws CoreException{
int mask = IJavaSearchScope.SOURCES ;
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, mask);
search("RuntimeException", IJavaSearchConstants.TYPE, IJavaSearchConstants.REFERENCES, scope, this.resultCollector);
- assertSearchResults("Unexpected search results!", "Test.java void Test.foo(Object) [RuntimeException] EXACT_MATCH", this.resultCollector);
+ assertSearchResults("Unexpected search results!", "Test.java void Test.foo(Object) [RuntimeException] EXACT_MATCH", this.resultCollector);
} finally {
deleteProject("P");
}
}
-// search for type in multiple catch parameters in catch clauses
+// search for type in multiple catch parameters in catch clauses
public void testBug336322b() throws CoreException{
try
{
IJavaProject project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "", "1.7");
- createFile("/P/Test.java",
+ createFile("/P/Test.java",
"public class Test {\n"+
"public void foo(Object o) {\n"+
" try {\n"+
- " }\n"+
+ " }\n"+
" catch(Exception|RuntimeException exc) {\n" +
" }\n"+
"}\n"+
@@ -12888,21 +12888,21 @@ public void testBug336322b() throws CoreException{
int mask = IJavaSearchScope.SOURCES ;
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, mask);
search("RuntimeException", IJavaSearchConstants.TYPE, CATCH_TYPE_REFERENCE, scope, this.resultCollector);
- assertSearchResults("Unexpected search results!", "Test.java void Test.foo(Object) [RuntimeException] EXACT_MATCH", this.resultCollector);
+ assertSearchResults("Unexpected search results!", "Test.java void Test.foo(Object) [RuntimeException] EXACT_MATCH", this.resultCollector);
} finally {
deleteProject("P");
}
}
-// search for the multi-catch variable should return the variable
+// search for the multi-catch variable should return the variable
public void testBug336322c() throws CoreException{
try
{
IJavaProject project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "", "1.7");
- createFile("/P/Test.java",
+ createFile("/P/Test.java",
"public class Test {\n"+
"public void foo(Object o) {\n"+
" try {\n"+
- " }\n"+
+ " }\n"+
" catch(Exception|RuntimeException exc) {\n" +
" exc.printStackTrace();\n"+
" }\n"+
@@ -12913,7 +12913,7 @@ public void testBug336322c() throws CoreException{
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, mask);
ILocalVariable variable = selectLocalVariable(type.getCompilationUnit(), "exc");
search(variable, READ_ACCESSES, scope, this.resultCollector);
- assertSearchResults("Unexpected search results!", "Test.java void Test.foo(Object) [exc] EXACT_MATCH", this.resultCollector);
+ assertSearchResults("Unexpected search results!", "Test.java void Test.foo(Object) [exc] EXACT_MATCH", this.resultCollector);
} finally {
deleteProject("P");
}
@@ -12950,7 +12950,7 @@ public void testBug341462() throws CoreException {
try
{
IJavaProject project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "", "1.7");
- createFile("/P/X.java",
+ createFile("/P/X.java",
"public class X<T> {\n" +
" T field1;\n" +
" public X(T param) {\n" +
@@ -12975,7 +12975,7 @@ public void testBug341462() throws CoreException {
IMethod method = type.getMethod("testFunction", new String[] { "QString;" });
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[]{project}, IJavaSearchScope.SOURCES);
search(method, REFERENCES, ERASURE_RULE, scope, this.resultCollector);
- assertSearchResults("Unexpected search results!", "X.java void X.main(String[]) [testFunction(new X<>(\"hello\").getField())] EXACT_MATCH", this.resultCollector);
+ assertSearchResults("Unexpected search results!", "X.java void X.main(String[]) [testFunction(new X<>(\"hello\").getField())] EXACT_MATCH", this.resultCollector);
} finally {
deleteProject("P");
}
@@ -12988,7 +12988,7 @@ public void testBug350885() throws CoreException {
// ensure that the workspace auto-build is ON
preferences.setAutoBuilding(true);
getWorkspace().setDescription(preferences);
-
+
IJavaProject project = createJavaProject("P");
createFile("/P/X.java",
"class Parent {" +
@@ -12999,7 +12999,7 @@ public void testBug350885() throws CoreException {
"}\n"+
"}\n");
waitUntilIndexesReady();
-
+
// search
IType type = getCompilationUnit("/P/X.java").getType("Child");
IMethod method = type.getMethods()[0];
@@ -13011,7 +13011,7 @@ public void testBug350885() throws CoreException {
// put back initial setup
preferences.setAutoBuilding(autoBuild);
getWorkspace().setDescription(preferences);
-
+
// delete the created project
deleteProject("P");
}
@@ -13023,22 +13023,22 @@ public void testBug349683() throws CoreException {
{
IJavaProject project = createJavaProject("P", new String[] {""}, new String[] {"JCL17_LIB"}, "", "1.7");
createFile("/P/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" +
- " Object x;\n" +
- " String s;\n" +
- " int i;\n" +
- " MethodType mt;\n" +
- " MethodHandle mh;\n" +
- " MethodHandles.Lookup lookup = MethodHandles.lookup();\n" +
- " // mt is (char,char)String\n" +
- " mt = MethodType.methodType(String.class, char.class, char.class);\n" +
- " mh = lookup.findVirtual(String.class, \"replace\", mt);\n" +
- " s = (String) mh.invokeExact(\"daddy\", 'd', 'n');\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" +
+ " Object x;\n" +
+ " String s;\n" +
+ " int i;\n" +
+ " MethodType mt;\n" +
+ " MethodHandle mh;\n" +
+ " MethodHandles.Lookup lookup = MethodHandles.lookup();\n" +
+ " // mt is (char,char)String\n" +
+ " mt = MethodType.methodType(String.class, char.class, char.class);\n" +
+ " mh = lookup.findVirtual(String.class, \"replace\", mt);\n" +
+ " s = (String) mh.invokeExact(\"daddy\", 'd', 'n');\n" +
" }\n" +
"}\n");
waitUntilIndexesReady();
@@ -13048,7 +13048,7 @@ public void testBug349683() throws CoreException {
this.resultCollector = new TestCollector();
this.resultCollector.showAccuracy(true);
search(method, REFERENCES, ERASURE_RULE, scope, this.resultCollector);
- assertSearchResults("Unexpected search results!", "X.java void X.main(String[]) [invokeExact(\"daddy\", \'d\', \'n\')] EXACT_MATCH", this.resultCollector);
+ assertSearchResults("Unexpected search results!", "X.java void X.main(String[]) [invokeExact(\"daddy\", \'d\', \'n\')] EXACT_MATCH", this.resultCollector);
} finally {
deleteProject("P");
}
@@ -13058,7 +13058,7 @@ public void testBug349683() throws CoreException {
public void testBug345807() throws CoreException {
try {
// Create a project depending on the jar
- IJavaProject p1 = createJavaProject("P1", new String[] {}, new String[] {"/P1/01b345807.jar"}, "");
+ IJavaProject p1 = createJavaProject("P1", new String[] {}, new String[] {"/P1/01b345807.jar"}, "");
createJar(new String[] {
"inlib/P345807Test.java",
"package inlib;\n" +
@@ -13066,13 +13066,13 @@ public void testBug345807() throws CoreException {
"}"
}, p1.getProject().getLocation().append("01b345807.jar").toOSString());
refresh(p1);
-
+
// Create another project with the same class name
createJavaProject("Project2", new String[] {""}, new String[] {}, "");
createFile("/Project2/P345807Test.java",
- "public class P345807Test {\n" +
+ "public class P345807Test {\n" +
"}\n");
-
+
waitUntilIndexesReady();
SearchTests.SearchTypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
new SearchEngine().searchAllTypeNames(
@@ -13099,26 +13099,26 @@ public void testBug355605() throws CoreException {
try {
createJavaProject("P");
- String fileContent =
- "public class X { \n"
+ String fileContent =
+ "public class X { \n"
+ "class R {\n"
- + " class S {\n"
+ + " class S {\n"
+ " void setInfo(String x) {\n"
- + " }\n"
+ + " }\n"
+ " }\n"
+ " class T {\n"
+ " }\n"
- + " T t = new T() {\n"
+ + " T t = new T() {\n"
+ " S s = new S() {\n"
+ " void myMethod() {\n"
- + " setInfo(\"a\");\n"
+ + " setInfo(\"a\");\n"
+ " }\n"
+ " };// S ends\n"
- + " };\n"
- + "}\n"
+ + " };\n"
+ + "}\n"
+ "}\n" ;
createFile("/P/X.java", fileContent);
-
+
waitUntilIndexesReady();
this.resultCollector = new TestCollector();
this.resultCollector.showAccuracy(true);
@@ -13127,7 +13127,7 @@ public void testBug355605() throws CoreException {
IJavaSearchScope hierarchyScope = SearchEngine.createHierarchyScope((IType)method.getParent());
search(method, IMPLEMENTORS, EXACT_RULE, hierarchyScope, this.resultCollector);
assertSearchResults("Unexpected search results!", "X.java void X$R.t:<anonymous>#1.s:<anonymous>#1.myMethod() [myMethod] EXACT_MATCH", this.resultCollector);
-
+
} finally {
deleteProject("P");
}
@@ -13155,14 +13155,14 @@ public void testBug241834() throws CoreException {
assertSearchResults("");
} finally {
deleteProject("P");
-
+
}
}
/**
* @bug 402902: [1.8][search] Search engine fails to annotation matches in extends/implements clauses
- * @test Ensures that the search for type use annotation finds matches
- * in extends and implements clauses.
- *
+ * @test Ensures that the search for type use annotation finds matches
+ * in extends and implements clauses.
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=402902"
*/
public void testBug400902a() throws CoreException {
@@ -13176,9 +13176,9 @@ public void testBug400902a() throws CoreException {
" int x = (@Marker int) 0;\n" +
" @Marker public class Y {}\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface Marker {}\n" +
- "@Target(ElementType.TYPE)\n" +
+ "@Target(ElementType.TYPE)\n" +
"@interface Marker1 {}"
);
SearchPattern pattern = SearchPattern.createPattern(
@@ -13196,14 +13196,14 @@ public void testBug400902a() throws CoreException {
"src/b400902/X.java b400902.X [Marker] EXACT_MATCH\n" +
"src/b400902/X.java b400902.X [Marker] EXACT_MATCH\n" +
"src/b400902/X.java b400902.X.x [Marker] EXACT_MATCH\n" +
- "src/b400902/X.java b400902.X$Y [Marker] EXACT_MATCH"
- );
+ "src/b400902/X.java b400902.X$Y [Marker] EXACT_MATCH"
+ );
}
/**
* @bug 400919: [1.8][search] Search engine fails to annotation matches in type variable bounds
* @test Ensures that the search for type use annotation finds matches in type variable bounds
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=400919"
*/
public void testBug400919a() throws CoreException {
@@ -13274,20 +13274,20 @@ public void testBug400919a() throws CoreException {
this.resultCollector,
null);
assertSearchResults(
- "src/b400919/X.java b400919.X.s [Existing] EXACT_MATCH\n" +
- "src/b400919/X.java b400919.X.s [Existing] EXACT_MATCH\n" +
- "src/b400919/X.java int b400919.X.x(T) [Existing] EXACT_MATCH\n" +
- "src/b400919/X.java int b400919.X.x(T) [Existing] EXACT_MATCH\n" +
- "src/b400919/X.java b400919.X$Folder [Existing] EXACT_MATCH\n" +
- "src/b400919/X.java b400919.X$Folder [Existing] EXACT_MATCH\n" +
- "src/b400919/X.java b400919.X$Test [Existing] EXACT_MATCH\n" +
+ "src/b400919/X.java b400919.X.s [Existing] EXACT_MATCH\n" +
+ "src/b400919/X.java b400919.X.s [Existing] EXACT_MATCH\n" +
+ "src/b400919/X.java int b400919.X.x(T) [Existing] EXACT_MATCH\n" +
+ "src/b400919/X.java int b400919.X.x(T) [Existing] EXACT_MATCH\n" +
+ "src/b400919/X.java b400919.X$Folder [Existing] EXACT_MATCH\n" +
+ "src/b400919/X.java b400919.X$Folder [Existing] EXACT_MATCH\n" +
+ "src/b400919/X.java b400919.X$Test [Existing] EXACT_MATCH\n" +
"src/b400919/X.java b400919.XY [Existing] EXACT_MATCH"
- );
+ );
}
/**
* @bug 400919: [1.8][search] Search engine fails to annotation matches in type variable bounds
* @test Ensures that the search for type use annotation finds matches in type variable bounds with TYPE
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=400919"
*/
public void testBug400919b() throws CoreException {
@@ -13358,20 +13358,20 @@ public void testBug400919b() throws CoreException {
this.resultCollector,
null);
assertSearchResults(
- "src/b400919/X.java b400919.X.s [Existing] EXACT_MATCH\n" +
- "src/b400919/X.java b400919.X.s [Existing] EXACT_MATCH\n" +
- "src/b400919/X.java int b400919.X.x(T) [Existing] EXACT_MATCH\n" +
- "src/b400919/X.java int b400919.X.x(T) [Existing] EXACT_MATCH\n" +
- "src/b400919/X.java b400919.X$Folder [Existing] EXACT_MATCH\n" +
- "src/b400919/X.java b400919.X$Folder [Existing] EXACT_MATCH\n" +
- "src/b400919/X.java b400919.X$Test [Existing] EXACT_MATCH\n" +
+ "src/b400919/X.java b400919.X.s [Existing] EXACT_MATCH\n" +
+ "src/b400919/X.java b400919.X.s [Existing] EXACT_MATCH\n" +
+ "src/b400919/X.java int b400919.X.x(T) [Existing] EXACT_MATCH\n" +
+ "src/b400919/X.java int b400919.X.x(T) [Existing] EXACT_MATCH\n" +
+ "src/b400919/X.java b400919.X$Folder [Existing] EXACT_MATCH\n" +
+ "src/b400919/X.java b400919.X$Folder [Existing] EXACT_MATCH\n" +
+ "src/b400919/X.java b400919.X$Test [Existing] EXACT_MATCH\n" +
"src/b400919/X.java b400919.XY [Existing] EXACT_MATCH"
- );
+ );
}
/**
* @bug 400919: [1.8][search] Search engine fails to annotation matches in type variable bounds
* @test Ensures that the search for type use annotation finds matches in type variable bounds
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=400919"
*/
public void testBug400919c() throws CoreException {
@@ -13449,8 +13449,8 @@ public void testBug400919c() throws CoreException {
"src/b400919/X.java b400919.X2 [Marker] EXACT_MATCH\n" +
"src/b400919/X.java b400919.X2 [Marker] EXACT_MATCH\n" +
"src/b400919/X.java b400919.X2 [Marker] EXACT_MATCH\n" +
- "src/b400919/X.java b400919.X2 [Marker] EXACT_MATCH"
- );
+ "src/b400919/X.java b400919.X2 [Marker] EXACT_MATCH"
+ );
}
/** @bug 431357
* [search] Search API got wrong result, when searching for method references, where the parameter is a member type of another type.
@@ -13595,7 +13595,7 @@ public void testBug431357_003() throws CoreException {
getJavaSearchWorkingCopiesScope(),
this.resultCollector,
null);
- assertSearchResults("src/X.java void I.query(Bar.InnerKey) [query] EXACT_MATCH\n" +
+ assertSearchResults("src/X.java void I.query(Bar.InnerKey) [query] EXACT_MATCH\n" +
"src/X.java void X.bar(I, Bar.InnerKey) [query(key)] EXACT_MATCH"
);
}
@@ -13652,7 +13652,7 @@ public void testBug431357_004() throws CoreException {
this.resultCollector,
null);
assertSearchResults(
- "src/X.java void I.query(Foo.Key) [query] EXACT_MATCH\n" +
+ "src/X.java void I.query(Foo.Key) [query] EXACT_MATCH\n" +
"src/X.java void Foo.foo(I, Key) [query(key)] EXACT_MATCH"
);
}
@@ -13709,7 +13709,7 @@ public void testBug431357_005() throws CoreException {
this.resultCollector,
null);
assertSearchResults(
- "src/X.java void I.query(Key) [query] EXACT_MATCH\n" +
+ "src/X.java void I.query(Key) [query] EXACT_MATCH\n" +
"src/X.java void Bar.bar(I, Key) [query(key)] EXACT_MATCH"
);
}
@@ -13772,7 +13772,7 @@ public void testBug431357_006() throws CoreException {
this.resultCollector,
null);
assertSearchResults(
- "src/X.java void I.query(Foo.Key) [query] EXACT_MATCH\n" +
+ "src/X.java void I.query(Foo.Key) [query] EXACT_MATCH\n" +
"src/X.java void Foo.foo(I, Key) [query(key)] EXACT_MATCH"
);
}
@@ -13835,7 +13835,7 @@ public void testBug431357_007() throws CoreException {
this.resultCollector,
null);
assertSearchResults(
- "src/X.java void I.query(Key) [query] EXACT_MATCH\n" +
+ "src/X.java void I.query(Key) [query] EXACT_MATCH\n" +
"src/X.java void X.bar(I, Key) [query(key)] EXACT_MATCH"
);
}
@@ -13899,7 +13899,7 @@ public void testBug431357_008() throws CoreException {
this.resultCollector,
null);
assertSearchResults(
- "src/X.java void I.query(Bar.Key) [query] EXACT_MATCH\n" +
+ "src/X.java void I.query(Bar.Key) [query] EXACT_MATCH\n" +
"src/X.java void Bar.bar(I, Key) [query(key)] EXACT_MATCH"
);
}
@@ -13929,7 +13929,7 @@ public void testBug431357_009() throws CoreException {
" i.query(fk, bk, \"\");\n" +
" }\n" +
"}\n" +
- "public class X {}\n"
+ "public class X {}\n"
);
String str = this.workingCopies[0].getSource();
@@ -14012,7 +14012,7 @@ public void testBug431357_011() throws CoreException {
" i.query(\"\", fk);\n" +
" }\n" +
"}\n" +
- "public class X {}\n"
+ "public class X {}\n"
);
String nonExistentPattern = "MyIF.query(String, Bar.InnerKey)";
@@ -14052,7 +14052,7 @@ public void testBug431357_012() throws CoreException {
" i.query(fk, bk, \"\");\n" +
" }\n" +
"}\n" +
- "public class X {}\n"
+ "public class X {}\n"
);
String str = this.workingCopies[0].getSource();
@@ -14068,7 +14068,7 @@ public void testBug431357_012() throws CoreException {
getJavaSearchWorkingCopiesScope(),
this.resultCollector,
null);
- assertSearchResults("src/X.java void MyIF.query(Foo.InnerKey, Bar.InnerKey, String) [query] EXACT_MATCH\n" +
+ assertSearchResults("src/X.java void MyIF.query(Foo.InnerKey, Bar.InnerKey, String) [query] EXACT_MATCH\n" +
"src/X.java void Bar.bar(MyIF, Foo.InnerKey, Bar.InnerKey) [query(fk, bk, \"\")] EXACT_MATCH"
);
}
@@ -14094,7 +14094,7 @@ public void testBug431357_013() throws CoreException {
"class Bar {\n" +
" static class InnerKey{}\n" +
"}\n" +
- "public class X {}\n"
+ "public class X {}\n"
);
String str = this.workingCopies[0].getSource();
@@ -14135,7 +14135,7 @@ public void testBug431357_014() throws CoreException {
"class Bar {\n" +
" static class InnerKey{}\n" +
"}\n" +
- "public class X {}\n"
+ "public class X {}\n"
);
String str = this.workingCopies[0].getSource();
@@ -14183,7 +14183,7 @@ public void testBug431357_015() throws CoreException {
createFolder(folder);
createFile(filename, contents);
waitUntilIndexesReady();
-
+
// search
IType[] types = getCompilationUnit(filename).getTypes();
IMethod method = types[0].getMethods()[0];
@@ -14240,7 +14240,7 @@ public void _testBug431357_016() throws CoreException {
createFolder(folder);
createFile(filename, contents);
waitUntilIndexesReady();
-
+
// search
IType[] types = getCompilationUnit(filename).getTypes();
IMethod method = types[0].getMethods()[1];
@@ -14284,7 +14284,7 @@ public void testBug460465_since_5() throws CoreException {
"}\n");
- IType type = this.workingCopies[0].getTypes()[0];
+ IType type = this.workingCopies[0].getTypes()[0];
TypeReferencePattern pattern = (TypeReferencePattern) SearchPattern.createPattern(type, REFERENCES, EXACT_RULE | ERASURE_RULE);
new SearchEngine(this.workingCopies).search(pattern,
@@ -14292,10 +14292,10 @@ public void testBug460465_since_5() throws CoreException {
getJavaSearchWorkingCopiesScope(),
this.resultCollector,
null);
- assertSearchResults(
- "src/test/ClassWithStaticImports.java [test.TestE] EXACT_MATCH\n" +
- "src/test/ClassWithStaticImports.java [test.TestE] EXACT_MATCH\n" +
- "src/test/ClassWithoutStaticImports.java test.ClassWithoutStaticImports() [TestE] EXACT_MATCH\n" +
+ assertSearchResults(
+ "src/test/ClassWithStaticImports.java [test.TestE] EXACT_MATCH\n" +
+ "src/test/ClassWithStaticImports.java [test.TestE] EXACT_MATCH\n" +
+ "src/test/ClassWithoutStaticImports.java test.ClassWithoutStaticImports() [TestE] EXACT_MATCH\n" +
"src/test/ClassWithoutStaticImports.java test.ClassWithoutStaticImports() [TestE] EXACT_MATCH");
}
public void testBug469320_0001() throws CoreException {
@@ -14307,7 +14307,7 @@ public void testBug469320_0001() throws CoreException {
this.createFile("/ProjectA/common.jar", f.getContents());
this.addLibraryEntry(ProjectA, "/ProjectA/common.jar", false);
createFolder("/ProjectA/test");
- createFile("/ProjectA/test/Validation.java",
+ createFile("/ProjectA/test/Validation.java",
"package test;\n"+
"public final class Validation {\n"+
" public static boolean validate(String traceTypeName, String fileName) {\n"+
@@ -14316,18 +14316,18 @@ public void testBug469320_0001() throws CoreException {
" return true;\n"+
" }\n"+
"}\n");
- createFile("/ProjectA/test/ValidationHelper.java",
+ createFile("/ProjectA/test/ValidationHelper.java",
"package test;\n"+
"public class ValidationHelper {\n"+
" public String validate(String path) {\n" +
- " return null;\n" +
+ " return null;\n" +
" }\n" +
"}\n");
ProjectB = createJavaProject("ProjectB", new String[] {""}, new String[] {"JCL15_LIB"}, "","1.5");
//this.createFile("/ProjectB/common.jar", f.getContents());
this.addLibraryEntry(ProjectB, "/ProjectA/common.jar", false);
createFolder("/ProjectB/testReferences");
- createFile("/ProjectB/testReferences/Main.java",
+ createFile("/ProjectB/testReferences/Main.java",
"package testReferences;\n" +
"import validator.*;\n" +
"public class Main {\n" +
@@ -14452,7 +14452,7 @@ public void testBug476738_002() throws CoreException {
this.resultCollector,
null);
assertSearchResults(
- "src/X.java void X.foo(I, Foo.InnerKey) [query(key)] EXACT_MATCH\n" +
+ "src/X.java void X.foo(I, Foo.InnerKey) [query(key)] EXACT_MATCH\n" +
"src/X.java void X.bar(I, Bar.InnerKey) [query(key)] EXACT_MATCH"
);
}
@@ -14476,9 +14476,9 @@ public void testBug478042_wScope_0001() throws Exception {
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(this.workingCopies);
searchAllMethodNames("foo", SearchPattern.R_PREFIX_MATCH, scope, requestor);
assertSearchResults(
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.foo01()\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.foo01()\n" +
"/JavaSearchBugs/src/p478042/AllMethodDeclarations01b.java Integer p478042.AllMethodDeclarations01b.fooInt()",
requestor
);
@@ -14503,9 +14503,9 @@ public void testBug478042_wScope_0002() throws Exception {
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(this.workingCopies);
searchAllMethodNames("foo", SearchPattern.R_PREFIX_MATCH, scope, requestor);
assertSearchResults(
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.foo01()\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.foo01()\n" +
"/JavaSearchBugs/src/p478042/AllMethodDeclarations01b.java Integer p478042.AllMethodDeclarations01b.fooInt()",
requestor
);
@@ -14530,9 +14530,9 @@ public void testBug478042_wScope_003() throws Exception {
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(this.workingCopies);
searchAllMethodNames("AllMethod", SearchPattern.R_PREFIX_MATCH, "foo", SearchPattern.R_PREFIX_MATCH, scope, requestor);
assertSearchResults(
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.foo01()\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.foo01()\n" +
"/JavaSearchBugs/src/p478042/AllMethodDeclarations01b.java Integer p478042.AllMethodDeclarations01b.fooInt()",
requestor
);
@@ -14547,7 +14547,7 @@ public void testBug478042_wScope_004() throws Exception {
" public char foo03(Object o, String s) {return null;}\n" +
"}\n"
);
-
+
this.workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/p478042/AllMethodDeclarations01b.java",
"package p478042;\n" +
"public class AllMethodDeclarations01b {\n" +
@@ -14560,12 +14560,12 @@ public void testBug478042_wScope_004() throws Exception {
"p478042", SearchPattern.R_EXACT_MATCH, //package
null, SearchPattern.R_EXACT_MATCH, // declaring Qualification
"AllMethod", SearchPattern.R_PREFIX_MATCH, // declaring SimpleType
- "foo", SearchPattern.R_PREFIX_MATCH,
+ "foo", SearchPattern.R_PREFIX_MATCH,
scope, requestor);
assertSearchResults(
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.foo01()\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.foo01()\n" +
"/JavaSearchBugs/src/p478042/AllMethodDeclarations01b.java Integer p478042.AllMethodDeclarations01b.fooInt()",
requestor
);
@@ -14580,7 +14580,7 @@ public void testBug478042_wScope_005() throws Exception {
" public char foo03(Object o, String s) {return null;}\n" +
"}\n"
);
-
+
this.workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/p478042/AllMethodDeclarations01b.java",
"package p478042;\n" +
"public class AllMethodDeclarations01b {\n" +
@@ -14598,12 +14598,12 @@ public void testBug478042_wScope_005() throws Exception {
"p478042", SearchPattern.R_EXACT_MATCH, //package
null, SearchPattern.R_EXACT_MATCH, // declaring Qualification
"AllMethod", SearchPattern.R_PREFIX_MATCH, // declaring SimpleType
- "foo", SearchPattern.R_PREFIX_MATCH,
+ "foo", SearchPattern.R_PREFIX_MATCH,
scope, collector);
assertSearchResults(
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.foo01()\n" +
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.foo01()\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
"/JavaSearchBugs/src/p478042/AllMethodDeclarations01b.java Integer p478042.AllMethodDeclarations01b.fooInt()",
collector
);
@@ -14618,7 +14618,7 @@ public void testBug478042_wScope_006() throws Exception {
" public char fooCamel03(Object o, String s) {return null;}\n" +
"}\n"
);
-
+
this.workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/p478042/AllMethodDeclarations01b.java",
"package p478042;\n" +
"public class AllMethodDeclarations01b {\n" +
@@ -14636,11 +14636,11 @@ public void testBug478042_wScope_006() throws Exception {
"p478042", SearchPattern.R_EXACT_MATCH, //package
null, SearchPattern.R_EXACT_MATCH, // declaring Qualification
"AllMethod", SearchPattern.R_PREFIX_MATCH, // declaring SimpleType
- "fooCC", SearchPattern.R_CAMELCASE_MATCH,
+ "fooCC", SearchPattern.R_CAMELCASE_MATCH,
scope, collector);
assertSearchResults(
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.fooCamelCase01()\n" +
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.fooCamelCase02(Object o)\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.fooCamelCase01()\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.fooCamelCase02(Object o)\n" +
"/JavaSearchBugs/src/p478042/AllMethodDeclarations01b.java Integer p478042.AllMethodDeclarations01b.fooCamelCaseInt()",
collector
);
@@ -14657,7 +14657,7 @@ public void testBug478042_wScope_007() throws Exception {
" public char fooCamel03(Object o, String s) {return null;}\n" +
"}\n"
);
-
+
this.workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/p478042/AllMethodDeclarations01b.java",
"package p478042;\n" +
"public class AllMethodDeclarations01b {\n" +
@@ -14675,11 +14675,11 @@ public void testBug478042_wScope_007() throws Exception {
"p478042", SearchPattern.R_EXACT_MATCH, //package
null, SearchPattern.R_EXACT_MATCH, // declaring Qualification
"AllMethod", SearchPattern.R_PREFIX_MATCH, // declaring SimpleType
- "fooCC", SearchPattern.R_CAMELCASE_MATCH,
+ "fooCC", SearchPattern.R_CAMELCASE_MATCH,
scope, collector);
assertSearchResults(
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java Y p478042.AllMethodDeclarations01.fooCamelCase01(Y t)\n" +
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.fooCamelCase02(Object o)\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java Y p478042.AllMethodDeclarations01.fooCamelCase01(Y t)\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.fooCamelCase02(Object o)\n" +
"/JavaSearchBugs/src/p478042/AllMethodDeclarations01b.java Integer p478042.AllMethodDeclarations01b.fooCamelCaseInt()",
collector
);
@@ -14698,7 +14698,7 @@ public void testBug478042_wScope_008() throws Exception {
"}\n" +
"}\n"
);
-
+
this.workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/p478042/AllMethodDeclarations01b.java",
"package p478042;\n" +
"public class AllMethodDeclarations01b {\n" +
@@ -14716,12 +14716,12 @@ public void testBug478042_wScope_008() throws Exception {
"p478042", SearchPattern.R_EXACT_MATCH, //package
"AllMethod", SearchPattern.R_PREFIX_MATCH, // declaring Qualification
"Inn", SearchPattern.R_PREFIX_MATCH, // declaring SimpleType
- "foo", SearchPattern.R_PREFIX_MATCH,
+ "foo", SearchPattern.R_PREFIX_MATCH,
scope, collector);
assertSearchResults(
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.Nested.Inner.foo01()\n" +
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.Nested.Inner.foo02(Object o)\n" +
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.Nested.Inner.foo03(Object o,String s)",
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.Nested.Inner.foo01()\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.Nested.Inner.foo02(Object o)\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.Nested.Inner.foo03(Object o,String s)",
collector
);
}
@@ -14734,7 +14734,7 @@ public void testBug483303_001() throws Exception {
" }\n" +
"}\n"
);
-
+
MethodNameMatchCollector collector = new MethodNameMatchCollector() {
@Override
public String toString() {
@@ -14746,10 +14746,10 @@ public void testBug483303_001() throws Exception {
null, SearchPattern.R_PREFIX_MATCH, //package
null, SearchPattern.R_PREFIX_MATCH, // declaring Qualification
null, SearchPattern.R_PREFIX_MATCH, // declaring SimpleType
- "m1", SearchPattern.R_PREFIX_MATCH,
+ "m1", SearchPattern.R_PREFIX_MATCH,
scope, collector);
assertSearchResults(
- "/JavaSearchBugs/src/com/test/C1.java void com.test.C1.m1(int i)",
+ "/JavaSearchBugs/src/com/test/C1.java void com.test.C1.m1(int i)",
collector
);
}
@@ -14762,12 +14762,12 @@ public void testBug483303_002() throws Exception {
" }\n" +
"}\n"
);
-
+
class Collector extends MethodNameMatchRequestor {
List<MethodNameMatch> matches = new ArrayList<>();
@Override
public void acceptMethodNameMatch(MethodNameMatch match) {
- this.matches.add(match);
+ this.matches.add(match);
}
}
Collector collector = new Collector();
@@ -14776,7 +14776,7 @@ public void testBug483303_002() throws Exception {
null, SearchPattern.R_PREFIX_MATCH, //package
null, SearchPattern.R_PREFIX_MATCH, // declaring Qualification
null, SearchPattern.R_PREFIX_MATCH, // declaring SimpleType
- "m1".toCharArray(), SearchPattern.R_PREFIX_MATCH,
+ "m1".toCharArray(), SearchPattern.R_PREFIX_MATCH,
scope, collector,
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, null);
assertTrue(collector.matches.size() == 1);
@@ -14812,9 +14812,9 @@ public void testBug483650_wScope_0001() throws Exception {
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(this.workingCopies);
searchAllMethodNames("p478042*.AllMethodDeclarations0*", SearchPattern.R_PATTERN_MATCH, "foo", SearchPattern.R_PREFIX_MATCH, scope, collector);
assertSearchResults(
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.foo01()\n" +
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.foo01()\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
"/JavaSearchBugs/src/p478042/AllMethodDeclarations01b.java Integer p478042.AllMethodDeclarations01b.fooInt()",
collector
);
@@ -14844,9 +14844,9 @@ public void testBug483650_wScope_0002() throws Exception {
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(this.workingCopies);
searchAllMethodNames("p478042*.AllMethodDeclarations0*", SearchPattern.R_PATTERN_MATCH, "foo", SearchPattern.R_PREFIX_MATCH, scope, collector);
assertSearchResults(
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.foo01()\n" +
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.foo01()\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
"/JavaSearchBugs/src/p478042/AllMethodDeclarations01b.java Integer p478042.AllMethodDeclarations01b.fooInt()",
collector
);
@@ -14876,9 +14876,9 @@ public void testBug483650_wScope_003() throws Exception {
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(this.workingCopies);
searchAllMethodNames("*AllMethod*", SearchPattern.R_PATTERN_MATCH, "foo", SearchPattern.R_PREFIX_MATCH, scope, collector);
assertSearchResults(
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.foo01()\n" +
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.foo01()\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
"/JavaSearchBugs/src/p478042/AllMethodDeclarations01b.java Integer p478042.AllMethodDeclarations01b.fooInt()",
collector
);
@@ -14893,7 +14893,7 @@ public void testBug483650_wScope_004() throws Exception {
" public char foo03(Object o, String s) {return null;}\n" +
"}\n"
);
-
+
this.workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/p478042/AllMethodDeclarations01b.java",
"package p478042;\n" +
"public class AllMethodDeclarations01b {\n" +
@@ -14909,12 +14909,12 @@ public void testBug483650_wScope_004() throws Exception {
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(this.workingCopies);
searchAllMethodNames(
"p478042.AllMethod*", SearchPattern.R_PATTERN_MATCH, //qualifier
- "foo", SearchPattern.R_PREFIX_MATCH,
+ "foo", SearchPattern.R_PREFIX_MATCH,
scope, collector);
assertSearchResults(
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.foo01()\n" +
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.foo01()\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
"/JavaSearchBugs/src/p478042/AllMethodDeclarations01b.java Integer p478042.AllMethodDeclarations01b.fooInt()",
collector
);
@@ -14929,7 +14929,7 @@ public void testBug483650_wScope_005() throws Exception {
" public char foo03(Object o, String s) {return null;}\n" +
"}\n"
);
-
+
this.workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/p478042/AllMethodDeclarations01b.java",
"package p478042;\n" +
"public class AllMethodDeclarations01b {\n" +
@@ -14945,12 +14945,12 @@ public void testBug483650_wScope_005() throws Exception {
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(this.workingCopies);
searchAllMethodNames(
"p478042.AllMethod*", SearchPattern.R_PATTERN_MATCH,
- "foo", SearchPattern.R_PREFIX_MATCH,
+ "foo", SearchPattern.R_PREFIX_MATCH,
scope, collector);
assertSearchResults(
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.foo01()\n" +
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.foo01()\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
"/JavaSearchBugs/src/p478042/AllMethodDeclarations01b.java Integer p478042.AllMethodDeclarations01b.fooInt()",
collector
);
@@ -14965,7 +14965,7 @@ public void testBug483650_wScope_006() throws Exception {
" public char fooCamel03(Object o, String s) {return null;}\n" +
"}\n"
);
-
+
this.workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/p478042/AllMethodDeclarations01b.java",
"package p478042;\n" +
"public class AllMethodDeclarations01b {\n" +
@@ -14980,12 +14980,12 @@ public void testBug483650_wScope_006() throws Exception {
};
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(this.workingCopies);
searchAllMethodNames(
- "p478042.AllMethod*", SearchPattern.R_PATTERN_MATCH,
- "fooCC", SearchPattern.R_CAMELCASE_MATCH,
+ "p478042.AllMethod*", SearchPattern.R_PATTERN_MATCH,
+ "fooCC", SearchPattern.R_CAMELCASE_MATCH,
scope, collector);
assertSearchResults(
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.fooCamelCase01()\n" +
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.fooCamelCase02(Object o)\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.fooCamelCase01()\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.fooCamelCase02(Object o)\n" +
"/JavaSearchBugs/src/p478042/AllMethodDeclarations01b.java Integer p478042.AllMethodDeclarations01b.fooCamelCaseInt()",
collector
);
@@ -15002,7 +15002,7 @@ public void testBug483650_wScope_007() throws Exception {
" public char fooCamel03(Object o, String s) {return null;}\n" +
"}\n"
);
-
+
this.workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/p478042/AllMethodDeclarations01b.java",
"package p478042;\n" +
"public class AllMethodDeclarations01b {\n" +
@@ -15018,11 +15018,11 @@ public void testBug483650_wScope_007() throws Exception {
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(this.workingCopies);
searchAllMethodNames(
"p478042.AllMethod*", SearchPattern.R_PATTERN_MATCH,
- "fooCC", SearchPattern.R_CAMELCASE_MATCH,
+ "fooCC", SearchPattern.R_CAMELCASE_MATCH,
scope, collector);
assertSearchResults(
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java Y p478042.AllMethodDeclarations01.fooCamelCase01(Y t)\n" +
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.fooCamelCase02(Object o)\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java Y p478042.AllMethodDeclarations01.fooCamelCase01(Y t)\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.fooCamelCase02(Object o)\n" +
"/JavaSearchBugs/src/p478042/AllMethodDeclarations01b.java Integer p478042.AllMethodDeclarations01b.fooCamelCaseInt()",
collector
);
@@ -15041,7 +15041,7 @@ public void testBug483650_wScope_008() throws Exception {
"}\n" +
"}\n"
);
-
+
this.workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/p478042/AllMethodDeclarations01b.java",
"package p478042;\n" +
"public class AllMethodDeclarations01b {\n" +
@@ -15057,12 +15057,12 @@ public void testBug483650_wScope_008() throws Exception {
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(this.workingCopies);
searchAllMethodNames(
"p478042.AllMethod*.Inn*", SearchPattern.R_PATTERN_MATCH,
- "foo", SearchPattern.R_PREFIX_MATCH,
+ "foo", SearchPattern.R_PREFIX_MATCH,
scope, collector);
assertSearchResults(
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.Nested.Inner.foo01()\n" +
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.Nested.Inner.foo02(Object o)\n" +
- "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.Nested.Inner.foo03(Object o,String s)",
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.Nested.Inner.foo01()\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.Nested.Inner.foo02(Object o)\n" +
+ "/JavaSearchBugs/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.Nested.Inner.foo03(Object o,String s)",
collector
);
}
@@ -15075,7 +15075,7 @@ public void testBug483650_009() throws Exception {
" }\n" +
"}\n"
);
-
+
MethodNameMatchCollector collector = new MethodNameMatchCollector() {
@Override
public String toString() {
@@ -15084,11 +15084,11 @@ public void testBug483650_009() throws Exception {
};
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(this.workingCopies);
searchAllMethodNames(
- null, SearchPattern.R_PREFIX_MATCH,
- "m1", SearchPattern.R_PREFIX_MATCH,
+ null, SearchPattern.R_PREFIX_MATCH,
+ "m1", SearchPattern.R_PREFIX_MATCH,
scope, collector);
assertSearchResults(
- "/JavaSearchBugs/src/com/test/C1.java void com.test.C1.m1(int i)",
+ "/JavaSearchBugs/src/com/test/C1.java void com.test.C1.m1(int i)",
collector
);
}
@@ -15101,19 +15101,19 @@ public void testBug483650_010() throws Exception {
" }\n" +
"}\n"
);
-
+
class Collector extends MethodNameMatchRequestor {
List<MethodNameMatch> matches = new ArrayList<>();
@Override
public void acceptMethodNameMatch(MethodNameMatch match) {
- this.matches.add(match);
+ this.matches.add(match);
}
}
Collector collector = new Collector();
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(this.workingCopies);
new SearchEngine(this.workingCopies).searchAllMethodNames(
null, SearchPattern.R_PREFIX_MATCH,
- "m1".toCharArray(), SearchPattern.R_PREFIX_MATCH,
+ "m1".toCharArray(), SearchPattern.R_PREFIX_MATCH,
scope, collector,
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, null);
assertTrue(collector.matches.size() == 1);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests2.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests2.java
index cc08ea50f..d9c801fff 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests2.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests2.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
@@ -78,7 +78,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
super(name);
this.endChar = "";
}
-
+
static {
//TESTS_NAMES = new String[] {"testBug378390"};
}
@@ -110,10 +110,10 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
IJavaProject p = createJavaProject("P", new String[] {}, new String[] { "/P/lib325418.jar", "JCL15_LIB" }, "", "1.5");
org.eclipse.jdt.core.tests.util.Util.createJar(new String[] {
"p325418M/Missing.java",
- "package p325418M;\n" +
- "public class Missing{}\n" },
+ "package p325418M;\n" +
+ "public class Missing{}\n" },
p.getProject().getLocation().append("lib325418M.jar").toOSString(), "1.5");
-
+
org.eclipse.jdt.core.tests.util.Util.createJar(
new String[] {
"p325418/Test.java",
@@ -144,7 +144,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
deleteProject("P");
}
}
-
+
/**
* @bug 123836: [1.5][search] for references to overriding method with bound type variable is not polymorphic
* @test Search for references to an overridden method with bound variables should yield.
@@ -154,8 +154,8 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
IJavaProject project = null;
try
{
- project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "","1.5");
- createFile("/P/Sub.java",
+ project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "","1.5");
+ createFile("/P/Sub.java",
"abstract class Sup<C> {\n" +
" protected void m(C classifier) {}\n"+
" public void use(C owner) { m (owner); }\n" +
@@ -178,8 +178,8 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
IJavaProject project = null;
try
{
- project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "","1.5");
- createFile("/P/Sub.java",
+ project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "","1.5");
+ createFile("/P/Sub.java",
"abstract class Sup<C> {\n" +
" protected void m(C classifier) {}\n"+
" public void use(C owner) { m (owner); }\n" +
@@ -194,7 +194,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
IMethod method = type.getMethod("m", new String[]{"QSub;"});
search(method, REFERENCES, EXACT_RULE, SearchEngine.createWorkspaceScope(), this.resultCollector);
assertSearchResults("");
-
+
} finally {
deleteProject(project);
}
@@ -205,8 +205,8 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
try
{
// create the common project and create an interface
- project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "","1.5");
- createFile("/P/Test.java",
+ project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "","1.5");
+ createFile("/P/Test.java",
"class Test {\n"+
" void calc(Property prop, Property<? extends Serializable> p2) {\n"+
" prop.compute(null);\n"+
@@ -223,7 +223,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
IType type = getCompilationUnit("/P/Test.java").getType("StringProperty");
IMethod method = type.getMethod("compute", new String[]{"QString;"});
search(method, REFERENCES, EXACT_RULE, SearchEngine.createWorkspaceScope(), this.resultCollector);
- assertSearchResults("Test.java void Test.calc(Property, Property<? extends Serializable>) [compute(null)] EXACT_MATCH\n" +
+ assertSearchResults("Test.java void Test.calc(Property, Property<? extends Serializable>) [compute(null)] EXACT_MATCH\n" +
"Test.java void Test.calc(Property, Property<? extends Serializable>) [compute(null)] EXACT_MATCH");
} finally {
deleteProject(project);
@@ -235,8 +235,8 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
try
{
// create the common project and create an interface
- project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "","1.5");
- createFile("/P/Test.java",
+ project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "","1.5");
+ createFile("/P/Test.java",
"class Test {\n"+
" void calc(Property prop, Property<? extends Serializable> p2) {\n"+
" prop.compute(null);\n"+
@@ -250,11 +250,11 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
"abstract class Property<E> {\n"+
" public abstract void compute(E e);\n"+
"}");
-
+
IType type = getCompilationUnit("/P/Test.java").getType("Test").getType("StringProperty");
IMethod method = type.getMethod("compute", new String[]{"QString;"});
search(method, REFERENCES, EXACT_RULE, SearchEngine.createWorkspaceScope(), this.resultCollector);
- assertSearchResults("Test.java void Test.calc(Property, Property<? extends Serializable>) [compute(null)] EXACT_MATCH\n" +
+ assertSearchResults("Test.java void Test.calc(Property, Property<? extends Serializable>) [compute(null)] EXACT_MATCH\n" +
"Test.java void Test.calc(Property, Property<? extends Serializable>) [compute(null)] EXACT_MATCH");
} finally {
deleteProject(project);
@@ -266,8 +266,8 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
try
{
// create the common project and create an interface
- project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "","1.5");
- createFile("/P/Test.java",
+ project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "","1.5");
+ createFile("/P/Test.java",
"class Test {\n"+
" void calc(Property prop, Property<? extends Serializable> p2) {\n"+
" prop.compute(null);\n"+
@@ -284,7 +284,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
"}");
IMethod method = selectMethod(getCompilationUnit("/P/Test.java"), "compute", 3);
search(method, REFERENCES, EXACT_RULE, SearchEngine.createWorkspaceScope(), this.resultCollector);
- assertSearchResults("Test.java void Test.calc(Property, Property<? extends Serializable>) [compute(null)] EXACT_MATCH\n" +
+ assertSearchResults("Test.java void Test.calc(Property, Property<? extends Serializable>) [compute(null)] EXACT_MATCH\n" +
"Test.java void Test.calc(Property, Property<? extends Serializable>) [compute(null)] EXACT_MATCH");
} finally {
deleteProject(project);
@@ -296,8 +296,8 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
try
{
// create the common project and create an interface
- project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "","1.5");
- createFile("/P/Test.java",
+ project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "","1.5");
+ createFile("/P/Test.java",
"class Test {\n"+
" void calc(Property prop, Property<? extends Serializable> p2) {\n"+
" prop.compute(null);\n"+
@@ -314,7 +314,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
"}");
IMethod method = selectMethod(getCompilationUnit("/P/Test.java"), "compute", 3);
search(method, REFERENCES, EXACT_RULE, SearchEngine.createWorkspaceScope(), this.resultCollector);
- assertSearchResults("Test.java void Test.calc(Property, Property<? extends Serializable>) [compute(null)] EXACT_MATCH\n" +
+ assertSearchResults("Test.java void Test.calc(Property, Property<? extends Serializable>) [compute(null)] EXACT_MATCH\n" +
"Test.java void Test.calc(Property, Property<? extends Serializable>) [compute(null)] EXACT_MATCH");
} finally {
deleteProject(project);
@@ -326,8 +326,8 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
try
{
// create the common project and create an interface
- project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "","1.5");
- createFile("/P/Test.java",
+ project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "","1.5");
+ createFile("/P/Test.java",
"class Test {\n"+
" {\n" +
" new Property<String>() {\n" +
@@ -344,7 +344,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
"}");
IMethod method = selectMethod(getCompilationUnit("/P/Test.java"), "compute", 1);
search(method, REFERENCES, EXACT_RULE, SearchEngine.createWorkspaceScope(), this.resultCollector);
- assertSearchResults("Test.java void Test.calc(Property, Property<? extends Serializable>) [compute(null)] EXACT_MATCH\n" +
+ assertSearchResults("Test.java void Test.calc(Property, Property<? extends Serializable>) [compute(null)] EXACT_MATCH\n" +
"Test.java void Test.calc(Property, Property<? extends Serializable>) [compute(null)] EXACT_MATCH");
} finally {
deleteProject(project);
@@ -356,8 +356,8 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
try
{
// create the common project and create an interface
- project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "","1.5");
- createFile("/P/Test.java",
+ project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "","1.5");
+ createFile("/P/Test.java",
"class Test {\n"+
" static {\n" +
" new Property<String>() {\n" +
@@ -374,7 +374,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
"}");
IMethod method = selectMethod(getCompilationUnit("/P/Test.java"), "compute", 1);
search(method, REFERENCES, EXACT_RULE, SearchEngine.createWorkspaceScope(), this.resultCollector);
- assertSearchResults("Test.java void Test.calc(Property, Property<? extends Serializable>) [compute(null)] EXACT_MATCH\n" +
+ assertSearchResults("Test.java void Test.calc(Property, Property<? extends Serializable>) [compute(null)] EXACT_MATCH\n" +
"Test.java void Test.calc(Property, Property<? extends Serializable>) [compute(null)] EXACT_MATCH");
} finally {
deleteProject(project);
@@ -386,8 +386,8 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
try
{
// create the common project and create an interface
- project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "","1.5");
- createFile("/P/Test.java",
+ project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "","1.5");
+ createFile("/P/Test.java",
"class Test {\n"+
" Property <?>p = new Property<String>() {\n" +
" @Override public void compute(String e) {}\n" +
@@ -402,7 +402,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
"}");
IMethod method = selectMethod(getCompilationUnit("/P/Test.java"), "compute", 1);
search(method, REFERENCES, EXACT_RULE, SearchEngine.createWorkspaceScope(), this.resultCollector);
- assertSearchResults("Test.java void Test.calc(Property, Property<? extends Serializable>) [compute(null)] EXACT_MATCH\n" +
+ assertSearchResults("Test.java void Test.calc(Property, Property<? extends Serializable>) [compute(null)] EXACT_MATCH\n" +
"Test.java void Test.calc(Property, Property<? extends Serializable>) [compute(null)] EXACT_MATCH");
} finally {
deleteProject(project);
@@ -413,8 +413,8 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
try
{
// create the common project and create an interface
- project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "","1.5");
- createFile("/P/Test.java",
+ project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "","1.5");
+ createFile("/P/Test.java",
"class Test {\n"+
" void calc(Property prop, Property<? extends Serializable> p2) {\n"+
" prop.compute(null);\n"+
@@ -437,7 +437,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
"}");
IMethod method = selectMethod(getCompilationUnit("/P/Test.java"), "compute", 6);
search(method, REFERENCES, EXACT_RULE, SearchEngine.createWorkspaceScope(), this.resultCollector);
- assertSearchResults("Test.java void Test.calc(Property, Property<? extends Serializable>) [compute(null)] EXACT_MATCH\n" +
+ assertSearchResults("Test.java void Test.calc(Property, Property<? extends Serializable>) [compute(null)] EXACT_MATCH\n" +
"Test.java void Test.calc(Property, Property<? extends Serializable>) [compute(null)] EXACT_MATCH");
} finally {
deleteProject(project);
@@ -449,8 +449,8 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
try
{
// create the common project and create an interface
- project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "","1.5");
- createFile("/P/Sub.java",
+ project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "","1.5");
+ createFile("/P/Sub.java",
"abstract class Sup<C> {\n" +
" protected void m(C classifier) {}\n"+
" public void use(C owner) { m (owner); }\n" +
@@ -465,7 +465,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
SearchPattern pattern = SearchPattern.createPattern("Sub.m(String)", METHOD, REFERENCES, EXACT_RULE);
search(pattern, SearchEngine.createWorkspaceScope(), this.resultCollector);
assertSearchResults("Sub.java void Sup.use(C) [m (owner)] EXACT_MATCH");
-
+
} finally {
deleteProject(project);
}
@@ -476,8 +476,8 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
try
{
// create the common project and create an interface
- project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "","1.5");
- createFile("/P/Sub.java",
+ project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "","1.5");
+ createFile("/P/Sub.java",
"abstract class Sup<C> {\n" +
" protected void m(C classifier) {}\n"+
" public void use(C owner) { m (owner); }\n" +
@@ -491,7 +491,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
SearchPattern pattern = SearchPattern.createPattern("Sub.m(Sub)", METHOD, REFERENCES, EXACT_RULE);
search(pattern, SearchEngine.createWorkspaceScope(), this.resultCollector);
assertSearchResults("");
-
+
} finally {
deleteProject(project);
}
@@ -682,16 +682,16 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
IJavaSearchScope scope = SearchEngine. createJavaSearchScope(
new IJavaElement[] { project }, IJavaSearchScope.SOURCES);
search("getSquare", METHOD, DECLARATIONS, EXACT_RULE, scope, this.resultCollector);
- assertSearchResults("b342393/Generic.java A b342393.Generic$A.ONE:<anonymous>#1.getSquare() [getSquare] EXACT_MATCH\n" +
- "b342393/Generic.java A b342393.Generic$A.TWO:<anonymous>#1.getSquare() [getSquare] EXACT_MATCH\n" +
+ assertSearchResults("b342393/Generic.java A b342393.Generic$A.ONE:<anonymous>#1.getSquare() [getSquare] EXACT_MATCH\n" +
+ "b342393/Generic.java A b342393.Generic$A.TWO:<anonymous>#1.getSquare() [getSquare] EXACT_MATCH\n" +
"b342393/Generic.java A b342393.Generic$A.getSquare() [getSquare] EXACT_MATCH");
} finally {
deleteProject("P");
}
}
-
+
/**
- * @bug 376673: DBCS4.2 Can not rename the class names when DBCS (Surrogate e.g. U+20B9F) is in it
+ * @bug 376673: DBCS4.2 Can not rename the class names when DBCS (Surrogate e.g. U+20B9F) is in it
* @test Search for DBCS type should report the match
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=376673"
*/
@@ -702,7 +702,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
return;
}
IJavaProject project = createJavaProject("P", new String[] {""}, new String[] {"JCL17_LIB"}, "bin", "1.7");
- String content = "package pkg;\n" +
+ String content = "package pkg;\n" +
"class \uD842\uDF9F1 {}\n";
createFolder("/P/pkg");
try {
@@ -727,7 +727,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
return;
}
IJavaProject project = createJavaProject("P", new String[] {""}, new String[] {"JCL17_LIB"}, "bin", "1.7");
- String content = "package pkg;\n" +
+ String content = "package pkg;\n" +
"class \uD842\uDF9F1 {" +
" public void \uD842\uDF9Fm() {}\n" +
"}\n";
@@ -754,7 +754,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
return;
}
IJavaProject project = createJavaProject("P", new String[] {""}, new String[] {"JCL17_LIB"}, "bin", "1.7");
- String content = "package pkg;\n" +
+ String content = "package pkg;\n" +
"class \uD842\uDF9F1 {" +
" public \uD842\uDF9F1() {}\n" +
"}\n";
@@ -781,7 +781,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
return;
}
IJavaProject project = createJavaProject("P", new String[] {""}, new String[] {"JCL17_LIB"}, "bin", "1.7");
- String content = "package pkg;\n" +
+ String content = "package pkg;\n" +
"class \uD842\uDF9F1 {" +
" public int \uD842\uDF9Ff;\n" +
"}\n";
@@ -814,7 +814,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
}
IJavaProject p = createJavaProject("P", new String[] {}, new String[] { "/P/lib376673.jar", "JCL17_LIB" }, "", "1.7");
IPath jarPath = p.getProject().getLocation().append("lib376673.jar");
-
+
org.eclipse.jdt.core.tests.util.Util.createJar(
new String[] {
"p\uD842\uDF9F/i\uD842\uDF9F/Test.java",
@@ -898,7 +898,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
deleteProject(project);
}
}
-
+
// search for the method name should also not return matches if not-overridden because of package-visible
public void testBug357547b() throws CoreException {
IJavaProject project = null;
@@ -934,8 +934,8 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
deleteProject(project);
}
}
-
- // search for the method name should return the match if same package
+
+ // search for the method name should return the match if same package
public void testBug357547c() throws CoreException {
IJavaProject project = null;
try
@@ -1015,10 +1015,10 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
project = createJavaProject("P", new String[] {""}, new String[] { "/P/lib357547.jar", "JCL15_LIB" }, "", "1.5");
org.eclipse.jdt.core.tests.util.Util.createJar(new String[] {
"p2/A.java",
- "package p2;\n" +
- "public class A{}\n" },
+ "package p2;\n" +
+ "public class A{}\n" },
project.getProject().getLocation().append("libStuff.jar").toOSString(), "1.5");
-
+
org.eclipse.jdt.core.tests.util.Util.createJar(
new String[] {
"p1/B.java",
@@ -1027,7 +1027,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
"public class B extends A {\n" +
"long k(){\n" +
"return 0;\n" +
- "}\n" +
+ "}\n" +
"}\n"},
null,
project.getProject().getLocation().append("lib357547.jar").toOSString(),
@@ -1063,10 +1063,10 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
project = createJavaProject("P", new String[] {""}, new String[] { "/P/lib357547.jar", "JCL15_LIB" }, "", "1.5");
org.eclipse.jdt.core.tests.util.Util.createJar(new String[] {
"p2/A.java",
- "package p2;\n" +
- "public class A{}\n" },
+ "package p2;\n" +
+ "public class A{}\n" },
project.getProject().getLocation().append("libStuff.jar").toOSString(), "1.5");
-
+
org.eclipse.jdt.core.tests.util.Util.createJar(
new String[] {
"p2/B.java",
@@ -1075,7 +1075,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
"public class B extends A {\n" +
"long k(){\n" +
"return 0;\n" +
- "}\n" +
+ "}\n" +
"}\n"},
null,
project.getProject().getLocation().append("lib357547.jar").toOSString(),
@@ -1169,8 +1169,8 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
"class B extends A {\n" +
"long k(){\n" +
"return 0;\n" +
- "}\n" +
- "}\n" +
+ "}\n" +
+ "}\n" +
"long k(){\n" +
"return 0;\n" +
"}\n" +
@@ -1338,7 +1338,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
IMethod method = selectMethod(unit, "addListener");
this.resultCollector.showRule();
search(method, REFERENCES, ERASURE_RULE, SearchEngine.createWorkspaceScope(), this.resultCollector);
- assertSearchResults("ClassB.java void ClassB.doSomething() [addListener()] EXACT_MATCH\n" +
+ assertSearchResults("ClassB.java void ClassB.doSomething() [addListener()] EXACT_MATCH\n" +
"ClassC.java void ClassC.doSomething() [addListener()] ERASURE_MATCH");
} finally {
deleteProject("P");
@@ -1675,7 +1675,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
}
public void testBug395348() throws CoreException {
try {
- IJavaProject project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "","1.5");
+ IJavaProject project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "","1.5");
createFile("/P/X.java",
"public class X {\n"+
" static void f() {\n" +
@@ -1691,7 +1691,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
"}\n" +
"class C2 {}\n"
);
- IMethod method = selectMethod(getCompilationUnit("/P/X.java"), "compare", 0);
+ IMethod method = selectMethod(getCompilationUnit("/P/X.java"), "compare", 0);
MethodPattern pattern = (MethodPattern) SearchPattern.createPattern(method, DECLARATIONS|IGNORE_DECLARING_TYPE|IGNORE_RETURN_TYPE, EQUIVALENT_RULE|EXACT_RULE);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, IJavaSearchScope.SOURCES);
search(pattern, scope, this.resultCollector);
@@ -1723,21 +1723,21 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
// this class contains the method we search for, possibleMatch #402
// (must be > 401 possibleMatches to trigger environment cleanup)
"p2/B.java",
- "package p2;\n" +
+ "package p2;\n" +
"public class B<T> {\n" +
" public int test(T t) {\n" +
" return 0;\n" +
" }\n" +
"}\n"
- },
+ },
p.getProject().getLocation().append("libStuff.jar").toOSString(), "1.5");
refresh(p);
-
+
createFolder("/P/src/pkg");
// 400 matches, which populate MatchLocator.unitScope
- // all 400 matches are processed in one go of MatchLocator.locateMatches(JavaProject, PossibleMatch[], int, int)
+ // all 400 matches are processed in one go of MatchLocator.locateMatches(JavaProject, PossibleMatch[], int, int)
// next round will call nameEnvironment.cleanup() but reuse MatchLocator.unitScope ==> BOOM
- for (int i = 0; i < 400; i++) {
+ for (int i = 0; i < 400; i++) {
createFile("/P/src/pkg/Bug"+i+".java",
"package pkg;\n"+
"public class Bug"+i+" {\n"+
@@ -1746,7 +1746,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
" }\n" +
"}");
}
-
+
waitUntilIndexesReady();
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { p },
IJavaSearchScope.SOURCES|IJavaSearchScope.SYSTEM_LIBRARIES|IJavaSearchScope.APPLICATION_LIBRARIES);
@@ -1801,8 +1801,8 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
search(field, REFERENCES, EXACT_RULE, SearchEngine.createWorkspaceScope(), this.resultCollector);
assertSearchResults(
- "src/com/test/Test2.java com.test.Test2.{} [fi] EXACT_MATCH\n" +
- "src/com/test/Test2.java FI com.test.Test2.fun1(FI) [fi] EXACT_MATCH\n" +
+ "src/com/test/Test2.java com.test.Test2.{} [fi] EXACT_MATCH\n" +
+ "src/com/test/Test2.java FI com.test.Test2.fun1(FI) [fi] EXACT_MATCH\n" +
"src/com/test/Test2.java FI com.test.Test2.fun1(FI) [fi] EXACT_MATCH");
} finally {
deleteProject("P");
@@ -1814,7 +1814,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
try {
jgit = createJavaProject("jgit", new String[] {""}, new String[] {"JCL15_LIB"}, "","1.5");
createFolder("/jgit/base");
- createFile("/jgit/base/AbstractPlotRenderer.java",
+ createFile("/jgit/base/AbstractPlotRenderer.java",
"package base;\n" +
"public abstract class AbstractPlotRenderer<TLane extends PlotLane, TColor> {\n"+
" protected abstract TColor laneColor(TLane myLane);\n"+
@@ -1825,24 +1825,24 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
" final TColor myColor = laneColor(myLane);\n"+
" }\n"+
"}\n");
- createFile("/jgit/base/PlotCommit.java",
+ createFile("/jgit/base/PlotCommit.java",
"package base;\n"+
"public class PlotCommit<L extends PlotLane> {\n"+
" public L getLane() {\n"+
" return null;\n"+
" }\n"+
"}");
- createFile("/jgit/base/PlotLane.java",
+ createFile("/jgit/base/PlotLane.java",
"package base;\n"+
"public class PlotLane {\n"+
"}");
egit = createJavaProject("egit", new String[] {""}, new String[] {"JCL15_LIB"}, "","1.5");
createFolder("/egit/bug");
- createFile("/egit/bug/SWTPlotLane.java",
+ createFile("/egit/bug/SWTPlotLane.java",
"package bug;\n" +
"import base.PlotLane;\n" +
"public class SWTPlotLane extends PlotLane {}");
- createFile("/egit/bug/SWTPlotRenderer.java",
+ createFile("/egit/bug/SWTPlotRenderer.java",
"package bug;\n" +
"import base.AbstractPlotRenderer;\n" +
"class SWTPlotRenderer extends AbstractPlotRenderer<SWTPlotLane, Integer> {\n" +
@@ -1852,7 +1852,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
" }\n" +
"}");
addClasspathEntry(egit, JavaCore.newProjectEntry(jgit.getPath()));
-
+
// search
IType type = getCompilationUnit("/egit/bug/SWTPlotRenderer.java").getType("SWTPlotRenderer");
IMethod method = type.getMethods()[0];
@@ -1904,9 +1904,9 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, IJavaSearchScope.APPLICATION_LIBRARIES | IJavaSearchScope.SOURCES);
search(method, REFERENCES, scope);
assertSearchResults(
- "lib469965.jar void f3.<anonymous>.goo() EXACT_MATCH\n" +
- "lib469965.jar void f3.<anonymous>.goo() EXACT_MATCH\n" +
- "lib469965.jar void f3.<anonymous>.goo() EXACT_MATCH\n" +
+ "lib469965.jar void f3.<anonymous>.goo() EXACT_MATCH\n" +
+ "lib469965.jar void f3.<anonymous>.goo() EXACT_MATCH\n" +
+ "lib469965.jar void f3.<anonymous>.goo() EXACT_MATCH\n" +
"lib469965.jar void f3.<anonymous>.goo() EXACT_MATCH");
} catch (IOException e) {
// TODO Auto-generated catch block
@@ -1934,11 +1934,11 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
" void goo() {\n" +
" final Y y = new Y();\n" +
" new X() {\n" +
- " void goo() {\n" +
+ " void goo() {\n" +
" new X() {\n" +
" void goo() { y.bar();}\n" +
" };\n" +
- " y.bar();\n" +
+ " y.bar();\n" +
" }\n" +
" };\n" +
" new X() {\n" +
@@ -1962,10 +1962,10 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, IJavaSearchScope.APPLICATION_LIBRARIES | IJavaSearchScope.SOURCES);
search(method, REFERENCES, scope);
assertSearchResults(
- "lib469965.jar void f3.<anonymous>.goo() EXACT_MATCH\n" +
- "lib469965.jar void f3.<anonymous>.goo() EXACT_MATCH\n" +
- "lib469965.jar void f3.<anonymous>.goo() EXACT_MATCH\n" +
- "lib469965.jar void f3.<anonymous>.goo() EXACT_MATCH\n" +
+ "lib469965.jar void f3.<anonymous>.goo() EXACT_MATCH\n" +
+ "lib469965.jar void f3.<anonymous>.goo() EXACT_MATCH\n" +
+ "lib469965.jar void f3.<anonymous>.goo() EXACT_MATCH\n" +
+ "lib469965.jar void f3.<anonymous>.goo() EXACT_MATCH\n" +
"lib469965.jar void f3.<anonymous>.goo() EXACT_MATCH");
} catch (IOException e) {
// TODO Auto-generated catch block
@@ -2006,7 +2006,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
p.getProject().getLocation().append("lib473921.jar").toOSString(),
"1.7");
refresh(p);
-
+
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { p });
class Collector extends TypeNameMatchRequestor {
List<TypeNameMatch> matches = new ArrayList<>();
@@ -2027,7 +2027,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
assertEquals(IAccessRule.K_ACCESSIBLE, collector.matches.get(0).getAccessibility());
assertEquals(IAccessRule.K_ACCESSIBLE, collector.matches.get(1).getAccessibility()); // bug 482309
assertEquals(IAccessRule.K_ACCESSIBLE, collector.matches.get(2).getAccessibility()); // bug 482309 (double-nested type)
-
+
collector = new Collector();
new SearchEngine().searchAllTypeNames(
null,
@@ -2051,14 +2051,14 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
// create the common project and create an interface
project = createJavaProject("P", new String[] {"src"}, new String[] {"JCL15_LIB"}, "bin","1.5");
createFolder("P/src/p478042");
- createFile("/P/src/p478042/AllMethodDeclarations01.java",
+ createFile("/P/src/p478042/AllMethodDeclarations01.java",
"package p478042;\n" +
"public class AllMethodDeclarations01 {\n" +
" public void foo01() {}\n" +
" public int foo02(Object o) {return null;}\n" +
" public char foo03(Object o, String s) {return null;}\n" +
" }");
- createFile("/P/src/p478042/AllMethodDeclarations01b.java",
+ createFile("/P/src/p478042/AllMethodDeclarations01b.java",
"package p478042;\n" +
"public class AllMethodDeclarations01b {\n" +
" public Integer fooInt() {return null;}\n" +
@@ -2067,9 +2067,9 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, IJavaSearchScope.SOURCES);
searchAllMethodNames("foo", SearchPattern.R_PREFIX_MATCH, scope, requestor);
assertSearchResults(
- "/P/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
- "/P/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
- "/P/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.foo01()\n" +
+ "/P/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
+ "/P/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
+ "/P/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.foo01()\n" +
"/P/src/p478042/AllMethodDeclarations01b.java Integer p478042.AllMethodDeclarations01b.fooInt()",
requestor
);
@@ -2084,14 +2084,14 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
// create the common project and create an interface
project = createJavaProject("P", new String[] {"src"}, new String[] {"JCL15_LIB"}, "bin","1.5");
createFolder("P/src/p478042");
- createFile("/P/src/p478042/AllMethodDeclarations01.java",
+ createFile("/P/src/p478042/AllMethodDeclarations01.java",
"package p478042;\n" +
"public class AllMethodDeclarations01 {\n" +
" public void foo01() {}\n" +
" public int foo02(Object o) {return null;}\n" +
" public char foo03(Object o, String s) {return null;}\n" +
" }");
- createFile("/P/src/p478042/AllMethodDeclarations01b.java",
+ createFile("/P/src/p478042/AllMethodDeclarations01b.java",
"package p478042;\n" +
"public class AllMethodDeclarations01b {\n" +
" public Integer fooInt() {return null;}\n" +
@@ -2100,9 +2100,9 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, IJavaSearchScope.SOURCES);
searchAllMethodNames("foo", SearchPattern.R_PREFIX_MATCH, scope, requestor);
assertSearchResults(
- "/P/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
- "/P/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
- "/P/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.foo01()\n" +
+ "/P/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
+ "/P/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
+ "/P/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.foo01()\n" +
"/P/src/p478042/AllMethodDeclarations01b.java Integer p478042.AllMethodDeclarations01b.fooInt()",
requestor
);
@@ -2115,7 +2115,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
try {
project = createJavaProject("P", new String[] {"src"}, new String[] {"JCL15_LIB"}, "bin","1.5");
createFolder("P/src/p478042");
- createFile("/P/src/p478042/AllMethodDeclarations01.java",
+ createFile("/P/src/p478042/AllMethodDeclarations01.java",
"package p478042;\n" +
"public class AllMethodDeclarations01 {\n" +
" public void foo() {}\n" +
@@ -2123,7 +2123,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
" public int foo02(Object o) {return null;}\n" +
" public char foo03(Object o, String s) {return null;}\n" +
" }");
- createFile("/P/src/p478042/AllMethodDeclarations01b.java",
+ createFile("/P/src/p478042/AllMethodDeclarations01b.java",
"package p478042;\n" +
"public class AllMethodDeclarations01b {\n" +
" public Integer fooInt() {return null;}\n" +
@@ -2132,7 +2132,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
List<MethodNameMatch> matches = new ArrayList<>();
@Override
public void acceptMethodNameMatch(MethodNameMatch match) {
- this.matches.add(match);
+ this.matches.add(match);
}
}
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, IJavaSearchScope.SOURCES);
@@ -2155,7 +2155,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
// create the common project and create an interface
project = createJavaProject("P", new String[] {"src"}, new String[] {"JCL15_LIB"}, "bin","1.5");
createFolder("P/src/p478042");
- createFile("/P/src/p478042/AllMethodDeclarations01.java",
+ createFile("/P/src/p478042/AllMethodDeclarations01.java",
"package p478042;\n" +
"class Y<T> {}\n" +
"class X<T> {}\n" +
@@ -2164,7 +2164,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
" public int foo02(Object o) {return null;}\n" +
" public char foo03(Object o, String s) {return null;}\n" +
"}");
- createFile("/P/src/p478042/AllMethodDeclarations01b.java",
+ createFile("/P/src/p478042/AllMethodDeclarations01b.java",
"package p478042;\n" +
"public class AllMethodDeclarations01b {\n" +
" public Integer fooInt() {return null;}\n" +
@@ -2173,9 +2173,9 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, IJavaSearchScope.SOURCES);
searchAllMethodNames("foo", SearchPattern.R_PREFIX_MATCH, scope, requestor);
assertSearchResults(
- "/P/src/p478042/AllMethodDeclarations01.java Y p478042.AllMethodDeclarations01.foo01(Y t)\n" +
- "/P/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
- "/P/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
+ "/P/src/p478042/AllMethodDeclarations01.java Y p478042.AllMethodDeclarations01.foo01(Y t)\n" +
+ "/P/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
+ "/P/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
"/P/src/p478042/AllMethodDeclarations01b.java Integer p478042.AllMethodDeclarations01b.fooInt()",
requestor
);
@@ -2205,14 +2205,14 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
new String[] { p.getProject().getLocation().append("lib478042.jar").toOSString() },
"1.5");
refresh(p);
-
+
MethodDeclarationsCollector requestor = new MethodDeclarationsCollector();
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { p }, IJavaSearchScope.SOURCES|IJavaSearchScope.APPLICATION_LIBRARIES);
searchAllMethodNames("foo", SearchPattern.R_PREFIX_MATCH, scope, requestor);
assertSearchResults(
- "/P/lib478042.jar|p478042/AllMethodDeclarations02.class char p478042.AllMethodDeclarations02.foo03(java.lang.Object o,java.lang.String s)\n" +
- "/P/lib478042.jar|p478042/AllMethodDeclarations02.class int p478042.AllMethodDeclarations02.foo02(java.lang.Object o)\n" +
- "/P/lib478042.jar|p478042/AllMethodDeclarations02.class p478042.Y p478042.AllMethodDeclarations02.foo01(p478042.Y t)\n" +
+ "/P/lib478042.jar|p478042/AllMethodDeclarations02.class char p478042.AllMethodDeclarations02.foo03(java.lang.Object o,java.lang.String s)\n" +
+ "/P/lib478042.jar|p478042/AllMethodDeclarations02.class int p478042.AllMethodDeclarations02.foo02(java.lang.Object o)\n" +
+ "/P/lib478042.jar|p478042/AllMethodDeclarations02.class p478042.Y p478042.AllMethodDeclarations02.foo01(p478042.Y t)\n" +
"/P/lib478042.jar|p478042/AllMethodDeclarations02b.class void p478042.AllMethodDeclarations02b.fooInt()",
requestor
);
@@ -2239,13 +2239,13 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
new String[] { p.getProject().getLocation().append("lib478042.jar").toOSString() },
"1.5");
refresh(p);
-
+
MethodDeclarationsCollector requestor = new MethodDeclarationsCollector();
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { p }, IJavaSearchScope.SOURCES|IJavaSearchScope.APPLICATION_LIBRARIES);
searchAllMethodNames("foo", SearchPattern.R_PREFIX_MATCH, scope, requestor);
assertSearchResults(
- "/P/lib478042.jar|p478042/AllMethodDeclarations01$Nested$Inner.class char p478042.Inner.foo03(java.lang.Object o,java.lang.String s)\n" +
- "/P/lib478042.jar|p478042/AllMethodDeclarations01$Nested$Inner.class int p478042.Inner.foo02(java.lang.Object o)\n" +
+ "/P/lib478042.jar|p478042/AllMethodDeclarations01$Nested$Inner.class char p478042.Inner.foo03(java.lang.Object o,java.lang.String s)\n" +
+ "/P/lib478042.jar|p478042/AllMethodDeclarations01$Nested$Inner.class int p478042.Inner.foo02(java.lang.Object o)\n" +
"/P/lib478042.jar|p478042/AllMethodDeclarations01$Nested$Inner.class void p478042.Inner.foo01()",
requestor
);
@@ -2272,15 +2272,15 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
new String[] { p.getProject().getLocation().append("lib478042.jar").toOSString() },
"1.5");
refresh(p);
-
+
MethodDeclarationsCollector requestor = new MethodDeclarationsCollector();
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { p }, IJavaSearchScope.SOURCES|IJavaSearchScope.APPLICATION_LIBRARIES);
searchAllMethodNames(
"Inner", SearchPattern.R_EXACT_MATCH,
"foo", SearchPattern.R_PREFIX_MATCH, scope, requestor);
assertSearchResults(
- "/P/lib478042.jar|p478042/AllMethodDeclarations01$Nested$Inner.class char p478042.Inner.foo03(java.lang.Object o,java.lang.String s)\n" +
- "/P/lib478042.jar|p478042/AllMethodDeclarations01$Nested$Inner.class int p478042.Inner.foo02(java.lang.Object o)\n" +
+ "/P/lib478042.jar|p478042/AllMethodDeclarations01$Nested$Inner.class char p478042.Inner.foo03(java.lang.Object o,java.lang.String s)\n" +
+ "/P/lib478042.jar|p478042/AllMethodDeclarations01$Nested$Inner.class int p478042.Inner.foo02(java.lang.Object o)\n" +
"/P/lib478042.jar|p478042/AllMethodDeclarations01$Nested$Inner.class void p478042.Inner.foo01()",
requestor
);
@@ -2295,7 +2295,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
// create the common project and create an interface
project = createJavaProject("P", new String[] {"src"}, new String[] {"JCL15_LIB"}, "bin","1.5");
createFolder("P/src/p478042");
- createFile("/P/src/p478042/AllMethodDeclarations01.java",
+ createFile("/P/src/p478042/AllMethodDeclarations01.java",
"package p478042;\n" +
"public class AllMethodDeclarations01 {\n" +
" public class Nested {\n" +
@@ -2310,8 +2310,8 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, IJavaSearchScope.SOURCES);
searchAllMethodNames("foo", SearchPattern.R_PREFIX_MATCH, scope, requestor);
assertSearchResults(
- "/P/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.Nested
- "/P/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.Nested
+ "/P/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.Nested
+ "/P/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.Nested
"/P/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.Nested
requestor
);
@@ -2326,7 +2326,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
try {
project = createJavaProject("P", new String[] {"src"}, new String[] {"JCL15_LIB"}, "bin","1.5");
createFolder("P/src/p478042");
- createFile("/P/src/p478042/AllMethodDeclarations01.java",
+ createFile("/P/src/p478042/AllMethodDeclarations01.java",
"package p478042;\n" +
"public class AllMethodDeclarations01 {\n" +
" public void m1(int i) {}\n" +
@@ -2334,7 +2334,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
" public int foo02(Object o) {return null;}\n" +
" public char foo03(Object o, String s) {return null;}\n" +
" }");
- createFile("/P/src/p478042/AllMethodDeclarations01b.java",
+ createFile("/P/src/p478042/AllMethodDeclarations01b.java",
"package p478042;\n" +
"public class AllMethodDeclarations01b {\n" +
" public Integer fooInt() {return null;}\n" +
@@ -2343,7 +2343,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
List<MethodNameMatch> matches = new ArrayList<>();
@Override
public void acceptMethodNameMatch(MethodNameMatch match) {
- this.matches.add(match);
+ this.matches.add(match);
}
}
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, IJavaSearchScope.SOURCES);
@@ -2368,14 +2368,14 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
// create the common project and create an interface
project = createJavaProject("P", new String[] {"src"}, new String[] {"JCL15_LIB"}, "bin","1.5");
createFolder("P/src/p478042");
- createFile("/P/src/p478042/AllMethodDeclarations01.java",
+ createFile("/P/src/p478042/AllMethodDeclarations01.java",
"package p478042;\n" +
"public class AllMethodDeclarations01 {\n" +
" public void foo01() {}\n" +
" public int foo02(Object o) {return null;}\n" +
" public char foo03(Object o, String s) {return null;}\n" +
" }");
- createFile("/P/src/p478042/AllMethodDeclarations01b.java",
+ createFile("/P/src/p478042/AllMethodDeclarations01b.java",
"package p478042;\n" +
"public class AllMethodDeclarations01b {\n" +
" public Integer fooInt() {return null;}\n" +
@@ -2389,9 +2389,9 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, IJavaSearchScope.SOURCES);
searchAllMethodNames("*", SearchPattern.R_PATTERN_MATCH, "foo", SearchPattern.R_PREFIX_MATCH, scope, collector);
assertSearchResults(
- "/P/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.foo01()\n" +
- "/P/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
- "/P/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
+ "/P/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.foo01()\n" +
+ "/P/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
+ "/P/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
"/P/src/p478042/AllMethodDeclarations01b.java Integer p478042.AllMethodDeclarations01b.fooInt()",
collector
);
@@ -2406,14 +2406,14 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
// create the common project and create an interface
project = createJavaProject("P", new String[] {"src"}, new String[] {"JCL15_LIB"}, "bin","1.5");
createFolder("P/src/p478042");
- createFile("/P/src/p478042/AllMethodDeclarations01.java",
+ createFile("/P/src/p478042/AllMethodDeclarations01.java",
"package p478042;\n" +
"public class AllMethodDeclarations01 {\n" +
" public void foo01() {}\n" +
" public int foo02(Object o) {return null;}\n" +
" public char foo03(Object o, String s) {return null;}\n" +
" }");
- createFile("/P/src/p478042/AllMethodDeclarations01b.java",
+ createFile("/P/src/p478042/AllMethodDeclarations01b.java",
"package p478042;\n" +
"public class AllMethodDeclarations01b {\n" +
" public Integer fooInt() {return null;}\n" +
@@ -2427,9 +2427,9 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, IJavaSearchScope.SOURCES);
searchAllMethodNames("*", SearchPattern.R_PATTERN_MATCH, "foo", SearchPattern.R_PREFIX_MATCH, scope, collector);
assertSearchResults(
- "/P/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.foo01()\n" +
- "/P/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
- "/P/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
+ "/P/src/p478042/AllMethodDeclarations01.java void p478042.AllMethodDeclarations01.foo01()\n" +
+ "/P/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
+ "/P/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
"/P/src/p478042/AllMethodDeclarations01b.java Integer p478042.AllMethodDeclarations01b.fooInt()",
collector
);
@@ -2442,7 +2442,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
try {
project = createJavaProject("P", new String[] {"src"}, new String[] {"JCL15_LIB"}, "bin","1.5");
createFolder("P/src/p478042");
- createFile("/P/src/p478042/AllMethodDeclarations01.java",
+ createFile("/P/src/p478042/AllMethodDeclarations01.java",
"package p478042;\n" +
"public class AllMethodDeclarations01 {\n" +
" public void foo() {}\n" +
@@ -2450,7 +2450,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
" public int foo02(Object o) {return null;}\n" +
" public char foo03(Object o, String s) {return null;}\n" +
" }");
- createFile("/P/src/p478042/AllMethodDeclarations01b.java",
+ createFile("/P/src/p478042/AllMethodDeclarations01b.java",
"package p478042;\n" +
"public class AllMethodDeclarations01b {\n" +
" public Integer fooInt() {return null;}\n" +
@@ -2459,7 +2459,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
List<MethodNameMatch> matches = new ArrayList<>();
@Override
public void acceptMethodNameMatch(MethodNameMatch match) {
- this.matches.add(match);
+ this.matches.add(match);
}
}
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, IJavaSearchScope.SOURCES);
@@ -2480,7 +2480,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
// create the common project and create an interface
project = createJavaProject("P", new String[] {"src"}, new String[] {"JCL15_LIB"}, "bin","1.5");
createFolder("P/src/p478042");
- createFile("/P/src/p478042/AllMethodDeclarations01.java",
+ createFile("/P/src/p478042/AllMethodDeclarations01.java",
"package p478042;\n" +
"class Y<T> {}\n" +
"class X<T> {}\n" +
@@ -2489,7 +2489,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
" public int foo02(Object o) {return null;}\n" +
" public char foo03(Object o, String s) {return null;}\n" +
"}");
- createFile("/P/src/p478042/AllMethodDeclarations01b.java",
+ createFile("/P/src/p478042/AllMethodDeclarations01b.java",
"package p478042;\n" +
"public class AllMethodDeclarations01b {\n" +
" public Integer fooInt() {return null;}\n" +
@@ -2503,9 +2503,9 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, IJavaSearchScope.SOURCES);
searchAllMethodNames("*", SearchPattern.R_PATTERN_MATCH, "foo", SearchPattern.R_PREFIX_MATCH, scope, collector);
assertSearchResults(
- "/P/src/p478042/AllMethodDeclarations01.java Y p478042.AllMethodDeclarations01.foo01(Y t)\n" +
- "/P/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
- "/P/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
+ "/P/src/p478042/AllMethodDeclarations01.java Y p478042.AllMethodDeclarations01.foo01(Y t)\n" +
+ "/P/src/p478042/AllMethodDeclarations01.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
+ "/P/src/p478042/AllMethodDeclarations01.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
"/P/src/p478042/AllMethodDeclarations01b.java Integer p478042.AllMethodDeclarations01b.fooInt()",
collector
);
@@ -2535,7 +2535,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
new String[] { p.getProject().getLocation().append("lib478042.jar").toOSString() },
"1.5");
refresh(p);
-
+
MethodNameMatchCollector collector = new MethodNameMatchCollector() {
@Override
public String toString() {
@@ -2545,9 +2545,9 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { p }, IJavaSearchScope.SOURCES|IJavaSearchScope.APPLICATION_LIBRARIES);
searchAllMethodNames("*", SearchPattern.R_PATTERN_MATCH, "foo", SearchPattern.R_PREFIX_MATCH, scope, collector);
assertSearchResults(
- "/P/lib478042.jar p478042.Y p478042.AllMethodDeclarations02.foo01(p478042.Y t)\n" +
- "/P/lib478042.jar void p478042.AllMethodDeclarations02b.fooInt()\n" +
- "/P/lib478042.jar int p478042.AllMethodDeclarations02.foo02(java.lang.Object o)\n" +
+ "/P/lib478042.jar p478042.Y p478042.AllMethodDeclarations02.foo01(p478042.Y t)\n" +
+ "/P/lib478042.jar void p478042.AllMethodDeclarations02b.fooInt()\n" +
+ "/P/lib478042.jar int p478042.AllMethodDeclarations02.foo02(java.lang.Object o)\n" +
"/P/lib478042.jar char p478042.AllMethodDeclarations02.foo03(java.lang.Object o,java.lang.String s)",
collector
);
@@ -2574,7 +2574,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
new String[] { p.getProject().getLocation().append("lib478042.jar").toOSString() },
"1.5");
refresh(p);
-
+
MethodNameMatchCollector collector = new MethodNameMatchCollector() {
@Override
public String toString() {
@@ -2584,8 +2584,8 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { p }, IJavaSearchScope.SOURCES|IJavaSearchScope.APPLICATION_LIBRARIES);
searchAllMethodNames("*", SearchPattern.R_PATTERN_MATCH, "foo", SearchPattern.R_PREFIX_MATCH, scope, collector);
assertSearchResults(
- "/P/lib478042.jar void p478042.AllMethodDeclarations01.Nested.Inner.foo01()\n" +
- "/P/lib478042.jar int p478042.AllMethodDeclarations01.Nested.Inner.foo02(java.lang.Object o)\n" +
+ "/P/lib478042.jar void p478042.AllMethodDeclarations01.Nested.Inner.foo01()\n" +
+ "/P/lib478042.jar int p478042.AllMethodDeclarations01.Nested.Inner.foo02(java.lang.Object o)\n" +
"/P/lib478042.jar char p478042.AllMethodDeclarations01.Nested.Inner.foo03(java.lang.Object o,java.lang.String s)",
collector
);
@@ -2612,7 +2612,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
new String[] { p.getProject().getLocation().append("lib478042.jar").toOSString() },
"1.5");
refresh(p);
-
+
MethodNameMatchCollector collector = new MethodNameMatchCollector() {
@Override
public String toString() {
@@ -2624,8 +2624,8 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
"*Inner", SearchPattern.R_PATTERN_MATCH,
"foo", SearchPattern.R_PREFIX_MATCH, scope, collector);
assertSearchResults(
- "/P/lib478042.jar void p478042.AllMethodDeclarations01.Nested.Inner.foo01()\n" +
- "/P/lib478042.jar int p478042.AllMethodDeclarations01.Nested.Inner.foo02(java.lang.Object o)\n" +
+ "/P/lib478042.jar void p478042.AllMethodDeclarations01.Nested.Inner.foo01()\n" +
+ "/P/lib478042.jar int p478042.AllMethodDeclarations01.Nested.Inner.foo02(java.lang.Object o)\n" +
"/P/lib478042.jar char p478042.AllMethodDeclarations01.Nested.Inner.foo03(java.lang.Object o,java.lang.String s)",
collector
);
@@ -2640,7 +2640,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
// create the common project and create an interface
project = createJavaProject("P", new String[] {"src"}, new String[] {"JCL15_LIB"}, "bin","1.5");
createFolder("P/src/p478042");
- createFile("/P/src/p478042/AllMethodDeclarations01.java",
+ createFile("/P/src/p478042/AllMethodDeclarations01.java",
"package p478042;\n" +
"public class AllMethodDeclarations01 {\n" +
" public class Nested {\n" +
@@ -2671,7 +2671,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
try {
project = createJavaProject("P", new String[] {"src"}, new String[] {"JCL15_LIB"}, "bin","1.5");
createFolder("P/src/p478042");
- createFile("/P/src/p478042/AllMethodDeclarations01.java",
+ createFile("/P/src/p478042/AllMethodDeclarations01.java",
"package p478042;\n" +
"public class AllMethodDeclarations01 {\n" +
" public void m1(int i) {}\n" +
@@ -2679,7 +2679,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
" public int foo02(Object o) {return null;}\n" +
" public char foo03(Object o, String s) {return null;}\n" +
" }");
- createFile("/P/src/p478042/AllMethodDeclarations01b.java",
+ createFile("/P/src/p478042/AllMethodDeclarations01b.java",
"package p478042;\n" +
"public class AllMethodDeclarations01b {\n" +
" public Integer fooInt() {return null;}\n" +
@@ -2688,7 +2688,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
List<MethodNameMatch> matches = new ArrayList<>();
@Override
public void acceptMethodNameMatch(MethodNameMatch match) {
- this.matches.add(match);
+ this.matches.add(match);
}
}
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, IJavaSearchScope.SOURCES);
@@ -2709,10 +2709,10 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
IJavaProject p = createJavaProject("P", new String[] { "src" }, new String[] { "/P/p1p2.jar", "JCL15_LIB" }, "bin", "1.5");
org.eclipse.jdt.core.tests.util.Util.createJar(new String[] {
"p1/MissingClass.java",
- "package p1;\n" +
- "public class MissingClass{}\n" },
+ "package p1;\n" +
+ "public class MissingClass{}\n" },
p.getProject().getLocation().append("p1.jar").toOSString(), "1.5");
-
+
org.eclipse.jdt.core.tests.util.Util.createJar(new String[] {
"p1/p2/BinaryWithField.java",
"package p1.p2;\n" +
@@ -2737,7 +2737,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
new String[] { p.getProject().getLocation().append("p1.jar").toOSString() },
"1.5");
createFolder("/P/src/test");
- createFile("/P/src/test/A.java",
+ createFile("/P/src/test/A.java",
"package test;\n" +
"import p1.MissingClass;\n" +
"public class A {\n" +
@@ -2745,7 +2745,7 @@ public class JavaSearchBugsTests2 extends AbstractJavaSearchTests {
" return null;\n" +
" }\n" +
"}\n");
- createFile("/P/src/test/TestSearchBug.java",
+ createFile("/P/src/test/TestSearchBug.java",
"package test;\n" +
"\n" +
"public class TestSearchBug {\n" +
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchFineGrainTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchFineGrainTests.java
index 7903ceb2b..389b2b9e5 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchFineGrainTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchFineGrainTests.java
@@ -598,7 +598,7 @@ public void testTypeRefAll_Annotation() throws CoreException {
search("*", TYPE, ANNOTATION_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
assertSearchResults(
//{ObjectTeams: changed order:
-/* orig:
+/* orig:
"src/all/types/ref/TestTypes.java all.types.ref.TestTypes [@!|Bug|!(num=155013)@70] EXACT_MATCH\n" +
"src/all/types/ref/TestTypes.java all.types.ref.TestTypes.field [ @!|Bug|!(comment=\"field\")@127] EXACT_MATCH\n" +
"src/all/types/ref/TestTypes.java Types all.types.ref.TestTypes.method(Types) [ @!|Bug|!(comment=\"method\", num=155013)@424] EXACT_MATCH\n" +
@@ -1353,7 +1353,7 @@ public void testTypeRefQualifiedAll_Annotation() throws CoreException {
+"\n"+
"src/all/types/ref/TestTypes.java all.types.ref.TestTypes [@!|type.def.Bug|!(num=155013)@25] EXACT_MATCH\n" +
"src/all/types/ref/TestTypes.java all.types.ref.TestTypes.field [ @!|type.def.Bug|!(comment=\"field\")@100] EXACT_MATCH\n" +
- "src/all/types/ref/TestTypes.java type.def.Types all.types.ref.TestTypes.method(type.def.Types) [ @!|type.def.Bug|!(comment=\"method\", num=155013)@460] EXACT_MATCH"
+ "src/all/types/ref/TestTypes.java type.def.Types all.types.ref.TestTypes.method(type.def.Types) [ @!|type.def.Bug|!(comment=\"method\", num=155013)@460] EXACT_MATCH"
// SH}
);
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchMultipleProjectsTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchMultipleProjectsTests.java
index 2a20c507f..4260e3696 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchMultipleProjectsTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchMultipleProjectsTests.java
@@ -1447,8 +1447,8 @@ public void testBug250454() throws CoreException {
createFile(
"/P0/p/Shape.java",
"package p;\n" +
- "public interface Shape {\n" +
- " public void f();\n" +
+ "public interface Shape {\n" +
+ " public void f();\n" +
"}\n"
);
@@ -1458,8 +1458,8 @@ public void testBug250454() throws CoreException {
createFile(
"/P1/p/Square.java",
"package p;\n" +
- "public class Square implements Shape {\n" +
- " public void f() {}\n" +
+ "public class Square implements Shape {\n" +
+ " public void f() {}\n" +
"}\n"
);
@@ -1469,9 +1469,9 @@ public void testBug250454() throws CoreException {
createFile(
"/P2/p/ShapeUser.java",
"package p;\n" +
- "public class ShapeUser {\n" +
- " public void useShape(Shape p_shape) {\n" +
- " p_shape.f();\n" +
+ "public class ShapeUser {\n" +
+ " public void useShape(Shape p_shape) {\n" +
+ " p_shape.f();\n" +
" }\n"
);
@@ -1507,8 +1507,8 @@ public void testBug250454_jars() throws CoreException, IOException {
String[] pathsAndContents= new String[] {
"p/Shape.java",
"package p;\n" +
- "public interface Shape {\n" +
- " public void f();\n" +
+ "public interface Shape {\n" +
+ " public void f();\n" +
"}\n"
};
createJar(pathsAndContents, jarPath);
@@ -1519,8 +1519,8 @@ public void testBug250454_jars() throws CoreException, IOException {
createFile(
"/P1/p/Square.java",
"package p;\n" +
- "public class Square implements Shape {\n" +
- " public void f() {}\n" +
+ "public class Square implements Shape {\n" +
+ " public void f() {}\n" +
"}\n"
);
@@ -1530,9 +1530,9 @@ public void testBug250454_jars() throws CoreException, IOException {
createFile(
"/P2/p/ShapeUser.java",
"package p;\n" +
- "public class ShapeUser {\n" +
- " public void useShape(Shape p_shape) {\n" +
- " p_shape.f();\n" +
+ "public class ShapeUser {\n" +
+ " public void useShape(Shape p_shape) {\n" +
+ " p_shape.f();\n" +
" }\n"
);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchScopeTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchScopeTests.java
index 23150d8b9..fdc655cf2 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchScopeTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchScopeTests.java
@@ -1090,9 +1090,9 @@ public void testBug250211() throws CoreException {
}
}
projects[i] = createJavaProject(projectName, new String[]{"src"}, new String[]{"JCL_LIB"}, dependents, exportedProjects, "bin");
- }
+ }
}
- },
+ },
null);
SearchEngine.createJavaSearchScope(projects);
}
@@ -1107,7 +1107,7 @@ public void testBug250211() throws CoreException {
public void testBug397818() throws CoreException {
try {
createJavaProject("P1", new String[] {"src"}, new String[] {}, "bin");
-
+
createFolder("/P1/new folder");
IFile newFile = createFile("/P1/new folder/testindex.index", "");
try {
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchTests.java
index 39cde4563..491193441 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchTests.java
@@ -2234,7 +2234,7 @@ public void testSearchMethodInBinaryWithResolution() throws CoreException {
assertSearchResults(
"AbortCompilation.jar void AbortCompilation.MissingArgumentType.foo() [No source] EXACT_MATCH\n" +
"AbortCompilation.jar void AbortCompilation.MissingArgumentType.foo(java.util.EventListener) [No source] EXACT_MATCH\n" +
- "AbortCompilation.jar void AbortCompilation.MissingArgumentType.foo2() [No source] EXACT_MATCH"
+ "AbortCompilation.jar void AbortCompilation.MissingArgumentType.foo2() [No source] EXACT_MATCH"
);
} finally {
// reset classpath
@@ -2453,7 +2453,7 @@ public void testSearchScope06() throws CoreException {
ICompilationUnit cuC = this. getCompilationUnit("JavaSearch", "src", "a10", "C.java");
IType type = cuC.getType("C");
IJavaSearchScope scope = SearchEngine.createStrictHierarchyScope(null, type, true, false, null);
-
+
// don't include super-classes:
assertFalse("a10.A should not be included in hierarchy scope", scope.encloses(cuB.getType("A")));
assertFalse("a10.B should not be included in hierarchy scope", scope.encloses(cuB.getType("B")));
@@ -2467,10 +2467,10 @@ public void testSearchScope07() throws CoreException {
ICompilationUnit cuC = this. getCompilationUnit("JavaSearch", "src", "a10", "C.java");
IType type = cuC.getType("C");
IJavaSearchScope scope = SearchEngine.createStrictHierarchyScope(null, type, true, false, null);
-
+
// don't include focus type:
assertFalse("a10.C should not be included in hierarchy scope", scope.encloses(type));
- assertFalse("a10/C.java should not be included in hierarchy scope", scope.encloses(cuC.getUnderlyingResource().getFullPath().toString()));
+ assertFalse("a10/C.java should not be included in hierarchy scope", scope.encloses(cuC.getUnderlyingResource().getFullPath().toString()));
}
/**
* Hierarchy scope test.
@@ -2481,10 +2481,10 @@ public void testSearchScope07a() throws CoreException {
ICompilationUnit cuC = this. getCompilationUnit("JavaSearch", "src", "a10", "C.java");
IType type = cuC.getType("C");
IJavaSearchScope scope = SearchEngine.createStrictHierarchyScope(null, type, true, true, null);
-
+
// include focus type:
assertTrue("a10.C should be included in hierarchy scope", scope.encloses(type));
- assertTrue("a10/C.java should be included in hierarchy scope", scope.encloses(cuC.getUnderlyingResource().getFullPath().toString()));
+ assertTrue("a10/C.java should be included in hierarchy scope", scope.encloses(cuC.getUnderlyingResource().getFullPath().toString()));
}
/**
* Hierarchy scope test.
@@ -2496,11 +2496,11 @@ public void testSearchScope08() throws CoreException {
ICompilationUnit cuE = this. getCompilationUnit("JavaSearch", "src", "a10", "E.java");
IType type = cuC.getType("C");
IJavaSearchScope scope = SearchEngine.createStrictHierarchyScope(null, type, true, false, null);
-
+
// regular sub-types:
assertTrue("a10.D should be included in hierarchy scope", scope.encloses(cuD.getType("D")));
assertTrue("a10/D.java should be included in hierarchy scope", scope.encloses(cuD.getUnderlyingResource().getFullPath().toString()));
-
+
assertTrue("a10.E should be included in hierarchy scope", scope.encloses(cuE.getType("E")));
assertTrue("a10.F should be included in hierarchy scope", scope.encloses(cuE.getType("F")));
}
@@ -2513,7 +2513,7 @@ public void testSearchScope09() throws CoreException {
ICompilationUnit cuE = this. getCompilationUnit("JavaSearch", "src", "a10", "E.java");
IType type = cuC.getType("C");
IJavaSearchScope scope = SearchEngine.createStrictHierarchyScope(null, type, true, false, null);
-
+
// sub-type is a nested type:
assertTrue("a10.H$I should be included in hierarchy scope", scope.encloses(cuE.getType("H").getType("I")));
}
@@ -2526,7 +2526,7 @@ public void testSearchScope10() throws CoreException {
ICompilationUnit cuE = this. getCompilationUnit("JavaSearch", "src", "a10", "E.java");
IType type = cuC.getType("C");
IJavaSearchScope scope = SearchEngine.createStrictHierarchyScope(null, type, true, false, null);
-
+
// member of a sub-type:
assertFalse("a10.F$G should not be included in hierarchy scope", scope.encloses(cuE.getType("F").getType("G")));
}
@@ -2539,7 +2539,7 @@ public void testSearchScope12() throws CoreException {
ICompilationUnit cuE = this. getCompilationUnit("JavaSearch", "src", "a10", "E.java");
IType type = cuC.getType("C");
IJavaSearchScope scope = SearchEngine.createStrictHierarchyScope(null, type, true, false, null);
-
+
// enclosing of a sub-type:
assertFalse("a10.H should not be included in hierarchy scope", scope.encloses(cuE.getType("H")));
assertTrue("a10/E.java should be included in hierarchy scope", scope.encloses(cuE.getUnderlyingResource().getFullPath().toString()));
@@ -2552,12 +2552,12 @@ public void testSearchScope13() throws CoreException {
ICompilationUnit cuC = this. getCompilationUnit("JavaSearch", "src", "a10", "C.java");
IType type = cuC.getType("C");
IJavaSearchScope scope = SearchEngine.createStrictHierarchyScope(null, type, true, false, null);
-
+
search("**", TYPE, DECLARATIONS, scope);
assertSearchResults(
- "src/a10/D.java a10.D [D]\n" +
- "src/a10/E.java a10.E [E]\n" +
- "src/a10/E.java a10.F [F]\n" +
+ "src/a10/D.java a10.D [D]\n" +
+ "src/a10/E.java a10.E [E]\n" +
+ "src/a10/E.java a10.F [F]\n" +
"src/a10/E.java a10.H$I [I]"
);
}
@@ -2569,16 +2569,16 @@ public void testSearchScope14() throws CoreException {
ICompilationUnit cuC = this. getCompilationUnit("JavaSearch", "src", "a10", "C.java");
IType type = cuC.getType("C");
IJavaSearchScope scope = SearchEngine.createStrictHierarchyScope(null, type, /*onlySubTypes*/false, true, null);
-
+
search("**", TYPE, DECLARATIONS, scope);
assertSearchResults(
- "src/a10/B.java a10.A [A]\n" +
- "src/a10/B.java a10.B [B]\n" +
- "src/a10/C.java a10.C [C]\n" +
- "src/a10/D.java a10.D [D]\n" +
- "src/a10/E.java a10.E [E]\n" +
- "src/a10/E.java a10.F [F]\n" +
- "src/a10/E.java a10.H$I [I]\n" +
+ "src/a10/B.java a10.A [A]\n" +
+ "src/a10/B.java a10.B [B]\n" +
+ "src/a10/C.java a10.C [C]\n" +
+ "src/a10/D.java a10.D [D]\n" +
+ "src/a10/E.java a10.E [E]\n" +
+ "src/a10/E.java a10.F [F]\n" +
+ "src/a10/E.java a10.H$I [I]\n" +
getExternalJCLPathString() + " java.lang.Object"
);
}
@@ -2591,15 +2591,15 @@ public void testSearchScope14a() throws CoreException {
ICompilationUnit cuC = this. getCompilationUnit("JavaSearch", "src", "a10", "C.java");
IType type = cuC.getType("C");
IJavaSearchScope scope = SearchEngine.createStrictHierarchyScope(null, type, /*onlySubTypes*/false, false, null);
-
+
search("**", TYPE, DECLARATIONS, scope);
assertSearchResults(
- "src/a10/B.java a10.A [A]\n" +
- "src/a10/B.java a10.B [B]\n" +
- "src/a10/D.java a10.D [D]\n" +
- "src/a10/E.java a10.E [E]\n" +
- "src/a10/E.java a10.F [F]\n" +
- "src/a10/E.java a10.H$I [I]\n" +
+ "src/a10/B.java a10.A [A]\n" +
+ "src/a10/B.java a10.B [B]\n" +
+ "src/a10/D.java a10.D [D]\n" +
+ "src/a10/E.java a10.E [E]\n" +
+ "src/a10/E.java a10.F [F]\n" +
+ "src/a10/E.java a10.H$I [I]\n" +
getExternalJCLPathString() + " java.lang.Object"
);
}
@@ -2623,7 +2623,7 @@ public void testSearchScope15() throws CoreException {
collector,
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
null);
- String expected =
+ String expected =
"a10.D\n" +
"a10.E\n" +
"a10.F\n" +
@@ -2640,7 +2640,7 @@ public void testSearchScope17() throws CoreException {
ICompilationUnit cuE = this. getCompilationUnit("JavaSearch", "src", "a10", "E.java");
IType type = cuC.getType("C");
IJavaSearchScope scope = SearchEngine.createStrictHierarchyScope(null, type, true, false, null);
-
+
// method of a member of a sub-type:
assertFalse("a10.F$G.m() should not be included in hierarchy scope", scope.encloses(cuE.getType("F").getType("G").getMethod("m", new String[0])));
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavadocBugsCompletionModelTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavadocBugsCompletionModelTest.java
index 78ad2f229..5f9627be6 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavadocBugsCompletionModelTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavadocBugsCompletionModelTest.java
@@ -1133,7 +1133,7 @@ public void testBug249785a() throws JavaModelException {
);
}
/**
- * @bug 255752 [javadoc][assist] Inappropriate completion proposals for javadoc at compilation unit level
+ * @bug 255752 [javadoc][assist] Inappropriate completion proposals for javadoc at compilation unit level
* @test that there are no tag completions offered at the compilation unit level for a non package-info.java
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=255752"
*/
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavadocPackageCompletionModelTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavadocPackageCompletionModelTest.java
index 29fb0854f..2522adaeb 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavadocPackageCompletionModelTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavadocPackageCompletionModelTest.java
@@ -303,9 +303,9 @@ public void test015() throws JavaModelException {
"package javadoc.tags;\n";
completeInJavadoc("/Completion/src/javadoc/tags/package-info.java", source, true, "I");
assertSortedResults(
- "IllegalMonitorStateException[TYPE_REF]{IllegalMonitorStateException, java.lang, Ljava.lang.IllegalMonitorStateException;, null, null, "+this.positions+R_DRICUNR+"}\n" +
- "InterruptedException[TYPE_REF]{InterruptedException, java.lang, Ljava.lang.InterruptedException;, null, null, "+this.positions+R_DRICUNR+"}\n" +
- "Inherited[TYPE_REF]{java.lang.annotation.Inherited, java.lang.annotation, Ljava.lang.annotation.Inherited;, null, null, "+this.positions+R_DRICNR+"}\n" +
+ "IllegalMonitorStateException[TYPE_REF]{IllegalMonitorStateException, java.lang, Ljava.lang.IllegalMonitorStateException;, null, null, "+this.positions+R_DRICUNR+"}\n" +
+ "InterruptedException[TYPE_REF]{InterruptedException, java.lang, Ljava.lang.InterruptedException;, null, null, "+this.positions+R_DRICUNR+"}\n" +
+ "Inherited[TYPE_REF]{java.lang.annotation.Inherited, java.lang.annotation, Ljava.lang.annotation.Inherited;, null, null, "+this.positions+R_DRICNR+"}\n" +
"Iterator[TYPE_REF]{java.util.Iterator, java.util, Ljava.util.Iterator;, null, null, "+this.positions+R_DRICNR+"}"
);
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/MatchingRegionsTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/MatchingRegionsTest.java
index 87f70a3e2..b69f03e84 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/MatchingRegionsTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/MatchingRegionsTest.java
@@ -20,10 +20,10 @@ import org.eclipse.jdt.core.search.SearchPattern;
/**
* Class to test the matching regions API method added on {@link SearchPattern}
- *
+ *
* @see SearchPattern#getMatchingRegions(String, String, int)
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=218605"
- *
+ *
* @since 3.5
*/
public class MatchingRegionsTest extends AbstractJavaModelTests {
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/MementoTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/MementoTests.java
index 4be167bd4..5bf451277 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/MementoTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/MementoTests.java
@@ -94,8 +94,8 @@ public void setUpSuite() throws Exception {
Util.createClassFolder(new String[] {
"X.java",
"public class X {}"
- },
- getExternalResourcePath("myLib"),
+ },
+ getExternalResourcePath("myLib"),
"1.4");
this.createJavaProject(
"P",
@@ -816,7 +816,7 @@ public void testAnnotationPath18() throws CoreException, IOException {
// tests annotationpath in memento for a regular jar library:
try {
IJavaProject project = createJavaProject("Test", new String[] {"src"}, null, "bin", "1.8", false);
- addLibraryWithExternalAnnotations(project, "1.8", "lib.jar", "/Test/annots",
+ addLibraryWithExternalAnnotations(project, "1.8", "lib.jar", "/Test/annots",
new String[] {
"test/Test.java",
"package test;\n" +
@@ -841,7 +841,7 @@ public void testAnnotationPath18() throws CoreException, IOException {
// PackageFragment
IPackageFragment test = packageRoot.getPackageFragment("test");
handleIdentifier = test.getHandleIdentifier();
- String expected = expectedIdentifiers[i]+"<test";
+ String expected = expectedIdentifiers[i]+"<test";
assertEquals("PackageFragment mementos", expected, handleIdentifier);
element = JavaCore.create(handleIdentifier, null);
assertEquals("PackageFragment equivalence", test, element);
@@ -888,7 +888,7 @@ public void testAnnotationPath9() throws CoreException, IOException {
// PackageFragment
IPackageFragment test = packageRoot.getPackageFragment("java.lang");
handleIdentifier = test.getHandleIdentifier();
- String expected = expectedIdentifier+"<java.lang";
+ String expected = expectedIdentifier+"<java.lang";
assertEquals("PackageFragment mementos", expected, handleIdentifier);
element = JavaCore.create(handleIdentifier, null);
assertEquals("PackageFragment equivalence", test, element);
@@ -909,15 +909,15 @@ public void testEmptyAttribute() throws CoreException, IOException {
org.eclipse.jdt.core.tests.util.Util.createJar(
new String[] {"test/Test.java", "package test; public class Test {}\n" },
null, project.getProject().getLocation().toString()+"/lib.jar", null, "1.8", null);
-
+
project.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
IClasspathAttribute[] attributes = {
- JavaCore.newClasspathAttribute("foo", "")
+ JavaCore.newClasspathAttribute("foo", "")
};
addLibraryEntry(project, new Path("/Test/lib.jar"), null, null, null, null, attributes, false);
String[] expectedIdentifiers = {
"=Test/src",
- "=Test/lib.jar=/foo=/=/"
+ "=Test/lib.jar=/foo=/=/"
};
IPackageFragmentRoot[] roots = project.getAllPackageFragmentRoots();
boolean archiveSeen = false;
@@ -932,7 +932,7 @@ public void testEmptyAttribute() throws CoreException, IOException {
// PackageFragment
IPackageFragment test = packageRoot.getPackageFragment("test");
handleIdentifier = test.getHandleIdentifier();
- String expected = expectedIdentifiers[i]+"<test";
+ String expected = expectedIdentifiers[i]+"<test";
assertEquals("PackageFragment mementos", expected, handleIdentifier);
element = JavaCore.create(handleIdentifier, null);
assertEquals("PackageFragment equivalence", test, element);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleBuilderTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleBuilderTests.java
index f94c7492c..d96658dcb 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleBuilderTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleBuilderTests.java
@@ -62,7 +62,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
static {
// TESTS_NAMES = new String[] { "testReleaseOption8" };
- }
+ }
private String sourceWorkspacePath = null;
protected ProblemRequestor problemRequestor;
public static Test suite() {
@@ -97,13 +97,13 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
waitForManualRefresh();
waitForAutoBuild();
}
-
+
public void tearDownSuite() throws Exception {
super.tearDownSuite();
deleteProject("P1");
}
-
- // Test that the java.base found as a module package fragment root in the project
+
+ // Test that the java.base found as a module package fragment root in the project
public void test001() throws CoreException {
try {
IJavaProject project = createJava9Project("Test01", new String[]{"src"});
@@ -184,8 +184,8 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
this.currentProject.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = this.currentProject.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
sortMarkers(markers);
- assertMarkers("Unexpected markers",
- "The type java.sql.Connection is not accessible\n" +
+ assertMarkers("Unexpected markers",
+ "The type java.sql.Connection is not accessible\n" +
"Connection cannot be resolved to a type", markers);
} finally {
}
@@ -272,7 +272,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
}
/*
* Two Java projects, each with one module. P2 has P1 in its build path but
- * module M2 has no 'requires' M1. Should report unresolved type, import etc.
+ * module M2 has no 'requires' M1. Should report unresolved type, import etc.
*
*/
public void test007() throws Exception {
@@ -291,9 +291,9 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
project.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = project.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
sortMarkers(markers);
- assertMarkers("Unexpected markers",
- "The type com.greetings.Main is not accessible\n" +
- "Main cannot be resolved",
+ assertMarkers("Unexpected markers",
+ "The type com.greetings.Main is not accessible\n" +
+ "Main cannot be resolved",
markers);
} finally {
deleteProject("P2");
@@ -322,9 +322,9 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
project.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = project.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
sortMarkers(markers);
- assertMarkers("Unexpected markers",
- "The type com.greetings.Main is not accessible\n" +
- "Main cannot be resolved",
+ assertMarkers("Unexpected markers",
+ "The type com.greetings.Main is not accessible\n" +
+ "Main cannot be resolved",
markers);
} finally {
deleteProject("P2");
@@ -332,8 +332,8 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
}
/*
* Two Java projects, each with one module. P2 has P1 in its build path.
- * Module M2 has "requires M1" in module-info and all packages used by M2
- * are exported by M1. No errors expected.
+ * Module M2 has "requires M1" in module-info and all packages used by M2
+ * are exported by M1. No errors expected.
*/
public void test009() throws Exception {
try {
@@ -350,7 +350,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
waitForManualRefresh();
project.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = project.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
- assertMarkers("Unexpected markers",
+ assertMarkers("Unexpected markers",
"", markers);
} finally {
deleteProject("P2");
@@ -377,9 +377,9 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
project.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = project.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
sortMarkers(markers);
- assertMarkers("Unexpected markers",
- "The import com.greetings.Main cannot be resolved\n" +
- "Main cannot be resolved",
+ assertMarkers("Unexpected markers",
+ "The import com.greetings.Main cannot be resolved\n" +
+ "Main cannot be resolved",
markers);
} finally {
deleteProject("P2");
@@ -462,9 +462,9 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
assertMarkers("Unexpected markers", "", markers);
markers = p3.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
sortMarkers(markers);
- assertMarkers("Unexpected markers",
- "The package com.greetings is not accessible\n" +
- "Main cannot be resolved",
+ assertMarkers("Unexpected markers",
+ "The package com.greetings is not accessible\n" +
+ "Main cannot be resolved",
markers);
} finally {
deleteProject("P2");
@@ -560,7 +560,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
}
}
/*
- * Change the module-info and wait for autobuild to
+ * Change the module-info and wait for autobuild to
* report expected errors.
*/
public void test016() throws CoreException, IOException {
@@ -585,14 +585,14 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
sortMarkers(markers);
assertMarkers("Unexpected markers",
- "The type com.greetings.Main is not accessible\n" +
+ "The type com.greetings.Main is not accessible\n" +
"Main cannot be resolved", markers);
} finally {
deleteProject("P2");
}
}
/*
- * Change the module-info of a required module and wait for autobuild to
+ * Change the module-info of a required module and wait for autobuild to
* report expected errors.
*/
public void test017() throws CoreException, IOException {
@@ -617,7 +617,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
sortMarkers(markers);
assertMarkers("Unexpected markers",
- "The type com.greetings.Main is not accessible\n" +
+ "The type com.greetings.Main is not accessible\n" +
"Main cannot be resolved", markers);
} finally {
deleteProject("P2");
@@ -629,7 +629,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
}
}
/*
- * Change the module-info of a required module and wait for autobuild to
+ * Change the module-info of a required module and wait for autobuild to
* report expected errors.
*/
public void test018() throws CoreException, IOException {
@@ -733,7 +733,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
}
public void test_services_abstractImpl() throws CoreException {
try {
- String[] sources = new String[] {
+ String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
" exports org.astro;\n" +
@@ -742,14 +742,14 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"package org.astro;\n" +
"public interface World {\n" +
" public String name();\n" +
- "}"
+ "}"
};
IJavaProject p1 = setupModuleProject("org.astro", sources);
IClasspathAttribute modAttr = new ClasspathAttribute("module", "true");
IClasspathEntry dep = JavaCore.newProjectEntry(p1.getPath(), null, false,
new IClasspathAttribute[] {modAttr},
false/*not exported*/);
- String[] src = new String[] {
+ String[] src = new String[] {
"src/module-info.java",
"module com.greetings {\n" +
" requires org.astro;\n" +
@@ -773,7 +773,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
}
public void test_services_invalidImpl() throws CoreException {
try {
- String[] sources = new String[] {
+ String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
" exports org.astro;\n" +
@@ -782,14 +782,14 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"package org.astro;\n" +
"public interface World {\n" +
" public String name();\n" +
- "}"
+ "}"
};
IJavaProject p1 = setupModuleProject("org.astro", sources);
IClasspathAttribute modAttr = new ClasspathAttribute("module", "true");
IClasspathEntry dep = JavaCore.newProjectEntry(p1.getPath(), null, false,
new IClasspathAttribute[] {modAttr},
false/*not exported*/);
- String[] src = new String[] {
+ String[] src = new String[] {
"src/module-info.java",
"module com.greetings {\n" +
" requires org.astro;\n" +
@@ -815,7 +815,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -860,7 +860,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -905,7 +905,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -950,7 +950,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -995,7 +995,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -1041,7 +1041,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -1080,7 +1080,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -1131,7 +1131,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -1143,8 +1143,8 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
sources = new String[] {
"src/module-info.java",
"module other.mod {\n" +
- " requires org.astro;\n" +
- " exports org.impl;\n" +
+ " requires org.astro;\n" +
+ " exports org.impl;\n" +
"}",
"src/org/impl/MyWorld.java",
"package org.impl;\n" +
@@ -1188,7 +1188,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -1200,7 +1200,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
sources = new String[] {
"src/module-info.java",
"module other.mod {\n" +
- " requires org.astro;\n" +
+ " requires org.astro;\n" +
"}",
"src/org/impl/MyWorld.java",
"package org.impl;\n" +
@@ -1244,7 +1244,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -1294,7 +1294,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -1361,7 +1361,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -1400,7 +1400,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -1450,7 +1450,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
IJavaProject p2 = setupModuleProject("com.greetings", src);
p2.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
- assertMarkers("Unexpected markers",
+ assertMarkers("Unexpected markers",
"The package com.greetings does not exist or is empty", markers);
} finally {
deleteProject("com.greetings");
@@ -1467,7 +1467,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
IJavaProject p2 = setupModuleProject("com.greetings", src);
p2.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
- assertMarkers("Unexpected markers",
+ assertMarkers("Unexpected markers",
"Cannot export the package java.util which belongs to module java.base", markers);
} finally {
deleteProject("com.greetings");
@@ -1488,7 +1488,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
p2.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
sortMarkers(markers);
- assertMarkers("Unexpected markers",
+ assertMarkers("Unexpected markers",
"The package java.util conflicts with a package accessible from another module: java.base",
markers);
} finally {
@@ -1500,8 +1500,8 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro;\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -1512,7 +1512,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
IJavaProject p1 = setupModuleProject("org.astro", sources);
p1.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p1.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
- assertMarkers("Unexpected markers",
+ assertMarkers("Unexpected markers",
"Duplicate exports entry: org.astro", markers);
} finally {
deleteProject("org.astro");
@@ -1523,7 +1523,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro to com.greetings, com.greetings;\n" +
+ " exports org.astro to com.greetings, com.greetings;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -1551,7 +1551,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
setupModuleProject("com.greetings", src, new IClasspathEntry[] { dep });
p1.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p1.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
- assertMarkers("Unexpected markers",
+ assertMarkers("Unexpected markers",
"Duplicate module name: com.greetings", markers);
} finally {
deleteProject("org.astro");
@@ -1565,7 +1565,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro to com.greetings;\n" +
+ " exports org.astro to com.greetings;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -1615,7 +1615,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro to some.mod;\n" +
+ " exports org.astro to some.mod;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -1647,7 +1647,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
p2.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
sortMarkers(markers);
- assertMarkers("Unexpected markers",
+ assertMarkers("Unexpected markers",
"The type org.astro.World is not accessible\n" +
"World cannot be resolved to a type",
markers);
@@ -1657,14 +1657,14 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
deleteProject("com.greetings");
}
}
- // It is permitted for the to clause of an exports or opens statement to
+ // It is permitted for the to clause of an exports or opens statement to
// specify a module which is not observable
public void test_TargetedExports_Unresolved() throws CoreException {
try {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro to some.mod;\n" +
+ " exports org.astro to some.mod;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -1693,7 +1693,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro to some.mod;\n" +
+ " exports org.astro to some.mod;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -1717,7 +1717,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -1763,7 +1763,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -1811,7 +1811,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -1843,7 +1843,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
" }\n" +
"}"
};
-
+
IJavaProject p2 = setupModuleProject("com.greetings", src, new IClasspathEntry[] { dep });
p2.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
@@ -1868,7 +1868,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -1892,7 +1892,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
" }\n" +
"}"
};
-
+
IJavaProject p2 = setupModuleProject("com.greetings", src, new IClasspathEntry[] { dep });
this.editFile("some.mod/src/module-info.java",
"module some.mod {\n" +
@@ -1901,7 +1901,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
p2.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
sortMarkers(markers);
- assertMarkers("Unexpected markers",
+ assertMarkers("Unexpected markers",
"The type org.astro.World is not accessible\n" +
"World cannot be resolved to a type", markers);
} finally {
@@ -1925,7 +1925,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -1949,7 +1949,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
" }\n" +
"}"
};
-
+
IJavaProject p2 = setupModuleProject("com.greetings", src, new IClasspathEntry[] { dep });
this.editFile("some.mod/src/module-info.java",
"module some.mod {\n" +
@@ -1993,9 +1993,9 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
" exports com.greetings;\n" +
"}"
};
-
+
IJavaProject p2 = setupModuleProject("com.greetings", src, new IClasspathEntry[] { dep });
- editFile("org.astro/src/module-info.java",
+ editFile("org.astro/src/module-info.java",
"module org.astro {\n" +
" exports org.astro;\n" +
" requires com.greetings;\n" +
@@ -2039,7 +2039,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"}"
};
IJavaProject p2 = setupModuleProject("com.greetings", src, new IClasspathEntry[] { dep });
- editFile("org.astro/src/module-info.java",
+ editFile("org.astro/src/module-info.java",
"module org.astro {\n" +
" exports org.astro;\n" +
" requires transitive com.greetings;\n" +
@@ -2087,7 +2087,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -2142,7 +2142,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -2205,7 +2205,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -2222,9 +2222,9 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"}"
};
IJavaProject p1 = setupModuleProject("org.astro", new String[]{"src", "othersrc"}, sources, null);
- this.createFile("org.astro/othersrc/module-info.java",
+ this.createFile("org.astro/othersrc/module-info.java",
"module org.astro1 {\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}");
waitForAutoBuild();
p1.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
@@ -2242,7 +2242,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -2251,7 +2251,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"}",
"othersrc/module-info.java",
"module org.astro1 {\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}",
"othersrc/org/astro/OtherWorld.java",
"package org.astro;\n" +
@@ -2275,7 +2275,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
}
public void test_services_multipleImpl() throws CoreException {
try {
- String[] sources = new String[] {
+ String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
" exports org.astro;\n" +
@@ -2284,14 +2284,14 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"package org.astro;\n" +
"public interface World {\n" +
" public String name();\n" +
- "}"
+ "}"
};
IJavaProject p1 = setupModuleProject("org.astro", sources);
IClasspathAttribute modAttr = new ClasspathAttribute("module", "true");
IClasspathEntry dep = JavaCore.newProjectEntry(p1.getPath(), null, false,
new IClasspathAttribute[] {modAttr},
false/*not exported*/);
- String[] src = new String[] {
+ String[] src = new String[] {
"src/module-info.java",
"import org.astro.World;\n" +
"import com.greetings.*;\n" +
@@ -2328,7 +2328,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
}
public void test_imports_in_moduleinfo() throws CoreException {
try {
- String[] sources = new String[] {
+ String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
" exports org.astro;\n" +
@@ -2337,14 +2337,14 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"package org.astro;\n" +
"public interface World {\n" +
" public String name();\n" +
- "}"
+ "}"
};
IJavaProject p1 = setupModuleProject("org.astro", sources);
IClasspathAttribute modAttr = new ClasspathAttribute("module", "true");
IClasspathEntry dep = JavaCore.newProjectEntry(p1.getPath(), null, false,
new IClasspathAttribute[] {modAttr},
false/*not exported*/);
- String[] src = new String[] {
+ String[] src = new String[] {
"src/module-info.java",
"import org.astro.World;\n" +
"module com.greetings {\n" +
@@ -2392,9 +2392,9 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"src/module-info.java",
"module org.astro {}",
"src/org/astro/World.java",
- "package org.astro;\n" +
- "public interface World {\n" +
- " public String name();\n" +
+ "package org.astro;\n" +
+ "public interface World {\n" +
+ " public String name();\n" +
"}\n"
};
IJavaProject p1 = setupModuleProject("org.astro", src);
@@ -2416,7 +2416,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
sortMarkers(markers);
- assertMarkers("Unexpected markers",
+ assertMarkers("Unexpected markers",
"The type org.astro.World is not accessible\n" +
"The package org.astro does not exist or is empty", markers);
} finally {
@@ -2429,8 +2429,8 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " opens org.astro;\n" +
- " opens org.astro;\n" +
+ " opens org.astro;\n" +
+ " opens org.astro;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -2441,7 +2441,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
IJavaProject p1 = setupModuleProject("org.astro", sources);
p1.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p1.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
- assertMarkers("Unexpected markers",
+ assertMarkers("Unexpected markers",
"Duplicate opens entry: org.astro", markers);
} finally {
deleteProject("org.astro");
@@ -2452,7 +2452,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " opens org.astro to com.greetings, com.greetings;\n" +
+ " opens org.astro to com.greetings, com.greetings;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -2480,21 +2480,21 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
setupModuleProject("com.greetings", src, new IClasspathEntry[] { dep });
p1.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p1.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
- assertMarkers("Unexpected markers",
+ assertMarkers("Unexpected markers",
"Duplicate module name: com.greetings", markers);
} finally {
deleteProject("org.astro");
deleteProject("com.greetings");
}
}
- // It is permitted for the to clause of an exports or opens statement to
+ // It is permitted for the to clause of an exports or opens statement to
// specify a module which is not observable
public void test_TargetedOpens_Unresolved() throws CoreException {
try {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " opens org.astro to some.mod;\n" +
+ " opens org.astro to some.mod;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -2510,13 +2510,13 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
deleteProject("org.astro");
}
}
- // It is a compile-time error if an opens statement appears in the declaration of an open module.
+ // It is a compile-time error if an opens statement appears in the declaration of an open module.
public void test_OpensStatment_in_OpenModule() throws CoreException {
try {
String[] sources = new String[] {
"src/module-info.java",
"open module org.astro {\n" +
- " opens org.astro to some.mod;\n" +
+ " opens org.astro to some.mod;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -2527,7 +2527,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
IJavaProject p1 = setupModuleProject("org.astro", sources);
p1.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p1.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
- assertMarkers("Unexpected markers",
+ assertMarkers("Unexpected markers",
"opens statement is not allowed, as module org.astro is declared open", markers);
} finally {
deleteProject("org.astro");
@@ -2593,7 +2593,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
this.workingCopies[0] = getCompilationUnit("/com.greetings/src/module-info.java").getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
} finally {
@@ -2614,11 +2614,11 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
this.workingCopies[0] = getCompilationUnit("/com.greetings/src/module-info.java").getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. ERROR in /com.greetings/src/module-info.java (at line 2)\n" +
- " requires java.sq;\n" +
- " ^^^^^^^\n" +
- "java.sq cannot be resolved to a module\n" +
+ "----------\n" +
+ "1. ERROR in /com.greetings/src/module-info.java (at line 2)\n" +
+ " requires java.sq;\n" +
+ " ^^^^^^^\n" +
+ "java.sq cannot be resolved to a module\n" +
"----------\n",
this.problemRequestor);
} finally {
@@ -2683,10 +2683,10 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
}
newClasspath[rawClasspath.length] = desktop;
project.setRawClasspath(newClasspath, null);
- this.createFile("Test01/src/module-info.java",
- "module org.eclipse {\n" +
- " requires java.desktop;\n" +
- " requires java.base;\n" +
+ this.createFile("Test01/src/module-info.java",
+ "module org.eclipse {\n" +
+ " requires java.desktop;\n" +
+ " requires java.base;\n" +
"}");
waitForManualRefresh();
waitForAutoBuild();
@@ -2698,11 +2698,11 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
ICompilationUnit cu = getCompilationUnit("/Test01/src/module-info.java");
cu.getWorkingCopy(this.wcOwner, null);
markers = project.getProject().findMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE);
- editFile("Test01/src/module-info.java",
+ editFile("Test01/src/module-info.java",
"//Just touching \n" +
- "module org.eclipse {\n" +
- " requires java.desktop;\n" +
- " requires java.base;\n" +
+ "module org.eclipse {\n" +
+ " requires java.desktop;\n" +
+ " requires java.base;\n" +
"}");
project.getProject().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);
markers = project.getProject().findMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE);
@@ -2717,49 +2717,49 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"src/module-info.java",
"module Test {\n" +
" exports p;\n" +
- " requires java.sql;\n" +
+ " requires java.sql;\n" +
" provides java.sql.Driver with p.C;\n" +
"}",
"src/p/C.java",
- "package p;\n" +
- "import java.lang.SecurityManager;\n" +
- "import java.sql.Connection;\n" +
- "import java.sql.Driver;\n" +
- "import java.sql.DriverPropertyInfo;\n" +
- "import java.sql.SQLException;\n" +
- "import java.sql.SQLFeatureNotSupportedException;\n" +
- "import java.util.Properties;\n" +
- "import java.util.logging.Logger;\n" +
- "public class C implements Driver {\n" +
- " SecurityManager s;\n" +
- " @Override\n" +
- " public boolean acceptsURL(String arg0) throws SQLException {\n" +
- " return false;\n" +
- " }\n" +
- " @Override\n" +
- " public Connection connect(String arg0, Properties arg1) throws SQLException {\n" +
- " return null;\n" +
- " }\n" +
- " @Override\n" +
- " public int getMajorVersion() {\n" +
- " return 0;\n" +
- " }\n" +
- " @Override\n" +
- " public int getMinorVersion() {\n" +
- " return 0;\n" +
- " }\n" +
- " @Override\n" +
- " public Logger getParentLogger() throws SQLFeatureNotSupportedException {\n" +
- " return null;\n" +
- " }\n" +
- " @Override\n" +
- " public DriverPropertyInfo[] getPropertyInfo(String arg0, Properties arg1) throws SQLException {\n" +
- " return null;\n" +
- " }\n" +
- " @Override\n" +
- " public boolean jdbcCompliant() {\n" +
- " return false;\n" +
- " } \n" +
+ "package p;\n" +
+ "import java.lang.SecurityManager;\n" +
+ "import java.sql.Connection;\n" +
+ "import java.sql.Driver;\n" +
+ "import java.sql.DriverPropertyInfo;\n" +
+ "import java.sql.SQLException;\n" +
+ "import java.sql.SQLFeatureNotSupportedException;\n" +
+ "import java.util.Properties;\n" +
+ "import java.util.logging.Logger;\n" +
+ "public class C implements Driver {\n" +
+ " SecurityManager s;\n" +
+ " @Override\n" +
+ " public boolean acceptsURL(String arg0) throws SQLException {\n" +
+ " return false;\n" +
+ " }\n" +
+ " @Override\n" +
+ " public Connection connect(String arg0, Properties arg1) throws SQLException {\n" +
+ " return null;\n" +
+ " }\n" +
+ " @Override\n" +
+ " public int getMajorVersion() {\n" +
+ " return 0;\n" +
+ " }\n" +
+ " @Override\n" +
+ " public int getMinorVersion() {\n" +
+ " return 0;\n" +
+ " }\n" +
+ " @Override\n" +
+ " public Logger getParentLogger() throws SQLFeatureNotSupportedException {\n" +
+ " return null;\n" +
+ " }\n" +
+ " @Override\n" +
+ " public DriverPropertyInfo[] getPropertyInfo(String arg0, Properties arg1) throws SQLException {\n" +
+ " return null;\n" +
+ " }\n" +
+ " @Override\n" +
+ " public boolean jdbcCompliant() {\n" +
+ " return false;\n" +
+ " } \n" +
"}"
};
setupModuleProject("Test", src);
@@ -2769,7 +2769,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
this.workingCopies[0] = getCompilationUnit("/Test/src/module-info.java").getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
} finally {
@@ -2778,7 +2778,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
}
public void test_annotations_in_moduleinfo() throws CoreException {
try {
- String[] sources = new String[] {
+ String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
" exports org.astro;\n" +
@@ -2790,14 +2790,14 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"}",
"src/org/astro/Foo.java",
"package org.astro;\n" +
- "public @interface Foo {}"
+ "public @interface Foo {}"
};
IJavaProject p1 = setupModuleProject("org.astro", sources);
IClasspathAttribute modAttr = new ClasspathAttribute("module", "true");
IClasspathEntry dep = JavaCore.newProjectEntry(p1.getPath(), null, false,
new IClasspathAttribute[] {modAttr},
false/*not exported*/);
- String[] src = new String[] {
+ String[] src = new String[] {
"src/module-info.java",
"import org.astro.Foo;\n" +
"import org.astro.World;\n" +
@@ -2827,7 +2827,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
}
public void test_unresolved_annotations() throws CoreException {
try {
- String[] sources = new String[] {
+ String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
" exports org.astro;\n" +
@@ -2839,14 +2839,14 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"}",
"src/org/astro/Foo.java",
"package org.astro;\n" +
- "public @interface Foo {}"
+ "public @interface Foo {}"
};
IJavaProject p1 = setupModuleProject("org.astro", sources);
IClasspathAttribute modAttr = new ClasspathAttribute("module", "true");
IClasspathEntry dep = JavaCore.newProjectEntry(p1.getPath(), null, false,
new IClasspathAttribute[] {modAttr},
false/*not exported*/);
- String[] src = new String[] {
+ String[] src = new String[] {
"src/module-info.java",
"import org.astro.Foo;\n" +
"import org.astro.World;\n" +
@@ -2868,7 +2868,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
IJavaProject p2 = setupModuleProject("com.greetings", src, new IClasspathEntry[] { dep });
p2.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
- assertMarkers("Unexpected markers",
+ assertMarkers("Unexpected markers",
"Bar cannot be resolved to a type", markers);
} finally {
deleteProject("org.astro");
@@ -2877,7 +2877,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
}
public void test_illegal_modifiers() throws CoreException {
try {
- String[] sources = new String[] {
+ String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
" exports org.astro;\n" +
@@ -2889,14 +2889,14 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"}",
"src/org/astro/Foo.java",
"package org.astro;\n" +
- "public @interface Foo {}"
+ "public @interface Foo {}"
};
IJavaProject p1 = setupModuleProject("org.astro", sources);
IClasspathAttribute modAttr = new ClasspathAttribute("module", "true");
IClasspathEntry dep = JavaCore.newProjectEntry(p1.getPath(), null, false,
new IClasspathAttribute[] {modAttr},
false/*not exported*/);
- String[] src = new String[] {
+ String[] src = new String[] {
"src/module-info.java",
"import org.astro.Foo;\n" +
"import org.astro.World;\n" +
@@ -2918,7 +2918,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
IJavaProject p2 = setupModuleProject("com.greetings", src, new IClasspathEntry[] { dep });
p2.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
- assertMarkers("Unexpected markers",
+ assertMarkers("Unexpected markers",
"Illegal modifier for module com.greetings; only open is permitted", markers);
} finally {
deleteProject("org.astro");
@@ -2927,7 +2927,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
}
public void test_annotations_with_target() throws CoreException {
try {
- String[] sources = new String[] {
+ String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
" exports org.astro;\n" +
@@ -2942,14 +2942,14 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"import java.lang.annotation.ElementType;\n" +
"import java.lang.annotation.Target;\n" +
"@Target(ElementType.MODULE)\n" +
- "public @interface Foo {}"
+ "public @interface Foo {}"
};
IJavaProject p1 = setupModuleProject("org.astro", sources);
IClasspathAttribute modAttr = new ClasspathAttribute("module", "true");
IClasspathEntry dep = JavaCore.newProjectEntry(p1.getPath(), null, false,
new IClasspathAttribute[] {modAttr},
false/*not exported*/);
- String[] src = new String[] {
+ String[] src = new String[] {
"src/module-info.java",
"import org.astro.Foo;\n" +
"import org.astro.World;\n" +
@@ -2979,7 +2979,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
}
public void test_annotations_with_wrong_target() throws CoreException {
try {
- String[] sources = new String[] {
+ String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
" exports org.astro;\n" +
@@ -2994,14 +2994,14 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"import java.lang.annotation.ElementType;\n" +
"import java.lang.annotation.Target;\n" +
"@Target({ElementType.TYPE_PARAMETER, ElementType.TYPE})\n" +
- "public @interface Foo {}"
+ "public @interface Foo {}"
};
IJavaProject p1 = setupModuleProject("org.astro", sources);
IClasspathAttribute modAttr = new ClasspathAttribute("module", "true");
IClasspathEntry dep = JavaCore.newProjectEntry(p1.getPath(), null, false,
new IClasspathAttribute[] {modAttr},
false/*not exported*/);
- String[] src = new String[] {
+ String[] src = new String[] {
"src/module-info.java",
"import org.astro.Foo;\n" +
"import org.astro.World;\n" +
@@ -3023,7 +3023,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
IJavaProject p2 = setupModuleProject("com.greetings", src, new IClasspathEntry[] { dep });
p2.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
- assertMarkers("Unexpected markers",
+ assertMarkers("Unexpected markers",
"The annotation @Foo is disallowed for this location", markers);
} finally {
deleteProject("org.astro");
@@ -3032,7 +3032,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
}
public void testBug518334() throws CoreException, IOException {
try {
- String[] sources = new String[] {
+ String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
" requires java.sql;\n" +
@@ -3056,7 +3056,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
}
public void testBug518334a() throws CoreException {
try {
- String[] sources = new String[] {
+ String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
" exports org.astro;\n" +
@@ -3065,11 +3065,11 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"package org.astro;\n" +
"public interface World {\n" +
" public String name();\n" +
- "}"
+ "}"
};
IJavaProject p1 = setupModuleProject("org.astro", sources);
IClasspathEntry dep = JavaCore.newProjectEntry(p1.getPath());
- String[] src = new String[] {
+ String[] src = new String[] {
"src/module-info.java",
"module com.greetings {\n" +
" requires org.astro;\n" +
@@ -3086,7 +3086,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
p2.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
- assertMarkers("Unexpected markers",
+ assertMarkers("Unexpected markers",
"org.astro cannot be resolved to a module", markers);
} finally {
deleteProject("org.astro");
@@ -3097,19 +3097,19 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
public void test_api_leak_1() throws CoreException {
try {
String[] sources1 = {
- "src/module-info.java",
+ "src/module-info.java",
"module mod.one { \n" +
" exports pm;\n" +
"}",
- "src/impl/Other.java",
+ "src/impl/Other.java",
"package impl;\n" +
"public class Other {\n" +
"}\n",
- "src/pm/C1.java",
+ "src/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"
};
IJavaProject p1 = setupModuleProject("mod.one", sources1);
@@ -3120,21 +3120,21 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
p1.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
String[] sources2 = {
- "src/module-info.java",
+ "src/module-info.java",
"module mod.two { \n" +
" requires mod.one;\n" +
"}",
- "src/impl/Other.java",
+ "src/impl/Other.java",
"package impl;\n" +
"public class Other {\n" +
"}\n",
- "src/po/Client.java",
- "package po;\n" +
- "import pm.C1;\n" +
- "public class Client {\n" +
- " void test1(C1 one) {\n" +
- " one.m1(one);\n" +
- " }\n" +
+ "src/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"
};
IJavaProject p2 = setupModuleProject("mod.two", sources2, new IClasspathEntry[] { dep });
@@ -3158,23 +3158,23 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
public void test_api_leak_2() throws CoreException {
try {
String[] sources1 = {
- "src/module-info.java",
+ "src/module-info.java",
"module mod.one { \n" +
" exports pm;\n" +
"}",
- "src/impl/SomeImpl.java",
+ "src/impl/SomeImpl.java",
"package impl;\n" +
"public class SomeImpl {\n" +
"}\n",
- "src/pm/C1.java",
+ "src/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",
- "src/pm/Other.java",
+ "src/pm/Other.java",
"package pm;\n" +
- "import impl.SomeImpl;\n" +
+ "import impl.SomeImpl;\n" +
"public class Other extends SomeImpl {\n" +
"}\n"
};
@@ -3190,21 +3190,21 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"module mod.two { \n" +
" requires mod.one;\n" +
"}",
- "src/impl/SomeImpl.java",
+ "src/impl/SomeImpl.java",
"package impl;\n" +
"public class SomeImpl {\n" + // pseudo-conflict to same named, but inaccessible class from mod.one
"}\n",
- "src/po/Client.java",
- "package po;\n" +
- "import pm.C1;\n" +
+ "src/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",
};
String expectedError = "The method m1(impl.SomeImpl) in the type C1 is not applicable for the arguments (impl.SomeImpl)";
@@ -3221,15 +3221,15 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
deleteProject("mod.two");
}
}
-
+
public void testNonPublic1() throws CoreException {
try {
String[] sources1 = {
- "src/module-info.java",
+ "src/module-info.java",
"module mod.one { \n" +
" exports pm;\n" +
"}",
- "src/pm/C1.java",
+ "src/pm/C1.java",
"package pm;\n" +
"class C1 {\n" +
" public void test() {}\n" +
@@ -3243,22 +3243,22 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
p1.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
String[] sources2 = {
- "src/module-info.java",
+ "src/module-info.java",
"module mod.two { \n" +
" requires mod.one;\n" +
"}",
- "src/pm/sub/C2.java",
+ "src/pm/sub/C2.java",
"package pm.sub;\n" +
"class C2 {\n" +
" public void foo() {}\n" +
"}\n",
- "src/po/Client.java",
- "package po;\n" +
+ "src/po/Client.java",
+ "package po;\n" +
"import pm.*;\n" + // package is exported but type C1 is not public
- "public class Client {\n" +
+ "public class Client {\n" +
" void test1(C1 one) {\n" +
- " one.test();\n" +
- " }\n" +
+ " one.test();\n" +
+ " }\n" +
"}\n"
};
@@ -3270,20 +3270,20 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
this.workingCopies[2] = getCompilationUnit("/mod.two/src/po/Client.java").getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. ERROR in /mod.two/src/po/Client.java (at line 4)\n" +
- " void test1(C1 one) {\n" +
- " ^^\n" +
- "The type C1 is not visible\n" +
- "----------\n" +
- "2. ERROR in /mod.two/src/po/Client.java (at line 5)\n" +
- " one.test();\n" +
- " ^^^\n" +
- "The type C1 is not visible\n" +
+ "----------\n" +
+ "1. ERROR in /mod.two/src/po/Client.java (at line 4)\n" +
+ " void test1(C1 one) {\n" +
+ " ^^\n" +
+ "The type C1 is not visible\n" +
+ "----------\n" +
+ "2. ERROR in /mod.two/src/po/Client.java (at line 5)\n" +
+ " one.test();\n" +
+ " ^^^\n" +
+ "The type C1 is not visible\n" +
"----------\n",
this.problemRequestor);
- String expectedError = "The type C1 is not visible\n" +
+ String expectedError = "The type C1 is not visible\n" +
"The type C1 is not visible";
p2.getProject().getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);
IMarker[] markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
@@ -3315,7 +3315,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -3340,7 +3340,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
" }\n" +
"}"
};
-
+
IJavaProject p2 = setupModuleProject("com.greetings", src, new IClasspathEntry[] { dep });
p2.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
@@ -3413,7 +3413,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
p1.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p1.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
sortMarkers(markers);
- assertMarkers("Unexpected markers",
+ assertMarkers("Unexpected markers",
"The package java.util conflicts with a package accessible from another module: java.base\n" +
"The package java.util is accessible from more than one module: <unnamed>, java.base\n" +
"The method entrySet() is undefined for the type Map___",
@@ -3431,7 +3431,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -3465,7 +3465,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
p2.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
sortMarkers(markers);
- assertMarkers("Unexpected markers",
+ assertMarkers("Unexpected markers",
"The package org.astro conflicts with a package accessible from another module: org.astro\n" +
"The package org.astro is accessible from more than one module: com.greetings, org.astro",
markers);
@@ -3484,7 +3484,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports bundle.org.astro;\n" +
+ " exports bundle.org.astro;\n" +
"}",
"src/bundle/org/astro/World.java",
"package bundle.org.astro;\n" +
@@ -3496,7 +3496,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
sources = new String[] {
"src/module-info.java",
"module other.mod {\n" +
- " exports bundle.org;\n" +
+ " exports bundle.org;\n" +
"}",
"src/bundle/org/astro.java",
"package bundle.org;\n" +
@@ -3521,7 +3521,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
IJavaProject p2 = setupModuleProject("com.greetings", src, new IClasspathEntry[] { dep });
p2.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
- assertMarkers("Unexpected markers",
+ assertMarkers("Unexpected markers",
"bundle.org.astro.World cannot be resolved to a type", markers);
} finally {
deleteProject("org.astro");
@@ -3540,7 +3540,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports bundle.org.astro;\n" +
+ " exports bundle.org.astro;\n" +
"}",
"src/bundle/org/astro/World.java",
"package bundle.org.astro;\n" +
@@ -3601,7 +3601,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -3631,7 +3631,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p3.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
sortMarkers(markers);
- assertMarkers("Unexpected markers",
+ assertMarkers("Unexpected markers",
"The package org.astro is accessible from more than one module: org.astro, some.mod\n" +
"World cannot be resolved to a type",
markers);
@@ -3649,7 +3649,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -3682,7 +3682,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
p2.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
sortMarkers(markers);
- assertMarkers("Unexpected markers",
+ assertMarkers("Unexpected markers",
"The package org.astro conflicts with a package accessible from another module: org.astro\n" +
"The package org.astro is accessible from more than one module: <unnamed>, org.astro",
markers);
@@ -3699,7 +3699,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports bundle.org.astro;\n" +
+ " exports bundle.org.astro;\n" +
"}",
"src/bundle/org/astro/World.java",
"package bundle.org.astro;\n" +
@@ -3711,7 +3711,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
sources = new String[] {
"src/module-info.java",
"module other.mod {\n" +
- " exports bundle.org;\n" +
+ " exports bundle.org;\n" +
"}",
"src/bundle/org/astro.java",
"package bundle.org;\n" +
@@ -3737,7 +3737,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
IJavaProject p3 = setupModuleProject("com.greetings", src, new IClasspathEntry[] { dep1, dep2 });
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p3.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
- assertMarkers("Unexpected markers",
+ assertMarkers("Unexpected markers",
"bundle.org.astro.World cannot be resolved to a type", markers);
} finally {
deleteProject("org.astro");
@@ -3753,7 +3753,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports bundle.org.astro;\n" +
+ " exports bundle.org.astro;\n" +
"}",
"src/bundle/org/astro/World.java",
"package bundle.org.astro;\n" +
@@ -3765,7 +3765,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
sources = new String[] {
"src/module-info.java",
"module other.mod {\n" +
- " exports bundle.org;\n" +
+ " exports bundle.org;\n" +
"}",
"src/bundle/org/astro.java",
"package bundle.org;\n" +
@@ -3795,8 +3795,8 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p3.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
sortMarkers(markers);
- assertMarkers("Unexpected markers",
- "The package bundle.org conflicts with a package accessible from another module: other.mod\n" +
+ assertMarkers("Unexpected markers",
+ "The package bundle.org conflicts with a package accessible from another module: other.mod\n" +
"The package bundle.org is accessible from more than one module: <unnamed>, other.mod",
markers);
} finally {
@@ -3813,7 +3813,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports bundle.org.astro;\n" +
+ " exports bundle.org.astro;\n" +
"}",
"src/bundle/org/astro/World.java",
"package bundle.org.astro;\n" +
@@ -3859,7 +3859,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
}
public void testBug512053() throws CoreException, IOException {
Hashtable<String, String> javaCoreOptions = JavaCore.getOptions();
- this.sourceWorkspacePath = super.getSourceWorkspacePath() + java.io.File.separator + "bug512053";
+ this.sourceWorkspacePath = super.getSourceWorkspacePath() + java.io.File.separator + "bug512053";
try {
setUpJavaProject("bundle.test.a.callable", "9");
setUpJavaProject("bundle.test.a", "9");
@@ -3895,7 +3895,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
new HashMap<>(),
null,
getExternalResourcePath(libPath));
- String[] src = new String[] {
+ String[] src = new String[] {
"src/module-info.java",
"module com.greetings {\n" +
" requires test;\n" +
@@ -3946,7 +3946,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
IJavaProject p1 = setUpJavaProject("test_automodules", "9");
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
assertNoErrors();
- String[] src = new String[] {
+ String[] src = new String[] {
"src/module-info.java",
"module com.greetings {\n" +
" requires junit; // This should not be resolved\n" +
@@ -3969,7 +3969,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
- assertMarkers("Unexpected markers",
+ assertMarkers("Unexpected markers",
"junit cannot be resolved to a module", markers);
} finally {
this.deleteProject("test_automodules");
@@ -3983,7 +3983,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
Hashtable<String, String> javaCoreOptions = JavaCore.getOptions();
String libPath = "externalLib/test.jar";
try {
- String[] src = new String[] {
+ String[] src = new String[] {
"src/module-info.java",
"module com.greetings {\n" +
" exports com.greetings;\n" +
@@ -4000,7 +4000,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
File rootDir = new File(p1.getProject().findMember("bin").getLocation().toString());
Util.zip(rootDir, getExternalResourcePath(libPath));
- src = new String[] {
+ src = new String[] {
"src/module-info.java",
"module test_automodules {\n" +
" requires com.greetings;\n" +
@@ -4036,7 +4036,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
Hashtable<String, String> javaCoreOptions = JavaCore.getOptions();
String libPath = "externalLib/test.jar";
try {
- String[] src = new String[] {
+ String[] src = new String[] {
"src/module-info.java",
"module test {\n" +
" exports com.greetings;\n" +
@@ -4053,7 +4053,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
File rootDir = new File(p1.getProject().findMember("bin").getLocation().toString());
Util.zip(rootDir, getExternalResourcePath(libPath));
- src = new String[] {
+ src = new String[] {
"src/module-info.java",
"module test_automodules {\n" +
" requires test;\n" +
@@ -4088,7 +4088,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
Hashtable<String, String> javaCoreOptions = JavaCore.getOptions();
String libPath = "externalLib/test.jar";
try {
- String[] src = new String[] {
+ String[] src = new String[] {
"src/org/astro/World.java",
"package org.astro;\n" +
"public interface World {\n" +
@@ -4096,7 +4096,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"}"
};
IJavaProject p1 = setupModuleProject("org.astro", src);
- src = new String[] {
+ src = new String[] {
"src/org/greetings/Test.java",
"package org.greetings;\n" +
"import org.astro.World;\n" +
@@ -4111,7 +4111,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
File rootDir = new File(p2.getProject().findMember("bin").getLocation().toString());
Util.zip(rootDir, getExternalResourcePath(libPath));
- src = new String[] {
+ src = new String[] {
"src/module-info.java",
"module test_automodules {\n" +
" requires test;\n" +
@@ -4154,7 +4154,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
Hashtable<String, String> javaCoreOptions = JavaCore.getOptions();
String libPath = "externalLib/test.jar";
try {
- String[] src = new String[] {
+ String[] src = new String[] {
"src/module-info.java",
"module org.astro {\n" +
" exports org.astro;\n" +
@@ -4166,7 +4166,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"}"
};
IJavaProject p1 = setupModuleProject("org.astro", src);
- src = new String[] {
+ src = new String[] {
"src/com/greetings/Test.java",
"package com.greetings;\n" +
"import org.astro.World;\n" +
@@ -4181,7 +4181,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
File rootDir = new File(p2.getProject().findMember("bin").getLocation().toString());
Util.zip(rootDir, getExternalResourcePath(libPath));
- src = new String[] {
+ src = new String[] {
"src/module-info.java",
"module test_automodules {\n" +
" requires test;\n" +
@@ -4211,7 +4211,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p3.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
sortMarkers(markers);
- assertMarkers("Unexpected markers",
+ assertMarkers("Unexpected markers",
"The package org.astro is not accessible\n" +
"World cannot be resolved to a type", markers);
} finally {
@@ -4227,7 +4227,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
Hashtable<String, String> javaCoreOptions = JavaCore.getOptions();
String libPath = "externalLib/test.jar";
try {
- String[] src = new String[] {
+ String[] src = new String[] {
"src/org/astro/World.java",
"package org.astro;\n" +
"public interface World {\n" +
@@ -4235,7 +4235,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"}"
};
IJavaProject p1 = setupModuleProject("org.astro", src);
- src = new String[] {
+ src = new String[] {
"src/com/greetings/Test.java",
"package com.greetings;\n" +
"import org.astro.World;\n" +
@@ -4250,7 +4250,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
File rootDir = new File(p2.getProject().findMember("bin").getLocation().toString());
Util.zip(rootDir, getExternalResourcePath(libPath));
- src = new String[] {
+ src = new String[] {
"src/module-info.java",
"module test_automodules {\n" +
" requires test;\n" +
@@ -4279,7 +4279,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p3.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
assertMarkers("Unexpected markers",
- "Name of automatic module \'test\' is unstable, it is derived from the module\'s file name.\n" +
+ "Name of automatic module \'test\' is unstable, it is derived from the module\'s file name.\n" +
"The type org.astro.World is not accessible",
markers);
} finally {
@@ -4298,7 +4298,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
createFile("/Project1/src/pack1/Class1.java",
"package pack1;\n" +
"public class Class1 {}\n");
-
+
IJavaProject p2 = createJava9Project("Project2");
{
IClasspathEntry[] old = p2.getRawClasspath();
@@ -4323,7 +4323,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
}
public void testBug520246() throws CoreException {
try {
- String[] src = new String[] {
+ String[] src = new String[] {
"src/module-info.java",
"module test_automodules {\n" +
" requires java.sql;\n" +
@@ -4343,11 +4343,11 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
this.deleteProject("org.astro");
}
- }
+ }
public void testBug520147() throws CoreException, IOException {
Hashtable<String, String> javaCoreOptions = JavaCore.getOptions();
try {
- String[] src = new String[] {
+ String[] src = new String[] {
"src/module-info.java",
"module org.astro {\n" +
" exports org.astro;\n" +
@@ -4381,7 +4381,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
IClasspathEntry dep = JavaCore.newProjectEntry(p1.getPath(), null, false, new IClasspathAttribute[] {modAttr}, false);
IJavaProject p2 = setupModuleProject("com.greetings", src, new IClasspathEntry[] {dep});
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
- src = new String[] {
+ src = new String[] {
"src/module-info.java",
"module test {\n" +
" exports test;\n" +
@@ -4409,11 +4409,11 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
this.deleteProject("org.astro");
JavaCore.setOptions(javaCoreOptions);
}
- }
+ }
public void testBug520147a() throws CoreException, IOException {
Hashtable<String, String> javaCoreOptions = JavaCore.getOptions();
try {
- String[] src = new String[] {
+ String[] src = new String[] {
"src/module-info.java",
"module org.astro {\n" +
" exports org.astro;\n" +
@@ -4447,7 +4447,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
IClasspathEntry dep = JavaCore.newProjectEntry(p1.getPath(), null, false, new IClasspathAttribute[] {modAttr}, false);
IJavaProject p2 = setupModuleProject("com.greetings", src, new IClasspathEntry[] {dep});
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
- src = new String[] {
+ src = new String[] {
"src/module-info.java",
"module test {\n" +
" exports test;\n" +
@@ -4467,7 +4467,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
IJavaProject p3 = setupModuleProject("test", src, new IClasspathEntry[] {dep, dep2});
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p3.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
- assertMarkers("Unexpected markers",
+ assertMarkers("Unexpected markers",
"The type org.astro.World is not accessible", markers);
} finally {
this.deleteProject("test");
@@ -4479,7 +4479,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
public void testBug520147b() throws CoreException, IOException {
Hashtable<String, String> javaCoreOptions = JavaCore.getOptions();
try {
- String[] src = new String[] {
+ String[] src = new String[] {
"src/module-info.java",
"module org.astro {\n" +
" exports org.astro;\n" +
@@ -4516,11 +4516,11 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
sortMarkers(markers);
- assertMarkers("markers on com.greetings",
+ assertMarkers("markers on com.greetings",
"The package bundle.org conflicts with a package accessible from another module: org.astro",
markers);
- src = new String[] {
+ src = new String[] {
"src/module-info.java",
"module test {\n" +
" exports test;\n" +
@@ -4552,7 +4552,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
public void testSourceFolders_Bug519673() throws CoreException {
try {
// Setup project PSources1:
- String[] src = new String[] {
+ String[] src = new String[] {
"src/module-info.java",
"module PSources1 {\n" +
" //exports p.q;\n" +
@@ -4578,12 +4578,12 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
// was: ERROR: The package pkg does not exist or is empty
assertProblems(
"Unexpected problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
// Setup project PClient2:
- String[] src2 = new String[] {
+ String[] src2 = new String[] {
"src/module-info.java",
"module PClient2 {\n" +
" requires PSources1;\n" +
@@ -4606,7 +4606,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
this.workingCopies[0] = getCompilationUnit("PClient2/src/module-info.java").getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
@@ -4616,7 +4616,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
this.workingCopies[0] = getCompilationUnit("PClient2/src/x/Client.java").getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
} finally {
@@ -4627,36 +4627,36 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
public void testPrivateMethod_Bug515985() throws CoreException {
try {
String[] src = new String[] {
- "src/module-info.java",
+ "src/module-info.java",
"module mod.one { \n" +
" exports pm;\n" +
"}",
- "src/impl/Other.java",
+ "src/impl/Other.java",
"package impl;\n" +
"public class Other {\n" +
- " public void privateMethod() {}" +
+ " public void privateMethod() {}" +
"}\n",
- "src/pm/C1.java",
+ "src/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"
};
IJavaProject p1 = setupModuleProject("mod.one", src);
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
-
+
String[] src2 = new String[] {
- "src/module-info.java",
+ "src/module-info.java",
"module mod.two { \n" +
" requires mod.one;\n" +
"}",
- "src/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" +
+ "src/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"
};
IClasspathAttribute modAttr = new ClasspathAttribute("module", "true");
@@ -4768,7 +4768,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -4860,7 +4860,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
public void testBug520147c() throws CoreException, IOException {
Hashtable<String, String> javaCoreOptions = JavaCore.getOptions();
try {
- String[] src = new String[] {
+ String[] src = new String[] {
"src/module-info.java",
"module org.astro {\n" +
" exports org.astro;\n" +
@@ -4886,7 +4886,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
IClasspathEntry dep = JavaCore.newProjectEntry(p1.getPath(), null, false, new IClasspathAttribute[] {modAttr}, false);
IJavaProject p2 = setupModuleProject("com.greetings", src, new IClasspathEntry[] {dep});
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
- src = new String[] {
+ src = new String[] {
"src/module-info.java",
"module test {\n" +
" exports test;\n" +
@@ -4907,7 +4907,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
IJavaProject p3 = setupModuleProject("test", src, new IClasspathEntry[] {dep, dep2});
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p3.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
- assertMarkers("Unexpected markers",
+ assertMarkers("Unexpected markers",
"Name of automatic module \'com.greetings\' is unstable, it is derived from the module\'s file name.",
markers);
} finally {
@@ -4921,7 +4921,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
public void testBug519935() throws CoreException, IOException {
Hashtable<String, String> javaCoreOptions = JavaCore.getOptions();
try {
- String[] src = new String[] {
+ String[] src = new String[] {
"src/module-info.java",
"module org.astro {\n" +
" exports org.astro;\n" +
@@ -4933,7 +4933,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"}"
};
IJavaProject p1 = setupModuleProject("org.astro", src);
- src = new String[] {
+ src = new String[] {
"src/org/eclipse/pack/Test.java",
"package org.eclipse.pack;\n" +
"import org.astro.World;\n" +
@@ -4946,7 +4946,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
IClasspathEntry dep = JavaCore.newProjectEntry(p1.getPath());
IJavaProject p2 = setupModuleProject("test", src, new IClasspathEntry[] {dep});
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
- src = new String[] {
+ src = new String[] {
"src/module-info.java",
"module test_automodules {\n" +
" requires bin;\n" +
@@ -4988,7 +4988,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
@Deprecated
public void testBug520310() throws CoreException, IOException {
try {
- String[] src = new String[] {
+ String[] src = new String[] {
"src/module-info.java",
"module mod.one {\n" +
// " requires mod.two;\n" +
@@ -5003,7 +5003,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
IClasspathEntry modDep = JavaCore.newContainerEntry(new Path(JavaCore.MODULE_PATH_CONTAINER_ID));
IJavaProject p1 = setupModuleProject("mod.one", src, new IClasspathEntry[] {modDep});
- src = new String[] {
+ src = new String[] {
"src/module-info.java",
"module mod.two {\n" +
" requires mod.one;\n" +
@@ -5019,13 +5019,13 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"}"
};
IJavaProject p2 = setupModuleProject("mod.two", src, new IClasspathEntry[] {modDep});
-
+
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p1.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
assertMarkers("Unexpected markers in mod.one", "", markers);
markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
assertMarkers("Unexpected markers in mod.two", "", markers);
-
+
editFile("/mod.one/src/module-info.java",
"module mod.one {\n" +
" requires mod.two;\n" + // added
@@ -5034,14 +5034,14 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null); // modules see each other only on 2nd attempt, don't ask me...
markers = p1.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
- assertMarkers("Unexpected markers in mod.one",
+ assertMarkers("Unexpected markers in mod.one",
"Cycle exists in module dependencies, Module mod.one requires itself via mod.two",
markers);
markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
sortMarkers(markers);
- assertMarkers("Unexpected markers in mod.two",
- "The type org.astro.World is not accessible\n" + // cannot use cyclic requires
- "Cycle exists in module dependencies, Module mod.two requires itself via mod.one\n" +
+ assertMarkers("Unexpected markers in mod.two",
+ "The type org.astro.World is not accessible\n" + // cannot use cyclic requires
+ "Cycle exists in module dependencies, Module mod.two requires itself via mod.one\n" +
"World cannot be resolved to a type",
markers);
@@ -5059,21 +5059,21 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
IJavaProject javaProject = null;
try {
String src =
- "import java.*;\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(true);\n" +
- " }\n" +
+ "import java.*;\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(true);\n" +
+ " }\n" +
"}";
javaProject = createJava9Project("Test");
this.problemRequestor.initialize(src.toCharArray());
getWorkingCopy("/Test/src/X.java", src, true);
assertProblems("should have not problems",
- "----------\n" +
- "1. ERROR in /Test/src/X.java (at line 1)\n" +
- " import java.*;\n" +
- " ^^^^\n" +
- "The package java is not accessible\n" +
+ "----------\n" +
+ "1. ERROR in /Test/src/X.java (at line 1)\n" +
+ " import java.*;\n" +
+ " ^^^^\n" +
+ "The package java is not accessible\n" +
"----------\n",
this.problemRequestor);
} finally {
@@ -5090,10 +5090,10 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"public class X {}\n;"
};
String outputDirectory = Util.getOutputDirectory();
-
+
String jarPath = outputDirectory + File.separator + "lib-x.jar";
Util.createJar(sources, jarPath, "1.8");
-
+
javaProject = createJava9Project("mod.one", new String[] {"src"});
IClasspathAttribute[] attributes = { JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true") };
addClasspathEntry(javaProject, JavaCore.newLibraryEntry(new Path(jarPath), null, null, null, attributes, false));
@@ -5102,7 +5102,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"module mod.one { \n" +
" requires lib.x;\n" + // lib.x is derived from lib-x.jar
"}";
- createFile("/mod.one/src/module-info.java",
+ createFile("/mod.one/src/module-info.java",
srcMod);
createFolder("mod.one/src/q");
String srcX =
@@ -5111,22 +5111,22 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
" p.a.X f;\n" +
"}";
createFile("/mod.one/src/q/X.java", srcX);
-
+
this.problemRequestor.initialize(srcMod.toCharArray());
getWorkingCopy("/mod.one/module-info.java", srcMod, true);
assertProblems("module-info should have one warning",
- "----------\n" +
- "1. WARNING in /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. WARNING in /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",
this.problemRequestor);
this.problemRequestor.initialize(srcX.toCharArray());
getWorkingCopy("/mod.one/src/q/X.java", srcX, true);
assertProblems("X should have no problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
@@ -5147,14 +5147,14 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
};
String[] mfSource = {
"META-INF/MANIFEST.MF",
- "Manifest-Version: 1.0\n" +
+ "Manifest-Version: 1.0\n" +
"Automatic-Module-Name: org.eclipse.lib.x\n"
};
String outputDirectory = Util.getOutputDirectory();
String jarPath = outputDirectory + File.separator + "lib-x.jar";
Util.createJar(sources, mfSource, jarPath, "1.8");
-
+
javaProject = createJava9Project("mod.one", new String[] {"src"});
IClasspathAttribute[] attributes = { JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true") };
addClasspathEntry(javaProject, JavaCore.newLibraryEntry(new Path(jarPath), null, null, null, attributes, false));
@@ -5163,7 +5163,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"module mod.one { \n" +
" requires org.eclipse.lib.x;\n" + // from jar attribute
"}";
- createFile("/mod.one/src/module-info.java",
+ createFile("/mod.one/src/module-info.java",
srcMod);
createFolder("mod.one/src/q");
String srcX =
@@ -5176,14 +5176,14 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
this.problemRequestor.initialize(srcMod.toCharArray());
getWorkingCopy("/mod.one/module-info.java", srcMod, true);
assertProblems("module-info should have no problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
this.problemRequestor.initialize(srcX.toCharArray());
getWorkingCopy("/mod.one/src/q/X.java", srcX, true);
assertProblems("X should have no problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
@@ -5204,7 +5204,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"public class X {}\n;");
createFolder("auto/META-INF");
createFile("auto/META-INF/MANIFEST.MF",
- "Manifest-Version: 1.0\n" +
+ "Manifest-Version: 1.0\n" +
"Automatic-Module-Name: org.eclipse.lib.x\n");
javaProject = createJava9Project("mod.one", new String[] {"src"});
@@ -5215,7 +5215,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"module mod.one { \n" +
" requires org.eclipse.lib.x;\n" + // from manifest attribute
"}";
- createFile("/mod.one/src/module-info.java",
+ createFile("/mod.one/src/module-info.java",
srcMod);
createFolder("mod.one/src/q");
String srcX =
@@ -5229,14 +5229,14 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
this.problemRequestor.initialize(srcMod.toCharArray());
getWorkingCopy("/mod.one/module-info.java", srcMod, true);
assertProblems("module-info should have no problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
this.problemRequestor.initialize(srcX.toCharArray());
getWorkingCopy("/mod.one/src/q/X.java", srcX, true);
assertProblems("X should have no problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
@@ -5262,14 +5262,14 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
};
String[] mfSource = {
"META-INF/MANIFEST.MF",
- "Manifest-Version: 1.0\n" +
+ "Manifest-Version: 1.0\n" +
"Automatic-Module-Name: org.eclipse.lib.x\n" // automatic module reads all (incl. mod.one below)
};
String outputDirectory = Util.getOutputDirectory();
String jarPath = outputDirectory + File.separator + "lib-x.jar";
Util.createJar(sources, mfSource, jarPath, "1.8");
-
+
// first source module:
javaProject = createJava9Project("mod.one", new String[] {"src"});
IClasspathAttribute[] attributes = { JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true") };
@@ -5310,27 +5310,27 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
this.problemRequestor.initialize(srcMod.toCharArray());
getWorkingCopy("/mod.one/module-info.java", srcMod, true);
assertProblems("module-info should have no problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
this.problemRequestor.initialize(srcX.toCharArray());
getWorkingCopy("/mod.one/src/p/q/api/X.java", srcX, true);
assertProblems("X should have no problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
this.problemRequestor.initialize(srcY.toCharArray());
getWorkingCopy("/mod.two/src/p/q/Y.java", srcY, true);
assertProblems("Y should have no problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
javaProject.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
assertProblemMarkers("markers in mod.one", "", javaProject.getProject());
-
+
javaProject2.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
assertProblemMarkers("markers in mod.two", "", javaProject2.getProject());
@@ -5362,7 +5362,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"module mod.one { \n" +
" requires auto;\n" +
"}";
- createFile("/mod.one/src/module-info.java",
+ createFile("/mod.one/src/module-info.java",
srcMod);
createFolder("mod.one/src/q");
String srcX =
@@ -5376,14 +5376,14 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
this.problemRequestor.initialize(srcMod.toCharArray());
getWorkingCopy("/mod.one/module-info.java", srcMod, true);
assertProblems("module-info should have no problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
this.problemRequestor.initialize(srcX.toCharArray());
getWorkingCopy("/mod.one/src/q/X.java", srcX, true);
assertProblems("X should have no problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
@@ -5415,18 +5415,18 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"module mod.one { \n" +
" requires auto;\n" +
"}";
- createFile("/mod.one/src/module-info.java",
+ createFile("/mod.one/src/module-info.java",
srcMod);
auto.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
this.problemRequestor.initialize(srcMod.toCharArray());
getWorkingCopy("/mod.one/module-info.java", srcMod, true);
assertProblems("module-info should have only one error",
- "----------\n" +
- "1. ERROR in /mod.one/module-info.java (at line 2)\n" +
- " requires auto;\n" +
- " ^^^^\n" +
- "Name of automatic module \'auto\' is unstable, it is derived from the module\'s file name.\n" +
+ "----------\n" +
+ "1. ERROR in /mod.one/module-info.java (at line 2)\n" +
+ " requires auto;\n" +
+ " ^^^^\n" +
+ "Name of automatic module \'auto\' is unstable, it is derived from the module\'s file name.\n" +
"----------\n",
this.problemRequestor);
} finally {
@@ -5441,7 +5441,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
public void testPatch1() throws CoreException, IOException {
try {
IJavaProject mainProject = createJava9Project("org.astro");
- String[] sources = {
+ String[] sources = {
"src/module-info.java",
"module org.astro {\n" + // no exports
"}",
@@ -5479,7 +5479,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"}\n"
};
createSourceFiles(patchProject, patchSources);
-
+
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = mainProject.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
assertMarkers("Unexpected markers",
@@ -5500,8 +5500,8 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
cu.getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. ERROR in /org.astro/src/org/astro/World.java\n" +
+ "----------\n" +
+ "1. ERROR in /org.astro/src/org/astro/World.java\n" +
"org.astro.test cannot be resolved to a type\n" +
"----------\n",
this.problemRequestor);
@@ -5536,7 +5536,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"}\n"
};
createSourceFiles(patchProject, patchSources);
-
+
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
assertNoErrors();
@@ -5570,7 +5570,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String jarPath = outputDirectory + File.separator + "mod-one.jar";
Util.createJar(sources, jarPath, "9");
- IJavaProject patchProject = createJava9Project("mod.one.patch");
+ IJavaProject patchProject = createJava9Project("mod.one.patch");
IClasspathAttribute[] attributes = {
JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true"),
JavaCore.newClasspathAttribute(IClasspathAttribute.PATCH_MODULE, "mod.one=/mod.one.patch")
@@ -5584,7 +5584,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"}\n"
};
createSourceFiles(patchProject, patchSources);
-
+
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
assertNoErrors();
@@ -5629,7 +5629,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"}\n"
};
createSourceFiles(project, sources);
-
+
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = project.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
assertMarkers("Unexpected markers",
@@ -5642,7 +5642,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
assertProblems(
"Unexpected problems",
"----------\n" +
- "1. ERROR in /org.astro/src/module-info.java\n" +
+ "1. ERROR in /org.astro/src/module-info.java\n" +
"java.sql cannot be resolved to a module\n" +
"----------\n",
this.problemRequestor);
@@ -5697,7 +5697,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"}\n"
};
createSourceFiles(project, sources);
-
+
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = project.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
assertMarkers("Unexpected markers",
@@ -5743,33 +5743,33 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = {
"src/org/astro/ProblemWithPostConstruct.java",
"package org.astro;\n" +
- "import javax.annotation.PostConstruct;\n" +
- "\n" +
+ "import javax.annotation.PostConstruct;\n" +
+ "\n" +
"public class ProblemWithPostConstruct {\n" +
- " @PostConstruct void init() {}\n" +
+ " @PostConstruct void init() {}\n" +
"}\n"
};
createSourceFiles(project, sources);
-
+
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = project.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
sortMarkers(markers);
assertMarkers("Unexpected markers",
- "The import javax.annotation.PostConstruct cannot be resolved\n" +
+ "The import javax.annotation.PostConstruct cannot be resolved\n" +
"PostConstruct cannot be resolved to a type", // not in default root modules: java.xml.ws.annotation
markers);
-
+
this.problemRequestor.reset();
ICompilationUnit cu = getCompilationUnit("/org.astro/src/org/astro/ProblemWithPostConstruct.java");
cu.getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. ERROR in /org.astro/src/org/astro/ProblemWithPostConstruct.java\n" +
- "The import javax.annotation.PostConstruct cannot be resolved\n" +
- "----------\n" +
- "2. ERROR in /org.astro/src/org/astro/ProblemWithPostConstruct.java\n" +
- "PostConstruct cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in /org.astro/src/org/astro/ProblemWithPostConstruct.java\n" +
+ "The import javax.annotation.PostConstruct cannot be resolved\n" +
+ "----------\n" +
+ "2. ERROR in /org.astro/src/org/astro/ProblemWithPostConstruct.java\n" +
+ "PostConstruct cannot be resolved to a type\n" +
"----------\n",
this.problemRequestor);
} finally {
@@ -5835,7 +5835,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
};
IJavaProject p1 = setupModuleProject("nonmodular1", sources);
p1.setOption(JavaCore.COMPILER_COMPLIANCE, "1.8"); // compile with 1.8 compliance to avoid error about package conflict
-
+
IClasspathEntry dep = JavaCore.newProjectEntry(p1.getPath(), null, false,
new IClasspathAttribute[] {},
false/*not exported*/);
@@ -5893,18 +5893,18 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
IJavaProject p2 = setupModuleProject("mod.two", sources2, deps);
p2.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
assertNoErrors();
-
+
this.problemRequestor.reset();
ICompilationUnit cu = getCompilationUnit("/mod.two/src/client/Client.java");
cu.getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
} finally {
- deleteProject("mod.one");
- deleteProject("mod.two");
+ deleteProject("mod.one");
+ deleteProject("mod.two");
}
}
public void testBug522671() throws Exception {
@@ -5987,7 +5987,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
cu.getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
} finally {
@@ -6096,26 +6096,26 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
" public static void lookup(String s) throws UnavailableServiceException {}\n" +
"}\n");
- // non-modular project consuming the non-modular jnlp, instead of the module from the JRE:
+ // non-modular project consuming the non-modular jnlp, instead of the module from the JRE:
IJavaProject p1 = createJava9ProjectWithJREAttributes("nonmod1", new String[] {"src"}, jreAttribs);
addClasspathEntry(p1, JavaCore.newProjectEntry(jnlp.getPath()));
createFolder("nonmod1/src/test");
createFile("nonmod1/src/test/Test.java",
- "package test;\n" +
- "import javax.jnlp.ServiceManager;\n" +
- "import javax.jnlp.UnavailableServiceException;\n" +
- "\n" +
- "public class Test {\n" +
- "\n" +
- " void init() {\n" +
- " try {\n" +
- " ServiceManager.lookup(\"\");\n" +
- " } catch (final UnavailableServiceException e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- "\n" +
- " }\n" +
+ "package test;\n" +
+ "import javax.jnlp.ServiceManager;\n" +
+ "import javax.jnlp.UnavailableServiceException;\n" +
+ "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " void init() {\n" +
+ " try {\n" +
+ " ServiceManager.lookup(\"\");\n" +
+ " } catch (final UnavailableServiceException e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ "\n" +
+ " }\n" +
"}\n");
p1.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
assertNoErrors();
@@ -6125,7 +6125,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
cu.getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
@@ -6144,20 +6144,20 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"public class DummyA {}\n;"
};
String outputDirectory = Util.getOutputDirectory();
-
+
String jarPath = outputDirectory + File.separator + "automod.jar";
Util.createJar(sources, jarPath, "1.8");
-
+
javaProject = createJava9Project("mod1", new String[] {"src"});
IClasspathAttribute[] attributes = { JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true") };
addClasspathEntry(javaProject, JavaCore.newLibraryEntry(new Path(jarPath), null, null, null, attributes, false));
String srcMod =
- "module mod1 {\n" +
- " exports com.mod1.pack1;\n" +
- " requires automod;\n" +
+ "module mod1 {\n" +
+ " exports com.mod1.pack1;\n" +
+ " requires automod;\n" +
"}";
- createFile("/mod1/src/module-info.java",
+ createFile("/mod1/src/module-info.java",
srcMod);
createFolder("/mod1/src/com/mod1/pack1");
String srcX =
@@ -6165,22 +6165,22 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"public class Dummy {\n" +
"}";
createFile("/mod1/src/com/mod1/pack1/Dummy.java", srcX);
-
+
this.problemRequestor.initialize(srcMod.toCharArray());
getWorkingCopy("/mod1/src/module-info.java", srcMod, true);
assertProblems("module-info should have exactly one warning",
- "----------\n" +
- "1. WARNING in /mod1/src/module-info.java (at line 3)\n" +
- " requires automod;\n" +
- " ^^^^^^^\n" +
- "Name of automatic module \'automod\' is unstable, it is derived from the module\'s file name.\n" +
+ "----------\n" +
+ "1. WARNING in /mod1/src/module-info.java (at line 3)\n" +
+ " requires automod;\n" +
+ " ^^^^^^^\n" +
+ "Name of automatic module \'automod\' is unstable, it is derived from the module\'s file name.\n" +
"----------\n",
this.problemRequestor);
this.problemRequestor.initialize(srcX.toCharArray());
getWorkingCopy("/mod1/src/com/mod1/pack1/Dummy.java", srcX, true);
assertProblems("X should have no problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
@@ -6254,7 +6254,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
// modulepath
IClasspathEntry[] deps3 = { JavaCore.newProjectEntry(p1.getPath(), null, false, attr, false) };
IJavaProject p3 = setupModuleProject("other", sources3, deps3);
-
+
String[] sources4 = {
"src/test/Test.java",
"package test;\n" +
@@ -6279,7 +6279,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
};
IJavaProject p4 = setupModuleProject("test", sources4, deps4);
p4.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
-
+
assertNoErrors();
} finally {
JavaCore.setOptions(javaCoreOptions);
@@ -6302,11 +6302,11 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
IJavaProject javaProject = createJava9ProjectWithJREAttributes("mod1", new String[] {"src"}, attrs);
String srcMod =
- "module mod1 {\n" +
- " exports com.mod1.pack1;\n" +
- " requires jdk.rmic;\n" +
+ "module mod1 {\n" +
+ " exports com.mod1.pack1;\n" +
+ " requires jdk.rmic;\n" +
"}";
- createFile("/mod1/src/module-info.java",
+ createFile("/mod1/src/module-info.java",
srcMod);
createFolder("/mod1/src/com/mod1/pack1");
String srcX =
@@ -6322,14 +6322,14 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
this.problemRequestor.initialize(srcMod.toCharArray());
getWorkingCopy("/mod1/src/module-info.java", srcMod, true);
assertProblems("module-info should have no problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
this.problemRequestor.initialize(srcX.toCharArray());
getWorkingCopy("/mod1/src/com/mod1/pack1/Dummy.java", srcX, true);
assertProblems("Dummy should have no problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
@@ -6350,11 +6350,11 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
createJava9ProjectWithJREAttributes("mod1", new String[] {"src"}, attrs);
String srcMod1 =
- "module mod1 {\n" +
- " exports com.mod1.pack1;\n" +
- " requires jdk.rmic;\n" +
+ "module mod1 {\n" +
+ " exports com.mod1.pack1;\n" +
+ " requires jdk.rmic;\n" +
"}";
- createFile("/mod1/src/module-info.java",
+ createFile("/mod1/src/module-info.java",
srcMod1);
createFolder("/mod1/src/com/mod1/pack1");
String srcX1 =
@@ -6363,16 +6363,16 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"public class Dummy implements Constants {\n" +
"}";
createFile("/mod1/src/com/mod1/pack1/Dummy.java", srcX1);
-
+
// second project cannot see jdk.rmic/sun.rmi.rmic:
createJava9Project("mod2", new String[] {"src"});
String srcMod2 =
- "module mod2 {\n" +
- " exports com.mod2.pack1;\n" +
- " requires jdk.rmic;\n" +
+ "module mod2 {\n" +
+ " exports com.mod2.pack1;\n" +
+ " requires jdk.rmic;\n" +
"}";
- createFile("/mod2/src/module-info.java",
+ createFile("/mod2/src/module-info.java",
srcMod2);
createFolder("/mod2/src/com/mod2/pack1");
String srcX2 =
@@ -6389,7 +6389,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
this.problemRequestor.initialize(srcX1.toCharArray());
getWorkingCopy("/mod1/src/com/mod1/pack1/Dummy.java", srcX1, true);
assertProblems("Dummy in mod1 should have no problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
@@ -6397,16 +6397,16 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
this.problemRequestor.initialize(srcX2.toCharArray());
getWorkingCopy("/mod2/src/com/mod2/pack1/Dummy.java", srcX2, true);
assertProblems("Dummy in mod2 should have problems",
- "----------\n" +
- "1. ERROR in /mod2/src/com/mod2/pack1/Dummy.java (at line 2)\n" +
- " import sun.rmi.rmic.Main;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The type sun.rmi.rmic.Main is not accessible\n" +
- "----------\n" +
- "2. ERROR in /mod2/src/com/mod2/pack1/Dummy.java (at line 5)\n" +
- " return Main.getString(\"in\");\n" +
- " ^^^^\n" +
- "Main cannot be resolved\n" +
+ "----------\n" +
+ "1. ERROR in /mod2/src/com/mod2/pack1/Dummy.java (at line 2)\n" +
+ " import sun.rmi.rmic.Main;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The type sun.rmi.rmic.Main is not accessible\n" +
+ "----------\n" +
+ "2. ERROR in /mod2/src/com/mod2/pack1/Dummy.java (at line 5)\n" +
+ " return Main.getString(\"in\");\n" +
+ " ^^^^\n" +
+ "Main cannot be resolved\n" +
"----------\n",
this.problemRequestor);
@@ -6416,7 +6416,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
IMarker[] markers = getWorkspace().getRoot().findMarkers(null, true, IResource.DEPTH_INFINITE);
sortMarkers(markers);
assertMarkers("Unexpected markers",
- "The type sun.rmi.rmic.Main is not accessible\n" +
+ "The type sun.rmi.rmic.Main is not accessible\n" +
"Main cannot be resolved",
markers);
} finally {
@@ -6427,12 +6427,12 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
public void testBug525918() throws CoreException {
try {
- String[] sources = new String[] {
+ String[] sources = new String[] {
"src/module-info.java",
- "import p.MyAbstractDriver;\n" +
- "import p.MyAbstractDriverWithProvider;\n" +
- "import p.MyDriverInf;\n" +
- "import p.MyInfWithProvider;\n" +
+ "import p.MyAbstractDriver;\n" +
+ "import p.MyAbstractDriverWithProvider;\n" +
+ "import p.MyDriverInf;\n" +
+ "import p.MyInfWithProvider;\n" +
"module test {\n" +
" requires java.sql;\n" +
" provides java.sql.Driver with MyDriverInf, MyAbstractDriver, MyInfWithProvider, MyAbstractDriverWithProvider;" +
@@ -6442,22 +6442,22 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"public interface MyDriverInf extends java.sql.Driver { }",
"src/p/MyAbstractDriver.java",
"package p;\n" +
- "public abstract class MyAbstractDriver {\n" +
- " public MyAbstractDriver() { }\n" +
+ "public abstract class MyAbstractDriver {\n" +
+ " public MyAbstractDriver() { }\n" +
"}",
"src/p/MyInfWithProvider.java",
"package p;\n" +
- "public interface MyInfWithProvider {\n" +
- " public static java.sql.Driver provider() {\n" +
- " return null;\n" +
- " }\n" +
+ "public interface MyInfWithProvider {\n" +
+ " public static java.sql.Driver provider() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n",
"src/p/MyAbstractDriverWithProvider.java",
"package p;\n" +
- "public abstract class MyAbstractDriverWithProvider {\n" +
- " public static java.sql.Driver provider() {\n" +
- " return null;\n" +
- " }\n" +
+ "public abstract class MyAbstractDriverWithProvider {\n" +
+ " public static java.sql.Driver provider() {\n" +
+ " return null;\n" +
+ " }\n" +
"}"
};
IJavaProject p1 = setupModuleProject("test", sources);
@@ -6477,14 +6477,14 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
public void testBug527576() throws Exception {
IJavaProject javaProject = null;
try {
-
+
javaProject = createJava9Project("mod1", new String[] {"src"});
String[] sources = {
"org/junit/Assert.java",
"package org.junit;\n" +
"public class Assert {}\n;"
};
-
+
Path jarPath = new Path('/' + javaProject.getProject().getName() + '/' + "localjunit.jar");
Util.createJar(sources, javaProject.getProject().getWorkspace().getRoot().getFile(jarPath).getRawLocation().toOSString(), "1.8");
javaProject.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
@@ -6494,7 +6494,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String srcMod =
"module mod1 {\n" +
"}";
- createFile("/mod1/src/module-info.java",
+ createFile("/mod1/src/module-info.java",
srcMod);
createFolder("/mod1/src/com/mod1/pack1");
String srcX =
@@ -6503,36 +6503,36 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"public class Dummy extends Assert {\n" +
"}";
createFile("/mod1/src/com/mod1/pack1/Dummy.java", srcX);
-
+
this.problemRequestor.initialize(srcMod.toCharArray());
getWorkingCopy("/mod1/src/module-info.java", srcMod, true);
assertProblems("module-info should have no problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
this.problemRequestor.initialize(srcX.toCharArray());
getWorkingCopy("/mod1/src/com/mod1/pack1/Dummy.java", srcX, true);
assertProblems("X should have errors because Assert should not be visible",
- "----------\n" +
- "1. ERROR in /mod1/src/com/mod1/pack1/Dummy.java (at line 2)\n" +
- " import org.junit.Assert;\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The type org.junit.Assert is not accessible\n" +
- "----------\n" +
- "2. ERROR in /mod1/src/com/mod1/pack1/Dummy.java (at line 3)\n" +
- " public class Dummy extends Assert {\n" +
- " ^^^^^^\n" +
- "Assert cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in /mod1/src/com/mod1/pack1/Dummy.java (at line 2)\n" +
+ " import org.junit.Assert;\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The type org.junit.Assert is not accessible\n" +
+ "----------\n" +
+ "2. ERROR in /mod1/src/com/mod1/pack1/Dummy.java (at line 3)\n" +
+ " public class Dummy extends Assert {\n" +
+ " ^^^^^^\n" +
+ "Assert cannot be resolved to a type\n" +
"----------\n",
this.problemRequestor);
javaProject.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = javaProject.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
sortMarkers(markers);
- assertMarkers("Unexpected markers",
- "The type org.junit.Assert is not accessible\n" +
- "Assert cannot be resolved to a type",
+ assertMarkers("Unexpected markers",
+ "The type org.junit.Assert is not accessible\n" +
+ "Assert cannot be resolved to a type",
markers);
} finally {
if (javaProject != null)
@@ -6551,11 +6551,11 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
jrtPath = iClasspathEntry.getPath().toOSString();
IAccessRule[] pathRules = new IAccessRule[1];
pathRules[0] = JavaCore.newAccessRule(new Path("java/awt/**"), IAccessRule.K_NON_ACCESSIBLE);
- IClasspathEntry newEntry = JavaCore.newLibraryEntry(iClasspathEntry.getPath(),
- iClasspathEntry.getSourceAttachmentPath(),
- iClasspathEntry.getSourceAttachmentRootPath(),
- pathRules,
- iClasspathEntry.getExtraAttributes(),
+ IClasspathEntry newEntry = JavaCore.newLibraryEntry(iClasspathEntry.getPath(),
+ iClasspathEntry.getSourceAttachmentPath(),
+ iClasspathEntry.getSourceAttachmentRootPath(),
+ pathRules,
+ iClasspathEntry.getExtraAttributes(),
iClasspathEntry.isExported());
rawClasspath[i] = newEntry;
break;
@@ -6578,8 +6578,8 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
waitForAutoBuild();
p1.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p1.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
-
- assertMarkers("Unexpected markers", "Access restriction: The type 'Image' is not API (restriction on required library '"+
+
+ assertMarkers("Unexpected markers", "Access restriction: The type 'Image' is not API (restriction on required library '"+
jrtPath + "')", markers);
} finally {
deleteProject(p1);
@@ -6597,11 +6597,11 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
jrtPath = iClasspathEntry.getPath().toOSString();
IAccessRule[] pathRules = new IAccessRule[1];
pathRules[0] = JavaCore.newAccessRule(new Path("java/awt/Image"), IAccessRule.K_NON_ACCESSIBLE);
- IClasspathEntry newEntry = JavaCore.newLibraryEntry(iClasspathEntry.getPath(),
- iClasspathEntry.getSourceAttachmentPath(),
- iClasspathEntry.getSourceAttachmentRootPath(),
- pathRules,
- iClasspathEntry.getExtraAttributes(),
+ IClasspathEntry newEntry = JavaCore.newLibraryEntry(iClasspathEntry.getPath(),
+ iClasspathEntry.getSourceAttachmentPath(),
+ iClasspathEntry.getSourceAttachmentRootPath(),
+ pathRules,
+ iClasspathEntry.getExtraAttributes(),
iClasspathEntry.isExported());
rawClasspath[i] = newEntry;
break;
@@ -6629,9 +6629,9 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
IMarker[] markers = p1.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
sortMarkers(markers);
- assertMarkers("Unexpected markers",
- "Access restriction: The type \'Image\' is not API (restriction on required library '"+ jrtPath + "')\n" +
- "The type Graphics from module java.desktop may not be accessible to clients due to missing \'requires transitive\'\n" +
+ assertMarkers("Unexpected markers",
+ "Access restriction: The type \'Image\' is not API (restriction on required library '"+ jrtPath + "')\n" +
+ "The type Graphics from module java.desktop may not be accessible to clients due to missing \'requires transitive\'\n" +
"Access restriction: The method \'Image.getGraphics()\' is not API (restriction on required library '"+ jrtPath + "')", markers);
} finally {
deleteProject(p1);
@@ -6649,11 +6649,11 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
jrtPath = iClasspathEntry.getPath().toOSString();
IAccessRule[] pathRules = new IAccessRule[1];
pathRules[0] = JavaCore.newAccessRule(new Path("java/awt/**"), IAccessRule.K_NON_ACCESSIBLE);
- IClasspathEntry newEntry = JavaCore.newLibraryEntry(iClasspathEntry.getPath(),
- iClasspathEntry.getSourceAttachmentPath(),
- iClasspathEntry.getSourceAttachmentRootPath(),
- pathRules,
- iClasspathEntry.getExtraAttributes(),
+ IClasspathEntry newEntry = JavaCore.newLibraryEntry(iClasspathEntry.getPath(),
+ iClasspathEntry.getSourceAttachmentPath(),
+ iClasspathEntry.getSourceAttachmentRootPath(),
+ pathRules,
+ iClasspathEntry.getExtraAttributes(),
iClasspathEntry.isExported());
rawClasspath[i] = newEntry;
break;
@@ -6672,7 +6672,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
p1.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p1.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
- assertMarkers("Unexpected markers", "Access restriction: The type 'Image' is not API (restriction on required library '"+
+ assertMarkers("Unexpected markers", "Access restriction: The type 'Image' is not API (restriction on required library '"+
jrtPath + "')", markers);
} finally {
deleteProject(p1);
@@ -6681,7 +6681,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
// Bug 520713: allow test code to access code on the classpath
public void testWithTestAttributeAndTestDependencyOnClassPath() throws CoreException, IOException {
String outputDirectory = Util.getOutputDirectory();
-
+
String jarPath = outputDirectory + File.separator + "mytestlib.jar";
IJavaProject project1 = null;
IJavaProject project2 = null;
@@ -6692,7 +6692,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"public class Test {}\n;"
};
Util.createJar(sources, jarPath, "1.8");
-
+
project1 = createJava9Project("Project1", new String[] {"src"});
addClasspathEntry(project1, JavaCore.newSourceEntry(new Path("/Project1/src-tests"), null, null, new Path("/Project1/bin-tests"), new IClasspathAttribute[] { JavaCore.newClasspathAttribute(IClasspathAttribute.TEST, "true") }));
addClasspathEntry(project1, JavaCore.newLibraryEntry(new Path(jarPath), null, null, null, new IClasspathAttribute[] { JavaCore.newClasspathAttribute(IClasspathAttribute.TEST, "true") }, false));
@@ -6703,49 +6703,49 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"module m1 {\n" +
" exports p1;\n" +
"}");
- createFile("/Project1/src/p1/P1Class.java",
- "package p1;\n" +
- "\n" +
- "public class P1Class {\n"+
- "}\n"
+ createFile("/Project1/src/p1/P1Class.java",
+ "package p1;\n" +
+ "\n" +
+ "public class P1Class {\n"+
+ "}\n"
);
createFile("/Project1/src/p1/Production1.java",
- "package p1;\n" +
- "\n" +
- "public class Production1 {\n" +
- " void p1() {\n" +
- " new P1Class(); // ok\n" +
- " new T1Class(); // forbidden\n" +
- " }\n" +
- "}\n" +
+ "package p1;\n" +
+ "\n" +
+ "public class Production1 {\n" +
+ " void p1() {\n" +
+ " new P1Class(); // ok\n" +
+ " new T1Class(); // forbidden\n" +
+ " }\n" +
+ "}\n" +
""
);
- createFile("/Project1/src-tests/p1/T1Class.java",
- "package p1;\n" +
- "\n" +
- "public class T1Class {\n"+
- "}\n"
+ createFile("/Project1/src-tests/p1/T1Class.java",
+ "package p1;\n" +
+ "\n" +
+ "public class T1Class {\n"+
+ "}\n"
);
- createFile("/Project1/src-tests/p1/Test1.java",
- "package p1;\n" +
- "\n" +
- "public class Test1 extends my.test.Test {\n" +
- " void test1() {\n" +
- " new P1Class(); // ok\n" +
- " new T1Class(); // ok\n" +
- " }\n" +
- "}\n" +
- ""
+ createFile("/Project1/src-tests/p1/Test1.java",
+ "package p1;\n" +
+ "\n" +
+ "public class Test1 extends my.test.Test {\n" +
+ " void test1() {\n" +
+ " new P1Class(); // ok\n" +
+ " new T1Class(); // ok\n" +
+ " }\n" +
+ "}\n" +
+ ""
);
project1.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
-
+
IMarker[] markers = project1.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
sortMarkers(markers);
- assertMarkers("Unexpected markers",
- "T1Class cannot be resolved to a type" +
- "",
+ assertMarkers("Unexpected markers",
+ "T1Class cannot be resolved to a type" +
+ "",
markers);
-
+
project2 = createJava9Project("Project2", new String[] {"src"});
addClasspathEntry(project2, JavaCore.newProjectEntry(new Path("/Project1"), null, false, new IClasspathAttribute[] { JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true") }, false));
addClasspathEntry(project2, JavaCore.newSourceEntry(new Path("/Project2/src-tests"), null, null, new Path("/Project2/bin-tests"), new IClasspathAttribute[] { JavaCore.newClasspathAttribute(IClasspathAttribute.TEST, "true") }));
@@ -6756,58 +6756,58 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"module m2 {\n" +
" requires m1;\n" +
"}");
- createFile("/Project2/src/p2/P2Class.java",
- "package p2;\n" +
- "\n" +
- "public class P2Class {\n"+
- "}\n"
+ createFile("/Project2/src/p2/P2Class.java",
+ "package p2;\n" +
+ "\n" +
+ "public class P2Class {\n"+
+ "}\n"
);
createFile("/Project2/src/p2/Production2.java",
- "package p2;\n" +
- "\n" +
- "import p1.P1Class;\n" +
- "import p1.T1Class;\n" +
- "\n" +
- "public class Production2 {\n" +
- " void p2() {\n" +
- " new P1Class(); // ok\n" +
- " new P2Class(); // ok\n" +
- " new T1Class(); // forbidden\n" +
- " new T2Class(); // forbidden\n" +
- " }\n" +
- "}\n" +
+ "package p2;\n" +
+ "\n" +
+ "import p1.P1Class;\n" +
+ "import p1.T1Class;\n" +
+ "\n" +
+ "public class Production2 {\n" +
+ " void p2() {\n" +
+ " new P1Class(); // ok\n" +
+ " new P2Class(); // ok\n" +
+ " new T1Class(); // forbidden\n" +
+ " new T2Class(); // forbidden\n" +
+ " }\n" +
+ "}\n" +
""
);
- createFile("/Project2/src-tests/p2/T2Class.java",
- "package p2;\n" +
- "\n" +
- "public class T2Class {\n"+
- "}\n"
+ createFile("/Project2/src-tests/p2/T2Class.java",
+ "package p2;\n" +
+ "\n" +
+ "public class T2Class {\n"+
+ "}\n"
);
- createFile("/Project2/src-tests/p2/Test2.java",
- "package p2;\n" +
- "\n" +
- "import p1.P1Class;\n" +
- "import p1.T1Class;\n" +
- "\n" +
- "public class Test2 extends p1.Test1 {\n" +
- " void test2() {\n" +
- " new P1Class(); // ok\n" +
- " new P2Class(); // ok\n" +
- " new T1Class(); // ok\n" +
- " new T2Class(); // ok\n" +
- " }\n" +
- "}\n" +
- ""
+ createFile("/Project2/src-tests/p2/Test2.java",
+ "package p2;\n" +
+ "\n" +
+ "import p1.P1Class;\n" +
+ "import p1.T1Class;\n" +
+ "\n" +
+ "public class Test2 extends p1.Test1 {\n" +
+ " void test2() {\n" +
+ " new P1Class(); // ok\n" +
+ " new P2Class(); // ok\n" +
+ " new T1Class(); // ok\n" +
+ " new T2Class(); // ok\n" +
+ " }\n" +
+ "}\n" +
+ ""
);
project1.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
-
+
IMarker[] markers2 = project2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
sortMarkers(markers2);
- assertMarkers("Unexpected markers",
- "The import p1.T1Class cannot be resolved\n" +
- "T1Class cannot be resolved to a type\n" +
- "T2Class cannot be resolved to a type",
+ assertMarkers("Unexpected markers",
+ "The import p1.T1Class cannot be resolved\n" +
+ "T1Class cannot be resolved to a type\n" +
+ "T2Class cannot be resolved to a type",
markers2);
} finally {
if (project1 != null)
@@ -6829,8 +6829,8 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String[] sources = {
"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" +
@@ -6845,26 +6845,26 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
addClasspathEntry(project1, JavaCore.newLibraryEntry(new Path(jarPath), null, null));
createFolder("/Project1/src/p1");
- createFile("/Project1/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"
+ createFile("/Project1/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"
);
project1.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = project1.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
sortMarkers(markers);
- assertMarkers("Unexpected markers",
- "The value of the local variable context is not used",
+ assertMarkers("Unexpected markers",
+ "The value of the local variable context is not used",
markers);
} finally {
if (project1 != null)
@@ -7002,8 +7002,8 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
p1.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p1.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
sortMarkers(markers);
- assertMarkers("Unexpected markers",
- "Archive for required library: \'test.txt\' in project \'Bug522601\' cannot be read or is not a valid ZIP file\n" +
+ assertMarkers("Unexpected markers",
+ "Archive for required library: \'test.txt\' in project \'Bug522601\' cannot be read or is not a valid ZIP file\n" +
"The project cannot be built until build path errors are resolved", markers);
} finally {
deleteProject(p1);
@@ -7025,7 +7025,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
new HashMap<>(),
null,
getExternalResourcePath(libPath));
- String[] src = new String[] {
+ String[] src = new String[] {
"src/module-info.java",
"module com.greetings {\n" +
" requires transitive test;\n" +
@@ -7098,7 +7098,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = project.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
assertMarkers("Unexpected markers", "Version10 cannot be resolved to a module", markers);
-
+
project.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_10);
project.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_10);
project.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_10);
@@ -7114,7 +7114,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
// missing linked jar must not cause NPE
public void testBug540904() throws CoreException, IOException {
try {
- String[] src = new String[] {
+ String[] src = new String[] {
"src/test/Test.java",
"package test;\n" +
"public class Test {\n" +
@@ -7138,9 +7138,9 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
createSourceFiles(common,
new String[] {
"src/main/java/module-info.java",
- "module org.sheepy.common {\n" +
- " requires transitive org.eclipse.emf.common;\n" +
- " requires transitive org.eclipse.emf.ecore;\n" +
+ "module org.sheepy.common {\n" +
+ " requires transitive org.eclipse.emf.common;\n" +
+ " requires transitive org.eclipse.emf.ecore;\n" +
"}\n"
});
IFolder libs = createFolder("/Bug540788.common/libs");
@@ -7178,18 +7178,18 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
createSourceFiles(vulkan,
new String[] {
"src/main/java/module-info.java",
- "module org.sheepy.vulkan {\n" +
- " requires transitive org.sheepy.common;\n" +
- " exports org.sheepy.vulkan.model.resource;\n" +
+ "module org.sheepy.vulkan {\n" +
+ " requires transitive org.sheepy.common;\n" +
+ " exports org.sheepy.vulkan.model.resource;\n" +
"}\n",
"src/main/java/org/sheepy/vulkan/model/resource/Resource.java",
- "package org.sheepy.vulkan.model.resource;\n" +
- "import org.eclipse.emf.ecore.EObject;\n" +
- "public interface Resource extends EObject {\n" +
+ "package org.sheepy.vulkan.model.resource;\n" +
+ "import org.eclipse.emf.ecore.EObject;\n" +
+ "public interface Resource extends EObject {\n" +
"}\n",
"src/main/java/org/sheepy/vulkan/model/resource/VulkanBuffer.java",
- "package org.sheepy.vulkan.model.resource;\n" +
- "public interface VulkanBuffer extends Resource {\n" +
+ "package org.sheepy.vulkan.model.resource;\n" +
+ "public interface VulkanBuffer extends Resource {\n" +
"}\n",
});
addModularProjectEntry(vulkan, common);
@@ -7200,21 +7200,21 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
createSourceFiles(vulkan_demo,
new String[] {
"src/main/java/module-info.java",
- "module org.sheepy.vulkan.demo {\n" +
- " exports org.sheepy.vulkan.demo.model;\n" +
- " requires org.sheepy.vulkan;\n" +
+ "module org.sheepy.vulkan.demo {\n" +
+ " exports org.sheepy.vulkan.demo.model;\n" +
+ " requires org.sheepy.vulkan;\n" +
"}\n",
"src/main/java/org/sheepy/vulkan/demo/model/UniformBuffer.java",
- "package org.sheepy.vulkan.demo.model;\n" +
- "import org.sheepy.vulkan.model.resource.VulkanBuffer;\n" +
- "public interface UniformBuffer extends VulkanBuffer {\n" +
+ "package org.sheepy.vulkan.demo.model;\n" +
+ "import org.sheepy.vulkan.model.resource.VulkanBuffer;\n" +
+ "public interface UniformBuffer extends VulkanBuffer {\n" +
"}\n",
});
addModularProjectEntry(vulkan_demo, vulkan);
addModularProjectEntry(vulkan_demo, common);
addModularLibraryEntry(vulkan_demo, emfCommonPath, null);
addModularLibraryEntry(vulkan_demo, ecorePath, null);
-
+
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = vulkan_demo.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
assertMarkers("Unexpected markers", "", markers);
@@ -7267,30 +7267,30 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
addModularProjectEntry(unnamed, m1);
addModularProjectEntry(unnamed, m2);
addModularProjectEntry(unnamed, m3);
-
+
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = unnamed.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
sortMarkers(markers);
assertMarkers("Unexpected markers",
- "The package org.p1 is accessible from more than one module: m1, m2, m3\n" +
+ "The package org.p1 is accessible from more than one module: m1, m2, m3\n" +
"T1 cannot be resolved to a type",
markers);
-
+
char[] sourceChars = testSource.toCharArray();
this.problemRequestor.initialize(sourceChars);
getCompilationUnit("/unnamed/src/test/Test.java").getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. ERROR in /unnamed/src/test/Test.java (at line 2)\n" +
- " import org.p1.T1;\n" +
- " ^^^^^^\n" +
- "The package org.p1 is accessible from more than one module: m1, m2, m3\n" +
- "----------\n" +
- "2. ERROR in /unnamed/src/test/Test.java (at line 4)\n" +
- " T1 t1;\n" +
- " ^^\n" +
- "T1 cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in /unnamed/src/test/Test.java (at line 2)\n" +
+ " import org.p1.T1;\n" +
+ " ^^^^^^\n" +
+ "The package org.p1 is accessible from more than one module: m1, m2, m3\n" +
+ "----------\n" +
+ "2. ERROR in /unnamed/src/test/Test.java (at line 4)\n" +
+ " T1 t1;\n" +
+ " ^^\n" +
+ "T1 cannot be resolved to a type\n" +
"----------\n",
this.problemRequestor);
} finally {
@@ -7317,14 +7317,14 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
project.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
IClasspathEntry libraryEntry = JavaCore.newLibraryEntry(new Path("/ztest/lib/xml-apis.jar"), null, null);
addClasspathEntry(project, libraryEntry, 1); // right after src and before jrt-fs.jar
-
+
String testSource =
- "package com.ztest;\n" +
- "import javax.xml.transform.Transformer;\n" +
- "\n" +
+ "package com.ztest;\n" +
+ "import javax.xml.transform.Transformer;\n" +
+ "\n" +
"public class TestApp {\n" +
" Transformer ts;\n" +
- " javax.xml.transform.Result result;\n" +
+ " javax.xml.transform.Result result;\n" +
"}\n";
createFolder("/ztest/src/com/ztest");
createFile("/ztest/src/com/ztest/TestApp.java", testSource);
@@ -7345,27 +7345,27 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"Transformer cannot be resolved to a type\n" +
"The package javax.xml.transform is accessible from more than one module: <unnamed>, java.xml",
markers);
-
+
char[] sourceChars = testSource.toCharArray();
this.problemRequestor.initialize(sourceChars);
getCompilationUnit("/ztest/src/com/ztest/TestApp.java").getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. ERROR in /ztest/src/com/ztest/TestApp.java (at line 2)\n" +
- " import javax.xml.transform.Transformer;\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "The package javax.xml.transform is accessible from more than one module: <unnamed>, java.xml\n" +
- "----------\n" +
- "2. ERROR in /ztest/src/com/ztest/TestApp.java (at line 5)\n" +
- " Transformer ts;\n" +
- " ^^^^^^^^^^^\n" +
- "Transformer cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in /ztest/src/com/ztest/TestApp.java (at line 6)\n" +
- " javax.xml.transform.Result result;\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "The package javax.xml.transform is accessible from more than one module: <unnamed>, java.xml\n" +
+ "----------\n" +
+ "1. ERROR in /ztest/src/com/ztest/TestApp.java (at line 2)\n" +
+ " import javax.xml.transform.Transformer;\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "The package javax.xml.transform is accessible from more than one module: <unnamed>, java.xml\n" +
+ "----------\n" +
+ "2. ERROR in /ztest/src/com/ztest/TestApp.java (at line 5)\n" +
+ " Transformer ts;\n" +
+ " ^^^^^^^^^^^\n" +
+ "Transformer cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in /ztest/src/com/ztest/TestApp.java (at line 6)\n" +
+ " javax.xml.transform.Result result;\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "The package javax.xml.transform is accessible from more than one module: <unnamed>, java.xml\n" +
"----------\n",
this.problemRequestor);
@@ -7374,16 +7374,16 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
getCompilationUnit("/ztest/src/com/ztest/Test2.java").getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. ERROR in /ztest/src/com/ztest/Test2.java (at line 2)\n" +
- " import javax.xml.transform.*;\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "The package javax.xml.transform is accessible from more than one module: <unnamed>, java.xml\n" +
- "----------\n" +
- "2. ERROR in /ztest/src/com/ztest/Test2.java (at line 4)\n" +
- " Transformer ts;\n" +
- " ^^^^^^^^^^^\n" +
- "Transformer cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in /ztest/src/com/ztest/Test2.java (at line 2)\n" +
+ " import javax.xml.transform.*;\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "The package javax.xml.transform is accessible from more than one module: <unnamed>, java.xml\n" +
+ "----------\n" +
+ "2. ERROR in /ztest/src/com/ztest/Test2.java (at line 4)\n" +
+ " Transformer ts;\n" +
+ " ^^^^^^^^^^^\n" +
+ "Transformer cannot be resolved to a type\n" +
"----------\n",
this.problemRequestor);
} finally {
@@ -7407,14 +7407,14 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
project.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
IClasspathEntry libraryEntry = JavaCore.newLibraryEntry(new Path("/ztest/lib/xml-apis.jar"), null, null);
addClasspathEntry(project, libraryEntry, 2); // DIFFERENCE HERE: place xml-apis.jar AFTER jrt-fs.jar
-
+
String testSource =
- "package com.ztest;\n" +
- "import javax.xml.transform.Transformer;\n" +
- "\n" +
+ "package com.ztest;\n" +
+ "import javax.xml.transform.Transformer;\n" +
+ "\n" +
"public class TestApp {\n" +
" Transformer ts;\n" +
- " javax.xml.transform.Result result;\n" +
+ " javax.xml.transform.Result result;\n" +
"}\n";
createFolder("/ztest/src/com/ztest");
createFile("/ztest/src/com/ztest/TestApp.java", testSource);
@@ -7435,27 +7435,27 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"Transformer cannot be resolved to a type\n" +
"The package javax.xml.transform is accessible from more than one module: <unnamed>, java.xml",
markers);
-
+
char[] sourceChars = testSource.toCharArray();
this.problemRequestor.initialize(sourceChars);
getCompilationUnit("/ztest/src/com/ztest/TestApp.java").getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. ERROR in /ztest/src/com/ztest/TestApp.java (at line 2)\n" +
- " import javax.xml.transform.Transformer;\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "The package javax.xml.transform is accessible from more than one module: <unnamed>, java.xml\n" +
- "----------\n" +
- "2. ERROR in /ztest/src/com/ztest/TestApp.java (at line 5)\n" +
- " Transformer ts;\n" +
- " ^^^^^^^^^^^\n" +
- "Transformer cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in /ztest/src/com/ztest/TestApp.java (at line 6)\n" +
- " javax.xml.transform.Result result;\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "The package javax.xml.transform is accessible from more than one module: <unnamed>, java.xml\n" +
+ "----------\n" +
+ "1. ERROR in /ztest/src/com/ztest/TestApp.java (at line 2)\n" +
+ " import javax.xml.transform.Transformer;\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "The package javax.xml.transform is accessible from more than one module: <unnamed>, java.xml\n" +
+ "----------\n" +
+ "2. ERROR in /ztest/src/com/ztest/TestApp.java (at line 5)\n" +
+ " Transformer ts;\n" +
+ " ^^^^^^^^^^^\n" +
+ "Transformer cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in /ztest/src/com/ztest/TestApp.java (at line 6)\n" +
+ " javax.xml.transform.Result result;\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "The package javax.xml.transform is accessible from more than one module: <unnamed>, java.xml\n" +
"----------\n",
this.problemRequestor);
@@ -7464,16 +7464,16 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
getCompilationUnit("/ztest/src/com/ztest/Test2.java").getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. ERROR in /ztest/src/com/ztest/Test2.java (at line 2)\n" +
- " import javax.xml.transform.*;\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "The package javax.xml.transform is accessible from more than one module: <unnamed>, java.xml\n" +
- "----------\n" +
- "2. ERROR in /ztest/src/com/ztest/Test2.java (at line 4)\n" +
- " Transformer ts;\n" +
- " ^^^^^^^^^^^\n" +
- "Transformer cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in /ztest/src/com/ztest/Test2.java (at line 2)\n" +
+ " import javax.xml.transform.*;\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "The package javax.xml.transform is accessible from more than one module: <unnamed>, java.xml\n" +
+ "----------\n" +
+ "2. ERROR in /ztest/src/com/ztest/Test2.java (at line 4)\n" +
+ " Transformer ts;\n" +
+ " ^^^^^^^^^^^\n" +
+ "Transformer cannot be resolved to a type\n" +
"----------\n",
this.problemRequestor);
} finally {
@@ -7483,7 +7483,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
public void testBug536928_comment22_limited() throws CoreException, IOException {
try {
IClasspathAttribute[] limitModules = {
- JavaCore.newClasspathAttribute(IClasspathAttribute.LIMIT_MODULES, "java.base")
+ JavaCore.newClasspathAttribute(IClasspathAttribute.LIMIT_MODULES, "java.base")
};
IJavaProject project = createJava9ProjectWithJREAttributes("ztest", new String[] { "src" }, limitModules);
createFolder("/ztest/lib");
@@ -7500,14 +7500,14 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
project.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
IClasspathEntry libraryEntry = JavaCore.newLibraryEntry(new Path("/ztest/lib/xml-apis.jar"), null, null);
addClasspathEntry(project, libraryEntry, 1); // right after src and before jrt-fs.jar
-
+
String testSource =
- "package com.ztest;\n" +
- "import javax.xml.transform.Transformer;\n" +
- "\n" +
+ "package com.ztest;\n" +
+ "import javax.xml.transform.Transformer;\n" +
+ "\n" +
"public class TestApp {\n" +
- " Transformer ts;\n" +
- " javax.xml.transform.Result result;\n" +
+ " Transformer ts;\n" +
+ " javax.xml.transform.Result result;\n" +
"}\n";
createFolder("/ztest/src/com/ztest");
createFile("/ztest/src/com/ztest/TestApp.java", testSource);
@@ -7520,13 +7520,13 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
createFile("/ztest/src/com/ztest/Test2.java", test2Source);
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
assertNoErrors();
-
+
char[] sourceChars = testSource.toCharArray();
this.problemRequestor.initialize(sourceChars);
getCompilationUnit("/ztest/src/com/ztest/TestApp.java").getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
sourceChars = test2Source.toCharArray();
@@ -7534,7 +7534,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
getCompilationUnit("/ztest/src/com/ztest/Test2.java").getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
} finally {
@@ -7546,35 +7546,35 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
try {
createFolder("/bug/src/test/platform");
createFile("/bug/src/test/platform/Context.java",
- "package test.platform;\n" +
- "\n" +
- "import java.net.URI;\n" +
- "\n" +
- "public interface Context {\n" +
- " public URI getURI();\n" +
+ "package test.platform;\n" +
+ "\n" +
+ "import java.net.URI;\n" +
+ "\n" +
+ "public interface Context {\n" +
+ " public URI getURI();\n" +
"}\n");
createFile("/bug/src/test/platform/AbstractContext.java",
- "package test.platform;\n" +
- "\n" +
- "import java.net.URI;\n" +
- "import java.util.*;\n" +
- "import test.*;\n" +
- "\n" +
- "public abstract class AbstractContext implements Context {\n" +
- " Iterable<URI> uris = new ArrayList<URI>();\n" +
- " Application application;\n" +
+ "package test.platform;\n" +
+ "\n" +
+ "import java.net.URI;\n" +
+ "import java.util.*;\n" +
+ "import test.*;\n" +
+ "\n" +
+ "public abstract class AbstractContext implements Context {\n" +
+ " Iterable<URI> uris = new ArrayList<URI>();\n" +
+ " Application application;\n" +
"}\n");
String testSource =
- "package test;\n" +
- "\n" +
- "import java.io.*;\n" +
- "import java.net.*;\n" +
- "import java.util.*;\n" +
- "\n" +
- "import test.platform.*;\n" +
- "\n" +
- "public interface Application // extends Foo\n" +
- "{\n" +
+ "package test;\n" +
+ "\n" +
+ "import java.io.*;\n" +
+ "import java.net.*;\n" +
+ "import java.util.*;\n" +
+ "\n" +
+ "import test.platform.*;\n" +
+ "\n" +
+ "public interface Application // extends Foo\n" +
+ "{\n" +
"}\n";
String testPath = "/bug/src/test/Application.java";
createFile(testPath, testSource);
@@ -7586,40 +7586,40 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
getCompilationUnit(testPath).getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. WARNING in /bug/src/test/Application.java (at line 3)\n" +
- " import java.io.*;\n" +
- " ^^^^^^^\n" +
- "The import java.io is never used\n" +
- "----------\n" +
- "2. WARNING in /bug/src/test/Application.java (at line 4)\n" +
- " import java.net.*;\n" +
- " ^^^^^^^^\n" +
- "The import java.net is never used\n" +
- "----------\n" +
- "3. WARNING in /bug/src/test/Application.java (at line 5)\n" +
- " import java.util.*;\n" +
- " ^^^^^^^^^\n" +
- "The import java.util is never used\n" +
- "----------\n" +
- "4. WARNING in /bug/src/test/Application.java (at line 7)\n" +
- " import test.platform.*;\n" +
- " ^^^^^^^^^^^^^\n" +
- "The import test.platform is never used\n" +
+ "----------\n" +
+ "1. WARNING in /bug/src/test/Application.java (at line 3)\n" +
+ " import java.io.*;\n" +
+ " ^^^^^^^\n" +
+ "The import java.io is never used\n" +
+ "----------\n" +
+ "2. WARNING in /bug/src/test/Application.java (at line 4)\n" +
+ " import java.net.*;\n" +
+ " ^^^^^^^^\n" +
+ "The import java.net is never used\n" +
+ "----------\n" +
+ "3. WARNING in /bug/src/test/Application.java (at line 5)\n" +
+ " import java.util.*;\n" +
+ " ^^^^^^^^^\n" +
+ "The import java.util is never used\n" +
+ "----------\n" +
+ "4. WARNING in /bug/src/test/Application.java (at line 7)\n" +
+ " import test.platform.*;\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The import test.platform is never used\n" +
"----------\n",
this.problemRequestor);
// introduce error:
String testSourceEdited =
- "package test;\n" +
- "\n" +
- "import java.io.*;\n" +
- "import java.net.*;\n" +
- "import java.util.*;\n" +
- "\n" +
- "import test.platform.*;\n" +
- "\n" +
- "public interface Application extends Foo\n" +
- "{\n" +
+ "package test;\n" +
+ "\n" +
+ "import java.io.*;\n" +
+ "import java.net.*;\n" +
+ "import java.util.*;\n" +
+ "\n" +
+ "import test.platform.*;\n" +
+ "\n" +
+ "public interface Application extends Foo\n" +
+ "{\n" +
"}\n";
editFile(testPath, testSourceEdited);
java10Project.getProject().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);
@@ -7683,22 +7683,22 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
this.problemRequestor.initialize(sourceChars);
getCompilationUnit(test1path).getWorkingCopy(this.wcOwner, null);
assertProblems("unexpected problems",
- "----------\n" +
- "1. ERROR in /current/src/current/Test1.java (at line 2)\n" +
- " import other.p.C;\n" +
- " ^^^^^^^^^\n" +
- "The type other.p.C is not accessible\n" +
+ "----------\n" +
+ "1. ERROR in /current/src/current/Test1.java (at line 2)\n" +
+ " import other.p.C;\n" +
+ " ^^^^^^^^^\n" +
+ "The type other.p.C is not accessible\n" +
"----------\n",
this.problemRequestor);
sourceChars = test2source.toCharArray();
this.problemRequestor.initialize(sourceChars);
getCompilationUnit(test2path).getWorkingCopy(this.wcOwner, null);
assertProblems("unexpected problems",
- "----------\n" +
- "1. ERROR in /current/src/current/Test2.java (at line 3)\n" +
- " other.p.C c;\n" +
- " ^^^^^^^^^\n" +
- "The type other.p.C is not accessible\n" +
+ "----------\n" +
+ "1. ERROR in /current/src/current/Test2.java (at line 3)\n" +
+ " other.p.C c;\n" +
+ " ^^^^^^^^^\n" +
+ "The type other.p.C is not accessible\n" +
"----------\n",
this.problemRequestor);
} finally {
@@ -7729,7 +7729,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"public class Boo extends Bar {}\n");
addModularProjectEntry(pb, pa);
- IClasspathAttribute[] forceExport = {
+ IClasspathAttribute[] forceExport = {
JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true"),
JavaCore.newClasspathAttribute(IClasspathAttribute.ADD_EXPORTS, "m.a/a.foo=ALL-UNNAMED")
};
@@ -7750,7 +7750,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
this.problemRequestor.initialize(testSource.toCharArray());
getCompilationUnit(testPath).getWorkingCopy(this.wcOwner, null);
assertProblems("unexpected problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
} finally {
@@ -7816,17 +7816,17 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
IMarker[] markers = ptest.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
sortMarkers(markers);
assertMarkers("unexpected markers",
- "The import p.Missing cannot be resolved\n" +
+ "The import p.Missing cannot be resolved\n" +
"The method miss() is undefined for the type API2",
markers);
this.problemRequestor.initialize(test2Content.toCharArray());
getCompilationUnit(test2Path).getWorkingCopy(this.wcOwner, null);
assertProblems("unexpected problems",
- "----------\n" +
- "1. ERROR in /ptest/src/t/Test2.java (at line 2)\n" +
- " import p.Missing;\n" +
- " ^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in /ptest/src/t/Test2.java (at line 2)\n" +
+ " import p.Missing;\n" +
+ " ^^^^^^^^^\n" +
"The import p.Missing cannot be resolved\n" +
"----------\n",
this.problemRequestor);
@@ -7855,7 +7855,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"import javax.xml.transform.Result;\n" +
"public class C2 {\n" +
" public void m(Number n) {}\n" +
- " public void m(Result r) {}\n" + // Result will be ambiguous looking from project 'p', but should not break compilation
+ " public void m(Result r) {}\n" + // Result will be ambiguous looking from project 'p', but should not break compilation
"}\n"
}, new HashMap<>(), jar2Path);
@@ -7880,7 +7880,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
this.problemRequestor.initialize(testSource.toCharArray());
getCompilationUnit(testPath).getWorkingCopy(this.wcOwner, null);
assertProblems("unexpected problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
} finally {
@@ -7942,7 +7942,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
Util.flushDirectoryContent(outputDir);
}
}
-
+
public void testBug543765() throws CoreException, IOException {
// failure never seen in this test
IJavaProject m = createJava9Project("M");
@@ -7960,52 +7960,52 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
" public static void main(String... args) {}\n" +
"}\n"
}, wJarLocation, "9");
-
+
// ------ X ------
addModularLibraryEntry(x, wJarPath, null);
createFolder("X/src/com/example/x");
createFile("X/src/com/example/x/X.java",
- "package com.example.x;\n" +
- "public class X {\n" +
- " public static void main(String[] args) { \n" +
- " System.out.println(\"X\");\n" +
- " }\n" +
+ "package com.example.x;\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) { \n" +
+ " System.out.println(\"X\");\n" +
+ " }\n" +
"}\n");
createFile("X/src/module-info.java",
- "open module com.example.x {\n" +
- " exports com.example.x;\n" +
- " requires w;\n" +
+ "open module com.example.x {\n" +
+ " exports com.example.x;\n" +
+ " requires w;\n" +
"}\n");
-
+
// ------ Y ------
addModularLibraryEntry(y, wJarPath, null);
addModularProjectEntry(y, x);
createFolder("Y/src/com/example/y");
createFile("Y/src/com/example/y/Y.java",
- "package com.example.y;\n" +
- "public class Y {\n" +
- " public static void main(String[] args) { \n" +
- " System.out.println(\"Y\");\n" +
- " }\n" +
+ "package com.example.y;\n" +
+ "public class Y {\n" +
+ " public static void main(String[] args) { \n" +
+ " System.out.println(\"Y\");\n" +
+ " }\n" +
"}\n");
createFile("Y/src/module-info.java",
- "open module com.example.y {\n" +
- " exports com.example.y;\n" +
- " requires com.example.x;\n" +
+ "open module com.example.y {\n" +
+ " exports com.example.y;\n" +
+ " requires com.example.x;\n" +
"}\n");
// ------ N ------
createFolder("N/src/com/example/n");
createFile("N/src/com/example/n/N.java",
- "package com.example.n;\n" +
- "public class N {\n" +
- " public static void main(String[] args) { \n" +
- " System.out.println(\"N\");\n" +
- " } \n" +
+ "package com.example.n;\n" +
+ "public class N {\n" +
+ " public static void main(String[] args) { \n" +
+ " System.out.println(\"N\");\n" +
+ " } \n" +
"}\n");
createFile("N/src/module-info.java",
- "open module n {\n" +
- " exports com.example.n;\n" +
+ "open module n {\n" +
+ " exports com.example.n;\n" +
"}\n");
// ------ M ------
@@ -8022,32 +8022,32 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
createFolder("M/src/m");
String mSource =
- "package m;\n" +
- "import com.example.n.N;\n" +
- "public class M {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"M\");\n" +
- " N.main(null);\n" +
- " }\n" +
+ "package m;\n" +
+ "import com.example.n.N;\n" +
+ "public class M {\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(\"M\");\n" +
+ " N.main(null);\n" +
+ " }\n" +
"}\n";
String mPath = "M/src/m/M.java";
createFile(mPath, mSource);
createFile("M/src/module-info.java",
- "open module m {\n" +
- " requires n;\n" +
- " requires w;\n" +
+ "open module m {\n" +
+ " requires n;\n" +
+ " requires w;\n" +
"}\n");
-
+
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
assertNoErrors();
-
+
m.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
assertNoErrors();
this.problemRequestor.initialize(mSource.toCharArray());
getCompilationUnit(mPath).getWorkingCopy(this.wcOwner, null);
assertProblems("unexpected problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
} finally {
@@ -8087,17 +8087,17 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String testPath = "p/src/test/Test.java";
String testSource =
"package test;\n" +
- "import org.test.Root;\n" +
- "public class Test {\n" +
- " public static void main(String[] args) { \n" +
- " System.out.println(new Root());\n" +
- " }\n" +
+ "import org.test.Root;\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) { \n" +
+ " System.out.println(new Root());\n" +
+ " }\n" +
"}\n";
createFile(testPath, testSource);
createFile("p/src/module-info.java",
- "module test {\n" +
- " requires auto1Lib;\n" +
- " requires auto2Lib;\n" +
+ "module test {\n" +
+ " requires auto1Lib;\n" +
+ " requires auto2Lib;\n" +
"}\n");
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
assertNoErrors();
@@ -8105,7 +8105,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
this.problemRequestor.initialize(testSource.toCharArray());
getCompilationUnit(testPath).getWorkingCopy(this.wcOwner, null);
assertProblems("unexpected problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
} finally {
@@ -8115,38 +8115,38 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
Util.flushDirectoryContent(outputDir);
}
}
-
+
public void testBug544432() throws CoreException {
IJavaProject prjA = createJava9Project("A");
IJavaProject prjB = createJava9Project("B");
try {
createFolder("A/src/com/a");
createFile("A/src/com/a/A.java",
- "package com.a;\n" +
- "\n" +
+ "package com.a;\n" +
+ "\n" +
"public class A {}\n");
createFile("A/src/module-info.java",
- "open module com.a {\n" +
- " exports com.a;\n" +
+ "open module com.a {\n" +
+ " exports com.a;\n" +
"}\n");
addModularProjectEntry(prjB, prjA);
createFolder("B/src/com/a/b");
String bPath = "B/src/com/a/b/B.java";
String bSource =
- "package com.a.b;\n" +
- "import com.a.A;\n" +
- "public class B {\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " A a = new A();\n" +
- " System.out.println(a);\n" +
- " }\n" +
+ "package com.a.b;\n" +
+ "import com.a.A;\n" +
+ "public class B {\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " A a = new A();\n" +
+ " System.out.println(a);\n" +
+ " }\n" +
"}\n";
createFile(bPath, bSource);
createFile("B/src/module-info.java",
- "open module com.a.b {\n" +
- " requires com.a;\n" +
+ "open module com.a.b {\n" +
+ " requires com.a;\n" +
"}\n");
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
assertNoErrors();
@@ -8154,7 +8154,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
this.problemRequestor.initialize(bSource.toCharArray());
getCompilationUnit(bPath).getWorkingCopy(this.wcOwner, null);
assertProblems("unexpected problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
} finally {
@@ -8368,16 +8368,16 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
String outputDirectory = Util.getOutputDirectory();
try {
String testSource = "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" +
+ "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" +
"}";
String mPath = "p/src/X.java";
createFile(mPath,
@@ -8387,7 +8387,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
IMarker[] markers = p.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
sortMarkers(markers);
assertMarkers("Unexpected markers",
- "Multi-catch parameters are not allowed for source level below 1.7\n" +
+ "Multi-catch parameters are not allowed for source level below 1.7\n" +
"The exception FileNotFoundException is already caught by the alternative IOException", markers);
} finally {
@@ -8477,9 +8477,9 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
IMarker[] markers = p.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
sortMarkers(markers);
String expected =
- "Syntax error on token \"module\", package expected\n" +
- "Syntax error on token(s), misplaced construct(s)\n" +
- "Syntax error on token \".\", , expected\n" +
+ "Syntax error on token \"module\", package expected\n" +
+ "Syntax error on token(s), misplaced construct(s)\n" +
+ "Syntax error on token \".\", , expected\n" +
"Syntax error on token \"}\", delete this token";
assertMarkers("Unexpected markers",
expected, markers);
@@ -8510,9 +8510,9 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
"p/src/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" +
"}");
p.getProject().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);
waitForAutoBuild();
@@ -8539,12 +8539,12 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
p.setOption(JavaCore.COMPILER_RELEASE, JavaCore.ENABLED);
String outputDirectory = Util.getOutputDirectory();
try {
- String testSource = "import java.io.*;\n" +
- "\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " String str = Integer.toUnsignedString(1, 1);\n" +
- " }\n" +
+ String testSource = "import java.io.*;\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " String str = Integer.toUnsignedString(1, 1);\n" +
+ " }\n" +
"}";
String mPath = "p/src/X.java";
createFile(mPath,
@@ -8574,11 +8574,11 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
p.setOption(JavaCore.COMPILER_RELEASE, JavaCore.ENABLED);
String outputDirectory = Util.getOutputDirectory();
try {
- String testSource = "\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Integer.toUnsignedString(1, 1);\n" +
- " }\n" +
+ String testSource = "\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Integer.toUnsignedString(1, 1);\n" +
+ " }\n" +
"}";
String mPath = "p/src/X.java";
createFile(mPath,
@@ -8632,11 +8632,11 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
p.getProject().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);
waitForAutoBuild();
-
+
IMarker[] markers = p.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
// 1. marker is on the project, second on the "current" CU: World.java.
assertMarkers("Unexpected markers",
- "The project was not built since its build path has a problem: missing.module cannot be resolved to a module, it is referenced from an add-reads directive. Fix the build path then try building this project\n" +
+ "The project was not built since its build path has a problem: missing.module cannot be resolved to a module, it is referenced from an add-reads directive. Fix the build path then try building this project\n" +
"missing.module cannot be resolved to a module, it is referenced from an add-reads directive",
markers);
} finally {
@@ -8658,7 +8658,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
" C f;\n" +
"}\n"
});
-
+
IJavaProject lib = setupModuleProject("lib", new String[] {
"src/module-info.java",
"module lib {\n" +
@@ -8681,7 +8681,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
IMarker[] markers = p.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
// 1. marker is on the project, second on the "current" CU: World.java.
assertMarkers("Unexpected markers",
- "The project was not built since its build path has a problem: missing.module cannot be resolved to a module, it is referenced from an add-reads directive. Fix the build path then try building this project\n" +
+ "The project was not built since its build path has a problem: missing.module cannot be resolved to a module, it is referenced from an add-reads directive. Fix the build path then try building this project\n" +
"missing.module cannot be resolved to a module, it is referenced from an add-reads directive",
markers);
} finally {
@@ -8721,7 +8721,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
IJavaProject prjB = createJava9Project("B");
try {
createFile("A/src/module-info.java",
- "module A {\n" +
+ "module A {\n" +
"}\n");
addModularProjectEntry(prjB, prjA);
@@ -8730,29 +8730,29 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
// ---1---
createFolder("B/src/b");
createFile("B/src/b/Class1.java",
- "package b;\n" +
- "import java.sql.Connection;\n" +
- "public class Class1 {\n" +
- " Connection connection;\n" +
+ "package b;\n" +
+ "import java.sql.Connection;\n" +
+ "public class Class1 {\n" +
+ " Connection connection;\n" +
"}\n");
createFile("B/src/b/Class2.java",
- "package b;\n" +
- "import java.sql.Connection;\n" +
- "public class Class2 {\n" +
- " Connection connection;\n" +
+ "package b;\n" +
+ "import java.sql.Connection;\n" +
+ "public class Class2 {\n" +
+ " Connection connection;\n" +
"}\n");
// ---2---
createFile("B/src/module-info.java",
- "module B {\n" +
- " requires java.sql;\n" +
- " requires A;\n" +
+ "module B {\n" +
+ " requires java.sql;\n" +
+ " requires A;\n" +
"}\n");
String bPath = "B/src/b/Class3.java";
String bSource =
"package b;\n" + // <= this triggered createPackage in an inconsistent state
- "import java.sql.Connection;\n" +
- "public class Class3 {\n" +
- " Connection connection;\n" +
+ "import java.sql.Connection;\n" +
+ "public class Class3 {\n" +
+ " Connection connection;\n" +
"}\n";
createFile(bPath, bSource);
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
@@ -8761,7 +8761,7 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
this.problemRequestor.initialize(bSource.toCharArray());
getCompilationUnit(bPath).getWorkingCopy(this.wcOwner, null);
assertProblems("unexpected problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
} finally {
@@ -8777,13 +8777,13 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
IJavaProject prjD = createJava9Project("D");
try {
createFile("A/src/module-info.java",
- "module A {\n" +
+ "module A {\n" +
" exports p1.p2;\n" +
"}\n");
createFolder("A/src/p1/p2");
createFile("A/src/p1/p2/X.java",
- "package p1.p2;\n" +
- "public class X {\n" +
+ "package p1.p2;\n" +
+ "public class X {\n" +
"}\n");
addModularProjectEntry(prjB, prjA);
@@ -8792,48 +8792,48 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
addModularProjectEntry(prjD, prjC);
createFile("B/src/module-info.java",
- "module B {\n" +
+ "module B {\n" +
" requires A;\n" +
" exports p1;\n" +
"}\n");
createFolder("B/src/p1");
createFile("B/src/p1/Y.java",
- "package p1;\n" +
- "import p1.p2.X;\n" +
- "public class Y {\n" +
- " private void f(X x) {}\n" +
+ "package p1;\n" +
+ "import p1.p2.X;\n" +
+ "public class Y {\n" +
+ " private void f(X x) {}\n" +
"}\n");
-
+
createFile("C/src/module-info.java",
- "module C {\n" +
+ "module C {\n" +
" exports p1.p2;\n" +
"}\n");
createFolder("C/src/p1/p2");
createFile("C/src/p1/p2/X.java",
- "package p1.p2;\n" +
- "public class X {\n" +
+ "package p1.p2;\n" +
+ "public class X {\n" +
"}\n");
-
+
createFile("D/src/module-info.java",
- "module D {\n" +
+ "module D {\n" +
" requires B;\n" +
" requires C;\n" +
"}\n");
-
+
createFolder("D/src/usage");
createFile("D/src/usage/AAA.java",
- "package usage;\n" +
- "import p1.Y;\n" +
- "public class AAA {\n" +
- " Y y;\n" +
+ "package usage;\n" +
+ "import p1.Y;\n" +
+ "public class AAA {\n" +
+ " Y y;\n" +
"}\n");
createFile("D/src/usage/Usage.java",
- "package usage;\n" +
- "import p1.p2.X;\n" +
- "public class Usage {\n" +
- " X x;\n" +
+ "package usage;\n" +
+ "import p1.p2.X;\n" +
+ "public class Usage {\n" +
+ " X x;\n" +
"}\n");
-
+
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
assertNoErrors();
@@ -8859,11 +8859,11 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
// ---1---
createFolder("B/src/pack/b");
createFile("B/src/pack/b/Usage.java",
- "package pack.b;\n" +
- "public class Usage {\n" +
+ "package pack.b;\n" +
+ "public class Usage {\n" +
"}\n");
createFile("B/src/module-info.java",
- "module B {\n" +
+ "module B {\n" +
" requires A;\n" +
"}\n");
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
@@ -8886,6 +8886,6 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
// sort by CHAR_START then MESSAGE
protected void sortMarkers(IMarker[] markers) {
Arrays.sort(markers, Comparator.comparingInt((IMarker a) -> a.getAttribute(IMarker.CHAR_START, 0))
- .thenComparing((IMarker a) -> a.getAttribute(IMarker.MESSAGE, "")));
+ .thenComparing((IMarker a) -> a.getAttribute(IMarker.MESSAGE, "")));
}
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleOptionsTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleOptionsTests.java
index 7e2acbbb1..a4e5cd57b 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleOptionsTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleOptionsTests.java
@@ -43,14 +43,14 @@ public class ModuleOptionsTests extends ModifyingResourceTests {
static {
// TESTS_NAMES = new String[] { "testAddReads" };
}
-
+
public static Test suite() {
return buildModelTestSuite(ModuleOptionsTests.class, BYTECODE_DECLARATION_ORDER);
}
public void setUpSuite() throws Exception {
super.setUpSuite();
ClasspathJrt.resetCaches();
- }
+ }
public void tearDownSuite() throws Exception {
super.tearDownSuite();
}
@@ -102,9 +102,9 @@ public class ModuleOptionsTests extends ModifyingResourceTests {
markers = project.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
Arrays.sort(markers, (a,b) -> a.getAttribute(IMarker.CHAR_START, 0) - b.getAttribute(IMarker.CHAR_START, 0));
assertMarkers("Unexpected markers",
- "java.awt cannot be resolved to a type\n" +
"java.awt cannot be resolved to a type\n" +
- "java.desktop cannot be resolved to a module\n" +
+ "java.awt cannot be resolved to a type\n" +
+ "java.desktop cannot be resolved to a module\n" +
"java.datatransfer cannot be resolved to a module",
markers);
} finally {
@@ -189,8 +189,8 @@ public class ModuleOptionsTests extends ModifyingResourceTests {
"src/org/astro/Test2.java",
"package org.astro;\n" +
"public class Test2 {\n" +
- " int test(jdk.internal.misc.Unsafe unsafe) {\n" +
- " return unsafe.addressSize();\n" +
+ " int test(jdk.internal.misc.Unsafe unsafe) {\n" +
+ " return unsafe.addressSize();\n" +
" }" +
"}\n",
};
@@ -359,7 +359,7 @@ public class ModuleOptionsTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -421,8 +421,8 @@ public class ModuleOptionsTests extends ModifyingResourceTests {
setCPAttributes(p2, attrs, dep2);
getWorkspace().build(IncrementalProjectBuilder.AUTO_BUILD, null);
markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
- assertMarkers("Unexpected markers",
- "The project was not built since its build path is incomplete. Cannot find the class file for org.astro.World. Fix the build path then try building this project\n" +
+ assertMarkers("Unexpected markers",
+ "The project was not built since its build path is incomplete. Cannot find the class file for org.astro.World. Fix the build path then try building this project\n" +
"The type org.astro.World cannot be resolved. It is indirectly referenced from required .class files",
markers);
} finally {
@@ -439,7 +439,7 @@ public class ModuleOptionsTests extends ModifyingResourceTests {
String[] sources = new String[] {
"src/module-info.java",
"module org.astro {\n" +
- " exports org.astro;\n" +
+ " exports org.astro;\n" +
"}",
"src/org/astro/World.java",
"package org.astro;\n" +
@@ -493,8 +493,8 @@ public class ModuleOptionsTests extends ModifyingResourceTests {
IJavaProject p2 = setupModuleProject("com.greetings", src2, new IClasspathEntry[] { dep1, dep2 });
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
- assertMarkers("Unexpected markers",
- "The project was not built since its build path is incomplete. Cannot find the class file for org.astro.World. Fix the build path then try building this project\n" +
+ assertMarkers("Unexpected markers",
+ "The project was not built since its build path is incomplete. Cannot find the class file for org.astro.World. Fix the build path then try building this project\n" +
"The type org.astro.World cannot be resolved. It is indirectly referenced from required .class files",
markers);
IClasspathAttribute[] attrs = new IClasspathAttribute[] {
@@ -599,20 +599,20 @@ public class ModuleOptionsTests extends ModifyingResourceTests {
"}\n"
};
createSourceFiles(patchProject, patchSources);
-
+
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = patchProject.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
assertMarkers("Unexpected markers",
- "The type jdk.internal.misc.Unsafe is not accessible\n" +
+ "The type jdk.internal.misc.Unsafe is not accessible\n" +
"Signal cannot be resolved to a type",
markers);
-
+
attributes = new IClasspathAttribute[] {
JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true"),
JavaCore.newClasspathAttribute(IClasspathAttribute.PATCH_MODULE, "java.base")
};
setJRECPAttributes(patchProject, attributes);
-
+
getWorkspace().build(IncrementalProjectBuilder.AUTO_BUILD, null);
markers = patchProject.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
@@ -647,19 +647,19 @@ public class ModuleOptionsTests extends ModifyingResourceTests {
"}\n"
};
createSourceFiles(patchProject, patchSources);
-
+
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
-
+
attributes = new IClasspathAttribute[] {
JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true"),
};
setJRECPAttributes(patchProject, attributes);
-
+
getWorkspace().build(IncrementalProjectBuilder.AUTO_BUILD, null);
IMarker[] markers = patchProject.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
assertMarkers("Unexpected markers",
- "The type jdk.internal.misc.Unsafe is not accessible\n" +
+ "The type jdk.internal.misc.Unsafe is not accessible\n" +
"Signal cannot be resolved to a type",
markers);
} finally {
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/NamingConventionTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/NamingConventionTests.java
index 302c17627..bbe620972 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/NamingConventionTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/NamingConventionTests.java
@@ -65,7 +65,7 @@ public void testGetBaseName001() {
NamingConventions.VK_INSTANCE_FIELD,
"OneName", //$NON-NLS-1$
this.project);
-
+
assertEquals(
"oneName", //$NON-NLS-1$
baseName);
@@ -78,7 +78,7 @@ public void testGetBaseName002() {
NamingConventions.VK_STATIC_FINAL_FIELD,
"ONE_NAME", //$NON-NLS-1$
this.project);
-
+
assertEquals(
"oneName", //$NON-NLS-1$
baseName);
@@ -91,12 +91,12 @@ public void testGetBaseName003() {
options.put(JavaCore.CODEASSIST_FIELD_PREFIXES,"pre"); //$NON-NLS-1$
options.put(JavaCore.CODEASSIST_FIELD_SUFFIXES,"suf"); //$NON-NLS-1$
JavaCore.setOptions(options);
-
+
String baseName = NamingConventions.getBaseName(
NamingConventions.VK_INSTANCE_FIELD,
"preOneNamesuf", //$NON-NLS-1$
this.project);
-
+
assertEquals(
"oneName", //$NON-NLS-1$
baseName);
@@ -109,12 +109,12 @@ public void testGetBaseName004() {
options.put(JavaCore.CODEASSIST_STATIC_FINAL_FIELD_PREFIXES,"pre"); //$NON-NLS-1$
options.put(JavaCore.CODEASSIST_STATIC_FINAL_FIELD_SUFFIXES,"suf"); //$NON-NLS-1$
JavaCore.setOptions(options);
-
+
String baseName = NamingConventions.getBaseName(
NamingConventions.VK_STATIC_FINAL_FIELD,
"preONE_NAMEsuf", //$NON-NLS-1$
this.project);
-
+
assertEquals(
"oneName", //$NON-NLS-1$
baseName);
@@ -143,7 +143,7 @@ public void testSuggestFieldName002() {
0,
new String[]{},
true);
-
+
assumeEquals(
"oneClass\n" + //$NON-NLS-1$
"class1", //$NON-NLS-1$
@@ -196,7 +196,7 @@ public void testSuggestFieldName005() {
options.put(JavaCore.CODEASSIST_FIELD_PREFIXES,"f"); //$NON-NLS-1$
options.put(JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES,"fg"); //$NON-NLS-1$
JavaCore.setOptions(options);
-
+
String[] suggestions = NamingConventions.suggestVariableNames(
NamingConventions.VK_STATIC_FIELD,
NamingConventions.BK_TYPE_NAME,
@@ -290,7 +290,7 @@ public void testSuggestFieldName009() {
0,
new String[]{"preNamesuf"}, //$NON-NLS-1$
true);
-
+
assumeEquals(
"preOneNamesuf\n" + //$NON-NLS-1$
"preName2suf\n" + //$NON-NLS-1$
@@ -307,7 +307,7 @@ public void testSuggestFieldName010() {
options.put(JavaCore.CODEASSIST_FIELD_PREFIXES,"pre"); //$NON-NLS-1$
options.put(JavaCore.CODEASSIST_FIELD_SUFFIXES,"suf"); //$NON-NLS-1$
JavaCore.setOptions(options);
-
+
String[] suggestions = NamingConventions.suggestVariableNames(
NamingConventions.VK_INSTANCE_FIELD,
NamingConventions.BK_TYPE_NAME,
@@ -329,7 +329,7 @@ public void testSuggestFieldName010() {
toString(suggestions));
}
public void testSuggestFieldName011() {
-
+
String[] suggestions = NamingConventions.suggestVariableNames(
NamingConventions.VK_INSTANCE_FIELD,
NamingConventions.BK_TYPE_NAME,
@@ -510,7 +510,7 @@ public void testSuggestFieldName022() {
options.put(JavaCore.CODEASSIST_STATIC_FINAL_FIELD_PREFIXES,"pre"); //$NON-NLS-1$
options.put(JavaCore.CODEASSIST_STATIC_FINAL_FIELD_SUFFIXES,"suf"); //$NON-NLS-1$
JavaCore.setOptions(options);
-
+
String[] suggestions = NamingConventions.suggestVariableNames(
NamingConventions.VK_STATIC_FINAL_FIELD,
NamingConventions.BK_TYPE_NAME,
@@ -556,7 +556,7 @@ public void testSuggestFieldName024() {
options.put(JavaCore.CODEASSIST_FIELD_PREFIXES,"pre"); //$NON-NLS-1$
options.put(JavaCore.CODEASSIST_FIELD_SUFFIXES,"suf"); //$NON-NLS-1$
JavaCore.setOptions(options);
-
+
String[] suggestions = NamingConventions.suggestVariableNames(
NamingConventions.VK_INSTANCE_FIELD,
NamingConventions.BK_NAME,
@@ -732,8 +732,8 @@ public void testSuggestFieldName033() {
true);
assumeEquals(
- "my_First_Type\n" +
- "first_Type\n" +
+ "my_First_Type\n" +
+ "first_Type\n" +
"type", //$NON-NLS-1$
toString(suggestions));
}
@@ -751,8 +751,8 @@ public void testSuggestFieldName034() {
true);
assumeEquals(
- "my_FIRST_Type\n" +
- "first_Type\n" +
+ "my_FIRST_Type\n" +
+ "first_Type\n" +
"type", //$NON-NLS-1$
toString(suggestions));
}
@@ -770,8 +770,8 @@ public void testSuggestFieldName035() {
true);
assumeEquals(
- "my_first_Type\n" +
- "first_Type\n" +
+ "my_first_Type\n" +
+ "first_Type\n" +
"type", //$NON-NLS-1$
toString(suggestions));
}
@@ -789,8 +789,8 @@ public void testSuggestFieldName036() {
true);
assumeEquals(
- "myFirst_9_Type\n" +
- "first_9_Type\n" +
+ "myFirst_9_Type\n" +
+ "first_9_Type\n" +
"type", //$NON-NLS-1$
toString(suggestions));
}
@@ -842,7 +842,7 @@ public void testSuggestFieldName039() {
0,
new String[]{},
true);
-
+
assumeEquals(
"A", //$NON-NLS-1$
toString(suggestions));
@@ -859,7 +859,7 @@ public void testSuggestFieldName040() {
0,
new String[]{},
true);
-
+
assumeEquals(
"INT", //$NON-NLS-1$
toString(suggestions));
@@ -876,7 +876,7 @@ public void testSuggestFieldName041() {
1,
new String[]{},
true);
-
+
assumeEquals(
"keys", //$NON-NLS-1$
toString(suggestions));
@@ -893,7 +893,7 @@ public void testSuggestFieldName042() {
1,
new String[]{},
true);
-
+
assumeEquals(
"KEYS", //$NON-NLS-1$
toString(suggestions));
@@ -1369,7 +1369,7 @@ public void testSuggestConstantFieldName001() {
0,
new String[]{},
true);
-
+
assumeEquals(
"__", //$NON-NLS-1$
toString(suggestions));
@@ -1382,7 +1382,7 @@ public void testSuggestConstantFieldName002() {
options.put(JavaCore.CODEASSIST_STATIC_FINAL_FIELD_PREFIXES,"PRE"); //$NON-NLS-1$
options.put(JavaCore.CODEASSIST_STATIC_FINAL_FIELD_SUFFIXES,"SUF"); //$NON-NLS-1$
JavaCore.setOptions(options);
-
+
String[] suggestions = NamingConventions.suggestVariableNames(
NamingConventions.VK_STATIC_FINAL_FIELD,
NamingConventions.BK_NAME,
@@ -1401,7 +1401,7 @@ public void testSuggestConstantFieldName002() {
}
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=283539
- * Test that suggestions for parameters include the underscores as supplied
+ * Test that suggestions for parameters include the underscores as supplied
*/
public void testSuggestParamWithUnderscore() {
Map options = this.project.getOptions(true);
@@ -1419,10 +1419,10 @@ public void testSuggestParamWithUnderscore() {
true);
assumeEquals(
- "lMin___Trigger__Period_usec\n" +
- "min___Trigger__Period_usec\n" +
- "trigger__Period_usec\n" +
- "period_usec\n" +
+ "lMin___Trigger__Period_usec\n" +
+ "min___Trigger__Period_usec\n" +
+ "trigger__Period_usec\n" +
+ "period_usec\n" +
"usec", //$NON-NLS-1$
toString(suggestions));
} finally {
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/NullAnnotationModelTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/NullAnnotationModelTests.java
index 0cf01c8e5..fd7ef4171 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/NullAnnotationModelTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/NullAnnotationModelTests.java
@@ -469,8 +469,8 @@ public class NullAnnotationModelTests extends ReconcilerTests {
// so in addition to the synthetic annotation there must also be a real one:
String annotSourceString =
"package p1;\n" +
- "import java.lang.annotation.ElementType;\n" +
- "import java.lang.annotation.Target;\n" +
+ "import java.lang.annotation.ElementType;\n" +
+ "import java.lang.annotation.Target;\n" +
"@Target({ElementType.PARAMETER,ElementType.METHOD})\n" +
"public @interface Annot {}\n";
this.createFile(
@@ -540,7 +540,7 @@ public class NullAnnotationModelTests extends ReconcilerTests {
deleteProject("P");
}
}
-
+
// see https://bugs.eclipse.org/418233
public void testNonNullDefaultInInner() throws CoreException, IOException, InterruptedException {
IJavaProject project15 = null;
@@ -550,24 +550,24 @@ public class NullAnnotationModelTests extends ReconcilerTests {
createFile(
"/TestAnnot/src/p1/Interfaces.java",
"package p1;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "@NonNullByDefault\n" +
- "public interface Interfaces {\n" +
- " public interface InnerInterface {\n" +
- " Object doSomethingElse(Object o);\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "@NonNullByDefault\n" +
+ "public interface Interfaces {\n" +
+ " public interface InnerInterface {\n" +
+ " Object doSomethingElse(Object o);\n" +
+ " }\n" +
"}"
);
String source =
"package p1;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "@NonNullByDefault\n" +
- "public class Implementations implements Interfaces.InnerInterface {\n" +
- " public Object doSomethingElse(Object o) {\n" +
- " return o; \n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "@NonNullByDefault\n" +
+ "public class Implementations implements Interfaces.InnerInterface {\n" +
+ " public Object doSomethingElse(Object o) {\n" +
+ " return o; \n" +
+ " }\n" +
"}";
createFile(
"/TestAnnot/src/p1/Implementations.java",
@@ -580,14 +580,14 @@ public class NullAnnotationModelTests extends ReconcilerTests {
project15.setOption(JavaCore.COMPILER_PB_REDUNDANT_NULL_CHECK, JavaCore.ERROR);
project15.setOption(JavaCore.COMPILER_PB_INCLUDE_ASSERTS_IN_NULL_ANALYSIS, JavaCore.ENABLED);
project15.setOption(JavaCore.COMPILER_ANNOTATION_NULL_ANALYSIS, JavaCore.ENABLED);
-
+
this.workingCopies = new ICompilationUnit[1];
char[] sourceChars = source.toCharArray();
this.problemRequestor.initialize(sourceChars);
this.workingCopies[0] = getCompilationUnit("/TestAnnot/src/p1/Implementations.java").getWorkingCopy(this.wcOwner, null);
this.workingCopies[0].makeConsistent(null);
this.workingCopies[0].reconcile(ICompilationUnit.NO_AST, false, null, null);
-
+
assertNoProblem(sourceChars, this.workingCopies[0]);
} finally {
if (project15 != null)
@@ -658,11 +658,11 @@ public class NullAnnotationModelTests extends ReconcilerTests {
"}\n");
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. ERROR in /Bug405843/src/p1/X.java (at line 4)\n" +
- " y.foo(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String @NonNull[]\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in /Bug405843/src/p1/X.java (at line 4)\n" +
+ " y.foo(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String @NonNull[]\' but the provided value is null\n" +
"----------\n"
);
@@ -684,16 +684,16 @@ public class NullAnnotationModelTests extends ReconcilerTests {
setUpWorkingCopy("/Bug458361/src/MyCollection.java",
"import java.util.Collection;\n" +
"import org.eclipse.jdt.annotation.*;\n" +
- "public interface MyCollection<T> extends Collection<T> {\n" +
+ "public interface MyCollection<T> extends Collection<T> {\n" +
" public @Nullable T get(int i);\n" +
"}\n");
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. ERROR in /Bug458361/src/MyCollection.java (at line 4)\n" +
- " public @Nullable T get(int i);\n" +
- " ^^^^^^^^^^^\n" +
- "The return type is incompatible with the free type variable \'T\' returned from Collection<T>.get(int) (mismatching null constraints)\n" +
+ "----------\n" +
+ "1. ERROR in /Bug458361/src/MyCollection.java (at line 4)\n" +
+ " public @Nullable T get(int i);\n" +
+ " ^^^^^^^^^^^\n" +
+ "The return type is incompatible with the free type variable \'T\' returned from Collection<T>.get(int) (mismatching null constraints)\n" +
"----------\n");
} finally {
if (project != null)
@@ -707,7 +707,7 @@ public class NullAnnotationModelTests extends ReconcilerTests {
project.setOption(JavaCore.COMPILER_ANNOTATION_NULL_ANALYSIS, JavaCore.ENABLED);
project.setOption(JavaCore.COMPILER_PB_NULL_SPECIFICATION_VIOLATION, JavaCore.ERROR);
-
+
createFile("/Bug458361/src/Super.java",
"import org.eclipse.jdt.annotation.*;\n" +
"public interface Super {\n" +
@@ -716,16 +716,16 @@ public class NullAnnotationModelTests extends ReconcilerTests {
setUpWorkingCopy("/Bug458361/src/Sub.java",
"import org.eclipse.jdt.annotation.*;\n" +
- "public interface Sub extends Super {\n" +
+ "public interface Sub extends Super {\n" +
" @Nullable String getName();\n" +
"}\n");
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. ERROR in /Bug458361/src/Sub.java (at line 3)\n" +
- " @Nullable String getName();\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The return type is incompatible with \'@NonNull String\' returned from Super.getName() (mismatching null constraints)\n" +
+ "----------\n" +
+ "1. ERROR in /Bug458361/src/Sub.java (at line 3)\n" +
+ " @Nullable String getName();\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull String\' returned from Super.getName() (mismatching null constraints)\n" +
"----------\n");
} finally {
if (project != null)
@@ -776,7 +776,7 @@ public class NullAnnotationModelTests extends ReconcilerTests {
deleteProject(project);
}
}
-
+
public void testBug495635() throws CoreException, IOException, InterruptedException {
IJavaProject project = null;
try {
@@ -807,7 +807,7 @@ public class NullAnnotationModelTests extends ReconcilerTests {
);
String str = this.workingCopy.getSource();
-
+
int start = str.indexOf("PersonKey");
int length = "PersonKey".length();
@@ -823,7 +823,7 @@ public class NullAnnotationModelTests extends ReconcilerTests {
deleteProject(project);
}
}
-
+
public void testBug460491WithOldBinary() throws CoreException, InterruptedException, IOException {
IJavaProject project = null;
try {
@@ -833,11 +833,11 @@ public class NullAnnotationModelTests extends ReconcilerTests {
// bug460491-compiled-with-4.6.jar contains classes compiled with eclipse 4.6:
/*-
package test1;
-
+
import org.eclipse.jdt.annotation.DefaultLocation;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
-
+
public abstract class Base<B> {
static public class Static {
public class Middle1 {
@@ -849,7 +849,7 @@ public class NullAnnotationModelTests extends ReconcilerTests {
}
}
}
-
+
@NonNullByDefault(DefaultLocation.PARAMETER)
public Object method( Static.Middle1.Middle2<Object>.Middle3.@Nullable GenericInner<String> nullable) {
return new Object();
@@ -896,11 +896,11 @@ public class NullAnnotationModelTests extends ReconcilerTests {
// bug460491b-compiled-with-4.6.jar contains classes compiled with eclipse 4.6:
/*-
package test1;
-
+
import org.eclipse.jdt.annotation.DefaultLocation;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
-
+
public abstract class Base<B> {
static public class Static1 {
public static class Static2<X> {
@@ -912,7 +912,7 @@ public class NullAnnotationModelTests extends ReconcilerTests {
}
}
}
-
+
@NonNullByDefault(DefaultLocation.PARAMETER)
public Object method( Static1.Static2<Exception>.Middle1<Object>.Middle2.@Nullable GenericInner<String> nullable) {
return new Object();
@@ -926,13 +926,13 @@ public class NullAnnotationModelTests extends ReconcilerTests {
"\n" +
"import test1.Base;\n" +
"\n" +
- "class Derived extends Base<Object> {\n" +
- " void testOK(Static1.Static2<Exception>.Middle1<Object>.Middle2.GenericInner<String> gi) {\n" +
- " method(gi);\n" +
- " }\n" +
- " void testNOK(Static1.Static2<String>.Middle1<Object>.Middle2.GenericInner<String> gi) {\n" +
- " method(gi);\n" +
- " }\n" +
+ "class Derived extends Base<Object> {\n" +
+ " void testOK(Static1.Static2<Exception>.Middle1<Object>.Middle2.GenericInner<String> gi) {\n" +
+ " method(gi);\n" +
+ " }\n" +
+ " void testNOK(Static1.Static2<String>.Middle1<Object>.Middle2.GenericInner<String> gi) {\n" +
+ " method(gi);\n" +
+ " }\n" +
"}\n";
this.createFile(
"/Bug460491/src/test2/Derived.java",
@@ -944,11 +944,11 @@ public class NullAnnotationModelTests extends ReconcilerTests {
getCompilationUnit("/Bug460491/src/test2/Derived.java").getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. ERROR in /Bug460491/src/test2/Derived.java (at line 10)\n" +
- " method(gi);\n" +
- " ^^^^^^\n" +
- "The method method(Base.Static1.Static2<Exception>.Middle1<Object>.Middle2.GenericInner<String>) in the type Base<Object> is not applicable for the arguments (Base.Static1.Static2<String>.Middle1<Object>.Middle2.GenericInner<String>)\n" +
+ "----------\n" +
+ "1. ERROR in /Bug460491/src/test2/Derived.java (at line 10)\n" +
+ " method(gi);\n" +
+ " ^^^^^^\n" +
+ "The method method(Base.Static1.Static2<Exception>.Middle1<Object>.Middle2.GenericInner<String>) in the type Base<Object> is not applicable for the arguments (Base.Static1.Static2<String>.Middle1<Object>.Middle2.GenericInner<String>)\n" +
"----------\n"
);
} finally {
@@ -1000,8 +1000,8 @@ public class NullAnnotationModelTests extends ReconcilerTests {
"import p.*;\n" +
"public class Test {\n" +
" @Nullable int[] ints = null;\n" +
- " public @NonNull Object foo(@NonNull byte[] data) {\n" +
- " return data;\n" +
+ " public @NonNull Object foo(@NonNull byte[] data) {\n" +
+ " return data;\n" +
" }\n" +
"}\n");
@@ -1018,7 +1018,7 @@ public class NullAnnotationModelTests extends ReconcilerTests {
try {
project = createJavaProject("Bug549764", new String[] {"src"}, new String[] {"JCL18_LIB", this.ANNOTATION_LIB}, "bin", "1.8");
project.setOption(JavaCore.COMPILER_ANNOTATION_NULL_ANALYSIS, JavaCore.ENABLED);
-
+
IPath libpath = project.getProject().getLocation().append("libann.jar");
Util.createJar(new String[] {
"lib/MyGenerated.java",
@@ -1032,23 +1032,23 @@ public class NullAnnotationModelTests extends ReconcilerTests {
createFolder("Bug549764/src/nullAnalysis");
createFile("Bug549764/src/nullAnalysis/package-info.java",
- "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
+ "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
"package nullAnalysis;");
String testSource =
- "package nullAnalysis;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "import lib.MyGenerated;\n" +
- "\n" +
- "@MyGenerated(Endpoint.COMMENT)\n" +
- "public class Endpoint {\n" +
- "\n" +
- " public static final String COMMENT = \" comment\";\n" +
- "\n" +
- " public void method() {\n" +
- " format(COMMENT, \"\");\n" +
- " }\n" +
- " native void format(@NonNull String comment, String arg);\n" +
+ "package nullAnalysis;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "import lib.MyGenerated;\n" +
+ "\n" +
+ "@MyGenerated(Endpoint.COMMENT)\n" +
+ "public class Endpoint {\n" +
+ "\n" +
+ " public static final String COMMENT = \" comment\";\n" +
+ "\n" +
+ " public void method() {\n" +
+ " format(COMMENT, \"\");\n" +
+ " }\n" +
+ " native void format(@NonNull String comment, String arg);\n" +
"}\n";
String testSourcePath = "Bug549764/src/nullAnalysis/Endpoint.java";
createFile(testSourcePath, testSource);
@@ -1058,18 +1058,18 @@ public class NullAnnotationModelTests extends ReconcilerTests {
getCompilationUnit(testSourcePath).getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. WARNING in /Bug549764/src/nullAnalysis/Endpoint.java (at line 14)\n" +
- " native void format(@NonNull String comment, String arg);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The nullness annotation is redundant with a default that applies to this location\n" +
+ "----------\n" +
+ "1. WARNING in /Bug549764/src/nullAnalysis/Endpoint.java (at line 14)\n" +
+ " native void format(@NonNull String comment, String arg);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The nullness annotation is redundant with a default that applies to this location\n" +
"----------\n"
);
} finally {
deleteProject(project);
}
}
-
+
// was: NPE in SourceTypeBinding.getAnnotationTagBits
@SuppressWarnings("deprecation")
public void testBug551426() throws CoreException, Exception {
@@ -1081,8 +1081,8 @@ public class NullAnnotationModelTests extends ReconcilerTests {
options.put(JavaCore.COMPILER_COMPLIANCE, "1.8");
astParser.setCompilerOptions(options);
astParser.setUnitName("C.java");
- String source =
- "class C {\n" +
+ String source =
+ "class C {\n" +
" public static final Object f = new Object() {};\n" +
"}\n";
astParser.setSource(source.toCharArray());
@@ -1099,10 +1099,10 @@ public class NullAnnotationModelTests extends ReconcilerTests {
try {
project = createJavaProject("Bug479389", new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "1.8");
project.setOption(JavaCore.COMPILER_ANNOTATION_NULL_ANALYSIS, JavaCore.ENABLED);
-
+
createFolder("Bug479389/src/nullAnalysis");
String testSource =
- "package nullAnalysis;\n" +
+ "package nullAnalysis;\n" +
"interface MyList<T> {\n" +
" public Stream<T> stream();\n" +
"}\n" +
@@ -1111,12 +1111,12 @@ public class NullAnnotationModelTests extends ReconcilerTests {
"}\n" +
"interface IntFunction<T> {\n" +
" T apply(int i);\n" +
- "}\n" +
- "public class X {\n" +
- "\n" +
- " public String[] method(MyList<String> in) {\n" +
- " return in.stream().toArray(String[]::new);\n" +
- " }\n" +
+ "}\n" +
+ "public class X {\n" +
+ "\n" +
+ " public String[] method(MyList<String> in) {\n" +
+ " return in.stream().toArray(String[]::new);\n" +
+ " }\n" +
"}\n";
String testSourcePath = "Bug479389/src/nullAnalysis/X.java";
createFile(testSourcePath, testSource);
@@ -1126,11 +1126,11 @@ public class NullAnnotationModelTests extends ReconcilerTests {
getCompilationUnit(testSourcePath).getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. ERROR in /Bug479389/src/nullAnalysis/X.java (at line 13)\n" +
- " return in.stream().toArray(String[]::new);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Annotation type \'org.eclipse.jdt.annotation.NonNull\' cannot be found on the build path, which is implicitly needed for null analysis\n" +
+ "----------\n" +
+ "1. ERROR in /Bug479389/src/nullAnalysis/X.java (at line 13)\n" +
+ " return in.stream().toArray(String[]::new);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Annotation type \'org.eclipse.jdt.annotation.NonNull\' cannot be found on the build path, which is implicitly needed for null analysis\n" +
"----------\n" );
} finally {
deleteProject(project);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/NullAnnotationModelTests9.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/NullAnnotationModelTests9.java
index 0386f57d4..0bc483b4f 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/NullAnnotationModelTests9.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/NullAnnotationModelTests9.java
@@ -72,7 +72,7 @@ public class NullAnnotationModelTests9 extends ReconcilerTests {
try {
p = createJavaProject("mod.one", new String[] {"src"}, new String[] {"JCL19_LIB", this.ANNOTATION_LIB}, "bin", "9");
p.setOption(JavaCore.COMPILER_ANNOTATION_NULL_ANALYSIS, JavaCore.ENABLED);
-
+
createFolder("/mod.one/src/p/q");
createFile("/mod.one/src/module-info.java",
"@org.eclipse.jdt.annotation.NonNullByDefault\n" +
@@ -80,7 +80,7 @@ public class NullAnnotationModelTests9 extends ReconcilerTests {
" requires org.eclipse.jdt.annotation;\n" +
" exports p.q;\n" +
"}\n");
-
+
createFile("/mod.one/src/p/q/API.java",
"package p.q;\n" +
"public class API {\n" +
@@ -109,17 +109,17 @@ public class NullAnnotationModelTests9 extends ReconcilerTests {
" }\n" +
"}\n";
createFile("/mod.two/src/client/Client.java", clientSource);
-
+
this.problemRequestor.initialize(clientSource.toCharArray());
getCompilationUnit("/mod.two/src/client/Client.java").getWorkingCopy(this.wcOwner, null);
assertProblems("Unexpected problems",
"----------\n" +
- "1. ERROR in /mod.two/src/client/Client.java (at line 6)\n" +
- " api.id(null); // NOK\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "1. ERROR in /mod.two/src/client/Client.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");
} finally {
if (p != null)
@@ -157,7 +157,7 @@ public class NullAnnotationModelTests9 extends ReconcilerTests {
"9",
options);
p2.getResource().refreshLocal(1, null);
-
+
IClasspathAttribute[] attr = { JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true") };
addClasspathEntry(p2, JavaCore.newLibraryEntry(new Path("/mod.two/mod.one.jar"), null, null, null, attr, false));
addClasspathEntry(p2, JavaCore.newLibraryEntry(new Path(this.ANNOTATION_LIB), null, null, null, attr, false));
@@ -179,11 +179,11 @@ public class NullAnnotationModelTests9 extends ReconcilerTests {
" }\n" +
"}\n";
createFile("/mod.two/src/client/Client.java", clientSource);
-
+
// full build:
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
- assertMarkers("Unexpected markers in mod.one",
+ assertMarkers("Unexpected markers in mod.one",
"Null type mismatch: required \'@NonNull String\' but the provided value is null",
markers);
@@ -193,10 +193,10 @@ public class NullAnnotationModelTests9 extends ReconcilerTests {
assertProblems("Unexpected problems",
"----------\n" +
- "1. ERROR in /mod.two/src/client/Client.java (at line 6)\n" +
- " api.id(null); // NOK\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "1. ERROR in /mod.two/src/client/Client.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");
} finally {
if (p != null)
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/OptionTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/OptionTests.java
index 4bffa2d4c..2bb2aeaaa 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/OptionTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/OptionTests.java
@@ -730,11 +730,11 @@ public void testBug324987_Project01() throws CoreException {
project.setOption(obsoleteOption, JavaCore.DO_NOT_INSERT);
// Verify that obsolete preference is not stored
assertNull(
- "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
+ "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
project.getEclipsePreferences().get(obsoleteOption, null));
// Verify that project obsolete option is well retrieved
assertEquals(
- "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
+ "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
JavaCore.DO_NOT_INSERT,
project.getOption(obsoleteOption, true));
} finally {
@@ -758,11 +758,11 @@ public void testBug324987_Project02() throws CoreException {
project.setOptions(testOptions);
// Verify that obsolete preference is not stored
assertNull(
- "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
+ "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
// Verify that project obsolete option is well retrieved
project.getEclipsePreferences().get(obsoleteOption, null));
assertEquals(
- "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
+ "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
JavaCore.INSERT,
project.getOption(obsoleteOption, true));
} finally {
@@ -812,11 +812,11 @@ public void testBug346010() throws CoreException {
project.setOptions(orderedOptions);
// Verify that obsolete preference is not stored
assertNull(
- "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
+ "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
project.getEclipsePreferences().get(obsoleteOption, null));
// Verify that project obsolete option is well retrieved
assertEquals(
- "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
+ "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
JavaCore.INSERT,
project.getOption(obsoleteOption, true));
} finally {
@@ -840,12 +840,12 @@ public void testBug324987_Project03() throws CoreException {
project.getEclipsePreferences().put(obsoleteOption, JavaCore.DO_NOT_INSERT);
// Verify that obsolete preference is stored
assertEquals(
- "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
+ "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
JavaCore.DO_NOT_INSERT,
project.getEclipsePreferences().get(obsoleteOption, null));
// Verify that project obsolete option is well retrieved
assertEquals(
- "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
+ "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
JavaCore.DO_NOT_INSERT,
project.getOption(obsoleteOption, true));
} finally {
@@ -868,11 +868,11 @@ public void testBug324987_Workspace01() throws CoreException {
JavaCore.setOptions(testOptions);
// Verify that obsolete preference is not stored
assertNull(
- "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
+ "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
JavaModelManager.getJavaModelManager().getInstancePreferences().get(obsoleteOption, null));
// Verify that workspace obsolete option is well retrieved
assertEquals(
- "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
+ "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
JavaCore.INSERT,
JavaCore.getOption(obsoleteOption));
} finally {
@@ -894,12 +894,12 @@ public void testBug324987_Workspace02() throws CoreException {
instancePreferences.put(obsoleteOption, JavaCore.DO_NOT_INSERT);
// Verify that obsolete preference is stored
assertEquals(
- "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
+ "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
JavaCore.DO_NOT_INSERT,
instancePreferences.get(obsoleteOption, null));
// Verify that project obsolete option is well retrieved
assertEquals(
- "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
+ "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
JavaCore.DO_NOT_INSERT,
JavaCore.getOption(obsoleteOption));
} finally {
@@ -922,11 +922,11 @@ public void testBug324987_Workspace03() throws CoreException {
JavaCore.setOptions(testOptions);
// Verify that obsolete preference is not stored
assertNull(
- "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
+ "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
JavaModelManager.getJavaModelManager().getInstancePreferences().get(obsoleteOption, null));
// Verify that workspace obsolete option is well retrieved
assertEquals(
- "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
+ "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
JavaCore.INSERT,
JavaCore.getOption(obsoleteOption));
} finally {
@@ -948,12 +948,12 @@ public void testBug324987_Workspace04() throws CoreException {
instancePreferences.put(obsoleteOption, JavaCore.INSERT);
// Verify that obsolete preference is stored
assertEquals(
- "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
+ "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
JavaCore.INSERT,
instancePreferences.get(obsoleteOption, null));
// Verify that project obsolete option is well retrieved
assertEquals(
- "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
+ "Unexpected value for formatter deprecated option 'org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member'",
JavaCore.INSERT,
JavaCore.getOption(obsoleteOption));
} finally {
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java
index 4c3b7c33d..d5a501cba 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java
@@ -79,7 +79,7 @@ public class ReconcilerTests extends ModifyingResourceTests {
super.acceptProblem(problem);
}
}
-
+
/*package*/ static final int JLS_LATEST = AST.JLS14;
static class ReconcileParticipant extends CompilationParticipant {
@@ -378,7 +378,7 @@ public void testAccessRestriction2() throws CoreException, IOException {
new String[] {
"**/*"
},
- null,
+ null,
"1.4",
null
);
@@ -433,11 +433,11 @@ public void testAccessRestriction4() throws CoreException {
setUpWorkingCopy("/P3/src/Y.java", "public class Y extends p.X {}");
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. ERROR in /P3/src/Y.java (at line 1)\n" +
- " public class Y extends p.X {}\n" +
- " ^^^\n" +
- "Access restriction: The type \'X\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "1. ERROR in /P3/src/Y.java (at line 1)\n" +
+ " public class Y extends p.X {}\n" +
+ " ^^^\n" +
+ "Access restriction: The type \'X\' is not API (restriction on required project \'P1\')\n" +
"----------\n"
);
} finally {
@@ -474,11 +474,11 @@ public void testAccessRestriction5() throws CoreException {
this.workingCopy.reconcile(ICompilationUnit.NO_AST, true/*force problem detection*/, null, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. ERROR in /P2/src/Y.java (at line 1)\n" +
- " public class Y extends p.X {}\n" +
- " ^^^\n" +
- "Access restriction: The type \'X\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "1. ERROR in /P2/src/Y.java (at line 1)\n" +
+ " public class Y extends p.X {}\n" +
+ " ^^^\n" +
+ "Access restriction: The type \'X\' is not API (restriction on required project \'P1\')\n" +
"----------\n"
);
@@ -1692,11 +1692,11 @@ public void testExcludePartOfAnotherProject1() throws CoreException {
this.workingCopy.reconcile(ICompilationUnit.NO_AST, false, null, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. ERROR in /Reconciler/src/p1/X.java (at line 2)\n" +
- " public class X extends p.internal.Y {\n" +
- " ^^^^^^^^^^^^\n" +
- "Access restriction: The type \'Y\' is not API (restriction on required project \'P\')\n" +
+ "----------\n" +
+ "1. ERROR in /Reconciler/src/p1/X.java (at line 2)\n" +
+ " public class X extends p.internal.Y {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Access restriction: The type \'Y\' is not API (restriction on required project \'P\')\n" +
"----------\n"
);
} finally {
@@ -1896,11 +1896,11 @@ public void testIncludePartOfAnotherProject2() throws CoreException {
this.workingCopy.reconcile(ICompilationUnit.NO_AST, false, null, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. ERROR in /Reconciler/src/p1/X.java (at line 2)\n" +
- " public class X extends p.internal.Y {\n" +
- " ^^^^^^^^^^^^\n" +
- "Access restriction: The type \'Y\' is not API (restriction on required project \'P\')\n" +
+ "----------\n" +
+ "1. ERROR in /Reconciler/src/p1/X.java (at line 2)\n" +
+ " public class X extends p.internal.Y {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Access restriction: The type \'Y\' is not API (restriction on required project \'P\')\n" +
"----------\n"
);
} finally {
@@ -2021,11 +2021,11 @@ public void testIgnoreIfBetterNonAccessibleRule2() throws CoreException {
this.workingCopy.reconcile(ICompilationUnit.NO_AST, false, null, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. WARNING in /Reconciler/src/p1/X.java (at line 2)\n" +
- " public class X extends p.internal.Y {\n" +
- " ^^^^^^^^^^^^\n" +
- "Discouraged access: The type \'Y\' is not API (restriction on required project \'P2\')\n" +
+ "----------\n" +
+ "1. WARNING in /Reconciler/src/p1/X.java (at line 2)\n" +
+ " public class X extends p.internal.Y {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Discouraged access: The type \'Y\' is not API (restriction on required project \'P2\')\n" +
"----------\n"
);
} finally {
@@ -2066,11 +2066,11 @@ public void testIgnoreIfBetterNonAccessibleRule3() throws CoreException {
this.workingCopy.reconcile(ICompilationUnit.NO_AST, false, null, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. ERROR in /Reconciler/src/p1/X.java (at line 2)\n" +
- " public class X extends p.internal.Y {\n" +
- " ^^^^^^^^^^^^\n" +
- "Access restriction: The type \'Y\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "1. ERROR in /Reconciler/src/p1/X.java (at line 2)\n" +
+ " public class X extends p.internal.Y {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Access restriction: The type \'Y\' is not API (restriction on required project \'P1\')\n" +
"----------\n"
);
} finally {
@@ -2103,11 +2103,11 @@ public void testIgnoreIfBetterNonAccessibleRule4() throws CoreException {
this.workingCopy.reconcile(ICompilationUnit.NO_AST, false, null, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. ERROR in /Reconciler/src/p1/X.java (at line 2)\n" +
- " public class X extends p.internal.Y {\n" +
- " ^^^^^^^^^^^^\n" +
- "Access restriction: The type \'Y\' is not API (restriction on required project \'P1\')\n" +
+ "----------\n" +
+ "1. ERROR in /Reconciler/src/p1/X.java (at line 2)\n" +
+ " public class X extends p.internal.Y {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Access restriction: The type \'Y\' is not API (restriction on required project \'P1\')\n" +
"----------\n"
);
} finally {
@@ -2188,11 +2188,11 @@ public void testMethodWithError01a() throws CoreException {
);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. ERROR in /Reconciler/src/p1/X.java (at line 4)\n" +
- " public_ void foo() {\n" +
- " ^^^^^^^\n" +
- "Syntax error on token \"public_\", public expected\n" +
+ "----------\n" +
+ "1. ERROR in /Reconciler/src/p1/X.java (at line 4)\n" +
+ " public_ void foo() {\n" +
+ " ^^^^^^^\n" +
+ "Syntax error on token \"public_\", public expected\n" +
"----------\n"
);
@@ -3229,8 +3229,8 @@ public void testReconcileParticipant12() throws CoreException {
this.workingCopy.reconcile(ICompilationUnit.NO_AST, false, null, null);
assertWorkingCopyDeltas(
"Unexpected participant delta",
- "X[*]: {CHILDREN | FINE GRAINED}\n" +
- " bar()[+]: {}\n" +
+ "X[*]: {CHILDREN | FINE GRAINED}\n" +
+ " bar()[+]: {}\n" +
" foo()[-]: {}"
);
} finally {
@@ -3345,16 +3345,16 @@ public void testRenameWithSyntaxError() throws JavaModelException {
/* orig:
"Syntax error, insert \")\" to complete MethodDeclaration\n" +
:giro */
- "Syntax error, insert \")\" to complete MethodSpecLong\n" +
- "----------\n" +
- "2. ERROR in /Reconciler/src/p1/X.java (at line 4)\n" +
- " public void bar( {\n" +
- " ^\n" +
- "Syntax error, insert \"<-\" to complete CallinBindingLeft\n" +
- "----------\n" +
- "3. ERROR in /Reconciler/src/p1/X.java (at line 4)\n" +
- " public void bar( {\n" +
- " ^\n" +
+ "Syntax error, insert \")\" to complete MethodSpecLong\n" +
+ "----------\n" +
+ "2. ERROR in /Reconciler/src/p1/X.java (at line 4)\n" +
+ " public void bar( {\n" +
+ " ^\n" +
+ "Syntax error, insert \"<-\" to complete CallinBindingLeft\n" +
+ "----------\n" +
+ "3. ERROR in /Reconciler/src/p1/X.java (at line 4)\n" +
+ " public void bar( {\n" +
+ " ^\n" +
"Syntax error, insert \"MethodSpecsLong EmptyParameterMappings\" to complete ClassBodyDeclarations\n" +
// SH}
"----------\n"
@@ -4439,23 +4439,23 @@ public void testFallthroughDiagnosis() throws CoreException, InterruptedExceptio
// Resources creation
IJavaProject p1 = createJavaProject("P1", new String[] {""}, new String[] {"JCL_LIB"}, "bin");
p1.setOption(JavaCore.COMPILER_PB_FALLTHROUGH_CASE, JavaCore.ERROR);
- String source =
- "public class X {\n" +
- " void foo(int i) {\n" +
- " switch(i) {\n" +
- " case 0:\n" +
- " i ++;\n" +
- " // $FALL-THROUGH$\n" +
- " case 1:\n" +
- " i++;\n" +
- " /* $FALL-THROUGH$ */\n" +
- " case 2:\n" +
- " i++;\n" +
- " case 3:\n" +
- " }\n" +
- " }\n" +
+ String source =
+ "public class X {\n" +
+ " void foo(int i) {\n" +
+ " switch(i) {\n" +
+ " case 0:\n" +
+ " i ++;\n" +
+ " // $FALL-THROUGH$\n" +
+ " case 1:\n" +
+ " i++;\n" +
+ " /* $FALL-THROUGH$ */\n" +
+ " case 2:\n" +
+ " i++;\n" +
+ " case 3:\n" +
+ " }\n" +
+ " }\n" +
"}\n";
-
+
createFile("/P1/X.java", source);
this.workingCopies = new ICompilationUnit[1];
@@ -4464,11 +4464,11 @@ public void testFallthroughDiagnosis() throws CoreException, InterruptedExceptio
this.problemRequestor.initialize(sourceChars);
this.workingCopies[0] = getCompilationUnit("/P1/X.java").getWorkingCopy(this.wcOwner, null);
assertProblems("Working copy should have problems:",
- "----------\n" +
- "1. ERROR in /P1/X.java (at line 12)\n" +
- " case 3:\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 /P1/X.java (at line 12)\n" +
+ " case 3:\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"
);
} finally {
@@ -4478,11 +4478,11 @@ public void testFallthroughDiagnosis() throws CoreException, InterruptedExceptio
/*
* Ensure that the option ICompilationUnit.IGNORE_METHOD_BODIES is honored
*/
-public void testIgnoreMethodBodies1() throws CoreException {
+public void testIgnoreMethodBodies1() throws CoreException {
setWorkingCopyContents(
"package p1;\n" +
//{ObjectTeams: we don't check imports before analyze (see CUD.resolve())
-/* orig:
+/* orig:
"import p2.*;" +
"public class X {\n" +
*/
@@ -4490,7 +4490,7 @@ public void testIgnoreMethodBodies1() throws CoreException {
"public class X implements java.io.Serializable {\n" +
// SH}
" public int foo() {\n" + // force an error by not returning
- " int i = 0;\n" +
+ " int i = 0;\n" +
" }\n" +
"}");
org.eclipse.jdt.core.dom.CompilationUnit ast = this.workingCopy.reconcile(JLS_LATEST, ICompilationUnit.IGNORE_METHOD_BODIES, null, null);
@@ -4504,8 +4504,8 @@ public void testIgnoreMethodBodies1() throws CoreException {
" ^^\n" +
"The import p2 is never used\n"+
:giro */
- " public class X implements java.io.Serializable {\n" +
- " ^\n" +
+ " public class X implements java.io.Serializable {\n" +
+ " ^\n" +
"The serializable class X does not declare a static final serialVersionUID field of type long\n" +
// SH}
"----------\n"
@@ -4515,7 +4515,7 @@ public void testIgnoreMethodBodies1() throws CoreException {
"Unexpected participant ast",
"package p1;\n" +
//{ObjectTeams: different AST (see above):
-/* orig:
+/* orig:
"import p2.*;\n" +
"public class X {\n" +
:giro */
@@ -4533,10 +4533,10 @@ public void testIgnoreMethodBodies2() throws CoreException {
"import p2.*;" +
"public class X {\n" +
" public void foo() {\n" +
- " int i = 0;\n" +
+ " int i = 0;\n" +
" }\n" +
" public int bar() {\n" +
- " int i = 0;\n" +
+ " int i = 0;\n" +
" new X() /*start*/{\n" +
" }/*end*/;" +
" }\n" +
@@ -4564,10 +4564,10 @@ public void testIgnoreMethodBodies3() throws CoreException {
"import p2.*;" +
"public class X {\n" +
" public void foo() {\n" +
- " int i = 0;\n" +
+ " int i = 0;\n" +
" }\n" +
" public int bar() {\n" +
- " int i = 0;\n" +
+ " int i = 0;\n" +
" new X() {\n" +
" };" +
" }\n" +
@@ -4599,10 +4599,10 @@ public void testIgnoreMethodBodies4() throws CoreException {
"import p2.*;" +
"public class X {\n" +
" public void foo() {\n" +
- " int i = 0;\n" +
+ " int i = 0;\n" +
" }\n" +
" public int bar() {\n" +
- " int i = 0;\n" +
+ " int i = 0;\n" +
" new X() {\n" +
" };" +
" }\n" +
@@ -4645,21 +4645,21 @@ public void testGenericAPIUsageFromA14Project() throws CoreException {
project15.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5);
project15.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5);
project15.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5);
-
+
project14 = createJavaProject("Reconciler1415", new String[] {"src"}, new String[] {"JCL_LIB"}, "bin");
project14.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_4);
project14.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_4);
project14.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_4);
-
+
IClasspathEntry[] oldClasspath = project14.getRawClasspath();
int oldLength = oldClasspath.length;
IClasspathEntry[] newClasspath = new IClasspathEntry[oldLength+1];
System.arraycopy(oldClasspath, 0, newClasspath, 0, oldLength);
newClasspath[oldLength] = JavaCore.newProjectEntry(new Path("/Reconciler15API"));
project14.setRawClasspath(newClasspath, null);
-
+
createFolder("/Reconciler1415/src/p1");
- String source =
+ String source =
"package p1;\n" +
"import p2.BundleContext;\n" +
"public class X {\n" +
@@ -4672,18 +4672,18 @@ public void testGenericAPIUsageFromA14Project() throws CoreException {
"/Reconciler1415/src/p1/X.java",
source
);
-
+
this.workingCopies = new ICompilationUnit[1];
char[] sourceChars = source.toCharArray();
this.problemRequestor.initialize(sourceChars);
this.workingCopies[0] = getCompilationUnit("/Reconciler1415/src/p1/X.java").getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. WARNING in /Reconciler1415/src/p1/X.java (at line 5)\n" +
- " String s = (String) context.getService(string); \n" +
- " ^\n" +
- "The value of the local variable s is not used\n" +
+ "----------\n" +
+ "1. WARNING in /Reconciler1415/src/p1/X.java (at line 5)\n" +
+ " String s = (String) context.getService(string); \n" +
+ " ^\n" +
+ "The value of the local variable s is not used\n" +
"----------\n"
);
} finally {
@@ -4712,21 +4712,21 @@ public void testGenericAPIUsageFromA14Project2() throws CoreException {
project15.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5);
project15.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5);
project15.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_4);
-
+
project14 = createJavaProject("Reconciler1415", new String[] {"src"}, new String[] {"JCL_LIB"}, "bin");
project14.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_4);
project14.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_4);
project14.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_4);
-
+
IClasspathEntry[] oldClasspath = project14.getRawClasspath();
int oldLength = oldClasspath.length;
IClasspathEntry[] newClasspath = new IClasspathEntry[oldLength+1];
System.arraycopy(oldClasspath, 0, newClasspath, 0, oldLength);
newClasspath[oldLength] = JavaCore.newProjectEntry(new Path("/Reconciler15API"));
project14.setRawClasspath(newClasspath, null);
-
+
createFolder("/Reconciler1415/src/p1");
- String source =
+ String source =
"package p1;\n" +
"import p2.BundleContext;\n" +
"public class X {\n" +
@@ -4739,18 +4739,18 @@ public void testGenericAPIUsageFromA14Project2() throws CoreException {
"/Reconciler1415/src/p1/X.java",
source
);
-
+
this.workingCopies = new ICompilationUnit[1];
char[] sourceChars = source.toCharArray();
this.problemRequestor.initialize(sourceChars);
this.workingCopies[0] = getCompilationUnit("/Reconciler1415/src/p1/X.java").getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. WARNING in /Reconciler1415/src/p1/X.java (at line 5)\n" +
- " String s = (String) context.getService(string); \n" +
- " ^\n" +
- "The value of the local variable s is not used\n" +
+ "----------\n" +
+ "1. WARNING in /Reconciler1415/src/p1/X.java (at line 5)\n" +
+ " String s = (String) context.getService(string); \n" +
+ " ^\n" +
+ "The value of the local variable s is not used\n" +
"----------\n"
);
} finally {
@@ -4819,21 +4819,21 @@ public void testGenericAPIUsageFromA14Project3() throws CoreException {
project15.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5);
project15.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5);
project15.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5);
-
+
project14 = createJavaProject("Reconciler1415", new String[] {"src"}, new String[] {"JCL15_LIB"}, "bin");
project14.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_4);
project14.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_4);
project14.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_4);
-
+
IClasspathEntry[] oldClasspath = project14.getRawClasspath();
int oldLength = oldClasspath.length;
IClasspathEntry[] newClasspath = new IClasspathEntry[oldLength+1];
System.arraycopy(oldClasspath, 0, newClasspath, 0, oldLength);
newClasspath[oldLength] = JavaCore.newProjectEntry(new Path("/Reconciler15API"));
project14.setRawClasspath(newClasspath, null);
-
+
createFolder("/Reconciler1415/src/p1");
- String source =
+ String source =
"package p1;\n" +
"import java.util.Collection;\n" +
"public class X {\n" +
@@ -4846,18 +4846,18 @@ public void testGenericAPIUsageFromA14Project3() throws CoreException {
"/Reconciler1415/src/p1/X.java",
source
);
-
+
this.workingCopies = new ICompilationUnit[1];
char[] sourceChars = source.toCharArray();
this.problemRequestor.initialize(sourceChars);
this.workingCopies[0] = getCompilationUnit("/Reconciler1415/src/p1/X.java").getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. WARNING in /Reconciler1415/src/p1/X.java (at line 5)\n" +
- " Collection c = p2.X.getX(); \n" +
- " ^\n" +
- "The value of the local variable c is not used\n" +
+ "----------\n" +
+ "1. WARNING in /Reconciler1415/src/p1/X.java (at line 5)\n" +
+ " Collection c = p2.X.getX(); \n" +
+ " ^\n" +
+ "The value of the local variable c is not used\n" +
"----------\n"
);
} finally {
@@ -4874,7 +4874,7 @@ public void testGenericAPIUsageFromA14Project4() throws CoreException {
try {
project14 = createJavaProject("Reconciler1415", new String[] {"src"}, new String[] {"JCL15_LIB"}, "bin");
createFolder("/Reconciler1415/src/p1");
- String source =
+ String source =
"package p1;\n" +
"import java.lang.Comparable;\n" +
"public class X implements Comparable {\n" +
@@ -4898,8 +4898,8 @@ public void testGenericAPIUsageFromA14Project4() throws CoreException {
"public class X { \n" +
" private p1.X x = p1.X.getX();\n" +
" Comparable<String> y = null;\n" +
- "}\n";
-
+ "}\n";
+
createFile(
"/Reconciler15API/src/p2/X.java",
otherSource
@@ -4907,25 +4907,25 @@ public void testGenericAPIUsageFromA14Project4() throws CoreException {
project15.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5);
project15.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5);
project15.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5);
-
+
IClasspathEntry[] oldClasspath = project15.getRawClasspath();
int oldLength = oldClasspath.length;
IClasspathEntry[] newClasspath = new IClasspathEntry[oldLength+1];
System.arraycopy(oldClasspath, 0, newClasspath, 0, oldLength);
newClasspath[oldLength] = JavaCore.newProjectEntry(new Path("/Reconciler1415"));
project15.setRawClasspath(newClasspath, null);
-
+
this.workingCopies = new ICompilationUnit[1];
char[] sourceChars = otherSource.toCharArray();
this.problemRequestor.initialize(sourceChars);
this.workingCopies[0] = getCompilationUnit("/Reconciler15API/src/p2/X.java").getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. WARNING in /Reconciler15API/src/p2/X.java (at line 3)\n" +
- " private p1.X x = p1.X.getX();\n" +
- " ^\n" +
- "The value of the field X.x is not used\n" +
+ "----------\n" +
+ "1. WARNING in /Reconciler15API/src/p2/X.java (at line 3)\n" +
+ " private p1.X x = p1.X.getX();\n" +
+ " ^\n" +
+ "The value of the field X.x is not used\n" +
"----------\n"
);
} finally {
@@ -4957,21 +4957,21 @@ public void testGenericAPIUsageFromA14Project5() throws CoreException {
project15.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5);
project15.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5);
project15.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5);
-
+
project14 = createJavaProject("Reconciler1415", new String[] {"src"}, new String[] {"JCL_LIB"}, "bin");
project14.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_4);
project14.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_4);
project14.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_4);
-
+
IClasspathEntry[] oldClasspath = project14.getRawClasspath();
int oldLength = oldClasspath.length;
IClasspathEntry[] newClasspath = new IClasspathEntry[oldLength+1];
System.arraycopy(oldClasspath, 0, newClasspath, 0, oldLength);
newClasspath[oldLength] = JavaCore.newProjectEntry(new Path("/Reconciler15API"));
project14.setRawClasspath(newClasspath, null);
-
+
createFolder("/Reconciler1415/src/p1");
- String source =
+ String source =
"package p1;\n" +
"import p2.List;\n" +
"public class X {\n" +
@@ -4983,18 +4983,18 @@ public void testGenericAPIUsageFromA14Project5() throws CoreException {
"/Reconciler1415/src/p1/X.java",
source
);
-
+
this.workingCopies = new ICompilationUnit[1];
char[] sourceChars = source.toCharArray();
this.problemRequestor.initialize(sourceChars);
this.workingCopies[0] = getCompilationUnit("/Reconciler1415/src/p1/X.java").getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. WARNING in /Reconciler1415/src/p1/X.java (at line 5)\n" +
- " private List [] l2 = List.getBackArray(l);\n" +
- " ^^\n" +
- "The value of the field X.l2 is not used\n" +
+ "----------\n" +
+ "1. WARNING in /Reconciler1415/src/p1/X.java (at line 5)\n" +
+ " private List [] l2 = List.getBackArray(l);\n" +
+ " ^^\n" +
+ "The value of the field X.l2 is not used\n" +
"----------\n"
);
} finally {
@@ -5030,46 +5030,46 @@ public void testGenericAPIUsageFromA14Project6() throws CoreException {
project15.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5);
project15.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5);
project15.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5);
-
+
project14 = createJavaProject("Reconciler1415", new String[] {"src"}, new String[] {"JCL_LIB"}, "bin");
project14.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_4);
project14.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_4);
project14.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_4);
-
+
IClasspathEntry[] oldClasspath = project14.getRawClasspath();
int oldLength = oldClasspath.length;
IClasspathEntry[] newClasspath = new IClasspathEntry[oldLength+1];
System.arraycopy(oldClasspath, 0, newClasspath, 0, oldLength);
newClasspath[oldLength] = JavaCore.newProjectEntry(new Path("/Reconciler15API"));
project14.setRawClasspath(newClasspath, null);
-
+
createFolder("/Reconciler1415/src/p1");
- String source =
+ String source =
"package p1;\n" +
"import p2.Y;\n" +
- "public class X {\n" +
+ "public class X {\n" +
" private int unused = 0;\n" +
- " public Object foo() {\n" +
- " return new Y() {};\n" +
- " }\n" +
+ " public Object foo() {\n" +
+ " return new Y() {};\n" +
+ " }\n" +
"}";
createFile(
"/Reconciler1415/src/p1/X.java",
source
);
-
+
this.workingCopies = new ICompilationUnit[1];
char[] sourceChars = source.toCharArray();
this.problemRequestor.initialize(sourceChars);
this.workingCopies[0] = getCompilationUnit("/Reconciler1415/src/p1/X.java").getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. WARNING in /Reconciler1415/src/p1/X.java (at line 4)\n" +
- " private int unused = 0;\n" +
- " ^^^^^^\n" +
- "The value of the field X.unused is not used\n" +
+ "----------\n" +
+ "1. WARNING in /Reconciler1415/src/p1/X.java (at line 4)\n" +
+ " private int unused = 0;\n" +
+ " ^^^^^^\n" +
+ "The value of the field X.unused is not used\n" +
"----------\n"
);
} finally {
@@ -5099,7 +5099,7 @@ public void testGenericAPIUsageFromA14Project7() throws CoreException, IOExcepti
project15.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5);
project15.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5);
project15.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5);
-
+
addLibrary(
project15,
"libList15.jar",
@@ -5137,37 +5137,37 @@ public void testGenericAPIUsageFromA14Project7() throws CoreException, IOExcepti
System.arraycopy(oldClasspath, 0, newClasspath, 0, oldLength);
newClasspath[oldLength] = JavaCore.newProjectEntry(new Path("/Reconciler15API"));
project14.setRawClasspath(newClasspath, null);
-
+
createFolder("/Reconciler1415/src/p1");
- String source =
+ String source =
"package p1;\n" +
"import java.util.List;\n" +
"import p2.Y;\n" +
- "public class X {\n" +
+ "public class X {\n" +
" private static List getList(boolean test) {\n" +
" if (test)\n" +
- " return new Y();\n" +
+ " return new Y();\n" +
" else\n" +
- " return Y.getY();\n" +
- " }\n" +
+ " return Y.getY();\n" +
+ " }\n" +
"}";
createFile(
"/Reconciler1415/src/p1/X.java",
source
);
-
+
this.workingCopies = new ICompilationUnit[1];
char[] sourceChars = source.toCharArray();
this.problemRequestor.initialize(sourceChars);
this.workingCopies[0] = getCompilationUnit("/Reconciler1415/src/p1/X.java").getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. WARNING in /Reconciler1415/src/p1/X.java (at line 5)\n" +
- " private static List getList(boolean test) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "The method getList(boolean) from the type X is never used locally\n" +
+ "----------\n" +
+ "1. WARNING in /Reconciler1415/src/p1/X.java (at line 5)\n" +
+ " private static List getList(boolean test) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The method getList(boolean) from the type X is never used locally\n" +
"----------\n"
);
} finally {
@@ -5196,7 +5196,7 @@ public void testGenericAPIUsageFromA14Project8() throws CoreException, IOExcepti
project15.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5);
project15.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5);
project15.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5);
-
+
addLibrary(
project15,
"libList15.jar",
@@ -5234,36 +5234,36 @@ public void testGenericAPIUsageFromA14Project8() throws CoreException, IOExcepti
System.arraycopy(oldClasspath, 0, newClasspath, 0, oldLength);
newClasspath[oldLength] = JavaCore.newProjectEntry(new Path("/Reconciler15API"));
project14.setRawClasspath(newClasspath, null);
-
+
createFolder("/Reconciler1415/src/p1");
- String source =
+ String source =
"package p1;\n" +
"import p2.Y;\n" +
- "public class X {\n" +
+ "public class X {\n" +
" private static java.util.List getList(boolean test) {\n" +
" if (test)\n" +
- " return new Y();\n" +
+ " return new Y();\n" +
" else\n" +
- " return Y.getY();\n" +
- " }\n" +
+ " return Y.getY();\n" +
+ " }\n" +
"}";
createFile(
"/Reconciler1415/src/p1/X.java",
source
);
-
+
this.workingCopies = new ICompilationUnit[1];
char[] sourceChars = source.toCharArray();
this.problemRequestor.initialize(sourceChars);
this.workingCopies[0] = getCompilationUnit("/Reconciler1415/src/p1/X.java").getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. WARNING in /Reconciler1415/src/p1/X.java (at line 4)\n" +
- " private static java.util.List getList(boolean test) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "The method getList(boolean) from the type X is never used locally\n" +
+ "----------\n" +
+ "1. WARNING in /Reconciler1415/src/p1/X.java (at line 4)\n" +
+ " private static java.util.List getList(boolean test) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The method getList(boolean) from the type X is never used locally\n" +
"----------\n"
);
} finally {
@@ -5283,28 +5283,28 @@ public void test14ProjectWith15JRE() throws CoreException, IOException {
project14.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_4);
createFolder("/Reconciler1415/src/p1");
- String source =
+ String source =
"package p1;\n" +
"public class X {\n" +
" int a;\n" +
- " private Class c = a == 1 ? int.class : long.class;\n" +
+ " private Class c = a == 1 ? int.class : long.class;\n" +
"}\n";
createFile(
"/Reconciler1415/src/p1/X.java",
source
);
-
+
this.workingCopies = new ICompilationUnit[1];
char[] sourceChars = source.toCharArray();
this.problemRequestor.initialize(sourceChars);
this.workingCopies[0] = getCompilationUnit("/Reconciler1415/src/p1/X.java").getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. WARNING in /Reconciler1415/src/p1/X.java (at line 4)\n" +
- " private Class c = a == 1 ? int.class : long.class;\n" +
- " ^\n" +
- "The value of the field X.c is not used\n" +
+ "----------\n" +
+ "1. WARNING in /Reconciler1415/src/p1/X.java (at line 4)\n" +
+ " private Class c = a == 1 ? int.class : long.class;\n" +
+ " ^\n" +
+ "The value of the field X.c is not used\n" +
"----------\n"
);
} finally {
@@ -5322,7 +5322,7 @@ public void testJsr14TargetProjectWith14JRE() throws CoreException, IOException
project14.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_4);
createFolder("/Reconciler1415/src/p1");
- String source =
+ String source =
"package p1;\n" +
"public class X {\n" +
" public void foo() {\n" +
@@ -5335,18 +5335,18 @@ public void testJsr14TargetProjectWith14JRE() throws CoreException, IOException
"/Reconciler1415/src/p1/X.java",
source
);
-
+
this.workingCopies = new ICompilationUnit[1];
char[] sourceChars = source.toCharArray();
this.problemRequestor.initialize(sourceChars);
this.workingCopies[0] = getCompilationUnit("/Reconciler1415/src/p1/X.java").getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. WARNING in /Reconciler1415/src/p1/X.java (at line 6)\n" +
- " return;\n" +
- " ^^^^^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. WARNING in /Reconciler1415/src/p1/X.java (at line 6)\n" +
+ " return;\n" +
+ " ^^^^^^^\n" +
+ "Dead code\n" +
"----------\n"
);
@@ -5377,24 +5377,24 @@ public void testGenericAPIUsageFromA14Project9() throws CoreException {
project15.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5);
project15.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5);
project15.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5);
-
+
project14 = createJavaProject("Reconciler1415", new String[] {"src"}, new String[] {"JCL_LIB"}, "bin");
project14.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_4);
project14.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_4);
project14.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_4);
-
+
IClasspathEntry[] oldClasspath = project14.getRawClasspath();
int oldLength = oldClasspath.length;
IClasspathEntry[] newClasspath = new IClasspathEntry[oldLength+1];
System.arraycopy(oldClasspath, 0, newClasspath, 0, oldLength);
newClasspath[oldLength] = JavaCore.newProjectEntry(new Path("/Reconciler15API"));
project14.setRawClasspath(newClasspath, null);
-
+
createFolder("/Reconciler1415/src/p1");
- String source =
+ String source =
"package p1;\n" +
"public class X {\n" +
- " private int unused = 0;\n" +
+ " private int unused = 0;\n" +
" X(List l) {\n" +
" Y.foo(l);\n" +
" }\n" +
@@ -5404,18 +5404,18 @@ public void testGenericAPIUsageFromA14Project9() throws CoreException {
"/Reconciler1415/src/p1/X.java",
source
);
-
+
this.workingCopies = new ICompilationUnit[1];
char[] sourceChars = source.toCharArray();
this.problemRequestor.initialize(sourceChars);
this.workingCopies[0] = getCompilationUnit("/Reconciler1415/src/p1/X.java").getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. WARNING in /Reconciler1415/src/p1/X.java (at line 3)\n" +
- " private int unused = 0;\n" +
- " ^^^^^^\n" +
- "The value of the field X.unused is not used\n" +
+ "----------\n" +
+ "1. WARNING in /Reconciler1415/src/p1/X.java (at line 3)\n" +
+ " private int unused = 0;\n" +
+ " ^^^^^^\n" +
+ "The value of the field X.unused is not used\n" +
"----------\n"
);
} finally {
@@ -5499,18 +5499,18 @@ public void testBug374176b() throws CoreException, IOException, InterruptedExcep
this.workingCopies[0].reconcile(ICompilationUnit.NO_AST, false, null, null);
assertProblems("Unexpected problems",
- "----------\n" +
- "1. ERROR in /TestAnnot/src/p1/package-info.java (at line 1)\n" +
- " package p1;\n" +
- " ^^\n" +
- "A default nullness annotation has not been specified for the package p1\n" +
+ "----------\n" +
+ "1. ERROR in /TestAnnot/src/p1/package-info.java (at line 1)\n" +
+ " package p1;\n" +
+ " ^^\n" +
+ "A default nullness annotation has not been specified for the package p1\n" +
"----------\n");
assertProblems("Unexpected problems",
- "----------\n" +
- "1. ERROR in /TestAnnot/src/p1/package-info.java (at line 1)\n" +
- " package p1;\n" +
- " ^^\n" +
- "A default nullness annotation has not been specified for the package p1\n" +
+ "----------\n" +
+ "1. ERROR in /TestAnnot/src/p1/package-info.java (at line 1)\n" +
+ " package p1;\n" +
+ " ^^\n" +
+ "A default nullness annotation has not been specified for the package p1\n" +
"----------\n",
this.problemRequestor);
} finally {
@@ -5519,7 +5519,7 @@ public void testBug374176b() throws CoreException, IOException, InterruptedExcep
}
}
public void testSecondaryTypeDeletion() throws CoreException, IOException {
-
+
// Set working copy content with no error
setUpWorkingCopy("/Reconciler/src/X.java",
"interface I {\n" +
@@ -5536,24 +5536,24 @@ public void testSecondaryTypeDeletion() throws CoreException, IOException {
"----------\n"
);
- String contents =
+ String contents =
"public class X {\n" +
" static void goo(I i) {\n" +
" }\n" +
"}\n";
-
+
setWorkingCopyContents(contents);
this.workingCopy.reconcile(ICompilationUnit.NO_AST, true, null, null);
assertProblems(
"Wrong expected problems",
- "----------\n" +
- "1. ERROR in /Reconciler/src/X.java (at line 2)\n" +
- " static void goo(I i) {\n" +
- " ^\n" +
- "I cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in /Reconciler/src/X.java (at line 2)\n" +
+ " static void goo(I i) {\n" +
+ " ^\n" +
+ "I cannot be resolved to a type\n" +
"----------\n"
);
-
+
}
/**
* Project's compliance: source: 1.5, compiler: 1.5
@@ -5869,7 +5869,7 @@ public void testBug485092() throws CoreException, IOException, InterruptedExcept
try {
project15 = createJavaProject("Reconciler1518", new String[] {"src"}, new String[] {"JCL15_LIB"}, "bin");
createFolder("/Reconciler1518/src/p1");
- String source =
+ String source =
"package p1;\n" +
"\n" +
"public interface PreferenceableOption<T extends Object> {}\n";
@@ -5885,7 +5885,7 @@ public void testBug485092() throws CoreException, IOException, InterruptedExcept
project18 = createJavaProject("Reconciler18", new String[] {"src"}, new String[] {"JCL15_LIB"}, "bin");
createFolder("/Reconciler18/src/p2");
- String otherSource =
+ String otherSource =
"package p2;\n" +
"import org.eclipse.jdt.annotation.NonNull;\n" +
"import org.eclipse.jdt.annotation.Nullable;\n" +
@@ -5910,7 +5910,7 @@ public void testBug485092() throws CoreException, IOException, InterruptedExcept
File bundleFile = FileLocator.getBundleFile(bundles[0]);
String annotationsLib = bundleFile.isDirectory() ? bundleFile.getPath()+"/bin" : bundleFile.getPath();
IClasspathEntry nullAnnotationsClassPathEntry = JavaCore.newLibraryEntry(new Path(annotationsLib), null, null);
-
+
IClasspathEntry[] oldClasspath = project18.getRawClasspath();
int oldLength = oldClasspath.length;
IClasspathEntry[] newClasspath = new IClasspathEntry[oldLength+2];
@@ -5918,18 +5918,18 @@ public void testBug485092() throws CoreException, IOException, InterruptedExcept
newClasspath[oldLength] = JavaCore.newProjectEntry(new Path("/Reconciler1518"));
newClasspath[oldLength + 1] = nullAnnotationsClassPathEntry;
project18.setRawClasspath(newClasspath, null);
-
+
this.workingCopies = new ICompilationUnit[1];
char[] sourceChars = otherSource.toCharArray();
this.problemRequestor.initialize(sourceChars);
this.workingCopies[0] = getCompilationUnit("/Reconciler18/src/p2/PivotEnvironmentFactory.java").getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. WARNING in /Reconciler18/src/p2/PivotEnvironmentFactory.java (at line 5)\n" +
- " import p1.PreferenceableOption;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The import p1.PreferenceableOption is never used\n" +
+ "----------\n" +
+ "1. WARNING in /Reconciler18/src/p2/PivotEnvironmentFactory.java (at line 5)\n" +
+ " import p1.PreferenceableOption;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The import p1.PreferenceableOption is never used\n" +
"----------\n"
);
} finally {
@@ -5949,32 +5949,32 @@ public void testBug534865() throws CoreException, IOException {
createFile(
"/Reconciler18/src/org/eclipse/jdt/annotation/Nullable.java",
"package org.eclipse.jdt.annotation;\n" +
- "import static java.lang.annotation.ElementType.TYPE_USE;\n" +
- "\n" +
- "import java.lang.annotation.Documented;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import java.lang.annotation.RetentionPolicy;\n" +
+ "import static java.lang.annotation.ElementType.TYPE_USE;\n" +
+ "\n" +
+ "import java.lang.annotation.Documented;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import java.lang.annotation.RetentionPolicy;\n" +
"import java.lang.annotation.Target;\n" +
- "@Documented\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@Target({ TYPE_USE })\n" +
- "public @interface Nullable {\n" +
- " // marker annotation with no members\n" +
+ "@Documented\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Target({ TYPE_USE })\n" +
+ "public @interface Nullable {\n" +
+ " // marker annotation with no members\n" +
"}\n"
);
- String source =
+ String source =
"package org.eclipse.jdt.annotation;\n" +
- "import static java.lang.annotation.ElementType.TYPE_USE;\n" +
- "\n" +
- "import java.lang.annotation.Documented;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import java.lang.annotation.RetentionPolicy;\n" +
+ "import static java.lang.annotation.ElementType.TYPE_USE;\n" +
+ "\n" +
+ "import java.lang.annotation.Documented;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import java.lang.annotation.RetentionPolicy;\n" +
"import java.lang.annotation.Target;\n" +
- "@Documented\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@Target({ TYPE_USE })\n" +
- "public @interface NonNull {\n" +
- " // marker annotation with no members\n" +
+ "@Documented\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Target({ TYPE_USE })\n" +
+ "public @interface NonNull {\n" +
+ " // marker annotation with no members\n" +
"}\n";
createFile(
@@ -5986,7 +5986,7 @@ public void testBug534865() throws CoreException, IOException {
this.workingCopies[0] = getCompilationUnit("/Reconciler18/src/org/eclipse/jdt/annotation/NonNull.java").getWorkingCopy(this.wcOwner, null);
assertProblems(
"Unexpected problems",
- "----------\n" +
+ "----------\n" +
"----------\n"
);
} finally {
@@ -6004,40 +6004,40 @@ public void testBug559774() throws CoreException, IOException, InterruptedExcept
project14.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_14);
project14.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
project14.setOption(JavaCore.COMPILER_PB_REPORT_PREVIEW_FEATURES, JavaCore.IGNORE);
-
+
String[] sources = new String[2];
char[][] sourceAsArray = new char[2][];
createFolder("/Reconciler14/src/p");
createFolder("/Reconciler14/src/q");
- sources[0] = "package p;\n" +
- "public record X(int a, int b) {\n" +
- " public X {\n" +
- " this.a = a * 2;\n" +
- " }\n" +
- " public void foo() {}\n" +
- "}\n" +
- "class Z {\n" +
- " public void bar() {\n" +
- " X x = new X(0,1);\n" +
- " int l = x.a(); // works fine in the same file\n" +
- " System.out.println(l);\n" +
- " }\n" +
+ sources[0] = "package p;\n" +
+ "public record X(int a, int b) {\n" +
+ " public X {\n" +
+ " this.a = a * 2;\n" +
+ " }\n" +
+ " public void foo() {}\n" +
+ "}\n" +
+ "class Z {\n" +
+ " public void bar() {\n" +
+ " X x = new X(0,1);\n" +
+ " int l = x.a(); // works fine in the same file\n" +
+ " System.out.println(l);\n" +
+ " }\n" +
"}";
createFile(
"/Reconciler14/src/p/X.java",
sources[0]
);
sourceAsArray[0] = sources[0].toCharArray();
- sources[1] =
- "package q;\n" +
- "import p.X;\n" +
- "public class Y {\n" +
- " public X myField; \n" +
- " public static void main(String[] args) {\n" +
- " X x = new X(0, 1);\n" +
+ sources[1] =
+ "package q;\n" +
+ "import p.X;\n" +
+ "public class Y {\n" +
+ " public X myField; \n" +
+ " public static void main(String[] args) {\n" +
+ " X x = new X(0, 1);\n" +
" int l = x.a(); //Incorrect Error: The method a() is undefined for the type X\n" +
- " System.out.println(l);\n" +
- " }\n" +
+ " System.out.println(l);\n" +
+ " }\n" +
"} ";
createFile(
@@ -6056,7 +6056,7 @@ public void testBug559774() throws CoreException, IOException, InterruptedExcept
this.problemRequestor.initialize(sourceAsArray[1]);
this.workingCopies[1] = getCompilationUnit("/Reconciler14/src/q/Y.java").getWorkingCopy(this.wcOwner, null);
assertNoProblem(sourceAsArray[1], this.workingCopies[1]);
-
+
} finally {
if (project14 != null)
deleteProject(project14);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests9.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests9.java
index 5b69d960d..d2ccf0604 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests9.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests9.java
@@ -42,7 +42,7 @@ public class ReconcilerTests9 extends ModifyingResourceTests {
protected ICompilationUnit workingCopy;
protected ProblemRequestor problemRequestor;
-
+
/*package*/ static final int JLS_LATEST = AST.JLS13;
/**
@@ -287,11 +287,11 @@ public void testTerminalDeprecation1() throws CoreException {
try {
createJava9Project("P1");
createFolder("/P1/src/p");
- createFile("/P1/src/p/X1.java",
+ createFile("/P1/src/p/X1.java",
"package p;\n" +
"@Deprecated(forRemoval=true)\n" +
"public class X1 {}");
- createFile("/P1/src/p/X2.java",
+ createFile("/P1/src/p/X2.java",
"package p;\n" +
"public class X2 {\n" +
" @Deprecated(forRemoval=true)\n" +
@@ -309,21 +309,21 @@ public void testTerminalDeprecation1() throws CoreException {
"}\n");
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. WARNING in /P1/src/Y.java (at line 1)\n" +
- " public class Y extends p.X1 {\n" +
- " ^^\n" +
- "The type X1 has been deprecated and marked for removal\n" +
- "----------\n" +
- "2. WARNING in /P1/src/Y.java (at line 3)\n" +
- " x2.m();\n" +
- " ^^^\n" +
- "The method m() from the type X2 has been deprecated and marked for removal\n" +
- "----------\n" +
- "3. WARNING in /P1/src/Y.java (at line 4)\n" +
- " return x2.field;\n" +
- " ^^^^^\n" +
- "The field X2.field has been deprecated and marked for removal\n" +
+ "----------\n" +
+ "1. WARNING in /P1/src/Y.java (at line 1)\n" +
+ " public class Y extends p.X1 {\n" +
+ " ^^\n" +
+ "The type X1 has been deprecated and marked for removal\n" +
+ "----------\n" +
+ "2. WARNING in /P1/src/Y.java (at line 3)\n" +
+ " x2.m();\n" +
+ " ^^^\n" +
+ "The method m() from the type X2 has been deprecated and marked for removal\n" +
+ "----------\n" +
+ "3. WARNING in /P1/src/Y.java (at line 4)\n" +
+ " return x2.field;\n" +
+ " ^^^^^\n" +
+ "The field X2.field has been deprecated and marked for removal\n" +
"----------\n"
);
} finally {
@@ -378,26 +378,26 @@ public void testTerminalDeprecation2() throws CoreException, IOException {
"}\n");
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. WARNING in /P1/src/Y.java (at line 1)\n" +
- " public class Y extends p.X1 {\n" +
- " ^^\n" +
+ "----------\n" +
+ "1. WARNING in /P1/src/Y.java (at line 1)\n" +
+ " public class Y extends p.X1 {\n" +
+ " ^^\n" +
deprecatedForRemoval("The type X1") +
- "----------\n" +
- "2. WARNING in /P1/src/Y.java (at line 3)\n" +
- " x2.m();\n" +
- " ^^^\n" +
- deprecatedForRemoval("The method m() from the type X2") +
- "----------\n" +
- "3. WARNING in /P1/src/Y.java (at line 4)\n" +
- " x2.m2();\n" +
- " ^^^^\n" +
- "The method m2() from the type X2 is deprecated\n" +
- "----------\n" +
- "4. WARNING in /P1/src/Y.java (at line 5)\n" +
- " return x2.field;\n" +
- " ^^^^^\n" +
- deprecatedForRemoval("The field X2.field") +
+ "----------\n" +
+ "2. WARNING in /P1/src/Y.java (at line 3)\n" +
+ " x2.m();\n" +
+ " ^^^\n" +
+ deprecatedForRemoval("The method m() from the type X2") +
+ "----------\n" +
+ "3. WARNING in /P1/src/Y.java (at line 4)\n" +
+ " x2.m2();\n" +
+ " ^^^^\n" +
+ "The method m2() from the type X2 is deprecated\n" +
+ "----------\n" +
+ "4. WARNING in /P1/src/Y.java (at line 5)\n" +
+ " return x2.field;\n" +
+ " ^^^^^\n" +
+ deprecatedForRemoval("The field X2.field") +
"----------\n");
} finally {
deleteProject("P1");
@@ -419,12 +419,12 @@ public void testBug540541() throws CoreException, IOException {
"package java.lang;\n" +
"public class Object {\n" +
"}\n");
-
+
project1.setRawClasspath(new IClasspathEntry[] {JavaCore.newSourceEntry(new Path("/java.base/src"))}, null);
project1.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
IMarker[] markers = project1.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
assertMarkers("Unexpected markers on java.base", "", markers);
-
+
project2 = createJava9Project("client", "9");
IClasspathAttribute[] attributes = new IClasspathAttribute[] { JavaCore.newClasspathAttribute("module", "true") };
IClasspathEntry projectEntry = JavaCore.newProjectEntry(project1.getPath(), null, false, attributes, false);
@@ -438,10 +438,10 @@ public void testBug540541() throws CoreException, IOException {
this.problemRequestor.initialize(this.workingCopy.getSource().toCharArray());
this.workingCopy.reconcile(JLS_LATEST, true, this.wcOwner, null);
assertProblems("Expecting no problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
-
+
markers = project2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
assertMarkers("Unexpected markers on client", "", markers);
} finally {
@@ -503,7 +503,7 @@ public void testBug543092() throws Exception {
this.problemRequestor.initialize(this.workingCopy.getSource().toCharArray());
this.workingCopy.reconcile(JLS_LATEST, true, this.wcOwner, null);
assertProblems("Expecting no problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
@@ -562,11 +562,11 @@ public void testBug543092b() throws Exception {
this.problemRequestor.initialize(this.workingCopy.getSource().toCharArray());
this.workingCopy.reconcile(JLS_LATEST, true, this.wcOwner, null);
assertProblems("Expecting no problems",
- "----------\n" +
- "1. ERROR in /p/src/test/Test.java (at line 3)\n" +
- " lib.lab.Lib lob;\n" +
- " ^^^^^^^\n" +
- "The package lib.lab is accessible from more than one module: <unnamed>, lib\n" +
+ "----------\n" +
+ "1. ERROR in /p/src/test/Test.java (at line 3)\n" +
+ " lib.lab.Lib lob;\n" +
+ " ^^^^^^^\n" +
+ "The package lib.lab is accessible from more than one module: <unnamed>, lib\n" +
"----------\n",
this.problemRequestor);
} finally {
@@ -584,51 +584,51 @@ public void testBug544017() throws CoreException {
try {
createFolder("testb/src/com/example/sub/b");
createFile("testb/src/com/example/sub/b/B.java",
- "package com.example.sub.b;\n" +
- "public class B {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"B\");\n" +
- " }\n" +
+ "package com.example.sub.b;\n" +
+ "public class B {\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(\"B\");\n" +
+ " }\n" +
"}\n");
createFile("testb/src/module-info.java",
- "open module com.example.sub.b {\n" +
- " exports com.example.sub.b;\n" +
+ "open module com.example.sub.b {\n" +
+ " exports com.example.sub.b;\n" +
"}\n");
addModularProjectEntry(testa, testb);
createFolder("testa/src/com/example/sub/a");
createFile("testa/src/com/example/sub/a/A.java",
- "package com.example.sub.a;\n" +
- "public class A {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"A\");\n" +
- " }\n" +
+ "package com.example.sub.a;\n" +
+ "public class A {\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(\"A\");\n" +
+ " }\n" +
"}\n");
createFile("testa/src/module-info.java",
- "open module com.example.sub.a {\n" +
- " exports com.example.sub.a;\n" +
- " requires com.example.sub.b;\n" +
+ "open module com.example.sub.a {\n" +
+ " exports com.example.sub.a;\n" +
+ " requires com.example.sub.b;\n" +
"}\n");
addModularProjectEntry(testmain, testa);
addModularProjectEntry(testmain, testb);
createFolder("testmain/src/com/example");
createFile("testmain/src/module-info.java",
- "open module com.example {\n" +
- " requires com.example.sub.a;\n" +
- " requires com.example.sub.b;\n" +
+ "open module com.example {\n" +
+ " requires com.example.sub.a;\n" +
+ " requires com.example.sub.b;\n" +
"}\n");
String pathExample = "testmain/src/com/example/Example.java";
String sourceExample =
- "package com.example;\n" +
- "import com.example.sub.a.A;\n" +
- "import com.example.sub.b.B;\n" +
- "\n" +
- "public class Example {\n" +
- " public static void main(String[] args) {\n" +
- " A.main(null);\n" +
- " B.main(null);\n" +
- " }\n" +
+ "package com.example;\n" +
+ "import com.example.sub.a.A;\n" +
+ "import com.example.sub.b.B;\n" +
+ "\n" +
+ "public class Example {\n" +
+ " public static void main(String[] args) {\n" +
+ " A.main(null);\n" +
+ " B.main(null);\n" +
+ " }\n" +
"}\n";
createFile(pathExample, sourceExample);
@@ -643,7 +643,7 @@ public void testBug544017() throws CoreException {
this.problemRequestor.initialize((sourceExample+" ").toCharArray());
wc.reconcile(JLS_LATEST, true, this.wcOwner, null);
assertProblems("Expecting no problems",
- "----------\n" +
+ "----------\n" +
"----------\n",
this.problemRequestor);
} finally {
@@ -741,42 +741,42 @@ public void testBug546315() throws Exception {
addModularLibraryEntry(p, new Path(getExternalResourcePath(fooBarPath)), null);
addLibraryEntry(p, new Path(getExternalResourcePath(fooPath)), null, null, null, null, testAttrs, false);
addLibraryEntry(p, new Path(getExternalResourcePath(fooBar2Path)), null, null, null, null, testAttrs, false);
-
+
createFolder("p/src/main");
createFile("p/src/main/Main.java",
- "package main;\n" +
- "\n" +
- "import foo.bar.FooBar;\n" +
- "\n" +
- "public class Main {\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(FooBar.get());\n" +
- " }\n" +
- "\n" +
+ "package main;\n" +
+ "\n" +
+ "import foo.bar.FooBar;\n" +
+ "\n" +
+ "public class Main {\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(FooBar.get());\n" +
+ " }\n" +
+ "\n" +
"}\n");
createFile("p/src/module-info.java",
- "module com.example.main {\n" +
- " requires foo.bar;\n" +
+ "module com.example.main {\n" +
+ " requires foo.bar;\n" +
"}\n");
String testSource =
- "package test;\n" +
- "\n" +
- "// errors shown in Java editor (but not in Problems view)\n" +
- "// can be run without dialog \"error exists...\"\n" +
- "\n" +
- "import foo.bar.FooBar;\n" +
- "import foo.bar2.FooBar2;\n" +
- "import foo.Foo; // <- The package foo is accessible from more than one module: <unnamed>, foo.bar\n" +
- "\n" +
- "public class Test {\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(Foo.get()); // <- Foo cannot be resolved\n" +
- " System.out.println(FooBar.get());\n" +
- " System.out.println(FooBar2.get());\n" +
- " }\n" +
- "\n" +
+ "package test;\n" +
+ "\n" +
+ "// errors shown in Java editor (but not in Problems view)\n" +
+ "// can be run without dialog \"error exists...\"\n" +
+ "\n" +
+ "import foo.bar.FooBar;\n" +
+ "import foo.bar2.FooBar2;\n" +
+ "import foo.Foo; // <- The package foo is accessible from more than one module: <unnamed>, foo.bar\n" +
+ "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(Foo.get()); // <- Foo cannot be resolved\n" +
+ " System.out.println(FooBar.get());\n" +
+ " System.out.println(FooBar2.get());\n" +
+ " }\n" +
+ "\n" +
"}\n";
createFolder("p/src-test/test");
String mPath = "p/src-test/test/Test.java";
@@ -813,12 +813,12 @@ public void testBug544306() throws Exception {
try {
createFolder("p1/src/p1");
createFile("p1/src/p1/P1.java",
- "package p1;\n" +
- "public class P1 {\n" +
+ "package p1;\n" +
+ "public class P1 {\n" +
"}\n");
createFile("p1/src/module-info.java",
- "module p1 {\n" +
- " exports p1;\n" +
+ "module p1 {\n" +
+ " exports p1;\n" +
"}\n");
IClasspathAttribute[] testAttrs = { JavaCore.newClasspathAttribute("test", "true") };
@@ -828,18 +828,18 @@ public void testBug544306() throws Exception {
createFolder("p2/src-test/p2");
createFile("p2/src/module-info.java",
- "module p2 {\n" +
+ "module p2 {\n" +
"}\n");
String testSource = "package p2;\n" +
"import p1.P1;\n" +
"class Test extends P1{ }";
-
+
createFile("p2/src-test/p2/Test.java", testSource);
waitForAutoBuild();
IMarker[] markers = p1.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
assertMarkers("Unexpected markers",
"", markers);
-
+
this.workingCopy.discardWorkingCopy();
this.workingCopy = getCompilationUnit("p2/src-test/p2/Test.java").getWorkingCopy(this.wcOwner, null);
this.problemRequestor.initialize(testSource.toCharArray());
@@ -861,68 +861,68 @@ public void testBug547113() throws CoreException {
try {
createFolder("a/src/com/example/a");
createFile("a/src/com/example/Base.java",
- "package com.example;\n" +
- "\n" +
+ "package com.example;\n" +
+ "\n" +
"public class Base {}\n");
createFile("a/src/com/example/a/A.java",
- "package com.example.a;\n" +
- "\n" +
+ "package com.example.a;\n" +
+ "\n" +
"public class A {}\n");
createFile("a/src/module-info.java",
- "open module com.example.a {\n" +
- " exports com.example;\n" +
- " exports com.example.a;\n" +
- " \n" +
- " requires unnamed;\n" +
+ "open module com.example.a {\n" +
+ " exports com.example;\n" +
+ " exports com.example.a;\n" +
+ " \n" +
+ " requires unnamed;\n" +
"}\n");
addModularProjectEntry(a, unnamed);
createFolder("b/src/com/example/b");
createFile("b/src/com/example/b/B.java",
- "package com.example.b;\n" +
- "\n" +
- "import com.example.Base;\n" +
- "import com.example.a.A;\n" +
- "\n" +
- "public class B {\n" +
- "\n" +
- " public void a(A a) {\n" +
- " System.out.println(a);\n" +
- " }\n" +
- "\n" +
- " public void base(Base base) {\n" +
- " System.out.println(base);\n" +
- " }\n" +
- "\n" +
+ "package com.example.b;\n" +
+ "\n" +
+ "import com.example.Base;\n" +
+ "import com.example.a.A;\n" +
+ "\n" +
+ "public class B {\n" +
+ "\n" +
+ " public void a(A a) {\n" +
+ " System.out.println(a);\n" +
+ " }\n" +
+ "\n" +
+ " public void base(Base base) {\n" +
+ " System.out.println(base);\n" +
+ " }\n" +
+ "\n" +
"}\n");
createFile("b/src/module-info.java",
- "open module com.example.b {\n" +
- " exports com.example.b;\n" +
- " requires transitive com.example.a;\n" +
+ "open module com.example.b {\n" +
+ " exports com.example.b;\n" +
+ " requires transitive com.example.a;\n" +
"}\n");
addModularProjectEntry(b, a);
addModularProjectEntry(b, unnamed);
createFolder("c/src/com/example/c");
- String cSource = "package com.example.c;\n" +
- "\n" +
- "import com.example.Base;\n" +
- "import com.example.a.A;\n" +
- "import com.example.b.B;\n" +
- "\n" +
- "public class C {\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " new B().a(new A());\n" +
- " new B().base(new Base());\n" +
- " System.out.println(\"done.\");\n" +
- " }\n" +
+ String cSource = "package com.example.c;\n" +
+ "\n" +
+ "import com.example.Base;\n" +
+ "import com.example.a.A;\n" +
+ "import com.example.b.B;\n" +
+ "\n" +
+ "public class C {\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " new B().a(new A());\n" +
+ " new B().base(new Base());\n" +
+ " System.out.println(\"done.\");\n" +
+ " }\n" +
"}\n";
createFile("c/src/com/example/c/C.java", cSource);
createFile("c/src/module-info.java",
- "open module com.example.c {\n" +
- " exports com.example.c;\n" +
- " requires com.example.b;\n" +
+ "open module com.example.c {\n" +
+ " exports com.example.c;\n" +
+ " requires com.example.b;\n" +
"}\n");
addModularProjectEntry(c, a);
addModularProjectEntry(c, b);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/RenameTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/RenameTests.java
index 7b2d7f9fe..4ca12f784 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/RenameTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/RenameTests.java
@@ -368,11 +368,11 @@ public void testRenameCU2() throws CoreException {
assertDeltas(
"Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src[*]: {CHILDREN}\n" +
- " <default>[*]: {CHILDREN}\n" +
- " X.java[-]: {MOVED_TO(Y.java [in <default> [in src [in P]]])}\n" +
- " Y.java[*]: {CHILDREN | CONTENT | FINE GRAINED | PRIMARY RESOURCE}\n" +
+ "P[*]: {CHILDREN}\n" +
+ " src[*]: {CHILDREN}\n" +
+ " <default>[*]: {CHILDREN}\n" +
+ " X.java[-]: {MOVED_TO(Y.java [in <default> [in src [in P]]])}\n" +
+ " Y.java[*]: {CHILDREN | CONTENT | FINE GRAINED | PRIMARY RESOURCE}\n" +
" Y[+]: {MOVED_FROM(X [in X.java [in <default> [in src [in P]]]])}"
);
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests.java
index 9d8b67275..4bfa79306 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests.java
@@ -452,7 +452,7 @@ public void testEmptyCU1() throws JavaModelException {
"Unknown\n" +
"\n"
);
-
+
IJavaElement[] elements = codeSelect(this.workingCopies[0], "Unknown", "Unknown");
assertElementsEqual(
"Unexpected elements",
@@ -2646,7 +2646,7 @@ public void testCodeSelectInHybrid1415Projects() throws CoreException, IOExcepti
this.workingCopies[0] = getWorkingCopy(
"/Resolve/src/Test.java",
"public class TextEditTests extends TestCase {\n" +
- " {\n" +
+ " {\n" +
" new TestSuite(TextEditTests.class);\n" +
" }\n" +
"}\n");
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests10.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests10.java
index 85b76d0b2..8c5adae1b 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests10.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests10.java
@@ -46,9 +46,9 @@ public class ResolveTests10 extends AbstractJavaModelTests {
}
public void setUpSuite() throws Exception {
super.setUpSuite();
-
+
IJavaProject project = setUpJavaProject("Resolve", "10", true);
-
+
String bootModPath = System.getProperty("java.home") + File.separator +"jrt-fs.jar";
IClasspathEntry jrtEntry = JavaCore.newLibraryEntry(new Path(bootModPath), null, null, null, null, false);
IClasspathEntry[] old = project.getRawClasspath();
@@ -56,20 +56,20 @@ public class ResolveTests10 extends AbstractJavaModelTests {
System.arraycopy(old, 0, newPath, 0, old.length);
newPath[old.length] = jrtEntry;
project.setRawClasspath(newPath, null);
-
+
waitUntilIndexesReady();
}
-
+
protected void setUp() throws Exception {
super.setUp();
this.wcOwner = new WorkingCopyOwner(){};
}
public void tearDownSuite() throws Exception {
deleteProject("Resolve");
-
+
super.tearDownSuite();
}
-
+
protected void tearDown() throws Exception {
if (this.wc != null) {
this.wc.discardWorkingCopy();
@@ -83,37 +83,37 @@ public class ResolveTests10 extends AbstractJavaModelTests {
"\n" +
"abstract class AbstractSet<S> {}\n" +
"\n" +
- "class TreeSet<E> extends AbstractSet<E>\n" +
- " implements Cloneable, java.io.Serializable\n" +
+ "class TreeSet<E> extends AbstractSet<E>\n" +
+ " implements Cloneable, java.io.Serializable\n" +
"{}\n" +
"\n" +
- "class HashSet<E>\n" +
- " extends AbstractSet<E>\n" +
- " implements Cloneable, java.io.Serializable\n" +
- "{}\n" +
- "\n" +
- "public class Hey {\n" +
- " public static void main(String[] args) {\n" +
- " var x = args.length > 0 ? new TreeSet<>() : new HashSet<>();\n" +
- " x.add(1);\n" +
- " }\n" +
+ "class HashSet<E>\n" +
+ " extends AbstractSet<E>\n" +
+ " implements Cloneable, java.io.Serializable\n" +
+ "{}\n" +
+ "\n" +
+ "public class Hey {\n" +
+ " public static void main(String[] args) {\n" +
+ " var x = args.length > 0 ? new TreeSet<>() : new HashSet<>();\n" +
+ " x.add(1);\n" +
+ " }\n" +
"}\n");
-
+
String str = this.wc.getSource();
String selection = "x";
int start = str.lastIndexOf(selection);
int length = selection.length();
-
+
IJavaElement[] elements = this.wc.codeSelect(start, length);
assertElementsEqual(
"Unexpected elements",
"x [in main(String[]) [in Hey [in [Working copy] Hey.java [in <default> [in src [in Resolve]]]]]]",
elements
);
-
+
String typeSignature = ((LocalVariable)elements[0]).getTypeSignature();
assertEquals("type signature", "&LAbstractSet<Ljava.lang.Object;>;:LCloneable;:Ljava.io.Serializable;", typeSignature);
-
+
assertStringsEqual(
"Unexpected intersection type bounds",
"LAbstractSet<Ljava.lang.Object;>;\n" +
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests12.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests12.java
index 6caa19084..8d98bfcc0 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests12.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests12.java
@@ -369,7 +369,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" +
"}\n");
@@ -392,7 +392,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" +
"}\n");
@@ -415,7 +415,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" +
"}\n");
@@ -434,13 +434,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 {
- this.wc = getWorkingCopy("/Resolve/src/X.java","public class X {\n" +
- " public void bar(int s) {\n" +
- " int i_j = switch (s) {\n" +
+ this.wc = getWorkingCopy("/Resolve/src/X.java","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 str = this.wc.getSource();
String selection = "i_j";
@@ -454,13 +454,13 @@ public void test016() throws JavaModelException {
);
}
public void test017() throws JavaModelException {
- this.wc = getWorkingCopy("/Resolve/src/X.java","public class X {\n" +
- " public void bar(int s) {\n" +
- " int i_j = switch (s) {\n" +
+ this.wc = getWorkingCopy("/Resolve/src/X.java","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 str = this.wc.getSource();
String selection = "i_j";
@@ -476,18 +476,18 @@ public void test017() throws JavaModelException {
public void test018() throws JavaModelException {
this.wc = getWorkingCopy("/Resolve/src/X.java",
"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" +
+ "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" +
"}\n");
String str = this.wc.getSource();
String selection = "n_1";
@@ -502,19 +502,19 @@ public void test018() throws JavaModelException {
}
public void test019() throws JavaModelException {
this.wc = getWorkingCopy("/Resolve/src/X.java",
- "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" +
+ "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" +
"}\n");
String str = this.wc.getSource();
String selection = "n_1";
@@ -529,18 +529,18 @@ public void test019() throws JavaModelException {
}
public void test020() throws JavaModelException {
this.wc = getWorkingCopy("/Resolve/src/X.java",
- "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" +
+ "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" +
"}\n");
String str = this.wc.getSource();
String selection = "n_2";
@@ -555,18 +555,18 @@ public void test020() throws JavaModelException {
}
public void test021() throws JavaModelException {
this.wc = getWorkingCopy("/Resolve/src/X.java",
- "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" +
+ "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" +
"}\n");
String str = this.wc.getSource();
String selection = "n_1";
@@ -581,18 +581,18 @@ public void test021() throws JavaModelException {
}
public void test022() throws JavaModelException {
this.wc = getWorkingCopy("/Resolve/src/X.java",
- "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" +
+ "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" +
"}\n");
String str = this.wc.getSource();
String selection = "ijk";
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests18.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests18.java
index 5a2f62330..a7d40847e 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests18.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests18.java
@@ -1018,8 +1018,8 @@ public void testBug408230a() throws CoreException {
source
);
waitForAutoBuild();
-
- ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
+
+ ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
String selectString = "barg";
IJavaElement [] variable = ((ICodeAssist) unit).codeSelect(source.lastIndexOf(selectString), selectString.length());
assertEquals(1, variable.length);
@@ -1043,8 +1043,8 @@ public void testBug408230b() throws CoreException {
source
);
waitForAutoBuild();
-
- ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
+
+ ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
String selectString = "barg";
IJavaElement [] variable = ((ICodeAssist) unit).codeSelect(source.lastIndexOf(selectString), selectString.length());
assertEquals(1, variable.length);
@@ -1068,8 +1068,8 @@ public void testBug408230c() throws CoreException {
source
);
waitForAutoBuild();
-
- ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
+
+ ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
String selectString = "barg";
IJavaElement [] variable = ((ICodeAssist) unit).codeSelect(source.lastIndexOf(selectString), selectString.length());
assertEquals(1, variable.length);
@@ -1091,8 +1091,8 @@ public void testBug408230d() throws CoreException {
source
);
waitForAutoBuild();
-
- ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
+
+ ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
String selectString = "barg";
IJavaElement [] variable = ((ICodeAssist) unit).codeSelect(source.lastIndexOf(selectString), selectString.length());
assertEquals(1, variable.length);
@@ -1114,8 +1114,8 @@ public void testBug408230e() throws CoreException {
source
);
waitForAutoBuild();
-
- ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
+
+ ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
String selectString = "aarg";
IJavaElement [] variable = ((ICodeAssist) unit).codeSelect(source.lastIndexOf(selectString), selectString.length());
assertEquals(1, variable.length);
@@ -1137,8 +1137,8 @@ public void testBug408230f() throws CoreException {
source
);
waitForAutoBuild();
-
- ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
+
+ ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
String selectString = "aarg";
IJavaElement [] variable = ((ICodeAssist) unit).codeSelect(source.lastIndexOf(selectString), selectString.length());
assertEquals(1, variable.length);
@@ -1163,8 +1163,8 @@ public void testBug408230g() throws CoreException {
source
);
waitForAutoBuild();
-
- ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
+
+ ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
String selectString = "aarg";
IJavaElement [] variable = ((ICodeAssist) unit).codeSelect(source.lastIndexOf(selectString), selectString.length());
assertEquals(1, variable.length);
@@ -1189,8 +1189,8 @@ public void testBug408230h() throws CoreException {
source
);
waitForAutoBuild();
-
- ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
+
+ ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
String selectString = "aarg";
IJavaElement [] variable = ((ICodeAssist) unit).codeSelect(source.lastIndexOf(selectString), selectString.length());
assertEquals(1, variable.length);
@@ -1215,8 +1215,8 @@ public void testBug408230i() throws CoreException {
source
);
waitForAutoBuild();
-
- ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
+
+ ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
String selectString = "aarg";
IJavaElement [] variable = ((ICodeAssist) unit).codeSelect(source.lastIndexOf(selectString), selectString.length());
assertEquals(1, variable.length);
@@ -1241,8 +1241,8 @@ public void testBug408230j() throws CoreException {
source
);
waitForAutoBuild();
-
- ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
+
+ ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
String selectString = "aarg";
IJavaElement [] variable = ((ICodeAssist) unit).codeSelect(source.lastIndexOf(selectString), selectString.length());
assertEquals(1, variable.length);
@@ -1267,8 +1267,8 @@ public void testBug408230k() throws CoreException {
source
);
waitForAutoBuild();
-
- ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
+
+ ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
String selectString = "aarg";
IJavaElement [] variable = ((ICodeAssist) unit).codeSelect(source.lastIndexOf(selectString), selectString.length());
assertEquals(1, variable.length);
@@ -1293,8 +1293,8 @@ public void testBug408230l() throws CoreException {
source
);
waitForAutoBuild();
-
- ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
+
+ ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
String selectString = "aarg";
IJavaElement [] variable = ((ICodeAssist) unit).codeSelect(source.lastIndexOf(selectString), selectString.length());
assertEquals(1, variable.length);
@@ -1319,8 +1319,8 @@ public void testBug408230m() throws CoreException {
source
);
waitForAutoBuild();
-
- ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
+
+ ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
String selectString = "aarg";
IJavaElement [] variable = ((ICodeAssist) unit).codeSelect(source.lastIndexOf(selectString), selectString.length());
assertEquals(1, variable.length);
@@ -1345,8 +1345,8 @@ public void testBug408230n() throws CoreException {
source
);
waitForAutoBuild();
-
- ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
+
+ ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
String selectString = "aarg";
IJavaElement [] variable = ((ICodeAssist) unit).codeSelect(source.lastIndexOf(selectString), selectString.length());
assertEquals(1, variable.length);
@@ -2300,7 +2300,7 @@ public void test425064a() throws JavaModelException {
elements, true
);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=429845, [1.8] CCE on hover
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=429845, [1.8] CCE on hover
public void test429845() throws JavaModelException {
this.wc = getWorkingCopy(
"/Resolve/src/X.java",
@@ -2386,7 +2386,7 @@ public void test429934() throws CoreException {
" } \n" +
"}\n"
);
-
+
String str = this.workingCopies[0].getSource();
String selection = "s";
int start = str.lastIndexOf(selection);
@@ -2397,7 +2397,7 @@ public void test429934() throws CoreException {
"Unexpected elements",
"s [in main(String[]) [in X [in [Working copy] X.java [in <default> [in src [in Resolve]]]]]]",
elements, true
- );
+ );
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=429812, [1.8][model] Signatures returned by lambda IMethod APIs should be dot-based
@@ -2414,12 +2414,12 @@ public void test429812() throws CoreException {
" } \n" +
"}\n"
);
-
+
String str = this.workingCopies[0].getSource();
String selection = "x";
int start = str.lastIndexOf(selection);
int length = selection.length();
-
+
IJavaElement[] elements = this.workingCopies[0].codeSelect(start, length);
assertElementsEqual(
"Unexpected elements",
@@ -2444,45 +2444,45 @@ public void test430136() throws CoreException {
" } \n" +
"}\n"
);
-
+
String str = this.workingCopies[0].getSource();
-
+
String selection = "x,";
int start = str.indexOf(selection);
IJavaElement[] elements = this.workingCopies[0].codeSelect(start, 1);
IMethod lambda = (IMethod) elements[0].getParent();
String memento = lambda.getHandleIdentifier();
- assertEquals("Incorrect memento string",
- "=Resolve/src<{X.java[X~foo~QList\\<QU;>;=)=\"LGetter\\<TU;>;!144!161!152=&get!2=\"Ljava.util.List\\<TU;>;=\"x=\"I=\"i=\"TU;=\"LX\\~Getter\\<LX;:TU;>;.get\\(Ljava\\/util\\/List\\<TU;>;I)TU;@x!145!145!145!145!Ljava\\/util\\/List;!0!true@i!148!148!148!148!I!0!true=&",
+ assertEquals("Incorrect memento string",
+ "=Resolve/src<{X.java[X~foo~QList\\<QU;>;=)=\"LGetter\\<TU;>;!144!161!152=&get!2=\"Ljava.util.List\\<TU;>;=\"x=\"I=\"i=\"TU;=\"LX\\~Getter\\<LX;:TU;>;.get\\(Ljava\\/util\\/List\\<TU;>;I)TU;@x!145!145!145!145!Ljava\\/util\\/List;!0!true@i!148!148!148!148!I!0!true=&",
memento);
IJavaElement result = JavaCore.create(memento);
assertEquals("Java elements should be equal", lambda, result);
LambdaExpression expression = (LambdaExpression) lambda.getParent();
memento = expression.getHandleIdentifier();
- assertEquals("Incorrect memento string",
- "=Resolve/src<{X.java[X~foo~QList\\<QU;>;=)=\"LGetter\\<TU;>;!144!161!152=&get!2=\"Ljava.util.List\\<TU;>;=\"x=\"I=\"i=\"TU;=\"LX\\~Getter\\<LX;:TU;>;.get\\(Ljava\\/util\\/List\\<TU;>;I)TU;@x!145!145!145!145!Ljava\\/util\\/List;!0!true@i!148!148!148!148!I!0!true=)",
+ assertEquals("Incorrect memento string",
+ "=Resolve/src<{X.java[X~foo~QList\\<QU;>;=)=\"LGetter\\<TU;>;!144!161!152=&get!2=\"Ljava.util.List\\<TU;>;=\"x=\"I=\"i=\"TU;=\"LX\\~Getter\\<LX;:TU;>;.get\\(Ljava\\/util\\/List\\<TU;>;I)TU;@x!145!145!145!145!Ljava\\/util\\/List;!0!true@i!148!148!148!148!I!0!true=)",
memento);
result = JavaCore.create(memento);
assertEquals("Java elements should be equal", expression, result);
-
+
start = str.lastIndexOf(selection);
elements = this.workingCopies[0].codeSelect(start, 1);
lambda = (IMethod) elements[0].getParent();
memento = lambda.getHandleIdentifier();
- assertEquals("Incorrect memento string",
- "=Resolve/src<{X.java[X~foo~QList\\<QU;>;=)=\"LGetter\\<TU;>;!180!197!188=&get!2=\"Ljava.util.List\\<TU;>;=\"x=\"I=\"i=\"TU;=\"LX\\~Getter\\<LX;:TU;>;.get\\(Ljava\\/util\\/List\\<TU;>;I)TU;@x!181!181!181!181!Ljava\\/util\\/List;!0!true@i!184!184!184!184!I!0!true=&",
+ assertEquals("Incorrect memento string",
+ "=Resolve/src<{X.java[X~foo~QList\\<QU;>;=)=\"LGetter\\<TU;>;!180!197!188=&get!2=\"Ljava.util.List\\<TU;>;=\"x=\"I=\"i=\"TU;=\"LX\\~Getter\\<LX;:TU;>;.get\\(Ljava\\/util\\/List\\<TU;>;I)TU;@x!181!181!181!181!Ljava\\/util\\/List;!0!true@i!184!184!184!184!I!0!true=&",
memento);
result = JavaCore.create(memento);
assertEquals("Java elements should be equal", lambda, result);
expression = (LambdaExpression) lambda.getParent();
memento = expression.getHandleIdentifier();
- assertEquals("Incorrect memento string",
- "=Resolve/src<{X.java[X~foo~QList\\<QU;>;=)=\"LGetter\\<TU;>;!180!197!188=&get!2=\"Ljava.util.List\\<TU;>;=\"x=\"I=\"i=\"TU;=\"LX\\~Getter\\<LX;:TU;>;.get\\(Ljava\\/util\\/List\\<TU;>;I)TU;@x!181!181!181!181!Ljava\\/util\\/List;!0!true@i!184!184!184!184!I!0!true=)",
+ assertEquals("Incorrect memento string",
+ "=Resolve/src<{X.java[X~foo~QList\\<QU;>;=)=\"LGetter\\<TU;>;!180!197!188=&get!2=\"Ljava.util.List\\<TU;>;=\"x=\"I=\"i=\"TU;=\"LX\\~Getter\\<LX;:TU;>;.get\\(Ljava\\/util\\/List\\<TU;>;I)TU;@x!181!181!181!181!Ljava\\/util\\/List;!0!true@i!184!184!184!184!I!0!true=)",
memento);
result = JavaCore.create(memento);
assertEquals("Java elements should be equal", expression, result);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430307, [1.8][model] NPE trying to get children of a LambdaExpression restored from handleIdentifier
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430307, [1.8][model] NPE trying to get children of a LambdaExpression restored from handleIdentifier
public void test430307() throws CoreException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy("/Resolve/src/X.java",
@@ -2496,16 +2496,16 @@ public void test430307() throws CoreException {
" } \n" +
"}\n"
);
-
+
String str = this.workingCopies[0].getSource();
-
+
String selection = "x,";
int start = str.indexOf(selection);
IJavaElement[] elements = this.workingCopies[0].codeSelect(start, 1);
ILocalVariable local = (ILocalVariable) elements[0];
String memento = local.getHandleIdentifier();
- assertEquals("Incorrect memento string",
- "=Resolve/src<{X.java[X~foo~QList\\<QU;>;=)=\"LGetter\\<TU;>;!144!161!152=&get!2=\"Ljava.util.List\\<TU;>;=\"x=\"I=\"i=\"TU;=\"LX\\~Getter\\<LX;:TU;>;.get\\(Ljava\\/util\\/List\\<TU;>;I)TU;@x!145!145!145!145!Ljava\\/util\\/List;!0!true@i!148!148!148!148!I!0!true=&@x!145!145!145!145!Ljava.util.List\\<LU;>;!0!true",
+ assertEquals("Incorrect memento string",
+ "=Resolve/src<{X.java[X~foo~QList\\<QU;>;=)=\"LGetter\\<TU;>;!144!161!152=&get!2=\"Ljava.util.List\\<TU;>;=\"x=\"I=\"i=\"TU;=\"LX\\~Getter\\<LX;:TU;>;.get\\(Ljava\\/util\\/List\\<TU;>;I)TU;@x!145!145!145!145!Ljava\\/util\\/List;!0!true@i!148!148!148!148!I!0!true=&@x!145!145!145!145!Ljava.util.List\\<LU;>;!0!true",
memento);
IJavaElement result = JavaCore.create(memento);
assertEquals("Java elements should be equal", local, result);
@@ -2514,16 +2514,16 @@ public void test430307() throws CoreException {
IJavaElement parentExpr = parentMethod.getParent();
IMethod lambda = (IMethod) elements[0].getParent();
memento = lambda.getHandleIdentifier();
- assertEquals("Incorrect memento string",
- "=Resolve/src<{X.java[X~foo~QList\\<QU;>;=)=\"LGetter\\<TU;>;!144!161!152=&get!2=\"Ljava.util.List\\<TU;>;=\"x=\"I=\"i=\"TU;=\"LX\\~Getter\\<LX;:TU;>;.get\\(Ljava\\/util\\/List\\<TU;>;I)TU;@x!145!145!145!145!Ljava\\/util\\/List;!0!true@i!148!148!148!148!I!0!true=&",
+ assertEquals("Incorrect memento string",
+ "=Resolve/src<{X.java[X~foo~QList\\<QU;>;=)=\"LGetter\\<TU;>;!144!161!152=&get!2=\"Ljava.util.List\\<TU;>;=\"x=\"I=\"i=\"TU;=\"LX\\~Getter\\<LX;:TU;>;.get\\(Ljava\\/util\\/List\\<TU;>;I)TU;@x!145!145!145!145!Ljava\\/util\\/List;!0!true@i!148!148!148!148!I!0!true=&",
memento);
result = JavaCore.create(memento);
assertEquals("Java elements should be equal", lambda, result);
assertEquals("Java elements should be equal", result, parentMethod);
LambdaExpression expression = (LambdaExpression) lambda.getParent();
memento = expression.getHandleIdentifier();
- assertEquals("Incorrect memento string",
- "=Resolve/src<{X.java[X~foo~QList\\<QU;>;=)=\"LGetter\\<TU;>;!144!161!152=&get!2=\"Ljava.util.List\\<TU;>;=\"x=\"I=\"i=\"TU;=\"LX\\~Getter\\<LX;:TU;>;.get\\(Ljava\\/util\\/List\\<TU;>;I)TU;@x!145!145!145!145!Ljava\\/util\\/List;!0!true@i!148!148!148!148!I!0!true=)",
+ assertEquals("Incorrect memento string",
+ "=Resolve/src<{X.java[X~foo~QList\\<QU;>;=)=\"LGetter\\<TU;>;!144!161!152=&get!2=\"Ljava.util.List\\<TU;>;=\"x=\"I=\"i=\"TU;=\"LX\\~Getter\\<LX;:TU;>;.get\\(Ljava\\/util\\/List\\<TU;>;I)TU;@x!145!145!145!145!Ljava\\/util\\/List;!0!true@i!148!148!148!148!I!0!true=)",
memento);
LambdaExpression recreatedType = (LambdaExpression) JavaCore.create(memento);
assertEquals("Java elements should be equal", expression, recreatedType);
@@ -2547,7 +2547,7 @@ public void test430307a() throws JavaModelException {
" }\n" +
"}\n");
String str = this.workingCopies[0].getSource();
-
+
String selection = "abc)";
int start = str.indexOf(selection);
IJavaElement[] elements = this.workingCopies[0].codeSelect(start, 3);
@@ -2567,16 +2567,16 @@ public void test430307a() throws JavaModelException {
IJavaElement parentExpr = parentMethod.getParent();
assertEquals("Java elements should be equal", parentMethod, local.getParent());
assertEquals("Java elements should be equal", parentExpr, local.getParent().getParent());
-
+
selection = "xyz)";
start = str.lastIndexOf(selection);
elements = this.workingCopies[0].codeSelect(start, 3);
local = (ILocalVariable) elements[0];
memento = local.getHandleIdentifier();
- assertEquals("Incorrect memento string",
+ assertEquals("Incorrect memento string",
"=Resolve/src<{X.java[X~main~\\[QString;=)=\"LI;!103!169!110=&doit!1=\"LI;=\"pqr=\"LI;=\"LX\\~I;.doit\\(LI;)"
+ "LI;@pqr!104!106!104!106!LI;!0!true=&=)=\"LI;!124!164!131=&doit!1=\"LI;=\"xyz=\"LI;=\"LX\\~I;.doit\\(LI;)"
- + "LI;@xyz!125!127!125!127!LI;!0!true=&@xyz!125!127!125!127!LI;!0!true",
+ + "LI;@xyz!125!127!125!127!LI;!0!true=&@xyz!125!127!125!127!LI;!0!true",
memento);
result = JavaCore.create(memento);
assertEquals("Java elements should be equal", local, result);
@@ -2585,15 +2585,15 @@ public void test430307a() throws JavaModelException {
parentExpr = parentMethod.getParent();
assertEquals("Java elements should be equal", parentMethod, local.getParent());
assertEquals("Java elements should be equal", parentExpr, local.getParent().getParent());
-
+
selection = "pqr)";
start = str.indexOf(selection);
elements = this.workingCopies[0].codeSelect(start, 3);
local = (ILocalVariable) elements[0];
memento = local.getHandleIdentifier();
- assertEquals("Incorrect memento string",
+ assertEquals("Incorrect memento string",
"=Resolve/src<{X.java[X~main~\\[QString;=)=\"LI;!103!169!110=&doit!1=\"LI;=\"pqr=\"LI;=\"LX\\~I;.doit\\(LI;)"
- + "LI;@pqr!104!106!104!106!LI;!0!true=&@pqr!104!106!104!106!LI;!0!true",
+ + "LI;@pqr!104!106!104!106!LI;!0!true=&@pqr!104!106!104!106!LI;!0!true",
memento);
result = JavaCore.create(memento);
assertEquals("Java elements should be equal", local, result);
@@ -2845,31 +2845,31 @@ public void test430572() throws JavaModelException {
elements);
}
// nested poly invocation:
-public void testBug487791() throws JavaModelException {
+public void testBug487791() throws JavaModelException {
this.wc = getWorkingCopy(
"Resolve/src/Example.java",
- "import java.util.Comparator;\n" +
- "import java.util.stream.Collectors;\n" +
- "\n" +
- "interface Something {\n" +
- " public int getSize();\n" +
- " public Instant getTime();\n" +
+ "import java.util.Comparator;\n" +
+ "import java.util.stream.Collectors;\n" +
+ "\n" +
+ "interface Something {\n" +
+ " public int getSize();\n" +
+ " public Instant getTime();\n" +
"}\n" +
"interface Instant extends Comparable<Instant> {\n" +
- "}\n" +
- "public class Example {\n" +
- " public void test2() {\n" +
- " java.util.stream.Collector<Something,?,java.util.Map<Integer,Something>> c = \n" +
- " Collectors.collectingAndThen(\n" +
- " Collectors.<Something>toList(),\n" +
- " list -> list.stream().collect(Collectors.groupingBy(Something::getSize,\n" +
- " // Returns Collector<Something,?,Object> - INCORRECT!\n" +
+ "}\n" +
+ "public class Example {\n" +
+ " public void test2() {\n" +
+ " java.util.stream.Collector<Something,?,java.util.Map<Integer,Something>> c = \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" + // <-- select here
- " Collectors.<Something>toList(),\n" +
- " list2 -> list2.stream().sorted(Comparator.comparing(Something::getTime)).limit(1).findAny().orElse(null)\n" +
- " )\n" +
- " )));\n" +
- " }\n" +
+ " Collectors.<Something>toList(),\n" +
+ " list2 -> list2.stream().sorted(Comparator.comparing(Something::getTime)).limit(1).findAny().orElse(null)\n" +
+ " )\n" +
+ " )));\n" +
+ " }\n" +
"}\n");
this.wc.becomeWorkingCopy(null);
@@ -2892,20 +2892,20 @@ public void testBug487791() throws JavaModelException {
assertEquals("return type", "Ljava.util.stream.Collector<LSomething;!*LSomething;>;", returnType);
}
// ReferenceExpression:
-public void testBug487791b() throws JavaModelException {
+public void testBug487791b() throws JavaModelException {
this.wc = getWorkingCopy(
"Resolve/src/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" + // <- select f1 here
- " }\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");
this.wc.becomeWorkingCopy(null);
@@ -2931,22 +2931,22 @@ public void testBug487791b() throws JavaModelException {
public void testBug515758() throws JavaModelException {
this.wc = getWorkingCopy(
"Resolve/src/Snippet.java",
- "import java.util.function.Function;\n" +
- "\n" +
- "public class Snippet {\n" +
- " void m1() {\n" +
+ "import java.util.function.Function;\n" +
+ "\n" +
+ "public class Snippet {\n" +
+ " void m1() {\n" +
" MyObservable.range(1, 2).groupBy(integer -> {\n" +
" return \"even\";\n" +
" });\n" +
- " }\n" +
- "\n" +
- "}\n" +
- "class MyObservable<T> {\n" +
- " static MyObservable<Integer> range(int i1, int i2) {\n" +
- " return new MyObservable<>();\n" +
- " }\n" +
- " <K> void groupBy(Function<T, K> func) {\n" +
- " }\n" +
+ " }\n" +
+ "\n" +
+ "}\n" +
+ "class MyObservable<T> {\n" +
+ " static MyObservable<Integer> range(int i1, int i2) {\n" +
+ " return new MyObservable<>();\n" +
+ " }\n" +
+ " <K> void groupBy(Function<T, K> func) {\n" +
+ " }\n" +
"}");
String str = this.wc.getSource();
String selection = "range";
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests2.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests2.java
index 1312ab885..d881f64a4 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests2.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests2.java
@@ -206,7 +206,7 @@ public void testBug232880a() throws Exception {
String externalJar1 = outputDirectory + File.separator + "bug232880a.jar"; //$NON-NLS-1$
String externalJar2 = outputDirectory + File.separator + "bug232880b.jar"; //$NON-NLS-1$
try {
-
+
// create external jar 1
Util.createJar(
new String[] {
@@ -217,7 +217,7 @@ public void testBug232880a() throws Exception {
},
new HashMap(),
externalJar1);
-
+
// create external jar 2
String source2 =
"package test2;\n" + //$NON-NLS-1$
@@ -225,7 +225,7 @@ public void testBug232880a() throws Exception {
"public class IJavaElement {\n" + //$NON-NLS-1$
" IResource foo() {return null;}\n" + //$NON-NLS-1$
"}"; //$NON-NLS-1$
-
+
Util.createJar(
new String[] {
"test2/IJavaElement.java", //$NON-NLS-1$
@@ -242,12 +242,12 @@ public void testBug232880a() throws Exception {
new String[]{"src"},
new String[]{"JCL_LIB", externalJar1, externalJar2},
"bin");
-
+
this.createFolder("/PS1/attachment/test2");
this.createFile(
"/PS1/attachment/test2/IJavaElement.java",
source2);
-
+
IPackageFragmentRoot root = project1.getPackageFragmentRoot(externalJar2);
attachSource(root, "/PS1/attachment/", "");
@@ -255,7 +255,7 @@ public void testBug232880a() throws Exception {
// do code select
IClassFile cf = getClassFile("PS1", externalJar2, "test2", "IJavaElement.class");
-
+
IJavaElement[] elements = codeSelect(cf, "IResource foo", "IResource");
assertElementsEqual(
@@ -276,7 +276,7 @@ public void testBug232880b() throws Exception {
String externalJar1 = outputDirectory + File.separator + "bug232880a.jar"; //$NON-NLS-1$
String externalJar2 = outputDirectory + File.separator + "bug232880b.jar"; //$NON-NLS-1$
try {
-
+
// create external jar 1
Util.createJar(
new String[] {
@@ -287,7 +287,7 @@ public void testBug232880b() throws Exception {
},
new HashMap(),
externalJar1);
-
+
// create external jar 2
String source2 =
"package test2;\n" + //$NON-NLS-1$
@@ -295,7 +295,7 @@ public void testBug232880b() throws Exception {
"public class IJavaElement {\n" + //$NON-NLS-1$
" IResource foo() {return null;}\n" + //$NON-NLS-1$
"}"; //$NON-NLS-1$
-
+
Util.createJar(
new String[] {
"test2/IJavaElement.java", //$NON-NLS-1$
@@ -312,12 +312,12 @@ public void testBug232880b() throws Exception {
new String[]{"src"},
new String[]{"JCL_LIB", externalJar2},
"bin");
-
+
this.createFolder("/PS1/attachment/test2");
this.createFile(
"/PS1/attachment/test2/IJavaElement.java",
source2);
-
+
IPackageFragmentRoot root = project1.getPackageFragmentRoot(externalJar2);
attachSource(root, "/PS1/attachment/", "");
@@ -325,7 +325,7 @@ public void testBug232880b() throws Exception {
// do code select
IClassFile cf = getClassFile("PS1", externalJar2, "test2", "IJavaElement.class");
-
+
IJavaElement[] elements = codeSelect(cf, "IResource foo", "IResource");
assertElementsEqual(
@@ -346,7 +346,7 @@ public void testBug232880c() throws Exception {
String externalJar1 = outputDirectory + File.separator + "bug232880a.jar"; //$NON-NLS-1$
String externalJar2 = outputDirectory + File.separator + "bug232880b.jar"; //$NON-NLS-1$
try {
-
+
// create external jar 1
Util.createJar(
new String[] {
@@ -357,7 +357,7 @@ public void testBug232880c() throws Exception {
},
new HashMap(),
externalJar1);
-
+
// create external jar 2
String source2 =
"package test2;\n" + //$NON-NLS-1$
@@ -365,7 +365,7 @@ public void testBug232880c() throws Exception {
"public class IJavaElement {\n" + //$NON-NLS-1$
" IResource foo() {return null;}\n" + //$NON-NLS-1$
"}"; //$NON-NLS-1$
-
+
Util.createJar(
new String[] {
"test2/IJavaElement.java", //$NON-NLS-1$
@@ -382,15 +382,15 @@ public void testBug232880c() throws Exception {
new String[]{"src"},
new String[]{"JCL_LIB", externalJar2},
"bin");
-
+
this.createFolder("/PS1/attachment/test2");
this.createFile(
"/PS1/attachment/test2/IJavaElement.java",
source2);
-
+
IPackageFragmentRoot root = project1.getPackageFragmentRoot(externalJar2);
attachSource(root, "/PS1/attachment/", "");
-
+
// create P2
this.createJavaProject(
"PS2",
@@ -402,7 +402,7 @@ public void testBug232880c() throws Exception {
// do code select
IClassFile cf = getClassFile("PS1", externalJar2, "test2", "IJavaElement.class");
-
+
IJavaElement[] elements = codeSelect(cf, "IResource foo", "IResource");
assertElementsEqual(
@@ -425,13 +425,13 @@ public void testBug232880d() throws Exception {
String externalJar1 = outputDirectory + File.separator + "bug232880a.jar"; //$NON-NLS-1$
String externalJar2 = outputDirectory + File.separator + "bug232880b.jar"; //$NON-NLS-1$
try {
-
+
// create external jar 1
String source1 =
"package test1;\n" + //$NON-NLS-1$
"public class IResource {\n" + //$NON-NLS-1$
"}"; //$NON-NLS-1$
-
+
Util.createJar(
new String[] {
"test1/IResource.java", //$NON-NLS-1$
@@ -439,7 +439,7 @@ public void testBug232880d() throws Exception {
},
new HashMap(),
externalJar1);
-
+
// create external jar 2
String source2 =
"package test2;\n" + //$NON-NLS-1$
@@ -447,7 +447,7 @@ public void testBug232880d() throws Exception {
"public class IJavaElement {\n" + //$NON-NLS-1$
" IResource foo() {return null;}\n" + //$NON-NLS-1$
"}"; //$NON-NLS-1$
-
+
Util.createJar(
new String[] {
"test2/IJavaElement.java", //$NON-NLS-1$
@@ -464,15 +464,15 @@ public void testBug232880d() throws Exception {
new String[]{"src"},
new String[]{"JCL_LIB", externalJar2},
"bin");
-
+
this.createFolder("/PS1/attachment/test2");
this.createFile(
"/PS1/attachment/test2/IJavaElement.java",
source2);
-
+
IPackageFragmentRoot root = project1.getPackageFragmentRoot(externalJar2);
attachSource(root, "/PS1/attachment/", "");
-
+
// create P2
this.createJavaProject(
"PS2",
@@ -489,7 +489,7 @@ public void testBug232880d() throws Exception {
// do code select
IClassFile cf = getClassFile("PS1", externalJar2, "test2", "IJavaElement.class");
-
+
IJavaElement[] elements = codeSelect(cf, "IResource foo", "IResource");
assertElementsEqual(
@@ -512,18 +512,18 @@ public void testBug232880e() throws Exception {
String externalJar1 = outputDirectory + File.separator + "bug232880a.jar"; //$NON-NLS-1$
String externalJar2 = outputDirectory + File.separator + "bug232880b.jar"; //$NON-NLS-1$
try {
-
+
// create external jar 1
String source1_1 =
"package test1;\n" + //$NON-NLS-1$
"public class CoreException extends Exception {\n" + //$NON-NLS-1$
"}"; //$NON-NLS-1$
-
+
String source1_2 =
"package test1;\n" + //$NON-NLS-1$
"public class IResource {\n" + //$NON-NLS-1$
"}"; //$NON-NLS-1$
-
+
Util.createJar(
new String[] {
"test1/CoreException.java", //$NON-NLS-1$
@@ -533,14 +533,14 @@ public void testBug232880e() throws Exception {
},
new HashMap(),
externalJar1);
-
+
// create external jar 2
String source2_1 =
"package test2;\n" + //$NON-NLS-1$
"import test1.CoreException;\n" + //$NON-NLS-1$
"public class JavaModelException extends CoreException {\n" + //$NON-NLS-1$
"}"; //$NON-NLS-1$
-
+
String source2_2 =
"package test2;\n" + //$NON-NLS-1$
"import test1.IResource;\n" + //$NON-NLS-1$
@@ -548,7 +548,7 @@ public void testBug232880e() throws Exception {
" void foo1() throws JavaModelException {}\n" + //$NON-NLS-1$
" IResource foo2() {return null;}\n" + //$NON-NLS-1$
"}"; //$NON-NLS-1$
-
+
Util.createJar(
new String[] {
"test2/JavaModelException.java", //$NON-NLS-1$
@@ -567,15 +567,15 @@ public void testBug232880e() throws Exception {
new String[]{"src"},
new String[]{"JCL_LIB", externalJar2},
"bin");
-
+
this.createFolder("/PS1/attachment/test2");
this.createFile(
"/PS1/attachment/test2/IJavaElement.java",
source2_2);
-
+
IPackageFragmentRoot root = project1.getPackageFragmentRoot(externalJar2);
attachSource(root, "/PS1/attachment/", "");
-
+
// create P2
this.createJavaProject(
"PS2",
@@ -592,7 +592,7 @@ public void testBug232880e() throws Exception {
// do code select
IClassFile cf = getClassFile("PS1", externalJar2, "test2", "IJavaElement.class");
-
+
IJavaElement[] elements = codeSelect(cf, "IResource foo", "IResource");
assertElementsEqual(
@@ -615,7 +615,7 @@ public void testBug232880f() throws Exception {
String externalJar1 = outputDirectory + File.separator + "bug232880a.jar"; //$NON-NLS-1$
String externalJar2 = outputDirectory + File.separator + "bug232880b.jar"; //$NON-NLS-1$
try {
-
+
// create external jar 1
Util.createJar(
new String[] {
@@ -630,7 +630,7 @@ public void testBug232880f() throws Exception {
},
new HashMap(),
externalJar1);
-
+
// create external jar 2
String source2 =
"package test3;\n" + //$NON-NLS-1$
@@ -638,7 +638,7 @@ public void testBug232880f() throws Exception {
"public class IJavaElement {\n" + //$NON-NLS-1$
" IResource foo() {return null;}\n" + //$NON-NLS-1$
"}"; //$NON-NLS-1$
-
+
Util.createJar(
new String[] {
"test3/IJavaElement.java", //$NON-NLS-1$
@@ -655,15 +655,15 @@ public void testBug232880f() throws Exception {
new String[]{"src"},
new String[]{"JCL_LIB", externalJar2},
"bin");
-
+
this.createFolder("/PS1/attachment/test3");
this.createFile(
"/PS1/attachment/test3/IJavaElement.java",
source2);
-
+
IPackageFragmentRoot root = project1.getPackageFragmentRoot(externalJar2);
attachSource(root, "/PS1/attachment/", "");
-
+
// create P2
this.createJavaProject(
"PS2",
@@ -675,7 +675,7 @@ public void testBug232880f() throws Exception {
// do code select
IClassFile cf = getClassFile("PS1", externalJar2, "test3", "IJavaElement.class");
-
+
IJavaElement[] elements = codeSelect(cf, "IResource foo", "IResource");
assertElementsEqual(
@@ -698,7 +698,7 @@ public void testBug232880g() throws Exception {
String externalJar1 = outputDirectory + File.separator + "bug232880a.jar"; //$NON-NLS-1$
String externalJar2 = outputDirectory + File.separator + "bug232880b.jar"; //$NON-NLS-1$
try {
-
+
// create external jar 1
Util.createJar(
new String[] {
@@ -713,7 +713,7 @@ public void testBug232880g() throws Exception {
},
new HashMap(),
externalJar1);
-
+
// create external jar 2
String source2 =
"package test3;\n" + //$NON-NLS-1$
@@ -721,7 +721,7 @@ public void testBug232880g() throws Exception {
"public class IJavaElement {\n" + //$NON-NLS-1$
" IResource foo() {return null;}\n" + //$NON-NLS-1$
"}"; //$NON-NLS-1$
-
+
Util.createJar(
new String[] {
"test3/IJavaElement.java", //$NON-NLS-1$
@@ -738,15 +738,15 @@ public void testBug232880g() throws Exception {
new String[]{"src"},
new String[]{"JCL_LIB", externalJar2},
"bin");
-
+
this.createFolder("/PS1/attachment/test3");
this.createFile(
"/PS1/attachment/test3/IJavaElement.java",
source2);
-
+
IPackageFragmentRoot root = project1.getPackageFragmentRoot(externalJar2);
attachSource(root, "/PS1/attachment/", "");
-
+
// create P2
this.createJavaProject(
"PS2",
@@ -758,7 +758,7 @@ public void testBug232880g() throws Exception {
// do code select
IClassFile cf = getClassFile("PS1", externalJar2, "test3", "IJavaElement.class");
-
+
IJavaElement[] elements = codeSelect(cf, "IResource foo", "IResource");
assertElementsEqual(
@@ -780,7 +780,7 @@ public void testBug232880h() throws Exception {
String externalJar1 = outputDirectory + File.separator + "bug232880a.jar"; //$NON-NLS-1$
String externalJar2 = outputDirectory + File.separator + "bug232880b.jar"; //$NON-NLS-1$
try {
-
+
// create external jar 1
Util.createJar(
new String[] {
@@ -795,7 +795,7 @@ public void testBug232880h() throws Exception {
},
new HashMap(),
externalJar1);
-
+
// create external jar 2
String source2 =
"package test3;\n" + //$NON-NLS-1$
@@ -804,7 +804,7 @@ public void testBug232880h() throws Exception {
"public class IJavaElement {\n" + //$NON-NLS-1$
" IResource foo() {return null;}\n" + //$NON-NLS-1$
"}"; //$NON-NLS-1$
-
+
Util.createJar(
new String[] {
"test3/IJavaElement.java", //$NON-NLS-1$
@@ -821,15 +821,15 @@ public void testBug232880h() throws Exception {
new String[]{"src"},
new String[]{"JCL_LIB", externalJar2},
"bin");
-
+
this.createFolder("/PS1/attachment/test3");
this.createFile(
"/PS1/attachment/test3/IJavaElement.java",
source2);
-
+
IPackageFragmentRoot root = project1.getPackageFragmentRoot(externalJar2);
attachSource(root, "/PS1/attachment/", "");
-
+
// create P2
this.createJavaProject(
"PS2",
@@ -841,7 +841,7 @@ public void testBug232880h() throws Exception {
// do code select
IClassFile cf = getClassFile("PS1", externalJar2, "test3", "IJavaElement.class");
-
+
IJavaElement[] elements = codeSelect(cf, "IResource foo", "IResource");
assertElementsEqual(
@@ -863,7 +863,7 @@ public void testBug232880i() throws Exception {
String externalJar1 = outputDirectory + File.separator + "bug232880a.jar"; //$NON-NLS-1$
String externalJar2 = outputDirectory + File.separator + "bug232880b.jar"; //$NON-NLS-1$
try {
-
+
// create external jar 1
Util.createJar(
new String[] {
@@ -878,14 +878,14 @@ public void testBug232880i() throws Exception {
},
new HashMap(),
externalJar1);
-
+
// create external jar 2
String source2 =
"package test3;\n" + //$NON-NLS-1$
"public class IJavaElement {\n" + //$NON-NLS-1$
" test2.IResource foo() {return null;}\n" + //$NON-NLS-1$
"}"; //$NON-NLS-1$
-
+
Util.createJar(
new String[] {
"test3/IJavaElement.java", //$NON-NLS-1$
@@ -902,15 +902,15 @@ public void testBug232880i() throws Exception {
new String[]{"src"},
new String[]{"JCL_LIB", externalJar2},
"bin");
-
+
this.createFolder("/PS1/attachment/test3");
this.createFile(
"/PS1/attachment/test3/IJavaElement.java",
source2);
-
+
IPackageFragmentRoot root = project1.getPackageFragmentRoot(externalJar2);
attachSource(root, "/PS1/attachment/", "");
-
+
// create P2
this.createJavaProject(
"PS2",
@@ -922,12 +922,12 @@ public void testBug232880i() throws Exception {
// do code select
IClassFile cf = getClassFile("PS1", externalJar2, "test3", "IJavaElement.class");
-
+
IJavaElement[] elements = codeSelect(cf, "IResource foo", "IResource");
assertElementsEqual(
"Unexpected elements",
- "IResource [in IResource.class [in test1 [in "+outputDirectory+File.separator+"bug232880a.jar]]]\n" +
+ "IResource [in IResource.class [in test1 [in "+outputDirectory+File.separator+"bug232880a.jar]]]\n" +
"IResource [in IResource.class [in test2 [in "+outputDirectory+File.separator+"bug232880a.jar]]]",
elements,
false,
@@ -948,7 +948,7 @@ public void testBug232880j() throws Exception {
String externalJar1 = outputDirectory + File.separator + "bug232880a.jar"; //$NON-NLS-1$
String externalJar2 = outputDirectory + File.separator + "bug232880b.jar"; //$NON-NLS-1$
try {
-
+
// create external jar 1
Util.createJar(
new String[] {
@@ -959,7 +959,7 @@ public void testBug232880j() throws Exception {
},
new HashMap(),
externalJar1);
-
+
// create external jar 2
String source2 =
"package test2;\n" + //$NON-NLS-1$
@@ -968,7 +968,7 @@ public void testBug232880j() throws Exception {
" // iresource\n" + //$NON-NLS-1$
" IResource foo() {return null;}\n" + //$NON-NLS-1$
"}"; //$NON-NLS-1$
-
+
Util.createJar(
new String[] {
"test2/IJavaElement.java", //$NON-NLS-1$
@@ -985,15 +985,15 @@ public void testBug232880j() throws Exception {
new String[]{"src"},
new String[]{"JCL_LIB", externalJar2},
"bin");
-
+
this.createFolder("/PS1/attachment/test2");
this.createFile(
"/PS1/attachment/test2/IJavaElement.java",
source2);
-
+
IPackageFragmentRoot root = project1.getPackageFragmentRoot(externalJar2);
attachSource(root, "/PS1/attachment/", "");
-
+
// create P2
this.createJavaProject(
"PS2",
@@ -1005,7 +1005,7 @@ public void testBug232880j() throws Exception {
// do code select
IClassFile cf = getClassFile("PS1", externalJar2, "test2", "IJavaElement.class");
-
+
IJavaElement[] elements = codeSelect(cf, "iresource", "iresource");
assertElementsEqual(
@@ -1038,7 +1038,7 @@ public void testBug249027a() throws Exception {
"package p1;\n"+
"public class C1 {\n" +
"}");
-
+
this.createFolder("/P1/src/p1/C1");
this.createFile(
"/P1/src/p1/C1/C2.java",
@@ -1084,7 +1084,7 @@ public void testBug249027b() throws Exception {
"package p1;\n"+
"public class C1 {\n" +
"}");
-
+
this.createFolder("/P1/src/p2");
this.createFile(
"/P1/src/p2/C2.java",
@@ -1135,7 +1135,7 @@ public void testBug343693() throws Exception{
" new X<>(\"hello\");\n"+
"}\n"+
"}");
-
+
waitUntilIndexesReady();
// do code select
@@ -1169,25 +1169,25 @@ public void testBug349486() throws Exception{
this.createFolder("/P1/src/p1");
this.createFile("/P1/src/p1/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" +
- " Object x;\n" +
- " String s;\n" +
- " int i;\n" +
- " MethodType mt;\n" +
- " MethodHandle mh;\n" +
- " MethodHandles.Lookup lookup = MethodHandles.lookup();\n" +
- " // mt is (char,char)String\n" +
- " mt = MethodType.methodType(String.class, char.class, char.class);\n" +
- " mh = lookup.findVirtual(String.class, \"replace\", mt);\n" +
- " s = (String) mh.invokeExact(\"daddy\", 'd', 'n');\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" +
+ " Object x;\n" +
+ " String s;\n" +
+ " int i;\n" +
+ " MethodType mt;\n" +
+ " MethodHandle mh;\n" +
+ " MethodHandles.Lookup lookup = MethodHandles.lookup();\n" +
+ " // mt is (char,char)String\n" +
+ " mt = MethodType.methodType(String.class, char.class, char.class);\n" +
+ " mh = lookup.findVirtual(String.class, \"replace\", mt);\n" +
+ " s = (String) mh.invokeExact(\"daddy\", 'd', 'n');\n" +
" }\n" +
"}\n");
-
+
waitUntilIndexesReady();
// do code select
@@ -1221,9 +1221,9 @@ public void testBug356325() throws Exception{
this.createFolder("/P1/src/p");
this.createFile("/P1/src/p/C.java",
- "package p;" +
- "\n" +
- "public class C {\n" +
+ "package p;" +
+ "\n" +
+ "public class C {\n" +
" public void m() {\n" +
" class Inner<T> {\n" +
" Inner() {\n"+
@@ -1231,7 +1231,7 @@ public void testBug356325() throws Exception{
" Inner<String> i = new Inner<String>();\n"+
" }\n" +
"}\n");
-
+
waitUntilIndexesReady();
// do code select
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests9.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests9.java
index 9753ba595..328fe8abb 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests9.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests9.java
@@ -69,9 +69,9 @@ public class ResolveTests9 extends AbstractJavaModelTests {
}
public void setUpSuite() throws Exception {
super.setUpSuite();
-
+
IJavaProject project = setUpJavaProject("Resolve", "9", true);
-
+
String bootModPath = System.getProperty("java.home") + File.separator +"jrt-fs.jar";
IClasspathEntry jrtEntry = JavaCore.newLibraryEntry(new Path(bootModPath), null, null, null, null, false);
IClasspathEntry[] old = project.getRawClasspath();
@@ -79,20 +79,20 @@ public class ResolveTests9 extends AbstractJavaModelTests {
System.arraycopy(old, 0, newPath, 0, old.length);
newPath[old.length] = jrtEntry;
project.setRawClasspath(newPath, null);
-
+
waitUntilIndexesReady();
}
-
+
protected void setUp() throws Exception {
super.setUp();
this.wcOwner = new WorkingCopyOwner(){};
}
public void tearDownSuite() throws Exception {
deleteProject("Resolve");
-
+
super.tearDownSuite();
}
-
+
protected void tearDown() throws Exception {
if (this.wc != null) {
this.wc.discardWorkingCopy();
@@ -116,7 +116,7 @@ public class ResolveTests9 extends AbstractJavaModelTests {
}
void addTestSrc(IJavaProject prj) throws CoreException {
IPath path = prj.getProject().getFullPath();
- IClasspathEntry testSrc = JavaCore.newSourceEntry(path.append(new Path("src-test")),
+ IClasspathEntry testSrc = JavaCore.newSourceEntry(path.append(new Path("src-test")),
null, null, path.append(new Path("bin-test")),
new IClasspathAttribute[] {JavaCore.newClasspathAttribute(IClasspathAttribute.TEST, "true")});
addClasspathEntry(prj, testSrc);
@@ -132,18 +132,18 @@ public class ResolveTests9 extends AbstractJavaModelTests {
getWorkingCopy(
"/Resolve/src/test/TestClass.java",
"public class TestClass implements ITest {}\n");
-
+
this.wc = getWorkingCopy(
"/Resolve/src/module-info.java",
"module com.test {\n" +
" provides p1.Y with ResolveInterface;\n" +
"}\n");
-
+
String str = this.wc.getSource();
String selection = "ResolveInterface";
int start = str.indexOf(selection);
int length = selection.length();
-
+
IJavaElement[] elements = this.wc.codeSelect(start, length);
assertElementsEqual(
"Unexpected elements",
@@ -168,18 +168,18 @@ public class ResolveTests9 extends AbstractJavaModelTests {
"/Resolve/src/test/TestClass.java",
"package test;\n" +
"public class TestClass implements ITest {}\n");
-
+
this.wc = getWorkingCopy(
"/Resolve/src/module-info.java",
"module com.test {\n" +
" provides test.ITest with test.TestClass;\n" +
"}\n");
-
+
String str = this.wc.getSource();
String selection = "ITest";
int start = str.indexOf(selection);
int length = selection.length();
-
+
IJavaElement[] elements = this.wc.codeSelect(start, length);
assertElementsEqual(
"Unexpected elements",
@@ -227,7 +227,7 @@ public class ResolveTests9 extends AbstractJavaModelTests {
String selection = "ITest";
int start = str.indexOf(selection);
int length = selection.length();
-
+
// still, if we get here before indexes are ready,
// then OperationCanceledException will send us into SearchableEnvironment.findTypes(String, ISearchRequestor, int),
// which succeeds:
@@ -256,18 +256,18 @@ public class ResolveTests9 extends AbstractJavaModelTests {
createFile(
"/Resolve/src/test/TestClass.java",
"public class TestClass implements ITest {}\n");
-
+
this.wc = getWorkingCopy(
"/Resolve/src/module-info.java",
"module com.test {\n" +
" provides test.ITest with test.TestClass;\n" +
"}\n");
-
+
String str = this.wc.getSource();
String selection = "ITest";
int start = str.indexOf(selection);
int length = selection.length();
-
+
waitUntilIndexesReady();
// even after indexes are built we meanwhile (after bug 540541) find the selected type
IJavaElement[] elements = this.wc.codeSelect(start, length);
@@ -293,18 +293,18 @@ public class ResolveTests9 extends AbstractJavaModelTests {
getWorkingCopy(
"/Resolve/src/test/TestClass.java",
"public class TestClass implements ITest {}\n");
-
+
this.wc = getWorkingCopy(
"/Resolve/src/module-info.java",
"module com.test {\n" +
" provides p1.Y with ResolveInterface;\n" +
"}\n");
-
+
String str = this.wc.getSource();
String selection = "provides";
int start = str.indexOf(selection);
int length = selection.length();
-
+
IJavaElement[] elements = this.wc.codeSelect(start, length);
assertElementsEqual(
"Unexpected elements",
@@ -327,18 +327,18 @@ public class ResolveTests9 extends AbstractJavaModelTests {
getWorkingCopy(
"/Resolve/src/test/TestClass.java",
"public class TestClass implements ITest {}\n");
-
+
this.wc = getWorkingCopy(
"/Resolve/src/module-info.java",
- "module com.test {\n" +
- " provides p1.Y with provides;\n" +
+ "module com.test {\n" +
+ " provides p1.Y with provides;\n" +
"}\n");
-
+
String str = this.wc.getSource();
String selection = "provides";
int start = str.lastIndexOf(selection);
int length = selection.length();
-
+
IJavaElement[] elements = this.wc.codeSelect(start, length);
assertElementsEqual(
"Unexpected elements",
@@ -407,8 +407,8 @@ public class ResolveTests9 extends AbstractJavaModelTests {
IMarker[] markers = test.getProject().findMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE);
sortMarkers(markers);
assertMarkers("Unexpected markers",
- "The package p1.p2 conflicts with a package accessible from another module: mod\n" +
- "The package p1.p2 is accessible from more than one module: <unnamed>, mod\n" +
+ "The package p1.p2 conflicts with a package accessible from another module: mod\n" +
+ "The package p1.p2 is accessible from more than one module: <unnamed>, mod\n" +
"The package p1.p2 is accessible from more than one module: <unnamed>, mod",
markers);
@@ -519,7 +519,7 @@ public class ResolveTests9 extends AbstractJavaModelTests {
gui = createJava9ProjectWithJREAttributes("com.igorion.gui", new String[] {"src"}, attributes(MODULE));
addTestSrc(gui);
createFolder("com.igorion.gui/src/com/igorion/gui");
- String source =
+ String source =
"package com.igorion.gui;\n" +
"import com.igorion.model.IModel;\n" +
"import com.igorion.model.define.Model;\n" +
@@ -594,7 +594,7 @@ public class ResolveTests9 extends AbstractJavaModelTests {
// ... and observe javax.xml.bind unobservable:
prj.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
markers = prj.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
- assertMarkers("unexpected markers",
+ assertMarkers("unexpected markers",
"javax.xml.bind cannot be resolved to a type", markers);
} finally {
deleteProject(prj);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests_1_5.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests_1_5.java
index 840b32cd6..d22d2bae6 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests_1_5.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests_1_5.java
@@ -2732,7 +2732,7 @@ public void test0117() throws Exception {
" @A(n=) String str;\n" +
" }\n" +
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/Resolve/src/test/A.java",
"package test;\n" +
@@ -2765,7 +2765,7 @@ public void test0118() throws Exception {
" @A(n=) String str;\n" +
" }\n" +
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/Resolve/src/test/A.java",
"package test;\n" +
@@ -2779,7 +2779,7 @@ public void test0118() throws Exception {
int start = str.lastIndexOf("str");
int length = "str".length();
IJavaElement[] elements = this.workingCopies[0].codeSelect(start, length, this.wcOwner);
-
+
if (elements != null &&
elements.length > 0 &&
elements[0] instanceof IAnnotatable) {
@@ -2802,14 +2802,14 @@ public void test0119() throws Exception {
" return Collections.emptyList();\n" +
" }\n" +
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/Resolve/src/test/Collections.java",
"package test;\n" +
"public class Collections {\n" +
" public static final <T> List<T> emptyList() {return null;}\n" +
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/Resolve/src/test/List.java",
"package test;\n" +
@@ -2839,14 +2839,14 @@ public void test0120() throws Exception {
" List<String> local = Collections.emptyList();\n" +
" }\n" +
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/Resolve/src/test/Collections.java",
"package test;\n" +
"public class Collections {\n" +
" public static final <T> List<T> emptyList() {return null;}\n" +
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/Resolve/src/test/List.java",
"package test;\n" +
@@ -2876,14 +2876,14 @@ public void test0121() throws Exception {
" public void foo() {\n" +
" }\n" +
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/Resolve/src/test/Collections.java",
"package test;\n" +
"public class Collections {\n" +
" public static final <T> List<T> emptyList() {return null;}\n" +
"}");
-
+
this.workingCopies[1] = getWorkingCopy(
"/Resolve/src/test/List.java",
"package test;\n" +
@@ -2931,13 +2931,13 @@ public void test0123() throws Exception {
this.workingCopies[0] = getWorkingCopy(
"/Resolve/src/test/Test.java",
"package test;\n" +
- "public class Test {\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" +
+ "public class Test {\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 str = this.workingCopies[0].getSource();
@@ -2957,10 +2957,10 @@ public void test0124() throws Exception {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
"/Resolve/src/Test.java",
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " String str\ud842\udf9f = null;\n" +
- " }\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) {\n" +
+ " String str\ud842\udf9f = null;\n" +
+ " }\n" +
"}");
String str = this.workingCopies[0].getSource();
@@ -2987,7 +2987,7 @@ public void test0125() throws CoreException {
WorkingCopyOwner owner = newWorkingCopyOwner(new BasicProblemRequestor());
ICompilationUnit cu = getWorkingCopy(
"/P0125/src/Test.java",
- "public enum Test {\n" +
+ "public enum Test {\n" +
"}",
owner);
IType type = cu.getType("Test");
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/RunCompletionModelTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/RunCompletionModelTests.java
index dc17bb9a2..ceb49bcfa 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/RunCompletionModelTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/RunCompletionModelTests.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.model/src/org/eclipse/jdt/core/tests/model/SearchParticipantTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SearchParticipantTests.java
index 239ad8278..b75605cb6 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SearchParticipantTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SearchParticipantTests.java
@@ -317,7 +317,7 @@ public class SearchParticipantTests extends ModifyingResourceTests implements IJ
"X.test X [X]",
requestor);
}
-
+
/*
* Ensures that a simple search that forwards queries to the default participant works as expected even after restart
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=308402
@@ -342,7 +342,7 @@ public class SearchParticipantTests extends ModifyingResourceTests implements IJ
simulateExit();
simulateRestart();
waitUntilIndexesReady();
-
+
// search for declaration of X
SearchPattern pattern = SearchPattern.createPattern("X", IJavaSearchConstants.DECLARATIONS, IJavaSearchConstants.TYPE, SearchPattern.R_EXACT_MATCH);
IJavaSearchScope scope = SearchEngine.createWorkspaceScope();
@@ -351,9 +351,9 @@ public class SearchParticipantTests extends ModifyingResourceTests implements IJ
assertSearchResults(
"X.test X [X]",
requestor);
-
+
}
-
+
/*
* Ensures that a simple search that forwards queries to the default participant works as expected even after restart
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=308402
@@ -370,13 +370,13 @@ public class SearchParticipantTests extends ModifyingResourceTests implements IJ
TestSearchDocument document = new TestSearchDocument("/P/X.test", participant);
participant.scheduleDocumentIndexing(document, getIndexLocation());
waitUntilIndexesReady();
-
+
// search for declaration of X
SearchPattern pattern = SearchPattern.createPattern("X", IJavaSearchConstants.DECLARATIONS, IJavaSearchConstants.TYPE, SearchPattern.R_EXACT_MATCH);
IJavaSearchScope scope = SearchEngine.createWorkspaceScope();
SearchRequestor requestor = new TestResultCollector();
new SearchEngine().search(pattern, new SearchParticipant[] {participant}, scope, requestor, null);
-
+
// remove the index
participant.removeIndex(getIndexLocation());
assertSearchResults(
@@ -390,12 +390,12 @@ public class SearchParticipantTests extends ModifyingResourceTests implements IJ
requestor = new TestResultCollector();
new SearchEngine().search(pattern, new SearchParticipant[] {participant}, scope, requestor, null);
assertSearchResults("", requestor);
-
+
simulateExit();
simulateRestart();
waitUntilIndexesReady();
requestor = new TestResultCollector();
new SearchEngine().search(pattern, new SearchParticipant[] {participant}, scope, requestor, null);
- assertSearchResults("", requestor);
+ assertSearchResults("", requestor);
}
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SearchTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SearchTests.java
index 2cb4fa40a..e8b89c6d2 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SearchTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SearchTests.java
@@ -81,18 +81,18 @@ public class SearchTests extends ModifyingResourceTests implements IJavaSearchCo
Vector results = new Vector<>();
@Override
public void acceptMethod(
- char[] methodName,
- int parameterCount,
- char[] declaringQualifier,
- char[] simpleTypeName,
- int typeModifiers,
- char[] packageName,
- char[] signature,
- char[][] parameterTypes,
- char[][] parameterNames,
- char[] returnType,
- int modifiers,
- String path,
+ char[] methodName,
+ int parameterCount,
+ char[] declaringQualifier,
+ char[] simpleTypeName,
+ int typeModifiers,
+ char[] packageName,
+ char[] signature,
+ char[][] parameterTypes,
+ char[][] parameterNames,
+ char[] returnType,
+ int modifiers,
+ String path,
int methodIndex) {
StringBuffer buffer = new StringBuffer();
char c = '.';
@@ -107,9 +107,9 @@ public class SearchTests extends ModifyingResourceTests implements IJavaSearchCo
buffer.append(methodName);
buffer.append('(');
parameterTypes = signature == null ? parameterTypes : Signature.getParameterTypes(signature);
-
+
for (int i = 0; i < parameterCount; i++) {
-
+
if (parameterTypes != null) {
char[] parameterType;
if (parameterTypes.length != parameterCount) {
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SelectionJavadocModelTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SelectionJavadocModelTests.java
index bff291ae9..31a01ccfe 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SelectionJavadocModelTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SelectionJavadocModelTests.java
@@ -1344,7 +1344,7 @@ public class SelectionJavadocModelTests extends AbstractJavaModelTests {
elements[0] = selectMethod(this.workingCopies[0], "@inheritDoc", 1);
elements[1] = selectMethod(this.workingCopies[0], "@inheritDoc", 2);
assertElementsEqual("Invalid selection(s)",
- "foo(int) [in X [in [Working copy] X.java [in b171019 [in <project root> [in Tests]]]]]\n" +
+ "foo(int) [in X [in [Working copy] X.java [in b171019 [in <project root> [in Tests]]]]]\n" +
"foo(String) [in Y [in [Working copy] X.java [in b171019 [in <project root> [in Tests]]]]]",
elements
);
@@ -1382,7 +1382,7 @@ public class SelectionJavadocModelTests extends AbstractJavaModelTests {
elements[0] = selectMethod(this.workingCopies[0], "@inheritDoc", 1);
elements[1] = selectMethod(this.workingCopies[0], "@inheritDoc", 2);
assertElementsEqual("Invalid selection(s)",
- "foo(int) [in X [in [Working copy] X.java [in b171019 [in <project root> [in Tests]]]]]\n" +
+ "foo(int) [in X [in [Working copy] X.java [in b171019 [in <project root> [in Tests]]]]]\n" +
"foo(String) [in Y [in [Working copy] X.java [in b171019 [in <project root> [in Tests]]]]]",
elements
);
@@ -1533,9 +1533,9 @@ public class SelectionJavadocModelTests extends AbstractJavaModelTests {
elements[2] = selectMethod(this.workingCopies[0], "@inheritDoc", 3);
elements[3] = selectMethod(this.workingCopies[0], "@inheritDoc", 4);
assertElementsEqual("Invalid selection(s)",
- "foo(int) [in X [in [Working copy] X.java [in b171019 [in <project root> [in Tests]]]]]\n" +
- "foo(int) [in X [in [Working copy] X.java [in b171019 [in <project root> [in Tests]]]]]\n" +
- "foo(int) [in X [in [Working copy] X.java [in b171019 [in <project root> [in Tests]]]]]\n" +
+ "foo(int) [in X [in [Working copy] X.java [in b171019 [in <project root> [in Tests]]]]]\n" +
+ "foo(int) [in X [in [Working copy] X.java [in b171019 [in <project root> [in Tests]]]]]\n" +
+ "foo(int) [in X [in [Working copy] X.java [in b171019 [in <project root> [in Tests]]]]]\n" +
"foo(int) [in X [in [Working copy] X.java [in b171019 [in <project root> [in Tests]]]]]",
elements
);
@@ -1608,7 +1608,7 @@ public class SelectionJavadocModelTests extends AbstractJavaModelTests {
if (t.isAlive()) {
fail("Thread shouldn't still be running");
}
- assertElementEquals("Should return a valid element",
+ assertElementEquals("Should return a valid element",
"componentShown(ComponentEvent) [in ComponentAdapter [in [Working copy] ETest.java [in test [in <project root> [in Tests]]]]]", selection[0]);
}
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SignatureTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SignatureTests.java
index 5056193b0..4b03a5811 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SignatureTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SignatureTests.java
@@ -354,7 +354,7 @@ public void testGetParameterTypes() {
parameterTypes = Signature.getParameterTypes(methodSig);
assertEquals("Signature#getParameterTypes 6", 1, parameterTypes.length);
assertEquals("Signature#getParameterTypes 6", "La;", parameterTypes[0]);
-
+
methodSig = "(La<TE;>;)V";
parameterTypes = Signature.getParameterTypes(methodSig);
assertEquals("Signature#getParameterTypes 6", 1,
@@ -1600,34 +1600,34 @@ public void testCreateIntersectionTypeSignature2() {
}
// Bug 380048 - error popup when navigating to source files
public void testSourceMapperSigConversion01() {
- SourceMapper mapper = new SourceMapper();
+ SourceMapper mapper = new SourceMapper();
char[][] typeNames = new char[][] {
"java.lang.String".toCharArray(),
-
- ("apache.Mapper" +
- "<?,?,ap.Text,ap.ClusterObservations>" +
+
+ ("apache.Mapper" +
+ "<?,?,ap.Text,ap.ClusterObservations>" +
".Context"
).toCharArray(),
- ("apache.Mapper" +
- "<?,?,ap.Text,ap.ClusterObservations>" +
+ ("apache.Mapper" +
+ "<?,?,ap.Text,ap.ClusterObservations>" +
".Context<java.lang.String>"
).toCharArray(),
-
- ("app.Mapper" +
+
+ ("app.Mapper" +
"<?,?,ap.Text,ap2.ClusterObservations>"
).toCharArray(),
-
+
"Context<String>".toCharArray(),
- ("Mapper" +
- "<?,?,Text,ClusterObservations>" +
+ ("Mapper" +
+ "<?,?,Text,ClusterObservations>" +
".Context"
+"<String>"
).toCharArray(),
-
+
"Iterable<Mapper<?,?,Text,ClusterObservations>.Context>".toCharArray(),
-
+
"java.util.Iterable<Mapper<?,?,Text,ClusterObservations>.Context>".toCharArray(),
"Mapper<?,?,Text,Mapper<?,?,Text,ClusterObservations>.Context>.Context".toCharArray()
@@ -1641,7 +1641,7 @@ public void testSourceMapperSigConversion01() {
"QContext<QString;>;",
"QIterable<QContext;>;",
"QIterable<QContext;>;",
- "QContext;"
+ "QContext;"
};
String[] ss = mapper.convertTypeNamesToSigs(typeNames);
assertEquals("Wrong number of signatures", expectedSigs.length, ss.length);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SubstringCompletionTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SubstringCompletionTests.java
index 2c36c3ac7..f0148b4fb 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SubstringCompletionTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SubstringCompletionTests.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Gábor Kövesdán - initial version
*******************************************************************************/
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SubwordCompletionTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SubwordCompletionTests.java
index e11569845..b73ae952d 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SubwordCompletionTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SubwordCompletionTests.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Julian Honnen - initial version
*******************************************************************************/
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SuiteOfTestCases.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SuiteOfTestCases.java
index 3631b62ab..3842597b4 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SuiteOfTestCases.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SuiteOfTestCases.java
@@ -167,7 +167,7 @@ public class SuiteOfTestCases extends org.eclipse.jdt.core.tests.junit.extension
field.setAccessible(true);
Set set = (Set) field.get(null);
set.clear();
-
+
suiteOfTestCases.setUpSuite();
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TestCompilationParticipant.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TestCompilationParticipant.java
index d7940a73a..83e25fce6 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TestCompilationParticipant.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TestCompilationParticipant.java
@@ -26,7 +26,7 @@ public class TestCompilationParticipant extends CompilationParticipant {
if (failToInstantiate)
throw new RuntimeException();
}
-
+
public boolean isActive(IJavaProject project) {
return PARTICIPANT != null && PARTICIPANT.isActive(project);
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeHierarchyNotificationTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeHierarchyNotificationTests.java
index 833666c8c..1d559adb7 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeHierarchyNotificationTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeHierarchyNotificationTests.java
@@ -1285,7 +1285,7 @@ public void testRenameExternalCompilationUnit() throws CoreException {
/*
* Ensures that getting a non-primary working copy does NOT trigger
- * a type hierarchy notification for the concerned hierarchy.
+ * a type hierarchy notification for the concerned hierarchy.
* See https://bugs.eclipse.org/bugs/show_bug.cgi?id=275805
*/
public void testGetWorkingCopy() throws CoreException {
@@ -1293,7 +1293,7 @@ public void testGetWorkingCopy() throws CoreException {
ICompilationUnit superCopy = null;
ICompilationUnit aWorkingCopy = null;
try {
-
+
createJavaProject("P");
createFolder("/P/p");
createFile(
@@ -1302,7 +1302,7 @@ public void testGetWorkingCopy() throws CoreException {
"public interface IX {\n" +
"}"
);
-
+
createFile(
"/P/p/X.java",
"package p;\n" +
@@ -1312,11 +1312,11 @@ public void testGetWorkingCopy() throws CoreException {
superCopy = getCompilationUnit("/P/p/IX.java");
superCopy.becomeWorkingCopy(null/*no progress*/);
- h = superCopy.getType("IX").newTypeHierarchy(null);
+ h = superCopy.getType("IX").newTypeHierarchy(null);
h.addTypeHierarchyChangedListener(this);
-
+
aWorkingCopy = getCompilationUnit("P/p/X.java").getWorkingCopy(null);
-
+
assertTrue("Should receive NO change", !this.changeReceived);
} finally {
if (h != null)
@@ -1325,14 +1325,14 @@ public void testGetWorkingCopy() throws CoreException {
aWorkingCopy.discardWorkingCopy();
if (superCopy!= null)
superCopy.discardWorkingCopy();
-
+
deleteProject("P");
}
}
/*
* Ensures that working copies with different owner than that of the
- * type hierarchy listener are ignored.
+ * type hierarchy listener are ignored.
* See https://bugs.eclipse.org/bugs/show_bug.cgi?id=275805
*/
public void testOwner() throws CoreException {
@@ -1348,7 +1348,7 @@ public void testOwner() throws CoreException {
"public class X {\n" +
"}"
);
-
+
aWorkingCopy = getCompilationUnit("/P/p/X.java").getWorkingCopy(null);
h = aWorkingCopy.getType("X").newTypeHierarchy(null);
h.addTypeHierarchyChangedListener(this);
@@ -1373,10 +1373,10 @@ public void testOwner() throws CoreException {
}
/**
* @bug 316654: ITypeHierarchyChangedListener receive spurious callbacks
- *
+ *
* Test that a non-Java resource added to a folder package fragment root doesn't
* result in a type hierarchy changed event.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=316654"
* @throws CoreException
*/
@@ -1396,9 +1396,9 @@ public void testBug316654() throws CoreException {
}
}
/**
- * Additional test - Test that a relevant Java source resource change results in a type hierarchy
- * change event.
- *
+ * Additional test - Test that a relevant Java source resource change results in a type hierarchy
+ * change event.
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=316654"
* @throws CoreException
*/
@@ -1410,7 +1410,7 @@ public void testBug316654_a() throws CoreException {
h.addTypeHierarchyChangedListener(this);
IPath filePath = project.getProject().getFullPath().append("src").append("p").append("Y.java");
try {
- createFile(filePath.toOSString(),
+ createFile(filePath.toOSString(),
"package p;\n" +
"class Y extends X{\n" +
"}");
@@ -1421,9 +1421,9 @@ public void testBug316654_a() throws CoreException {
}
}
/**
- * Additional test - Test that a relevant external archive change results in a type hierarchy
- * change event.
- *
+ * Additional test - Test that a relevant external archive change results in a type hierarchy
+ * change event.
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=316654"
* @throws CoreException
*/
@@ -1439,7 +1439,7 @@ public void testBug316654_b() throws CoreException {
ITypeHierarchy h = throwableClass.newTypeHierarchy(project, null);
h.addTypeHierarchyChangedListener(this);
reset();
-
+
try {
jarFile.setLastModified(System.currentTimeMillis());
refreshExternalArchives(project);
@@ -1450,22 +1450,22 @@ public void testBug316654_b() throws CoreException {
}
}
/**
- * Additional test - Test that a relevant archive change results in a type hierarchy
+ * Additional test - Test that a relevant archive change results in a type hierarchy
* change event.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=316654"
* @throws CoreException
*/
public void testBug316654_c() throws CoreException {
IJavaProject project = getJavaProject("TypeHierarchyNotification");
- IPath jarPath = project.getPath().append("test316654.jar");
+ IPath jarPath = project.getPath().append("test316654.jar");
IFile jarFile = getFile(jarPath.toOSString());
IType type = getClassFile("TypeHierarchyNotification", jarPath.toOSString(), "a", "A.class").getType();
ITypeHierarchy h = type.newTypeHierarchy(project, null);
h.addTypeHierarchyChangedListener(this);
reset();
-
+
try {
jarFile.touch(null);
refresh(project);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java
index 76776ebc0..b2fe6baa3 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java
@@ -687,7 +687,7 @@ public void testEfficiencyMultipleProjects() throws CoreException {
}
ProgressCounter counter = new ProgressCounter();
type.newTypeHierarchy(counter);
- assertTrue("Not enough cancellation checks", counter.count >= 85);
+ assertTrue("Not enough cancellation checks", counter.count >= 85);
} finally {
deleteProjects(new String[] {"P1", "P2", "P3"});
}
@@ -2420,8 +2420,8 @@ public void testBug254738() throws CoreException {
getType("", 1);
ITypeHierarchy hierarchy = focus.newTypeHierarchy(null);
assertHierarchyEquals(
- "Focus: <anonymous #1> [in nestedonemethod() [in <anonymous #1> [in parentmethod() [in Parent [in Parent.java [in abc [in src [in P]]]]]]]]\n" +
- "Super types:\n" +
+ "Focus: <anonymous #1> [in nestedonemethod() [in <anonymous #1> [in parentmethod() [in Parent [in Parent.java [in abc [in src [in P]]]]]]]]\n" +
+ "Super types:\n" +
"Sub types:\n",
hierarchy);
} finally {
@@ -2429,7 +2429,7 @@ public void testBug254738() throws CoreException {
}
}
/**
- * @bug 288698: Can't create type hierarchy for abstract types when they have inline descendants and *.class* in project name
+ * @bug 288698: Can't create type hierarchy for abstract types when they have inline descendants and *.class* in project name
* @test Ensure that ".class" as a substring of a path name is not interpreted as the ".class" suffix.
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=288698"
*/
@@ -2438,17 +2438,17 @@ public void testBug288698() throws JavaModelException {
assertTrue("Type should exist!", type.exists());
ITypeHierarchy hierarchy = type.newTypeHierarchy(null); // when bug occurred a StringIndexOutOfBoundsException was thrown here
assertHierarchyEquals(
- "Focus: AbstractBugTest [in AbstractBugTest.java [in p288698 [in src288698.classbug [in TypeHierarchy]]]]\n" +
- "Super types:\n" +
- " Object [in Object.class [in java.lang [in "+ getExternalJCLPathString() + "]]]\n" +
- "Sub types:\n" +
+ "Focus: AbstractBugTest [in AbstractBugTest.java [in p288698 [in src288698.classbug [in TypeHierarchy]]]]\n" +
+ "Super types:\n" +
+ " Object [in Object.class [in java.lang [in "+ getExternalJCLPathString() + "]]]\n" +
+ "Sub types:\n" +
" <anonymous #1> [in testIt() [in BugTest2Buggy [in BugTest2Buggy.java [in p288698 [in src288698.classbug [in TypeHierarchy]]]]]]\n",
hierarchy);
}
/**
* @bug 329663:[type hierarchy] Interfaces duplicated in type hierarchy on two packages from multiple projects
* @test that when two selected regions contains the same interface, it's not reported twice in the hierarchy.
- *
+ *
* @throws JavaModelException
* @throws CoreException
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=329663"
@@ -2481,9 +2481,9 @@ public void _testBug329663() throws JavaModelException, CoreException {
region.add(p2);
ITypeHierarchy hierarchy = JavaCore.newTypeHierarchy(region, null, null);
IType[] types = hierarchy.getRootInterfaces();
- assertTypesEqual("Unexpected super interfaces",
- "java.io.Serializable\n" +
- "p.I\n",
+ assertTypesEqual("Unexpected super interfaces",
+ "java.io.Serializable\n" +
+ "p.I\n",
types);
}
finally{
@@ -2495,7 +2495,7 @@ public void _testBug329663() throws JavaModelException, CoreException {
* @bug 329663:[type hierarchy] Interfaces duplicated in type hierarchy on two packages from multiple projects
* @test that when two selected regions contains interfaces with same name but different, they are reported individually
* in the hierarchy.
- *
+ *
* @throws JavaModelException
* @throws CoreException
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=329663"
@@ -2531,10 +2531,10 @@ try {
region.add(p2);
ITypeHierarchy hierarchy = JavaCore.newTypeHierarchy(region, null, null);
IType[] types = hierarchy.getRootInterfaces();
- assertTypesEqual("Unexpected super interfaces",
- "java.io.Serializable\n" +
- "p.I\n" +
- "q.I\n",
+ assertTypesEqual("Unexpected super interfaces",
+ "java.io.Serializable\n" +
+ "p.I\n" +
+ "q.I\n",
types);
}
finally{
@@ -2550,31 +2550,31 @@ public void testBug300576() throws CoreException {
prj = createJavaProject("Bug300576", new String[] {"src"}, new String[] {"JCL_LIB"}, "bin", "1.5");
createFolder("/Bug300576/src/p");
createFile("/Bug300576/src/p/Outer.java",
- "package p;\n" +
- "class Outer {\n" +
- " enum A {\n" +
+ "package p;\n" +
+ "class Outer {\n" +
+ " enum A {\n" +
" GREEN, DARK_GREEN, BLACK;\n" +
- " /** Javadoc of getNext() */\n" +
- " A getNext() {\n" +
- " switch (this) {\n" +
- " case GREEN : return DARK_GREEN;\n" +
- " case DARK_GREEN : return BLACK;\n" +
- " case BLACK : return GREEN;\n" +
- " default : return null;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " {\n" +
- " A a= A.GREEN.getNext();\n" +
- " }\n" +
+ " /** Javadoc of getNext() */\n" +
+ " A getNext() {\n" +
+ " switch (this) {\n" +
+ " case GREEN : return DARK_GREEN;\n" +
+ " case DARK_GREEN : return BLACK;\n" +
+ " case BLACK : return GREEN;\n" +
+ " default : return null;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " {\n" +
+ " A a= A.GREEN.getNext();\n" +
+ " }\n" +
"}\n");
IType a = getCompilationUnit("Bug300576", "src", "p", "Outer.java").getType("Outer").getType("A");
IRegion region = JavaCore.newRegion();
region.add(getPackageFragmentRoot("Bug300576", "src"));
ITypeHierarchy hierarchy = prj.newTypeHierarchy(a, region, new NullProgressMonitor());
assertHierarchyEquals(
- "Focus: A [in Outer [in Outer.java [in p [in src [in Bug300576]]]]]\n" +
- "Super types:\n" +
+ "Focus: A [in Outer [in Outer.java [in p [in src [in Bug300576]]]]]\n" +
+ "Super types:\n" +
"Sub types:\n",
hierarchy);
} finally {
@@ -2594,37 +2594,37 @@ public void testBug300576b() throws CoreException {
"package java.lang;\n" +
"public class Enum {}\n");
createFile("/Bug300576/src/p/Outer.java",
- "package p;\n" +
- "class Outer {\n" +
- " enum A {\n" +
+ "package p;\n" +
+ "class Outer {\n" +
+ " enum A {\n" +
" GREEN, DARK_GREEN, BLACK;\n" +
- " /** Javadoc of getNext() */\n" +
- " A getNext() {\n" +
- " switch (this) {\n" +
- " case GREEN : return DARK_GREEN;\n" +
- " case DARK_GREEN : return BLACK;\n" +
- " case BLACK : return GREEN;\n" +
- " default : return null;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " {\n" +
- " A a= A.GREEN.getNext();\n" +
- " }\n" +
+ " /** Javadoc of getNext() */\n" +
+ " A getNext() {\n" +
+ " switch (this) {\n" +
+ " case GREEN : return DARK_GREEN;\n" +
+ " case DARK_GREEN : return BLACK;\n" +
+ " case BLACK : return GREEN;\n" +
+ " default : return null;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " {\n" +
+ " A a= A.GREEN.getNext();\n" +
+ " }\n" +
"}\n");
IType a = getCompilationUnit("Bug300576", "src", "p", "Outer.java").getType("Outer").getType("A");
IRegion region = JavaCore.newRegion();
region.add(getPackageFragmentRoot("Bug300576", "src"));
ITypeHierarchy hierarchy = prj.newTypeHierarchy(a, region, new NullProgressMonitor());
assertHierarchyEquals(
- "Focus: A [in Outer [in Outer.java [in p [in src [in Bug300576]]]]]\n" +
- "Super types:\n" +
+ "Focus: A [in Outer [in Outer.java [in p [in src [in Bug300576]]]]]\n" +
+ "Super types:\n" +
"Sub types:\n",
hierarchy);
} finally {
if (prj != null)
deleteProject(prj);
- }
+ }
}
//Bug 393192 -- Incomplete type hierarchy with > 10 annotations
public void testBug393192() throws CoreException {
@@ -2633,78 +2633,78 @@ public void testBug393192() throws CoreException {
prj = createJavaProject("Bug393192", new String[] {"src"}, new String[] {"JCL_LIB"}, "bin", "1.5");
createFolder("/Bug393192/src/pullup");
createFile("/Bug393192/src/pullup/A.java",
- "package pullup;\n" +
- "\n" +
- "class A {\n" +
- " @Deprecated\n" +
- " void m0() {\n" +
- " }\n" +
- "\n" +
- " @Deprecated\n" +
- " void m1() {\n" +
- " }\n" +
- "\n" +
- " @Deprecated\n" +
- " void m2() {\n" +
- " }\n" +
- "\n" +
- " @Deprecated\n" +
- " void m3() {\n" +
- " }\n" +
- "\n" +
- " @Deprecated\n" +
- " void m4() {\n" +
- " }\n" +
- "\n" +
- " @Deprecated\n" +
- " void m5() {\n" +
- " }\n" +
- "\n" +
- " @Deprecated\n" +
- " void m6() {\n" +
- " }\n" +
- "\n" +
- " @Deprecated\n" +
- " void m7() {\n" +
- " }\n" +
- "\n" +
- " @Deprecated\n" +
- " void m8() {\n" +
- " }\n" +
- "\n" +
- " @Deprecated\n" +
- " void m9() {\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * @param\n" +
- " */\n" +
- " @Deprecated\n" +
- " void m10() {\n" +
- " }\n" +
- "}\n" +
+ "package pullup;\n" +
+ "\n" +
+ "class A {\n" +
+ " @Deprecated\n" +
+ " void m0() {\n" +
+ " }\n" +
+ "\n" +
+ " @Deprecated\n" +
+ " void m1() {\n" +
+ " }\n" +
+ "\n" +
+ " @Deprecated\n" +
+ " void m2() {\n" +
+ " }\n" +
+ "\n" +
+ " @Deprecated\n" +
+ " void m3() {\n" +
+ " }\n" +
+ "\n" +
+ " @Deprecated\n" +
+ " void m4() {\n" +
+ " }\n" +
+ "\n" +
+ " @Deprecated\n" +
+ " void m5() {\n" +
+ " }\n" +
+ "\n" +
+ " @Deprecated\n" +
+ " void m6() {\n" +
+ " }\n" +
+ "\n" +
+ " @Deprecated\n" +
+ " void m7() {\n" +
+ " }\n" +
+ "\n" +
+ " @Deprecated\n" +
+ " void m8() {\n" +
+ " }\n" +
+ "\n" +
+ " @Deprecated\n" +
+ " void m9() {\n" +
+ " }\n" +
+ "\n" +
+ " /**\n" +
+ " * @param\n" +
+ " */\n" +
+ " @Deprecated\n" +
+ " void m10() {\n" +
+ " }\n" +
+ "}\n" +
"\n");
createFile("/Bug393192/src/pullup/package-info.java",
- "package pullup;\n" +
+ "package pullup;\n" +
"\n");
createFile("/Bug393192/src/pullup/PullUpBug.java",
- "package pullup;\n" +
- "\n" +
- "class PullUpBug extends A {\n" +
- "\n" +
- " void mb() {\n" +
- " pullUp();\n" +
- " }\n" +
- "\n" +
- " // INVOKE Pull Up REFACTORING ON \"pullUp\", or type Hierarchy on A\n" +
- " private void pullUp() {\n" +
- " }\n" +
+ "package pullup;\n" +
+ "\n" +
+ "class PullUpBug extends A {\n" +
+ "\n" +
+ " void mb() {\n" +
+ " pullUp();\n" +
+ " }\n" +
+ "\n" +
+ " // INVOKE Pull Up REFACTORING ON \"pullUp\", or type Hierarchy on A\n" +
+ " private void pullUp() {\n" +
+ " }\n" +
"}\n");
IType a = getCompilationUnit("Bug393192", "src", "pullup", "A.java").getType("A");
ITypeHierarchy hierarchy = a.newTypeHierarchy(new NullProgressMonitor());
assertHierarchyEquals(
- "Focus: A [in A.java [in pullup [in src [in Bug393192]]]]\n" +
- "Super types:\n" +
+ "Focus: A [in A.java [in pullup [in src [in Bug393192]]]]\n" +
+ "Super types:\n" +
" Object [in Object.class [in java.lang [in "+ getExternalJCLPathString() + "]]]\n" +
"Sub types:\n" +
" PullUpBug [in PullUpBug.java [in pullup [in src [in Bug393192]]]]\n",
@@ -2712,7 +2712,7 @@ public void testBug393192() throws CoreException {
} finally {
if (prj != null)
deleteProject(prj);
- }
+ }
}
public void testBug436155() throws CoreException, IOException {
try {
@@ -2729,7 +2729,7 @@ public void testBug436155() throws CoreException, IOException {
"package p;\n"+
"public class Text extends I2 {}",
}, "1.4");
-
+
createFolder("/P/src/q");
String source = "package q;\n" +
"import p.Text;\n" +
@@ -2737,7 +2737,7 @@ public void testBug436155() throws CoreException, IOException {
" Text text = null;\n" +
"}\n";
createFile("/P/src/q/A.java", source);
-
+
int start = source.lastIndexOf("Text");
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy("P/src/q/A.java", source);
@@ -2746,11 +2746,11 @@ public void testBug436155() throws CoreException, IOException {
IType focus = (IType) elements[0];
ITypeHierarchy hierarchy = focus.newTypeHierarchy(null);
assertHierarchyEquals(
- "Focus: Text [in Text.class [in p [in lib.jar [in P]]]]\n" +
- "Super types:\n" +
- " I2 [in I2.class [in p [in lib.jar [in P]]]]\n" +
- " I [in I.class [in p [in lib.jar [in P]]]]\n" +
- " Object [in Object.class [in java.lang [in "+ getExternalJCLPathString() + "]]]\n" +
+ "Focus: Text [in Text.class [in p [in lib.jar [in P]]]]\n" +
+ "Super types:\n" +
+ " I2 [in I2.class [in p [in lib.jar [in P]]]]\n" +
+ " I [in I.class [in p [in lib.jar [in P]]]]\n" +
+ " Object [in Object.class [in java.lang [in "+ getExternalJCLPathString() + "]]]\n" +
"Sub types:\n",
hierarchy);
} finally {
@@ -2770,7 +2770,7 @@ public void testBug436139() throws CoreException, IOException {
createFile("/Bug436139/src/p1/A.java", "package p1;\n" +"public class A<T> {}");
createFile("/Bug436139/src/p1/B.java", "package p1;\n" +"public class B {}");
-
+
createFolder("/Bug436139/src/p2");
String source = "package p2;\n" +
"import p1.*;\n" +
@@ -2804,10 +2804,10 @@ public void testBug436139() throws CoreException, IOException {
IType focus = (IType) elements[0];
ITypeHierarchy hierarchy = focus.newTypeHierarchy(null);
assertHierarchyEquals(
- "Focus: I [in [Working copy] I.java [in p1 [in src [in Bug436139]]]]\n" +
- "Super types:\n" +
- "Sub types:\n" +
- " <anonymous #1> [in patternChanged(A<B>) [in X [in X.java [in p2 [in src [in Bug436139]]]]]]\n" +
+ "Focus: I [in [Working copy] I.java [in p1 [in src [in Bug436139]]]]\n" +
+ "Super types:\n" +
+ "Sub types:\n" +
+ " <anonymous #1> [in patternChanged(A<B>) [in X [in X.java [in p2 [in src [in Bug436139]]]]]]\n" +
" <anonymous #1> [in someOtherMethod() [in X [in X.java [in p2 [in src [in Bug436139]]]]]]\n" +
" <lambda #1> [in someOtherMethod() [in X [in X.java [in p2 [in src [in Bug436139]]]]]]\n",
hierarchy);
@@ -2929,7 +2929,7 @@ public void testBug462158() throws CoreException, IOException {
}
}
public void testBug507954_0001() throws JavaModelException, CoreException {
- IJavaProject javaProject = null;
+ IJavaProject javaProject = null;
try {
String projectName = "507954";
javaProject = createJavaProject(projectName, new String[] {"src"}, new String[] {"JCL15_LIB"}, "bin", "1.5");
@@ -2999,7 +2999,7 @@ public void testBug507954_0001() throws JavaModelException, CoreException {
"}\n";
createFile(packA + "D.java", fileD);
-
+
String classA = "A";
int start = fileA.indexOf(classA);
this.workingCopies = new ICompilationUnit[1];
@@ -3011,8 +3011,8 @@ public void testBug507954_0001() throws JavaModelException, CoreException {
ITypeHierarchy hierarchy = focus.newTypeHierarchy(this.workingCopies, null);
IType[] allSubTypes = hierarchy.getAllSubtypes(focus);
assertTypesEqual("Incorrect hierarchy",
- "a.B$1\n" +
- "a.D$1$1\n" +
+ "a.B$1\n" +
+ "a.D$1$1\n" +
"a.D$1$2\n",
allSubTypes,
true);
@@ -3024,8 +3024,8 @@ public void testBug507954_0001() throws JavaModelException, CoreException {
public void testBug533949() throws CoreException {
if (!isJRE9) return;
- IJavaProject javaProject1 = null;
- IJavaProject javaProject2 = null;
+ IJavaProject javaProject1 = null;
+ IJavaProject javaProject2 = null;
try {
javaProject1 = createJava9Project("mod1");
String packA = "/mod1/src/a/";
@@ -3038,7 +3038,7 @@ public void testBug533949() throws CoreException {
"module mod1 {\n" +
" exports a;\n"+
"}\n");
-
+
javaProject2 = createJava9Project("mod2");
addClasspathEntry(javaProject2, JavaCore.newProjectEntry(javaProject1.getPath()));
String packB = "/mod2/src/b/";
@@ -3051,7 +3051,7 @@ public void testBug533949() throws CoreException {
"module mod2 {\n" +
" requires mod1;\n"+
"}\n");
-
+
waitUntilIndexesReady();
this.workingCopies = new ICompilationUnit[1];
@@ -3065,7 +3065,7 @@ public void testBug533949() throws CoreException {
"java.lang.Object\n",
allSuperTypes,
true);
-
+
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(packA + "A.java", true);
@@ -3117,7 +3117,7 @@ public void testBug425111() throws Exception {
try {
javaProject1 = createJavaProject("P1", new String[] {"src"}, new String[] {"JCL18_FULL", "/P1/lib.jar"},"bin", "1.8");
- createLibrary(javaProject1, "lib.jar", "lib-src.zip",
+ createLibrary(javaProject1, "lib.jar", "lib-src.zip",
new String[] {
"javax/tools/JavaFileManager.java",
"package javax.tools;\n" +
@@ -3145,121 +3145,121 @@ public void testBug425111() throws Exception {
ITypeHierarchy hierarchy = focus.newTypeHierarchy(null);
IType[] allSubTypes = hierarchy.getAllSubtypes(focus);
assertTypesEqual("Incorrect sub hierarchy",
- "java.io.BufferedInputStream\n" +
- "java.io.BufferedOutputStream\n" +
- "java.io.BufferedReader\n" +
- "java.io.BufferedWriter\n" +
- "java.io.ByteArrayInputStream\n" +
- "java.io.ByteArrayOutputStream\n" +
- "java.io.CharArrayReader\n" +
- "java.io.CharArrayWriter\n" +
- "java.io.Closeable\n" +
- "java.io.DataInputStream\n" +
- "java.io.DataOutputStream\n" +
- "java.io.FileInputStream\n" +
- "java.io.FileOutputStream\n" +
- "java.io.FileReader\n" +
- "java.io.FileWriter\n" +
- "java.io.FilterInputStream\n" +
- "java.io.FilterOutputStream\n" +
- "java.io.FilterReader\n" +
- "java.io.FilterWriter\n" +
- "java.io.InputStream\n" +
- "java.io.InputStreamReader\n" +
- "java.io.LineNumberInputStream\n" +
- "java.io.LineNumberReader\n" +
- "java.io.ObjectInput\n" +
- "java.io.ObjectInputStream\n" +
- "java.io.ObjectOutput\n" +
- "java.io.ObjectOutputStream\n" +
- "java.io.OutputStream\n" +
- "java.io.OutputStreamWriter\n" +
- "java.io.PipedInputStream\n" +
- "java.io.PipedOutputStream\n" +
- "java.io.PipedReader\n" +
- "java.io.PipedWriter\n" +
- "java.io.PrintStream\n" +
- "java.io.PrintWriter\n" +
- "java.io.PushbackInputStream\n" +
- "java.io.PushbackReader\n" +
- "java.io.RandomAccessFile\n" +
- "java.io.Reader\n" +
- "java.io.SequenceInputStream\n" +
- "java.io.StringBufferInputStream\n" +
- "java.io.StringReader\n" +
- "java.io.StringWriter\n" +
- "java.io.Writer\n" +
- "java.net.DatagramSocket\n" +
- "java.net.FactoryURLClassLoader\n" +
- "java.net.MulticastSocket\n" +
- "java.net.ServerSocket\n" +
- "java.net.Socket\n" +
- "java.net.SocketInputStream\n" +
- "java.net.SocketOutputStream\n" +
- "java.net.URLClassLoader\n" +
- "java.nio.channels.AsynchronousByteChannel\n" +
- "java.nio.channels.AsynchronousChannel\n" +
- "java.nio.channels.AsynchronousFileChannel\n" +
- "java.nio.channels.AsynchronousServerSocketChannel\n" +
- "java.nio.channels.AsynchronousSocketChannel\n" +
- "java.nio.channels.ByteChannel\n" +
- "java.nio.channels.Channel\n" +
- "java.nio.channels.DatagramChannel\n" +
- "java.nio.channels.FileChannel\n" +
- "java.nio.channels.FileLock\n" +
- "java.nio.channels.GatheringByteChannel\n" +
- "java.nio.channels.InterruptibleChannel\n" +
- "java.nio.channels.MulticastChannel\n" +
- "java.nio.channels.NetworkChannel\n" +
- "java.nio.channels.Pipe$SinkChannel\n" +
- "java.nio.channels.Pipe$SourceChannel\n" +
- "java.nio.channels.ReadableByteChannel\n" +
- "java.nio.channels.ScatteringByteChannel\n" +
- "java.nio.channels.SeekableByteChannel\n" +
- "java.nio.channels.SelectableChannel\n" +
- "java.nio.channels.Selector\n" +
- "java.nio.channels.ServerSocketChannel\n" +
- "java.nio.channels.SocketChannel\n" +
- "java.nio.channels.WritableByteChannel\n" +
- "java.nio.channels.spi.AbstractInterruptibleChannel\n" +
- "java.nio.channels.spi.AbstractSelectableChannel\n" +
- "java.nio.channels.spi.AbstractSelector\n" +
- "java.nio.file.WatchService\n" +
- "java.security.DigestInputStream\n" +
- "java.security.DigestOutputStream\n" +
- "java.sql.CallableStatement\n" +
- "java.sql.Connection\n" +
- "java.sql.PreparedStatement\n" +
- "java.sql.ResultSet\n" +
- "java.sql.Statement\n" +
- "java.util.Formatter\n" +
- "java.util.Scanner\n" +
- "java.util.jar.JarFile\n" +
- "java.util.jar.JarInputStream\n" +
- "java.util.jar.JarOutputStream\n" +
- "java.util.stream.AbstractPipeline\n" +
- "java.util.stream.BaseStream\n" +
- "java.util.stream.DoublePipeline\n" +
- "java.util.stream.DoubleStream\n" +
- "java.util.stream.IntPipeline\n" +
- "java.util.stream.IntStream\n" +
- "java.util.stream.LongPipeline\n" +
- "java.util.stream.LongStream\n" +
- "java.util.stream.ReferencePipeline\n" +
- "java.util.stream.Stream\n" +
- "java.util.zip.CheckedInputStream\n" +
- "java.util.zip.CheckedOutputStream\n" +
- "java.util.zip.DeflaterInputStream\n" +
- "java.util.zip.DeflaterOutputStream\n" +
- "java.util.zip.GZIPInputStream\n" +
- "java.util.zip.GZIPOutputStream\n" +
- "java.util.zip.InflaterInputStream\n" +
- "java.util.zip.InflaterOutputStream\n" +
- "java.util.zip.ZipFile\n" +
- "java.util.zip.ZipInputStream\n" +
- "java.util.zip.ZipOutputStream\n" +
- "javax.tools.ForwardingJavaFileManager\n" +
- "javax.tools.JavaFileManager\n" +
+ "java.io.BufferedInputStream\n" +
+ "java.io.BufferedOutputStream\n" +
+ "java.io.BufferedReader\n" +
+ "java.io.BufferedWriter\n" +
+ "java.io.ByteArrayInputStream\n" +
+ "java.io.ByteArrayOutputStream\n" +
+ "java.io.CharArrayReader\n" +
+ "java.io.CharArrayWriter\n" +
+ "java.io.Closeable\n" +
+ "java.io.DataInputStream\n" +
+ "java.io.DataOutputStream\n" +
+ "java.io.FileInputStream\n" +
+ "java.io.FileOutputStream\n" +
+ "java.io.FileReader\n" +
+ "java.io.FileWriter\n" +
+ "java.io.FilterInputStream\n" +
+ "java.io.FilterOutputStream\n" +
+ "java.io.FilterReader\n" +
+ "java.io.FilterWriter\n" +
+ "java.io.InputStream\n" +
+ "java.io.InputStreamReader\n" +
+ "java.io.LineNumberInputStream\n" +
+ "java.io.LineNumberReader\n" +
+ "java.io.ObjectInput\n" +
+ "java.io.ObjectInputStream\n" +
+ "java.io.ObjectOutput\n" +
+ "java.io.ObjectOutputStream\n" +
+ "java.io.OutputStream\n" +
+ "java.io.OutputStreamWriter\n" +
+ "java.io.PipedInputStream\n" +
+ "java.io.PipedOutputStream\n" +
+ "java.io.PipedReader\n" +
+ "java.io.PipedWriter\n" +
+ "java.io.PrintStream\n" +
+ "java.io.PrintWriter\n" +
+ "java.io.PushbackInputStream\n" +
+ "java.io.PushbackReader\n" +
+ "java.io.RandomAccessFile\n" +
+ "java.io.Reader\n" +
+ "java.io.SequenceInputStream\n" +
+ "java.io.StringBufferInputStream\n" +
+ "java.io.StringReader\n" +
+ "java.io.StringWriter\n" +
+ "java.io.Writer\n" +
+ "java.net.DatagramSocket\n" +
+ "java.net.FactoryURLClassLoader\n" +
+ "java.net.MulticastSocket\n" +
+ "java.net.ServerSocket\n" +
+ "java.net.Socket\n" +
+ "java.net.SocketInputStream\n" +
+ "java.net.SocketOutputStream\n" +
+ "java.net.URLClassLoader\n" +
+ "java.nio.channels.AsynchronousByteChannel\n" +
+ "java.nio.channels.AsynchronousChannel\n" +
+ "java.nio.channels.AsynchronousFileChannel\n" +
+ "java.nio.channels.AsynchronousServerSocketChannel\n" +
+ "java.nio.channels.AsynchronousSocketChannel\n" +
+ "java.nio.channels.ByteChannel\n" +
+ "java.nio.channels.Channel\n" +
+ "java.nio.channels.DatagramChannel\n" +
+ "java.nio.channels.FileChannel\n" +
+ "java.nio.channels.FileLock\n" +
+ "java.nio.channels.GatheringByteChannel\n" +
+ "java.nio.channels.InterruptibleChannel\n" +
+ "java.nio.channels.MulticastChannel\n" +
+ "java.nio.channels.NetworkChannel\n" +
+ "java.nio.channels.Pipe$SinkChannel\n" +
+ "java.nio.channels.Pipe$SourceChannel\n" +
+ "java.nio.channels.ReadableByteChannel\n" +
+ "java.nio.channels.ScatteringByteChannel\n" +
+ "java.nio.channels.SeekableByteChannel\n" +
+ "java.nio.channels.SelectableChannel\n" +
+ "java.nio.channels.Selector\n" +
+ "java.nio.channels.ServerSocketChannel\n" +
+ "java.nio.channels.SocketChannel\n" +
+ "java.nio.channels.WritableByteChannel\n" +
+ "java.nio.channels.spi.AbstractInterruptibleChannel\n" +
+ "java.nio.channels.spi.AbstractSelectableChannel\n" +
+ "java.nio.channels.spi.AbstractSelector\n" +
+ "java.nio.file.WatchService\n" +
+ "java.security.DigestInputStream\n" +
+ "java.security.DigestOutputStream\n" +
+ "java.sql.CallableStatement\n" +
+ "java.sql.Connection\n" +
+ "java.sql.PreparedStatement\n" +
+ "java.sql.ResultSet\n" +
+ "java.sql.Statement\n" +
+ "java.util.Formatter\n" +
+ "java.util.Scanner\n" +
+ "java.util.jar.JarFile\n" +
+ "java.util.jar.JarInputStream\n" +
+ "java.util.jar.JarOutputStream\n" +
+ "java.util.stream.AbstractPipeline\n" +
+ "java.util.stream.BaseStream\n" +
+ "java.util.stream.DoublePipeline\n" +
+ "java.util.stream.DoubleStream\n" +
+ "java.util.stream.IntPipeline\n" +
+ "java.util.stream.IntStream\n" +
+ "java.util.stream.LongPipeline\n" +
+ "java.util.stream.LongStream\n" +
+ "java.util.stream.ReferencePipeline\n" +
+ "java.util.stream.Stream\n" +
+ "java.util.zip.CheckedInputStream\n" +
+ "java.util.zip.CheckedOutputStream\n" +
+ "java.util.zip.DeflaterInputStream\n" +
+ "java.util.zip.DeflaterOutputStream\n" +
+ "java.util.zip.GZIPInputStream\n" +
+ "java.util.zip.GZIPOutputStream\n" +
+ "java.util.zip.InflaterInputStream\n" +
+ "java.util.zip.InflaterOutputStream\n" +
+ "java.util.zip.ZipFile\n" +
+ "java.util.zip.ZipInputStream\n" +
+ "java.util.zip.ZipOutputStream\n" +
+ "javax.tools.ForwardingJavaFileManager\n" +
+ "javax.tools.JavaFileManager\n" +
"p1.T$1\n",
allSubTypes,
true);
@@ -3285,22 +3285,22 @@ public void testBug559210() throws CoreException {
"/P/src/p/ReferenceInputStream.java",
"pakage p;\n" +
"public class ReferenceInputStream extends java.io.InputStream {\n" +
- " private final File reference;\n" +
- "\n" +
- " public ReferenceInputStream(File reference) {\n" +
- " this.reference = reference;\n" +
- " }\n" +
- "\n" +
- " /* This method should not be called.\n" +
- " */\n" +
- " @Override\n" +
- " public int read() throws IOException {\n" +
- " throw new IOException();\n" +
- " }\n" +
- "\n" +
- " public File getReference() {\n" +
- " return reference;\n" +
- " }\n" +
+ " private final File reference;\n" +
+ "\n" +
+ " public ReferenceInputStream(File reference) {\n" +
+ " this.reference = reference;\n" +
+ " }\n" +
+ "\n" +
+ " /* This method should not be called.\n" +
+ " */\n" +
+ " @Override\n" +
+ " public int read() throws IOException {\n" +
+ " throw new IOException();\n" +
+ " }\n" +
+ "\n" +
+ " public File getReference() {\n" +
+ " return reference;\n" +
+ " }\n" +
"}"
);
createFile(
@@ -3308,17 +3308,17 @@ public void testBug559210() throws CoreException {
"pakage p;\n" +
"import p.ReferenceInputStream;\n" +
"public class Storage {\n" +
- "\n" +
- " public ReferenceInputStream stream;\n" +
+ "\n" +
+ " public ReferenceInputStream stream;\n" +
"}"
);
getProject("P").build(IncrementalProjectBuilder.FULL_BUILD, null);
waitForAutoBuild();
ITypeHierarchy hierarchy = getCompilationUnit("/P/src/p/Storage.java").getTypes()[0].newSupertypeHierarchy(null);
assertHierarchyEquals(
- "Focus: Storage [in Storage.java [in p [in src [in P]]]]\n" +
- "Super types:\n" +
- " Object [in Object.class [in java.lang [in "+ getExternalJCLPathString() + "]]]\n" +
+ "Focus: Storage [in Storage.java [in p [in src [in P]]]]\n" +
+ "Super types:\n" +
+ " Object [in Object.class [in java.lang [in "+ getExternalJCLPathString() + "]]]\n" +
"Sub types:\n",
hierarchy);
} finally {
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeResolveTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeResolveTests.java
index 823eb1e36..fb62dece9 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeResolveTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeResolveTests.java
@@ -352,15 +352,15 @@ public void testParamAnnotations() throws CoreException {
source
);
waitForAutoBuild();
-
- ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
+
+ ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
IJavaElement[] variable = ((ICodeAssist) unit).codeSelect(source.indexOf("processor"), "processor".length());
assertEquals(1, variable.length);
String annotationString = "@Default [in processor [in Test(String) [in X [in X.java [in p [in src [in P]]]]]]]";
assertEquals(annotationString, ((LocalVariable)variable[0]).getAnnotations()[0].toString());
IType type = unit.getType("X");
-
+
IMethod method = type.getMethods()[0];
assertEquals(annotationString, method.getParameters()[0].getAnnotations()[0].toString());
} finally {
@@ -385,12 +385,12 @@ public void testParamAnnotations2() throws CoreException, IOException {
"@interface Default{\n" +
"}"};
addLibrary(project, "lib334783.jar", "libsrc.zip", pathAndContents, JavaCore.VERSION_1_5);
-
+
waitForAutoBuild();
IPackageFragmentRoot root = project.getPackageFragmentRoot(getFile("/P/lib334783.jar"));
IType type = root.getPackageFragment("p").getOrdinaryClassFile("X.class").getType();
String annotationString = "@p.Default [in processor [in Test(java.lang.String) [in X [in X.class [in p [in lib334783.jar [in P]]]]]]]";
-
+
IMethod method = type.getMethods()[1];
assertEquals(annotationString, method.getParameters()[0].getAnnotations()[0].toString());
} finally {
@@ -422,8 +422,8 @@ public void testParamAnnotations3() throws CoreException {
source
);
waitForAutoBuild();
-
- ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
+
+ ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
IJavaElement[] variable = ((ICodeAssist) unit).codeSelect(source.indexOf("processor"), "processor".length());
assertEquals(1, variable.length);
@@ -431,7 +431,7 @@ public void testParamAnnotations3() throws CoreException {
String annotationString2 = "@Marker [in processor [in Test(int, String, int) [in X [in X.java [in p [in src [in P]]]]]]]";
assertEquals(annotationString1, ((LocalVariable)variable[0]).getAnnotations()[0].toString());
IType type = unit.getType("X");
-
+
IMethod method = type.getMethods()[0];
IAnnotation[] parameterAnnotations = method.getParameters()[1].getAnnotations();
assertEquals("Wrong length", 2, parameterAnnotations.length);
@@ -480,7 +480,7 @@ public void testParamAnnotations4() throws CoreException, IOException {
"public @interface Default{\n" +
"}"};
addLibrary(project, "lib334783_2.jar", "lib334783_2src.zip", pathAndContents, JavaCore.VERSION_1_5);
-
+
waitForAutoBuild();
IPackageFragmentRoot root = project.getPackageFragmentRoot(getFile("/P/lib334783_2.jar"));
IType type = root.getPackageFragment("p").getOrdinaryClassFile("X.class").getType();
@@ -555,7 +555,7 @@ public void testParamAnnotations5() throws CoreException, IOException {
Map options = new HashMap();
options.put(JavaCore.COMPILER_LOCAL_VARIABLE_ATTR, JavaCore.DO_NOT_GENERATE);
addLibrary(project, "lib334783_3.jar", "lib334783_3src.zip", pathAndContents, JavaCore.VERSION_1_5, options);
-
+
waitForAutoBuild();
IPackageFragmentRoot root = project.getPackageFragmentRoot(getFile("/P/lib334783_3.jar"));
IType type = root.getPackageFragment("p").getOrdinaryClassFile("X.class").getType();
@@ -609,8 +609,8 @@ public void testParamAnnotations6() throws CoreException {
source
);
waitForAutoBuild();
-
- ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
+
+ ICompilationUnit unit = getCompilationUnit("/P/src/p/X.java");
IType type = unit.getType("X");
IMethod method = type.getMethods()[0];
ILocalVariable[] localVariables = method.getParameters();
@@ -634,11 +634,11 @@ public void testParamAnnotations7() throws CoreException, IOException {
"}"
};
addLibrary(project, "lib334783.jar", "libsrc.zip", pathAndContents, JavaCore.VERSION_1_5);
-
+
waitForAutoBuild();
IPackageFragmentRoot root = project.getPackageFragmentRoot(getFile("/P/lib334783.jar"));
IType type = root.getPackageFragment("p").getOrdinaryClassFile("X.class").getType();
-
+
IMethod method = type.getMethods()[1];
ILocalVariable[] localVariables = method.getParameters();
assertNotNull(localVariables);
@@ -676,7 +676,7 @@ public void testParamAnnotations8() throws CoreException, IOException {
Map options = new HashMap();
options.put(JavaCore.COMPILER_LOCAL_VARIABLE_ATTR, JavaCore.DO_NOT_GENERATE);
addLibrary(project, "lib334783_3.jar", "lib334783_3src.zip", pathAndContents, JavaCore.VERSION_1_5, options);
-
+
waitForAutoBuild();
IPackageFragmentRoot root = project.getPackageFragmentRoot(getFile("/P/lib334783_3.jar"));
IType type = root.getPackageFragment("p").getOrdinaryClassFile("X.class").getType();
@@ -714,7 +714,7 @@ public void testParamAnnotations8() throws CoreException, IOException {
}
}
/**
- * @throws IOException
+ * @throws IOException
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=375568"
*/
public void testParamAnnotations9() throws CoreException, IOException {
@@ -730,12 +730,12 @@ public void testParamAnnotations9() throws CoreException, IOException {
"@interface Default{\n" +
"}"};
addLibrary(project, "lib334783.jar", "libsrc.zip", pathAndContents, JavaCore.VERSION_1_5);
-
+
waitForAutoBuild();
IPackageFragmentRoot root = project.getPackageFragmentRoot(getFile("/P/lib334783.jar"));
IType type = root.getPackageFragment("p").getOrdinaryClassFile("X.class").getType();
String annotationString = "@p.Default [in processor [in Test(java.lang.String) [in X [in X.class [in p [in lib334783.jar [in P]]]]]]]";
-
+
IMethod method = type.getMethods()[1];
assertEquals(1, method.getParameters()[0].getAnnotations().length);
assertEquals(annotationString, method.getParameters()[0].getAnnotations()[0].toString());
@@ -1225,7 +1225,7 @@ public void test531046a() throws CoreException, IOException {
try {
createJava10Project("P", new String[] {"src"});
String source = "package p;\n"
- + "public class X {\n"
+ + "public class X {\n"
+ " public static void main(java.lang.String[] args) {\n"
+ " var s1 = args[0];\n"
+ " System.out.println(s1);\n"
@@ -1251,7 +1251,7 @@ public void test531046b() throws CoreException, IOException {
try {
createJava10Project("P", new String[] {"src"});
String source = "package p;\n"
- + "public class X {\n"
+ + "public class X {\n"
+ " public static void main(java.lang.String[] args) {\n"
+ " var s1 = args[0];\n"
+ " System.out.println(s1);\n"
@@ -1277,7 +1277,7 @@ public void test531046c() throws CoreException, IOException {
try {
createJava10Project("P", new String[] {"src"});
String source = "package p;\n"
- + "public class X {\n"
+ + "public class X {\n"
+ " public static void main(java.lang.String[] args) {\n"
+ " var s1 = args;\n"
+ " System.out.println(s1);\n"
@@ -1303,7 +1303,7 @@ public void test531046d() throws CoreException, IOException {
try {
createJava10Project("P", new String[] {"src"});
String source = "package p;\n"
- + "public class X {\n"
+ + "public class X {\n"
+ " public static void main(java.lang.String[] args) {\n"
+ " var s1 = new java.util.HashMap<String, Object>();\n"
+ " }\n"
@@ -1328,7 +1328,7 @@ public void test531046e() throws CoreException, IOException {
try {
createJava10Project("P", new String[] {"src"});
String source = "package p;\n"
- + "public class X {\n"
+ + "public class X {\n"
+ " public static void main(java.lang.String[] args) {\n"
+ " var s1 = new java.util.HashMap<String, Object>();\n"
+ " }\n"
@@ -1352,7 +1352,7 @@ public void test531046f() throws CoreException, IOException {
try {
createJava10Project("P", new String[] {"src"});
String source = "package p;\n"
- + "public class X {\n"
+ + "public class X {\n"
+ " public static void main(java.lang.String[] args) {\n"
+ " var e = (CharSequence & Comparable<String>) \"x\";\n"
+ " }\n"
@@ -1378,7 +1378,7 @@ public void test531046g() throws CoreException, IOException {
try {
createJava10Project("P", new String[] {"src"});
String source = "package p;\n"
- + "public class X {\n"
+ + "public class X {\n"
+ " public static void main(java.lang.String[] args) {\n"
+ " var v_v = (CharSequence & Comparable<String>) \"x\";\n"
+ " }\n"
@@ -1402,7 +1402,7 @@ public void test531046h() throws CoreException, IOException {
try {
createJava10Project("P", new String[] {"src"});
String source = "package p;\n"
- + "public class X {\n"
+ + "public class X {\n"
+ " public static void main(java.lang.String[] args) {\n"
+ " var v_v = (CharSequence & Comparable<String>) \"x\";\n"
+ " System.out.println(v_v);\n"
@@ -1429,11 +1429,11 @@ public void testBug533884a() throws Exception {
String source = "package p;\n" +
"public class X {\n" +
" void bar() {\n" +
- " String[] x = {\"a\", \"b\"};\n" +
+ " String[] x = {\"a\", \"b\"};\n" +
" for (var y : x) { \n" + // <= select this occurrence of 'y'
- " System.err.println(y.toUpperCase());\n" +
- " }\n" +
- " }\n" +
+ " System.err.println(y.toUpperCase());\n" +
+ " }\n" +
+ " }\n" +
"\n"
+ "}\n";
createFolder("/P/src/p");
@@ -1457,11 +1457,11 @@ public void testBug533884b() throws Exception {
String source = "package p;\n" +
"public class X {\n" +
" void bar() {\n" +
- " String[] x = {\"a\", \"b\"};\n" +
- " for (var y : x) { \n" +
+ " String[] x = {\"a\", \"b\"};\n" +
+ " for (var y : x) { \n" +
" System.err.println(y.toUpperCase());\n" + // <= select this occurrence of 'y'
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"\n"
+ "}\n";
createFolder("/P/src/p");
@@ -1485,10 +1485,10 @@ public void testBug533884b_blockless() throws Exception {
String source = "package p;\n" +
"public class X {\n" +
" void bar() {\n" +
- " String[] x = {\"a\", \"b\"};\n" +
- " for (var y : x) \n" +
+ " String[] x = {\"a\", \"b\"};\n" +
+ " for (var y : x) \n" +
" System.err.println(y.toUpperCase());\n" + // <= select this occurrence of 'y'
- " }\n" +
+ " }\n" +
"\n"
+ "}\n";
createFolder("/P/src/p");
@@ -1512,10 +1512,10 @@ public void testBug533884c() throws Exception {
"import java.io.*;\n" +
"public class X {\n" +
" void bar(File file) {\n" +
- " try (var rc = new FileInputStream(file)) { \n" +
+ " try (var rc = new FileInputStream(file)) { \n" +
" System.err.println(rc.read());\n" + // <= select this occurrence of 'rc'
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"\n"
+ "}\n";
createFolder("/P/src/p");
@@ -1542,9 +1542,9 @@ public void testBug533884c_blockless() throws Exception {
"import java.io.*;\n" +
"public class X {\n" +
" void bar(File file) {\n" +
- " try (var rc = new FileInputStream(file))\n" +
+ " try (var rc = new FileInputStream(file))\n" +
" System.err.println(rc.read());\n" + // <= select this occurrence of 'rc'
- " }\n" +
+ " }\n" +
"\n"
+ "}\n";
createFolder("/P/src/p");
@@ -1576,10 +1576,10 @@ public void testBug536387() throws Exception {
" }\n\n"+
" public interface Finder {\n" +
" public int find(NewType one, int two);\n" +
- " }\n\n"+
+ " }\n\n"+
" public static void main(String[] args) {\n" +
- " final Finder finder = (var s1,var s2) -> s1.indexOf(s2);\n"+
- " }\n" +
+ " final Finder finder = (var s1,var s2) -> s1.indexOf(s2);\n"+
+ " }\n" +
"\n"
+ "}\n";
createFolder("/P/src/p");
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/WorkingCopyOwnerTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/WorkingCopyOwnerTests.java
index b3be0debd..6850eee9c 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/WorkingCopyOwnerTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/WorkingCopyOwnerTests.java
@@ -39,7 +39,7 @@ public class WorkingCopyOwnerTests extends ModifyingResourceTests {
* @deprecated
*/
/*package*/ static final int JLS3_INTERNAL = AST.JLS3;
-
+
ICompilationUnit workingCopy = null;
public class TestWorkingCopyOwner extends WorkingCopyOwner {
@@ -99,7 +99,7 @@ public class WorkingCopyOwnerTests extends ModifyingResourceTests {
CompilationUnit cu = (CompilationUnit) parser.createAST(null);
assertProblems("Unexpected problems", expectedProblems, cu.getProblems(), source.toCharArray());
}
-
+
protected void assertTypeBindingsEqual(String message, String expected, ITypeBinding[] types) {
StringBuffer buffer = new StringBuffer();
if (types == null) {
@@ -665,7 +665,7 @@ public class WorkingCopyOwnerTests extends ModifyingResourceTests {
"",
"/P/X.java",
"public class X extends to.be.Generated {\n" +
- "}",
+ "}",
owner);
}
@@ -684,14 +684,14 @@ public class WorkingCopyOwnerTests extends ModifyingResourceTests {
}
};
assertProblems(
- "1. ERROR in /P/X.java (at line 1)\n" +
- " public class X extends Y {\n" +
- " ^\n" +
- "Y cannot be resolved to a type\n" +
+ "1. ERROR in /P/X.java (at line 1)\n" +
+ " public class X extends Y {\n" +
+ " ^\n" +
+ "Y cannot be resolved to a type\n" +
"----------\n",
"/P/X.java",
"public class X extends Y {\n" +
- "}",
+ "}",
owner);
} finally {
deleteFile("/P/Y.java");
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/WorkingCopySearchTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/WorkingCopySearchTests.java
index d1c8c507e..d35f26994 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/WorkingCopySearchTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/WorkingCopySearchTests.java
@@ -471,12 +471,12 @@ public class WorkingCopySearchTests extends JavaSearchTests {
"p478042".toCharArray(), SearchPattern.R_EXACT_MATCH, //package
null, SearchPattern.R_EXACT_MATCH, // declaring Qualification
"AllMethod".toCharArray(), SearchPattern.R_PREFIX_MATCH, // declaring SimpleType
- "foo".toCharArray(), SearchPattern.R_PREFIX_MATCH,
- scope, requestor,
+ "foo".toCharArray(), SearchPattern.R_PREFIX_MATCH,
+ scope, requestor,
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, null);
assertSearchResults(
- "/JavaSearch/src/wc/X.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
- "/JavaSearch/src/wc/X.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
+ "/JavaSearch/src/wc/X.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
+ "/JavaSearch/src/wc/X.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
"/JavaSearch/src/wc/X.java void p478042.AllMethodDeclarations01.foo01()",
requestor
);
@@ -501,12 +501,12 @@ public class WorkingCopySearchTests extends JavaSearchTests {
"p478042".toCharArray(), SearchPattern.R_EXACT_MATCH, //package
"AllMethod".toCharArray(), SearchPattern.R_PREFIX_MATCH, // declaring Qualification
"Nested".toCharArray(), SearchPattern.R_EXACT_MATCH, // declaring SimpleType
- "foo".toCharArray(), SearchPattern.R_PREFIX_MATCH,
- scope, requestor,
+ "foo".toCharArray(), SearchPattern.R_PREFIX_MATCH,
+ scope, requestor,
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, null);
assertSearchResults(
- "/JavaSearch/src/wc/X.java char p478042.AllMethodDeclarations01.Nested.foo03(Object o,String s)\n" +
- "/JavaSearch/src/wc/X.java int p478042.AllMethodDeclarations01.Nested.foo02(Object o)\n" +
+ "/JavaSearch/src/wc/X.java char p478042.AllMethodDeclarations01.Nested.foo03(Object o,String s)\n" +
+ "/JavaSearch/src/wc/X.java int p478042.AllMethodDeclarations01.Nested.foo02(Object o)\n" +
"/JavaSearch/src/wc/X.java void p478042.AllMethodDeclarations01.Nested.foo01()",
requestor
);
@@ -533,12 +533,12 @@ public class WorkingCopySearchTests extends JavaSearchTests {
"p478042".toCharArray(), SearchPattern.R_EXACT_MATCH, //package
"AllMethod".toCharArray(), SearchPattern.R_PREFIX_MATCH, // declaring Qualification
"Inner".toCharArray(), SearchPattern.R_EXACT_MATCH, // declaring SimpleType
- "foo".toCharArray(), SearchPattern.R_PREFIX_MATCH,
- scope, requestor,
+ "foo".toCharArray(), SearchPattern.R_PREFIX_MATCH,
+ scope, requestor,
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, null);
assertSearchResults(
- "/JavaSearch/src/wc/X.java char p478042.AllMethodDeclarations01.Nested.Inner.foo03(Object o,String s)\n" +
- "/JavaSearch/src/wc/X.java int p478042.AllMethodDeclarations01.Nested.Inner.foo02(Object o)\n" +
+ "/JavaSearch/src/wc/X.java char p478042.AllMethodDeclarations01.Nested.Inner.foo03(Object o,String s)\n" +
+ "/JavaSearch/src/wc/X.java int p478042.AllMethodDeclarations01.Nested.Inner.foo02(Object o)\n" +
"/JavaSearch/src/wc/X.java void p478042.AllMethodDeclarations01.Nested.Inner.foo01()",
requestor
);
@@ -559,12 +559,12 @@ public class WorkingCopySearchTests extends JavaSearchTests {
SearchTests.SearchMethodNameRequestor requestor = new SearchTests.SearchMethodNameRequestor();
new SearchEngine(new ICompilationUnit[] {this.workingCopy}).searchAllMethodNames(
"p478042.AllMethod*".toCharArray(), SearchPattern.R_PATTERN_MATCH,
- "foo".toCharArray(), SearchPattern.R_PREFIX_MATCH,
- scope, requestor,
+ "foo".toCharArray(), SearchPattern.R_PREFIX_MATCH,
+ scope, requestor,
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, null);
assertSearchResults(
- "/JavaSearch/src/wc/X.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
- "/JavaSearch/src/wc/X.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
+ "/JavaSearch/src/wc/X.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
+ "/JavaSearch/src/wc/X.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
"/JavaSearch/src/wc/X.java void p478042.AllMethodDeclarations01.foo01()",
requestor
);
@@ -582,12 +582,12 @@ public class WorkingCopySearchTests extends JavaSearchTests {
SearchTests.SearchMethodNameRequestor requestor = new SearchTests.SearchMethodNameRequestor();
new SearchEngine(new ICompilationUnit[] {this.workingCopy}).searchAllMethodNames(
"p478042.AllMethod*".toCharArray(), SearchPattern.R_PATTERN_MATCH,
- "foo".toCharArray(), SearchPattern.R_PREFIX_MATCH,
- scope, requestor,
+ "foo".toCharArray(), SearchPattern.R_PREFIX_MATCH,
+ scope, requestor,
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, null);
assertSearchResults(
- "/JavaSearch/src/wc/X.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
- "/JavaSearch/src/wc/X.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
+ "/JavaSearch/src/wc/X.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
+ "/JavaSearch/src/wc/X.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
"/JavaSearch/src/wc/X.java void p478042.AllMethodDeclarations01.foo01()",
requestor
);
@@ -610,12 +610,12 @@ public class WorkingCopySearchTests extends JavaSearchTests {
SearchTests.SearchMethodNameRequestor requestor = new SearchTests.SearchMethodNameRequestor();
new SearchEngine(new ICompilationUnit[] {this.workingCopy}).searchAllMethodNames(
"p478042.AllMethod*.Nested".toCharArray(), SearchPattern.R_PATTERN_MATCH,
- "foo".toCharArray(), SearchPattern.R_PREFIX_MATCH,
- scope, requestor,
+ "foo".toCharArray(), SearchPattern.R_PREFIX_MATCH,
+ scope, requestor,
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, null);
assertSearchResults(
- "/JavaSearch/src/wc/X.java char p478042.AllMethodDeclarations01.Nested.foo03(Object o,String s)\n" +
- "/JavaSearch/src/wc/X.java int p478042.AllMethodDeclarations01.Nested.foo02(Object o)\n" +
+ "/JavaSearch/src/wc/X.java char p478042.AllMethodDeclarations01.Nested.foo03(Object o,String s)\n" +
+ "/JavaSearch/src/wc/X.java int p478042.AllMethodDeclarations01.Nested.foo02(Object o)\n" +
"/JavaSearch/src/wc/X.java void p478042.AllMethodDeclarations01.Nested.foo01()",
requestor
);
@@ -640,12 +640,12 @@ public class WorkingCopySearchTests extends JavaSearchTests {
SearchTests.SearchMethodNameRequestor requestor = new SearchTests.SearchMethodNameRequestor();
new SearchEngine(new ICompilationUnit[] {this.workingCopy}).searchAllMethodNames(
"p478042.AllMethod*.Inner".toCharArray(), SearchPattern.R_PATTERN_MATCH,
- "foo".toCharArray(), SearchPattern.R_PREFIX_MATCH,
- scope, requestor,
+ "foo".toCharArray(), SearchPattern.R_PREFIX_MATCH,
+ scope, requestor,
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, null);
assertSearchResults(
- "/JavaSearch/src/wc/X.java char p478042.AllMethodDeclarations01.Nested.Inner.foo03(Object o,String s)\n" +
- "/JavaSearch/src/wc/X.java int p478042.AllMethodDeclarations01.Nested.Inner.foo02(Object o)\n" +
+ "/JavaSearch/src/wc/X.java char p478042.AllMethodDeclarations01.Nested.Inner.foo03(Object o,String s)\n" +
+ "/JavaSearch/src/wc/X.java int p478042.AllMethodDeclarations01.Nested.Inner.foo02(Object o)\n" +
"/JavaSearch/src/wc/X.java void p478042.AllMethodDeclarations01.Nested.Inner.foo01()",
requestor
);
@@ -666,12 +666,12 @@ public class WorkingCopySearchTests extends JavaSearchTests {
SearchTests.SearchMethodNameRequestor requestor = new SearchTests.SearchMethodNameRequestor();
new SearchEngine(new ICompilationUnit[] {this.workingCopy}).searchAllMethodNames(
"p478042.AllMethod*".toCharArray(), SearchPattern.R_PATTERN_MATCH,
- "foo".toCharArray(), SearchPattern.R_PREFIX_MATCH,
- scope, requestor,
+ "foo".toCharArray(), SearchPattern.R_PREFIX_MATCH,
+ scope, requestor,
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, null);
assertSearchResults(
- "/JavaSearch/src/wc/X.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
- "/JavaSearch/src/wc/X.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
+ "/JavaSearch/src/wc/X.java char p478042.AllMethodDeclarations01.foo03(Object o,String s)\n" +
+ "/JavaSearch/src/wc/X.java int p478042.AllMethodDeclarations01.foo02(Object o)\n" +
"/JavaSearch/src/wc/X.java void p478042.AllMethodDeclarations01.foo01()",
requestor
);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/BTreeExpensiveTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/BTreeExpensiveTests.java
index 0e2b70e1a..b06dd4380 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/BTreeExpensiveTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/BTreeExpensiveTests.java
@@ -24,25 +24,25 @@ import junit.framework.Test;
* expensive and cpu hungry.
*/
public class BTreeExpensiveTests extends BTreeTests {
-
+
public static Test suite() {
return suite(BTreeExpensiveTests.class);
}
-
+
public void testBySortedSetMirror() throws Exception {
sortedMirrorTest(100);
}
-
+
// @Override
@Override
public void testInsertion() throws Exception {
super.testInsertion();
}
-
+
/*
* N.B. Each of the following tests are quite expensive (i.e. > 10mins each on a 2Ghz machine)
*/
-
+
public void testBySortedSetMirror1682762087() throws Exception {
System.out.println("1682762087 Full Checking");
trial(1682762087, true); // exposed bugs in 2a,b
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/DatabaseTestUtil.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/DatabaseTestUtil.java
index b3a376d4d..b1201f022 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/DatabaseTestUtil.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/DatabaseTestUtil.java
@@ -25,13 +25,13 @@ import org.eclipse.jdt.internal.core.nd.db.ChunkCache;
import org.eclipse.jdt.internal.core.nd.db.Database;
/**
- *
+ *
*/
public class DatabaseTestUtil {
public static IPath getTestDir() {
Plugin plugin = Activator.getInstance();
-
+
IPath path = plugin.getStateLocation().append("tests/");
File file = path.toFile();
if (!file.exists())
@@ -46,7 +46,7 @@ public class DatabaseTestUtil {
/**
* Creates an empty {@link Nd} with an empty type registry and randomly-named
* database for the given test name
- *
+ *
* @param testName
* @return the new {@link Nd}
*/
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/InheritenceTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/InheritenceTests.java
index 7e758eba9..ceb2a6c42 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/InheritenceTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/InheritenceTests.java
@@ -109,7 +109,7 @@ public class InheritenceTests extends BaseTestCase {
super(nd, deletionDetector);
}
}
-
+
public static class Reference extends NdNode {
public static final FieldManyToOne<BaseClass> BASE_CLASS_REFERENCE;
public static final FieldManyToOne<BaseClass> OWNER;
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/LargeBlockTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/LargeBlockTest.java
index 005ff7353..d239287ff 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/LargeBlockTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/LargeBlockTest.java
@@ -95,7 +95,7 @@ public class LargeBlockTest extends BaseTestCase {
* Tests that if there is a single large free block available, that block
* will be split and reused if necessary to satisfy a number of smaller
* requests.
- *
+ *
* @throws Exception
*/
public void testLargeAllocationIsSplitAndReused() throws Exception {
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/Package.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/Package.java
index 95e512efd..92a7f0e15 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/Package.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/Package.java
@@ -36,14 +36,14 @@ import org.eclipse.jdt.core.JavaCore;
log("Error: " + msg, e); //$NON-NLS-1$
}
}
-
+
/**
* @noreference This method is not intended to be referenced by clients.
*/
public static void log(String message, Throwable e) {
log(createStatus(message, e));
}
-
+
/**
* @noreference This method is not intended to be referenced by clients.
*/
@@ -60,7 +60,7 @@ import org.eclipse.jdt.core.JavaCore;
/**
* @noreference This method is not intended to be referenced by clients.
- *
+ *
* Returns the appropriate ILog for this package
*/
public static ILog getLog() {
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/SearchKeyTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/SearchKeyTests.java
index 21fc87f8c..b50cc0fe6 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/SearchKeyTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/SearchKeyTests.java
@@ -44,7 +44,7 @@ public class SearchKeyTests extends BaseTestCase {
private final long address;
private Nd nd;
-
+
public TestSearchIndex(Nd dom, long address) {
this.address = address;
this.nd = dom;
@@ -64,7 +64,7 @@ public class SearchKeyTests extends BaseTestCase {
FieldSearchIndex.SearchCriteria.create(searchString.toCharArray()));
}
}
-
+
public static class Element extends NdNode {
public static final FieldSearchKey<TestSearchIndex> NAME;
public static final FieldSearchKey<TestSearchIndex> NICKNAME;
@@ -113,7 +113,7 @@ public class SearchKeyTests extends BaseTestCase {
this.elementA = new Element(this.nd);
this.elementB = new Element(this.nd);
-
+
this.index = TestSearchIndex.getIndex(this.nd);
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/util/BaseTestCase.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/util/BaseTestCase.java
index 816916568..6a9ef260b 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/util/BaseTestCase.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/util/BaseTestCase.java
@@ -46,12 +46,12 @@ public class BaseTestCase extends TestCase {
private static final String INDEXER_TIMEOUT_PROPERTY = "indexer.timeout";
/**
* Indexer timeout used by tests. To avoid this timeout expiring during debugging add
- * -Dindexer.timeout=some_large_number to VM arguments of the test launch configuration.
+ * -Dindexer.timeout=some_large_number to VM arguments of the test launch configuration.
*/
protected static final int INDEXER_TIMEOUT_SEC =
Integer.parseInt(System.getProperty(INDEXER_TIMEOUT_PROPERTY, DEFAULT_INDEXER_TIMEOUT_SEC));
protected static final int INDEXER_TIMEOUT_MILLISEC= INDEXER_TIMEOUT_SEC * 1000;
-
+
private boolean fExpectFailure;
private int fBugNumber;
private int fExpectedLoggedNonOK;
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/util/Package.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/util/Package.java
index 826610eae..f4aec9f0c 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/util/Package.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/nd/util/Package.java
@@ -36,14 +36,14 @@ import org.eclipse.jdt.core.JavaCore;
log("Error: " + msg, e); //$NON-NLS-1$
}
}
-
+
/**
* @noreference This method is not intended to be referenced by clients.
*/
public static void log(String message, Throwable e) {
log(createStatus(message, e));
}
-
+
/**
* @noreference This method is not intended to be referenced by clients.
*/
@@ -60,7 +60,7 @@ import org.eclipse.jdt.core.JavaCore;
/**
* @noreference This method is not intended to be referenced by clients.
- *
+ *
* Returns the appropriate ILog for this package
*/
public static ILog getLog() {
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritePropertyTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritePropertyTest.java
index 89338c928..0ef0cf976 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritePropertyTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritePropertyTest.java
@@ -63,7 +63,7 @@ public class ASTRewritePropertyTest extends ASTRewritingTest {
Object value1 = rewrite.getProperty(propertyName1);
assertTrue("Not a String", value1 instanceof String);
assertTrue("Wrong value", "value".equals(value1));
-
+
Object value2 = rewrite.getProperty(propertyName2);
assertTrue("Not an Integer", value2 instanceof Integer);
assertTrue("Wrong value", Integer.valueOf(1).equals(value2));
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingExpressionsTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingExpressionsTest.java
index d7b09e772..3106ff149 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingExpressionsTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingExpressionsTest.java
@@ -207,7 +207,7 @@ public class ASTRewritingExpressionsTest extends ASTRewritingTest {
arrayCreation.setType(ast.newArrayType(ast.newSimpleType(ast.newSimpleName("Object")), 3));
arrayCreation.dimensions().add(ast.newNumberLiteral("1"));
arrayCreation.dimensions().add(ast.newNumberLiteral("2"));
-
+
rewrite.getListRewrite(invocation, MethodInvocation.ARGUMENTS_PROPERTY).insertLast(arrayCreation, null);
}
@@ -240,12 +240,12 @@ public class ASTRewritingExpressionsTest extends ASTRewritingTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createAST(cu);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
-
+
AST ast= astRoot.getAST();
-
+
assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
TypeDeclaration type= findTypeDeclaration(astRoot, "E");
MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
@@ -254,11 +254,11 @@ public class ASTRewritingExpressionsTest extends ASTRewritingTest {
assertTrue("Number of statements not 1", statements.size() == 1);
ExpressionStatement statement= (ExpressionStatement) statements.get(0);
MethodInvocation invocation= (MethodInvocation) statement.getExpression();
-
+
{ // add a new ArrayCreation with annotations
ArrayCreation arrayCreation= ast.newArrayCreation();
SimpleType elementType= ast.newSimpleType(ast.newName("java.lang.String"));
-
+
ArrayType arrayType= ast.newArrayType(elementType);
NormalAnnotation annotationC= ast.newNormalAnnotation();
annotationC.setTypeName(ast.newSimpleName("C"));
@@ -268,29 +268,29 @@ public class ASTRewritingExpressionsTest extends ASTRewritingTest {
annotationC.values().add(memberValuePair);
Dimension dim0 = (Dimension) arrayType.dimensions().get(0);
dim0.annotations().add(annotationC);
-
+
SingleMemberAnnotation annotationB= ast.newSingleMemberAnnotation();
annotationB.setTypeName(ast.newSimpleName("B"));
annotationB.setValue(ast.newNumberLiteral("0"));
Dimension dim1 = ast.newDimension();
dim1.annotations().add(annotationB);
arrayType.dimensions().add(0, dim1);
-
+
MarkerAnnotation annotationA= ast.newMarkerAnnotation();
annotationA.setTypeName(ast.newSimpleName("A"));
Dimension dim2 = ast.newDimension();
dim2.annotations().add(annotationA);
arrayType.dimensions().add(0, dim2);
-
+
arrayCreation.dimensions().add(ast.newNumberLiteral("1"));
arrayCreation.dimensions().add(ast.newNumberLiteral("2"));
arrayCreation.setType(arrayType);
-
+
rewrite.getListRewrite(invocation, MethodInvocation.ARGUMENTS_PROPERTY).insertLast(arrayCreation, null);
}
-
+
String preview= evaluateRewrite(cu, rewrite);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
@@ -299,7 +299,7 @@ public class ASTRewritingExpressionsTest extends ASTRewritingTest {
buf.append(" }\n");
buf.append("}\n");
assertEqualString(preview, buf.toString());
-
+
}
public void testArrayInitializer() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
@@ -1073,10 +1073,10 @@ public class ASTRewritingExpressionsTest extends ASTRewritingTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createAST(cu);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
-
+
assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
TypeDeclaration type= findTypeDeclaration(astRoot, "E");
MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
@@ -1086,46 +1086,46 @@ public class ASTRewritingExpressionsTest extends ASTRewritingTest {
ExpressionStatement stmt= (ExpressionStatement) statements.get(0);
Assignment assignment= (Assignment) stmt.getExpression();
InfixExpression expr= (InfixExpression) assignment.getRightHandSide();
-
+
rewrite.remove(expr.getLeftOperand(), null);
}
-
+
{ // remove right side
ExpressionStatement stmt= (ExpressionStatement) statements.get(1);
Assignment assignment= (Assignment) stmt.getExpression();
InfixExpression expr= (InfixExpression) assignment.getRightHandSide();
-
+
rewrite.remove(expr.getRightOperand(), null);
}
-
+
{ // remove left side (with extended operands)
ExpressionStatement stmt= (ExpressionStatement) statements.get(2);
Assignment assignment= (Assignment) stmt.getExpression();
InfixExpression expr= (InfixExpression) assignment.getRightHandSide();
-
+
rewrite.remove(expr.getLeftOperand(), null);
}
-
+
{ // remove right side (with extended operands)
ExpressionStatement stmt= (ExpressionStatement) statements.get(3);
Assignment assignment= (Assignment) stmt.getExpression();
InfixExpression expr= (InfixExpression) assignment.getRightHandSide();
-
+
rewrite.remove(expr.getRightOperand(), null);
}
-
+
{ // remove left, right, and extended operand
ExpressionStatement stmt= (ExpressionStatement) statements.get(4);
Assignment assignment= (Assignment) stmt.getExpression();
InfixExpression expr= (InfixExpression) assignment.getRightHandSide();
-
+
rewrite.remove(expr.getLeftOperand(), null);
rewrite.remove(expr.getRightOperand(), null);
rewrite.remove((ASTNode) expr.extendedOperands().get(0), null);
}
-
+
String preview= evaluateRewrite(cu, rewrite);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
@@ -1138,7 +1138,7 @@ public class ASTRewritingExpressionsTest extends ASTRewritingTest {
buf.append(" }\n");
buf.append("}\n");
assertEqualString(preview, buf.toString());
-
+
}
public void testInstanceofExpression() throws Exception {
@@ -2310,7 +2310,7 @@ public class ASTRewritingExpressionsTest extends ASTRewritingTest {
TypeDeclaration type = (TypeDeclaration) unit.types().get(0);
ASTNode node = (ASTNode) type.bodyDeclarations().get(0);
MethodDeclaration method = (MethodDeclaration) node;
-
+
VariableDeclarationStatement statement = (VariableDeclarationStatement) method.getBody().statements().get(0);
VariableDeclarationFragment fragment = (VariableDeclarationFragment) statement.fragments().get(0);
CastExpression cast = (CastExpression) ((ParenthesizedExpression)fragment.getInitializer()).getExpression();
@@ -2366,7 +2366,7 @@ public class ASTRewritingExpressionsTest extends ASTRewritingTest {
annot.setTypeName(ast.newSimpleName("Marker1"));
simpleType.annotations().add(annot);
intersection.types().add(simpleType);
-
+
simpleType = ast.newSimpleType(ast.newSimpleName("Serializable"));
annot = ast.newMarkerAnnotation();
annot.setTypeName(ast.newSimpleName("Marker2"));
@@ -2446,14 +2446,14 @@ public class ASTRewritingExpressionsTest extends ASTRewritingTest {
MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
Block block= methodDecl.getBody();
List statements= block.statements();
- { // add infix expression with operand that is a prefix expression
+ { // add infix expression with operand that is a prefix expression
ExpressionStatement stmt= (ExpressionStatement) statements.get(0);
Assignment assignment= (Assignment) stmt.getExpression();
-
+
PrefixExpression prefix = ast.newPrefixExpression();
prefix.setOperator(PrefixExpression.Operator.INCREMENT);
prefix.setOperand(ast.newSimpleName("c"));
-
+
InfixExpression infix= ast.newInfixExpression();
infix.setLeftOperand(ast.newSimpleName("a"));
infix.setRightOperand(ast.newSimpleName("b"));
@@ -2471,10 +2471,10 @@ public class ASTRewritingExpressionsTest extends ASTRewritingTest {
buf.append(" }\n");
buf.append("}\n");
assertEqualString(preview, buf.toString());
-
+
this.project1.setOption(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ADDITIVE_OPERATOR, JavaCore.DO_NOT_INSERT);
this.project1.setOption(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ADDITIVE_OPERATOR, JavaCore.DO_NOT_INSERT);
-
+
preview= evaluateRewrite(cu, rewrite);
buf= new StringBuffer();
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingInstanceOfPatternExpressionTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingInstanceOfPatternExpressionTest.java
index 62edadf7f..fc1d45a99 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingInstanceOfPatternExpressionTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingInstanceOfPatternExpressionTest.java
@@ -57,7 +57,7 @@ public class ASTRewritingInstanceOfPatternExpressionTest extends ASTRewritingTes
this.project1.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
}
}
-
+
@SuppressWarnings({ "rawtypes", "deprecation" })
public void test001() throws Exception {
if (this.apiLevel != 14) {
@@ -98,7 +98,7 @@ public class ASTRewritingInstanceOfPatternExpressionTest extends ASTRewritingTes
ifStatement.setThenStatement(ast.newEmptyStatement());
rewrite.getListRewrite(block, Block.STATEMENTS_PROPERTY).insertLast(ifStatement, null);
}
-
+
String preview= evaluateRewrite(cu, rewrite);
buf= new StringBuffer();
@@ -111,6 +111,6 @@ public class ASTRewritingInstanceOfPatternExpressionTest extends ASTRewritingTes
buf.append("}\n");
assertEqualString(preview, buf.toString());
-
+
}
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingLambdaExpressionTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingLambdaExpressionTest.java
index 74b4a565e..a8f2fd904 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingLambdaExpressionTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingLambdaExpressionTest.java
@@ -96,16 +96,16 @@ public class ASTRewritingLambdaExpressionTest extends ASTRewritingTest {
Expression expression = fragment.getInitializer();
assertTrue(expression instanceof LambdaExpression);
LambdaExpression lambdaExpression = (LambdaExpression)expression;
-
+
{// add a parameter to the lambda expression
List parameters= lambdaExpression.parameters();
assertTrue("must be 1 parameter", parameters.size() == 1);
ASTNode firstParam= (ASTNode) parameters.get(0);
VariableDeclarationFragment newParam= ast.newVariableDeclarationFragment();
newParam.setName(ast.newSimpleName("wlambda"));
- rewrite.getListRewrite(lambdaExpression, LambdaExpression.PARAMETERS_PROPERTY).insertAfter(newParam, firstParam, null);
+ rewrite.getListRewrite(lambdaExpression, LambdaExpression.PARAMETERS_PROPERTY).insertAfter(newParam, firstParam, null);
}
-
+
{// replace the block body with a float literal expression body.
ASTNode body = lambdaExpression.getBody();
ASTNode newBody = ast.newNumberLiteral("3.14");
@@ -117,13 +117,13 @@ public class ASTRewritingLambdaExpressionTest extends ASTRewritingTest {
expression = fragment.getInitializer();
assertTrue(expression instanceof LambdaExpression);
lambdaExpression = (LambdaExpression)expression;
-
+
{// add a parameter to the lambda expression - border case - empty list initially
List parameters= lambdaExpression.parameters();
assertTrue("must be 0 parameter", parameters.size() == 0);
VariableDeclarationFragment newParam= ast.newVariableDeclarationFragment();
newParam.setName(ast.newSimpleName("vlambda"));
- rewrite.getListRewrite(lambdaExpression, LambdaExpression.PARAMETERS_PROPERTY).insertFirst(newParam, null);
+ rewrite.getListRewrite(lambdaExpression, LambdaExpression.PARAMETERS_PROPERTY).insertFirst(newParam, null);
}
String preview= evaluateRewrite(cu, rewrite);
@@ -141,7 +141,7 @@ public class ASTRewritingLambdaExpressionTest extends ASTRewritingTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
public void testLambdaExpressions_Parentheses_since_8() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new StringBuffer();
@@ -187,21 +187,21 @@ public class ASTRewritingLambdaExpressionTest extends ASTRewritingTest {
FieldDeclaration fieldDeclaration = (FieldDeclaration) typedeclaration.bodyDeclarations().get(fCount++);
VariableDeclarationFragment fragment = (VariableDeclarationFragment)fieldDeclaration.fragments().get(0);
LambdaExpression lambdaExpression = (LambdaExpression)fragment.getInitializer();
-
+
{// set parentheses
assertTrue("lambda expression has parantheses", lambdaExpression.hasParentheses() == false);
rewrite.set(lambdaExpression, LambdaExpression.PARENTHESES_PROPERTY, Boolean.TRUE, null);
}
-
+
fieldDeclaration = (FieldDeclaration) typedeclaration.bodyDeclarations().get(fCount++);
fragment = (VariableDeclarationFragment)fieldDeclaration.fragments().get(0);
lambdaExpression = (LambdaExpression)fragment.getInitializer();
-
+
{// reset parentheses - a legal operation here.
assertTrue("lambda expression has parantheses", lambdaExpression.hasParentheses() == true);
rewrite.set(lambdaExpression, LambdaExpression.PARENTHESES_PROPERTY, Boolean.FALSE, null);
}
-
+
fieldDeclaration = (FieldDeclaration) typedeclaration.bodyDeclarations().get(fCount++);
fragment = (VariableDeclarationFragment)fieldDeclaration.fragments().get(0);
lambdaExpression = (LambdaExpression)fragment.getInitializer();
@@ -219,7 +219,7 @@ public class ASTRewritingLambdaExpressionTest extends ASTRewritingTest {
assertTrue("lambda expression does not have parantheses", lambdaExpression.hasParentheses() == true);
rewrite.set(lambdaExpression, LambdaExpression.PARENTHESES_PROPERTY, Boolean.FALSE, null);
}
-
+
{// change all the parameter to SVD ie add type info to the parameters.
List parameters = lambdaExpression.parameters();
VariableDeclaration param = (VariableDeclaration)parameters.get(0);
@@ -227,7 +227,7 @@ public class ASTRewritingLambdaExpressionTest extends ASTRewritingTest {
newParam.setName(ast.newSimpleName(new String(param.toString())));
newParam.setType(ast.newPrimitiveType(PrimitiveType.INT));
rewrite.getListRewrite(lambdaExpression, LambdaExpression.PARAMETERS_PROPERTY).replace(param, newParam, null);
-
+
param = (VariableDeclaration)parameters.get(1);
newParam= ast.newSingleVariableDeclaration();
newParam.setName(ast.newSimpleName(new String(param.toString())));
@@ -246,14 +246,14 @@ public class ASTRewritingLambdaExpressionTest extends ASTRewritingTest {
SingleVariableDeclaration param = (SingleVariableDeclaration)parameters.get(i);
VariableDeclarationFragment newParam= ast.newVariableDeclarationFragment();
newParam.setName(ast.newSimpleName(new String(param.getName().toString())));
- rewrite.getListRewrite(lambdaExpression, LambdaExpression.PARAMETERS_PROPERTY).replace(param, newParam, null);
+ rewrite.getListRewrite(lambdaExpression, LambdaExpression.PARAMETERS_PROPERTY).replace(param, newParam, null);
}
}
fieldDeclaration = (FieldDeclaration) typedeclaration.bodyDeclarations().get(fCount++);
fragment = (VariableDeclarationFragment)fieldDeclaration.fragments().get(0);
lambdaExpression = (LambdaExpression)fragment.getInitializer();
-
+
{// remove the only parameter and the rewriter should automatically add the parentheses
List parameters = lambdaExpression.parameters();
ASTNode param = (ASTNode)parameters.get(0);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingMethodDeclTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingMethodDeclTest.java
index cfe73f602..858b1abd9 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingMethodDeclTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingMethodDeclTest.java
@@ -59,14 +59,14 @@ public class ASTRewritingMethodDeclTest extends ASTRewritingTest {
}
/** @deprecated using deprecated code */
- private Type getReturnType(MethodDeclaration methodDecl) {
- return this.apiLevel < AST.JLS3 ? methodDecl.getReturnType() : methodDecl.getReturnType2();
- }
+ private Type getReturnType(MethodDeclaration methodDecl) {
+ return this.apiLevel < AST.JLS3 ? methodDecl.getReturnType() : methodDecl.getReturnType2();
+ }
/** @deprecated using deprecated code */
- private ChildPropertyDescriptor getMethodReturnTypeProperty(AST ast) {
- return ast.apiLevel() < AST.JLS3 ? INTERNAL_METHOD_RETURN_TYPE_PROPERTY : MethodDeclaration.RETURN_TYPE2_PROPERTY;
- }
+ private ChildPropertyDescriptor getMethodReturnTypeProperty(AST ast) {
+ return ast.apiLevel() < AST.JLS3 ? INTERNAL_METHOD_RETURN_TYPE_PROPERTY : MethodDeclaration.RETURN_TYPE2_PROPERTY;
+ }
/** @deprecated using deprecated code */
private ASTNode createNewExceptionType(AST ast, String name) {
@@ -74,14 +74,14 @@ public class ASTRewritingMethodDeclTest extends ASTRewritingTest {
}
/** @deprecated using deprecated code */
- private List getThrownExceptions(MethodDeclaration methodDecl) {
- return this.apiLevel < AST.JLS8 ? methodDecl.thrownExceptions() : methodDecl.thrownExceptionTypes();
- }
+ private List getThrownExceptions(MethodDeclaration methodDecl) {
+ return this.apiLevel < AST.JLS8 ? methodDecl.thrownExceptions() : methodDecl.thrownExceptionTypes();
+ }
/** @deprecated using deprecated code */
- private ChildListPropertyDescriptor getMethodThrownExceptionsProperty(AST ast) {
- return ast.apiLevel() < AST.JLS8 ? INTERNAL_METHOD_THROWN_EXCEPTIONS_PROPERTY : MethodDeclaration.THROWN_EXCEPTION_TYPES_PROPERTY;
- }
+ private ChildListPropertyDescriptor getMethodThrownExceptionsProperty(AST ast) {
+ return ast.apiLevel() < AST.JLS8 ? INTERNAL_METHOD_THROWN_EXCEPTIONS_PROPERTY : MethodDeclaration.THROWN_EXCEPTION_TYPES_PROPERTY;
+ }
/** @deprecated using deprecated code */
private void setModifiers(ASTRewrite rewrite, MethodDeclaration methodDecl, int newModifiers) {
@@ -100,7 +100,7 @@ public class ASTRewritingMethodDeclTest extends ASTRewritingTest {
}
}
}
-
+
/** @deprecated using deprecated code */
private void setExtraDimensions(ASTRewrite rewrite, MethodDeclaration methodDecl, int extraDimensions) {
if (this.apiLevel < AST.JLS8) {
@@ -933,24 +933,24 @@ public class ASTRewritingMethodDeclTest extends ASTRewritingTest {
buf.append(" public void foo( String s ) {}\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
-
- CompilationUnit astRoot= createAST(cu);
+
+ CompilationUnit astRoot= createAST(cu);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
TypeDeclaration type = (TypeDeclaration) astRoot.types().get(0);
-
+
{ // delete param, insert new
MethodDeclaration methodDecl= (MethodDeclaration) type.bodyDeclarations().get(0);
List parameters= methodDecl.parameters();
rewrite.remove((ASTNode) parameters.get(0), null);
}
String preview= evaluateRewrite(cu, rewrite);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
buf.append(" public void foo() {}\n");
buf.append("}\n");
-
+
assertEqualString(preview, buf.toString());
} finally {
this.project1.setOptions(options);
@@ -2446,9 +2446,9 @@ public class ASTRewritingMethodDeclTest extends ASTRewritingTest {
buf.append(" }\n");
buf.append("}\n");
assertEqualString(preview, buf.toString());
-
+
this.project1.setOption(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ELLIPSIS, JavaCore.INSERT);
-
+
preview= evaluateRewrite(cu, rewrite);
buf= new StringBuffer();
@@ -2758,16 +2758,16 @@ public class ASTRewritingMethodDeclTest extends ASTRewritingTest {
buf.append(" }\n");
buf.append(" public void foo3(Object @Marker ... args) {\n");
buf.append(" }\n");
- buf.append(" public void foo4(Object @Marker... args) {\n");
+ buf.append(" public void foo4(Object @Marker... args) {\n");
buf.append(" }\n");
- buf.append(" public void foo5(Object... args) {\n");
+ buf.append(" public void foo5(Object... args) {\n");
buf.append(" }\n");
buf.append(" public void foo6(Object args) {\n");
buf.append(" }\n");
buf.append(" public void foo7(Object @Marker... args) {\n");
- buf.append(" }\n");
+ buf.append(" }\n");
buf.append(" public void foo8(Object @Marker... args) {\n");
- buf.append(" }\n");
+ buf.append(" }\n");
buf.append(" public void foo9(@B @C int @A... a) {\n");
buf.append(" }\n");
buf.append(" public void foo10(Object args) {\n");
@@ -2778,20 +2778,20 @@ public class ASTRewritingMethodDeclTest extends ASTRewritingTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("DD.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createAST(cu, false);
AST ast= astRoot.getAST();
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
TypeDeclaration type= findTypeDeclaration(astRoot, "DD");
-
+
{
// Remove annotation from first method args - boundary condition -
// - only one annotation should be present.
MethodDeclaration methodDecl= findMethodDeclaration(type, "foo1");
SingleVariableDeclaration param = (SingleVariableDeclaration) methodDecl.parameters().get(1);
rewrite.remove((ASTNode)param.varargsAnnotations().get(0), null);
-
- // Add one annotation to the second method - boundary condition
+
+ // Add one annotation to the second method - boundary condition
// - no annotation should be present
methodDecl= findMethodDeclaration(type, "foo2");
param = (SingleVariableDeclaration) methodDecl.parameters().get(0);
@@ -2799,23 +2799,23 @@ public class ASTRewritingMethodDeclTest extends ASTRewritingTest {
markerAnnotation.setTypeName(ast.newSimpleName("X"));
ListRewrite listRewrite= rewrite.getListRewrite(param, SingleVariableDeclaration.VARARGS_ANNOTATIONS_PROPERTY);
listRewrite.insertFirst(markerAnnotation, null);
-
+
// Remove the varargs property - annotation(s) should disappear
methodDecl= findMethodDeclaration(type, "foo3");
param = (SingleVariableDeclaration) methodDecl.parameters().get(0);
rewrite.set(param, SingleVariableDeclaration.VARARGS_PROPERTY, Boolean.FALSE, null);
-
+
// Remove the varargs property - annotation(s) should disappear
// - differs from the above due to the absence of a blank before ...
methodDecl= findMethodDeclaration(type, "foo4");
param = (SingleVariableDeclaration) methodDecl.parameters().get(0);
rewrite.set(param, SingleVariableDeclaration.VARARGS_PROPERTY, Boolean.FALSE, null);
-
+
// Remove the varargs property - Existing functionality unchanged without annotations
methodDecl= findMethodDeclaration(type, "foo5");
param = (SingleVariableDeclaration) methodDecl.parameters().get(0);
rewrite.set(param, SingleVariableDeclaration.VARARGS_PROPERTY, Boolean.FALSE, null);
-
+
// Add the varargs property and annotation
methodDecl= findMethodDeclaration(type, "foo6");
param = (SingleVariableDeclaration) methodDecl.parameters().get(0);
@@ -2824,20 +2824,20 @@ public class ASTRewritingMethodDeclTest extends ASTRewritingTest {
markerAnnotation.setTypeName(ast.newSimpleName("X"));
listRewrite= rewrite.getListRewrite(param, SingleVariableDeclaration.VARARGS_ANNOTATIONS_PROPERTY);
listRewrite.insertFirst(markerAnnotation, null);
-
+
// Replace annotation
methodDecl= findMethodDeclaration(type, "foo7");
param = (SingleVariableDeclaration) methodDecl.parameters().get(0);
markerAnnotation= ast.newMarkerAnnotation();
markerAnnotation.setTypeName(ast.newSimpleName("X"));
rewrite.replace((ASTNode)param.varargsAnnotations().get(0), markerAnnotation, null);
-
+
// Reset and Set Varargs - output should not change.
methodDecl= findMethodDeclaration(type, "foo8");
param = (SingleVariableDeclaration) methodDecl.parameters().get(0);
rewrite.set(param, SingleVariableDeclaration.VARARGS_PROPERTY, Boolean.FALSE, null);
rewrite.set(param, SingleVariableDeclaration.VARARGS_PROPERTY, Boolean.TRUE, null);
-
+
// Add multiple (two) annotations, remove an existing annotation
methodDecl= findMethodDeclaration(type, "foo9");
param = (SingleVariableDeclaration) methodDecl.parameters().get(0);
@@ -2849,18 +2849,18 @@ public class ASTRewritingMethodDeclTest extends ASTRewritingTest {
markerAnnotation.setTypeName(ast.newSimpleName("Y"));
listRewrite.insertFirst(markerAnnotation, null);
rewrite.remove((ASTNode)param.varargsAnnotations().get(0), null);
-
+
// Add the varargs property
methodDecl= findMethodDeclaration(type, "foo10");
param = (SingleVariableDeclaration) methodDecl.parameters().get(0);
rewrite.set(param, SingleVariableDeclaration.VARARGS_PROPERTY, Boolean.TRUE, null);
-
+
// Remove the annotations and varargs property as well.
methodDecl= findMethodDeclaration(type, "foo11");
param = (SingleVariableDeclaration) methodDecl.parameters().get(0);
rewrite.remove((ASTNode)param.varargsAnnotations().get(0), null);
rewrite.set(param, SingleVariableDeclaration.VARARGS_PROPERTY, Boolean.FALSE, null);
-
+
// Add an annotation but remove the varargs property - should not add the annotation.
methodDecl= findMethodDeclaration(type, "foo12");
param = (SingleVariableDeclaration) methodDecl.parameters().get(0);
@@ -2870,9 +2870,9 @@ public class ASTRewritingMethodDeclTest extends ASTRewritingTest {
listRewrite= rewrite.getListRewrite(param, SingleVariableDeclaration.VARARGS_ANNOTATIONS_PROPERTY);
listRewrite.insertFirst(markerAnnotation, null);
}
-
+
String preview= evaluateRewrite(cu, rewrite);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("@interface Marker {\n");
@@ -2891,9 +2891,9 @@ public class ASTRewritingMethodDeclTest extends ASTRewritingTest {
buf.append(" public void foo6(Object @X... args) {\n");
buf.append(" }\n");
buf.append(" public void foo7(Object @X... args) {\n");
- buf.append(" }\n");
+ buf.append(" }\n");
buf.append(" public void foo8(Object @Marker... args) {\n");
- buf.append(" }\n");
+ buf.append(" }\n");
buf.append(" public void foo9(@B @C int @Y @X()... a) {\n");
buf.append(" }\n");
buf.append(" public void foo10(Object... args) {\n");
@@ -2903,7 +2903,7 @@ public class ASTRewritingMethodDeclTest extends ASTRewritingTest {
buf.append(" public void foo12(Object args) {\n");
buf.append(" }\n");
buf.append("}\n");
- assertEqualString(preview, buf.toString());
+ assertEqualString(preview, buf.toString());
}
public void testMethodDeclChangesBug77538() throws Exception {
@@ -3098,20 +3098,20 @@ public class ASTRewritingMethodDeclTest extends ASTRewritingTest {
}
{
SingleVariableDeclaration decl= ast.newSingleVariableDeclaration();
-
+
MarkerAnnotation markerAnnotation= ast.newMarkerAnnotation();
markerAnnotation.setTypeName(ast.newSimpleName("X"));
decl.modifiers().add(markerAnnotation);
-
+
Type type= ast.newPrimitiveType(PrimitiveType.INT);
decl.setType(type);
-
+
decl.setName(ast.newSimpleName("e"));
-
+
ListRewrite listRewrite= rewrite.getListRewrite(methodDecl, MethodDeclaration.PARAMETERS_PROPERTY);
listRewrite.insertLast(decl, null);
}
-
+
String preview= evaluateRewrite(cu, rewrite);
buf= new StringBuffer();
@@ -3121,11 +3121,11 @@ public class ASTRewritingMethodDeclTest extends ASTRewritingTest {
buf.append(" }\n");
buf.append("}\n");
assertEqualString(preview, buf.toString());
-
+
this.project1.setOption(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PARAMETER, JavaCore.INSERT);
-
+
preview= evaluateRewrite(cu, rewrite);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("class E {\n");
@@ -3148,7 +3148,7 @@ public class ASTRewritingMethodDeclTest extends ASTRewritingTest {
buf.append(" public Object foo6(int i) @Annot1 [] @Annot2 [] throws IllegalArgumentException { return null; }\n");
buf.append(" public Object foo7(int i) @Annot1 [] @Annot2 [] { return null; }\n");
buf.append("}\n");
- buf.append("@java.lang.annotation.Target(value= {ElementType.TYPE_USE})\n");
+ buf.append("@java.lang.annotation.Target(value= {ElementType.TYPE_USE})\n");
buf.append("@interface Annot1 {}\n");
buf.append("@java.lang.annotation.Target(value= {ElementType.TYPE_USE})\n");
buf.append("@interface Annot2 {}\n");
@@ -3174,7 +3174,7 @@ public class ASTRewritingMethodDeclTest extends ASTRewritingTest {
markerAnnotation.setTypeName(ast.newSimpleName("Annot2"));
dim.annotations().add(markerAnnotation);
listRewrite.insertAt(dim, 2, null);
-
+
ASTNode exception = (ASTNode) methodDecl.thrownExceptionTypes().get(0);
rewrite.getListRewrite(methodDecl, MethodDeclaration.THROWN_EXCEPTION_TYPES_PROPERTY).remove(exception, null);
}
@@ -3188,7 +3188,7 @@ public class ASTRewritingMethodDeclTest extends ASTRewritingTest {
dim.annotations().add(markerAnnotation);
listRewrite.insertAt(dim, 1, null);
-
+
Type exception= ast.newSimpleType(ast.newSimpleName("ArrayStoreException"));
rewrite.getListRewrite(methodDecl, MethodDeclaration.THROWN_EXCEPTION_TYPES_PROPERTY).insertFirst(exception, null);
}
@@ -3267,7 +3267,7 @@ public class ASTRewritingMethodDeclTest extends ASTRewritingTest {
buf.append(" public Object foo6(int i) [] [] throws IllegalArgumentException { return null; }\n");
buf.append(" public Object foo7(int i) { return null; }\n");
buf.append("}\n");
- buf.append("@java.lang.annotation.Target(value= {ElementType.TYPE_USE})\n");
+ buf.append("@java.lang.annotation.Target(value= {ElementType.TYPE_USE})\n");
buf.append("@interface Annot1 {}\n");
buf.append("@java.lang.annotation.Target(value= {ElementType.TYPE_USE})\n");
buf.append("@interface Annot2 {}\n");
@@ -3453,7 +3453,7 @@ public class ASTRewritingMethodDeclTest extends ASTRewritingTest {
TypeDeclaration type = (TypeDeclaration) findTypeDeclaration(astRoot, "XYZ").bodyDeclarations().get(0);
MethodDeclaration method1 = (MethodDeclaration) type.bodyDeclarations().get(0); // Remove the receiver type and qualifying name
MethodDeclaration method2 = (MethodDeclaration) type.bodyDeclarations().get(1); // Remove the receiver but not the qualifier
- MethodDeclaration method3 = (MethodDeclaration) type.bodyDeclarations().get(2); // Remove the qualifier only
+ MethodDeclaration method3 = (MethodDeclaration) type.bodyDeclarations().get(2); // Remove the qualifier only
MethodDeclaration method4 = (MethodDeclaration) type.bodyDeclarations().get(3); // Remove the qualifier and receiver annotation
MethodDeclaration method5 = (MethodDeclaration) type.bodyDeclarations().get(4); // Remove the receiver type and all parameters
MethodDeclaration method6 = (MethodDeclaration) type.bodyDeclarations().get(5); // Remove the receiver type and add a param
@@ -3704,7 +3704,7 @@ public class ASTRewritingMethodDeclTest extends ASTRewritingTest {
assertEqualString(preview, buf.toString());
}
-
+
public void testReceiverParam_InnerClass_since_8() throws Exception {
IPackageFragment pack1 = this.sourceFolder.createPackageFragment(
"test1", false, null);
@@ -3725,7 +3725,7 @@ public class ASTRewritingMethodDeclTest extends ASTRewritingTest {
ASTRewrite rewrite = ASTRewrite.create(astRoot.getAST());
TypeDeclaration type = findTypeDeclaration(astRoot, "E");
TypeDeclaration inner = (TypeDeclaration) type.bodyDeclarations().get(1);
-
+
MethodDeclaration newMethodDeclaration = ast.newMethodDeclaration();
SimpleName methodName = ast.newSimpleName("Inner");
SimpleType simpleType = ast.newSimpleType(ast.newSimpleName("E"));
@@ -3804,19 +3804,19 @@ public class ASTRewritingMethodDeclTest extends ASTRewritingTest {
buf.append("@interface Marker {}\n");
assertEqualString(preview, buf.toString());
-
+
// still no new line if new line after annotation on parameter is enabled:
this.project1.setOption(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PARAMETER, JavaCore.INSERT);
-
+
preview= evaluateRewrite(cu, rewrite);
assertEqualString(preview, buf.toString());
-
+
// do insert new line if new line after type annotation is enabled:
this.project1.setOption(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PARAMETER, JavaCore.DO_NOT_INSERT);
this.project1.setOption(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_TYPE_ANNOTATION, JavaCore.INSERT);
-
+
preview= evaluateRewrite(cu, rewrite);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("import java.lang.annotation.*;\n");
@@ -3829,10 +3829,10 @@ public class ASTRewritingMethodDeclTest extends ASTRewritingTest {
buf.append("}\n");
buf.append("@Target (Element.TYPE_USE);\n");
buf.append("@interface Marker {}\n");
-
+
assertEqualString(preview, buf.toString());
}
-
+
public void testBug427622b_since_8() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new StringBuffer();
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingModuleDeclarationTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingModuleDeclarationTest.java
index 58791869f..31f10d10d 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingModuleDeclarationTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingModuleDeclarationTest.java
@@ -85,7 +85,7 @@ public class ASTRewritingModuleDeclarationTest extends ASTRewritingTest {
Name newName = ast.newSimpleName("newpack11");
rewrite.replace(exp.getName(), newName, null);
ListRewrite expListRewrite = rewrite.getListRewrite(exp, ExportsDirective.MODULES_PROPERTY);
- expListRewrite.remove((ASTNode) exp.modules().get(1), null);
+ expListRewrite.remove((ASTNode) exp.modules().get(1), null);
// exports pack12 to fifth -> exports pack12 to fifth, sixth
exp = (ExportsDirective) moduleStatements.get(index++);
@@ -188,7 +188,7 @@ public class ASTRewritingModuleDeclarationTest extends ASTRewritingTest {
buf.append(" requires existing;\n");
buf.append(" requires addedme;\n");
buf.append("}");
- assertEqualString(preview, buf.toString());
+ assertEqualString(preview, buf.toString());
} finally {
if (javaProject != null) deleteProject(javaProject);
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingReferenceExpressionTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingReferenceExpressionTest.java
index 0b88d6b78..17c44e387 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingReferenceExpressionTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingReferenceExpressionTest.java
@@ -93,10 +93,10 @@ public class ASTRewritingReferenceExpressionTest extends ASTRewritingTest {
VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) variableDeclarationStatement.fragments().get(0);
CreationReference creationReference = (CreationReference) variableDeclarationFragment.getInitializer();
TypeParameter typeParameter= ast.newTypeParameter();
- typeParameter.setName(ast.newSimpleName("Integer"));
+ typeParameter.setName(ast.newSimpleName("Integer"));
ListRewrite listRewrite = rewrite.getListRewrite(creationReference, CreationReference.TYPE_ARGUMENTS_PROPERTY);
listRewrite.replace((ASTNode)(creationReference.typeArguments().get(0)), typeParameter, null);
-
+
// case 2: add a type argument.
variableDeclarationStatement = (VariableDeclarationStatement) methodDecl.getBody().statements().get(1);
variableDeclarationFragment = (VariableDeclarationFragment) variableDeclarationStatement.fragments().get(0);
@@ -104,7 +104,7 @@ public class ASTRewritingReferenceExpressionTest extends ASTRewritingTest {
SimpleType simpleType = ast.newSimpleType(ast.newSimpleName("Integer"));
listRewrite = rewrite.getListRewrite(creationReference, CreationReference.TYPE_ARGUMENTS_PROPERTY);
listRewrite.insertLast(simpleType, null);
-
+
// case 3: delete a type argument.
variableDeclarationStatement = (VariableDeclarationStatement) methodDecl.getBody().statements().get(2);
variableDeclarationFragment = (VariableDeclarationFragment) variableDeclarationStatement.fragments().get(0);
@@ -139,7 +139,7 @@ public class ASTRewritingReferenceExpressionTest extends ASTRewritingTest {
simpleType = ast.newSimpleType(ast.newQualifiedName(ast.newSimpleName("Y"), ast.newSimpleName("Z")));
rewrite.replace(creationReference.getType(), simpleType, null);
}
-
+
String preview= evaluateRewrite(cu, rewrite);
contents = "package test407131;\n" +
"\n" +
@@ -177,7 +177,7 @@ public class ASTRewritingReferenceExpressionTest extends ASTRewritingTest {
buf= new StringBuffer(contents);
assertEqualString(preview, buf.toString());
}
-
+
/**
* tests various aspects of CreationReference (Constructor Method Reference) with ArrayType as lhs
* @throws Exception
@@ -227,7 +227,7 @@ public class ASTRewritingReferenceExpressionTest extends ASTRewritingTest {
buf= new StringBuffer(contents);
assertEqualString(preview, buf.toString());
}
-
+
/**
* tests various aspects of {@link ExpressionMethodReference}
* @throws Exception
@@ -273,7 +273,7 @@ public class ASTRewritingReferenceExpressionTest extends ASTRewritingTest {
rewrite.replace(expressionMethodReference.getExpression(), ast.newSimpleName("z"), null);
rewrite.getListRewrite(expressionMethodReference, ExpressionMethodReference.TYPE_ARGUMENTS_PROPERTY).insertFirst(simpleType, null);
rewrite.replace(expressionMethodReference.getName(), ast.newSimpleName("bar"), null);
-
+
variableDeclarationStatement = (VariableDeclarationStatement) methodDecl.getBody().statements().get(3);
variableDeclarationFragment = (VariableDeclarationFragment) variableDeclarationStatement.fragments().get(0);
expressionMethodReference = (ExpressionMethodReference) variableDeclarationFragment.getInitializer();
@@ -281,7 +281,7 @@ public class ASTRewritingReferenceExpressionTest extends ASTRewritingTest {
ASTNode typeArgument = (ASTNode) expressionMethodReference.typeArguments().get(0);
rewrite.getListRewrite(expressionMethodReference, ExpressionMethodReference.TYPE_ARGUMENTS_PROPERTY).remove(typeArgument, null);
rewrite.replace(expressionMethodReference.getName(), ast.newSimpleName("foo"), null);
-
+
}
String preview= evaluateRewrite(cu, rewrite);
contents = "package test407131;\n" +
@@ -308,7 +308,7 @@ public class ASTRewritingReferenceExpressionTest extends ASTRewritingTest {
buf= new StringBuffer(contents);
assertEqualString(preview, buf.toString());
}
-
+
/**
* tests various aspects of {@link TypeMethodReference}
* @throws Exception
@@ -359,7 +359,7 @@ public class ASTRewritingReferenceExpressionTest extends ASTRewritingTest {
rewrite.replace(typeMethodReference.getType(), newType, null);
rewrite.getListRewrite(typeMethodReference, TypeMethodReference.TYPE_ARGUMENTS_PROPERTY).insertFirst(simpleType, null);
rewrite.replace(typeMethodReference.getName(), ast.newSimpleName("bar"), null);
-
+
variableDeclarationStatement = (VariableDeclarationStatement) methodDecl.getBody().statements().get(1);
variableDeclarationFragment = (VariableDeclarationFragment) variableDeclarationStatement.fragments().get(0);
typeMethodReference = (TypeMethodReference) variableDeclarationFragment.getInitializer();
@@ -367,7 +367,7 @@ public class ASTRewritingReferenceExpressionTest extends ASTRewritingTest {
rewrite.replace(typeMethodReference.getType(), newType, null);
ASTNode typeArgument = (ASTNode) typeMethodReference.typeArguments().get(0);
rewrite.getListRewrite(typeMethodReference, TypeMethodReference.TYPE_ARGUMENTS_PROPERTY).remove(typeArgument, null);
- rewrite.replace(typeMethodReference.getName(), ast.newSimpleName("foo"), null);
+ rewrite.replace(typeMethodReference.getName(), ast.newSimpleName("foo"), null);
}
String preview= evaluateRewrite(cu, rewrite);
contents = "package test407131;\n" +
@@ -398,7 +398,7 @@ public class ASTRewritingReferenceExpressionTest extends ASTRewritingTest {
buf= new StringBuffer(contents);
assertEqualString(preview, buf.toString());
}
-
+
/**
* tests various aspects of SuperMethodReference
* @throws Exception
@@ -442,7 +442,7 @@ public class ASTRewritingReferenceExpressionTest extends ASTRewritingTest {
ASTNode typeArgument = (ASTNode) superMethodReference.typeArguments().get(0);
rewrite.getListRewrite(superMethodReference, SuperMethodReference.TYPE_ARGUMENTS_PROPERTY).remove(typeArgument, null);
rewrite.replace(superMethodReference.getName(), ast.newSimpleName("bar"), null);
-
+
variableDeclarationStatement = (VariableDeclarationStatement) methodDecl.getBody().statements().get(1);
variableDeclarationFragment = (VariableDeclarationFragment) variableDeclarationStatement.fragments().get(0);
superMethodReference = (SuperMethodReference) variableDeclarationFragment.getInitializer();
@@ -450,7 +450,7 @@ public class ASTRewritingReferenceExpressionTest extends ASTRewritingTest {
SimpleType simpleType = ast.newSimpleType(ast.newSimpleName("String"));
rewrite.getListRewrite(superMethodReference, SuperMethodReference.TYPE_ARGUMENTS_PROPERTY).insertFirst(simpleType, null);
rewrite.replace(superMethodReference.getName(), ast.newSimpleName("foo"), null);
-
+
}
String preview = evaluateRewrite(cu, rewrite);
contents = "package test407131;\n" +
@@ -539,7 +539,7 @@ public class ASTRewritingReferenceExpressionTest extends ASTRewritingTest {
typeMethodReference.setType(qualifiedType);
typeMethodReference.setName(ast.newSimpleName("foo"));
rewrite.replace(creationReference, typeMethodReference, null);
-
+
// case 2: CreationReference to SuperMethodReference
variableDeclarationStatement = (VariableDeclarationStatement) methodDecl.getBody().statements().get(1);
variableDeclarationFragment = (VariableDeclarationFragment) variableDeclarationStatement.fragments().get(0);
@@ -547,7 +547,7 @@ public class ASTRewritingReferenceExpressionTest extends ASTRewritingTest {
SuperMethodReference superMethodReference = ast.newSuperMethodReference();
superMethodReference.setName(ast.newSimpleName("foo"));
rewrite.replace(creationReference, superMethodReference, null);
-
+
// case 3: TypeMethodReference to SuperMethodReference
variableDeclarationStatement = (VariableDeclarationStatement) methodDecl.getBody().statements().get(2);
variableDeclarationFragment = (VariableDeclarationFragment) variableDeclarationStatement.fragments().get(0);
@@ -555,8 +555,8 @@ public class ASTRewritingReferenceExpressionTest extends ASTRewritingTest {
superMethodReference = ast.newSuperMethodReference();
superMethodReference.setName(ast.newSimpleName("bar"));
superMethodReference.setQualifier(ast.newSimpleName("X"));
- rewrite.replace(typeMethodReference, superMethodReference, null);
-
+ rewrite.replace(typeMethodReference, superMethodReference, null);
+
// case 4: SuperMethodReference to CreationMethodReference
variableDeclarationStatement = (VariableDeclarationStatement) methodDecl.getBody().statements().get(3);
variableDeclarationFragment = (VariableDeclarationFragment) variableDeclarationStatement.fragments().get(0);
@@ -566,8 +566,8 @@ public class ASTRewritingReferenceExpressionTest extends ASTRewritingTest {
creationReference = ast.newCreationReference();
creationReference.setType(parameterizedType);
creationReference.typeArguments().add(ast.newSimpleType(ast.newSimpleName("String")));
- rewrite.replace(superMethodReference, creationReference, null);
-
+ rewrite.replace(superMethodReference, creationReference, null);
+
// case 5: SuperMethodReference to ExpressionMethodReference
variableDeclarationStatement = (VariableDeclarationStatement) methodDecl.getBody().statements().get(4);
variableDeclarationFragment = (VariableDeclarationFragment) variableDeclarationStatement.fragments().get(0);
@@ -575,10 +575,10 @@ public class ASTRewritingReferenceExpressionTest extends ASTRewritingTest {
ExpressionMethodReference expressionMethodReference = ast.newExpressionMethodReference();
expressionMethodReference.setExpression(ast.newQualifiedName(ast.newSimpleName("Y"), ast.newSimpleName("Z")));
expressionMethodReference.setName(ast.newSimpleName("foo"));
- rewrite.replace(superMethodReference, expressionMethodReference, null);
-
+ rewrite.replace(superMethodReference, expressionMethodReference, null);
+
}
-
+
String preview= evaluateRewrite(cu, rewrite);
contents = "package test407131;\n" +
"import java.lang.annotation.*;\n" +
@@ -617,5 +617,5 @@ public class ASTRewritingReferenceExpressionTest extends ASTRewritingTest {
"}\n";
buf= new StringBuffer(contents);
assertEqualString(preview, buf.toString());
- }
+ }
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingStatementsTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingStatementsTest.java
index fae511da9..3e53f561e 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingStatementsTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingStatementsTest.java
@@ -112,7 +112,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
this.project1.setOption(JavaCore.COMPILER_PB_REPORT_PREVIEW_FEATURES, JavaCore.IGNORE);
}
}
-
+
/** @deprecated using deprecated code */
private void internalSetExtraDimensions(VariableDeclarationFragment node, int dimensions) {
if (this.apiLevel < AST.JLS8) {
@@ -403,7 +403,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
assertEqualString(preview, buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=276938
public void testRemoveStatement01() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
@@ -420,7 +420,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
CompilationUnit astRoot= createAST(cu);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
-
+
assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
TypeDeclaration type= findTypeDeclaration(astRoot, "E");
MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
@@ -444,7 +444,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=276938
public void testRemoveStatement02() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
@@ -460,7 +460,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
CompilationUnit astRoot= createAST(cu);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
-
+
assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
TypeDeclaration type= findTypeDeclaration(astRoot, "E");
MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
@@ -484,7 +484,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=276938
public void testRemoveStatement03() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
@@ -500,7 +500,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
CompilationUnit astRoot= createAST(cu);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
-
+
assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
TypeDeclaration type= findTypeDeclaration(astRoot, "E");
MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
@@ -524,7 +524,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=276938
public void testRemoveStatement04() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
@@ -539,7 +539,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
CompilationUnit astRoot= createAST(cu);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
-
+
assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
TypeDeclaration type= findTypeDeclaration(astRoot, "E");
MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
@@ -562,7 +562,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=276938
public void testRemoveStatement05() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
@@ -579,7 +579,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
CompilationUnit astRoot= createAST(cu);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
-
+
assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
TypeDeclaration type= findTypeDeclaration(astRoot, "E");
MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
@@ -604,7 +604,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=276938
public void testRemoveStatement06() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
@@ -621,7 +621,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
CompilationUnit astRoot= createAST(cu);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
-
+
assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
TypeDeclaration type= findTypeDeclaration(astRoot, "E");
MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
@@ -646,7 +646,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=276938
public void testRemoveStatement07() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
@@ -663,7 +663,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
CompilationUnit astRoot= createAST(cu);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
-
+
assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
TypeDeclaration type= findTypeDeclaration(astRoot, "E");
MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
@@ -689,7 +689,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=276938
public void testRemoveStatement08() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
@@ -706,7 +706,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
CompilationUnit astRoot= createAST(cu);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
-
+
assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
TypeDeclaration type= findTypeDeclaration(astRoot, "E");
MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
@@ -731,7 +731,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=276938
public void testRemoveStatement09() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
@@ -748,7 +748,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
CompilationUnit astRoot= createAST(cu);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
-
+
assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
TypeDeclaration type= findTypeDeclaration(astRoot, "E");
MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
@@ -774,7 +774,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=276938
public void testRemoveStatement10() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
@@ -791,9 +791,9 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
CompilationUnit astRoot= createAST(cu);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
-
+
AST ast = astRoot.getAST();
-
+
assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
TypeDeclaration type= findTypeDeclaration(astRoot, "E");
MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
@@ -802,7 +802,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
assertTrue("Number of statements not 4", blockStatements.size() == 4);
{
ASTNode statement = (ASTNode)blockStatements.get(2);
-
+
ListRewrite listRewrite= rewrite.getListRewrite(block, Block.STATEMENTS_PROPERTY);
listRewrite.insertBefore(ast.newBreakStatement(), statement, null);
listRewrite.remove(statement, null);
@@ -821,7 +821,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=276938
public void testRemoveStatement11() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
@@ -838,9 +838,9 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
CompilationUnit astRoot= createAST(cu);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
-
+
AST ast = astRoot.getAST();
-
+
assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
TypeDeclaration type= findTypeDeclaration(astRoot, "E");
MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
@@ -849,7 +849,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
assertTrue("Number of statements not 4", blockStatements.size() == 4);
{
ASTNode statement = (ASTNode)blockStatements.get(2);
-
+
ListRewrite listRewrite= rewrite.getListRewrite(block, Block.STATEMENTS_PROPERTY);
listRewrite.insertAfter(ast.newBreakStatement(), statement, null);
listRewrite.remove(statement, null);
@@ -869,7 +869,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=276938
public void testRemoveStatement12() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
@@ -886,9 +886,9 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
CompilationUnit astRoot= createAST(cu);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
-
+
AST ast = astRoot.getAST();
-
+
assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
TypeDeclaration type= findTypeDeclaration(astRoot, "E");
MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
@@ -1468,23 +1468,23 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createAST(cu, true);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
AST ast= astRoot.getAST();
-
+
TypeDeclaration type= findTypeDeclaration(astRoot, "E");
MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
Block block= methodDecl.getBody();
assertTrue("Parse errors", (block.getFlags() & ASTNode.MALFORMED) == 0);
-
+
List statements= block.statements();
assertTrue("Number of statements not 1", statements.size() == 1);
-
+
{ // replace body statement with body
DoStatement doStatement= (DoStatement) statements.get(0);
-
-
+
+
TryStatement newTry= ast.newTryStatement();
newTry.getBody().statements().add(ast.newReturnStatement());
CatchClause newCatchClause= ast.newCatchClause();
@@ -1500,13 +1500,13 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
resource.setType(ast.newSimpleType(ast.newSimpleName("Reader")));
rewrite.getListRewrite(newTry, getResourcesProperty()).insertLast(resource, null);
-
+
rewrite.replace(doStatement.getBody(), newTry, null);
}
-
-
+
+
String preview= evaluateRewrite(cu, rewrite);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
@@ -3415,7 +3415,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
assertEqualString(preview, buf.toString());
}
-
+
public void testReturnStatement2() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new StringBuffer();
@@ -3450,7 +3450,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
rewrite.replace(expression, newExpression, null);
}
-
+
{ // replace expression "A" in return"A"+"B"
ReturnStatement statement= (ReturnStatement) statements.get(1);
@@ -3459,12 +3459,12 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
assertTrue("Is not an InfixExpression", expression instanceof InfixExpression);
Expression leftOperand = ((InfixExpression)expression).getLeftOperand();
assertTrue("Has no leftOperand", leftOperand != null);
-
+
SimpleName newExpression= ast.newSimpleName("x");
rewrite.replace(leftOperand, newExpression, null);
}
-
+
{ // replace expression (1) in return(1) * 2 + 3
ReturnStatement statement= (ReturnStatement) statements.get(2);
@@ -3476,7 +3476,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
assertTrue("Is not an InfixExpression", leftOperand instanceof InfixExpression);
Expression leftOperand2 = ((InfixExpression)leftOperand).getLeftOperand();
assertTrue("Has no leftOperand2", leftOperand2 != null);
-
+
SimpleName newExpression= ast.newSimpleName("x");
rewrite.replace(leftOperand2, newExpression, null);
@@ -3722,15 +3722,15 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
assertEqualString(preview, buf.toString());
}
-
+
@SuppressWarnings("deprecation")
public void testSwitchStatement2() throws Exception {
String previousValue = null;
try {
previousValue = this.project1.getOption(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH, false);
-
+
this.project1.setOption(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH, DefaultCodeFormatterConstants.FALSE);
-
+
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test1;\n");
@@ -3751,12 +3751,12 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createAST(cu);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
-
+
AST ast= astRoot.getAST();
-
+
assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
TypeDeclaration type= findTypeDeclaration(astRoot, "E");
MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
@@ -3765,14 +3765,14 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
assertTrue("Number of statements not 2", blockStatements.size() == 2);
{ // insert statements, replace expression
SwitchStatement switchStatement= (SwitchStatement) blockStatements.get(0);
-
+
ASTNode expression= switchStatement.getExpression();
SimpleName newExpression= ast.newSimpleName("x");
rewrite.replace(expression, newExpression, null);
-
+
List statements= switchStatement.statements();
assertTrue("Number of statements not 0", statements.size() == 0);
-
+
SwitchCase caseStatement1= ast.newSwitchCase();
if (this.apiLevel < AST.JLS14) {
caseStatement1.setExpression(ast.newNumberLiteral("1"));
@@ -3780,32 +3780,32 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
else {
caseStatement1.expressions().add(ast.newNumberLiteral("1"));
}
-
+
Statement statement1= ast.newReturnStatement();
-
+
SwitchCase caseStatement2= ast.newSwitchCase(); // default
if (this.apiLevel < AST.JLS14) {
caseStatement2.setExpression(null);
}
-
+
ListRewrite listRewrite= rewrite.getListRewrite(switchStatement, SwitchStatement.STATEMENTS_PROPERTY);
listRewrite.insertLast(caseStatement1, null);
listRewrite.insertLast(statement1, null);
listRewrite.insertLast(caseStatement2, null);
}
-
+
{ // insert, remove, replace statements, change case statements
SwitchStatement switchStatement= (SwitchStatement) blockStatements.get(1);
-
+
List statements= switchStatement.statements();
assertTrue("Number of statements not 8", statements.size() == 8);
-
+
// remove statements
-
+
rewrite.remove((ASTNode) statements.get(0), null);
rewrite.remove((ASTNode) statements.get(1), null);
rewrite.remove((ASTNode) statements.get(2), null);
-
+
// change case statement
SwitchCase caseStatement= (SwitchCase) statements.get(3);
Expression newCaseExpression= ast.newNumberLiteral("10");
@@ -3816,9 +3816,9 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
ListRewrite listRewrite2= rewrite.getListRewrite(caseStatement, SwitchCase.EXPRESSIONS2_PROPERTY);
listRewrite2.replace((Expression)expressions.get(0), newCaseExpression, null);
}
-
+
ListRewrite listRewrite= rewrite.getListRewrite(switchStatement, SwitchStatement.STATEMENTS_PROPERTY);
-
+
{
// insert case statement
SwitchCase caseStatement2= ast.newSwitchCase();
@@ -3827,15 +3827,15 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
}
else {
caseStatement2.expressions().add(ast.newNumberLiteral("11"));
-
+
}
listRewrite.insertFirst(caseStatement2, null);
-
+
// insert statement
Statement statement1= ast.newReturnStatement();
listRewrite.insertAfter(statement1, caseStatement2, null);
}
-
+
{
// insert case statement
SwitchCase caseStatement2= ast.newSwitchCase();
@@ -3846,17 +3846,17 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
caseStatement2.expressions().add(ast.newNumberLiteral("12"));
}
listRewrite.insertLast(caseStatement2, null);
-
+
// insert statement
Statement statement1= ast.newReturnStatement();
listRewrite.insertAfter(statement1, caseStatement2, null);
}
-
-
+
+
}
-
+
String preview= evaluateRewrite(cu, rewrite);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
@@ -3886,14 +3886,14 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
}
}
}
-
+
public void testSwitchStatement3() throws Exception {
String previousValue = null;
try {
previousValue = this.project1.getOption(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH, false);
-
+
this.project1.setOption(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH, DefaultCodeFormatterConstants.FALSE);
-
+
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test1;\n");
@@ -3909,12 +3909,12 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createAST(cu);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
-
+
AST ast= astRoot.getAST();
-
+
assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
TypeDeclaration type= findTypeDeclaration(astRoot, "E");
MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
@@ -3923,20 +3923,20 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
assertTrue("Number of statements not 2", blockStatements.size() == 1);
{ // insert statements, replace expression
SwitchStatement switchStatement= (SwitchStatement) blockStatements.get(0);
-
+
List statements= switchStatement.statements();
assertTrue("Number of statements not 0", statements.size() == 5);
-
+
SwitchCase caseStatement = (SwitchCase)statements.get(2);
-
+
BreakStatement breakStatement= ast.newBreakStatement();
-
+
ListRewrite listRewrite= rewrite.getListRewrite(switchStatement, SwitchStatement.STATEMENTS_PROPERTY);
listRewrite.insertBefore(breakStatement, caseStatement, null);
}
-
+
String preview= evaluateRewrite(cu, rewrite);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
@@ -3958,7 +3958,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
}
}
}
-
+
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=246627
* Insert a statement before an unchanged statement (and preceded by an unchanged statement)
@@ -3967,9 +3967,9 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
String previousValue = null;
try {
previousValue = this.project1.getOption(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH, false);
-
+
this.project1.setOption(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH, DefaultCodeFormatterConstants.FALSE);
-
+
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test1;\n");
@@ -3984,12 +3984,12 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createAST(cu);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
-
+
AST ast= astRoot.getAST();
-
+
assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
TypeDeclaration type= findTypeDeclaration(astRoot, "E");
MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
@@ -3998,18 +3998,18 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
assertTrue("Number of statements not 1", blockStatements.size() == 1);
{ // insert statements, replace expression
SwitchStatement switchStatement= (SwitchStatement) blockStatements.get(0);
-
+
List statements= switchStatement.statements();
assertTrue("Number of statements not 4", statements.size() == 4);
-
+
SwitchCase caseStatement = (SwitchCase)statements.get(2); // case 2:
-
+
ListRewrite listRewrite= rewrite.getListRewrite(switchStatement, SwitchStatement.STATEMENTS_PROPERTY);
listRewrite.insertBefore(ast.newBreakStatement(), caseStatement, null);
}
-
+
String preview= evaluateRewrite(cu, rewrite);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
@@ -4030,7 +4030,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
}
}
}
-
+
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=246627
* Insert a statement after an unchanged statement (and preceded by an unchanged statement)
@@ -4039,9 +4039,9 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
String previousValue = null;
try {
previousValue = this.project1.getOption(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH, false);
-
+
this.project1.setOption(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH, DefaultCodeFormatterConstants.FALSE);
-
+
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test1;\n");
@@ -4056,12 +4056,12 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createAST(cu);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
-
+
AST ast= astRoot.getAST();
-
+
assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
TypeDeclaration type= findTypeDeclaration(astRoot, "E");
MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
@@ -4070,18 +4070,18 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
assertTrue("Number of statements not 1", blockStatements.size() == 1);
{ // insert statements, replace expression
SwitchStatement switchStatement= (SwitchStatement) blockStatements.get(0);
-
+
List statements= switchStatement.statements();
assertTrue("Number of statements not 4", statements.size() == 4);
-
+
ExpressionStatement assignment = (ExpressionStatement)statements.get(1); // i= 1;
-
+
ListRewrite listRewrite= rewrite.getListRewrite(switchStatement, SwitchStatement.STATEMENTS_PROPERTY);
listRewrite.insertAfter(ast.newBreakStatement(), assignment, null);
}
-
+
String preview= evaluateRewrite(cu, rewrite);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
@@ -4102,7 +4102,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
}
}
}
-
+
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=246627
* Replace a statement preceded by an unchanged statement)
@@ -4112,9 +4112,9 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
String previousValue = null;
try {
previousValue = this.project1.getOption(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH, false);
-
+
this.project1.setOption(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH, DefaultCodeFormatterConstants.FALSE);
-
+
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test1;\n");
@@ -4129,12 +4129,12 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createAST(cu);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
-
+
AST ast= astRoot.getAST();
-
+
assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
TypeDeclaration type= findTypeDeclaration(astRoot, "E");
MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
@@ -4143,12 +4143,12 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
assertTrue("Number of statements not 1", blockStatements.size() == 1);
{ // insert statements, replace expression
SwitchStatement switchStatement= (SwitchStatement) blockStatements.get(0);
-
+
List statements= switchStatement.statements();
assertTrue("Number of statements not 4", statements.size() == 4);
-
+
ExpressionStatement assignment = (ExpressionStatement)statements.get(1); // i= 1;:
-
+
SwitchCase switchCase = ast.newSwitchCase();
if (this.apiLevel < AST.JLS14) {
switchCase.setExpression(ast.newNumberLiteral("2"));
@@ -4156,13 +4156,13 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
else {
switchCase.expressions().add(ast.newNumberLiteral("2"));
}
-
+
ListRewrite listRewrite= rewrite.getListRewrite(switchStatement, SwitchStatement.STATEMENTS_PROPERTY);
listRewrite.replace(assignment, switchCase, null);
}
-
+
String preview= evaluateRewrite(cu, rewrite);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
@@ -4182,7 +4182,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
}
}
}
-
+
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=246627
* Remove a statement preceded by an unchanged statement)
@@ -4191,9 +4191,9 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
String previousValue = null;
try {
previousValue = this.project1.getOption(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH, false);
-
+
this.project1.setOption(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH, DefaultCodeFormatterConstants.FALSE);
-
+
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test1;\n");
@@ -4208,10 +4208,10 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createAST(cu);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
-
+
assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
TypeDeclaration type= findTypeDeclaration(astRoot, "E");
MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
@@ -4220,18 +4220,18 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
assertTrue("Number of statements not 1", blockStatements.size() == 1);
{ // insert statements, replace expression
SwitchStatement switchStatement= (SwitchStatement) blockStatements.get(0);
-
+
List statements= switchStatement.statements();
assertTrue("Number of statements not 4", statements.size() == 4);
-
+
ExpressionStatement assignment = (ExpressionStatement)statements.get(1); // i= 1;:
-
+
ListRewrite listRewrite= rewrite.getListRewrite(switchStatement, SwitchStatement.STATEMENTS_PROPERTY);
listRewrite.remove(assignment, null);
}
-
+
String preview= evaluateRewrite(cu, rewrite);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
@@ -4250,7 +4250,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
}
}
}
-
+
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=246627
* Remove a statement followed by an inserted statement)
@@ -4260,9 +4260,9 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
String previousValue = null;
try {
previousValue = this.project1.getOption(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH, false);
-
+
this.project1.setOption(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH, DefaultCodeFormatterConstants.FALSE);
-
+
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test1;\n");
@@ -4277,12 +4277,12 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createAST(cu);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
-
+
AST ast= astRoot.getAST();
-
+
assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
TypeDeclaration type= findTypeDeclaration(astRoot, "E");
MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
@@ -4291,12 +4291,12 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
assertTrue("Number of statements not 1", blockStatements.size() == 1);
{ // insert statements, replace expression
SwitchStatement switchStatement= (SwitchStatement) blockStatements.get(0);
-
+
List statements= switchStatement.statements();
assertTrue("Number of statements not 4", statements.size() == 4);
-
+
ExpressionStatement assignment = (ExpressionStatement)statements.get(1); // i= 1;
-
+
SwitchCase switchCase = ast.newSwitchCase();
if (this.apiLevel < AST.JLS14) {
switchCase.setExpression(ast.newNumberLiteral("2"));
@@ -4304,14 +4304,14 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
else {
switchCase.expressions().add(ast.newNumberLiteral("2"));
}
-
+
ListRewrite listRewrite= rewrite.getListRewrite(switchStatement, SwitchStatement.STATEMENTS_PROPERTY);
listRewrite.remove(assignment, null);
listRewrite.insertAfter(switchCase, assignment, null);
}
-
+
String preview= evaluateRewrite(cu, rewrite);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
@@ -4331,7 +4331,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
}
}
}
-
+
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=246627
* Remove a statement preceded by an inserted statement)
@@ -4340,9 +4340,9 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
String previousValue = null;
try {
previousValue = this.project1.getOption(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH, false);
-
+
this.project1.setOption(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH, DefaultCodeFormatterConstants.FALSE);
-
+
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test1;\n");
@@ -4357,12 +4357,12 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createAST(cu);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
-
+
AST ast= astRoot.getAST();
-
+
assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
TypeDeclaration type= findTypeDeclaration(astRoot, "E");
MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
@@ -4371,19 +4371,19 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
assertTrue("Number of statements not 1", blockStatements.size() == 1);
{ // insert statements, replace expression
SwitchStatement switchStatement= (SwitchStatement) blockStatements.get(0);
-
+
List statements= switchStatement.statements();
assertTrue("Number of statements not 4", statements.size() == 4);
-
+
ExpressionStatement assignment = (ExpressionStatement)statements.get(1); // i= 1;:
-
+
ListRewrite listRewrite= rewrite.getListRewrite(switchStatement, SwitchStatement.STATEMENTS_PROPERTY);
listRewrite.insertBefore(ast.newBreakStatement(), assignment, null);
listRewrite.remove(assignment, null);
}
-
+
String preview= evaluateRewrite(cu, rewrite);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
@@ -4403,15 +4403,15 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
}
}
}
-
+
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=276938
public void testSwitchStatement11() throws Exception {
String previousValue = null;
try {
previousValue = this.project1.getOption(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH, false);
-
+
this.project1.setOption(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH, DefaultCodeFormatterConstants.FALSE);
-
+
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test1;\n");
@@ -4424,10 +4424,10 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createAST(cu);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
-
+
assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
TypeDeclaration type= findTypeDeclaration(astRoot, "E");
MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
@@ -4436,18 +4436,18 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
assertTrue("Number of statements not 1", blockStatements.size() == 1);
{ // insert statements, replace expression
SwitchStatement switchStatement= (SwitchStatement) blockStatements.get(0);
-
+
List statements= switchStatement.statements();
assertTrue("Number of statements not 5", statements.size() == 5);
-
+
BreakStatement breakStatement = (BreakStatement)statements.get(2); // break;:
-
+
ListRewrite listRewrite= rewrite.getListRewrite(switchStatement, SwitchStatement.STATEMENTS_PROPERTY);
listRewrite.remove(breakStatement, null);
}
-
+
String preview= evaluateRewrite(cu, rewrite);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
@@ -4465,15 +4465,15 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
}
}
}
-
+
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=276938
public void testSwitchStatement12() throws Exception {
String previousValue = null;
try {
previousValue = this.project1.getOption(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH, false);
-
+
this.project1.setOption(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH, DefaultCodeFormatterConstants.FALSE);
-
+
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test1;\n");
@@ -4485,10 +4485,10 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createAST(cu);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
-
+
assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
TypeDeclaration type= findTypeDeclaration(astRoot, "E");
MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
@@ -4497,18 +4497,18 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
assertTrue("Number of statements not 1", blockStatements.size() == 1);
{ // insert statements, replace expression
SwitchStatement switchStatement= (SwitchStatement) blockStatements.get(0);
-
+
List statements= switchStatement.statements();
assertTrue("Number of statements not 5", statements.size() == 5);
-
+
BreakStatement breakStatement = (BreakStatement)statements.get(2); // break;:
-
+
ListRewrite listRewrite= rewrite.getListRewrite(switchStatement, SwitchStatement.STATEMENTS_PROPERTY);
listRewrite.remove(breakStatement, null);
}
-
+
String preview= evaluateRewrite(cu, rewrite);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
@@ -4531,9 +4531,9 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
String previousValue = null;
try {
previousValue = this.project1.getOption(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH, false);
-
+
this.project1.setOption(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH, DefaultCodeFormatterConstants.FALSE);
-
+
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test1;\n");
@@ -4563,13 +4563,13 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
TextEdit res= rewrite.rewriteAST(document1, null);
res.apply(document1);
String preview = document1.get();
-
+
buf= new StringBuffer();
- buf.append("package test1;\n");
- buf.append("public class E {\n");
+ buf.append("package test1;\n");
+ buf.append("public class E {\n");
buf.append(" public void foo(int i) {\n");
- buf.append(" switch(4){\n");
- buf.append(" case 4:break;default:System.out.println(\"Not 4\");\n");
+ buf.append(" switch(4){\n");
+ buf.append(" case 4:break;default:System.out.println(\"Not 4\");\n");
buf.append(" case 5:\n");
buf.append(" System.out.println(\"This is 5\");break;\n");
buf.append(" }\n");
@@ -5014,7 +5014,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createAST(cu);
AST ast= astRoot.getAST();
ASTRewrite rewrite= ASTRewrite.create(ast);
@@ -5027,19 +5027,19 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
assertTrue("Number of statements not 1", blockStatements.size() == 1);
{ // replace catch exception type with a union type
TryStatement tryStatement= (TryStatement) blockStatements.get(0);
-
+
List catchClauses= tryStatement.catchClauses();
-
+
CatchClause catchClause= (CatchClause) catchClauses.get(0);
SingleVariableDeclaration exception = catchClause.getException();
UnionType unionType = ast.newUnionType();
unionType.types().add(ast.newSimpleType(ast.newSimpleName("IOException")));
unionType.types().add(ast.newSimpleType(ast.newSimpleName("Exception")));
rewrite.set(exception, SingleVariableDeclaration.TYPE_PROPERTY, unionType, null);
- }
-
+ }
+
String preview= evaluateRewrite(cu, rewrite);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
@@ -5072,11 +5072,11 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createAST(cu);
AST ast= astRoot.getAST();
ASTRewrite rewrite= ASTRewrite.create(ast);
-
+
assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
TypeDeclaration type= findTypeDeclaration(astRoot, "E");
MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
@@ -5085,23 +5085,23 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
assertTrue("Number of statements not 1", blockStatements.size() == 1);
{ // replace catch exception type with a union type
TryStatement tryStatement= (TryStatement) blockStatements.get(0);
-
+
List catchClauses= tryStatement.catchClauses();
-
+
CatchClause catchClause= (CatchClause) catchClauses.get(0);
SingleVariableDeclaration exception = catchClause.getException();
UnionType unionType = (UnionType) exception.getType();
-
+
SimpleType exceptionType = (SimpleType) unionType.types().get(0);
rewrite.getListRewrite(unionType, UnionType.TYPES_PROPERTY)
.replace(
exceptionType,
ast.newSimpleType(ast.newSimpleName("FileNotFoundException")),
null);
- }
-
+ }
+
String preview= evaluateRewrite(cu, rewrite);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
@@ -5135,7 +5135,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createAST(cu);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
@@ -5147,12 +5147,12 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
assertTrue("Number of statements not 1", blockStatements.size() == 1);
{ // remove finally
TryStatement tryStatement= (TryStatement) blockStatements.get(0);
-
+
rewrite.remove(tryStatement.getFinally(), null);
- }
-
+ }
+
String preview= evaluateRewrite(cu, rewrite);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
@@ -5188,7 +5188,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createAST(cu);
AST ast= astRoot.getAST();
ASTRewrite rewrite= ASTRewrite.create(ast);
@@ -5201,18 +5201,18 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
assertTrue("Number of statements not 2", blockStatements.size() == 2);
{ // add catch, replace finally
TryStatement tryStatement= (TryStatement) blockStatements.get(0);
-
+
CatchClause catchClause= ast.newCatchClause();
SingleVariableDeclaration decl= ast.newSingleVariableDeclaration();
decl.setType(ast.newSimpleType(ast.newSimpleName("IOException")));
decl.setName(ast.newSimpleName("e"));
catchClause.setException(decl);
-
+
rewrite.getListRewrite(tryStatement, TryStatement.CATCH_CLAUSES_PROPERTY).insertLast(catchClause, null);
-
+
Block body= ast.newBlock();
body.statements().add(ast.newReturnStatement());
-
+
rewrite.replace(tryStatement.getFinally(), body, null);
}
{ // add resource
@@ -5227,23 +5227,23 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
}
{ // replace catch, remove finally
TryStatement tryStatement= (TryStatement) blockStatements.get(1);
-
+
List catchClauses= tryStatement.catchClauses();
-
+
CatchClause catchClause= ast.newCatchClause();
SingleVariableDeclaration decl= ast.newSingleVariableDeclaration();
decl.setType(ast.newSimpleType(ast.newSimpleName("Exception")));
decl.setName(ast.newSimpleName("x"));
catchClause.setException(decl);
-
+
rewrite.replace((ASTNode) catchClauses.get(0), catchClause, null);
-
+
rewrite.remove(tryStatement.getFinally(), null);
}
-
-
+
+
String preview= evaluateRewrite(cu, rewrite);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
@@ -5288,7 +5288,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createAST(cu);
AST ast= astRoot.getAST();
ASTRewrite rewrite= ASTRewrite.create(ast);
@@ -5301,16 +5301,16 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
assertTrue("Number of statements not 1", blockStatements.size() == 1);
{ // rename resource
TryStatement tryStatement= (TryStatement) blockStatements.get(0);
-
+
VariableDeclarationExpression resource = (VariableDeclarationExpression) tryStatement.resources().get(0);
VariableDeclarationFragment fragment = (VariableDeclarationFragment) resource.fragments().get(0);
-
+
rewrite.set(fragment, VariableDeclarationFragment.NAME_PROPERTY, ast.newSimpleName("r1"), null);
}
-
-
+
+
String preview= evaluateRewrite(cu, rewrite);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
@@ -5379,7 +5379,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
TextEdit res= rewrite.rewriteAST(document1, null);
res.apply(document1);
String preview = document1.get();
-
+
buf= new StringBuffer();
buf.append("package test0017;\n");
buf.append("\n");
@@ -6158,8 +6158,8 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
assertEqualString(preview, buf.toString());
}
-
-
+
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=350285
// Test that converting a multi catch into a normal catch using complete block copy doesn't change indentation
public void testTryStatementWithMultiCatch1_since_4() throws Exception {
@@ -6195,7 +6195,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
List catchClauses= tryStatement.catchClauses();
assertTrue("Number of catch clauses not 1", catchClauses.size() == 1);
CatchClause catchClause = (CatchClause) catchClauses.get(0);
-
+
SingleVariableDeclaration singleVariableDeclaration= catchClause.getException();
UnionType unionType = (UnionType) singleVariableDeclaration.getType();
List types = unionType.types();
@@ -6270,7 +6270,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
List catchClauses= tryStatement.catchClauses();
assertTrue("Number of catch clauses not 1", catchClauses.size() == 1);
CatchClause catchClause = (CatchClause) catchClauses.get(0);
-
+
SingleVariableDeclaration singleVariableDeclaration= catchClause.getException();
UnionType unionType = (UnionType) singleVariableDeclaration.getType();
List types = unionType.types();
@@ -6357,7 +6357,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
ArrayType creationType = creation.getType();
ArrayType newArrayType = (ArrayType) ASTNode.copySubtree(ast, creationType);
newArrayType.dimensions().add(ast.newDimension());
-
+
Dimension dim0 = ast.newDimension();
markerAnnotation= ast.newMarkerAnnotation();
markerAnnotation.setTypeName(ast.newSimpleName("Annot3"));
@@ -6431,7 +6431,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
expressions = creation.dimensions();
listRewrite = rewrite.getListRewrite(creation, ArrayCreation.DIMENSIONS_PROPERTY);
- Expression expression = ast.newNumberLiteral("10");
+ Expression expression = ast.newNumberLiteral("10");
listRewrite.replace((ASTNode) expressions.get(1), expression, null);
MethodInvocation invoc = ast.newMethodInvocation();
@@ -6540,12 +6540,12 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
buf.append("@interface Annot3 {}\n");
assertEqualString(preview, buf.toString());
}
-
+
public void testBug413592a_since_8() throws Exception {
String buf = "default int func2(){return 1;}";
Document doc = new Document(buf);
String formattedString = "\tdefault int func2() {\n" +
- "\t\treturn 1;\n" +
+ "\t\treturn 1;\n" +
"\t}";
Hashtable options = JavaCore.getOptions();
options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_8);
@@ -6558,7 +6558,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
String buf = "default int func2(){return 2*(3+4)/5/(6+7);}";
Document doc = new Document(buf);
String formattedString = "\tdefault int func2() {\n" +
- "\t\treturn 2 * (3 + 4) / 5 / (6 + 7);\n" +
+ "\t\treturn 2 * (3 + 4) / 5 / (6 + 7);\n" +
"\t}";
Hashtable options = JavaCore.getOptions();
options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_8);
@@ -6861,7 +6861,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
markerAnnotation.setTypeName(ast.newSimpleName("Annot1"));
listRewrite.insertAt(markerAnnotation, 0, null);
}
-
+
String preview= evaluateRewrite(cu, rewrite);
buf= new StringBuffer();
buf.append("package test1;\n");
@@ -6922,7 +6922,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
markerAnnotation.setTypeName(ast.newSimpleName("Annot1"));
listRewrite.insertAt(markerAnnotation, 0, null);
}
-
+
String preview= evaluateRewrite(cu, rewrite);
buf= new StringBuffer();
buf.append("package test1;\n");
@@ -7052,7 +7052,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
buf.append("@interface Annot1 {}\n");
assertEqualString(preview, buf.toString());
}
-
+
public void testBug417923i_since_8() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new StringBuffer();
@@ -7112,7 +7112,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
buf.append("@interface Annot1 {}\n");
assertEqualString(preview, buf.toString());
}
-
+
public void testBug417923j_since_8() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new StringBuffer();
@@ -7355,7 +7355,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
{
VariableDeclarationStatement statement = (VariableDeclarationStatement) statements.get(2);
ArrayType arrayType = (ArrayType) statement.getType();
-
+
SingleMemberAnnotation annotation = ast.newSingleMemberAnnotation();
annotation.setTypeName(ast.newSimpleName("Annot2"));
ArrayType type = ast.newArrayType(ast.newPrimitiveType(PrimitiveType.FLOAT), 1);
@@ -7432,10 +7432,10 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
fragment.setName(ast.newSimpleName("i"));
VariableDeclarationStatement statement = ast.newVariableDeclarationStatement(fragment);
statement.setType(arrayType);
-
+
ListRewrite listRewrite= rewrite.getListRewrite(block, Block.STATEMENTS_PROPERTY);
listRewrite.insertFirst(statement, null);
-
+
}
{
ArrayType arrayType = ast.newArrayType(ast.newPrimitiveType(PrimitiveType.INT), 2);
@@ -7450,19 +7450,19 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
VariableDeclarationFragment fragment = ast.newVariableDeclarationFragment();
fragment.setName(ast.newSimpleName("j"));
fragment.setInitializer(creation);
-
+
arrayType = ast.newArrayType(ast.newPrimitiveType(PrimitiveType.INT), 2);
dim = (Dimension) arrayType.dimensions().get(1);
markerAnnotation = ast.newMarkerAnnotation();
markerAnnotation.setTypeName(ast.newName("Marker"));
dim.annotations().add(markerAnnotation);
-
+
VariableDeclarationStatement statement = ast.newVariableDeclarationStatement(fragment);
statement.setType(arrayType);
-
+
ListRewrite listRewrite= rewrite.getListRewrite(block, Block.STATEMENTS_PROPERTY);
listRewrite.insertLast(statement, null);
-
+
}
{
ArrayType arrayType = ast.newArrayType(ast.newPrimitiveType(PrimitiveType.INT), 2);
@@ -7470,7 +7470,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
MarkerAnnotation markerAnnotation = ast.newMarkerAnnotation();
markerAnnotation.setTypeName(ast.newSimpleName("Marker"));
dim.annotations().add(markerAnnotation);
-
+
NormalAnnotation normalAnnotation = ast.newNormalAnnotation();
normalAnnotation.setTypeName(ast.newSimpleName("Annot1"));
MemberValuePair memberValuePair= ast.newMemberValuePair();
@@ -7490,7 +7490,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
literal.setType(type);
singleMemberAnnotation.setValue(literal);
dim.annotations().add(singleMemberAnnotation);
-
+
ArrayCreation creation = ast.newArrayCreation();
creation.setType(arrayType);
creation.dimensions().add(ast.newNumberLiteral("1"));
@@ -7498,13 +7498,13 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
VariableDeclarationFragment fragment = ast.newVariableDeclarationFragment();
fragment.setName(ast.newSimpleName("k"));
fragment.setInitializer(creation);
-
+
arrayType = ast.newArrayType(ast.newPrimitiveType(PrimitiveType.INT), 2);
dim = (Dimension) arrayType.dimensions().get(0);
markerAnnotation = ast.newMarkerAnnotation();
markerAnnotation.setTypeName(ast.newName("Marker"));
dim.annotations().add(markerAnnotation);
-
+
normalAnnotation = ast.newNormalAnnotation();
normalAnnotation.setTypeName(ast.newSimpleName("Annot1"));
memberValuePair= ast.newMemberValuePair();
@@ -7516,7 +7516,7 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
memberValuePair.setValue(ast.newNumberLiteral("2"));
normalAnnotation.values().add(memberValuePair);
dim.annotations().add(normalAnnotation);
-
+
singleMemberAnnotation = ast.newSingleMemberAnnotation();
singleMemberAnnotation.setTypeName(ast.newSimpleName("Annot2"));
type = ast.newArrayType(ast.newPrimitiveType(PrimitiveType.FLOAT), 1);
@@ -7526,10 +7526,10 @@ public class ASTRewritingStatementsTest extends ASTRewritingTest {
dim.annotations().add(singleMemberAnnotation);
VariableDeclarationStatement statement = ast.newVariableDeclarationStatement(fragment);
statement.setType(arrayType);
-
+
ListRewrite listRewrite= rewrite.getListRewrite(block, Block.STATEMENTS_PROPERTY);
listRewrite.insertLast(statement, null);
-
+
}
String preview= evaluateRewrite(cu, rewrite);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingSwitchExpressionsTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingSwitchExpressionsTest.java
index 2d630fb0d..c2482a69b 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingSwitchExpressionsTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingSwitchExpressionsTest.java
@@ -63,7 +63,7 @@ public class ASTRewritingSwitchExpressionsTest extends ASTRewritingTest {
this.project1.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_14);
}
}
-
+
@SuppressWarnings("rawtypes")
public void testSwitchExpressions_since_12() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
@@ -110,7 +110,7 @@ public class ASTRewritingSwitchExpressionsTest extends ASTRewritingTest {
caseStatement1.setSwitchLabeledRule(true);
caseStatement1.expressions().add(ast.newNumberLiteral("1"));
caseStatement1.expressions().add(ast.newNumberLiteral("2"));
-
+
Statement statement1= ast.newReturnStatement();
@@ -786,10 +786,10 @@ public class ASTRewritingSwitchExpressionsTest extends ASTRewritingTest {
builder.append("package test1;\n");
builder.append("public class X {\n");
builder.append(" public String foo(int i) {\n" +
- " String ret = switch(i%2) {\n" +
- " case 0 -> \"even\";\n" +
- " default -> \"\";\n" +
- " };\n" +
+ " String ret = switch(i%2) {\n" +
+ " case 0 -> \"even\";\n" +
+ " default -> \"\";\n" +
+ " };\n" +
" return ret;");
builder.append(" }\n");
builder.append("}\n");
@@ -818,7 +818,7 @@ public class ASTRewritingSwitchExpressionsTest extends ASTRewritingTest {
rewrite.set(cse1, SwitchCase.SWITCH_LABELED_RULE_PROPERTY, Boolean.FALSE, null);
SwitchCase cse2 = (SwitchCase) statements.get(2);
rewrite.set(cse2, SwitchCase.SWITCH_LABELED_RULE_PROPERTY, Boolean.FALSE, null);
-
+
ListRewrite listRewrite= rewrite.getListRewrite(initializer, SwitchExpression.STATEMENTS_PROPERTY);
SwitchCase caseStatement1= ast.newSwitchCase();
caseStatement1.setSwitchLabeledRule(false);
@@ -836,12 +836,12 @@ public class ASTRewritingSwitchExpressionsTest extends ASTRewritingTest {
builder.append("package test1;\n");
builder.append("public class X {\n");
builder.append(" public String foo(int i) {\n" +
- " String ret = switch(i%2) {\n" +
- " case 0 : \"even\";\n" +
+ " String ret = switch(i%2) {\n" +
+ " case 0 : \"even\";\n" +
" case 1:\n" +
- " \"odd\";\n" +
- " default : \"\";\n" +
- " };\n" +
+ " \"odd\";\n" +
+ " default : \"\";\n" +
+ " };\n" +
" return ret;");
builder.append(" }\n");
builder.append("}\n");
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingTest.java
index 4e51fcf73..1300f0bac 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingTest.java
@@ -46,7 +46,7 @@ import junit.framework.TestSuite;
/**
* Tests for ASTRewrite. Subclasses must have 2 constructors that forward to
* constructors with the same signature as this class's constructors.
- *
+ *
* Test methods can end with:
* <ul>
* <li>"_since_<i>n</i>", where <i>n</i> is an AST.JLS* constant value:
@@ -82,7 +82,7 @@ public class ASTRewritingTest extends AbstractJavaModelTests {
/** @deprecated using deprecated code */
private final static int JLS10_INTERNAL = AST.JLS10;
-
+
private final static int JLS14_INTERNAL = AST.JLS14;
private final static int[] JLS_LEVELS = { JLS2_INTERNAL, JLS3_INTERNAL, JLS4_INTERNAL, JLS8_INTERNAL, JLS9_INTERNAL, JLS10_INTERNAL, JLS14_INTERNAL };
@@ -109,7 +109,7 @@ public class ASTRewritingTest extends AbstractJavaModelTests {
}
/**
- * Creates an instance of a test at a particular AST level. All sub tests of ASTRewritingTest must have a constructor
+ * Creates an instance of a test at a particular AST level. All sub tests of ASTRewritingTest must have a constructor
* with the specified parameters.
*
* @param name name of the test method
@@ -122,15 +122,15 @@ public class ASTRewritingTest extends AbstractJavaModelTests {
public static Test suite() {
TestSuite suite= new TestSuite(ASTRewritingTest.class.getName());
-
-
+
+
suite.addTest(ASTRewritingExpressionsTest.suite());
suite.addTest(ASTRewritingInsertBoundTest.suite());
suite.addTest(ASTRewritingMethodDeclTest.suite());
suite.addTest(ASTRewritingMoveCodeTest.suite());
suite.addTest(ASTRewritingStatementsTest.suite());
suite.addTest(ASTRewritingSwitchExpressionsTest.suite());
-
+
suite.addTest(ASTRewritingTrackingTest.suite());
suite.addTest(ASTRewritingJavadocTest.suite());
suite.addTest(ASTRewritingTypeAnnotationsTest.suite());
@@ -146,13 +146,13 @@ public class ASTRewritingTest extends AbstractJavaModelTests {
suite.addTest(SourceModifierTest.suite());
suite.addTest(ImportRewriteTest.suite());
suite.addTest(ImportRewrite18Test.suite());
-
+
return suite;
}
/**
* Creates a test suite according to the rules in {@link ASTRewritingTest}.
- *
+ *
* @param testClass subclass of ASTRewritingTest
* @return test suite that runs all tests with all supported AST levels
*/
@@ -162,7 +162,7 @@ public class ASTRewritingTest extends AbstractJavaModelTests {
/**
* Creates a test suite according to the rules in {@link ASTRewritingTest}.
- *
+ *
* @param testClass subclass of ASTRewritingTest
* @param classSince smallest supported AST level for this test class, or -1 to support all levels
* @return test suite that runs all tests with all supported AST levels
@@ -175,7 +175,7 @@ public class ASTRewritingTest extends AbstractJavaModelTests {
for (int i = 0, max = methods.length; i < max; i++) {
String name = methods[i].getName();
if (name.startsWith("test")) { //$NON-NLS-1$
-
+
int index = name.indexOf(ONLY_AST_STRING);
if (index != -1) {
String suffix = name.substring(index + ONLY_AST_STRING.length() + 1);
@@ -183,7 +183,7 @@ public class ASTRewritingTest extends AbstractJavaModelTests {
for (int l= 0; l < levels.length; l++) {
suite.addTest((Test) cons.newInstance(new Object[]{name, Integer.valueOf(levels[l])}));
}
-
+
} else {
int since = -1;
index = name.indexOf(SINCE_AST_STRING);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingTrackingTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingTrackingTest.java
index 0f72a9906..89b449486 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingTrackingTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingTrackingTest.java
@@ -30,7 +30,7 @@ public class ASTRewritingTrackingTest extends ASTRewritingTest {
/** @deprecated using deprecated code */
private static final SimplePropertyDescriptor INTERNAL_FIELD_MODIFIERS_PROPERTY = FieldDeclaration.MODIFIERS_PROPERTY;
-
+
public ASTRewritingTrackingTest(String name) {
super(name);
}
@@ -43,7 +43,7 @@ public class ASTRewritingTrackingTest extends ASTRewritingTest {
return createSuite(ASTRewritingTrackingTest.class);
}
- /**
+ /**
* Internal access method to VariableDeclarationFragment#setExtraDimensions() for avoiding deprecated warnings
*
* @param node
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingTypeAnnotationsTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingTypeAnnotationsTest.java
index daf8dae65..a0e48b349 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingTypeAnnotationsTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingTypeAnnotationsTest.java
@@ -857,7 +857,7 @@ public class ASTRewritingTypeAnnotationsTest extends ASTRewritingTest {
/**
* ASTRewriterTests for NameQualifiedType
* @throws Exception
- *
+ *
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=406469
*/
public void testNameQualifiedTypeAnnotations() throws Exception {
@@ -897,7 +897,7 @@ public class ASTRewritingTypeAnnotationsTest extends ASTRewritingTest {
"class FileNotFoundException extends Exception{private static final long serialVersionUID=10002L;}\n" +
"class EOFException extends Exception{private static final long serialVersionUID=10003L;}\n" +
"class IOError extends Exception{private static final long serialVersionUID=10004L;}\n";
- StringBuffer buf = new StringBuffer(contents);
+ StringBuffer buf = new StringBuffer(contents);
ICompilationUnit cu= pack1.createCompilationUnit("X.java", buf.toString(), false, null);
CompilationUnit astRoot= createAST(cu, /* resolve */ true, false);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
@@ -914,13 +914,13 @@ public class ASTRewritingTypeAnnotationsTest extends ASTRewritingTest {
SingleVariableDeclaration param = (SingleVariableDeclaration) methodDeclaration.parameters().get(0);
nameQualifiedType = (NameQualifiedType) param.getType();
rewrite.remove((ASTNode) nameQualifiedType.annotations().get(0), null);
-
+
// insert an annotation after an existing annotation
nameQualifiedType = (NameQualifiedType) methodDeclaration.thrownExceptionTypes().get(0);
markerAnnotation= ast.newMarkerAnnotation();
markerAnnotation.setTypeName(ast.newSimpleName("Marker"));
rewrite.getListRewrite(nameQualifiedType, NameQualifiedType.ANNOTATIONS_PROPERTY).insertLast(markerAnnotation, null);
-
+
/* insert an annotation in a type not converted as a NameQualifiedType. This would involve
* creation of a NameQualifiedType from fields of the existing type.
*/
@@ -981,7 +981,7 @@ public class ASTRewritingTypeAnnotationsTest extends ASTRewritingTest {
/**
* ASTRewriterTests for QualifiedType
* @throws Exception
- *
+ *
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=407364
*/
public void testQualifiedTypeAnnotations() throws Exception {
@@ -996,10 +996,10 @@ public class ASTRewritingTypeAnnotationsTest extends ASTRewritingTest {
" Outer.Inner.@Marker1 Deeper deeper = second.new Deeper();\n" +
" Outer.Inner.Deeper deeper2 = second.new Deeper();\n" +
" }\n" + "}\n" + "class Outer {\n" +
- " public class Inner {\n" +
+ " public class Inner {\n" +
" public class Deeper {\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}\n" +
"@Target (java.lang.annotation.ElementType.TYPE_USE)\n" +
"@interface Marker {}\n" +
@@ -1007,8 +1007,8 @@ public class ASTRewritingTypeAnnotationsTest extends ASTRewritingTest {
"@interface Marker1 {}\n" +
"@Target (java.lang.annotation.ElementType.TYPE_USE)\n" +
"@interface Marker2 {}\n";
-
- StringBuffer buf = new StringBuffer(contents);
+
+ StringBuffer buf = new StringBuffer(contents);
ICompilationUnit cu= pack1.createCompilationUnit("X.java", buf.toString(), false, null);
CompilationUnit astRoot= createAST(cu, /* resolve */ true, false);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
@@ -1024,19 +1024,19 @@ public class ASTRewritingTypeAnnotationsTest extends ASTRewritingTest {
MarkerAnnotation markerAnnotation= ast.newMarkerAnnotation();
markerAnnotation.setTypeName(ast.newSimpleName("NewMarker"));
rewrite.replace((ASTNode) nameQualifiedType.annotations().get(0), markerAnnotation, null);
-
+
// remove an annotation
variableDeclarationStatement = (VariableDeclarationStatement) statements.get(sCount++);
nameQualifiedType = (NameQualifiedType) variableDeclarationStatement.getType();
rewrite.remove((ASTNode) nameQualifiedType.annotations().get(0), null);
-
+
// insert an annotation after an existing annotation
variableDeclarationStatement = (VariableDeclarationStatement) statements.get(sCount++);
nameQualifiedType = (NameQualifiedType) variableDeclarationStatement.getType();
markerAnnotation= ast.newMarkerAnnotation();
markerAnnotation.setTypeName(ast.newSimpleName("NewMarker"));
rewrite.getListRewrite(nameQualifiedType, NameQualifiedType.ANNOTATIONS_PROPERTY).insertLast(markerAnnotation, null);
-
+
/* insert an annotation in a type not converted as QualifiedType. This would involve
* creation of a QualifiedType from fields of the existing type.
*/
@@ -1047,7 +1047,7 @@ public class ASTRewritingTypeAnnotationsTest extends ASTRewritingTest {
qualifiedName = (QualifiedName) qualifiedName.getQualifier();
qualifiedName = ast.newQualifiedName(ast.newName(qualifiedName.getQualifier().toString()), ast.newSimpleName(qualifiedName.getName().toString()));
nameQualifiedType = ast.newNameQualifiedType(qualifiedName, simpleName);
-
+
markerAnnotation= ast.newMarkerAnnotation();
markerAnnotation.setTypeName(ast.newSimpleName("NewMarker"));
rewrite.getListRewrite(nameQualifiedType, NameQualifiedType.ANNOTATIONS_PROPERTY).insertLast(markerAnnotation, null);
@@ -1064,10 +1064,10 @@ public class ASTRewritingTypeAnnotationsTest extends ASTRewritingTest {
" Outer.Inner.@Marker1 @NewMarker Deeper deeper = second.new Deeper();\n" +
" Outer.Inner.@NewMarker Deeper deeper2 = second.new Deeper();\n" +
" }\n" + "}\n" + "class Outer {\n" +
- " public class Inner {\n" +
+ " public class Inner {\n" +
" public class Deeper {\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}\n" +
"@Target (java.lang.annotation.ElementType.TYPE_USE)\n" +
"@interface Marker {}\n" +
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingTypeDeclTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingTypeDeclTest.java
index be882ff23..6356cc66d 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingTypeDeclTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingTypeDeclTest.java
@@ -78,8 +78,8 @@ public class ASTRewritingTypeDeclTest extends ASTRewritingTest {
private static final SimplePropertyDescriptor INTERNAL_VARIABLE_MODIFIERS_PROPERTY = SingleVariableDeclaration.MODIFIERS_PROPERTY;
/** @deprecated using deprecated code */
private static final SimplePropertyDescriptor INTERNAL_VARIABLE_EXTRA_DIMENSIONS_PROPERTY = SingleVariableDeclaration.EXTRA_DIMENSIONS_PROPERTY;
-
-
+
+
public ASTRewritingTypeDeclTest(String name) {
super(name);
}
@@ -981,43 +981,43 @@ public class ASTRewritingTypeDeclTest extends ASTRewritingTest {
assertEqualString(preview, buf.toString());
}
-
+
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=262517
public void testSingleMemberAnnotation1_since_3() throws Exception {
String previousValue = null;
try {
previousValue = this.project1.getOption(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_ANNOTATION, false);
-
+
this.project1.setOption(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_ANNOTATION, JavaCore.INSERT);
-
+
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createAST(cu);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
AST ast= astRoot.getAST();
-
+
{
TypeDeclaration type= findTypeDeclaration(astRoot, "E");
-
+
SingleMemberAnnotation newAnnot= ast.newSingleMemberAnnotation();
-
+
newAnnot.setTypeName(ast.newName("SuppressWarnings"));
-
+
StringLiteral newStringLiteral= ast.newStringLiteral();
newStringLiteral.setLiteralValue("deprecation");
newAnnot.setValue(newStringLiteral);
-
+
ListRewrite modifiers= rewrite.getListRewrite(type, TypeDeclaration.MODIFIERS2_PROPERTY);
modifiers.insertFirst(newAnnot, null);
}
-
+
String preview= evaluateRewrite(cu, rewrite);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("@SuppressWarnings (\"deprecation\")\n");
@@ -1800,7 +1800,7 @@ public class ASTRewritingTypeDeclTest extends ASTRewritingTest {
MarkerAnnotation markerAnnotation= ast.newMarkerAnnotation();
markerAnnotation.setTypeName(ast.newSimpleName("Annot1"));
dim.annotations().add(markerAnnotation);
-
+
markerAnnotation= ast.newMarkerAnnotation();
markerAnnotation.setTypeName(ast.newSimpleName("Annot2"));
dim.annotations().add(markerAnnotation);
@@ -1939,7 +1939,7 @@ public class ASTRewritingTypeDeclTest extends ASTRewritingTest {
assertEqualString(preview, buf.toString());
}
- // Bug 419057 - ITypeBinding#getModifiers() misses implicit "static" for class member interface
+ // Bug 419057 - ITypeBinding#getModifiers() misses implicit "static" for class member interface
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=419057
public void testBug419057a() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
@@ -1972,7 +1972,7 @@ public class ASTRewritingTypeDeclTest extends ASTRewritingTest {
ITypeBinding memberTypeBinding = memberTypeDeclaration.resolveBinding();
assertTrue((memberTypeBinding.getModifiers() & Modifier.STATIC) != 0);
}
-
+
public void test401848_since_3() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new StringBuffer();
@@ -2012,7 +2012,7 @@ public class ASTRewritingTypeDeclTest extends ASTRewritingTest {
String preview= evaluateRewrite(cu, rewrite);
String expected = "package test1;\n" +
"public class E {\n" +
- " @Marker\n"+
+ " @Marker\n"+
" public int i;\n" +
" @test1.Marker\n" +
" public F f;\n" +
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingWithStatementsRecoveryTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingWithStatementsRecoveryTest.java
index 0e71bad74..c2e49f90a 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingWithStatementsRecoveryTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingWithStatementsRecoveryTest.java
@@ -79,7 +79,7 @@ public class ASTRewritingWithStatementsRecoveryTest extends ASTRewritingTest {
assertEqualString(preview, buf.toString());
}
-
+
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=272711
public void testBug272711_02_since_3() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
@@ -123,7 +123,7 @@ public class ASTRewritingWithStatementsRecoveryTest extends ASTRewritingTest {
assertEqualString(preview, buf.toString());
}
-
+
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=272711
public void testBug272711_03_since_3() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ImportRewrite18Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ImportRewrite18Test.java
index 8c5096f7e..94a281107 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ImportRewrite18Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ImportRewrite18Test.java
@@ -187,7 +187,7 @@ public class ImportRewrite18Test extends AbstractJavaModelTests {
parser.setSource(cu);
parser.setResolveBindings(true);
parser.setStatementsRecovery(true);
- astRoot = (CompilationUnit) parser.createAST(null);
+ astRoot = (CompilationUnit) parser.createAST(null);
TypeDeclaration type= (TypeDeclaration) astRoot.types().get(0);
MethodDeclaration [] methods = type.getMethods();
MethodDeclaration method = methods[0];
@@ -244,7 +244,7 @@ public class ImportRewrite18Test extends AbstractJavaModelTests {
parser.setSource(cu);
parser.setResolveBindings(true);
parser.setStatementsRecovery(true);
- astRoot = (CompilationUnit) parser.createAST(null);
+ astRoot = (CompilationUnit) parser.createAST(null);
TypeDeclaration type= (TypeDeclaration) astRoot.types().get(0);
MethodDeclaration [] methods = type.getMethods();
MethodDeclaration method = methods[0];
@@ -395,7 +395,7 @@ public class ImportRewrite18Test extends AbstractJavaModelTests {
" \n" +
" }\n" +
" }\n" +
- "}\n" +
+ "}\n" +
createFolder("/" + PROJECT + "/src/pack3");
createFile("/" + PROJECT + "/src/pack3/C1.java", contents);
contents = "package pack4;\n" +
@@ -414,7 +414,7 @@ public class ImportRewrite18Test extends AbstractJavaModelTests {
parser.setSource(cu);
parser.setResolveBindings(true);
parser.setStatementsRecovery(true);
- CompilationUnit astRoot = (CompilationUnit) parser.createAST(null);
+ CompilationUnit astRoot = (CompilationUnit) parser.createAST(null);
TypeDeclaration typeDeclaration = (TypeDeclaration) astRoot.types().get(0);
MethodDeclaration [] methods = typeDeclaration.getMethods();
MethodDeclaration method = methods[0];
@@ -476,7 +476,7 @@ public class ImportRewrite18Test extends AbstractJavaModelTests {
" \n" +
" }\n" +
" }\n" +
- "}\n" +
+ "}\n" +
createFolder("/" + PROJECT + "/src/pack4");
createFile("/" + PROJECT + "/src/pack4/D1.java", contents);
@@ -607,7 +607,7 @@ public class ImportRewrite18Test extends AbstractJavaModelTests {
if(testNullImportRewriteContext) {
actualType = rewrite.addImport(typeBinding, astRoot.getAST(), null, TypeLocation.UNKNOWN);
} else {
- actualType = rewrite.addImport(typeBinding, astRoot.getAST());
+ actualType = rewrite.addImport(typeBinding, astRoot.getAST());
}
return actualType;
}
@@ -770,7 +770,7 @@ public class ImportRewrite18Test extends AbstractJavaModelTests {
}
public void testBug474270_since_8() throws Exception {
- String contents =
+ String contents =
"package pack1;\n" +
"import java.util.Comparator;\n" +
"interface Comparator<T> {\n" +
@@ -792,7 +792,7 @@ public class ImportRewrite18Test extends AbstractJavaModelTests {
parser.setSource(cu);
parser.setResolveBindings(true);
parser.setStatementsRecovery(true);
- CompilationUnit astRoot = (CompilationUnit) parser.createAST(null);
+ CompilationUnit astRoot = (CompilationUnit) parser.createAST(null);
TypeDeclaration type= (TypeDeclaration) astRoot.types().get(1);
MethodDeclaration [] methods = type.getMethods();
MethodDeclaration method = methods[0];
@@ -840,7 +840,7 @@ public class ImportRewrite18Test extends AbstractJavaModelTests {
edit.apply(document);
compilationUnit.getBuffer().setContents(document.get());
}
-
+
public void testBug513869() throws Exception {
Type actualType = runTest426094andGetType(0, true);
assertEquals(this.bug426094TestInput[0][1], actualType.toString());
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ImportRewriteTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ImportRewriteTest.java
index d0eb23b11..20c8b6382 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ImportRewriteTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ImportRewriteTest.java
@@ -62,7 +62,7 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
* @deprecated
*/
/*package*/ static final int JLS3_INTERNAL = AST.JLS3;
-
+
private static final Class THIS= ImportRewriteTest.class;
protected IPackageFragmentRoot sourceFolder;
@@ -1510,25 +1510,25 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
expected.append("public class Clazz {}\n");
assertEqualString(cu.getSource(), expected.toString());
}
-
+
// https://bugs.eclipse.org/459320
public void testAddImportToCuNotOnClasspath() throws Exception {
StringBuffer contents = new StringBuffer();
contents.append("package pack1;\n");
contents.append("\n");
contents.append("public class Clazz {}\n");
-
+
createFolder("/P/alt-src/pack1/");
IFile clazz = createFile("/P/alt-src/pack1/Clazz.java", contents.toString());
ICompilationUnit cu = (ICompilationUnit) JavaCore.create(clazz);
cu.becomeWorkingCopy(null);
-
+
try {
ImportRewrite rewrite = newImportsRewrite(cu, new String[] {}, 999, 999, true);
rewrite.setUseContextToFilterImplicitImports(true);
rewrite.addImport("pack1.AnotherClass");
apply(rewrite);
-
+
assertEqualString(cu.getSource(), contents.toString());
} finally {
cu.discardWorkingCopy();
@@ -1721,10 +1721,10 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
buf.append("}\n");
assertEqualString(cu.getSource(), buf.toString());
}
-
+
public void testAddImports4() throws Exception {
getJavaProject("P").setOption(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON, JavaCore.INSERT);
-
+
IPackageFragment pack1= this.sourceFolder.createPackageFragment("pack1", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package pack1;\n");
@@ -1755,7 +1755,7 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
public void testAddImports5() throws Exception {
getJavaProject("P").setOption(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON, JavaCore.INSERT);
-
+
IPackageFragment pack1= this.sourceFolder.createPackageFragment("pack1", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package pack1;\n");
@@ -1792,19 +1792,19 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("pack1", false, null);
StringBuffer buf= new StringBuffer();
buf.append(
- "package pack1;\n" +
- "\n" +
- "import java.util.*;\n" +
- "\n" +
- "public class C {\n" +
- " public static void main(String[] args) {\n" +
- " HashMap h;\n" +
- "\n" +
- " Map.Entry e= null;\n" +
- " Entry e2= null;\n" +
- "\n" +
- " System.out.println(\"hello\");\n" +
- " }\n" +
+ "package pack1;\n" +
+ "\n" +
+ "import java.util.*;\n" +
+ "\n" +
+ "public class C {\n" +
+ " public static void main(String[] args) {\n" +
+ " HashMap h;\n" +
+ "\n" +
+ " Map.Entry e= null;\n" +
+ " Entry e2= null;\n" +
+ "\n" +
+ " System.out.println(\"hello\");\n" +
+ " }\n" +
"}");
ICompilationUnit cu= pack1.createCompilationUnit("C.java", buf.toString(), false, null);
@@ -1819,20 +1819,20 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
// With on-demand threshold set to 1, java.util.Map.Entry is reduced to java.util.Map.*.
buf= new StringBuffer();
buf.append(
- "package pack1;\n" +
- "\n" +
- "import java.util.*;\n" +
- "import java.util.Map.*;\n" +
- "\n" +
- "public class C {\n" +
- " public static void main(String[] args) {\n" +
- " HashMap h;\n" +
- "\n" +
- " Map.Entry e= null;\n" +
- " Entry e2= null;\n" +
- "\n" +
- " System.out.println(\"hello\");\n" +
- " }\n" +
+ "package pack1;\n" +
+ "\n" +
+ "import java.util.*;\n" +
+ "import java.util.Map.*;\n" +
+ "\n" +
+ "public class C {\n" +
+ " public static void main(String[] args) {\n" +
+ " HashMap h;\n" +
+ "\n" +
+ " Map.Entry e= null;\n" +
+ " Entry e2= null;\n" +
+ "\n" +
+ " System.out.println(\"hello\");\n" +
+ " }\n" +
"}");
assertEqualString(cu.getSource(), buf.toString());
}
@@ -1842,21 +1842,21 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("pack1", false, null);
StringBuffer buf= new StringBuffer();
buf.append(
- "package pack1;\n" +
- "\n" +
- "import java.util.*;\n" +
- "import java.util.Map.Entry;\n" +
- "\n" +
- "public class C {\n" +
- " public static void main(String[] args) {\n" +
- " HashMap h;\n" +
- "\n" +
- " Map.Entry e= null;\n" +
- " Entry e2= null;\n" +
- "\n" +
- " PrintWriter pw;\n" +
- " System.out.println(\"hello\");\n" +
- " }\n" +
+ "package pack1;\n" +
+ "\n" +
+ "import java.util.*;\n" +
+ "import java.util.Map.Entry;\n" +
+ "\n" +
+ "public class C {\n" +
+ " public static void main(String[] args) {\n" +
+ " HashMap h;\n" +
+ "\n" +
+ " Map.Entry e= null;\n" +
+ " Entry e2= null;\n" +
+ "\n" +
+ " PrintWriter pw;\n" +
+ " System.out.println(\"hello\");\n" +
+ " }\n" +
"}");
ICompilationUnit cu= pack1.createCompilationUnit("C.java", buf.toString(), false, null);
@@ -1870,23 +1870,23 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
buf= new StringBuffer();
buf.append(
- "package pack1;\n" +
- "\n" +
- "import java.io.*;\n" +
- "\n" +
- "import java.util.*;\n" +
- "import java.util.Map.Entry;\n" +
- "\n" +
- "public class C {\n" +
- " public static void main(String[] args) {\n" +
- " HashMap h;\n" +
- "\n" +
- " Map.Entry e= null;\n" +
- " Entry e2= null;\n" +
- "\n" +
- " PrintWriter pw;\n" +
- " System.out.println(\"hello\");\n" +
- " }\n" +
+ "package pack1;\n" +
+ "\n" +
+ "import java.io.*;\n" +
+ "\n" +
+ "import java.util.*;\n" +
+ "import java.util.Map.Entry;\n" +
+ "\n" +
+ "public class C {\n" +
+ " public static void main(String[] args) {\n" +
+ " HashMap h;\n" +
+ "\n" +
+ " Map.Entry e= null;\n" +
+ " Entry e2= null;\n" +
+ "\n" +
+ " PrintWriter pw;\n" +
+ " System.out.println(\"hello\");\n" +
+ " }\n" +
"}");
assertEqualString(cu.getSource(), buf.toString());
}
@@ -2046,7 +2046,7 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
buf.append(" }\n");
buf.append("}\n");
pack.createCompilationUnit("A.java", buf.toString(), false, null);
-
+
IPackageFragment test1= this.sourceFolder.createPackageFragment("test1", false, null);
buf= new StringBuffer();
buf.append("package test1;\n");
@@ -2061,22 +2061,22 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
buf.append("public class T {\n");
buf.append("}\n");
ICompilationUnit cuT= test1.createCompilationUnit("T.java", buf.toString(), false, null);
-
+
ASTParser parser= ASTParser.newParser(JLS3_INTERNAL);
parser.setSource(cuT);
parser.setResolveBindings(true);
CompilationUnit astRoot= (CompilationUnit) parser.createAST(null);
-
+
ImportRewrite imports= newImportsRewrite(astRoot, new String[0], 99, 99, true);
imports.setUseContextToFilterImplicitImports(true);
-
+
imports.removeImport("pack.A.Inner");
imports.removeImport("pack.A.NotThere");
imports.removeImport("pack.B.Inner");
imports.removeImport("pack.B.NotThere");
-
+
apply(imports);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("\n");
@@ -2089,7 +2089,7 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
}
public void testRemoveImportWithSyntaxError_bug494691() throws Exception {
-
+
IPackageFragment pack1= this.sourceFolder.createPackageFragment("pack1", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package pack1;\n");
@@ -2100,12 +2100,12 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
buf.append("public class C {\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("C.java", buf.toString(), false, null);
-
+
ImportRewrite imports= newImportsRewrite(cu, new String[0], 2, 2, true);
imports.removeImport("java.util.*");
-
+
apply(imports);
-
+
buf= new StringBuffer();
buf.append("package pack1;\n");
buf.append("\n");
@@ -2283,7 +2283,7 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
/**
* Test that the Inner class import comes in the right order (i.e. after the enclosing type's import) when re-organized
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=194358"
*/
public void testBug194358() throws Exception {
@@ -2301,7 +2301,7 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("pack1", false, null);
ICompilationUnit cu= pack1.createCompilationUnit("C.java", buf.toString(), false, null);
- // We need to actually make some state in the AST for the classes, to test that we can
+ // We need to actually make some state in the AST for the classes, to test that we can
// disambiguate between packages and inner classes (see the bug for details).
IPackageFragment pack2= this.sourceFolder.createPackageFragment("pack2", false, null);
ICompilationUnit aUnit= pack2.createCompilationUnit("A.java", "", false, null);
@@ -2334,9 +2334,9 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
/**
* Test that a valid inner class import is not removed even when the container
- * class is implicitly available. This tests the case where the classes are in
+ * class is implicitly available. This tests the case where the classes are in
* different compilation units.
- *
+ *
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=194358"
*/
public void testBug194358a() throws Exception {
@@ -2380,10 +2380,10 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
assertEqualString(cu.getSource(), buf.toString());
}
/**
- * Test that the Inner type imports are not removed while organizing even though the
- * containing class is implicitly available - for the case when both the classes are
+ * Test that the Inner type imports are not removed while organizing even though the
+ * containing class is implicitly available - for the case when both the classes are
* in the same compilation unit
- *
+ *
* see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=235253"
*/
public void testBug235253() throws Exception {
@@ -2393,7 +2393,7 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
buf.append("class Bug {\n");
buf.append("public void addFile(File file) {}\n");
buf.append("\tinterface Proto{};\n");
- buf.append("}\n");
+ buf.append("}\n");
buf.append("class Foo implements Proto{}");
IPackageFragment pack1= this.sourceFolder.createPackageFragment("bug", false, null);
@@ -2402,8 +2402,8 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
ImportRewrite imports= newImportsRewrite(cu, order, 99, 99, false);
imports.setUseContextToFilterImplicitImports(true);
imports.addImport("bug.Bug.Proto");
- imports.addImport("java.io.File");
-
+ imports.addImport("java.io.File");
+
apply(imports);
buf = new StringBuffer();
buf.append("package bug;\n");
@@ -2415,11 +2415,11 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
buf.append("class Bug {\n");
buf.append("public void addFile(File file) {}\n");
buf.append("\tinterface Proto{};\n");
- buf.append("}\n");
+ buf.append("}\n");
buf.append("class Foo implements Proto{}");
assertEqualString(cu.getSource(), buf.toString());
}
-
+
public void testAddStaticImports1() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("pack1", false, null);
@@ -2775,10 +2775,10 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
public void testBug252379() throws CoreException, BackingStoreException,
MalformedTreeException, BadLocationException {
-
+
ICompilationUnit[] units = new ICompilationUnit[3];
-
+
IPackageFragment pack1 = this.sourceFolder.createPackageFragment(
"bug", false, null);
@@ -2789,15 +2789,15 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
buf.append("\tone;\n");
buf.append("\tstatic CaseType[] all(){return null;}\n");
buf.append("}\n");
-
+
units[0] = pack1.createCompilationUnit("CaseType.java", buf.toString(), false, null);
-
+
buf = new StringBuffer();
buf.append("package bug;\n");
buf.append("enum ShareLevel{all})\n");
-
+
units[1] = pack1.createCompilationUnit("ShareLevel.java", buf.toString(), false, null);
-
+
buf = new StringBuffer();
buf.append("package bug;\n");
buf.append("class Bug {\n");
@@ -2889,24 +2889,24 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
StringBuffer buf = new StringBuffer();
// 2 imports are in 1 group but third is separated by a comment
buf.append(
- "package pack1;\n" +
- "\n" +
+ "package pack1;\n" +
+ "\n" +
"import java.util.*; // test\n" +
"import java.util.Map.Entry;\n" +
"//comment 2\n" +
"import java.util.Map.SomethingElse;\n" +
- "// commen 3\n" +
- "\n" +
- "public class C {\n" +
- " public static void main(String[] args) {\n" +
- " HashMap h;\n" +
- "\n" +
- " Map.Entry e= null;\n" +
- " Entry e2= null;\n" +
- "\n" +
- " PrintWriter pw;\n" +
- " System.out.println(\"hello\");\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C {\n" +
+ " public static void main(String[] args) {\n" +
+ " HashMap h;\n" +
+ "\n" +
+ " Map.Entry e= null;\n" +
+ " Entry e2= null;\n" +
+ "\n" +
+ " PrintWriter pw;\n" +
+ " System.out.println(\"hello\");\n" +
+ " }\n" +
"}");
ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
@@ -2920,54 +2920,54 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
- "\n" +
- "import java.io.*;\n" +
- "\n" +
- "import java.util.*; // test\n" +
- "import java.util.Map.Entry;\n" +
+ "package pack1;\n" +
+ "\n" +
+ "import java.io.*;\n" +
+ "\n" +
+ "import java.util.*; // test\n" +
+ "import java.util.Map.Entry;\n" +
"//comment 2\n" +
"import java.util.Map.SomethingElse;\n" +
"// commen 3\n" +
- "\n" +
- "public class C {\n" +
- " public static void main(String[] args) {\n" +
- " HashMap h;\n" +
- "\n" +
- " Map.Entry e= null;\n" +
- " Entry e2= null;\n" +
- "\n" +
- " PrintWriter pw;\n" +
- " System.out.println(\"hello\");\n" +
- " }\n" +
+ "\n" +
+ "public class C {\n" +
+ " public static void main(String[] args) {\n" +
+ " HashMap h;\n" +
+ "\n" +
+ " Map.Entry e= null;\n" +
+ " Entry e2= null;\n" +
+ "\n" +
+ " PrintWriter pw;\n" +
+ " System.out.println(\"hello\");\n" +
+ " }\n" +
"}");
assertEqualString(cu.getSource(), buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=376930
public void testBug376930_2() throws Exception {
IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
StringBuffer buf = new StringBuffer();
// all imports are in same group
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
- "// comment 1\n" +
+ "// comment 1\n" +
"import java.util.*; // test\n" +
"import java.util.Map.Entry; // test2\n" +
"import java.util.Map.SomethingElse;\n" +
- "// commen 3\n" +
- "\n" +
- "public class C {\n" +
- " public static void main(String[] args) {\n" +
- " HashMap h;\n" +
- "\n" +
- " Map.Entry e= null;\n" +
- " Entry e2= null;\n" +
- "\n" +
- " PrintWriter pw;\n" +
- " System.out.println(\"hello\");\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C {\n" +
+ " public static void main(String[] args) {\n" +
+ " HashMap h;\n" +
+ "\n" +
+ " Map.Entry e= null;\n" +
+ " Entry e2= null;\n" +
+ "\n" +
+ " PrintWriter pw;\n" +
+ " System.out.println(\"hello\");\n" +
+ " }\n" +
"}");
ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
@@ -2981,30 +2981,30 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
- "\n" +
- "import java.io.*;\n" +
- "\n" +
- "// comment 1\n" +
+ "package pack1;\n" +
+ "\n" +
+ "import java.io.*;\n" +
+ "\n" +
+ "// comment 1\n" +
"import java.util.*; // test\n" +
"import java.util.Map.Entry; // test2\n" +
"import java.util.Map.SomethingElse;\n" +
- "// commen 3\n" +
- "\n" +
- "public class C {\n" +
- " public static void main(String[] args) {\n" +
- " HashMap h;\n" +
- "\n" +
- " Map.Entry e= null;\n" +
- " Entry e2= null;\n" +
- "\n" +
- " PrintWriter pw;\n" +
- " System.out.println(\"hello\");\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C {\n" +
+ " public static void main(String[] args) {\n" +
+ " HashMap h;\n" +
+ "\n" +
+ " Map.Entry e= null;\n" +
+ " Entry e2= null;\n" +
+ "\n" +
+ " PrintWriter pw;\n" +
+ " System.out.println(\"hello\");\n" +
+ " }\n" +
"}");
assertEqualString(cu.getSource(), buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=376930
public void testBug376930_3() throws Exception {
IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
@@ -3012,24 +3012,24 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
// all imports are in same group
// leading and trailing comments
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
- "// comment 1\n" +
+ "// comment 1\n" +
"/* lead 1*/ import java.util.*; // test1\n" +
"/* lead 2*/import java.util.Map.Entry; // test2\n" +
"/* lead 3*/ import java.util.Map.SomethingElse; // test3\n" +
- "// commen 3\n" +
- "\n" +
- "public class C {\n" +
- " public static void main(String[] args) {\n" +
- " HashMap h;\n" +
- "\n" +
- " Map.Entry e= null;\n" +
- " Entry e2= null;\n" +
- "\n" +
- " PrintWriter pw;\n" +
- " System.out.println(\"hello\");\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C {\n" +
+ " public static void main(String[] args) {\n" +
+ " HashMap h;\n" +
+ "\n" +
+ " Map.Entry e= null;\n" +
+ " Entry e2= null;\n" +
+ "\n" +
+ " PrintWriter pw;\n" +
+ " System.out.println(\"hello\");\n" +
+ " }\n" +
"}");
ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
@@ -3043,54 +3043,54 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
- "\n" +
- "import java.io.*;\n" +
- "\n" +
- "// comment 1\n" +
+ "package pack1;\n" +
+ "\n" +
+ "import java.io.*;\n" +
+ "\n" +
+ "// comment 1\n" +
"/* lead 1*/ import java.util.*; // test1\n" +
"/* lead 2*/import java.util.Map.Entry; // test2\n" +
"/* lead 3*/ import java.util.Map.SomethingElse; // test3\n" +
- "// commen 3\n" +
- "\n" +
- "public class C {\n" +
- " public static void main(String[] args) {\n" +
- " HashMap h;\n" +
- "\n" +
- " Map.Entry e= null;\n" +
- " Entry e2= null;\n" +
- "\n" +
- " PrintWriter pw;\n" +
- " System.out.println(\"hello\");\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C {\n" +
+ " public static void main(String[] args) {\n" +
+ " HashMap h;\n" +
+ "\n" +
+ " Map.Entry e= null;\n" +
+ " Entry e2= null;\n" +
+ "\n" +
+ " PrintWriter pw;\n" +
+ " System.out.println(\"hello\");\n" +
+ " }\n" +
"}");
assertEqualString(cu.getSource(), buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=376930
// remove imports, preserve all comments
public void testBug376930_3a() throws Exception {
IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
StringBuffer buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
- "// comment 1\n" +
+ "// comment 1\n" +
"/* lead 1*/ import java.util.*; // test1\n" +
"/* lead 2*/import java.util.Map.Entry; // test2\n" +
"/* lead 3*/ import java.util.Map.SomethingElse; // test3\n" +
- "// commen 3\n" +
- "\n" +
- "public class C {\n" +
- " public static void main(String[] args) {\n" +
- " HashMap h;\n" +
- "\n" +
- " Map.Entry e= null;\n" +
- " Entry e2= null;\n" +
- "\n" +
- " PrintWriter pw;\n" +
- " System.out.println(\"hello\");\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C {\n" +
+ " public static void main(String[] args) {\n" +
+ " HashMap h;\n" +
+ "\n" +
+ " Map.Entry e= null;\n" +
+ " Entry e2= null;\n" +
+ "\n" +
+ " PrintWriter pw;\n" +
+ " System.out.println(\"hello\");\n" +
+ " }\n" +
"}");
ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
@@ -3104,24 +3104,24 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
- "\n" +
- "import java.io.*;\n" +
- "\n" +
- "public class C {\n" +
- " public static void main(String[] args) {\n" +
- " HashMap h;\n" +
- "\n" +
- " Map.Entry e= null;\n" +
- " Entry e2= null;\n" +
- "\n" +
- " PrintWriter pw;\n" +
- " System.out.println(\"hello\");\n" +
- " }\n" +
+ "package pack1;\n" +
+ "\n" +
+ "import java.io.*;\n" +
+ "\n" +
+ "public class C {\n" +
+ " public static void main(String[] args) {\n" +
+ " HashMap h;\n" +
+ "\n" +
+ " Map.Entry e= null;\n" +
+ " Entry e2= null;\n" +
+ "\n" +
+ " PrintWriter pw;\n" +
+ " System.out.println(\"hello\");\n" +
+ " }\n" +
"}");
assertEqualString(cu.getSource(), buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=376930
public void testBug376930_4() throws Exception {
IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
@@ -3130,24 +3130,24 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
// leading and trailing comments
// two on demand imports in the group
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
- "// comment 1\n" +
+ "// comment 1\n" +
"/* lead 1*/ import java.util.*; // test1\n" +
"/* lead 2*/import java.util.Map.*; // test2\n" +
"/* lead 3*/ import java.util.Map.SomethingElse; // test3\n" +
- "// commen 3\n" +
- "\n" +
- "public class C {\n" +
- " public static void main(String[] args) {\n" +
- " HashMap h;\n" +
- "\n" +
- " Map.Entry e= null;\n" +
- " Entry e2= null;\n" +
- "\n" +
- " PrintWriter pw;\n" +
- " System.out.println(\"hello\");\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C {\n" +
+ " public static void main(String[] args) {\n" +
+ " HashMap h;\n" +
+ "\n" +
+ " Map.Entry e= null;\n" +
+ " Entry e2= null;\n" +
+ "\n" +
+ " PrintWriter pw;\n" +
+ " System.out.println(\"hello\");\n" +
+ " }\n" +
"}");
ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
@@ -3161,54 +3161,54 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
- "\n" +
- "import java.io.*;\n" +
- "\n" +
- "// comment 1\n" +
+ "package pack1;\n" +
+ "\n" +
+ "import java.io.*;\n" +
+ "\n" +
+ "// comment 1\n" +
"/* lead 1*/ import java.util.*; // test1\n" +
"/* lead 2*/import java.util.Map.*; // test2\n" +
"/* lead 3*/ import java.util.Map.SomethingElse; // test3\n" +
- "// commen 3\n" +
- "\n" +
- "public class C {\n" +
- " public static void main(String[] args) {\n" +
- " HashMap h;\n" +
- "\n" +
- " Map.Entry e= null;\n" +
- " Entry e2= null;\n" +
- "\n" +
- " PrintWriter pw;\n" +
- " System.out.println(\"hello\");\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C {\n" +
+ " public static void main(String[] args) {\n" +
+ " HashMap h;\n" +
+ "\n" +
+ " Map.Entry e= null;\n" +
+ " Entry e2= null;\n" +
+ "\n" +
+ " PrintWriter pw;\n" +
+ " System.out.println(\"hello\");\n" +
+ " }\n" +
"}");
assertEqualString(cu.getSource(), buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=376930
// remove imports, preserve all comments
public void testBug376930_4a() throws Exception {
IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
StringBuffer buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
- "// comment 1\n" +
+ "// comment 1\n" +
"/* lead 1*/ import java.util.HashMap; // test1\n" +
"/* lead 2*/import java.util.Map.*; // test2\n" +
"/* lead 3*/ import java.util.Map.SomethingElse; // test3\n" +
- "// commen 3\n" +
- "\n" +
- "public class C {\n" +
- " public static void main(String[] args) {\n" +
- " HashMap h;\n" +
- "\n" +
- " Map.Entry e= null;\n" +
- " Entry e2= null;\n" +
- "\n" +
- " PrintWriter pw;\n" +
- " System.out.println(\"hello\");\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C {\n" +
+ " public static void main(String[] args) {\n" +
+ " HashMap h;\n" +
+ "\n" +
+ " Map.Entry e= null;\n" +
+ " Entry e2= null;\n" +
+ "\n" +
+ " PrintWriter pw;\n" +
+ " System.out.println(\"hello\");\n" +
+ " }\n" +
"}");
ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
@@ -3222,24 +3222,24 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
- "\n" +
- "import java.io.*;\n" +
- "\n" +
- "public class C {\n" +
- " public static void main(String[] args) {\n" +
- " HashMap h;\n" +
- "\n" +
- " Map.Entry e= null;\n" +
- " Entry e2= null;\n" +
- "\n" +
- " PrintWriter pw;\n" +
- " System.out.println(\"hello\");\n" +
- " }\n" +
+ "package pack1;\n" +
+ "\n" +
+ "import java.io.*;\n" +
+ "\n" +
+ "public class C {\n" +
+ " public static void main(String[] args) {\n" +
+ " HashMap h;\n" +
+ "\n" +
+ " Map.Entry e= null;\n" +
+ " Entry e2= null;\n" +
+ "\n" +
+ " PrintWriter pw;\n" +
+ " System.out.println(\"hello\");\n" +
+ " }\n" +
"}");
assertEqualString(cu.getSource(), buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=376930
public void testBug376930_5() throws Exception {
IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
@@ -3248,24 +3248,24 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
// leading and trailing comments
// adding an on-demand import belonging to a group
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
- "// comment 1\n" +
+ "// comment 1\n" +
"/* lead 1*/ import java.util.*; // test1\n" +
"/* lead 2*/import java.io.PrintWriter.*; // test2\n" +
"/* lead 3*/ import java.util.Map.SomethingElse; // test3\n" +
- "// commen 3\n" +
- "\n" +
- "public class C {\n" +
- " public static void main(String[] args) {\n" +
- " HashMap h;\n" +
- "\n" +
- " Map.Entry e= null;\n" +
- " Entry e2= null;\n" +
- "\n" +
- " PrintWriter pw;\n" +
- " System.out.println(\"hello\");\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C {\n" +
+ " public static void main(String[] args) {\n" +
+ " HashMap h;\n" +
+ "\n" +
+ " Map.Entry e= null;\n" +
+ " Entry e2= null;\n" +
+ "\n" +
+ " PrintWriter pw;\n" +
+ " System.out.println(\"hello\");\n" +
+ " }\n" +
"}");
ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
@@ -3281,31 +3281,31 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
// java.util.Map.* is placed after java.util.* and is assigned the comments
// from java.util.Map.SomethingElse.
buf.append(
- "package pack1;\n" +
- "\n" +
- "// comment 1\n" +
+ "package pack1;\n" +
+ "\n" +
+ "// comment 1\n" +
"/* lead 1*/ import java.util.*; // test1\n" +
"/* lead 3*/\n" +
"// test3\n" +
- "// commen 3\n" +
+ "// commen 3\n" +
"import java.util.Map.*;\n" +
"\n" +
"/* lead 2*/import java.io.PrintWriter.*; // test2\n" +
"\n" +
- "public class C {\n" +
- " public static void main(String[] args) {\n" +
- " HashMap h;\n" +
- "\n" +
- " Map.Entry e= null;\n" +
- " Entry e2= null;\n" +
- "\n" +
- " PrintWriter pw;\n" +
- " System.out.println(\"hello\");\n" +
- " }\n" +
+ "public class C {\n" +
+ " public static void main(String[] args) {\n" +
+ " HashMap h;\n" +
+ "\n" +
+ " Map.Entry e= null;\n" +
+ " Entry e2= null;\n" +
+ "\n" +
+ " PrintWriter pw;\n" +
+ " System.out.println(\"hello\");\n" +
+ " }\n" +
"}");
assertEqualString(cu.getSource(), buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=376930
public void testBug376930_5a() throws Exception {
IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
@@ -3314,24 +3314,24 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
// leading and trailing comments
// adding an on-demand import belonging to a group
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/* lead 2*/import java.io.PrintWriter.*; // test2\n" +
"/* lead 1*/ import java.util.*; // test1\n" +
"/* lead 3*/ import java.util.Map.SomethingElse; // test3\n" +
- "// commen 3\n" +
- "\n" +
- "public class C {\n" +
- " public static void main(String[] args) {\n" +
- " HashMap h;\n" +
- "\n" +
- " Map.Entry e= null;\n" +
- " Entry e2= null;\n" +
- "\n" +
- " PrintWriter pw;\n" +
- " System.out.println(\"hello\");\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C {\n" +
+ " public static void main(String[] args) {\n" +
+ " HashMap h;\n" +
+ "\n" +
+ " Map.Entry e= null;\n" +
+ " Entry e2= null;\n" +
+ "\n" +
+ " PrintWriter pw;\n" +
+ " System.out.println(\"hello\");\n" +
+ " }\n" +
"}");
ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
@@ -3347,54 +3347,54 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
// and the latter's comments are reassigned to it.
buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
- "\n" +
- "// comment 1\n" +
+ "package pack1;\n" +
+ "\n" +
+ "// comment 1\n" +
"/* lead 2*/import java.io.PrintWriter.*; // test2\n" +
"/* lead 1*/ import java.util.*; // test1\n" +
"/* lead 3*/\n" +
"// test3\n" +
- "// commen 3\n" +
+ "// commen 3\n" +
"import java.util.Map.*;\n" +
- "\n" +
- "public class C {\n" +
- " public static void main(String[] args) {\n" +
- " HashMap h;\n" +
- "\n" +
- " Map.Entry e= null;\n" +
- " Entry e2= null;\n" +
- "\n" +
- " PrintWriter pw;\n" +
- " System.out.println(\"hello\");\n" +
- " }\n" +
+ "\n" +
+ "public class C {\n" +
+ " public static void main(String[] args) {\n" +
+ " HashMap h;\n" +
+ "\n" +
+ " Map.Entry e= null;\n" +
+ " Entry e2= null;\n" +
+ "\n" +
+ " PrintWriter pw;\n" +
+ " System.out.println(\"hello\");\n" +
+ " }\n" +
"}");
assertEqualString(cu.getSource(), buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=376930
// added import should get folded into existing *, without touching comments
public void testBug376930_5b() throws Exception {
IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
StringBuffer buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/* lead 2*/import java.io.PrintWriter.*; // test2\n" +
"/* lead 1*/ import java.util.*; // test1\n" +
"/* lead 3*/ import java.util.Map.SomethingElse; // test3\n" +
- "// commen 3\n" +
- "\n" +
- "public class C {\n" +
- " public static void main(String[] args) {\n" +
- " HashMap h;\n" +
- "\n" +
- " Map.Entry e= null;\n" +
- " Entry e2= null;\n" +
- "\n" +
- " PrintWriter pw;\n" +
- " System.out.println(\"hello\");\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C {\n" +
+ " public static void main(String[] args) {\n" +
+ " HashMap h;\n" +
+ "\n" +
+ " Map.Entry e= null;\n" +
+ " Entry e2= null;\n" +
+ "\n" +
+ " PrintWriter pw;\n" +
+ " System.out.println(\"hello\");\n" +
+ " }\n" +
"}");
ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
@@ -3408,48 +3408,48 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"/* lead 1*/ import java.util.*; // test1\n" +
"\n" +
- "public class C {\n" +
- " public static void main(String[] args) {\n" +
- " HashMap h;\n" +
- "\n" +
- " Map.Entry e= null;\n" +
- " Entry e2= null;\n" +
- "\n" +
- " PrintWriter pw;\n" +
- " System.out.println(\"hello\");\n" +
- " }\n" +
+ "public class C {\n" +
+ " public static void main(String[] args) {\n" +
+ " HashMap h;\n" +
+ "\n" +
+ " Map.Entry e= null;\n" +
+ " Entry e2= null;\n" +
+ "\n" +
+ " PrintWriter pw;\n" +
+ " System.out.println(\"hello\");\n" +
+ " }\n" +
"}");
assertEqualString(cu.getSource(), buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=376930
// remove imports, preserve all comments
public void testBug376930_5c() throws Exception {
IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
StringBuffer buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
- "// comment 1\n" +
+ "// comment 1\n" +
"/* lead 1*/ import java.util.*; // test1\n" +
"/* lead 2*/import java.io.PrintWriter.*; // test2\n" +
"/* lead 3*/ import java.util.Map.SomethingElse; // test3\n" +
- "// commen 3\n" +
- "\n" +
- "public class C {\n" +
- " public static void main(String[] args) {\n" +
- " HashMap h;\n" +
- "\n" +
- " Map.Entry e= null;\n" +
- " Entry e2= null;\n" +
- "\n" +
- " PrintWriter pw;\n" +
- " System.out.println(\"hello\");\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C {\n" +
+ " public static void main(String[] args) {\n" +
+ " HashMap h;\n" +
+ "\n" +
+ " Map.Entry e= null;\n" +
+ " Entry e2= null;\n" +
+ "\n" +
+ " PrintWriter pw;\n" +
+ " System.out.println(\"hello\");\n" +
+ " }\n" +
"}");
ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
@@ -3465,50 +3465,50 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
// and the latter's comments are reassigned to it.
buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
- "\n" +
+ "package pack1;\n" +
+ "\n" +
"/* lead 3*/\n" +
"// test3\n" +
"// commen 3\n" +
"import java.util.Map.*;\n" +
"\n" +
- "public class C {\n" +
- " public static void main(String[] args) {\n" +
- " HashMap h;\n" +
- "\n" +
- " Map.Entry e= null;\n" +
- " Entry e2= null;\n" +
- "\n" +
- " PrintWriter pw;\n" +
- " System.out.println(\"hello\");\n" +
- " }\n" +
+ "public class C {\n" +
+ " public static void main(String[] args) {\n" +
+ " HashMap h;\n" +
+ "\n" +
+ " Map.Entry e= null;\n" +
+ " Entry e2= null;\n" +
+ "\n" +
+ " PrintWriter pw;\n" +
+ " System.out.println(\"hello\");\n" +
+ " }\n" +
"}");
assertEqualString(cu.getSource(), buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=376930
// added import should get folded along with existing import into *, without deleting comments
public void testBug376930_5d() throws Exception {
IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
StringBuffer buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/* lead 2*/import java.io.PrintWriter.*; // test2\n" +
"/* lead 1*/ import java.util.Map; // test1\n" +
- "// commen 3\n" +
- "\n" +
- "public class C {\n" +
- " public static void main(String[] args) {\n" +
- " HashMap h;\n" +
- "\n" +
- " Map.Entry e= null;\n" +
- " Entry e2= null;\n" +
- "\n" +
- " PrintWriter pw;\n" +
- " System.out.println(\"hello\");\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C {\n" +
+ " public static void main(String[] args) {\n" +
+ " HashMap h;\n" +
+ "\n" +
+ " Map.Entry e= null;\n" +
+ " Entry e2= null;\n" +
+ "\n" +
+ " PrintWriter pw;\n" +
+ " System.out.println(\"hello\");\n" +
+ " }\n" +
"}");
ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
@@ -3522,7 +3522,7 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/* lead 2*/import java.io.PrintWriter.*; // test2\n" +
@@ -3531,17 +3531,17 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
"// test1\n" +
"// commen 3\n" +
"import java.util.*;\n" +
- "\n" +
- "public class C {\n" +
- " public static void main(String[] args) {\n" +
- " HashMap h;\n" +
- "\n" +
- " Map.Entry e= null;\n" +
- " Entry e2= null;\n" +
- "\n" +
- " PrintWriter pw;\n" +
- " System.out.println(\"hello\");\n" +
- " }\n" +
+ "\n" +
+ "public class C {\n" +
+ " public static void main(String[] args) {\n" +
+ " HashMap h;\n" +
+ "\n" +
+ " Map.Entry e= null;\n" +
+ " Entry e2= null;\n" +
+ "\n" +
+ " PrintWriter pw;\n" +
+ " System.out.println(\"hello\");\n" +
+ " }\n" +
"}");
assertEqualString(cu.getSource(), buf.toString());
}
@@ -3579,30 +3579,30 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"import java.util.*;\n" +
- "/* comment leading Map.Entry */\n" +
+ "/* comment leading Map.Entry */\n" +
"import java.util.Map.Entry;\n" +
- "\n" +
- "public class C {\n" +
- " public static void main(String[] args) {\n" +
- " HashMap h;\n" +
- "\n" +
- " Map.Entry e= null;\n" +
- " Entry e2= null;\n" +
- "\n" +
- " }\n" +
+ "\n" +
+ "public class C {\n" +
+ " public static void main(String[] args) {\n" +
+ " HashMap h;\n" +
+ "\n" +
+ " Map.Entry e= null;\n" +
+ " Entry e2= null;\n" +
+ "\n" +
+ " }\n" +
"}");
assertEqualString(cu.getSource(), buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=378024
public void testBug378024() throws Exception {
IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
StringBuffer buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/*\n" +
@@ -3618,13 +3618,13 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
" * keep me with HashMap\n" +
" */\n" +
"import java.util.HashMap;// test3\n" +
- "// commen 3\n" +
- "\n" +
- "public class C implements Serializable{\n" +
- " public static void main(String[] args) {\n" +
- " List l = new List();\n" +
- " Map e= null;\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C implements Serializable{\n" +
+ " public static void main(String[] args) {\n" +
+ " List l = new List();\n" +
+ " Map e= null;\n" +
+ " }\n" +
"}");
ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
@@ -3640,7 +3640,7 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/*\n" +
@@ -3656,23 +3656,23 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
" * keep me with HashMap\n" +
" */\n" +
"import java.util.HashMap;// test3\n" +
- "// commen 3\n" +
- "\n" +
- "public class C implements Serializable{\n" +
- " public static void main(String[] args) {\n" +
- " List l = new List();\n" +
- " Map e= null;\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C implements Serializable{\n" +
+ " public static void main(String[] args) {\n" +
+ " List l = new List();\n" +
+ " Map e= null;\n" +
+ " }\n" +
"}");
assertEqualString(cu.getSource(), buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=378024
public void testBug378024b() throws Exception {
IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
StringBuffer buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/*\n" +
@@ -3688,13 +3688,13 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
" * don't move me 3\n" +
" */\n" +
"import java.util.HashMap;// test3\n" +
- "// commen 3\n" +
- "\n" +
- "public class C implements Serializable{\n" +
- " public static void main(String[] args) {\n" +
- " List l = new List();\n" +
- " Map e= null;\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C implements Serializable{\n" +
+ " public static void main(String[] args) {\n" +
+ " List l = new List();\n" +
+ " Map e= null;\n" +
+ " }\n" +
"}");
ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
@@ -3710,7 +3710,7 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/*\n" +
@@ -3729,26 +3729,26 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
" * don't move me 3\n" +
" */\n" +
"// test3\n" +
- "// commen 3\n" +
+ "// commen 3\n" +
"import java.util.*;\n" +
- "\n" +
- "public class C implements Serializable{\n" +
- " public static void main(String[] args) {\n" +
- " List l = new List();\n" +
- " Map e= null;\n" +
- " }\n" +
+ "\n" +
+ "public class C implements Serializable{\n" +
+ " public static void main(String[] args) {\n" +
+ " List l = new List();\n" +
+ " Map e= null;\n" +
+ " }\n" +
"}");
assertEqualString(cu.getSource(), buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=378024
- // leading and trailing comments always move with imports.
+ // leading and trailing comments always move with imports.
// comments in between stay where they are
public void testBug378024c() throws Exception {
IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
StringBuffer buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/*\n" +
@@ -3775,13 +3775,13 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
"\n" +
"//lead 3\n" +
"import java.util.HashMap;// test3\n" +
- "// commen 3\n" +
- "\n" +
- "public class C implements Serializable{\n" +
- " public static void main(String[] args) {\n" +
- " List l = new List();\n" +
- " Map e= null;\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C implements Serializable{\n" +
+ " public static void main(String[] args) {\n" +
+ " List l = new List();\n" +
+ " Map e= null;\n" +
+ " }\n" +
"}");
ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
@@ -3797,7 +3797,7 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/*\n" +
@@ -3824,25 +3824,25 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
"\n" +
"//lead 3\n" +
"import java.util.HashMap;// test3\n" +
- "// commen 3\n" +
+ "// commen 3\n" +
"\n" +
- "public class C implements Serializable{\n" +
- " public static void main(String[] args) {\n" +
- " List l = new List();\n" +
- " Map e= null;\n" +
- " }\n" +
+ "public class C implements Serializable{\n" +
+ " public static void main(String[] args) {\n" +
+ " List l = new List();\n" +
+ " Map e= null;\n" +
+ " }\n" +
"}");
assertEqualString(cu.getSource(), buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=378024
- // leading and trailing comments always move with imports.
+ // leading and trailing comments always move with imports.
// comments in between stay where they are
public void testBug378024c_1() throws Exception {
IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
StringBuffer buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/*\n" +
@@ -3869,13 +3869,13 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
"\n" +
"//lead 3\n" +
"import java.util.HashMap;// test3\n" +
- "// commen 3\n" +
- "\n" +
- "public class C implements Serializable{\n" +
- " public static void main(String[] args) {\n" +
- " List l = new List();\n" +
- " Map e= null;\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C implements Serializable{\n" +
+ " public static void main(String[] args) {\n" +
+ " List l = new List();\n" +
+ " Map e= null;\n" +
+ " }\n" +
"}");
ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
@@ -3891,7 +3891,7 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/*\n" +
@@ -3901,42 +3901,42 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
"\n" +
"// lead 1\n" +
"import java.awt.List;// test1\n" +
- "\n" +
+ "\n" +
"/*\n" +
" * don't move me 2\n" +
" */\n" +
- "\n" +
+ "\n" +
"// lead 2\n" +
"import java.io.Serializable;// test2\n" +
"/*\n" +
" * don't move me 3\n" +
" */\n" +
- "\n" +
+ "\n" +
"/*\n" +
" * don't move me 4\n" +
" */\n" +
- "\n" +
+ "\n" +
"//lead 3\n" +
"import java.util.HashMap;// test3\n" +
- "// commen 3\n" +
- "\n" +
- "public class C implements Serializable{\n" +
- " public static void main(String[] args) {\n" +
- " List l = new List();\n" +
- " Map e= null;\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C implements Serializable{\n" +
+ " public static void main(String[] args) {\n" +
+ " List l = new List();\n" +
+ " Map e= null;\n" +
+ " }\n" +
"}");
assertEqualString(cu.getSource(), buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=378024
- // leading and trailing comments always move with imports, even if they get folded.
+ // leading and trailing comments always move with imports, even if they get folded.
// comments in between stay where they are
public void testBug378024c_2() throws Exception {
IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
StringBuffer buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/*\n" +
@@ -3963,13 +3963,13 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
"\n" +
"//lead 3\n" +
"import java.util.HashMap;// test3\n" +
- "// commen 3\n" +
- "\n" +
- "public class C implements Serializable{\n" +
- " public static void main(String[] args) {\n" +
- " List l = new List();\n" +
- " Map e= null;\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C implements Serializable{\n" +
+ " public static void main(String[] args) {\n" +
+ " List l = new List();\n" +
+ " Map e= null;\n" +
+ " }\n" +
"}");
ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
@@ -3985,7 +3985,7 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/*\n" +
@@ -3996,43 +3996,43 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
"// lead 1\n" +
"// test1\n" +
"import java.awt.*;\n" +
- "\n" +
+ "\n" +
"/*\n" +
" * don't move me 2\n" +
" */\n" +
- "\n" +
+ "\n" +
"// lead 2\n" +
"// test2\n" +
"/*\n" +
" * don't move me 3\n" +
" */\n" +
"import java.io.*;\n" +
- "\n" +
+ "\n" +
"/*\n" +
" * don't move me 4\n" +
" */\n" +
- "\n" +
+ "\n" +
"//lead 3\n" +
"// test3\n" +
- "// commen 3\n" +
+ "// commen 3\n" +
"import java.util.*;\n" +
- "\n" +
- "public class C implements Serializable{\n" +
- " public static void main(String[] args) {\n" +
- " List l = new List();\n" +
- " Map e= null;\n" +
- " }\n" +
+ "\n" +
+ "public class C implements Serializable{\n" +
+ " public static void main(String[] args) {\n" +
+ " List l = new List();\n" +
+ " Map e= null;\n" +
+ " }\n" +
"}");
assertEqualString(cu.getSource(), buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=378024
// not adding an import should preserve its comments and put them at the end.
public void testBug378024d() throws Exception {
IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
StringBuffer buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/*\n" +
@@ -4059,13 +4059,13 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
"\n" +
"//lead 3\n" +
"import java.util.HashMap;// test3\n" +
- "// commen 3\n" +
- "\n" +
- "public class C implements Serializable{\n" +
- " public static void main(String[] args) {\n" +
- " List l = new List();\n" +
- " Map e= null;\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C implements Serializable{\n" +
+ " public static void main(String[] args) {\n" +
+ " List l = new List();\n" +
+ " Map e= null;\n" +
+ " }\n" +
"}");
ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
@@ -4080,7 +4080,7 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/*\n" +
@@ -4098,25 +4098,25 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
"\n" +
"//lead 3\n" +
"// test3\n" +
- "// commen 3\n" +
+ "// commen 3\n" +
"import java.util.*;\n" +
"\n" +
- "public class C implements Serializable{\n" +
- " public static void main(String[] args) {\n" +
- " List l = new List();\n" +
- " Map e= null;\n" +
- " }\n" +
+ "public class C implements Serializable{\n" +
+ " public static void main(String[] args) {\n" +
+ " List l = new List();\n" +
+ " Map e= null;\n" +
+ " }\n" +
"}");
assertEqualString(cu.getSource(), buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=378024
// adding a new import should not disturb comments and import should be added in its group
public void testBug378024e() throws Exception {
IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
StringBuffer buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/*\n" +
@@ -4143,13 +4143,13 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
"\n" +
"//lead 3\n" +
"import java.util.HashMap;// test3\n" +
- "// commen 3\n" +
- "\n" +
- "public class C implements Serializable{\n" +
- " public static void main(String[] args) {\n" +
- " List l = new List();\n" +
- " Map e= null;\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C implements Serializable{\n" +
+ " public static void main(String[] args) {\n" +
+ " List l = new List();\n" +
+ " Map e= null;\n" +
+ " }\n" +
"}");
ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
@@ -4166,7 +4166,7 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/*\n" +
@@ -4194,17 +4194,17 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
"\n" +
"//lead 3\n" +
"import java.util.HashMap;// test3\n" +
- "// commen 3\n" +
- "\n" +
- "public class C implements Serializable{\n" +
- " public static void main(String[] args) {\n" +
- " List l = new List();\n" +
- " Map e= null;\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C implements Serializable{\n" +
+ " public static void main(String[] args) {\n" +
+ " List l = new List();\n" +
+ " Map e= null;\n" +
+ " }\n" +
"}");
assertEqualString(cu.getSource(), buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=378024
// removing an import should preserve its comments at the end, and adding a new import should not disturb
// existing comments
@@ -4212,7 +4212,7 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
StringBuffer buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/*\n" +
@@ -4239,13 +4239,13 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
"\n" +
"//lead 3\n" +
"import java.util.HashMap;// test3\n" +
- "// commen 3\n" +
- "\n" +
- "public class C implements Serializable{\n" +
- " public static void main(String[] args) {\n" +
- " List l = new List();\n" +
- " Map e= null;\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C implements Serializable{\n" +
+ " public static void main(String[] args) {\n" +
+ " List l = new List();\n" +
+ " Map e= null;\n" +
+ " }\n" +
"}");
ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
@@ -4261,7 +4261,7 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/*\n" +
@@ -4279,24 +4279,24 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
"\n" +
"//lead 3\n" +
"import java.util.HashMap;// test3\n" +
- "// commen 3\n" +
+ "// commen 3\n" +
"\n" +
- "public class C implements Serializable{\n" +
- " public static void main(String[] args) {\n" +
- " List l = new List();\n" +
- " Map e= null;\n" +
- " }\n" +
+ "public class C implements Serializable{\n" +
+ " public static void main(String[] args) {\n" +
+ " List l = new List();\n" +
+ " Map e= null;\n" +
+ " }\n" +
"}");
assertEqualString(cu.getSource(), buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=378024
// folding imports because of a newly added import should preserve comments
public void testBug378024f() throws Exception {
IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
StringBuffer buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/*\n" +
@@ -4323,13 +4323,13 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
"\n" +
"//lead 3\n" +
"import java.util.HashMap;// test3\n" +
- "// commen 3\n" +
- "\n" +
- "public class C implements Serializable{\n" +
- " public static void main(String[] args) {\n" +
- " List l = new List();\n" +
- " Map e= null;\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C implements Serializable{\n" +
+ " public static void main(String[] args) {\n" +
+ " List l = new List();\n" +
+ " Map e= null;\n" +
+ " }\n" +
"}");
ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
@@ -4346,7 +4346,7 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/*\n" +
@@ -4374,24 +4374,24 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
"\n" +
"//lead 3\n" +
"import java.util.HashMap;// test3\n" +
- "// commen 3\n" +
- "\n" +
- "public class C implements Serializable{\n" +
- " public static void main(String[] args) {\n" +
- " List l = new List();\n" +
- " Map e= null;\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C implements Serializable{\n" +
+ " public static void main(String[] args) {\n" +
+ " List l = new List();\n" +
+ " Map e= null;\n" +
+ " }\n" +
"}");
assertEqualString(cu.getSource(), buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=378024
// folding imports because of a newly added import should preserve comments
public void testBug378024f_1() throws Exception {
IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
StringBuffer buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/*\n" +
@@ -4424,13 +4424,13 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
"\n" +
"//lead 4\n" +
"import java.util.HashMap;// test4\n" +
- "// commen 3\n" +
- "\n" +
- "public class C implements Serializable{\n" +
- " public static void main(String[] args) {\n" +
- " List l = new List();\n" +
- " Map e= null;\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C implements Serializable{\n" +
+ " public static void main(String[] args) {\n" +
+ " List l = new List();\n" +
+ " Map e= null;\n" +
+ " }\n" +
"}");
ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
@@ -4447,7 +4447,7 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/*\n" +
@@ -4480,24 +4480,24 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
"\n" +
"//lead 4\n" +
"import java.util.HashMap;// test4\n" +
- "// commen 3\n" +
+ "// commen 3\n" +
"\n" +
- "public class C implements Serializable{\n" +
- " public static void main(String[] args) {\n" +
- " List l = new List();\n" +
- " Map e= null;\n" +
- " }\n" +
+ "public class C implements Serializable{\n" +
+ " public static void main(String[] args) {\n" +
+ " List l = new List();\n" +
+ " Map e= null;\n" +
+ " }\n" +
"}");
assertEqualString(cu.getSource(), buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=378024
// Re-ordering imports and converting them to *
public void testBug378024g() throws Exception {
IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
StringBuffer buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/*\n" +
@@ -4523,13 +4523,13 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
"\n" +
"//lead 3\n" +
"import java.util.HashMap;// test3\n" +
- "// commen 3\n" +
- "\n" +
- "public class C implements Serializable{\n" +
- " public static void main(String[] args) {\n" +
- " List l = new List();\n" +
- " Map e= null;\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C implements Serializable{\n" +
+ " public static void main(String[] args) {\n" +
+ " List l = new List();\n" +
+ " Map e= null;\n" +
+ " }\n" +
"}");
ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
@@ -4545,7 +4545,7 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
StringBuffer buf2 = new StringBuffer();
buf2.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/*\n" +
@@ -4559,7 +4559,7 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
"\n" +
"//lead 3\n" +
"// test3\n" +
- "// commen 3\n" +
+ "// commen 3\n" +
"import java.util.*;\n" +
"\n" +
"/*\n" +
@@ -4576,15 +4576,15 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
" */\n" +
"import java.io.*;\n" +
"\n" +
- "public class C implements Serializable{\n" +
- " public static void main(String[] args) {\n" +
- " List l = new List();\n" +
- " Map e= null;\n" +
- " }\n" +
+ "public class C implements Serializable{\n" +
+ " public static void main(String[] args) {\n" +
+ " List l = new List();\n" +
+ " Map e= null;\n" +
+ " }\n" +
"}");
assertEqualString(cu.getSource(), buf2.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=378024
// Preserve comments when imports are removed in case the restoring of imports is enabled
// This will test changes in org.eclipse.jdt.internal.core.dom.rewrite.ImportRewriteAnalyzer.removeImport(String, boolean)
@@ -4592,7 +4592,7 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
StringBuffer buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/*\n" +
@@ -4619,12 +4619,12 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
"\n" +
"//lead 3\n" +
"import java.util.HashMap;// test3\n" +
- "// commen 3\n" +
- "\n" +
- "public class C implements Serializable{\n" +
- " public static void main(String[] args) {\n" +
- " Map e= null;\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C implements Serializable{\n" +
+ " public static void main(String[] args) {\n" +
+ " Map e= null;\n" +
+ " }\n" +
"}");
ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
@@ -4638,7 +4638,7 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"/*\n" +
" * don't move me 2\n" +
@@ -4656,23 +4656,23 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
"\n" +
"//lead 3\n" +
"import java.util.HashMap;// test3\n" +
- "// commen 3\n" +
- "\n" +
- "public class C implements Serializable{\n" +
- " public static void main(String[] args) {\n" +
- " Map e= null;\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C implements Serializable{\n" +
+ " public static void main(String[] args) {\n" +
+ " Map e= null;\n" +
+ " }\n" +
"}");
assertEqualString(cu.getSource(), buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=378024
// Preserve comments when imports are removed in case the restoring of imports is enabled
public void testBug378024h_1() throws Exception {
IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
StringBuffer buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/*\n" +
@@ -4699,12 +4699,12 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
"\n" +
"//lead 3\n" +
"import java.util.HashMap;// test3\n" +
- "// commen 3\n" +
- "\n" +
- "public class C implements Serializable{\n" +
- " public static void main(String[] args) {\n" +
- " Map e= null;\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C implements Serializable{\n" +
+ " public static void main(String[] args) {\n" +
+ " Map e= null;\n" +
+ " }\n" +
"}");
ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
@@ -4719,7 +4719,7 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"/*\n" +
" * don't move me 2\n" +
@@ -4737,24 +4737,24 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
"\n" +
"//lead 3\n" +
"import java.util.HashMap;// test3\n" +
- "// commen 3\n" +
- "import java.util.List;\n" +
- "\n" +
- "public class C implements Serializable{\n" +
- " public static void main(String[] args) {\n" +
- " Map e= null;\n" +
- " }\n" +
+ "// commen 3\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "public class C implements Serializable{\n" +
+ " public static void main(String[] args) {\n" +
+ " Map e= null;\n" +
+ " }\n" +
"}");
assertEqualString(cu.getSource(), buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=378024
// Preserve comments when imports are unfolded.
public void testBug378024i() throws Exception {
IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
StringBuffer buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/*\n" +
@@ -4781,14 +4781,14 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
"\n" +
"//lead 3\n" +
"import java.util.*;// test3\n" +
- "// commen 3\n" +
- "\n" +
- "public class C implements Serializable{\n" +
- " public static void main(String[] args) {\n" +
- " HashMap e= null;\n" +
- " PrintWriter p= null;\n" +
- " List l= null;\n" +
- " }\n" +
+ "// commen 3\n" +
+ "\n" +
+ "public class C implements Serializable{\n" +
+ " public static void main(String[] args) {\n" +
+ " HashMap e= null;\n" +
+ " PrintWriter p= null;\n" +
+ " List l= null;\n" +
+ " }\n" +
"}");
ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
@@ -4805,7 +4805,7 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/*\n" +
@@ -4835,27 +4835,27 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
"\n" +
"//lead 3\n" +
"// test3\n" +
- "// commen 3\n" +
+ "// commen 3\n" +
"import java.util.HashMap;\n" +
"import java.util.Map;\n" +
- "\n" +
- "public class C implements Serializable{\n" +
- " public static void main(String[] args) {\n" +
- " HashMap e= null;\n" +
- " PrintWriter p= null;\n" +
- " List l= null;\n" +
- " }\n" +
+ "\n" +
+ "public class C implements Serializable{\n" +
+ " public static void main(String[] args) {\n" +
+ " HashMap e= null;\n" +
+ " PrintWriter p= null;\n" +
+ " List l= null;\n" +
+ " }\n" +
"}");
assertEqualString(cu.getSource(), buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=378024
// Preserve comments when imports are folded but a member type import is present
public void testBug378024j() throws Exception {
IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
StringBuffer buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/*\n" +
@@ -4887,11 +4887,11 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
"// lead 2\n" +
"import java.io.Serializable;// test2\n" +
"// commen 3\n" +
- "\n" +
- "public class C implements Serializable{\n" +
- " public static void main(String[] args) {\n" +
- " Map e= null;\n" +
- " }\n" +
+ "\n" +
+ "public class C implements Serializable{\n" +
+ " public static void main(String[] args) {\n" +
+ " Map e= null;\n" +
+ " }\n" +
"}");
ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
@@ -4908,7 +4908,7 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
buf = new StringBuffer();
buf.append(
- "package pack1;\n" +
+ "package pack1;\n" +
"\n" +
"// comment 1\n" +
"/*\n" +
@@ -4943,11 +4943,11 @@ public class ImportRewriteTest extends AbstractJavaModelTests {
"// member type import\n" +
"/*keep me with Map.Entry 2*/\n" +
"import java.util.Map.*;\n" +
- "\n" +
- "public class C implements Serializable{\n" +
- " public static void main(String[] args) {\n" +
- " Map e= null;\n" +
- " }\n" +
+ "\n" +
+ "public class C implements Serializable{\n" +
+ " public static void main(String[] args) {\n" +
+ " Map e= null;\n" +
+ " }\n" +
"}");
assertEqualString(cu.getSource(), buf.toString());
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/modifying/ASTRewritingModifyingCopyTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/modifying/ASTRewritingModifyingCopyTest.java
index 1d9548d64..a5e94be41 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/modifying/ASTRewritingModifyingCopyTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/modifying/ASTRewritingModifyingCopyTest.java
@@ -409,29 +409,29 @@ public class ASTRewritingModifyingCopyTest extends ASTRewritingModifyingTest {
public void test0008() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test0008", false, null);
StringBuffer buf= new StringBuffer();
- buf.append("package test0008;\n" +
- "\n" +
- "public class TestClass {\n" +
- " Thread t = new Thread(new Runnable(){\n" +
- "\n" +
- " @Override\n" +
- " public void run() {\n" +
- " try {\n" +
- " Thread.currentThread().sleep(1000);\n" +
- " } catch (InterruptedException e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " });\n" +
- "\n" +
- " public void testMethod(){\n" +
- " t.start();\n" +
- " }\n" +
- "\n" +
- " public static Thread staticTestMethod(Thread thread){\n" +
- " return thread;\n" +
- " }\n" +
+ buf.append("package test0008;\n" +
+ "\n" +
+ "public class TestClass {\n" +
+ " Thread t = new Thread(new Runnable(){\n" +
+ "\n" +
+ " @Override\n" +
+ " public void run() {\n" +
+ " try {\n" +
+ " Thread.currentThread().sleep(1000);\n" +
+ " } catch (InterruptedException e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
+ " });\n" +
+ "\n" +
+ " public void testMethod(){\n" +
+ " t.start();\n" +
+ " }\n" +
+ "\n" +
+ " public static Thread staticTestMethod(Thread thread){\n" +
+ " return thread;\n" +
+ " }\n" +
"}");
ICompilationUnit cu = pack1.createCompilationUnit("Test.java", buf.toString(), false, null);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/modifying/ASTRewritingModifyingRemoveTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/modifying/ASTRewritingModifyingRemoveTest.java
index 3b03704ef..861f374dd 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/modifying/ASTRewritingModifyingRemoveTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/modifying/ASTRewritingModifyingRemoveTest.java
@@ -474,7 +474,7 @@ public class ASTRewritingModifyingRemoveTest extends ASTRewritingModifyingTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=306524
* To test that when types are removed, only the comments in the extended source range are
@@ -565,12 +565,12 @@ public class ASTRewritingModifyingRemoveTest extends ASTRewritingModifyingTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=306524
* To test that when types are removed, only the comments in the extended source range are
- * removed, and the rest are left untouched. This test is for cases where type to be removed is the
- * last one in file and there are more than one leading comments that are not part of its
+ * removed, and the rest are left untouched. This test is for cases where type to be removed is the
+ * last one in file and there are more than one leading comments that are not part of its
* extended source range
*/
public void test0013() throws Exception {
@@ -649,7 +649,7 @@ public class ASTRewritingModifyingRemoveTest extends ASTRewritingModifyingTest {
*/
public void testBug446446_001() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("testBug446446_001", false, null);
- String contents =
+ String contents =
"package testBug446446_001;\n"+
"public class X {\n " +
" public static void main(String[] args) {\n" +
@@ -678,7 +678,7 @@ public class ASTRewritingModifyingRemoveTest extends ASTRewritingModifyingTest {
instance.arguments().remove(1);
String preview = evaluateRewrite(cu, astRoot);
- String expected =
+ String expected =
"package testBug446446_001;\n"+
"public class X {\n " +
" public static void main(String[] args) {\n" +
@@ -697,7 +697,7 @@ public class ASTRewritingModifyingRemoveTest extends ASTRewritingModifyingTest {
*/
public void testBug446446_002() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("testBug446446_002", false, null);
- String contents =
+ String contents =
"package testBug446446_002;\n"+
"public class X {\n"+
" public void foo() {\n"+
@@ -723,7 +723,7 @@ public class ASTRewritingModifyingRemoveTest extends ASTRewritingModifyingTest {
Block thenBlock= (Block) ifStatement.getThenStatement();
thenBlock.statements().remove(2);
String preview = evaluateRewrite(cu, astRoot);
- String expected =
+ String expected =
"package testBug446446_002;\n"+
"public class X {\n"+
" public void foo() {\n"+
@@ -739,7 +739,7 @@ public class ASTRewritingModifyingRemoveTest extends ASTRewritingModifyingTest {
*/
public void testBug446446_003() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("testBug446446_003", false, null);
- String contents =
+ String contents =
"package testBug446446_003;\n"+
"public class X {\n"+
" public void foo() {\n"+
@@ -766,7 +766,7 @@ public class ASTRewritingModifyingRemoveTest extends ASTRewritingModifyingTest {
Block thenBlock= (Block) ifStatement.getThenStatement();
thenBlock.statements().remove(2);
String preview = evaluateRewrite(cu, astRoot);
- String expected =
+ String expected =
"package testBug446446_003;\n"+
"public class X {\n"+
" public void foo() {\n"+
@@ -783,7 +783,7 @@ public class ASTRewritingModifyingRemoveTest extends ASTRewritingModifyingTest {
*/
public void testBug446446_004() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("testBug446446_004", false, null);
- String contents =
+ String contents =
"package testBug446446_004;\n"+
"public class X {\n"+
" public void foo() {\n"+
@@ -811,7 +811,7 @@ public class ASTRewritingModifyingRemoveTest extends ASTRewritingModifyingTest {
thenBlock.statements().remove(2);
thenBlock.statements().remove(2);
String preview = evaluateRewrite(cu, astRoot);
- String expected =
+ String expected =
"package testBug446446_004;\n"+
"public class X {\n"+
" public void foo() {\n"+
@@ -828,7 +828,7 @@ public class ASTRewritingModifyingRemoveTest extends ASTRewritingModifyingTest {
*/
public void testBug446446_005() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("testBug446446_005", false, null);
- String contents =
+ String contents =
"package testBug446446_005;\n"+
"public class X {\n"+
" public void foo() {\n"+
@@ -862,7 +862,7 @@ public class ASTRewritingModifyingRemoveTest extends ASTRewritingModifyingTest {
thenBlock.statements().add(newStatement);
String preview = evaluateRewrite(cu, astRoot);
- String expected =
+ String expected =
"package testBug446446_005;\n"+
"public class X {\n"+
" public void foo() {\n"+
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/modifying/ASTRewritingModifyingReplaceTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/modifying/ASTRewritingModifyingReplaceTest.java
index 5d5a55b80..b21e5407a 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/modifying/ASTRewritingModifyingReplaceTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/modifying/ASTRewritingModifyingReplaceTest.java
@@ -466,7 +466,7 @@ public class ASTRewritingModifyingReplaceTest extends ASTRewritingModifyingTest
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=331138
// Make sure comments between removed and replaced node are not removed.
public void test0014a() throws Exception {
@@ -498,10 +498,10 @@ public class ASTRewritingModifyingReplaceTest extends ASTRewritingModifyingTest
List statements = body.statements();
VariableDeclarationStatement varDeclaration = (VariableDeclarationStatement) statements.get(0);
statements.remove(0);
-
+
statements.set(0, varDeclaration);
String preview = evaluateRewrite(cu, astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0014;\n");
buf.append("public class X {\n");
@@ -518,7 +518,7 @@ public class ASTRewritingModifyingReplaceTest extends ASTRewritingModifyingTest
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=331138
// Make sure comments between removed and replaced node are not removed.
public void test0014b() throws Exception {
@@ -551,10 +551,10 @@ public class ASTRewritingModifyingReplaceTest extends ASTRewritingModifyingTest
List statements = body.statements();
VariableDeclarationStatement varDeclaration = (VariableDeclarationStatement) statements.get(0);
statements.remove(0);
-
+
statements.set(0, varDeclaration);
String preview = evaluateRewrite(cu, astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0014;\n");
buf.append("public class X {\n");
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/modifying/ASTRewritingModifyingTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/modifying/ASTRewritingModifyingTest.java
index e77229eef..ddf79d061 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/modifying/ASTRewritingModifyingTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/modifying/ASTRewritingModifyingTest.java
@@ -44,7 +44,7 @@ public abstract class ASTRewritingModifyingTest extends AbstractJavaModelTests {
/** @deprecated using deprecated code */
private static final int AST_INTERNAL_JLS2 = AST.JLS2;
-
+
/**
* Internal synonym for deprecated constant AST.JSL3
* to alleviate deprecation warnings.
@@ -223,7 +223,7 @@ public abstract class ASTRewritingModifyingTest extends AbstractJavaModelTests {
buffer.append("\");");
return buffer.toString();
}
-
+
static int getJLS3() {
return JLS3_INTERNAL;
}
diff --git a/org.eclipse.jdt.core/antadapter/org/eclipse/jdt/core/CheckDebugAttributes.java b/org.eclipse.jdt.core/antadapter/org/eclipse/jdt/core/CheckDebugAttributes.java
index cee541f53..9d38412df 100644
--- a/org.eclipse.jdt.core/antadapter/org/eclipse/jdt/core/CheckDebugAttributes.java
+++ b/org.eclipse.jdt.core/antadapter/org/eclipse/jdt/core/CheckDebugAttributes.java
@@ -29,14 +29,14 @@ import org.eclipse.jdt.internal.antadapter.AntAdapterMessages;
/**
* <p>An Ant task to find out if a class file or a jar contains debug attributes. If this is the case,
* the property contains the value "has debug" after the call.
- * </p>
+ * </p>
* <p>
* <code>&lt;eclipse.checkDebugAttributes property="hasDebug" file="${basedir}/bin/p/A.class"/&gt;</code>
* </p>
* <p>
* For more information on Ant check out the website at http://jakarta.apache.org/ant/ .
* </p>
- *
+ *
* This is not intended to be subclassed by users.
* @since 2.0
*/
@@ -45,7 +45,7 @@ public final class CheckDebugAttributes extends Task {
private String file;
private String property;
-
+
@Override
public void execute() throws BuildException {
if (this.file == null) {
@@ -85,14 +85,14 @@ public final class CheckDebugAttributes extends Task {
throw new BuildException(AntAdapterMessages.getString("checkDebugAttributes.ioexception.occured") + this.file, e); //$NON-NLS-1$
}
}
-
+
private boolean checkClassFile(IClassFileReader classFileReader) {
IMethodInfo[] methodInfos = classFileReader.getMethodInfos();
for (int i = 0, max = methodInfos.length; i < max; i++) {
ICodeAttribute codeAttribute = methodInfos[i].getCodeAttribute();
if (codeAttribute != null && codeAttribute.getLineNumberAttribute() != null) {
return true;
- }
+ }
}
return false;
}
@@ -100,7 +100,7 @@ public final class CheckDebugAttributes extends Task {
public void setFile(String value) {
this.file = value;
}
-
+
public void setProperty(String value) {
this.property = value;
}
diff --git a/org.eclipse.jdt.core/antadapter/org/eclipse/jdt/internal/antadapter/AntAdapterMessages.java b/org.eclipse.jdt.core/antadapter/org/eclipse/jdt/internal/antadapter/AntAdapterMessages.java
index 4310c78f7..482f84d00 100644
--- a/org.eclipse.jdt.core/antadapter/org/eclipse/jdt/internal/antadapter/AntAdapterMessages.java
+++ b/org.eclipse.jdt.core/antadapter/org/eclipse/jdt/internal/antadapter/AntAdapterMessages.java
@@ -23,7 +23,7 @@ public class AntAdapterMessages {
private static final String BUNDLE_NAME = "org.eclipse.jdt.internal.antadapter.messages"; //$NON-NLS-1$
private static ResourceBundle RESOURCE_BUNDLE;
-
+
static {
try {
RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME, Locale.getDefault());
diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/BasicModule.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/BasicModule.java
index 1dcfc2231..1bf653f86 100644
--- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/BasicModule.java
+++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/BasicModule.java
@@ -103,7 +103,7 @@ public class BasicModule implements ISourceModule {
Service[] provides;
IModule.IPackageExport[] opens;
private ICompilationUnit compilationUnit;
-
+
public BasicModule(ModuleDeclaration descriptor, IModulePathEntry root) {
this.compilationUnit = descriptor.compilationResult().compilationUnit;
this.name = descriptor.moduleName;
diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.java
index e2c2a951f..3d6cc5409 100644
--- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.java
+++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.java
@@ -135,13 +135,13 @@ private NameEnvironmentAnswer findClassInternal(char[] typeName, String qualifie
int adjustedMode = this.mode;
if (Config.getSourceTypeRequired())
adjustedMode = SOURCE;
-// SH}
-
+// SH}
+
String fileName = new String(typeName);
//{ObjectTeams: was "this.mode" instead of adjustedMode
boolean binaryExists = ((adjustedMode & BINARY) != 0) && doesFileExist(fileName + SUFFIX_STRING_class, qualifiedPackageName);
boolean sourceExists = ((adjustedMode & SOURCE) != 0) && doesFileExist(fileName + SUFFIX_STRING_java, qualifiedPackageName);
-// SH}
+// SH}
if (sourceExists && !asBinaryOnly) {
String fullSourcePath = this.path + qualifiedBinaryFileName.substring(0, qualifiedBinaryFileName.length() - 6) + SUFFIX_STRING_java;
CompilationUnit unit = new CompilationUnit(null, fullSourcePath, this.encoding, this.destinationPath);
@@ -160,7 +160,7 @@ private NameEnvironmentAnswer findClassInternal(char[] typeName, String qualifie
try {
ClassFileReader reader = ClassFileReader.read(this.path + qualifiedBinaryFileName);
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=321115, package names are to be treated case sensitive.
- String typeSearched = qualifiedPackageName.length() > 0 ?
+ String typeSearched = qualifiedPackageName.length() > 0 ?
qualifiedPackageName.replace(File.separatorChar, '/') + "/" + fileName //$NON-NLS-1$
: fileName;
if (!CharOperation.equals(reader.getName(), typeSearched.toCharArray())) {
@@ -219,8 +219,8 @@ private Hashtable<String, String> getSecondaryTypes(String qualifiedPackageName)
Hashtable<String, String> packageEntry = new Hashtable<>();
String[] dirList = (String[]) this.directoryCache.get(qualifiedPackageName);
- if (dirList == this.missingPackageHolder // package exists in another classpath directory or jar
- || dirList == null)
+ if (dirList == this.missingPackageHolder // package exists in another classpath directory or jar
+ || dirList == null)
return packageEntry;
File dir = new File(this.path + qualifiedPackageName);
@@ -235,7 +235,7 @@ private Hashtable<String, String> getSecondaryTypes(String qualifiedPackageName)
if (!(s.endsWith(SUFFIX_STRING_java) || s.endsWith(SUFFIX_STRING_JAVA))) continue;
CompilationUnit cu = new CompilationUnit(null, s, this.encoding, this.destinationPath);
CompilationResult compilationResult = new CompilationResult(s.toCharArray(), 1, 1, 10);
- ProblemReporter problemReporter =
+ ProblemReporter problemReporter =
new ProblemReporter(
DefaultErrorHandlingPolicies.proceedWithAllProblems(),
new CompilerOptions(this.options),
@@ -249,14 +249,14 @@ private Hashtable<String, String> getSecondaryTypes(String qualifiedPackageName)
for (int j = 0, k = types.length; j < k; j++) {
TypeDeclaration type = types[j];
char[] name = type.isSecondary() ? type.name : null; // add only secondary types
- if (name != null)
+ if (name != null)
packageEntry.put(new String(name), s);
}
}
return packageEntry;
}
private NameEnvironmentAnswer findSourceSecondaryType(String typeName, String qualifiedPackageName, String qualifiedBinaryFileName) {
-
+
if (this.packageSecondaryTypes == null) this.packageSecondaryTypes = new Hashtable<>();
Hashtable<String, String> packageEntry = this.packageSecondaryTypes.get(qualifiedPackageName);
if (packageEntry == null) {
diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJar.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJar.java
index 0f85ef512..1fcce4bee 100644
--- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJar.java
+++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJar.java
@@ -156,7 +156,7 @@ public NameEnvironmentAnswer findClass(char[] typeName, String qualifiedPackageN
}
@Override
public boolean hasAnnotationFileFor(String qualifiedTypeName) {
- return this.zipFile.getEntry(qualifiedTypeName+ExternalAnnotationProvider.ANNOTATION_FILE_SUFFIX) != null;
+ return this.zipFile.getEntry(qualifiedTypeName+ExternalAnnotationProvider.ANNOTATION_FILE_SUFFIX) != null;
}
@Override
public char[][][] findTypeNames(final String qualifiedPackageName, String moduleName) {
@@ -205,7 +205,7 @@ void acceptModule(ClassFileReader reader) {
}
}
void acceptModule(byte[] content) {
- if (content == null)
+ if (content == null)
return;
ClassFileReader reader = null;
try {
@@ -235,7 +235,7 @@ public synchronized char[][] getModulesDeclaringPackage(String qualifiedPackageN
this.packageCache = new HashSet<>(41);
this.packageCache.add(Util.EMPTY_STRING);
-
+
for (Enumeration e = this.zipFile.entries(); e.hasMoreElements(); ) {
String fileName = ((ZipEntry) e.nextElement()).getName();
addToPackageCache(fileName, false);
@@ -254,7 +254,7 @@ public boolean hasCompilationUnit(String qualifiedPackageName, String moduleName
if (tail.toLowerCase().endsWith(SUFFIX_STRING_class))
return true;
}
- }
+ }
return false;
}
diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJep247Jdk12.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJep247Jdk12.java
index c3a28d023..d49d5f74f 100644
--- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJep247Jdk12.java
+++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJep247Jdk12.java
@@ -172,7 +172,7 @@ public class ClasspathJep247Jdk12 extends ClasspathJep247 {
@Override
public FileVisitResult visitFile(java.nio.file.Path f, BasicFileAttributes attrs) throws IOException {
- if (attrs.isDirectory() || f.getNameCount() < 3)
+ if (attrs.isDirectory() || f.getNameCount() < 3)
return FileVisitResult.CONTINUE;
if (f.getFileName().toString().equals(MODULE_INFO) && Files.exists(f)) {
byte[] content = JRTUtil.safeReadBytes(f);
@@ -222,7 +222,7 @@ public class ClasspathJep247Jdk12 extends ClasspathJep247 {
return null;
}
void acceptModule(String name, byte[] content, Map<String, IModule> cache) {
- if (content == null)
+ if (content == null)
return;
if (cache.containsKey(name))
diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJmod.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJmod.java
index 09786d668..7334d2bec 100644
--- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJmod.java
+++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJmod.java
@@ -39,7 +39,7 @@ public class ClasspathJmod extends ClasspathJar {
public static char[] CLASSES = "classes".toCharArray(); //$NON-NLS-1$
public static char[] CLASSES_FOLDER = "classes/".toCharArray(); //$NON-NLS-1$
-
+
public ClasspathJmod(File file, boolean closeZipFileAtEnd,
AccessRuleSet accessRuleSet, String destinationPath) {
super(file, closeZipFileAtEnd, accessRuleSet, destinationPath);
@@ -97,7 +97,7 @@ public NameEnvironmentAnswer findClass(char[] typeName, String qualifiedPackageN
@Override
public boolean hasAnnotationFileFor(String qualifiedTypeName) {
qualifiedTypeName = new String(CharOperation.append(CLASSES_FOLDER, qualifiedTypeName.toCharArray()));
- return this.zipFile.getEntry(qualifiedTypeName+ExternalAnnotationProvider.ANNOTATION_FILE_SUFFIX) != null;
+ return this.zipFile.getEntry(qualifiedTypeName+ExternalAnnotationProvider.ANNOTATION_FILE_SUFFIX) != null;
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
@@ -142,7 +142,7 @@ public synchronized char[][] getModulesDeclaringPackage(String qualifiedPackageN
this.packageCache = new HashSet<>(41);
this.packageCache.add(Util.EMPTY_STRING);
-
+
for (Enumeration<? extends ZipEntry> e = this.zipFile.entries(); e.hasMoreElements(); ) {
char[] entryName = e.nextElement().getName().toCharArray();
int index = CharOperation.indexOf('/', entryName);
@@ -175,7 +175,7 @@ public boolean hasCompilationUnit(String qualifiedPackageName, String moduleName
}
}
}
- }
+ }
return false;
}
@Override
diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJrt.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJrt.java
index 03cdb86f2..104a9f0c0 100644
--- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJrt.java
+++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJrt.java
@@ -128,14 +128,14 @@ public class ClasspathJrt extends ClasspathLocation implements IMultiModuleEntry
return null; // most common case
final char[] packageArray = qualifiedPackageName.toCharArray();
final ArrayList answers = new ArrayList();
-
+
try {
JRTUtil.walkModuleImage(this.file, new JRTUtil.JrtFileVisitor<java.nio.file.Path>() {
@Override
public FileVisitResult visitPackage(java.nio.file.Path dir, java.nio.file.Path modPath, BasicFileAttributes attrs) throws IOException {
if (qualifiedPackageName.startsWith(dir.toString())) {
- return FileVisitResult.CONTINUE;
+ return FileVisitResult.CONTINUE;
}
return FileVisitResult.SKIP_SUBTREE;
}
@@ -168,7 +168,7 @@ public class ClasspathJrt extends ClasspathLocation implements IMultiModuleEntry
} catch (IOException e) {
// Ignore and move on
}
-
+
int size = answers.size();
if (size != 0) {
char[][][] result = new char[size][][];
@@ -193,7 +193,7 @@ public class ClasspathJrt extends ClasspathLocation implements IMultiModuleEntry
loadModules();
}
// public void acceptModule(IModuleDeclaration mod) {
-// if (this.isJrt)
+// if (this.isJrt)
// return;
// this.module = mod;
// }
@@ -252,7 +252,7 @@ public class ClasspathJrt extends ClasspathLocation implements IMultiModuleEntry
}
void acceptModule(byte[] content, Map<String, IModule> cache) {
- if (content == null)
+ if (content == null)
return;
ClassFileReader reader = null;
try {
@@ -264,7 +264,7 @@ public class ClasspathJrt extends ClasspathLocation implements IMultiModuleEntry
acceptModule(reader, cache);
}
}
-
+
@Override
public Collection<String> getModuleNames(Collection<String> limitModule, Function<String, IModule> getModule) {
Map<String, IModule> cache = ModulesCache.get(this.file.getPath());
@@ -288,7 +288,7 @@ public class ClasspathJrt extends ClasspathLocation implements IMultiModuleEntry
boolean isPotentialRoot = !isJavaDotStart; // always include non-java.*
if (!hasJavaDotSE)
isPotentialRoot |= isJavaDotStart; // no java.se => add all java.*
-
+
if (isPotentialRoot) {
IModule m = getModule.apply(mod);
if (m != null) {
@@ -320,7 +320,7 @@ public class ClasspathJrt extends ClasspathLocation implements IMultiModuleEntry
//
// this.packageCache = new HashSet<>(41);
// this.packageCache.add(Util.EMPTY_STRING);
-//
+//
// try {
// JRTUtil.walkModuleImage(this.file, new JRTUtil.JrtFileVisitor<java.nio.file.Path>() {
//
diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathLocation.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathLocation.java
index ac693db11..e2c3c7ca3 100644
--- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathLocation.java
+++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathLocation.java
@@ -35,7 +35,7 @@ public abstract class ClasspathLocation implements FileSystem.Classpath,
public static final int SOURCE = 1;
public static final int BINARY = 2;
-
+
String path;
char[] normalizedPath;
public AccessRuleSet accessRuleSet;
@@ -45,14 +45,14 @@ public abstract class ClasspathLocation implements FileSystem.Classpath,
// destination path for compilation units that are reached through this
// classpath location; the coding is consistent with the one of
// Main.destinationPath:
- // == null: unspecified, use whatever value is set by the enclosing
+ // == null: unspecified, use whatever value is set by the enclosing
// context, id est Main;
// == Main.NONE: absorbent element, do not output class files;
// else: use as the path of the directory into which class files must
// be written.
- // potentially carried by any entry that contains to be compiled files
-
- protected ClasspathLocation(AccessRuleSet accessRuleSet,
+ // potentially carried by any entry that contains to be compiled files
+
+ protected ClasspathLocation(AccessRuleSet accessRuleSet,
String destinationPath) {
this.accessRuleSet = accessRuleSet;
this.destinationPath = destinationPath;
@@ -61,11 +61,11 @@ public abstract class ClasspathLocation implements FileSystem.Classpath,
/**
* Return the first access rule which is violated when accessing a given
* type, or null if no 'non accessible' access rule applies.
- *
+ *
* @param qualifiedBinaryFileName
* tested type specification, formed as:
* "org/eclipse/jdt/core/JavaCore.class"; on systems that
- * use \ as File.separator, the
+ * use \ as File.separator, the
* "org\eclipse\jdt\core\JavaCore.class" is accepted as well
* @return the first access rule which is violated when accessing a given
* type, or null if none applies
@@ -75,13 +75,13 @@ public abstract class ClasspathLocation implements FileSystem.Classpath,
return null;
char [] qualifiedTypeName = qualifiedBinaryFileName.
substring(0, qualifiedBinaryFileName.length() - SUFFIX_CLASS.length)
- .toCharArray();
+ .toCharArray();
if (File.separatorChar == '\\') {
CharOperation.replace(qualifiedTypeName, File.separatorChar, '/');
}
return this.accessRuleSet.getViolatedRestriction(qualifiedTypeName);
}
-
+
public int getMode() {
return SOURCE | BINARY;
}
@@ -121,7 +121,7 @@ public abstract class ClasspathLocation implements FileSystem.Classpath,
public String getDestinationPath() {
return this.destinationPath;
}
-
+
@Override
public void acceptModule(IModule mod) {
this.module = mod;
@@ -191,9 +191,9 @@ public abstract class ClasspathLocation implements FileSystem.Classpath,
return new char[][] { this.module.name() };
return new char[][] { ModuleBinding.UNNAMED };
}
-
+
@Override
public void reset() {
- this.module = null;
+ this.module = null;
}
}
diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathMultiReleaseJar.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathMultiReleaseJar.java
index 41756884e..2a108c0e9 100644
--- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathMultiReleaseJar.java
+++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathMultiReleaseJar.java
@@ -72,7 +72,7 @@ public class ClasspathMultiReleaseJar extends ClasspathJar {
this.packageCache = new HashSet<>(41);
this.packageCache.add(Util.EMPTY_STRING);
-
+
for (Enumeration e = this.zipFile.entries(); e.hasMoreElements(); ) {
String fileName = ((ZipEntry) e.nextElement()).getName();
addToPackageCache(fileName, false);
@@ -159,8 +159,8 @@ public class ClasspathMultiReleaseJar extends ClasspathJar {
}
if (this.accessRuleSet == null)
return new NameEnvironmentAnswer(reader, null, modName);
- return new NameEnvironmentAnswer(reader,
- this.accessRuleSet.getViolatedRestriction(fileNameWithoutExtension.toCharArray()),
+ return new NameEnvironmentAnswer(reader,
+ this.accessRuleSet.getViolatedRestriction(fileNameWithoutExtension.toCharArray()),
modName);
}
} catch (IOException | ClassFormatException e) {
diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathSourceJar.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathSourceJar.java
index 8e85825ca..126409d44 100644
--- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathSourceJar.java
+++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathSourceJar.java
@@ -25,8 +25,8 @@ import org.eclipse.jdt.internal.compiler.util.Util;
public class ClasspathSourceJar extends ClasspathJar {
private String encoding;
- public ClasspathSourceJar(File file, boolean closeZipFileAtEnd,
- AccessRuleSet accessRuleSet, String encoding,
+ public ClasspathSourceJar(File file, boolean closeZipFileAtEnd,
+ AccessRuleSet accessRuleSet, String encoding,
String destinationPath) {
super(file, closeZipFileAtEnd, accessRuleSet, destinationPath);
this.encoding = encoding;
@@ -41,7 +41,7 @@ public class ClasspathSourceJar extends ClasspathJar {
if (sourceEntry != null) {
try {
InputStream stream = null;
- char[] contents = null;
+ char[] contents = null;
try {
stream = this.zipFile.getInputStream(sourceEntry);
contents = Util.getInputStreamAsCharArray(stream, -1, this.encoding);
diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/CompilationUnit.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/CompilationUnit.java
index 4981e9c1b..80d9d1d20 100644
--- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/CompilationUnit.java
+++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/CompilationUnit.java
@@ -32,7 +32,7 @@ public class CompilationUnit implements ICompilationUnit {
public char[] module;
// a specific destination path for this compilation unit; coding is
// aligned with Main.destinationPath:
- // == null: unspecified, use whatever value is set by the enclosing
+ // == null: unspecified, use whatever value is set by the enclosing
// context, id est Main;
// == Main.NONE: absorbent element, do not output class files;
// else: use as the path of the directory into which class files must
@@ -65,7 +65,7 @@ public CompilationUnit(char[] contents, String fileName, String encoding,
}
}
this.fileName = fileNameCharArray;
- int start = CharOperation.lastIndexOf(File.separatorChar, fileNameCharArray) + 1;
+ int start = CharOperation.lastIndexOf(File.separatorChar, fileNameCharArray) + 1;
int end = CharOperation.lastIndexOf('.', fileNameCharArray);
if (end == -1) {
diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/FileFinder.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/FileFinder.java
index 6bcbfade9..247c0c49c 100644
--- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/FileFinder.java
+++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/FileFinder.java
@@ -20,10 +20,10 @@ import java.util.List;
import org.eclipse.jdt.internal.compiler.env.IModule;
public class FileFinder {
-
+
/**
* Although the file finder is meant to be generic for any file name patters,
- * at the moment it is used only for *.java files. This method handles the
+ * at the moment it is used only for *.java files. This method handles the
* module-info.java in a special way by always placing it as the first element
* of the resulting array.
*/
diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/FileSystem.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/FileSystem.java
index 85c172f91..7eca744e2 100644
--- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/FileSystem.java
+++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/FileSystem.java
@@ -159,7 +159,7 @@ public class FileSystem implements IModuleAwareNameEnvironment, SuffixConstants
return normalizedClasspath;
}
}
-
+
protected Classpath[] classpaths;
// Used only in single-module mode when the module descriptor is
// provided via command line.
@@ -238,7 +238,7 @@ protected FileSystem(Classpath[] paths, String[] initialFileNames, boolean annot
}
private void initializeModuleLocations(Set<String> limitedModules) {
// First create the mapping of all module/Classpath
- // since the second iteration of getModuleNames() can't be relied on for
+ // since the second iteration of getModuleNames() can't be relied on for
// to get the right origin of module
if (limitedModules == null) {
for (Classpath c : this.classpaths) {
@@ -273,7 +273,7 @@ public static Classpath getJrtClasspath(String jdkHome, String encoding, AccessR
return new ClasspathJrt(new File(convertPathSeparators(jdkHome)), true, accessRuleSet, null);
}
public static Classpath getOlderSystemRelease(String jdkHome, String release, AccessRuleSet accessRuleSet) {
- return isJRE12Plus ?
+ return isJRE12Plus ?
new ClasspathJep247Jdk12(new File(convertPathSeparators(jdkHome)), release, accessRuleSet) :
new ClasspathJep247(new File(convertPathSeparators(jdkHome)), release, accessRuleSet);
}
@@ -320,7 +320,7 @@ public static Classpath getClasspath(String classpathName, String encoding,
JRT_CLASSPATH_CACHE.put(file, result);
}
} else {
- result =
+ result =
(release == null) ?
new ClasspathJar(file, true, accessRuleSet, null) :
new ClasspathMultiReleaseJar(file, true, accessRuleSet, destinationPath, release);
@@ -431,7 +431,7 @@ private NameEnvironmentAnswer findClass(String qualifiedTypeName, char[] typeNam
zip = ExternalAnnotationDecorator.getAnnotationZipFile(classpathEntry.getPath(), null);
shouldClose = true;
}
- answer.setBinaryType(ExternalAnnotationDecorator.create(answer.getBinaryType(), classpathEntry.getPath(),
+ answer.setBinaryType(ExternalAnnotationDecorator.create(answer.getBinaryType(), classpathEntry.getPath(),
qualifiedTypeName, zip));
return answer;
} catch (IOException e) {
@@ -641,7 +641,7 @@ public boolean hasCompilationUnit(char[][] qualifiedPackageName, char[] moduleNa
LookupStrategy strategy = LookupStrategy.get(moduleName);
Parser parser = checkCUs ? getParser() : null;
Function<CompilationUnit, String> pkgNameExtractor = (sourceUnit) -> {
- String pkgName = null;
+ String pkgName = null;
CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 1);
char[][] name = parser.parsePackageDeclaration(sourceUnit.getContents(), compilationResult);
if (name != null) {
diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java
index 7afb89187..dca4dcb82 100644
--- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java
+++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java
@@ -15,7 +15,7 @@
* Benjamin Muskalla - Contribution for bug 239066
* Fraunhofer FIRST - extended API and implementation
* Technical University Berlin - extended API and implementation
- * 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 295551 - Add option to automatically promote all warnings to errors
* bug 359721 - [options] add command line option for new warning token "resource"
@@ -29,7 +29,7 @@
* Bug 408815 - [batch][null] Add CLI option for COMPILER_PB_SYNTACTIC_NULL_ANALYSIS_FOR_FIELDS
* Jesper S Moller - Contributions for
* bug 407297 - [1.8][compiler] Control generation of parameter names by option
- * Mat Booth - Contribution for bug 405176
+ * Mat Booth - Contribution for bug 405176
* Frits Jalvingh - fix for bug 533830.
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.batch;
@@ -240,7 +240,7 @@ public class Main implements ProblemSeverities, SuffixConstants {
this.parameters = new HashMap<>();
this.main = main;
}
-
+
//{ObjectTeams
/* lists of IProblem objects */
public ArrayList<IProblem> globalProblems;
@@ -863,17 +863,17 @@ public class Main implements ProblemSeverities, SuffixConstants {
}
this.printlnErr("----------"); //$NON-NLS-1$
}
-//{ObjectTeams
+//{ObjectTeams
this.globalProblems.add(problem);
if (problem.isError()) {
- // make exceptions distinguishable:
+ // make exceptions distinguishable:
this.globalErrors.add(problem);
if (problem.getID() == IProblem.Unclassified)
this.errorCode = -2; // signal an exception occurred.
} else if (problem.isWarning()) {
this.globalWarnings.add(problem);
}
-//carp+SH}
+//carp+SH}
}
public int logProblems(CategorizedProblem[] problems, char[] unitSource, Main currentMain) {
@@ -985,7 +985,7 @@ public class Main implements ProblemSeverities, SuffixConstants {
if (globalInfoCount == 1) {
infoMessage = this.main.bind("compile.oneInfo"); //$NON-NLS-1$
} else if (globalInfoCount > 1) {
- infoMessage = this.main.bind("compile.severalInfos", String.valueOf(warningsNumber)); //$NON-NLS-1$
+ infoMessage = this.main.bind("compile.severalInfos", String.valueOf(warningsNumber)); //$NON-NLS-1$
}
if (globalProblemsCount == globalInfoCount || globalProblemsCount == globalErrorsCount || globalProblemsCount == globalWarningsCount) {
String msg = errorMessage != null ? errorMessage : warningMessage != null ? warningMessage : infoMessage;
@@ -1107,12 +1107,12 @@ public class Main implements ProblemSeverities, SuffixConstants {
this.main.bind("compiler.name"), //$NON-NLS-1$
this.main.bind("compiler.version"), //$NON-NLS-1$
this.main.bind("compiler.copyright") //$NON-NLS-1$
-//{ObjectTeams: more version info
+//{ObjectTeams: more version info
,
this.main.bind("otdtc.name"), //$NON-NLS-1$
this.main.bind("otdtc.version"), //$NON-NLS-1$
this.main.bind("otdtc.copyright") //$NON-NLS-1$
-// SH}
+// SH}
}
);
@@ -1132,7 +1132,7 @@ public class Main implements ProblemSeverities, SuffixConstants {
this.main.bind("otdtc.name"), //$NON-NLS-1$
this.main.bind("otdtc.version"), //$NON-NLS-1$
this.main.bind("otdtc.copyright") //$NON-NLS-1$
-// SH}
+// SH}
}
);
@@ -1278,7 +1278,7 @@ public class Main implements ProblemSeverities, SuffixConstants {
logTiming(compilerStats);
}
if (this.main.globalProblemsCount > 0) {
- logProblemsSummary(this.main.globalProblemsCount, this.main.globalErrorsCount, this.main.globalWarningsCount,
+ logProblemsSummary(this.main.globalProblemsCount, this.main.globalErrorsCount, this.main.globalWarningsCount,
this.main.globalInfoCount, this.main.globalTasksCount);
}
if (this.main.exportedClassFilesCounter != 0
@@ -1688,7 +1688,7 @@ protected void addNewEntry(ArrayList<FileSystem.Classpath> paths, String current
if (NONE.equals(destPath)) {
destPath = NONE; // keep == comparison valid
}
-
+
if (rejectDestinationPathOnJars && destPath != null &&
Util.archiveFormat(currentClasspathName) > -1) {
throw new IllegalArgumentException(
@@ -1700,7 +1700,7 @@ protected void addNewEntry(ArrayList<FileSystem.Classpath> paths, String current
customEncoding,
isSourceOnly,
accessRuleSet,
- destPath,
+ destPath,
this.options,
this.releaseVersion);
if (currentClasspath != null) {
@@ -1771,7 +1771,7 @@ public String bind(String id, String[] arguments) {
* <li><code>org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants.JDK9</code></li>
* <li><code>org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants.JDK10</code></li>
* <li><code>org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants.JDK11</code></li>
- *
+ *
* </ul>
* @param minimalSupportedVersion the given minimal version
* @return true if and only if the running VM supports the given minimal version, false otherwise
@@ -1934,7 +1934,7 @@ public void configure(String[] argv) {
String currentSourceDirectory = null;
String currentArg = Util.EMPTY_STRING;
String moduleName = null;
-
+
Set<String> specifiedEncodings = null;
// expand the command line if necessary
@@ -2899,7 +2899,7 @@ public void configure(String[] argv) {
continue;
case INSIDE_RELEASE:
// If release is < 9, the following are disallowed:
- // bootclasspath, -Xbootclasspath, -Xbootclasspath/a:, -Xbootclasspath/p:,
+ // bootclasspath, -Xbootclasspath, -Xbootclasspath/a:, -Xbootclasspath/p:,
// -endorseddirs, -Djava.endorsed.dirs, -extdirs, -Djava.ext.dirs
// If release >= 9, the following are disallowed
@@ -3356,7 +3356,7 @@ private String validateModuleVersion(String versionString) {
}
private Parser getNewParser() {
- return new Parser(new ProblemReporter(getHandlingPolicy(),
+ return new Parser(new ProblemReporter(getHandlingPolicy(),
new CompilerOptions(this.options), getProblemFactory()), false);
}
private IModule extractModuleDesc(String fileName) {
@@ -3365,10 +3365,10 @@ private IModule extractModuleDesc(String fileName) {
// validated. Make sure the source level is set for the parser
Map<String,String> opts = new HashMap<String, String>(this.options);
opts.put(CompilerOptions.OPTION_Source, this.options.get(CompilerOptions.OPTION_Compliance));
- Parser parser = new Parser(new ProblemReporter(getHandlingPolicy(),
+ Parser parser = new Parser(new ProblemReporter(getHandlingPolicy(),
new CompilerOptions(opts), getProblemFactory()), false);
if (fileName.toLowerCase().endsWith(IModule.MODULE_INFO_JAVA)) {
-
+
ICompilationUnit cu = new CompilationUnit(null, fileName, null);
CompilationResult compilationResult = new CompilationResult(cu, 0, 1, 10);
CompilationUnitDeclaration unit = parser.parse(cu, compilationResult);
@@ -3530,7 +3530,7 @@ public String extractDestinationPathFromSourceFile(CompilationResult result) {
:giro */
String outputPathName = new String(fileName, 0, lastIndex);
outputPathName= result.stripTeamPackagesFromPath(outputPathName);
-// SH}
+// SH}
final File output = new File(outputPathName);
if (output.exists() && output.isDirectory()) {
return outputPathName;
@@ -3556,7 +3556,7 @@ public CompilationUnit[] getCompilationUnits() {
String defaultEncoding = this.options.get(CompilerOptions.OPTION_Encoding);
if (Util.EMPTY_STRING.equals(defaultEncoding))
defaultEncoding = null;
-
+
for (int round = 0; round < 2; round++) {
for (int i = 0; i < fileCount; i++) {
char[] charName = this.filenames[i].toCharArray();
@@ -3579,7 +3579,7 @@ public CompilationUnit[] getCompilationUnits() {
fileName = this.filenames[i];
}
units[i] = new CompilationUnit(null, fileName, encoding, this.destinationPaths[i],
- shouldIgnoreOptionalProblems(this.ignoreOptionalProblemsFromFolders, fileName.toCharArray()),
+ shouldIgnoreOptionalProblems(this.ignoreOptionalProblemsFromFolders, fileName.toCharArray()),
this.modNames[i]);
}
}
@@ -3634,7 +3634,7 @@ public File getJavaHome() {
}
public FileSystem getLibraryAccess() {
- FileSystem nameEnvironment = new FileSystem(this.checkedClasspaths, this.filenames,
+ FileSystem nameEnvironment = new FileSystem(this.checkedClasspaths, this.filenames,
this.annotationsFromClasspath && CompilerOptions.ENABLED.equals(this.options.get(CompilerOptions.OPTION_AnnotationBasedNullAnalysis)),
this.limitedModules);
nameEnvironment.module = this.module;
@@ -3954,7 +3954,7 @@ protected ArrayList<FileSystem.Classpath> handleExtdirs(ArrayList<String> extdir
}
}
}
- return result;
+ return result;
}
return FileSystem.EMPTY_CLASSPATH;
@@ -4158,7 +4158,7 @@ private void handleErrorOrWarningToken(String token, boolean isEnabling, int sev
default: // no severity update
}
}
- this.options.put(CompilerOptions.OPTION_ReportMissingEnumCaseDespiteDefault,
+ this.options.put(CompilerOptions.OPTION_ReportMissingEnumCaseDespiteDefault,
isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED);
return;
} else if (token.equals("emptyBlock")) {//$NON-NLS-1$
@@ -4493,10 +4493,10 @@ private void handleErrorOrWarningToken(String token, boolean isEnabling, int sev
setSeverity(CompilerOptions.OPTION_ReportNonnullParameterAnnotationDropped, severity, isEnabling);
return;
}
-
+
break;
case 'o' :
- if (token.equals("over-sync") /*|| token.equals("syncOverride")*/) { //$NON-NLS-1$
+ if (token.equals("over-sync") /*|| token.equals("syncOverride")*/) { //$NON-NLS-1$
setSeverity(CompilerOptions.OPTION_ReportMissingSynchronizedOnInheritedMethod, severity, isEnabling);
return;
} else if (token.equals("over-ann")) { //$NON-NLS-1$
@@ -4564,7 +4564,7 @@ private void handleErrorOrWarningToken(String token, boolean isEnabling, int sev
} else if (token.equals("staticReceiver")) { //$NON-NLS-1$
setSeverity(CompilerOptions.OPTION_ReportNonStaticAccessToStatic, severity, isEnabling);
return;
- } else if (/*token.equals("over-sync") ||*/ token.equals("syncOverride")) { //$NON-NLS-1$
+ } else if (/*token.equals("over-sync") ||*/ token.equals("syncOverride")) { //$NON-NLS-1$
setSeverity(CompilerOptions.OPTION_ReportMissingSynchronizedOnInheritedMethod, severity, isEnabling);
return;
} else if (token.equals("semicolon")) {//$NON-NLS-1$
@@ -4627,7 +4627,7 @@ private void handleErrorOrWarningToken(String token, boolean isEnabling, int sev
this.options.put(
CompilerOptions.OPTION_TaskTags,
isEnabling ? taskTags : Util.EMPTY_STRING);
-
+
setSeverity(CompilerOptions.OPTION_ReportTasks, severity, isEnabling);
return;
} else if (token.equals("typeHiding")) { //$NON-NLS-1$
diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ModuleFinder.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ModuleFinder.java
index fd89bd892..bfb46da22 100644
--- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ModuleFinder.java
+++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ModuleFinder.java
@@ -53,14 +53,14 @@ public class ModuleFinder {
}
return modulePath;
}
- protected static void scanForModules(String destinationPath, Parser parser, Map<String, String> options, boolean isModulepath,
+ protected static void scanForModules(String destinationPath, Parser parser, Map<String, String> options, boolean isModulepath,
boolean thisAnAutomodule, List<FileSystem.Classpath> collector, final File file, String release) {
FileSystem.Classpath entry = FileSystem.getClasspath(
file.getAbsolutePath(),
null,
!isModulepath,
null,
- destinationPath == null ? null : (destinationPath + File.separator + file.getName()),
+ destinationPath == null ? null : (destinationPath + File.separator + file.getName()),
options,
release);
if (entry != null) {
@@ -140,10 +140,10 @@ public class ModuleFinder {
* Extracts the single reads clause from the given
* command line option (--add-reads). The result is a String[] with two
* element, first being the source module and second being the target module.
- * The expected format is:
+ * The expected format is:
* --add-reads <source-module>=<target-module>
* @param option
- * @return a String[] with source and target module of the "reads" clause.
+ * @return a String[] with source and target module of the "reads" clause.
*/
protected static String[] extractAddonRead(String option) {
StringTokenizer tokenizer = new StringTokenizer(option, "="); //$NON-NLS-1$
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java
index 7bc7af39b..e212ea304 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java
@@ -282,7 +282,7 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.util.TypeAnalyzer;
public final class CompletionEngine
extends Engine
implements ISearchRequestor, TypeConstants , TerminalTokens , RelevanceConstants, SuffixConstants {
-
+
private static class AcceptedConstructor {
public int modifiers;
public char[] simpleTypeName;
@@ -297,9 +297,9 @@ public final class CompletionEngine
public boolean proposeType = false;
public boolean proposeConstructor = false;
public char[] fullyQualifiedName = null;
-
+
public boolean mustBeQualified = false;
-
+
public AcceptedConstructor(
int modifiers,
char[] simpleTypeName,
@@ -334,7 +334,7 @@ public final class CompletionEngine
return buffer.toString();
}
}
-
+
private static class AcceptedType {
public char[] packageName;
public char[] simpleTypeName;
@@ -371,7 +371,7 @@ public final class CompletionEngine
return buffer.toString();
}
}
-
+
public class CompletionProblemFactory extends DefaultProblemFactory {
private int lastErrorStart;
@@ -487,7 +487,7 @@ public final class CompletionEngine
this.checkProblems = false;
}
}
-
+
//{ObjectTeams: prefixes for callout-to-field:
private static final char[] SET = "set".toCharArray(); //$NON-NLS-1$
@@ -602,7 +602,7 @@ public final class CompletionEngine
result = CharOperation.replaceOnCopy(result, '/', '.');
return result;
}
-
+
private static char[] getTypeName(TypeReference typeReference) {
char[] typeName = CharOperation.concatWith(typeReference.getTypeName(), '.');
int dims = typeReference.dimensions();
@@ -615,10 +615,10 @@ public final class CompletionEngine
typeName[k+1] = ']';
}
}
-
+
return typeName;
}
-
+
private static boolean hasStaticMemberTypes(ReferenceBinding typeBinding, SourceTypeBinding invocationType, CompilationUnitScope unitScope) {
ReferenceBinding[] memberTypes = typeBinding.memberTypes();
int length = memberTypes == null ? 0 : memberTypes.length;
@@ -629,18 +629,18 @@ public final class CompletionEngine
} else if(invocationType == null && !memberType.canBeSeenBy(unitScope.fPackage)) {
continue next;
}
-
+
if ((memberType.modifiers & ClassFileConstants.AccStatic) != 0) {
return true;
}
}
return false;
}
-
+
private static boolean hasMemberTypesInEnclosingScope(SourceTypeBinding typeBinding, Scope scope) {
ReferenceBinding[] memberTypes = typeBinding.memberTypes();
int length = memberTypes == null ? 0 : memberTypes.length;
-
+
if (length > 0) {
MethodScope methodScope = scope.methodScope();
if (methodScope != null && !methodScope.isStatic) {
@@ -656,16 +656,16 @@ public final class CompletionEngine
}
return false;
}
-
+
public HashtableOfObject typeCache;
public int openedBinaryTypes; // used during InternalCompletionProposal#findConstructorParameterNames()
-
+
public static boolean DEBUG = false;
public static boolean PERF = false;
-
+
private static final char[] KNOWN_TYPE_WITH_UNKNOWN_CONSTRUCTORS = new char[]{};
private static final char[] KNOWN_TYPE_WITH_KNOWN_CONSTRUCTORS = new char[]{};
-
+
private static final char[] ARG = "arg".toCharArray(); //$NON-NLS-1$
private static final char[] ARG0 = "arg0".toCharArray(); //$NON-NLS-1$
private static final char[] ARG1 = "arg1".toCharArray(); //$NON-NLS-1$
@@ -675,12 +675,12 @@ public final class CompletionEngine
private static final char[][] ARGS2 = new char[][]{ARG0, ARG1};
private static final char[][] ARGS3 = new char[][]{ARG0, ARG1, ARG2};
private static final char[][] ARGS4 = new char[][]{ARG0, ARG1, ARG2, ARG3};
-
+
private final static int CHECK_CANCEL_FREQUENCY = 50;
-
+
// temporary constants to quickly disabled polish features if necessary
public final static boolean NO_TYPE_COMPLETION_ON_EMPTY_TOKEN = false;
-
+
private final static char[] ERROR_PATTERN = "*error*".toCharArray(); //$NON-NLS-1$
private final static char[] EXCEPTION_PATTERN = "*exception*".toCharArray(); //$NON-NLS-1$
private final static char[] SEMICOLON = new char[] { ';' };
@@ -696,11 +696,11 @@ public final class CompletionEngine
private final static char[] BASE = "base".toCharArray(); //$NON-NLS-1$
// SH}
private final static char[] DEFAULT_CONSTRUCTOR_SIGNATURE = "()V".toCharArray(); //$NON-NLS-1$
-
+
private final static char[] DOT = ".".toCharArray(); //$NON-NLS-1$
private final static char[] VARARGS = "...".toCharArray(); //$NON-NLS-1$
-
+
private final static char[] IMPORT = "import".toCharArray(); //$NON-NLS-1$
private final static char[] STATIC = "static".toCharArray(); //$NON-NLS-1$
private final static char[] ON_DEMAND = ".*".toCharArray(); //$NON-NLS-1$
@@ -710,11 +710,11 @@ public final class CompletionEngine
createTypeSignature(CharOperation.concatWith(JAVA_LANG, '.'), OBJECT);
private final static char[] JAVA_LANG_NAME =
CharOperation.concatWith(JAVA_LANG, '.');
-
+
private final static int NONE = 0;
private final static int SUPERTYPE = 1;
private final static int SUBTYPE = 2;
-
+
int expectedTypesPtr = -1;
TypeBinding[] expectedTypes = new TypeBinding[1];
int expectedTypesFilter;
@@ -726,9 +726,9 @@ public final class CompletionEngine
int forbbidenBindingsPtr = -1;
Binding[] forbbidenBindings = new Binding[1];
int uninterestingBindingsFilter; // only set when completing on an exception type
-
+
ImportBinding[] favoriteReferenceBindings;
-
+
boolean assistNodeIsClass;
boolean assistNodeIsEnum;
boolean assistNodeIsException;
@@ -742,9 +742,9 @@ public final class CompletionEngine
boolean assistNodeCanBeSingleMemberAnnotation = false;
boolean assistNodeIsInsideCase = false; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=195346
boolean assistNodeIsString = false; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=343476
-
+
long targetedElement;
-
+
//{ObjectTeams:
private AbstractMethodMappingDeclaration currentMethodMapping;
private char seperator= 0; // char that should be inserted before the completion
@@ -782,7 +782,7 @@ public final class CompletionEngine
HashtableOfObject knownModules = new HashtableOfObject(10);
HashtableOfObject knownPkgs = new HashtableOfObject(10);
HashtableOfObject knownTypes = new HashtableOfObject(10);
-
+
/*
static final char[][] mainDeclarations =
new char[][] {
@@ -831,7 +831,7 @@ public final class CompletionEngine
BASE_TYPE_NAMES_WITHOUT_VOID[i] = BASE_TYPES[i].simpleName;
}
}
-
+
static final char[] classField = "class".toCharArray(); //$NON-NLS-1$
static final char[] lengthField = "length".toCharArray(); //$NON-NLS-1$
static final char[] cloneMethod = "clone".toCharArray(); //$NON-NLS-1$
@@ -873,7 +873,7 @@ public final class CompletionEngine
private int foundTypesCount;
private ObjectVector acceptedTypes;
-
+
private int foundConstructorsCount;
private ObjectVector acceptedConstructors;
@@ -922,7 +922,7 @@ public final class CompletionEngine
this.owner = owner;
this.monitor = monitor;
}
-
+
@Override
public void accept(ICompilationUnit sourceUnit, AccessRestriction accessRestriction) {
if (!CharOperation.equals(sourceUnit.getMainTypeName(), TypeConstants.PACKAGE_INFO_NAME)) {
@@ -934,7 +934,7 @@ public final class CompletionEngine
super.accept(sourceUnit, accessRestriction);
}
}
-
+
@Override
public void acceptConstructor(
int modifiers,
@@ -948,13 +948,13 @@ public final class CompletionEngine
int extraFlags,
String path,
AccessRestriction accessRestriction) {
-
+
// does not check cancellation for every types to avoid performance loss
if ((this.foundConstructorsCount % (CHECK_CANCEL_FREQUENCY)) == 0) checkCancel();
this.foundConstructorsCount++;
-
+
if ((typeModifiers & ClassFileConstants.AccEnum) != 0) return;
-
+
if (this.options.checkDeprecation && (typeModifiers & ClassFileConstants.AccDeprecated) != 0) return;
if (this.options.checkVisibility) {
@@ -964,7 +964,7 @@ public final class CompletionEngine
if (this.currentPackageName == null) {
initializePackageCache();
}
-
+
if(!CharOperation.equals(packageName, this.currentPackageName)) return;
}
}
@@ -986,7 +986,7 @@ public final class CompletionEngine
break;
}
}
-
+
if(this.acceptedConstructors == null) {
this.acceptedConstructors = new ObjectVector();
}
@@ -1003,31 +1003,31 @@ public final class CompletionEngine
extraFlags,
accessibility));
}
-
+
private void acceptConstructors(Scope scope) {
final boolean DEFER_QUALIFIED_PROPOSALS = false;
-
+
this.checkCancel();
-
+
if(this.acceptedConstructors == null) return;
int length = this.acceptedConstructors.size();
if(length == 0) return;
-
+
HashtableOfObject onDemandFound = new HashtableOfObject();
-
+
ArrayList deferredProposals = null;
if (DEFER_QUALIFIED_PROPOSALS) {
deferredProposals = new ArrayList();
}
-
+
try {
next : for (int i = 0; i < length; i++) {
-
+
// does not check cancellation for every types to avoid performance loss
if ((i % CHECK_CANCEL_FREQUENCY) == 0) checkCancel();
-
+
AcceptedConstructor acceptedConstructor = (AcceptedConstructor)this.acceptedConstructors.elementAt(i);
final int typeModifiers = acceptedConstructor.typeModifiers;
final char[] packageName = acceptedConstructor.packageName;
@@ -1039,11 +1039,11 @@ public final class CompletionEngine
final char[][] parameterNames = acceptedConstructor.parameterNames;
final int extraFlags = acceptedConstructor.extraFlags;
final int accessibility = acceptedConstructor.accessibility;
-
+
boolean proposeType = hasArrayTypeAsExpectedSuperTypes() || (extraFlags & ExtraFlags.HasNonPrivateStaticMemberTypes) != 0;
-
+
char[] fullyQualifiedName = CharOperation.concat(packageName, simpleTypeName, '.');
-
+
Object knownTypeKind = this.knownTypes.get(fullyQualifiedName);
if (knownTypeKind != null) {
if (knownTypeKind == KNOWN_TYPE_WITH_KNOWN_CONSTRUCTORS) {
@@ -1055,9 +1055,9 @@ public final class CompletionEngine
} else {
this.knownTypes.put(fullyQualifiedName, KNOWN_TYPE_WITH_UNKNOWN_CONSTRUCTORS);
}
-
+
boolean proposeConstructor = true;
-
+
if (this.options.checkVisibility) {
if((modifiers & ClassFileConstants.AccPublic) == 0) {
if((modifiers & ClassFileConstants.AccPrivate) != 0) {
@@ -1067,9 +1067,9 @@ public final class CompletionEngine
if (this.currentPackageName == null) {
initializePackageCache();
}
-
+
if(!CharOperation.equals(packageName, this.currentPackageName)) {
-
+
if((typeModifiers & ClassFileConstants.AccAbstract) == 0 ||
(modifiers & ClassFileConstants.AccProtected) == 0) {
if (!proposeType) continue next;
@@ -1079,16 +1079,16 @@ public final class CompletionEngine
}
}
}
-
+
acceptedConstructor.fullyQualifiedName = fullyQualifiedName;
acceptedConstructor.proposeType = proposeType;
acceptedConstructor.proposeConstructor = proposeConstructor;
-
-
+
+
if(!this.importCachesInitialized) {
initializeImportCaches();
}
-
+
for (int j = 0; j < this.importCacheCount; j++) {
char[][] importName = this.importsCache[j];
if(CharOperation.equals(simpleTypeName, importName[0])) {
@@ -1103,7 +1103,7 @@ public final class CompletionEngine
!CharOperation.equals(fullyQualifiedName, importName[1]),
scope);
}
-
+
if (proposeConstructor && !Flags.isEnum(typeModifiers)) {
boolean isQualified = !CharOperation.equals(fullyQualifiedName, importName[1]);
if (!isQualified) {
@@ -1148,7 +1148,7 @@ public final class CompletionEngine
false,
scope);
}
-
+
if (proposeConstructor && !Flags.isEnum(typeModifiers)) {
proposeConstructor(
simpleTypeName,
@@ -1231,7 +1231,7 @@ public final class CompletionEngine
true,
scope);
}
-
+
if (proposeConstructor && !Flags.isEnum(typeModifiers)) {
acceptedConstructor.mustBeQualified = true;
if (DEFER_QUALIFIED_PROPOSALS) {
@@ -1242,15 +1242,15 @@ public final class CompletionEngine
}
}
}
-
+
char[][] keys = onDemandFound.keyTable;
Object[] values = onDemandFound.valueTable;
int max = keys.length;
for (int i = 0; i < max; i++) {
-
+
// does not check cancellation for every types to avoid performance loss
if ((i % CHECK_CANCEL_FREQUENCY) == 0) checkCancel();
-
+
if(keys[i] != null) {
AcceptedConstructor value = (AcceptedConstructor) values[i];
if(value != null) {
@@ -1287,7 +1287,7 @@ public final class CompletionEngine
value.mustBeQualified,
scope);
}
-
+
if (value.proposeConstructor && !Flags.isEnum(value.modifiers)) {
if (!value.mustBeQualified) {
proposeConstructor(
@@ -1316,16 +1316,16 @@ public final class CompletionEngine
}
}
}
-
+
if (DEFER_QUALIFIED_PROPOSALS) {
int size = deferredProposals.size();
for (int i = 0; i < size; i++) {
-
+
// does not check cancellation for every types to avoid performance loss
if ((i % CHECK_CANCEL_FREQUENCY) == 0) checkCancel();
-
+
AcceptedConstructor deferredProposal = (AcceptedConstructor)deferredProposals.get(i);
-
+
if (deferredProposal.proposeConstructor) {
proposeConstructor(
deferredProposal.simpleTypeName,
@@ -1349,7 +1349,7 @@ public final class CompletionEngine
this.acceptedTypes = null; // reset
}
}
-
+
/**
* One result of the search consists of a new module.
*
@@ -1384,7 +1384,7 @@ public final class CompletionEngine
this.printDebug(proposal);
}
}
-
+
}
@Override
@@ -1393,7 +1393,7 @@ public final class CompletionEngine
if (this.knownPkgs.containsKey(packageName)) return;
if (!isValidPackageName(packageName)) return;
-
+
if (this.skipDefaultPackage &&
CharOperation.equals(packageName, CharOperation.NO_CHAR))
return;
@@ -1443,11 +1443,11 @@ public final class CompletionEngine
char[][] enclosingTypeNames,
int modifiers,
AccessRestriction accessRestriction) {
-
+
// does not check cancellation for every types to avoid performance loss
if ((this.foundTypesCount % CHECK_CANCEL_FREQUENCY) == 0) checkCancel();
this.foundTypesCount++;
-
+
if (this.options.checkDeprecation && (modifiers & ClassFileConstants.AccDeprecated) != 0) return;
if (this.assistNodeIsExtendedType && (modifiers & ClassFileConstants.AccFinal) != 0) return;
if (this.assistNodeIsExtendedType && (modifiers & ExtraCompilerModifiers.AccRecord) != 0) return;
@@ -1479,7 +1479,7 @@ public final class CompletionEngine
break;
}
}
-
+
if (isForbidden(packageName, simpleTypeName, enclosingTypeNames)) {
return;
}
@@ -1492,7 +1492,7 @@ public final class CompletionEngine
private void acceptTypes(Scope scope) {
this.checkCancel();
-
+
if(this.acceptedTypes == null) return;
int length = this.acceptedTypes.size();
@@ -1500,20 +1500,20 @@ public final class CompletionEngine
if(length == 0) return;
HashtableOfObject onDemandFound = new HashtableOfObject();
-
+
try {
next : for (int i = 0; i < length; i++) {
-
+
// does not check cancellation for every types to avoid performance loss
if ((i % CHECK_CANCEL_FREQUENCY) == 0) checkCancel();
-
+
AcceptedType acceptedType = (AcceptedType)this.acceptedTypes.elementAt(i);
char[] packageName = acceptedType.packageName;
char[] simpleTypeName = acceptedType.simpleTypeName;
char[][] enclosingTypeNames = acceptedType.enclosingTypeNames;
int modifiers = acceptedType.modifiers;
int accessibility = acceptedType.accessibility;
-
+
char[] typeName;
char[] flatEnclosingTypeNames;
if(enclosingTypeNames == null || enclosingTypeNames.length == 0) {
@@ -1524,18 +1524,18 @@ public final class CompletionEngine
typeName = CharOperation.concat(flatEnclosingTypeNames, simpleTypeName, '.');
}
char[] fullyQualifiedName = CharOperation.concat(packageName, typeName, '.');
-
+
if (this.knownTypes.containsKey(fullyQualifiedName)) continue next;
-
+
this.knownTypes.put(fullyQualifiedName, KNOWN_TYPE_WITH_UNKNOWN_CONSTRUCTORS);
-
+
if (this.resolvingImports) {
if(this.compilerOptions.complianceLevel >= ClassFileConstants.JDK1_4 && packageName.length == 0) {
continue next; // import of default package is forbidden when compliance is 1.4 or higher
}
-
+
char[] completionName = this.insideQualifiedReference ? simpleTypeName : fullyQualifiedName;
-
+
if(this.resolvingStaticImports) {
if(enclosingTypeNames == null || enclosingTypeNames.length == 0) {
completionName = CharOperation.concat(completionName, new char[] { '.' });
@@ -1547,13 +1547,13 @@ public final class CompletionEngine
} else {
completionName = appendUnlessNextToken(completionName, new char[] {';'}, TerminalTokens.TokenNameSEMICOLON);
}
-
+
int relevance = computeBaseRelevance();
relevance += computeRelevanceForResolution();
relevance += computeRelevanceForInterestingProposal(packageName, fullyQualifiedName);
relevance += computeRelevanceForRestrictions(accessibility);
relevance += computeRelevanceForCaseMatching(this.completionToken, simpleTypeName);
-
+
this.noProposal = false;
if(!this.requestor.isIgnored(CompletionProposal.TYPE_REF)) {
createTypeProposal(packageName, typeName, modifiers, accessibility, completionName, relevance);
@@ -1562,7 +1562,7 @@ public final class CompletionEngine
if(!this.importCachesInitialized) {
initializeImportCaches();
}
-
+
for (int j = 0; j < this.importCacheCount; j++) {
char[][] importName = this.importsCache[j];
if(CharOperation.equals(typeName, importName[0])) {
@@ -1578,8 +1578,8 @@ public final class CompletionEngine
continue next;
}
}
-
-
+
+
if ((enclosingTypeNames == null || enclosingTypeNames.length == 0 ) && CharOperation.equals(this.currentPackageName, packageName)) {
proposeType(
packageName,
@@ -1593,15 +1593,15 @@ public final class CompletionEngine
continue next;
} else {
char[] fullyQualifiedEnclosingTypeOrPackageName = null;
-
+
AcceptedType foundType = null;
if((foundType = (AcceptedType)onDemandFound.get(simpleTypeName)) == null) {
for (int j = 0; j < this.onDemandImportCacheCount; j++) {
ImportBinding importBinding = this.onDemandImportsCache[j];
-
+
char[][] importName = importBinding.compoundName;
char[] importFlatName = CharOperation.concatWith(importName, '.');
-
+
if(fullyQualifiedEnclosingTypeOrPackageName == null) {
if(enclosingTypeNames != null && enclosingTypeNames.length != 0) {
fullyQualifiedEnclosingTypeOrPackageName =
@@ -1637,10 +1637,10 @@ public final class CompletionEngine
} else if(!foundType.mustBeQualified){
done : for (int j = 0; j < this.onDemandImportCacheCount; j++) {
ImportBinding importBinding = this.onDemandImportsCache[j];
-
+
char[][] importName = importBinding.compoundName;
char[] importFlatName = CharOperation.concatWith(importName, '.');
-
+
if(fullyQualifiedEnclosingTypeOrPackageName == null) {
if(enclosingTypeNames != null && enclosingTypeNames.length != 0) {
fullyQualifiedEnclosingTypeOrPackageName =
@@ -1678,7 +1678,7 @@ public final class CompletionEngine
}
}
}
-
+
char[][] keys = onDemandFound.keyTable;
Object[] values = onDemandFound.valueTable;
int max = keys.length;
@@ -1703,7 +1703,7 @@ public final class CompletionEngine
this.acceptedTypes = null; // reset
}
}
-
+
private char[] appendUnlessNextToken(char[] completionName, char[] suffix, int nextToken) {
if (this.source == null)
return CharOperation.concat(completionName, suffix);
@@ -2132,7 +2132,7 @@ public final class CompletionEngine
this.source = sourceUnit.getContents();
this.checkCancel();
-
+
// for now until we can change the UI.
CompilationResult result = new CompilationResult(sourceUnit, 1, 1, this.compilerOptions.maxProblemsPerUnit);
CompilationUnitDeclaration parsedUnit = this.parser.dietParse(sourceUnit, result, this.actualCompletionPosition);
@@ -2154,7 +2154,7 @@ public final class CompletionEngine
if(!this.requestor.isIgnored(CompletionProposal.MODULE_DECLARATION)) {
proposeModuleName(parsedUnit);
}
- debugPrintf();
+ debugPrintf();
return;
}
if (this.moduleDeclaration instanceof CompletionOnKeywordModuleDeclaration) {
@@ -2702,7 +2702,7 @@ public final class CompletionEngine
this.requestor.endReporting();
}
}
-
+
private void completionOnBranchStatementLabel(ASTNode astNode) {
if (!this.requestor.isIgnored(CompletionProposal.LABEL_REF)) {
CompletionOnBranchStatementLabel label = (CompletionOnBranchStatementLabel) astNode;
@@ -2710,7 +2710,7 @@ public final class CompletionEngine
findLabels(this.completionToken, label.possibleLabels);
}
}
-
+
private void completionOnClassLiteralAccess(ASTNode astNode, Binding qualifiedBinding, Scope scope) {
if (!this.requestor.isIgnored(CompletionProposal.FIELD_REF)) {
CompletionOnClassLiteralAccess access = (CompletionOnClassLiteralAccess) astNode;
@@ -2726,7 +2726,7 @@ public final class CompletionEngine
false);
}
}
-
+
private void completionOnExplicitConstructorCall(ASTNode astNode, Binding qualifiedBinding, Scope scope) {
if (!this.requestor.isIgnored(CompletionProposal.METHOD_REF)) {
setSourceAndTokenRange(astNode.sourceStart, astNode.sourceEnd, false);
@@ -2744,7 +2744,7 @@ public final class CompletionEngine
false);
}
}
-
+
private void completionOnFieldName(ASTNode astNode, Scope scope) {
if (!this.requestor.isIgnored(CompletionProposal.VARIABLE_DECLARATION)) {
CompletionOnFieldName field = (CompletionOnFieldName) astNode;
@@ -2757,18 +2757,18 @@ public final class CompletionEngine
this.completionToken = field.realName;
-
+
int kind =
- (field.modifiers & ClassFileConstants.AccStatic) == 0 ?
+ (field.modifiers & ClassFileConstants.AccStatic) == 0 ?
InternalNamingConventions.VK_INSTANCE_FIELD :
- (field.modifiers & ClassFileConstants.AccFinal) == 0 ?
+ (field.modifiers & ClassFileConstants.AccFinal) == 0 ?
InternalNamingConventions.VK_STATIC_FIELD :
InternalNamingConventions.VK_STATIC_FINAL_FIELD;
-
+
findVariableNames(field.realName, field.type, excludeNames, null, kind);
}
}
-
+
private void completionOnFieldType(ASTNode astNode, Scope scope) {
CompletionOnFieldType field = (CompletionOnFieldType) astNode;
CompletionOnSingleTypeReference type = (CompletionOnSingleTypeReference) field.type;
@@ -2808,7 +2808,7 @@ public final class CompletionEngine
//TODO
private void completionOnJavadocAllocationExpression(ASTNode astNode, Binding qualifiedBinding, Scope scope) {
// setSourceRange(astNode.sourceStart, astNode.sourceEnd, false);
-
+
CompletionOnJavadocAllocationExpression allocExpression = (CompletionOnJavadocAllocationExpression) astNode;
this.javadocTagPosition = allocExpression.tagSourceStart;
int rangeStart = astNode.sourceStart;
@@ -3022,14 +3022,14 @@ public final class CompletionEngine
findJavadocParamNames(paramRef.token, paramRef.missingParams, true);
}
}
-
+
private void completionOnKeyword(ASTNode astNode) {
if (!this.requestor.isIgnored(CompletionProposal.KEYWORD)) {
CompletionOnKeyword keyword = (CompletionOnKeyword)astNode;
findKeywords(keyword.getToken(), keyword.getPossibleKeywords(), false, false);
}
}
-
+
private void completionOnLocalOrArgumentName(ASTNode astNode, Scope scope) {
if (!this.requestor.isIgnored(CompletionProposal.VARIABLE_DECLARATION)) {
LocalDeclaration variable = (LocalDeclaration) astNode;
@@ -3062,7 +3062,7 @@ public final class CompletionEngine
findVariableNames(this.completionToken, variable.type, discouragedNames, forbiddenNames, kind);
}
}
-
+
private void completionOnMarkerAnnotationName(ASTNode astNode, Binding qualifiedBinding, Scope scope) {
CompletionOnMarkerAnnotationName annot = (CompletionOnMarkerAnnotationName) astNode;
@@ -3149,7 +3149,7 @@ public final class CompletionEngine
}
}
}
-
+
private void completionOnMemberAccess(ASTNode astNode, ASTNode enclosingNode, Binding qualifiedBinding,
Scope scope, boolean insideTypeAnnotation) {
this.insideQualifiedReference = true;
@@ -3208,9 +3208,9 @@ public final class CompletionEngine
-1);
if (!superCall) {
-
+
checkCancel();
-
+
findFieldsAndMethodsFromCastedReceiver(
enclosingNode,
qualifiedBinding,
@@ -3224,7 +3224,7 @@ public final class CompletionEngine
}
}
}
-
+
private void completionOnMemberValueName(ASTNode astNode, ASTNode astNodeParent, Scope scope,
boolean insideTypeAnnotation) {
CompletionOnMemberValueName memberValuePair = (CompletionOnMemberValueName) astNode;
@@ -3274,7 +3274,7 @@ public final class CompletionEngine
}
}
}
-
+
private void completionOnMessageSend(ASTNode astNode, Binding qualifiedBinding, Scope scope) {
setSourceAndTokenRange(astNode.sourceStart, astNode.sourceEnd, false);
@@ -3286,9 +3286,9 @@ public final class CompletionEngine
ObjectVector methodsFound = new ObjectVector();
findImplicitMessageSends(this.completionToken, argTypes, scope, messageSend, scope, methodsFound);
-
+
checkCancel();
-
+
findLocalMethodsFromStaticImports(
this.completionToken,
scope,
@@ -3322,7 +3322,7 @@ public final class CompletionEngine
-1);
}
}
-
+
private void completionOnMessageSendName(ASTNode astNode, Binding qualifiedBinding, Scope scope) {
if (!this.requestor.isIgnored(CompletionProposal.METHOD_REF)) {
CompletionOnMessageSendName messageSend = (CompletionOnMessageSendName) astNode;
@@ -3374,7 +3374,7 @@ public final class CompletionEngine
this.insideQualifiedReference = true;
this.completionToken = referenceExpression.selector;
boolean onlyStatic = false;
-
+
TypeBinding receiverType = (TypeBinding) qualifiedBinding;
if (receiverType != null && receiverType instanceof ReferenceBinding) {
setSourceAndTokenRange(referenceExpression.nameSourceStart, referenceExpression.sourceEnd);
@@ -3407,7 +3407,7 @@ public final class CompletionEngine
}
}
-
+
private void completionOnMethodName(ASTNode astNode, Scope scope) {
if (!this.requestor.isIgnored(CompletionProposal.VARIABLE_DECLARATION)) {
CompletionOnMethodName method = (CompletionOnMethodName) astNode;
@@ -3422,18 +3422,18 @@ public final class CompletionEngine
this.completionToken = method.selector;
-
+
int kind =
- (method.modifiers & ClassFileConstants.AccStatic) == 0 ?
+ (method.modifiers & ClassFileConstants.AccStatic) == 0 ?
InternalNamingConventions.VK_INSTANCE_FIELD :
- (method.modifiers & ClassFileConstants.AccFinal) == 0 ?
+ (method.modifiers & ClassFileConstants.AccFinal) == 0 ?
InternalNamingConventions.VK_STATIC_FIELD :
InternalNamingConventions.VK_STATIC_FINAL_FIELD;
-
+
findVariableNames(this.completionToken, method.returnType, excludeNames, null, kind);
}
}
-
+
private void completionOnMethodReturnType(ASTNode astNode, Scope scope) {
CompletionOnMethodReturnType method = (CompletionOnMethodReturnType) astNode;
SingleTypeReference type = (CompletionOnSingleTypeReference) method.returnType;
@@ -3464,7 +3464,7 @@ public final class CompletionEngine
}
}
}
-
+
private void completionOnParameterizedQualifiedTypeReference(ASTNode astNode, ASTNode astNodeParent, Binding qualifiedBinding, Scope scope) {
if (!this.requestor.isIgnored(CompletionProposal.TYPE_REF)) {
CompletionOnParameterizedQualifiedTypeReference ref = (CompletionOnParameterizedQualifiedTypeReference) astNode;
@@ -3503,9 +3503,9 @@ public final class CompletionEngine
(BlockScope)scope,
typesFound);
}
-
+
checkCancel();
-
+
findMemberTypes(
this.completionToken,
(ReferenceBinding) qualifiedBinding,
@@ -3528,7 +3528,7 @@ public final class CompletionEngine
return false;
if (astNodeParent instanceof TypeDeclaration) {
TypeDeclaration typeDeclaration = (TypeDeclaration) astNodeParent;
- return (typeDeclaration.superclass == astNode);
+ return (typeDeclaration.superclass == astNode);
} else if (astNodeParent instanceof TypeParameter) {
TypeParameter typeParameter = (TypeParameter) astNodeParent;
return (typeParameter.type == astNode);
@@ -3538,7 +3538,7 @@ public final class CompletionEngine
}
return false;
}
-
+
private boolean assistNodeIsInterfaceExcludingAnnotation(ASTNode astNode, ASTNode astNodeParent) {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=310423, don't propose annotations for implements.
if (astNodeParent == null)
@@ -3554,9 +3554,9 @@ public final class CompletionEngine
}
return false;
}
-
+
private boolean assistNodeIsInsideCase(ASTNode astNode, ASTNode astNodeParent) {
- // To find whether we're completing inside the case expression in a
+ // To find whether we're completing inside the case expression in a
// switch case construct (https://bugs.eclipse.org/bugs/show_bug.cgi?id=195346)
if (astNodeParent instanceof SwitchStatement) {
CaseStatement[] cases = ((SwitchStatement) astNodeParent).cases;
@@ -3578,7 +3578,7 @@ public final class CompletionEngine
TypeBinding[] argTypes = computeTypes(allocExpression.arguments);
ReferenceBinding ref = (ReferenceBinding) qualifiedBinding;
-
+
if (ref.problemId() == ProblemReasons.NotFound) {
findConstructorsFromMissingType(
allocExpression.type,
@@ -3600,9 +3600,9 @@ public final class CompletionEngine
null,
false);
}
-
+
checkCancel();
-
+
if (!this.requestor.isIgnored(CompletionProposal.ANONYMOUS_CLASS_DECLARATION)
&& !ref.isFinal()
&& !ref.isEnum()){
@@ -3618,7 +3618,7 @@ public final class CompletionEngine
}
}
}
-
+
private void completionOnQualifiedNameReference(ASTNode astNode, ASTNode enclosingNode, Binding qualifiedBinding,
Scope scope, boolean insideTypeAnnotation) {
this.insideQualifiedReference = true;
@@ -3626,7 +3626,7 @@ public final class CompletionEngine
(CompletionOnQualifiedNameReference) astNode;
this.completionToken = ref.completionIdentifier;
long completionPosition = ref.sourcePositions[ref.sourcePositions.length - 1];
-
+
if (qualifiedBinding.problemId() == ProblemReasons.NotFound) {
setSourceAndTokenRange((int) (completionPosition >>> 32), (int) completionPosition);
// complete field members with missing fields type
@@ -3644,9 +3644,9 @@ public final class CompletionEngine
boolean foundSomeFields = findFieldsAndMethodsFromMissingFieldType(ref.tokens[0], scope, ref, insideTypeAnnotation);
if (!foundSomeFields) {
-
+
checkCancel();
-
+
findMembersFromMissingType(
ref.tokens[0],
ref.sourcePositions[0],
@@ -3681,7 +3681,7 @@ public final class CompletionEngine
null,
-1,
-1);
-
+
checkCancel();
findFieldsAndMethodsFromCastedReceiver(
@@ -3755,7 +3755,7 @@ public final class CompletionEngine
findTypesAndSubpackages(this.completionToken, (PackageBinding) qualifiedBinding, scope);
}
}
-
+
private void completionOnQualifiedTypeReference(ASTNode astNode, ASTNode astNodeParent, Binding qualifiedBinding,
Scope scope) {
this.insideQualifiedReference = true;
@@ -3770,7 +3770,7 @@ public final class CompletionEngine
this.assistNodeIsSuperType = ref.isSuperType();
this.assistNodeIsExtendedType = assistNodeIsExtendedType(astNode, astNodeParent);
this.assistNodeIsInterfaceExcludingAnnotation = assistNodeIsInterfaceExcludingAnnotation(astNode, astNodeParent);
-
+
this.completionToken = ref.completionIdentifier;
long completionPosition = ref.sourcePositions[ref.tokens.length];
@@ -3800,7 +3800,7 @@ public final class CompletionEngine
(BlockScope)scope,
typesFound);
}
-
+
checkCancel();
findMemberTypes(
@@ -3824,7 +3824,7 @@ public final class CompletionEngine
findTypesAndSubpackages(this.completionToken, (PackageBinding) qualifiedBinding, scope);
}
}
-
+
private void completionOnProvidesInterfacesQualifiedTypeReference(ASTNode astNode, ASTNode astNodeParent, Binding qualifiedBinding, Scope scope) {
// TODO: Filter the results wrt accessibility and add relevance to the results.
completionOnQualifiedTypeReference(astNode, astNodeParent, qualifiedBinding, scope);
@@ -3877,9 +3877,9 @@ public final class CompletionEngine
(BlockScope)scope,
alreadyDefinedName);
}
-
+
checkCancel();
-
+
findVariablesAndMethods(
this.completionToken,
scope,
@@ -3887,13 +3887,13 @@ public final class CompletionEngine
scope,
insideTypeAnnotation,
singleNameReference.isInsideAnnotationAttribute);
-
+
//{ObjectTeams: following analyses don't apply to base/tsuper calls:
if (isBaseAccess(singleNameReference) || isTSuperAccess(singleNameReference))
return;
// SH}
checkCancel();
-
+
// can be the start of a qualified type name
findTypesAndPackages(this.completionToken, scope, true, false, new ObjectVector());
if (!this.requestor.isIgnored(CompletionProposal.KEYWORD)) {
@@ -3914,7 +3914,7 @@ public final class CompletionEngine
}
}
}
-
+
private void completionOnSingleTypeReference(ASTNode astNode, ASTNode astNodeParent, Binding qualifiedBinding, Scope scope) {
CompletionOnSingleTypeReference singleRef = (CompletionOnSingleTypeReference) astNode;
@@ -3931,7 +3931,7 @@ public final class CompletionEngine
this.assistNodeIsSuperType = singleRef.isSuperType();
this.assistNodeIsExtendedType = assistNodeIsExtendedType(astNode, astNodeParent);
this.assistNodeIsInterfaceExcludingAnnotation = assistNodeIsInterfaceExcludingAnnotation(astNode, astNodeParent);
-
+
// can be the start of a qualified type name
if (qualifiedBinding == null) {
if (this.completionToken.length == 0 &&
@@ -3950,9 +3950,9 @@ public final class CompletionEngine
(BlockScope)scope,
typesFound);
}
-
+
checkCancel();
-
+
findTypesAndPackages(this.completionToken, scope, this.assistNodeIsConstructor, false, typesFound);
}
} else if (!this.requestor.isIgnored(CompletionProposal.TYPE_REF)) {
@@ -4328,13 +4328,13 @@ public final class CompletionEngine
// completing inside the diamond
if (this.parser.enclosingNode instanceof AbstractVariableDeclaration) {
AbstractVariableDeclaration abstractVariableDeclaration = (AbstractVariableDeclaration) this.parser.enclosingNode;
- expected = abstractVariableDeclaration.initialization != null ? abstractVariableDeclaration.initialization.expectedType() : null;
+ expected = abstractVariableDeclaration.initialization != null ? abstractVariableDeclaration.initialization.expectedType() : null;
} else {
ReturnStatement returnStatement = (ReturnStatement) this.parser.enclosingNode;
if (returnStatement.expression != null) {
expected = returnStatement.expression.expectedType();
}
- }
+ }
addExpectedType(expected, scope);
} else {
TypeVariableBinding[] typeVariables = ((ReferenceBinding)ref.resolvedType).typeVariables();
@@ -4342,7 +4342,7 @@ public final class CompletionEngine
if(typeVariables != null && typeVariables.length >= length) {
int index = length - 1;
while(index > -1 && ref.typeArguments[index] != node) index--;
-
+
TypeBinding bound = typeVariables[index].firstBound;
addExpectedType(bound == null ? scope.getJavaLangObject() : bound, scope);
}
@@ -4477,7 +4477,7 @@ public final class CompletionEngine
// type if we are completing inside if(), for (; ;), while() and do while()
} else if (parent instanceof WhileStatement) { // covers both while and do-while loops
addExpectedType(TypeBinding.BOOLEAN, scope);
- } else if (parent instanceof IfStatement) {
+ } else if (parent instanceof IfStatement) {
addExpectedType(TypeBinding.BOOLEAN, scope);
} else if (parent instanceof AssertStatement) {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=274466
@@ -4486,7 +4486,7 @@ public final class CompletionEngine
if (assertStatement.assertExpression == node) {
addExpectedType(TypeBinding.BOOLEAN, scope);
}
- } else if (parent instanceof ForStatement) { // astNodeParent set to ForStatement only for the condition
+ } else if (parent instanceof ForStatement) { // astNodeParent set to ForStatement only for the condition
addExpectedType(TypeBinding.BOOLEAN, scope);
// Expected types for javadoc
@@ -4771,7 +4771,7 @@ public final class CompletionEngine
}
return 0;
}
-
+
private int computeRelevanceForConstructor() {
if (this.assistNodeIsConstructor) {
return R_CONSTRUCTOR;
@@ -4837,10 +4837,10 @@ public final class CompletionEngine
if(this.expectedTypes != null && proposalType != null) {
int relevance = 0;
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=271296
- // If there is at least one expected type, then void proposal types attract a degraded relevance.
+ // If there is at least one expected type, then void proposal types attract a degraded relevance.
if (proposalType == TypeBinding.VOID && this.expectedTypesPtr >=0) {
return R_VOID;
- }
+ }
for (int i = 0; i <= this.expectedTypesPtr; i++) {
if((this.expectedTypesFilter & SUBTYPE) != 0
&& (proposalType.erasure().isCompatibleWith(this.expectedTypes[i].erasure()))) {
@@ -4906,7 +4906,7 @@ public final class CompletionEngine
}
return R_INTERESTING;
}
-
+
private int computeRelevanceForInterestingProposal(char[] givenPkgName, char[] fullTypeName) {
for (int i = 0; i <= this.uninterestingBindingsPtr; i++) {
if (this.uninterestingBindings[i] instanceof TypeBinding) {
@@ -4971,7 +4971,7 @@ public final class CompletionEngine
}
return 0;
}
-
+
private int computeRelevanceForFinal(boolean onlyFinal, boolean isFinal) {
if (onlyFinal && isFinal) {
return R_FINAL;
@@ -5077,7 +5077,7 @@ public final class CompletionEngine
}
}
}
-
+
}
}
}
@@ -5227,7 +5227,7 @@ public final class CompletionEngine
InternalCompletionProposal proposal = createProposal(CompletionProposal.OVERRIDE_ROLE_DECLARATION, this.actualCompletionPosition);
proposal.setDeclarationSignature(getSignature(superTeam));
proposal.setDeclarationKey(superTeam.computeUniqueKey());
- proposal.setSignature(roleTypeSignature);
+ proposal.setSignature(roleTypeSignature);
// proposal.setKey(superRole.getKey().toCharArray()); // FIXME(SH): unused?
proposal.setDeclarationPackageName(superTeam.qualifiedPackageName());
proposal.setDeclarationTypeName(superTeam.qualifiedSourceName());
@@ -5243,7 +5243,7 @@ public final class CompletionEngine
}
}
}
-
+
private void createRole(char[] superRoleName, int modifiers, StringBuffer completion) {
//// Modifiers
if(modifiers != ClassFileConstants.AccDefault){
@@ -5602,16 +5602,16 @@ public final class CompletionEngine
int[] missingElementsStarts,
int[] missingElementsEnds,
boolean missingElementsHaveProblems) {
-
+
int relevance = computeBaseRelevance();
relevance += computeRelevanceForResolution();
relevance += computeRelevanceForInterestingProposal(currentType);
relevance += computeRelevanceForRestrictions(IAccessRule.K_ACCESSIBLE);
-
+
if (missingElements != null) {
relevance += computeRelevanceForMissingElements(missingElementsHaveProblems);
}
-
+
//{ObjectTeams: other parts of completion prefer role interfaces, but here we need to go back to the role class:
if (currentType.isSynthInterface()) {
currentType = currentType.roleModel.getClassPartBinding();
@@ -5654,7 +5654,7 @@ public final class CompletionEngine
char[] completion = CharOperation.NO_CHAR;
char[] typeCompletion = null;
if (!exactMatch) {
- typeCompletion =
+ typeCompletion =
isQualified ?
CharOperation.concat(currentType.qualifiedPackageName(), currentType.qualifiedSourceName(), '.') :
currentType.sourceName();
@@ -5672,7 +5672,7 @@ public final class CompletionEngine
if(!isIgnored(CompletionProposal.ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION, CompletionProposal.TYPE_REF)) {
char[] packageName = currentType.isLocalType() ? null : currentType.qualifiedPackageName();
char[] typeName = currentType.qualifiedSourceName();
-
+
InternalCompletionProposal proposal = createProposal(CompletionProposal.ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION, this.actualCompletionPosition);
proposal.setDeclarationSignature(getSignature(currentType));
proposal.setDeclarationKey(currentType.computeUniqueKey());
@@ -5691,7 +5691,7 @@ public final class CompletionEngine
//proposal.setPackageName(null);
//proposal.setTypeName(null);
proposal.setName(currentType.sourceName());
-
+
InternalCompletionProposal typeProposal = createProposal(CompletionProposal.TYPE_REF, this.actualCompletionPosition);
typeProposal.nameLookup = this.nameEnvironment.nameLookup;
typeProposal.completionEngine = this;
@@ -5705,7 +5705,7 @@ public final class CompletionEngine
typeProposal.setTokenRange(this.startPosition - this.offset, this.endPosition - this.offset);
typeProposal.setRelevance(relevance);
proposal.setRequiredProposals( new CompletionProposal[]{typeProposal});
-
+
proposal.setCompletion(completion);
proposal.setFlags(Flags.AccPublic);
proposal.setReplaceRange(this.endPosition - this.offset, this.endPosition - this.offset);
@@ -5850,7 +5850,7 @@ public final class CompletionEngine
}
}
}
-
+
void findConstructors(
ReferenceBinding currentType,
TypeBinding[] argTypes,
@@ -5861,16 +5861,16 @@ public final class CompletionEngine
int[] missingElementsStarts,
int[] missingElementsEnds,
boolean missingElementsHaveProblems) {
-
+
int relevance = computeBaseRelevance();
relevance += computeRelevanceForResolution();
relevance += computeRelevanceForInterestingProposal();
relevance += computeRelevanceForRestrictions(IAccessRule.K_ACCESSIBLE);
-
+
if (missingElements != null) {
relevance += computeRelevanceForMissingElements(missingElementsHaveProblems);
}
-
+
findConstructors(
currentType,
argTypes,
@@ -5885,8 +5885,8 @@ public final class CompletionEngine
false,
relevance);
}
-
-
+
+
private void findConstructorsFromMissingType(
TypeReference typeRef,
final TypeBinding[] argTypes,
@@ -5918,9 +5918,9 @@ public final class CompletionEngine
missingElementsEnds,
hasProblems);
}
-
+
checkCancel();
-
+
if (!isIgnored(CompletionProposal.ANONYMOUS_CLASS_DECLARATION, missingElements != null)
&& !ref.isFinal()
&& !ref.isEnum()){
@@ -5939,7 +5939,7 @@ public final class CompletionEngine
};
missingTypesConverter.guess(typeRef, scope, substitutionRequestor);
}
-
+
private void findConstructors(
ReferenceBinding currentType,
TypeBinding[] argTypes,
@@ -6010,11 +6010,11 @@ public final class CompletionEngine
char[][] parameterNames = findMethodParameterNames(constructor,parameterTypeNames);
char[] completion = CharOperation.NO_CHAR;
-
+
if(forAnonymousType){
char[] typeCompletion = null;
if (!exactMatch) {
- typeCompletion =
+ typeCompletion =
isQualified ?
CharOperation.concat(currentType.qualifiedPackageName(), currentType.qualifiedSourceName(), '.') :
currentType.sourceName();
@@ -6026,13 +6026,13 @@ public final class CompletionEngine
completion = new char[] { '(', ')' };
}
}
-
+
this.noProposal = false;
if (!exactMatch) {
if(!isIgnored(CompletionProposal.ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION, CompletionProposal.TYPE_REF)) {
char[] packageName = currentType.isLocalType() ? null : currentType.qualifiedPackageName();
char[] typeName = currentType.qualifiedSourceName();
-
+
InternalCompletionProposal proposal = createProposal(CompletionProposal.ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION, this.actualCompletionPosition);
proposal.setBinding(constructor);
proposal.setDeclarationSignature(getSignature(currentType));
@@ -6050,7 +6050,7 @@ public final class CompletionEngine
//proposal.setPackageName(null);
//proposal.setTypeName(null);
proposal.setName(currentType.sourceName());
-
+
InternalCompletionProposal typeProposal = createProposal(CompletionProposal.TYPE_REF, this.actualCompletionPosition);
typeProposal.nameLookup = this.nameEnvironment.nameLookup;
typeProposal.completionEngine = this;
@@ -6064,7 +6064,7 @@ public final class CompletionEngine
typeProposal.setTokenRange(this.startPosition - this.offset, this.endPosition - this.offset);
typeProposal.setRelevance(relevance);
proposal.setRequiredProposals( new CompletionProposal[]{typeProposal});
-
+
proposal.setCompletion(completion);
proposal.setFlags(constructor.modifiers);
proposal.setReplaceRange(this.endPosition - this.offset, this.endPosition - this.offset);
@@ -6172,11 +6172,11 @@ public final class CompletionEngine
}
} else {
if (!exactMatch) {
- typeCompletion =
+ typeCompletion =
isQualified ?
CharOperation.concat(currentType.qualifiedPackageName(), currentType.qualifiedSourceName(), '.') :
currentType.sourceName();
-
+
if (this.source != null
&& this.source.length > this.endPosition
&& this.source[this.endPosition] == '(') {
@@ -6209,7 +6209,7 @@ public final class CompletionEngine
//proposal.setPackageName(null);
//proposal.setTypeName(null);
proposal.setName(currentType.sourceName());
-
+
InternalCompletionProposal typeProposal = createProposal(CompletionProposal.TYPE_REF, this.actualCompletionPosition);
typeProposal.nameLookup = this.nameEnvironment.nameLookup;
typeProposal.completionEngine = this;
@@ -6223,7 +6223,7 @@ public final class CompletionEngine
typeProposal.setTokenRange(this.startPosition - this.offset, this.endPosition - this.offset);
typeProposal.setRelevance(constructorRelevance);
proposal.setRequiredProposals( new CompletionProposal[]{typeProposal});
-
+
proposal.setIsContructor(true);
proposal.setCompletion(completion);
proposal.setFlags(constructor.modifiers);
@@ -6314,7 +6314,7 @@ public final class CompletionEngine
}
}
}
-
+
private char[] getResolvedSignature(char[][] parameterTypes, char[] fullyQualifiedTypeName, int parameterCount, Scope scope) {
char[][] cn = CharOperation.splitOn('.', fullyQualifiedTypeName);
@@ -6324,7 +6324,7 @@ public final class CompletionEngine
} else {
ref = new QualifiedTypeReference(cn,new long[cn.length]);
}
-
+
TypeBinding guessedType = null;
INameEnvironment oldNameEnvironment = this.lookupEnvironment.nameEnvironment;
this.lookupEnvironment.nameEnvironment = getNoCacheNameEnvironment();
@@ -6338,38 +6338,38 @@ public final class CompletionEngine
guessedType = ref.resolveType((ClassScope)scope);
break;
}
-
+
if (guessedType != null && guessedType.isValidBinding()) {
// the erasure must be used because guessedType can be a RawTypeBinding (https://bugs.eclipse.org/bugs/show_bug.cgi?id=276890)
guessedType = guessedType.erasure();
-
+
if (guessedType instanceof SourceTypeBinding) {
SourceTypeBinding refBinding = (SourceTypeBinding) guessedType;
-
+
if (refBinding.scope == null || refBinding.scope.referenceContext == null) return null;
-
+
TypeDeclaration typeDeclaration = refBinding.scope.referenceContext;
AbstractMethodDeclaration[] methods = typeDeclaration.methods;
-
+
next : for (int i = 0; i < methods.length; i++) {
AbstractMethodDeclaration method = methods[i];
-
+
if (!method.isConstructor()) continue next;
-
+
Argument[] arguments = method.arguments;
int argumentsLength = arguments == null ? 0 : arguments.length;
-
+
if (parameterCount != argumentsLength) continue next;
-
+
for (int j = 0; j < argumentsLength; j++) {
char[] argumentTypeName = getTypeName(arguments[j].type);
-
+
if (!CharOperation.equals(argumentTypeName, parameterTypes[j])) {
continue next;
}
}
-
+
refBinding.resolveTypesFor(method.binding); // force resolution
if (method.binding == null) continue next;
return getSignature(method.binding);
@@ -6379,17 +6379,17 @@ public final class CompletionEngine
} finally {
this.lookupEnvironment.nameEnvironment = oldNameEnvironment;
}
-
+
return null;
}
-
+
private void findConstructorsOrAnonymousTypes(
ReferenceBinding currentType,
Scope scope,
InvocationSite invocationSite,
boolean isQualified,
int relevance) {
-
+
//{ObjectTeams: other parts of completion prefer role interfaces, but here we need to go back to the role class:
if (currentType.isSynthInterface()) {
currentType = currentType.roleModel.getClassPartBinding();
@@ -6413,7 +6413,7 @@ public final class CompletionEngine
isQualified,
relevance);
}
-
+
//{ObjectTeams: no anonymous classes from roles:
if (currentType.isRole())
return;
@@ -6718,7 +6718,7 @@ public final class CompletionEngine
return;
}
}
-
+
if (isForbidden(exceptionType)) return;
for (int j = typesFound.size; --j >= 0;) {
@@ -7025,7 +7025,7 @@ public final class CompletionEngine
int fieldLength = fieldName.length;
next : for (int f = fields.length; --f >= 0;) {
FieldBinding field = fields[f];
-
+
// Content assist invoked inside some field's initialization.
// bug 310427 and 325481
if (fieldBeingCompletedId >= 0 && field.id >= fieldBeingCompletedId) {
@@ -7042,7 +7042,7 @@ public final class CompletionEngine
}
}
}
-
+
//{ObjectTeams: filter out generated fields
if (!canBeCompleted(field.name)) continue next;
//carp}
@@ -7065,7 +7065,7 @@ public final class CompletionEngine
// SH}
if (this.options.checkVisibility
&& !field.canBeSeenBy(receiverType, invocationSite, scope)) continue next;
-
+
// don't propose non constant fields or strings (1.6 or below) in case expression
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=195346
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=343342
@@ -7075,9 +7075,9 @@ public final class CompletionEngine
if (field.type == null || field.type.id != TypeIds.T_JavaLangString)
continue next;
} else if (!(field.type instanceof BaseTypeBinding))
- continue next;
+ continue next;
} else {
- continue next; // non-constants not allowed in case.
+ continue next; // non-constants not allowed in case.
}
}
@@ -7773,9 +7773,9 @@ public final class CompletionEngine
receiverType = scope.getJavaLangObject();
}
-
+
checkCancel();
-
+
if(proposeField) {
findFields(
token,
@@ -7913,29 +7913,29 @@ public final class CompletionEngine
IfStatement ifStatement = (IfStatement)enclosingNode;
while (true) {
if (!(ifStatement.condition instanceof InstanceOfExpression)) return;
-
+
InstanceOfExpression instanceOfExpression = (InstanceOfExpression) ifStatement.condition;
-
+
TypeReference instanceOfType = instanceOfExpression.type;
-
+
if (instanceOfType.resolvedType == null) return;
-
+
boolean findFromAnotherReceiver = false;
-
+
char[][] receiverName = null;
int receiverStart = -1;
int receiverEnd = -1;
-
+
if (receiver instanceof QualifiedNameReference) {
QualifiedNameReference qualifiedNameReference = (QualifiedNameReference) receiver;
-
+
receiverName = qualifiedNameReference.tokens;
-
+
if (receiverName.length != 1) return;
-
+
receiverStart = (int) (qualifiedNameReference.sourcePositions[0] >>> 32);
receiverEnd = (int) qualifiedNameReference.sourcePositions[qualifiedNameReference.tokens.length - 1] + 1;
-
+
// if (local instanceof X) local.|
// if (field instanceof X) field.|
if (instanceOfExpression.expression instanceof SingleNameReference &&
@@ -7943,11 +7943,11 @@ public final class CompletionEngine
(qualifiedBinding instanceof LocalVariableBinding || qualifiedBinding instanceof FieldBinding)) {
findFromAnotherReceiver = true;
}
-
+
// if (this.field instanceof X) field.|
if (instanceOfExpression.expression instanceof FieldReference) {
FieldReference fieldReference = (FieldReference)instanceOfExpression.expression;
-
+
if (fieldReference.receiver instanceof ThisReference &&
qualifiedBinding instanceof FieldBinding &&
fieldReference.binding == qualifiedBinding) {
@@ -7956,24 +7956,24 @@ public final class CompletionEngine
}
} else if (receiver instanceof FieldReference) {
FieldReference fieldReference1 = (FieldReference) receiver;
-
+
receiverStart = fieldReference1.sourceStart;
receiverEnd = fieldReference1.sourceEnd + 1;
-
+
if (fieldReference1.receiver instanceof ThisReference) {
-
+
receiverName = new char[][] {THIS, fieldReference1.token};
-
+
// if (field instanceof X) this.field.|
if (instanceOfExpression.expression instanceof SingleNameReference &&
((SingleNameReference)instanceOfExpression.expression).binding == fieldReference1.binding) {
findFromAnotherReceiver = true;
}
-
+
// if (this.field instanceof X) this.field.|
if (instanceOfExpression.expression instanceof FieldReference) {
FieldReference fieldReference2 = (FieldReference)instanceOfExpression.expression;
-
+
if (fieldReference2.receiver instanceof ThisReference &&
fieldReference2.binding == fieldReference1.binding) {
findFromAnotherReceiver = true;
@@ -7981,18 +7981,18 @@ public final class CompletionEngine
}
}
}
-
+
if (findFromAnotherReceiver) {
TypeBinding receiverTypeBinding = instanceOfType.resolvedType;
char[] castedReceiver = null;
-
+
char[] castedTypeChars = CharOperation.concatWith(instanceOfType.getTypeName(), '.');
if(this.source != null) {
int memberRefStart = this.startPosition;
-
+
char[] receiverChars = CharOperation.subarray(this.source, receiverStart, receiverEnd);
char[] dotChars = CharOperation.subarray(this.source, receiverEnd, memberRefStart);
-
+
castedReceiver =
CharOperation.concat(
CharOperation.concat(
@@ -8013,12 +8013,12 @@ public final class CompletionEngine
')'),
DOT);
}
-
+
if (castedReceiver == null) return;
-
+
int oldStartPosition = this.startPosition;
this.startPosition = receiverStart;
-
+
findFieldsAndMethods(
this.completionToken,
receiverTypeBinding,
@@ -8036,7 +8036,7 @@ public final class CompletionEngine
castedReceiver,
receiverStart,
receiverEnd);
-
+
this.startPosition = oldStartPosition;
}
// traverse the enclosing node to find the instanceof expression corresponding
@@ -8841,7 +8841,7 @@ public final class CompletionEngine
}
}
}
-
+
private void findInterfacesMethodDeclarations(
char[] selector,
ReferenceBinding receiverType,
@@ -8891,7 +8891,7 @@ public final class CompletionEngine
}
}
}
-
+
private void findInterfacesMethods(
char[] selector,
TypeBinding[] typeArgTypes,
@@ -9132,7 +9132,7 @@ public final class CompletionEngine
}
}
- if (astNode instanceof CompletionOnFieldType &&
+ if (astNode instanceof CompletionOnFieldType &&
this.compilerOptions.sourceLevel >= ClassFileConstants.JDK1_8) {
FieldBinding astNodeBinding = ((CompletionOnFieldType) astNode).binding;
ReferenceBinding declaringClass = astNodeBinding != null ? astNodeBinding.declaringClass : null;
@@ -9719,7 +9719,7 @@ public final class CompletionEngine
&& this.source.length > this.endPosition
&& this.source[this.endPosition] == '(')
completion = method.selector;
- else
+ else
completion = CharOperation.concat(method.selector, new char[] { '(', ')' });
if (castedReceiver != null) {
@@ -10193,7 +10193,7 @@ public final class CompletionEngine
/**
* Helper method for findMethods(char[], TypeBinding[], ReferenceBinding, Scope, ObjectVector, boolean, boolean, boolean)
* Note that the method doesn't do a comparison of the method names and expects the client to handle the same.
- *
+ *
* @methodName method as entered by the user, the one to completed
* @param methods a resultant array of MethodBinding, whose names should match methodName. The calling client must ensure that this check is handled.
*/
@@ -10829,7 +10829,7 @@ public final class CompletionEngine
}
boolean allowingLongComputationProposals = isAllowingLongComputationProposals();
-
+
this.noProposal = false;
if (!this.assistNodeIsConstructor ||
!allowingLongComputationProposals ||
@@ -10847,7 +10847,7 @@ public final class CompletionEngine
missingElementsEnds,
missingElementsHaveProblems);
}
-
+
if (this.assistNodeIsConstructor && allowingLongComputationProposals) {
findConstructorsOrAnonymousTypes(
memberType,
@@ -10892,7 +10892,7 @@ public final class CompletionEngine
typeRef.resolvedType = new ProblemReferenceBinding(new char[][]{ typeName }, null, ProblemReasons.NotFound);
missingTypesConverter.guess(typeRef, scope, substitutionRequestor);
}
-
+
private void findMemberTypesFromMissingType(
TypeReference typeRef,
final long pos,
@@ -10953,7 +10953,7 @@ public final class CompletionEngine
}
ReferenceBinding currentType = receiverType;
-
+
findInterfacesMethodDeclarations(
selector,
receiverType,
@@ -10964,13 +10964,13 @@ public final class CompletionEngine
missingElementsStarts,
missingElementsEnds,
missingElementsHaveProblems);
-
+
if (receiverType.isInterface()) {
currentType = scope.getJavaLangObject();
} else {
currentType = receiverType.superclass();
}
-
+
boolean hasPotentialDefaultAbstractMethods = true;
boolean java8Plus = this.compilerOptions.sourceLevel >= ClassFileConstants.JDK1_8;
while (currentType != null) {
@@ -11025,7 +11025,7 @@ public final class CompletionEngine
}
// SH}
}
-
+
private char[][] findMethodParameterNames(MethodBinding method, char[][] parameterTypeNames){
//{ObjectTeams: added arg offset:
return findMethodParameterNames(method, /*parameterOffset*/0, parameterTypeNames);
@@ -11177,7 +11177,7 @@ public final class CompletionEngine
if (selector == null && notInJavadoc) {
return;
}
-
+
if (this.assistNodeIsInsideCase)
return; // no methods should be proposed inside case expression
@@ -11327,7 +11327,7 @@ public final class CompletionEngine
Scope scope,
boolean proposeAllMemberTypes,
ObjectVector typesFound) {
-
+
if (typeName == null)
return;
@@ -11401,7 +11401,7 @@ public final class CompletionEngine
false);
}
}
-
+
if (this.assistNodeIsConstructor && allowingLongComputationProposals) {
findConstructorsOrAnonymousTypes(
localType,
@@ -11465,32 +11465,32 @@ public final class CompletionEngine
findOverridableRolesFrom(tsuperTeam, knownRoles);
}
- private void findOverridableRolesFrom(ReferenceBinding superTeam, Set<String> knownRoles)
+ private void findOverridableRolesFrom(ReferenceBinding superTeam, Set<String> knownRoles)
{
int nameLength = this.completionToken.length;
ReferenceBinding[] superRoles = superTeam.memberTypes();
-
+
// inline roles:
for (int i = 0; i < superRoles.length; i++)
checkOverridableRole(superTeam, knownRoles, superRoles[i], nameLength);
-
- // secondary types like the super team are inserted into compilation using the
- // SourceTypeConverter, which doesn't know about role files.
+
+ // secondary types like the super team are inserted into compilation using the
+ // SourceTypeConverter, which doesn't know about role files.
// Thus we use the search engine (via IOTType.getRoleTypes) to find role files:
try {
IType superType = this.javaProject.findType(String.valueOf(superTeam.readableName()));
IOTType superTeamType = OTModelManager.getOTElement(superType);
if (superTeamType != null)
for (IType type : superTeamType.getRoleTypes(IOTType.ROLEFILE))
- checkOverridableRole(superTeam, knownRoles, type, nameLength);
+ checkOverridableRole(superTeam, knownRoles, type, nameLength);
} catch (JavaModelException e) {
// ignore
}
}
- private void checkOverridableRole(ReferenceBinding superTeam,
- Set<String> knownRoles,
+ private void checkOverridableRole(ReferenceBinding superTeam,
+ Set<String> knownRoles,
ReferenceBinding superRole,
- int nameLength)
+ int nameLength)
{
if (!superRole.isInterface())
return;
@@ -11501,7 +11501,7 @@ public final class CompletionEngine
char[] superRoleName = superRole.sourceName;
if (CharOperation.equals(superRoleName, IOTConstants.ILOWERABLE)) // not interesting to override
return;
-
+
if (this.completionToken.length > 0) {
if (this.completionToken.length > superRoleName.length)
return;
@@ -11510,21 +11510,21 @@ public final class CompletionEngine
&& !(this.options.camelCaseMatch && CharOperation.camelCaseMatch(this.completionToken, superRoleName)))
return;
}
-
+
String roleName = String.valueOf(superRoleName);
if (!knownRoles.add(roleName))
return;
-
+
ReferenceBinding classPart = superRole.roleModel.getClassPartBinding();
int modifiers = classPart != null ? classPart.modifiers : superRole.modifiers;
-
+
createOverrideRoleProposal(superTeam, superRoleName, getSignature(superRole), modifiers);
}
// similar to above, version for IType:
- private void checkOverridableRole(ReferenceBinding superTeam,
- Set<String> knownRoles,
+ private void checkOverridableRole(ReferenceBinding superTeam,
+ Set<String> knownRoles,
IType superRole,
- int nameLength) throws JavaModelException
+ int nameLength) throws JavaModelException
{
// don't check for interface, java model has no role-splitting
if (TypeHelper.isConfined(superRole)) // can't override Confined/IConfined
@@ -11560,7 +11560,7 @@ public final class CompletionEngine
if (moduleName.length > 0) {// do not propose invalid names
if (!Character.isJavaIdentifierStart(moduleName[0])) return;
for (char c : moduleName) {
- if (!Character.isJavaIdentifierPart(c) && c != '.') return;
+ if (!Character.isJavaIdentifierPart(c) && c != '.') return;
}
}
this.completionToken = CharOperation.concatWith(this.moduleDeclaration.tokens, '.');
@@ -11868,34 +11868,34 @@ public final class CompletionEngine
if (token == null)
return;
-
+
boolean allowingLongComputationProposals = isAllowingLongComputationProposals();
-
+
boolean proposeType =
!this.requestor.isIgnored(CompletionProposal.TYPE_REF) ||
((this.assistNodeInJavadoc & CompletionOnJavadoc.TEXT) != 0 && !this.requestor.isIgnored(CompletionProposal.JAVADOC_TYPE_REF));
boolean proposeAllMemberTypes = !this.assistNodeIsConstructor;
-
+
boolean proposeConstructor =
allowingLongComputationProposals &&
this.assistNodeIsConstructor &&
(!isIgnored(CompletionProposal.CONSTRUCTOR_INVOCATION, CompletionProposal.TYPE_REF) ||
!isIgnored(CompletionProposal.ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION, CompletionProposal.TYPE_REF));
-
+
if ((proposeType || proposeConstructor) && scope.enclosingSourceType() != null) {
-
+
checkCancel();
-
+
findNestedTypes(token, scope.enclosingSourceType(), scope, proposeAllMemberTypes, typesFound);
if(!this.assistNodeIsInterface &&
!this.assistNodeIsConstructor &&
!this.assistNodeIsAnnotation &&
this.assistNodeInJavadoc == 0) {
-
+
checkCancel();
-
+
// don't propose type parameters if the completion is a constructor ('new |')
findTypeParameters(token, scope);
}
@@ -11912,7 +11912,7 @@ public final class CompletionEngine
boolean isEmptyPrefix = token.length == 0;
if ((proposeType || proposeConstructor) && this.unitScope != null) {
-
+
ReferenceBinding outerInvocationType = scope.enclosingSourceType();
if(outerInvocationType != null) {
ReferenceBinding temp = outerInvocationType.enclosingType();
@@ -11926,9 +11926,9 @@ public final class CompletionEngine
SourceTypeBinding[] types = this.unitScope.topLevelTypes;
next : for (int i = 0, length = types.length; i < length; i++) {
-
+
checkCancel();
-
+
SourceTypeBinding sourceType = types[i];
if(isForbidden(sourceType)) continue next;
@@ -11962,7 +11962,7 @@ public final class CompletionEngine
if (TypeBinding.equalsEquals(sourceType, otherType)) continue next;
}
-
+
typesFound.add(sourceType);
if (this.assistNodeIsExtendedType && sourceType.isFinal()) continue next;
@@ -12000,8 +12000,8 @@ public final class CompletionEngine
relevance += computeRelevanceForClass();
relevance += computeRelevanceForException(sourceType.sourceName);
}
-
-
+
+
this.noProposal = false;
if(proposeType &&
(!this.assistNodeIsConstructor ||
@@ -12021,7 +12021,7 @@ public final class CompletionEngine
null,
false);
}
-
+
if (proposeConstructor) {
findConstructorsOrAnonymousTypes(
sourceType,
@@ -12034,21 +12034,21 @@ public final class CompletionEngine
}
if (proposeConstructor && !isEmptyPrefix) {
-
+
checkCancel();
-
+
findTypesFromImports(token, scope, proposeType, typesFound);
} else if(proposeType) {
-
+
checkCancel();
-
+
findTypesFromStaticImports(token, scope, proposeAllMemberTypes, typesFound);
}
-
+
if (proposeConstructor) {
-
+
checkCancel();
-
+
findTypesFromExpectedTypes(token, scope, typesFound, proposeType, proposeConstructor);
}
@@ -12068,7 +12068,7 @@ public final class CompletionEngine
}
}
}
-
+
if (proposeConstructor) {
int l = typesFound.size();
for (int i = 0; i < l; i++) {
@@ -12080,9 +12080,9 @@ public final class CompletionEngine
'.');
this.knownTypes.put(fullyQualifiedTypeName, KNOWN_TYPE_WITH_KNOWN_CONSTRUCTORS);
}
-
+
checkCancel();
-
+
this.foundConstructorsCount = 0;
this.nameEnvironment.findConstructorDeclarations(
token,
@@ -12113,9 +12113,9 @@ public final class CompletionEngine
} else if(this.assistNodeIsAnnotation) {
searchFor = IJavaSearchConstants.ANNOTATION_TYPE;
}
-
+
checkCancel();
-
+
this.foundTypesCount = 0;
this.nameEnvironment.findTypes(
token,
@@ -12127,9 +12127,9 @@ public final class CompletionEngine
acceptTypes(scope);
}
if(!isEmptyPrefix && !this.requestor.isIgnored(CompletionProposal.PACKAGE_REF)) {
-
+
checkCancel();
-
+
this.nameEnvironment.findPackages(token, this);
}
}
@@ -12139,13 +12139,13 @@ public final class CompletionEngine
char[] token,
PackageBinding packageBinding,
Scope scope) {
-
+
boolean allowingLongComputationProposals = isAllowingLongComputationProposals();
boolean proposeType =
!this.requestor.isIgnored(CompletionProposal.TYPE_REF) ||
((this.assistNodeInJavadoc & CompletionOnJavadoc.TEXT) != 0 && !this.requestor.isIgnored(CompletionProposal.JAVADOC_TYPE_REF));
-
+
boolean proposeConstructor =
allowingLongComputationProposals &&
this.assistNodeIsConstructor &&
@@ -12173,11 +12173,11 @@ public final class CompletionEngine
SourceTypeBinding[] types = this.unitScope.topLevelTypes;
for (int i = 0, length = types.length; i < length; i++) {
-
+
checkCancel();
-
+
SourceTypeBinding sourceType = types[i];
-
+
if (isForbidden(sourceType)) continue;
if (this.assistNodeIsClass && sourceType.isInterface()) continue;
if (this.assistNodeIsInterface && sourceType.isClass()) continue;
@@ -12238,7 +12238,7 @@ public final class CompletionEngine
relevance += computeRelevanceForClass();
relevance += computeRelevanceForException(sourceType.sourceName);
}
-
+
this.noProposal = false;
if(proposeType &&
(!this.assistNodeIsConstructor ||
@@ -12258,7 +12258,7 @@ public final class CompletionEngine
null,
false);
}
-
+
if (proposeConstructor) {
findConstructorsOrAnonymousTypes(
sourceType,
@@ -12272,9 +12272,9 @@ public final class CompletionEngine
if (proposeConstructor) {
-
+
checkCancel();
-
+
this.foundConstructorsCount = 0;
this.nameEnvironment.findConstructorDeclarations(
qualifiedName,
@@ -12295,9 +12295,9 @@ public final class CompletionEngine
} else if(this.assistNodeIsAnnotation) {
searchFor = IJavaSearchConstants.ANNOTATION_TYPE;
}
-
+
checkCancel();
-
+
this.foundTypesCount = 0;
this.nameEnvironment.findTypes(
qualifiedName,
@@ -12308,28 +12308,28 @@ public final class CompletionEngine
this.monitor);
acceptTypes(scope);
}
-
+
if(!this.requestor.isIgnored(CompletionProposal.PACKAGE_REF)) {
this.nameEnvironment.findPackages(qualifiedName, this);
}
}
-
+
private void findTypesFromExpectedTypes(char[] token, Scope scope, ObjectVector typesFound, boolean proposeType, boolean proposeConstructor) {
if(this.expectedTypesPtr > -1) {
boolean allowingLongComputationProposals = isAllowingLongComputationProposals();
-
+
int typeLength = token == null ? 0 : token.length;
-
+
next : for (int i = 0; i <= this.expectedTypesPtr; i++) {
-
+
checkCancel();
-
+
if(this.expectedTypes[i] instanceof ReferenceBinding) {
ReferenceBinding refBinding = (ReferenceBinding)this.expectedTypes[i];
-
+
if (typeLength > 0) {
if (typeLength > refBinding.sourceName.length) continue next;
-
+
if (isFailedMatch(token, refBinding.sourceName)) continue next;
}
@@ -12371,7 +12371,7 @@ public final class CompletionEngine
continue next;
}
}
-
+
typesFound.add(refBinding);
boolean inSameUnit = this.unitScope.isDefinedInSameUnit(refBinding);
@@ -12419,7 +12419,7 @@ public final class CompletionEngine
} else if(refBinding.isInterface()) {
relevance += computeRelevanceForInterface();
}
-
+
if (proposeType &&
(!this.assistNodeIsConstructor ||
!allowingLongComputationProposals ||
@@ -12444,7 +12444,7 @@ public final class CompletionEngine
}
}
}
-
+
if (proposeConstructor) {
findConstructorsOrAnonymousTypes(
refBinding,
@@ -12497,7 +12497,7 @@ public final class CompletionEngine
if (typeLength > typeBinding.sourceName.length) continue next;
if (isFailedMatch(token, typeBinding.sourceName)) continue next;
-
+
int accessibility = IAccessRule.K_ACCESSIBLE;
if(typeBinding.hasRestrictedAccess()) {
AccessRestriction accessRestriction = this.lookupEnvironment.getAccessRestriction(typeBinding);
@@ -12518,11 +12518,11 @@ public final class CompletionEngine
}
}
}
-
+
if (typesFound.contains(typeBinding)) continue next;
-
+
typesFound.add(typeBinding);
-
+
if (this.assistNodeIsExtendedType && typeBinding.isFinal()) continue;
if (this.assistNodeIsInterfaceExcludingAnnotation && typeBinding.isAnnotationType()) continue;
if(this.assistNodeIsClass) {
@@ -12532,7 +12532,7 @@ public final class CompletionEngine
} else if (this.assistNodeIsAnnotation) {
if(!typeBinding.isAnnotationType()) continue;
}
-
+
int relevance = computeBaseRelevance();
relevance += computeRelevanceForResolution();
relevance += computeRelevanceForInterestingProposal(typeBinding);
@@ -12540,7 +12540,7 @@ public final class CompletionEngine
relevance += computeRelevanceForExpectingType(typeBinding);
relevance += computeRelevanceForQualification(false);
relevance += computeRelevanceForRestrictions(accessibility);
-
+
if (typeBinding.isAnnotationType()) {
relevance += computeRelevanceForAnnotation();
relevance += computeRelevanceForAnnotationTarget(typeBinding);
@@ -12550,8 +12550,8 @@ public final class CompletionEngine
relevance += computeRelevanceForClass();
relevance += computeRelevanceForException(typeBinding.sourceName);
}
-
- if (proposeType &&
+
+ if (proposeType &&
(hasStaticMemberTypes(typeBinding, scope.enclosingSourceType(), this.unitScope) || hasArrayTypeAsExpectedSuperTypes())) {
this.noProposal = false;
if(!this.requestor.isIgnored(CompletionProposal.TYPE_REF)) {
@@ -12571,7 +12571,7 @@ public final class CompletionEngine
}
}
}
-
+
findConstructorsOrAnonymousTypes(
typeBinding,
scope,
@@ -12584,7 +12584,7 @@ public final class CompletionEngine
}
}
}
-
+
private void findTypesFromStaticImports(char[] token, Scope scope, boolean proposeAllMemberTypes, ObjectVector typesFound) {
ImportBinding[] importBindings = scope.compilationUnitScope().imports;
if (importBindings == null) return;
@@ -12888,7 +12888,7 @@ public final class CompletionEngine
findPackagesInCurrentModule();
}
return;
-
+
} catch (JavaModelException e) {
//
}
@@ -12975,9 +12975,9 @@ public final class CompletionEngine
IType[] subclasses = newTypeHierarchy.getSubclasses(iClass);
for (IType iType2 : subclasses) {
getAllTypesInHierarchy(newTypeHierarchy,iType2,allTypes);
-
+
}
-
+
}
private char[][] findVariableFromUnresolvedReference(LocalDeclaration variable, BlockScope scope, final char[][] discouragedNames) {
@@ -13239,7 +13239,7 @@ public final class CompletionEngine
forbiddenNames,
type.dimensions(),
kind);
-
+
if (tb.isParameterizedType() &&
tb.findSuperTypeOriginatingFrom(TypeIds.T_JavaUtilCollection, false) != null) {
ParameterizedTypeBinding ptb = ((ParameterizedTypeBinding) tb);
@@ -13320,13 +13320,13 @@ public final class CompletionEngine
// carp}
if (local.isSecret())
continue next;
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=328674
if (local.declaration.initialization != null && !local.declaration.type.isTypeNameVar(null)) {
// proposal being asked inside field's initialization. Don't propose this field.
continue next;
}
-
+
// don't propose non constant variables or strings (1.6 or below) in case expression
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=195346
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=343342
@@ -13336,12 +13336,12 @@ public final class CompletionEngine
if (local.type == null || local.type.id != TypeIds.T_JavaLangString)
continue next;
} else if (!(local.type instanceof BaseTypeBinding))
- continue next;
+ continue next;
} else {
- continue next; // non-constants not allowed in case.
+ continue next; // non-constants not allowed in case.
}
}
-
+
int ptr = this.uninterestingBindingsPtr;
// Cases where the binding is uninteresting eg. for completion occurring inside a local var
// declaration, the local var binding is uninteresting and shouldn't be proposed.
@@ -13405,7 +13405,7 @@ public final class CompletionEngine
currentScope = currentScope.parent;
}
}
-
+
checkCancel();
boolean proposeField = !this.requestor.isIgnored(CompletionProposal.FIELD_REF);
@@ -13486,9 +13486,9 @@ public final class CompletionEngine
}
currentScope = currentScope.parent;
}
-
+
checkCancel();
-
+
findFieldsAndMethodsFromStaticImports(
token,
scope,
@@ -13503,9 +13503,9 @@ public final class CompletionEngine
proposeMethod);
if (this.assistNodeInJavadoc == 0) {
-
+
checkCancel();
-
+
// search in favorites import
findFieldsAndMethodsFromFavorites(
token,
@@ -13516,9 +13516,9 @@ public final class CompletionEngine
fieldsFound,
methodsFound);
}
-
+
checkCancel();
-
+
findEnumConstantsFromExpectedTypes(
token,
invocationScope,
@@ -13651,7 +13651,7 @@ public final class CompletionEngine
return this.favoriteReferenceBindings = resolvedImports;
}
-
+
private INameEnvironment getNoCacheNameEnvironment() {
if (this.noCacheNameEnvironment == null) {
JavaModelManager.getJavaModelManager().cacheZipFiles(this);
@@ -13667,7 +13667,7 @@ public final class CompletionEngine
}
protected boolean hasArrayTypeAsExpectedSuperTypes() {
if ((this.expectedTypesFilter & ~SUBTYPE) != 0) return false;
-
+
if (!this.hasComputedExpectedArrayTypes) {
if(this.expectedTypes != null) {
done : for (int i = 0; i <= this.expectedTypesPtr; i++) {
@@ -13677,10 +13677,10 @@ public final class CompletionEngine
}
}
}
-
+
this.hasComputedExpectedArrayTypes = true;
}
-
+
return this.hasExpectedArrayTypes;
}
protected boolean hasPossibleAnnotationTarget(TypeBinding typeBinding, Scope scope) {
@@ -13736,12 +13736,12 @@ public final class CompletionEngine
private boolean isAllowingLongComputationProposals() {
return this.monitor != null;
}
-
+
/**
* Checks whether name matches the token according to the current
* code completion settings (substring match, camel case match etc.)
* and sets whether the current match is a suffix proposal.
- *
+ *
* @param token the token that is tested
* @param name the name to match
* @return <code>true</code> if the token does not match,
@@ -13784,11 +13784,11 @@ public final class CompletionEngine
}
}
}
-
+
if (!isValidPackageName(givenPkgName)) {
return true;
}
-
+
return false;
}
@@ -14098,7 +14098,7 @@ public final class CompletionEngine
buffer.append('\t');
}
}
-
+
private void proposeConstructor(AcceptedConstructor deferredProposal, Scope scope) {
if (deferredProposal.proposeConstructor) {
proposeConstructor(
@@ -14118,7 +14118,7 @@ public final class CompletionEngine
deferredProposal.extraFlags);
}
}
-
+
private void proposeConstructor(
char[] simpleTypeName,
int parameterCount,
@@ -14175,7 +14175,7 @@ public final class CompletionEngine
relevance += computeRelevanceForException(simpleTypeName);
break;
}
-
+
char[] completion;
if (this.source != null
&& this.source.length > this.endPosition
@@ -14184,7 +14184,7 @@ public final class CompletionEngine
} else {
completion = new char[] { '(', ')' };
}
-
+
InternalCompletionProposal typeProposal = createProposal(CompletionProposal.TYPE_REF, this.actualCompletionPosition);
typeProposal.nameLookup = this.nameEnvironment.nameLookup;
typeProposal.completionEngine = this;
@@ -14197,14 +14197,14 @@ public final class CompletionEngine
typeProposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset);
typeProposal.setTokenRange(this.startPosition - this.offset, this.endPosition - this.offset);
typeProposal.setRelevance(relevance);
-
+
switch (parameterCount) {
case -1: // default constructor
int flags = Flags.AccPublic;
if (Flags.isDeprecated(typeModifiers)) {
flags |= Flags.AccDeprecated;
}
-
+
if (isInterface || (typeModifiers & ClassFileConstants.AccAbstract) != 0) {
this.noProposal = false;
//{ObjectTeams: no anonymous roles:
@@ -14262,7 +14262,7 @@ public final class CompletionEngine
}
break;
case 0: // constructor with no parameter
-
+
if ((typeModifiers & ClassFileConstants.AccAbstract) != 0) {
//{ObjectTeams: no anonymous roles:
if ((typeModifiers & ExtraCompilerModifiers.AccRole) != 0) {
@@ -14327,12 +14327,12 @@ public final class CompletionEngine
} else {
signature = CharOperation.replaceOnCopy(signature, '/', '.');
}
-
+
int parameterNamesLength = parameterNames == null ? 0 : parameterNames.length;
if (parameterCount != parameterNamesLength) {
parameterNames = null;
}
-
+
if ((typeModifiers & ClassFileConstants.AccAbstract) != 0) {
this.noProposal = false;
if(!isIgnored(CompletionProposal.ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION, CompletionProposal.TYPE_REF)) {
@@ -14385,7 +14385,7 @@ public final class CompletionEngine
proposal.setReplaceRange(this.endPosition - this.offset, this.endPosition - this.offset);
proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset);
proposal.setRelevance(relevance);
-
+
this.requestor.accept(proposal);
if(DEBUG) {
this.printDebug(proposal);
@@ -14650,7 +14650,7 @@ public final class CompletionEngine
if(foundConflicts) return substituedParameterNames;
return null;
}
-
+
//{ObjectTeams: added methods:
// helper for base.foo, tsuper.foo
private boolean isBaseAccess(InvocationSite invocationSite) {
@@ -15058,14 +15058,14 @@ public final class CompletionEngine
}
private void inferCallouts(
- char[] selector,
+ char[] selector,
TypeBinding[] typeArgTypes,
- TypeBinding[] argTypes,
- ReferenceBinding receiverType,
+ TypeBinding[] argTypes,
+ ReferenceBinding receiverType,
Scope scope,
- ObjectVector methodsFound,
+ ObjectVector methodsFound,
boolean onlyStaticMethods,
- boolean exactMatch,
+ boolean exactMatch,
int kind,
TypeBinding expectedType,
InvocationSite invocationSite,
@@ -15076,12 +15076,12 @@ public final class CompletionEngine
Binding[] missingElements,
int[] missingElementsStarts,
int[] missingElementsEnds,
- boolean missingElementsHaveProblems,
+ boolean missingElementsHaveProblems,
char[] castedReceiver,
int receiverStart,
- int receiverEnd)
+ int receiverEnd)
{
-
+
ReferenceBinding baseclass = receiverType.baseclass();
boolean inferredCalloutAllowed = implicitCall;
if (!implicitCall && invocationSite instanceof CompletionOnMemberAccess)
@@ -15119,17 +15119,17 @@ public final class CompletionEngine
}
}
private void inferCalloutDeclarations(
- char[] selector,
- ReferenceBinding receiverType,
+ char[] selector,
+ ReferenceBinding receiverType,
Scope scope,
- ObjectVector methodsFound,
+ ObjectVector methodsFound,
Binding[] missingElements,
int[] missingElementsStarts,
int[] missingElementsEnds,
- boolean missingElementsHaveProblems)
+ boolean missingElementsHaveProblems)
{
ReferenceBinding baseclass = receiverType.baseclass();
-
+
// prepare for callout-to-field:
ObjectVector fieldsFound = new ObjectVector();
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/ISearchRequestor.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/ISearchRequestor.java
index 93f6e3970..fb47fd63b 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/ISearchRequestor.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/ISearchRequestor.java
@@ -93,6 +93,6 @@ public interface ISearchRequestor {
* The default package is represented by an empty array.
*/
public void acceptPackage(char[] packageName);
-
+
public void acceptModule(char[] moduleName);
}
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionContext.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionContext.java
index 06882abf1..def77c8df 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionContext.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionContext.java
@@ -122,9 +122,9 @@ public class InternalCompletionContext extends CompletionContext {
@Override
public IJavaElement getEnclosingElement() {
if (!this.isExtended) throw new UnsupportedOperationException("Operation only supported in extended context"); //$NON-NLS-1$
-
+
if (this.extendedContext == null) return null;
-
+
return this.extendedContext.getEnclosingElement();
}
@@ -172,9 +172,9 @@ public class InternalCompletionContext extends CompletionContext {
@Override
public IJavaElement[] getVisibleElements(String typeSignature) {
if (!this.isExtended) throw new UnsupportedOperationException("Operation only supported in extended context"); //$NON-NLS-1$
-
+
if (this.extendedContext == null) return new IJavaElement[0];
-
+
return this.extendedContext.getVisibleElements(typeSignature);
}
@@ -197,7 +197,7 @@ public class InternalCompletionContext extends CompletionContext {
public boolean isInJavadocText() {
return (this.javadoc & CompletionOnJavadoc.TEXT) != 0;
}
-
+
/**
* Return the completion node associated with the current completion.
*
@@ -208,12 +208,12 @@ public class InternalCompletionContext extends CompletionContext {
*/
public ASTNode getCompletionNode() {
if (!this.isExtended) throw new UnsupportedOperationException("Operation only supported in extended context"); //$NON-NLS-1$
-
+
if (this.extendedContext == null) return null;
-
+
return this.extendedContext.getCompletionNode();
}
-
+
/**
* Return the parent AST node of the completion node associated with the current completion.
*
@@ -224,12 +224,12 @@ public class InternalCompletionContext extends CompletionContext {
*/
public ASTNode getCompletionNodeParent() {
if (!this.isExtended) throw new UnsupportedOperationException("Operation only supported in extended context"); //$NON-NLS-1$
-
+
if (this.extendedContext == null) return null;
-
+
return this.extendedContext.getCompletionNodeParent();
}
-
+
/**
* Return the bindings of all visible local variables in the current completion context.
*
@@ -241,12 +241,12 @@ public class InternalCompletionContext extends CompletionContext {
*/
public ObjectVector getVisibleLocalVariables() {
if (!this.isExtended) throw new UnsupportedOperationException("Operation only supported in extended context"); //$NON-NLS-1$
-
+
if (this.extendedContext == null) return null;
-
+
return this.extendedContext.getVisibleLocalVariables();
}
-
+
/**
* Return the bindings of all visible fields in the current completion context.
*
@@ -258,12 +258,12 @@ public class InternalCompletionContext extends CompletionContext {
*/
public ObjectVector getVisibleFields() {
if (!this.isExtended) throw new UnsupportedOperationException("Operation only supported in extended context"); //$NON-NLS-1$
-
+
if (this.extendedContext == null) return null;
-
+
return this.extendedContext.getVisibleFields();
}
-
+
/**
* Return the bindings of all visible methods in the current completion context.
*
@@ -275,9 +275,9 @@ public class InternalCompletionContext extends CompletionContext {
*/
public ObjectVector getVisibleMethods() {
if (!this.isExtended) throw new UnsupportedOperationException("Operation only supported in extended context"); //$NON-NLS-1$
-
+
if (this.extendedContext == null) return null;
-
+
return this.extendedContext.getVisibleMethods();
}
}
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java
index 3236746c9..6c9174a31 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.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
* Andreas Magnusson <andreas.ch.magnusson@gmail.com>- contribution for bug 151500
@@ -46,7 +46,7 @@ import org.eclipse.jdt.internal.core.SourceMapper;
*/
public class InternalCompletionProposal extends CompletionProposal {
private static Object NO_ATTACHED_SOURCE = new Object();
-
+
protected CompletionEngine completionEngine;
protected NameLookup nameLookup;
@@ -192,7 +192,7 @@ public class InternalCompletionProposal extends CompletionProposal {
* Indicates whether parameter names have been computed.
*/
private boolean parameterNamesComputed = false;
-
+
protected char[][] findConstructorParameterNames(char[] declaringTypePackageName, char[] declaringTypeName, char[] selector, char[][] paramTypeNames){
if(paramTypeNames == null || declaringTypeName == null) return null;
@@ -282,7 +282,7 @@ public class InternalCompletionProposal extends CompletionProposal {
return parameters;
}
-
+
protected char[][] findMethodParameterNames(char[] declaringTypePackageName, char[] declaringTypeName, char[] selector, char[][] paramTypeNames){
if(paramTypeNames == null || declaringTypeName == null) return null;
@@ -344,7 +344,7 @@ public class InternalCompletionProposal extends CompletionProposal {
int startingIndex = 0;
String[] args;
IType enclosingType = type.getDeclaringType();
- // If the method is a constructor of a non-static inner type, add the enclosing type as an
+ // If the method is a constructor of a non-static inner type, add the enclosing type as an
// additional parameter to the constructor
if (enclosingType != null
&& CharOperation.equals(type.getElementName().toCharArray(), selector)
@@ -360,7 +360,7 @@ public class InternalCompletionProposal extends CompletionProposal {
args[i] = new String(paramTypeNames[i-startingIndex]);
}
method = type.getMethod(new String(selector), args);
-
+
IMethod[] methods = type.findMethods(method);
if (methods != null && methods.length > 0) {
method = methods[0];
@@ -375,7 +375,7 @@ public class InternalCompletionProposal extends CompletionProposal {
protected char[] getDeclarationTypeName() {
return this.declarationTypeName;
}
-
+
private int getOpenedBinaryTypesThreshold() {
return JavaModelManager.getJavaModelManager().getOpenableCacheSize() / 10;
}
@@ -905,7 +905,7 @@ public class InternalCompletionProposal extends CompletionProposal {
public void setFlags(int flags) {
this.flags = flags;
}
-
+
public void setHasNoParameterNamesFromIndex(boolean hasNoParameterNamesFromIndex) {
this.hasNoParameterNamesFromIndex = hasNoParameterNamesFromIndex;
}
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalExtendedCompletionContext.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalExtendedCompletionContext.java
index 4cb7868cd..da6d31618 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalExtendedCompletionContext.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalExtendedCompletionContext.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
* Technical University Berlin - extended API and implementation
@@ -181,15 +181,15 @@ public class InternalExtendedCompletionContext {
this.lookupEnvironment.unitBeingCompleted = this.compilationUnitDeclaration;
try {
this.hasComputedVisibleElementBindings = true;
-
+
Scope scope = this.assistScope;
ASTNode astNode = this.assistNode;
boolean notInJavadoc = this.completionContext.javadoc == 0;
-
+
this.visibleLocalVariables = new ObjectVector();
this.visibleFields = new ObjectVector();
this.visibleMethods = new ObjectVector();
-
+
ReferenceContext referenceContext = scope.referenceContext();
if (referenceContext instanceof AbstractMethodDeclaration || referenceContext instanceof LambdaExpression) {
// completion is inside a method body
@@ -208,7 +208,7 @@ public class InternalExtendedCompletionContext {
break done;
}
} else {
- FieldDeclaration fieldDeclaration = fields[i];
+ FieldDeclaration fieldDeclaration = fields[i];
if (fieldDeclaration.initialization != null && fieldDeclaration.binding != null) {
boolean isInsideInitializer = false;
if (fieldDeclaration.initialization.sourceEnd > 0) {
@@ -786,7 +786,7 @@ public class InternalExtendedCompletionContext {
// If the local variable declaration's initialization statement itself has the completion,
// then don't propose the local variable
if (local.declaration.initialization != null) {
- /*(use this if-else block if it is found that local.declaration.initialization != null is not sufficient to
+ /*(use this if-else block if it is found that local.declaration.initialization != null is not sufficient to
guarantee that proposal is being asked inside a local variable declaration's initializer)
if(local.declaration.initialization.sourceEnd > 0) {
if (this.assistNode.sourceEnd <= local.declaration.initialization.sourceEnd
@@ -929,7 +929,7 @@ public class InternalExtendedCompletionContext {
char[][] expectedTypekeys= this.completionContext.getExpectedTypesKeys();
if (expectedTypekeys == null || expectedTypekeys.length == 0)
return true;
- // Next, find out whether any of the constructor parameters are the same as one of the
+ // Next, find out whether any of the constructor parameters are the same as one of the
// class type variables. If yes, diamond cannot be used.
TypeReference ref;
if (cn.length == 1) {
@@ -967,14 +967,14 @@ public class InternalExtendedCompletionContext {
}
return false;
}
-
+
/**
* @see InternalCompletionContext#getCompletionNode()
*/
public ASTNode getCompletionNode() {
return this.assistNode;
}
-
+
/**
* @see InternalCompletionContext#getCompletionNodeParent()
*/
@@ -982,21 +982,21 @@ public class InternalExtendedCompletionContext {
// TODO Auto-generated method stub
return this.assistNodeParent;
}
-
+
public ObjectVector getVisibleLocalVariables() {
if (!this.hasComputedVisibleElementBindings) {
computeVisibleElementBindings();
}
return this.visibleLocalVariables;
}
-
+
public ObjectVector getVisibleFields() {
if (!this.hasComputedVisibleElementBindings) {
computeVisibleElementBindings();
}
return this.visibleFields;
}
-
+
public ObjectVector getVisibleMethods() {
if (!this.hasComputedVisibleElementBindings) {
computeVisibleElementBindings();
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/RelevanceConstants.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/RelevanceConstants.java
index 383acb765..6e43a84a2 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/RelevanceConstants.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/RelevanceConstants.java
@@ -15,14 +15,14 @@ package org.eclipse.jdt.internal.codeassist;
public interface RelevanceConstants {
-
+
/*
* Important: The following rules must be strictly adhered to while declaring new relevance constants or modifying the existing:
* 1. One or more relevance constants are used in combination to form a relevance.
* 2. A particular relevance constant can be added only once to form a relevance.
* 3. A resultant relevance (after combining all the applicable relevance constants) must be a positive number.
* 4. The value of R_DEFAULT is maintained at a positive value such that the sum of all the negative relevance constants
- * and R_DEFAULT must not be negative.
+ * and R_DEFAULT must not be negative.
*/
int R_DEFAULT = 30;
int R_INTERESTING = 5;
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java
index b707c7bd1..d2f9ac944 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java
@@ -12,7 +12,7 @@
* IBM Corporation - initial API and implementation
* Fraunhofer FIRST - extended API and implementation
* Technical University Berlin - extended 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.internal.codeassist;
@@ -154,16 +154,16 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.statemachine.transfor
*/
@SuppressWarnings({"rawtypes", "unchecked"})
public final class SelectionEngine extends Engine implements ISearchRequestor {
-
+
private static class SelectionTypeNameMatchRequestorWrapper extends TypeNameMatchRequestorWrapper {
-
+
class AcceptedType {
public int modifiers;
public char[] packageName;
public char[] simpleTypeName;
public String path;
public AccessRestriction access;
-
+
public AcceptedType(int modifiers, char[] packageName, char[] simpleTypeName, String path, AccessRestriction access) {
this.modifiers = modifiers;
this.packageName = packageName;
@@ -172,63 +172,63 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
this.access = access;
}
}
-
+
private ImportReference[] importReferences;
-
+
private boolean importCachesNodeInitialized = false;
private ImportReference[] onDemandImportsNodeCache;
private int onDemandImportsNodeCacheCount;
private char[][][] importsNodeCache;
private int importsNodeCacheCount;
-
+
private HashtableOfObject onDemandFound = new HashtableOfObject();
private ObjectVector notImportedFound = new ObjectVector();
-
+
public SelectionTypeNameMatchRequestorWrapper(TypeNameMatchRequestor requestor, IJavaSearchScope scope, ImportReference[] importReferences) {
super(requestor, scope);
this.importReferences = importReferences;
}
-
+
@Override
public void acceptType(int modifiers, char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, String path, AccessRestriction access) {
if (enclosingTypeNames != null && enclosingTypeNames.length > 0) return;
-
+
if (!this.importCachesNodeInitialized) initializeImportNodeCaches();
-
+
char[] fullyQualifiedTypeName = CharOperation.concat(packageName, simpleTypeName, '.');
-
+
for (int i = 0; i < this.importsNodeCacheCount; i++) {
char[][] importName = this.importsNodeCache[i];
if (CharOperation.equals(importName[0], simpleTypeName)) {
-
+
if(CharOperation.equals(importName[1], fullyQualifiedTypeName)) {
super.acceptType(modifiers, packageName, simpleTypeName, enclosingTypeNames, path, access);
}
return;
}
}
-
+
for (int i = 0; i < this.onDemandImportsNodeCacheCount; i++) {
char[][] importName = this.onDemandImportsNodeCache[i].tokens;
char[] importFlatName = CharOperation.concatWith(importName, '.');
-
+
if (CharOperation.equals(importFlatName, packageName)) {
-
+
this.onDemandFound.put(simpleTypeName, simpleTypeName);
super.acceptType(modifiers, packageName, simpleTypeName, enclosingTypeNames, path, access);
return;
}
}
-
-
+
+
this.notImportedFound.add(new AcceptedType(modifiers, packageName, simpleTypeName, path, access));
}
-
+
public void acceptNotImported() {
int size = this.notImportedFound.size();
for (int i = 0; i < size; i++) {
AcceptedType acceptedType = (AcceptedType)this.notImportedFound.elementAt(i);
-
+
if (this.onDemandFound.get(acceptedType.simpleTypeName) == null) {
super.acceptType(
acceptedType.modifiers,
@@ -240,10 +240,10 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
}
}
}
-
+
public void initializeImportNodeCaches() {
int length = this.importReferences == null ? 0 : this.importReferences.length;
-
+
for (int i = 0; i < length; i++) {
ImportReference importReference = this.importReferences[i];
if((importReference.bits & ASTNode.OnDemand) != 0) {
@@ -256,15 +256,15 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
if(this.importsNodeCache == null) {
this.importsNodeCache = new char[length - i][][];
}
-
-
+
+
this.importsNodeCache[this.importsNodeCacheCount++] = new char[][]{
importReference.tokens[importReference.tokens.length - 1],
CharOperation.concatWith(importReference.tokens, '.')
};
}
}
-
+
this.importCachesNodeInitialized = true;
}
}
@@ -376,7 +376,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
this.parser = new SelectionParser(problemReporter);
this.owner = owner;
}
-
+
@Override
public void acceptConstructor(
int modifiers,
@@ -600,7 +600,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
scanner.setOTFlags(this.compilerOptions);
// SH}
scanner.setSource(source);
-
+
int lastIdentifierStart = -1;
int lastIdentifierEnd = -1;
char[] lastIdentifier = null;
@@ -720,7 +720,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
if (selectionStart == selectionEnd) { // Widen the selection to scan -> || :: if needed. No unicode handling for now.
if (selectionStart > 0 && selectionEnd < source.length - 1) {
if ((source[selectionStart] == '>' && source[selectionStart - 1] == '-') ||
- source[selectionStart] == ':' && source[selectionStart - 1] == ':') {
+ source[selectionStart] == ':' && source[selectionStart - 1] == ':') {
selectionStart--;
} else {
if ((source[selectionStart] == '-' && source[selectionEnd + 1] == '>') ||
@@ -728,7 +728,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
selectionEnd++;
}
}
- }
+ }
} // there could be some innocuous widening, shouldn't matter.
scanner.resetTo(selectionStart, selectionEnd, isModuleInfo);
@@ -759,12 +759,12 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
}
expectingIdentifier = false;
break;
- case TerminalTokens.TokenNameCOLON_COLON:
+ case TerminalTokens.TokenNameCOLON_COLON:
if (selectionStart >= scanner.startPosition && selectionEnd < scanner.currentPosition) {
this.actualSelectionStart = selectionStart;
this.actualSelectionEnd = selectionEnd;
this.selectedIdentifier = CharOperation.NO_CHAR;
- return true;
+ return true;
}
//$FALL-THROUGH$
case TerminalTokens.TokenNameDOT :
@@ -789,7 +789,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
this.actualSelectionStart = selectionStart;
this.actualSelectionEnd = selectionEnd;
this.selectedIdentifier = CharOperation.NO_CHAR;
- return true;
+ return true;
}
return false;
default :
@@ -875,7 +875,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
return false;
}
-
+
/*
* find all types outside the project scope
*/
@@ -916,7 +916,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
// implements interface method
}
};
-
+
TypeNameMatchRequestor typeNameMatchRequestor = new TypeNameMatchRequestor() {
@Override
public void acceptTypeNameMatch(TypeNameMatch match) {
@@ -926,17 +926,17 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
}
}
};
-
+
IJavaSearchScope scope = BasicSearchEngine.createWorkspaceScope();
-
+
SelectionTypeNameMatchRequestorWrapper requestorWrapper =
new SelectionTypeNameMatchRequestorWrapper(
- typeNameMatchRequestor,
+ typeNameMatchRequestor,
scope,
this.unitScope == null ? null : this.unitScope.referenceContext.imports);
-
+
org.eclipse.jdt.core.ICompilationUnit[] workingCopies = this.owner == null ? null : JavaModelManager.getJavaModelManager().getWorkingCopies(this.owner, true/*add primary WCs*/);
-
+
try {
new BasicSearchEngine(workingCopies).searchAllTypeNames(
null,
@@ -1201,7 +1201,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
// accept qualified types only if no unqualified type was accepted
if(!this.acceptedAnswer) {
acceptQualifiedTypes();
-
+
// accept types from all the workspace only if no type was found in the project scope
if (this.noProposal) {
findAllTypes(this.selectedIdentifier);
@@ -1646,7 +1646,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
public boolean visit(
LocalDeclaration localDeclaration, BlockScope scope) {
if(localDeclaration instanceof SelectionOnLocalName) {
- localDeclaration.resolve(scope);
+ localDeclaration.resolve(scope);
}
if (localDeclaration.type instanceof SingleTypeReference && ((SingleTypeReference)localDeclaration.type).token == assistIdentifier) {
if(localDeclaration.binding != null) {
@@ -1788,7 +1788,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
}
// find the type declaration that corresponds to the original source type
while (context.isLambda() && context.getParent() != null) {
- // It is easier to find the first enclosing proper type than the corresponding
+ // It is easier to find the first enclosing proper type than the corresponding
// lambda expression ast to add the selection node to.
context = (IType) context.getParent().getAncestor(IJavaElement.TYPE);
}
@@ -1820,7 +1820,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
CompilationResult result = new CompilationResult(reader.getFileName(), 1, 1, this.compilerOptions.maxProblemsPerUnit);
parsedUnit = new CompilationUnitDeclaration(this.parser.problemReporter(), result, 0);
HashSetOfCharArrayArray typeNames = new HashSetOfCharArrayArray();
-
+
BinaryTypeConverter converter = new BinaryTypeConverter(this.parser.problemReporter(), result, typeNames);
typeDeclaration = converter.buildTypeDeclaration(context, parsedUnit);
parsedUnit.imports = converter.buildImports(reader);
@@ -2105,7 +2105,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
return false;
}
-
+
/*
* Returns the correct method binding according to whether the selection is on the method declaration
* or on the inheritDoc tag in its javadoc.
@@ -2140,7 +2140,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
// SH}
return binding;
}
-
+
protected MethodBinding findOverriddenMethodInType(ReferenceBinding overriddenType, MethodBinding overriding) throws JavaModelException {
if (overriddenType == null)
return null;
@@ -2155,7 +2155,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
}
return null;
}
-
+
private Object findMethodWithAttachedDocInHierarchy(final MethodBinding method) throws JavaModelException {
ReferenceBinding type= method.declaringClass;
final SelectionRequestor requestor1 = (SelectionRequestor) this.requestor;
@@ -2173,7 +2173,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
IMember member = (IMember) requestor1.findMethodFromBinding(overridden, names, overridden.declaringClass);
if (member == null)
return InheritDocVisitor.CONTINUE;
- if (member.getAttachedJavadoc(null) != null ) {
+ if (member.getAttachedJavadoc(null) != null ) {
// for binary methods with attached javadoc and no source attached
return overridden;
}
@@ -2197,7 +2197,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
}
}.visitInheritDoc(type);
}
-
+
/**
* Implements the "Algorithm for Inheriting Method Comments" as specified for
* <a href="http://download.oracle.com/javase/6/docs/technotes/tools/windows/javadoc.html#inheritingcomments">1.6</a>.
@@ -2277,7 +2277,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
/**
* Visits the super interfaces of the given type in the given hierarchy, thereby skipping already visited types.
- *
+ *
* @param visited set of visited types
* @param currentType type whose super interfaces should be visited
* @return the result, or {@link #CONTINUE} if no result has been found
@@ -2313,6 +2313,6 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
@Override
public void acceptModule(char[] moduleName) {
// TODO Auto-generated method stub
-
+
}
}
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/ThrownExceptionFinder.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/ThrownExceptionFinder.java
index 5847fba02..6ccf8bcb7 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/ThrownExceptionFinder.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/ThrownExceptionFinder.java
@@ -44,7 +44,7 @@ public class ThrownExceptionFinder extends ASTVisitor {
* Finds the thrown exceptions minus the ones that are already caught in previous catch blocks.
* Exception is already caught even if its super type is being caught. Also computes, separately,
* a list comprising of (a)those exceptions that have been caught already and (b)those exceptions that are thrown
- * by the method and whose super type has been caught already.
+ * by the method and whose super type has been caught already.
* @param tryStatement
* @param scope
*/
@@ -107,10 +107,10 @@ public class ThrownExceptionFinder extends ASTVisitor {
this.caughtExceptions.asArray(allCaughtExceptions);
return allCaughtExceptions;
}
-
+
/**
* Returns all the thrown exceptions minus the ones that are already caught in previous catch blocks
- * (of the same try), found by the call to
+ * (of the same try), found by the call to
* {@link ThrownExceptionFinder#processThrownExceptions(TryStatement, BlockScope)}.
* @return Returns an array of thrown exceptions that are still not caught in any catch block.
*/
@@ -119,9 +119,9 @@ public class ThrownExceptionFinder extends ASTVisitor {
this.thrownExceptions.asArray(result);
return result;
}
-
+
/**
- * Returns all exceptions that are discouraged to use because (a) they are already caught in some inner try-catch,
+ * Returns all exceptions that are discouraged to use because (a) they are already caught in some inner try-catch,
* or (b) their super exception has already been caught.
* @return all discouraged exceptions
*/
@@ -174,7 +174,7 @@ public class ThrownExceptionFinder extends ASTVisitor {
}
return false;
}
-
+
private void removeCaughtExceptions(TryStatement tryStatement, boolean recordUncheckedCaughtExceptions) {
Argument[] catchArguments = tryStatement.catchArguments;
int length = catchArguments == null ? 0 : catchArguments.length;
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionNodeDetector.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionNodeDetector.java
index 7b839bf19..a8f214a30 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionNodeDetector.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionNodeDetector.java
@@ -171,7 +171,7 @@ public class CompletionNodeDetector extends ASTVisitor {
}
@Override
public void endVisit(ReferenceExpression referenceExpression, BlockScope blockScope) {
- endVisit(referenceExpression);
+ endVisit(referenceExpression);
}
@Override
public void endVisit(SingleNameReference singleNameReference, BlockScope scope) {
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnExportReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnExportReference.java
index eb3e281b5..584a251ed 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnExportReference.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnExportReference.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.codeassist.complete;
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocTag.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocTag.java
index 1f0683955..7b1f581f4 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocTag.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocTag.java
@@ -87,7 +87,7 @@ public class CompletionOnJavadocTag extends JavadocSingleNameReference implement
switch (kind) {
case Scope.COMPILATION_UNIT_SCOPE:
// bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=255752
- // Check for FAKE_TYPE_NAME to allow proposals (@see CompletionParser#consumeCompilationUnit)
+ // Check for FAKE_TYPE_NAME to allow proposals (@see CompletionParser#consumeCompilationUnit)
CompilationUnitDeclaration compilationUnit = scope.referenceCompilationUnit();
if(compilationUnit != null && compilationUnit.isModuleInfo() ) {
specifiedTags = MODULE_TAGS;
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeywordModuleDeclaration.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeywordModuleDeclaration.java
index 9c867b6d9..95720be70 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeywordModuleDeclaration.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeywordModuleDeclaration.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.codeassist.complete;
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeywordModuleInfo.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeywordModuleInfo.java
index ddb343acf..340bce639 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeywordModuleInfo.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeywordModuleInfo.java
@@ -18,7 +18,7 @@ import org.eclipse.jdt.internal.compiler.ast.ExportsStatement;
import org.eclipse.jdt.internal.compiler.ast.ImportReference;
/**
- *
+ *
* This class is independent of its parent class and is in fact a dummy ExportsStatement. Used to hook
* into the existing module declaration type and is used as a placeholder for keyword completion. This can
* be any module keyword completion and not necessarily related to exports statement.
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSendName.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSendName.java
index 2c048f196..e70ec61f8 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSendName.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSendName.java
@@ -31,7 +31,7 @@ public class CompletionOnMessageSendName extends MessageSend {
public TypeBinding resolveType(BlockScope scope) {
this.constant = Constant.NotAConstant;
-
+
if (this.receiver.isImplicitThis())
throw new CompletionNodeFound();
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnModuleDeclaration.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnModuleDeclaration.java
index 548ede61f..b17708e18 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnModuleDeclaration.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnModuleDeclaration.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.codeassist.complete;
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnModuleReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnModuleReference.java
index e45032c97..3d88012cf 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnModuleReference.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnModuleReference.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.codeassist.complete;
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesImplementationsQualifiedTypeReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesImplementationsQualifiedTypeReference.java
index 87b59d076..0900daba5 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesImplementationsQualifiedTypeReference.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesImplementationsQualifiedTypeReference.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.codeassist.complete;
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesImplementationsSingleTypeReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesImplementationsSingleTypeReference.java
index bdbe254b1..6b295cd15 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesImplementationsSingleTypeReference.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesImplementationsSingleTypeReference.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.codeassist.complete;
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesInterfacesQualifiedTypeReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesInterfacesQualifiedTypeReference.java
index 9007ee1e4..eb06589c2 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesInterfacesQualifiedTypeReference.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesInterfacesQualifiedTypeReference.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.codeassist.complete;
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesInterfacesSingleTypeReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesInterfacesSingleTypeReference.java
index b89e8e8b7..d30284e8e 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesInterfacesSingleTypeReference.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesInterfacesSingleTypeReference.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.codeassist.complete;
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedTypeReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedTypeReference.java
index a6ca50766..c69faafc8 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedTypeReference.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedTypeReference.java
@@ -38,9 +38,9 @@ public class CompletionOnQualifiedTypeReference extends QualifiedTypeReference {
private int kind = K_TYPE;
public char[] completionIdentifier;
-
+
public boolean isConstructorType;
-
+
public CompletionOnQualifiedTypeReference(char[][] previousIdentifiers, char[] completionIdentifier, long[] positions) {
this(previousIdentifiers, completionIdentifier, positions, K_TYPE);
}
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnReferenceExpressionName.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnReferenceExpressionName.java
index 377c50105..e02edf669 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnReferenceExpressionName.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnReferenceExpressionName.java
@@ -24,14 +24,14 @@ import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
import org.eclipse.jdt.internal.compiler.parser.Scanner;
public class CompletionOnReferenceExpressionName extends ReferenceExpression {
-
+
public CompletionOnReferenceExpressionName(Scanner scanner) {
super(scanner);
}
@Override
public TypeBinding resolveType(BlockScope scope) {
-
+
final CompilerOptions compilerOptions = scope.compilerOptions();
TypeBinding lhsType;
boolean typeArgumentsHaveErrors;
@@ -54,7 +54,7 @@ public class CompletionOnReferenceExpressionName extends ReferenceExpression {
if (typeArgumentsHaveErrors || lhsType == null)
throw new CompletionNodeFound();
}
-
+
if (lhsType != null && lhsType.isValidBinding())
throw new CompletionNodeFound(this, lhsType, scope);
throw new CompletionNodeFound();
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnUsesQualifiedTypeReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnUsesQualifiedTypeReference.java
index 17ab3d3ca..cbc002e98 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnUsesQualifiedTypeReference.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnUsesQualifiedTypeReference.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/package org.eclipse.jdt.internal.codeassist.complete;
public class CompletionOnUsesQualifiedTypeReference extends CompletionOnQualifiedTypeReference {
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnUsesSingleTypeReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnUsesSingleTypeReference.java
index 11854055c..9745b0c42 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnUsesSingleTypeReference.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnUsesSingleTypeReference.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/package org.eclipse.jdt.internal.codeassist.complete;
public class CompletionOnUsesSingleTypeReference extends CompletionOnSingleTypeReference {
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java
index 2054122e1..fc72da16f 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java
@@ -213,7 +213,7 @@ public class CompletionParser extends AssistParser {
private IProgressMonitor monitor;
private int resumeOnSyntaxError = 0;
private boolean consumedEnhancedFor;
-
+
public CompletionParser(ProblemReporter problemReporter, boolean storeExtraSourceEnds) {
super(problemReporter);
this.reportSyntaxErrorIsRequired = false;
@@ -711,16 +711,16 @@ private static class SavedState {
this.parserCursorLocation = parserCursorLocation;
this.scannerCursorLocation = scannerCursorLocation;
this.assistNodeParent = assistNodeParent;
- }
+ }
}
@Override
public Object becomeSimpleParser() {
CompletionScanner completionScanner = (CompletionScanner)this.scanner;
SavedState parserState = new SavedState(this.cursorLocation, completionScanner.cursorLocation, this.assistNodeParent);
-
+
this.cursorLocation = Integer.MAX_VALUE;
completionScanner.cursorLocation = Integer.MAX_VALUE;
-
+
return parserState;
}
private void buildMoreAnnotationCompletionContext(MemberValuePair memberValuePair) {
@@ -1197,10 +1197,10 @@ private Statement buildMoreCompletionEnclosingContext(Statement statement) {
IfStatement ifStatement = null;
int index = -1;
/*
- * What happens here? When we have an "instanceof" after the last
- * K_CONTROL_STATEMENT_DELIMITER (which represents if or else-if), the former
+ * What happens here? When we have an "instanceof" after the last
+ * K_CONTROL_STATEMENT_DELIMITER (which represents if or else-if), the former
* is taken to be the current point. Otherwise, the standard rule applies: i.e.
- * pick the block if it comes after the K_CONTROL_STATEMENT_DELIMITER, otherwise pick the
+ * pick the block if it comes after the K_CONTROL_STATEMENT_DELIMITER, otherwise pick the
* K_BLOCK_DELIMITER.
*/
int blockIndex = lastIndexOfElement(K_BLOCK_DELIMITER);
@@ -1217,7 +1217,7 @@ private Statement buildMoreCompletionEnclosingContext(Statement statement) {
// Try to find an enclosing if statement even if one is not found immediately preceding the completion node.
if (index != -1 && this.elementInfoStack[index] == IF && this.elementObjectInfoStack[index] != null) {
Expression condition = (Expression)this.elementObjectInfoStack[index];
-
+
// If currentElement is a RecoveredLocalVariable then it can be contained in the if statement
if (this.currentElement instanceof RecoveredLocalVariable &&
this.currentElement.parent instanceof RecoveredBlock) {
@@ -1226,15 +1226,15 @@ private Statement buildMoreCompletionEnclosingContext(Statement statement) {
statement instanceof Expression && ((Expression) statement).isTrulyExpression() &&
condition.sourceStart < recoveredLocalVariable.localDeclaration.sourceStart) {
this.currentElement.add(statement, 0);
-
+
statement = recoveredLocalVariable.updatedStatement(0, new HashSet<TypeDeclaration>());
-
+
// RecoveredLocalVariable must be removed from its parent because the IfStatement will be added instead
RecoveredBlock recoveredBlock = (RecoveredBlock) recoveredLocalVariable.parent;
recoveredBlock.statements[--recoveredBlock.statementCount] = null;
-
+
this.currentElement = recoveredBlock;
-
+
}
}
if (statement instanceof AND_AND_Expression && this.assistNode instanceof Statement) {
@@ -1299,12 +1299,12 @@ private void buildMoreGenericsCompletionContext(ASTNode node, boolean consumeTyp
}
if(this.currentElement instanceof RecoveredType) {
this.currentElement = this.currentElement.add(new CompletionOnFieldType(ref, false), 0);
- } else {
-
+ } else {
+
if (prevKind == K_BETWEEN_NEW_AND_LEFT_BRACKET) {
-
+
AllocationExpression exp;
- if (this.expressionPtr > -1 && this.expressionStack[this.expressionPtr] instanceof AllocationExpression
+ if (this.expressionPtr > -1 && this.expressionStack[this.expressionPtr] instanceof AllocationExpression
&& this.invocationType == QUALIFIED_ALLOCATION) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=361963
exp = new QualifiedAllocationExpression();
exp.type = ref;
@@ -1607,7 +1607,7 @@ private boolean checkKeyword() {
&& (this.lastModifiers & ClassFileConstants.AccFinal) == 0) {
keywords[count++] = Keywords.FINAL;
}
-
+
//{ObjectTeams: consider team class
if (CharOperation.prefixEquals(this.identifierStack[ptr], Keywords.TEAM))
{
@@ -1618,7 +1618,7 @@ private boolean checkKeyword() {
if (this.options.complianceLevel >= ClassFileConstants.JDK1_5) {
keywords[count++] = Keywords.ENUM;
}
-
+
if((this.lastModifiers & ClassFileConstants.AccFinal) == 0) {
keywords[count++] = Keywords.INTERFACE;
}
@@ -1663,7 +1663,7 @@ private boolean checkModuleInfoConstructs() {
int index = -1;
if ((index = this.indexOfAssistIdentifier()) <= -1) return false;
-
+
if (this.currentElement instanceof RecoveredModule) {
RecoveredModule module = (RecoveredModule) this.currentElement;
if (checkModuleInfoKeyword(module, index)) return true;
@@ -1674,13 +1674,13 @@ private boolean checkModuleInfoConstructs() {
if (foundToken(K_AFTER_NAME_IN_PROVIDES_STATEMENT)) keyword = ModuleKeyword.PROVIDES_WITH;
}
if (keyword == ModuleKeyword.NOT_A_KEYWORD) return false;
-
+
int length = this.identifierLengthStack[this.identifierLengthPtr];
int ptr = this.identifierPtr - length + index + 1;
-
+
char[] ident = this.identifierStack[ptr];
- long pos = this.identifierPositionStack[ptr];
- char[][] keywords = getModuleKeywords(keyword);
+ long pos = this.identifierPositionStack[ptr];
+ char[][] keywords = getModuleKeywords(keyword);
if (this.currentElement instanceof RecoveredPackageVisibilityStatement) {
RecoveredPackageVisibilityStatement rPvs = (RecoveredPackageVisibilityStatement) this.currentElement;
rPvs.add(new CompletionOnKeywordModule2(ident, pos, keywords), 0);
@@ -1690,7 +1690,7 @@ private boolean checkModuleInfoConstructs() {
rPs.add(new CompletionOnKeyword1(ident, pos, keywords), 0);
return true;
}
- }
+ }
return false;
}
private boolean checkModuleInfoKeyword(RecoveredModule module, int index) {
@@ -2806,7 +2806,7 @@ protected void consumeClassHeaderImplements() {
for (int i = 0; i < length; i++) {
if (superInterfaces[i] == this.assistNode) {
this.assistNodeParent = typeDecl;
- }
+ }
}
}
}
@@ -2936,9 +2936,9 @@ protected void consumeDimWithOrWithOutExpr() {
@Override
protected void consumeEmptyStatement() {
super.consumeEmptyStatement();
- /* Sneak in the assist node. The reason we can't do that when we see the assist node is that
+ /* Sneak in the assist node. The reason we can't do that when we see the assist node is that
we don't know whether it is the first or subsequent statement in a block to be able to
- decide whether to call contactNodeLists. See Parser.consumeBlockStatement(s)
+ decide whether to call contactNodeLists. See Parser.consumeBlockStatement(s)
*/
if (this.shouldStackAssistNode && this.assistNode != null)
this.astStack[this.astPtr] = this.assistNodeParent instanceof MessageSend ? this.assistNodeParent : this.assistNode;
@@ -3228,10 +3228,10 @@ protected void consumeForceNoDiet() {
}
@Override
protected void consumeFormalParameter(boolean isVarArgs) {
-
+
this.invocationType = NO_RECEIVER;
this.qualifier = -1;
-
+
if (this.indexOfAssistIdentifier() < 0) {
super.consumeFormalParameter(isVarArgs);
if (this.pendingAnnotation != null) {
@@ -3261,14 +3261,14 @@ protected void consumeFormalParameter(boolean isVarArgs) {
varArgsAnnotations = new Annotation[length],
0,
length);
- }
+ }
}
int firstDimensions = this.intStack[this.intPtr--];
TypeReference type = getTypeReference(firstDimensions);
-
+
if (isVarArgs || extendedDimensions != 0) {
if (isVarArgs) {
- type = augmentTypeWithAdditionalDimensions(type, 1, varArgsAnnotations != null ? new Annotation[][] { varArgsAnnotations } : null, true);
+ type = augmentTypeWithAdditionalDimensions(type, 1, varArgsAnnotations != null ? new Annotation[][] { varArgsAnnotations } : null, true);
}
if (extendedDimensions != 0) { // combination illegal.
type = augmentTypeWithAdditionalDimensions(type, extendedDimensions, annotationsOnExtendedDimensions, false);
@@ -3318,7 +3318,7 @@ protected void consumeGenericTypeWithDiamond() {
super.consumeGenericTypeWithDiamond();
// we need to pop the <> of the diamond from the stack.
// This is not required in usual case when the type argument isn't elided
- // since the < and > get popped while parsing the type argument.
+ // since the < and > get popped while parsing the type argument.
popElement(K_BINARY_OPERATOR); // pop >
popElement(K_BINARY_OPERATOR); // pop <
}
@@ -3355,7 +3355,7 @@ protected void consumeInsideCastExpression() {
this.genericsPtr -= additionalBoundsLength;
System.arraycopy(this.genericsStack, this.genericsPtr + 1, bounds, 1, additionalBoundsLength);
}
-
+
int end = this.intStack[this.intPtr--];
boolean isParameterized =(topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_PARAMETERIZED_CAST);
if(isParameterized) {
@@ -3373,7 +3373,7 @@ protected void consumeInsideCastExpression() {
Expression castType = getTypeReference(this.intStack[this.intPtr--]);
if (additionalBoundsLength > 0) {
bounds[0] = (TypeReference) castType;
- castType = createIntersectionCastTypeReference(bounds);
+ castType = createIntersectionCastTypeReference(bounds);
}
if(isParameterized) {
this.intPtr--;
@@ -3444,7 +3444,7 @@ protected void consumeInsideCastExpressionWithQualifiedGenerics() {
int dim = this.intStack[this.intPtr--];
Annotation[][] annotationsOnDimensions = dim == 0 ? null : getAnnotationsOnDimensions(dim);
-
+
TypeReference[] bounds = null;
int additionalBoundsLength = this.genericsLengthStack[this.genericsLengthPtr--];
if (additionalBoundsLength > 0) {
@@ -3452,14 +3452,14 @@ protected void consumeInsideCastExpressionWithQualifiedGenerics() {
this.genericsPtr -= additionalBoundsLength;
System.arraycopy(this.genericsStack, this.genericsPtr + 1, bounds, 1, additionalBoundsLength);
}
-
+
TypeReference rightSide = getTypeReference(0);
castType = computeQualifiedGenericsFromRightSide(rightSide, dim, annotationsOnDimensions);
if (additionalBoundsLength > 0) {
bounds[0] = (TypeReference) castType;
- castType = createIntersectionCastTypeReference(bounds);
- }
+ castType = createIntersectionCastTypeReference(bounds);
+ }
this.intPtr--;
castType.sourceEnd = end - 1;
castType.sourceStart = this.intStack[this.intPtr--] + 1;
@@ -4227,7 +4227,7 @@ protected void consumeToken(int token) {
int prevIdentifierPtr = this.previousIdentifierPtr;
isInsideEnhancedForLoopWithoutBlock(token);
-
+
if (isInsideMethod() || isInsideFieldInitialization() || isInsideAnnotation() || isInsideEnumConstantnitialization()) {
switch(token) {
case TokenNameLPAREN:
@@ -4346,7 +4346,7 @@ protected void consumeToken(int token) {
pushOnElementStack(K_YIELD_KEYWORD);
// Take the short cut here.
// Instead of injecting the TokenNameRestrictedIdentifierYield, totally ignore it
- // and let completion take it course. We will not be constructing the
+ // and let completion take it course. We will not be constructing the
// YieldStatement and thus not producing accurate completion, but completion doesn't have
// enough information anyway about the LHS anyway.
token = this.currentToken = this.getNextToken();
@@ -4854,7 +4854,7 @@ private void isInsideEnhancedForLoopWithoutBlock(int token) {
consumeOpenFakeBlock();
}
this.consumedEnhancedFor = false;
-
+
}
@Override
protected void consumeInvocationExpression() { // on error, a message send's error reductions will take the expression path rather than the statement path since that is a dead end.
@@ -5673,9 +5673,9 @@ public void initialize(boolean parsingCompilationUnit) {
public void copyState(Parser from) {
super.copyState(from);
-
+
CompletionParser parser = (CompletionParser) from;
-
+
this.invocationType = parser.invocationType;
this.qualifier = parser.qualifier;
this.inReferenceExpression = parser.inReferenceExpression;
@@ -5977,12 +5977,12 @@ public void recoveryExitFromVariable() {
// To make sure the array initializer is popped when the focus is shifted to the parent
// in case we're restarting recovery inside an array initializer
RecoveredElement oldElement = this.currentElement;
- super.recoveryExitFromVariable();
- if(oldElement != this.currentElement) {
- if(topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_ARRAY_INITIALIZER) {
- popElement(K_ARRAY_INITIALIZER);
- popElement(K_FIELD_INITIALIZER_DELIMITER);
- }
+ super.recoveryExitFromVariable();
+ if(oldElement != this.currentElement) {
+ if(topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_ARRAY_INITIALIZER) {
+ popElement(K_ARRAY_INITIALIZER);
+ popElement(K_FIELD_INITIALIZER_DELIMITER);
+ }
}
} else {
super.recoveryExitFromVariable();
@@ -6069,11 +6069,11 @@ public void resetAfterCompletion() {
flushAssistState();
}
@Override
-public void restoreAssistParser(Object parserState) {
+public void restoreAssistParser(Object parserState) {
SavedState state = (SavedState) parserState;
-
+
CompletionScanner completionScanner = (CompletionScanner)this.scanner;
-
+
this.cursorLocation = state.parserCursorLocation;
completionScanner.cursorLocation = state.scannerCursorLocation;
this.assistNodeParent = state.assistNodeParent;
@@ -6083,7 +6083,7 @@ protected int resumeOnSyntaxError() {
if (this.monitor != null) {
if (++this.resumeOnSyntaxError > 100) {
this.resumeOnSyntaxError = 0;
- if (this.monitor.isCanceled())
+ if (this.monitor.isCanceled())
return HALT;
}
}
@@ -6100,14 +6100,14 @@ protected int resumeOnSyntaxError() {
protected int resumeAfterRecovery() {
this.hasUnusedModifiers = false;
if (this.assistNode != null) {
-
+
if (requireExtendedRecovery()) {
if (this.unstackedAct != ERROR_ACTION) {
return RESUME;
}
return super.resumeAfterRecovery();
}
-
+
/* if reached [eof] inside method body, but still inside nested type,
or inside a field initializer, should continue in diet mode until
the end of the method body or compilation unit */
@@ -6206,7 +6206,7 @@ protected void updateRecoveryState() {
parser = createSnapShotParser();
parser.copyState(this);
}
-
+
/* may be able to retrieve completionNode as an orphan, and then attach it */
completionIdentifierCheck();
attachOrphanCompletionNode();
@@ -6279,7 +6279,7 @@ protected boolean isInsideArrayInitializer(){
if (i > -1 && this.elementKindStack[i] == K_ARRAY_INITIALIZER) {
return true;
}
- return false;
+ return false;
}
private boolean foundToken(int token) {
int i = this.elementPtr;
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java
index b54ed99c8..d45e8e084 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java
@@ -806,7 +806,7 @@ protected int getNextToken0() throws InvalidInputException {
pushLineSeparator();
}
}
- }
+ }
switch (this.currentCharacter) {
case '*':
star = true;
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java
index 5d069a09e..02cf7cd2a 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java
@@ -86,7 +86,7 @@ public abstract class AssistParser extends Parser {
// the index in the identifier stack of the previous identifier
protected int previousIdentifierPtr;
-
+
// depth of '(', '{' and '[]'
protected int bracketDepth;
@@ -151,26 +151,26 @@ public abstract char[] assistIdentifier();
@Override
public void copyState(Parser from) {
-
+
super.copyState(from);
AssistParser parser = (AssistParser) from;
-
+
this.previousToken = parser.previousToken;
this.previousIdentifierPtr = parser.previousIdentifierPtr;
-
+
this.lastModifiers = parser.lastModifiers;
this.lastModifiersStart = parser.lastModifiersStart;
-
+
this.bracketDepth = parser.bracketDepth;
this.elementPtr = parser.elementPtr;
-
+
int length;
System.arraycopy(parser.blockStarts, 0, this.blockStarts = new int [length = parser.blockStarts.length], 0, length);
System.arraycopy(parser.elementKindStack, 0, this.elementKindStack = new int [length = parser.elementKindStack.length], 0, length);
System.arraycopy(parser.elementInfoStack, 0, this.elementInfoStack = new int [length = parser.elementInfoStack.length], 0, length);
System.arraycopy(parser.elementObjectInfoStack, 0, this.elementObjectInfoStack = new Object [length = parser.elementObjectInfoStack.length], 0, length);
-
+
this.previousKind = parser.previousKind;
this.previousInfo = parser.previousInfo;
this.previousObjectInfo = parser.previousObjectInfo;
@@ -280,7 +280,7 @@ public RecoveredElement buildInitialRecoveryState(){
}
blockIndex = j+1; // shift the index to the new block
}
-
+
if (node instanceof LocalDeclaration){
LocalDeclaration local = (LocalDeclaration) node;
if (local.declarationSourceEnd == 0){
@@ -372,7 +372,7 @@ public RecoveredElement buildInitialRecoveryState(){
if (this.currentToken == TokenNameRBRACE) {
if (isIndirectlyInsideLambdaExpression())
this.ignoreNextClosingBrace = true;
- else
+ else
this.currentToken = 0; // closing brace has already been taken care of
}
@@ -408,7 +408,7 @@ private void initModuleInfo(RecoveredElement element) {
int i = 0;
for (; i <= this.astPtr; i++) {
if ((node = this.astStack[i]) instanceof ModuleDeclaration) {
- unit.add((ModuleDeclaration) node, this.bracketDepth);
+ unit.add((ModuleDeclaration) node, this.bracketDepth);
break;
}
}
@@ -552,7 +552,7 @@ protected boolean triggerRecoveryUponLambdaClosure(Statement statement, boolean
See also that this concern does not arise in the case of field/local initialization since the initializer is replaced with full tree by consumeExitVariableWithInitialization.
*/
/*
- * All the above comments will not work if the assist node is buried deeper. This happens when there the
+ * All the above comments will not work if the assist node is buried deeper. This happens when there the
* lambda was part of a complex statement, such as it was one of the arguments to a method invocation. In which case,
* we start from the topmost recovery element and look for assist nodes. If the operation is successful, the method
* replaceAssistStatement() returns null. Else, it returns the original statement, thus falling back to replacing the
@@ -560,10 +560,10 @@ protected boolean triggerRecoveryUponLambdaClosure(Statement statement, boolean
*/
statement = replaceAssistStatement(this.currentElement.topElement(),
this.assistNodeParent(), statementStart, statementEnd, statement);
-
+
if (statement != null) {
- RecoveredBlock recoveredBlock = (RecoveredBlock) (this.currentElement instanceof RecoveredBlock ? this.currentElement :
- (this.currentElement.parent instanceof RecoveredBlock) ? this.currentElement.parent :
+ RecoveredBlock recoveredBlock = (RecoveredBlock) (this.currentElement instanceof RecoveredBlock ? this.currentElement :
+ (this.currentElement.parent instanceof RecoveredBlock) ? this.currentElement.parent :
this.currentElement instanceof RecoveredMethod ? ((RecoveredMethod) this.currentElement).methodBody : null);
if (recoveredBlock != null) {
RecoveredStatement recoveredStatement = recoveredBlock.statementCount > 0 ? recoveredBlock.statements[recoveredBlock.statementCount - 1] : null;
@@ -576,7 +576,7 @@ protected boolean triggerRecoveryUponLambdaClosure(Statement statement, boolean
((Expression) statement).isTrulyExpression()) {
RecoveredLocalVariable local = (RecoveredLocalVariable) recoveredStatement;
if (local.localDeclaration != null && local.localDeclaration.initialization != null) {
- if ((local.localDeclaration.initialization.sourceStart == 0 || local.localDeclaration.initialization.sourceEnd == 0) ||
+ if ((local.localDeclaration.initialization.sourceStart == 0 || local.localDeclaration.initialization.sourceEnd == 0) ||
(local.localDeclaration.initialization.sourceStart >= statementStart && local.localDeclaration.initialization.sourceEnd <= statementEnd) ){
local.localDeclaration.initialization = (Expression) statement;
local.localDeclaration.declarationSourceEnd = statement.sourceEnd;
@@ -875,7 +875,7 @@ protected void consumeOpenBlock() {
stackLength);
}
this.stack[this.stateStackTop++] = this.unstackedAct; // transition to Block ::= OpenBlock .LBRACE BlockStatementsopt RBRACE
- this.stack[this.stateStackTop] = tAction(this.unstackedAct, this.currentToken); // transition to Block ::= OpenBlock LBRACE .BlockStatementsopt RBRACE
+ this.stack[this.stateStackTop] = tAction(this.unstackedAct, this.currentToken); // transition to Block ::= OpenBlock LBRACE .BlockStatementsopt RBRACE
commit(true);
this.stateStackTop -= 2;
}
@@ -1409,7 +1409,7 @@ protected void consumeToken(int token) {
}
break;
}
- } else if (isInsideModuleInfo()) {
+ } else if (isInsideModuleInfo()) {
adjustBracket(token);
} else {
switch (token) {
@@ -1519,7 +1519,7 @@ protected void flushElementStack() {
@Override
protected TypeReference getTypeReference(int dim) {
//{ObjectTeams: wrap to introduce 2nd parameter
- return getTypeReference(dim, false);
+ return getTypeReference(dim, false);
}
@Override
protected TypeReference getTypeReference(int dim, boolean liftingTypeAllowed) {
@@ -1529,7 +1529,7 @@ protected TypeReference getTypeReference(int dim, boolean liftingTypeAllowed) {
/* no need to take action if not inside completed identifiers */
if ((index = indexOfAssistIdentifier(true)) < 0) {
-/* orig:
+/* orig:
return super.getTypeReference(dim);
:giro */
return super.getTypeReference(dim, liftingTypeAllowed);
@@ -1694,7 +1694,7 @@ protected NameReference getUnspecifiedReferenceOptimized() {
}
consumeNonTypeUseName();
-
+
/* retrieve identifiers subset and whole positions, the completion node positions
should include the entire replaced source. */
int length = this.identifierLengthStack[this.identifierLengthPtr];
@@ -1918,7 +1918,7 @@ protected boolean isInsideFieldInitialization(){
switch (this.elementKindStack[i]) {
case K_TYPE_DELIMITER : return false;
case K_METHOD_DELIMITER : return false;
- case K_FIELD_INITIALIZER_DELIMITER :
+ case K_FIELD_INITIALIZER_DELIMITER :
return true;
}
i--;
@@ -1942,9 +1942,9 @@ protected boolean isInsideModuleInfo(){
int i = this.elementPtr;
while(i > -1) {
switch (this.elementKindStack[i]) {
- case K_TYPE_DELIMITER :
+ case K_TYPE_DELIMITER :
case K_METHOD_DELIMITER :
- case K_FIELD_INITIALIZER_DELIMITER :
+ case K_FIELD_INITIALIZER_DELIMITER :
return false;
case K_MODULE_INFO_DELIMITER:
return true;
@@ -2258,12 +2258,12 @@ public void parseBlockStatements(AbstractMethodMappingDeclaration mapping, Compi
}
// SH}
-// the name is a misnomer, we allow "pop"s not just at the TOS. Lambda wants to be sticky till fully reduced, however we do want other elements popped at the right point, so ...
+// the name is a misnomer, we allow "pop"s not just at the TOS. Lambda wants to be sticky till fully reduced, however we do want other elements popped at the right point, so ...
protected void popElement(int kind) {
-
+
if (this.elementPtr < 0)
return;
-
+
int stackPointer = this.elementPtr;
if (kind != K_LAMBDA_EXPRESSION_DELIMITER) {
@@ -2273,7 +2273,7 @@ protected void popElement(int kind) {
}
if (stackPointer < 0 || this.elementKindStack[stackPointer] != kind)
return;
-
+
this.previousKind = this.elementKindStack[stackPointer];
this.previousInfo = this.elementInfoStack[stackPointer];
this.previousObjectInfo = this.elementObjectInfoStack[stackPointer];
@@ -2488,7 +2488,7 @@ protected abstract AssistParser createSnapShotParser();
protected int fallBackToSpringForward(Statement unused) {
int nextToken;
int automatonState = automatonState();
-
+
// If triggered fake EOF at completion site, see if the real next token would have passed muster.
if (this.currentToken == TokenNameEOF) {
int extendedEnd = this.scanner.source.length;
@@ -2510,7 +2510,7 @@ protected int fallBackToSpringForward(Statement unused) {
nextToken = this.currentToken;
this.scanner.ungetToken(nextToken);
if (nextToken == TokenNameRBRACE)
- ignoreNextClosingBrace(); // having ungotten it, recoveryTokenCheck will see this again.
+ ignoreNextClosingBrace(); // having ungotten it, recoveryTokenCheck will see this again.
}
// OK, next token is no good to resume "in place", attempt some local repair. FIXME: need to make sure we don't get stuck keep reducing empty statements !!
for (int i = 0, length = RECOVERY_TOKENS.length; i < length; i++) {
@@ -2555,7 +2555,7 @@ protected int resumeAfterRecovery() {
return RESUME;
}
}
-
+
// reset internal stacks
this.astPtr = -1;
this.astLengthPtr = -1;
@@ -2563,19 +2563,19 @@ protected int resumeAfterRecovery() {
this.expressionLengthPtr = -1;
this.typeAnnotationLengthPtr = -1;
this.typeAnnotationPtr = -1;
-
+
this.identifierPtr = -1;
this.identifierLengthPtr = -1;
this.intPtr = -1;
-
-
+
+
this.dimensions = 0 ;
this.recoveredStaticInitializerStart = 0;
this.genericsIdentifiersLengthPtr = -1;
this.genericsLengthPtr = -1;
this.genericsPtr = -1;
-
+
this.valueLambdaNestDepth = -1;
this.modifiers = ClassFileConstants.AccDefault;
@@ -2691,7 +2691,7 @@ protected Object topKnownElementObjectInfo(int owner) {
protected ASTNode wrapWithExplicitConstructorCallIfNeeded(ASTNode ast) {
int selector;
if (ast != null && topKnownElementKind(ASSIST_PARSER) == K_SELECTOR && ast instanceof Expression &&
- ((Expression) ast).isTrulyExpression() &&
+ ((Expression) ast).isTrulyExpression() &&
(((selector = topKnownElementInfo(ASSIST_PARSER)) == THIS_CONSTRUCTOR) ||
(selector == SUPER_CONSTRUCTOR))) {
ExplicitConstructorCall call = new ExplicitConstructorCall(
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/Engine.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/Engine.java
index ff7fb8434..13f81de26 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/Engine.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/Engine.java
@@ -83,13 +83,13 @@ public abstract class Engine implements ITypeRequestor {
@Override
public void accept(ICompilationUnit sourceUnit, AccessRestriction accessRestriction) {
CompilationResult result = new CompilationResult(sourceUnit, 1, 1, this.compilerOptions.maxProblemsPerUnit);
-
+
AssistParser assistParser = getParser();
Object parserState = assistParser.becomeSimpleParser();
-
+
CompilationUnitDeclaration parsedUnit =
assistParser.dietParse(sourceUnit, result);
-
+
assistParser.restoreAssistParser(parserState);
this.lookupEnvironment.buildTypeBindings(parsedUnit, accessRestriction);
@@ -161,7 +161,7 @@ public abstract class Engine implements ITypeRequestor {
}
// SH}
}
-
+
//{ObjectTeams: with dependencies configured for fieldAndMethods:
@Override
public void accept(IModule module, LookupEnvironment environment) {
@@ -169,7 +169,7 @@ public abstract class Engine implements ITypeRequestor {
ITypeRequestor.super.accept(module, environment);
}
}
-// SH}
+// SH}
public abstract AssistParser getParser();
@@ -177,7 +177,7 @@ public abstract class Engine implements ITypeRequestor {
if (this.currentPackageName == null) {
initializePackageCache();
}
-
+
ImportBinding[] importBindings = this.unitScope.imports;
int length = importBindings == null ? 0 : importBindings.length;
@@ -205,7 +205,7 @@ public abstract class Engine implements ITypeRequestor {
this.importCachesInitialized = true;
}
-
+
public void initializePackageCache() {
if (this.unitScope.fPackage != null) {
this.currentPackageName = CharOperation.concatWith(this.unitScope.fPackage.compoundName, '.');
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionJavadocParser.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionJavadocParser.java
index d11db50a3..22226f361 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionJavadocParser.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionJavadocParser.java
@@ -204,7 +204,7 @@ public class SelectionJavadocParser extends JavadocParser {
((SelectionJavadoc) this.docComment).inheritDocSelected = true;
}
}
-
+
/*
* Sets a flag to denote that selection has taken place on an inheritDoc tag
*/
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnArgumentName.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnArgumentName.java
index 2aab501f2..5634b5b21 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnArgumentName.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnArgumentName.java
@@ -58,7 +58,7 @@ public class SelectionOnArgumentName extends Argument {
super.resolve(scope);
throw new SelectionNodeFound(this.binding);
}
-
+
@Override
public TypeBinding resolveForCatch(BlockScope scope) {
super.resolveForCatch(scope);
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnLambdaExpression.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnLambdaExpression.java
index f248f5891..833b0dac7 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnLambdaExpression.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnLambdaExpression.java
@@ -1,6 +1,6 @@
/*******************************************************************************
* Copyright (c) 2014, 2015 IBM Corporation and others.
- *
+ *
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnLocalName.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnLocalName.java
index ce48fe7ab..867db743f 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnLocalName.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnLocalName.java
@@ -33,7 +33,7 @@ public class SelectionOnLocalName extends LocalDeclaration{
if (isTypeNameVar(scope)) {
if ((this.bits & ASTNode.IsForeachElementVariable) != 0 && scope.blockStatement instanceof ForeachStatement) {
// small version extracted from ForeachStatement.resolve():
-
+
ForeachStatement stat = (ForeachStatement) scope.blockStatement;
TypeBinding collectionType = stat.collection == null ? null : stat.collection.resolveType((BlockScope) scope.parent);
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnModuleDeclaration.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnModuleDeclaration.java
index a67a3541c..1b9145057 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnModuleDeclaration.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnModuleDeclaration.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.codeassist.select;
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnModuleReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnModuleReference.java
index 44d51e351..6770d9906 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnModuleReference.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnModuleReference.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.codeassist.select;
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpression.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpression.java
index 2838a8f18..064cc138e 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpression.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpression.java
@@ -1,6 +1,6 @@
/*******************************************************************************
* Copyright (c) 2014, 2017 IBM Corporation and others.
- *
+ *
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -21,12 +21,12 @@ import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
import org.eclipse.jdt.internal.compiler.parser.Scanner;
public class SelectionOnReferenceExpression extends ReferenceExpression {
-
+
public SelectionOnReferenceExpression(ReferenceExpression referenceExpression, Scanner scanner) {
super(scanner);
initialize(referenceExpression.compilationResult, referenceExpression.lhs, referenceExpression.typeArguments, referenceExpression.selector, referenceExpression.sourceEnd);
}
-
+
@Override
public TypeBinding resolveType(BlockScope scope) {
TypeBinding resolveType = super.resolveType(scope);
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpressionName.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpressionName.java
index 22a5552f8..7e6832495 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpressionName.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpressionName.java
@@ -34,13 +34,13 @@ public class SelectionOnReferenceExpressionName extends ReferenceExpression {
super.printExpression(indent, output);
return output.append('>');
}
-
+
// See SelectionScanner#scanIdentifierOrKeyword
@Override
public boolean isConstructorReference() {
return CharOperation.equals(this.selector, "new".toCharArray()); //$NON-NLS-1$
}
-
+
// See SelectionScanner#scanIdentifierOrKeyword
@Override
public boolean isMethodReference() {
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java
index 6a6502b10..399265ab9 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java
@@ -12,7 +12,7 @@
* IBM Corporation - initial API and implementation
* Fraunhofer FIRST - extended API and implementation
* Technical University Berlin - extended 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.internal.codeassist.select;
@@ -566,7 +566,7 @@ protected void consumeEnterAnonymousClassBody(boolean qualified) {
0,
argumentLength);
}
-
+
if (qualified) {
this.expressionLengthPtr--;
alloc.enclosingInstance = this.expressionStack[this.expressionPtr--];
@@ -587,7 +587,7 @@ protected void consumeEnterAnonymousClassBody(boolean qualified) {
this.lastIgnoredToken = -1;
if (isIndirectlyInsideLambdaExpression())
this.ignoreNextOpeningBrace = true;
- else
+ else
this.currentToken = 0; // opening brace already taken into account.
this.hasReportedError = true;
}
@@ -600,7 +600,7 @@ protected void consumeEnterAnonymousClassBody(boolean qualified) {
this.currentElement = this.currentElement.add(anonymousType, 0);
if (isIndirectlyInsideLambdaExpression())
this.ignoreNextOpeningBrace = true;
- else
+ else
this.currentToken = 0; // opening brace already taken into account.
this.lastIgnoredToken = -1;
}
@@ -712,15 +712,15 @@ protected void consumeFormalParameter(boolean isVarArgs) {
varArgsAnnotations = new Annotation[length],
0,
length);
- }
+ }
}
int firstDimensions = this.intStack[this.intPtr--];
TypeReference type = getTypeReference(firstDimensions);
if (isVarArgs || extendedDimensions != 0) {
if (isVarArgs) {
- type = augmentTypeWithAdditionalDimensions(type, 1, varArgsAnnotations != null ? new Annotation[][] { varArgsAnnotations } : null, true);
- }
+ type = augmentTypeWithAdditionalDimensions(type, 1, varArgsAnnotations != null ? new Annotation[][] { varArgsAnnotations } : null, true);
+ }
if (extendedDimensions != 0) { // combination illegal.
type = augmentTypeWithAdditionalDimensions(type, extendedDimensions, annotationsOnExtendedDimensions, false);
}
@@ -1807,7 +1807,7 @@ protected Argument typeElidedArgument() {
char[] selector = this.identifierStack[this.identifierPtr];
if (selector != assistIdentifier()){
return super.typeElidedArgument();
- }
+ }
this.identifierLengthPtr--;
char[] identifierName = this.identifierStack[this.identifierPtr];
long namePositions = this.identifierPositionStack[this.identifierPtr--];
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/objectteams/otdt/internal/codeassist/SelectionOnCallinMapping.java b/org.eclipse.jdt.core/codeassist/org/eclipse/objectteams/otdt/internal/codeassist/SelectionOnCallinMapping.java
index ad24f0753..994077cd3 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/objectteams/otdt/internal/codeassist/SelectionOnCallinMapping.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/objectteams/otdt/internal/codeassist/SelectionOnCallinMapping.java
@@ -5,7 +5,7 @@
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* Copyright 2010 Stephan Herrmann
*
* This program and the accompanying materials
@@ -30,7 +30,7 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.ast.CallinMappingDecl
import org.eclipse.objectteams.otdt.internal.core.compiler.model.RoleModel;
/**
- *
+ *
* @author stephan
*/
public class SelectionOnCallinMapping extends CallinMappingDeclaration {
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/objectteams/otdt/internal/codeassist/select/SelectionOnBaseAllocationExpression.java b/org.eclipse.jdt.core/codeassist/org/eclipse/objectteams/otdt/internal/codeassist/select/SelectionOnBaseAllocationExpression.java
index a9a6c3635..c725e716d 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/objectteams/otdt/internal/codeassist/select/SelectionOnBaseAllocationExpression.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/objectteams/otdt/internal/codeassist/select/SelectionOnBaseAllocationExpression.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2011 GK Software AG
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -26,7 +26,7 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.ast.BaseAllocationExp
/**
* For code select, a base allocation expression should be mapped to the corresponding
* base constructor, which is found via this.expression (an AllocationExpression).
- *
+ *
* @author stephan
* @since 2.0 (from eclipse.org).
*/
@@ -35,7 +35,7 @@ public class SelectionOnBaseAllocationExpression extends BaseAllocationExpressio
public SelectionOnBaseAllocationExpression(int start, int end) {
super(start, end);
}
-
+
@Override
public TypeBinding resolveType(BlockScope scope) {
super.resolveType(scope);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/CategorizedProblem.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/CategorizedProblem.java
index c162e3ec7..425a8e263 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/CategorizedProblem.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/CategorizedProblem.java
@@ -107,7 +107,7 @@ public abstract class CategorizedProblem implements IProblem {
* @since 3.18
*/
public static final int CAT_COMPLIANCE = 170;
- /** Category for problems related to preview features
+ /** Category for problems related to preview features
* @since 3.20*/
public static final int CAT_PREVIEW_RELATED = 180;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/CharOperation.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/CharOperation.java
index 0736e1069..ca1600bcd 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/CharOperation.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/CharOperation.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
* Luiz-Otavio Zorzella <zorzella at gmail dot com> - Improve CamelCase algorithm
@@ -1015,7 +1015,7 @@ public static String charToString(char[] charArray) {
/**
* Converts the given list of strings to an array of equal size,
* containing the individual strings converted to char[] each.
- *
+ *
* @param stringList
* @return an array of char[], representing the elements in the input list, or {@code null} if the list was {@code null}.
* @since 3.14
@@ -1108,7 +1108,7 @@ public static final int compareTo(char[] array1, char[] array2) {
* @param array2 the second given array
* @param start the starting position to compare (inclusive)
* @param end the ending position to compare (exclusive)
- *
+ *
* @return the returned value of the comparison between array1 and array2
* @throws NullPointerException if one of the arrays is null
* @since 3.7.1
@@ -1900,7 +1900,7 @@ public static final char[] concatWith(char[][] array, char separator) {
}
/**
- * Answers the concatenation of the given array parts using the given separator between each part
+ * Answers the concatenation of the given array parts using the given separator between each part
* irrespective of whether an element is a zero length array or not.
* <br>
* <br>
@@ -3164,7 +3164,7 @@ public static final boolean match(
if (iPattern == patternEnd) {
if (iName == nameEnd) return true; // the chars match
return false; // pattern has ended but not the name, no match
- }
+ }
if ((patternChar = pattern[iPattern]) == '*') {
break;
}
@@ -4177,13 +4177,13 @@ public static final char[][] splitOnWithEnclosures(
int enclCount = 0;
for (int i = start; i < end; i++) {
if (array[i] == openEncl)
- enclCount++;
+ enclCount++;
else if (array[i] == divider)
wordCount++;
}
if (enclCount == 0)
return CharOperation.splitOn(divider, array, start, end);
-
+
int nesting = 0;
if (openEncl == divider || closeEncl == divider) // divider should be distinct
return CharOperation.NO_CHAR_CHAR;
@@ -4196,7 +4196,7 @@ public static final char[][] splitOnWithEnclosures(
continue;
}
if (array[i] == closeEncl) {
- if (nesting > 0)
+ if (nesting > 0)
--nesting;
continue;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java
index bf5b3d823..0f11a07b1 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java
@@ -225,7 +225,7 @@
* VarLocalWithoutInitizalier
* VarLocalInitializedToNull
* VarLocalCannotBeArrayInitalizers
- * VarLocalCannotBeLambda
+ * VarLocalCannotBeLambda
* VarLocalCannotBeMethodReference
* VarIsReserved
* VarIsReservedInFuture
@@ -380,7 +380,7 @@ void setSourceStart(int sourceStart);
/** @since 3.18 */
int Compliance = 0x00400000;
/** @since 3.20 */
- int PreviewRelated = 0x00200000;
+ int PreviewRelated = 0x00200000;
/**
* Mask to use in order to filter out the category portion of the problem ID.
@@ -420,7 +420,7 @@ void setSourceStart(int sourceStart);
int TypeMismatch = TypeRelated + 17;
/** @since 3.0 */
int IndirectAccessToStaticType = Internal + TypeRelated + 18;
-
+
/** @since 3.10 */
int ReturnTypeMismatch = TypeRelated + 19;
@@ -1581,7 +1581,7 @@ void setSourceStart(int sourceStart);
int IllegalModifierForEnum = TypeRelated + 750;
/** @since 3.1 */
int IllegalModifierForEnumConstant = FieldRelated + 751;
- /** @deprecated - problem could not be reported, enums cannot be local takes precedence
+ /** @deprecated - problem could not be reported, enums cannot be local takes precedence
* @since 3.1 */
int IllegalModifierForLocalEnum = TypeRelated + 752;
/** @since 3.1 */
@@ -1681,7 +1681,7 @@ void setSourceStart(int sourceStart);
/** @since 3.7.1 */
int AssignmentToResource = Internal + 872;
/** @since 3.7.1 */
- int InvalidUnionTypeReferenceSequence = Internal + TypeRelated + 873;
+ int InvalidUnionTypeReferenceSequence = Internal + TypeRelated + 873;
/** @since 3.7.1 */
int AutoManagedResourceNotBelow17 = Syntax + Internal + 874;
/** @since 3.7.1 */
@@ -1735,7 +1735,7 @@ void setSourceStart(int sourceStart);
int DisallowedTargetForContainerAnnotationType = TypeRelated + 898;
/** @since 3.10 */
int RepeatedAnnotationWithContainerAnnotation = TypeRelated + 899;
-
+
/** @since 3.14 */
int AutoManagedVariableResourceNotBelow9 = Syntax + Internal + 1351;
/**
@@ -1749,7 +1749,7 @@ void setSourceStart(int sourceStart);
// associated with it
/** @since 3.2 */
int ExternalProblemFixable = 901;
-
+
/** @since 3.10 */
int ContainerAnnotationTypeHasWrongValueType = TypeRelated + 902;
/** @since 3.10 */
@@ -1766,7 +1766,7 @@ void setSourceStart(int sourceStart);
int RepeatableAnnotationTypeIsInherited = TypeRelated + 908;
/** @since 3.10 */
int RepeatableAnnotationWithRepeatingContainerAnnotation = TypeRelated + 909;
-
+
/**
* Errors/warnings from annotation based null analysis
*/
@@ -1934,10 +1934,10 @@ void setSourceStart(int sourceStart);
/** @since 3.10 */
int DefaultMethodOverridesObjectMethod = MethodRelated + 1051;
-
+
/** @since 3.10 */
int InheritedDefaultMethodConflictsWithOtherInherited = MethodRelated + 1052;
-
+
/** @since 3.10 */
int DuplicateInheritedDefaultMethods = MethodRelated + 1053;
@@ -1953,14 +1953,14 @@ void setSourceStart(int sourceStart);
int IllegalDefaultModifierSpecification = MethodRelated + 1058;
/** @since 3.13 */
int CannotInferInvocationType = TypeRelated + 1059;
-
-
+
+
/** @since 3.13 */
int TypeAnnotationAtQualifiedName = Internal + Syntax + 1060;
/** @since 3.13 */
int NullAnnotationAtQualifyingType = Internal + Syntax + 1061;
-
+
/** @since 3.14*/
int IllegalModifierForInterfaceMethod9 = MethodRelated + 1071;
/** @since 3.14*/
@@ -2064,7 +2064,7 @@ void setSourceStart(int sourceStart);
int UsingTerminallyDeprecatedModule = ModuleRelated + 1431;
/** @since 3.14 */
int UsingTerminallyDeprecatedSinceVersionModule = ModuleRelated + 1432;
-
+
/** @since 3.14 */
int NotAccessibleType = TypeRelated + 1450;
/** @since 3.14 */
@@ -2092,13 +2092,13 @@ void setSourceStart(int sourceStart);
/** @since 3.13 */
int RedundantNullDefaultAnnotationLocal = Internal + 1062;
-
+
/** @since 3.13 */
int RedundantNullDefaultAnnotationField = Internal + 1063;
-
+
/** @since 3.10 */
int GenericInferenceError = 1100; // FIXME: This is just a stop-gap measure, be more specific via https://bugs.eclipse.org/404675
-
+
/** @deprecated - problem is no longer generated (implementation issue has been resolved)
* @since 3.10 */
int LambdaShapeComputationError = 1101;
@@ -2218,7 +2218,7 @@ void setSourceStart(int sourceStart);
int QualifiedReferenceToBaseclass = ROLE_RELATED + 1211; // 2.1.2(d)
int ParameterizedBaseclass = ROLE_RELATED + 1212; // 2.1.2(e)
int NonParameterizedBaseclass = ROLE_RELATED + 1213; // 2.1.2(e)
-
+
int DeprecatedBaseclass = ROLE_RELATED + 1299; // no OTJLD
// ==>> do not change these numbers: they are used from persisted state to determine if base imports are legal:
@@ -2231,7 +2231,7 @@ void setSourceStart(int sourceStart);
// <<==
int BaseImportFromSplitPackage = ROLE_RELATED + 1314; // OT/Equinox
int BaseImportFromSplitPackagePlural = ROLE_RELATED + 1315; // OT/Equinox
-
+
int IllegalImplicitLower = ROLE_RELATED + 2001; // 2.2(b)
int OmitCastForLowering = ROLE_RELATED + 2002; // 2.2(b)
int UseTmpForLoweringInstanceof = ROLE_RELATED + 2003; // 2.2(b)
@@ -2375,7 +2375,7 @@ void setSourceStart(int sourceStart);
int CallinOverriddenInTeam = CALLIN_RELATED + 1013; // 4.1(e)
int CallinToDeprecated = CALLIN_RELATED + 1099; // no OTJLD
-
+
int CallinInNonRole = CALLIN_RELATED + 2001; // 4.2(d)
int CallinWithVisibility = CALLIN_RELATED + 2002; // 4.2(d)
int CallToCallin = CALLIN_RELATED + 2003; // 4.2(d)
@@ -2468,7 +2468,7 @@ void setSourceStart(int sourceStart);
// ==== Joinpoint Queries: ====
int JP_RELATED = OTJ_RELATED + 8*OTCHAP;
// Chapter currently not in use
-
+
// ==== Dependent Types: ====
int DEPENDENT_RELATED = OTJ_RELATED + 9*OTCHAP;
int AnchorReferenceNotAValue = DEPENDENT_RELATED + 210; // 9.2.1
@@ -2502,7 +2502,7 @@ void setSourceStart(int sourceStart);
/**
* @since 3.8
*/
- int IllegalModifierBeforeCallinLabel = SYNTAX_RELATED + 3305; // A.3.3 // FIXME: annotations are still missing from OTJLD A.3.3
+ int IllegalModifierBeforeCallinLabel = SYNTAX_RELATED + 3305; // A.3.3 // FIXME: annotations are still missing from OTJLD A.3.3
int IllegalModifierInMethodSpecRight = SYNTAX_RELATED + 3501; // A.3.5
@@ -2511,7 +2511,7 @@ void setSourceStart(int sourceStart);
int MissingPredicateExpression = SYNTAX_RELATED + 7001; // A.7.1
int ValueParamWrongPosition = SYNTAX_RELATED + 9001; // A.9(a)
-
+
int SyntaxErrorSingleTypeReferenceExpected = SYNTAX_RELATED + 9501; // 1.2.4(c) NOTE(SH): don't yet have a section "Expression" in §A.
// ==== LIMITATIONS: ====
@@ -2548,21 +2548,21 @@ void setSourceStart(int sourceStart);
int TryingToWeaveIntoSystemClass = LIMITATIONS + 26;
int DangerousCallinBinding = LIMITATIONS + 27;
-
+
int UnexpectedAnnotationStructure = LIMITATIONS + 28;
-
+
int IncompatibleOTJByteCodeVersion = LIMITATIONS + 29;
int CallinBindingToInterface = LIMITATIONS + 30;
-
+
int AbstractStaticMethodCalled = LIMITATIONS + 31; // actually a sign of corrupt byte code
-
+
/** @since 4.3 OT 2.2 */
int RoleFileMissingTeamDeclaration = LIMITATIONS + 32;
-
+
/** @since 3.10 OT 2.3 */
int OtreCannotWeaveIntoJava8 = LIMITATIONS + 33;
-
+
/** @since 3.10 OT 2.3 */
int IncompatibleWeavingScheme = LIMITATIONS + 34;
@@ -2590,11 +2590,11 @@ void setSourceStart(int sourceStart);
/** @since 3.14 */
int VarLocalInitializedToNull = TypeRelated + 1504; // Variable initialized to ''null'' needs an explicit target-type
/** @since 3.14 */
- int VarLocalInitializedToVoid = TypeRelated + 1505; // Variable initializer is ''void'' -- cannot infer variable type
+ int VarLocalInitializedToVoid = TypeRelated + 1505; // Variable initializer is ''void'' -- cannot infer variable type
/** @since 3.14 */
int VarLocalCannotBeArrayInitalizers = TypeRelated + 1506; // Array initializer needs an explicit target-type
/** @since 3.14 */
- int VarLocalCannotBeLambda = TypeRelated + 1507; // Lambda expression needs an explicit target-type
+ int VarLocalCannotBeLambda = TypeRelated + 1507; // Lambda expression needs an explicit target-type
/** @since 3.14 */
int VarLocalCannotBeMethodReference = TypeRelated + 1508; // Method reference needs an explicit target-type
/** @since 3.14 */
@@ -2605,47 +2605,47 @@ void setSourceStart(int sourceStart);
int VarIsNotAllowedHere = Syntax + 1511; // ''var'' is not allowed here
/** @since 3.16 */
int VarCannotBeMixedWithNonVarParams = Syntax + 1512; // ''var'' cannot be mixed with explicit or implicit parameters
- /** @since 3.18
+ /** @since 3.18
* @deprecated preview related error - will be removed
* @noreference preview related error */
int SwitchExpressionsIncompatibleResultExpressionTypes = TypeRelated + 1600;
- /** @since 3.18
+ /** @since 3.18
* @deprecated preview related error - will be removed
* @noreference preview related error */
int SwitchExpressionsEmptySwitchBlock = Internal + 1601;
- /** @since 3.18
+ /** @since 3.18
* @deprecated preview related error - will be removed
* @noreference preview related error */
int SwitchExpressionsNoResultExpression = TypeRelated + 1602;
- /** @since 3.18
+ /** @since 3.18
* @deprecated preview related error - will be removed
* @noreference preview related error */
int SwitchExpressionSwitchLabeledBlockCompletesNormally = Internal + 1603;
- /** @since 3.18
+ /** @since 3.18
* @deprecated preview related error - will be removed
* @noreference preview related error */
int SwitchExpressionLastStatementCompletesNormally = Internal + 1604;
- /** @since 3.18
+ /** @since 3.18
* @deprecated preview related error - will be removed
* @noreference preview related error */
int SwitchExpressionTrailingSwitchLabels = Internal + 1605;
- /** @since 3.18
+ /** @since 3.18
* @deprecated preview related error - will be removed
* @noreference preview related error */
int switchMixedCase = Syntax + 1606;
- /** @since 3.18
+ /** @since 3.18
* @deprecated preview related error - will be removed
* @noreference preview related error */
int SwitchExpressionMissingDefaultCase = Internal + 1607;
- /** @since 3.18
+ /** @since 3.18
* @deprecated preview related error - will be removed
* @noreference preview related error */
int SwitchExpressionBreakMissingValue = Internal + 1610;
- /** @since 3.18
+ /** @since 3.18
* @deprecated preview related error - will be removed
* @noreference preview related error */
int SwitchExpressionMissingEnumConstantCase = Internal + 1611;
- /** @since 3.18
+ /** @since 3.18
* @deprecated preview related error - will be removed
* @noreference preview related error */
int SwitchExpressionIllegalLastStatement = Internal + 1612;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ASTVisitor.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ASTVisitor.java
index d608e129b..f2deed497 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ASTVisitor.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ASTVisitor.java
@@ -523,7 +523,7 @@ public abstract class ASTVisitor {
// do nothing by default
}
public void endVisit(ReferenceExpression referenceExpression, BlockScope blockScope) {
- // do nothing by default
+ // do nothing by default
}
public void endVisit(IntersectionCastTypeReference intersectionCastTypeReference, ClassScope scope) {
// do nothing by default
@@ -573,7 +573,7 @@ public abstract class ASTVisitor {
// do nothing by default
}
public void endVisit(PrecedenceDeclaration precedenceDeclaration, BlockScope scope) {
- // do nothing by default
+ // do nothing by default
}
// SH et al}
public boolean visit(
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/AbstractAnnotationProcessorManager.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/AbstractAnnotationProcessorManager.java
index 022b20ae9..f3fc317ca 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/AbstractAnnotationProcessorManager.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/AbstractAnnotationProcessorManager.java
@@ -38,7 +38,7 @@ public abstract class AbstractAnnotationProcessorManager {
* @param compiler the given compiler
* @param compilationUnitLocator the given compilation unit locator
* @param javaProject the given java project
- * @param isTestCode
+ * @param isTestCode
*/
public abstract void configureFromPlatform(Compiler compiler, Object compilationUnitLocator, Object javaProject, boolean isTestCode);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java
index 313fc5609..178472e9f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java
@@ -13,7 +13,7 @@
* Fraunhofer FIRST - extended API and implementation
* Technical University Berlin - extended API and implementation
* Jesper S Moller - Contributions for
- * Bug 405066 - [1.8][compiler][codegen] Implement code generation infrastructure for JSR335
+ * Bug 405066 - [1.8][compiler][codegen] Implement code generation infrastructure for JSR335
* Bug 406982 - [1.8][compiler] Generation of MethodParameters Attribute in classfile
* Bug 416885 - [1.8][compiler]IncompatibleClassChange error (edit)
* Bug 412149 - [1.8][compiler] Emit repeated annotations into the designated container
@@ -375,7 +375,7 @@ public class ClassFile implements TypeConstants, TypeIds {
AbstractMethodDeclaration method,
MethodBinding methodBinding) {
-//{ObjectTeams: role ifc methods may have funny modifiers (static, callin), don't destroy the original binding
+//{ObjectTeams: role ifc methods may have funny modifiers (static, callin), don't destroy the original binding
if (methodBinding.declaringClass.isSynthInterface())
methodBinding = new MethodBinding(methodBinding, methodBinding.declaringClass);
// SH}
@@ -466,7 +466,7 @@ public class ClassFile implements TypeConstants, TypeIds {
targetMask = TagBits.AnnotationForType | TagBits.AnnotationForAnnotationType;
else
targetMask = TagBits.AnnotationForType | TagBits.AnnotationForTypeUse;
- attributesNumber += generateRuntimeAnnotations(annotations, targetMask);
+ attributesNumber += generateRuntimeAnnotations(annotations, targetMask);
}
}
}
@@ -517,9 +517,9 @@ public class ClassFile implements TypeConstants, TypeIds {
generateMissingTypesAttribute();
attributesNumber++;
}
-
+
attributesNumber += generateTypeAnnotationAttributeForTypeDeclaration();
-
+
if (this.targetJDK >= ClassFileConstants.JDK11) {
// add nestMember and nestHost attributes
attributesNumber += generateNestAttributes();
@@ -567,7 +567,7 @@ public class ClassFile implements TypeConstants, TypeIds {
attributesNumber += generateModuleAttribute(cud.moduleDeclaration);
if (annotations != null) {
long targetMask = TagBits.AnnotationForModule;
- attributesNumber += generateRuntimeAnnotations(annotations, targetMask);
+ attributesNumber += generateRuntimeAnnotations(annotations, targetMask);
}
char[] mainClass = cud.moduleDeclaration.binding.mainClassName;
if (mainClass != null) {
@@ -922,7 +922,7 @@ public class ClassFile implements TypeConstants, TypeIds {
AbstractMethodDeclaration method,
MethodBinding methodBinding,
CategorizedProblem[] problems) {
-
+
if (methodBinding.declaringClass.isInterface()) {
method.abort(ProblemSeverities.AbortType, null);
}
@@ -1112,7 +1112,7 @@ public class ClassFile implements TypeConstants, TypeIds {
int attributeNumber = generateMethodInfoAttributes(methodBinding);
completeMethodInfo(methodBinding, methodAttributeOffset, attributeNumber);
}
-
+
// add synthetic methods infos
int emittedSyntheticsCount = 0;
SyntheticMethodBinding deserializeLambdaMethod = null;
@@ -1178,7 +1178,7 @@ public class ClassFile implements TypeConstants, TypeIds {
break;
case SyntheticMethodBinding.FactoryMethod:
addSyntheticFactoryMethod(syntheticMethod);
- break;
+ break;
case SyntheticMethodBinding.DeserializeLambda:
deserializeLambdaMethod = syntheticMethod; // delay processing
break;
@@ -1202,7 +1202,7 @@ public class ClassFile implements TypeConstants, TypeIds {
do {
try {
problemResetPC = this.contentsOffset;
- addSyntheticDeserializeLambda(deserializeLambdaMethod,this.referenceBinding.syntheticMethods());
+ addSyntheticDeserializeLambda(deserializeLambdaMethod,this.referenceBinding.syntheticMethods());
restart = false;
} catch (AbortMethod e) {
// Restart code generation if possible ...
@@ -1722,7 +1722,7 @@ public class ClassFile implements TypeConstants, TypeIds {
false,
scope);
}
-
+
if ((this.produceAttributes & ClassFileConstants.ATTR_TYPE_ANNOTATION) != 0) {
attributesNumber += generateTypeAnnotationsOnCodeAttribute();
}
@@ -1737,10 +1737,10 @@ public class ClassFile implements TypeConstants, TypeIds {
this.contents[codeAttributeOffset + 4] = (byte) (codeAttributeLength >> 8);
this.contents[codeAttributeOffset + 5] = (byte) codeAttributeLength;
}
-
+
public int generateTypeAnnotationsOnCodeAttribute() {
int attributesNumber = 0;
-
+
List allTypeAnnotationContexts = ((TypeAnnotationCodeStream) this.codeStream).allTypeAnnotationContexts;
int invisibleTypeAnnotationsCounter = 0;
int visibleTypeAnnotationsCounter = 0;
@@ -1758,7 +1758,7 @@ public class ClassFile implements TypeConstants, TypeIds {
int targetType = ((localVariable.tagBits & TagBits.IsResource) == 0) ? AnnotationTargetTypeConstants.LOCAL_VARIABLE : AnnotationTargetTypeConstants.RESOURCE_VARIABLE;
declaration.getAllAnnotationContexts(targetType, localVariable, allTypeAnnotationContexts);
}
-
+
ExceptionLabel[] exceptionLabels = this.codeStream.exceptionLabels;
for (int i = 0, max = this.codeStream.exceptionLabelsCounter; i < max; i++) {
ExceptionLabel exceptionLabel = exceptionLabels[i];
@@ -1766,7 +1766,7 @@ public class ClassFile implements TypeConstants, TypeIds {
exceptionLabel.exceptionTypeReference.getAllAnnotationContexts(AnnotationTargetTypeConstants.EXCEPTION_PARAMETER, i, allTypeAnnotationContexts, exceptionLabel.se7Annotations);
}
}
-
+
int size = allTypeAnnotationContexts.size();
if (size != 0) {
AnnotationContext[] allTypeAnnotationContextsArray = new AnnotationContext[size];
@@ -2043,7 +2043,7 @@ public class ClassFile implements TypeConstants, TypeIds {
if ((this.produceAttributes & ClassFileConstants.ATTR_TYPE_ANNOTATION) != 0) {
attributesNumber += generateTypeAnnotationsOnCodeAttribute();
}
-
+
// update the number of attributes
// ensure first that there is enough space available inside the contents array
if (codeAttributeAttributeOffset + 2 >= this.contents.length) {
@@ -2450,7 +2450,7 @@ public class ClassFile implements TypeConstants, TypeIds {
MethodBinding binding,
int methodAttributeOffset,
int attributesNumber) {
-
+
if ((this.produceAttributes & ClassFileConstants.ATTR_TYPE_ANNOTATION) != 0) {
List allTypeAnnotationContexts = new ArrayList();
int invisibleTypeAnnotationsCounter = 0;
@@ -2526,7 +2526,7 @@ public class ClassFile implements TypeConstants, TypeIds {
this.contents[methodAttributeOffset++] = (byte) (attributesNumber >> 8);
this.contents[methodAttributeOffset] = (byte) attributesNumber;
}
-
+
private void dumpLocations(int[] locations) {
if (locations == null) {
// no type path
@@ -2558,7 +2558,7 @@ public class ClassFile implements TypeConstants, TypeIds {
this.contents[this.contentsOffset++] = (byte) annotationContext.info;
// bound_index
this.contents[this.contentsOffset++] = (byte) annotationContext.info2;
- break;
+ break;
case AnnotationTargetTypeConstants.FIELD :
case AnnotationTargetTypeConstants.METHOD_RECEIVER :
case AnnotationTargetTypeConstants.METHOD_RETURN :
@@ -2568,7 +2568,7 @@ public class ClassFile implements TypeConstants, TypeIds {
// target_info is parameter index
this.contents[this.contentsOffset++] = (byte) annotationContext.info;
break;
-
+
case AnnotationTargetTypeConstants.INSTANCEOF :
case AnnotationTargetTypeConstants.NEW :
case AnnotationTargetTypeConstants.EXCEPTION_PARAMETER :
@@ -2585,7 +2585,7 @@ public class ClassFile implements TypeConstants, TypeIds {
this.contents[this.contentsOffset++] = (byte) annotationContext.info;
this.contents[this.contentsOffset++] = (byte) annotationContext.info2;
break;
-
+
case AnnotationTargetTypeConstants.CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT :
case AnnotationTargetTypeConstants.METHOD_INVOCATION_TYPE_ARGUMENT :
case AnnotationTargetTypeConstants.CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT :
@@ -2593,18 +2593,18 @@ public class ClassFile implements TypeConstants, TypeIds {
// bytecode offset
this.contents[this.contentsOffset++] = (byte) (annotationContext.info >> 8);
this.contents[this.contentsOffset++] = (byte) annotationContext.info;
- // type_argument_index
+ // type_argument_index
this.contents[this.contentsOffset++] = (byte) annotationContext.info2;
break;
-
+
case AnnotationTargetTypeConstants.CLASS_EXTENDS :
- case AnnotationTargetTypeConstants.THROWS :
+ case AnnotationTargetTypeConstants.THROWS :
// For CLASS_EXTENDS - info is supertype index (-1 = superclass)
// For THROWS - info is exception table index
this.contents[this.contentsOffset++] = (byte) (annotationContext.info >> 8);
this.contents[this.contentsOffset++] = (byte) annotationContext.info;
break;
-
+
case AnnotationTargetTypeConstants.LOCAL_VARIABLE :
case AnnotationTargetTypeConstants.RESOURCE_VARIABLE :
int localVariableTableOffset = this.contentsOffset;
@@ -2788,7 +2788,7 @@ public class ClassFile implements TypeConstants, TypeIds {
// leave space for attribute_length(4), max_stack(2), max_locals(2), code_length(4)
this.contentsOffset += 12;
}
-
+
private int generateConstantValueAttribute(Constant fieldConstant, FieldBinding fieldBinding, int fieldAttributeOffset) {
int localContentsOffset = this.contentsOffset;
int attributesNumber = 1;
@@ -2959,7 +2959,7 @@ public class ClassFile implements TypeConstants, TypeIds {
if (recordComponents == null)
return 0;
// could be an empty record also, account for zero components as well.
-
+
int numberOfRecordComponents = recordComponents.length;
int exSize = 8 + 2 * numberOfRecordComponents;
@@ -3018,7 +3018,7 @@ public class ClassFile implements TypeConstants, TypeIds {
this.contents[localContentsOffset++] = (byte) (module_version_idx >> 8);
this.contents[localContentsOffset++] = (byte) module_version_idx;
int attrLength = 6;
-
+
// ================= requires section =================
/** u2 requires_count;
{ u2 requires_index;
@@ -3031,7 +3031,7 @@ public class ClassFile implements TypeConstants, TypeIds {
if (localContentsOffset + requiresSize >= this.contents.length) {
resizeContents(requiresSize);
}
-
+
localContentsOffset += 2;
ModuleBinding javaBaseBinding = null;
for(int i = 0; i < module.requiresCount; i++) {
@@ -3098,7 +3098,7 @@ public class ClassFile implements TypeConstants, TypeIds {
this.contents[localContentsOffset++] = (byte) 0;
this.contents[localContentsOffset++] = (byte) 0;
- int exportsToCount = ref.isQualified() ? ref.targets.length : 0;
+ int exportsToCount = ref.isQualified() ? ref.targets.length : 0;
this.contents[localContentsOffset++] = (byte) (exportsToCount >> 8);
this.contents[localContentsOffset++] = (byte) (exportsToCount);
if (exportsToCount > 0) {
@@ -3143,8 +3143,8 @@ public class ClassFile implements TypeConstants, TypeIds {
// TODO opens_flags - check when they are set
this.contents[localContentsOffset++] = (byte) 0;
this.contents[localContentsOffset++] = (byte) 0;
-
- int opensToCount = ref.isQualified() ? ref.targets.length : 0;
+
+ int opensToCount = ref.isQualified() ? ref.targets.length : 0;
this.contents[localContentsOffset++] = (byte) (opensToCount >> 8);
this.contents[localContentsOffset++] = (byte) (opensToCount);
if (opensToCount > 0) {
@@ -3266,7 +3266,7 @@ public class ClassFile implements TypeConstants, TypeIds {
localContentsOffset+= 4;
int packageCountOffset = localContentsOffset;
localContentsOffset+= 2;
-
+
int packagesCount = 0;
for (char[] packageName : packageNames) {
if (packageName == null || packageName.length == 0) continue;
@@ -3401,7 +3401,7 @@ public class ClassFile implements TypeConstants, TypeIds {
}
}
}
-
+
private void generateElementValueForNonConstantExpression(Expression defaultValue, int attributeOffset, TypeBinding defaultValueBinding) {
if (defaultValueBinding != null) {
if (defaultValueBinding.isEnum()) {
@@ -3648,13 +3648,13 @@ public class ClassFile implements TypeConstants, TypeIds {
// Generate the boot strap attribute - since we are only making lambdas and
// functional expressions, we know the size ahead of time - this less general
// than the full invokedynamic scope, but fine for Java 8
-
+
final int contentsEntries = 10;
int exSize = contentsEntries * numberOfBootstraps + 8;
if (exSize + localContentsOffset >= this.contents.length) {
resizeContents(exSize);
}
-
+
int attributeNameIndex =
this.constantPool.literalIndex(AttributeNamesConstants.BootstrapMethodsName);
this.contents[localContentsOffset++] = (byte) (attributeNameIndex >> 8);
@@ -3684,9 +3684,9 @@ public class ClassFile implements TypeConstants, TypeIds {
private int generateLambdaMetaFactoryBootStrapMethods(List functionalExpressionList,
int localContentsOffset, final int contentsEntries) {
- ReferenceBinding javaLangInvokeLambdaMetafactory = this.referenceBinding.scope.getJavaLangInvokeLambdaMetafactory();
+ ReferenceBinding javaLangInvokeLambdaMetafactory = this.referenceBinding.scope.getJavaLangInvokeLambdaMetafactory();
int numberOfBootstraps = functionalExpressionList.size();
-
+
// Depending on the complexity of the expression it may be necessary to use the altMetafactory() rather than the metafactory()
int indexForMetaFactory = 0;
int indexForAltMetaFactory = 0;
@@ -3710,29 +3710,29 @@ public class ClassFile implements TypeConstants, TypeIds {
}
if (extraSpace + contentsEntries + localContentsOffset >= this.contents.length) {
resizeContents(extraSpace + contentsEntries);
- }
-
+ }
+
if (indexForAltMetaFactory == 0) {
- indexForAltMetaFactory =
- this.constantPool.literalIndexForMethodHandle(ClassFileConstants.MethodHandleRefKindInvokeStatic, javaLangInvokeLambdaMetafactory,
+ indexForAltMetaFactory =
+ this.constantPool.literalIndexForMethodHandle(ClassFileConstants.MethodHandleRefKindInvokeStatic, javaLangInvokeLambdaMetafactory,
ConstantPool.ALTMETAFACTORY, ConstantPool.JAVA_LANG_INVOKE_LAMBDAMETAFACTORY_ALTMETAFACTORY_SIGNATURE, false);
}
this.contents[localContentsOffset++] = (byte) (indexForAltMetaFactory >> 8);
this.contents[localContentsOffset++] = (byte) indexForAltMetaFactory;
-
+
// u2 num_bootstrap_arguments
this.contents[localContentsOffset++] = 0;
- this.contents[localContentsOffset++] = (byte) (4 + (markerInterfaces==null?0:1+markerInterfaces.length) +
+ this.contents[localContentsOffset++] = (byte) (4 + (markerInterfaces==null?0:1+markerInterfaces.length) +
(bridges == null ? 0 : 1 + bridges.length));
-
+
int functionalDescriptorIndex = this.constantPool.literalIndexForMethodType(functional.descriptor.original().signature());
this.contents[localContentsOffset++] = (byte) (functionalDescriptorIndex >> 8);
this.contents[localContentsOffset++] = (byte) functionalDescriptorIndex;
-
+
int methodHandleIndex = this.constantPool.literalIndexForMethodHandle(functional.binding.original()); // Speak of " implementation" (erased) version here, adaptations described below.
this.contents[localContentsOffset++] = (byte) (methodHandleIndex >> 8);
this.contents[localContentsOffset++] = (byte) methodHandleIndex;
-
+
char [] instantiatedSignature = functional.descriptor.signature();
int methodTypeIndex = this.constantPool.literalIndexForMethodType(instantiatedSignature);
this.contents[localContentsOffset++] = (byte) (methodTypeIndex >> 8);
@@ -3749,10 +3749,10 @@ public class ClassFile implements TypeConstants, TypeIds {
bitflags |= ClassFileConstants.FLAG_BRIDGES;
}
int indexForBitflags = this.constantPool.literalIndex(bitflags);
-
+
this.contents[localContentsOffset++] = (byte)(indexForBitflags>>8);
this.contents[localContentsOffset++] = (byte)(indexForBitflags);
-
+
if (markerInterfaces != null) {
int markerInterfaceCountIndex = this.constantPool.literalIndex(markerInterfaces.length);
this.contents[localContentsOffset++] = (byte)(markerInterfaceCountIndex>>8);
@@ -3761,7 +3761,7 @@ public class ClassFile implements TypeConstants, TypeIds {
int classTypeIndex = this.constantPool.literalIndexForType(markerInterfaces[m]);
this.contents[localContentsOffset++] = (byte)(classTypeIndex>>8);
this.contents[localContentsOffset++] = (byte)(classTypeIndex);
- }
+ }
}
if (bridges != null) {
int bridgeCountIndex = this.constantPool.literalIndex(bridges.length);
@@ -3772,42 +3772,42 @@ public class ClassFile implements TypeConstants, TypeIds {
int bridgeMethodTypeIndex = this.constantPool.literalIndexForMethodType(bridgeSignature);
this.contents[localContentsOffset++] = (byte) (bridgeMethodTypeIndex >> 8);
this.contents[localContentsOffset++] = (byte) bridgeMethodTypeIndex;
- }
+ }
}
} else {
if (contentsEntries + localContentsOffset >= this.contents.length) {
resizeContents(contentsEntries);
}
if (indexForMetaFactory == 0) {
- indexForMetaFactory = this.constantPool.literalIndexForMethodHandle(ClassFileConstants.MethodHandleRefKindInvokeStatic, javaLangInvokeLambdaMetafactory,
+ indexForMetaFactory = this.constantPool.literalIndexForMethodHandle(ClassFileConstants.MethodHandleRefKindInvokeStatic, javaLangInvokeLambdaMetafactory,
ConstantPool.METAFACTORY, ConstantPool.JAVA_LANG_INVOKE_LAMBDAMETAFACTORY_METAFACTORY_SIGNATURE, false);
}
this.contents[localContentsOffset++] = (byte) (indexForMetaFactory >> 8);
this.contents[localContentsOffset++] = (byte) indexForMetaFactory;
-
+
// u2 num_bootstrap_arguments
this.contents[localContentsOffset++] = 0;
this.contents[localContentsOffset++] = (byte) 3;
-
+
int functionalDescriptorIndex = this.constantPool.literalIndexForMethodType(functional.descriptor.original().signature());
this.contents[localContentsOffset++] = (byte) (functionalDescriptorIndex >> 8);
this.contents[localContentsOffset++] = (byte) functionalDescriptorIndex;
-
+
int methodHandleIndex = this.constantPool.literalIndexForMethodHandle(functional.binding instanceof PolymorphicMethodBinding ? functional.binding : functional.binding.original()); // Speak of " implementation" (erased) version here, adaptations described below.
this.contents[localContentsOffset++] = (byte) (methodHandleIndex >> 8);
this.contents[localContentsOffset++] = (byte) methodHandleIndex;
-
+
char [] instantiatedSignature = functional.descriptor.signature();
int methodTypeIndex = this.constantPool.literalIndexForMethodType(instantiatedSignature);
this.contents[localContentsOffset++] = (byte) (methodTypeIndex >> 8);
- this.contents[localContentsOffset++] = (byte) methodTypeIndex;
+ this.contents[localContentsOffset++] = (byte) methodTypeIndex;
}
}
return localContentsOffset;
}
private int generateObjectMethodsBootStrapMethods(List<TypeBinding> recordList,
int localContentsOffset, final int contentsEntries) {
- ReferenceBinding javaLangRuntimeObjectMethods = this.referenceBinding.scope.getJavaLangRuntimeObjectMethods();
+ ReferenceBinding javaLangRuntimeObjectMethods = this.referenceBinding.scope.getJavaLangRuntimeObjectMethods();
int numberOfBootstraps = recordList.size();
int indexForObjectMethodBootStrap = 0;
for (int i = 0; i < numberOfBootstraps; i++) {
@@ -3815,16 +3815,16 @@ public class ClassFile implements TypeConstants, TypeIds {
resizeContents(contentsEntries);
}
if (indexForObjectMethodBootStrap == 0) {
- indexForObjectMethodBootStrap = this.constantPool.literalIndexForMethodHandle(ClassFileConstants.MethodHandleRefKindInvokeStatic, javaLangRuntimeObjectMethods,
+ indexForObjectMethodBootStrap = this.constantPool.literalIndexForMethodHandle(ClassFileConstants.MethodHandleRefKindInvokeStatic, javaLangRuntimeObjectMethods,
ConstantPool.BOOTSTRAP, ConstantPool.JAVA_LANG_RUNTIME_OBJECTMETHOD_BOOTSTRAP_SIGNATURE, false);
}
this.contents[localContentsOffset++] = (byte) (indexForObjectMethodBootStrap >> 8);
this.contents[localContentsOffset++] = (byte) indexForObjectMethodBootStrap;
-
+
// u2 num_bootstrap_arguments
int numArgsLocation = localContentsOffset;
localContentsOffset += 2;
-
+
TypeBinding type = recordList.get(i);
assert type.isRecord(); // sanity check
char[] recordName = type.constantPoolName();
@@ -3835,12 +3835,12 @@ public class ClassFile implements TypeConstants, TypeIds {
assert type instanceof SourceTypeBinding;
SourceTypeBinding sourceType = (SourceTypeBinding) type;
FieldBinding[] recordComponents = sourceType.getRecordComponents();
-
+
int numArgs = 2 + recordComponents.length;
this.contents[numArgsLocation++] = (byte) (numArgs >> 8);
this.contents[numArgsLocation] = (byte) numArgs;
- String names =
+ String names =
Arrays.stream(recordComponents)
.map(f -> new String(f.name))
.reduce((s1, s2) -> { return s1 + ";" + s2;}) //$NON-NLS-1$
@@ -3854,7 +3854,7 @@ public class ClassFile implements TypeConstants, TypeIds {
}
for (FieldBinding field : recordComponents) {
int methodHandleIndex = this.constantPool.literalIndexForMethodHandleFieldRef(
- ClassFileConstants.MethodHandleRefKindGetField,
+ ClassFileConstants.MethodHandleRefKindGetField,
recordName, field.name, field.type.signature());
this.contents[localContentsOffset++] = (byte) (methodHandleIndex >> 8);
@@ -3944,7 +3944,7 @@ public class ClassFile implements TypeConstants, TypeIds {
this.contentsOffset = localContentsOffset;
return 1;
}
-
+
private int generateLocalVariableTableAttribute(int code_length, boolean methodDeclarationIsStatic, boolean isSynthetic) {
int attributesNumber = 0;
int localContentsOffset = this.contentsOffset;
@@ -3977,7 +3977,7 @@ public class ClassFile implements TypeConstants, TypeIds {
nameIndex = this.constantPool.literalIndex(ConstantPool.This);
this.contents[localContentsOffset++] = (byte) (nameIndex >> 8);
this.contents[localContentsOffset++] = (byte) nameIndex;
- declaringClassBinding = (SourceTypeBinding)
+ declaringClassBinding = (SourceTypeBinding)
(this.codeStream.methodDeclaration != null ? this.codeStream.methodDeclaration.binding.declaringClass : this.codeStream.lambdaExpression.binding.declaringClass);
descriptorIndex =
this.constantPool.literalIndex(
@@ -4191,7 +4191,7 @@ public class ClassFile implements TypeConstants, TypeIds {
if (arguments != null) {
int parameterCount = methodBinding.parameters.length;
int argumentCount = arguments.length;
- if (parameterCount > argumentCount) { // synthetics prefixed
+ if (parameterCount > argumentCount) { // synthetics prefixed
int redShift = parameterCount - argumentCount;
System.arraycopy(arguments, 0, arguments = new Argument[parameterCount], redShift, argumentCount);
for (int i = 0; i < redShift; i++)
@@ -4199,7 +4199,7 @@ public class ClassFile implements TypeConstants, TypeIds {
}
attributesNumber += generateRuntimeAnnotationsForParameters(arguments);
}
- }
+ }
}
}
}
@@ -4272,7 +4272,7 @@ public class ClassFile implements TypeConstants, TypeIds {
this.contents[this.contentsOffset++] = (byte) (descriptorIndex >> 8);
this.contents[this.contentsOffset++] = (byte) descriptorIndex;
}
-
+
public void addSyntheticDeserializeLambda(SyntheticMethodBinding methodBinding, SyntheticMethodBinding[] syntheticMethodBindings ) {
generateMethodInfoHeader(methodBinding);
int methodAttributeOffset = this.contentsOffset;
@@ -4299,7 +4299,7 @@ public class ClassFile implements TypeConstants, TypeIds {
.getLineSeparatorPositions());
this.contents[methodAttributeOffset++] = (byte) (attributeNumber >> 8);
this.contents[methodAttributeOffset] = (byte) attributeNumber;
- }
+ }
/**
* INTERNAL USE-ONLY
@@ -4541,7 +4541,7 @@ public class ClassFile implements TypeConstants, TypeIds {
}
return attributesNumber;
}
-
+
private int generateRuntimeAnnotationsForParameters(Argument[] arguments) {
final int argumentsLength = arguments.length;
final int VISIBLE_INDEX = 0;
@@ -4694,7 +4694,7 @@ public class ClassFile implements TypeConstants, TypeIds {
}
return attributesNumber;
}
-
+
/**
* @param annotationContexts the given annotation contexts
* @param visibleTypeAnnotationsNumber the given number of visible type annotations
@@ -4702,8 +4702,8 @@ public class ClassFile implements TypeConstants, TypeIds {
* @return the number of attributes created while dumping the annotations in the .class file
*/
private int generateRuntimeTypeAnnotations(
- final AnnotationContext[] annotationContexts,
- int visibleTypeAnnotationsNumber,
+ final AnnotationContext[] annotationContexts,
+ int visibleTypeAnnotationsNumber,
int invisibleTypeAnnotationsNumber) {
int attributesNumber = 0;
final int length = annotationContexts.length;
@@ -4803,14 +4803,14 @@ public class ClassFile implements TypeConstants, TypeIds {
* @return the number of attributes created while dumping he method's parameters in the .class file (0 or 1)
*/
private int generateMethodParameters(final MethodBinding binding) {
-
+
if (binding.sourceLambda() != null)
return 0;
int initialContentsOffset = this.contentsOffset;
int length = 0; // count of actual parameters
-
+
AbstractMethodDeclaration methodDeclaration = binding.sourceMethod();
-
+
boolean isConstructor = binding.isConstructor();
TypeBinding[] targetParameters = binding.parameters;
ReferenceBinding declaringClass = binding.declaringClass;
@@ -4903,7 +4903,7 @@ public class ClassFile implements TypeConstants, TypeIds {
private int writeArgumentName(char[] name, int modifiers, int oldLength) {
int ensureRoomForBytes = 4;
if (oldLength == 0) {
- // Make room for
+ // Make room for
ensureRoomForBytes += 7;
this.contentsOffset += 7; // Make room for attribute header + count byte
}
@@ -5519,12 +5519,12 @@ public class ClassFile implements TypeConstants, TypeIds {
this.contentsOffset = localContentsOffset;
return 1;
}
-
+
private void generateTypeAnnotation(AnnotationContext annotationContext, int currentOffset) {
Annotation annotation = annotationContext.annotation.getPersistibleAnnotation();
if (annotation == null || annotation.resolvedType == null)
return;
-
+
int targetType = annotationContext.targetType;
int[] locations = Annotation.getLocations(
@@ -5593,9 +5593,9 @@ public class ClassFile implements TypeConstants, TypeIds {
}
return attributesNumber;
}
-
-
-
+
+
+
private int generateVarargsAttribute() {
int localContentsOffset = this.contentsOffset;
@@ -6204,7 +6204,7 @@ public class ClassFile implements TypeConstants, TypeIds {
this.methodCountOffset = this.contentsOffset;
this.contentsOffset += 2;
}
-
+
private List filterFakeFrames(Set realJumpTargets, Map frames, int codeLength) {
// no more frame to generate
// filter out "fake" frames
@@ -6227,7 +6227,7 @@ public class ClassFile implements TypeConstants, TypeIds {
});
return result;
}
-
+
private TypeBinding getTypeBinding(char[] typeConstantPoolName, Scope scope, boolean checkcast) {
if (typeConstantPoolName.length == 1) {
// base type
@@ -6347,7 +6347,7 @@ public class ClassFile implements TypeConstants, TypeIds {
}
return type;
}
-
+
private boolean isLikelyLocalTypeName(char[] typeName) {
int dollarPos = CharOperation.lastIndexOf('$', typeName);
while (dollarPos != -1 && dollarPos+1 < typeName.length) {
@@ -6446,7 +6446,7 @@ public class ClassFile implements TypeConstants, TypeIds {
Map<Integer, StackMapFrame> frames,
boolean isClinit,
Scope scope) {
- Set realJumpTarget = new HashSet();
+ Set realJumpTarget = new HashSet();
StackMapFrameCodeStream stackMapFrameCodeStream = (StackMapFrameCodeStream) this.codeStream;
int[] framePositions = stackMapFrameCodeStream.getFramePositions();
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/CompilationResult.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/CompilationResult.java
index 323aad2a0..d4ce98922 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/CompilationResult.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/CompilationResult.java
@@ -619,7 +619,7 @@ public int requestSyntheticSourcePosition(int syntheticLineNumber) {
int oldLen = this.lineSeparatorPositions.length;
assert oldLen <= syntheticLineNumber : "Synthetic line numbers must be higher than existing ones."; //$NON-NLS-1$
int newStartPos = oldEndPos;
- System.arraycopy(this.lineSeparatorPositions, 0,
+ System.arraycopy(this.lineSeparatorPositions, 0,
this.lineSeparatorPositions = new int[syntheticLineNumber], 0, oldLen);
for (int i=oldLen; i<syntheticLineNumber; i++) {
newStartPos += 2;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/Compiler.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/Compiler.java
index 620a94142..695ef2fe0 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/Compiler.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/Compiler.java
@@ -12,7 +12,7 @@
* IBM Corporation - initial API and implementation
* Fraunhofer FIRST - extended API and implementation
* Technical University Berlin - extended API and implementation
- * Stephan Herrmann - contributions for
+ * Stephan Herrmann - contributions for
* bug 337868 - [compiler][model] incomplete support for package-info.java when using SearchableEnvironment
* bug 186342 - [compiler][null] Using annotations for null checking
*******************************************************************************/
@@ -81,7 +81,7 @@ public class Compiler implements ITypeRequestor, ProblemSeverities {
//public CompilationUnitResult currentCompilationUnitResult;
public CompilationUnitDeclaration[] unitsToProcess;
public int totalUnits; // (totalUnits-1) gives the last unit in unitToProcess
-
+
private Map<String, APTProblem[]> aptProblems;
// name lookup
@@ -575,7 +575,7 @@ public class Compiler implements ITypeRequestor, ProblemSeverities {
this.context = context;
}
}
-
+
protected void backupAptProblems() {
if (this.unitsToProcess == null) return;
for (int i = 0; i < this.totalUnits; i++) {
@@ -604,7 +604,7 @@ public class Compiler implements ITypeRequestor, ProblemSeverities {
}
}
}
-
+
protected void restoreAptProblems() {
if (this.unitsToProcess != null && this.aptProblems!= null) {
for (int i = 0; i < this.totalUnits; i++) {
@@ -983,7 +983,7 @@ public class Compiler implements ITypeRequestor, ProblemSeverities {
long analyzeStart = System.currentTimeMillis();
this.stats.resolveTime += analyzeStart - resolveStart;
/*
- //No need of analysis or generation of code if statements are not required
+ //No need of analysis or generation of code if statements are not required
if (!this.options.ignoreMethodBodies) unit.analyseCode(); // flow analysis
*/
/*OT:*/ Dependencies.ensureState(unit, ITranslationStates.STATE_BYTE_CODE_GENERATED-1);
@@ -1076,9 +1076,9 @@ public class Compiler implements ITypeRequestor, ProblemSeverities {
this.annotationProcessorManager.reset();
}
} while (newUnitSize != 0 || newClassFilesSize != 0);
-
+
this.annotationProcessorManager.processAnnotations(null, null, true);
- // process potential units added in the final round see 329156
+ // process potential units added in the final round see 329156
ICompilationUnit[] newUnits = this.annotationProcessorManager.getNewUnits();
newUnitSize = newUnits.length;
if (newUnitSize != 0) {
@@ -1210,9 +1210,9 @@ public class Compiler implements ITypeRequestor, ProblemSeverities {
//{ObjectTeams: hook for subclasses needing more setting up:
protected Config setupDependencies(boolean verifyMethods, boolean analyzeCode, boolean generateCode) {
return Dependencies.setup(this, this.parser, this.lookupEnvironment,
- verifyMethods,
- analyzeCode && !this.options.ignoreMethodBodies,
- generateCode && !this.options.ignoreMethodBodies,
+ verifyMethods,
+ analyzeCode && !this.options.ignoreMethodBodies,
+ generateCode && !this.options.ignoreMethodBodies,
true, true, false);
}
// SH}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java
index 1debc7459..124b1d938 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java
@@ -14,7 +14,7 @@
* Karen Moore - fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=207411
* Fraunhofer FIRST - extended API and implementation
* Technical University Berlin - extended API and implementation
- * Stephan Herrmann <stephan@cs.tu-berlin.de> - Contributions for
+ * Stephan Herrmann <stephan@cs.tu-berlin.de> - Contributions for
* bug 185682 - Increment/decrement operators mark local variables as read
* bug 186342 - [compiler][null] Using annotations for null checking
* bug 365519 - editorial cleanup after bug 186342 and bug 365387
@@ -38,7 +38,7 @@
* Bug 441693 - [1.8][null] Bogus warning for type argument annotated with @NonNull
* Bug 434483 - [1.8][compiler][inference] Type inference not picked up with method reference
* Bug 446442 - [1.8] merge null annotations from super methods
- * Bug 437072 - [compiler][null] Null analysis emits possibly incorrect warning for new int[][] despite @NonNullByDefault
+ * Bug 437072 - [compiler][null] Null analysis emits possibly incorrect warning for new int[][] despite @NonNullByDefault
* Jesper S Moller - Contributions for
* bug 382721 - [1.8][compiler] Effectively final variables needs special treatment
* bug 412153 - [1.8][compiler] Check validity of annotations which may be repeatable
@@ -175,7 +175,7 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
// for msg or field references
public static final int NeedReceiverGenericCast = Bit19;
-
+
// for this reference
public static final int IsImplicitThis = Bit3;
@@ -234,10 +234,10 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
// for all method/constructor invocations (msg, alloc, expl. constr call)
public static final int Unchecked = Bit17;
-
+
// for javadoc - used to indicate whether the javadoc has to be resolved
public static final int ResolveJavadoc = Bit17;
-
+
// for empty statement
public static final int IsUsefulEmptyStatement = Bit1;
@@ -323,7 +323,7 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
// for all declarations that can contain type references that have type annotations
public static final int HasTypeAnnotations = Bit21;
-
+
// for type reference (diamond case) - Java 7
public static final int IsUnionType = Bit30;
// Used to tag ParameterizedSingleTypeReference or ParameterizedQualifiedTypeReference when they are
@@ -337,10 +337,10 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
// for annotation reference, signal if annotation was created from a default:
// also used for implicit method creation of records Java 14
public static final int IsSynthetic = ASTNode.Bit7;
-
+
// for all reference context entries.
public static final int HasFunctionalInterfaceTypes = ASTNode.Bit22;
-
+
public static final Argument [] NO_ARGUMENTS = new Argument [0];
public ASTNode() {
@@ -365,7 +365,7 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
}
//{ObjectTeams: make overridable:
/* orig:
- public static boolean checkInvocationArguments(BlockScope scope, Expression receiver, TypeBinding receiverType, MethodBinding method, Expression[] arguments, TypeBinding[] argumentTypes, boolean argsContainCast, InvocationSite invocationSite) {
+ public static boolean checkInvocationArguments(BlockScope scope, Expression receiver, TypeBinding receiverType, MethodBinding method, Expression[] arguments, TypeBinding[] argumentTypes, boolean argsContainCast, InvocationSite invocationSite) {
:giro */
public boolean checkInvocationArguments(BlockScope scope, Expression receiver, TypeBinding receiverType, MethodBinding method, Expression[] arguments, TypeBinding[] argumentTypes, boolean argsContainCast, InvocationSite invocationSite) {
// SH}
@@ -421,7 +421,7 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
for (int i = lastIndex; i < argLength; i++) {
invocationStatus |= checkInvocationArgument(scope, arguments[i], parameterType, argumentTypes[i], originalRawParam);
}
- }
+ }
if (paramLength == argLength) { // 70056
int varargsIndex = paramLength - 1;
ArrayBinding varargsType = (ArrayBinding) params[varargsIndex];
@@ -461,7 +461,7 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
if (scope.compilerOptions().reportUnavoidableGenericTypeProblems || receiver == null || !receiver.forcedToBeRaw(scope.referenceContext())) {
scope.problemReporter().unsafeRawInvocation((ASTNode)invocationSite, method);
}
- } else if (rawOriginalGenericMethod != null
+ } else if (rawOriginalGenericMethod != null
|| uncheckedBoundCheck
|| ((invocationStatus & INVOCATION_ARGUMENT_UNCHECKED) != 0)) {
if (method instanceof ParameterizedGenericMethodBinding) {
@@ -478,11 +478,11 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
}
public final boolean isFieldUseDeprecated(FieldBinding field, Scope scope, int filteredBits) {
- if ((this.bits & ASTNode.InsideJavadoc) == 0 // ignore references inside Javadoc comments
+ if ((this.bits & ASTNode.InsideJavadoc) == 0 // ignore references inside Javadoc comments
&& (filteredBits & IsStrictlyAssigned) == 0 // ignore write access
- && field.isOrEnclosedByPrivateType()
- && !scope.isDefinedInField(field)) // ignore cases where field is used from inside itself
- {
+ && field.isOrEnclosedByPrivateType()
+ && !scope.isDefinedInField(field)) // ignore cases where field is used from inside itself
+ {
if (((filteredBits & IsCompoundAssigned) != 0))
// used, but usage may not be relevant
field.original().compoundUseFlag++;
@@ -593,7 +593,7 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
return false;
}
-
+
public boolean isUnqualifiedSuper() {
return false;
}
@@ -730,7 +730,7 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
* After method lookup has produced 'methodBinding' but when poly expressions have been seen as arguments,
* inspect the arguments to trigger another round of resolving with improved target types from the methods parameters.
* If this resolving produces better types for any arguments, update the 'argumentTypes' array in-place as an
- * intended side effect that will feed better type information in checkInvocationArguments() and others.
+ * intended side effect that will feed better type information in checkInvocationArguments() and others.
* @param invocation the outer invocation which is being resolved
* @param method the method produced by lookup (possibly involving type inference).
* @param argumentTypes the argument types as collected from first resolving the invocation arguments and as used for the method lookup.
@@ -757,7 +757,7 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
continue; // not much we can do without a target type, assume it only happens after some resolve error
if (argumentTypes[i] != null && argumentTypes[i].isPolyType()) {
argument.setExpectedType(parameterType);
- TypeBinding updatedArgumentType;
+ TypeBinding updatedArgumentType;
if (argument instanceof LambdaExpression) {
LambdaExpression lambda = (LambdaExpression) argument;
// avoid complaining about non-kosher descriptor as secondary problem
@@ -805,7 +805,7 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
if (recipient instanceof SourceTypeBinding)
((SourceTypeBinding) recipient).evaluateNullAnnotations();
}
-
+
/**
* Resolve annotations, and check duplicates, answers combined tagBits
* for recognized standard annotations. Return null if nothing new is
@@ -843,7 +843,7 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
//{ObjectTeams: method mappings
case Binding.BINDING :
CallinCalloutBinding mapping = (CallinCalloutBinding) recipient;
- if ((mapping.tagBits & TagBits.AnnotationResolved) != 0)
+ if ((mapping.tagBits & TagBits.AnnotationResolved) != 0)
return annotations;
mapping.tagBits |= TagBits.AnnotationResolved;
if (length > 0) {
@@ -962,9 +962,9 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
}
}
- /* See if the recipient is meta-annotated with @Repeatable and if so validate constraints. We can't do this during resolution of @Repeatable itself as @Target and
+ /* See if the recipient is meta-annotated with @Repeatable and if so validate constraints. We can't do this during resolution of @Repeatable itself as @Target and
@Retention etc could come later
- */
+ */
if (recipient != null && recipient.isTaggedRepeatable()) {
for (int i = 0; i < length; i++) {
Annotation annotation = sourceAnnotations[i];
@@ -973,7 +973,7 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
annotation.checkRepeatableMetaAnnotation(scope);
}
}
-
+
// check duplicate annotations
if (annotations != null && length > 1) {
AnnotationBinding[] distinctAnnotations = annotations; // only copy after 1st duplicate is detected
@@ -1033,12 +1033,12 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
copySE8AnnotationsToType(scope, recipient, sourceAnnotations, false);
return annotations;
}
-
+
/** Resolve JSR308 annotations on a type reference, array creation expression or a wildcard. Type parameters go directly to the subroutine,
By construction the bindings associated with QTR, PQTR etc get resolved first and then annotations for different levels get resolved
and applied at one go. Likewise for multidimensional arrays.
-
- @Returns the annotated type binding.
+
+ @Returns the annotated type binding.
*/
public static TypeBinding resolveAnnotations(BlockScope scope, Annotation[][] sourceAnnotations, TypeBinding type) {
int levels = sourceAnnotations == null ? 0 : sourceAnnotations.length;
@@ -1058,7 +1058,7 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
/**
* "early" handling of NonNullByDefault because for local variables annotations are resolved after their type because of bug
* 96991.
- * @param localDeclaration
+ * @param localDeclaration
*/
public static void handleNonNullByDefault(BlockScope scope, Annotation[] sourceAnnotations, LocalDeclaration localDeclaration) {
if (sourceAnnotations == null || sourceAnnotations.length == 0) {
@@ -1092,13 +1092,13 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
}
-
+
// When SE8 annotations feature in SE7 locations, they get attributed to the declared entity. Copy/move these to the type of the declared entity (field, local, argument etc.)
public static void copySE8AnnotationsToType(BlockScope scope, Binding recipient, Annotation[] annotations, boolean annotatingEnumerator) {
-
+
if (annotations == null || annotations.length == 0 || recipient == null)
return;
-
+
long recipientTargetMask = 0;
switch (recipient.kind()) {
case Binding.LOCAL:
@@ -1114,7 +1114,7 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
default:
return;
}
-
+
AnnotationBinding [] se8Annotations = null;
int se8count = 0;
long se8nullBits = 0;
@@ -1213,11 +1213,11 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
}
private static TypeBinding mergeAnnotationsIntoType(BlockScope scope, AnnotationBinding[] se8Annotations, long se8nullBits, Annotation se8NullAnnotation,
- TypeReference typeRef, TypeBinding existingType)
+ TypeReference typeRef, TypeBinding existingType)
{
if (existingType == null || !existingType.isValidBinding()) return existingType;
TypeReference unionRef = typeRef.isUnionType() ? ((UnionTypeReference) typeRef).typeReferences[0] : null;
-
+
// for arrays: @T X[] SE7 associates @T to the type, but in SE8 it affects the leaf component type
TypeBinding oldLeafType = (unionRef == null) ? existingType.leafComponentType() : unionRef.resolvedType;
if (se8nullBits != 0) {
@@ -1371,12 +1371,12 @@ public static void resolveDeprecatedAnnotations(BlockScope scope, Annotation[] a
public boolean checkingPotentialCompatibility() {
return false;
}
-
+
public void acceptPotentiallyCompatibleMethods(MethodBinding [] methods) {
- // Discard. Interested subclasses should override and grab these goodies.
+ // Discard. Interested subclasses should override and grab these goodies.
}
// --- "default methods" for InvocationSite
-
+
public int sourceStart() {
return this.sourceStart;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java
index 56d1b2c98..4cb34088c 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java
@@ -372,7 +372,7 @@ public abstract class AbstractMethodDeclaration
else if (methodBinding.parameters[i].isFreeTypeVariable()) {
flowInfo.markNullStatus(methodArguments[i].binding, FlowInfo.FREE_TYPEVARIABLE);
}
- } else {
+ } else {
if (methodBinding.parameterNonNullness != null) {
// leverage null-info from parameter annotations:
Boolean nonNullNess = methodBinding.parameterNonNullness[i];
@@ -490,7 +490,7 @@ public abstract class AbstractMethodDeclaration
restart = true;
} else {
restart = false;
- abort = true;
+ abort = true;
}
}
} while (restart);
@@ -516,7 +516,7 @@ public abstract class AbstractMethodDeclaration
// special body for abstract static:
int abstractStatic = ClassFileConstants.AccAbstract | ClassFileConstants.AccStatic;
if ( (this.binding.modifiers & abstractStatic) == abstractStatic
- && !this.binding.declaringClass.isInterface())
+ && !this.binding.declaringClass.isInterface())
{
// Code attribute
attributeNumber += generateAbstractStaticRoleMethodCode(classFile);
@@ -601,7 +601,7 @@ public abstract class AbstractMethodDeclaration
classFile.generateCodeAttributeHeader();
CodeStream codeStream = classFile.codeStream;
codeStream.reset(this, classFile);
- String errorMessage = this.scope.problemReporter().problemFactory.getLocalizedMessage(IProblem.AbstractStaticMethodCalled,
+ String errorMessage = this.scope.problemReporter().problemFactory.getLocalizedMessage(IProblem.AbstractStaticMethodCalled,
new String[]{new String(this.binding.readableName())});
codeStream.generateCodeAttributeForProblemMethod(errorMessage);
int[] startLineIndexes = this.compilationResult.getLineSeparatorPositions();
@@ -846,7 +846,7 @@ public abstract class AbstractMethodDeclaration
if (!(this.isGenerated || this.isCopied))
// SH}
resolveAnnotations(this.scope, this.annotations, this.binding, this.isConstructor());
-
+
long sourceLevel = this.scope.compilerOptions().sourceLevel;
if (sourceLevel < ClassFileConstants.JDK1_8) // otherwise already checked via Argument.createBinding
validateNullAnnotations(this.scope.environment().usesNullTypeAnnotations());
@@ -992,12 +992,12 @@ public abstract class AbstractMethodDeclaration
// similarly hide local types from copy inheritance:
SourceTypeBinding sourceType = this.scope.enclosingSourceType();
if (sourceType != null && sourceType.roleModel != null)
- sourceType.roleModel.purgeLocalTypes(this.sourceStart, this.declarationSourceEnd);
+ sourceType.roleModel.purgeLocalTypes(this.sourceStart, this.declarationSourceEnd);
}
}
// SH}
}
-
+
@Override
public void tagAsHavingIgnoredMandatoryErrors(int problemId) {
// Nothing to do for this context;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java
index caf794b11..3a02309c6 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java
@@ -37,7 +37,7 @@
* Bug 424930 - [1.8][compiler] Regression: "Cannot infer type arguments" error from compiler.
* Bug 427483 - [Java 8] Variables in lambdas sometimes can't be resolved
* Bug 427438 - [1.8][compiler] NPE at org.eclipse.jdt.internal.compiler.ast.ConditionalExpression.generateCode(ConditionalExpression.java:280)
- * Bug 426996 - [1.8][inference] try to avoid method Expression.unresolve()?
+ * Bug 426996 - [1.8][inference] try to avoid method Expression.unresolve()?
* Bug 428352 - [1.8][compiler] Resolution errors don't always surface
* Bug 429203 - [1.8][compiler] NPE in AllocationExpression.binding
* Bug 429430 - [1.8] Lambdas and method reference infer wrong exception type with generics (RuntimeException instead of IOException)
@@ -122,7 +122,7 @@ public class AllocationExpression extends Expression implements IPolyExpression,
public boolean argsContainCast;
public TypeBinding[] argumentTypes = Binding.NO_PARAMETERS;
public boolean argumentsHaveErrors = false;
-
+
//{ObjectTeams: alternate AST in case the creation needs to be redirected through a creator call:
private MessageSend roleCreatorCall = null;
private NameReference valueParam; // if allocation type has value parameter: synthesized argument for ctor call
@@ -145,8 +145,8 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl
// process arguments
if (this.arguments != null) {
boolean analyseResources = currentScope.compilerOptions().analyseResourceLeaks;
- boolean hasResourceWrapperType = analyseResources
- && this.resolvedType instanceof ReferenceBinding
+ boolean hasResourceWrapperType = analyseResources
+ && this.resolvedType instanceof ReferenceBinding
&& ((ReferenceBinding)this.resolvedType).hasTypeBit(TypeIds.BitWrapperCloseable);
for (int i = 0, count = this.arguments.length; i < count; i++) {
flowInfo =
@@ -168,7 +168,7 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl
if ((this.bits & ASTNode.Unchecked) != 0 && this.genericTypeArguments == null) {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=277643, align with javac on JLS 15.12.2.6
thrownExceptions = currentScope.environment().convertToRawTypes(this.binding.thrownExceptions, true, true);
- }
+ }
// check exception handling
flowContext.checkExceptionHandlers(
thrownExceptions,
@@ -183,7 +183,7 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl
ReferenceBinding declaringClass = this.binding.declaringClass;
MethodScope methodScope = currentScope.methodScope();
- if ((declaringClass.isMemberType() && !declaringClass.isStatic()) ||
+ if ((declaringClass.isMemberType() && !declaringClass.isStatic()) ||
(declaringClass.isLocalType() && !methodScope.isStatic && methodScope.isLambdaScope())) {
// allocating a non-static member type without an enclosing instance of parent type
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=335845
@@ -364,7 +364,7 @@ public void manageSyntheticAccessIfNecessary(BlockScope currentScope, FlowInfo f
// SH}
ReferenceBinding declaringClass;
- if (codegenBinding.isPrivate() &&
+ if (codegenBinding.isPrivate() &&
!currentScope.enclosingSourceType().isNestmateOf(this.binding.declaringClass) &&
TypeBinding.notEquals(currentScope.enclosingSourceType(), (declaringClass = codegenBinding.declaringClass))) {
@@ -506,7 +506,7 @@ public TypeBinding resolveType(BlockScope scope) {
this.argumentsHaveErrors = true;
} else {
// orig:
- if (this.arguments[i].resolvedType != null)
+ if (this.arguments[i].resolvedType != null)
scope.problemReporter().genericInferenceError("Argument was unexpectedly found resolved", this); //$NON-NLS-1$
if ((this.argumentTypes[i] = argument.resolveType(scope)) == null) {
this.argumentsHaveErrors = true;
@@ -559,7 +559,7 @@ public TypeBinding resolveType(BlockScope scope) {
scope.problemReporter().cannotInstantiate(this.type, this.resolvedType);
return this.resolvedType;
}
- }
+ }
if (isDiamond) {
this.binding = inferConstructorOfElidedParameterizedType(scope);
if (this.binding == null || !this.binding.isValidBinding()) {
@@ -754,7 +754,7 @@ public static MethodBinding inferDiamondConstructor(Scope scope, InvocationSite
ReferenceBinding genericType = ((ParameterizedTypeBinding) type).genericType();
ReferenceBinding enclosingType = type.enclosingType();
ParameterizedTypeBinding allocationType = scope.environment().createParameterizedType(genericType, genericType.typeVariables(), enclosingType);
-
+
// Given the allocation type and the arguments to the constructor, see if we can infer the constructor of the elided parameterized type.
MethodBinding factory = scope.getStaticFactory(allocationType, enclosingType, argumentTypes, site);
if (factory instanceof ParameterizedGenericMethodBinding && factory.isValidBinding()) {
@@ -764,7 +764,7 @@ public static MethodBinding inferDiamondConstructor(Scope scope, InvocationSite
TypeVariableBinding[] constructorTypeVariables = sfmb.getConstructor().typeVariables();
TypeBinding [] constructorTypeArguments = constructorTypeVariables != null ? new TypeBinding[constructorTypeVariables.length] : Binding.NO_TYPES;
if (constructorTypeArguments.length > 0)
- System.arraycopy(((ParameterizedGenericMethodBinding)factory).typeArguments, sfmb.typeVariables().length - constructorTypeArguments.length ,
+ System.arraycopy(((ParameterizedGenericMethodBinding)factory).typeArguments, sfmb.typeVariables().length - constructorTypeArguments.length ,
constructorTypeArguments, 0, constructorTypeArguments.length);
if (allocationType.isInterface()) {
ParameterizedTypeBinding parameterizedType = (ParameterizedTypeBinding) factory.returnType;
@@ -778,11 +778,11 @@ public TypeBinding[] inferElidedTypes(final Scope scope) {
return inferElidedTypes((ParameterizedTypeBinding) this.resolvedType, scope);
}
public TypeBinding[] inferElidedTypes(ParameterizedTypeBinding parameterizedType, final Scope scope) {
-
+
ReferenceBinding genericType = parameterizedType.genericType();
ReferenceBinding enclosingType = parameterizedType.enclosingType();
ParameterizedTypeBinding allocationType = scope.environment().createParameterizedType(genericType, genericType.typeVariables(), enclosingType);
-
+
/* Given the allocation type and the arguments to the constructor, see if we can synthesize a generic static factory
method that would, given the argument types and the invocation site, manufacture a parameterized object of type allocationType.
If we are successful then by design and construction, the parameterization of the return type of the factory method is identical
@@ -815,13 +815,13 @@ public void checkTypeArgumentRedundancy(ParameterizedTypeBinding allocationType,
if (i == allocationType.arguments.length) {
scope.problemReporter().redundantSpecificationOfTypeArguments(this.type, allocationType.arguments);
return;
- }
+ }
}
}
TypeBinding [] inferredTypes;
int previousBits = this.type.bits;
try {
- // checking for redundant type parameters must fake a diamond,
+ // checking for redundant type parameters must fake a diamond,
// so we infer the same results as we would get with a diamond in source code:
this.type.bits |= IsDiamond;
inferredTypes = inferElidedTypes(allocationType, scope);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java
index 65a86f125..70ae15ff7 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java
@@ -26,7 +26,7 @@
* Bug 429958 - [1.8][null] evaluate new DefaultLocation attribute of @NonNullByDefault
* Bug 435805 - [1.8][compiler][null] Java 8 compiler does not recognize declaration style null annotations
* Bug 457210 - [1.8][compiler][null] Wrong Nullness errors given on full build build but not on incremental build?
- * Bug 469584 - ClassCastException in Annotation.detectStandardAnnotation (320)
+ * Bug 469584 - ClassCastException in Annotation.detectStandardAnnotation (320)
* Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
* Bug 383624 - [1.8][compiler] Revive code generation support for type annotations (from Olivier's work)
* Bug 409517 - [1.8][compiler] Type annotation problems on more elaborate array references
@@ -62,28 +62,28 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.lookup.CallinCalloutB
*/
@SuppressWarnings({"rawtypes", "unchecked"})
public abstract class Annotation extends Expression {
-
+
Annotation persistibleAnnotation = this; // Emit this into class file, unless this is a repeating annotation, in which case package this into the designated container.
-
+
/**
* Return the location for the corresponding annotation inside the type reference, <code>null</code> if none.
*/
public static int[] getLocations(
final Expression reference,
final Annotation annotation) {
-
+
class LocationCollector extends ASTVisitor {
Stack typePathEntries;
Annotation searchedAnnotation;
boolean continueSearch = true;
-
+
public LocationCollector(Annotation currentAnnotation) {
this.typePathEntries = new Stack();
this.searchedAnnotation = currentAnnotation;
}
-
+
private int[] computeNestingDepth(TypeReference typeReference) {
- TypeBinding type = typeReference.resolvedType == null ? null : typeReference.resolvedType.leafComponentType();
+ TypeBinding type = typeReference.resolvedType == null ? null : typeReference.resolvedType.leafComponentType();
int[] nestingDepths = new int[typeReference.getAnnotatableLevels()];
if (type != null && type.isNestedType()) {
int depth = 0;
@@ -102,7 +102,7 @@ public abstract class Annotation extends Expression {
}
return nestingDepths;
}
-
+
private void inspectAnnotations(Annotation [] annotations) {
for (int i = 0, length = annotations == null ? 0 : annotations.length; this.continueSearch && i < length; i++) {
@@ -119,7 +119,7 @@ public abstract class Annotation extends Expression {
this.typePathEntries.push(TYPE_PATH_ELEMENT_ARRAY);
}
}
-
+
private void inspectTypeArguments(TypeReference[] typeReferences) {
for (int i = 0, length = typeReferences == null ? 0 : typeReferences.length; this.continueSearch && i < length; i++) {
int size = this.typePathEntries.size();
@@ -129,7 +129,7 @@ public abstract class Annotation extends Expression {
this.typePathEntries.setSize(size);
}
}
-
+
public boolean visit(TypeReference typeReference, BlockScope scope) {
if (this.continueSearch) {
inspectArrayDimensions(typeReference.getAnnotationsOnDimensions(), typeReference.dimensions());
@@ -151,18 +151,18 @@ public abstract class Annotation extends Expression {
}
}
}
- return false; // if annotation is not found in the type reference, it must be one from SE7 location, typePathEntries captures the proper path entries for them.
- }
+ return false; // if annotation is not found in the type reference, it must be one from SE7 location, typePathEntries captures the proper path entries for them.
+ }
@Override
public boolean visit(SingleTypeReference typeReference, BlockScope scope) {
return visit((TypeReference) typeReference, scope);
}
-
+
@Override
public boolean visit(ArrayTypeReference typeReference, BlockScope scope) {
return visit((TypeReference) typeReference, scope);
}
-
+
@Override
public boolean visit(ParameterizedSingleTypeReference typeReference, BlockScope scope) {
return visit((TypeReference) typeReference, scope);
@@ -172,17 +172,17 @@ public abstract class Annotation extends Expression {
public boolean visit(QualifiedTypeReference typeReference, BlockScope scope) {
return visit((TypeReference) typeReference, scope);
}
-
+
@Override
public boolean visit(ArrayQualifiedTypeReference typeReference, BlockScope scope) {
return visit((TypeReference) typeReference, scope);
}
-
+
@Override
public boolean visit(ParameterizedQualifiedTypeReference typeReference, BlockScope scope) {
return visit((TypeReference) typeReference, scope);
}
-
+
@Override
public boolean visit(Wildcard typeReference, BlockScope scope) {
visit((TypeReference) typeReference, scope);
@@ -210,7 +210,7 @@ public abstract class Annotation extends Expression {
}
return false;
}
-
+
@Override
public String toString() {
StringBuffer buffer = new StringBuffer();
@@ -252,7 +252,7 @@ public abstract class Annotation extends Expression {
static final int[] TYPE_PATH_ELEMENT_ARRAY = new int[]{0,0};
static final int[] TYPE_PATH_INNER_TYPE = new int[]{1,0};
static final int[] TYPE_PATH_ANNOTATION_ON_WILDCARD_BOUND = new int[]{2,0};
-
+
public int declarationSourceEnd;
public Binding recipient;
@@ -435,7 +435,7 @@ public abstract class Annotation extends Expression {
} else if (annotationType.hasNullBit(TypeIds.BitNonNullByDefaultAnnotation)) {
tagBits |= determineNonNullByDefaultTagBits(annotationType, valueAttribute);
}
-
+
return tagBits;
}
@@ -470,7 +470,7 @@ public abstract class Annotation extends Expression {
/**
* Convert the value() attribute of @NonNullByDefault into a bitvector a la {@link Binding#NullnessDefaultMASK}.
* This method understands value encodings from source and binary types.
- *
+ *
* <b>pre:</b> null annotation analysis is enabled
*/
public static int nullLocationBitsFromAnnotationValue(Object value) {
@@ -531,7 +531,7 @@ public abstract class Annotation extends Expression {
}
return 0;
}
-
+
public static int nullLocationBitsFromElementTypeAnnotationValue(Object value) {
if (value instanceof Object[]) {
if (((Object[]) value).length == 0) { // ({})
@@ -575,7 +575,7 @@ public abstract class Annotation extends Expression {
return 0;
}
-
+
static String getRetentionName(long tagBits) {
if ((tagBits & TagBits.AnnotationRuntimeRetention) == TagBits.AnnotationRuntimeRetention) {
// TagBits.AnnotationRuntimeRetention combines both TagBits.AnnotationClassRetention & TagBits.AnnotationSourceRetention
@@ -594,22 +594,22 @@ public abstract class Annotation extends Expression {
}
public void checkRepeatableMetaAnnotation(BlockScope scope) {
-
+
// `this' is the @Repeatable meta annotation, its recipient is the *repeatable* annotation type - we are at the declaration site, not the repeating use site.
-
+
ReferenceBinding repeatableAnnotationType = (ReferenceBinding) this.recipient; // know it to be an annotation type. On target miss we don't get here
-
+
MemberValuePair[] valuePairs = this.memberValuePairs();
if (valuePairs == null || valuePairs.length != 1)
return;
-
+
Object value = valuePairs[0].compilerElementPair.value;
if (!(value instanceof ReferenceBinding))
return; // Has deeper problems, will bark elsewhere.
ReferenceBinding containerAnnotationType = (ReferenceBinding) value;
if (!containerAnnotationType.isAnnotationType())
return; // Has deeper problems, will bark elsewhere.
-
+
repeatableAnnotationType.setContainerAnnotationType(containerAnnotationType); // For now. May be reset later to PRB in case of problems.
checkContainerAnnotationType(valuePairs[0], scope, containerAnnotationType, repeatableAnnotationType, false); // false => not use site, i.e declaration site error reporting requested.
}
@@ -642,34 +642,34 @@ public abstract class Annotation extends Expression {
if (useSite)
checkContainingAnnotationTargetAtUse((Annotation) culpritNode, scope, containerAnnotationType, repeatableAnnotationType);
- else
+ else
checkContainerAnnotationTypeTarget(culpritNode, scope, containerAnnotationType, repeatableAnnotationType);
-
+
long annotationTypeBits = getAnnotationRetention(repeatableAnnotationType);
- long containerTypeBits = getAnnotationRetention(containerAnnotationType);
+ long containerTypeBits = getAnnotationRetention(containerAnnotationType);
// Due to clever layout of the bits, we can compare the absolute value directly
if (containerTypeBits < annotationTypeBits) {
repeatableAnnotationType.tagAsHavingDefectiveContainerType();
scope.problemReporter().containerAnnotationTypeHasShorterRetention(culpritNode, repeatableAnnotationType, getRetentionName(annotationTypeBits), containerAnnotationType, getRetentionName(containerTypeBits));
}
-
+
if ((repeatableAnnotationType.getAnnotationTagBits() & TagBits.AnnotationDocumented) != 0 && (containerAnnotationType.getAnnotationTagBits() & TagBits.AnnotationDocumented) == 0) {
repeatableAnnotationType.tagAsHavingDefectiveContainerType();
scope.problemReporter().repeatableAnnotationTypeIsDocumented(culpritNode, repeatableAnnotationType, containerAnnotationType);
}
-
+
if ((repeatableAnnotationType.getAnnotationTagBits() & TagBits.AnnotationInherited) != 0 && (containerAnnotationType.getAnnotationTagBits() & TagBits.AnnotationInherited) == 0) {
repeatableAnnotationType.tagAsHavingDefectiveContainerType();
scope.problemReporter().repeatableAnnotationTypeIsInherited(culpritNode, repeatableAnnotationType, containerAnnotationType);
}
}
-
+
// This is for error reporting for bad targets at annotation type declaration site (as opposed to the repeat site)
private static void checkContainerAnnotationTypeTarget(ASTNode culpritNode, Scope scope, ReferenceBinding containerType, ReferenceBinding repeatableAnnotationType) {
long tagBits = repeatableAnnotationType.getAnnotationTagBits();
if ((tagBits & TagBits.AnnotationTargetMASK) == 0)
tagBits = TagBits.SE7AnnotationTargetMASK; // absence of @Target meta-annotation implies all SE7 targets not all targets.
-
+
long containerAnnotationTypeTypeTagBits = containerType.getAnnotationTagBits();
if ((containerAnnotationTypeTypeTagBits & TagBits.AnnotationTargetMASK) == 0)
containerAnnotationTypeTypeTagBits = TagBits.SE7AnnotationTargetMASK;
@@ -731,7 +731,7 @@ public abstract class Annotation extends Expression {
}
}
}
-
+
// This is for error reporting for bad targets at the repeated annotation use site (as opposed to repeatable annotation type declaration site) - Leads to better message.
public static void checkContainingAnnotationTargetAtUse(Annotation repeatingAnnotation, BlockScope scope, TypeBinding containerAnnotationType, TypeBinding repeatingAnnotationType) {
// check (meta)target compatibility
@@ -757,7 +757,7 @@ public abstract class Annotation extends Expression {
// we need to filter out only "pure" type use and type parameter annotations, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=392119
if ((metaTagBits & (TagBits.AnnotationForTypeParameter | TagBits.AnnotationForTypeUse)) != 0) {
- if ((metaTagBits & TagBits.SE7AnnotationTargetMASK) == 0) { // not a hybrid target.
+ if ((metaTagBits & TagBits.SE7AnnotationTargetMASK) == 0) { // not a hybrid target.
return false;
}
}
@@ -1090,10 +1090,10 @@ public abstract class Annotation extends Expression {
LocalDeclaration localDeclaration = variable.declaration;
recordSuppressWarnings(scope, localDeclaration.declarationSourceStart, localDeclaration.declarationSourceEnd, compilerOptions.suppressWarnings);
}
- // note: defaultNullness for local declarations has been already been handled earlier by handleNonNullByDefault()
+ // note: defaultNullness for local declarations has been already been handled earlier by handleNonNullByDefault()
break;
}
- }
+ }
if (kind == Binding.TYPE) {
SourceTypeBinding sourceType = (SourceTypeBinding) this.recipient;
if (CharOperation.equals(sourceType.sourceName, TypeConstants.PACKAGE_INFO_NAME))
@@ -1118,7 +1118,7 @@ public abstract class Annotation extends Expression {
}
ReferenceBinding annotationType = (ReferenceBinding) typeBinding;
-
+
if (!annotationType.hasNullBit(TypeIds.BitNonNullByDefaultAnnotation)) {
return 0;
}
@@ -1149,11 +1149,11 @@ public abstract class Annotation extends Expression {
long tagBits = determineNonNullByDefaultTagBits(annotationType, valueAttribute);
return (int) (tagBits & Binding.NullnessDefaultMASK);
}
-
+
public enum AnnotationTargetAllowed {
YES, TYPE_ANNOTATION_ON_QUALIFIED_NAME, NO;
}
-
+
private static AnnotationTargetAllowed isAnnotationTargetAllowed(Binding recipient, BlockScope scope, TypeBinding annotationType, int kind, long metaTagBits) {
switch (kind) {
case Binding.PACKAGE :
@@ -1318,7 +1318,7 @@ public abstract class Annotation extends Expression {
AnnotationTargetAllowed annotationTargetAllowed = isAnnotationTargetAllowed(annotation, scope, annotationType, kind);
if (annotationTargetAllowed != AnnotationTargetAllowed.YES) {
if(annotationTargetAllowed == AnnotationTargetAllowed.TYPE_ANNOTATION_ON_QUALIFIED_NAME) {
- scope.problemReporter().typeAnnotationAtQualifiedName(annotation);
+ scope.problemReporter().typeAnnotationAtQualifiedName(annotation);
} else {
scope.problemReporter().disallowedTargetForAnnotation(annotation);
}
@@ -1337,15 +1337,15 @@ public abstract class Annotation extends Expression {
// Fail fast if the repeating annotation type can't be a container, anyway
MethodBinding[] valueMethods = repeatedAnnotationType.getMethods(TypeConstants.VALUE);
if (valueMethods.length != 1) return; // No violations possible
-
+
TypeBinding methodReturnType = valueMethods[0].returnType;
- // value must be an array
+ // value must be an array
if (! methodReturnType.isArrayType() || methodReturnType.dimensions() != 1) return;
-
+
ArrayBinding array = (ArrayBinding) methodReturnType;
TypeBinding elementsType = array.elementsType();
if (! elementsType.isRepeatableAnnotationType()) return; // Can't be a problem, then
-
+
for (int i= 0; i < sourceAnnotations.length; ++i) {
Annotation annotation = sourceAnnotations[i];
if (TypeBinding.equalsEquals(elementsType, annotation.resolvedType)) {
@@ -1366,7 +1366,7 @@ public abstract class Annotation extends Expression {
}
return true;
}
-
+
// Complain if an attempt to annotate the enclosing type of a static member type is being made.
public static void isTypeUseCompatible(TypeReference reference, Scope scope, Annotation[] annotations) {
if (annotations == null || reference == null || reference.getAnnotatableLevels() == 1)
@@ -1413,7 +1413,7 @@ public abstract class Annotation extends Expression {
public Annotation getPersistibleAnnotation() {
return this.persistibleAnnotation; // will be this for non-repeating annotation, the container for the first of the repeating ones and null for the followers.
}
-
+
public void setPersistibleAnnotation(ContainerAnnotation container) {
this.persistibleAnnotation = container; // will be a legitimate container for the first of the repeating ones and null for the followers.
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AnnotationMethodDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AnnotationMethodDeclaration.java
index 018946947..b75eae8a0 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AnnotationMethodDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AnnotationMethodDeclaration.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/compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java
index 3e0317ffc..634931b4f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java
@@ -58,7 +58,7 @@ public class Argument extends LocalDeclaration {
}
this.bits |= (IsLocalDeclarationReachable | IsArgument);
}
-
+
@Override
public boolean isRecoveredFromLoneIdentifier() {
return false;
@@ -86,7 +86,7 @@ public class Argument extends LocalDeclaration {
public TypeBinding createBinding(MethodScope scope, TypeBinding typeBinding) {
if (this.binding == null) {
- // for default constructors and fake implementation of abstract methods
+ // for default constructors and fake implementation of abstract methods
this.binding = new LocalVariableBinding(this, typeBinding, this.modifiers, scope);
//{ObjectTeams: NPE occurred in Java5.testA119_nestedValueParameter8() ff.
/* orig:
@@ -188,14 +188,14 @@ public class Argument extends LocalDeclaration {
public boolean isVarArgs() {
return this.type != null && (this.type.bits & IsVarArgs) != 0;
}
-
+
public boolean hasElidedType() {
return (this.bits & IsTypeElided) != 0;
}
public boolean hasNullTypeAnnotation(AnnotationPosition position) {
// parser associates SE8 annotations to the declaration
- return TypeReference.containsNullAnnotation(this.annotations) ||
+ return TypeReference.containsNullAnnotation(this.annotations) ||
(this.type != null && this.type.hasNullTypeAnnotation(position)); // just in case
}
@@ -262,7 +262,7 @@ public class Argument extends LocalDeclaration {
scope.problemReporter().localVariableHiding(this, existingVariable, false);
}
}
-
+
if ((this.type.bits & ASTNode.IsUnionType) != 0) {
this.binding = new CatchParameterBinding(this, exceptionType, this.modifiers | ClassFileConstants.AccFinal, false); // argument decl, but local var (where isArgument = false)
this.binding.tagBits |= TagBits.MultiCatchParameter;
@@ -271,7 +271,7 @@ public class Argument extends LocalDeclaration {
}
resolveAnnotations(scope, this.annotations, this.binding, true);
Annotation.isTypeUseCompatible(this.type, scope, this.annotations);
- if (scope.compilerOptions().isAnnotationBasedNullAnalysisEnabled &&
+ if (scope.compilerOptions().isAnnotationBasedNullAnalysisEnabled &&
(this.type.hasNullTypeAnnotation(AnnotationPosition.ANY) || TypeReference.containsNullAnnotation(this.annotations)))
{
scope.problemReporter().nullAnnotationUnsupportedLocation(this.type);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java
index ccee99f84..dd48533ef 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java
@@ -10,7 +10,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Stephan Herrmann - Contributions for
+ * Stephan Herrmann - Contributions for
* bug 368546 - [compiler][resource] Avoid remaining false positives found when compiling the Eclipse SDK
* bug 370639 - [compiler][resource] restore the default for resource leak warnings
* bug 388996 - [compiler][resource] Incorrect 'potential resource leak'
@@ -69,7 +69,7 @@ public class ArrayInitializer extends Expression {
public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean valueRequired) {
generateCode(null, null, currentScope, codeStream, valueRequired);
}
-
+
/**
* Code generation for a array initializer
*/
@@ -198,7 +198,7 @@ public class ArrayInitializer extends Expression {
if (TypeBinding.notEquals(elementType, expressionType)) // must call before computeConversion() and typeMismatchError()
scope.compilationUnitScope().recordTypeConversion(elementType, expressionType);
- if (expression.isConstantValueOfTypeAssignableToType(expressionType, elementType)
+ if (expression.isConstantValueOfTypeAssignableToType(expressionType, elementType)
|| expressionType.isCompatibleWith(elementType)) {
expression.computeConversion(scope, elementType, expressionType);
} else if (isBoxingCompatible(expressionType, elementType, expression, scope)) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.java
index fa7d0c157..e8e78285f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.java
@@ -30,7 +30,7 @@ public class ArrayQualifiedTypeReference extends QualifiedTypeReference {
super( sources , poss);
this.dimensions = dim ;
- this.annotationsOnDimensions = null;
+ this.annotationsOnDimensions = null;
}
public ArrayQualifiedTypeReference(char[][] sources, int dim, Annotation[][] annotationsOnDimensions, long[] poss) {
@@ -45,7 +45,7 @@ public class ArrayQualifiedTypeReference extends QualifiedTypeReference {
return this.dimensions;
}
-
+
@Override
public int extraDimensions() {
return this.extendedDimensions;
@@ -64,7 +64,7 @@ public class ArrayQualifiedTypeReference extends QualifiedTypeReference {
System.arraycopy(this.annotationsOnDimensions, 0, externalAnnotations, this.extendedDimensions, baseDimensions);
return externalAnnotations;
}
-
+
@Override
public void setAnnotationsOnDimensions(Annotation [][] annotationsOnDimensions) {
this.annotationsOnDimensions = annotationsOnDimensions;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.java
index 37773b3dc..9fe6a31f3 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.java
@@ -65,7 +65,7 @@ public class ArrayTypeReference extends SingleTypeReference {
return this.dimensions;
}
-
+
@Override
public int extraDimensions() {
return this.extendedDimensions;
@@ -84,7 +84,7 @@ public class ArrayTypeReference extends SingleTypeReference {
System.arraycopy(this.annotationsOnDimensions, 0, externalAnnotations, this.extendedDimensions, baseDimensions);
return externalAnnotations;
}
-
+
@Override
public void setAnnotationsOnDimensions(Annotation [][] annotationsOnDimensions) {
this.annotationsOnDimensions = annotationsOnDimensions;
@@ -268,7 +268,7 @@ public class ArrayTypeReference extends SingleTypeReference {
}
return scope.environment().createAnnotatedType(typeBinding, newAnnots);
}
-
+
@Override
public boolean hasNullTypeAnnotation(AnnotationPosition position) {
switch (position) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AssertStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AssertStatement.java
index 7fc731fdc..87b5d8eeb 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AssertStatement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AssertStatement.java
@@ -55,7 +55,7 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl
this.assertExpression.checkNPEbyUnboxing(currentScope, flowContext, flowInfo);
boolean isOptimizedTrueAssertion = cst != Constant.NotAConstant && cst.booleanValue() == true;
boolean isOptimizedFalseAssertion = cst != Constant.NotAConstant && cst.booleanValue() == false;
-
+
flowContext.tagBits |= FlowContext.HIDE_NULL_COMPARISON_WARNING;
FlowInfo conditionFlowInfo = this.assertExpression.analyseCode(currentScope, flowContext, flowInfo.copy());
flowContext.extendTimeToLiveForNullCheckedField(1); // survive this assert as a Statement
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java
index 068ee0f72..592ee6d77 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java
@@ -97,7 +97,7 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl
// just a local variable.
LocalVariableBinding local = this.lhs.localVariableBinding();
this.expression.checkNPEbyUnboxing(currentScope, flowContext, flowInfo);
-
+
FlowInfo preInitInfo = null;
CompilerOptions compilerOptions = currentScope.compilerOptions();
boolean shouldAnalyseResource = local != null
@@ -113,7 +113,7 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl
// analysis of resource leaks needs additional context while analyzing the RHS:
FakedTrackingVariable.preConnectTrackerAcrossAssignment(this, local, this.expression, flowInfo);
}
-
+
flowInfo = ((Reference) this.lhs)
.analyseAssignment(currentScope, flowContext, flowInfo, this, false)
.unconditionalInits();
@@ -243,7 +243,7 @@ public TypeBinding resolveType(BlockScope scope) {
this.resolvedType = lhsType.capture(scope, this.lhs.sourceStart, this.lhs.sourceEnd); // make it unique, `this' shares source end with 'this.expression'.
}
LocalVariableBinding localVariableBinding = this.lhs.localVariableBinding();
- if (localVariableBinding != null && (localVariableBinding.isCatchParameter() || localVariableBinding.isParameter())) {
+ if (localVariableBinding != null && (localVariableBinding.isCatchParameter() || localVariableBinding.isParameter())) {
localVariableBinding.tagBits &= ~TagBits.IsEffectivelyFinal; // as it is already definitely assigned, we can conclude already. Also note: catch parameter cannot be compound assigned.
}
//{ObjectTeams:
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java
index bada77ab3..9853097e1 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java
@@ -64,7 +64,7 @@ public FlowInfo analyseCode(
private void analyseConstantExpression(
BlockScope currentScope,
FlowContext flowContext,
- FlowInfo flowInfo,
+ FlowInfo flowInfo,
Expression e) {
if (e.constant == Constant.NotAConstant
&& !e.resolvedType.isEnum()) {
@@ -171,12 +171,12 @@ public Constant[] resolveCase(BlockScope scope, TypeBinding switchExpressionType
}
return Constant.NotAConstantList;
}
-public Constant resolveConstantExpression(BlockScope scope,
- TypeBinding caseType,
- TypeBinding switchExpressionType,
- SwitchStatement switchStatement,
+public Constant resolveConstantExpression(BlockScope scope,
+ TypeBinding caseType,
+ TypeBinding switchExpressionType,
+ SwitchStatement switchStatement,
Expression expression) {
-
+
if (expression.isConstantValueOfTypeAssignableToType(caseType, switchExpressionType)
|| caseType.isCompatibleWith(switchExpressionType)) {
if (caseType.isEnum()) {
@@ -216,7 +216,7 @@ public void traverse(ASTVisitor visitor, BlockScope blockScope) {
} else {
if (this.constantExpression != null) this.constantExpression.traverse(visitor, blockScope);
}
-
+
}
visitor.endVisit(this, blockScope);
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java
index 76c76a829..4244e0b33 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java
@@ -562,7 +562,7 @@ public boolean checkUnsafeCast(Scope scope, TypeBinding castType, TypeBinding ex
case Binding.TYPE_PARAMETER :
this.bits |= ASTNode.UnsafeCast;
return true;
-// (disabled) https://bugs.eclipse.org/bugs/show_bug.cgi?id=240807
+// (disabled) https://bugs.eclipse.org/bugs/show_bug.cgi?id=240807
// case Binding.TYPE :
// if (isNarrowing && match == null && expressionType.isParameterizedType()) {
// this.bits |= ASTNode.UnsafeCast;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CharLiteral.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CharLiteral.java
index c45145933..6d1846b63 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CharLiteral.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CharLiteral.java
@@ -20,9 +20,9 @@ import org.eclipse.jdt.internal.compiler.lookup.*;
import org.eclipse.jdt.internal.compiler.parser.ScannerHelper;
public class CharLiteral extends NumberLiteral {
-
+
char value;
-
+
public CharLiteral(char[] token, int s, int e) {
super(token, s, e);
computeValue();
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.java
index ac36c80e5..84ea74f5e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.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
* Fraunhofer FIRST - extended API and implementation
@@ -117,14 +117,14 @@ public class ClassLiteralAccess extends Expression {
this.constant = Constant.NotAConstant;
if ((this.targetType = this.type.resolveType(scope, true /* check bounds*/)) == null)
return null;
-
+
/* https://bugs.eclipse.org/bugs/show_bug.cgi?id=320463
https://bugs.eclipse.org/bugs/show_bug.cgi?id=312076
JLS3 15.8.2 forbids the type named in the class literal expression from being a parameterized type.
And the grammar in 18.1 disallows (where X and Y are some concrete types) constructs of the form
Outer<X>.class, Outer<X>.Inner.class, Outer.Inner<X>.class, Outer<X>.Inner<Y>.class etc.
Corollary wise, we should resolve the type of the class literal expression to be a raw type as
- class literals exist only for the raw underlying type.
+ class literals exist only for the raw underlying type.
*/
LookupEnvironment environment = scope.environment();
this.targetType = environment.convertToRawType(this.targetType, true /* force conversion of enclosing types*/);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompactConstructorDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompactConstructorDeclaration.java
index 7207702a0..cc76e7a68 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompactConstructorDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompactConstructorDeclaration.java
@@ -21,7 +21,7 @@ import org.eclipse.jdt.internal.compiler.parser.Parser;
public class CompactConstructorDeclaration extends ConstructorDeclaration {
public RecordDeclaration recordDeclaration;
-
+
public CompactConstructorDeclaration(CompilationResult compilationResult) {
super(compilationResult);
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java
index 5ab4b3619..39ab8f8f7 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java
@@ -301,7 +301,7 @@ public void finalizeProblems() {
return;
}
int removed = 0;
-/*
+/*
IrritantSet[] foundIrritants = new IrritantSet[this.suppressWarningsCount];
:giro */
// SH}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompoundAssignment.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompoundAssignment.java
index 947d123b1..abe74f755 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompoundAssignment.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompoundAssignment.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
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java
index 852ae0c44..89ee11073 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java
@@ -51,7 +51,7 @@ public class ConditionalExpression extends OperatorExpression implements IPolyEx
int trueInitStateIndex = -1;
int falseInitStateIndex = -1;
int mergedInitStateIndex = -1;
-
+
// we compute and store the null status during analyseCode (https://bugs.eclipse.org/324178):
private int nullStatus = FlowInfo.UNKNOWN;
int ifFalseNullStatus;
@@ -122,14 +122,14 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext,
this.valueIfFalse.checkNPEbyUnboxing(currentScope, flowContext, falseFlowInfo);
flowContext.conditionalLevel--;
-
+
// merge if-true & if-false initializations
FlowInfo mergedInfo;
if (isConditionOptimizedTrue){
mergedInfo = trueFlowInfo.addPotentialInitializationsFrom(falseFlowInfo);
if (this.ifTrueNullStatus != -1) {
this.nullStatus = this.ifTrueNullStatus;
- } else {
+ } else {
this.nullStatus = this.valueIfTrue.nullStatus(trueFlowInfo, flowContext);
}
} else if (isConditionOptimizedFalse) {
@@ -143,12 +143,12 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext,
// (2) For definite assignment analysis (JLS 16.1.5) of boolean conditional expressions of the form
// "if (c1 ? expr1 : expr2) use(v);" we need to check whether any variable v will be definitely
// assigned whenever the entire conditional expression evaluates to true (to reach the then branch).
- // I.e., we need to collect flowInfo *towards* the overall outcome true/false
+ // I.e., we need to collect flowInfo *towards* the overall outcome true/false
// (regardless of the evaluation of the condition).
-
+
// to support (1) use the infos of both branches originating from the condition for computing the nullStatus:
computeNullStatus(trueFlowInfo, falseFlowInfo, flowContext);
-
+
// to support (2) we split the true/false branches according to their inner structure. Consider this:
// if (b ? false : (true && (v = false))) return v; -- ok
// - expr1 ("false") has no path towards true (mark as unreachable)
@@ -168,16 +168,16 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext,
UnconditionalFlowInfo trueFlowTowardsFalse = trueFlowInfo.initsWhenFalse().unconditionalInits();
UnconditionalFlowInfo falseFlowTowardsFalse = falseFlowInfo.initsWhenFalse().unconditionalInits();
if (isValueIfTrueOptimizedFalse) {
- trueFlowTowardsTrue.setReachMode(FlowInfo.UNREACHABLE_OR_DEAD);
+ trueFlowTowardsTrue.setReachMode(FlowInfo.UNREACHABLE_OR_DEAD);
}
if (isValueIfFalseOptimizedFalse) {
- falseFlowTowardsTrue.setReachMode(FlowInfo.UNREACHABLE_OR_DEAD);
+ falseFlowTowardsTrue.setReachMode(FlowInfo.UNREACHABLE_OR_DEAD);
}
if (isValueIfTrueOptimizedTrue) {
- trueFlowTowardsFalse.setReachMode(FlowInfo.UNREACHABLE_OR_DEAD);
+ trueFlowTowardsFalse.setReachMode(FlowInfo.UNREACHABLE_OR_DEAD);
}
if (isValueIfFalseOptimizedTrue) {
- falseFlowTowardsFalse.setReachMode(FlowInfo.UNREACHABLE_OR_DEAD);
+ falseFlowTowardsFalse.setReachMode(FlowInfo.UNREACHABLE_OR_DEAD);
}
mergedInfo =
FlowInfo.conditional(
@@ -187,7 +187,7 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext,
this.mergedInitStateIndex =
currentScope.methodScope().recordInitializationStates(mergedInfo);
mergedInfo.setReachMode(mode);
-
+
return mergedInfo;
}
@@ -201,7 +201,7 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext,
}
private void computeNullStatus(FlowInfo trueBranchInfo, FlowInfo falseBranchInfo, FlowContext flowContext) {
- // given that the condition cannot be optimized to a constant
+ // given that the condition cannot be optimized to a constant
// we now merge the nullStatus from both branches:
if (this.ifTrueNullStatus == -1) { // has this status been pre-computed?
this.ifTrueNullStatus = this.valueIfTrue.nullStatus(trueBranchInfo, flowContext);
@@ -459,7 +459,7 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext,
final long sourceLevel = scope.compilerOptions().sourceLevel;
boolean use15specifics = sourceLevel >= ClassFileConstants.JDK1_5;
this.use18specifics = sourceLevel >= ClassFileConstants.JDK1_8;
-
+
if (this.use18specifics) {
if (this.expressionContext == ASSIGNMENT_CONTEXT || this.expressionContext == INVOCATION_CONTEXT) {
this.valueIfTrue.setExpressionContext(this.expressionContext);
@@ -468,7 +468,7 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext,
this.valueIfFalse.setExpectedType(this.expectedType);
}
}
-
+
if (this.constant != Constant.NotAConstant) {
this.constant = Constant.NotAConstant;
TypeBinding conditionType = this.condition.resolveTypeExpecting(scope, TypeBinding.BOOLEAN);
@@ -487,7 +487,7 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext,
this.originalValueIfTrueType = this.valueIfTrue.resolveType(scope);
if (this.originalValueIfFalseType.kind() == Binding.POLY_TYPE)
this.originalValueIfFalseType = this.valueIfFalse.resolveType(scope);
-
+
if (this.originalValueIfTrueType == null || !this.originalValueIfTrueType.isValidBinding())
return this.resolvedType = null;
if (this.originalValueIfFalseType == null || !this.originalValueIfFalseType.isValidBinding())
@@ -726,7 +726,7 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext,
public void setExpectedType(TypeBinding expectedType) {
this.expectedType = expectedType;
}
-
+
@Override
public void setExpressionContext(ExpressionContext context) {
this.expressionContext = context;
@@ -736,7 +736,7 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext,
public ExpressionContext getExpressionContext() {
return this.expressionContext;
}
-
+
@Override
public Expression[] getPolyExpressions() {
Expression [] truePolys = this.valueIfTrue.getPolyExpressions();
@@ -753,46 +753,46 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext,
@Override
public boolean isPertinentToApplicability(TypeBinding targetType, MethodBinding method) {
- return this.valueIfTrue.isPertinentToApplicability(targetType, method)
+ return this.valueIfTrue.isPertinentToApplicability(targetType, method)
&& this.valueIfFalse.isPertinentToApplicability(targetType, method);
}
-
+
@Override
public boolean isPotentiallyCompatibleWith(TypeBinding targetType, Scope scope) {
- return this.valueIfTrue.isPotentiallyCompatibleWith(targetType, scope)
+ return this.valueIfTrue.isPotentiallyCompatibleWith(targetType, scope)
&& this.valueIfFalse.isPotentiallyCompatibleWith(targetType, scope);
}
-
+
@Override
public boolean isFunctionalType() {
return this.valueIfTrue.isFunctionalType() || this.valueIfFalse.isFunctionalType(); // Even if only one arm is functional type, this will require a functional interface target
}
-
+
@Override
public boolean isPolyExpression() throws UnsupportedOperationException {
-
+
if (!this.use18specifics)
return false;
-
+
if (this.isPolyExpression)
return true;
if (this.expressionContext != ASSIGNMENT_CONTEXT && this.expressionContext != INVOCATION_CONTEXT)
return false;
-
+
if (this.originalValueIfTrueType == null || this.originalValueIfFalseType == null) // resolution error.
return false;
-
+
if (this.valueIfTrue.isPolyExpression() || this.valueIfFalse.isPolyExpression())
return true;
-
+
// "... unless both operands produce primitives (or boxed primitives)":
if (this.originalValueIfTrueType.isBaseType() || (this.originalValueIfTrueType.id >= TypeIds.T_JavaLangByte && this.originalValueIfTrueType.id <= TypeIds.T_JavaLangBoolean)) {
if (this.originalValueIfFalseType.isBaseType() || (this.originalValueIfFalseType.id >= TypeIds.T_JavaLangByte && this.originalValueIfFalseType.id <= TypeIds.T_JavaLangBoolean))
return false;
}
-
- // clause around generic method's return type prior to instantiation needs double check.
+
+ // clause around generic method's return type prior to instantiation needs double check.
return this.isPolyExpression = true;
}
@@ -808,17 +808,17 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext,
return isPolyExpression() ? this.valueIfTrue.isCompatibleWith(left, scope) && this.valueIfFalse.isCompatibleWith(left, scope) :
super.isCompatibleWith(left, scope);
}
-
+
@Override
public boolean isBoxingCompatibleWith(TypeBinding targetType, Scope scope) {
// Note: compatibility check may have failed in just one arm and we may have reached here.
- return isPolyExpression() ? (this.valueIfTrue.isCompatibleWith(targetType, scope) ||
- this.valueIfTrue.isBoxingCompatibleWith(targetType, scope)) &&
- (this.valueIfFalse.isCompatibleWith(targetType, scope) ||
+ return isPolyExpression() ? (this.valueIfTrue.isCompatibleWith(targetType, scope) ||
+ this.valueIfTrue.isBoxingCompatibleWith(targetType, scope)) &&
+ (this.valueIfFalse.isCompatibleWith(targetType, scope) ||
this.valueIfFalse.isBoxingCompatibleWith(targetType, scope)) :
super.isBoxingCompatibleWith(targetType, scope);
- }
-
+ }
+
@Override
public boolean sIsMoreSpecific(TypeBinding s, TypeBinding t, Scope scope) {
if (super.sIsMoreSpecific(s, t, scope))
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java
index 5ee3d7ed0..735f51b5b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java
@@ -122,7 +122,7 @@ public void analyseCode(ClassScope classScope, InitializationFlowContext initial
// ... except for base ctor issues:
if (MethodModel.callsBaseCtor(this.binding.copyInheritanceSrc))
MethodModel.setCallsBaseCtor(this);
- if ( this.arguments == null
+ if ( this.arguments == null
&& !MethodModel.callsBaseCtor(this.binding)
&& roleType.baseclass() != null)
{
@@ -165,7 +165,7 @@ public void analyseCode(ClassScope classScope, InitializationFlowContext initial
this.scope.problemReporter().baseConstructorCallInLiftingConstructor(this);
} else {
if (!calledHere && !calledIndirectly && !Lifting.isLiftingCtor(selfCall)) {
- if (!(isDefaultConstructor() && roleType.roleModel != null && roleType.roleModel.hasBaseclassProblem())) // ignore if wrong def.ctor was created
+ if (!(isDefaultConstructor() && roleType.roleModel != null && roleType.roleModel.hasBaseclassProblem())) // ignore if wrong def.ctor was created
this.scope.problemReporter().missingCallToBaseConstructor(
this, this.binding.declaringClass);
} else if (calledHere && calledIndirectly) {
@@ -202,7 +202,7 @@ public void analyseCode(ClassScope classScope, InitializationFlowContext initial
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=270446, When the AST built is an abridged version
// we don't have all tree nodes we would otherwise expect. (see ASTParser.setFocalPosition)
if (this.constructorCall == null)
- break checkUnused;
+ break checkUnused;
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=264991, Don't complain about this
// constructor being unused if the base class doesn't have a no-arg constructor.
// See that a seemingly unused constructor that chains to another constructor with a
@@ -239,7 +239,7 @@ public void analyseCode(ClassScope classScope, InitializationFlowContext initial
for (int i = 0, length = this.typeParameters.length; i < length; ++i) {
TypeParameter typeParameter = this.typeParameters[i];
if ((typeParameter.binding.modifiers & ExtraCompilerModifiers.AccLocallyUsed) == 0) {
- this.scope.problemReporter().unusedTypeParameter(typeParameter);
+ this.scope.problemReporter().unusedTypeParameter(typeParameter);
}
}
}
@@ -352,7 +352,7 @@ public void analyseCode(ClassScope classScope, InitializationFlowContext initial
if (!isValueProvidedUsingAnnotation(fieldDecl))
this.scope.problemReporter().uninitializedNonNullField(
field,
- ((this.bits & ASTNode.IsDefaultConstructor) != 0)
+ ((this.bits & ASTNode.IsDefaultConstructor) != 0)
? (ASTNode) fieldDecl
: this);
}
@@ -386,7 +386,7 @@ protected void checkAndGenerateFieldAssignment(FlowContext flowContext, FlowInfo
return;
}
boolean isValueProvidedUsingAnnotation(FieldDeclaration fieldDecl) {
- // a member field annotated with @Inject is considered to be initialized by the injector
+ // a member field annotated with @Inject is considered to be initialized by the injector
if (fieldDecl.annotations != null) {
int length = fieldDecl.annotations.length;
for (int i = 0; i < length; i++) {
@@ -590,7 +590,7 @@ private void internalGenerateCode(ClassScope classScope, ClassFile classFile) {
//{ObjectTeams: treat value parameters similar to enclosing instances:
VariableBinding[] syntheticArguments = declaringClass.valueParamSynthArgs();
argSlotSize += syntheticArguments.length;
-/* orig:
+/* orig:
this.scope.computeLocalVariablePositions(1 + enumOffset, codeStream);
:giro */
this.scope.computeLocalVariablePositions(1 + enumOffset + syntheticArguments.length, codeStream);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ContainerAnnotation.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ContainerAnnotation.java
index 32f328156..b865829a8 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ContainerAnnotation.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ContainerAnnotation.java
@@ -22,29 +22,29 @@ import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
import org.eclipse.jdt.internal.compiler.lookup.TypeConstants;
public class ContainerAnnotation extends SingleMemberAnnotation {
-
+
private Annotation [] containees;
private ArrayInitializer memberValues;
-
+
public ContainerAnnotation(Annotation repeatingAnnotation, ReferenceBinding containerAnnotationType, BlockScope scope) {
-
+
char [][] containerTypeName = containerAnnotationType.compoundName;
if (containerTypeName.length == 1) {
this.type = new SingleTypeReference(containerTypeName[0], 0);
} else {
this.type = new QualifiedTypeReference(containerTypeName, new long [containerTypeName.length]);
}
-
+
this.sourceStart = repeatingAnnotation.sourceStart;
this.sourceEnd = repeatingAnnotation.sourceEnd;
-
+
this.resolvedType = containerAnnotationType;
this.recipient = repeatingAnnotation.recipient;
this.containees = new Annotation[0];
this.memberValue = this.memberValues = new ArrayInitializer();
addContainee(repeatingAnnotation);
}
-
+
public void addContainee(Annotation repeatingAnnotation) {
final int length = this.containees.length;
System.arraycopy(this.containees, 0, this.containees = new Annotation[length + 1], 0, length);
@@ -52,7 +52,7 @@ public class ContainerAnnotation extends SingleMemberAnnotation {
this.memberValues.expressions = this.containees;
repeatingAnnotation.setPersistibleAnnotation(length == 0 ? this : null);
}
-
+
// Resolve the compiler synthesized container annotation.
@Override
public TypeBinding resolveType(BlockScope scope) {
@@ -74,11 +74,11 @@ public class ContainerAnnotation extends SingleMemberAnnotation {
this.resolvedType = containerAnnotationType = repeatingAnnotationType.containerAnnotationType();
if (!this.resolvedType.isValidBinding())
return this.resolvedType;
-
- // OK, the declaration site of the repeating annotation type as well as the use site where the annotations actually repeat pass muster.
+
+ // OK, the declaration site of the repeating annotation type as well as the use site where the annotations actually repeat pass muster.
MethodBinding[] methods = containerAnnotationType.methods();
MemberValuePair pair = memberValuePairs()[0];
-
+
for (int i = 0, length = methods.length; i < length; i++) {
MethodBinding method = methods[i];
if (CharOperation.equals(method.selector, TypeConstants.VALUE)) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/DoStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/DoStatement.java
index 3b7c1025f..548bedd3c 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/DoStatement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/DoStatement.java
@@ -107,7 +107,7 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl
(this.action == null
? actionInfo
: (actionInfo.mergedWith(loopingContext.initsOnContinue))).copy());
- /* https://bugs.eclipse.org/bugs/show_bug.cgi?id=367023, we reach the condition at the bottom via two arcs,
+ /* https://bugs.eclipse.org/bugs/show_bug.cgi?id=367023, we reach the condition at the bottom via two arcs,
one by free fall and another by continuing... Merge initializations propagated through the two pathways,
cf, while and for loops.
*/
@@ -136,7 +136,7 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl
loopingContext.simulateThrowAfterLoopBack(loopbackFlowInfo);
}
// end of loop
- FlowInfo mergedInfo =
+ FlowInfo mergedInfo =
FlowInfo.mergedOptimizedBranches(
(loopingContext.initsOnBreak.tagBits & FlowInfo.UNREACHABLE) != 0
? loopingContext.initsOnBreak
@@ -250,7 +250,7 @@ public boolean doesNotCompleteNormally() {
boolean isConditionTrue = cst == null || cst != Constant.NotAConstant && cst.booleanValue() == true;
cst = this.condition.optimizedBooleanConstant();
boolean isConditionOptimizedTrue = cst == null ? true : cst != Constant.NotAConstant && cst.booleanValue() == true;
-
+
if (isConditionTrue || isConditionOptimizedTrue)
return this.action == null || !this.action.breaksOut(null);
if (this.action == null || this.action.breaksOut(null))
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/DoubleLiteral.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/DoubleLiteral.java
index a012723a5..87c58ad51 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/DoubleLiteral.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/DoubleLiteral.java
@@ -21,9 +21,9 @@ import org.eclipse.jdt.internal.compiler.lookup.*;
import org.eclipse.jdt.internal.compiler.util.FloatUtil;
public class DoubleLiteral extends NumberLiteral {
-
+
double value;
-
+
public DoubleLiteral(char[] token, int s, int e) {
super(token, s, e);
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/EqualExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/EqualExpression.java
index d14d1534e..0801d396d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/EqualExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/EqualExpression.java
@@ -60,7 +60,7 @@ public class EqualExpression extends BinaryExpression {
rightNonNullChecked = scope.problemReporter().expressionNonNullComparison(this.right, checkEquality);
}
}
-
+
boolean contextualCheckEquality = checkEquality ^ ((flowContext.tagBits & FlowContext.INSIDE_NEGATION) != 0);
// perform flowInfo-based checks for variables and record info for syntactic null analysis for fields:
if (!leftNonNullChecked) {
@@ -70,7 +70,7 @@ public class EqualExpression extends BinaryExpression {
checkVariableComparison(scope, flowContext, flowInfo, initsWhenTrue, initsWhenFalse, local, rightStatus, this.left);
}
} else if (this.left instanceof Reference
- && ((!contextualCheckEquality && rightStatus == FlowInfo.NULL)
+ && ((!contextualCheckEquality && rightStatus == FlowInfo.NULL)
|| (contextualCheckEquality && rightStatus == FlowInfo.NON_NULL))
&& scope.compilerOptions().enableSyntacticNullAnalysisForFields)
{
@@ -82,19 +82,19 @@ public class EqualExpression extends BinaryExpression {
}
if (!rightNonNullChecked) {
LocalVariableBinding local = this.right.localVariableBinding();
- if (local != null) {
+ if (local != null) {
if ((local.type.tagBits & TagBits.IsBaseType) == 0) {
checkVariableComparison(scope, flowContext, flowInfo, initsWhenTrue, initsWhenFalse, local, leftStatus, this.right);
}
} else if (this.right instanceof Reference
- && ((!contextualCheckEquality && leftStatus == FlowInfo.NULL)
+ && ((!contextualCheckEquality && leftStatus == FlowInfo.NULL)
|| (contextualCheckEquality && leftStatus == FlowInfo.NON_NULL))
- && scope.compilerOptions().enableSyntacticNullAnalysisForFields)
+ && scope.compilerOptions().enableSyntacticNullAnalysisForFields)
{
FieldBinding field = ((Reference)this.right).lastFieldBinding();
if (field != null && (field.type.tagBits & TagBits.IsBaseType) == 0) {
flowContext.recordNullCheckedFieldReference((Reference) this.right, 1);
- }
+ }
}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java
index b6a6fee5a..0b4c1f5e4 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java
@@ -178,7 +178,7 @@ public class ExplicitConstructorCall extends Statement implements Invocation {
if ((this.bits & ASTNode.Unchecked) != 0 && this.genericTypeArguments == null) {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=277643, align with javac on JLS 15.12.2.6
thrownExceptions = currentScope.environment().convertToRawTypes(this.binding.thrownExceptions, true, true);
- }
+ }
// check exceptions
flowContext.checkExceptionHandlers(
thrownExceptions,
@@ -654,7 +654,7 @@ public class ExplicitConstructorCall extends Statement implements Invocation {
this.binding = tsuperMethod;
argumentTypes = tsuperArgs;
}
-
+
// perform any adjustments needed for declared lifting in team constructors:
if (this.binding.problemId() == ProblemReasons.NotFound) {
argumentTypes = checkLiftingTeamCtor(scope, argumentTypes, (ConstructorDeclaration)methodDeclaration);
@@ -865,7 +865,7 @@ public class ExplicitConstructorCall extends Statement implements Invocation {
public void setFieldIndex(int depth) {
// ignore for here
}
-
+
@Override
public void traverse(ASTVisitor visitor, BlockScope scope) {
if (visitor.visit(this, scope)) {
@@ -895,17 +895,17 @@ public class ExplicitConstructorCall extends Statement implements Invocation {
public void registerInferenceContext(ParameterizedGenericMethodBinding method, InferenceContext18 infCtx18) {
// Nothing to do.
}
-
+
@Override
public void registerResult(TypeBinding targetType, MethodBinding method) {
// Nothing to do.
}
-
+
@Override
public InferenceContext18 getInferenceContext(ParameterizedMethodBinding method) {
return null;
}
-
+
@Override
public void cleanUpInferenceContexts() {
// Nothing to do.
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExportsStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExportsStatement.java
index b641512be..932435cae 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExportsStatement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExportsStatement.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.ast;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java
index 8879789be..92b526b25 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java
@@ -12,7 +12,7 @@
* IBM Corporation - initial API and implementation
* Fraunhofer FIRST - extended API and implementation
* Technical University Berlin - extended API and implementation
- * Stephan Herrmann - Contributions for
+ * Stephan Herrmann - Contributions for
* bug 292478 - Report potentially null across variable assignment
* bug 345305 - [compiler][null] Compiler misidentifies a case of "variable can only be null"
* bug 392862 - [1.8][compiler][null] Evaluate null annotations on array types
@@ -199,9 +199,9 @@ public abstract class Expression extends Statement {
public int implicitConversion;
public TypeBinding resolvedType;
-
+
public static Expression [] NO_EXPRESSIONS = new Expression[0];
-
+
public static final boolean isConstantValueRepresentable(Constant constant, int constantTypeID, int targetTypeID) {
//true if there is no loss of precision while casting.
@@ -434,7 +434,7 @@ public final boolean checkCastTypesCompatibility(
return true;
}
- } else if (use17specifics && castType.isPrimitiveType() && expressionType instanceof ReferenceBinding &&
+ } else if (use17specifics && castType.isPrimitiveType() && expressionType instanceof ReferenceBinding &&
!expressionType.isBoxedPrimitiveType() && checkCastTypesCompatibility(scope, scope.boxing(castType), expressionType, expression)) {
// cast from any reference type (other than boxing types) to base type allowed from 1.7, see JLS $5.5
// by our own interpretation (in accordance with javac) we reject arays, though.
@@ -460,7 +460,7 @@ public final boolean checkCastTypesCompatibility(
}
return true;
}
-
+
switch(expressionType.kind()) {
case Binding.BASE_TYPE :
//-----------cast to something which is NOT a base type--------------------------
@@ -1331,7 +1331,7 @@ public boolean forcedToBeRaw(ReferenceContext referenceContext) {
if (field.type.isRawType()) {
if (referenceContext instanceof AbstractMethodDeclaration) {
AbstractMethodDeclaration methodDecl = (AbstractMethodDeclaration) referenceContext;
- ReferenceBinding declaringClass = methodDecl.binding != null
+ ReferenceBinding declaringClass = methodDecl.binding != null
? methodDecl.binding.declaringClass
: methodDecl.scope.enclosingReceiverType();
if (TypeBinding.notEquals(field.declaringClass, declaringClass)) { // inherited raw field, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=337962
@@ -1429,9 +1429,9 @@ public boolean isExactMethodReference() {
}
/* Answer if the receiver is a poly expression in the prevailing context. Caveat emptor: Some constructs (notably method calls)
- cannot answer this question until after resolution is over and may throw unsupported operation exception if queried ahead of
+ cannot answer this question until after resolution is over and may throw unsupported operation exception if queried ahead of
resolution. Default implementation here returns false which is true for vast majority of AST nodes. The ones that are poly
- expressions under one or more contexts should override and return suitable value.
+ expressions under one or more contexts should override and return suitable value.
*/
public boolean isPolyExpression() throws UnsupportedOperationException {
return false;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExpressionContext.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExpressionContext.java
index 07a84ce87..9050a3c42 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExpressionContext.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExpressionContext.java
@@ -16,14 +16,14 @@
package org.eclipse.jdt.internal.compiler.ast;
public enum ExpressionContext {
-
- /** Assignment context: potential poly-expressions are: method invocations, lambdas, reference expressions,
+
+ /** Assignment context: potential poly-expressions are: method invocations, lambdas, reference expressions,
conditional expressions and allocation expressions. This is the only Java 7 context where target type
influenced evaluation of some expression.
-
- Context induced by: ReturnStatement, ArrayInitializer, Assignment, FieldDeclaration and LocalDeclaration.
+
+ Context induced by: ReturnStatement, ArrayInitializer, Assignment, FieldDeclaration and LocalDeclaration.
*/
- ASSIGNMENT_CONTEXT {
+ ASSIGNMENT_CONTEXT {
@Override
public String toString() {
return "assignment context"; //$NON-NLS-1$
@@ -33,14 +33,14 @@ public enum ExpressionContext {
return true;
}
},
-
- /** Invocation context: potential poly-expressions are: method invocations, lambdas, reference expressions,
- conditional expressions and allocation expressions. At this point, we don't distinguish between strict
+
+ /** Invocation context: potential poly-expressions are: method invocations, lambdas, reference expressions,
+ conditional expressions and allocation expressions. At this point, we don't distinguish between strict
and loose invocation contexts - we may have to cross the bridge some day.
-
+
Context induced by: AllocationExpression, QualifiedAllocationExpression, ExplicitConstructorCall, MessageSend
CodeSnippetAllocationExpression and CodeSnippetMessageSend.
- */
+ */
INVOCATION_CONTEXT {
@Override
public String toString() {
@@ -51,7 +51,7 @@ public enum ExpressionContext {
return true;
}
},
-
+
/** Casting context: potential poly-expressions are: lambdas and reference expressions
Context induced by: CastExpression.
*/
@@ -65,9 +65,9 @@ public enum ExpressionContext {
return false;
}
},
-
- /** Vanilla context (string, numeric): potential poly-expressions are: NONE. This is the nonpoly context in which
- expressions get evaluated, unless they feature in one of the above contexts.
+
+ /** Vanilla context (string, numeric): potential poly-expressions are: NONE. This is the nonpoly context in which
+ expressions get evaluated, unless they feature in one of the above contexts.
*/
VANILLA_CONTEXT {
@Override
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FakedTrackingVariable.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FakedTrackingVariable.java
index 6351ad66b..3202a04c8 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FakedTrackingVariable.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FakedTrackingVariable.java
@@ -51,7 +51,7 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.statemachine.copyinhe
* A faked local variable declaration used for keeping track of data flows of a
* special variable. Certain events will be recorded by changing the null info
* for this variable.
- *
+ *
* See bug 349326 - [1.7] new warning for missing try-with-resources
*/
@SuppressWarnings({"rawtypes", "unchecked"})
@@ -68,10 +68,10 @@ public class FakedTrackingVariable extends LocalDeclaration {
// - obtaining this from a method call or array reference
// Interpret that we may or may not be responsible for closing
private static final int SHARED_WITH_OUTSIDE = 2;
- // the resource is likely owned by outside code (owner has responsibility to close):
+ // the resource is likely owned by outside code (owner has responsibility to close):
// - obtained as argument of the current method, or via a field read
// - stored into a field
- // - returned as the result of this method
+ // - returned as the result of this method
private static final int OWNED_BY_OUTSIDE = 4;
// If close() is invoked from a nested method (inside a local type) report remaining problems only as potential:
private static final int CLOSED_IN_NESTED_METHOD = 8;
@@ -93,7 +93,7 @@ public class FakedTrackingVariable extends LocalDeclaration {
private int globalClosingState = 0;
public LocalVariableBinding originalBinding; // the real local being tracked, can be null for preliminary track vars for allocation expressions
-
+
public FakedTrackingVariable innerTracker; // chained tracking variable of a chained (wrapped) resource
public FakedTrackingVariable outerTracker; // inverse of 'innerTracker'
@@ -103,7 +103,7 @@ public class FakedTrackingVariable extends LocalDeclaration {
// temporary storage while analyzing "res = new Res();":
private ASTNode currentAssignment; // temporarily store the assignment as the location for error reporting
-
+
// if tracking var was allocated from a finally context, record here the flow context of the corresponding try block
private FlowContext tryContext;
@@ -140,7 +140,7 @@ public class FakedTrackingVariable extends LocalDeclaration {
if (nullStatus != 0)
flowInfo.markNullStatus(this.binding, nullStatus); // mark that this flow has seen the resource
}
-
+
@Override
public void generateCode(BlockScope currentScope, CodeStream codeStream)
{ /* NOP - this variable is completely dummy, ie. for analysis only. */ }
@@ -216,7 +216,7 @@ public class FakedTrackingVariable extends LocalDeclaration {
return local.closeTracker;
}
} else if (expression instanceof AllocationExpression) {
- // return any preliminary tracking variable from analyseCloseableAllocation
+ // return any preliminary tracking variable from analyseCloseableAllocation
return ((AllocationExpression) expression).closeTracker;
} else if (expression instanceof MessageSend) {
// return any preliminary tracking variable from analyseCloseableAcquisition
@@ -231,7 +231,7 @@ public class FakedTrackingVariable extends LocalDeclaration {
* Also the assignment is temporarily stored in the tracking variable in case we need to
* report errors because the assignment leaves the old LHS value unclosed.
* In this case the assignment should be used as the error location.
- *
+ *
* @param location the assignment/local declaration being analyzed
* @param local the local variable being assigned to
* @param rhs the rhs of the assignment resp. the initialization of the local variable declaration.
@@ -247,7 +247,7 @@ public class FakedTrackingVariable extends LocalDeclaration {
if (local.isParameter()) {
closeTracker.globalClosingState |= OWNED_BY_OUTSIDE;
}
- }
+ }
}
if (closeTracker != null) {
closeTracker.currentAssignment = location;
@@ -257,7 +257,7 @@ public class FakedTrackingVariable extends LocalDeclaration {
closeTracker = local.closeTracker;
if (closeTracker != null) {
handleReassignment(flowInfo, closeTracker, location);
- }
+ }
if (rhs.resolvedType != TypeBinding.NULL) { // not NULL means valid closeable as per method precondition
closeTracker = new FakedTrackingVariable(local, location, flowInfo, null, FlowInfo.UNKNOWN);
closeTracker.currentAssignment = location;
@@ -331,9 +331,9 @@ public class FakedTrackingVariable extends LocalDeclaration {
}
}
- /**
+ /**
* Compute/assign a tracking variable for a freshly allocated closeable value, using information from our white lists.
- * See Bug 358903 - Filter practically unimportant resource leak warnings
+ * See Bug 358903 - Filter practically unimportant resource leak warnings
*/
public static void analyseCloseableAllocation(BlockScope scope, FlowInfo flowInfo, AllocationExpression allocation) {
// client has checked that the resolvedType is an AutoCloseable, hence the following cast is safe:
@@ -407,7 +407,7 @@ public class FakedTrackingVariable extends LocalDeclaration {
}
}
- /**
+ /**
* Check if a message send acquires a closeable from its receiver, see:
* Bug 463320 - [compiler][resource] potential "resource leak" problem disappears when local variable inlined
*/
@@ -530,13 +530,13 @@ public class FakedTrackingVariable extends LocalDeclaration {
return null; // not a tracked expression
}
- /**
+ /**
* Given the rhs of an assignment or local declaration has a (Auto)Closeable type (or null), setup for leak analysis now:
* Create or re-use a tracking variable, and wire and initialize everything.
* @param scope scope containing the assignment
* @param upstreamInfo info without analysis of the rhs, use this to determine the status of a resource being disconnected
* @param flowInfo info with analysis of the rhs, use this for recording resource status because this will be passed downstream
- * @param flowContext
+ * @param flowContext
* @param location where to report warnigs/errors against
* @param rhs the right hand side of the assignment, this expression is to be analyzed.
* The caller has already checked that the rhs is either of a closeable type or null.
@@ -573,9 +573,9 @@ public class FakedTrackingVariable extends LocalDeclaration {
if (rhs instanceof AllocationExpression || rhs instanceof ConditionalExpression || rhs instanceof SwitchExpression || rhs instanceof MessageSend) {
if (rhsTrackVar == disconnectedTracker)
return; // b.: self wrapper: res = new Wrap(res); -> done!
- if (local.closeTracker == rhsTrackVar
+ if (local.closeTracker == rhsTrackVar
&& ((rhsTrackVar.globalClosingState & OWNED_BY_OUTSIDE) != 0)) {
- // c.: assigning a fresh resource (pre-connected alloc)
+ // c.: assigning a fresh resource (pre-connected alloc)
// to a local previously holding an alien resource -> start over
local.closeTracker = new FakedTrackingVariable(local, location, flowInfo, flowContext, FlowInfo.NULL);
// still check disconnectedTracker below
@@ -612,7 +612,7 @@ public class FakedTrackingVariable extends LocalDeclaration {
// a fresh resource, mark as not-closed:
if ((rhsTrackVar.globalClosingState & (SHARED_WITH_OUTSIDE|OWNED_BY_OUTSIDE|FOREACH_ELEMENT_VAR)) == 0)
flowInfo.markAsDefinitelyNull(rhsTrackVar.binding);
-// TODO(stephan): this might be useful, but I could not find a test case for it:
+// TODO(stephan): this might be useful, but I could not find a test case for it:
// if (flowContext.initsOnFinally != null)
// flowContext.initsOnFinally.markAsDefinitelyNonNull(trackerBinding);
}
@@ -641,8 +641,8 @@ public class FakedTrackingVariable extends LocalDeclaration {
* which we should then re-use
* @return a tracking variable associated with local or null if no need to track
*/
- private static FakedTrackingVariable analyseCloseableExpression(FlowInfo flowInfo, FlowContext flowContext, LocalVariableBinding local,
- ASTNode location, Expression expression, FakedTrackingVariable previousTracker)
+ private static FakedTrackingVariable analyseCloseableExpression(FlowInfo flowInfo, FlowContext flowContext, LocalVariableBinding local,
+ ASTNode location, Expression expression, FakedTrackingVariable previousTracker)
{
// unwrap uninteresting nodes:
while (true) {
@@ -674,8 +674,8 @@ public class FakedTrackingVariable extends LocalDeclaration {
return null;
}
return tracker;
- } else if (expression instanceof MessageSend
- || expression instanceof ArrayReference)
+ } else if (expression instanceof MessageSend
+ || expression instanceof ArrayReference)
{
// we *might* be responsible for the resource obtained
FakedTrackingVariable tracker = new FakedTrackingVariable(local, location, flowInfo, flowContext, FlowInfo.POTENTIALLY_NULL); // shed some doubt
@@ -691,7 +691,7 @@ public class FakedTrackingVariable extends LocalDeclaration {
FakedTrackingVariable tracker = new FakedTrackingVariable(local, location, flowInfo, flowContext, FlowInfo.UNKNOWN);
tracker.globalClosingState |= OWNED_BY_OUTSIDE;
// leave state as UNKNOWN, the bit OWNED_BY_OUTSIDE will prevent spurious warnings
- return tracker;
+ return tracker;
}
if (local.closeTracker != null)
@@ -874,14 +874,14 @@ public class FakedTrackingVariable extends LocalDeclaration {
this.globalClosingState |= CLOSED_IN_NESTED_METHOD;
}
- /**
+ /**
* Mark that this resource is passed to some outside code
- * (as argument to a method/ctor call or as a return value from the current method),
+ * (as argument to a method/ctor call or as a return value from the current method),
* and thus should be considered as potentially closed.
* @param owned should the resource be considered owned by some outside?
*/
- public static FlowInfo markPassedToOutside(BlockScope scope, Expression expression, FlowInfo flowInfo, FlowContext flowContext, boolean owned) {
-
+ public static FlowInfo markPassedToOutside(BlockScope scope, Expression expression, FlowInfo flowInfo, FlowContext flowContext, boolean owned) {
+
FakedTrackingVariable trackVar = getCloseTrackingVariable(expression, flowInfo, flowContext);
if (trackVar != null) {
// insert info that the tracked resource *may* be closed (by the target method, i.e.)
@@ -909,7 +909,7 @@ public class FakedTrackingVariable extends LocalDeclaration {
}
/**
- * Iterator for a set of FakedTrackingVariable, which dispenses the elements
+ * Iterator for a set of FakedTrackingVariable, which dispenses the elements
* according to the priorities defined by enum {@link Stage}.
* Resources whose outer is owned by an enclosing scope are never answered,
* unless we are analysing on behalf of an exit (return/throw).
@@ -923,7 +923,7 @@ public class FakedTrackingVariable extends LocalDeclaration {
private Stage stage;
private Iterator<FakedTrackingVariable> iterator;
private FakedTrackingVariable next;
-
+
enum Stage {
/** 1. prio: all top-level resources, ie., resources with no outer. */
OuterLess,
@@ -1006,14 +1006,14 @@ public class FakedTrackingVariable extends LocalDeclaration {
/**
* Answer true if we know for sure that no resource is bound to this variable
- * at the point of 'flowInfo'.
+ * at the point of 'flowInfo'.
*/
public boolean hasDefinitelyNoResource(FlowInfo flowInfo) {
if (this.originalBinding == null) return false; // shouldn't happen but keep quiet.
if (flowInfo.isDefinitelyNull(this.originalBinding)) {
return true;
}
- if (!(flowInfo.isDefinitelyAssigned(this.originalBinding)
+ if (!(flowInfo.isDefinitelyAssigned(this.originalBinding)
|| flowInfo.isPotentiallyAssigned(this.originalBinding))) {
return true;
}
@@ -1022,7 +1022,7 @@ public class FakedTrackingVariable extends LocalDeclaration {
public boolean isClosedInFinallyOfEnclosing(BlockScope scope) {
BlockScope currentScope = scope;
- while (true) {
+ while (true) {
if (currentScope.finallyInfo != null
&& currentScope.finallyInfo.isDefinitelyNonNull(this.binding)) {
return true; // closed in enclosing finally
@@ -1031,9 +1031,9 @@ public class FakedTrackingVariable extends LocalDeclaration {
return false;
}
currentScope = (BlockScope) currentScope.parent;
- }
+ }
}
- /**
+ /**
* If current is the same as 'returnedResource' or a wrapper thereof,
* mark as reported and return true, otherwise false.
*/
@@ -1098,7 +1098,7 @@ public class FakedTrackingVariable extends LocalDeclaration {
}
return hasReported;
}
-
+
private boolean neverClosedAtLocations() {
if (this.recordedLocations != null) {
for (Object value : this.recordedLocations.values())
@@ -1124,19 +1124,19 @@ public class FakedTrackingVariable extends LocalDeclaration {
if (isPotentialProblem) {
if ((this.globalClosingState & (REPORTED_POTENTIAL_LEAK|REPORTED_DEFINITIVE_LEAK)) != 0)
return 0;
-// if ((this.globalClosingState & (ACQUIRED_FROM_OUTSIDE)) != 0
+// if ((this.globalClosingState & (ACQUIRED_FROM_OUTSIDE)) != 0
// && location instanceof ReturnStatement
// && ((ReturnStatement) location).expression == this.acquisition)
// return 0; // directly returning a resource acquired from a message send: don't assume responsibility
- problemReporter.potentiallyUnclosedCloseable(this, location);
+ problemReporter.potentiallyUnclosedCloseable(this, location);
} else {
if ((this.globalClosingState & (REPORTED_DEFINITIVE_LEAK)) != 0)
return 0;
- problemReporter.unclosedCloseable(this, location);
+ problemReporter.unclosedCloseable(this, location);
}
// propagate flag to inners:
int reportFlag = isPotentialProblem ? REPORTED_POTENTIAL_LEAK : REPORTED_DEFINITIVE_LEAK;
- if (location == null) { // if location != null flags will be set after the loop over locations
+ if (location == null) { // if location != null flags will be set after the loop over locations
FakedTrackingVariable current = this;
do {
current.globalClosingState |= reportFlag;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FalseLiteral.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FalseLiteral.java
index 0180477c5..29979ef1a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FalseLiteral.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FalseLiteral.java
@@ -21,9 +21,9 @@ import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
public class FalseLiteral extends MagicLiteral {
-
+
static final char[] source = {'f', 'a', 'l', 's', 'e'};
-
+
public FalseLiteral(int s , int e) {
super(s,e);
}
@@ -75,7 +75,7 @@ public char[] source() {
}
@Override
public void traverse(ASTVisitor visitor, BlockScope scope) {
-//{ObjectTeams: hide synthetic nodes from visitors (e.g., inserted into a base call)
+//{ObjectTeams: hide synthetic nodes from visitors (e.g., inserted into a base call)
if (this.isGenerated) return;
// SH}
visitor.visit(this, scope);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java
index e7f071e9d..33de23e8e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java
@@ -270,7 +270,7 @@ public void resolve(MethodScope initializationScope) {
if (!existingField.isStatic() && declaringType.isStatic()) break checkHiding;
}
//{ObjectTeams: never report hiding re _OT$base, _OT$cacheInitTrigger et al
- if (CharOperation.prefixEquals(IOTConstants.OT_DOLLAR_NAME, this.name))
+ if (CharOperation.prefixEquals(IOTConstants.OT_DOLLAR_NAME, this.name))
break checkHiding;
// SH}
// collision with outer field or local variable
@@ -299,7 +299,7 @@ public void resolve(MethodScope initializationScope) {
}
}
}
-
+
// check @Deprecated annotation presence
if ((this.binding.getAnnotationTagBits() & TagBits.AnnotationDeprecated) == 0
&& (this.binding.modifiers & ClassFileConstants.AccDeprecated) != 0
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java
index dd8ed4cea..fac6b4082 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java
@@ -140,9 +140,9 @@ public FlowInfo analyseAssignment(BlockScope currentScope, FlowContext flowConte
this.receiver
.analyseCode(currentScope, flowContext, flowInfo, !this.binding.isStatic())
.unconditionalInits();
-
+
this.receiver.checkNPE(currentScope, flowContext, flowInfo);
-
+
if (assignment.expression != null) {
flowInfo =
assignment
@@ -181,7 +181,7 @@ public FlowInfo analyseAssignment(BlockScope currentScope, FlowContext flowConte
&& TypeBinding.equalsEquals(this.receiver.resolvedType, this.binding.declaringClass) // inherited fields are not tracked here
&& ((this.receiver.bits & ASTNode.ParenthesizedMASK) == 0)) { // (this).x is forbidden
flowInfo.markAsDefinitelyAssigned(this.binding);
- }
+ }
}
return flowInfo;
}
@@ -319,7 +319,7 @@ public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean
this.receiver.generateCode(currentScope, codeStream, !isStatic);
if ((this.bits & NeedReceiverGenericCast) != 0) {
codeStream.checkcast(this.actualReceiverType);
- }
+ }
pc = codeStream.position;
if (codegenBinding.declaringClass == null) { // array length
codeStream.arraylength();
@@ -470,7 +470,7 @@ public void generatePostIncrement(BlockScope currentScope, CodeStream codeStream
operandType = this.genericCast;
} else {
operandType = codegenBinding.type;
- }
+ }
if (valueRequired) {
if (isStatic) {
switch (operandType.id) {
@@ -481,7 +481,7 @@ public void generatePostIncrement(BlockScope currentScope, CodeStream codeStream
default :
codeStream.dup();
break;
- }
+ }
} else { // Stack: [owner][old field value] ---> [old field value][owner][old field value]
switch (operandType.id) {
case TypeIds.T_long :
@@ -491,10 +491,10 @@ public void generatePostIncrement(BlockScope currentScope, CodeStream codeStream
default :
codeStream.dup_x1();
break;
- }
+ }
}
}
- codeStream.generateImplicitConversion(this.implicitConversion);
+ codeStream.generateImplicitConversion(this.implicitConversion);
codeStream.generateConstant(
postIncrement.expression.constant,
this.implicitConversion);
@@ -530,7 +530,7 @@ public boolean isEquivalent(Reference reference) {
FieldReference fr = (FieldReference) reference;
if (fr.receiver.isThis() && !(fr.receiver instanceof QualifiedThisReference)) {
otherToken = fr.token;
- }
+ }
}
return otherToken != null && CharOperation.equals(this.token, otherToken);
} else {
@@ -594,13 +594,13 @@ public FieldBinding lastFieldBinding() {
*/
public void manageSyntheticAccessIfNecessary(BlockScope currentScope, FlowInfo flowInfo, boolean isReadAccess) {
if ((flowInfo.tagBits & FlowInfo.UNREACHABLE_OR_DEAD) != 0) return;
-
+
//{ObjectTeams: don't create (more) synthetics for base field accessed via callout:
- if ( FieldModel.isCalloutAccessed(this.binding)
- && this.syntheticAccessors != null
- && this.syntheticAccessors[isReadAccess ? FieldReference.READ : FieldReference.WRITE] != null)
+ if ( FieldModel.isCalloutAccessed(this.binding)
+ && this.syntheticAccessors != null
+ && this.syntheticAccessors[isReadAccess ? FieldReference.READ : FieldReference.WRITE] != null)
{
- return; // synthetic binding already created during resolveType; avoid CCE if declaringClass is binary.
+ return; // synthetic binding already created during resolveType; avoid CCE if declaringClass is binary.
}
// SH}
// if field from parameterized type got found, use the original field at codegen time
@@ -803,7 +803,7 @@ public TypeBinding resolveType(BlockScope scope) {
return null;
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=245007 avoid secondary errors in case of
- // missing super type for anonymous classes ...
+ // missing super type for anonymous classes ...
ReferenceBinding declaringClass = fieldBinding.declaringClass;
boolean avoidSecondary = declaringClass != null &&
declaringClass.isAnonymousType() &&
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FloatLiteral.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FloatLiteral.java
index 0ea54ee2e..039e2ad80 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FloatLiteral.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FloatLiteral.java
@@ -22,9 +22,9 @@ import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
import org.eclipse.jdt.internal.compiler.util.FloatUtil;
public class FloatLiteral extends NumberLiteral {
-
+
float value;
-
+
public FloatLiteral(char[] token, int s, int e) {
super(token, s, e);
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ForStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ForStatement.java
index acaf0cdf0..dc970d20b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ForStatement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ForStatement.java
@@ -11,7 +11,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
* Technical University Berlin - extended API and implementation
- * Stephan Herrmann - Contributions for
+ * Stephan Herrmann - Contributions for
* bug 319201 - [null] no warning when unboxing SingleNameReference causes NPE
* bug 349326 - [1.7] new warning for missing try-with-resources
* bug 345305 - [compiler][null] Compiler misidentifies a case of "variable can only be null"
@@ -90,7 +90,7 @@ public class ForStatement extends Statement {
cst = this.condition == null ? null : this.condition.optimizedBooleanConstant();
boolean isConditionOptimizedTrue = cst == null || (cst != Constant.NotAConstant && cst.booleanValue() == true);
boolean isConditionOptimizedFalse = cst != null && (cst != Constant.NotAConstant && cst.booleanValue() == false);
-
+
// process the condition
LoopingFlowContext condLoopContext = null;
FlowInfo condInfo = flowInfo.nullInfoLessUnconditionalCopy();
@@ -452,10 +452,10 @@ public class ForStatement extends Statement {
boolean isConditionTrue = cst == null || cst != Constant.NotAConstant && cst.booleanValue() == true;
cst = this.condition == null ? null : this.condition.optimizedBooleanConstant();
boolean isConditionOptimizedTrue = cst == null ? true : cst != Constant.NotAConstant && cst.booleanValue() == true;
-
+
return (isConditionTrue || isConditionOptimizedTrue) && (this.action == null || !this.action.breaksOut(null));
}
-
+
@Override
public boolean completesByContinue() {
return this.action.continuesAtOuterLabel();
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ForeachStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ForeachStatement.java
index 9b18f386c..8e9dd654d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ForeachStatement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ForeachStatement.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
* Technical University Berlin - extended API and implementation
@@ -457,7 +457,7 @@ public class ForeachStatement extends Statement {
public static TypeBinding getCollectionElementType(BlockScope scope, TypeBinding collectionType) {
if (collectionType == null) return null;
-
+
boolean isTargetJsr14 = scope.compilerOptions().targetJDK == ClassFileConstants.JDK1_4;
if (collectionType.isCapture()) {
TypeBinding upperBound = ((CaptureBinding)collectionType).firstBound;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FunctionalExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FunctionalExpression.java
index ec8105264..c52104e23 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FunctionalExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FunctionalExpression.java
@@ -54,7 +54,7 @@ import org.eclipse.jdt.internal.compiler.lookup.TypeIds;
import org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding;
public abstract class FunctionalExpression extends Expression {
-
+
protected TypeBinding expectedType;
public MethodBinding descriptor;
public MethodBinding binding; // Code generation binding. May include synthetics. See getMethodBinding()
@@ -74,20 +74,20 @@ public abstract class FunctionalExpression extends Expression {
public FunctionalExpression(CompilationResult compilationResult) {
this.compilationResult = compilationResult;
}
-
+
public FunctionalExpression() {
super();
}
-
+
@Override
public boolean isBoxingCompatibleWith(TypeBinding targetType, Scope scope) {
return false;
}
-
+
public void setCompilationResult(CompilationResult compilationResult) {
this.compilationResult = compilationResult;
}
-
+
// Return the actual (non-code generation) method binding that is void of synthetics.
public MethodBinding getMethodBinding() {
return null;
@@ -97,7 +97,7 @@ public abstract class FunctionalExpression extends Expression {
public void setExpectedType(TypeBinding expectedType) {
this.expectedType = expectedType;
}
-
+
@Override
public void setExpressionContext(ExpressionContext context) {
this.expressionContext = context;
@@ -121,7 +121,7 @@ public abstract class FunctionalExpression extends Expression {
public boolean isFunctionalType() {
return true;
}
-
+
@Override
public boolean isPertinentToApplicability(TypeBinding targetType, MethodBinding method) {
if (targetType instanceof TypeVariableBinding) {
@@ -159,7 +159,7 @@ public abstract class FunctionalExpression extends Expression {
public TypeBinding expectedType() {
return this.expectedType;
}
-
+
public boolean argumentsTypeElided() { return true; /* only exception: lambda with explicit argument types. */ }
// Notify the compilation unit that it contains some functional types, taking care not to add any transient copies. this is assumed not to be a copy
@@ -173,7 +173,7 @@ public abstract class FunctionalExpression extends Expression {
if (expression != expression.original) // fake universe.
return 0;
}
- break;
+ break;
case Scope.COMPILATION_UNIT_SCOPE :
CompilationUnitDeclaration unit = ((CompilationUnitScope) scope).referenceContext;
return unit.record(this);
@@ -199,7 +199,7 @@ public abstract class FunctionalExpression extends Expression {
if (!sam.isValidBinding() && sam.problemId() != ProblemReasons.ContradictoryNullAnnotations) {
return reportSamProblem(blockScope, sam);
}
-
+
this.descriptor = sam;
if (skipKosherCheck || kosherDescriptor(blockScope, sam, true)) {
if (this.expectedType instanceof IntersectionTypeBinding18) {
@@ -217,9 +217,9 @@ public abstract class FunctionalExpression extends Expression {
if (environment.globalOptions.isAnnotationBasedNullAnalysisEnabled) {
NullAnnotationMatching.checkForContradictions(sam, this, blockScope);
}
- return this.resolvedType = this.expectedType;
+ return this.resolvedType = this.expectedType;
}
-
+
return this.resolvedType = null;
}
@@ -245,7 +245,7 @@ public abstract class FunctionalExpression extends Expression {
private boolean shouldChatter;
private boolean visible = true;
private FunctionalExpression expression;
-
+
public VisibilityInspector(FunctionalExpression expression, Scope scope, boolean shouldChatter) {
this.scope = scope;
this.shouldChatter = shouldChatter;
@@ -259,20 +259,20 @@ public abstract class FunctionalExpression extends Expression {
this.scope.problemReporter().descriptorHasInvisibleType(this.expression, referenceBinding);
}
}
-
+
@Override
public boolean visit(ReferenceBinding referenceBinding) {
checkVisibility(referenceBinding);
return true;
}
-
+
@Override
public boolean visit(ParameterizedTypeBinding parameterizedTypeBinding) {
checkVisibility(parameterizedTypeBinding);
return true;
}
-
+
@Override
public boolean visit(RawTypeBinding rawTypeBinding) {
checkVisibility(rawTypeBinding);
@@ -288,13 +288,13 @@ public abstract class FunctionalExpression extends Expression {
TypeBindingVisitor.visit(this, types);
return this.visible;
}
-
+
}
public boolean kosherDescriptor(Scope scope, MethodBinding sam, boolean shouldChatter) {
-
+
VisibilityInspector inspector = new VisibilityInspector(this, scope, shouldChatter);
-
+
boolean status = true;
if (!inspector.visible(sam.returnType))
status = false;
@@ -319,7 +319,7 @@ public abstract class FunctionalExpression extends Expression {
public MethodBinding[] getRequiredBridges() {
class BridgeCollector {
-
+
MethodBinding [] bridges;
MethodBinding method;
char [] selector;
@@ -333,19 +333,19 @@ public abstract class FunctionalExpression extends Expression {
this.scope = FunctionalExpression.this.enclosingScope;
collectBridges(new ReferenceBinding[]{functionalType});
}
-
+
void collectBridges(ReferenceBinding[] interfaces) {
int length = interfaces == null ? 0 : interfaces.length;
for (int i = 0; i < length; i++) {
ReferenceBinding superInterface = interfaces[i];
- if (superInterface == null)
+ if (superInterface == null)
continue;
MethodBinding [] methods = superInterface.getMethods(this.selector);
for (int j = 0, count = methods == null ? 0 : methods.length; j < count; j++) {
MethodBinding inheritedMethod = methods[j];
if (inheritedMethod == null || this.method == inheritedMethod) // descriptor declaring class may not be same functional interface target type.
continue;
- if (inheritedMethod.isStatic() || inheritedMethod.redeclaresPublicObjectMethod(this.scope))
+ if (inheritedMethod.isStatic() || inheritedMethod.redeclaresPublicObjectMethod(this.scope))
continue;
inheritedMethod = MethodVerifier.computeSubstituteMethod(inheritedMethod, this.method, this.environment);
if (inheritedMethod == null || !MethodVerifier.isSubstituteParameterSubsignature(this.method, inheritedMethod, this.environment) ||
@@ -376,7 +376,7 @@ public abstract class FunctionalExpression extends Expression {
return this.bridges;
}
}
-
+
ReferenceBinding functionalType;
if (this.expectedType instanceof IntersectionTypeBinding18) {
functionalType = (ReferenceBinding) ((IntersectionTypeBinding18)this.expectedType).getSAMType(this.enclosingScope);
@@ -386,7 +386,7 @@ public abstract class FunctionalExpression extends Expression {
return new BridgeCollector(functionalType, this.descriptor).getBridges();
}
boolean requiresBridges() {
- return getRequiredBridges() != null;
+ return getRequiredBridges() != null;
}
public void cleanUp() {
// to be overridden by sub-classes
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IPolyExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IPolyExpression.java
index 62af5576f..8bd42cc18 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IPolyExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IPolyExpression.java
@@ -25,9 +25,9 @@ import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
/**
Contract to be implemented by all poly expressions and potential poly expressions for uniform integration into overload resolution and type inference.
- Additional contracts may be imposed by {@link Invocation} and {@link InvocationSite}. For most contracts "default" implementations are furnished by
+ Additional contracts may be imposed by {@link Invocation} and {@link InvocationSite}. For most contracts "default" implementations are furnished by
{@link Expression} or {@link Statement} or by {@link ASTNode} and the poly expression should suitably override where required.
-
+
@see PolyTypeBinding
@see ExpressionContext
*/
@@ -36,17 +36,17 @@ public interface IPolyExpression {
// Expression context manipulation
public void setExpressionContext(ExpressionContext context);
public ExpressionContext getExpressionContext();
-
+
// Target type injection.
public void setExpectedType(TypeBinding targetType);
public TypeBinding invocationTargetType();
-
+
// Compatibility checks.
public boolean isPotentiallyCompatibleWith(TypeBinding targetType, Scope scope);
public boolean isCompatibleWith(TypeBinding targetType, final Scope scope);
public boolean isBoxingCompatibleWith(TypeBinding targetType, Scope scope);
- public boolean sIsMoreSpecific(TypeBinding s, TypeBinding t, Scope skope);
-
+ public boolean sIsMoreSpecific(TypeBinding s, TypeBinding t, Scope skope);
+
// Pertinence checks.
public boolean isPertinentToApplicability(TypeBinding targetType, MethodBinding method);
@@ -55,14 +55,14 @@ public interface IPolyExpression {
public boolean isPolyExpression();
public boolean isFunctionalType();
public Expression[] getPolyExpressions();
-
-
+
+
/* Resolution: A poly expression must be prepared to be resolved multiple times and should manage matters in a side effect free fashion.
Typically, in invocation contexts, there is an initial resolution, multiple tentative resolutions and then a final resolution against
the ultimate target type.
*/
public TypeBinding resolveType(BlockScope blockScope);
- // Resolve expression tentatively - should have no lingering side-effects that may impact final resolution !
+ // Resolve expression tentatively - should have no lingering side-effects that may impact final resolution !
public Expression resolveExpressionExpecting(TypeBinding targetType, Scope scope, InferenceContext18 inferenceContext);
-
+
} \ No newline at end of file
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java
index e987b027b..fa4f4609f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java
@@ -10,7 +10,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Stephan Herrmann - Contributions for
+ * Stephan Herrmann - Contributions for
* bug 319201 - [null] no warning when unboxing SingleNameReference causes NPE
* bug 349326 - [1.7] new warning for missing try-with-resources
* bug 345305 - [compiler][null] Compiler misidentifies a case of "variable can only be null"
@@ -82,7 +82,7 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl
if (isConditionOptimizedTrue) {
elseFlowInfo.setReachMode(FlowInfo.UNREACHABLE_OR_DEAD);
}
- if (((flowInfo.tagBits & FlowInfo.UNREACHABLE) == 0) &&
+ if (((flowInfo.tagBits & FlowInfo.UNREACHABLE) == 0) &&
((thenFlowInfo.tagBits & FlowInfo.UNREACHABLE) != 0)) {
// Mark then block as unreachable
// No need if the whole if-else construct itself lies in unreachable code
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Initializer.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Initializer.java
index 75ae8d653..9e41eadb1 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Initializer.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Initializer.java
@@ -143,7 +143,7 @@ public class Initializer extends FieldDeclaration {
public MethodBinding getMethodBinding() {
if (this.methodBinding == null) {
Scope scope = this.block.scope;
- this.methodBinding = isStatic()
+ this.methodBinding = isStatic()
? new MethodBinding(ClassFileConstants.AccStatic, CharOperation.NO_CHAR, TypeBinding.VOID, Binding.NO_PARAMETERS, Binding.NO_EXCEPTIONS, scope.enclosingSourceType())
: new MethodBinding(0, CharOperation.NO_CHAR, TypeBinding.VOID, Binding.NO_PARAMETERS, Binding.NO_EXCEPTIONS, scope.enclosingSourceType());
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java
index 38173b0c7..0dae2ee46 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java
@@ -166,7 +166,7 @@ public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean
}
// SH}
initializePatternVariables(currentScope, codeStream);
-
+
int pc = codeStream.position;
this.expression.generateCode(currentScope, codeStream, true);
codeStream.instance_of(this.type, this.type.resolvedType);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IntersectionCastTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IntersectionCastTypeReference.java
index f7745d171..f239f4a23 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IntersectionCastTypeReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IntersectionCastTypeReference.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
@@ -67,14 +67,14 @@ public class IntersectionCastTypeReference extends TypeReference {
public TypeReference[] getTypeReferences() {
return this.typeReferences;
}
-
+
@Override
public TypeBinding resolveType(BlockScope scope, boolean checkBounds, int location) {
int length = this.typeReferences.length;
ReferenceBinding[] intersectingTypes = new ReferenceBinding[length];
boolean hasError = false;
-
+
int typeCount = 0;
nextType:
for (int i = 0; i < length; i++) {
@@ -137,7 +137,7 @@ public class IntersectionCastTypeReference extends TypeReference {
itsSuperclass = firstType.superclass();
System.arraycopy(intersectingTypes, 1, interfaces = new ReferenceBinding[typeCount - 1], 0, typeCount - 1);
}
-
+
Map invocations = new HashMap(2);
nextInterface: for (int i = 0, interfaceCount = interfaces.length; i < interfaceCount; i++) {
ReferenceBinding one = interfaces[i];
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Invocation.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Invocation.java
index c20d074e3..5dc4f1d49 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Invocation.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Invocation.java
@@ -29,7 +29,7 @@ public interface Invocation extends InvocationSite {
/** Answer the resolved method binding of this invocation */
MethodBinding binding();
-
+
/**
* Register the given inference context, which produced the given method as its intermediate result.
* Later when the same method is selected as the most specific method, the inference context
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java
index b7825bc07..3d3b25465 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java
@@ -236,7 +236,7 @@ public class Javadoc extends ASTNode {
// @param tags
int paramTagsSize = this.paramReferences == null ? 0 : this.paramReferences.length;
for (int i = 0; i < paramTagsSize; i++) {
- if(scope.referenceContext instanceof RecordDeclaration) {
+ if(scope.referenceContext instanceof RecordDeclaration) {
RecordDeclaration rd = (RecordDeclaration)scope.referenceContext;
if( rd.nRecordComponents > 0)
break;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java
index 6e3f0cb44..093658e0f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java
@@ -29,7 +29,7 @@ public class JavadocImplicitTypeReference extends TypeReference {
this.sourceStart = pos;
this.sourceEnd = pos;
}
-
+
@Override
public TypeReference augmentTypeWithAdditionalDimensions(int additionalDimensions, Annotation[][] additionalAnnotations, boolean isVarargs) {
return null;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LabeledStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LabeledStatement.java
index 74f7893a4..b252fc8af 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LabeledStatement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LabeledStatement.java
@@ -156,7 +156,7 @@ public class LabeledStatement extends Statement {
return false;
return this.statement.doesNotCompleteNormally();
}
-
+
@Override
public boolean completesByContinue() {
return this.statement instanceof ContinueStatement; // NOT this.statement.continuesAtOuterLabel
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java
index 5b07ed635..bb6d3b3b0 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java
@@ -139,7 +139,7 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
private Map<Integer/*sourceStart*/, LocalTypeBinding> localTypes; // support look-up of a local type from this lambda copy
public boolean argumentsTypeVar = false;
-
+
public LambdaExpression(CompilationResult compilationResult, boolean assistNode, boolean requiresGenericSignature) {
super(compilationResult);
this.assistNode = assistNode;
@@ -156,7 +156,7 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
this.arguments = arguments != null ? arguments : ASTNode.NO_ARGUMENTS;
this.argumentTypes = new TypeBinding[arguments != null ? arguments.length : 0];
}
-
+
public Argument [] arguments() {
return this.arguments;
}
@@ -168,7 +168,7 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
public void setBody(Statement body) {
this.body = body == null ? NO_BODY : body;
}
-
+
public Statement body() {
return this.body;
}
@@ -180,15 +180,15 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
public void setArrowPosition(int arrowPosition) {
this.arrowPosition = arrowPosition;
}
-
+
public int arrowPosition() {
return this.arrowPosition;
}
-
+
protected FunctionalExpression original() {
return this.original;
}
-
+
@Override
public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean valueRequired) {
//{ObjectTeams: this needs to happen after AbstractMethodDeclaration.generateCode() has started
@@ -231,7 +231,7 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
codeStream.invokeDynamic(invokeDynamicNumber, (this.shouldCaptureInstance ? 1 : 0) + this.outerLocalVariablesSlotSize, 1, this.descriptor.selector, signature.toString().toCharArray());
if (!valueRequired)
codeStream.pop();
- codeStream.recordPositionsFrom(pc, this.sourceStart);
+ codeStream.recordPositionsFrom(pc, this.sourceStart);
}
@Override
@@ -243,8 +243,8 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
}
return super.kosherDescriptor(currentScope, sam, shouldChatter);
}
-
- /* This code is arranged so that we can continue with as much analysis as possible while avoiding
+
+ /* This code is arranged so that we can continue with as much analysis as possible while avoiding
* mine fields that would result in a slew of spurious messages. This method is a merger of:
* @see org.eclipse.jdt.internal.compiler.lookup.MethodScope.createMethod(AbstractMethodDeclaration)
* @see org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.resolveTypesFor(MethodBinding)
@@ -252,44 +252,44 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
*/
@Override
public TypeBinding resolveType(BlockScope blockScope, boolean skipKosherCheck) {
-
+
boolean argumentsTypeElided = argumentsTypeElided();
int argumentsLength = this.arguments == null ? 0 : this.arguments.length;
-
+
if (this.constant != Constant.NotAConstant) {
this.constant = Constant.NotAConstant;
this.enclosingScope = blockScope;
if (this.original == this)
this.ordinal = recordFunctionalType(blockScope);
-
+
if (!argumentsTypeElided) {
for (int i = 0; i < argumentsLength; i++)
this.argumentTypes[i] = this.arguments[i].type.resolveType(blockScope, true /* check bounds*/);
}
if (this.expectedType == null && this.expressionContext == INVOCATION_CONTEXT) {
return new PolyTypeBinding(this);
- }
+ }
}
-
+
MethodScope methodScope = blockScope.methodScope();
this.scope = new MethodScope(blockScope, this, methodScope.isStatic, methodScope.lastVisibleFieldID);
this.scope.isConstructorCall = methodScope.isConstructorCall;
super.resolveType(blockScope, skipKosherCheck); // compute & capture interface function descriptor.
-
+
final boolean haveDescriptor = this.descriptor != null;
-
+
if (!skipKosherCheck && (!haveDescriptor || this.descriptor.typeVariables != Binding.NO_TYPE_VARIABLES)) // already complained in kosher*
return this.resolvedType = null;
-
+
this.binding = new MethodBinding(ClassFileConstants.AccPrivate | ClassFileConstants.AccSynthetic | ExtraCompilerModifiers.AccUnresolved,
CharOperation.concat(TypeConstants.ANONYMOUS_METHOD, Integer.toString(this.ordinal).toCharArray()), // will be fixed up later.
- haveDescriptor ? this.descriptor.returnType : TypeBinding.VOID,
- Binding.NO_PARAMETERS, // for now.
- haveDescriptor ? this.descriptor.thrownExceptions : Binding.NO_EXCEPTIONS,
+ haveDescriptor ? this.descriptor.returnType : TypeBinding.VOID,
+ Binding.NO_PARAMETERS, // for now.
+ haveDescriptor ? this.descriptor.thrownExceptions : Binding.NO_EXCEPTIONS,
blockScope.enclosingSourceType());
this.binding.typeVariables = Binding.NO_TYPE_VARIABLES;
-
+
boolean argumentsHaveErrors = false;
if (haveDescriptor) {
int parametersLength = this.descriptor.parameters.length;
@@ -303,7 +303,7 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
}
}
}
-
+
TypeBinding[] newParameters = new TypeBinding[argumentsLength];
AnnotationBinding [][] parameterAnnotations = null;
@@ -317,7 +317,7 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
argumentsHaveErrors = true;
}
}
-
+
TypeBinding argumentType;
final TypeBinding expectedParameterType = haveDescriptor && i < this.descriptor.parameters.length ? this.descriptor.parameters[i] : null;
argumentType = argumentsTypeElided ? expectedParameterType : this.argumentTypes[i];
@@ -339,19 +339,19 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
ReferenceBinding groundType = null;
ReferenceBinding expectedSAMType = null;
if (this.expectedType instanceof IntersectionTypeBinding18)
- expectedSAMType = (ReferenceBinding) ((IntersectionTypeBinding18) this.expectedType).getSAMType(blockScope);
+ expectedSAMType = (ReferenceBinding) ((IntersectionTypeBinding18) this.expectedType).getSAMType(blockScope);
else if (this.expectedType instanceof ReferenceBinding)
expectedSAMType = (ReferenceBinding) this.expectedType;
if (expectedSAMType != null)
groundType = findGroundTargetType(blockScope, this.expectedType, expectedSAMType, argumentsTypeElided);
-
+
if (groundType != null) {
this.descriptor = groundType.getSingleAbstractMethod(blockScope, true);
if (!this.descriptor.isValidBinding()) {
reportSamProblem(blockScope, this.descriptor);
} else {
if (groundType != expectedSAMType) { //$IDENTITY-COMPARISON$
- if (!groundType.isCompatibleWith(expectedSAMType, this.scope)) { // the ground has shifted, are we still on firm grounds ?
+ if (!groundType.isCompatibleWith(expectedSAMType, this.scope)) { // the ground has shifted, are we still on firm grounds ?
blockScope.problemReporter().typeMismatchError(groundType, this.expectedType, this, null); // report deliberately against block scope so as not to blame the lambda.
return null;
}
@@ -387,7 +387,7 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
if (leafType instanceof ReferenceBinding && (((ReferenceBinding) leafType).modifiers & ExtraCompilerModifiers.AccGenericSignature) != 0)
this.binding.modifiers |= ExtraCompilerModifiers.AccGenericSignature;
}
- newParameters[i] = argument.bind(this.scope, argumentType, false);
+ newParameters[i] = argument.bind(this.scope, argumentType, false);
if (argument.annotations != null) {
this.binding.tagBits |= TagBits.HasParameterAnnotations;
if (parameterAnnotations == null) {
@@ -413,7 +413,7 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
if (parameterAnnotations != null)
this.binding.setParameterAnnotations(parameterAnnotations);
}
-
+
if (!argumentsTypeElided && !argumentsHaveErrors && this.binding.isVarargs()) {
if (!this.binding.parameters[this.binding.parameters.length - 1].isReifiable()) {
this.scope.problemReporter().possibleHeapPollutionFromVararg(this.arguments[this.arguments.length - 1]);
@@ -430,7 +430,7 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
if (genericSignatureNeeded)
this.binding.modifiers |= (exception.modifiers & ExtraCompilerModifiers.AccGenericSignature);
}
-
+
TypeBinding returnType = this.binding.returnType;
if (returnType != null) {
if ((returnType.tagBits & TagBits.HasMissingType) != 0) {
@@ -453,7 +453,7 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
}
this.binding.modifiers &= ~ExtraCompilerModifiers.AccUnresolved;
-
+
if (this.body instanceof Expression && ((Expression) this.body).isTrulyExpression()) {
Expression expression = (Expression) this.body;
new ReturnStatement(expression, expression.sourceStart, expression.sourceEnd, true).resolve(this.scope); // :-) ;-)
@@ -506,10 +506,10 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
return onlyWildcardMismatch;
}
private ReferenceBinding findGroundTargetType(BlockScope blockScope, TypeBinding targetType, TypeBinding expectedSAMType, boolean argumentTypesElided) {
-
+
if (expectedSAMType instanceof IntersectionTypeBinding18)
- expectedSAMType = ((IntersectionTypeBinding18) expectedSAMType).getSAMType(blockScope);
-
+ expectedSAMType = ((IntersectionTypeBinding18) expectedSAMType).getSAMType(blockScope);
+
if (expectedSAMType instanceof ReferenceBinding && expectedSAMType.isValidBinding()) {
ParameterizedTypeBinding withWildCards = InferenceContext18.parameterizedWithWildcard(expectedSAMType);
if (withWildCards != null) {
@@ -550,8 +550,8 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
boolean oldAnalyseResources = compilerOptions.analyseResourceLeaks;
compilerOptions.analyseResourceLeaks = false;
try {
- this.body.analyseCode(this.scope,
- ehfc = new ExceptionInferenceFlowContext(null, this, Binding.NO_EXCEPTIONS, null, this.scope, FlowInfo.DEAD_END),
+ this.body.analyseCode(this.scope,
+ ehfc = new ExceptionInferenceFlowContext(null, this, Binding.NO_EXCEPTIONS, null, this.scope, FlowInfo.DEAD_END),
UnconditionalFlowInfo.fakeInitializedFlowInfo(this.scope.outerMostMethodScope().analysisIndex, this.scope.referenceType().maxFieldCount));
this.thrownExceptions = ehfc.extendedExceptions == null ? Collections.emptySet() : new HashSet<TypeBinding>(ehfc.extendedExceptions);
} catch (Exception e) {
@@ -562,10 +562,10 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
}
@Override
public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, final FlowInfo flowInfo) {
-
- if (this.ignoreFurtherInvestigation)
+
+ if (this.ignoreFurtherInvestigation)
return flowInfo;
-
+
FlowInfo lambdaInfo = flowInfo.copy(); // what happens in vegas, stays in vegas ...
ExceptionHandlingFlowContext methodContext =
new ExceptionHandlingFlowContext(
@@ -585,9 +585,9 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
this.bits |= (this.arguments[i].bits & ASTNode.HasTypeAnnotations);
}
}
-
+
lambdaInfo = this.body.analyseCode(this.scope, methodContext, lambdaInfo);
-
+
// check for missing returning path for block body's ...
if (this.body instanceof Block) {
TypeBinding returnTypeBinding = expectedResultType();
@@ -601,7 +601,7 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
}
}
} else { // Expression
- if (currentScope.compilerOptions().isAnnotationBasedNullAnalysisEnabled
+ if (currentScope.compilerOptions().isAnnotationBasedNullAnalysisEnabled
&& lambdaInfo.reachMode() == FlowInfo.REACHABLE)
{
Expression expression = (Expression)this.body;
@@ -651,7 +651,7 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
inheritedAnnotationName = env.getNullableAnnotationName();
currentScope.problemReporter().illegalRedefinitionToNonNullParameter(this.arguments[i], this.descriptor.declaringClass, inheritedAnnotationName);
}
- }
+ }
}
}
@@ -699,10 +699,10 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
return true;
if (argumentsTypeElided())
return false;
-
+
if (!super.isPertinentToApplicability(targetType, method))
return false;
-
+
if (this.body instanceof Expression && ((Expression) this.body).isTrulyExpression()) {
if (!((Expression) this.body).isPertinentToApplicability(targetType, method))
return false;
@@ -722,10 +722,10 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
}
}
}
-
+
return true;
}
-
+
public boolean isVoidCompatible() {
return this.voidCompatible;
}
@@ -733,7 +733,7 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
public boolean isValueCompatible() {
return this.valueCompatible;
}
-
+
@Override
public StringBuffer printExpression(int tab, StringBuffer output) {
return printExpression(tab, output, false);
@@ -768,7 +768,7 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
public TypeBinding expectedResultType() {
return this.descriptor != null && this.descriptor.isValidBinding() ? this.descriptor.returnType : null;
}
-
+
@Override
public void traverse(ASTVisitor visitor, BlockScope blockScope) {
@@ -785,11 +785,11 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
}
visitor.endVisit(this, blockScope);
}
-
+
public MethodScope getScope() {
return this.scope;
}
-
+
private boolean enclosingScopesHaveErrors() {
Scope skope = this.enclosingScope;
while (skope != null) {
@@ -800,7 +800,7 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
}
return false;
}
-
+
private void analyzeShape() { // Simple minded analysis for code assist & potential compatibility.
class ShapeComputer extends ASTVisitor {
@Override
@@ -844,11 +844,11 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
this.valueCompatible = this.body.doesNotCompleteNormally();
}
}
-
+
@Override
public boolean isPotentiallyCompatibleWith(TypeBinding targetType, Scope skope) {
/* We get here only when the lambda is NOT pertinent to applicability and that too only for type elided lambdas. */
-
+
/* 15.12.2.1: A lambda expression (§15.27) is potentially compatible with a functional interface type (§9.8) if all of the following are true:
– The arity of the target type's function type is the same as the arity of the lambda expression.
– If the target type's function type has a void return, then the lambda body is either a statement expression (§14.8) or a void-compatible block (§15.27.2).
@@ -856,14 +856,14 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
*/
if (!super.isPertinentToApplicability(targetType, null))
return true;
-
+
final MethodBinding sam = targetType.getSingleAbstractMethod(skope, true);
if (sam == null || !sam.isValidBinding())
return false;
-
+
if (sam.parameters.length != this.arguments.length)
return false;
-
+
analyzeShape();
if (sam.returnType.id == TypeIds.T_void) {
if (!this.voidCompatible)
@@ -886,10 +886,10 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
return internalIsCompatibleWith(targetType, skope, false) == CompatibilityResult.COMPATIBLE;
}
CompatibilityResult internalIsCompatibleWith(TypeBinding targetType, Scope skope, boolean reportShapeProblem) {
-
+
if (!super.isPertinentToApplicability(targetType, null))
return CompatibilityResult.COMPATIBLE;
-
+
LambdaExpression copy = null;
try {
copy = cachedResolvedCopy(targetType, argumentsTypeElided(), false, null); // if argument types are elided, we don't care for result expressions against *this* target, any valid target is OK.
@@ -900,7 +900,7 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
}
if (copy == null)
return CompatibilityResult.INCOMPATIBLE;
-
+
// copy here is potentially compatible with the target type and has its shape fully computed: i.e value/void compatibility is determined and result expressions have been gathered.
targetType = findGroundTargetType(this.enclosingScope, targetType, targetType, argumentsTypeElided());
MethodBinding sam = targetType.getSingleAbstractMethod(this.enclosingScope, true);
@@ -941,7 +941,7 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
}
return CompatibilityResult.COMPATIBLE;
}
-
+
class CopyFailureException extends RuntimeException {
private static final long serialVersionUID = 1L;
}
@@ -951,14 +951,14 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
targetType = findGroundTargetType(this.enclosingScope, targetType, targetType, argumentsTypeElided());
if (targetType == null)
return null;
-
+
MethodBinding sam = targetType.getSingleAbstractMethod(this.enclosingScope, true);
if (sam == null || !sam.isValidBinding())
return null;
-
+
if (sam.parameters.length != this.arguments.length)
return null;
-
+
LambdaExpression copy = null;
if (this.copiesPerTargetType != null) {
copy = this.copiesPerTargetType.get(targetType);
@@ -1008,12 +1008,12 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
// SH}
}
}
-
+
/**
* Get a resolved copy of this lambda for use by type inference, as to avoid spilling any premature
* type results into the original lambda.
- *
- * @param targetType the target functional type against which inference is attempted, must be a non-null valid functional type
+ *
+ * @param targetType the target functional type against which inference is attempted, must be a non-null valid functional type
* @return a resolved copy of 'this' or null if significant errors where encountered
*/
@Override
@@ -1029,12 +1029,12 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
@Override
public boolean sIsMoreSpecific(TypeBinding s, TypeBinding t, Scope skope) {
-
- // 15.12.2.5
-
+
+ // 15.12.2.5
+
if (super.sIsMoreSpecific(s, t, skope))
return true;
-
+
if (argumentsTypeElided() || t.findSuperTypeOriginatingFrom(s) != null)
return false;
TypeBinding sPrime = s; // uncaptured
@@ -1060,17 +1060,17 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
}
TypeBinding r1 = adapted.returnType; // return type of S adapted to type parameters of T
TypeBinding r2 = tSam.returnType;
-
+
if (r2.id == TypeIds.T_void)
return true;
-
+
if (r1.id == TypeIds.T_void)
return false;
-
+
// r1 <: r2
if (r1.isCompatibleWith(r2, skope))
return true;
-
+
LambdaExpression copy;
try {
copy = cachedResolvedCopy(s, true /* any resolved copy is good */, false, null); // we expect a cached copy - otherwise control won't reach here.
@@ -1108,7 +1108,7 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
}
if (i == returnExpressionsLength)
return true;
- }
+ }
}
return false;
}
@@ -1117,7 +1117,7 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
final Parser parser = new Parser(this.enclosingScope.problemReporter(), false);
final ICompilationUnit compilationUnit = this.compilationResult.getCompilationUnit();
char[] source = compilationUnit != null ? compilationUnit.getContents() : this.text;
- LambdaExpression copy = (LambdaExpression) parser.parseLambdaExpression(source, compilationUnit != null ? this.sourceStart : 0, this.sourceEnd - this.sourceStart + 1,
+ LambdaExpression copy = (LambdaExpression) parser.parseLambdaExpression(source, compilationUnit != null ? this.sourceStart : 0, this.sourceEnd - this.sourceStart + 1,
this.enclosingScope.referenceCompilationUnit(), false /* record line separators */);
if (copy != null) { // ==> syntax errors == null
@@ -1152,7 +1152,7 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
this.voidCompatible = !this.returnsValue;
}
}
-
+
@Override
public CompilationResult compilationResult() {
return this.compilationResult;
@@ -1160,7 +1160,7 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
@Override
public void abort(int abortLevel, CategorizedProblem problem) {
-
+
switch (abortLevel) {
case AbortCompilation :
throw new AbortCompilation(this.compilationResult, problem);
@@ -1210,7 +1210,7 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
}
}
}
-
+
@Override
public void tagAsHavingIgnoredMandatoryErrors(int problemId) {
switch (problemId) {
@@ -1219,7 +1219,7 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
case IProblem.UnhandledExceptionInDefaultConstructor:
case IProblem.UnhandledException:
return;
- /* The following structural problems can occur only because of target type imposition. Filter, so we can distinguish inherent errors
+ /* The following structural problems can occur only because of target type imposition. Filter, so we can distinguish inherent errors
in explicit lambdas. This is to help decide whether to proceed with data/control flow analysis to discover shape. In case of inherent
errors, we will not call analyze code as it is not prepared to analyze broken programs.
*/
@@ -1235,7 +1235,7 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
case IProblem.illFormedParameterizationOfFunctionalInterface:
case IProblem.NoGenericLambda:
return;
- default:
+ default:
this.hasIgnoredMandatoryErrors = true;
MethodScope enclosingLambdaScope = this.scope == null ? null : this.scope.enclosingLambdaScope();
while (enclosingLambdaScope != null) {
@@ -1246,7 +1246,7 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
return;
}
}
-
+
public Set<TypeBinding> getThrownExceptions() {
if (this.thrownExceptions == null)
return Collections.emptySet();
@@ -1281,7 +1281,7 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
}
} while (restart);
}
-
+
public void generateCode(ClassFile classFile) {
classFile.generateMethodInfoHeader(this.binding);
int methodAttributeOffset = classFile.contentsOffset;
@@ -1334,12 +1334,12 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
classFile.completeMethodInfo(this.binding, methodAttributeOffset, attributeNumber);
}
-
+
public void addSyntheticArgument(LocalVariableBinding actualOuterLocalVariable) {
-
- if (this.original != this || this.binding == null)
+
+ if (this.original != this || this.binding == null)
return; // Do not bother tracking outer locals for clones created during overload resolution.
-
+
SyntheticArgumentBinding syntheticLocal = null;
int newSlot = this.outerLocalVariables.length;
for (int i = 0; i < newSlot; i++) {
@@ -1366,7 +1366,7 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
default :
this.outerLocalVariablesSlotSize++;
break;
- }
+ }
}
public SyntheticArgumentBinding getSyntheticArgument(LocalVariableBinding actualOuterLocalVariable) {
@@ -1376,7 +1376,7 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
return null;
}
- // Return the actual method binding devoid of synthetics.
+ // Return the actual method binding devoid of synthetics.
@Override
public MethodBinding getMethodBinding() {
if (this.actualMethodBinding == null) {
@@ -1428,10 +1428,10 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
}
public ReferenceBinding getTypeBinding() {
-
+
if (this.classType != null || this.resolvedType == null)
return null;
-
+
class LambdaTypeBinding extends ReferenceBinding {
@Override
public MethodBinding[] methods() {
@@ -1484,7 +1484,7 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
*/
class LocalTypeSubstitutor extends Substitutor {
Map<Integer,LocalTypeBinding> localTypes2;
-
+
public LocalTypeSubstitutor(Map<Integer, LocalTypeBinding> localTypes) {
this.localTypes2 = localTypes;
}
@@ -1496,7 +1496,7 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
MethodScope lambdaScope2 = orgLocal.scope.enclosingLambdaScope();
if (lambdaScope2 != null) {
if (((LambdaExpression) lambdaScope2.referenceContext).sourceStart == LambdaExpression.this.sourceStart) {
- // local type within this lambda needs replacement:
+ // local type within this lambda needs replacement:
TypeBinding substType = this.localTypes2.get(orgLocal.sourceStart);
if (substType != null && substType != orgLocal) { //$IDENTITY-COMPARISON$
orgLocal.transferConstantPoolNameTo(substType);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java
index 026243af0..7ce3c26b3 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java
@@ -37,7 +37,7 @@
* Bug 529556 - [18.3] Add content assist support for 'var' as a type
* Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
* Bug 409250 - [1.8][compiler] Various loose ends in 308 code generation
- * Bug 426616 - [1.8][compiler] Type Annotations, multiple problems
+ * Bug 426616 - [1.8][compiler] Type Annotations, multiple problems
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.ast;
@@ -130,9 +130,9 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl
return flowInfo;
}
this.initialization.checkNPEbyUnboxing(currentScope, flowContext, flowInfo);
-
+
FlowInfo preInitInfo = null;
- boolean shouldAnalyseResource = this.binding != null
+ boolean shouldAnalyseResource = this.binding != null
&& flowInfo.reachMode() == FlowInfo.REACHABLE
&& currentScope.compilerOptions().analyseResourceLeaks
//{ObjectTeams: notably lift methods of Closeable roles would trigger warnings against synthetic code
@@ -261,7 +261,7 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl
AnnotationCollector collector = new AnnotationCollector(this, targetType, parameterIndex, allAnnotationContexts);
this.traverse(collector, (BlockScope) null);
}
-
+
public boolean isArgument() {
return false;
}
@@ -272,7 +272,7 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl
// Perform upwards projection on type wrt mentioned type variables
TypeBinding[] mentionedTypeVariables= findCapturedTypeVariables(newType);
if (mentionedTypeVariables != null && mentionedTypeVariables.length > 0) {
- newType = newType.upwardsProjection(this.binding.declaringScope, mentionedTypeVariables);
+ newType = newType.upwardsProjection(this.binding.declaringScope, mentionedTypeVariables);
}
this.type.resolvedType = newType;
if (this.binding != null) {
@@ -295,7 +295,7 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl
if (mentioned.isEmpty()) return null;
return mentioned.toArray(new TypeVariableBinding[mentioned.size()]);
}
-
+
private static Expression findPolyExpression(Expression e) {
// This is simpler than using an ASTVisitor, since we only care about a very few select cases.
if (e instanceof FunctionalExpression) {
@@ -318,7 +318,7 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl
}
return null;
}
-
+
@Override
public void resolve(BlockScope scope) {
resolve(scope, false);
@@ -398,10 +398,10 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl
}
if (isTypeNameVar) {
// Create binding for the initializer's type
- // In order to resolve self-referential initializers, we must declare the variable with a placeholder type (j.l.Object), and then patch it later
+ // In order to resolve self-referential initializers, we must declare the variable with a placeholder type (j.l.Object), and then patch it later
this.binding = new LocalVariableBinding(this, variableType != null ? variableType : scope.getJavaLangObject(), this.modifiers, false) {
private boolean isInitialized = false;
-
+
@Override
public void markReferenced() {
if (! this.isInitialized) {
@@ -451,9 +451,9 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl
return;
}
boolean resolveAnnotationsEarly = false;
- if (scope.environment().usesNullTypeAnnotations()
+ if (scope.environment().usesNullTypeAnnotations()
&& !isTypeNameVar // 'var' does not provide a target type
- && variableType != null && variableType.isValidBinding()) {
+ && variableType != null && variableType.isValidBinding()) {
resolveAnnotationsEarly = this.initialization instanceof Invocation
|| this.initialization instanceof ConditionalExpression
|| this.initialization instanceof SwitchExpression
@@ -583,8 +583,8 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl
}
visitor.endVisit(this, scope);
}
-
- private void traverseWithoutInitializer(ASTVisitor visitor, BlockScope scope) {
+
+ private void traverseWithoutInitializer(ASTVisitor visitor, BlockScope scope) {
if (visitor.visit(this, scope)) {
if (this.annotations != null) {
int annotationsLength = this.annotations.length;
@@ -597,12 +597,12 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl
}
public boolean isRecoveredFromLoneIdentifier() { // recovered from lonely identifier or identifier cluster ?
- return this.name == RecoveryScanner.FAKE_IDENTIFIER &&
+ return this.name == RecoveryScanner.FAKE_IDENTIFIER &&
(this.type instanceof SingleTypeReference || (this.type instanceof QualifiedTypeReference && !(this.type instanceof ArrayQualifiedTypeReference))) && this.initialization == null && !this.type.isBaseTypeReference();
}
-
+
public boolean isTypeNameVar(Scope scope) {
return this.type != null && this.type.isTypeNameVar(scope);
}
-
+
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MemberValuePair.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MemberValuePair.java
index b65a66745..a217432f7 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MemberValuePair.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MemberValuePair.java
@@ -119,7 +119,7 @@ public class MemberValuePair extends ASTNode {
&& requiredType.dimensions() == 1
&& (MemberValuePair.this.value.isConstantValueOfTypeAssignableToType(valueType, leafType)
|| valueType.isCompatibleWith(leafType)))) {
-
+
if (leafType.isAnnotationType() && !valueType.isAnnotationType()) {
scope.problemReporter().annotationValueMustBeAnnotation(MemberValuePair.this.binding.declaringClass,
MemberValuePair.this.name, MemberValuePair.this.value, leafType);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java
index db5498f9b..b53b7819e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java
@@ -49,7 +49,7 @@
* Bug 426290 - [1.8][compiler] Inference + overloading => wrong method resolution ?
* Bug 427483 - [Java 8] Variables in lambdas sometimes can't be resolved
* Bug 427438 - [1.8][compiler] NPE at org.eclipse.jdt.internal.compiler.ast.ConditionalExpression.generateCode(ConditionalExpression.java:280)
- * Bug 426996 - [1.8][inference] try to avoid method Expression.unresolve()?
+ * Bug 426996 - [1.8][inference] try to avoid method Expression.unresolve()?
* Bug 428352 - [1.8][compiler] Resolution errors don't always surface
* Bug 429430 - [1.8] Lambdas and method reference infer wrong exception type with generics (RuntimeException instead of IOException)
* Bug 441734 - [1.8][inference] Generic method with nested parameterized type argument fails on method reference
@@ -57,7 +57,7 @@
* Bug 456487 - [1.8][null] @Nullable type variant of @NonNull-constrained type parameter causes grief
* Bug 407414 - [compiler][null] Incorrect warning on a primitive type being null
* Bug 472618 - [compiler][null] assertNotNull vs. Assert.assertNotNull
- * Bug 470958 - [1.8] Unable to convert lambda
+ * Bug 470958 - [1.8] Unable to convert lambda
* Bug 410218 - Optional warning for arguments of "unexpected" types to Map#get(Object), Collection#remove(Object) et al.
* Jesper S Moller - Contributions for
* Bug 378674 - "The method can be declared as static" is wrong
@@ -211,12 +211,12 @@ public class MessageSend extends Expression implements IPolyExpression, Invocati
private SimpleLookupTable/*<PGMB,InferenceContext18>*/ inferenceContexts;
private HashMap<TypeBinding, MethodBinding> solutionsPerTargetType;
private InferenceContext18 outerInferenceContext; // resolving within the context of an outer (lambda) inference?
-
+
private boolean receiverIsType;
protected boolean argsContainCast;
public TypeBinding[] argumentTypes = Binding.NO_PARAMETERS;
public boolean argumentsHaveErrors = false;
-
+
public FakedTrackingVariable closeTracker;
//{ObjectTeams:
@@ -248,7 +248,7 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl
for (int i=0; i<TypeConstants.closeMethods.length; i++) {
CloseMethodRecord record = TypeConstants.closeMethods[i];
if (CharOperation.equals(record.selector, this.selector)
- && CharOperation.equals(record.typeName, this.binding.declaringClass.compoundName))
+ && CharOperation.equals(record.typeName, this.binding.declaringClass.compoundName))
{
int len = Math.min(record.numCloseableArgs, this.arguments.length);
for (int j=0; j<len; j++)
@@ -364,19 +364,19 @@ private void recordCallingClose(BlockScope currentScope, FlowContext flowContext
//{ObjectTeams: checkBaseCallsIfSuper
protected FlowInfo checkBaseCallsIfSuper(BlockScope currentScope, FlowInfo flowInfo) {
MethodScope methodScope = currentScope.methodScope();
- if (methodScope == null)
+ if (methodScope == null)
return flowInfo;
AbstractMethodDeclaration methodDecl = methodScope.referenceMethod();
- if (methodDecl == null || !methodDecl.isCallin())
+ if (methodDecl == null || !methodDecl.isCallin())
return flowInfo;
if (!this.isSuperAccess())
return flowInfo;
MethodDeclaration callinMethod = (MethodDeclaration) methodDecl;
if (MethodModel.hasCallinFlag(this.binding, CALLIN_FLAG_DEFINITELY_MISSING_BASECALL))
return flowInfo; // no effect
-
+
boolean definitelyViaSuper = !MethodModel.hasCallinFlag(this.binding, CALLIN_FLAG_POTENTIALLY_MISSING_BASECALL);
-
+
LocalVariableBinding trackingVariable = callinMethod.baseCallTrackingVariable.binding;
if (flowInfo.isDefinitelyAssigned(callinMethod.baseCallTrackingVariable)) {
if (definitelyViaSuper)
@@ -460,13 +460,13 @@ private int detectAssertionUtility(int argumentIdx) {
if (CharOperation.equals(TypeConstants.CHECK_NOT_NULL, this.selector))
return NONNULL_ASSERTION;
}
- break;
+ break;
case TypeIds.T_JavaUtilObjects:
if (parameterType.isTypeVariable()) {
if (CharOperation.equals(TypeConstants.REQUIRE_NON_NULL, this.selector))
return NONNULL_ASSERTION;
}
- break;
+ break;
}
}
}
@@ -510,7 +510,7 @@ private FlowInfo analyseBooleanAssertion(BlockScope currentScope, Expression arg
// if the code does reach ahead, it means the assert didn't cause an exit, and so
// the expression inside it shouldn't change the prior flowinfo
// viz. org.eclipse.core.runtime.Assert.isLegal(false && o != null)
-
+
// keep the merge from the initial code for the definite assignment
// analysis, tweak the null part to influence nulls downstream
flowInfo = flowInfo.mergedWith(assertWhenFailInfo.nullInfoLessUnconditionalCopy()).
@@ -526,14 +526,14 @@ private FlowInfo analyseNullAssertion(BlockScope currentScope, Expression argume
flowInfo = argument.analyseCode(currentScope, flowContext, flowInfo).unconditionalInits();
LocalVariableBinding local = argument.localVariableBinding();
if (local != null) {// beyond this point the argument can only be null/nonnull
- if (expectingNull)
+ if (expectingNull)
flowInfo.markAsDefinitelyNull(local);
- else
+ else
flowInfo.markAsDefinitelyNonNull(local);
} else {
if (!expectingNull
- && argument instanceof Reference
- && currentScope.compilerOptions().enableSyntacticNullAnalysisForFields)
+ && argument instanceof Reference
+ && currentScope.compilerOptions().enableSyntacticNullAnalysisForFields)
{
FieldBinding field = ((Reference)argument).lastFieldBinding();
if (field != null && (field.type.tagBits & TagBits.IsBaseType) == 0) {
@@ -552,7 +552,7 @@ public boolean checkNPE(BlockScope scope, FlowContext flowContext, FlowInfo flow
int nullStatus = nullStatus(flowInfo, flowContext); // note that flowInfo is not used inside nullStatus(..)
if ((nullStatus & FlowInfo.POTENTIALLY_NULL) != 0) {
if(this.binding.returnType.isTypeVariable() && nullStatus == FlowInfo.FREE_TYPEVARIABLE && scope.environment().globalOptions.pessimisticNullAnalysisForFreeTypeVariablesEnabled) {
- scope.problemReporter().methodReturnTypeFreeTypeVariableReference(this.binding, this);
+ scope.problemReporter().methodReturnTypeFreeTypeVariableReference(this.binding, this);
} else {
scope.problemReporter().messageSendPotentialNullReference(this.binding, this);
}
@@ -590,7 +590,7 @@ public void computeConversion(Scope scope, TypeBinding runtimeTimeType, TypeBind
TypeBinding leafRuntime = runtimeTimeType.leafComponentType();
if ((leafCompile instanceof ReferenceBinding) && (leafRuntime instanceof ReferenceBinding)
&& ((ReferenceBinding)leafCompile).isCompatibleViaLowering((ReferenceBinding) leafRuntime))
- this.valueCast = originalType.genericCast(compileTimeType);
+ this.valueCast = originalType.genericCast(compileTimeType);
// SH}
}
if (this.valueCast instanceof ReferenceBinding) {
@@ -639,13 +639,13 @@ public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean
}
//{ObjectTeams: various synthetic arguments for static role methods:
// role method bridge needs role arg (null)
- if ( this.syntheticAccessor instanceof SyntheticRoleBridgeMethodBinding
+ if ( this.syntheticAccessor instanceof SyntheticRoleBridgeMethodBinding
&& !this.syntheticAccessor.isStatic() // non-static accessor ...
&& this.binding.isStatic()) // towards static role method
{
codeStream.aload_0(); // receiver: team instance
codeStream.aconst_null(); // arg: no role instance
- codeStream.iconst_0(); // arg: dummy
+ codeStream.iconst_0(); // arg: dummy
codeStream.aload_0(); // arg: team instance
// directly use the accessor and its declaring class for the invoke instruction:
this.binding = this.syntheticAccessor;
@@ -682,7 +682,7 @@ public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean
//{ObjectTeams: decapsulated methods will not be private in the JVM any more:
/* orig:
} else if((this.receiver.isSuper()) || codegenBinding.isPrivate()){
- } else if((this.receiver.isSuper()) ||
+ } else if((this.receiver.isSuper()) ||
(!currentScope.enclosingSourceType().isNestmateOf(this.binding.declaringClass) && codegenBinding.isPrivate())){
:giro */
@@ -765,7 +765,7 @@ public void manageSyntheticAccessIfNecessary(BlockScope currentScope, FlowInfo f
boolean useNesting = currentScope.enclosingSourceType().isNestmateOf(codegenBinding.declaringClass) &&
!(this.receiver instanceof QualifiedSuperReference);
//{ObjectTeams: nesting a la JEP 181 doesn't help for private role methods
- useNesting &= !this.actualReceiverType.isRole();
+ useNesting &= !this.actualReceiverType.isRole();
// SH}
// depth is set for both implicit and explicit access (see MethodBinding#canBeSeenBy)
if (!useNesting &&
@@ -776,7 +776,7 @@ public void manageSyntheticAccessIfNecessary(BlockScope currentScope, FlowInfo f
}
} else if (this.receiver instanceof QualifiedSuperReference) { // qualified super
- if (this.actualReceiverType.isInterface())
+ if (this.actualReceiverType.isInterface())
return; // invoking an overridden default method, which is accessible/public by definition
// qualified super need emulation always
SourceTypeBinding destinationType = (SourceTypeBinding)(((QualifiedSuperReference)this.receiver).currentCompatibleType);
@@ -900,7 +900,7 @@ public StringBuffer printExpression(int indent, StringBuffer output){
@Override
public TypeBinding resolveType(BlockScope scope) {
- // Answer the signature return type, answers PolyTypeBinding if a poly expression and there is no target type
+ // Answer the signature return type, answers PolyTypeBinding if a poly expression and there is no target type
// Base type promotion
if (this.constant != Constant.NotAConstant) {
this.constant = Constant.NotAConstant;
@@ -973,7 +973,7 @@ public TypeBinding resolveType(BlockScope scope) {
//{ObjectTeams: keep pre-resolved binding inside generated code:
if (!this.isGenerated)
// SH}
- if (this.arguments[i].resolvedType != null)
+ if (this.arguments[i].resolvedType != null)
scope.problemReporter().genericInferenceError("Argument was unexpectedly found resolved", this); //$NON-NLS-1$
if (argument instanceof CastExpression) {
argument.bits |= ASTNode.DisableUnnecessaryCastCheck; // will check later on
@@ -1038,7 +1038,7 @@ public TypeBinding resolveType(BlockScope scope) {
return null;
}
}
-
+
//{ObjectTeams: revert receiver weakening & setup anchorMapping:
if (this.actualReceiverType instanceof WeakenedTypeBinding) {
// this happens if receiver is a role-type field from a super team, see B.1.1-otjld-sh-32.
@@ -1189,7 +1189,7 @@ public TypeBinding resolveType(BlockScope scope) {
} else {
// orig:
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=245007 avoid secondary errors in case of
- // missing super type for anonymous classes ...
+ // missing super type for anonymous classes ...
ReferenceBinding declaringClass = this.binding.declaringClass;
boolean avoidSecondary = declaringClass != null &&
declaringClass.isAnonymousType() &&
@@ -1273,7 +1273,7 @@ public TypeBinding resolveType(BlockScope scope) {
returnType = scope.environment().createAnnotatedType(returnType, new AnnotationBinding[] {scope.environment().getNonNullAnnotation()});
// SH}
}
-
+
if (((this.bits & ASTNode.InsideExpressionStatement) != 0)
&& this.binding.isPolymorphic()) {
// we only set the return type to be void if this method invocation is used inside an expression statement
@@ -1415,13 +1415,13 @@ protected TypeBinding findMethodBinding(BlockScope scope) {
if (referenceContext instanceof LambdaExpression) {
this.outerInferenceContext = ((LambdaExpression) referenceContext).inferenceContext;
}
-
+
if (this.expectedType != null && this.binding instanceof PolyParameterizedGenericMethodBinding) {
this.binding = this.solutionsPerTargetType.get(this.expectedType);
}
if (this.binding == null) { // first look up or a "cache miss" somehow.
- this.binding = this.receiver.isImplicitThis() ?
- scope.getImplicitMethod(this.selector, this.argumentTypes, this)
+ this.binding = this.receiver.isImplicitThis() ?
+ scope.getImplicitMethod(this.selector, this.argumentTypes, this)
: scope.getMethod(this.actualReceiverType, this.selector, this.argumentTypes, this);
if (this.binding instanceof PolyParameterizedGenericMethodBinding) {
@@ -1461,7 +1461,7 @@ protected AnchorMapping beforeMethodLookup(
if (this.actualReceiverType instanceof ReferenceBinding) // funny thing: receiver could be array..
Dependencies.ensureBindingState(
(ReferenceBinding)this.actualReceiverType,
- ITranslationStates.STATE_METHODS_CREATED); // creates bindings for possible target methods (incl. shorthand callout)
+ ITranslationStates.STATE_METHODS_CREATED); // creates bindings for possible target methods (incl. shorthand callout)
} finally {
// it is essential that we setup an anchor mapping in any case.
result = AnchorMapping.setupNewMapping(receiverForAnchorMapping(scope), this.arguments, scope);
@@ -1560,7 +1560,7 @@ private TypeBinding checkStrengthenReturnType(TypeBinding returnType, Scope scop
strengthenedReturnType = (ReferenceBinding)TeamModel.strengthenRoleType(site, currentType);
if (TypeBinding.equalsEquals(strengthenedReturnType, currentType))
return returnType; //unchanged
-
+
// if strengthenRoleType actually worked it returned a dependent type
this.resolvedType = WeakenedTypeBinding.makeWeakenedTypeBinding((DependentTypeBinding) strengthenedReturnType, currentType, returnType.dimensions());
}
@@ -1622,7 +1622,7 @@ public void setExpressionContext(ExpressionContext context) {
@Override
public boolean isPolyExpression() {
-
+
/* 15.12 has four requirements: 1) The invocation appears in an assignment context or an invocation context
2) The invocation elides NonWildTypeArguments 3) the method to be invoked is a generic method (8.4.4).
4) The return type of the method to be invoked mentions at least one of the method's type parameters.
@@ -1690,26 +1690,26 @@ public boolean isCompatibleWith(TypeBinding targetType, final Scope scope) {
public boolean isPolyExpression(MethodBinding resolutionCandidate) {
if (this.expressionContext != ASSIGNMENT_CONTEXT && this.expressionContext != INVOCATION_CONTEXT)
return false;
-
+
if (this.typeArguments != null && this.typeArguments.length > 0)
return false;
-
+
if (this.constant != Constant.NotAConstant)
throw new UnsupportedOperationException("Unresolved MessageSend can't be queried if it is a polyexpression"); //$NON-NLS-1$
-
+
if (resolutionCandidate != null) {
if (resolutionCandidate instanceof ParameterizedGenericMethodBinding) {
ParameterizedGenericMethodBinding pgmb = (ParameterizedGenericMethodBinding) resolutionCandidate;
if (pgmb.inferredReturnType)
return true; // if already determined
- }
+ }
if (resolutionCandidate.returnType != null) {
// resolution may have prematurely instantiated the generic method, we need the original, though:
MethodBinding candidateOriginal = resolutionCandidate.original();
return candidateOriginal.returnType.mentionsAny(candidateOriginal.typeVariables(), -1);
}
}
-
+
return false;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java
index b962af479..e52d215a1 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java
@@ -119,7 +119,7 @@ public class MethodDeclaration extends AbstractMethodDeclaration {
&& this.binding.isOrEnclosedByPrivateType())) {
if (!classScope.referenceCompilationUnit().compilationResult.hasSyntaxError) {
//{ObjectTeams: don't report against generated methods nor roles (could be accessed by tsub role):
- if ( !CharOperation.prefixEquals(IOTConstants.OT_DOLLAR_NAME, this.selector)
+ if ( !CharOperation.prefixEquals(IOTConstants.OT_DOLLAR_NAME, this.selector)
&& (!classScope.referenceContext.isRole()
|| (classScope.referenceContext.binding.isAnonymousType() && !classScope.referenceContext.isPurelyCopied))) // do report against non-copied anonymous types
// SH}
@@ -140,14 +140,14 @@ public class MethodDeclaration extends AbstractMethodDeclaration {
// may be in a non necessary <clinit> for innerclass with static final constant fields
if (this.binding.isAbstract() || this.binding.isNative())
return;
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=385780
if (this.typeParameters != null &&
!this.scope.referenceCompilationUnit().compilationResult.hasSyntaxError) {
for (int i = 0, length = this.typeParameters.length; i < length; ++i) {
TypeParameter typeParameter = this.typeParameters[i];
if ((typeParameter.binding.modifiers & ExtraCompilerModifiers.AccLocallyUsed) == 0) {
- this.scope.problemReporter().unusedTypeParameter(typeParameter);
+ this.scope.problemReporter().unusedTypeParameter(typeParameter);
}
}
}
@@ -215,7 +215,7 @@ public class MethodDeclaration extends AbstractMethodDeclaration {
this.scope.problemReporter().methodCanBePotentiallyDeclaredStatic(this);
}
}
-
+
}
this.scope.checkUnclosedCloseables(flowInfo, null, null/*don't report against a specific location*/, null);
} catch (AbortMethod e) {
@@ -250,10 +250,10 @@ public class MethodDeclaration extends AbstractMethodDeclaration {
annotation.traverse(collector, (BlockScope) null);
}
}
-
+
public boolean hasNullTypeAnnotation(AnnotationPosition position) {
// parser associates SE8 annotations to the declaration
- return TypeReference.containsNullAnnotation(this.annotations) ||
+ return TypeReference.containsNullAnnotation(this.annotations) ||
(this.returnType != null && this.returnType.hasNullTypeAnnotation(position)); // just in case
}
@@ -397,7 +397,7 @@ public class MethodDeclaration extends AbstractMethodDeclaration {
// actually overrides, but did not claim to do so
this.scope.problemReporter().missingOverrideAnnotationForInterfaceMethodImplementation(this);
}
-
+
}
}
else { //For 1.6 and above only
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ModuleDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ModuleDeclaration.java
index 6fa9fab81..e987dde9b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ModuleDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ModuleDeclaration.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.ast;
@@ -277,13 +277,13 @@ public class ModuleDeclaration extends ASTNode implements ReferenceContext {
}
}
this.binding.setUses(allTypes.toArray(new TypeBinding[allTypes.size()]));
-
+
Set<TypeBinding> interfaces = new HashSet<>();
for(int i = 0; i < this.servicesCount; i++) {
this.services[i].resolve(this.scope);
TypeBinding infBinding = this.services[i].serviceInterface.resolvedType;
if (infBinding != null && infBinding.isValidBinding()) {
- if (!interfaces.add(this.services[i].serviceInterface.resolvedType)) {
+ if (!interfaces.add(this.services[i].serviceInterface.resolvedType)) {
cuScope.problemReporter().duplicateTypeReference(IProblem.DuplicateServices,
this.services[i].serviceInterface);
}
@@ -297,7 +297,7 @@ public class ModuleDeclaration extends ASTNode implements ReferenceContext {
analyseModuleGraph(skope);
analyseReferencedPackages(skope);
}
-
+
private void analyseReferencedPackages(CompilationUnitScope skope) {
if (this.exports != null) {
analyseSomeReferencedPackages(this.exports, skope);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ModuleReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ModuleReference.java
index 4f9af71dc..c8ebf645c 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ModuleReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ModuleReference.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.ast;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ModuleStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ModuleStatement.java
index a53484f63..62c9ac2d6 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ModuleStatement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ModuleStatement.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.ast;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/NameReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/NameReference.java
index 2e2905f47..a750efc9b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/NameReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/NameReference.java
@@ -15,7 +15,7 @@
* Stephan Herrmann - Contribution for
* bug 331649 - [compiler][null] consider null annotations for fields
* Bug 400874 - [1.8][compiler] Inference infrastructure should evolve to meet JLS8 18.x (Part G of JSR335 spec)
- * Bug 426996 - [1.8][inference] try to avoid method Expression.unresolve()?
+ * Bug 426996 - [1.8][inference] try to avoid method Expression.unresolve()?
* Jesper S Moller - Contributions for
* bug 382721 - [1.8][compiler] Effectively final variables needs special treatment
*******************************************************************************/
@@ -84,7 +84,7 @@ public NameReference() {
this.bits |= Binding.TYPE | Binding.VARIABLE; // restrictiveFlag
}
-/**
+/**
* Use this method only when sure that the current reference is <strong>not</strong>
* a chain of several fields (QualifiedNameReference with more than one field).
* Otherwise use {@link #lastFieldBinding()}.
@@ -147,7 +147,7 @@ public abstract String unboundReferenceErrorName();
public abstract char[][] getName();
-/* Called during code generation to ensure that outer locals's effectively finality is guaranteed.
+/* Called during code generation to ensure that outer locals's effectively finality is guaranteed.
Aborts if constraints are violated. Due to various complexities, this check is not conveniently
implementable in resolve/analyze phases.
*/
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/NullAnnotationMatching.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/NullAnnotationMatching.java
index 1054469f7..6a7c7101c 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/NullAnnotationMatching.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/NullAnnotationMatching.java
@@ -51,7 +51,7 @@ import org.eclipse.jdt.internal.compiler.problem.ProblemSeverities;
* @since 3.10
*/
public class NullAnnotationMatching {
-
+
public static final NullAnnotationMatching NULL_ANNOTATIONS_OK = new NullAnnotationMatching(Severity.OK, FlowInfo.UNKNOWN, null);
public static final NullAnnotationMatching NULL_ANNOTATIONS_OK_NONNULL = new NullAnnotationMatching(Severity.OK, FlowInfo.NON_NULL, null);
public static final NullAnnotationMatching NULL_ANNOTATIONS_UNCHECKED = new NullAnnotationMatching(Severity.UNCHECKED, FlowInfo.UNKNOWN, null);
@@ -74,7 +74,7 @@ public class NullAnnotationMatching {
OVERRIDE_RETURN {
@Override CheckMode toDetail() {
return OVERRIDE;
- }
+ }
},
/** in this mode we do not tolerate incompatibly missing annotations on type parameters (for overriding analysis) */
OVERRIDE {
@@ -85,7 +85,7 @@ public class NullAnnotationMatching {
return OVERRIDE;
}
};
-
+
boolean requiredNullableMatchesAll() {
return false;
}
@@ -111,18 +111,18 @@ public class NullAnnotationMatching {
return severity;
return this;
}
-
+
public boolean isAnyMismatch() {
return compareTo(LEGACY_WARNING) > 0;
}
}
private final Severity severity;
-
+
/** If non-null this field holds the supertype of the provided type which was used for direct matching. */
public final TypeBinding superTypeHint;
public final int nullStatus;
-
+
NullAnnotationMatching(Severity severity, int nullStatus, TypeBinding superTypeHint) {
this.severity = severity;
this.superTypeHint = superTypeHint;
@@ -150,7 +150,7 @@ public class NullAnnotationMatching {
public String superTypeHintName(CompilerOptions options, boolean shortNames) {
return String.valueOf(this.superTypeHint.nullAnnotatedReadableName(options, shortNames));
}
-
+
/** Check null-ness of 'var' against a possible null annotation */
public static int checkAssignment(BlockScope currentScope, FlowContext flowContext,
VariableBinding var, FlowInfo flowInfo, int nullStatus, Expression expression, TypeBinding providedType)
@@ -180,7 +180,7 @@ public class NullAnnotationMatching {
for (int i = 1, l = resExprs.length; i < l; ++i) {
re = resExprs[i];
int otherStatus = NullAnnotationMatching.checkAssignment(currentScope, flowContext, var, flowInfo, re.nullStatus(flowInfo, flowContext), re, re.resolvedType);
- identicalStatus &= status0 == otherStatus;
+ identicalStatus &= status0 == otherStatus;
}
return identicalStatus ? status0 : nullStatus; // if not all branches agree use the precomputed & merged nullStatus
}
@@ -294,7 +294,7 @@ public class NullAnnotationMatching {
long requiredBits = validNullTagBits(requiredDimsTagBits[i]);
long providedBits = validNullTagBits(providedDimsTagBits[i]);
if (i == 0 && requiredBits == TagBits.AnnotationNullable && nullStatus != -1 && mode.requiredNullableMatchesAll()) {
- // toplevel nullable array: no need to check
+ // toplevel nullable array: no need to check
if (nullStatus == FlowInfo.NULL)
break; // null value has no details
} else {
@@ -395,7 +395,7 @@ public class NullAnnotationMatching {
if (method != null && method.isValidBinding()) {
MethodBinding originalMethod = method.original();
TypeBinding originalDeclaringClass = originalMethod.declaringClass;
- if (originalDeclaringClass instanceof BinaryTypeBinding
+ if (originalDeclaringClass instanceof BinaryTypeBinding
&& ((BinaryTypeBinding) originalDeclaringClass).externalAnnotationStatus.isPotentiallyUnannotatedLib()
&& originalMethod.returnType.isTypeVariable()
&& (originalMethod.returnType.tagBits & TagBits.AnnotationNullMASK) == 0)
@@ -462,8 +462,8 @@ public class NullAnnotationMatching {
break;
}
return TagBits.AnnotationNullMASK;
- }
-
+ }
+
if (type.isTypeVariable()) {
// assume we must require @NonNull, unless lower @Nullable bound
// (annotation directly on the TV has already been checked above)
@@ -496,11 +496,11 @@ public class NullAnnotationMatching {
long tagBits = type.tagBits & TagBits.AnnotationNullMASK;
if (tagBits != 0)
return validNullTagBits(tagBits);
-
+
if (type.isWildcard()) { // wildcard can be 'provided' during inheritance checks
return TagBits.AnnotationNullMASK;
}
-
+
if (type.isTypeVariable()) { // incl. captures
TypeVariableBinding typeVariable = (TypeVariableBinding)type;
boolean haveNullBits = false;
@@ -544,7 +544,7 @@ public class NullAnnotationMatching {
bits &= TagBits.AnnotationNullMASK;
return bits == TagBits.AnnotationNullMASK ? 0 : bits;
}
-
+
/** Provided that both types are {@link TypeBinding#equalsEquals}, return the one that is more likely to show null at runtime. */
public static TypeBinding moreDangerousType(TypeBinding one, TypeBinding two) {
if (one == null) return null;
@@ -578,7 +578,7 @@ public class NullAnnotationMatching {
private static Severity computeNullProblemSeverity(long requiredBits, long providedBits, int nullStatus, CheckMode mode, TypeBinding requiredType) {
if (requiredBits == providedBits)
return Severity.OK;
- if (requiredBits == 0) {
+ if (requiredBits == 0) {
switch (mode) {
case EXACT:
if (providedBits == TagBits.AnnotationNonNull && !(requiredType instanceof TypeVariableBinding))
@@ -629,7 +629,7 @@ public class NullAnnotationMatching {
return Severity.UNCHECKED;
return Severity.MISMATCH;
}
-
+
} else if (requiredBits == TagBits.AnnotationNullable) {
switch (mode) {
case COMPATIBLE:
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/PackageVisibilityStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/PackageVisibilityStatement.java
index 1ecfec767..ca132c9b5 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/PackageVisibilityStatement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/PackageVisibilityStatement.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.ast;
@@ -36,7 +36,7 @@ public abstract class PackageVisibilityStatement extends ModuleStatement {
public boolean isQualified() {
return this.targets != null && this.targets.length > 0;
}
-
+
public ModuleReference[] getTargetedModules() {
return this.targets;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java
index d4abdf50d..15b3ef042 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.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
* Fraunhofer FIRST - extended API and implementation
@@ -192,7 +192,7 @@ public class ParameterizedQualifiedTypeReference extends ArrayQualifiedTypeRefer
public TypeReference[][] getTypeArguments() {
return this.typeArguments;
}
-
+
@Override
protected TypeBinding getTypeBinding(Scope scope) {
return null; // not supported here - combined with resolveType(...)
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java
index 4a630bebe..e925d3812 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.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
* Fraunhofer FIRST - extended API and implementation
@@ -102,7 +102,7 @@ public class ParameterizedSingleTypeReference extends ArrayTypeReference {
}
}
}
-
+
@Override
public TypeReference augmentTypeWithAdditionalDimensions(int additionalDimensions, Annotation [][] additionalAnnotations, boolean isVarargs) {
int totalDimensions = this.dimensions() + additionalDimensions;
@@ -157,12 +157,12 @@ public class ParameterizedSingleTypeReference extends ArrayTypeReference {
}
return new char[][]{ name };
}
-
+
@Override
public TypeReference[][] getTypeArguments() {
return new TypeReference[][] { this.typeArguments };
}
-
+
/**
* @see org.eclipse.jdt.internal.compiler.ast.ArrayQualifiedTypeReference#getTypeBinding(org.eclipse.jdt.internal.compiler.lookup.Scope)
*/
@@ -170,7 +170,7 @@ public class ParameterizedSingleTypeReference extends ArrayTypeReference {
protected TypeBinding getTypeBinding(Scope scope) {
return null; // not supported here - combined with resolveType(...)
}
-
+
@Override
public boolean isParameterizedTypeReference() {
return true;
@@ -231,7 +231,7 @@ public class ParameterizedSingleTypeReference extends ArrayTypeReference {
if (!seg.isFinal())
scope.problemReporter().anchorPathNotFinal(typeAnchorReference, seg, this.token);
// proceed to possibly report more errors
-
+
// try member type (role) of anchor's type (team):
this.resolvedType = anchor.resolveRoleType(this.token, this.dimensions); // FIXME(SH): although contained in a loop only one anchor can win
if (this.resolvedType == null) {
@@ -253,7 +253,7 @@ public class ParameterizedSingleTypeReference extends ArrayTypeReference {
if (!checkParameterizedRoleVisibility(scope, anchor, (ReferenceBinding) this.resolvedType))
return this.resolvedType;
}
-
+
if ( shouldAnalyzeRoleReference()
&& isIllegalQualifiedUseOfProtectedRole(scope))
return this.resolvedType; // problem binding may be in this.resolvedType
@@ -270,7 +270,7 @@ public class ParameterizedSingleTypeReference extends ArrayTypeReference {
len = this.typeArguments.length-1;
System.arraycopy(this.typeArguments, 1,
this.typeArguments = new TypeReference[len], 0, len); // FIXME(SH): reducing this array conflicts with loop condition
-
+
// note: handling of arrays differs for role and regular types
if (len == 0) {
resolveAnnotations(scope, location);
@@ -331,7 +331,7 @@ public class ParameterizedSingleTypeReference extends ArrayTypeReference {
ReferenceBinding currentType;
if (enclosingType == null) {
//:giro
- if (importScope != null)
+ if (importScope != null)
this.resolvedType = importScope.getType(this.token);
if (this.resolvedType == null || this.resolvedType.problemId() == ProblemReasons.NotFound)
// SH}
@@ -448,7 +448,7 @@ public class ParameterizedSingleTypeReference extends ArrayTypeReference {
if (!isDiamond) { // check arity, IsDiamond never set for 1.6-
scope.problemReporter().incorrectArityForParameterizedType(this, currentType, argTypes);
return null;
- }
+ }
} else if (!currentType.isStatic()) {
ReferenceBinding actualEnclosing = currentType.enclosingType();
if (actualEnclosing != null && actualEnclosing.isRawType()){
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ProvidesStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ProvidesStatement.java
index 8a429ada5..20eae5c1c 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ProvidesStatement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ProvidesStatement.java
@@ -59,7 +59,7 @@ public class ProvidesStatement extends ModuleStatement {
}
int problemId = ProblemReasons.NoError;
ModuleBinding declaringModule = impl.module();
-
+
if (declaringModule != src) {
problemId = IProblem.ServiceImplNotDefinedByModule;
} else if (!impl.isClass() && !impl.isInterface()) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java
index bd6a8d938..17f14a4fc 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.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
* Fraunhofer FIRST - extended API and implementation
@@ -107,7 +107,7 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.util.RoleTypeCreator;
* + anchor mapping
*
* What: wrap resolvedType if it's a role.
- *
+ *
* This class adds an alternative implementation using a creator call.
* It is in-lined in the original class in order to defer the decision
* whether or not to translate it into a role creator call.
@@ -166,7 +166,7 @@ public class QualifiedAllocationExpression extends AllocationExpression {
// The corresponding problem (when called from static) is not produced until during code generation
}
}
-
+
}
// check captured variables are initialized in current context (26134)
@@ -180,8 +180,8 @@ public class QualifiedAllocationExpression extends AllocationExpression {
// process arguments
if (this.arguments != null) {
boolean analyseResources = currentScope.compilerOptions().analyseResourceLeaks;
- boolean hasResourceWrapperType = analyseResources
- && this.resolvedType instanceof ReferenceBinding
+ boolean hasResourceWrapperType = analyseResources
+ && this.resolvedType instanceof ReferenceBinding
&& ((ReferenceBinding)this.resolvedType).hasTypeBit(TypeIds.BitWrapperCloseable);
for (int i = 0, count = this.arguments.length; i < count; i++) {
flowInfo = this.arguments[i].analyseCode(currentScope, flowContext, flowInfo);
@@ -205,7 +205,7 @@ public class QualifiedAllocationExpression extends AllocationExpression {
if ((this.bits & ASTNode.Unchecked) != 0 && this.genericTypeArguments == null) {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=277643, align with javac on JLS 15.12.2.6
thrownExceptions = currentScope.environment().convertToRawTypes(this.binding.thrownExceptions, true, true);
- }
+ }
// check exception handling
flowContext.checkExceptionHandlers(
thrownExceptions,
@@ -517,7 +517,7 @@ public class QualifiedAllocationExpression extends AllocationExpression {
}
return result;
}
-
+
private TypeBinding resolveTypeForQualifiedAllocationExpression(BlockScope scope) {
// Propagate the type checking to the arguments, and checks if the constructor is defined.
// ClassInstanceCreationExpression ::= Primary '.' 'new' SimpleName '(' ArgumentListopt ')' ClassBodyopt
@@ -708,7 +708,7 @@ public class QualifiedAllocationExpression extends AllocationExpression {
scope.problemReporter().diamondNotWithAnoymousClasses(this.type);
return null;
}
- }
+ }
ReferenceBinding superType = (ReferenceBinding) receiverType;
if (superType.isTypeVariable()) {
superType = new ProblemReferenceBinding(new char[][]{superType.sourceName()}, superType, ProblemReasons.IllegalSuperTypeVariable);
@@ -834,7 +834,7 @@ public class QualifiedAllocationExpression extends AllocationExpression {
}
this.enclosingInstance.computeConversion(scope, targetEnclosing, enclosingInstanceType);
}
- if (!isDiamond && receiverType.isParameterizedTypeWithActualArguments() &&
+ if (!isDiamond && receiverType.isParameterizedTypeWithActualArguments() &&
(this.anonymousType == null || sourceLevel >= ClassFileConstants.JDK9)) {
checkTypeArgumentRedundancy((ParameterizedTypeBinding) receiverType, scope);
}
@@ -894,7 +894,7 @@ public class QualifiedAllocationExpression extends AllocationExpression {
return this.noErrors;
}
}
-
+
return new ValidityInspector().isValid();
}
private MethodBinding getAnonymousConstructorBinding(ReferenceBinding receiverType, BlockScope scope) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java
index e062d288b..e09bdcb43 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java
@@ -476,7 +476,7 @@ public void generateCompoundAssignment(BlockScope currentScope, CodeStream codeS
boolean isFirst = lastFieldBinding == this.binding
&& (this.indexOfFirstFieldBinding == 1 || TypeBinding.equalsEquals(lastFieldBinding.declaringClass, currentScope.enclosingReceiverType()))
&& this.otherBindings == null; // could be dup: next.next.next
- TypeBinding constantPoolDeclaringClass = CodeStream.getConstantPoolDeclaringClass(currentScope, lastFieldBinding, getFinalReceiverType(), isFirst);
+ TypeBinding constantPoolDeclaringClass = CodeStream.getConstantPoolDeclaringClass(currentScope, lastFieldBinding, getFinalReceiverType(), isFirst);
SyntheticMethodBinding accessor = this.syntheticReadAccessors == null ? null : this.syntheticReadAccessors[this.syntheticReadAccessors.length - 1];
if (lastFieldBinding.isStatic()) {
if (accessor == null) {
@@ -530,7 +530,7 @@ public void generatePostIncrement(BlockScope currentScope, CodeStream codeStream
boolean isFirst = lastFieldBinding == this.binding
&& (this.indexOfFirstFieldBinding == 1 || TypeBinding.equalsEquals(lastFieldBinding.declaringClass, currentScope.enclosingReceiverType()))
&& this.otherBindings == null; // could be dup: next.next.next
- TypeBinding constantPoolDeclaringClass = CodeStream.getConstantPoolDeclaringClass(currentScope, lastFieldBinding, getFinalReceiverType(), isFirst);
+ TypeBinding constantPoolDeclaringClass = CodeStream.getConstantPoolDeclaringClass(currentScope, lastFieldBinding, getFinalReceiverType(), isFirst);
SyntheticMethodBinding accessor = this.syntheticReadAccessors == null
? null
: this.syntheticReadAccessors[this.syntheticReadAccessors.length - 1];
@@ -555,7 +555,7 @@ public void generatePostIncrement(BlockScope currentScope, CodeStream codeStream
operandType = requiredGenericCast;
} else {
operandType = lastFieldBinding.type;
- }
+ }
// duplicate the old field value
if (valueRequired) {
if (lastFieldBinding.isStatic()) {
@@ -567,7 +567,7 @@ public void generatePostIncrement(BlockScope currentScope, CodeStream codeStream
default:
codeStream.dup();
break;
- }
+ }
} else { // Stack: [owner][old field value] ---> [old field value][owner][old field value]
switch (operandType.id) {
case TypeIds.T_long :
@@ -577,10 +577,10 @@ public void generatePostIncrement(BlockScope currentScope, CodeStream codeStream
default:
codeStream.dup_x1();
break;
- }
+ }
}
}
- codeStream.generateImplicitConversion(this.implicitConversion);
+ codeStream.generateImplicitConversion(this.implicitConversion);
codeStream.generateConstant(
postIncrement.expression.constant,
this.implicitConversion);
@@ -759,7 +759,7 @@ protected TypeBinding getFinalReceiverType() {
default:
TypeBinding previousGenericCast = this.otherGenericCasts == null ? null : this.otherGenericCasts[otherBindingsCount-2];
return previousGenericCast != null ? previousGenericCast : this.otherBindings[otherBindingsCount-2].type;
- }
+ }
}
// get the matching generic cast
@@ -814,7 +814,7 @@ public TypeBinding getOtherFieldBindings(BlockScope scope) {
FieldBinding originalBinding = previousField.original();
if (TypeBinding.notEquals(fieldReceiverType, oldReceiverType) || originalBinding.type.leafComponentType().isTypeVariable()) { // record need for explicit cast at codegen
setGenericCast(index-1,originalBinding.type.genericCast(fieldReceiverType)); // type cannot be base-type even in boxing case
- }
+ }
}
// only last field is actually a write access if any
if (isFieldUseDeprecated(field, scope, index+1 == length ? this.bits : 0)) {
@@ -837,7 +837,7 @@ public TypeBinding getOtherFieldBindings(BlockScope scope) {
&& field.id >= methodScope.lastVisibleFieldID
&& (!field.isStatic() || methodScope.isStatic)) {
scope.problemReporter().forwardReference(this, index, field);
- }
+ }
// check if accessing enum static field in initializer
if ((TypeBinding.equalsEquals(sourceType, declaringClass) || TypeBinding.equalsEquals(sourceType.superclass, declaringClass)) // enum constant body
&& field.constant(scope) == Constant.NotAConstant
@@ -898,8 +898,8 @@ public TypeBinding getOtherFieldBindings(BlockScope scope) {
if ( !scope.isGeneratedScope() // wrapping types breaks cast methods for nested roles (see http://trac.objectteams.org/ot/changeset/5348)
|| CharOperation.equals(IOTConstants._OT_BASE, this.tokens[0])) // direct callout-set-to-field needs wrapping (see test3317_multipleCalloutToSameField2)
{
- final BlockScope theScope = scope;
- type = RoleTypeCreator.deepSubstitute(type, scope.environment(),
+ final BlockScope theScope = scope;
+ type = RoleTypeCreator.deepSubstitute(type, scope.environment(),
new IDependentTypeSubstitution() {
@Override
public TypeBinding substitute(DependentTypeBinding original, TypeBinding[] typeArguments, int dimensions) {
@@ -957,7 +957,7 @@ private void accessAsCalloutToField(BlockScope scope, ReferenceBinding enclosing
SyntheticMethodBinding accessor = (strategy == ImplementationStrategy.DYN_ACCESS)
? new SyntheticOTTargetMethod.OTDREFieldDecapsulation(fakedAccessorBinding, baseclassField.type, accessid, 0/*get*/, scope, this)
: new SyntheticOTTargetMethod.CalloutToField(fakedAccessorBinding);
-
+
// convert to a synthetic method that generateCode can use:
setSyntheticAccessor(baseclassField, idx, accessor);
}
@@ -996,7 +996,7 @@ public boolean isFieldAccess() {
@Override
public FieldBinding lastFieldBinding() {
if (this.otherBindings != null) {
- return this.otherBindings[this.otherBindings.length - 1];
+ return this.otherBindings[this.otherBindings.length - 1];
} else if (this.binding != null && (this.bits & RestrictiveFlagMASK) == Binding.FIELD) {
return (FieldBinding) this.binding;
}
@@ -1063,8 +1063,8 @@ public void manageSyntheticAccessIfNecessary(BlockScope currentScope, FieldBindi
int prevIndex = Math.abs(index) - 1;
boolean isExternalRoleAccess = false;
if (prevIndex >= 0) { // after the first dot, check if previous segment was an anchored type
- TypeBinding receiverType = prevIndex == 0
- ? ((VariableBinding)this.binding).type
+ TypeBinding receiverType = prevIndex == 0
+ ? ((VariableBinding)this.binding).type
: this.otherBindings[prevIndex-1].type;
isExternalRoleAccess = RoleTypeBinding.isRoleWithExplicitAnchor(receiverType);
}
@@ -1225,7 +1225,7 @@ public TypeBinding resolveType(BlockScope scope) {
this.bits &= ~ASTNode.RestrictiveFlagMASK; // clear bits
this.bits |= Binding.LOCAL;
LocalVariableBinding local = (LocalVariableBinding) this.binding;
- if (!local.isFinal() && (this.bits & ASTNode.IsCapturedOuterLocal) != 0) {
+ if (!local.isFinal() && (this.bits & ASTNode.IsCapturedOuterLocal) != 0) {
if (scope.compilerOptions().sourceLevel < ClassFileConstants.JDK1_8) // for 8, defer till effective finality could be ascertained.
scope.problemReporter().cannotReferToNonFinalOuterLocal((LocalVariableBinding) this.binding, this);
}
@@ -1263,7 +1263,7 @@ public TypeBinding resolveType(BlockScope scope) {
}
}
if (isFieldUseDeprecated(fieldBinding, scope, this.indexOfFirstFieldBinding == this.tokens.length ? this.bits : 0)) {
- scope.problemReporter().deprecatedField(fieldBinding, this);
+ scope.problemReporter().deprecatedField(fieldBinding, this);
}
if (fieldBinding.isStatic()) {
// only last field is actually a write access if any
@@ -1280,7 +1280,7 @@ public TypeBinding resolveType(BlockScope scope) {
&& TypeBinding.notEquals(fieldBinding.declaringClass, this.actualReceiverType)
&& fieldBinding.declaringClass.canBeSeenBy(scope)) {
scope.problemReporter().indirectAccessToStaticField(this, fieldBinding);
- }
+ }
} else {
boolean inStaticContext = scope.methodScope().isStatic;
if (this.indexOfFirstFieldBinding == 1) {
@@ -1298,7 +1298,7 @@ public TypeBinding resolveType(BlockScope scope) {
return null;
}
}
-
+
this.resolvedType = getOtherFieldBindings(scope);
if (this.resolvedType != null
&& (this.resolvedType.tagBits & TagBits.HasMissingType) != 0) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedSuperReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedSuperReference.java
index edc4c8f15..286fe9191 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedSuperReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedSuperReference.java
@@ -95,7 +95,7 @@ int findCompatibleEnclosing(ReferenceBinding enclosingType, TypeBinding type, Bl
compoundName = supers[i].compoundName;
if (closestMatch == null)
closestMatch = supers[i];
- // keep looking to ensure we always find the referenced type (even if illegal)
+ // keep looking to ensure we always find the referenced type (even if illegal)
}
}
if (!isLegal || !isJava8) {
@@ -104,7 +104,7 @@ int findCompatibleEnclosing(ReferenceBinding enclosingType, TypeBinding type, Bl
// we use the problem's compoundName to report the type being illegally bypassed,
// whereas the closestMatch denotes the resolved (though illegal) target type
// for downstream resolving.
- this.resolvedType = new ProblemReferenceBinding(compoundName,
+ this.resolvedType = new ProblemReferenceBinding(compoundName,
closestMatch, isJava8 ? ProblemReasons.AttemptToBypassDirectSuper : ProblemReasons.InterfaceMethodInvocationNotBelow18);
}
return 0; // never an outer enclosing type
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedThisReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedThisReference.java
index b5f9e75c9..a75af4944 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedThisReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedThisReference.java
@@ -153,7 +153,7 @@ public class QualifiedThisReference extends ThisReference {
if (depth == 0) {
checkAccess(scope, null);
} // if depth>0, path emulation will diagnose bad scenarii
-
+
MethodScope methodScope = scope.namedMethodScope();
if (methodScope != null) {
MethodBinding method = methodScope.referenceMethodBinding();
@@ -162,7 +162,7 @@ public class QualifiedThisReference extends ThisReference {
while (receiver != null) {
if (TypeBinding.equalsEquals(receiver, this.resolvedType))
return this.resolvedType = receiver;
- receiver = receiver.enclosingType();
+ receiver = receiver.enclosingType();
}
}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java
index d3d2ae81c..7604af30f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java
@@ -196,7 +196,7 @@ public class QualifiedTypeReference extends TypeReference {
}
PackageBinding packageBinding = binding == null ? null : (PackageBinding) binding;
int typeStart = packageBinding == null ? 0 : packageBinding.compoundName.length;
-
+
if (packageBinding != null) {
PackageBinding uniquePackage = packageBinding.getVisibleFor(scope.module(), false);
if (uniquePackage instanceof SplitPackageBinding) {
@@ -272,7 +272,7 @@ public class QualifiedTypeReference extends TypeReference {
}
//{ObjectTeams: overridable hook for above
protected void reportDeprecatedPathSyntax(Scope scope) {
- scope.problemReporter().deprecatedPathSyntax(this);
+ scope.problemReporter().deprecatedPathSyntax(this);
}
// SH}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Receiver.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Receiver.java
index dce07d32d..739888691 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Receiver.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Receiver.java
@@ -24,7 +24,7 @@ public class Receiver extends Argument {
public boolean isReceiver() {
return true;
}
-
+
@Override
public StringBuffer print(int indent, StringBuffer output) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/RecordDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/RecordDeclaration.java
index cb94f7680..37470c238 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/RecordDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/RecordDeclaration.java
@@ -107,7 +107,7 @@ public class RecordDeclaration extends TypeDeclaration {
}
}
/* At this point we can only say that there is high possibility that there is a constructor
- * If it is a CCD, then definitely it is there (except for empty one); else we need to check
+ * If it is a CCD, then definitely it is there (except for empty one); else we need to check
* the bindings to say that there is a canonical constructor. To take care at binding resolution time.
*/
return null;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Reference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Reference.java
index 43ed61877..b1f7c17d0 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Reference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Reference.java
@@ -18,7 +18,7 @@
* bug 331649 - [compiler][null] consider null annotations for fields
* bug 383368 - [compiler][null] syntactic null analysis for field references
* bug 392384 - [1.8][compiler][null] Restore nullness info from type annotations in class files
- * 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 411964 - [1.8][null] leverage null type annotation in foreach statement
* Bug 407414 - [compiler][null] Incorrect warning on a primitive type being null
*******************************************************************************/
@@ -49,7 +49,7 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.model.TeamModel;
*
* What: support notion of expected type
* Why: inferred callout to field must be created with proper type, possibly involving lifting.
- *
+ *
* @author stephan
*/
public abstract class Reference extends Expression {
@@ -89,7 +89,7 @@ protected boolean checkNullableFieldDereference(Scope scope, FieldBinding field,
if ((field.type.tagBits & TagBits.AnnotationNullable) != 0) {
scope.problemReporter().dereferencingNullableExpression(sourcePosition, scope.environment());
return true;
- }
+ }
if (field.type.isFreeTypeVariable()) {
scope.problemReporter().fieldFreeTypeVariableReference(field, sourcePosition);
return true;
@@ -117,7 +117,7 @@ public void fieldStore(Scope currentScope, CodeStream codeStream, FieldBinding f
case TypeIds.T_double :
codeStream.dup2();
break;
- default :
+ default :
codeStream.dup();
break;
}
@@ -135,7 +135,7 @@ public void fieldStore(Scope currentScope, CodeStream codeStream, FieldBinding f
case TypeIds.T_double :
codeStream.dup2_x1();
break;
- default :
+ default :
codeStream.dup_x1();
break;
}
@@ -156,8 +156,8 @@ public abstract void generateCompoundAssignment(BlockScope currentScope, CodeStr
public abstract void generatePostIncrement(BlockScope currentScope, CodeStream codeStream, CompoundAssignment postIncrement, boolean valueRequired);
-/**
- * Is the given reference equivalent to the receiver,
+/**
+ * Is the given reference equivalent to the receiver,
* meaning that both denote the same path of field reads?
* Used from {@link FlowContext#isNullcheckedFieldAccess(Reference)}.
*/
@@ -205,7 +205,7 @@ void reportOnlyUselesslyReadPrivateField(BlockScope currentScope, FieldBinding f
if (fieldBinding.isUsedOnlyInCompound()) {
fieldBinding.compoundUseFlag--; // consume one
if (fieldBinding.compoundUseFlag == 0 // report only the last usage
- && fieldBinding.isOrEnclosedByPrivateType()
+ && fieldBinding.isOrEnclosedByPrivateType()
&& (this.implicitConversion & TypeIds.UNBOXING) == 0) // don't report if unboxing is involved (might cause NPE)
{
// compoundAssignment/postIncrement is the only usage of this field
@@ -240,14 +240,14 @@ static void reportOnlyUselesslyReadLocal(BlockScope currentScope, LocalVariableB
MethodScope methodScope = currentScope.methodScope();
if (methodScope != null && !methodScope.isLambdaScope()) { // lambda must be congruent with the descriptor.
MethodBinding method = ((AbstractMethodDeclaration)methodScope.referenceContext()).binding;
-
+
boolean shouldReport = !method.isMain();
if (method.isImplementing()) {
shouldReport &= currentScope.compilerOptions().reportUnusedParameterWhenImplementingAbstract;
} else if (method.isOverriding()) {
shouldReport &= currentScope.compilerOptions().reportUnusedParameterWhenOverridingConcrete;
}
-
+
if (shouldReport) {
// report the case of an argument that is unread except through a special operator
currentScope.problemReporter().unusedArgument(localBinding.declaration);
@@ -281,8 +281,8 @@ protected int getDepthForSynthFieldAccess(FieldBinding fieldBinding, SourceTypeB
}
return depth;
}
-/**
- * If this reference is an inferred call to a c-t-f to static, synthetic args (int,Team) must be generated.
+/**
+ * If this reference is an inferred call to a c-t-f to static, synthetic args (int,Team) must be generated.
* @return true if synthetic args have been generated
*/
protected boolean checkGeneratedSynthArgsForFieldAccess(MethodBinding[] accessors, CodeStream codeStream, BlockScope scope) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java
index bec3ac776..bf1eb632f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java
@@ -15,7 +15,7 @@
* Bug 384687 - [1.8] Wildcard type arguments should be rejected for lambda and reference expressions
* Bug 416885 - [1.8][compiler]IncompatibleClassChange error (edit)
* Stephan Herrmann - Contribution for
- * bug 402028 - [1.8][compiler] null analysis for reference expressions
+ * bug 402028 - [1.8][compiler] null analysis for reference expressions
* bug 404649 - [1.8][compiler] detect illegal reference to indirect or redundant super via I.super.m() syntax
* Bug 392099 - [1.8][compiler][null] Apply null annotation on types for null analysis
* Bug 415850 - [1.8] Ensure RunJDTCoreTests can cope with null annotations enabled
@@ -106,14 +106,14 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
public Expression lhs;
public TypeReference [] typeArguments;
public char [] selector;
-
+
public int nameSourceStart;
public TypeBinding receiverType;
public boolean haveReceiver;
public TypeBinding[] resolvedTypeArguments;
private boolean typeArgumentsHaveErrors;
-
+
MethodBinding syntheticAccessor; // synthetic accessor for inner-emulation
private int depth;
private MethodBinding exactMethodBinding; // != null ==> exact method reference.
@@ -128,14 +128,14 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
// the scanner used when creating this expression, may be a RecoveryScanner (with proper RecoveryScannerData),
// need to keep it so copy() can parse in the same mode (normal/recovery):
- private Scanner scanner;
-
+ private Scanner scanner;
+
public ReferenceExpression(Scanner scanner) {
super();
this.original = this;
this.scanner = scanner;
}
-
+
public void initialize(CompilationResult result, Expression expression, TypeReference [] optionalTypeArguments, char [] identifierOrNew, int sourceEndPosition) {
super.setCompilationResult(result);
this.lhs = expression;
@@ -144,20 +144,20 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
this.sourceStart = expression.sourceStart;
this.sourceEnd = sourceEndPosition;
}
-
+
private ReferenceExpression copy() {
final Parser parser = new Parser(this.enclosingScope.problemReporter(), false);
final ICompilationUnit compilationUnit = this.compilationResult.getCompilationUnit();
final char[] source = compilationUnit != null ? compilationUnit.getContents() : this.text;
parser.scanner = this.scanner;
- ReferenceExpression copy = (ReferenceExpression) parser.parseExpression(source, compilationUnit != null ? this.sourceStart : 0, this.sourceEnd - this.sourceStart + 1,
+ ReferenceExpression copy = (ReferenceExpression) parser.parseExpression(source, compilationUnit != null ? this.sourceStart : 0, this.sourceEnd - this.sourceStart + 1,
this.enclosingScope.referenceCompilationUnit(), false /* record line separators */);
copy.original = this;
copy.sourceStart = this.sourceStart;
copy.sourceEnd = this.sourceEnd;
return copy;
}
-
+
private boolean shouldGenerateSecretReceiverVariable() {
if (isMethodReference() && this.haveReceiver) {
if (this.lhs instanceof Invocation)
@@ -188,11 +188,11 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
return false;
}
public void generateImplicitLambda(BlockScope currentScope, CodeStream codeStream, boolean valueRequired) {
-
+
ReferenceExpression copy = copy();
-
+
int argc = this.descriptor.parameters.length;
-
+
LambdaExpression implicitLambda = new LambdaExpression(this.compilationResult, false, (this.binding.modifiers & ExtraCompilerModifiers.AccGenericSignature) != 0);
Argument [] arguments = new Argument[argc];
for (int i = 0; i < argc; i++)
@@ -200,7 +200,7 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
implicitLambda.setArguments(arguments);
implicitLambda.setExpressionContext(this.expressionContext);
implicitLambda.setExpectedType(this.expectedType);
-
+
int parameterShift = this.receiverPrecedesParameters ? 1 : 0;
Expression [] argv = new SingleNameReference[argc - parameterShift];
for (int i = 0, length = argv.length; i < length; i++) {
@@ -217,7 +217,7 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
MessageSend message = new MessageSend();
message.selector = this.selector;
Expression receiver = generateSecretReceiverVariable ? new SingleNameReference(this.receiverVariable.name, 0) : copy.lhs;
- message.receiver = this.receiverPrecedesParameters ?
+ message.receiver = this.receiverPrecedesParameters ?
new SingleNameReference(CharOperation.append(ImplicitArgName, Integer.toString(0).toCharArray()), 0) : receiver;
message.typeArguments = copy.typeArguments;
message.arguments = argv;
@@ -228,12 +228,12 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
arrayAllocationExpression.dimensions = new Expression[] { argv[0] };
if (this.lhs instanceof ArrayTypeReference) {
ArrayTypeReference arrayTypeReference = (ArrayTypeReference) this.lhs;
- arrayAllocationExpression.type = arrayTypeReference.dimensions == 1 ? new SingleTypeReference(arrayTypeReference.token, 0L) :
+ arrayAllocationExpression.type = arrayTypeReference.dimensions == 1 ? new SingleTypeReference(arrayTypeReference.token, 0L) :
new ArrayTypeReference(arrayTypeReference.token, arrayTypeReference.dimensions - 1, 0L);
} else {
ArrayQualifiedTypeReference arrayQualifiedTypeReference = (ArrayQualifiedTypeReference) this.lhs;
arrayAllocationExpression.type = arrayQualifiedTypeReference.dimensions == 1 ? new QualifiedTypeReference(arrayQualifiedTypeReference.tokens, arrayQualifiedTypeReference.sourcePositions)
- : new ArrayQualifiedTypeReference(arrayQualifiedTypeReference.tokens, arrayQualifiedTypeReference.dimensions - 1,
+ : new ArrayQualifiedTypeReference(arrayQualifiedTypeReference.tokens, arrayQualifiedTypeReference.dimensions - 1,
arrayQualifiedTypeReference.sourcePositions);
}
implicitLambda.setBody(arrayAllocationExpression);
@@ -252,14 +252,14 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
allocation.arguments = argv;
implicitLambda.setBody(allocation);
}
-
+
// Process the lambda, taking care not to double report diagnostics. Don't expect any from resolve, Any from code generation should surface, but not those from flow analysis.
BlockScope lambdaScope = this.receiverVariable != null ? this.receiverVariable.declaringScope : currentScope;
IErrorHandlingPolicy oldPolicy = lambdaScope.problemReporter().switchErrorHandlingPolicy(silentErrorHandlingPolicy);
try {
implicitLambda.resolveType(lambdaScope, true);
- implicitLambda.analyseCode(lambdaScope,
- new FieldInitsFakingFlowContext(null, this, Binding.NO_EXCEPTIONS, null, lambdaScope, FlowInfo.DEAD_END),
+ implicitLambda.analyseCode(lambdaScope,
+ new FieldInitsFakingFlowContext(null, this, Binding.NO_EXCEPTIONS, null, lambdaScope, FlowInfo.DEAD_END),
UnconditionalFlowInfo.fakeInitializedFlowInfo(lambdaScope.outerMostMethodScope().analysisIndex, lambdaScope.referenceType().maxFieldCount));
} finally {
lambdaScope.problemReporter().switchErrorHandlingPolicy(oldPolicy);
@@ -267,16 +267,16 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
SyntheticArgumentBinding[] outerLocals = this.receiverType.syntheticOuterLocalVariables();
for (int i = 0, length = outerLocals == null ? 0 : outerLocals.length; i < length; i++)
implicitLambda.addSyntheticArgument(outerLocals[i].actualOuterLocalVariable);
-
+
implicitLambda.generateCode(lambdaScope, codeStream, valueRequired);
if (generateSecretReceiverVariable) {
codeStream.removeVariable(this.receiverVariable);
}
- }
-
+ }
+
private boolean shouldGenerateImplicitLambda(BlockScope currentScope) {
- // these cases are either too complicated, impossible to handle or result in significant code duplication
- return (this.binding.isVarargs() ||
+ // these cases are either too complicated, impossible to handle or result in significant code duplication
+ return (this.binding.isVarargs() ||
(isConstructorReference() && this.receiverType.syntheticOuterLocalVariables() != null && this.shouldCaptureInstance) ||
this.requiresBridges() || // bridges.
!isDirectCodeGenPossible());
@@ -304,7 +304,7 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
for (int i = 0; i < descriptorParams.length - offset; i++) {
TypeBinding descType = descriptorParams[i + offset];
TypeBinding origDescType = origDescParams[i + offset];
- if (descType.isIntersectionType18() ||
+ if (descType.isIntersectionType18() ||
(descType.isTypeVariable() && ((TypeVariableBinding) descType).boundsCount() > 1)) {
return CharOperation.equals(origDescType.signature(), origParams[i].signature());
}
@@ -331,7 +331,7 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
} else if (this.syntheticAccessor != null) {
if (this.lhs.isSuper() || isMethodReference())
this.binding = this.syntheticAccessor;
- } else { // cf. MessageSend.generateCode()'s call to CodeStream.getConstantPoolDeclaringClass. We have extracted the relevant portions sans side effect here.
+ } else { // cf. MessageSend.generateCode()'s call to CodeStream.getConstantPoolDeclaringClass. We have extracted the relevant portions sans side effect here.
if (this.binding != null && isMethodReference()) {
if (TypeBinding.notEquals(this.binding.declaringClass, this.lhs.resolvedType.erasure())) {
if (!this.binding.declaringClass.canBeSeenBy(currentScope)) {
@@ -362,7 +362,7 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
} else {
buffer.append(((QualifiedSuperReference) this.lhs).currentCompatibleType.signature());
}
- } else {
+ } else {
buffer.append(sourceType.signature());
}
} else {
@@ -409,13 +409,13 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
sourceType.addSyntheticMethod(this);
}
int invokeDynamicNumber = codeStream.classFile.recordBootstrapMethod(this);
- codeStream.invokeDynamic(invokeDynamicNumber, argumentsSize, 1, this.descriptor.selector, buffer.toString().toCharArray(),
+ codeStream.invokeDynamic(invokeDynamicNumber, argumentsSize, 1, this.descriptor.selector, buffer.toString().toCharArray(),
this.isConstructorReference(), (this.lhs instanceof TypeReference? (TypeReference) this.lhs : null), this.typeArguments);
if (!valueRequired)
codeStream.pop();
codeStream.recordPositionsFrom(pc, this.sourceStart);
}
-
+
@Override
public void cleanUp() {
// no more rescanning needed beyond this point, so free the memory:
@@ -431,16 +431,16 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
}
public void manageSyntheticAccessIfNecessary(BlockScope currentScope, FlowInfo flowInfo) {
-
- if ((flowInfo.tagBits & FlowInfo.UNREACHABLE_OR_DEAD) != 0 || this.binding == null || !this.binding.isValidBinding())
+
+ if ((flowInfo.tagBits & FlowInfo.UNREACHABLE_OR_DEAD) != 0 || this.binding == null || !this.binding.isValidBinding())
return;
-
+
MethodBinding codegenBinding = this.binding.original();
if (codegenBinding.isVarargs())
return; // completely managed by transforming into implicit lambda expression.
-
+
SourceTypeBinding enclosingSourceType = currentScope.enclosingSourceType();
-
+
if (this.isConstructorReference()) {
ReferenceBinding allocatedType = codegenBinding.declaringClass;
if (codegenBinding.isPrivate() &&
@@ -458,7 +458,7 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
}
return;
}
-
+
// ----------------------------------- Only method references from now on -----------
if (this.binding.isPrivate()) {
if (TypeBinding.notEquals(enclosingSourceType, codegenBinding.declaringClass)){
@@ -467,7 +467,7 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
}
return;
}
-
+
if (this.lhs.isSuper()) {
SourceTypeBinding destinationType = enclosingSourceType;
if (this.lhs instanceof QualifiedSuperReference) { // qualified super
@@ -476,12 +476,12 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
if (!qualification.resolvedType.isInterface()) // we can't drop the bridge in I, it may not even be a source type.
destinationType = (SourceTypeBinding) (qualifiedSuperReference.currentCompatibleType);
}
-
+
this.syntheticAccessor = destinationType.addSyntheticMethod(codegenBinding, true);
currentScope.problemReporter().needToEmulateMethodAccess(codegenBinding, this);
return;
}
-
+
if (this.binding.isProtected() && (this.bits & ASTNode.DepthMASK) != 0 && codegenBinding.declaringClass.getPackage() != enclosingSourceType.getPackage()) {
SourceTypeBinding currentCompatibleType = (SourceTypeBinding) enclosingSourceType.enclosingTypeAt((this.bits & ASTNode.DepthMASK) >> ASTNode.DepthSHIFT);
this.syntheticAccessor = currentCompatibleType.addSyntheticMethod(codegenBinding, isSuperAccess());
@@ -489,7 +489,7 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
return;
}
}
-
+
@Override
public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {
// static methods with receiver value never get here
@@ -532,10 +532,10 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
if (argumentCheck != null && argumentCheck.isDangerous(currentScope)) {
currentScope.problemReporter().unlikelyArgumentType(this, this.binding, argumentType2,
argumentCheck.typeToReport, argumentCheck.dangerousMethod);
- }
+ }
}
}
-
+
if (currentScope.compilerOptions().analyseResourceLeaks) {
if (this.haveReceiver && CharOperation.equals(this.selector, TypeConstants.CLOSE)) {
FakedTrackingVariable trackingVariable = FakedTrackingVariable.getCloseTrackingVariable(this.lhs, flowInfo, flowContext);
@@ -552,16 +552,16 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
public boolean checkingPotentialCompatibility() {
return this.checkingPotentialCompatibility;
}
-
+
@Override
public void acceptPotentiallyCompatibleMethods(MethodBinding[] methods) {
if (this.checkingPotentialCompatibility)
this.potentialMethods = methods;
}
-
+
@Override
public TypeBinding resolveType(BlockScope scope) {
-
+
final CompilerOptions compilerOptions = scope.compilerOptions();
TypeBinding lhsType;
if (this.constant != Constant.NotAConstant) {
@@ -595,12 +595,12 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
}
if (this.typeArgumentsHaveErrors || lhsType == null)
return this.resolvedType = null;
-
+
if (lhsType.problemId() == ProblemReasons.AttemptToBypassDirectSuper)
lhsType = lhsType.closestMatch(); // improve resolving experience
- if (lhsType == null || !lhsType.isValidBinding())
+ if (lhsType == null || !lhsType.isValidBinding())
return this.resolvedType = null; // nope, no useful type found
-
+
this.receiverType = lhsType;
this.haveReceiver = true;
if (this.lhs instanceof NameReference) {
@@ -626,7 +626,7 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
scope.problemReporter().cannotInstantiate(this.lhs, lhsType);
return this.resolvedType = null;
}
-
+
if (this.lhs instanceof TypeReference && ((TypeReference)this.lhs).hasNullTypeAnnotation(AnnotationPosition.ANY)) {
scope.problemReporter().nullAnnotationUnsupportedLocation((TypeReference) this.lhs);
}
@@ -667,30 +667,30 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
super.resolveType(scope);
- /* For Reference expressions unlike other call sites, we always have a receiver _type_ since LHS of :: cannot be empty.
+ /* For Reference expressions unlike other call sites, we always have a receiver _type_ since LHS of :: cannot be empty.
LHS's resolved type == actual receiver type. All code below only when a valid descriptor is available.
*/
if (this.descriptor == null || !this.descriptor.isValidBinding())
return this.resolvedType = null;
-
+
// Convert parameters into argument expressions for look up.
TypeBinding[] descriptorParameters = descriptorParametersAsArgumentExpressions();
-
+
if (lhsType.isBaseType()) {
scope.problemReporter().errorNoMethodFor(this.lhs, lhsType, this.selector, descriptorParameters);
return this.resolvedType = null;
}
-
+
/* 15.13: "If a method reference expression has the form super :: [TypeArguments] Identifier or TypeName . super :: [TypeArguments] Identifier,
it is a compile-time error if the expression occurs in a static context. ": This is nop since the primary when it resolves
itself will complain automatically.
-
- 15.13: "The immediately enclosing instance of an inner class instance (15.9.2) must be provided for a constructor reference by a lexically
+
+ 15.13: "The immediately enclosing instance of an inner class instance (15.9.2) must be provided for a constructor reference by a lexically
enclosing instance of this (8.1.3)", we will actually implement this check in code generation. Emulation path computation will fail if there
- is no suitable enclosing instance. While this could be pulled up to here, leaving it to code generation is more consistent with Java 5,6,7
+ is no suitable enclosing instance. While this could be pulled up to here, leaving it to code generation is more consistent with Java 5,6,7
modus operandi.
*/
-
+
// handle the special case of array construction first.
final int parametersLength = descriptorParameters.length;
if (isConstructorReference() && lhsType.isArrayType()) {
@@ -728,7 +728,7 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
return this.resolvedType = null;
}
}
-
+
if (this.lhs.isSuper() && this.lhs.resolvedType.isInterface()) {
scope.checkAppropriateMethodAgainstSupers(this.selector, someMethod, this.descriptor.parameters, this);
}
@@ -756,12 +756,12 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
this.depth = 0;
}
}
-
+
if (someMethod != null && someMethod.isValidBinding() && someMethod.isStatic() && anotherMethod != null && anotherMethod.isValidBinding() && !anotherMethod.isStatic()) {
scope.problemReporter().methodReferenceSwingsBothWays(this, anotherMethod, someMethod);
return this.resolvedType = null;
}
-
+
if (someMethod != null && someMethod.isValidBinding() && (anotherMethod == null || !anotherMethod.isValidBinding() || anotherMethod.isStatic())) {
this.binding = someMethod;
this.bits &= ~ASTNode.DepthMASK;
@@ -773,7 +773,7 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
scope.problemReporter().methodMustBeAccessedWithInstance(this, someMethod);
return this.resolvedType = null;
}
- }
+ }
} else if (anotherMethod != null && anotherMethod.isValidBinding() && (someMethod == null || !someMethod.isValidBinding() || !someMethod.isStatic())) {
this.binding = anotherMethod;
this.receiverPrecedesParameters = true; // 0 is receiver, real parameters start at 1
@@ -795,12 +795,12 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
scope.problemReporter().danglingReference(this, this.receiverType, visibleName, descriptorParameters);
return this.resolvedType = null;
}
-
+
// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=382350#c2, I.super::abstractMethod will be handled there.
if (this.binding.isAbstract() && this.lhs.isSuper())
scope.problemReporter().cannotDireclyInvokeAbstractMethod(this, this.binding);
-
+
if (this.binding.isStatic()) {
if (TypeBinding.notEquals(this.binding.declaringClass, this.receiverType))
scope.problemReporter().indirectAccessToStaticMethod(this, this.binding);
@@ -809,16 +809,16 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
if (srcMethod != null && srcMethod.isMethod())
srcMethod.bits &= ~ASTNode.CanBeStatic;
}
-
+
if (isMethodUseDeprecated(this.binding, scope, true, this))
scope.problemReporter().deprecatedMethod(this.binding, this);
if (this.typeArguments != null && this.binding.original().typeVariables == Binding.NO_TYPE_VARIABLES)
scope.problemReporter().unnecessaryTypeArgumentsForMethodInvocation(this.binding, this.resolvedTypeArguments, this.typeArguments);
-
+
if ((this.binding.tagBits & TagBits.HasMissingType) != 0)
scope.problemReporter().missingTypeInMethod(this, this.binding);
-
+
// OK, we have a compile time declaration, see if it passes muster.
TypeBinding [] methodExceptions = this.binding.thrownExceptions;
@@ -835,7 +835,7 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
}
checkNullAnnotations(scope);
this.freeParameters = null; // not used after method lookup
-
+
if (checkInvocationArguments(scope, null, this.receiverType, this.binding, null, descriptorParameters, false, this))
this.bits |= ASTNode.Unchecked;
@@ -886,7 +886,7 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
final TypeBinding receiver = scope.environment().createAnnotatedType(this.binding.declaringClass,
new AnnotationBinding[] { scope.environment().getNonNullAnnotation() });
scope.problemReporter().referenceExpressionArgumentNullityMismatch(this, receiver, descriptorParameter, this.descriptor, -1, NullAnnotationMatching.NULL_ANNOTATIONS_MISMATCH);
- }
+ }
}
boolean isVarArgs = false;
if (this.binding.isVarargs()) {
@@ -929,10 +929,10 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
}
private TypeBinding[] descriptorParametersAsArgumentExpressions() {
-
+
if (this.descriptor == null || this.descriptor.parameters == null || this.descriptor.parameters.length == 0)
return Binding.NO_PARAMETERS;
-
+
/* 15.13.1, " ... method reference is treated as if it were an invocation with argument expressions of types P1, ..., Pn;"
This implies/requires wildcard capture. This creates interesting complications, we can't just take the descriptor parameters
and apply captures - where a single wildcard type got "fanned out" and propagated into multiple locations through type variable
@@ -943,7 +943,7 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
ParameterizedTypeBinding type = (ParameterizedTypeBinding) this.expectedType;
MethodBinding method = type.getSingleAbstractMethod(this.enclosingScope, true, this.sourceStart, this.sourceEnd);
return method.parameters;
- }
+ }
return this.descriptor.parameters;
}
@@ -975,29 +975,29 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
copy.setExpressionContext(this.expressionContext);
copy.setExpectedType(targetType);
copy.resolveType(this.enclosingScope);
-
+
if (this.copiesPerTargetType == null)
this.copiesPerTargetType = new HashMap<TypeBinding, ReferenceExpression>();
this.copiesPerTargetType.put(targetType, copy);
-
+
return copy;
} finally {
this.enclosingScope.problemReporter().switchErrorHandlingPolicy(oldPolicy);
}
}
-
+
public void registerInferenceContext(ParameterizedGenericMethodBinding method, InferenceContext18 context) {
if (this.inferenceContexts == null)
this.inferenceContexts = new HashMap<ParameterizedGenericMethodBinding, InferenceContext18>();
this.inferenceContexts.put(method, context);
}
-
+
public InferenceContext18 getInferenceContext(ParameterizedMethodBinding method) {
if (this.inferenceContexts == null)
return null;
return this.inferenceContexts.get(method);
}
-
+
@Override
public ReferenceExpression resolveExpressionExpecting(TypeBinding targetType, Scope scope, InferenceContext18 inferenceContext) {
if (this.exactMethodBinding != null) { // We may see inference variables in target type.
@@ -1006,34 +1006,34 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
return null;
int n = functionType.parameters.length;
int k = this.exactMethodBinding.parameters.length;
-
+
if (!this.haveReceiver && this.isMethodReference() && !this.exactMethodBinding.isStatic()) {
k++;
}
return (n == k) ? this : null;
}
// descriptors parameters should be free of inference variables.
- ReferenceExpression copy = cachedResolvedCopy(targetType);
+ ReferenceExpression copy = cachedResolvedCopy(targetType);
return copy != null && copy.resolvedType != null && copy.resolvedType.isValidBinding() && copy.binding != null && copy.binding.isValidBinding() ? copy : null;
}
public boolean isConstructorReference() {
return CharOperation.equals(this.selector, ConstantPool.Init);
}
-
+
@Override
public boolean isExactMethodReference() {
return this.exactMethodBinding != null;
}
-
+
public MethodBinding getExactMethod() {
return this.exactMethodBinding;
}
-
+
public boolean isMethodReference() {
return !CharOperation.equals(this.selector, ConstantPool.Init);
}
-
+
@Override
public boolean isPertinentToApplicability(TypeBinding targetType, MethodBinding method) {
if (!this.isExactMethodReference()) {
@@ -1041,7 +1041,7 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
}
return super.isPertinentToApplicability(targetType, method);
}
-
+
@Override
public TypeBinding[] genericTypeArguments() {
return this.resolvedTypeArguments;
@@ -1083,7 +1083,7 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
@Override
public StringBuffer printExpression(int tab, StringBuffer output) {
-
+
this.lhs.print(0, output);
output.append("::"); //$NON-NLS-1$
if (this.typeArguments != null) {
@@ -1098,19 +1098,19 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
}
if (isConstructorReference())
output.append("new"); //$NON-NLS-1$
- else
+ else
output.append(this.selector);
-
+
return output;
}
-
+
@Override
public void traverse(ASTVisitor visitor, BlockScope blockScope) {
if (visitor.visit(this, blockScope)) {
-
+
this.lhs.traverse(visitor, blockScope);
-
+
int length = this.typeArguments == null ? 0 : this.typeArguments.length;
for (int i = 0; i < length; i++) {
this.typeArguments[i].traverse(visitor, blockScope);
@@ -1120,7 +1120,7 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
}
public Expression[] createPseudoExpressions(TypeBinding[] p) {
- // from 15.13.1:
+ // from 15.13.1:
// ... the reference is treated as if it were an invocation with argument expressions of types P1..Pn
// ... the reference is treated as if it were an invocation with argument expressions of types P2..Pn
// (the different sets of types are passed from our resolveType to scope.getMethod(..), see someMethod, anotherMethod)
@@ -1156,7 +1156,7 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
return false;
if (this.typeArgumentsHaveErrors || this.receiverType == null || !this.receiverType.isValidBinding())
return false;
-
+
int parametersLength = sam.parameters.length;
TypeBinding[] descriptorParameters = new TypeBinding[parametersLength];
for (int i = 0; i < parametersLength; i++) {
@@ -1178,7 +1178,7 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
}
};
}
-
+
// 15.13.1
this.freeParameters = descriptorParameters;
this.checkingPotentialCompatibility = true;
@@ -1188,12 +1188,12 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
if (compileTimeDeclaration != null && compileTimeDeclaration.isValidBinding()) // we have the mSMB.
this.potentialMethods = new MethodBinding [] { compileTimeDeclaration };
else {
- /* We EITHER have potential methods that are input to Scope.mSMb already captured in this.potentialMethods
+ /* We EITHER have potential methods that are input to Scope.mSMb already captured in this.potentialMethods
OR there is no potentially compatible compile time declaration ...
*/
}
- /* 15.12.2.1: A method reference expression (§15.13) is potentially compatible with a functional interface type if, where the type's function type arity is n,
+ /* 15.12.2.1: A method reference expression (§15.13) is potentially compatible with a functional interface type if, where the type's function type arity is n,
there exists at least one potentially applicable method for the method reference expression with arity n (§15.13.1), and one of the following is true:
– The method reference expression has the form ReferenceType ::[TypeArguments] Identifier and at least one potentially applicable method is
i) static and supports arity n, or ii) not static and supports arity n-1.
@@ -1217,11 +1217,11 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
this.freeParameters = descriptorParameters;
this.potentialMethods = Binding.NO_METHODS;
compileTimeDeclaration = getCompileTimeDeclaration(scope, false, descriptorParameters);
-
+
if (compileTimeDeclaration != null && compileTimeDeclaration.isValidBinding()) // we have the mSMB.
this.potentialMethods = new MethodBinding [] { compileTimeDeclaration };
else {
- /* We EITHER have potential methods that are input to Scope.mSMb already captured in this.potentialMethods
+ /* We EITHER have potential methods that are input to Scope.mSMb already captured in this.potentialMethods
OR there is no potentially compatible compile time declaration ...
*/
}
@@ -1237,7 +1237,7 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
}
return false;
}
-
+
MethodBinding getCompileTimeDeclaration(Scope scope, boolean isConstructorRef, TypeBinding[] parameters) {
if (this.exactMethodBinding != null)
return this.exactMethodBinding;
@@ -1258,22 +1258,22 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
return copy.resolvedType != null && copy.resolvedType.isValidBinding() && copy.binding != null && copy.binding.isValidBinding();
}
}
-
+
@Override
public boolean sIsMoreSpecific(TypeBinding s, TypeBinding t, Scope scope) {
-
+
if (super.sIsMoreSpecific(s, t, scope))
return true;
-
+
if (this.exactMethodBinding == null || t.findSuperTypeOriginatingFrom(s) != null)
return false;
-
+
s = s.capture(this.enclosingScope, this.sourceStart, this.sourceEnd);
MethodBinding sSam = s.getSingleAbstractMethod(this.enclosingScope, true);
if (sSam == null || !sSam.isValidBinding())
return false;
TypeBinding r1 = sSam.returnType;
-
+
MethodBinding tSam = t.getSingleAbstractMethod(this.enclosingScope, true);
if (tSam == null || !tSam.isValidBinding())
return false;
@@ -1288,14 +1288,14 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
}
if (r2.id == TypeIds.T_void)
return true;
-
+
if (r1.id == TypeIds.T_void)
return false;
-
+
// r1 <: r2
if (r1.isCompatibleWith(r2, scope))
return true;
-
+
return r1.isBaseType() != r2.isBaseType() && r1.isBaseType() == this.exactMethodBinding.returnType.isBaseType();
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/RequiresStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/RequiresStatement.java
index 110ab4acc..ea1b95d46 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/RequiresStatement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/RequiresStatement.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.ast;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.java
index a4f8fec71..21f6132c8 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.java
@@ -88,12 +88,12 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl
// to each of the traversed try statements, so that execution will terminate properly.
// lookup the label, this should answer the returnContext
-
+
if (this.expression instanceof FunctionalExpression) {
if (this.expression.resolvedType == null || !this.expression.resolvedType.isValidBinding()) {
/* Don't descend without proper target types. For lambda shape analysis, what is pertinent is value vs void return and the fact that
this constitutes an abrupt exit. The former is already gathered, the latter is handled here.
- */
+ */
flowContext.recordAbruptExit();
return FlowInfo.DEAD_END;
}
@@ -307,7 +307,7 @@ public void resolve(BlockScope scope) {
: methodBinding.returnType)
: TypeBinding.VOID;
TypeBinding expressionType;
-
+
if (this.expression != null) {
this.expression.setExpressionContext(ASSIGNMENT_CONTEXT);
this.expression.setExpectedType(methodType);
@@ -315,7 +315,7 @@ public void resolve(BlockScope scope) {
this.expression.bits |= ASTNode.DisableUnnecessaryCastCheck;
}
}
-
+
if (methodType == TypeBinding.VOID) {
// the expression should be null, exceptions exist for lambda expressions.
if (this.expression == null) {
@@ -338,11 +338,11 @@ public void resolve(BlockScope scope) {
if (methodType != null) scope.problemReporter().shouldReturn(methodType, this);
return;
}
-
+
expressionType = this.expression.resolveType(scope);
if (lambda != null)
lambda.returnsExpression(this.expression, expressionType);
-
+
if (expressionType == null) return;
if (expressionType == TypeBinding.VOID) {
scope.problemReporter().attemptToReturnVoidValue(this);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleMemberAnnotation.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleMemberAnnotation.java
index 4a5fbb046..193692428 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleMemberAnnotation.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleMemberAnnotation.java
@@ -31,7 +31,7 @@ public class SingleMemberAnnotation extends Annotation {
this.sourceStart = sourceStart;
this.sourceEnd = type.sourceEnd;
}
-
+
public SingleMemberAnnotation() {
// for subclasses.
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java
index d6d50ee1e..4f01d918d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java
@@ -20,7 +20,7 @@
* Bug 412203 - [compiler] Internal compiler error: java.lang.IllegalArgumentException: info cannot be null
* Bug 458396 - NPE in CodeStream.invoke()
* Bug 407414 - [compiler][null] Incorrect warning on a primitive type being null
- * Jesper S Moller - <jesper@selskabet.org> - Contributions for
+ * Jesper S Moller - <jesper@selskabet.org> - Contributions for
* bug 382721 - [1.8][compiler] Effectively final variables needs special treatment
* bug 378674 - "The method can be declared as static" is wrong
* bug 404657 - [1.8][compiler] Analysis for effectively final variables fails to consider loops
@@ -84,7 +84,7 @@ public class SingleNameReference extends NameReference implements OperatorIds {
public MethodBinding[] syntheticAccessors; // [0]=read accessor [1]=write accessor
public TypeBinding genericCast;
public boolean isLabel;// flagging for break expression when expression is SwitchExpression - java 12 preview-feature
-//{ObjectTeams: in generated out-of-scope code a name may have the privilige of a (t)this:
+//{ObjectTeams: in generated out-of-scope code a name may have the privilige of a (t)this:
public boolean isThisLike;
// SH}
@@ -419,7 +419,7 @@ public void generateAssignment(BlockScope currentScope, CodeStream codeStream, A
default :
codeStream.pop();
break;
- }
+ }
}
}
return;
@@ -603,7 +603,7 @@ public void generateCompoundAssignment(BlockScope currentScope, CodeStream codeS
FieldBinding codegenField = ((FieldBinding) this.binding).original();
if (codegenField.isStatic()) {
if ((this.syntheticAccessors == null) || (this.syntheticAccessors[SingleNameReference.READ] == null)) {
- TypeBinding constantPoolDeclaringClass = CodeStream.getConstantPoolDeclaringClass(currentScope, codegenField, this.actualReceiverType, true /* implicit this */);
+ TypeBinding constantPoolDeclaringClass = CodeStream.getConstantPoolDeclaringClass(currentScope, codegenField, this.actualReceiverType, true /* implicit this */);
codeStream.fieldAccess(Opcodes.OPC_getstatic, codegenField, constantPoolDeclaringClass);
} else {
codeStream.invoke(Opcodes.OPC_invokestatic, this.syntheticAccessors[SingleNameReference.READ], null /* default declaringClass */);
@@ -798,7 +798,7 @@ public void generatePostIncrement(BlockScope currentScope, CodeStream codeStream
default:
codeStream.dup();
break;
- }
+ }
} else { // Stack: [owner][old field value] ---> [old field value][owner][old field value]
switch (operandType.id) {
case TypeIds.T_long :
@@ -816,7 +816,7 @@ public void generatePostIncrement(BlockScope currentScope, CodeStream codeStream
codeStream.sendOperator(postIncrement.operator, this.implicitConversion & TypeIds.COMPILE_TYPE_MASK);
codeStream.generateImplicitConversion(postIncrement.preAssignImplicitConversion);
fieldStore(currentScope, codeStream, codegenField, this.syntheticAccessors == null ? null : this.syntheticAccessors[SingleNameReference.WRITE], this.actualReceiverType, true /*implicit this*/, false);
- // no need for generic cast
+ // no need for generic cast
return;
case Binding.LOCAL : // assigning to a local variable
LocalVariableBinding localBinding = (LocalVariableBinding) this.binding;
@@ -853,7 +853,7 @@ public void generatePostIncrement(BlockScope currentScope, CodeStream codeStream
default:
codeStream.dup();
break;
- }
+ }
}
codeStream.generateImplicitConversion(this.implicitConversion);
codeStream.generateConstant(postIncrement.expression.constant, this.implicitConversion);
@@ -910,7 +910,7 @@ public VariableBinding nullAnnotatedVariableBinding(boolean supportTypeAnnotatio
switch (this.bits & ASTNode.RestrictiveFlagMASK) {
case Binding.FIELD : // reading a field
case Binding.LOCAL : // reading a local variable
- if (supportTypeAnnotations
+ if (supportTypeAnnotations
|| (((VariableBinding)this.binding).tagBits & TagBits.AnnotationNullMASK) != 0)
return (VariableBinding) this.binding;
}
@@ -1146,7 +1146,7 @@ public TypeBinding resolveType(BlockScope scope) {
if (((FieldAccessSpec)callout.baseMethodSpec).isSetter())
this.resolvedType = callout.roleMethodSpec.resolvedParameters()[0];
else
- this.resolvedType = callout.roleMethodSpec.resolvedType();
+ this.resolvedType = callout.roleMethodSpec.resolvedType();
return this.resolvedType;
}
// SH}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java
index 97bb12728..ec3c66b5a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.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
* Fraunhofer FIRST - extended API and implementation
@@ -65,7 +65,7 @@ public class SingleTypeReference extends TypeReference {
return this.resolvedType;
this.resolvedType = scope.getType(this.token);
-
+
if (this.resolvedType instanceof TypeVariableBinding) {
TypeVariableBinding typeVariable = (TypeVariableBinding) this.resolvedType;
if (typeVariable.declaringElement instanceof SourceTypeBinding) {
@@ -101,9 +101,9 @@ public class SingleTypeReference extends TypeReference {
this.token == CHAR ||
this.token == BOOLEAN ||
this.token == NULL ||
- this.token == VOID;
+ this.token == VOID;
}
-
+
@Override
public StringBuffer printExpression(int indent, StringBuffer output){
if (this.annotations != null && this.annotations[0] != null) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java
index 18249ba69..1063a56fa 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java
@@ -81,7 +81,7 @@ public abstract class Statement extends ASTNode {
// case OperatorIds.AND_AND :
// case OperatorIds.OR_OR :
// break;
-// default:
+// default:
// // if (DEBUG_LEVEL > 0) print(); - tolerated
// if ((binary.left instanceof Reference) && binary.right.constant != Constant.NotAConstant)
// return true;
@@ -96,8 +96,8 @@ public abstract FlowInfo analyseCode(BlockScope currentScope, FlowContext flowCo
/** Lambda shape analysis: *Assuming* this is reachable, analyze if this completes normally i.e control flow can reach the textually next statement.
For blocks, we don't perform intra-reachability analysis. We assume the lambda body is free of intrinsic control flow errors (if such errors
- exist they will not be flagged by this analysis, but are guaranteed to surface later on.)
-
+ exist they will not be flagged by this analysis, but are guaranteed to surface later on.)
+
@see Block#doesNotCompleteNormally
*/
public boolean doesNotCompleteNormally() {
@@ -105,7 +105,7 @@ public boolean doesNotCompleteNormally() {
}
/** Lambda shape analysis: *Assuming* this is reachable, analyze if this completes by continuing i.e control flow cannot reach the textually next statement.
- This is necessitated by the fact that continue claims to not complete normally. So this is necessary to discriminate between do { continue; } while (false);
+ This is necessitated by the fact that continue claims to not complete normally. So this is necessary to discriminate between do { continue; } while (false);
which completes normally and do { throw new Exception(); } while (false); which does not complete normally.
*/
public boolean completesByContinue() {
@@ -115,7 +115,7 @@ public boolean completesByContinue() {
public static final int NOT_COMPLAINED = 0;
public static final int COMPLAINED_FAKE_REACHABLE = 1;
public static final int COMPLAINED_UNREACHABLE = 2;
-
+
/** Analysing arguments of MessageSend, ExplicitConstructorCall, AllocationExpression. */
protected void analyseArguments(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo, MethodBinding methodBinding, Expression[] arguments)
@@ -173,7 +173,7 @@ protected void analyseArguments(BlockScope currentScope, FlowContext flowContext
flowContext.recordNullityMismatch(currentScope, argument, argument.resolvedType, expectedType, flowInfo, nullStatus, null);
}
}
- }
+ }
}
}
void analyseOneArgument18(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo,
@@ -199,16 +199,16 @@ void analyseOneArgument18(BlockScope currentScope, FlowContext flowContext, Flow
nullStatus, expectedNonNullness, originalExpected);
}
void internalAnalyseOneArgument18(BlockScope currentScope, FlowContext flowContext, TypeBinding expectedType,
- Expression argument, FlowInfo flowInfo, int nullStatus, Boolean expectedNonNullness, TypeBinding originalExpected)
+ Expression argument, FlowInfo flowInfo, int nullStatus, Boolean expectedNonNullness, TypeBinding originalExpected)
{
// here we consume special case information generated in the ctor of ParameterizedGenericMethodBinding (see there):
- int statusFromAnnotatedNull = expectedNonNullness == Boolean.TRUE ? nullStatus : 0;
-
+ int statusFromAnnotatedNull = expectedNonNullness == Boolean.TRUE ? nullStatus : 0;
+
NullAnnotationMatching annotationStatus = NullAnnotationMatching.analyse(expectedType, argument.resolvedType, nullStatus);
-
+
if (!annotationStatus.isAnyMismatch() && statusFromAnnotatedNull != 0)
expectedType = originalExpected; // to avoid reports mentioning '@NonNull null'!
-
+
if (statusFromAnnotatedNull == FlowInfo.NULL) {
// immediate reporting:
currentScope.problemReporter().nullityMismatchingTypeAnnotation(argument, argument.resolvedType, expectedType, annotationStatus);
@@ -232,7 +232,7 @@ void internalAnalyseOneArgument18(BlockScope currentScope, FlowContext flowConte
} catch (NullPointerException npe) {
// chain of references in try-block has several potential nulls;
// any null means we cannot perform the following check
- return;
+ return;
}
if (useTypeAnnotations) {
checkAgainstNullTypeAnnotation(scope, methodBinding.returnType, expr, flowContext, flowInfo);
@@ -254,8 +254,8 @@ protected void checkAgainstNullTypeAnnotation(BlockScope scope, TypeBinding requ
} else if (expression instanceof SwitchExpression && expression.isPolyExpression()) {
SwitchExpression se = (SwitchExpression) expression;
for (int i = 0; i < se.resultExpressions.size(); i++) {
- internalCheckAgainstNullTypeAnnotation(scope, requiredType,
- se.resultExpressions.get(i),
+ internalCheckAgainstNullTypeAnnotation(scope, requiredType,
+ se.resultExpressions.get(i),
se.resultExpressionNullStatus.get(i), flowContext, flowInfo);
}
return;
@@ -288,7 +288,7 @@ public void branchChainTo(BranchLabel label) {
// Inspect AST nodes looking for a break statement, descending into nested control structures only when necessary (looking for a break with a specific label.)
public boolean breaksOut(final char[] label) {
return new ASTVisitor() {
-
+
boolean breaksOut;
@Override
public boolean visit(TypeDeclaration type, BlockScope skope) { return label != null; }
@@ -306,7 +306,7 @@ public boolean breaksOut(final char[] label) {
public boolean visit(ForStatement forStatement, BlockScope skope) { return label != null; }
@Override
public boolean visit(SwitchStatement switchStatement, BlockScope skope) { return label != null; }
-
+
@Override
public boolean visit(BreakStatement breakStatement, BlockScope skope) {
if (label == null || CharOperation.equals(label, breakStatement.label))
@@ -374,7 +374,7 @@ public int complainIfUnreachable(FlowInfo flowInfo, BlockScope scope, int previo
return COMPLAINED_UNREACHABLE;
} else {
if (previousComplaintLevel < COMPLAINED_FAKE_REACHABLE) {
-/* OT: */ if (shouldReport)
+/* OT: */ if (shouldReport)
// SH}
scope.problemReporter().fakeReachable(this);
if (endOfBlock)
@@ -460,7 +460,7 @@ public void generateArguments(MethodBinding binding, Expression[] arguments, Blo
//{ObjectTeams:
private TypeBinding checkRoleToPlainCast(TypeBinding providedType, TypeBinding requiredBinding) {
- if ( providedType.isRole()
+ if ( providedType.isRole()
&& !TeamModel.isTeamContainingRole(((ReferenceBinding)providedType).enclosingType(), (ReferenceBinding) requiredBinding))
return requiredBinding;
return null;
@@ -525,7 +525,7 @@ public Constant[] resolveCase(BlockScope scope, TypeBinding testType, SwitchStat
public TypeBinding resolveExpressionType(BlockScope scope) {
return null;
}
-/**
+/**
* Implementation of {@link org.eclipse.jdt.internal.compiler.lookup.InvocationSite#invocationTargetType}
* suitable at this level. Subclasses should override as necessary.
* @see org.eclipse.jdt.internal.compiler.lookup.InvocationSite#invocationTargetType()
@@ -542,7 +542,7 @@ public ExpressionContext getExpressionContext() {
return ExpressionContext.VANILLA_CONTEXT;
}
/**
- * For all constructor invocations: find the constructor binding;
+ * For all constructor invocations: find the constructor binding;
* if site.innersNeedUpdate() perform some post processing for those and produce
* any updates as side-effects into 'argumentTypes'.
*/
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SuperReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SuperReference.java
index 65395586c..8aaf7a2f9 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SuperReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SuperReference.java
@@ -44,7 +44,7 @@ public class SuperReference extends ThisReference {
return true;
}
-
+
@Override
public boolean isUnqualifiedSuper() {
return true;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchExpression.java
index 8feb17d3a..4f056ea2f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchExpression.java
@@ -89,7 +89,7 @@ public class SwitchExpression extends SwitchStatement implements IPolyExpression
protected int getFallThroughState(Statement stmt, BlockScope blockScope) {
if ((stmt instanceof Expression && ((Expression) stmt).isTrulyExpression())|| stmt instanceof ThrowStatement)
return BREAKING;
- if (this.switchLabeledRules // do this check for every block if '->' (Switch Labeled Rules)
+ if (this.switchLabeledRules // do this check for every block if '->' (Switch Labeled Rules)
&& stmt instanceof Block) {
Block block = (Block) stmt;
if (block.doesNotCompleteNormally()) {
@@ -161,11 +161,11 @@ public class SwitchExpression extends SwitchStatement implements IPolyExpression
}
}
if (firstTrailingCaseStmt != null) {
- blockScope.problemReporter().switchExpressionTrailingSwitchLabels(firstTrailingCaseStmt);
+ blockScope.problemReporter().switchExpressionTrailingSwitchLabels(firstTrailingCaseStmt);
}
}
@Override
- protected boolean needToCheckFlowInAbsenceOfDefaultBranch() { // JLS 12 16.1.8
+ protected boolean needToCheckFlowInAbsenceOfDefaultBranch() { // JLS 12 16.1.8
return !this.switchLabeledRules;
}
@Override
@@ -292,18 +292,18 @@ public class SwitchExpression extends SwitchStatement implements IPolyExpression
continue;
if (!this.labelDecls.contains(new String(bs.label)))
blockScope.problemReporter().switchExpressionsBreakOutOfSwitchExpression(bs);
- }
+ }
for (ContinueStatement cs : this.referencedContinueLabels) {
if (cs.label == null || cs.label.length == 0)
continue;
if (!this.labelDecls.contains(new String(cs.label)))
blockScope.problemReporter().switchExpressionsContinueOutOfSwitchExpression(cs);
- }
+ }
} catch (EmptyStackException e) {
// ignore
}
}
-
+
@Override
public void endVisit(SwitchExpression switchExpression, BlockScope blockScope) {
checkForOutofBoundLabels(blockScope);
@@ -337,8 +337,8 @@ public class SwitchExpression extends SwitchStatement implements IPolyExpression
int resultExpressionsCount;
if (this.constant != Constant.NotAConstant) {
this.constant = Constant.NotAConstant;
-
- // A switch expression is a poly expression if it appears in an assignment context or an invocation context (5.2, 5.3).
+
+ // A switch expression is a poly expression if it appears in an assignment context or an invocation context (5.2, 5.3).
// Otherwise, it is a standalone expression.
if (this.expressionContext == ASSIGNMENT_CONTEXT || this.expressionContext == INVOCATION_CONTEXT) {
for (Expression e : this.resultExpressions) {
@@ -348,24 +348,24 @@ public class SwitchExpression extends SwitchStatement implements IPolyExpression
e.setExpectedType(this.expectedType);
}
}
-
+
resolve(upperScope);
-
+
if (this.statements == null || this.statements.length == 0) {
// Report Error JLS 13 15.28.1 The switch block must not be empty.
upperScope.problemReporter().switchExpressionEmptySwitchBlock(this);
return null;
}
-
+
resultExpressionsCount = this.resultExpressions != null ? this.resultExpressions.size() : 0;
if (resultExpressionsCount == 0) {
- // Report Error JLS 13 15.28.1
+ // Report Error JLS 13 15.28.1
// It is a compile-time error if a switch expression has no result expressions.
upperScope.problemReporter().switchExpressionNoResultExpressions(this);
return null;
}
this.traverse(new OOBLFlagger(this), upperScope);
-
+
if (this.originalValueResultExpressionTypes == null) {
this.originalValueResultExpressionTypes = new TypeBinding[resultExpressionsCount];
this.finalValueResultExpressionTypes = new TypeBinding[resultExpressionsCount];
@@ -387,7 +387,7 @@ public class SwitchExpression extends SwitchStatement implements IPolyExpression
for (int i = 0; i < resultExpressionsCount; i++) {
Expression resultExpr = this.resultExpressions.get(i);
if (resultExpr.resolvedType == null || resultExpr.resolvedType.kind() == Binding.POLY_TYPE) {
- this.finalValueResultExpressionTypes[i] = this.originalValueResultExpressionTypes[i] =
+ this.finalValueResultExpressionTypes[i] = this.originalValueResultExpressionTypes[i] =
resultExpr.resolveTypeExpecting(upperScope, this.expectedType);
}
// This is a kludge and only way completion can tell this node to resolve all
@@ -413,7 +413,7 @@ public class SwitchExpression extends SwitchStatement implements IPolyExpression
break;
}
}
- // If the result expressions all have the same type (which may be the null type),
+ // If the result expressions all have the same type (which may be the null type),
// then that is the type of the switch expression.
if (typeUniformAcrossAllArms) {
tmp = this.originalValueResultExpressionTypes[0];
@@ -423,7 +423,7 @@ public class SwitchExpression extends SwitchStatement implements IPolyExpression
}
return this.resolvedType = tmp;
}
-
+
boolean typeBbolean = true;
for (TypeBinding t : this.originalValueResultExpressionTypes) {
if (t != null)
@@ -472,7 +472,7 @@ public class SwitchExpression extends SwitchStatement implements IPolyExpression
* are widened to double.
* Otherwise, if any result expression is of type float, then other result expressions that are not of
* type float are widened to float.
- * Otherwise, if any result expression is of type long, then other result expressions that are not of
+ * Otherwise, if any result expression is of type long, then other result expressions that are not of
* type long are widened to long.
*/
TypeBinding[] dfl = new TypeBinding[]{// do not change the order JLS 13 5.6
@@ -493,7 +493,7 @@ public class SwitchExpression extends SwitchStatement implements IPolyExpression
* a standalone switch expression where all the result expressions are convertible to a numeric type.]
*/
- /* Otherwise, if any result expression is of type int and is not a constant expression, the other
+ /* Otherwise, if any result expression is of type int and is not a constant expression, the other
* result expressions that are not of type int are widened to int.
*/
resultNumeric = resultNumeric != null ? resultNumeric : check_nonconstant_int();
@@ -582,16 +582,16 @@ public class SwitchExpression extends SwitchStatement implements IPolyExpression
candidate : null;
}
private TypeBinding getResultNumeric(Set<TypeBinding> typeSet, TypeBinding[] armTypes) {
- // note: if an expression has a type integer, then it will be a constant
+ // note: if an expression has a type integer, then it will be a constant
// since non-constant integers are already processed before reaching here.
/* Otherwise, if any expression is of type short, and every other expression is either of type short,
* or of type byte, or a constant expression of type int with a value that is representable in the
- * type short, then T is short, the byte expressions undergo widening primitive conversion to short,
+ * type short, then T is short, the byte expressions undergo widening primitive conversion to short,
* and the int expressions undergo narrowing primitive conversion to short.\
*
* Otherwise, if any expression is of type byte, and every other expression is either of type byte or a
- * constant expression of type int with a value that is representable in the type byte, then T is byte
+ * constant expression of type int with a value that is representable in the type byte, then T is byte
* and the int expressions undergo narrowing primitive conversion to byte.
*
* Otherwise, if any expression is of type char, and every other expression is either of type char or a
@@ -618,7 +618,7 @@ public class SwitchExpression extends SwitchStatement implements IPolyExpression
return true;
// JLS 13 15.28.1 A switch expression is a poly expression if it appears in an assignment context or
// an invocation context (5.2, 5.3). Otherwise, it is a standalone expression.
- return this.isPolyExpression = this.expressionContext == ASSIGNMENT_CONTEXT ||
+ return this.isPolyExpression = this.expressionContext == ASSIGNMENT_CONTEXT ||
this.expressionContext == INVOCATION_CONTEXT;
}
@Override
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java
index 620e4dc5b..d18bae6b0 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java
@@ -10,7 +10,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Stephan Herrmann - Contributions for
+ * Stephan Herrmann - Contributions for
* bug 319201 - [null] no warning when unboxing SingleNameReference causes NPE
* bug 349326 - [1.7] new warning for missing try-with-resources
* bug 265744 - Enum switch should warn about missing default
@@ -65,7 +65,7 @@ public class SwitchStatement extends Expression {
public final static int FALLTHROUGH = 1;
public final static int ESCAPING = 2;
public final static int BREAKING = 3;
-
+
// for switch on strings
private static final char[] SecretStringVariableName = " switchDispatchString".toCharArray(); //$NON-NLS-1$
@@ -75,7 +75,7 @@ public class SwitchStatement extends Expression {
// for local variables table attributes
int preSwitchInitStateIndex = -1;
int mergedInitStateIndex = -1;
-
+
CaseStatement[] duplicateCaseStatements = null;
int duplicateCaseStatementsCounter = 0;
private LocalVariableBinding dispatchStringCopy = null;
@@ -84,7 +84,7 @@ public class SwitchStatement extends Expression {
if (this.switchLabeledRules) {
if ((stmt instanceof Expression && ((Expression) stmt).isTrulyExpression()) || stmt instanceof ThrowStatement)
return BREAKING;
-
+
if (stmt instanceof Block) {
Block block = (Block) stmt;
if (block.doesNotCompleteNormally()) {
@@ -225,7 +225,7 @@ public class SwitchStatement extends Expression {
return;
}
int pc = codeStream.position;
-
+
class StringSwitchCase implements Comparable {
int hashCode;
String string;
@@ -249,13 +249,13 @@ public class SwitchStatement extends Expression {
@Override
public String toString() {
return "StringSwitchCase :\n" + //$NON-NLS-1$
- "case " + this.hashCode + ":(" + this.string + ")\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "case " + this.hashCode + ":(" + this.string + ")\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
/*
* With multi constant case statements, the number of case statements (hence branch labels)
* and number of constants (hence hashcode labels) could be different. For e.g:
-
+
switch(s) {
case "FB", "c":
System.out.println("A/C");
@@ -263,18 +263,18 @@ public class SwitchStatement extends Expression {
case "Ea":
System.out.println("B");
break;
-
- With the above code, we will have
+
+ With the above code, we will have
2 branch labels for FB and c
3 stringCases for FB, c and Ea
2 hashCodeCaseLabels one for FB, Ea and one for c
-
- Should produce something like this:
+
+ Should produce something like this:
lookupswitch { // 2
99: 32
2236: 44
default: 87
-
+
"FB" and "Ea" producing the same hashcode values, but still belonging in different case statements.
First, produce the two branch labels pertaining to the case statements
And the three string cases and use the this.constMapping to get the correct branch label.
@@ -285,7 +285,7 @@ public class SwitchStatement extends Expression {
if (currentScope.compilerOptions().complianceLevel >= ClassFileConstants.JDK12) {
for (int i = 0, max = this.caseCount; i < max; i++) {
int l = this.cases[i].constantExpressions.length;
- this.cases[i].targetLabels = new BranchLabel[l];
+ this.cases[i].targetLabels = new BranchLabel[l];
}
sourceCaseLabels = new BranchLabel[this.nConstants];
int j = 0;
@@ -314,14 +314,14 @@ public class SwitchStatement extends Expression {
Arrays.sort(stringCases);
int uniqHashCount = 0;
- int lastHashCode = 0;
+ int lastHashCode = 0;
for (int i = 0, length = constSize; i < length; ++i) {
int hashCode = stringCases[i].hashCode;
if (i == 0 || hashCode != lastHashCode) {
lastHashCode = this.constants[uniqHashCount++] = hashCode;
}
}
-
+
if (uniqHashCount != constSize) { // multiple keys hashed to the same value.
System.arraycopy(this.constants, 0, this.constants = new int[uniqHashCount], 0, uniqHashCount);
System.arraycopy(hashCodeCaseLabels, 0, hashCodeCaseLabels = new CaseLabel[uniqHashCount], 0, uniqHashCount);
@@ -336,7 +336,7 @@ public class SwitchStatement extends Expression {
// prepare the labels and constants
this.breakLabel.initialize(codeStream);
-
+
BranchLabel defaultBranchLabel = new BranchLabel(codeStream);
if (hasCases) defaultBranchLabel.tagBits |= BranchLabel.USED;
if (this.defaultCase != null) {
@@ -391,7 +391,7 @@ public class SwitchStatement extends Expression {
statementGenerateCode(currentScope, codeStream, statement);
}
}
-
+
// May loose some local variable initializations : affecting the local variable attributes
if (this.mergedInitStateIndex != -1) {
codeStream.removeNotDefinitelyAssignedVariables(currentScope, this.mergedInitStateIndex);
@@ -412,7 +412,7 @@ public class SwitchStatement extends Expression {
if (this.expectedType() != null) {
TypeBinding expectedType = this.expectedType().erasure();
boolean optimizedGoto = codeStream.lastAbruptCompletion == -1;
- // if the last bytecode was an optimized goto (value is already on the stack) or an enum switch without default case, then we need to adjust the
+ // if the last bytecode was an optimized goto (value is already on the stack) or an enum switch without default case, then we need to adjust the
// stack depth to reflect the fact that there is an value on the stack (return type of the switch expression)
codeStream.recordExpressionType(expectedType, optimizedGoto ? 0 : 1, optimizedGoto);
}
@@ -422,7 +422,7 @@ public class SwitchStatement extends Expression {
}
}
-
+
/**
* Switch code generation
*
@@ -450,7 +450,7 @@ public class SwitchStatement extends Expression {
for (int i = 0, max = this.caseCount; i < max; i++) {
int l = this.cases[i].constantExpressions.length;
nCaseLabels += l;
- this.cases[i].targetLabels = new BranchLabel[l];
+ this.cases[i].targetLabels = new BranchLabel[l];
}
caseLabels = new CaseLabel[nCaseLabels];
int j = 0;
@@ -568,7 +568,7 @@ public class SwitchStatement extends Expression {
* to make the stack map consistent. All cases will return a value on the stack except the missing default
* case.
* There is no returned value for the default case so we handle it with an exception thrown. An
- * IllegalClassChangeError seems legitimate as this would mean the enum type has been recompiled with more
+ * IllegalClassChangeError seems legitimate as this would mean the enum type has been recompiled with more
* enum constants and the class that is using the switch on the enum has not been recompiled
*/
codeStream.newJavaLangIncompatibleClassChangeError();
@@ -597,7 +597,7 @@ public class SwitchStatement extends Expression {
switchResolveType = this.expectedType().erasure();
}
boolean optimizedGoto = codeStream.lastAbruptCompletion == -1;
- // if the last bytecode was an optimized goto (value is already on the stack) or an enum switch without default case, then we need to adjust the
+ // if the last bytecode was an optimized goto (value is already on the stack) or an enum switch without default case, then we need to adjust the
// stack depth to reflect the fact that there is an value on the stack (return type of the switch expression)
codeStream.recordExpressionType(switchResolveType, optimizedGoto ? 0 : 1, optimizedGoto || isEnumSwitchWithoutDefaultCase);
}
@@ -715,7 +715,7 @@ public class SwitchStatement extends Expression {
}
if ((constantsList = statement.resolveCase(this.scope, expressionType, this)) != Constant.NotAConstantList) {
for (Constant con : constantsList) {
- if (con == Constant.NotAConstant)
+ if (con == Constant.NotAConstant)
continue;
if (!isStringSwitch) {
int key = con.intValue();
@@ -825,11 +825,11 @@ public class SwitchStatement extends Expression {
private void reportDuplicateCase(final CaseStatement duplicate, final CaseStatement original, int length) {
if (this.duplicateCaseStatements == null) {
this.scope.problemReporter().duplicateCase(original);
- if (duplicate != original)
+ if (duplicate != original)
this.scope.problemReporter().duplicateCase(duplicate);
this.duplicateCaseStatements = new CaseStatement[length];
this.duplicateCaseStatements[this.duplicateCaseStatementsCounter++] = original;
- if (duplicate != original)
+ if (duplicate != original)
this.duplicateCaseStatements[this.duplicateCaseStatementsCounter++] = duplicate;
} else {
boolean found = false;
@@ -888,7 +888,7 @@ public class SwitchStatement extends Expression {
}
return this.statements[this.statements.length - 1].doesNotCompleteNormally();
}
-
+
@Override
public boolean completesByContinue() {
if (this.statements == null || this.statements.length == 0)
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SynchronizedStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SynchronizedStatement.java
index d6465cb9c..cbc5e9170 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SynchronizedStatement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SynchronizedStatement.java
@@ -113,7 +113,7 @@ public void generateCode(BlockScope currentScope, CodeStream codeStream) {
default :
codeStream.dup();
break;
- }
+ }
// only take the lock
codeStream.monitorenter();
codeStream.monitorexit();
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ThisReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ThisReference.java
index 079c138e9..e33228ca4 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ThisReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ThisReference.java
@@ -139,7 +139,7 @@ public class ThisReference extends Reference {
public TypeBinding resolveType(BlockScope scope) {
this.constant = Constant.NotAConstant;
-
+
ReferenceBinding enclosingReceiverType = scope.enclosingReceiverType();
if (!isImplicitThis() &&!checkAccess(scope, enclosingReceiverType)) {
return null;
@@ -156,7 +156,7 @@ public class ThisReference extends Reference {
this.resolvedType = RoleTypeCreator.maybeWrapUnqualifiedRoleType(
this.resolvedType,
scope,
- this);
+ this);
}
// SH}
return this.resolvedType;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TrueLiteral.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TrueLiteral.java
index 1ef7a61bc..00955c887 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TrueLiteral.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TrueLiteral.java
@@ -21,9 +21,9 @@ import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
public class TrueLiteral extends MagicLiteral {
-
+
static final char[] source = {'t' , 'r' , 'u' , 'e'};
-
+
public TrueLiteral(int s , int e) {
super(s,e);
}
@@ -76,7 +76,7 @@ public char[] source() {
}
@Override
public void traverse(ASTVisitor visitor, BlockScope scope) {
-//{ObjectTeams: hide synthetic nodes from visitors (e.g., inserted into a base call)
+//{ObjectTeams: hide synthetic nodes from visitors (e.g., inserted into a base call)
if (this.isGenerated) return;
// SH}
visitor.visit(this, scope);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TryStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TryStatement.java
index af44a2a03..c39dde83a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TryStatement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TryStatement.java
@@ -162,7 +162,7 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl
FlowInfo tryInfo = flowInfo.copy();
for (int i = 0; i < resourcesLength; i++) {
- final Statement resource = this.resources[i];
+ final Statement resource = this.resources[i];
tryInfo = resource.analyseCode(currentScope, handlingContext, tryInfo);
this.postResourcesInitStateIndexes[i] = currentScope.methodScope().recordInitializationStates(tryInfo);
TypeBinding resolvedType = null;
@@ -261,7 +261,7 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl
null,
this.scope,
flowInfo);
- insideSubContext.initsOnFinally = handlingContext.initsOnFinally;
+ insideSubContext.initsOnFinally = handlingContext.initsOnFinally;
subInfo =
this.finallyBlock
@@ -600,7 +600,7 @@ public void generateCode(BlockScope currentScope, CodeStream codeStream) {
for (int i = resourceCount; i >= 0; i--) {
BranchLabel exitLabel = new BranchLabel(codeStream);
this.resourceExceptionLabels[i].placeEnd(); // outer handler if any is the one that should catch exceptions out of close()
-
+
Statement stmt = i > 0 ? this.resources[i - 1] : null;
if ((this.bits & ASTNode.IsTryBlockExiting) == 0) {
// inline resource closure
@@ -631,8 +631,8 @@ public void generateCode(BlockScope currentScope, CodeStream codeStream) {
codeStream.pushExceptionOnStack(this.scope.getJavaLangThrowable());
this.resourceExceptionLabels[i].place();
- if (i == resourceCount) {
- // inner most try's catch/finally can be a lot simpler.
+ if (i == resourceCount) {
+ // inner most try's catch/finally can be a lot simpler.
codeStream.store(this.primaryExceptionVariable, false);
// fall through, invoke close() and re-throw.
} else {
@@ -655,7 +655,7 @@ public void generateCode(BlockScope currentScope, CodeStream codeStream) {
if (i > 0) {
// inline resource close here rather than bracketing the current catch block with a try region.
BranchLabel postCloseLabel = new BranchLabel(codeStream);
- generateCodeSnippet(stmt, codeStream, postCloseLabel, true /* record */, i, codeStream.position);
+ generateCodeSnippet(stmt, codeStream, postCloseLabel, true /* record */, i, codeStream.position);
postCloseLabel.place();
}
codeStream.load(this.primaryExceptionVariable);
@@ -911,8 +911,8 @@ public void generateCode(BlockScope currentScope, CodeStream codeStream) {
codeStream.recordPositionsFrom(pc, this.sourceStart);
}
private void generateCodeSnippet(Statement statement, CodeStream codeStream, BranchLabel postCloseLabel, boolean record, int... values) {
-
- int i = -1;
+
+ int i = -1;
int invokeCloseStartPc = -1;
if (record) {
i = values[0];
@@ -953,11 +953,11 @@ private boolean isDuplicateResourceReference(int index) {
Binding refBinding = ref instanceof NameReference ? ((NameReference) ref).binding :
ref instanceof FieldReference ? ((FieldReference) ref).binding : null;
if (refBinding == null) return false;
-
+
//TODO: For field accesses in the form of a.b.c and b.c - could there be a non-trivial dup - to check?
for (int i = 0; i < index; i++) {
Statement stmt = this.resources[i];
- Binding b = stmt instanceof LocalDeclaration ? ((LocalDeclaration) stmt).binding :
+ Binding b = stmt instanceof LocalDeclaration ? ((LocalDeclaration) stmt).binding :
stmt instanceof NameReference ? ((NameReference) stmt).binding :
stmt instanceof FieldReference ? ((FieldReference) stmt).binding : null;
if (b == refBinding) {
@@ -1189,7 +1189,7 @@ public void resolve(BlockScope upperScope) {
if (!methodScope.isInsideInitializer()) {
MethodBinding methodBinding = methodScope.referenceContext instanceof AbstractMethodDeclaration ?
- ((AbstractMethodDeclaration) methodScope.referenceContext).binding : (methodScope.referenceContext instanceof LambdaExpression ?
+ ((AbstractMethodDeclaration) methodScope.referenceContext).binding : (methodScope.referenceContext instanceof LambdaExpression ?
((LambdaExpression)methodScope.referenceContext).binding : null);
if (methodBinding != null) {
TypeBinding methodReturnType = methodBinding.returnType;
@@ -1363,7 +1363,7 @@ public boolean doesNotCompleteNormally() {
public boolean completesByContinue() {
if (this.tryBlock.completesByContinue()) {
return (this.finallyBlock == null) ? true :
- !this.finallyBlock.doesNotCompleteNormally() || this.finallyBlock.completesByContinue();
+ !this.finallyBlock.doesNotCompleteNormally() || this.finallyBlock.completesByContinue();
}
if (this.catchBlocks != null) {
for (int i = 0; i < this.catchBlocks.length; i++) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java
index 214371ccf..d94a50cfe 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java
@@ -701,7 +701,7 @@ public ConstructorDeclaration createDefaultConstructor( boolean needExplicitCons
// if roleModel != null assume were called later than during parsing:
// - from CopyInheritance.copyMethod(OTConfined)
// - crom Dependencies.establishMethodsCreated(RoleModel)
- if (this.isDirectRole() && this.roleModel == null)
+ if (this.isDirectRole() && this.roleModel == null)
return null;
// SH}
@@ -806,11 +806,11 @@ public MethodBinding createDefaultConstructorWithBinding(MethodBinding inherited
constructor.binding.tagBits |= (inheritedConstructorBinding.tagBits & TagBits.HasMissingType);
constructor.binding.modifiers |= ExtraCompilerModifiers.AccIsDefaultConstructor;
if (inheritedConstructorBinding.parameterNonNullness != null // this implies that annotation based null analysis is enabled
- && argumentsLength > 0)
+ && argumentsLength > 0)
{
// copy nullness info from inherited constructor to the new constructor:
int len = inheritedConstructorBinding.parameterNonNullness.length;
- System.arraycopy(inheritedConstructorBinding.parameterNonNullness, 0,
+ System.arraycopy(inheritedConstructorBinding.parameterNonNullness, 0,
constructor.binding.parameterNonNullness = new Boolean[len], 0, len);
}
// TODO(stephan): do argument types already carry sufficient info about type annotations?
@@ -1090,7 +1090,7 @@ public void generateCode(ClassFile enclosingClassFile) {
//{ObjectTeams: mark as done:
finally {
if (this.isTeam())
- this.teamModel.setState(ITranslationStates.STATE_BYTE_CODE_GENERATED);
+ this.teamModel.setState(ITranslationStates.STATE_BYTE_CODE_GENERATED);
}
// SH}
}
@@ -1152,7 +1152,7 @@ protected AbstractSmapGenerator createSmapGenerator()
return new TeamSmapGenerator(this);
// NOTE: currently no special treatment for nested team (team&role)
-
+
return null;
}
//ike}
@@ -1233,9 +1233,9 @@ private void internalAnalyseCode(FlowContext flowContext, FlowInfo flowInfo) {
this.scope.problemReporter().unusedPrivateType(this);
}
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=385780
- if (this.typeParameters != null &&
+ if (this.typeParameters != null &&
!this.scope.referenceCompilationUnit().compilationResult.hasSyntaxError) {
for (int i = 0, length = this.typeParameters.length; i < length; ++i) {
TypeParameter typeParameter = this.typeParameters[i];
@@ -1243,11 +1243,11 @@ private void internalAnalyseCode(FlowContext flowContext, FlowInfo flowInfo) {
if (!(typeParameter instanceof TypeValueParameter))
// SH}
if ((typeParameter.binding.modifiers & ExtraCompilerModifiers.AccLocallyUsed) == 0) {
- this.scope.problemReporter().unusedTypeParameter(typeParameter);
+ this.scope.problemReporter().unusedTypeParameter(typeParameter);
}
}
}
-
+
// for local classes we use the flowContext as our parent, but never use an initialization context for this purpose
// see Bug 360328 - [compiler][null] detect null problems in nested code (local class inside a loop)
FlowContext parentContext = (flowContext instanceof InitializationFlowContext) ? null : flowContext;
@@ -2066,7 +2066,7 @@ public void resolve() {
}
StateMemento.methodResolveStart(this.binding);
// any role types found during field resolve? If so, catch up now:
- if (this.memberTypes != null && this.memberTypes.length > resolvedMemberCount
+ if (this.memberTypes != null && this.memberTypes.length > resolvedMemberCount
&& this.teamModel != null)
{
Dependencies.lateRolesCatchup(this.teamModel);
@@ -2153,7 +2153,7 @@ checkOuterScope:while (outerScope != null) {
}
} else if (existing2 instanceof ReferenceBinding
&& existing2.isValidBinding()
- && outerScope.isDefinedInType((ReferenceBinding) existing2)) {
+ && outerScope.isDefinedInType((ReferenceBinding) existing2)) {
blockScope.problemReporter().typeCollidesWithEnclosingType(this);
break checkOuterScope;
} else if (existing2 == null) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeParameter.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeParameter.java
index 109373335..92d12f677 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeParameter.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeParameter.java
@@ -189,7 +189,7 @@ public class TypeParameter extends AbstractVariableDeclaration {
this.binding.evaluateNullAnnotations(scope, this);
}
}
- }
+ }
}
@Override
@@ -263,7 +263,7 @@ public class TypeParameter extends AbstractVariableDeclaration {
visitor.endVisit(this, scope);
}
//{ObjectTeams: for type parameters with an anchor (C<R<@t..>>)
- public void connectTypeAnchors(Scope scope) {
+ public void connectTypeAnchors(Scope scope) {
if (this.type instanceof TypeAnchorReference) {
int numParams = 1;
if (this.bounds != null)
@@ -287,7 +287,7 @@ public class TypeParameter extends AbstractVariableDeclaration {
this.binding.superclass = (ReferenceBinding) bound;
else
scope.problemReporter().incompleteDependentTypesImplementation(this, "Cannot combine more than one type bound with an instance bound");
- }
+ }
}
this.binding.anchors = anchors;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java
index 37cc590b9..23aefe397 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java
@@ -28,7 +28,7 @@
* Bug 435570 - [1.8][null] @NonNullByDefault illegally tries to affect "throws E"
* Bug 435805 - [1.8][compiler][null] Java 8 compiler does not recognize declaration style null annotations
* Bug 437072 - [compiler][null] Null analysis emits possibly incorrect warning for new int[][] despite @NonNullByDefault
- * Bug 466713 - Null Annotations: NullPointerException using <int @Nullable []> as Type Param
+ * Bug 466713 - Null Annotations: NullPointerException using <int @Nullable []> as Type Param
* Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
* Bug 383624 - [1.8][compiler] Revive code generation support for type annotations (from Olivier's work)
* Bug 409236 - [1.8][compiler] Type annotations on intersection cast types dropped by code generator
@@ -36,7 +36,7 @@
* Jesper S Møller <jesper@selskabet.org> - Contributions for
* bug 527554 - [18.3] Compiler support for JEP 286 Local-Variable Type
* bug 529556 - [18.3] Add content assist support for 'var' as a type
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.ast;
@@ -95,7 +95,7 @@ public abstract class TypeReference extends Expression {
/** Any position admitting type annotations. */
ANY
}
-
+
static class AnnotationCollector extends ASTVisitor {
List annotationContexts;
Expression typeReference;
@@ -189,7 +189,7 @@ static class AnnotationCollector extends ASTVisitor {
// of the dimensions.
this.dimensions = dimensions;
}
-
+
private boolean internalVisit(Annotation annotation) {
AnnotationContext annotationContext = null;
if (annotation.isRuntimeTypeInvisible()) {
@@ -230,7 +230,7 @@ static class AnnotationCollector extends ASTVisitor {
case AnnotationTargetTypeConstants.METHOD_RETURN :
case AnnotationTargetTypeConstants.METHOD_RECEIVER :
break;
-
+
}
this.annotationContexts.add(annotationContext);
}
@@ -410,7 +410,7 @@ protected Annotation[][] getMergedAnnotationsOnDimensions(int additionalDimensio
*/
Annotation[][] annotationsOnDimensions = this.getAnnotationsOnDimensions(true);
int dimensions = this.dimensions();
-
+
if (annotationsOnDimensions == null && additionalAnnotations == null)
return null;
@@ -419,7 +419,7 @@ protected Annotation[][] getMergedAnnotationsOnDimensions(int additionalDimensio
if (annotationsOnDimensions != null) {
for (int i = 0; i < dimensions; i++) {
mergedAnnotations[i] = annotationsOnDimensions[i];
- }
+ }
}
if (additionalAnnotations != null) {
for (int i = dimensions, j = 0; i < totalDimensions; i++, j++) {
@@ -515,8 +515,8 @@ public TypeReference [][] getTypeArguments() {
* int @Nullable [] f @NonNull [] ==> f is really a @NonNull array of @Nullable arrays of ints. This is the type system
* view since extended dimensions bind more readily than type components that precede the identifier. This is how it ought
* to be encoded in bindings and how it ought to be persisted in class files. However for DOM/AST construction, we need the
- * dimensions in source order, so we provide a way for the clients to ask what they want.
- *
+ * dimensions in source order, so we provide a way for the clients to ask what they want.
+ *
*/
public Annotation[][] getAnnotationsOnDimensions(boolean useSourceOrder) {
return null;
@@ -874,7 +874,7 @@ protected void resolveAnnotations(Scope scope, int location) {
&& !this.resolvedType.isTypeVariable()
&& !this.resolvedType.isWildcard()
&& location != 0
- && scope.hasDefaultNullnessFor(location, this.sourceStart))
+ && scope.hasDefaultNullnessFor(location, this.sourceStart))
{
if (location == Binding.DefaultLocationTypeBound && this.resolvedType.id == TypeIds.T_JavaLangObject) {
scope.problemReporter().implicitObjectBoundNoNullDefault(this);
@@ -911,7 +911,7 @@ protected void checkNullConstraints(Scope scope, Substitution substitution, Type
}
protected void checkIllegalNullAnnotation(Scope scope) {
if (this.resolvedType.leafComponentType().isBaseType() && hasNullTypeAnnotation(AnnotationPosition.LEAF_TYPE))
- scope.problemReporter().illegalAnnotationForBaseType(this, this.annotations[0], this.resolvedType.tagBits & TagBits.AnnotationNullMASK);
+ scope.problemReporter().illegalAnnotationForBaseType(this, this.annotations[0], this.resolvedType.tagBits & TagBits.AnnotationNullMASK);
}
/** Retrieve the null annotation that has been translated to the given nullTagBits. */
public Annotation findAnnotation(long nullTagBits) {
@@ -948,7 +948,7 @@ public static boolean containsNullAnnotation(Annotation[] annotations) {
return true;
}
}
- return false;
+ return false;
}
public TypeReference[] getTypeReferences() {
return new TypeReference [] { this };
@@ -963,9 +963,9 @@ private char[] getTypeName(int index) {
CharOperation.NO_CHAR;
}
/**
- * Checks to see if the declaration uses 'var' as type name
+ * Checks to see if the declaration uses 'var' as type name
* @param scope Relevant scope, for error reporting
- * @return true, if source level is Java 10 or above and the type name is just 'var', false otherwise
+ * @return true, if source level is Java 10 or above and the type name is just 'var', false otherwise
*/
public boolean isTypeNameVar(Scope scope) {
CompilerOptions compilerOptions = scope != null ? scope.compilerOptions() : null;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/UnionTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/UnionTypeReference.java
index 49e08f05a..cb9b2e838 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/UnionTypeReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/UnionTypeReference.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
@@ -49,7 +49,7 @@ public class UnionTypeReference extends TypeReference {
@Override
public TypeBinding resolveType(BlockScope scope, boolean checkBounds, int location) {
- // return the lub (least upper bound of all type binding)
+ // return the lub (least upper bound of all type binding)
int length = this.typeReferences.length;
TypeBinding[] allExceptionTypes = new TypeBinding[length];
boolean hasError = false;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/UnlikelyArgumentCheck.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/UnlikelyArgumentCheck.java
index f8ba8be90..7eebf7418 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/UnlikelyArgumentCheck.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/UnlikelyArgumentCheck.java
@@ -133,7 +133,7 @@ public class UnlikelyArgumentCheck {
ReferenceBinding argumentCollectionType = argumentType
.findSuperTypeOriginatingFrom(TypeIds.T_JavaUtilCollection, false);
if (collectionType != null && argumentCollectionType != null
- && argumentCollectionType.isParameterizedTypeWithActualArguments()
+ && argumentCollectionType.isParameterizedTypeWithActualArguments()
&& collectionType.isParameterizedTypeWithActualArguments()) {
return new UnlikelyArgumentCheck(suspect,
((ParameterizedTypeBinding) argumentCollectionType).typeArguments()[0],
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/WhileStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/WhileStatement.java
index 84f301c39..000bd31b1 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/WhileStatement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/WhileStatement.java
@@ -10,7 +10,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Stephan Herrmann - Contributions for
+ * Stephan Herrmann - Contributions for
* bug 319201 - [null] no warning when unboxing SingleNameReference causes NPE
* bug 349326 - [1.7] new warning for missing try-with-resources
* bug 345305 - [compiler][null] Compiler misidentifies a case of "variable can only be null"
@@ -63,7 +63,7 @@ public class WhileStatement extends Statement {
this.preCondInitStateIndex = currentScope.methodScope().recordInitializationStates(flowInfo);
LoopingFlowContext condLoopContext;
FlowInfo condInfo = flowInfo.nullInfoLessUnconditionalCopy();
-
+
// we need to collect the contribution to nulls of the coming paths through the
// loop, be they falling through normally or branched to break, continue labels
// or catch blocks
@@ -312,7 +312,7 @@ public class WhileStatement extends Statement {
boolean isConditionOptimizedTrue = cst == null ? true : cst != Constant.NotAConstant && cst.booleanValue() == true;
return (isConditionTrue || isConditionOptimizedTrue) && (this.action == null || !this.action.breaksOut(null));
}
-
+
@Override
public boolean completesByContinue() {
return this.action.continuesAtOuterLabel();
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Wildcard.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Wildcard.java
index 42fd68e0f..15caa6a31 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Wildcard.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Wildcard.java
@@ -79,11 +79,11 @@ public class Wildcard extends SingleTypeReference {
}
this.resolvedType = scope.environment().createWildcard(genericType, rank, boundType, null /*no extra bound*/, this.kind);
resolveAnnotations(scope, 0); // no defaultNullness for wildcards
-
+
if(scope.environment().usesNullTypeAnnotations()) {
((WildcardBinding)this.resolvedType).evaluateNullAnnotations(scope, this);
}
-
+
return this.resolvedType;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/YieldStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/YieldStatement.java
index 8adc75c5f..14e6fc9bb 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/YieldStatement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/YieldStatement.java
@@ -41,7 +41,7 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl
// lookup the null label, this should answer the returnContext - for implicit yields, the nesting
- // doesn't occur since it immediately follow '->' and hence identical to default break - ie the
+ // doesn't occur since it immediately follow '->' and hence identical to default break - ie the
// immediate breakable context is guaranteed to be the one intended;
// while explicit yield should move up the parent to the switch expression.
FlowContext targetContext = this.isImplicit ? flowContext.getTargetContextForDefaultBreak() :
@@ -124,7 +124,7 @@ public void resolve(BlockScope scope) {
if (this.expression == null) {
//currentScope.problemReporter().switchExpressionYieldMissingExpression(this);
return;
-
+
}
if (this.switchExpression != null || this.isImplicit) {
if (this.switchExpression == null && this.isImplicit && !this.expression.statementExpression()) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java
index 8640bc5a1..a47853e01 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java
@@ -13,7 +13,7 @@
* Fraunhofer FIRST - extended API and implementation
* Technical University Berlin - extended API and implementation
* Jesper S Moller - Contributions for
- * Bug 405066 - [1.8][compiler][codegen] Implement code generation infrastructure for JSR335
+ * Bug 405066 - [1.8][compiler][codegen] Implement code generation infrastructure for JSR335
* Bug 406982 - [1.8][compiler] Generation of MethodParameters Attribute in classfile
* Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
* Bug 405104 - [1.8][compiler][codegen] Implement support for serializeable lambdas
@@ -64,7 +64,7 @@ public interface ClassFileConstants {
int ACC_TRANSITIVE = 0x0020;
int ACC_STATIC_PHASE = 0x0040;
int ACC_SYNTHETIC = 0x1000;
-
+
/**
* Other VM flags.
*/
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java
index 38700ef74..eb424c12e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java
@@ -811,7 +811,7 @@ public char[] getEnclosingMethod() {
if (this.enclosingMethod == null) {
// read the name
StringBuffer buffer = new StringBuffer();
-
+
int nameAndTypeOffset = this.constantPoolOffsets[this.enclosingNameAndTypeIndex];
int utf8Offset = this.constantPoolOffsets[u2At(nameAndTypeOffset + 1)];
buffer.append(utf8At(utf8Offset + 3, u2At(utf8Offset + 1)));
@@ -849,9 +849,9 @@ public char[] getModule() {
return this.moduleName;
}
/**
- * Returns the module declaration that this class file represents. This will be
+ * Returns the module declaration that this class file represents. This will be
* null for non module-info class files.
- *
+ *
* @return the module declaration this represents
*/
public IBinaryModule getModuleDeclaration() {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ComponentInfo.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ComponentInfo.java
index 7fe4459dd..f357ad2dc 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ComponentInfo.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ComponentInfo.java
@@ -37,7 +37,7 @@ public class ComponentInfo extends ClassFileStruct implements IComponent, Compar
public static ComponentInfo createComponent(byte classFileBytes[], int offsets[], int offset, long version) {
ComponentInfo componentInfo = new ComponentInfo(classFileBytes, offsets, offset, version);
-
+
int attributesCount = componentInfo.u2At(4);
int readOffset = 6;
AnnotationInfo[] annotations = null;
@@ -90,7 +90,7 @@ public static ComponentInfo createComponent(byte classFileBytes[], int offsets[]
readOffset += (6 + componentInfo.u4At(readOffset + 2));
}
componentInfo.attributeBytes = readOffset;
-
+
if (typeAnnotations != null)
return new ComponentInfoWithTypeAnnotation(componentInfo, annotations, typeAnnotations);
if (annotations != null)
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationDecorator.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationDecorator.java
index d67ce1296..afcef9d87 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationDecorator.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationDecorator.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Stefan Xenos <sxenos@gmail.com> (Google) - initial API and implementation
*******************************************************************************/
@@ -239,7 +239,7 @@ public class ExternalAnnotationDecorator implements IBinaryType {
* annotations is associated. This provider is constructed using the given basePath, which is either a directory
* holding .eea text files, or a zip file of entries of the same format. If no such provider could be constructed,
* then the original binary type is returned unchanged.
- *
+ *
* @param toDecorate
* the binary type to wrap, if needed
* @param basePath
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider.java
index a40a380fd..8dbd7d95d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider.java
@@ -59,7 +59,7 @@ public class ExternalAnnotationProvider {
Map<String,String> supertypeAnnotationSources;
private Map<String,String> methodAnnotationSources;
private Map<String,String> fieldAnnotationSources;
-
+
/**
* Create and initialize.
* @param input open input stream to read the annotations from, will be closed by the constructor.
@@ -86,7 +86,7 @@ public class ExternalAnnotationProvider {
this.typeParametersAnnotationSource = line.substring(TYPE_PARAMETER_PREFIX.length());
if ((line = reader.readLine()) == null)
return;
- }
+ }
}
String pendingLine;
do {
@@ -171,7 +171,7 @@ public class ExternalAnnotationProvider {
int tail = line.indexOf(' ');
if (tail == -1)
tail = line.indexOf('\t');
- if (tail != -1)
+ if (tail != -1)
return line.substring(0, tail);
return line;
}
@@ -257,7 +257,7 @@ public class ExternalAnnotationProvider {
public ITypeAnnotationWalker toTypeParameter(boolean isClassTypeParameter, int rank) {
String source = ExternalAnnotationProvider.this.typeParametersAnnotationSource;
if (source != null) {
- if (this.typeParametersWalker == null)
+ if (this.typeParametersWalker == null)
this.typeParametersWalker = new TypeParametersAnnotationWalker(source.toCharArray(), 0, 0, null, this.environment);
return this.typeParametersWalker.toTypeParameter(isClassTypeParameter, rank);
}
@@ -305,7 +305,7 @@ public class ExternalAnnotationProvider {
}
abstract class BasicAnnotationWalker implements ITypeAnnotationWalker {
-
+
char[] source;
SignatureWrapper wrapper;
int pos;
@@ -319,7 +319,7 @@ public class ExternalAnnotationProvider {
this.environment = environment;
initAnnotations(environment);
}
-
+
SignatureWrapper wrapperWithStart(int start) {
if (this.wrapper == null)
this.wrapper = new SignatureWrapper(this.source);
@@ -362,10 +362,10 @@ public class ExternalAnnotationProvider {
}
int next = this.prevTypeArgStart;
switch (this.source[next]) {
- case '*':
+ case '*':
next = skipNullAnnotation(next+1);
break;
- case '-':
+ case '-':
case '+':
next = skipNullAnnotation(next+1);
//$FALL-THROUGH$
@@ -380,13 +380,13 @@ public class ExternalAnnotationProvider {
@Override
public ITypeAnnotationWalker toWildcardBound() {
switch (this.source[this.pos]) {
- case '-':
+ case '-':
case '+':
int newPos = skipNullAnnotation(this.pos+1);
return new MethodAnnotationWalker(this.source, newPos, this.environment);
default: // includes unbounded '*'
return ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER;
- }
+ }
}
@Override
@@ -419,7 +419,7 @@ public class ExternalAnnotationProvider {
case NONNULL:
return new IBinaryAnnotation[]{ ExternalAnnotationProvider.this.NONNULL_ANNOTATION };
}
- }
+ }
}
return NO_ANNOTATIONS;
}
@@ -431,7 +431,7 @@ public class ExternalAnnotationProvider {
case NULLABLE:
return cur+1;
default:
- return cur;
+ return cur;
}
}
}
@@ -501,7 +501,7 @@ public class ExternalAnnotationProvider {
System.arraycopy(rankStarts, 0, this.rankStarts = new int[curRank], 0, curRank);
}
}
-
+
@Override
public ITypeAnnotationWalker toTypeParameter(boolean isClassTypeParameter, int rank) {
if (rank == this.currentRank)
@@ -564,7 +564,7 @@ public class ExternalAnnotationProvider {
return new IBinaryAnnotation[]{ ExternalAnnotationProvider.this.NULLABLE_ANNOTATION };
case NONNULL:
return new IBinaryAnnotation[]{ ExternalAnnotationProvider.this.NONNULL_ANNOTATION };
- }
+ }
}
return super.getAnnotationsAtCursor(currentTypeId, mayApplyArrayContentsDefaultNullness);
}
@@ -611,7 +611,7 @@ public class ExternalAnnotationProvider {
MethodAnnotationWalker(char[] source, int pos, LookupEnvironment environment) {
super(source, pos, environment);
}
-
+
int typeEnd(int start) {
while (this.source[start] == '[') {
start++;
@@ -621,7 +621,7 @@ public class ExternalAnnotationProvider {
int end = wrapper1.skipAngleContents(wrapper1.computeEnd());
return end;
}
-
+
@Override
public ITypeAnnotationWalker toTypeParameter(boolean isClassTypeParameter, int rank) {
if (this.source[0] == '<') {
@@ -689,7 +689,7 @@ public class ExternalAnnotationProvider {
return count;
}
}
-
+
class FieldAnnotationWalker extends BasicAnnotationWalker {
public FieldAnnotationWalker(char[] source, int pos, LookupEnvironment environment) {
super(source, pos, environment);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/FieldInfo.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/FieldInfo.java
index c265f2d06..41d60c6e1 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/FieldInfo.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/FieldInfo.java
@@ -59,7 +59,7 @@ public class FieldInfo extends ClassFileStruct implements IBinaryField, Comparab
public static FieldInfo createField(byte classFileBytes[], int offsets[], int offset, long version) {
FieldInfo fieldInfo = new FieldInfo(classFileBytes, offsets, offset, version);
-
+
int attributesCount = fieldInfo.u2At(6);
int readOffset = 8;
AnnotationInfo[] annotations = null;
@@ -112,7 +112,7 @@ public static FieldInfo createField(byte classFileBytes[], int offsets[], int of
readOffset += (6 + fieldInfo.u4At(readOffset + 2));
}
fieldInfo.attributeBytes = readOffset;
-
+
if (typeAnnotations != null)
return new FieldInfoWithTypeAnnotation(fieldInfo, annotations, typeAnnotations);
if (annotations != null)
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/MethodInfo.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/MethodInfo.java
index d1569bddc..aad385dee 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/MethodInfo.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/MethodInfo.java
@@ -319,7 +319,7 @@ static AnnotationInfo[][] decodeParamAnnotations(int offset, boolean runtimeVisi
* @param classFileBytes byte[]
* @param offsets int[]
* @param offset int
- * @param version class file version
+ * @param version class file version
*/
protected MethodInfo (byte classFileBytes[], int offsets[], int offset, long version) {
super(classFileBytes, offsets, offset);
@@ -563,7 +563,7 @@ private synchronized void readModifierRelatedAttributes() {
* @param readOffset
* @param aStructOffset (subtract when indexing via constantPoolOffsets)
* @param someConstantPoolOffsets
- * @return (visibility modifiers | HAVE_OT_MODIFIERS) or 0
+ * @return (visibility modifiers | HAVE_OT_MODIFIERS) or 0
*/
long readOTAttribute(
char[] attributeName,
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ModuleInfo.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ModuleInfo.java
index aa091f8a8..f2807b7da 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ModuleInfo.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ModuleInfo.java
@@ -280,7 +280,7 @@ public class ModuleInfo extends ClassFileStruct implements IBinaryModule {
}
@Override
public boolean equals(Object o) {
- if (this == o)
+ if (this == o)
return true;
if (!(o instanceof IModule.IModuleReference))
return false;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/NonNullDefaultAwareTypeAnnotationWalker.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/NonNullDefaultAwareTypeAnnotationWalker.java
index ad0f05079..5cc61289e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/NonNullDefaultAwareTypeAnnotationWalker.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/NonNullDefaultAwareTypeAnnotationWalker.java
@@ -34,12 +34,12 @@ public class NonNullDefaultAwareTypeAnnotationWalker extends TypeAnnotationWalke
private final boolean isEmpty;
private final IBinaryAnnotation nonNullAnnotation;
private final LookupEnvironment environment;
-
+
private boolean nextIsDefaultLocation;
private boolean nextIsTypeBound;
private boolean nextArrayContentIsNonNull;
-
+
/** Create initial walker with non-empty type annotations. */
public NonNullDefaultAwareTypeAnnotationWalker(IBinaryTypeAnnotation[] typeAnnotations,
int defaultNullness, LookupEnvironment environment) {
@@ -52,7 +52,7 @@ public class NonNullDefaultAwareTypeAnnotationWalker extends TypeAnnotationWalke
this.isEmpty = false;
this.currentArrayContentIsNonNull = false;
}
-
+
/** Create an initial walker without 'real' type annotations, but with a nonnull default. */
public NonNullDefaultAwareTypeAnnotationWalker(int defaultNullness, LookupEnvironment environment) {
this(defaultNullness, getNonNullAnnotation(environment), false, false, environment, false);
@@ -84,7 +84,7 @@ public class NonNullDefaultAwareTypeAnnotationWalker extends TypeAnnotationWalke
this.environment = environment;
this.currentArrayContentIsNonNull = this.nextArrayContentIsNonNull = currentArrayContentIsNonNull;
}
-
+
private static IBinaryAnnotation getNonNullAnnotation(LookupEnvironment environment) {
final char[] nonNullAnnotationName = CharOperation.concat(
'L', CharOperation.concatWith(environment.getNonNullAnnotationName(), '/'), ';');
@@ -111,7 +111,7 @@ public class NonNullDefaultAwareTypeAnnotationWalker extends TypeAnnotationWalke
return this;
// are we running out of real type annotations?
if (newMatches == 0 || this.typeAnnotations == null || this.typeAnnotations.length == 0)
- return new NonNullDefaultAwareTypeAnnotationWalker(this.defaultNullness, this.nonNullAnnotation,
+ return new NonNullDefaultAwareTypeAnnotationWalker(this.defaultNullness, this.nonNullAnnotation,
this.nextIsDefaultLocation, this.nextIsTypeBound, this.environment, this.nextArrayContentIsNonNull);
// proceed as normal, but pass on our specific fields, too:
return new NonNullDefaultAwareTypeAnnotationWalker(this.typeAnnotations, newMatches, newPathPtr,
@@ -123,7 +123,7 @@ public class NonNullDefaultAwareTypeAnnotationWalker extends TypeAnnotationWalke
this.nextArrayContentIsNonNull = this.currentArrayContentIsNonNull;
}
}
-
+
@Override
public ITypeAnnotationWalker toSupertype(short index, char[] superTypeSignature) {
if (this.isEmpty) return restrict(this.matches, this.pathPtr);
@@ -143,7 +143,7 @@ public class NonNullDefaultAwareTypeAnnotationWalker extends TypeAnnotationWalke
if (this.isEmpty) return restrict(this.matches, this.pathPtr);
return super.toField();
}
-
+
@Override
public ITypeAnnotationWalker toMethodReturn() {
// don't set nextIsDefaultLocation, because signature-level nullness is handled by ImplicitNullAnnotationVerifier (triggered per invocation via MessageSend.resolveType() et al)
@@ -225,7 +225,7 @@ public class NonNullDefaultAwareTypeAnnotationWalker extends TypeAnnotationWalke
}
return normalAnnotations;
}
-
+
@Override
public ITypeAnnotationWalker toNextArrayDimension() {
boolean hasNNBDForArrayContents = (this.defaultNullness & Binding.DefaultLocationArrayContents) != 0;
@@ -255,12 +255,12 @@ public class NonNullDefaultAwareTypeAnnotationWalker extends TypeAnnotationWalke
} else {
if (walker instanceof TypeAnnotationWalker) {
TypeAnnotationWalker typeAnnotationWalker = (TypeAnnotationWalker) walker;
-
+
IBinaryAnnotation nonNullAnnotation2;
if (walker instanceof NonNullDefaultAwareTypeAnnotationWalker) {
NonNullDefaultAwareTypeAnnotationWalker nonNullDefaultAwareTypeAnnotationWalker = (NonNullDefaultAwareTypeAnnotationWalker) walker;
if(nonNullDefaultAwareTypeAnnotationWalker.isEmpty) {
- return new NonNullDefaultAwareTypeAnnotationWalker(defaultNullness, environment);
+ return new NonNullDefaultAwareTypeAnnotationWalker(defaultNullness, environment);
}
nonNullAnnotation2 = nonNullDefaultAwareTypeAnnotationWalker.nonNullAnnotation;
} else {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/TypeAnnotationInfo.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/TypeAnnotationInfo.java
index e0d84a176..ba20fb026 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/TypeAnnotationInfo.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/TypeAnnotationInfo.java
@@ -22,38 +22,38 @@ import org.eclipse.jdt.internal.compiler.env.IBinaryTypeAnnotation;
/**
* The TypeAnnotationInfo class does not currently support type annotations within code
- * blocks (those that have a target type of 0x40 and higher) - it is not yet clear that
+ * blocks (those that have a target type of 0x40 and higher) - it is not yet clear that
* these need to be accessible.
*/
public class TypeAnnotationInfo extends ClassFileStruct implements IBinaryTypeAnnotation {
private AnnotationInfo annotation;
-
+
private int targetType = 0;
-
+
// info is used in different ways:
// TargetType 0x00: CLASS_TYPE_PARAMETER: type parameter index
- // TargetType 0x01: METHOD_TYPE_PARAMETER: type parameter index
+ // TargetType 0x01: METHOD_TYPE_PARAMETER: type parameter index
// TargetType 0x10: CLASS_EXTENDS: supertype index (-1 = superclass, 0..N superinterface)
// TargetType 0x11: CLASS_TYPE_PARAMETER_BOUND: type parameter index
// TargetType 0x12: METHOD_TYPE_PARAMETER_BOUND: type parameter index
// TargetType 0x16: METHOD_FORMAL_PARAMETER: method formal parameter index
// TargetType 0x17: THROWS: throws type index
private int info;
-
+
// TargetType 0x11: CLASS_TYPE_PARAMETER_BOUND: bound index
// TargetType 0x12: METHOD_TYPE_PARAMETER_BOUND: bound index
private int info2;
-
+
private int[] typePath; // each pair of ints in the array is a type path entry
-
+
int readOffset = 0;
-
-
+
+
TypeAnnotationInfo(byte[] classFileBytes, int[] contantPoolOffsets, int offset) {
super(classFileBytes, contantPoolOffsets, offset);
}
-
+
TypeAnnotationInfo(byte[] classFileBytes, int[] contantPoolOffsets, int offset, boolean runtimeVisible, boolean populate) {
this(classFileBytes, contantPoolOffsets, offset);
this.readOffset = 0;
@@ -64,30 +64,30 @@ TypeAnnotationInfo(byte[] classFileBytes, int[] contantPoolOffsets, int offset,
this.info = u1At(1); // typeParameterIndex
this.readOffset += 2;
break;
-
+
case AnnotationTargetTypeConstants.CLASS_EXTENDS:
this.info = u2At(1); // supertypeIndex
this.readOffset += 3;
break;
-
+
case AnnotationTargetTypeConstants.CLASS_TYPE_PARAMETER_BOUND:
case AnnotationTargetTypeConstants.METHOD_TYPE_PARAMETER_BOUND:
this.info = u1At(1); // typeParameterIndex
this.info2 = u1At(2); // boundIndex;
this.readOffset += 3;
break;
-
+
case AnnotationTargetTypeConstants.FIELD:
case AnnotationTargetTypeConstants.METHOD_RETURN:
case AnnotationTargetTypeConstants.METHOD_RECEIVER:
this.readOffset ++;
break;
-
+
case AnnotationTargetTypeConstants.METHOD_FORMAL_PARAMETER :
this.info = u1At(1); // methodFormalParameterIndex
this.readOffset += 2;
break;
-
+
case AnnotationTargetTypeConstants.THROWS :
this.info = u2At(1); // throwsTypeIndex
this.readOffset += 3;
@@ -204,7 +204,7 @@ public boolean equals(Object obj) {
if (this.targetType != other.targetType) {
return false;
}
-
+
if (this.info != other.info) {
return false;
}
@@ -212,11 +212,11 @@ public boolean equals(Object obj) {
if (this.info2 != other.info2) {
return false;
}
-
+
if (!Arrays.equals(this.typePath, other.typePath)) {
return false;
}
-
+
return this.annotation.equals(other.annotation);
}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/TypeAnnotationWalker.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/TypeAnnotationWalker.java
index 28bfcd837..d5fd76993 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/TypeAnnotationWalker.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/TypeAnnotationWalker.java
@@ -46,7 +46,7 @@ public class TypeAnnotationWalker implements ITypeAnnotationWalker {
}
// ==== filter by top-level targetType: ====
-
+
@Override
public ITypeAnnotationWalker toField() {
return toTarget(AnnotationTargetTypeConstants.FIELD);
@@ -92,7 +92,7 @@ public class TypeAnnotationWalker implements ITypeAnnotationWalker {
newMatches &= ~mask;
}
}
- return restrict(newMatches, 0);
+ return restrict(newMatches, 0);
}
@Override
@@ -110,7 +110,7 @@ public class TypeAnnotationWalker implements ITypeAnnotationWalker {
newMatches &= ~mask;
}
}
- return restrict(newMatches, 0);
+ return restrict(newMatches, 0);
}
@Override
@@ -126,10 +126,10 @@ public class TypeAnnotationWalker implements ITypeAnnotationWalker {
newMatches &= ~mask;
}
}
- return restrict(newMatches, 0);
+ return restrict(newMatches, 0);
}
-
-
+
+
/**
* {@inheritDoc}
* <p>(superTypesSignature is ignored in this implementation).</p>
@@ -147,7 +147,7 @@ public class TypeAnnotationWalker implements ITypeAnnotationWalker {
newMatches &= ~mask;
}
}
- return restrict(newMatches, 0);
+ return restrict(newMatches, 0);
}
@Override
@@ -163,7 +163,7 @@ public class TypeAnnotationWalker implements ITypeAnnotationWalker {
newMatches &= ~mask;
}
}
- return restrict(newMatches, 0);
+ return restrict(newMatches, 0);
}
@Override
@@ -179,7 +179,7 @@ public class TypeAnnotationWalker implements ITypeAnnotationWalker {
newMatches &= ~mask;
}
}
- return restrict(newMatches, 0);
+ return restrict(newMatches, 0);
}
// ==== descending into details: ====
@@ -195,13 +195,13 @@ public class TypeAnnotationWalker implements ITypeAnnotationWalker {
for (int i = 0; i < length; i++, mask = mask << 1) {
IBinaryTypeAnnotation candidate = this.typeAnnotations[i];
int[] path = candidate.getTypePath();
- if (this.pathPtr >= path.length
+ if (this.pathPtr >= path.length
|| path[this.pathPtr] != AnnotationTargetTypeConstants.TYPE_ARGUMENT
|| path[this.pathPtr+1] != rank) {
newMatches &= ~mask;
}
}
- return restrict(newMatches, this.pathPtr+2);
+ return restrict(newMatches, this.pathPtr+2);
}
@Override
@@ -214,19 +214,19 @@ public class TypeAnnotationWalker implements ITypeAnnotationWalker {
for (int i = 0; i < length; i++, mask = mask << 1) {
IBinaryTypeAnnotation candidate = this.typeAnnotations[i];
int[] path = candidate.getTypePath();
- if (this.pathPtr >= path.length
+ if (this.pathPtr >= path.length
|| path[this.pathPtr] != AnnotationTargetTypeConstants.WILDCARD_BOUND) {
newMatches &= ~mask;
}
}
- return restrict(newMatches, this.pathPtr+2);
+ return restrict(newMatches, this.pathPtr+2);
}
@Override
public ITypeAnnotationWalker toNextArrayDimension() {
return toNextDetail(AnnotationTargetTypeConstants.NEXT_ARRAY_DIMENSION);
}
-
+
@Override
public ITypeAnnotationWalker toNextNestedType() {
return toNextDetail(AnnotationTargetTypeConstants.NEXT_NESTED_TYPE);
@@ -250,9 +250,9 @@ public class TypeAnnotationWalker implements ITypeAnnotationWalker {
}
return restrict(newMatches, this.pathPtr+2);
}
-
+
// ==== leaves: the actual annotations: ====
-
+
@Override
public IBinaryAnnotation[] getAnnotationsAtCursor(int currentTypeId, boolean mayApplyArrayContentsDefaultNullness) {
int length = this.typeAnnotations.length;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/AttributeNamesConstants.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/AttributeNamesConstants.java
index f936f904f..b069105dc 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/AttributeNamesConstants.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/AttributeNamesConstants.java
@@ -11,7 +11,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
* Jesper S Moller - Contributions for
- * Bug 405066 - [1.8][compiler][codegen] Implement code generation infrastructure for JSR335
+ * Bug 405066 - [1.8][compiler][codegen] Implement code generation infrastructure for JSR335
* Bug 406973 - [compiler] Parse MethodParameters attribute
* Andy Clement - Contributions for
* Bug 383624 - [1.8][compiler] Revive code generation support for type annotations (from Olivier's work)
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java
index 320ed7aa3..5be578078 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java
@@ -17,7 +17,7 @@
* bug 391376 - [1.8] check interaction of default methods with bridge methods and generics
* bug 421543 - [1.8][compiler] Compiler fails to recognize default method being turned into abstract by subtytpe
* Jesper S Moller - Contributions for
- * Bug 405066 - [1.8][compiler][codegen] Implement code generation infrastructure for JSR335
+ * Bug 405066 - [1.8][compiler][codegen] Implement code generation infrastructure for JSR335
* Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
* Bug 383624 - [1.8][compiler] Revive code generation support for type annotations (from Olivier's work)
* Bug 409247 - [1.8][compiler] Verify error with code allocating multidimensional array
@@ -152,12 +152,12 @@ public class CodeStream {
protected long targetLevel;
public LocalVariableBinding[] visibleLocals = new LocalVariableBinding[LOCALS_INCREMENT];
-
+
int visibleLocalsCount;
-
+
// to handle goto_w
- public boolean wideMode = false;
-
+ public boolean wideMode = false;
+
public CodeStream(ClassFile givenClassFile) {
this.targetLevel = givenClassFile.targetJDK;
this.generateAttributes = givenClassFile.produceAttributes;
@@ -2155,7 +2155,7 @@ public void generateImplicitConversion(int implicitConversionCode) {
int runtimeType = (implicitConversionCode & TypeIds.IMPLICIT_CONVERSION_MASK) >> 4;
checkcast(runtimeType);
generateUnboxingConversion(runtimeType);
- break;
+ break;
}
if ((implicitConversionCode & TypeIds.BOXING) != 0) {
// need to unbox/box the constant
@@ -2546,10 +2546,10 @@ public void generateSyntheticBodyForFactoryMethod(SyntheticMethodBinding methodB
MethodBinding constructorBinding = methodBinding.targetMethod;
TypeBinding[] parameters = methodBinding.parameters;
int length = parameters.length;
-
+
new_(constructorBinding.declaringClass);
dup();
-
+
int resolvedPosition = 0;
for (int i = 0; i < length; i++) {
TypeBinding parameter;
@@ -2566,7 +2566,7 @@ public void generateSyntheticBodyForFactoryMethod(SyntheticMethodBinding methodB
}
for (int i = 0; i < methodBinding.fakePaddedParameters; i++)
aconst_null();
-
+
invoke(Opcodes.OPC_invokespecial, constructorBinding, null /* default declaringClass */);
areturn();
}
@@ -2594,7 +2594,7 @@ public void generateSyntheticBodyForEnumValueOf(SyntheticMethodBinding methodBin
public void generateSyntheticBodyForDeserializeLambda(SyntheticMethodBinding methodBinding,SyntheticMethodBinding[] syntheticMethodBindings) {
initializeMaxLocals(methodBinding);
- // Compute a map of hashcodes to a list of synthetic methods whose names share a hashcode
+ // Compute a map of hashcodes to a list of synthetic methods whose names share a hashcode
Map hashcodesTosynthetics = new LinkedHashMap();
for (int i=0,max=syntheticMethodBindings.length;i<max;i++) {
SyntheticMethodBinding syntheticMethodBinding = syntheticMethodBindings[i];
@@ -2611,7 +2611,7 @@ public void generateSyntheticBodyForDeserializeLambda(SyntheticMethodBinding met
}
}
ClassScope scope = ((SourceTypeBinding)methodBinding.declaringClass).scope;
-
+
// Generate the first switch, on method name hashcode
aload_0();
invoke(Opcodes.OPC_invokevirtual, 1, 1, ConstantPool.JavaLangInvokeSerializedLambdaConstantPoolName, ConstantPool.GetImplMethodName, ConstantPool.GetImplMethodNameSignature);
@@ -2626,7 +2626,7 @@ public void generateSyntheticBodyForDeserializeLambda(SyntheticMethodBinding met
addVariable(lvb2);
aload_1();
invokeStringHashCode();
-
+
BranchLabel label = new BranchLabel(this);
CaseLabel defaultLabel = new CaseLabel(this);
int numberOfHashcodes = hashcodesTosynthetics.size();
@@ -2648,7 +2648,7 @@ public void generateSyntheticBodyForDeserializeLambda(SyntheticMethodBinding met
sort(localKeysCopy, 0, numberOfHashcodes-1, sortedIndexes);
// TODO need to use a tableswitch at some size threshold?
lookupswitch(defaultLabel, keys, sortedIndexes, switchLabels);
- // TODO cope with multiple names that share the same hashcode
+ // TODO cope with multiple names that share the same hashcode
hashcodeIterator = hashcodes.iterator();
index = 0;
while (hashcodeIterator.hasNext()) {
@@ -2837,7 +2837,7 @@ public void generateSyntheticBodyForDeserializeLambda(SyntheticMethodBinding met
}
}
}
-
+
removeVariable(lvb1);
removeVariable(lvb2);
defaultLabel.place();
@@ -2845,7 +2845,7 @@ public void generateSyntheticBodyForDeserializeLambda(SyntheticMethodBinding met
// Code: throw new IllegalArgumentException("Invalid lambda deserialization")
new_(scope.getJavaLangIllegalArgumentException());
dup();
- ldc("Invalid lambda deserialization"); //$NON-NLS-1$ // TODO into a constant?
+ ldc("Invalid lambda deserialization"); //$NON-NLS-1$ // TODO into a constant?
// invokespecial: java.lang.IllegalArgumentException.<init>(Ljava/lang/String;)V
invoke(
Opcodes.OPC_invokespecial,
@@ -2935,8 +2935,8 @@ public void generateSyntheticBodyForFieldReadAccess(SyntheticMethodBinding acces
initializeMaxLocals(accessMethod);
FieldBinding fieldBinding = accessMethod.targetReadField;
// target method declaring class may not be accessible (247953);
- TypeBinding declaringClass = accessMethod.purpose == SyntheticMethodBinding.SuperFieldReadAccess
- ? accessMethod.declaringClass.superclass()
+ TypeBinding declaringClass = accessMethod.purpose == SyntheticMethodBinding.SuperFieldReadAccess
+ ? accessMethod.declaringClass.superclass()
: accessMethod.declaringClass;
//{ObjectTeams: role field?
if (accessMethod instanceof SyntheticRoleFieldAccess) {
@@ -2944,7 +2944,7 @@ public void generateSyntheticBodyForFieldReadAccess(SyntheticMethodBinding acces
} else
// SH}
if (fieldBinding.isStatic()) {
- fieldAccess(Opcodes.OPC_getstatic, fieldBinding, declaringClass);
+ fieldAccess(Opcodes.OPC_getstatic, fieldBinding, declaringClass);
} else {
aload_0();
fieldAccess(Opcodes.OPC_getfield, fieldBinding, declaringClass);
@@ -2978,9 +2978,9 @@ public void generateSyntheticBodyForFieldWriteAccess(SyntheticMethodBinding acce
initializeMaxLocals(accessMethod);
FieldBinding fieldBinding = accessMethod.targetWriteField;
// target method declaring class may not be accessible (247953);
- TypeBinding declaringClass = accessMethod.purpose == SyntheticMethodBinding.SuperFieldWriteAccess
- ? accessMethod.declaringClass.superclass()
- : accessMethod.declaringClass;
+ TypeBinding declaringClass = accessMethod.purpose == SyntheticMethodBinding.SuperFieldWriteAccess
+ ? accessMethod.declaringClass.superclass()
+ : accessMethod.declaringClass;
//{ObjectTeams: role field?
if (accessMethod instanceof SyntheticRoleFieldAccess) {
((SyntheticRoleFieldAccess)accessMethod).generateBodyForWrite(fieldBinding, this);
@@ -3053,7 +3053,7 @@ public void generateSyntheticBodyForMethodAccess(SyntheticMethodBinding accessMe
// qualified super "X.super.foo()" targets methods from superclass
|| accessMethod.purpose == SyntheticMethodBinding.SuperMethodAccess){
// target method declaring class may not be accessible (247953);
- TypeBinding declaringClass = accessMethod.purpose == SyntheticMethodBinding.SuperMethodAccess
+ TypeBinding declaringClass = accessMethod.purpose == SyntheticMethodBinding.SuperMethodAccess
? findDirectSuperTypeTowards(accessMethod, targetMethod)
: accessMethod.declaringClass;
//{ObjectTeams: private methods also occur in role interfaces:
@@ -3108,7 +3108,7 @@ ReferenceBinding findDirectSuperTypeTowards(SyntheticMethodBinding accessMethod,
ReferenceBinding currentType = accessMethod.declaringClass;
ReferenceBinding superclass = currentType.superclass();
if (targetMethod.isDefaultMethod()) {
- // could be inherited via superclass *or* a super interface
+ // could be inherited via superclass *or* a super interface
ReferenceBinding targetType = targetMethod.declaringClass;
if (superclass.isCompatibleWith(targetType))
return superclass;
@@ -3218,11 +3218,11 @@ public void generateSyntheticEnclosingInstanceValues(BlockScope currentScope, Re
//compliance >= JDK1_7
if (invocationSite instanceof AllocationExpression) {
denyEnclosingArgInConstructorCall = !targetType.isLocalType();
- } else if (invocationSite instanceof ExplicitConstructorCall &&
+ } else if (invocationSite instanceof ExplicitConstructorCall &&
((ExplicitConstructorCall)invocationSite).isSuperAccess()) {
MethodScope enclosingMethodScope = currentScope.enclosingMethodScope();
denyEnclosingArgInConstructorCall = !targetType.isLocalType() && enclosingMethodScope != null
- && enclosingMethodScope.isConstructorCall;
+ && enclosingMethodScope.isConstructorCall;
} else {
denyEnclosingArgInConstructorCall = false;
}
@@ -3535,7 +3535,7 @@ public static TypeBinding getConstantPoolDeclaringClass(Scope currentScope, Fiel
return actualReceiverType.erasure();
}
- }
+ }
return constantPoolDeclaringClass;
}
@@ -3563,7 +3563,7 @@ public static TypeBinding getConstantPoolDeclaringClass(Scope currentScope, Meth
// and not from Object or implicit static method call.
if (TypeBinding.notEquals(constantPoolDeclaringClass, actualReceiverType.erasure()) && !actualReceiverType.isArrayType()) {
CompilerOptions options = currentScope.compilerOptions();
-
+
if ((options.targetJDK >= ClassFileConstants.JDK1_2
&& (options.complianceLevel >= ClassFileConstants.JDK1_4 || !(isImplicitThisReceiver && codegenBinding.isStatic()))
&& codegenBinding.declaringClass.id != TypeIds.T_JavaLangObject) // no change for Object methods
@@ -3584,7 +3584,7 @@ public static TypeBinding getConstantPoolDeclaringClass(Scope currentScope, Meth
constantPoolDeclaringClass = erasedReceiverType;
}
}
- }
+ }
}
return constantPoolDeclaringClass;
}
@@ -4357,7 +4357,7 @@ public void initializeMaxLocals(MethodBinding methodBinding) {
case TypeIds.T_double :
this.maxLocals += 2;
break;
- default:
+ default:
this.maxLocals++;
}
}
@@ -4424,7 +4424,7 @@ protected void invoke(byte opcode, int receiverAndArgsSize, int returnTypeSize,
// Hence adding explicit parameter 'isInterface', which is needed only for non-ctor invokespecial invocations
// (i.e., other clients may still call the shorter overload).
private void invoke18(byte opcode, int receiverAndArgsSize, int returnTypeSize, char[] declaringClass,
- boolean isInterface, char[] selector, char[] signature) {
+ boolean isInterface, char[] selector, char[] signature) {
this.countLabels = 0;
if (opcode == Opcodes.OPC_invokeinterface) {
// invokeinterface
@@ -4521,10 +4521,10 @@ public void invoke(byte opcode, MethodBinding methodBinding, TypeBinding declari
case TypeIds.T_long :
receiverAndArgsSize += 2;
break;
- default:
+ default:
receiverAndArgsSize++;
break;
- }
+ }
}
}
}
@@ -4532,7 +4532,7 @@ public void invoke(byte opcode, MethodBinding methodBinding, TypeBinding declari
// adding String (name) and int (ordinal)
receiverAndArgsSize += 2;
}
- }
+ }
break;
default :
return; // should not occur
@@ -4564,12 +4564,12 @@ public void invoke(byte opcode, MethodBinding methodBinding, TypeBinding declari
break;
}
invoke18(
- opcode,
- receiverAndArgsSize,
- returnTypeSize,
- declaringClass.constantPoolName(),
+ opcode,
+ receiverAndArgsSize,
+ returnTypeSize,
+ declaringClass.constantPoolName(),
declaringClass.isInterface(),
- methodBinding.selector,
+ methodBinding.selector,
methodBinding.signature(this.classFile));
//{ObjectTeams: if signature is weakened to conform to tsuper erasure, we need a cast to make the result compatible to the expected type
if ((methodBinding.otBits & IOTConstants.IsCopyOfParameterized) != 0 &&
@@ -4577,7 +4577,7 @@ public void invoke(byte opcode, MethodBinding methodBinding, TypeBinding declari
checkcast(methodBinding.returnType.erasure());
// SH}
}
-//{ObjectTeams: misguided callout-to-field accessor??
+//{ObjectTeams: misguided callout-to-field accessor??
private byte checkInvokeCalloutToField(byte opcode, SyntheticMethodBinding accessor) {
if ( ( accessor.purpose == SyntheticMethodBinding.FieldReadAccess
|| accessor.purpose == SyntheticMethodBinding.FieldWriteAccess)
@@ -4705,8 +4705,8 @@ public void invokeIterableIterator(TypeBinding iterableReceiverType) {
iterableReceiverType.isInterface() ? Opcodes.OPC_invokeinterface : Opcodes.OPC_invokevirtual,
1, // receiverAndArgsSize
1, // returnTypeSize
- iterableReceiverType.constantPoolName(),
- ConstantPool.ITERATOR_NAME,
+ iterableReceiverType.constantPoolName(),
+ ConstantPool.ITERATOR_NAME,
ConstantPool.ITERATOR_SIGNATURE);
}
@@ -4719,8 +4719,8 @@ public void invokeAutoCloseableClose(TypeBinding resourceType) {
resourceType.erasure().isInterface() ? Opcodes.OPC_invokeinterface : Opcodes.OPC_invokevirtual,
1, // receiverAndArgsSize
0, // returnTypeSize
- resourceType.constantPoolName(),
- ConstantPool.Close,
+ resourceType.constantPoolName(),
+ ConstantPool.Close,
ConstantPool.CloseSignature);
}
@@ -4729,7 +4729,7 @@ public void invokeThrowableAddSuppressed() {
2, // receiverAndArgsSize
0, // returnTypeSize
ConstantPool.JavaLangThrowableConstantPoolName,
- ConstantPool.AddSuppressed,
+ ConstantPool.AddSuppressed,
ConstantPool.AddSuppressedSignature);
}
@@ -4828,11 +4828,11 @@ public void invokeJavaLangEnumValues(TypeBinding enumBinding, ArrayBinding array
char[] signature = "()".toCharArray(); //$NON-NLS-1$
signature = CharOperation.concat(signature, arrayBinding.constantPoolName());
invoke(
- Opcodes.OPC_invokestatic,
+ Opcodes.OPC_invokestatic,
0, // receiverAndArgsSize
1, // return type size
- enumBinding.constantPoolName(),
- TypeConstants.VALUES,
+ enumBinding.constantPoolName(),
+ TypeConstants.VALUES,
signature);
}
@@ -5183,7 +5183,7 @@ public void invokeStringConcatenationToString() {
} else {
// invokespecial: java.lang.StringStringBuilder.<init>(java.langString)V
declaringClass = ConstantPool.JavaLangStringBuilderConstantPoolName;
- }
+ }
invoke(
Opcodes.OPC_invokevirtual,
1, // receiverAndArgsSize
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java
index d9e13de80..31414517b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java
@@ -11,7 +11,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
* Jesper S Moller - Contributions for
- * Bug 405066 - [1.8][compiler][codegen] Implement code generation infrastructure for JSR335
+ * Bug 405066 - [1.8][compiler][codegen] Implement code generation infrastructure for JSR335
* Bug 406982 - [1.8][compiler] Generation of MethodParameters Attribute in classfile
* Bug 416885 - [1.8][compiler]IncompatibleClassChange error (edit)
* Bug 412153 - [1.8][compiler] Check validity of annotations which may be repeatable
@@ -275,7 +275,7 @@ public class ConstantPool implements ClassFileConstants, TypeIds {
public static final char[] METAFACTORY = "metafactory".toCharArray(); //$NON-NLS-1$
public static final char[] JAVA_LANG_INVOKE_LAMBDAMETAFACTORY_METAFACTORY_SIGNATURE = "(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;".toCharArray(); //$NON-NLS-1$
public static final char[] ALTMETAFACTORY = "altMetafactory".toCharArray(); //$NON-NLS-1$
- public static final char[] JAVA_LANG_INVOKE_LAMBDAMETAFACTORY_ALTMETAFACTORY_SIGNATURE =
+ public static final char[] JAVA_LANG_INVOKE_LAMBDAMETAFACTORY_ALTMETAFACTORY_SIGNATURE =
"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;".toCharArray(); //$NON-NLS-1$
public static final char[] JavaLangInvokeSerializedLambda = "Ljava/lang/invoke/SerializedLambda;".toCharArray(); //$NON-NLS-1$
public static final char[] JavaLangInvokeSerializedLambdaConstantPoolName = "java/lang/invoke/SerializedLambda".toCharArray(); //$NON-NLS-1$
@@ -299,16 +299,16 @@ public class ConstantPool implements ClassFileConstants, TypeIds {
public static final char[] JAVA_LANG_ANNOTATION_REPEATABLE = "Ljava/lang/annotation/Repeatable;".toCharArray(); //$NON-NLS-1$
public static final char[] HashCode = "hashCode".toCharArray(); //$NON-NLS-1$
- public static final char[] HashCodeSignature = "()I".toCharArray(); //$NON-NLS-1$;
+ public static final char[] HashCodeSignature = "()I".toCharArray(); //$NON-NLS-1$;
public static final char[] Equals = "equals".toCharArray(); //$NON-NLS-1$
- public static final char[] EqualsSignature = "(Ljava/lang/Object;)Z".toCharArray(); //$NON-NLS-1$;
+ public static final char[] EqualsSignature = "(Ljava/lang/Object;)Z".toCharArray(); //$NON-NLS-1$;
public static final char[] AddSuppressed = "addSuppressed".toCharArray(); //$NON-NLS-1$;
public static final char[] AddSuppressedSignature = "(Ljava/lang/Throwable;)V".toCharArray(); //$NON-NLS-1$
public static final char[] Clone = "clone".toCharArray(); //$NON-NLS-1$
public static final char[] CloneSignature = "()Ljava/lang/Object;".toCharArray(); //$NON-NLS-1$
public static final char[] BOOTSTRAP = "bootstrap".toCharArray(); //$NON-NLS-1$
public static final char[] JAVA_LANG_RUNTIME_OBJECTMETHOD_BOOTSTRAP_SIGNATURE = "(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;".toCharArray(); //$NON-NLS-1$
-
+
/**
* ConstantPool constructor comment.
*/
@@ -861,10 +861,10 @@ public class ConstantPool implements ClassFileConstants, TypeIds {
: binding.isStatic() ? MethodHandleRefKindInvokeStatic
: binding.isPrivate() ? MethodHandleRefKindInvokeSpecial
: MethodHandleRefKindInvokeVirtual;
-
+
return literalIndexForMethodHandle(referenceKind, binding.declaringClass, binding.selector, binding.signature(), isInterface);
}
-
+
public int literalIndexForMethodHandle(int referenceKind, TypeBinding declaringClass, char[] selector, char[] signature, boolean isInterface) {
int indexForMethod = literalIndexForMethod(declaringClass, selector, signature, isInterface);
@@ -874,7 +874,7 @@ public class ConstantPool implements ClassFileConstants, TypeIds {
// resize
System.arraycopy(this.offsets, 0, (this.offsets = new int[index * 2]), 0, length);
}
-
+
this.offsets[index] = this.currentOffset;
writeU1(MethodHandleTag);
writeU1(referenceKind);
@@ -892,7 +892,7 @@ public class ConstantPool implements ClassFileConstants, TypeIds {
// resize
System.arraycopy(this.offsets, 0, (this.offsets = new int[index * 2]), 0, length);
}
-
+
this.offsets[index] = this.currentOffset;
writeU1(MethodHandleTag);
writeU1(referenceKind);
@@ -904,7 +904,7 @@ public class ConstantPool implements ClassFileConstants, TypeIds {
int signatureIndex = literalIndex(descriptor);
int index = this.currentIndex++;
-
+
int length = this.offsets.length;
if (length <= index) {
// resize
@@ -1123,7 +1123,7 @@ public class ConstantPool implements ClassFileConstants, TypeIds {
}
return index;
}
-
+
/**
* @param bootstrapIndex the given bootstrap index
* @param selector the given method selector
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/MultiCatchExceptionLabel.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/MultiCatchExceptionLabel.java
index 8911f8794..b70c44d65 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/MultiCatchExceptionLabel.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/MultiCatchExceptionLabel.java
@@ -29,7 +29,7 @@ public class MultiCatchExceptionLabel extends ExceptionLabel {
public MultiCatchExceptionLabel(CodeStream codeStream, TypeBinding exceptionType) {
super(codeStream, exceptionType);
}
-
+
public void initialize(UnionTypeReference typeReference, Annotation [] annotations) {
TypeReference[] typeReferences = typeReference.typeReferences;
int length = typeReferences.length;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/Opcodes.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/Opcodes.java
index dfe0f0834..e509d670a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/Opcodes.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/Opcodes.java
@@ -10,9 +10,9 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
* Jesper S Moller - Contributions for
- * Bug 405066 - [1.8][compiler][codegen] Implement code generation infrastructure for JSR335
+ * Bug 405066 - [1.8][compiler][codegen] Implement code generation infrastructure for JSR335
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.codegen;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream.java
index 3e44c49bf..0a4337b7f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream.java
@@ -213,7 +213,7 @@ public class StackMapFrameCodeStream extends CodeStream {
/*
* Macro for building a class descriptor object... using or not a field cache to store it into... this
* sequence is responsible for building the actual class descriptor.
- *
+ *
* If the fieldCache is set, then it is supposed to be the body of a synthetic access method factoring the
* actual descriptor creation out of the invocation site (saving space). If the fieldCache is nil, then we
* are dumping the bytecode on the invocation site, since we have no way to get a hand on the field cache to
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/TypeAnnotationCodeStream.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/TypeAnnotationCodeStream.java
index 8f6085ada..32aad53c1 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/TypeAnnotationCodeStream.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/TypeAnnotationCodeStream.java
@@ -38,11 +38,11 @@ public class TypeAnnotationCodeStream extends StackMapFrameCodeStream {
this.generateAttributes |= ClassFileConstants.ATTR_TYPE_ANNOTATION;
this.allTypeAnnotationContexts = new ArrayList();
}
-
+
private void addAnnotationContext(TypeReference typeReference, int info, int targetType, ArrayAllocationExpression allocationExpression) {
allocationExpression.getAllAnnotationContexts(targetType, info, this.allTypeAnnotationContexts);
}
-
+
private void addAnnotationContext(TypeReference typeReference, int info, int targetType) {
typeReference.getAllAnnotationContexts(targetType, info, this.allTypeAnnotationContexts);
}
@@ -50,7 +50,7 @@ public class TypeAnnotationCodeStream extends StackMapFrameCodeStream {
private void addAnnotationContext(TypeReference typeReference, int info, int typeIndex, int targetType) {
typeReference.getAllAnnotationContexts(targetType, info, typeIndex, this.allTypeAnnotationContexts);
}
-
+
@Override
public void instance_of(TypeReference typeReference, TypeBinding typeBinding) {
if (typeReference != null && (typeReference.bits & ASTNode.HasTypeAnnotations) != 0) {
@@ -58,7 +58,7 @@ public class TypeAnnotationCodeStream extends StackMapFrameCodeStream {
}
super.instance_of(typeReference, typeBinding);
}
-
+
@Override
public void multianewarray(
TypeReference typeReference,
@@ -78,7 +78,7 @@ public class TypeAnnotationCodeStream extends StackMapFrameCodeStream {
}
super.new_(typeReference, typeBinding);
}
-
+
@Override
public void newArray(TypeReference typeReference, ArrayAllocationExpression allocationExpression, ArrayBinding arrayBinding) {
if (typeReference != null && (typeReference.bits & ASTNode.HasTypeAnnotations) != 0) {
@@ -86,7 +86,7 @@ public class TypeAnnotationCodeStream extends StackMapFrameCodeStream {
}
super.newArray(typeReference, allocationExpression, arrayBinding);
}
-
+
@Override
public void checkcast(TypeReference typeReference, TypeBinding typeBinding, int currentPosition) {
/* We use a slightly sub-optimal generation for intersection casts by resorting to a runtime cast for every intersecting type, but in
@@ -115,7 +115,7 @@ public class TypeAnnotationCodeStream extends StackMapFrameCodeStream {
super.checkcast(null, typeBinding, currentPosition);
}
}
-
+
@Override
public void invoke(byte opcode, MethodBinding methodBinding, TypeBinding declaringClass, TypeReference[] typeArguments) {
if (typeArguments != null) {
@@ -131,9 +131,9 @@ public class TypeAnnotationCodeStream extends StackMapFrameCodeStream {
}
super.invoke(opcode, methodBinding, declaringClass, typeArguments);
}
-
+
@Override
- public void invokeDynamic(int bootStrapIndex, int argsSize, int returnTypeSize, char[] selector, char[] signature,
+ public void invokeDynamic(int bootStrapIndex, int argsSize, int returnTypeSize, char[] selector, char[] signature,
boolean isConstructorReference, TypeReference lhsTypeReference, TypeReference [] typeArguments) {
if (lhsTypeReference != null && (lhsTypeReference.bits & ASTNode.HasTypeAnnotations) != 0) {
if (isConstructorReference) {
@@ -143,7 +143,7 @@ public class TypeAnnotationCodeStream extends StackMapFrameCodeStream {
}
}
if (typeArguments != null) {
- int targetType =
+ int targetType =
isConstructorReference
? AnnotationTargetTypeConstants.CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT
: AnnotationTargetTypeConstants.METHOD_REFERENCE_TYPE_ARGUMENT;
@@ -162,7 +162,7 @@ public class TypeAnnotationCodeStream extends StackMapFrameCodeStream {
super.reset(givenClassFile);
this.allTypeAnnotationContexts = new ArrayList();
}
-
+
@Override
public void init(ClassFile targetClassFile) {
super.init(targetClassFile);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/VerificationTypeInfo.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/VerificationTypeInfo.java
index 7f3be5a78..c2e2244d2 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/VerificationTypeInfo.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/VerificationTypeInfo.java
@@ -25,55 +25,55 @@ import org.eclipse.jdt.internal.compiler.lookup.TypeIds;
public class VerificationTypeInfo {
/**
* The tag value representing top variable info
- *
+ *
* @since 3.2
*/
public static final int ITEM_TOP = 0;
/**
* The tag value representing integer variable info
- *
+ *
* @since 3.2
*/
public static final int ITEM_INTEGER = 1;
/**
* The tag value representing float variable info
- *
+ *
* @since 3.2
*/
public static final int ITEM_FLOAT = 2;
/**
* The tag value representing double variable info
- *
+ *
* @since 3.2
*/
public static final int ITEM_DOUBLE = 3;
/**
* The tag value representing long variable info
- *
+ *
* @since 3.2
*/
public static final int ITEM_LONG = 4;
/**
* The tag value representing null variable info
- *
+ *
* @since 3.2
*/
public static final int ITEM_NULL = 5;
/**
* The tag value representing uninitialized this variable info
- *
+ *
* @since 3.2
*/
public static final int ITEM_UNINITIALIZED_THIS = 6;
/**
* The tag value representing object variable info
- *
+ *
* @since 3.2
*/
public static final int ITEM_OBJECT = 7;
/**
* The tag value representing uninitialized variable info
- *
+ *
* @since 3.2
*/
public static final int ITEM_UNINITIALIZED = 8;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/AutomaticModuleNaming.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/AutomaticModuleNaming.java
index 815bc96c2..3a624edcb 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/AutomaticModuleNaming.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/AutomaticModuleNaming.java
@@ -84,7 +84,7 @@ public class AutomaticModuleNaming {
* Determine the automatic module name if no "Automatic-Module-Name" was found in the Manifest, as specified in
* {@link <a href=
* "http://download.java.net/java/jdk9/docs/api/java/lang/module/ModuleFinder.html#of-java.nio.file.Path...-">ModuleFinder.of</a>}
- *
+ *
* @param name
* the filename (or directory name)
* @param skipDirectory
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IBinaryType.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IBinaryType.java
index 9c2dd6707..0fb5989e3 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IBinaryType.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IBinaryType.java
@@ -182,7 +182,7 @@ ExternalAnnotationStatus getExternalAnnotationStatus();
* Answers the "real" binary type for the given binary type.
* By default this is an identity transformation.
* Only IndexBinaryType will retrieve the bytes from disk to answer a fresh ClassFileReader.
- * @throws Exception
+ * @throws Exception
*/
default IBinaryType withClassBytes() throws Exception {
return this;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IBinaryTypeAnnotation.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IBinaryTypeAnnotation.java
index 2038cbc8e..1910b7555 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IBinaryTypeAnnotation.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IBinaryTypeAnnotation.java
@@ -20,7 +20,7 @@ import org.eclipse.jdt.internal.compiler.codegen.AnnotationTargetTypeConstants;
* This represents class file information about an annotation instance.
*/
public interface IBinaryTypeAnnotation {
-
+
static int[] NO_TYPE_PATH = new int[0];
/**
@@ -34,42 +34,42 @@ IBinaryAnnotation getAnnotation();
int getTargetType();
/**
- *
+ *
* @return the raw type path data, each pair of ints is a type path entry
*/
int[] getTypePath();
/**
* Applicable for target type 0x10(CLASS_EXTENDS)
- *
+ *
* @return the supertype index. -1 (65535) for superclass, 0..n for superinterfaces
*/
int getSupertypeIndex();
/**
* Applicable for target type 0x00(CLASS_TYPE_PARAMETER), 0x01(METHOD_TYPE_PARAMETER)
- *
+ *
* @return the type parameter index (0 based)
*/
int getTypeParameterIndex();
/**
* Applicable for target type 0x11(CLASS_TYPE_PARAMETER_BOUND), 0x12(METHOD_TYPE_PARAMETER_BOUND)
- *
+ *
* @return the bound index
*/
int getBoundIndex();
/**
* Applicable for target type 0x16(METHOD_FORMAL_PARAMETER)
- *
+ *
* @return the method formal parameter index
*/
int getMethodFormalParameterIndex();
/**
* Applicable for target type 0x17(THROWS)
- *
+ *
* @return the throws type index
*/
int getThrowsTypeIndex();
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/ICompilationUnit.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/ICompilationUnit.java
index a27574e55..24bd52d73 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/ICompilationUnit.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/ICompilationUnit.java
@@ -18,7 +18,7 @@ import org.eclipse.jdt.internal.compiler.lookup.ModuleBinding;
/**
* This interface denotes a compilation unit, providing its name and content.
- *
+ *
* <p>
* Note: This internal interface has been implemented illegally by the
* org.apache.jasper.glassfish bundle from Orbit, see
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IModule.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IModule.java
index bd417f0f5..11998aa7c 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IModule.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IModule.java
@@ -70,7 +70,7 @@ public interface IModule {
public char[] name();
char[][] with();
}
-
+
public default boolean isAutomatic() {
return false;
}
@@ -92,32 +92,32 @@ public interface IModule {
public char[] name() {
return this.name;
}
-
+
@Override
public IModuleReference[] requires() {
return IModule.NO_MODULE_REFS;
}
-
+
@Override
public IPackageExport[] exports() {
return IModule.NO_EXPORTS;
}
-
+
@Override
public char[][] uses() {
return IModule.NO_USES;
}
-
+
@Override
public IService[] provides() {
return IModule.NO_PROVIDES;
}
-
+
@Override
public IPackageExport[] opens() {
return NO_OPENS;
}
-
+
@Override
public boolean isAutomatic() {
return true;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IModuleAwareNameEnvironment.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IModuleAwareNameEnvironment.java
index 539caaba7..cbc554ee0 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IModuleAwareNameEnvironment.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IModuleAwareNameEnvironment.java
@@ -72,7 +72,7 @@ public interface IModuleAwareNameEnvironment extends INameEnvironment {
public <T> boolean matches(T elem, Predicate<T> isNamed) {
return matchesWithName(elem, isNamed, t -> true);
}
-
+
/** Get the lookup strategy corresponding to the given module name. */
public static LookupStrategy get(char[] moduleName) {
if (moduleName == ModuleBinding.ANY)
@@ -91,7 +91,7 @@ public interface IModuleAwareNameEnvironment extends INameEnvironment {
}
}
}
-
+
@Override
default NameEnvironmentAnswer findType(char[][] compoundTypeName) {
return findType(compoundTypeName, ModuleBinding.ANY);
@@ -121,7 +121,7 @@ public interface IModuleAwareNameEnvironment extends INameEnvironment {
return allNames;
}
-
+
/**
* Answer whether the given package (within the given module) contains any compilation unit.
* @param qualifiedPackageName
@@ -129,7 +129,7 @@ public interface IModuleAwareNameEnvironment extends INameEnvironment {
* @return true iff the package contains at least one compilation unit.
*/
boolean hasCompilationUnit(char[][] qualifiedPackageName, char[] moduleName, boolean checkCUs);
-
+
/** Get the module with the given name, which must denote a named module. */
IModule getModule(char[] moduleName);
char[][] getAllAutomaticModules();
@@ -142,7 +142,7 @@ public interface IModuleAwareNameEnvironment extends INameEnvironment {
default void applyModuleUpdates(IUpdatableModule module, IUpdatableModule.UpdateKind kind) { /* default: do nothing */ }
/**
- * Lists all packages in the module identified by the given, real module name
+ * Lists all packages in the module identified by the given, real module name
* (i.e., this method is implemented only for {@link LookupStrategy#Named}).
* @param moduleName
* @return array of flat, dot-separated package names
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IModulePathEntry.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IModulePathEntry.java
index 86f24f73a..e5eb40c0d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IModulePathEntry.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IModulePathEntry.java
@@ -25,18 +25,18 @@ public interface IModulePathEntry {
/**
* Get the module that this entry contributes. May be null, for instance when this entry does not
* represent a single module
- *
+ *
* @return The module that this entry contributes or null
*/
default IModule getModule() {
return null;
}
-
+
/**
* Get the module named name from this entry. May be null
- *
+ *
* @param name - The name of the module to look up
- *
+ *
* @return The module named name or null
*/
default IModule getModule(char[] name) {
@@ -48,9 +48,9 @@ public interface IModulePathEntry {
/**
* Indicates whether this entry knows the module named name and can answer queries regarding the module
- *
+ *
* @param name The name of the module
- *
+ *
* @return True if this entry knows the module, false otherwise
*/
default boolean servesModule(char[] name) {
@@ -84,7 +84,7 @@ public interface IModulePathEntry {
/**
* Specifies whether this entry represents an automatic module.
- *
+ *
* @return true if this is an automatic module, false otherwise
*/
public default boolean isAutomaticModule() {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IMultiModuleEntry.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IMultiModuleEntry.java
index 1d48ff940..ca0b105f6 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IMultiModuleEntry.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IMultiModuleEntry.java
@@ -23,7 +23,7 @@ import java.util.Collection;
public interface IMultiModuleEntry extends IModulePathEntry {
/**
- * Get the module named name that this entry contributes to the module path
+ * Get the module named name that this entry contributes to the module path
*/
@Override
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/INameEnvironmentExtension.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/INameEnvironmentExtension.java
index 5fd197078..986fc82d8 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/INameEnvironmentExtension.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/INameEnvironmentExtension.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
*******************************************************************************/
@@ -18,10 +18,10 @@ package org.eclipse.jdt.internal.compiler.env;
* can use to look up types, compilation units, and packages in the
* current environment. The name environment is passed to the compiler
* on creation.
- *
+ *
* This name environment adds a method to switch on/off the search for secondary types.
* Refer {@link #findType(char[], char[][], boolean)}.
- *
+ *
*/
public interface INameEnvironmentExtension extends INameEnvironment {
/**
@@ -48,7 +48,7 @@ public interface INameEnvironmentExtension extends INameEnvironment {
* @return {@link NameEnvironmentAnswer}
*/
NameEnvironmentAnswer findType(char[] typeName, char[][] packageName, boolean searchWithSecondaryTypes, char[] moduleName);
-
+
default NameEnvironmentAnswer findType(char[] typeName, char[][] packageName, boolean searchWithSecondaryTypes) {
return findType(typeName, packageName, searchWithSecondaryTypes, null);
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/ITypeAnnotationWalker.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/ITypeAnnotationWalker.java
index cc846adcc..7c3a7835b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/ITypeAnnotationWalker.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/ITypeAnnotationWalker.java
@@ -18,7 +18,7 @@ package org.eclipse.jdt.internal.compiler.env;
* A TypeAnnotationWalker is initialized with all type annotations found at a given element.
* It can be used to walk into the types at the given element and finally answer the
* actual annotations at any node of the walk.
- *
+ *
* The walker is implemented as immutable objects. During the walk either new instances
* are created, or the current instance is shared if no difference is encountered.
*/
@@ -90,13 +90,13 @@ public interface ITypeAnnotationWalker {
/**
* Detail of {@link #toTypeParameterBounds(boolean, int)}: walk to the bounds
- * of the previously selected type parameter.
+ * of the previously selected type parameter.
* @param boundIndex
*/
public abstract ITypeAnnotationWalker toTypeBound(short boundIndex);
/** Walk to the specified supertype either index based or name based:
- * @param index -1 is superclass, else index into the list of superinterfaces
+ * @param index -1 is superclass, else index into the list of superinterfaces
* @param superTypeSignature name and type arguments of the super type to visit
*/
public abstract ITypeAnnotationWalker toSupertype(short index, char[] superTypeSignature);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IUpdatableModule.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IUpdatableModule.java
index 0704eefe9..82e3bd10c 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IUpdatableModule.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IUpdatableModule.java
@@ -45,15 +45,15 @@ public interface IUpdatableModule {
public void accept(IUpdatableModule t) {
t.addExports(this.name, this.targets);
}
-
+
public char[] getName() {
return this.name;
}
-
+
public char[][] getTargetModules() {
return this.targets;
}
-
+
public UpdateKind getKind() {
return UpdateKind.PACKAGE;
}
@@ -62,7 +62,7 @@ public interface IUpdatableModule {
if (this == other) return true;
if (!(other instanceof AddExports)) return false;
AddExports pu = (AddExports) other;
-
+
if (!CharOperation.equals(this.name, pu.name))
return false;
if (!CharOperation.equals(this.targets, pu.targets))
@@ -80,11 +80,11 @@ public interface IUpdatableModule {
return hash;
}
}
-
+
class AddReads implements Consumer<IUpdatableModule> {
char[] targetModule;
-
+
public AddReads(char[] target) {
this.targetModule = target;
}
@@ -93,11 +93,11 @@ public interface IUpdatableModule {
// TODO Auto-generated method stub
t.addReads(this.targetModule);
}
-
+
public char[] getTarget() {
return this.targetModule;
}
-
+
public UpdateKind getKind() {
return UpdateKind.MODULE;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/ModuleReferenceImpl.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/ModuleReferenceImpl.java
index 6af1a826e..cdc69584c 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/ModuleReferenceImpl.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/ModuleReferenceImpl.java
@@ -24,7 +24,7 @@ public class ModuleReferenceImpl implements IModule.IModuleReference {
}
@Override
public boolean equals(Object o) {
- if (this == o)
+ if (this == o)
return true;
if (!(o instanceof IModule.IModuleReference))
return false;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/NameEnvironmentAnswer.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/NameEnvironmentAnswer.java
index b11078dfe..6f6496c40 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/NameEnvironmentAnswer.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/NameEnvironmentAnswer.java
@@ -55,7 +55,7 @@ public class NameEnvironmentAnswer {
this.externalAnnotationPath = externalAnnotationPath;
this.moduleName = module;
}
-
+
public NameEnvironmentAnswer(ReferenceBinding binding, ModuleBinding module) {
this.binding = binding;
this.moduleBinding = module;
@@ -86,7 +86,7 @@ public class NameEnvironmentAnswer {
}
return baseString;
}
-
+
/**
* Returns the associated access restriction, or null if none.
*/
@@ -167,10 +167,10 @@ public class NameEnvironmentAnswer {
public boolean ignoreIfBetter() {
return this.accessRestriction != null && this.accessRestriction.ignoreIfBetter();
}
-
- /**
+
+ /**
* Name of the module to which the CU in this answer is associated.
- * {@code null} when associated to the unnamed module.
+ * {@code null} when associated to the unnamed module.
* @return module name or {@code null}
*/
public char[] moduleName() {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/ConditionalFlowInfo.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/ConditionalFlowInfo.java
index 256bb09b7..51fcfcb46 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/ConditionalFlowInfo.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/ConditionalFlowInfo.java
@@ -121,7 +121,7 @@ public boolean isDefinitelyUnknown(LocalVariableBinding local) {
@Override
public boolean hasNullInfoFor(LocalVariableBinding local) {
- return this.initsWhenTrue.hasNullInfoFor(local)
+ return this.initsWhenTrue.hasNullInfoFor(local)
|| this.initsWhenFalse.hasNullInfoFor(local);
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/ExceptionHandlingFlowContext.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/ExceptionHandlingFlowContext.java
index f29648064..0c958db28 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/ExceptionHandlingFlowContext.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/ExceptionHandlingFlowContext.java
@@ -50,7 +50,7 @@ public class ExceptionHandlingFlowContext extends FlowContext {
int[] isReached;
int[] isNeeded;
// WARNING: This is an array that maps to catch blocks, not caught exceptions (which could be more than catch blocks in a multi-catch block)
- UnconditionalFlowInfo[] initsOnExceptions;
+ UnconditionalFlowInfo[] initsOnExceptions;
ObjectCache indexes = new ObjectCache();
boolean isMethodContext;
@@ -82,7 +82,7 @@ public ExceptionHandlingFlowContext(
FlowContext initializationParent,
BlockScope scope,
FlowInfo flowInfo) {
- this(parent, tryStatement, handledExceptions, exceptionToCatchBlockMap,
+ this(parent, tryStatement, handledExceptions, exceptionToCatchBlockMap,
tryStatement.catchArguments, initializationParent, scope, flowInfo.unconditionalInits());
UnconditionalFlowInfo unconditionalCopy = flowInfo.unconditionalCopy();
unconditionalCopy.iNBit = -1L;
@@ -193,7 +193,7 @@ public void complainIfUnusedExceptionHandlers(BlockScope scope,TryStatement tryS
}
}
-private ASTNode getExceptionType(int index) {
+private ASTNode getExceptionType(int index) {
if (this.exceptionToCatchBlockMap == null) {
return this.catchArguments[index].type;
}
@@ -204,8 +204,8 @@ private ASTNode getExceptionType(int index) {
for (int i = 0, len = typeRefs.length; i < len; i++) {
TypeReference typeRef = typeRefs[i];
if (TypeBinding.equalsEquals(typeRef.resolvedType, this.handledExceptions[index])) return typeRef;
- }
- }
+ }
+ }
return node;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/FinallyFlowContext.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/FinallyFlowContext.java
index 5cd681981..cd075750e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/FinallyFlowContext.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/FinallyFlowContext.java
@@ -224,7 +224,7 @@ public void complainOnDeferredChecks(FlowInfo flowInfo, BlockScope scope) {
}
break;
case IN_UNBOXING:
- checkUnboxing(scope, (Expression) location, flowInfo);
+ checkUnboxing(scope, (Expression) location, flowInfo);
break;
default:
// should not happen
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/FlowContext.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/FlowContext.java
index 8fb978d36..f74ee32a4 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/FlowContext.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/FlowContext.java
@@ -70,7 +70,7 @@ public class FlowContext implements TypeConstants {
public FlowInfo initsOnFinally;
// only used within try blocks; remembers upstream flow info mergedWith
// any null related operation happening within the try block
- /**
+ /**
* Used to record whether effects in a try block affect the finally-block
* conditionally or unconditionally.
* -1 means: no effect,
@@ -95,7 +95,7 @@ public class FlowContext implements TypeConstants {
// inside an assertFalse or a not-expression checks for equality / inequality have reversed meaning for syntactic analysis for fields:
public static final int INSIDE_NEGATION = 0x4;
/**
- * used to hide null comparison related warnings inside assert statements
+ * used to hide null comparison related warnings inside assert statements
*/
public static final int HIDE_NULL_COMPARISON_WARNING = 0x1000;
public static final int HIDE_NULL_COMPARISON_WARNING_MASK = 0xF000;
@@ -107,7 +107,7 @@ public static final int CAN_ONLY_NULL = 0x0001;
public static final int CAN_ONLY_NON_NULL = 0x0002;
//check against non null, with definite values -- comparisons
public static final int MAY_NULL = 0x0003;
-//check binding a value to a @NonNull variable
+//check binding a value to a @NonNull variable
public final static int ASSIGN_TO_NONNULL = 0x0080;
//check against an unboxing conversion
public static final int IN_UNBOXING = 0x0010;
@@ -186,10 +186,10 @@ public void extendTimeToLiveForNullCheckedField(int t) {
/**
* Forget any information about fields that were previously known to be non-null.
- *
+ *
* Will only cause any effect if CompilerOptions.enableSyntacticNullAnalysisForFields
* (implicitly by guards before calls to {@link #recordNullCheckedFieldReference(Reference, int)}).
- */
+ */
public void expireNullCheckedFieldInfo() {
if (this.nullCheckedFieldReferences != null) {
for (int i = 0; i < this.nullCheckedFieldReferences.length; i++) {
@@ -199,7 +199,7 @@ public void expireNullCheckedFieldInfo() {
}
}
-/**
+/**
* Is the given field reference equivalent to a reference that is freshly known to be non-null?
* Can only return true if CompilerOptions.enableSyntacticNullAnalysisForFields
* (implicitly by guards before calls to {@link #recordNullCheckedFieldReference(Reference, int)}).
@@ -243,7 +243,7 @@ public void checkExceptionHandlers(TypeBinding raisedException, ASTNode location
if (scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_7 && location instanceof ThrowStatement) {
Expression throwExpression = ((ThrowStatement)location).exception;
LocalVariableBinding throwArgBinding = throwExpression.localVariableBinding();
- if (throwExpression instanceof SingleNameReference // https://bugs.eclipse.org/bugs/show_bug.cgi?id=350361
+ if (throwExpression instanceof SingleNameReference // https://bugs.eclipse.org/bugs/show_bug.cgi?id=350361
&& throwArgBinding instanceof CatchParameterBinding && throwArgBinding.isEffectivelyFinal()) {
CatchParameterBinding parameter = (CatchParameterBinding) throwArgBinding;
checkExceptionHandlers(parameter.getPreciseTypes(), location, flowInfo, scope);
@@ -431,7 +431,7 @@ public void checkExceptionHandlers(TypeBinding[] raisedExceptions, ASTNode locat
caughtException,
exceptionFlow.unconditionalInits(),
raisedException,
- caughtException,
+ caughtException,
location,
false);
// was not caught already per construction
@@ -655,16 +655,16 @@ public FlowContext getTargetContextForDefaultContinue() {
return null;
}
-/**
+/**
* Answer flow context that corresponds to initialization. Suitably override in subtypes.
*/
public FlowContext getInitializationContext() {
return null;
}
-/**
+/**
* Answer the parent flow context but be careful not to cross the boundary of a nested type,
- * or null if no such parent exists.
+ * or null if no such parent exists.
*/
public FlowContext getLocalParent() {
if (this.associatedNode instanceof AbstractMethodDeclaration || this.associatedNode instanceof TypeDeclaration || this.associatedNode instanceof LambdaExpression)
@@ -770,7 +770,7 @@ public void recordContinueFrom(FlowContext innerFlowContext, FlowInfo flowInfo)
// default implementation: do nothing
}
-/**
+/**
* Record that we found an early exit from a method while a resource is in scope.
* @param scope enclosing scope
* @param flowInfo flowInfo at the point of the early exit
@@ -912,7 +912,7 @@ public void recordSettingFinal(VariableBinding variable, Reference finalReferenc
* CAN_ONLY_NULL_NON_NULL}, {@link #MAY_NULL MAY_NULL}, potentially
* combined with a context indicator (one of {@link #IN_COMPARISON_NULL},
* {@link #IN_COMPARISON_NON_NULL}, {@link #IN_ASSIGNMENT} or {@link #IN_INSTANCEOF})
- * and a bit to indicate whether the reference is being recorded inside an assert,
+ * and a bit to indicate whether the reference is being recorded inside an assert,
* {@link #HIDE_NULL_COMPARISON_WARNING}
* @param flowInfo the flow info at the check point; deferring contexts will
* perform supplementary checks against flow info instances that cannot
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/FlowInfo.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/FlowInfo.java
index 6c1e05594..fd144cd4d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/FlowInfo.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/FlowInfo.java
@@ -12,7 +12,7 @@
* IBM Corporation - initial API and implementation
* Fraunhofer FIRST - extended API and implementation
* Technical University Berlin - extended API and implementation
- * Stephan Herrmann <stephan@cs.tu-berlin.de> - Contributions for
+ * Stephan Herrmann <stephan@cs.tu-berlin.de> - Contributions for
* bug 292478 - Report potentially null across variable assignment
* bug 332637 - Dead Code detection removing code that isn't dead
* bug 394768 - [compiler][resource] Incorrect resource leak warning when creating stream in conditional
@@ -40,9 +40,9 @@ public abstract class FlowInfo {
public int tagBits; // REACHABLE by default
public final static int REACHABLE = 0;
- /* unreachable code
+ /* unreachable code
* eg. while (true);
- * i++; --> unreachable code
+ * i++; --> unreachable code
*/
public final static int UNREACHABLE_OR_DEAD = 1;
/* unreachable code as inferred by null analysis
@@ -57,7 +57,7 @@ public abstract class FlowInfo {
*/
public final static int UNREACHABLE = UNREACHABLE_OR_DEAD | UNREACHABLE_BY_NULLANALYSIS;
public final static int NULL_FLAG_MASK = 4;
-
+
public final static int UNKNOWN = 1;
public final static int NULL = 2;
public final static int NON_NULL = 4;
@@ -66,7 +66,7 @@ public abstract class FlowInfo {
public final static int POTENTIALLY_NON_NULL = 32;
public final static int UNROOTED = 64; // marks a flowInfo that may be appended to another flowInfo (accepting incoming nulls/nonnulls, see UFI.iNBit/iNNBit).
-
+
public static final int FREE_TYPEVARIABLE = FlowInfo.POTENTIALLY_NULL | FlowInfo.POTENTIALLY_NON_NULL;
public static final UnconditionalFlowInfo DEAD_END; // Represents a dead branch status of initialization
@@ -553,7 +553,7 @@ public static UnconditionalFlowInfo mergedOptimizedBranchesIfElse(
// if a variable is only initialized in one branch and not initialized in the other,
// then we need to cast a doubt on its initialization in the merged info
mergedInfo.mergeDefiniteInitsWith(initsWhenFalse.unconditionalCopy());
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=415997, classify unreachability precisely, IsElseStatementUnreachable could be due to null analysis
if ((mergedInfo.tagBits & FlowInfo.UNREACHABLE_OR_DEAD) != 0 && (initsWhenFalse.tagBits & FlowInfo.UNREACHABLE) == FlowInfo.UNREACHABLE_BY_NULLANALYSIS) {
mergedInfo.tagBits &= ~UNREACHABLE_OR_DEAD;
@@ -567,7 +567,7 @@ public static UnconditionalFlowInfo mergedOptimizedBranchesIfElse(
// true or false (i.e if(true), etc) for sure
// We don't do this if both if and else branches themselves are in an unreachable code
// or if any of them is a DEAD_END (e.g. contains 'return' or 'throws')
- mergedInfo =
+ mergedInfo =
initsWhenFalse.addPotentialInitializationsFrom(initsWhenTrue.
nullInfoLessUnconditionalCopy()).
unconditionalInits();
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/InitializationFlowContext.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/InitializationFlowContext.java
index 2f516b0bd..5d2f44002 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/InitializationFlowContext.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/InitializationFlowContext.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
*******************************************************************************/
@@ -58,7 +58,7 @@ public class InitializationFlowContext extends ExceptionHandlingFlowContext {
public FlowContext getInitializationContext() {
return this;
}
-
+
@Override
public String individualToString() {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/LoopingFlowContext.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/LoopingFlowContext.java
index 203f56866..f8af4898f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/LoopingFlowContext.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/LoopingFlowContext.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
@@ -276,7 +276,7 @@ public void complainOnDeferredNullChecks(BlockScope scope, FlowInfo callerFlowIn
}
break;
}
- }
+ }
break;
case MAY_NULL:
if (flowInfo.isDefinitelyNull(local)) {
@@ -507,7 +507,7 @@ public void recordContinueFrom(FlowContext innerFlowContext, FlowInfo flowInfo)
FlowContext inner = innerFlowContext;
while (inner != this && !(inner instanceof LoopingFlowContext)) {
inner = inner.parent;
- // we know that inner is reachable from this without crossing a type boundary
+ // we know that inner is reachable from this without crossing a type boundary
}
if (inner == this) {
this.upstreamNullFlowInfo.
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/TryFlowContext.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/TryFlowContext.java
index 32d9cee33..4df6bbf86 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/TryFlowContext.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/TryFlowContext.java
@@ -30,7 +30,7 @@ public abstract class TryFlowContext extends FlowContext {
public TryFlowContext(FlowContext parent, ASTNode associatedNode) {
super(parent, associatedNode, true);
}
-
+
@Override
public void markFinallyNullStatus(LocalVariableBinding local, int nullStatus) {
if (this.outerTryContext != null) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.java
index a78dbb797..4b99fb741 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.java
@@ -98,7 +98,7 @@ public class UnconditionalFlowInfo extends FlowInfo {
1110 prot. null
1111 prot. non null
*/
- public long
+ public long
iNBit, // can an incoming null value reach the current point?
iNNBit; // can an incoming nonnull value reach the current point?
@@ -120,12 +120,12 @@ public class UnconditionalFlowInfo extends FlowInfo {
public static final int IN = 6;
public static final int INN = 7;
-/* fakeInitializedFlowInfo: For Lambda expressions tentative analysis during overload resolution.
- We presume that any and all outer locals touched by the lambda are definitely assigned and
+/* fakeInitializedFlowInfo: For Lambda expressions tentative analysis during overload resolution.
+ We presume that any and all outer locals touched by the lambda are definitely assigned and
effectively final. Whether they are or not is immaterial for overload analysis (errors encountered
- in the body are not supposed to influence the resolution. It is pertinent only for the eventual
+ in the body are not supposed to influence the resolution. It is pertinent only for the eventual
resolution/analysis post overload resolution. For lambda's the problem is that we start the control/data
- flow analysis abruptly at the start of the lambda, so we need to present a cogent world view and hence
+ flow analysis abruptly at the start of the lambda, so we need to present a cogent world view and hence
all this charade.
*/
public static UnconditionalFlowInfo fakeInitializedFlowInfo(int localsCount, int maxFieldCount) {
@@ -157,7 +157,7 @@ private FlowInfo addInfoFrom(FlowInfo inits, boolean handleInits) {
// union of potentially set ones
this.potentialInits |= otherInits.potentialInits;
}
-
+
// combine null information
boolean thisHadNulls = (this.tagBits & NULL_FLAG_MASK) != 0,
otherHasNulls = (otherInits.tagBits & NULL_FLAG_MASK) != 0;
@@ -192,7 +192,7 @@ private FlowInfo addInfoFrom(FlowInfo inits, boolean handleInits) {
long protNN1111 = a1&a2&a3&a4;
// filter 'a' using iNBit,iNNBit from otherInits:
- // this implements that otherInit does not accept certain bits which are known to be superseded by info in otherInits.
+ // this implements that otherInit does not accept certain bits which are known to be superseded by info in otherInits.
long acceptNonNull = otherInits.iNNBit;
long acceptNull = otherInits.iNBit
| protNN1111; // for 1111 don't bother suppressing incoming null, logic operation would produce wrong result
@@ -203,7 +203,7 @@ private FlowInfo addInfoFrom(FlowInfo inits, boolean handleInits) {
a3 = dontResetToStart & acceptNonNull & a3;
a4 &= dontResetToStart;
a1 &= (a2 | a3 | a4); // translate 1000 (undefined state) to 0000
-
+
this.nullBit1 = (b1 = otherInits.nullBit1)
| a1 & (a3
& a4 & (nb2 = ~(b2 = otherInits.nullBit2))
@@ -319,7 +319,7 @@ private FlowInfo addInfoFrom(FlowInfo inits, boolean handleInits) {
for (; i < copyLimit; i++) {
this.extra[0][i] = otherInits.extra[0][i];
this.extra[1][i] = otherInits.extra[1][i];
-
+
}
}
// tweak limits for nulls
@@ -342,7 +342,7 @@ private FlowInfo addInfoFrom(FlowInfo inits, boolean handleInits) {
long protNN1111 = a1&a2&a3&a4;
// filter 'a' using iNBit,iNNBit from otherInits:
- // this implements that otherInit does not accept certain bits which are known to be superseded by info in otherInits.
+ // this implements that otherInit does not accept certain bits which are known to be superseded by info in otherInits.
long acceptNonNull = otherInits.extra[INN][i];
long acceptNull = otherInits.extra[IN][i]
| protNN1111; // for 1111 don't bother suppressing incoming null, logic operation would produce wrong result
@@ -355,7 +355,7 @@ private FlowInfo addInfoFrom(FlowInfo inits, boolean handleInits) {
a1 &= (a2 | a3 | a4); // translate 1000 (undefined state) to 0000
this.extra[1 + 1][i] = (b1 = otherInits.extra[1 + 1][i])
- | a1 & (a3
+ | a1 & (a3
& a4 & (nb2 = ~(b2 = otherInits.extra[2 + 1][i]))
& (nb4 = ~(b4 = otherInits.extra[4 + 1][i]))
| ((na4 = ~a4) | (na3 = ~a3))
@@ -1818,7 +1818,7 @@ public UnconditionalFlowInfo mergedWith(UnconditionalFlowInfo otherInits) {
} else if (thisHadNulls) {
if (otherHasNulls) {
this.nullBit1 = (a1 = this.nullBit1) & (b1 = otherInits.nullBit1) & (
- ((a2 = this.nullBit2) & (((b2 = otherInits.nullBit2) &
+ ((a2 = this.nullBit2) & (((b2 = otherInits.nullBit2) &
~(((a3=this.nullBit3) & (a4=this.nullBit4)) ^ ((b3=otherInits.nullBit3) & (b4=otherInits.nullBit4))))
|(a3 & a4 & (nb2 = ~b2))))
|((na2 = ~a2) & ((b2 & b3 & b4)
@@ -1962,7 +1962,7 @@ public UnconditionalFlowInfo mergedWith(UnconditionalFlowInfo otherInits) {
// compose nulls
for (i = 0; i < mergeLimit; i++) {
this.extra[1 + 1][i] = (a1=this.extra[1+1][i]) & (b1=otherInits.extra[1+1][i]) & (
- ((a2=this.extra[2+1][i]) & (((b2=otherInits.extra[2+1][i]) &
+ ((a2=this.extra[2+1][i]) & (((b2=otherInits.extra[2+1][i]) &
~(((a3=this.extra[3+1][i]) & (a4=this.extra[4+1][i])) ^ ((b3=otherInits.extra[3+1][i]) & (b4=otherInits.extra[4+1][i]))))
|(a3 & a4 & (nb2=~b2))))
|((na2=~a2) & ((b2 & b3 & b4)
@@ -2091,7 +2091,7 @@ public FlowInfo safeInitsWhenTrue() {
public FlowInfo setReachMode(int reachMode) {
if (this == DEAD_END) {// cannot modify DEAD_END
return this;
- }
+ }
if (reachMode == REACHABLE ) {
this.tagBits &= ~UNREACHABLE;
} else if (reachMode == UNREACHABLE_BY_NULLANALYSIS ) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
index a78a0f148..94e08cf4f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
@@ -186,13 +186,13 @@ public class CompilerOptions {
public static final String OPTION_ReportUnsafeRoleInstantiation =
"org.eclipse.objectteams.otdt.compiler.problem.unsafe_role_instantiation"; //$NON-NLS-1$
- public static final String OPTION_ReportEffectlessFieldaccess =
- "org.eclipse.objectteams.otdt.compiler.problem.effectless_fieldaccess"; //$NON-NLS-1$
+ public static final String OPTION_ReportEffectlessFieldaccess =
+ "org.eclipse.objectteams.otdt.compiler.problem.effectless_fieldaccess"; //$NON-NLS-1$
public static final String OPTION_ReportFragileCallin =
"org.eclipse.objectteams.otdt.compiler.problem.fragile_callin"; //$NON-NLS-1$
- public static final String OPTION_ReportUnusedParammap =
- "org.eclipse.objectteams.otdt.compiler.problem.unused_parammap"; //$NON-NLS-1$
-
+ public static final String OPTION_ReportUnusedParammap =
+ "org.eclipse.objectteams.otdt.compiler.problem.unused_parammap"; //$NON-NLS-1$
+
public static final String OPTION_ReportPotentialAmbiguousPlayedby =
"org.eclipse.objectteams.otdt.compiler.problem.potential_ambiguous_playedby"; //$NON-NLS-1$
public static final String OPTION_ReportAbstractPotentialRelevantRole =
@@ -222,38 +222,38 @@ public class CompilerOptions {
public static final String OPTION_ReportExceptionInGuard=
"org.eclipse.objectteams.otdt.compiler.problem.exception_in_guard"; //$NON-NLS-1$
-
+
public static final String OPTION_ReportAmbiguousLowering=
"org.eclipse.objectteams.otdt.compiler.problem.ambiguous_lowering"; //$NON-NLS-1$
-
+
public static final String OPTION_ReportAdaptingDeprecated=
"org.eclipse.objectteams.otdt.compiler.problem.adapting_deprecated"; //$NON-NLS-1$
-
+
public static final String OPTION_ReportIgnoringRoleMethodReturn=
"org.eclipse.objectteams.otdt.compiler.problem.ignoring_role_return"; //$NON-NLS-1$
public static final String OPTION_ReportOtreWeavingIntoJava8=
"org.eclipse.objectteams.otdt.compiler.problem.otre_into_java8"; //$NON-NLS-1$
-
+
public static final String OPTION_AllowScopedKeywords =
"org.eclipse.objectteams.otdt.compiler.option.scoped_keywords"; //$NON-NLS-1$
-
+
public static final String OPTION_PureJavaOnly =
"org.eclipse.objectteams.otdt.compiler.option.pure_java"; //$NON-NLS-1$ // not for explicit configuration, set from project nature
-
+
// === multi value options ===:
-
+
public static final String OPTION_WeavingScheme =
"org.eclipse.objectteams.otdt.compiler.option.weaving_scheme"; //$NON-NLS-1$
/** Supported weaving schemes. */
- public static enum WeavingScheme {
+ public static enum WeavingScheme {
/** Code generation for the traditional "Object Teams Runtime Environment" implementation based on BCEL. */
OTRE,
/** Code generation for the newer "Object Teams Dynamic Runtime Environment" implementation based on ASM. */
OTDRE
}
-
-
+
+
public static final String OPTION_Decapsulation = "org.eclipse.objectteams.otdt.core.compiler.problem.decapsulation"; //$NON-NLS-1$
// values for the above:
public static final String REPORT_CLASS = "report class"; //$NON-NLS-1$
@@ -284,7 +284,7 @@ public class CompilerOptions {
public static final String OPTION_PessimisticNullAnalysisForFreeTypeVariables = "org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables"; //$NON-NLS-1$
public static final String OPTION_ReportNonNullTypeVariableFromLegacyInvocation = "org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation"; //$NON-NLS-1$
public static final String OPTION_ReportAnnotatedTypeArgumentToUnannotated = "org.eclipse.jdt.core.compiler.problem.annotatedTypeArgumentToUnannotated"; //$NON-NLS-1$
-
+
public static final String OPTION_ReportUnlikelyCollectionMethodArgumentType = "org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType"; //$NON-NLS-1$
public static final String OPTION_ReportUnlikelyCollectionMethodArgumentTypeStrict = "org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict"; //$NON-NLS-1$
public static final String OPTION_ReportUnlikelyEqualsArgumentType = "org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType"; //$NON-NLS-1$
@@ -377,7 +377,7 @@ public class CompilerOptions {
public static final int UnnecessaryTypeCheck = IrritantSet.GROUP0 | ASTNode.Bit27;
public static final int UndocumentedEmptyBlock = IrritantSet.GROUP0 | ASTNode.Bit28;
public static final int IndirectStaticAccess = IrritantSet.GROUP0 | ASTNode.Bit29;
-
+
// group 1
public static final int UnnecessaryElse = IrritantSet.GROUP1 | ASTNode.Bit1;
public static final int UncheckedTypeOperation = IrritantSet.GROUP1 | ASTNode.Bit2;
@@ -461,7 +461,7 @@ public class CompilerOptions {
public static final int AdaptingDeprecated= OTJFlag | ASTNode.Bit16;
public static final int IgnoringRoleReturn= OTJFlag | ASTNode.Bit17;
public static final int BaseclassCycle= OTJFlag | ASTNode.Bit18;
- public static final int EffectlessFieldaccess= OTJFlag | ASTNode.Bit19;
+ public static final int EffectlessFieldaccess= OTJFlag | ASTNode.Bit19;
public static final int UnusedParammap= OTJFlag | ASTNode.Bit20;
public static final int HiddenLiftingProblem= OTJFlag | ASTNode.Bit21;
public static final int OTREintoJava8= OTJFlag | ASTNode.Bit22;
@@ -469,28 +469,28 @@ public class CompilerOptions {
// SH}
// Severity level for handlers
- /**
- * Defaults defined at {@link IrritantSet#COMPILER_DEFAULT_ERRORS}
+ /**
+ * Defaults defined at {@link IrritantSet#COMPILER_DEFAULT_ERRORS}
* @see #resetDefaults()
*/
protected IrritantSet errorThreshold;
- /**
+ /**
* Defaults defined at {@link IrritantSet#COMPILER_DEFAULT_WARNINGS}
* @see #resetDefaults()
*/
protected IrritantSet warningThreshold;
- /**
+ /**
* Defaults defined at {@link IrritantSet#COMPILER_DEFAULT_INFOS}
* @see #resetDefaults()
*/
protected IrritantSet infoThreshold;
-
+
/**
* Default settings are to be defined in {@link CompilerOptions#resetDefaults()}
*/
-
+
/** Classfile debug information, may contain source file name, line numbers, local variable tables, etc... */
- public int produceDebugAttributes;
+ public int produceDebugAttributes;
/** Classfile method parameters information as per JEP 118... */
public boolean produceMethodParameters;
/** Indicates whether generic signature should be generated for lambda expressions */
@@ -504,7 +504,7 @@ public class CompilerOptions {
public long originalComplianceLevel;
/** Java source level, refers to a JDK version, e.g. {@link ClassFileConstants#JDK1_4} */
public long sourceLevel;
- /** Original Java source level, refers to a JDK version, e.g. {@link ClassFileConstants#JDK1_4}
+ /** Original Java source level, refers to a JDK version, e.g. {@link ClassFileConstants#JDK1_4}
* Usually same as the field sourceLevel, though the latter could deviate to create temporary sandbox
* modes during reconcile operations. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=323633
* */
@@ -516,7 +516,7 @@ public class CompilerOptions {
/** Compiler trace verbosity */
public boolean verbose;
/** Indicates whether reference info is desired */
- public boolean produceReferenceInfo;
+ public boolean produceReferenceInfo;
/** Indicates if unused/optimizable local variables need to be preserved (debugging purpose) */
public boolean preserveAllLocalVariables;
/** Indicates whether literal expressions are inlined at parse-time or not */
@@ -636,11 +636,11 @@ public class CompilerOptions {
public boolean analyseResourceLeaks;
/** Should missing enum cases be reported even if a default case exists in the same switch? */
public boolean reportMissingEnumCaseDespiteDefault;
-
+
/** When checking for unlikely argument types of of Map.get() et al, perform strict analysis against the expected type */
public boolean reportUnlikelyCollectionMethodArgumentTypeStrict;
- /** Should the compiler tolerate illegal ambiguous varargs invocation in compliance < 1.7
+ /** Should the compiler tolerate illegal ambiguous varargs invocation in compliance < 1.7
* to be bug compatible with javac? (bug 383780) */
public static boolean tolerateIllegalAmbiguousVarargsInvocation;
{
@@ -687,7 +687,7 @@ public class CompilerOptions {
"rawtypes", //$NON-NLS-1$
"removal", //$NON-NLS-1$
"resource", //$NON-NLS-1$
- "restriction", //$NON-NLS-1$
+ "restriction", //$NON-NLS-1$
"serial", //$NON-NLS-1$
"static-access", //$NON-NLS-1$
"static-method", //$NON-NLS-1$
@@ -1033,9 +1033,9 @@ public class CompilerOptions {
default:
if(major > ClassFileConstants.MAJOR_VERSION_10) {
return "" + (major - ClassFileConstants.MAJOR_VERSION_0); //$NON-NLS-1$
- }
+ }
return Util.EMPTY_STRING; // unknown version
-
+
}
return Util.EMPTY_STRING; // unknown version
}
@@ -1557,7 +1557,7 @@ public class CompilerOptions {
return null;
}
-
+
public Map<String, String> getMap() {
Map<String, String> optionsMap = new HashMap<>(30);
optionsMap.put(OPTION_LocalVariableAttribute, (this.produceDebugAttributes & ClassFileConstants.ATTR_VARS) != 0 ? GENERATE : DO_NOT_GENERATE);
@@ -1817,7 +1817,7 @@ public class CompilerOptions {
this.errorThreshold = new IrritantSet(IrritantSet.COMPILER_DEFAULT_ERRORS);
this.warningThreshold = new IrritantSet(IrritantSet.COMPILER_DEFAULT_WARNINGS);
this.infoThreshold = new IrritantSet(IrritantSet.COMPILER_DEFAULT_INFOS);
-
+
// by default only lines and source attributes are generated.
this.produceDebugAttributes = ClassFileConstants.ATTR_SOURCE | ClassFileConstants.ATTR_LINES;
this.complianceLevel = this.originalComplianceLevel = ClassFileConstants.JDK1_4; // by default be compliant with 1.4
@@ -1833,7 +1833,7 @@ public class CompilerOptions {
// indicates if unused/optimizable local variables need to be preserved (debugging purpose)
this.preserveAllLocalVariables = false;
-
+
this.produceMethodParameters = false;
// indicates whether literal expressions are inlined at parse-time or not
@@ -1850,17 +1850,17 @@ public class CompilerOptions {
// deprecation report
this.reportDeprecationInsideDeprecatedCode = false;
this.reportDeprecationWhenOverridingDeprecatedMethod = false;
-
+
// unused parameters report
this.reportUnusedParameterWhenImplementingAbstract = false;
this.reportUnusedParameterWhenOverridingConcrete = false;
this.reportUnusedParameterIncludeDocCommentReference = true;
-
+
// unused declaration of thrown exception
this.reportUnusedDeclaredThrownExceptionWhenOverriding = false;
this.reportUnusedDeclaredThrownExceptionIncludeDocCommentReference = true;
this.reportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable = true;
-
+
// constructor/setter parameter hiding
this.reportSpecialParameterHidingField = false;
@@ -1872,7 +1872,7 @@ public class CompilerOptions {
this.reportInvalidJavadocTagsDeprecatedRef = false;
this.reportInvalidJavadocTagsNotVisibleRef = false;
this.reportMissingJavadocTagDescription = RETURN_TAG;
-
+
// check missing javadoc tags
this.reportMissingJavadocTagsVisibility = ClassFileConstants.AccPublic;
this.reportMissingJavadocTagsOverriding = false;
@@ -1881,7 +1881,7 @@ public class CompilerOptions {
// check missing javadoc comments
this.reportMissingJavadocCommentsVisibility = ClassFileConstants.AccPublic;
this.reportMissingJavadocCommentsOverriding = false;
-
+
// JSR bytecode inlining and sharing
this.inlineJsrBytecode = false;
this.shareCommonFinallyBlocks = false;
@@ -1912,21 +1912,21 @@ public class CompilerOptions {
// enable annotation processing by default only in batch mode
this.processAnnotations = false;
-
+
// disable missing override annotation reporting for interface method implementation
this.reportMissingOverrideAnnotationForInterfaceMethodImplementation = true;
-
+
// dead code detection
this.reportDeadCodeInTrivialIfStatement = false;
-
+
// ignore method bodies
this.ignoreMethodBodies = false;
-
+
this.ignoreSourceFolderWarningOption = false;
-
+
// allow null info from asserts to be considered downstream by default
this.includeNullInfoFromAsserts = false;
-
+
this.isAnnotationBasedNullAnalysisEnabled = false;
this.nullableAnnotationName = DEFAULT_NULLABLE_ANNOTATION_NAME;
this.nonNullAnnotationName = DEFAULT_NONNULL_ANNOTATION_NAME;
@@ -1934,7 +1934,7 @@ public class CompilerOptions {
this.intendedDefaultNonNullness = 0;
this.enableSyntacticNullAnalysisForFields = false;
this.inheritNullAnnotations = false;
-
+
this.analyseResourceLeaks = true;
this.reportMissingEnumCaseDespiteDefault = false;
@@ -2081,7 +2081,7 @@ public class CompilerOptions {
} else if (DISABLED.equals(optionValue)) {
this.reportDeadCodeInTrivialIfStatement = false;
}
- }
+ }
if ((optionValue = optionsMap.get(OPTION_MaxProblemPerUnit)) != null) {
String stringValue = optionValue;
try {
@@ -2519,9 +2519,9 @@ public class CompilerOptions {
this.enablePreviewFeatures = false;
}
}
- if ((optionValue = optionsMap.get(OPTION_ReportPreviewFeatures)) != null)
+ if ((optionValue = optionsMap.get(OPTION_ReportPreviewFeatures)) != null)
updateSeverity(PreviewFeatureUsed, optionValue);
- if ((optionValue = optionsMap.get(OPTION_ReportSuppressWarningNotFullyAnalysed)) != null)
+ if ((optionValue = optionsMap.get(OPTION_ReportSuppressWarningNotFullyAnalysed)) != null)
updateSeverity(SuppressWarningsNotAnalysed, optionValue);
if ((optionValue = optionsMap.get(OPTION_JdtDebugCompileMode)) != null) {
@@ -2704,7 +2704,7 @@ public class CompilerOptions {
buf.append("\n\t- report when overriding a final role: ").append(getSeverityString(OverridingFinalRole)); //$NON-NLS-1$
buf.append("\n\t- report if a guard throws a checked exception: ").append(getSeverityString(ExceptionInGuard)); //$NON-NLS-1$
-
+
buf.append("\n\t- report if insertion of lowering is ambiguous : ").append(getSeverityString(AmbiguousLowering)); //$NON-NLS-1$
buf.append("\n\t- allow scoped keywords : ").append(this.allowScopedKeywords ? ENABLED : DISABLED); //$NON-NLS-1$
@@ -2712,7 +2712,7 @@ public class CompilerOptions {
// SH}
return buf.toString();
}
-
+
protected void updateSeverity(int irritant, Object severityString) {
if (ERROR.equals(severityString)) {
this.errorThreshold.set(irritant);
@@ -2733,7 +2733,7 @@ public class CompilerOptions {
}
}
- /**
+ /**
* Note, if you have a LookupEnvironment you should instead ask
* {@link org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment#usesNullTypeAnnotations()}. */
public boolean usesNullTypeAnnotations() {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/Constant.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/Constant.java
index 24be987cf..889ff94be 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/Constant.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/Constant.java
@@ -22,7 +22,7 @@ public abstract class Constant implements TypeIds, OperatorIds {
public static final Constant NotAConstant = DoubleConstant.fromValue(Double.NaN);
public static final Constant[] NotAConstantList = new Constant[] {DoubleConstant.fromValue(Double.NaN)};
-
+
public boolean booleanValue() {
throw new ShouldNotImplement(Messages.bind(Messages.constant_cannotCastedInto, new String[] { typeName(), "boolean" })); //$NON-NLS-1$
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java
index 2bf1799b4..9285e0102 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java
@@ -89,7 +89,7 @@ public class IrritantSet {
public static final IrritantSet JAVADOC = new IrritantSet(CompilerOptions.InvalidJavadoc);
public static final IrritantSet PREVIEW = new IrritantSet(CompilerOptions.PreviewFeatureUsed);
- public static final IrritantSet COMPILER_DEFAULT_ERRORS = new IrritantSet(0); // no optional error by default
+ public static final IrritantSet COMPILER_DEFAULT_ERRORS = new IrritantSet(0); // no optional error by default
public static final IrritantSet COMPILER_DEFAULT_WARNINGS = new IrritantSet(0); // see static initializer below
public static final IrritantSet COMPILER_DEFAULT_INFOS = new IrritantSet(0); // see static initializer below
//{ObjectTeams: new irritants:
@@ -145,7 +145,7 @@ public class IrritantSet {
CompilerOptions.UnlikelyEqualsArgumentType
| CompilerOptions.SuppressWarningsNotAnalysed
| CompilerOptions.AnnotatedTypeArgumentToUnannotated);
-
+
COMPILER_DEFAULT_WARNINGS
//{ObjectTeams: default to warning (group 3):
.set(CompilerOptions.BindingConventions
@@ -264,7 +264,7 @@ public class IrritantSet {
if (suppressRawWhenUnchecked != null && "true".equalsIgnoreCase(suppressRawWhenUnchecked)) { //$NON-NLS-1$
UNCHECKED.set(CompilerOptions.RawTypeReference);
}
-
+
JAVADOC
.set(CompilerOptions.MissingJavadocComments)
.set(CompilerOptions.MissingJavadocTags);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/ReferenceContext.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/ReferenceContext.java
index 0f14dc579..e1a03f22f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/ReferenceContext.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/ReferenceContext.java
@@ -36,7 +36,7 @@ public interface ReferenceContext {
boolean hasErrors();
void tagAsHavingErrors();
-
+
void tagAsHavingIgnoredMandatoryErrors(int problemId);
//{ObjectTeams: some errors will have to be removed
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/AnnotatableTypeSystem.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/AnnotatableTypeSystem.java
index 7f0e99db5..2c5226f99 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/AnnotatableTypeSystem.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/AnnotatableTypeSystem.java
@@ -11,7 +11,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
* Stephan Herrmann - Contribution for
- * Bug 432977 - [1.8][null] Incorrect 'type is not visible' compiler error
+ * Bug 432977 - [1.8][null] Incorrect 'type is not visible' compiler error
* Bug 446434 - [1.8][null] Enable interned captures also when analysing null type annotations
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.lookup;
@@ -23,29 +23,29 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.lookup.ITeamAnchor;
import org.eclipse.objectteams.otdt.internal.core.compiler.lookup.RoleTypeBinding;
/* AnnotatableTypeSystem: Keep track of annotated types so as to provide unique bindings for identically annotated versions identical underlying "naked" types.
- As of now, we ensure uniqueness only for marker annotated types and for others that default to all default attribute values, i.e two instances of @NonNull String
- would have the same binding, while @T(1) X and @T(2) X will not. Binding uniqueness is only a memory optimization and is not essential for correctness of compilation.
+ As of now, we ensure uniqueness only for marker annotated types and for others that default to all default attribute values, i.e two instances of @NonNull String
+ would have the same binding, while @T(1) X and @T(2) X will not. Binding uniqueness is only a memory optimization and is not essential for correctness of compilation.
Various subsystems should expect to determine binding identity/equality by calling TypeBinding.equalsEquals and not by using == operator.
-
- ATS is AnnotatableTypeSystem and not AnnotatedTypeSystem, various methods may actually return unannotated types if the input arguments do not specify any annotations
- and component types of the composite type being constructed are themselves also unannotated. We rely on the master type table maintained by TypeSystem and use
+
+ ATS is AnnotatableTypeSystem and not AnnotatedTypeSystem, various methods may actually return unannotated types if the input arguments do not specify any annotations
+ and component types of the composite type being constructed are themselves also unannotated. We rely on the master type table maintained by TypeSystem and use
getDerivedTypes() and cacheDerivedType() to get/put.
*/
public class AnnotatableTypeSystem extends TypeSystem {
private boolean isAnnotationBasedNullAnalysisEnabled;
-
+
public AnnotatableTypeSystem(LookupEnvironment environment) {
super(environment);
this.environment = environment;
this.isAnnotationBasedNullAnalysisEnabled = environment.globalOptions.isAnnotationBasedNullAnalysisEnabled;
}
-
+
// Given a type, return all its annotated variants: parameter may be annotated.
@Override
public TypeBinding[] getAnnotatedTypes(TypeBinding type) {
-
+
TypeBinding[] derivedTypes = getDerivedTypes(type);
final int length = derivedTypes.length;
TypeBinding [] annotatedVersions = new TypeBinding[length];
@@ -59,16 +59,16 @@ public class AnnotatableTypeSystem extends TypeSystem {
if (derivedType.id == type.id)
annotatedVersions[versions++] = derivedType;
}
-
+
if (versions != length)
System.arraycopy(annotatedVersions, 0, annotatedVersions = new TypeBinding[versions], 0, versions);
return annotatedVersions;
}
-
- /* This method replaces the version that used to sit in LE. The parameter `annotations' is a flattened sequence of annotations,
+
+ /* This method replaces the version that used to sit in LE. The parameter `annotations' is a flattened sequence of annotations,
where each dimension's annotations end with a sentinel null. Leaf type can be an already annotated type.
-
- See ArrayBinding.swapUnresolved for further special case handling if incoming leafType is a URB that would resolve to a raw
+
+ See ArrayBinding.swapUnresolved for further special case handling if incoming leafType is a URB that would resolve to a raw
type later.
*/
@Override
@@ -89,14 +89,14 @@ public class AnnotatableTypeSystem extends TypeSystem {
if (derivedType == null) break;
if (!derivedType.isArrayType() || derivedType.dimensions() != dimensions || derivedType.leafComponentType() != leafType) //$IDENTITY-COMPARISON$
continue;
- if (Util.effectivelyEqual(derivedType.getTypeAnnotations(), annotations))
+ if (Util.effectivelyEqual(derivedType.getTypeAnnotations(), annotations))
return (ArrayBinding) derivedType;
if (!derivedType.hasTypeAnnotations())
nakedType = (ArrayBinding) derivedType;
}
if (nakedType == null)
nakedType = super.getArrayType(leafType, dimensions);
-
+
if (!haveTypeAnnotations(leafType, annotations))
return nakedType;
@@ -117,18 +117,18 @@ public class AnnotatableTypeSystem extends TypeSystem {
return super.getMemberType(memberType, enclosingType);
return (ReferenceBinding) getAnnotatedType(memberType, enclosingType, memberType.getTypeAnnotations());
}
-
+
//{ObjectTeams: more arguments for role types:
/* orig:
public ParameterizedTypeBinding getParameterizedType(ReferenceBinding genericType, TypeBinding[] typeArguments, ReferenceBinding enclosingType, AnnotationBinding [] annotations) {
-
+
if (genericType.hasTypeAnnotations()) // @NonNull (List<String>) and not (@NonNull List)<String>
throw new IllegalStateException();
-
+
ParameterizedTypeBinding parameterizedType = this.parameterizedTypes.get(genericType, typeArguments, enclosingType, annotations);
if (parameterizedType != null)
return parameterizedType;
-
+
ParameterizedTypeBinding nakedType = super.getParameterizedType(genericType, typeArguments, enclosingType);
:giro */
@Override
@@ -139,18 +139,18 @@ public class AnnotatableTypeSystem extends TypeSystem {
if (genericType.hasTypeAnnotations()) // @NonNull (List<String>) and not (@NonNull List)<String>
throw new IllegalStateException();
- ParameterizedTypeBinding parameterizedType = this.parameterizedTypes.get(genericType, typeArguments,
+ ParameterizedTypeBinding parameterizedType = this.parameterizedTypes.get(genericType, typeArguments,
teamAnchor, valueParamPosition, enclosingType, annotations);
if (parameterizedType != null)
return parameterizedType;
ParameterizedTypeBinding nakedType = super.getParameterizedType(genericType, typeArguments, teamAnchor, valueParamPosition, enclosingType);
// SH}
-
+
if (!haveTypeAnnotations(genericType, enclosingType, typeArguments, annotations))
return nakedType;
-
+
//{ObjectTeams: dependent type?
-/* orig:
+/* orig:
parameterizedType = new ParameterizedTypeBinding(genericType, typeArguments, enclosingType, this.environment);
parameterizedType.id = nakedType.id;
parameterizedType.setTypeAnnotations(annotations, this.isAnnotationBasedNullAnalysisEnabled);
@@ -173,7 +173,7 @@ public class AnnotatableTypeSystem extends TypeSystem {
// SH}
return (ParameterizedTypeBinding) cacheDerivedType(genericType, nakedType, parameterizedType);
}
-
+
@Override
public ParameterizedTypeBinding getParameterizedType(ReferenceBinding genericType, TypeBinding[] typeArguments, ReferenceBinding enclosingType) {
//{ObjectTeams: more args (default values):
@@ -199,7 +199,7 @@ public class AnnotatableTypeSystem extends TypeSystem {
if (!genericType.hasEnclosingInstanceContext() && enclosingType != null) {
enclosingType = (ReferenceBinding) enclosingType.original();
}
-
+
RawTypeBinding nakedType = null;
TypeBinding[] derivedTypes = getDerivedTypes(genericType);
for (int i = 0, length = derivedTypes.length; i < length; i++) {
@@ -216,36 +216,36 @@ public class AnnotatableTypeSystem extends TypeSystem {
}
if (nakedType == null)
nakedType = super.getRawType(genericType, enclosingType);
-
+
if (!haveTypeAnnotations(genericType, enclosingType, null, annotations))
return nakedType;
-
+
RawTypeBinding rawType = new RawTypeBinding(genericType, enclosingType, this.environment);
rawType.id = nakedType.id;
rawType.setTypeAnnotations(annotations, this.isAnnotationBasedNullAnalysisEnabled);
return (RawTypeBinding) cacheDerivedType(genericType, nakedType, rawType);
}
-
+
@Override
public RawTypeBinding getRawType(ReferenceBinding genericType, ReferenceBinding enclosingType) {
return getRawType(genericType, enclosingType, Binding.NO_ANNOTATIONS);
}
-
+
@Override
public WildcardBinding getWildcard(ReferenceBinding genericType, int rank, TypeBinding bound, TypeBinding[] otherBounds, int boundKind, AnnotationBinding [] annotations) {
-
+
if (genericType == null) // pseudo wildcard denoting composite bounds for lub computation
genericType = ReferenceBinding.LUB_GENERIC;
if (genericType.hasTypeAnnotations())
throw new IllegalStateException();
-
+
WildcardBinding nakedType = null;
boolean useDerivedTypesOfBound = bound instanceof TypeVariableBinding || (bound instanceof ParameterizedTypeBinding && !(bound instanceof RawTypeBinding)) ;
TypeBinding[] derivedTypes = getDerivedTypes(useDerivedTypesOfBound ? bound : genericType);
for (int i = 0, length = derivedTypes.length; i < length; i++) {
TypeBinding derivedType = derivedTypes[i];
- if (derivedType == null)
+ if (derivedType == null)
break;
if (!derivedType.isWildcard() || derivedType.actualType() != genericType || derivedType.rank() != rank) //$IDENTITY-COMPARISON$
continue;
@@ -256,13 +256,13 @@ public class AnnotatableTypeSystem extends TypeSystem {
if (!derivedType.hasTypeAnnotations())
nakedType = (WildcardBinding) derivedType;
}
-
+
if (nakedType == null)
nakedType = super.getWildcard(genericType, rank, bound, otherBounds, boundKind);
-
+
if (!haveTypeAnnotations(genericType, bound, otherBounds, annotations))
return nakedType;
-
+
WildcardBinding wildcard = new WildcardBinding(genericType, rank, bound, otherBounds, boundKind, this.environment);
wildcard.id = nakedType.id;
wildcard.setTypeAnnotations(annotations, this.isAnnotationBasedNullAnalysisEnabled);
@@ -279,10 +279,10 @@ public class AnnotatableTypeSystem extends TypeSystem {
*/
@Override
public TypeBinding getAnnotatedType(TypeBinding type, AnnotationBinding[][] annotations) {
-
+
if (type == null || !type.isValidBinding() || annotations == null || annotations.length == 0)
return type;
-
+
TypeBinding annotatedType = null;
switch (type.kind()) {
case Binding.ARRAY_TYPE:
@@ -298,17 +298,17 @@ public class AnnotatableTypeSystem extends TypeSystem {
case Binding.WILDCARD_TYPE:
case Binding.INTERSECTION_TYPE:
case Binding.INTERSECTION_TYPE18:
- /* Taking the binding of QTR as an example, there could be different annotatable components, but we come in a with a single binding, e.g:
+ /* Taking the binding of QTR as an example, there could be different annotatable components, but we come in a with a single binding, e.g:
@T Z; type => Z annotations => [[@T]]
@T Y.@T Z type => Z annotations => [[@T][@T]]
- @T X.@T Y.@T Z type => Z annotations => [[@T][@T][@T]]
+ @T X.@T Y.@T Z type => Z annotations => [[@T][@T][@T]]
java.lang.@T X.@T Y.@T Z type => Z annotations => [[][][@T][@T][@T]]
in all these cases the incoming type binding is for Z, but annotations are for different levels. We need to align their layout for proper attribution.
*/
-
+
if (type.isUnresolvedType() && CharOperation.indexOf('$', type.sourceName()) > 0)
type = BinaryTypeBinding.resolveType(type, this.environment, true); // must resolve member types before asking for enclosingType
-
+
int levels = type.depth() + 1;
TypeBinding [] types = new TypeBinding[levels];
types[--levels] = type;
@@ -324,7 +324,7 @@ public class AnnotatableTypeSystem extends TypeSystem {
if (annotations[i] != null && annotations[i].length > 0)
break;
}
- if (i == levels) // empty annotations array ?
+ if (i == levels) // empty annotations array ?
return type;
if (j < 0) // Not kosher, broken type that is not flagged as invalid while reporting compilation error ? don't touch.
return type;
@@ -343,10 +343,10 @@ public class AnnotatableTypeSystem extends TypeSystem {
return annotatedType;
}
- /* Private subroutine for public APIs. Create an annotated version of the type. To materialize the annotated version, we can't use new since
- this is a general purpose method designed to deal type bindings of all types. "Clone" the incoming type, specializing for any enclosing type
- that may itself be possibly be annotated. This is so the binding for @Outer Outer.Inner != Outer.@Inner Inner != @Outer Outer.@Inner Inner.
- Likewise so the bindings for @Readonly List<@NonNull String> != @Readonly List<@Nullable String> != @Readonly List<@Interned String>
+ /* Private subroutine for public APIs. Create an annotated version of the type. To materialize the annotated version, we can't use new since
+ this is a general purpose method designed to deal type bindings of all types. "Clone" the incoming type, specializing for any enclosing type
+ that may itself be possibly be annotated. This is so the binding for @Outer Outer.Inner != Outer.@Inner Inner != @Outer Outer.@Inner Inner.
+ Likewise so the bindings for @Readonly List<@NonNull String> != @Readonly List<@Nullable String> != @Readonly List<@Interned String>
*/
private TypeBinding getAnnotatedType(TypeBinding type, TypeBinding enclosingType, AnnotationBinding[] annotations) {
if (type.kind() == Binding.PARAMETERIZED_TYPE) {
@@ -371,10 +371,10 @@ public class AnnotatableTypeSystem extends TypeSystem {
for (int i = 0, length = derivedTypes.length; i < length; i++) {
TypeBinding derivedType = derivedTypes[i];
if (derivedType == null) break;
-
+
if (derivedType.enclosingType() != enclosingType || !Util.effectivelyEqual(derivedType.typeArguments(), type.typeArguments())) //$IDENTITY-COMPARISON$
continue;
-
+
switch(type.kind()) {
case Binding.ARRAY_TYPE:
if (!derivedType.isArrayType() || derivedType.dimensions() != type.dimensions() || derivedType.leafComponentType() != type.leafComponentType()) //$IDENTITY-COMPARISON$
@@ -414,10 +414,10 @@ public class AnnotatableTypeSystem extends TypeSystem {
}
if (nakedType == null)
nakedType = getUnannotatedType(type);
-
+
if (!haveTypeAnnotations(type, enclosingType, null, annotations))
return nakedType;
-
+
TypeBinding annotatedType = type.clone(enclosingType);
annotatedType.id = nakedType.id;
annotatedType.setTypeAnnotations(annotations, this.isAnnotationBasedNullAnalysisEnabled);
@@ -458,12 +458,12 @@ public class AnnotatableTypeSystem extends TypeSystem {
private boolean haveTypeAnnotations(TypeBinding leafType, AnnotationBinding[] annotations) {
return haveTypeAnnotations(leafType, null, null, annotations);
}
-
+
private boolean haveTypeAnnotations(TypeBinding memberType, TypeBinding enclosingType) {
return haveTypeAnnotations(memberType, enclosingType, null, null);
}
- /* Utility method to "flatten" annotations. For multidimensional arrays, we encode the annotations into a flat array
+ /* Utility method to "flatten" annotations. For multidimensional arrays, we encode the annotations into a flat array
where a null separates the annotations of dimension n from dimension n - 1 as well as dimenion n + 1. There is a
final null always.
*/
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/AnnotationBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/AnnotationBinding.java
index 912c34c46..3aa1b607c 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/AnnotationBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/AnnotationBinding.java
@@ -160,7 +160,7 @@ private static AnnotationBinding buildTargetAnnotation(long bits, LookupEnvironm
arraysize++;
if ((bits & TagBits.AnnotationForRecordComponent) != 0)
arraysize++;
-
+
Object[] value = new Object[arraysize];
if (arraysize > 0) {
ReferenceBinding elementType = env.getResolvedType(TypeConstants.JAVA_LANG_ANNOTATION_ELEMENTTYPE, null);
@@ -249,7 +249,7 @@ public String toString() {
if (this.pairs != null && this.pairs.length > 0) {
buffer.append('(');
if (this.pairs.length == 1 && CharOperation.equals(this.pairs[0].getName(), TypeConstants.VALUE)) {
- buffer.append(this.pairs[0].value);
+ buffer.append(this.pairs[0].value);
} else {
for (int i = 0, max = this.pairs.length; i < max; i++) {
if (i > 0) buffer.append(", "); //$NON-NLS-1$
@@ -284,7 +284,7 @@ public boolean equals(Object object) {
final ElementValuePair[] thisElementValuePairs = this.getElementValuePairs();
final ElementValuePair[] thatElementValuePairs = that.getElementValuePairs();
final int length = thisElementValuePairs.length;
- if (length != thatElementValuePairs.length)
+ if (length != thatElementValuePairs.length)
return false;
loop: for (int i = 0; i < length; i++) {
ElementValuePair thisPair = thisElementValuePairs[i];
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.java
index 1005de5a9..6f4b38375 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.java
@@ -59,7 +59,7 @@ public final class ArrayBinding extends TypeBinding {
// possible bits are TagBits.AnnotationNonNull and TagBits.AnnotationNullable
// (only ever set when CompilerOptions.isAnnotationBasedNullAnalysisEnabled == true):
public long[] nullTagBitsPerDimension;
-
+
private MethodBinding clone;
public ArrayBinding(TypeBinding type, int dimensions, LookupEnvironment environment) {
@@ -210,13 +210,13 @@ public int dimensions() {
*/
public TypeBinding elementsType() {
-
- if (this.dimensions == 1)
+
+ if (this.dimensions == 1)
return this.leafComponentType;
-
+
AnnotationBinding [] oldies = getTypeAnnotations();
AnnotationBinding [] newbies = Binding.NO_ANNOTATIONS;
-
+
for (int i = 0, length = oldies == null ? 0 : oldies.length; i < length; i++) {
if (oldies[i] == null) {
System.arraycopy(oldies, i+1, newbies = new AnnotationBinding[length - i - 1], 0, length - i - 1);
@@ -402,8 +402,8 @@ public char[] nullAnnotatedReadableName(CompilerOptions options, boolean shortNa
fqAnnotationName = options.nonNullAnnotationName;
else
fqAnnotationName = options.nullableAnnotationName;
- char[] annotationName = shortNames
- ? fqAnnotationName[fqAnnotationName.length-1]
+ char[] annotationName = shortNames
+ ? fqAnnotationName[fqAnnotationName.length-1]
: CharOperation.concatWith(fqAnnotationName, '.');
brackets[i] = new char[annotationName.length+3];
brackets[i][0] = '@';
@@ -411,10 +411,10 @@ public char[] nullAnnotatedReadableName(CompilerOptions options, boolean shortNa
brackets[i][annotationName.length+1] = '[';
brackets[i][annotationName.length+2] = ']';
} else {
- brackets[i] = new char[]{'[', ']'};
+ brackets[i] = new char[]{'[', ']'};
}
}
- return CharOperation.concat(this.leafComponentType.nullAnnotatedReadableName(options, shortNames),
+ return CharOperation.concat(this.leafComponentType.nullAnnotatedReadableName(options, shortNames),
CharOperation.concatWith(brackets, ' '),
' ');
}
@@ -453,12 +453,12 @@ public void setTypeAnnotations(AnnotationBinding[] annotations, boolean evalNull
if (annotations == null || annotations.length == 0)
return;
this.typeAnnotations = annotations;
-
+
if (evalNullAnnotations) {
long nullTagBits = 0;
if (this.nullTagBitsPerDimension == null)
this.nullTagBitsPerDimension = new long[this.dimensions + 1];
-
+
int dimension = 0;
for (int i = 0, length = annotations.length; i < length; i++) {
AnnotationBinding annotation = annotations[i];
@@ -507,15 +507,15 @@ public void swapUnresolved(UnresolvedReferenceBinding unresolvedType, ReferenceB
/* Leaf component type is the key in the type system. If it undergoes change, the array has to be rehashed.
We achieve by creating a fresh array with the new component type and equating this array's id with that.
This means this array can still be found under the old key, but that is harmless (since the component type
- is always consulted (see TypeSystem.getArrayType()).
-
- This also means that this array type is not a fully interned singleton: There is `this' object and there is
- the array that is being created down below that gets cached by the type system and doled out for all further
- array creations against the same (raw) component type, dimensions and annotations. This again is harmless,
- since TypeBinding.id is consulted for (in)equality checks.
-
+ is always consulted (see TypeSystem.getArrayType()).
+
+ This also means that this array type is not a fully interned singleton: There is `this' object and there is
+ the array that is being created down below that gets cached by the type system and doled out for all further
+ array creations against the same (raw) component type, dimensions and annotations. This again is harmless,
+ since TypeBinding.id is consulted for (in)equality checks.
+
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=430425 for details and a test case.
- */
+ */
if (this.leafComponentType != resolvedType) //$IDENTITY-COMPARISON$
this.id = env.createArrayType(this.leafComponentType, this.dimensions, this.typeAnnotations).id;
this.tagBits |= this.leafComponentType.tagBits & (TagBits.HasTypeVariable | TagBits.HasDirectWildcard | TagBits.HasMissingType | TagBits.HasCapturedWildcard);
@@ -561,7 +561,7 @@ public boolean acceptsNonNullDefault() {
@Override
public long updateTagBits() {
if (this.leafComponentType != null)
- this.tagBits |= this.leafComponentType.updateTagBits();
+ this.tagBits |= this.leafComponentType.updateTagBits();
return super.updateTagBits();
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BaseTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BaseTypeBinding.java
index a7f49f048..ba5ac37cb 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BaseTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BaseTypeBinding.java
@@ -24,17 +24,17 @@ public class BaseTypeBinding extends TypeBinding {
public static final int WIDENING = 2;
public static final int NARROWING = 4;
public static final int MAX_CONVERSIONS = 16*16; // well-known x well-known
-
+
static {
CONVERSIONS = initializeConversions();
}
-
+
public static final int[] initializeConversions(){
// fromType destType --> conversion
// 0000 0000 0000
int[] table = new int[MAX_CONVERSIONS];
-
+
table[TypeIds.Boolean2Boolean] = IDENTITY;
table[TypeIds.Byte2Byte] = IDENTITY;
@@ -92,7 +92,7 @@ public class BaseTypeBinding extends TypeBinding {
table[TypeIds.Double2Long] = NARROWING;
table[TypeIds.Double2Float] = NARROWING;
table[TypeIds.Double2Double]= IDENTITY;
-
+
return table;
}
/**
@@ -104,8 +104,8 @@ public class BaseTypeBinding extends TypeBinding {
*/
public static final boolean isNarrowing(int left, int right) {
int right2left = right + (left<<4);
- return right2left >= 0
- && right2left < MAX_CONVERSIONS
+ return right2left >= 0
+ && right2left < MAX_CONVERSIONS
&& (CONVERSIONS[right2left] & (IDENTITY|NARROWING)) != 0;
}
@@ -118,11 +118,11 @@ public class BaseTypeBinding extends TypeBinding {
*/
public static final boolean isWidening(int left, int right) {
int right2left = right + (left<<4);
- return right2left >= 0
- && right2left < MAX_CONVERSIONS
+ return right2left >= 0
+ && right2left < MAX_CONVERSIONS
&& (CONVERSIONS[right2left] & (IDENTITY|WIDENING)) != 0;
}
-
+
public char[] simpleName;
private char[] constantPoolName;
@@ -154,13 +154,13 @@ public class BaseTypeBinding extends TypeBinding {
public TypeBinding clone(TypeBinding enclosingType) {
return new BaseTypeBinding(this.id, this.simpleName, this.constantPoolName);
}
-
+
@Override
public PackageBinding getPackage() {
return null;
}
-
+
/* Answer true if the receiver type can be assigned to the argument type (right)
*/
@Override
@@ -168,13 +168,13 @@ public class BaseTypeBinding extends TypeBinding {
if (equalsEquals(this, right))
return true;
int right2left = this.id + (right.id<<4);
- if (right2left >= 0
- && right2left < MAX_CONVERSIONS
+ if (right2left >= 0
+ && right2left < MAX_CONVERSIONS
&& (CONVERSIONS[right2left] & (IDENTITY|WIDENING)) != 0)
return true;
return this == TypeBinding.NULL && !right.isBaseType();
}
-
+
@Override
public void setTypeAnnotations(AnnotationBinding[] annotations, boolean evalNullAnnotations) {
super.setTypeAnnotations(annotations, false); // never set nullTagBits on base types
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryModuleBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryModuleBinding.java
index 5102e9ca1..4f35dc217 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryModuleBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryModuleBinding.java
@@ -28,7 +28,7 @@ import org.eclipse.jdt.internal.compiler.util.Util;
import org.eclipse.jdt.internal.compiler.env.IModuleAwareNameEnvironment;
public class BinaryModuleBinding extends ModuleBinding {
-
+
private static class AutomaticModuleBinding extends ModuleBinding {
boolean autoNameFromManifest;
@@ -80,12 +80,12 @@ public class BinaryModuleBinding extends ModuleBinding {
return this.moduleName;
}
}
-
+
private IPackageExport[] unresolvedExports;
private IPackageExport[] unresolvedOpens;
private char[][] unresolvedUses;
private IService[] unresolvedProvides;
-
+
/**
* Construct a named module from binary, could be an auto module - or from an info from Java Model.
* <p>
@@ -106,7 +106,7 @@ public class BinaryModuleBinding extends ModuleBinding {
existingEnvironment.root.knownModules.put(this.moduleName, this);
cachePartsFrom(module);
}
-
+
void cachePartsFrom(IBinaryModule module) {
if (module.isOpen())
this.modifiers |= ClassFileConstants.ACC_OPEN;
@@ -173,7 +173,7 @@ public class BinaryModuleBinding extends ModuleBinding {
resolvePackages();
return super.getExports();
}
-
+
@Override
public PlainPackageBinding[] getOpens() {
if (this.openedPackages == null && this.unresolvedOpens != null)
@@ -195,7 +195,7 @@ public class BinaryModuleBinding extends ModuleBinding {
}
if (count < this.exportedPackages.length)
System.arraycopy(this.exportedPackages, 0, this.exportedPackages = new PlainPackageBinding[count], 0, count);
-
+
this.openedPackages = new PlainPackageBinding[this.unresolvedOpens.length];
count = 0;
for (int i = 0; i < this.unresolvedOpens.length; i++) {
@@ -224,7 +224,7 @@ public class BinaryModuleBinding extends ModuleBinding {
}
return super.getUses();
}
-
+
@Override
public TypeBinding[] getServices() {
if (this.services == null)
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java
index fd82699cb..23044b80c 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java
@@ -192,7 +192,7 @@ public class BinaryTypeBinding extends ReferenceBinding {
}
}
public ExternalAnnotationStatus externalAnnotationStatus = ExternalAnnotationStatus.NOT_EEA_CONFIGURED; // unless proven differently
-
+
//{ObjectTeams: support callout-to-field
/** Callout to field adds faked access method (set or get): */
@@ -283,18 +283,18 @@ static Object convertMemberValue(Object binaryValue, LookupEnvironment env, char
public TypeBinding clone(TypeBinding outerType) {
BinaryTypeBinding copy = new BinaryTypeBinding(this);
copy.enclosingType = (ReferenceBinding) outerType;
-
+
/* BinaryTypeBinding construction is not "atomic" and is split between the constructor and cachePartsFrom and between the two
stages of construction, clone can kick in when LookupEnvironment.createBinaryTypeFrom calls PackageBinding.addType. This
can result in some URB's being resolved, which could trigger the clone call, leaving the clone with semi-initialized prototype.
Fortunately, the protocol for this type demands all clients to use public access methods, where we can deflect the call to the
prototype. enclosingType() and memberTypes() should not delegate, so ...
*/
- if (copy.enclosingType != null)
+ if (copy.enclosingType != null)
copy.tagBits |= TagBits.HasUnresolvedEnclosingType;
- else
+ else
copy.tagBits &= ~TagBits.HasUnresolvedEnclosingType;
-
+
copy.tagBits |= TagBits.HasUnresolvedMemberTypes;
return copy;
}
@@ -407,7 +407,7 @@ public BinaryTypeBinding(PackageBinding packageBinding, IBinaryType binaryType,
* @param needFieldsAndMethods
*/
public BinaryTypeBinding(PackageBinding packageBinding, IBinaryType binaryType, LookupEnvironment environment, boolean needFieldsAndMethods) {
-
+
this.prototype = this;
this.compoundName = CharOperation.splitOn('/', binaryType.getName());
computeId();
@@ -467,11 +467,11 @@ public boolean canBeSeenBy(Scope sco) {
*/
@Override
public FieldBinding[] availableFields() {
-
+
if (!isPrototype()) {
return this.prototype.availableFields();
}
-
+
if ((this.tagBits & TagBits.AreFieldsComplete) != 0)
return this.fields;
@@ -501,7 +501,7 @@ private TypeVariableBinding[] addMethodTypeVariables(TypeVariableBinding[] metho
if (!isPrototype()) throw new IllegalStateException();
if (this.typeVariables == null || this.typeVariables == Binding.NO_TYPE_VARIABLES) {
return methodTypeVars;
- }
+ }
if (methodTypeVars == null || methodTypeVars == Binding.NO_TYPE_VARIABLES) {
return this.typeVariables;
}
@@ -528,7 +528,7 @@ private TypeVariableBinding[] addMethodTypeVariables(TypeVariableBinding[] metho
*/
@Override
public MethodBinding[] availableMethods() {
-
+
if (!isPrototype()) {
return this.prototype.availableMethods();
}
@@ -656,7 +656,7 @@ void cachePartsFrom(IBinaryType binaryType, boolean needFieldsAndMethods) {
this.tagBits |= binaryType.getTagBits();
if (this.environment.globalOptions.complianceLevel < ClassFileConstants.JDK1_8)
this.tagBits &= ~TagBits.AnnotationForTypeUse; // avoid confusion with semantics that are not supported at 1.7-
-
+
char[][][] missingTypeNames = binaryType.getMissingTypeNames();
SignatureWrapper wrapper = null;
if (typeSignature != null) {
@@ -677,7 +677,7 @@ void cachePartsFrom(IBinaryType binaryType, boolean needFieldsAndMethods) {
MethodBinding enclosingMethod = findMethod(methodDescriptor, missingTypeNames);
if (enclosingMethod != null) {
typeVars = enclosingMethod.typeVariables;
- this.typeVariables = addMethodTypeVariables(typeVars);
+ this.typeVariables = addMethodTypeVariables(typeVars);
}
}
if (typeSignature == null) {
@@ -716,7 +716,7 @@ void cachePartsFrom(IBinaryType binaryType, boolean needFieldsAndMethods) {
}
} else {
// attempt to find the superclass if it exists in the cache (otherwise - resolve it when requested)
- this.superclass = (ReferenceBinding) this.environment.getTypeFromTypeSignature(wrapper, typeVars, this, missingTypeNames,
+ this.superclass = (ReferenceBinding) this.environment.getTypeFromTypeSignature(wrapper, typeVars, this, missingTypeNames,
toplevelWalker.toSupertype((short) -1, wrapper.peekFullType()));
//{ObjectTeams: wrapping of type (incl. its arguments)?
if (!TypeAnalyzer.isTopConfined(this.superclass))
@@ -1108,7 +1108,7 @@ private MethodBinding createMethod(IBinaryMethod method, IBinaryType binaryType,
if (!method.isConstructor())
returnType = this.environment.getTypeFromSignature(methodDescriptor, index + 1, -1, false, this, missingTypeNames, walker.toMethodReturn()); // index is currently pointing at the ')'
-
+
final int argumentNamesLength = argumentNames == null ? 0 : argumentNames.length;
if (startIndex > 0 && argumentNamesLength > 0) {
// We'll have to slice the starting arguments off
@@ -1199,7 +1199,7 @@ private MethodBinding createMethod(IBinaryMethod method, IBinaryType binaryType,
// SH}
? new MethodBinding(methodModifiers, parameters, exceptions, this)
: new MethodBinding(methodModifiers, method.getSelector(), returnType, parameters, exceptions, this);
-
+
IBinaryAnnotation[] receiverAnnotations = walker.toReceiver().getAnnotationsAtCursor(this.id, false);
if (receiverAnnotations != null && receiverAnnotations.length > 0) {
result.receiver = this.environment.createAnnotatedType(this, createAnnotations(receiverAnnotations, this.environment, missingTypeNames));
@@ -1225,7 +1225,7 @@ private MethodBinding createMethod(IBinaryMethod method, IBinaryType binaryType,
}
if (argumentNames != null) result.parameterNames = argumentNames;
-
+
if (use15specifics)
result.tagBits |= method.getTagBits();
result.typeVariables = typeVars;
@@ -1404,7 +1404,7 @@ private TypeVariableBinding[] createTypeVariables(SignatureWrapper wrapper, bool
int colon = CharOperation.indexOf(Util.C_COLON, typeSignature, i);
char[] variableName = CharOperation.subarray(typeSignature, i, colon);
TypeVariableBinding typeVariable = new TypeVariableBinding(variableName, this, rank, this.environment);
- AnnotationBinding [] annotations = BinaryTypeBinding.createAnnotations(walker.toTypeParameter(isClassTypeParameter, rank++).getAnnotationsAtCursor(0, false),
+ AnnotationBinding [] annotations = BinaryTypeBinding.createAnnotations(walker.toTypeParameter(isClassTypeParameter, rank++).getAnnotationsAtCursor(0, false),
this.environment, missingTypeNames);
if (annotations != null && annotations != Binding.NO_ANNOTATIONS)
typeVariable.setTypeAnnotations(annotations, this.environment.globalOptions.isAnnotationBasedNullAnalysisEnabled);
@@ -1445,7 +1445,7 @@ public ReferenceBinding enclosingType() { // should not delegate to prototype.
// NOTE: the type of each field of a binary type is resolved when needed
@Override
public FieldBinding[] fields() {
-
+
if (!isPrototype()) {
return this.fields = this.prototype.fields();
}
@@ -1517,7 +1517,7 @@ private MethodBinding findMethod(char[] methodDescriptor, char[][][] missingType
/* orig:
if (TypeBinding.notEquals(parameters[j], parameters2[j]) && TypeBinding.notEquals(parameters[j].erasure(), parameters2[j].erasure())) {
:giro */
- if ( !AnchorMapping.areTypesEqual(parameters[j], parameters2[j], currentMethod)
+ if ( !AnchorMapping.areTypesEqual(parameters[j], parameters2[j], currentMethod)
&& !AnchorMapping.areTypesEqual(parameters[j].erasure(), parameters2[j].erasure(), currentMethod)) {
// SH}
continue loop;
@@ -1648,7 +1648,7 @@ public MethodBinding getExactMethod(char[] selector, TypeBinding[] argumentTypes
//NOTE: the type of a field of a binary type is resolved when needed
@Override
public FieldBinding getField(char[] fieldName, boolean needResolve) {
-
+
if (!isPrototype())
return this.prototype.getField(fieldName, needResolve);
@@ -1738,7 +1738,7 @@ public static final TypeDeclaration binaryEnclosingTeam = new TypeDeclaration(nu
// NOTE: the return type, arg & exception types of each method of a binary type are resolved when needed
@Override
public MethodBinding[] getMethods(char[] selector) {
-
+
if (!isPrototype())
return this.prototype.getMethods(selector);
@@ -1779,7 +1779,7 @@ public MethodBinding[] getMethods(char[] selector) {
// The suggested parameter length is optional and may not be guaranteed by every type.
@Override
public MethodBinding[] getMethods(char[] selector, int suggestedParameterLength) {
-
+
if (!isPrototype())
return this.prototype.getMethods(selector, suggestedParameterLength);
@@ -1838,10 +1838,10 @@ public TypeVariableBinding getTypeVariable(char[] variableName) {
}
@Override
public boolean hasTypeBit(int bit) {
-
+
if (!isPrototype())
return this.prototype.hasTypeBit(bit);
-
+
// ensure hierarchy is resolved, which will propagate bits down to us
boolean wasToleratingMissingTypeProcessingAnnotations = this.environment.mayTolerateMissingType;
this.environment.mayTolerateMissingType = true;
@@ -1903,7 +1903,7 @@ private void initializeTypeVariable(TypeVariableBinding variable, TypeVariableBi
*/
@Override
public boolean isEquivalentTo(TypeBinding otherType) {
-
+
if (TypeBinding.equalsEquals(this, otherType)) return true;
if (otherType == null) return false;
switch(otherType.kind()) {
@@ -1912,12 +1912,12 @@ public boolean isEquivalentTo(TypeBinding otherType) {
return ((WildcardBinding) otherType).boundCheck(this);
case Binding.PARAMETERIZED_TYPE:
/* With the hybrid 1.4/1.5+ projects modes, while establishing type equivalence, we need to
- be prepared for a type such as Map appearing in one of three forms: As (a) a ParameterizedTypeBinding
- e.g Map<String, String>, (b) as RawTypeBinding Map#RAW and finally (c) as a BinaryTypeBinding
+ be prepared for a type such as Map appearing in one of three forms: As (a) a ParameterizedTypeBinding
+ e.g Map<String, String>, (b) as RawTypeBinding Map#RAW and finally (c) as a BinaryTypeBinding
When the usage of a type lacks type parameters, whether we land up with the raw form or not depends
on whether the underlying type was "seen to be" a generic type in the particular build environment or
- not. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=186565 && https://bugs.eclipse.org/bugs/show_bug.cgi?id=328827
- */
+ not. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=186565 && https://bugs.eclipse.org/bugs/show_bug.cgi?id=328827
+ */
case Binding.RAW_TYPE :
return TypeBinding.equalsEquals(otherType.erasure(), this);
}
@@ -1925,18 +1925,18 @@ public boolean isEquivalentTo(TypeBinding otherType) {
}
@Override
public boolean isGenericType() {
-
+
if (!isPrototype())
return this.prototype.isGenericType();
-
+
return this.typeVariables != Binding.NO_TYPE_VARIABLES;
}
@Override
public boolean isHierarchyConnected() {
-
+
if (!isPrototype())
return this.prototype.isHierarchyConnected();
-
+
return (this.tagBits & (TagBits.HasUnresolvedSuperclass | TagBits.HasUnresolvedSuperinterfaces)) == 0;
}
@Override
@@ -1946,10 +1946,10 @@ public boolean isRepeatableAnnotationType() {
}
@Override
public int kind() {
-
+
if (!isPrototype())
return this.prototype.kind();
-
+
if (this.typeVariables != Binding.NO_TYPE_VARIABLES)
return Binding.GENERIC_TYPE;
return Binding.TYPE;
@@ -1976,7 +1976,7 @@ public ReferenceBinding[] memberTypes() {
this.memberTypesSorted = true;
return this.memberTypes;
}
-
+
if ((this.tagBits & TagBits.HasUnresolvedMemberTypes) == 0) {
return maybeSortedMemberTypes();
}
@@ -2004,11 +2004,11 @@ private ReferenceBinding[] maybeSortedMemberTypes() {
// NOTE: the return type, arg & exception types of each method of a binary type are resolved when needed
@Override
public MethodBinding[] methods() {
-
+
if (!isPrototype()) {
return this.methods = this.prototype.methods();
}
-
+
if ((this.tagBits & TagBits.AreMethodsComplete) != 0)
return this.methods;
@@ -2052,10 +2052,10 @@ public ReferenceBinding containerAnnotationType() {
}
private FieldBinding resolveTypeFor(FieldBinding field) {
-
+
if (!isPrototype())
return this.prototype.resolveTypeFor(field);
-
+
if ((field.modifiers & ExtraCompilerModifiers.AccUnresolved) == 0)
return field;
@@ -2086,10 +2086,10 @@ private FieldBinding resolveTypeFor(FieldBinding field) {
return field;
}
MethodBinding resolveTypesFor(MethodBinding method) {
-
+
if (!isPrototype())
return this.prototype.resolveTypesFor(method);
-
+
if ((method.modifiers & ExtraCompilerModifiers.AccUnresolved) == 0)
return method;
@@ -2138,10 +2138,10 @@ MethodBinding resolveTypesFor(MethodBinding method) {
public
// SH}
AnnotationBinding[] retrieveAnnotations(Binding binding) {
-
+
if (!isPrototype())
return this.prototype.retrieveAnnotations(binding);
-
+
return AnnotationBinding.addStandardAnnotations(super.retrieveAnnotations(binding), binding.getAnnotationTagBits(), this.environment);
}
@@ -2160,10 +2160,10 @@ public void tagAsHavingDefectiveContainerType() {
@Override
SimpleLookupTable storedAnnotations(boolean forceInitialize, boolean forceStore) {
-
+
if (!isPrototype())
return this.prototype.storedAnnotations(forceInitialize, forceStore);
-
+
if (forceInitialize && this.storedAnnotations == null) {
//{ObjectTeams: do support annotations for roles for the sake of copying:
if (!this.isRole())
@@ -2209,7 +2209,7 @@ private void scanFieldForNullAnnotation(IBinaryField field, FieldBinding fieldBi
boolean explicitNullness = false;
IBinaryAnnotation[] annotations = externalAnnotationWalker != ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER
- ? externalAnnotationWalker.getAnnotationsAtCursor(fieldBinding.type.id, false)
+ ? externalAnnotationWalker.getAnnotationsAtCursor(fieldBinding.type.id, false)
: field.getAnnotations();
if (annotations != null) {
for (int i = 0; i < annotations.length; i++) {
@@ -2351,8 +2351,8 @@ private void scanMethodForNullAnnotation(IBinaryMethod method, MethodBinding met
}
}
if (useNullTypeAnnotations && this.externalAnnotationStatus.isPotentiallyUnannotatedLib()) {
- if (methodBinding.returnType.hasNullTypeAnnotations()
- || (methodBinding.tagBits & TagBits.AnnotationNullMASK) != 0
+ if (methodBinding.returnType.hasNullTypeAnnotations()
+ || (methodBinding.tagBits & TagBits.AnnotationNullMASK) != 0
|| methodBinding.parameterNonNullness != null) {
this.externalAnnotationStatus = ExternalAnnotationStatus.TYPE_IS_ANNOTATED;
} else {
@@ -2482,7 +2482,7 @@ public static int evaluateTypeQualifierDefault(ReferenceBinding annotationType)
for (Object value1 : values)
nullness |= Annotation.nullLocationBitsFromElementTypeAnnotationValue(value1);
} else {
- nullness |= Annotation.nullLocationBitsFromElementTypeAnnotationValue(value);
+ nullness |= Annotation.nullLocationBitsFromElementTypeAnnotationValue(value);
}
return nullness;
}
@@ -2529,11 +2529,11 @@ private void scanTypeForContainerAnnotation(IBinaryType binaryType, char[][][] m
*/
@Override
public ReferenceBinding superclass() {
-
+
if (!isPrototype()) {
return this.superclass = this.prototype.superclass();
}
-
+
if ((this.tagBits & TagBits.HasUnresolvedSuperclass) == 0)
return this.superclass;
@@ -2554,7 +2554,7 @@ public ReferenceBinding superclass() {
}
}
this.typeBits |= (this.superclass.typeBits & TypeIds.InheritableBits);
- if ((this.typeBits & (TypeIds.BitAutoCloseable|TypeIds.BitCloseable)) != 0) // avoid the side-effects of hasTypeBit()!
+ if ((this.typeBits & (TypeIds.BitAutoCloseable|TypeIds.BitCloseable)) != 0) // avoid the side-effects of hasTypeBit()!
this.typeBits |= applyCloseableClassWhitelists(this.environment.globalOptions);
detectCircularHierarchy();
return this.superclass;
@@ -2571,7 +2571,7 @@ private void breakLoop() {
currentSuper.tagBits |= TagBits.EndHierarchyCheck;
prevSuper = currentSuper;
currentSuper = currentSuper.superclass();
- }
+ }
}
private void detectCircularHierarchy() {
@@ -2579,14 +2579,14 @@ private void detectCircularHierarchy() {
ReferenceBinding tempSuper = null;
int count = 0;
int skipCount = 20;
- while (currentSuper != null) {
+ while (currentSuper != null) {
if (currentSuper.hasHierarchyCheckStarted())
break;
if (TypeBinding.equalsEquals(currentSuper, this) || TypeBinding.equalsEquals(currentSuper, tempSuper)) {
currentSuper.tagBits |= TagBits.HierarchyHasProblems;
if (currentSuper.isBinaryBinding())
breakLoop();
-
+
return;
}
if (count == skipCount) {
@@ -2595,19 +2595,19 @@ private void detectCircularHierarchy() {
count = 0;
}
//Ignore if the super is not yet resolved..
- if (!currentSuper.isHierarchyConnected())
+ if (!currentSuper.isHierarchyConnected())
return;
- currentSuper = currentSuper.superclass();
+ currentSuper = currentSuper.superclass();
count++;
}
/* No loop detected and completely found that there is no loop
- * So, set that info for all the classes
+ * So, set that info for all the classes
*/
tempSuper = this;
while (TypeBinding.notEquals(currentSuper, tempSuper)) {
tempSuper.setHierarchyCheckDone();
tempSuper=tempSuper.superclass();
- }
+ }
}
//{ObjectTeams:
@@ -2641,7 +2641,7 @@ public void resetSuperclass(ReferenceBinding superClass) {
// NOTE: superInterfaces of binary types are resolved when needed
@Override
public ReferenceBinding[] superInterfaces() {
-
+
if (!isPrototype()) {
return this.superInterfaces = this.prototype.superInterfaces();
}
@@ -2668,10 +2668,10 @@ public ReferenceBinding[] superInterfaces() {
this.superInterfaces[i].superInterfaces();
} finally {
this.environment.mayTolerateMissingType = wasToleratingMissingTypeProcessingAnnotations;
- }
+ }
}
this.typeBits |= (this.superInterfaces[i].typeBits & TypeIds.InheritableBits);
- if ((this.typeBits & (TypeIds.BitAutoCloseable|TypeIds.BitCloseable)) != 0) // avoid the side-effects of hasTypeBit()!
+ if ((this.typeBits & (TypeIds.BitAutoCloseable|TypeIds.BitCloseable)) != 0) // avoid the side-effects of hasTypeBit()!
this.typeBits |= applyCloseableInterfaceWhitelists();
}
this.tagBits &= ~TagBits.HasUnresolvedSuperinterfaces;
@@ -2679,7 +2679,7 @@ public ReferenceBinding[] superInterfaces() {
}
@Override
public TypeVariableBinding[] typeVariables() {
-
+
if (!isPrototype()) {
return this.typeVariables = this.prototype.typeVariables();
}
@@ -2693,10 +2693,10 @@ public TypeVariableBinding[] typeVariables() {
}
@Override
public String toString() {
-
+
if (this.hasTypeAnnotations())
return annotatedDebugName();
-
+
StringBuffer buffer = new StringBuffer();
if (isDeprecated()) buffer.append("deprecated "); //$NON-NLS-1$
@@ -2809,19 +2809,19 @@ public TypeBinding withoutToplevelNullAnnotation() {
}
@Override
MethodBinding[] unResolvedMethods() { // for the MethodVerifier so it doesn't resolve types
-
+
if (!isPrototype())
return this.prototype.unResolvedMethods();
-
+
return this.methods;
}
@Override
public FieldBinding[] unResolvedFields() {
-
+
if (!isPrototype())
return this.prototype.unResolvedFields();
-
+
return this.fields;
}
//{ObjectTeams: for use by TypeModel:
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Binding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Binding.java
index 8a4798823..814a7aec9 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Binding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Binding.java
@@ -54,8 +54,8 @@ public abstract class Binding {
public static final int TYPE_USE = TYPE | ASTNode.Bit15;
public static final int INTERSECTION_TYPE18 = TYPE | ASTNode.Bit16;
public static final int POLY_TYPE = TYPE | ASTNode.Bit17;
-
- // In the unlikely event you add a new type binding, remember to update TypeBindingVisitor and Scope.substitute methods.
+
+ // In the unlikely event you add a new type binding, remember to update TypeBindingVisitor and Scope.substitute methods.
//{ObjectTeams
public static final int BINDING = ASTNode.Bit16; //callin/callout-Binding
@@ -83,7 +83,7 @@ public abstract class Binding {
public static final CallinCalloutBinding[] NO_CALLIN_CALLOUT_BINDINGS = new CallinCalloutBinding[0];
public static final SyntheticArgumentBinding[] NO_SYNTH_ARGUMENTS = new SyntheticArgumentBinding[0];
//Markus Witte}
-
+
public static final FieldBinding[] UNINITIALIZED_FIELDS = new FieldBinding[0];
public static final MethodBinding[] UNINITIALIZED_METHODS = new MethodBinding[0];
public static final ReferenceBinding[] UNINITIALIZED_REFERENCE_TYPES = new ReferenceBinding[0];
@@ -131,7 +131,7 @@ public abstract class Binding {
public static final int DefaultLocationsForTrueValue = DefaultLocationParameter | DefaultLocationReturnType | DefaultLocationField;
- public static final int NullnessDefaultMASK =
+ public static final int NullnessDefaultMASK =
NULL_UNSPECIFIED_BY_DEFAULT | // included to terminate search up the parent chain
DefaultLocationParameter | DefaultLocationReturnType | DefaultLocationField |
DefaultLocationTypeArgument | DefaultLocationTypeParameter | DefaultLocationTypeBound | DefaultLocationArrayContents;
@@ -160,7 +160,7 @@ public abstract class Binding {
/**
* Compute the tagbits for standard annotations. For source types, these could require
* lazily resolving corresponding annotation nodes, in case of forward references.
- * For type use bindings, this method still returns the tagbits corresponding to the type
+ * For type use bindings, this method still returns the tagbits corresponding to the type
* declaration binding.
* @see org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding#getAnnotationTagBits()
*/
@@ -180,7 +180,7 @@ public abstract class Binding {
public boolean isAnnotationType() {
return false;
}
-
+
/* API
* Answer true if the receiver is not a problem binding
*/
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java
index 9956ab7f1..d53f8d639 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java
@@ -119,16 +119,16 @@ public final void addAnonymousType(TypeDeclaration anonymousType, ReferenceBindi
anonymousClassScope.buildAnonymousTypeBinding(
enclosingSourceType(),
superBinding);
-
+
/* Tag any enclosing lambdas as instance capturing. Strictly speaking they need not be, unless the local/anonymous type references enclosing instance state.
but the types themselves track enclosing types regardless of whether the state is accessed or not. This creates a mismatch in expectations in code generation
- time, if we choose to make the lambda method static. To keep things simple and avoid a messy rollback, we force the lambda to be an instance method under
+ time, if we choose to make the lambda method static. To keep things simple and avoid a messy rollback, we force the lambda to be an instance method under
this situation. However if per source, the lambda occurs in a static context, we would generate a static synthetic method.
*/
MethodScope methodScope = methodScope();
//{ObjectTeams: nested type of method mapping (via param map)?
if (anonymousType.binding != null) {
- if ( methodScope != null
+ if ( methodScope != null
&& methodScope.referenceContext instanceof AbstractMethodDeclaration
&& ((AbstractMethodDeclaration)methodScope.referenceContext).isMappingWrapper != WrapperKind.NONE)
// in this case isRole() cannot rely of depth() because physically the type is contained in the team;
@@ -151,7 +151,7 @@ public final void addLocalType(TypeDeclaration localType) {
ClassScope localTypeScope = new ClassScope(this, localType);
addSubscope(localTypeScope);
localTypeScope.buildLocalTypeBinding(enclosingSourceType());
-
+
// See comment in addAnonymousType.
MethodScope methodScope = methodScope();
while (methodScope != null && methodScope.referenceContext instanceof LambdaExpression) {
@@ -212,7 +212,7 @@ public final boolean allowBlankFinalFieldAssignment(FieldBinding binding) {
MethodScope methodScope = methodScope();
if (methodScope.isStatic != binding.isStatic())
return false;
- if (methodScope.isLambdaScope())
+ if (methodScope.isLambdaScope())
return false;
return methodScope.isInsideInitializer() // inside initializer
|| ((AbstractMethodDeclaration) methodScope.referenceContext).isInitializationMethod(); // inside constructor or clinit
@@ -361,7 +361,7 @@ public void emulateOuterAccess(LocalVariableBinding outerLocalVariable) {
BlockScope outerVariableScope = outerLocalVariable.declaringScope;
if (outerVariableScope == null)
return; // no need to further emulate as already inserted (val$this$0)
-
+
int depth = 0;
Scope scope = this;
while (outerVariableScope != scope) {
@@ -369,7 +369,7 @@ public void emulateOuterAccess(LocalVariableBinding outerLocalVariable) {
case CLASS_SCOPE:
depth++;
break;
- case METHOD_SCOPE:
+ case METHOD_SCOPE:
if (scope.isLambdaScope()) {
LambdaExpression lambdaExpression = (LambdaExpression) scope.referenceContext();
lambdaExpression.addSyntheticArgument(outerLocalVariable);
@@ -378,9 +378,9 @@ public void emulateOuterAccess(LocalVariableBinding outerLocalVariable) {
}
scope = scope.parent;
}
- if (depth == 0)
+ if (depth == 0)
return;
-
+
MethodScope currentMethodScope = methodScope();
if (outerVariableScope.methodScope() != currentMethodScope) {
NestedTypeBinding currentType = (NestedTypeBinding) enclosingSourceType();
@@ -681,10 +681,10 @@ private Binding internalGetBinding(char[][] compoundName, int mask, InvocationSi
((ProblemFieldBinding)binding).closestMatch,
((ProblemFieldBinding)binding).declaringClass,
CharOperation.concatWith(CharOperation.subarray(compoundName, 0, currentIndex), '.'),
- binding.problemId());
+ binding.problemId());
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=317858 : If field is inaccessible,
- // don't give up yet, continue to look for a visible member type
- if (binding.problemId() != ProblemReasons.NotVisible) {
+ // don't give up yet, continue to look for a visible member type
+ if (binding.problemId() != ProblemReasons.NotVisible) {
return problemFieldBinding;
}
}
@@ -712,7 +712,7 @@ private Binding internalGetBinding(char[][] compoundName, int mask, InvocationSi
// binding is a ReferenceBinding
if (!binding.isValidBinding()) {
//{ObjectTeams: let decapsulation see into nested levels of invisible types:
- if (binding.problemId() == ProblemReasons.NotVisible
+ if (binding.problemId() == ProblemReasons.NotVisible
&& invocationSite instanceof Expression
&& ((Expression)invocationSite).getBaseclassDecapsulation().isAllowed())
{
@@ -747,7 +747,7 @@ private Binding internalGetBinding(char[][] compoundName, int mask, InvocationSi
field.declaringClass,
CharOperation.concatWith(CharOperation.subarray(compoundName, 0, currentIndex), '.'),
ProblemReasons.NonStaticReferenceInStaticContext);
- // Since a qualified reference must be for a static member, it won't affect static-ness of the enclosing method,
+ // Since a qualified reference must be for a static member, it won't affect static-ness of the enclosing method,
// so we don't have to call resetEnclosingMethodStaticFlag() in this case
return binding;
}
@@ -1303,7 +1303,7 @@ public void checkUnclosedCloseables(FlowInfo flowInfo, FlowContext flowContext,
// compute the most specific null status for this resource,
int status = trackingVar.findMostSpecificStatus(flowInfo, this, locationScope);
-
+
if (status == FlowInfo.NULL) {
// definitely unclosed: highest priority
reportResourceLeak(trackingVar, location, status);
@@ -1314,12 +1314,12 @@ public void checkUnclosedCloseables(FlowInfo flowInfo, FlowContext flowContext,
// problems at specific locations: medium priority
if (trackingVar.reportRecordedErrors(this, status, flowInfo.reachMode() != FlowInfo.REACHABLE)) // ... report previously recorded errors
continue;
- }
+ }
if (status == FlowInfo.POTENTIALLY_NULL) {
// potentially unclosed: lower priority
reportResourceLeak(trackingVar, location, status);
} else if (status == FlowInfo.NON_NULL) {
- // properly closed but not managed by t-w-r: lowest priority
+ // properly closed but not managed by t-w-r: lowest priority
if (environment().globalOptions.complianceLevel >= ClassFileConstants.JDK1_7)
trackingVar.reportExplicitClosing(problemReporter());
}
@@ -1327,7 +1327,7 @@ public void checkUnclosedCloseables(FlowInfo flowInfo, FlowContext flowContext,
if (location == null) {
// when leaving this block dispose off all tracking variables:
for (int i=0; i<this.localIndex; i++)
- this.locals[i].closeTracker = null;
+ this.locals[i].closeTracker = null;
this.trackingVariables = null;
}
}
@@ -1339,23 +1339,23 @@ private void reportResourceLeak(FakedTrackingVariable trackingVar, ASTNode locat
trackingVar.reportError(problemReporter(), null, nullStatus);
}
-/**
+/**
* If one branch of an if-else closes any AutoCloseable resource, and if the same
* resource is known to be null on the other branch mark it as closed, too,
* so that merging both branches indicates that the resource is always closed.
* Example:
* FileReader fr1 = null;
* try {\n" +
- * fr1 = new FileReader(someFile);" +
- * fr1.read(buf);\n" +
- * } finally {\n" +
+ * fr1 = new FileReader(someFile);" +
+ * fr1.read(buf);\n" +
+ * } finally {\n" +
* if (fr1 != null)\n" +
* try {\n" +
* fr1.close();\n" +
* } catch (IOException e) {
- * // do nothing
+ * // do nothing
* }
- * // after this if statement fr1 is definitely not leaked
+ * // after this if statement fr1 is definitely not leaked
* }
*/
public void correlateTrackingVarsIfElse(FlowInfo thenFlowInfo, FlowInfo elseFlowInfo) {
@@ -1372,7 +1372,7 @@ public void correlateTrackingVarsIfElse(FlowInfo thenFlowInfo, FlowInfo elseFlow
elseFlowInfo.markNullStatus(trackingVar.binding, nullStatus);
} else if (!hasNullInfoInThen && hasNullInfoInElse) {
int nullStatus = elseFlowInfo.nullStatus(trackingVar.binding);
- thenFlowInfo.markNullStatus(trackingVar.binding, nullStatus);
+ thenFlowInfo.markNullStatus(trackingVar.binding, nullStatus);
}
continue;
}
@@ -1402,7 +1402,7 @@ public void correlateTrackingVarsIfElse(FlowInfo thenFlowInfo, FlowInfo elseFlow
if (!var1SeenInThen && var1SeenInElse && var2SeenInThen && !var2SeenInElse) {
newStatus = FlowInfo.mergeNullStatus(thenFlowInfo.nullStatus(var2.binding), elseFlowInfo.nullStatus(trackingVar.binding));
} else if (var1SeenInThen && !var1SeenInElse && !var2SeenInThen && var2SeenInElse) {
- newStatus = FlowInfo.mergeNullStatus(thenFlowInfo.nullStatus(trackingVar.binding), elseFlowInfo.nullStatus(var2.binding));
+ newStatus = FlowInfo.mergeNullStatus(thenFlowInfo.nullStatus(trackingVar.binding), elseFlowInfo.nullStatus(var2.binding));
} else {
continue;
}
@@ -1442,7 +1442,7 @@ private boolean checkAppropriate(MethodBinding compileTimeDeclaration, MethodBin
return true;
if (MethodVerifier.doesMethodOverride(otherMethod, compileTimeDeclaration, this.environment())) {
problemReporter().illegalSuperCallBypassingOverride(location, compileTimeDeclaration, otherMethod.declaringClass);
- return false;
+ return false;
}
return true;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BoundSet.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BoundSet.java
index d004bd72d..643964fda 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BoundSet.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BoundSet.java
@@ -51,10 +51,10 @@ class BoundSet {
enableOptimizationForBug543480 = enableOptimizationForBug543480Property.equalsIgnoreCase("true"); //$NON-NLS-1$
}
}
-
+
static final BoundSet TRUE = new BoundSet(); // empty set of bounds
static final BoundSet FALSE = new BoundSet(); // pseudo bounds
-
+
/**
* For a given inference variable this structure holds all type bounds
* with a relation in { SUPERTYPE, SAME, SUBTYPE }.
@@ -131,7 +131,7 @@ class BoundSet {
if (!onlyProper || right.isProperType(true)) {
if (right instanceof ReferenceBinding) {
rights[i++] = right;
- nullHints |= right.tagBits & TagBits.AnnotationNullMASK;
+ nullHints |= right.tagBits & TagBits.AnnotationNullMASK;
} else {
if (simpleUpper != null)
return Binding.NO_TYPES; // shouldn't
@@ -237,7 +237,7 @@ class BoundSet {
return boundType;
}
}
- }
+ }
}
if (this.superBounds != null) {
Iterator<TypeBound> it = this.superBounds.iterator();
@@ -256,7 +256,7 @@ class BoundSet {
return boundType;
}
}
- }
+ }
}
return null;
}
@@ -330,10 +330,10 @@ class BoundSet {
}
// main storage of type bounds:
HashMap<InferenceVariable, ThreeSets> boundsPerVariable = new HashMap<>();
-
+
/**
* 18.1.3 bullet 4: G<α1, ..., αn> = capture(G<A1, ..., An>)
- * On both sides we only enter types with nonnull arguments.
+ * On both sides we only enter types with nonnull arguments.
*/
HashMap<ParameterizedTypeBinding,ParameterizedTypeBinding> captures = new HashMap<>();
/** 18.1.3 bullet 5: throws α */
@@ -343,9 +343,9 @@ class BoundSet {
private TypeBound [] unincorporatedBounds = new TypeBound [1024];
private int unincorporatedBoundsCount = 0;
private TypeBound [] mostRecentBounds = new TypeBound[4]; // for quick & dirty duplicate elimination.
-
+
public BoundSet() {}
-
+
// pre: typeParameters != null, variables[i].typeParameter == typeParameters[i]
public void addBoundsFromTypeParameters(InferenceContext18 context, TypeVariableBinding[] typeParameters, InferenceVariable[] variables) {
int length = typeParameters.length;
@@ -396,7 +396,7 @@ class BoundSet {
}
public void addBound(TypeBound bound, LookupEnvironment environment) {
-
+
if (bound.relation == ReductionResult.SUBTYPE && bound.right.id == TypeIds.T_JavaLangObject)
return;
if (bound.left == bound.right) //$IDENTITY-COMPARISON$
@@ -417,12 +417,12 @@ class BoundSet {
return;
}
}
-
+
this.mostRecentBounds[3] = this.mostRecentBounds[2];
this.mostRecentBounds[2] = this.mostRecentBounds[1];
this.mostRecentBounds[1] = this.mostRecentBounds[0];
this.mostRecentBounds[0] = bound;
-
+
InferenceVariable variable = bound.left.prototype();
ThreeSets three = this.boundsPerVariable.get(variable);
if (three == null)
@@ -459,13 +459,13 @@ class BoundSet {
}
return hasProperBound;
}
-
+
public void addBounds(BoundSet that, LookupEnvironment environment) {
if (that == null || environment == null)
return;
addBounds(that.flatten(), environment);
}
-
+
public boolean isInstantiated(InferenceVariable inferenceVariable) {
ThreeSets three = this.boundsPerVariable.get(inferenceVariable.prototype());
if (three != null)
@@ -477,7 +477,7 @@ class BoundSet {
ThreeSets three = this.boundsPerVariable.get(inferenceVariable.prototype());
if (three != null) {
TypeBinding instantiation = three.instantiation;
- if (environment != null && environment.globalOptions.isAnnotationBasedNullAnalysisEnabled
+ if (environment != null && environment.globalOptions.isAnnotationBasedNullAnalysisEnabled
&& instantiation != null && (instantiation.tagBits & TagBits.AnnotationNullMASK) == 0)
return three.combineAndUseNullHints(instantiation, inferenceVariable.nullHints, environment);
return instantiation;
@@ -493,22 +493,22 @@ class BoundSet {
}
return num;
}
-
- // Driver for the real workhorse - Implements generational incorporation a la generational garbage collector.
+
+ // Driver for the real workhorse - Implements generational incorporation a la generational garbage collector.
boolean incorporate(InferenceContext18 context) throws InferenceFailureException {
-
+
if (this.unincorporatedBoundsCount == 0 && this.captures.size() == 0)
return true;
-
+
do {
TypeBound [] freshBounds;
System.arraycopy(this.unincorporatedBounds, 0, freshBounds = new TypeBound[this.unincorporatedBoundsCount], 0, this.unincorporatedBoundsCount);
this.unincorporatedBoundsCount = 0;
-
+
// Pairwise bidirectional compare all bounds from previous generation with the fresh set.
if (!incorporate(context, this.incorporatedBounds, freshBounds))
return false;
- // Pairwise bidirectional compare all fresh bounds.
+ // Pairwise bidirectional compare all fresh bounds.
if (!incorporate(context, freshBounds, freshBounds))
return false;
@@ -519,17 +519,17 @@ class BoundSet {
System.arraycopy(this.incorporatedBounds, 0, aggregate, 0, incorporatedLength);
System.arraycopy(freshBounds, 0, aggregate, incorporatedLength, unincorporatedLength);
this.incorporatedBounds = aggregate;
-
+
} while (this.unincorporatedBoundsCount > 0);
-
+
return true;
}
/**
* <b>JLS 18.3:</b> Try to infer new constraints from pairs of existing type bounds.
* Each new constraint is first reduced and checked for TRUE or FALSE, which will
- * abort the processing.
+ * abort the processing.
* @param context the context that manages our inference variables
- * @return false if any constraint resolved to false, true otherwise
+ * @return false if any constraint resolved to false, true otherwise
* @throws InferenceFailureException a compile error has been detected during inference
*/
boolean incorporate(InferenceContext18 context, TypeBound [] first, TypeBound [] next) throws InferenceFailureException {
@@ -604,10 +604,10 @@ class BoundSet {
mostRecentFormulas[2] = mostRecentFormulas[1];
mostRecentFormulas[1] = mostRecentFormulas[0];
mostRecentFormulas[0] = newConstraint;
-
+
if (!reduceOneConstraint(context, newConstraint))
return false;
-
+
if (analyzeNull) {
// not per JLS: if the new constraint relates types where at least one has a null annotations,
// record all null tagBits as hints for the final inference solution.
@@ -638,7 +638,7 @@ class BoundSet {
}
}
/* TODO: are we sure this will always terminate? Cf. e.g. (Discussion in 18.3):
- *
+ *
* "The assertion that incorporation reaches a fixed point oversimplifies the matter slightly. ..."
*/
Iterator<Entry<ParameterizedTypeBinding, ParameterizedTypeBinding>> captIter = this.captures.entrySet().iterator();
@@ -685,7 +685,7 @@ class BoundSet {
bi1 = context.object; // implicit bound
}
// If Bi is Object, α <: R implies ⟨T <: R⟩ (extends wildcard)
- // α <: R implies ⟨θ Bi <: R⟩ (else)
+ // α <: R implies ⟨θ Bi <: R⟩ (else)
it = three.subBounds.iterator();
while (it.hasNext()) {
TypeBound bound = it.next();
@@ -708,7 +708,7 @@ class BoundSet {
}
if (three.superBounds != null) {
// R <: α implies ⟨R <: T⟩ (super wildcard)
- // R <: α implies false (else)
+ // R <: α implies false (else)
it = three.superBounds.iterator();
while (it.hasNext()) {
TypeBound bound = it.next();
@@ -746,7 +746,7 @@ class BoundSet {
}
private ConstraintTypeFormula combineSameSame(TypeBound boundS, TypeBound boundT, TypeBound[] firstBounds, TypeBound[] nextBounds) {
-
+
// α = S and α = T imply ⟨S = T⟩
if (TypeBinding.equalsEquals(boundS.left, boundT.left))
return ConstraintTypeFormula.create(boundS.right, boundT.right, ReductionResult.SAME, boundS.isSoft||boundT.isSoft);
@@ -763,7 +763,7 @@ class BoundSet {
}
// pre: boundLeft.left != boundRight.left
- private ConstraintTypeFormula combineSameSameWithProperType(TypeBound boundLeft, TypeBound boundRight,
+ private ConstraintTypeFormula combineSameSameWithProperType(TypeBound boundLeft, TypeBound boundRight,
TypeBound[] firstBounds, TypeBound[] nextBounds) {
// α = U and S = T imply ⟨S[α:=U] = T[α:=U]⟩
TypeBinding u = boundLeft.right;
@@ -781,9 +781,9 @@ class BoundSet {
}
return null;
}
-
+
private ConstraintTypeFormula combineSameSubSuper(TypeBound boundS, TypeBound boundT, TypeBound[] firstBounds, TypeBound[] nextBounds) {
- // α = S and α <: T imply ⟨S <: T⟩
+ // α = S and α <: T imply ⟨S <: T⟩
// α = S and T <: α imply ⟨T <: S⟩
InferenceVariable alpha = boundS.left;
TypeBinding s = boundS.right;
@@ -807,7 +807,7 @@ class BoundSet {
if (TypeBinding.equalsEquals(alpha, boundT.right)) {
TypeBinding t = boundT.left;
return ConstraintTypeFormula.create(t, s, boundT.relation, boundT.isSoft||boundS.isSoft);
- }
+ }
}
return combineSameSubSuperWithProperType(boundS, boundT, alpha, firstBounds, nextBounds);
}
@@ -818,7 +818,7 @@ class BoundSet {
InferenceVariable alpha, TypeBound[] firstBounds, TypeBound[] nextBounds) {
// α = U and S <: T imply ⟨S[α:=U] <: T[α:=U]⟩
TypeBinding u = boundLeft.right;
-
+
if (enableOptimizationForBug543480 && isParameterizedDependency(boundRight)) {
// Performance optimization: do not incorporate arguments one by one, which yielt 2^n new bounds (n=number of type arguments) in the past.
// Instead, all arguments of a parameterized dependency are incorporated at once - but only when they are available.
@@ -835,7 +835,7 @@ class BoundSet {
}
return null;
}
-
+
private ConstraintTypeFormula combineSuperAndSub(TypeBound boundS, TypeBound boundT) {
// permutations of: S <: α and α <: T imply ⟨S <: T⟩
InferenceVariable alpha = boundS.left;
@@ -851,14 +851,14 @@ class BoundSet {
}
return null;
}
-
+
private ConstraintTypeFormula combineEqualSupers(TypeBound boundS, TypeBound boundT) {
// more permutations of: S <: α and α <: T imply ⟨S <: T⟩
if (TypeBinding.equalsEquals(boundS.left, boundT.right))
- // came in as: α REL S and T REL α imply ⟨T REL S⟩
+ // came in as: α REL S and T REL α imply ⟨T REL S⟩
return ConstraintTypeFormula.create(boundT.left, boundS.right, boundS.relation, boundT.isSoft||boundS.isSoft);
if (TypeBinding.equalsEquals(boundS.right, boundT.left))
- // came in as: S REL α and α REL T imply ⟨S REL T⟩
+ // came in as: S REL α and α REL T imply ⟨S REL T⟩
return ConstraintTypeFormula.create(boundS.left, boundT.right, boundS.relation, boundT.isSoft||boundS.isSoft);
return null;
}
@@ -868,7 +868,7 @@ class BoundSet {
&& !typeBound.right.isProperType(true) /* is a dependency, not a type bound */
&& typeBound.right.isParameterizedTypeWithActualArguments();
}
-
+
private ConstraintTypeFormula incorporateIntoParameterizedDependencyIfAllArgumentsAreProperTypes(TypeBound typeBound,
TypeBound[] firstBounds, TypeBound[] nextBounds) {
Collection<TypeBound> properTypesForAllInferenceVariables = getProperTypesForAllInferenceVariablesOrNull((ParameterizedTypeBinding)typeBound.right, firstBounds, nextBounds);
@@ -877,8 +877,8 @@ class BoundSet {
}
return null;
}
-
- private Collection<TypeBound> getProperTypesForAllInferenceVariablesOrNull(ParameterizedTypeBinding parameterizedType,
+
+ private Collection<TypeBound> getProperTypesForAllInferenceVariablesOrNull(ParameterizedTypeBinding parameterizedType,
TypeBound[] firstBounds, TypeBound[] nextBounds) {
final Map<InferenceVariable,TypeBound> properTypesByInferenceVariable = properTypesByInferenceVariable(firstBounds, nextBounds);
if(properTypesByInferenceVariable.size() == 0) {
@@ -896,7 +896,7 @@ class BoundSet {
.filter(bound -> bound.relation == ReductionResult.SAME)
.filter(bound -> bound.right.isProperType(true))
.collect(toMap(bound -> bound.left, identity(),
- // If nextBounds and firstBounds have a bound for the IV, prefer the newer one from nextBounds.
+ // If nextBounds and firstBounds have a bound for the IV, prefer the newer one from nextBounds.
(boundFromNextBounds, boundFromFirstBounds) -> boundFromNextBounds));
}
@@ -918,7 +918,7 @@ class BoundSet {
}
return inferenceVariables;
}
-
+
private ConstraintTypeFormula combineWithProperTypes(Collection<TypeBound> properTypesForAllInferenceVariables, TypeBound boundRight) {
// either: α = U, β = V, ... and S = T imply ⟨S[α:=U, β:=V, ...] = T[α:=U, β:=V, ...]⟩
// or: α = U, β = V, ... and S <: T imply ⟨S[α:=U, β:=V, ...] <: T[α:=U, β:=V, ...]⟩
@@ -928,7 +928,7 @@ class BoundSet {
boolean isAnyLeftSoft = false;
InferenceVariable left = boundRight.left;
TypeBinding right = boundRight.right;
- for(final TypeBound properTypeForInferenceVariable: properTypesForAllInferenceVariables) {
+ for(final TypeBound properTypeForInferenceVariable: properTypesForAllInferenceVariables) {
final TypeBound boundLeft = properTypeForInferenceVariable;
final InferenceVariable alpha = boundLeft.left;
final TypeBinding u = boundLeft.right;
@@ -942,7 +942,7 @@ class BoundSet {
/* From 18.4:
* If two bounds have the form α <: S and α <: T, and if for some generic class or interface, G,
* there exists a supertype (4.10) of S of the form G<S1, ..., Sn> and a supertype of T of the form G<T1, ..., Tn>,
- * then for all i, 1 ≤ i ≤ n, if Si and Ti are types (not wildcards), the constraint ⟨Si = Ti⟩ is implied.
+ * then for all i, 1 ≤ i ≤ n, if Si and Ti are types (not wildcards), the constraint ⟨Si = Ti⟩ is implied.
*/
// callers must ensure both relations are <: and both lefts are equal
TypeBinding[] supers = superTypesWithCommonGenericType(boundS.right, boundT.right);
@@ -960,7 +960,7 @@ class BoundSet {
TypeBinding[] tis = t.typeArguments();
if (sis == null || tis == null || sis.length != tis.length)
return null;
- List<ConstraintTypeFormula> result = new ArrayList<>();
+ List<ConstraintTypeFormula> result = new ArrayList<>();
for (int i = 0; i < sis.length; i++) {
TypeBinding si = sis[i];
TypeBinding ti = tis[i];
@@ -1006,7 +1006,7 @@ class BoundSet {
/**
* Helper for resolution (18.4):
- * Does this bound set define a direct dependency between the two given inference variables?
+ * Does this bound set define a direct dependency between the two given inference variables?
*/
public boolean dependsOnResolutionOf(InferenceVariable alpha, InferenceVariable beta) {
alpha = alpha.prototype();
@@ -1025,7 +1025,7 @@ class BoundSet {
ParameterizedTypeBinding captured = entry.getValue();
if (captured.mentionsAny(new TypeBinding[]{beta}, -1/*don't care about index*/))
return true;
- if (g.mentionsAny(new TypeBinding[]{beta}, i)) // exclude itself
+ if (g.mentionsAny(new TypeBinding[]{beta}, i)) // exclude itself
return true;
} else if (TypeBinding.equalsEquals(g.arguments[i], beta)) {
betaIsInCaptureLhs = true;
@@ -1112,7 +1112,7 @@ class BoundSet {
/**
* JLS 18.1.3:
- * Answer all upper bounds for the given inference variable as defined by any bounds in this set.
+ * Answer all upper bounds for the given inference variable as defined by any bounds in this set.
*/
public TypeBinding[] upperBounds(InferenceVariable variable, boolean onlyProper) {
ThreeSets three = this.boundsPerVariable.get(variable.prototype());
@@ -1122,10 +1122,10 @@ class BoundSet {
// TODO: if !onlyProper: should we also consider ThreeSets.inverseBounds,
// or is it safe to rely on incorporation to produce the required bounds?
}
-
+
/**
* JLS 18.1.3:
- * Answer all lower bounds for the given inference variable as defined by any bounds in this set.
+ * Answer all lower bounds for the given inference variable as defined by any bounds in this set.
*/
TypeBinding[] lowerBounds(InferenceVariable variable, boolean onlyProper) {
ThreeSets three = this.boundsPerVariable.get(variable.prototype());
@@ -1163,7 +1163,7 @@ class BoundSet {
}
// this condition is just way too complex to check it in-line:
public boolean condition18_5_2_bullet_3_3_1(InferenceVariable alpha, TypeBinding targetType) {
- // T is a reference type, but is not a wildcard-parameterized type, and either
+ // T is a reference type, but is not a wildcard-parameterized type, and either
// i) B2 contains a bound of one of the forms α = S or S <: α, where S is a wildcard-parameterized type, or ...
if (targetType.isBaseType()) return false;
if (InferenceContext18.parameterizedWithWildcard(targetType) != null) return false;
@@ -1197,7 +1197,7 @@ class BoundSet {
TypeBinding s2 = superBounds.get(j).right;
TypeBinding[] supers = superTypesWithCommonGenericType(s1, s2);
if (supers != null) {
- /* HashMap<K#8,V#9> and HashMap<K#8,ArrayList<T>> with an instantiation for V9 = ArrayList<T> already in the
+ /* HashMap<K#8,V#9> and HashMap<K#8,ArrayList<T>> with an instantiation for V9 = ArrayList<T> already in the
bound set should not be seen as two different parameterizations of the same generic class or interface.
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=432626 for a test that triggers this condition.
See https://bugs.openjdk.java.net/browse/JDK-8056092: recommendation is to check for proper types.
@@ -1247,7 +1247,7 @@ class BoundSet {
return s.isCompatibleWith(env.convertToRawType(g, false));
return false;
}
-
+
protected TypeBinding[] superTypesWithCommonGenericType(TypeBinding s, TypeBinding t) {
if (s == null || s.id == TypeIds.T_JavaLangObject || t == null || t.id == TypeIds.T_JavaLangObject)
return null;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding.java
index 91178434c..79c99526e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding.java
@@ -75,7 +75,7 @@ public class CaptureBinding extends TypeVariableBinding {
}
}
}
-
+
// for subclass CaptureBinding18
protected CaptureBinding(ReferenceBinding sourceType, char[] sourceName, int start, int end, int captureID, LookupEnvironment environment) {
super(sourceName, null, 0, environment);
@@ -97,7 +97,7 @@ public class CaptureBinding extends TypeVariableBinding {
this.tagBits |= (prototype.tagBits & TagBits.HasCapturedWildcard);
this.cud = prototype.cud;
}
-
+
// Captures may get cloned and annotated during type inference.
@Override
public TypeBinding clone(TypeBinding enclosingType) {
@@ -404,7 +404,7 @@ public class CaptureBinding extends TypeVariableBinding {
}
return super.readableName();
}
-
+
@Override
public char[] signableName() {
if (this.wildcard != null) {
@@ -436,7 +436,7 @@ public class CaptureBinding extends TypeVariableBinding {
}
return super.shortReadableName();
}
-
+
@Override
public char[] nullAnnotatedReadableName(CompilerOptions options, boolean shortNames) {
StringBuffer nameBuffer = new StringBuffer(10);
@@ -474,13 +474,13 @@ public class CaptureBinding extends TypeVariableBinding {
return this;
if (this.wildcard != null && this.wildcard.hasNullTypeAnnotations()) {
WildcardBinding newWildcard = (WildcardBinding) this.wildcard.withoutToplevelNullAnnotation();
- if (newWildcard != this.wildcard) { //$IDENTITY-COMPARISON$
-
+ if (newWildcard != this.wildcard) { //$IDENTITY-COMPARISON$
+
CaptureBinding newCapture = (CaptureBinding) this.environment.getUnannotatedType(this).clone(null);
if (newWildcard.hasTypeAnnotations())
newCapture.tagBits |= TagBits.HasTypeAnnotations;
newCapture.wildcard = newWildcard;
-
+
// manually transfer the following two, because we are not in a context where we can call initializeBounds():
newCapture.superclass = this.superclass;
newCapture.superInterfaces = this.superInterfaces;
@@ -524,7 +524,7 @@ public class CaptureBinding extends TypeVariableBinding {
this.pendingSubstitute = null;
}
}
-
+
@Override
public void setTypeAnnotations(AnnotationBinding[] annotations, boolean evalNullAnnotations) {
super.setTypeAnnotations(annotations, evalNullAnnotations);
@@ -606,12 +606,12 @@ public class CaptureBinding extends TypeVariableBinding {
TypeBinding wrappedBound = RoleTypeCreator.maybeWrapQualifiedRoleType(scope, anchorExpr, this.firstBound, typedNode);
if (TypeBinding.notEquals(wrappedBound, this.firstBound))
hasWrapped = true;
-
+
TypeBinding newSuper = RoleTypeCreator.maybeWrapQualifiedRoleType(scope, anchorExpr, this.superclass, typedNode);
if (TypeBinding.notEquals(newSuper, this.superclass))
hasWrapped = true;
-
- ReferenceBinding[] newSuperIfcs = new ReferenceBinding[this.superInterfaces.length];
+
+ ReferenceBinding[] newSuperIfcs = new ReferenceBinding[this.superInterfaces.length];
for (int i=0; i<this.superInterfaces.length; i++) {
newSuperIfcs[i] = (ReferenceBinding) RoleTypeCreator.maybeWrapQualifiedRoleType(scope, anchorExpr, this.superInterfaces[i], typedNode);
if (TypeBinding.notEquals(newSuperIfcs[i], this.superInterfaces[i]))
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding18.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding18.java
index 597111471..a48b86053 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding18.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding18.java
@@ -21,7 +21,7 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.lookup.ITeamAnchor;
* Capture-like type variable introduced during 1.8 type inference.
*/
public class CaptureBinding18 extends CaptureBinding {
-
+
TypeBinding[] upperBounds;
private char[] originalName;
private CaptureBinding18 prototype;
@@ -31,13 +31,13 @@ public class CaptureBinding18 extends CaptureBinding {
this.originalName = originalName;
this.prototype = this;
}
-
+
private CaptureBinding18(CaptureBinding18 prototype) {
super(prototype);
this.sourceName = CharOperation.append(prototype.sourceName, '\'');
this.originalName = prototype.originalName;
this.upperBounds = prototype.upperBounds;
- this.prototype = prototype.prototype;
+ this.prototype = prototype.prototype;
}
public boolean setUpperBounds(TypeBinding[] upperBounds, ReferenceBinding javaLangObject) {
@@ -142,7 +142,7 @@ public class CaptureBinding18 extends CaptureBinding {
return true;
if (this.inRecursiveFunction)
return true;
- this.inRecursiveFunction = true;
+ this.inRecursiveFunction = true;
try {
if (this.upperBounds != null) {
int length = this.upperBounds.length;
@@ -188,7 +188,7 @@ public class CaptureBinding18 extends CaptureBinding {
if (candidate != null)
return candidate;
// TODO: maybe we should double check about multiple candidates here,
- // but upper bounds should be consistent so hopefully the first non-null candidate is good enough.
+ // but upper bounds should be consistent so hopefully the first non-null candidate is good enough.
}
}
return super.findSuperTypeOriginatingFrom(otherType);
@@ -287,7 +287,7 @@ public class CaptureBinding18 extends CaptureBinding {
@Override
public boolean isProperType(boolean admitCapture18) {
- if (!admitCapture18)
+ if (!admitCapture18)
return false;
if (this.inRecursiveFunction)
return true;
@@ -362,7 +362,7 @@ public class CaptureBinding18 extends CaptureBinding {
}
return super.shortReadableName();
}
-
+
@Override
public TypeBinding uncapture(Scope scope) {
return this;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CatchParameterBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CatchParameterBinding.java
index 5df69c72a..25da77e4b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CatchParameterBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CatchParameterBinding.java
@@ -16,13 +16,13 @@ package org.eclipse.jdt.internal.compiler.lookup;
import org.eclipse.jdt.internal.compiler.ast.LocalDeclaration;
public class CatchParameterBinding extends LocalVariableBinding {
-
+
TypeBinding [] preciseTypes = Binding.NO_EXCEPTIONS; // the catch block can be entered with the parameters set to these types.
-
+
public CatchParameterBinding(LocalDeclaration declaration, TypeBinding type, int modifiers, boolean isArgument) {
super(declaration, type, modifiers, isArgument);
}
-
+
public TypeBinding [] getPreciseTypes() {
return this.preciseTypes;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java
index 60e55bae2..d96a2a940 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java
@@ -12,7 +12,7 @@
* IBM Corporation - initial API and implementation
* Fraunhofer FIRST - extended API and implementation
* Technical University Berlin - extended API and implementation
- * Stephan Herrmann <stephan@cs.tu-berlin.de> - Contributions for
+ * Stephan Herrmann <stephan@cs.tu-berlin.de> - Contributions for
* Bug 328281 - visibility leaks not detected when analyzing unused field in private class
* Bug 300576 - NPE Computing type hierarchy when compliance doesn't match libraries
* Bug 354536 - compiling package-info.java still depends on the order of compilation units
@@ -613,7 +613,7 @@ public class ClassScope extends Scope {
problemReporter().abstractMethodInConcreteClass(sourceType);
// :giro
}
-// SH}
+// SH}
}
if (sourceType.isRecord()) {
assert this.referenceContext instanceof RecordDeclaration;
@@ -632,7 +632,7 @@ public class ClassScope extends Scope {
}
FieldBinding[] fields = sourceType.unResolvedFields(); // https://bugs.eclipse.org/bugs/show_bug.cgi?id=301683
for (int i = 0; i < fields.length; i++) {
- fields[i].modifiers |= ExtraCompilerModifiers.AccLocallyUsed;
+ fields[i].modifiers |= ExtraCompilerModifiers.AccLocallyUsed;
}
}
if (isEnum && compilerOptions().isAnnotationBasedNullAnalysisEnabled) {
@@ -689,7 +689,7 @@ public class ClassScope extends Scope {
SourceTypeBinding sourceType = this.referenceContext.binding;
sourceType.module = module();
environment().setAccessRestriction(sourceType, accessRestriction);
-
+
TypeParameter[] typeParameters = this.referenceContext.typeParameters;
sourceType.typeVariables = typeParameters == null || typeParameters.length == 0 ? Binding.NO_TYPE_VARIABLES : null;
sourceType.fPackage.addType(sourceType);
@@ -728,7 +728,7 @@ public class ClassScope extends Scope {
// SH}
checkAndSetModifiers();
buildTypeVariables();
-
+
buildMemberTypes(accessRestriction);
//{ObjectTeams: setup cache for known role files:
if (this.referenceContext.isTeam())
@@ -1015,7 +1015,7 @@ public class ClassScope extends Scope {
switch (scope.kind) {
case METHOD_SCOPE :
MethodScope methodScope = (MethodScope) scope;
- if (methodScope.isLambdaScope())
+ if (methodScope.isLambdaScope())
methodScope = methodScope.namedMethodScope();
if (methodScope.isInsideInitializer()) {
SourceTypeBinding type = ((TypeDeclaration) methodScope.referenceContext).binding;
@@ -1204,19 +1204,19 @@ public class ClassScope extends Scope {
problemReporter().illegalModifierForRecord(sourceType);
}
// JLS 14 8.10 : It is a compile-time error if a record declaration has the modifier abstract.
-
+
/* Section 8.10 http://cr.openjdk.java.net/~gbierman/8222777/8222777-20190823/specs/records-jls.html#jls-8.10
* It is a compile-time error if a record declaration has the modifier abstract.
- *
+ *
* A record declaration is implicitly final. It is permitted for the declaration of a record type
* to redundantly specify the final modifier.
- *
+ *
* A nested record type is implicitly static. It is permitted for the declaration of a nested record
* type to redundantly specify the static modifier.
- *
+ *
* This implies that it is impossible to declare a record type in the body of an inner class (8.1.3),
* because an inner class cannot have static members except for constant variables.
- *
+ *
* It is a compile-time error if the same keyword appears more than once as a modifier for a record declaration,
* or if a record declaration has more than one of the access modifiers public, protected, and private (6.6).
*/
@@ -1347,7 +1347,7 @@ public class ClassScope extends Scope {
// set the modifiers
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=267670. Force all enumerators to be marked
// as used locally. We are unable to track the usage of these reliably as they could be used
- // in non obvious ways via the synthesized methods values() and valueOf(String) or by using
+ // in non obvious ways via the synthesized methods values() and valueOf(String) or by using
// Enum.valueOf(Class<T>, String).
final int IMPLICIT_MODIFIERS = ClassFileConstants.AccPublic | ClassFileConstants.AccStatic | ClassFileConstants.AccFinal | ClassFileConstants.AccEnum | ExtraCompilerModifiers.AccLocallyUsed;
fieldBinding.modifiers|= IMPLICIT_MODIFIERS;
@@ -1818,7 +1818,7 @@ public class ClassScope extends Scope {
}
try {
TypeReference baseclassRef = this.referenceContext.baseclass;
-
+
ReferenceBinding baseclass= findBaseclass(baseclassRef);
// detect cycle wrt. containment:
@@ -1882,11 +1882,11 @@ public class ClassScope extends Scope {
if (baseclass.isFinal())
problemReporter().decapsulationOfFinal(baseclassRef, baseclass);
- if (baseclass instanceof BinaryTypeBinding
+ if (baseclass instanceof BinaryTypeBinding
&& ((BinaryTypeBinding)baseclass).version >= ClassFileConstants.JDK1_8
&& compilerOptions().weavingScheme == WeavingScheme.OTRE) {
problemReporter().otreCannotWeaveIntoJava8(baseclassRef, baseclass, (int) (((BinaryTypeBinding)baseclass).version >> 16));
- }
+ }
if (/* !sourceType.isInterface() // FIXME(SH): ifc playedBy ifc is currently incompatible with add/removeRole infrastructure.
&& */baseclass.isInterface() && (baseclass.tagBits & TagBits.HasMissingType) == 0)
{
@@ -1996,7 +1996,7 @@ public class ClassScope extends Scope {
tsuperBase = tsuperBase.getRealType();
}
if ( !(TypeBinding.equalsEquals(baseclass, tsuperBase) || TSuperHelper.isTSubOf(baseclass, tsuperBase))
- || !TSuperHelper.isEquivalentField(baseAnchor, tsuperAnchor))
+ || !TSuperHelper.isEquivalentField(baseAnchor, tsuperAnchor))
{
problemReporter().overridesPlayedBy(ClassScope.this.referenceContext, tsuperBase);
}
@@ -2078,7 +2078,7 @@ public class ClassScope extends Scope {
} else {
// only want to reach here when no errors are reported
sourceType.superclass = superclass;
-
+
// team:
// if superclass is not o.o.Team add "implements org.objectteams.ITeam":
if (!superclass.isTeam()) {
@@ -2169,11 +2169,11 @@ public class ClassScope extends Scope {
sourceType.tagBits |= TagBits.HierarchyHasProblems;
continue nextInterface;
}
- if ( sourceType.isInterface()
- && TypeAnalyzer.isConfined(superInterface)
- && this.referenceContext.superclass == null)
+ if ( sourceType.isInterface()
+ && TypeAnalyzer.isConfined(superInterface)
+ && this.referenceContext.superclass == null)
{
- sourceType.superclass = null; // cancel premature superclass j.l.Object
+ sourceType.superclass = null; // cancel premature superclass j.l.Object
}
// SH}
@@ -2275,7 +2275,7 @@ public class ClassScope extends Scope {
//{ObjectTeams: top level source super-team must be fully loaded/connected:
ReferenceBinding superType= sourceType.superclass;
if ( superType != null
- && superType.isTeam())
+ && superType.isTeam())
{
ReferenceBinding superOriginal = (ReferenceBinding) superType.original();
if (!superOriginal.isBinaryBinding()) {
@@ -2378,7 +2378,7 @@ public class ClassScope extends Scope {
return detectHierarchyCycle(this.referenceContext.binding, (ReferenceBinding) superType, reference);
}
// Reinstate the code deleted by the fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=205235
- // For details, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=294057.
+ // For details, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=294057.
if ((superType.tagBits & TagBits.BeginHierarchyCheck) == 0 && superType instanceof SourceTypeBinding)
// ensure if this is a source superclass that it has already been checked
((SourceTypeBinding) superType).scope.connectTypeHierarchyWithoutMembers();
@@ -2419,7 +2419,7 @@ public class ClassScope extends Scope {
// force its superclass & superinterfaces to be found... 2 possibilities exist - the source type is included in the hierarchy of:
// - a binary type... this case MUST be caught & reported here
// - another source type... this case is reported against the other source type
- if (superType.problemId() != ProblemReasons.NotFound && (superType.tagBits & TagBits.HierarchyHasProblems) != 0) {
+ if (superType.problemId() != ProblemReasons.NotFound && (superType.tagBits & TagBits.HierarchyHasProblems) != 0) {
sourceType.tagBits |= TagBits.HierarchyHasProblems;
problemReporter().hierarchyHasProblems(sourceType);
return true;
@@ -2482,7 +2482,7 @@ public class ClassScope extends Scope {
if (ref != null && ref.resolvedType == null) {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=319885 Don't cry foul prematurely.
// Check the edges traversed to see if there really is a cycle.
- char [] referredName = ref.getLastToken();
+ char [] referredName = ref.getLastToken();
for (Iterator iter = environment().typesBeingConnected.iterator(); iter.hasNext();) {
SourceTypeBinding type = (SourceTypeBinding) iter.next();
if (CharOperation.equals(referredName, type.sourceName())) {
@@ -2666,7 +2666,7 @@ public class ClassScope extends Scope {
}
return this.parent.checkRedundantDefaultNullness(nullBits, sourceStart);
}
-
+
@Override
public String toString() {
if (this.referenceContext != null)
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java
index d1e42b2a2..3510a5dc2 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java
@@ -89,9 +89,9 @@ public class CompilationUnitScope extends Scope {
HashtableOfType constantPoolNameUsage;
private int captureID = 1;
-
+
private ImportBinding[] tempImports; // to keep a record of resolved imports while traversing all in faultInImports()
-
+
/**
* Skips import caching if unresolved imports were
* found last time.
@@ -146,7 +146,7 @@ void buildFieldsAndMethods() {
//{ObjectTeams: extract from the above:
public void connectBaseclass() {
for (int i = 0, length = this.topLevelTypes.length; i < length; i++)
- this.topLevelTypes[i].scope.connectBaseclassRecurse();
+ this.topLevelTypes[i].scope.connectBaseclassRecurse();
}
// SH}
void buildTypeBindings(AccessRestriction accessRestriction) {
@@ -291,8 +291,8 @@ void buildTypeBindings(AccessRestriction accessRestriction) {
//{ObjectTeams: role files: (a) classes never match the name of the unit: prepended __OT__!
// (b) always check for matching file name (also protected), except for purely copied role files
boolean isRole = typeDecl.isRole() ;
- if ( (typeDecl.modifiers & ClassFileConstants.AccPublic) != 0
- || typeDecl.isRole()) // (b) check independently of publicness
+ if ( (typeDecl.modifiers & ClassFileConstants.AccPublic) != 0
+ || typeDecl.isRole()) // (b) check independently of publicness
{
char[] mainTypeName;
/* orig:
@@ -306,7 +306,7 @@ void buildTypeBindings(AccessRestriction accessRestriction) {
&& !(isRole && !typeDecl.isInterface()) // (a): ignore role classes
&& !typeDecl.isPurelyCopied) // (has no file)
{
- if (typeDecl.isRole()) // (b) : more specific message
+ if (typeDecl.isRole()) // (b) : more specific message
problemReporter().roleFileMismatchingName(this.referenceContext, typeDecl);
else
// SH}
@@ -769,7 +769,7 @@ void faultInImports() {
}
}
}
- // all the code here which checks for valid bindings have been moved to the method
+ // all the code here which checks for valid bindings have been moved to the method
// checkAndRecordImportBinding() since bug 361327
if(checkAndRecordImportBinding(importBinding, typesBySimpleNames, importReference, compoundName) == -1)
continue nextImport;
@@ -779,7 +779,7 @@ void faultInImports() {
// So if a type is found, no fields and methods are available anyway
// similarly when method is found, type may be available but no field available for sure
if (importBinding.kind() == Binding.FIELD) {
- checkMoreStaticBindings(compoundName, typesBySimpleNames, Binding.TYPE | Binding.METHOD, importReference);
+ checkMoreStaticBindings(compoundName, typesBySimpleNames, Binding.TYPE | Binding.METHOD, importReference);
} else if (importBinding.kind() == Binding.METHOD) {
checkMoreStaticBindings(compoundName, typesBySimpleNames, Binding.TYPE, importReference);
}
@@ -1269,7 +1269,7 @@ private void recordImportBinding(ImportBinding bindingToAdd) {
this.tempImports[this.importPtr++] = bindingToAdd;
}
/**
- * Checks additional bindings (methods or types) imported from a single static import.
+ * Checks additional bindings (methods or types) imported from a single static import.
* Method is tried first, followed by type. If found, records them.
* If in the process, import is flagged as duplicate, -1 is returned.
* @param compoundName
@@ -1278,8 +1278,8 @@ private void recordImportBinding(ImportBinding bindingToAdd) {
* @param importReference
*/
private void checkMoreStaticBindings(
- char[][] compoundName,
- HashtableOfType typesBySimpleNames,
+ char[][] compoundName,
+ HashtableOfType typesBySimpleNames,
int mask,
ImportReference importReference) {
Binding importBinding = findSingleStaticImport(compoundName, mask);
@@ -1312,8 +1312,8 @@ private void checkMoreStaticBindings(
* @return -1 when this import is flagged as duplicate, importPtr otherwise.
*/
private int checkAndRecordImportBinding(
- Binding importBinding,
- HashtableOfType typesBySimpleNames,
+ Binding importBinding,
+ HashtableOfType typesBySimpleNames,
ImportReference importReference,
char[][] compoundName) {
ReferenceBinding conflictingType = null;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintExceptionFormula.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintExceptionFormula.java
index 84394cda3..bd4d2231b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintExceptionFormula.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintExceptionFormula.java
@@ -35,13 +35,13 @@ import org.eclipse.jdt.internal.compiler.ast.ReferenceExpression;
public class ConstraintExceptionFormula extends ConstraintFormula {
FunctionalExpression left;
-
+
public ConstraintExceptionFormula(FunctionalExpression left, TypeBinding type) {
this.left = left;
this.right = type;
this.relation = EXCEPTIONS_CONTAINED;
}
-
+
@Override
public Object reduce(InferenceContext18 inferenceContext) {
// JLS 18.2.5
@@ -61,7 +61,7 @@ public class ConstraintExceptionFormula extends ConstraintFormula {
if (sam.returnType != TypeBinding.VOID && !sam.returnType.isProperType(true))
return FALSE;
} else { // reference expression
- if (!((ReferenceExpression)this.left).isExactMethodReference()) {
+ if (!((ReferenceExpression)this.left).isExactMethodReference()) {
int nParam = sam.parameters.length;
for (int i = 0; i < nParam; i++)
if (!sam.parameters[i].isProperType(true))
@@ -76,13 +76,13 @@ public class ConstraintExceptionFormula extends ConstraintFormula {
for (int i = 0; i < thrown.length; i++)
if (!thrown[i].isProperType(true))
e[n++] = (InferenceVariable) thrown[i]; // thrown[i] is not a proper type, since it's an exception it must be an inferenceVariable, right?
-
+
/* If throw specification does not encode any type parameters, there are no constraints to be gleaned/gathered from the throw sites.
See also that thrown exceptions are not allowed to influence compatibility and overload resolution.
*/
if (n == 0)
return TRUE;
-
+
TypeBinding[] ePrime = null;
if (this.left instanceof LambdaExpression) {
LambdaExpression lambda = ((LambdaExpression) this.left).resolveExpressionExpecting(this.right, inferenceContext.scope, inferenceContext);
@@ -108,7 +108,7 @@ public class ConstraintExceptionFormula extends ConstraintFormula {
continue actual;
for (int j = 0; j < n; j++)
result.add(ConstraintTypeFormula.create(ePrime[i], e[j], SUBTYPE));
- }
+ }
for (int j = 0; j < n; j++)
inferenceContext.currentBounds.inThrows.add(e[j].prototype());
return result.toArray(new ConstraintFormula[result.size()]);
@@ -131,7 +131,7 @@ public class ConstraintExceptionFormula extends ConstraintFormula {
for (int i = 0; i < len; i++) {
sam.parameters[i].collectInferenceVariables(variables);
}
- }
+ }
if (sam.returnType != TypeBinding.VOID) {
// ii)
sam.returnType.collectInferenceVariables(variables);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula.java
index ccf6562ba..c8d11c76c 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula.java
@@ -51,7 +51,7 @@ class ConstraintExpressionFormula extends ConstraintFormula {
this.right = type;
this.relation = relation;
}
-
+
ConstraintExpressionFormula(Expression expression, TypeBinding type, int relation, boolean isSoft) {
this(expression, type, relation);
this.isSoft = isSoft;
@@ -59,17 +59,17 @@ class ConstraintExpressionFormula extends ConstraintFormula {
@Override
public Object reduce(InferenceContext18 inferenceContext) throws InferenceFailureException {
-
+
if (this.relation == POTENTIALLY_COMPATIBLE) {
- /* 15.12.2.1: ... The definition of potential applicability goes beyond a basic arity check to also take into account the presence and "shape" of functional interface
- target types. In some cases involving type argument inference, a lambda expression appearing as a method invocation argument cannot be properly typed until after
- overload resolution. These rules allow the form of the lambda expression to still be taken into account, discarding obviously incorrect target types that might
+ /* 15.12.2.1: ... The definition of potential applicability goes beyond a basic arity check to also take into account the presence and "shape" of functional interface
+ target types. In some cases involving type argument inference, a lambda expression appearing as a method invocation argument cannot be properly typed until after
+ overload resolution. These rules allow the form of the lambda expression to still be taken into account, discarding obviously incorrect target types that might
otherwise cause ambiguity errors.
*/
-
+
return this.left.isPotentiallyCompatibleWith(this.right, inferenceContext.scope) ? TRUE: FALSE;
}
-
+
// JLS 18.2.1
if (this.right.isProperType(true)) {
if (this.left.isCompatibleWith(this.right, inferenceContext.scope) || this.left.isBoxingCompatibleWith(this.right, inferenceContext.scope)) {
@@ -98,7 +98,7 @@ class ConstraintExpressionFormula extends ConstraintFormula {
return null; // -> proceed with no new constraints
MethodBinding method = previousMethod;
// ignore previous (inner) inference result and do a fresh start:
- // avoid original(), since we only want to discard one level of instantiation
+ // avoid original(), since we only want to discard one level of instantiation
// (method type variables - not class type variables)!
method = previousMethod.shallowOriginal();
SuspendedInferenceRecord prevInvocation = inferenceContext.enterPolyInvocation(invocation, invocation.arguments());
@@ -113,7 +113,7 @@ class ConstraintExpressionFormula extends ConstraintFormula {
if (previousMethod instanceof ParameterizedGenericMethodBinding) {
// find the previous inner inference context to see what inference kind this invocation needs:
innerCtx = invocation.getInferenceContext((ParameterizedGenericMethodBinding) previousMethod);
- if (innerCtx == null) {
+ if (innerCtx == null) {
/* No inference context -> the method was likely manufactured by Scope.findExactMethod -> assume it wasn't really poly after all.
-> proceed as for non-poly expressions.
*/
@@ -161,7 +161,7 @@ class ConstraintExpressionFormula extends ConstraintFormula {
return TRUE; // assume inner inference will handle the fine print
if (!this.right.isFunctionalInterface(scope))
return FALSE;
-
+
ReferenceBinding t = (ReferenceBinding) this.right;
ParameterizedTypeBinding withWildCards = InferenceContext18.parameterizedWithWildcard(t);
if (withWildCards != null) {
@@ -240,7 +240,7 @@ class ConstraintExpressionFormula extends ConstraintFormula {
}
private boolean canBePolyExpression(Expression expr) {
- // when inferring compatibility against a right type, the check isPolyExpression
+ // when inferring compatibility against a right type, the check isPolyExpression
// must assume that expr occurs in s.t. like an assignment context:
ExpressionContext previousExpressionContext = expr.getExpressionContext();
if (previousExpressionContext == ExpressionContext.VANILLA_CONTEXT)
@@ -352,7 +352,7 @@ class ConstraintExpressionFormula extends ConstraintFormula {
} else {
compileTimeReturn = original.returnType;
}
- return (original.typeVariables() != Binding.NO_TYPE_VARIABLES
+ return (original.typeVariables() != Binding.NO_TYPE_VARIABLES
&& compileTimeReturn.mentionsAny(original.typeVariables(), -1));
}
@@ -397,8 +397,8 @@ class ConstraintExpressionFormula extends ConstraintFormula {
}
/** Perform steps from JLS 18.5.2. needed for computing the bound set B3. */
- static boolean inferPolyInvocationType(InferenceContext18 inferenceContext, InvocationSite invocationSite, TypeBinding targetType, MethodBinding method)
- throws InferenceFailureException
+ static boolean inferPolyInvocationType(InferenceContext18 inferenceContext, InvocationSite invocationSite, TypeBinding targetType, MethodBinding method)
+ throws InferenceFailureException
{
TypeBinding[] typeArguments = invocationSite.genericTypeArguments();
if (typeArguments == null) {
@@ -530,7 +530,7 @@ class ConstraintExpressionFormula extends ConstraintFormula {
sam.parameters[i].collectInferenceVariables(variables);
}
return variables;
- }
+ }
} else if (this.left instanceof ConditionalExpression && this.left.isPolyExpression()) {
ConditionalExpression expr = (ConditionalExpression) this.left;
Set<InferenceVariable> variables = new HashSet<>();
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintFormula.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintFormula.java
index 898c3ece3..36bf8c30d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintFormula.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintFormula.java
@@ -38,7 +38,7 @@ abstract class ConstraintFormula extends ReductionResult {
Collection<InferenceVariable> inputVariables(InferenceContext18 context) {
return EMPTY_VARIABLE_LIST;
}
-
+
Collection<InferenceVariable> outputVariables(InferenceContext18 context) {
Set<InferenceVariable> variables = new HashSet<>();
this.right.collectInferenceVariables(variables);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintTypeFormula.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintTypeFormula.java
index 720c6440d..13a2639a4 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintTypeFormula.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintTypeFormula.java
@@ -33,18 +33,18 @@ import org.eclipse.jdt.internal.compiler.ast.Wildcard;
class ConstraintTypeFormula extends ConstraintFormula {
TypeBinding left;
-
+
// this flag contributes to the workaround controlled by InferenceContext18.ARGUMENT_CONSTRAINTS_ARE_SOFT:
boolean isSoft;
public static ConstraintTypeFormula create(TypeBinding exprType, TypeBinding right, int relation) {
- if (exprType == null || right == null)
+ if (exprType == null || right == null)
return FALSE;
return new ConstraintTypeFormula(exprType, right, relation, false);
}
public static ConstraintTypeFormula create(TypeBinding exprType, TypeBinding right, int relation, boolean isSoft) {
- if (exprType == null || right == null)
+ if (exprType == null || right == null)
return FALSE;
return new ConstraintTypeFormula(exprType, right, relation, isSoft);
}
@@ -83,7 +83,7 @@ class ConstraintTypeFormula extends ConstraintFormula {
break;
//$FALL-THROUGH$ array of parameterized is handled below:
case Binding.PARAMETERIZED_TYPE:
- {
+ {
// this.right = G<T1,T2,...> or G<T1,T2,...>[]k
TypeBinding gs = this.left.findSuperTypeOriginatingFrom(this.right); // G<S1,S2,...> or G<S1,S2,...>[]k
if (gs != null && gs.leafComponentType().isRawType()) {
@@ -110,7 +110,7 @@ class ConstraintTypeFormula extends ConstraintFormula {
// 18.2.3:
if (this.right.kind() != Binding.WILDCARD_TYPE) { // "If T is a type" ... all alternatives require "wildcard"
if (this.left.kind() != Binding.WILDCARD_TYPE) {
- return ConstraintTypeFormula.create(this.left, this.right, SAME, this.isSoft);
+ return ConstraintTypeFormula.create(this.left, this.right, SAME, this.isSoft);
} else {
// TODO: speculative addition:
if (this.right instanceof InferenceVariable)
@@ -129,15 +129,15 @@ class ConstraintTypeFormula extends ConstraintFormula {
switch (s.boundKind) {
case Wildcard.UNBOUND:
return ConstraintTypeFormula.create(inferenceContext.object, t.bound, SUBTYPE, this.isSoft);
- case Wildcard.EXTENDS:
+ case Wildcard.EXTENDS:
return ConstraintTypeFormula.create(s.bound, t.bound, SUBTYPE, this.isSoft);
- case Wildcard.SUPER:
+ case Wildcard.SUPER:
return ConstraintTypeFormula.create(inferenceContext.object, t.bound, SAME, this.isSoft);
default:
throw new IllegalArgumentException("Unexpected boundKind "+s.boundKind); //$NON-NLS-1$
}
}
- } else { // SUPER
+ } else { // SUPER
if (this.left.kind() != Binding.WILDCARD_TYPE) {
return ConstraintTypeFormula.create(t.bound, this.left, SUBTYPE, this.isSoft);
} else {
@@ -181,7 +181,7 @@ class ConstraintTypeFormula extends ConstraintFormula {
||(leftWC.boundKind == Wildcard.SUPER && rightWC.boundKind == Wildcard.SUPER))
{
return ConstraintTypeFormula.create(leftWC.bound, rightWC.bound, SAME, this.isSoft);
- }
+ }
}
} else {
if (this.right.kind() != Binding.WILDCARD_TYPE) {
@@ -200,9 +200,9 @@ class ConstraintTypeFormula extends ConstraintFormula {
if (this.right instanceof InferenceVariable && !this.left.isPrimitiveType()) {
return new TypeBound((InferenceVariable) this.right, this.left, SAME, this.isSoft);
}
- if ((this.left.isClass() || this.left.isInterface())
+ if ((this.left.isClass() || this.left.isInterface())
&& (this.right.isClass() || this.right.isInterface())
- && TypeBinding.equalsEquals(this.left.erasure(), this.right.erasure()))
+ && TypeBinding.equalsEquals(this.left.erasure(), this.right.erasure()))
{
TypeBinding[] leftParams = this.left.typeArguments();
TypeBinding[] rightParams = this.right.typeArguments();
@@ -244,9 +244,9 @@ class ConstraintTypeFormula extends ConstraintFormula {
if (subCandidate.isSubtypeOf(superCandidate, InferenceContext18.SIMULATE_BUG_JDK_8026527))
return TRUE;
//{ObjectTeams: one more kind of "sub-typing":
- if (subCandidate instanceof ReferenceBinding && superCandidate instanceof ReferenceBinding
+ if (subCandidate instanceof ReferenceBinding && superCandidate instanceof ReferenceBinding
&& ((ReferenceBinding) subCandidate).isCompatibleViaLowering((ReferenceBinding) superCandidate))
- return TRUE;
+ return TRUE;
// SH}
return FALSE;
}
@@ -273,7 +273,7 @@ class ConstraintTypeFormula extends ConstraintFormula {
boolean isFirst = true;
while (superCandidate != null && superCandidate.kind() == Binding.PARAMETERIZED_TYPE && subCandidate != null) {
if (!addConstraintsFromTypeParameters(subCandidate, (ParameterizedTypeBinding) superCandidate, constraints))
- if (isFirst) return FALSE;
+ if (isFirst) return FALSE;
isFirst = false;
// travel to enclosing types to check if they have type parameters, too:
superCandidate = superCandidate.enclosingType();
@@ -305,7 +305,7 @@ class ConstraintTypeFormula extends ConstraintFormula {
sPrimeArray = findMostSpecificSuperArray(subTVB.firstBound, subTVB.otherUpperBounds(), subTVB);
break;
}
- default:
+ default:
return FALSE;
}
if (sPrimeArray == null)
@@ -365,7 +365,7 @@ class ConstraintTypeFormula extends ConstraintFormula {
}
throw new IllegalStateException("Unexpected RHS "+superCandidate); //$NON-NLS-1$
}
-
+
private ArrayBinding findMostSpecificSuperArray(TypeBinding firstBound, TypeBinding[] otherUpperBounds, TypeBinding theType) {
int numArrayBounds = 0;
ArrayBinding result = null;
@@ -390,7 +390,7 @@ class ConstraintTypeFormula extends ConstraintFormula {
boolean addConstraintsFromTypeParameters(TypeBinding subCandidate, ParameterizedTypeBinding ca, List<ConstraintFormula> constraints) {
TypeBinding cb = subCandidate.findSuperTypeOriginatingFrom(ca); // C<B1,B2,...>
if (cb == null)
- return false; // nothing here means we failed
+ return false; // nothing here means we failed
if (TypeBinding.equalsEquals(ca, cb)) // incl C#RAW vs C#RAW
return true;
if (!(cb instanceof ParameterizedTypeBinding)) {
@@ -402,17 +402,17 @@ class ConstraintTypeFormula extends ConstraintFormula {
if (ai == null)
return true; // no arguments here means nothing to check
if (cb.isRawType() || bi == null || bi.length == 0)
- return (this.isSoft && InferenceContext18.SIMULATE_BUG_JDK_8026527) ? true : false; // FALSE would conform to the spec
+ return (this.isSoft && InferenceContext18.SIMULATE_BUG_JDK_8026527) ? true : false; // FALSE would conform to the spec
for (int i = 0; i < ai.length; i++)
constraints.add(ConstraintTypeFormula.create(bi[i], ai[i], TYPE_ARGUMENT_CONTAINED, this.isSoft));
return true;
}
public boolean equalsEquals (ConstraintTypeFormula that) {
- return (that != null && this.relation == that.relation && this.isSoft == that.isSoft &&
+ return (that != null && this.relation == that.relation && this.isSoft == that.isSoft &&
TypeBinding.equalsEquals(this.left, that.left) && TypeBinding.equalsEquals(this.right, that.right));
}
-
+
@Override
public boolean applySubstitution(BoundSet solutionSet, InferenceVariable[] variables) {
super.applySubstitution(solutionSet, variables);
@@ -431,7 +431,7 @@ class ConstraintTypeFormula extends ConstraintFormula {
public String toString() {
StringBuffer buf = new StringBuffer("Type Constraint:\n"); //$NON-NLS-1$
buf.append('\t').append(LEFT_ANGLE_BRACKET);
- appendTypeName(buf, this.left);
+ appendTypeName(buf, this.left);
buf.append(relationToString(this.relation));
appendTypeName(buf, this.right);
buf.append(RIGHT_ANGLE_BRACKET);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ElementValuePair.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ElementValuePair.java
index dea720c46..ff19f339a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ElementValuePair.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ElementValuePair.java
@@ -23,7 +23,7 @@ public class ElementValuePair {
char[] name;
public Object value;
public MethodBinding binding;
-
+
/**
* We want to avoid eagerly resolving of all enums that are used in annotations.
* This class encapsulates an unresolved enum constant as referenced in an ElementValuePair.
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ExternalAnnotationSuperimposer.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ExternalAnnotationSuperimposer.java
index b1785aa24..f4dfe2034 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ExternalAnnotationSuperimposer.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ExternalAnnotationSuperimposer.java
@@ -55,7 +55,7 @@ class ExternalAnnotationSuperimposer extends TypeBindingVisitor {
} catch (FileNotFoundException e) {
// file not found is expected
} catch (IOException e) {
- typeBinding.scope.problemReporter().abortDueToInternalError(Messages.bind(Messages.abort_externaAnnotationFile,
+ typeBinding.scope.problemReporter().abortDueToInternalError(Messages.bind(Messages.abort_externaAnnotationFile,
new String[] {String.valueOf(typeBinding.readableName()), externalAnnotationPath, e.getMessage()}));
} finally {
if (zipFile != null)
@@ -118,7 +118,7 @@ class ExternalAnnotationSuperimposer extends TypeBindingVisitor {
private TypeBinding typeReplacement;
private LookupEnvironment environment;
private boolean isReplacing;
-
+
ExternalAnnotationSuperimposer(LookupEnvironment environment) {
this.environment = environment;
}
@@ -157,13 +157,13 @@ class ExternalAnnotationSuperimposer extends TypeBindingVisitor {
return cl.cast(this.typeReplacement);
return type;
}
-
+
private TypeBinding goAndSuperimpose(ITypeAnnotationWalker walker, TypeBinding type) {
// no reset here
if (walker == ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER)
return type;
this.currentWalker = walker;
-
+
TypeBindingVisitor.visit(this, type);
if (this.typeReplacement == null)
@@ -173,7 +173,7 @@ class ExternalAnnotationSuperimposer extends TypeBindingVisitor {
this.typeReplacement = null;
return answer;
}
-
+
@Override
public boolean visit(ArrayBinding arrayBinding) {
ExternalAnnotationSuperimposer memento = snapshot();
@@ -229,7 +229,7 @@ class ExternalAnnotationSuperimposer extends TypeBindingVisitor {
return false;
} finally {
restore(memento);
- }
+ }
}
@Override
public boolean visit(RawTypeBinding rawTypeBinding) {
@@ -254,7 +254,7 @@ class ExternalAnnotationSuperimposer extends TypeBindingVisitor {
if (bound != null) {
bound = goAndSuperimpose(memento.currentWalker.toWildcardBound(), bound);
}
- IBinaryAnnotation[] binaryAnnotations = memento.currentWalker.getAnnotationsAtCursor(-1, false);
+ IBinaryAnnotation[] binaryAnnotations = memento.currentWalker.getAnnotationsAtCursor(-1, false);
if (this.isReplacing || binaryAnnotations != ITypeAnnotationWalker.NO_ANNOTATIONS) {
TypeBinding[] otherBounds = wildcardBinding.otherBounds;
if (binaryAnnotations != ITypeAnnotationWalker.NO_ANNOTATIONS) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ExtraCompilerModifiers.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ExtraCompilerModifiers.java
index 495b1c57b..0bb313475 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ExtraCompilerModifiers.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ExtraCompilerModifiers.java
@@ -53,7 +53,7 @@ public interface ExtraCompilerModifiers { // modifier constant
final int AccBlankFinal = ASTNode.Bit27; // for blank final variables
final int AccIsDefaultConstructor = ASTNode.Bit27; // for default constructor
final int AccLocallyUsed = ASTNode.Bit28; // used to diagnose unused (a) private/local members or (b) members of private classes
- // generally set when actual usage has been detected
+ // generally set when actual usage has been detected
// or, (b) when member of a private class is exposed via a non-private subclass
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=328281
final int AccVisibilityMASK = ClassFileConstants.AccPublic | ClassFileConstants.AccProtected | ClassFileConstants.AccPrivate;
@@ -69,7 +69,7 @@ public interface ExtraCompilerModifiers { // modifier constant
* also: AccDefaultMethod, for disambiguation avoid Flags.toString() in favor of Flags.typeFlagsToString()
*/
int AccRole = ASTNode.Bit17;
-
+
/**
* Encoding for the "team" class modifier.
*/
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/FieldBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/FieldBinding.java
index fece30cf0..e40381e20 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/FieldBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/FieldBinding.java
@@ -349,7 +349,7 @@ public void fillInDefaultNonNullness(FieldDeclaration sourceField, Scope scope)
this.tagBits |= TagBits.AnnotationNonNull;
} else if ((this.tagBits & TagBits.AnnotationNonNull) != 0) {
scope.problemReporter().nullAnnotationIsRedundant(sourceField);
- }
+ }
}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ImplicitNullAnnotationVerifier.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ImplicitNullAnnotationVerifier.java
index dfdd9b91b..0c38ddb38 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ImplicitNullAnnotationVerifier.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ImplicitNullAnnotationVerifier.java
@@ -105,15 +105,15 @@ public class ImplicitNullAnnotationVerifier {
// compatibility & inheritance do not consider constructors / static methods:
boolean isInstanceMethod = !currentMethod.isConstructor() && !currentMethod.isStatic();
complain &= isInstanceMethod;
- if (!needToApplyNonNullDefault
- && !complain
+ if (!needToApplyNonNullDefault
+ && !complain
&& !(this.inheritNullAnnotations && isInstanceMethod)) {
return; // short cut, no work to be done
}
if (isInstanceMethod) {
List superMethodList = new ArrayList();
-
+
// need super types connected:
if (currentType instanceof SourceTypeBinding && !currentType.isHierarchyConnected() && !currentType.isAnonymousType()) {
((SourceTypeBinding) currentType).scope.connectTypeHierarchy();
@@ -122,8 +122,8 @@ public class ImplicitNullAnnotationVerifier {
int paramLen = currentMethod.parameters.length;
findAllOverriddenMethods(currentMethod.original(), currentMethod.selector, paramLen,
currentType, new HashSet(), superMethodList);
-
- // prepare interim storage for nullness info so we don't pollute currentMethod before we know its conflict-free:
+
+ // prepare interim storage for nullness info so we don't pollute currentMethod before we know its conflict-free:
InheritedNonNullnessInfo[] inheritedNonNullnessInfos = new InheritedNonNullnessInfo[paramLen+1]; // index 0 is for the return type
for (int i=0; i<paramLen+1; i++) inheritedNonNullnessInfos[i] = new InheritedNonNullnessInfo();
@@ -137,7 +137,7 @@ public class ImplicitNullAnnotationVerifier {
checkNullSpecInheritance(currentMethod, srcMethod, needToApplyReturnNonNullDefault, needToApplyParameterNonNullDefault, complain, currentSuper, null, scope, inheritedNonNullnessInfos);
needToApplyNonNullDefault = false;
}
-
+
// transfer collected information into currentMethod:
InheritedNonNullnessInfo info = inheritedNonNullnessInfos[0];
if (!info.complained) {
@@ -176,17 +176,17 @@ public class ImplicitNullAnnotationVerifier {
else
currentMethod.fillInDefaultNonNullness18(srcMethod, scope.environment());
}
- } finally {
+ } finally {
currentMethod.tagBits |= TagBits.IsNullnessKnown;
}
}
- /*
+ /*
* Recursively traverse the tree of ancestors but whenever we find a matching method prune the super tree.
* Collect all matching methods in 'result'.
*/
- private void findAllOverriddenMethods(MethodBinding original, char[] selector, int suggestedParameterLength,
- ReferenceBinding currentType, Set ifcsSeen, List result)
+ private void findAllOverriddenMethods(MethodBinding original, char[] selector, int suggestedParameterLength,
+ ReferenceBinding currentType, Set ifcsSeen, List result)
{
if (currentType.id == TypeIds.T_JavaLangObject)
return;
@@ -214,7 +214,7 @@ public class ImplicitNullAnnotationVerifier {
/* collect matching methods from one supertype. */
private void collectOverriddenMethods(MethodBinding original, char[] selector, int suggestedParameterLength,
- ReferenceBinding superType, Set ifcsSeen, List result)
+ ReferenceBinding superType, Set ifcsSeen, List result)
{
MethodBinding [] ifcMethods = superType.unResolvedMethods();
int length = ifcMethods.length;
@@ -242,7 +242,7 @@ public class ImplicitNullAnnotationVerifier {
* @param srcMethod AST of 'currentMethod' if present
* @param hasReturnNonNullDefault is a @NonNull default applicable for the return type of currentMethod?
* @param hasParameterNonNullDefault is a @NonNull default applicable for parameters of currentMethod?
- * @param shouldComplain should we report any errors found?
+ * @param shouldComplain should we report any errors found?
* (see also comment about flows into this method, below).
* @param inheritedMethod one overridden method from a super type
* @param allInheritedMethods look here to see if nonnull-unannotated conflict already exists in one super type
@@ -251,9 +251,9 @@ public class ImplicitNullAnnotationVerifier {
* interim recording of nullness information from inheritedMethod rather than prematurely updating currentMethod.
* Index position 0 is used for the return type, positions i+1 for argument i.
*/
- void checkNullSpecInheritance(MethodBinding currentMethod, AbstractMethodDeclaration srcMethod,
+ void checkNullSpecInheritance(MethodBinding currentMethod, AbstractMethodDeclaration srcMethod,
boolean hasReturnNonNullDefault, ParameterNonNullDefaultProvider hasParameterNonNullDefault, boolean shouldComplain,
- MethodBinding inheritedMethod, MethodBinding[] allInheritedMethods, Scope scope, InheritedNonNullnessInfo[] inheritedNonNullnessInfos)
+ MethodBinding inheritedMethod, MethodBinding[] allInheritedMethods, Scope scope, InheritedNonNullnessInfo[] inheritedNonNullnessInfos)
{
if(currentMethod.declaringClass.id == TypeIds.T_JavaLangObject) {
// all method implementations in java.lang.Object return non-null results and accept nullable as parameter.
@@ -276,7 +276,7 @@ public class ImplicitNullAnnotationVerifier {
boolean useTypeAnnotations = this.environment.usesNullTypeAnnotations();
long inheritedNullnessBits = getReturnTypeNullnessTagBits(inheritedMethod, useTypeAnnotations);
long currentNullnessBits = getReturnTypeNullnessTagBits(currentMethod, useTypeAnnotations);
-
+
boolean shouldInherit = this.inheritNullAnnotations;
// return type:
@@ -294,12 +294,12 @@ public class ImplicitNullAnnotationVerifier {
// still use the inherited bits to avoid incompatibility
}
if (inheritedNonNullnessInfos != null && srcMethod != null) {
- recordDeferredInheritedNullness(scope, ((MethodDeclaration) srcMethod).returnType,
+ recordDeferredInheritedNullness(scope, ((MethodDeclaration) srcMethod).returnType,
inheritedMethod, Boolean.valueOf(inheritedNullnessBits == TagBits.AnnotationNonNull), inheritedNonNullnessInfos[0]);
} else {
// no need to defer, record this info now:
applyReturnNullBits(currentMethod, inheritedNullnessBits);
- }
+ }
break returnType; // compatible by construction, skip complain phase below
}
}
@@ -366,7 +366,7 @@ public class ImplicitNullAnnotationVerifier {
for (int i = 0; i < length; i++) {
if (currentMethod.parameters[i].isBaseType()) continue;
- Argument currentArgument = currentArguments == null
+ Argument currentArgument = currentArguments == null
? null : currentArguments[i];
Boolean inheritedNonNullNess = getParameterNonNullness(inheritedMethod, i, useTypeAnnotations);
Boolean currentNonNullNess = getParameterNonNullness(currentMethod, i, useTypeAnnotations);
@@ -416,7 +416,7 @@ public class ImplicitNullAnnotationVerifier {
annotationName = this.environment.getNullableAnnotationName();
}
if (inheritedNonNullNess != Boolean.TRUE // super parameter is not restricted to @NonNull
- && currentNonNullNess == Boolean.TRUE) // current parameter is restricted to @NonNull
+ && currentNonNullNess == Boolean.TRUE) // current parameter is restricted to @NonNull
{
// incompatible
if (currentArgument != null) {
@@ -428,10 +428,10 @@ public class ImplicitNullAnnotationVerifier {
scope.problemReporter().cannotImplementIncompatibleNullness(scope.referenceContext(), currentMethod, inheritedMethod, false);
}
continue;
- } else if (currentNonNullNess == null)
+ } else if (currentNonNullNess == null)
{
// unannotated strictly conflicts only with inherited @Nullable
- if (inheritedNonNullNess == Boolean.FALSE) {
+ if (inheritedNonNullNess == Boolean.FALSE) {
if (currentArgument != null) {
scope.problemReporter().parameterLackingNullableAnnotation(
currentArgument,
@@ -453,12 +453,12 @@ public class ImplicitNullAnnotationVerifier {
scope.problemReporter().parameterLackingNonnullAnnotation(currentArgument, inheritedMethod.declaringClass, annotationName);
} else {
TypeDeclaration type = scope.classScope().referenceContext;
- ASTNode location = type.superclass != null ? type.superclass : type;
+ ASTNode location = type.superclass != null ? type.superclass : type;
scope.problemReporter().inheritedParameterLackingNonnullAnnotation(currentMethod, i+1, inheritedMethod.declaringClass, location, annotationName);
}
continue;
}
- }
+ }
if (useTypeAnnotations) {
TypeBinding inheritedParameter = inheritedMethod.parameters[i];
TypeBinding substituteParameter = substituteParameters != null ? substituteParameters[i] : null;
@@ -520,12 +520,12 @@ public class ImplicitNullAnnotationVerifier {
/* check for conflicting annotations and record here the info 'inheritedNonNullness' found in 'inheritedMethod'. */
protected void recordDeferredInheritedNullness(Scope scope, ASTNode location,
- MethodBinding inheritedMethod, Boolean inheritedNonNullness,
- InheritedNonNullnessInfo nullnessInfo)
+ MethodBinding inheritedMethod, Boolean inheritedNonNullness,
+ InheritedNonNullnessInfo nullnessInfo)
{
if (nullnessInfo.inheritedNonNullness != null && nullnessInfo.inheritedNonNullness != inheritedNonNullness) {
- scope.problemReporter().conflictingInheritedNullAnnotations(location,
- nullnessInfo.inheritedNonNullness.booleanValue(), nullnessInfo.annotationOrigin,
+ scope.problemReporter().conflictingInheritedNullAnnotations(location,
+ nullnessInfo.inheritedNonNullness.booleanValue(), nullnessInfo.annotationOrigin,
inheritedNonNullness.booleanValue(), inheritedMethod);
nullnessInfo.complained = true;
// leave previous info intact, so subsequent errors are reported against the same first method
@@ -554,7 +554,7 @@ public class ImplicitNullAnnotationVerifier {
}
// ==== minimal set of utility methods previously from MethodVerifier15: ====
-
+
//{ObjectTeams: added 3. argument:
static boolean areParametersEqual(MethodBinding one, MethodBinding two, LookupEnvironment environment) {
// SH}
@@ -571,7 +571,7 @@ public class ImplicitNullAnnotationVerifier {
int length = oneArgs.length;
if (length != twoArgs.length) return false;
-
+
// methods with raw parameters are considered equal to inherited methods
// with parameterized parameters for backwards compatibility, need a more complex check
int i;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java
index 8ae0a05c3..05f223526 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java
@@ -42,7 +42,7 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.lookup.ITeamAnchor;
/**
* Main class for new type inference as per JLS8 sect 18.
* Keeps contextual state and drives the algorithm.
- *
+ *
* <h2>Inference Basics</h2>
* <ul>
* <li>18.1.1 Inference variables: {@link InferenceVariable}</li>
@@ -112,14 +112,14 @@ public class InferenceContext18 {
/** to conform with javac regarding https://bugs.openjdk.java.net/browse/JDK-8026527 */
static final boolean SIMULATE_BUG_JDK_8026527 = true;
-
- /** Temporary workaround until we know fully what to do with https://bugs.openjdk.java.net/browse/JDK-8054721
+
+ /** Temporary workaround until we know fully what to do with https://bugs.openjdk.java.net/browse/JDK-8054721
* It looks likely that we have a bug independent of this JLS bug in that we clear the capture bounds eagerly.
*/
static final boolean SHOULD_WORKAROUND_BUG_JDK_8054721 = true; // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=437444#c24 onwards
-
+
static final boolean SHOULD_WORKAROUND_BUG_JDK_8153748 = true; // emulating javac behaviour after private email communication
-
+
/**
* Detail flag to control the extent of {@link #SIMULATE_BUG_JDK_8026527}.
* A setting of 'false' implements the advice from http://mail.openjdk.java.net/pipermail/lambda-spec-experts/2013-December/000447.html
@@ -134,7 +134,7 @@ public class InferenceContext18 {
InvocationSite currentInvocation;
/** arguments of #currentInvocation, if any */
Expression[] invocationArguments;
-
+
/** The inference variables for which as solution is sought. */
InferenceVariable[] inferenceVariables;
@@ -156,7 +156,7 @@ public class InferenceContext18 {
/** Invocation Type Inference (18.5.2) has been completed (for some target type). */
public static final int TYPE_INFERRED = 2;
public static final int TYPE_INFERRED_FINAL = 3; // as above plus asserting that target type was a proper type
-
+
/** Signals whether any type compatibility makes use of unchecked conversion. */
public List<ConstraintFormula> constraintsWithUncheckedConversion;
public boolean usesUncheckedConversion;
@@ -168,12 +168,12 @@ public class InferenceContext18 {
public BoundSet b2;
private BoundSet b3;
/** Not per JLS: inbox for emulation of how javac passes type bounds from inner to outer */
- private BoundSet innerInbox;
+ private BoundSet innerInbox;
/** Not per JLS: signal when current is ready to directly merge all bounds from inner. */
private boolean directlyAcceptingInnerBounds = false;
/** Not per JLS: pushing bounds from inner to outer may have to be deferred till after overload resolution, store here a runnable to perform the push. */
private Runnable pushToOuterJob = null;
-
+
public static boolean isSameSite(InvocationSite site1, InvocationSite site2) {
if (site1 == site2)
return true;
@@ -188,7 +188,7 @@ public class InferenceContext18 {
public static final int CHECK_STRICT = 1;
public static final int CHECK_LOOSE = 2;
public static final int CHECK_VARARG = 3;
-
+
static class SuspendedInferenceRecord {
InvocationSite site;
Expression[] invocationArguments;
@@ -203,7 +203,7 @@ public class InferenceContext18 {
this.usesUncheckedConversion = usesUncheckedConversion;
}
}
-
+
/** Construct an inference context for an invocation (method/constructor). */
public InferenceContext18(Scope scope, Expression[] arguments, InvocationSite site, InferenceContext18 outerContext) {
this.scope = scope;
@@ -227,7 +227,7 @@ public class InferenceContext18 {
* @return the set of inference variables created for the given typeParameters
*/
public InferenceVariable[] createInitialBoundSet(TypeVariableBinding[] typeParameters) {
- //
+ //
if (this.currentBounds == null) {
this.currentBounds = new BoundSet();
}
@@ -240,7 +240,7 @@ public class InferenceContext18 {
}
/**
- * Substitute any type variables mentioned in 'type' by the corresponding inference variable, if one exists.
+ * Substitute any type variables mentioned in 'type' by the corresponding inference variable, if one exists.
*/
public TypeBinding substitute(TypeBinding type) {
InferenceSubstitution inferenceSubstitution = new InferenceSubstitution(this);
@@ -369,7 +369,7 @@ public class InferenceContext18 {
break;
}
}
- }
+ }
}
/** JLS 18.5.1 Invocation Applicability Inference. */
@@ -378,8 +378,8 @@ public class InferenceContext18 {
}
/** Perform steps from JLS 18.5.2. needed for computing the bound set B3. */
- boolean computeB3(InvocationSite invocationSite, TypeBinding targetType, MethodBinding method)
- throws InferenceFailureException
+ boolean computeB3(InvocationSite invocationSite, TypeBinding targetType, MethodBinding method)
+ throws InferenceFailureException
{
boolean result = ConstraintExpressionFormula.inferPolyInvocationType(this, invocationSite, targetType, method);
if (result) {
@@ -390,16 +390,16 @@ public class InferenceContext18 {
return result;
}
- /** JLS 18.5.2 Invocation Type Inference
+ /** JLS 18.5.2 Invocation Type Inference
*/
- public BoundSet inferInvocationType(TypeBinding expectedType, InvocationSite invocationSite, MethodBinding method) throws InferenceFailureException
+ public BoundSet inferInvocationType(TypeBinding expectedType, InvocationSite invocationSite, MethodBinding method) throws InferenceFailureException
{
// not JLS: simply ensure that null hints from the return type have been seen even in standalone contexts:
if (expectedType == null && method.returnType != null)
substitute(method.returnType); // result is ignore, the only effect is on InferenceVariable.nullHints
-
+
this.currentBounds = this.b2.copy();
-
+
int step = (expectedType == null || expectedType.isProperType(true)) ? TYPE_INFERRED_FINAL : TYPE_INFERRED;
try {
@@ -407,7 +407,7 @@ public class InferenceContext18 {
if (expectedType != null
&& expectedType != TypeBinding.VOID
&& invocationSite instanceof Expression && ((Expression) invocationSite).isTrulyExpression()
- && ((Expression)invocationSite).isPolyExpression(method))
+ && ((Expression)invocationSite).isPolyExpression(method))
{
// 3. bullet: special treatment for poly expressions
if (!computeB3(invocationSite, expectedType, method)) {
@@ -458,7 +458,7 @@ public class InferenceContext18 {
// don't bother with finding the necessary superset, just resolve all:
if (solution == null)
solution = resolve(this.inferenceVariables);
- // * ~ apply substitutions to all constraints:
+ // * ~ apply substitutions to all constraints:
bottomIt = bottomSet.iterator();
while (bottomIt.hasNext()) {
ConstraintFormula constraint = bottomIt.next();
@@ -553,7 +553,7 @@ public class InferenceContext18 {
TypeBinding parameter = getParameter(method.parameters, i, method.isVarargs());
if (parameter == null)
return ReductionResult.FALSE;
- parameter = substitution.substitute(substitution, parameter);
+ parameter = substitution.substitute(substitution, parameter);
ReductionResult result = addJDK_8153748ConstraintsFromExpression(argument, parameter, method, substitution);
if (result == ReductionResult.FALSE)
return ReductionResult.FALSE;
@@ -610,7 +610,7 @@ public class InferenceContext18 {
}
return null;
}
-
+
InferenceSubstitution enrichSubstitution(InferenceSubstitution substitution, Invocation innerInvocation, MethodBinding innerMethod) {
if (innerMethod instanceof ParameterizedGenericMethodBinding) {
InferenceContext18 innerContext = innerInvocation.getInferenceContext((ParameterizedMethodBinding) innerMethod);
@@ -699,7 +699,7 @@ public class InferenceContext18 {
MethodBinding innerMethod = invocation.binding();
if (innerMethod == null)
return true; // -> proceed with no new C set elements.
-
+
Expression[] arguments = invocation.arguments();
TypeBinding[] argumentTypes = arguments == null ? Binding.NO_PARAMETERS : new TypeBinding[arguments.length];
for (int i = 0; i < argumentTypes.length; i++)
@@ -707,7 +707,7 @@ public class InferenceContext18 {
InferenceContext18 innerContext = null;
if (innerMethod instanceof ParameterizedGenericMethodBinding)
innerContext = invocation.getInferenceContext((ParameterizedGenericMethodBinding) innerMethod);
-
+
if (innerContext != null) {
MethodBinding shallowMethod = innerMethod.shallowOriginal();
innerContext.outerContext = this;
@@ -739,7 +739,7 @@ public class InferenceContext18 {
return true;
}
-
+
protected int getInferenceKind(MethodBinding nonGenericMethod, TypeBinding[] argumentTypes) {
switch (this.scope.parameterCompatibilityLevel(nonGenericMethod, argumentTypes)) {
case Scope.AUTOBOX_COMPATIBLE:
@@ -754,8 +754,8 @@ public class InferenceContext18 {
/**
* 18.5.3 Functional Interface Parameterization Inference
*/
- public ReferenceBinding inferFunctionalInterfaceParameterization(LambdaExpression lambda, BlockScope blockScope,
- ParameterizedTypeBinding targetTypeWithWildCards)
+ public ReferenceBinding inferFunctionalInterfaceParameterization(LambdaExpression lambda, BlockScope blockScope,
+ ParameterizedTypeBinding targetTypeWithWildCards)
{
TypeBinding[] q = createBoundsForFunctionalInterfaceParameterizationInference(targetTypeWithWildCards);
if (q == null || q.length != lambda.arguments().length) {
@@ -782,7 +782,7 @@ public class InferenceContext18 {
/**
* Create initial bound set for 18.5.3 Functional Interface Parameterization Inference
* @param functionalInterface the functional interface F<A1,..Am>
- * @return the parameter types Q1..Qk of the function type of the type F<α1, ..., αm>, or null
+ * @return the parameter types Q1..Qk of the function type of the type F<α1, ..., αm>, or null
*/
TypeBinding[] createBoundsForFunctionalInterfaceParameterizationInference(ParameterizedTypeBinding functionalInterface) {
if (this.currentBounds == null)
@@ -871,7 +871,7 @@ public class InferenceContext18 {
return false;
}
}
-
+
// FALSE: inference fails
// TRUE: constraints have been incorporated
// null: need to create the si <: ti constraint
@@ -895,13 +895,13 @@ public class InferenceContext18 {
for (int i = 0; i < elements.length; i++)
if (!siSuperI(elements[i], funcI))
break checkSuper;
- return null; // bullet 4
+ return null; // bullet 4
// each element of the intersection is a superinterface of I, or a parameterization of a superinterface of I.
}
for (int i = 0; i < elements.length; i++)
if (siSubI(elements[i], funcI))
return null; // bullet 5
- // some element of the intersection is a subinterface of I, or a parameterization of a subinterface of I.
+ // some element of the intersection is a subinterface of I, or a parameterization of a subinterface of I.
}
// all passed, time to do some work:
TypeBinding siCapture = si.capture(this.scope, expri.sourceStart, expri.sourceEnd);
@@ -916,7 +916,7 @@ public class InferenceContext18 {
return null;
}
- private boolean checkExpression(Expression expri, TypeBinding[] u, TypeBinding r1, TypeBinding[] v, TypeBinding r2)
+ private boolean checkExpression(Expression expri, TypeBinding[] u, TypeBinding r1, TypeBinding[] v, TypeBinding r2)
throws InferenceFailureException {
if (expri instanceof LambdaExpression && !((LambdaExpression)expri).argumentsTypeElided()) {
for (int i = 0; i < u.length; i++) {
@@ -955,7 +955,7 @@ public class InferenceContext18 {
break checkPrimitive2;
}
return true;
- }
+ }
}
return reduceAndIncorporate(ConstraintTypeFormula.create(r1, r2, ReductionResult.SUBTYPE));
} else if (expri instanceof ReferenceExpression && ((ReferenceExpression)expri).isExactMethodReference()) {
@@ -968,7 +968,7 @@ public class InferenceContext18 {
return true;
MethodBinding method = reference.getExactMethod();
TypeBinding returnType = method.isConstructor() ? method.declaringClass : method.returnType;
- if (r1.isPrimitiveType() && !r2.isPrimitiveType() && returnType.isPrimitiveType())
+ if (r1.isPrimitiveType() && !r2.isPrimitiveType() && returnType.isPrimitiveType())
return true;
if (r2.isPrimitiveType() && !r1.isPrimitiveType() && !returnType.isPrimitiveType())
return true;
@@ -1029,14 +1029,14 @@ public class InferenceContext18 {
this.b2 = this.currentBounds.copy(); // Preserve the result after reduction, without effects of resolve() for later use in invocation type inference.
BoundSet solution = resolve(this.inferenceVariables);
-
+
/* If inferring applicability make a final pass over the initial constraints preserved as final constraints to make sure they hold true at a macroscopic level.
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=426537#c55 onwards.
*/
if (inferringApplicability && solution != null && this.finalConstraints != null) {
for (ConstraintExpressionFormula constraint: this.finalConstraints) {
if (constraint.left.isPolyExpression())
- continue; // avoid redundant re-inference, inner poly's own constraints get validated in its own context & poly invocation type inference proved compatibility against target.
+ continue; // avoid redundant re-inference, inner poly's own constraints get validated in its own context & poly invocation type inference proved compatibility against target.
constraint.applySubstitution(solution, this.inferenceVariables);
if (!this.currentBounds.reduceOneConstraint(this, constraint)) {
return null;
@@ -1045,11 +1045,11 @@ public class InferenceContext18 {
}
return solution;
}
-
+
public /*@Nullable*/ BoundSet solve() throws InferenceFailureException {
return solve(false);
}
-
+
public /*@Nullable*/ BoundSet solve(InferenceVariable[] toResolve) throws InferenceFailureException {
if (!reduce())
return null;
@@ -1060,8 +1060,8 @@ public class InferenceContext18 {
}
/**
- * JLS 18.2. reduce all initial constraints
- * @throws InferenceFailureException
+ * JLS 18.2. reduce all initial constraints
+ * @throws InferenceFailureException
*/
private boolean reduce() throws InferenceFailureException {
// Caution: This can be reentered recursively even as an earlier call is munching through the constraints !
@@ -1128,11 +1128,11 @@ public class InferenceContext18 {
/**
* <b>JLS 18.4</b> Resolution
* @return answer null if some constraint resolved to FALSE, otherwise the boundset representing the solution
- * @throws InferenceFailureException
+ * @throws InferenceFailureException
*/
private /*@Nullable*/ BoundSet resolve(InferenceVariable[] toResolve) throws InferenceFailureException {
this.captureId = 0;
- // NOTE: 18.5.2 ...
+ // NOTE: 18.5.2 ...
// "(While it was necessary to demonstrate that the inference variables in B1 could be resolved
// in order to establish applicability, the resulting instantiations are not considered part of B1.)
// For this reason, resolve works on a temporary bound set, copied before any modification.
@@ -1181,7 +1181,7 @@ public class InferenceContext18 {
if (glb == null) {
// inconsistent intersection
tmpBoundSet = prevBoundSet; // clean up
- break variables; // and start over
+ break variables; // and start over
}
}
}
@@ -1202,7 +1202,7 @@ public class InferenceContext18 {
final BoundSet kurrentBoundSet = tmpBoundSet;
Substitution theta = new Substitution() {
@Override
- public LookupEnvironment environment() {
+ public LookupEnvironment environment() {
return InferenceContext18.this.environment;
}
@Override
@@ -1281,7 +1281,7 @@ public class InferenceContext18 {
}
return tmpBoundSet;
}
-
+
private TypeBinding intersectionFromGlb(TypeBinding[] glbs) {
ReferenceBinding[] refGlbs = new ReferenceBinding[glbs.length];
for (int i = 0; i < glbs.length; i++) {
@@ -1297,9 +1297,9 @@ public class InferenceContext18 {
return intersection;
return null;
}
-
+
int captureId = 0;
-
+
/** For 18.4: "Let Z1, ..., Zn be fresh type variables" use capture bindings. */
private CaptureBinding18 freshCapture(InferenceVariable variable) {
int id = this.captureId++;
@@ -1310,7 +1310,7 @@ public class InferenceContext18 {
start, end, id, this.environment);
}
// === ===
-
+
private boolean setUpperBounds(CaptureBinding18 typeVariable, TypeBinding[] substitutedUpperBounds) {
// 18.4: ... define the upper bound of Zi as glb(L1θ, ..., Lkθ)
if (substitutedUpperBounds.length == 1) {
@@ -1337,7 +1337,7 @@ public class InferenceContext18 {
Arrays.sort(types, new Comparator<TypeBinding>() {
@Override
public int compare(TypeBinding o1, TypeBinding o2) {
- int i1 = o1.id, i2 = o2.id;
+ int i1 = o1.id, i2 = o2.id;
return (i1<i2 ? -1 : (i1==i2 ? 0 : 1));
}
});
@@ -1349,7 +1349,7 @@ public class InferenceContext18 {
*/
private Set<InferenceVariable> getSmallestVariableSet(BoundSet bounds, InferenceVariable[] subSet) {
// "Given a set of inference variables to resolve, let V be the union of this set and
- // all variables upon which the resolution of at least one variable in this set depends."
+ // all variables upon which the resolution of at least one variable in this set depends."
Set<InferenceVariable> v = new HashSet<InferenceVariable>();
Map<InferenceVariable,Set<InferenceVariable>> dependencies = new HashMap<>(); // compute only once, store for the final loop over 'v'.
for (InferenceVariable iv : subSet) {
@@ -1408,7 +1408,7 @@ public class InferenceContext18 {
// causing non-termination of the algorithm.
// Since that is not acceptable, I'm *interpreting* the spec to request a search for a constraint
// that "best matches" the given conditions.
-
+
// collect all constraints participating in a cycle
HashMap<ConstraintFormula,Set<ConstraintFormula>> dependencies = new HashMap<ConstraintFormula, Set<ConstraintFormula>>();
Set<ConstraintFormula> cycles = new HashSet<ConstraintFormula>();
@@ -1447,7 +1447,7 @@ public class InferenceContext18 {
}
if (candidatesII.isEmpty())
candidatesII = c; // not spec'ed but needed to avoid returning null below, witness: java.util.stream.Collectors
-
+
// tentatively: (iii) has the form ⟨Expression → T⟩
Set<ConstraintFormula> candidatesIII = new HashSet<ConstraintFormula>();
for (ConstraintFormula candidate : candidatesII) {
@@ -1459,7 +1459,7 @@ public class InferenceContext18 {
} else { // candidatesIII contains all relevant constraints ⟨Expression → T⟩
// (iv) contains an expression that appears to the left of the expression
// of every other constraint satisfying the previous three requirements
-
+
// collect containment info regarding all expressions in candidate constraints:
// (a) find minimal enclosing expressions:
Map<ConstraintExpressionFormula,ConstraintExpressionFormula> expressionContainedBy = new HashMap<ConstraintExpressionFormula, ConstraintExpressionFormula>();
@@ -1486,7 +1486,7 @@ public class InferenceContext18 {
containmentForest.put(parent, children = new HashSet<ConstraintExpressionFormula>());
children.add(parentRelation.getKey());
}
-
+
// approximate the spec by searching the largest containment tree:
int bestRank = -1;
ConstraintExpressionFormula candidate = null;
@@ -1500,7 +1500,7 @@ public class InferenceContext18 {
if (candidate != null)
return candidate;
}
-
+
if (candidatesIII.isEmpty())
throw new IllegalStateException("cannot pick constraint from cyclic set"); //$NON-NLS-1$
return candidatesIII.iterator().next();
@@ -1552,7 +1552,7 @@ public class InferenceContext18 {
}
/** non-roots answer -1, roots answer the size of the spanned tree */
- private int rankNode(ConstraintExpressionFormula parent,
+ private int rankNode(ConstraintExpressionFormula parent,
Map<ConstraintExpressionFormula,ConstraintExpressionFormula> expressionContainedBy,
Map<ConstraintExpressionFormula, Set<ConstraintExpressionFormula>> containmentForest)
{
@@ -1570,7 +1570,7 @@ public class InferenceContext18 {
return sum;
}
- private Set<ConstraintFormula> findBottomSet(Set<ConstraintFormula> constraints,
+ private Set<ConstraintFormula> findBottomSet(Set<ConstraintFormula> constraints,
Set<InferenceVariable> allOutputVariables, List<Set<InferenceVariable>> components)
{
// 18.5.2 bullet 5.(1)
@@ -1621,7 +1621,7 @@ public class InferenceContext18 {
types[i] = last;
return types;
}
-
+
public SuspendedInferenceRecord enterPolyInvocation(InvocationSite invocation, Expression[] innerArguments) {
SuspendedInferenceRecord record = new SuspendedInferenceRecord(this.currentInvocation, this.invocationArguments, this.inferenceVariables, this.inferenceKind, this.usesUncheckedConversion);
this.inferenceVariables = null;
@@ -1630,7 +1630,7 @@ public class InferenceContext18 {
this.usesUncheckedConversion = false;
return record;
}
-
+
public SuspendedInferenceRecord enterLambda(LambdaExpression lambda) {
SuspendedInferenceRecord record = new SuspendedInferenceRecord(this.currentInvocation, this.invocationArguments, this.inferenceVariables, this.inferenceKind, this.usesUncheckedConversion);
this.inferenceVariables = null;
@@ -1665,7 +1665,7 @@ public class InferenceContext18 {
System.arraycopy(this.inferenceVariables, 0, this.inferenceVariables=new InferenceVariable[l1+l2], l2, l1);
System.arraycopy(record.inferenceVariables, 0, this.inferenceVariables, 0, l2);
}
-
+
// replace invocation site & arguments:
this.currentInvocation = record.site;
this.invocationArguments = record.invocationArguments;
@@ -1682,11 +1682,11 @@ public class InferenceContext18 {
}
return this.seenInnerContexts.add(innerContext);
}
-
+
private Substitution getResultSubstitution(final BoundSet result) {
return new Substitution() {
@Override
- public LookupEnvironment environment() {
+ public LookupEnvironment environment() {
return InferenceContext18.this.environment;
}
@Override
@@ -1723,7 +1723,7 @@ public class InferenceContext18 {
public static TypeBinding getParameter(TypeBinding[] parameters, int rank, boolean isVarArgs) {
if (isVarArgs) {
if (rank >= parameters.length-1)
- return ((ArrayBinding)parameters[parameters.length-1]).elementsType();
+ return ((ArrayBinding)parameters[parameters.length-1]).elementsType();
} else if (rank >= parameters.length) {
return null;
}
@@ -1745,7 +1745,7 @@ public class InferenceContext18 {
}
/* We used to check if expected type is null and if so return method, but that is wrong - it injects an incompatible method into overload resolution.
if we get here with expected type set to null at all, the target context does not define a target type (vanilla context), so inference has done its
- best and nothing more to do than to signal error.
+ best and nothing more to do than to signal error.
*/
ProblemMethodBinding problemMethod = new ProblemMethodBinding(method, method.selector, method.parameters, ProblemReasons.InvocationTypeInferenceFailure);
problemMethod.returnType = expectedType != null ? expectedType : method.returnType;
@@ -1831,7 +1831,7 @@ public class InferenceContext18 {
this.constraintsWithUncheckedConversion.add(constraint);
this.usesUncheckedConversion = true;
}
-
+
void reportUncheckedConversions(BoundSet solution) {
if (this.constraintsWithUncheckedConversion != null) {
int len = this.constraintsWithUncheckedConversion.size();
@@ -1855,7 +1855,7 @@ public class InferenceContext18 {
}
}
}
-
+
/** For use by 15.12.2.6 Method Invocation Type */
public boolean usesUncheckedConversion() {
return this.constraintsWithUncheckedConversion != null;
@@ -1884,7 +1884,7 @@ public class InferenceContext18 {
if (binding instanceof ParameterizedGenericMethodBinding) {
MethodBinding shallowOriginal = binding.shallowOriginal();
TypeBinding[] solutions = getSolutions(shallowOriginal.typeVariables(), polyInvocation, result);
- if (solutions == null) // in CEF.reduce, we lift inner poly expressions into outer context only if their target type has inference variables.
+ if (solutions == null) // in CEF.reduce, we lift inner poly expressions into outer context only if their target type has inference variables.
continue;
methodSubstitute = this.environment.createParameterizedGenericMethod(shallowOriginal, solutions);
} else {
@@ -1893,7 +1893,7 @@ public class InferenceContext18 {
MethodBinding shallowOriginal = binding.shallowOriginal();
ReferenceBinding genericType = shallowOriginal.declaringClass;
TypeBinding[] solutions = getSolutions(genericType.typeVariables(), polyInvocation, result);
- if (solutions == null) // in CEF.reduce, we lift inner poly expressions into outer context only if their target type has inference variables.
+ if (solutions == null) // in CEF.reduce, we lift inner poly expressions into outer context only if their target type has inference variables.
continue;
ParameterizedTypeBinding parameterizedType = this.environment.createParameterizedType(genericType, solutions, binding.declaringClass.enclosingType());
for (MethodBinding parameterizedMethod : parameterizedType.methods()) {
@@ -1914,7 +1914,7 @@ public class InferenceContext18 {
}
}
TypeBinding parameterType = InferenceContext18.getParameter(parameters, i, variableArity);
- forwardResults(result, polyInvocation, methodSubstitute, parameterType);
+ forwardResults(result, polyInvocation, methodSubstitute, parameterType);
}
}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceFailureException.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceFailureException.java
index a017f1aea..188270228 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceFailureException.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceFailureException.java
@@ -21,9 +21,9 @@ public class InferenceFailureException extends Exception {
private static final long serialVersionUID = 1L;
// TODO(stephan); add more details so that ProblemReported can eventually manufacture an appropriate message
-
+
public InferenceFailureException(String message) {
super(message);
}
-
+
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceSubstitution.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceSubstitution.java
index dbf2ff903..3408ea312 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceSubstitution.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceSubstitution.java
@@ -57,7 +57,7 @@ public class InferenceSubstitution extends Scope.Substitutor implements Substitu
return false;
}
};
-
+
int l1 = this.sites.length;
subst.sites = new InvocationSite[l1+1];
System.arraycopy(this.sites, 0, subst.sites, 0, l1);
@@ -76,7 +76,7 @@ public class InferenceSubstitution extends Scope.Substitutor implements Substitu
}
/**
- * Override method {@link Scope.Substitutor#substitute(Substitution, TypeBinding)},
+ * Override method {@link Scope.Substitutor#substitute(Substitution, TypeBinding)},
* to add substitution of types other than type variables.
*/
@Override
@@ -129,7 +129,7 @@ public class InferenceSubstitution extends Scope.Substitutor implements Substitu
continue;
}
if (superInterfaces != null) {
- int ifcLen = superInterfaces.length;
+ int ifcLen = superInterfaces.length;
for (int j = 0; j < ifcLen; j++) {
if (TypeBinding.equalsEquals(pi, superInterfaces[j])) {
if (superInterfaces == typeVariable.superInterfaces)
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceVariable.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceVariable.java
index dc7585669..3557117a0 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceVariable.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceVariable.java
@@ -22,7 +22,7 @@ import org.eclipse.jdt.core.compiler.CharOperation;
* Implementation of 18.1.1 in JLS8
*/
public class InferenceVariable extends TypeVariableBinding {
-
+
/** Structured key for interning. */
static class InferenceVarKey {
/*@NonNull*/ TypeBinding typeParameter;
@@ -58,7 +58,7 @@ public class InferenceVariable extends TypeVariableBinding {
if (TypeBinding.notEquals(this.typeParameter, other.typeParameter))
return false;
return true;
- }
+ }
}
/**
@@ -88,9 +88,9 @@ public class InferenceVariable extends TypeVariableBinding {
long nullHints; // one of TagBits.{AnnotationNonNull,AnnotationNullable} may steer inference into inferring nullness as well; set both bits to request avoidance.
private InferenceVariable prototype;
int varId; // this is used for constructing a source name like T#0.
- public boolean isFromInitialSubstitution; // further ivars created during 18.5.2 (for capture bounds) set this to false
+ public boolean isFromInitialSubstitution; // further ivars created during 18.5.2 (for capture bounds) set this to false
// to mark that they don't participate in any theta substitution
-
+
private InferenceVariable(TypeBinding typeParameter, int parameterRank, int iVarId, InvocationSite site, LookupEnvironment environment, ReferenceBinding object, boolean initial) {
this(typeParameter, parameterRank, site, makeName(typeParameter, iVarId), environment, object);
this.varId = iVarId;
@@ -204,17 +204,17 @@ public class InferenceVariable extends TypeVariableBinding {
public boolean hasTypeBit(int bit) {
throw new UnsupportedOperationException();
}
-
+
@Override
public String debugName() {
return String.valueOf(this.sourceName);
}
-
+
@Override
public String toString() {
return debugName();
}
-
+
@Override
public int hashCode() {
int code = this.typeParameter.hashCode() + 17 * this.rank;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/IntersectionTypeBinding18.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/IntersectionTypeBinding18.java
index 944631baf..6a308121c 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/IntersectionTypeBinding18.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/IntersectionTypeBinding18.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
@@ -42,7 +42,7 @@ public class IntersectionTypeBinding18 extends ReferenceBinding {
public ReferenceBinding [] intersectingTypes;
private ReferenceBinding javaLangObject;
int length;
-
+
public IntersectionTypeBinding18(ReferenceBinding[] intersectingTypes, LookupEnvironment environment) {
this.intersectingTypes = intersectingTypes;
this.length = intersectingTypes.length;
@@ -51,7 +51,7 @@ public class IntersectionTypeBinding18 extends ReferenceBinding {
this.modifiers |= ClassFileConstants.AccInterface;
}
}
-
+
private IntersectionTypeBinding18(IntersectionTypeBinding18 prototype) {
this.intersectingTypes = prototype.intersectingTypes;
this.length = prototype.length;
@@ -60,7 +60,7 @@ public class IntersectionTypeBinding18 extends ReferenceBinding {
this.modifiers |= ClassFileConstants.AccInterface;
}
}
-
+
@Override
public TypeBinding clone(TypeBinding enclosingType) {
return new IntersectionTypeBinding18(this);
@@ -87,7 +87,7 @@ public class IntersectionTypeBinding18 extends ReferenceBinding {
@Override
public boolean hasTypeBit(int bit) { // Stephan ??
- for (int i = 0; i < this.length; i++) {
+ for (int i = 0; i < this.length; i++) {
if (this.intersectingTypes[i].hasTypeBit(bit))
return true;
}
@@ -98,7 +98,7 @@ public class IntersectionTypeBinding18 extends ReferenceBinding {
public boolean canBeInstantiated() {
return false;
}
-
+
@Override
public boolean canBeSeenBy(PackageBinding invocationPackage) {
for (int i = 0; i < this.length; i++) {
@@ -107,7 +107,7 @@ public class IntersectionTypeBinding18 extends ReferenceBinding {
}
return true;
}
-
+
@Override
public boolean canBeSeenBy(Scope scope) {
for (int i = 0; i < this.length; i++) {
@@ -116,7 +116,7 @@ public class IntersectionTypeBinding18 extends ReferenceBinding {
}
return true;
}
-
+
@Override
public boolean canBeSeenBy(ReferenceBinding receiverType, ReferenceBinding invocationType) {
for (int i = 0; i < this.length; i++) {
@@ -125,8 +125,8 @@ public class IntersectionTypeBinding18 extends ReferenceBinding {
}
return true;
}
-
-
+
+
@Override
public char[] constantPoolName() {
TypeBinding erasure = erasure();
@@ -141,7 +141,7 @@ public class IntersectionTypeBinding18 extends ReferenceBinding {
public PackageBinding getPackage() {
throw new UnsupportedOperationException(); // cannot be referred to
}
-
+
@Override
public ReferenceBinding[] getIntersectingTypes() {
return this.intersectingTypes;
@@ -149,9 +149,9 @@ public class IntersectionTypeBinding18 extends ReferenceBinding {
@Override
public ReferenceBinding superclass() {
- return this.intersectingTypes[0].isClass() ? this.intersectingTypes[0] : this.javaLangObject;
+ return this.intersectingTypes[0].isClass() ? this.intersectingTypes[0] : this.javaLangObject;
}
-
+
@Override
public ReferenceBinding [] superInterfaces() {
if (this.intersectingTypes[0].isClass()) {
@@ -161,12 +161,12 @@ public class IntersectionTypeBinding18 extends ReferenceBinding {
}
return this.intersectingTypes;
}
-
+
@Override
public boolean isBoxedPrimitiveType() {
return this.intersectingTypes[0].isBoxedPrimitiveType();
}
-
+
/* Answer true if the receiver type can be assigned to the argument type (right)
*/
@Override
@@ -199,13 +199,13 @@ public class IntersectionTypeBinding18 extends ReferenceBinding {
}
// normal case:
- for (int i = 0; i < this.length; i++) {
+ for (int i = 0; i < this.length; i++) {
if (this.intersectingTypes[i].isCompatibleWith(right, scope))
return true;
}
return false;
}
-
+
@Override
public boolean isSubtypeOf(TypeBinding other, boolean simulatingBugJDK8026527) {
if (TypeBinding.equalsEquals(this, other))
@@ -259,7 +259,7 @@ public class IntersectionTypeBinding18 extends ReferenceBinding {
@Override
public char[] qualifiedSourceName() {
StringBuffer qualifiedSourceName = new StringBuffer(16);
- for (int i = 0; i < this.length; i++) {
+ for (int i = 0; i < this.length; i++) {
qualifiedSourceName.append(this.intersectingTypes[i].qualifiedSourceName());
if (i != this.length - 1)
qualifiedSourceName.append(" & "); //$NON-NLS-1$
@@ -270,7 +270,7 @@ public class IntersectionTypeBinding18 extends ReferenceBinding {
@Override
public char[] sourceName() {
StringBuffer srcName = new StringBuffer(16);
- for (int i = 0; i < this.length; i++) {
+ for (int i = 0; i < this.length; i++) {
srcName.append(this.intersectingTypes[i].sourceName());
if (i != this.length - 1)
srcName.append(" & "); //$NON-NLS-1$
@@ -281,7 +281,7 @@ public class IntersectionTypeBinding18 extends ReferenceBinding {
@Override
public char[] readableName() {
StringBuffer readableName = new StringBuffer(16);
- for (int i = 0; i < this.length; i++) {
+ for (int i = 0; i < this.length; i++) {
readableName.append(this.intersectingTypes[i].readableName());
if (i != this.length - 1)
readableName.append(" & "); //$NON-NLS-1$
@@ -291,7 +291,7 @@ public class IntersectionTypeBinding18 extends ReferenceBinding {
@Override
public char[] shortReadableName() {
StringBuffer shortReadableName = new StringBuffer(16);
- for (int i = 0; i < this.length; i++) {
+ for (int i = 0; i < this.length; i++) {
shortReadableName.append(this.intersectingTypes[i].shortReadableName());
if (i != this.length - 1)
shortReadableName.append(" & "); //$NON-NLS-1$
@@ -309,7 +309,7 @@ public class IntersectionTypeBinding18 extends ReferenceBinding {
@Override
public String debugName() {
StringBuffer debugName = new StringBuffer(16);
- for (int i = 0; i < this.length; i++) {
+ for (int i = 0; i < this.length; i++) {
debugName.append(this.intersectingTypes[i].debugName());
if (i != this.length - 1)
debugName.append(" & "); //$NON-NLS-1$
@@ -342,7 +342,7 @@ public class IntersectionTypeBinding18 extends ReferenceBinding {
for (int i = 0; i < this.intersectingTypes.length; i++)
this.intersectingTypes[i].collectInferenceVariables(variables);
}
-
+
@Override
public ReferenceBinding upwardsProjection(Scope scope, TypeBinding[] mentionedTypeVariables) {
ReferenceBinding[] projectedTypes = new ReferenceBinding[this.intersectingTypes.length];
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InvocationSite.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InvocationSite.java
index aa57e1214..afb5f22e0 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InvocationSite.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InvocationSite.java
@@ -40,11 +40,11 @@ public interface InvocationSite {
boolean receiverIsImplicitThis();
boolean checkingPotentialCompatibility();
void acceptPotentiallyCompatibleMethods(MethodBinding [] methods);
-
+
/** When inference for this invocationSite starts, get a fresh inference context, initialized from this site. */
InferenceContext18 freshInferenceContext(Scope scope);
ExpressionContext getExpressionContext();
-
+
static class EmptyWithAstNode implements InvocationSite {
ASTNode node;
public EmptyWithAstNode(ASTNode node) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalTypeBinding.java
index 576c10921..0adc94106 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalTypeBinding.java
@@ -16,7 +16,7 @@
* bug 365662 - [compiler][null] warn on contradictory and redundant null annotations
* bug 401030 - [1.8][null] Null analysis support for lambda methods.
* Bug 429958 - [1.8][null] evaluate new DefaultLocation attribute of @NonNullByDefault
- * Bug 435805 - [1.8][compiler][null] Java 8 compiler does not recognize declaration style null annotations
+ * Bug 435805 - [1.8][compiler][null] Java 8 compiler does not recognize declaration style null annotations
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.lookup;
@@ -123,7 +123,7 @@ public ReferenceBinding anonymousOriginalSuperType() {
return ((LocalTypeBinding) this.prototype).anonymousOriginalSuperType();
if (this.superclass == null && this.scope != null)
return this.scope.getJavaLangObject();
-
+
if (this.superInterfaces != Binding.NO_SUPERINTERFACES) {
return this.superInterfaces[0];
}
@@ -143,7 +143,7 @@ public ReferenceBinding anonymousOriginalSuperType() {
public char[] computeUniqueKey(boolean isLeaf) {
if (!isPrototype())
return this.prototype.computeUniqueKey(isLeaf);
-
+
char[] outerKey = outermostEnclosingType().computeUniqueKey(isLeaf);
int semicolon = CharOperation.lastIndexOf(';', outerKey);
@@ -180,7 +180,7 @@ public char[] constantPoolName() /* java/lang/Object */ {
// cases where the left hand does not know what the right is doing.
this.constantPoolName = this.scope.compilationUnitScope().computeConstantPoolName(this);
}
- return this.constantPoolName;
+ return this.constantPoolName;
}
@Override
@@ -201,10 +201,10 @@ public int hashCode() {
*/
@Override
public char[] genericTypeSignature() {
-
+
if (!isPrototype())
return this.prototype.genericTypeSignature();
-
+
if (this.genericReferenceTypeSignature == null && this.constantPoolName == null) {
if (isAnonymousType())
setConstantPoolName(superclass().sourceName());
@@ -313,10 +313,10 @@ public void transferConstantPoolNameTo(TypeBinding substType) {
*/
@Override
public char[] signature() {
-
+
if (!isPrototype())
return this.prototype.signature();
-
+
if (this.signature == null && this.constantPoolName == null) {
if (isAnonymousType())
setConstantPoolName(superclass().sourceName());
@@ -338,7 +338,7 @@ public char[] sourceName() {
public String toString() {
if (this.hasTypeAnnotations())
return annotatedDebugName() + " (local)"; //$NON-NLS-1$
-
+
if (isAnonymousType())
return "Anonymous type : " + super.toString(); //$NON-NLS-1$
if (isMemberType())
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java
index e0b548c6c..12230d2cb 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.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
* Fraunhofer FIRST - extended API and implementation
@@ -84,7 +84,7 @@ public class LocalVariableBinding extends VariableBinding {
this(declaration.name, type, modifiers, isArgument);
this.declaration = declaration;
}
-
+
// argument
public LocalVariableBinding(LocalDeclaration declaration, TypeBinding type, int modifiers, MethodScope declaringScope) {
@@ -333,7 +333,7 @@ public class LocalVariableBinding extends VariableBinding {
public boolean isParameter() {
return ((this.tagBits & TagBits.IsArgument) != 0);
}
-
+
public boolean isCatchParameter() {
return false;
}
@@ -351,7 +351,7 @@ public class LocalVariableBinding extends VariableBinding {
}
return null;
}
-
+
public void markInitialized() {
// Signals that the type is correctly set now - This is for extension in subclasses
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java
index 67a2a94ff..43dbeb7fa 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java
@@ -141,7 +141,7 @@ public class LookupEnvironment implements ProblemReasons, TypeConstants {
private int lastUnitIndex = -1; // ROOT_ONLY
TypeSystem typeSystem; // SHARED
-
+
public INameEnvironment nameEnvironment; // SHARED
public CompilerOptions globalOptions; // SHARED
@@ -155,7 +155,7 @@ public class LookupEnvironment implements ProblemReasons, TypeConstants {
public ITypeRequestor typeRequestor; // SHARED
private SimpleLookupTable uniqueParameterizedGenericMethodBindings;
-
+
// key is a string with the method selector value is an array of method bindings
private SimpleLookupTable uniquePolymorphicMethodBindings;
private SimpleLookupTable uniqueGetClassMethodBinding; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=300734
@@ -279,7 +279,7 @@ public ModuleBinding getModule(char[] name) {
this.typeRequestor.accept(mod, this);
moduleBinding = this.root.knownModules.get(name);
}
- } else
+ } else
return this.UnNamedModule;
}
return moduleBinding;
@@ -318,7 +318,7 @@ public ReferenceBinding askForType(char[][] compoundName, /*@NonNull*/ModuleBind
Config.setSourceTypeRequired(false);
// SH}
ModuleBinding answerModule = answer.moduleBinding != null ? answer.moduleBinding : this.UnNamedModule;
-
+
if (answer.isBinaryType()) {
// the type was found as a .class file
PackageBinding pkg = answerModule.environment.computePackageFrom(compoundName, false /* valid pkg */);
@@ -384,7 +384,7 @@ ReferenceBinding askForType(PackageBinding packageBinding, char[] name, ModuleBi
// SH}
ModuleBinding answerModule = answer.moduleBinding != null ? answer.moduleBinding : this.UnNamedModule;
PackageBinding answerPackage = packageBinding;
-
+
if (answerModule != null) {
if (!answerPackage.isDeclaredIn(answerModule))
continue; // this answer is not reachable via the packageBinding
@@ -409,7 +409,7 @@ ReferenceBinding askForType(PackageBinding packageBinding, char[] name, ModuleBi
typeDeclaration = (TypeDeclaration)this.problemReporter.referenceContext;
prevFlag = typeDeclaration.willCatchAbort;
typeDeclaration.willCatchAbort = true;
- }
+ }
// SH}
try {
this.typeRequestor.accept(answer.getCompilationUnit(), answer.getAccessRestriction());
@@ -516,7 +516,7 @@ private ModuleBinding getModuleFromAnswer(NameEnvironmentAnswer answer) {
ModuleBinding moduleBinding;
if (!this.useModuleSystem || moduleName == ModuleBinding.UNNAMED) {
moduleBinding = this.UnNamedModule;
- } else {
+ } else {
moduleBinding = this.knownModules.get(moduleName);
if (moduleBinding == null && this.nameEnvironment instanceof IModuleAwareNameEnvironment) {
IModule iModule = ((IModuleAwareNameEnvironment) this.nameEnvironment).getModule(moduleName);
@@ -691,7 +691,7 @@ public int internalCompleteTypeBindings(CompilationUnitDeclaration parsedUnit) {
if (this != this.root) {
return this.root.internalCompleteTypeBindings(parsedUnit);
}
- if (this.unitBeingCompleted == parsedUnit)
+ if (this.unitBeingCompleted == parsedUnit)
return 0; // avoid re-entrance
int todo = this.stepCompleted;
//SH}
@@ -719,7 +719,7 @@ public int internalCompleteTypeBindings(CompilationUnitDeclaration parsedUnit) {
ReferenceBinding enclosingType = roleBinding.enclosingType();
if (enclosingType != null) {
TeamModel enclosingTeam = enclosingType.getTeamModel();
- if ( enclosingTeam != null
+ if ( enclosingTeam != null
&& enclosingTeam._state.getProcessingState() == ITranslationStates.STATE_LENV_CONNECT_TYPE_HIERARCHY)
todo = CONNECT_TYPE_HIERARCHY;
}
@@ -983,7 +983,7 @@ private PackageBinding computePackageFrom(char[][] constantPoolName, boolean isM
}
}
if (packageBinding == null || packageBinding == TheNotFoundPackage) {
- packageBinding = this.module.createDeclaredToplevelPackage(constantPoolName[0]);
+ packageBinding = this.module.createDeclaredToplevelPackage(constantPoolName[0]);
}
if (isMissing) packageBinding.tagBits |= TagBits.HasMissingType;
this.knownPackages.put(constantPoolName[0], packageBinding); // TODO: split?
@@ -1024,7 +1024,7 @@ private PackageBinding computePackageFrom(char[][] constantPoolName, boolean isM
if (incarnation.hasCompilationUnit(false)) {
if (candidate != null) {
candidate = null;
- break; // likely to report "accessible from more than one module" downstream
+ break; // likely to report "accessible from more than one module" downstream
}
candidate = incarnation;
}
@@ -1108,7 +1108,7 @@ public TypeBinding convertToRawType(TypeBinding type, boolean forceRawEnclosingT
if (!((ReferenceBinding)originalType).hasEnclosingInstanceContext()) {
convertedEnclosing = (ReferenceBinding) originalEnclosing.original();
} else {
- if (originalEnclosing.kind() == Binding.RAW_TYPE) {
+ if (originalEnclosing.kind() == Binding.RAW_TYPE) {
convertedEnclosing = originalEnclosing;
needToConvert = true;
} else if (forceRawEnclosingType && !needToConvert/*stop recursion when conversion occurs*/) {
@@ -1144,7 +1144,7 @@ public ReferenceBinding[] convertToRawTypes(ReferenceBinding[] originalTypes, bo
for (int i = 0, length = originalTypes.length; i < length; i++) {
ReferenceBinding originalType = originalTypes[i];
ReferenceBinding convertedType = (ReferenceBinding) convertToRawType(forceErasure ? originalType.erasure() : originalType, forceRawEnclosingType);
- if (TypeBinding.notEquals(convertedType, originalType)) {
+ if (TypeBinding.notEquals(convertedType, originalType)) {
if (convertedTypes == originalTypes) {
System.arraycopy(originalTypes, 0, convertedTypes = new ReferenceBinding[length], 0, i);
}
@@ -1258,7 +1258,7 @@ public TypeBinding createIntersectionType18(ReferenceBinding[] intersectingTypes
});
}
return this.typeSystem.getIntersectionType18(intersectingTypes);
-}
+}
public BinaryTypeBinding createBinaryTypeFrom(IBinaryType binaryType, PackageBinding packageBinding, AccessRestriction accessRestriction) {
return createBinaryTypeFrom(binaryType, packageBinding, true, accessRestriction);
@@ -1317,7 +1317,7 @@ public MissingTypeBinding createMissingType(PackageBinding packageBinding, char[
* 3. Create the method bindings
*/
public PackageBinding createPackage(char[][] compoundName) {
- return createPlainPackage(compoundName);
+ return createPlainPackage(compoundName);
}
public PlainPackageBinding createPlainPackage(char[][] compoundName) {
//{ObjectTeams: JDT didn't detect collision for toplevel type/package, because default package is weird ;-)
@@ -1482,7 +1482,7 @@ public PolymorphicMethodBinding createPolymorphicMethod(MethodBinding originalPo
String key = new String(originalPolymorphicMethod.selector);
PolymorphicMethodBinding[] cachedInfo = (PolymorphicMethodBinding[]) this.uniquePolymorphicMethodBindings.get(key);
int parametersLength = parameters == null ? 0: parameters.length;
- TypeBinding[] parametersTypeBinding = new TypeBinding[parametersLength];
+ TypeBinding[] parametersTypeBinding = new TypeBinding[parametersLength];
for (int i = 0; i < parametersLength; i++) {
TypeBinding parameterTypeBinding = parameters[i];
if (parameterTypeBinding.id == TypeIds.T_null) {
@@ -1637,7 +1637,7 @@ public ParameterizedTypeBinding createParameterizedType(ReferenceBinding generic
// SH}
public ReferenceBinding maybeCreateParameterizedType(ReferenceBinding nonGenericType, ReferenceBinding enclosingType) {
- boolean canSeeEnclosingTypeParameters = enclosingType != null
+ boolean canSeeEnclosingTypeParameters = enclosingType != null
&& (enclosingType.isParameterizedType() | enclosingType.isRawType())
&& !nonGenericType.isStatic();
if (canSeeEnclosingTypeParameters)
@@ -1781,7 +1781,7 @@ public char[][] getNullableAnnotationName() {
}
public AnnotationBinding getNonNullAnnotation() {
- if (this.nonNullAnnotation != null)
+ if (this.nonNullAnnotation != null)
return this.nonNullAnnotation;
if (this.root != this) {
return this.nonNullAnnotation = this.root.getNonNullAnnotation();
@@ -2085,9 +2085,9 @@ public ReferenceBinding getTypeFromCompoundName(char[][] compoundName, boolean i
if (binding == TheNotFoundType) {
// report the missing class file first
if (!wasMissingType) {
- /* Since missing types have been already been complained against while producing binaries, there is no class path
- * misconfiguration now that did not also exist in some equivalent form while producing the class files which encode
- * these missing types. So no need to bark again. Note that wasMissingType == true signals a type referenced in a .class
+ /* Since missing types have been already been complained against while producing binaries, there is no class path
+ * misconfiguration now that did not also exist in some equivalent form while producing the class files which encode
+ * these missing types. So no need to bark again. Note that wasMissingType == true signals a type referenced in a .class
* file which could not be found when the binary was produced. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=364450 */
this.problemReporter.isClassPathCorrect(compoundName, this.root.unitBeingCompleted, this.missingClassFileLocation, false);
}
@@ -2146,7 +2146,7 @@ ReferenceBinding getTypeFromConstantPoolName(char[] signature, int start, int en
//{ObjectTeams: changed default visibility to public
public
// SH}
-TypeBinding getTypeFromSignature(char[] signature, int start, int end, boolean isParameterized, TypeBinding enclosingType,
+TypeBinding getTypeFromSignature(char[] signature, int start, int end, boolean isParameterized, TypeBinding enclosingType,
char[][][] missingTypeNames, ITypeAnnotationWalker walker)
{
int dimension = 0;
@@ -2159,7 +2159,7 @@ TypeBinding getTypeFromSignature(char[] signature, int start, int end, boolean i
if (dimension > 0 && walker != ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER) {
for (int i = 0; i < dimension; i++) {
AnnotationBinding [] annotations = BinaryTypeBinding.createAnnotations(walker.getAnnotationsAtCursor(0, true), this, missingTypeNames);
- if (annotations != Binding.NO_ANNOTATIONS) {
+ if (annotations != Binding.NO_ANNOTATIONS) {
if (annotationsOnDimensions == null)
annotationsOnDimensions = new AnnotationBinding[dimension][];
annotationsOnDimensions[i] = annotations;
@@ -2167,7 +2167,7 @@ TypeBinding getTypeFromSignature(char[] signature, int start, int end, boolean i
walker = walker.toNextArrayDimension();
}
}
-
+
if (end == -1)
end = signature.length - 1;
@@ -2209,20 +2209,20 @@ TypeBinding getTypeFromSignature(char[] signature, int start, int end, boolean i
} else {
binding = getTypeFromConstantPoolName(signature, start + 1, end, isParameterized, missingTypeNames); // skip leading 'L' or 'T'
}
-
+
if (isParameterized) {
if (dimension != 0)
throw new IllegalStateException();
return binding;
}
-
+
if (walker != ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER) {
binding = annotateType(binding, walker, missingTypeNames);
}
-
+
if (dimension != 0)
binding = this.typeSystem.getArrayType(binding, dimension, AnnotatableTypeSystem.flattenedAnnotations(annotationsOnDimensions));
-
+
return binding;
}
@@ -2283,8 +2283,8 @@ boolean qualifiedNameMatchesSignature(char[][] name, char[] signature) {
return false;
}
-public TypeBinding getTypeFromTypeSignature(SignatureWrapper wrapper, TypeVariableBinding[] staticVariables, ReferenceBinding enclosingType,
- char[][][] missingTypeNames, ITypeAnnotationWalker walker)
+public TypeBinding getTypeFromTypeSignature(SignatureWrapper wrapper, TypeVariableBinding[] staticVariables, ReferenceBinding enclosingType,
+ char[][][] missingTypeNames, ITypeAnnotationWalker walker)
{
// TypeVariableSignature = 'T' Identifier ';'
// ArrayTypeSignature = '[' TypeSignature
@@ -2301,7 +2301,7 @@ public TypeBinding getTypeFromTypeSignature(SignatureWrapper wrapper, TypeVariab
if (dimension > 0 && walker != ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER) {
for (int i = 0; i < dimension; i++) {
AnnotationBinding [] annotations = BinaryTypeBinding.createAnnotations(walker.getAnnotationsAtCursor(0, true), this, missingTypeNames);
- if (annotations != Binding.NO_ANNOTATIONS) {
+ if (annotations != Binding.NO_ANNOTATIONS) {
if (annotationsOnDimensions == null)
annotationsOnDimensions = new AnnotationBinding[dimension][];
annotationsOnDimensions[i] = annotations;
@@ -2365,7 +2365,7 @@ public TypeBinding getTypeFromTypeSignature(SignatureWrapper wrapper, TypeVariab
if (memberType == null)
this.problemReporter.corruptedSignature(currentType, wrapper.signature, memberStart); // aborts
if(memberType.isStatic()) {
- // may happen for class files generated by eclipse before bug 460491 was fixed.
+ // may happen for class files generated by eclipse before bug 460491 was fixed.
walker = savedWalker;
} else {
walker = walker.toNextNestedType();
@@ -2376,7 +2376,7 @@ public TypeBinding getTypeFromTypeSignature(SignatureWrapper wrapper, TypeVariab
} else {
typeArguments = null;
}
- if (typeArguments != null || // has type arguments, or ...
+ if (typeArguments != null || // has type arguments, or ...
(!memberType.isStatic() && currentType.isParameterizedType())) // ... can see type arguments of enclosing
{
if (memberType.isStatic())
@@ -2486,7 +2486,7 @@ public void reset() {
this.accessRestrictions = new HashMap(3);
this.verifier = null;
-
+
// NOTE: remember to fix #updateCaches(...) when adding unique binding caches
this.uniqueParameterizedGenericMethodBindings = new SimpleLookupTable(3);
this.uniquePolymorphicMethodBindings = new SimpleLookupTable(3);
@@ -2609,7 +2609,7 @@ public boolean containsNullTypeAnnotation(AnnotationBinding[] typeAnnotations) {
if (typeAnnotation.type.hasNullBit(TypeIds.BitNonNullAnnotation|TypeIds.BitNullableAnnotation))
return true;
}
- return false;
+ return false;
}
public Binding getInaccessibleBinding(char[][] compoundName, ModuleBinding clientModule) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MemberTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MemberTypeBinding.java
index 48e6fb476..e0099bc3f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MemberTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MemberTypeBinding.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
* Fraunhofer FIRST - extended API and implementation
@@ -82,10 +82,10 @@ void checkSyntheticArgsAndFields() {
@Override
public char[] constantPoolName() /* java/lang/Object */ {
-
+
if (this.constantPoolName != null)
return this.constantPoolName;
-
+
if (!isPrototype()) {
return this.prototype.constantPoolName();
}
@@ -292,7 +292,7 @@ private ReferenceBinding checkRefineBase(
if (next.isCompatibleWith(current)) return next;
if (current.isRole() && current.roleModel.hasTSuperRole(next.getRealType())) return current;
if ( RoleTypeBinding.isRoleWithExplicitAnchor(current)
- && RoleTypeBinding.isRoleWithExplicitAnchor(next))
+ && RoleTypeBinding.isRoleWithExplicitAnchor(next))
{
// check for implicit refinement of base anchored baseclasses (OTJLD 2.7(d)):
ITeamAnchor currentAnchor = ((RoleTypeBinding)current).getAnchor();
@@ -306,7 +306,7 @@ private ReferenceBinding checkRefineBase(
if ( next.getRealType().isCompatibleWith(current.getRealType())
&& nextDeclaringType.isCompatibleWith(currentDeclaringType))
return next;
- }
+ }
}
classScope.problemReporter().incompatibleBaseclasses(
classScope.referenceContext, sStart, sEnd, current, next);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java
index acd33bd17..8fe6c449c 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java
@@ -519,7 +519,7 @@ public final boolean canBeSeenBy(TypeBinding receiverType, InvocationSite invoca
SourceTypeBinding invocationType = scope.enclosingSourceType();
//{ObjectTeams: staticness is no problem in synthetic role interfaces:
- if (!this.declaringClass.isSynthInterface())
+ if (!this.declaringClass.isSynthInterface())
// SH}
if (this.declaringClass.isInterface() && isStatic() && !isPrivate()) {
// Static interface methods can be explicitly invoked only through the type reference of the declaring interface or implicitly in the interface itself or via static import.
@@ -529,9 +529,9 @@ public final boolean canBeSeenBy(TypeBinding receiverType, InvocationSite invoca
return true;
return false;
}
-
+
if (isPublic()) return true;
-
+
//{ObjectTeams:
// creator methods conceptually belong to the role, check for stored orig ctor:
@@ -551,7 +551,7 @@ public final boolean canBeSeenBy(TypeBinding receiverType, InvocationSite invoca
receiverClass = ((ReferenceBinding)receiverType).getRealClass();
receiverType = ((ReferenceBinding)receiverType).getRealType();
}
-
+
// short-cut for generated methods (here: callin wrappers)
if (scope.methodScope() != null && scope.methodScope().isCallinWrapper())
if ( !isPrivate()
@@ -590,7 +590,7 @@ public final boolean canBeSeenBy(TypeBinding receiverType, InvocationSite invoca
/* orig:
TypeBinding receiverErasure = receiverType.erasure();
:giro*/
- TypeBinding receiverErasure = receiverClass != null ? receiverClass.erasure()
+ TypeBinding receiverErasure = receiverClass != null ? receiverClass.erasure()
: receiverType.erasure();
// SH}
ReferenceBinding declaringErasure = (ReferenceBinding) this.declaringClass.erasure();
@@ -900,8 +900,8 @@ public TypeBinding getCodeGenType(int pos) {
break checkTsuper;
tsuperType = tsuperOriginal.parameters[pos];
}
- if ( tsuperType.isTypeVariable()
- && (((TypeVariableBinding)tsuperType).declaringElement.kind() & Binding.TYPE) != 0
+ if ( tsuperType.isTypeVariable()
+ && (((TypeVariableBinding)tsuperType).declaringElement.kind() & Binding.TYPE) != 0
&& !currentType.isTypeVariable())
return tsuperType.erasure();
}
@@ -926,8 +926,8 @@ public final char[] constantPoolName() {
/**
* After method verifier has finished, fill in missing @NonNull specification from the applicable default.
- * @param needToApplyParameterNonNullDefault
- * @param needToApplyReturnNonNullDefault
+ * @param needToApplyParameterNonNullDefault
+ * @param needToApplyReturnNonNullDefault
*/
protected void fillInDefaultNonNullness(AbstractMethodDeclaration sourceMethod, boolean needToApplyReturnNonNullDefault, ParameterNonNullDefaultProvider needToApplyParameterNonNullDefault) {
if (this.parameterNonNullness == null)
@@ -999,7 +999,7 @@ protected void fillInDefaultNonNullness18(AbstractMethodDeclaration sourceMethod
if (original.returnType != null && hasNonNullDefaultForReturnType(sourceMethod) && original.returnType.acceptsNonNullDefault()) {
if ((this.returnType.tagBits & TagBits.AnnotationNullMASK) == 0) {
this.returnType = env.createAnnotatedType(this.returnType, new AnnotationBinding[]{env.getNonNullAnnotation()});
- } else if (sourceMethod instanceof MethodDeclaration && (this.returnType.tagBits & TagBits.AnnotationNonNull) != 0
+ } else if (sourceMethod instanceof MethodDeclaration && (this.returnType.tagBits & TagBits.AnnotationNonNull) != 0
&& ((MethodDeclaration)sourceMethod).hasNullTypeAnnotation(AnnotationPosition.MAIN_TYPE)) {
sourceMethod.scope.problemReporter().nullAnnotationIsRedundant(sourceMethod, -1/*signifies method return*/);
}
@@ -2017,9 +2017,9 @@ public boolean redeclaresPublicObjectMethod(Scope scope) {
MethodBinding [] methods = javaLangObject.getMethods(this.selector);
for (int i = 0, length = methods == null ? 0 : methods.length; i < length; i++) {
final MethodBinding method = methods[i];
- if (!method.isPublic() || method.isStatic() || method.parameters.length != this.parameters.length)
+ if (!method.isPublic() || method.isStatic() || method.parameters.length != this.parameters.length)
continue;
- if (MethodVerifier.doesMethodOverride(this, method, scope.environment()))
+ if (MethodVerifier.doesMethodOverride(this, method, scope.environment()))
return true;
}
return false;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java
index 0a694bbdb..f685b4b4a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java
@@ -245,7 +245,7 @@ private void checkAndSetModifiersForMethod(final MethodBinding methodBinding) {
}
if (reportIllegalModifierCombination) {
problemReporter().illegalModifierCombinationForInterfaceMethod((AbstractMethodDeclaration) this.referenceContext);
- }
+ }
if (sourceLevel >= ClassFileConstants.JDK9 && (methodBinding.modifiers & ClassFileConstants.AccPrivate) != 0) {
int remaining = realModifiers & ~expectedModifiers;
if (remaining == 0) { // check for the combination of allowed modifiers with private
@@ -274,7 +274,7 @@ private void checkAndSetModifiersForMethod(final MethodBinding methodBinding) {
LocalTypeBinding local = (LocalTypeBinding) declaringClass;
TypeReference ref = local.scope.referenceContext.allocation.type;
if (ref != null && (ref.bits & ASTNode.IsDiamond) != 0) {
- //
+ //
if ((realModifiers & (ClassFileConstants.AccPrivate | ClassFileConstants.AccStatic )) == 0) {
methodBinding.tagBits |= TagBits.AnnotationOverride;
}
@@ -320,13 +320,13 @@ private void checkAndSetModifiersForMethod(final MethodBinding methodBinding) {
if (!methodBinding.declaringClass.isAbstract())
//{ObjectTeams: set a re-checker since method abstractness might go during callout transformation.
/* orig:
- problemReporter().abstractMethodInAbstractClass((SourceTypeBinding) declaringClass, (AbstractMethodDeclaration) this.referenceContext);
+ problemReporter().abstractMethodInAbstractClass((SourceTypeBinding) declaringClass, (AbstractMethodDeclaration) this.referenceContext);
:giro */
problemReporter().setRechecker(new IProblemRechecker() { @Override
public boolean shouldBeReported(IrritantSet[] foundIrritants) {
return methodBinding.isAbstract();
}})
- .abstractMethodInAbstractClass((SourceTypeBinding) declaringClass, (AbstractMethodDeclaration) this.referenceContext);
+ .abstractMethodInAbstractClass((SourceTypeBinding) declaringClass, (AbstractMethodDeclaration) this.referenceContext);
//JH & MW & SH}
}
@@ -409,7 +409,7 @@ public void computeLocalVariablePositions(int initOffset, CodeStream codeStream)
// record user-defined argument for attribute generation
codeStream.record(local);
-
+
// assign variable position
local.resolvedPosition = this.offset;
@@ -751,14 +751,14 @@ public Binding checkRedundantDefaultNullness(int nullBits, int sourceStart) {
AbstractMethodDeclaration method = (AbstractMethodDeclaration)this.referenceContext;
return method.isMappingWrapper._callin();
}
-
+
public CallinCalloutScope getDeclaringMappingScope() {
AbstractMethodDeclaration method = referenceMethod();
TypeDeclaration type = referenceType();
if (method == null || type == null)
return null;
if (type.callinCallouts != null) {
- for (AbstractMethodMappingDeclaration mapping : type.callinCallouts)
+ for (AbstractMethodMappingDeclaration mapping : type.callinCallouts)
if (mapping.isCallout() && mapping.roleMethodSpec.resolvedMethod == method.binding)
return mapping.scope;
}
@@ -772,7 +772,7 @@ public Binding checkRedundantDefaultNullness(int nullBits, int sourceStart) {
for (AbstractMethodDeclaration wrapper : callinMapping.wrappers)
if (wrapper == method)
return mapping.scope;
- }
+ }
}
return null;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java
index c645e1435..290fd6858 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java
@@ -78,7 +78,7 @@ public abstract class MethodVerifier extends ImplicitNullAnnotationVerifier {
SourceTypeBinding type;
HashtableOfObject inheritedMethods;
HashtableOfObject currentMethods;
- /**
+ /**
* Methods that are to be considered inherited even though they are overridden somewhere in the
* hierarchy - notably for bridge method generation
*/
@@ -496,7 +496,7 @@ void checkForRedundantSuperinterfaces(ReferenceBinding superclass, ReferenceBind
if (superInterfaces == Binding.NO_SUPERINTERFACES) return;
//{ObjectTeams: implicit inheritance among roles is not visible at AST level
- if (this.type.isRole())
+ if (this.type.isRole())
return;
// TODO: should do this check during copyinheritance.TypeLevel!
// SH}
@@ -602,7 +602,7 @@ void checkInheritedMethods(MethodBinding[] methods, int length, boolean[] isOver
3. if concrete method exists, check to see if its return type is compatible with all others
if it is then check concrete method against abstract methods
if its not, then find most specific abstract method & report abstract method must be implemented since concrete method is insufficient
- if no most specific return type abstract method exists, then report incompatible return type with all inherited methods
+ if no most specific return type abstract method exists, then report incompatible return type with all inherited methods
*/
MethodBinding concreteMethod = this.type.isInterface() || methods[0].isAbstract() ? null : methods[0];
@@ -827,14 +827,14 @@ void computeInheritedMethods(ReferenceBinding superclass, ReferenceBinding[] sup
}
if (superIfcList.size() == 0) return;
-
+
if (superIfcList.size() == 1) {
superInterfaces = new ReferenceBinding[] { (ReferenceBinding) superIfcList.get(0) };
} else {
superInterfaces = (ReferenceBinding[]) superIfcList.toArray(new ReferenceBinding[superIfcList.size()]);
superInterfaces = Sorting.sortTypes(superInterfaces);
}
-
+
SimpleSet skip = findSuperinterfaceCollisions(superclass, superInterfaces);
int len = superInterfaces.length;
for (int i = len-1; i >= 0; i--) {
@@ -846,7 +846,7 @@ void computeInheritedMethods(ReferenceBinding superclass, ReferenceBinding[] sup
nextMethod : for (int m = methods.length; --m >= 0;) { // Interface methods are all abstract public
MethodBinding inheritedMethod = methods[m];
//{ObjectTeams:
- if ( inheritedMethod.original().problemId() == ProblemReasons.NotVisible
+ if ( inheritedMethod.original().problemId() == ProblemReasons.NotVisible
&& MethodModel.isRoleMethodInheritedFromNonPublicRegular(inheritedMethod))
continue nextMethod;
// SH}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java
index f3a660f3f..7dd60eedf 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java
@@ -159,7 +159,7 @@ void checkForBridgeMethod(MethodBinding currentMethod, MethodBinding inheritedMe
if (thisMethod.areParameterErasuresEqual(bridge) && TypeBinding.equalsEquals(thisMethod.returnType.erasure(), bridge.returnType.erasure())) {
// use inherited method for problem reporting.
problemReporter(thisMethod).methodNameClash(thisMethod, inheritedMethod.declaringClass.isRawType() ? inheritedMethod : inheritedMethod.original(), ProblemSeverities.Error);
- return;
+ return;
}
}
}
@@ -341,8 +341,8 @@ void checkInheritedMethods(MethodBinding[] methods, int length, boolean[] isOver
// (Not asking ParameterizedGenericMethodBinding.isRawMethod(),
// because that is true only for methods of a RawTypeBinding,
// but here we look for rawness regarding the method's type variables).
- if (TypeBinding.equalsEquals(concreteMethod.declaringClass, methods[i].declaringClass)
- && concreteMethod.typeVariables.length != methods[i].typeVariables.length)
+ if (TypeBinding.equalsEquals(concreteMethod.declaringClass, methods[i].declaringClass)
+ && concreteMethod.typeVariables.length != methods[i].typeVariables.length)
{
if (concreteMethod.typeVariables == Binding.NO_TYPE_VARIABLES
&& concreteMethod.original() == methods[i])
@@ -380,7 +380,7 @@ void checkInheritedMethods(MethodBinding[] methods, int length, boolean[] isOver
}
boolean checkInheritedDefaultMethods(MethodBinding[] methods, boolean[] isOverridden, int length) {
// JLS8 9.4.1.3 (interface) and 8.4.8.4 (class):
- // default method clashes with other inherited method which is override-equivalent
+ // default method clashes with other inherited method which is override-equivalent
if (length < 2) return true;
boolean ok = true;
findDefaultMethod: for (int i=0; i<length; i++) {
@@ -388,7 +388,7 @@ boolean checkInheritedDefaultMethods(MethodBinding[] methods, boolean[] isOverri
findEquivalent: for (int j=0; j<length; j++) {
if (j == i || isOverridden[j]) continue findEquivalent;
if (isMethodSubsignature(methods[i], methods[j])) {
- if (!doesMethodOverride(methods[i], methods[j]) && !doesMethodOverride(methods[j], methods[i])) {
+ if (!doesMethodOverride(methods[i], methods[j]) && !doesMethodOverride(methods[j], methods[i])) {
problemReporter().inheritedDefaultMethodConflictsWithOtherInherited(this.type, methods[i], methods[j]);
ok = false;
continue findDefaultMethod;
@@ -423,7 +423,7 @@ void checkAgainstInheritedMethods(MethodBinding currentMethod, MethodBinding[] m
{
super.checkAgainstInheritedMethods(currentMethod, methods, length, allInheritedMethods);
CompilerOptions options = this.environment.globalOptions;
- if (options.isAnnotationBasedNullAnalysisEnabled
+ if (options.isAnnotationBasedNullAnalysisEnabled
&& (currentMethod.tagBits & TagBits.IsNullnessKnown) == 0)
{
// if annotations are inherited these have been checked during STB.resolveTypesFor() (for methods explicit in this.type)
@@ -439,7 +439,7 @@ void checkAgainstInheritedMethods(MethodBinding currentMethod, MethodBinding[] m
}
@Override
-void checkNullSpecInheritance(MethodBinding currentMethod, AbstractMethodDeclaration srcMethod,
+void checkNullSpecInheritance(MethodBinding currentMethod, AbstractMethodDeclaration srcMethod,
boolean hasReturnNonNullDefault, ParameterNonNullDefaultProvider hasParameterNonNullDefault, boolean complain, MethodBinding inheritedMethod, MethodBinding[] allInherited, Scope scope, InheritedNonNullnessInfo[] inheritedNonNullnessInfos)
{
complain &= !currentMethod.isConstructor();
@@ -449,8 +449,8 @@ void checkNullSpecInheritance(MethodBinding currentMethod, AbstractMethodDeclara
return;
}
// in this context currentMethod can be inherited, too. Recurse if needed.
- if (TypeBinding.notEquals(currentMethod.declaringClass, this.type)
- && (currentMethod.tagBits & TagBits.IsNullnessKnown) == 0)
+ if (TypeBinding.notEquals(currentMethod.declaringClass, this.type)
+ && (currentMethod.tagBits & TagBits.IsNullnessKnown) == 0)
{
this.buddyImplicitNullAnnotationsVerifier.checkImplicitNullAnnotations(currentMethod, srcMethod, complain, scope);
}
@@ -460,7 +460,7 @@ void checkNullSpecInheritance(MethodBinding currentMethod, AbstractMethodDeclara
void reportRawReferences() {
CompilerOptions compilerOptions = this.type.scope.compilerOptions();
if (compilerOptions.sourceLevel < ClassFileConstants.JDK1_5 // shouldn't whine at all
- || compilerOptions.reportUnavoidableGenericTypeProblems) { // must have already whined
+ || compilerOptions.reportUnavoidableGenericTypeProblems) { // must have already whined
return;
}
/* Code below is only for a method that does not override/implement a super type method. If it were to,
@@ -505,7 +505,7 @@ void reportRawReferences() {
public void reportRawReferences(MethodBinding currentMethod, MethodBinding inheritedMethod) {
CompilerOptions compilerOptions = this.type.scope.compilerOptions();
if (compilerOptions.sourceLevel < ClassFileConstants.JDK1_5 // shouldn't whine at all
- || compilerOptions.reportUnavoidableGenericTypeProblems) { // must have already whined
+ || compilerOptions.reportUnavoidableGenericTypeProblems) { // must have already whined
return;
}
AbstractMethodDeclaration methodDecl = currentMethod.sourceMethod();
@@ -534,7 +534,7 @@ public void reportRawReferences(MethodBinding currentMethod, MethodBinding inher
final TypeBinding methodType = currentMethod.returnType;
if (methodType.leafComponentType().isRawType()) {
if (inheritedMethodType.leafComponentType().isRawType()) {
- //
+ //
} else {
if ((returnType.bits & ASTNode.IgnoreRawTypeCheck) == 0
&& compilerOptions.getSeverity(CompilerOptions.RawTypeReference) != ProblemSeverities.Ignore) {
@@ -557,7 +557,7 @@ void checkMethods() {
MethodBinding[] inherited = (MethodBinding[]) this.inheritedMethods.valueTable[s];
// ensure that if we have a concrete method this shows up at position [0]:
inherited = Sorting.concreteFirst(inherited, inherited.length);
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=296660, if current type is exposed,
// inherited methods of super classes are too. current != null case handled below.
if (current == null && !isOrEnclosedByPrivateType) {
@@ -661,7 +661,7 @@ void checkMethods() {
// (and perform some side effects : bridge methods & use flags)
for (int i = 0; i < inheritedLength; i++) {
MethodBinding matchMethod = foundMatch[i];
-
+
if (matchMethod == null && current != null && this.type.isPublic()) { // current == null case handled already.
MethodBinding inheritedMethod = inherited[i];
if (inheritedMethod.isPublic() && (!inheritedMethod.declaringClass.isInterface() && !inheritedMethod.declaringClass.isPublic())) {
@@ -671,7 +671,7 @@ void checkMethods() {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=296660, if current type is exposed,
// inherited methods of super classes are too. current == null case handled already.
if (!isOrEnclosedByPrivateType && matchMethod == null && current != null) {
- inherited[i].original().modifiers |= ExtraCompilerModifiers.AccLocallyUsed;
+ inherited[i].original().modifiers |= ExtraCompilerModifiers.AccLocallyUsed;
}
MethodBinding inheritedMethod = inherited[i];
for (int j = i + 1; j < inheritedLength; j++) {
@@ -713,7 +713,7 @@ void checkMethods() {
skip[j] = true;
} else if ((replaceMatch = findReplacedMethod(otherInheritedMethod, inheritedMethod)) != null) {
matchingInherited[++index] = replaceMatch;
- skip[j] = true;
+ skip[j] = true;
} else if (matchMethod == null) {
// none replaced by the other, check these methods against each other now:
checkInheritedMethods(inheritedMethod, otherInheritedMethod);
@@ -742,7 +742,7 @@ void checkMethods() {
matchingIsOverridden = isOverridden;
matchingIsInherited = isInherited;
}
-
+
checkInheritedMethods(matchingInherited, length, matchingIsOverridden, matchingIsInherited); // pass in the length of matching
}
else if (mustImplementAbstractMethods && matchingInherited[0].isAbstract() && matchMethod == null)
@@ -773,7 +773,7 @@ boolean isSkippableOrOverridden(MethodBinding specific, MethodBinding general, b
isOverridden[idx] = true;
return true;
}
- } else if (specificIsInterface == generalIsInterface) {
+ } else if (specificIsInterface == generalIsInterface) {
if (specific.declaringClass.isCompatibleWith(general.declaringClass) && isMethodSubsignature(specific, general)) {
skip[idx] = true;
isOverridden[idx] = true;
@@ -784,17 +784,17 @@ boolean isSkippableOrOverridden(MethodBinding specific, MethodBinding general, b
}
/* 'general' is considered as replaced by 'specific' if
* - 'specific' is "at least as concrete as" 'general'
- * - 'specific' has a signature that is a subsignature of the substituted signature of 'general' (as seen from specific's declaring class)
+ * - 'specific' has a signature that is a subsignature of the substituted signature of 'general' (as seen from specific's declaring class)
* - default methods should also be considered replaced by class methods that meet the signature that is a subsignature criteria.
*/
MethodBinding findReplacedMethod(MethodBinding specific, MethodBinding general) {
MethodBinding generalSubstitute = computeSubstituteMethod(general, specific);
- if (generalSubstitute != null
- && (!specific.isAbstract() || general.isAbstract() || (general.isDefaultMethod() && specific.declaringClass.isClass())) // if (abstract(specific) => abstract(general)) check if 'specific' overrides 'general'
- && isSubstituteParameterSubsignature(specific, generalSubstitute))
+ if (generalSubstitute != null
+ && (!specific.isAbstract() || general.isAbstract() || (general.isDefaultMethod() && specific.declaringClass.isClass())) // if (abstract(specific) => abstract(general)) check if 'specific' overrides 'general'
+ && isSubstituteParameterSubsignature(specific, generalSubstitute))
{
return generalSubstitute;
- }
+ }
return null;
}
@@ -880,7 +880,7 @@ void checkTypeVariableMethods(TypeParameter typeParameter) {
}
if (interfaceMethod != null && implementation != null && !implementation.isAbstract() && !isAsVisible(implementation, interfaceMethod))
problemReporter().inheritedMethodReducesVisibility(typeParameter, implementation, new MethodBinding [] {interfaceMethod});
-
+
if (areReturnTypesCompatible(first, match)) continue;
// unrelated interfaces - check to see if return types are compatible
if (first.declaringClass.isInterface() && match.declaringClass.isInterface() && areReturnTypesCompatible(match, first))
@@ -901,7 +901,7 @@ boolean detectInheritedNameClash(MethodBinding inherited, MethodBinding otherInh
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=322001
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=323693
// When reporting a name clash between two inherited methods, we should not look for a
- // signature clash, but instead should be looking for method descriptor clash.
+ // signature clash, but instead should be looking for method descriptor clash.
if (TypeBinding.notEquals(inherited.returnType.erasure(), otherInherited.returnType.erasure()))
return false;
// skip it if otherInherited is defined by a subtype of inherited's declaringClass or vice versa.
@@ -932,10 +932,10 @@ boolean detectNameClash(MethodBinding current, MethodBinding inherited, boolean
// For a user method, see if current class overrides the inherited method. If it does,
// then any grievance we may have ought to be against the current class's method and
// NOT against any super implementations. https://bugs.eclipse.org/bugs/show_bug.cgi?id=293615
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=315978 : we now defer this rather expensive
// check to just before reporting (the incorrect) name clash. In the event there is no name
- // clash to report to begin with (the common case), no penalty needs to be paid.
+ // clash to report to begin with (the common case), no penalty needs to be paid.
MethodBinding[] currentNamesakes = (MethodBinding[]) this.currentMethods.get(inherited.selector);
if (currentNamesakes.length > 1) { // we know it ought to at least one and that current is NOT the override
for (int i = 0, length = currentNamesakes.length; i < length; i++) {
@@ -1113,7 +1113,7 @@ void verify() {
this.type.detectAnnotationCycle();
super.verify();
-
+
reportRawReferences();
for (int i = this.type.typeVariables.length; --i >= 0;) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ModuleBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ModuleBinding.java
index 741b9ef05..a145a4763 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ModuleBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ModuleBinding.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.lookup;
@@ -197,7 +197,7 @@ public class ModuleBinding extends Binding implements IUpdatableModule {
this.environment = new LookupEnvironment(existingEnvironment.root, this);
this.declaredPackages = new HashtableOfPackage<PlainPackageBinding>(5);
}
-
+
public PlainPackageBinding[] getExports() {
completeIfNeeded(UpdateKind.PACKAGE);
return this.exportedPackages;
@@ -207,7 +207,7 @@ public class ModuleBinding extends Binding implements IUpdatableModule {
if (this.exportRestrictions != null) {
SimpleSetOfCharArray set = this.exportRestrictions.get(pack);
if (set != null) {
- char[][] names = new char[set.elementSize][];
+ char[][] names = new char[set.elementSize][];
set.asArray(names);
return CharOperation.charArrayToStringArray(names);
}
@@ -223,7 +223,7 @@ public class ModuleBinding extends Binding implements IUpdatableModule {
if (this.openRestrictions != null) {
SimpleSetOfCharArray set = this.openRestrictions.get(pack);
if (set != null) {
- char[][] names = new char[set.elementSize][];
+ char[][] names = new char[set.elementSize][];
set.asArray(names);
return CharOperation.charArrayToStringArray(names);
}
@@ -244,11 +244,11 @@ public class ModuleBinding extends Binding implements IUpdatableModule {
completeIfNeeded(UpdateKind.MODULE);
return this.requiresTransitive;
}
-
+
public TypeBinding[] getUses() {
return this.uses;
}
-
+
public TypeBinding[] getServices() {
return this.services;
}
@@ -456,7 +456,7 @@ public class ModuleBinding extends Binding implements IUpdatableModule {
* All required modules include modules explicitly specified as required in the module declaration
* as well as implicit dependencies - those specified as ' requires transitive ' by one of the
* dependencies
- *
+ *
* @return
* An array of all required modules
*/
@@ -470,9 +470,9 @@ public class ModuleBinding extends Binding implements IUpdatableModule {
}
ModuleBinding javaBase = this.environment.javaBaseModule();
// add java.base?
- if (!CharOperation.equals(this.moduleName, TypeConstants.JAVA_BASE) // ... not if this *is* java.base
+ if (!CharOperation.equals(this.moduleName, TypeConstants.JAVA_BASE) // ... not if this *is* java.base
&& javaBase != null // ... nor when java.base is absent
- && javaBase != this.environment.UnNamedModule) // ..... or faked by the unnamed module
+ && javaBase != this.environment.UnNamedModule) // ..... or faked by the unnamed module
{
allRequires.add(javaBase);
}
@@ -538,14 +538,14 @@ public class ModuleBinding extends Binding implements IUpdatableModule {
/**
* Return a package binding if there exists a package named name in this module's context and it can be seen by this module.
- * A package can be seen by this module if it is declared in this module or any other module read by this module
+ * A package can be seen by this module if it is declared in this module or any other module read by this module
* (JLS 7.4.3 for packages based on JLS 7.3 for compilation units).
* Package exports are not considered for visibility check (only when checking "uniquely visible" (JLS 7.4.3)).
* <p>
* The returned package may be a {@link SplitPackageBinding}, if more than one package of the given name is visible.
* </p>
* <p>
- * When asked via the unnamed module or an automatic module all other named modules are considered visible.
+ * When asked via the unnamed module or an automatic module all other named modules are considered visible.
* </p>
*/
public PackageBinding getTopLevelPackage(char[] name) {
@@ -611,11 +611,11 @@ public class ModuleBinding extends Binding implements IUpdatableModule {
if (this.environment.nameEnvironment.isPackage(parentName, name))
binding = this.createDeclaredPackage(subPkgCompoundName, parent);
}
-
+
binding = combineWithPackagesFromOtherRelevantModules(binding, subPkgCompoundName, declaringModuleNames);
assert binding == null || binding instanceof PlainPackageBinding || binding.enclosingModule == this;
-
+
if (binding == null || !binding.isValidBinding()) {
if (parent != null) {
if (binding == null) {
@@ -656,7 +656,7 @@ public class ModuleBinding extends Binding implements IUpdatableModule {
// check each sub package
for (int i = 1; i < qualifiedPackageName.length; i++) {
- PackageBinding binding = getVisiblePackage(parent, qualifiedPackageName[i]);
+ PackageBinding binding = getVisiblePackage(parent, qualifiedPackageName[i]);
if (binding == null) {
return null;
}
@@ -691,9 +691,9 @@ public class ModuleBinding extends Binding implements IUpdatableModule {
* Check if the given package is accessible by this module. True when the package is declared in
* this module or exported by some required module to this module.
* See {@link #isPackageExportedTo(PackageBinding, ModuleBinding)}
- *
+ *
* @param pkg
- *
+ *
* @return True, if the package is accessible by this module, false otherwise
*/
public boolean canAccess(PackageBinding pkg) {
@@ -857,7 +857,7 @@ public class ModuleBinding extends Binding implements IUpdatableModule {
return this.defaultNullness;
}
SimpleLookupTable storedAnnotations(boolean forceInitialize, boolean forceStore) {
-
+
if (forceInitialize && this.storedAnnotations == null) {
if (!this.environment.globalOptions.storeAnnotations && !forceStore)
return null; // not supported during this compile
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/NestedTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/NestedTypeBinding.java
index d10043f9f..38dc25f88 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/NestedTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/NestedTypeBinding.java
@@ -14,7 +14,7 @@
* Stephan Herrmann - Contributions for
* Bug 365662 - [compiler][null] warn on contradictory and redundant null annotations
* Bug 429958 - [1.8][null] evaluate new DefaultLocation attribute of @NonNullByDefault
- * Bug 435805 - [1.8][compiler][null] Java 8 compiler does not recognize declaration style null annotations
+ * Bug 435805 - [1.8][compiler][null] Java 8 compiler does not recognize declaration style null annotations
* Keigo Imai - Contribution for bug 388903 - Cannot extend inner class as an anonymous class when it extends the outer class
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.lookup;
@@ -50,9 +50,9 @@ public NestedTypeBinding(NestedTypeBinding prototype) {
* Answer the new argument or the existing argument if one already existed.
*/
public SyntheticArgumentBinding addSyntheticArgument(LocalVariableBinding actualOuterLocalVariable) {
-
+
if (!isPrototype()) throw new IllegalStateException();
-
+
SyntheticArgumentBinding synthLocal = null;
if (this.outerLocalVariables == null) {
@@ -165,7 +165,7 @@ public int getOuterLocalVariablesSlotSize() {
default :
this.outerLocalVariablesSlotSize ++;
break;
- }
+ }
}
}
return this.outerLocalVariablesSlotSize;
@@ -185,28 +185,28 @@ public SyntheticArgumentBinding getSyntheticArgument(LocalVariableBinding actual
/* Answer the synthetic argument for <targetEnclosingType> or null if one does not exist.
*/
public SyntheticArgumentBinding getSyntheticArgument(ReferenceBinding targetEnclosingType, boolean onlyExactMatch, boolean scopeIsConstructorCall) {
-
+
if (!isPrototype()) throw new IllegalStateException();
-
+
if (this.enclosingInstances == null) return null; // is null if no enclosing instances are known
-
+
// exact match
-
- // firstly, during allocation, check and use the leftmost one (if possible)
+
+ // firstly, during allocation, check and use the leftmost one (if possible)
// to handle cases involving two instances of same type, such as
// class X {
// class Inner extends X {}
// void f(){
- // new X().new Inner(){}
+ // new X().new Inner(){}
// // here the result of (new X()) is passed as the first (synthetic) arg for ctor of new Inner(){}
- // // (and (this) as the second, of course)
+ // // (and (this) as the second, of course)
// }
// }
if (scopeIsConstructorCall && this.enclosingInstances.length > 0)
- if (TypeBinding.equalsEquals(this.enclosingInstances[0].type, targetEnclosingType))
+ if (TypeBinding.equalsEquals(this.enclosingInstances[0].type, targetEnclosingType))
if (this.enclosingInstances[0].actualOuterLocalVariable == null)
return this.enclosingInstances[0];
-
+
// then check other possibility
for (int i = this.enclosingInstances.length; --i >= 0;)
if (TypeBinding.equalsEquals(this.enclosingInstances[i].type, targetEnclosingType))
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/NullTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/NullTypeBinding.java
index dca633b6d..bee6817ee 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/NullTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/NullTypeBinding.java
@@ -21,17 +21,17 @@ public class NullTypeBinding extends BaseTypeBinding {
NullTypeBinding() {
super(TypeIds.T_null, TypeConstants.NULL, new char[] { 'N' }); // N stands for null even if it is never internally used);
}
-
+
@Override
public TypeBinding clone(TypeBinding enclosingType) {
return this; // enforce solitude.
}
-
+
@Override
public void setTypeAnnotations(AnnotationBinding[] annotations, boolean evalNullAnnotations) {
return; // reject misguided attempt.
}
-
+
@Override
public TypeBinding unannotated() {
return this;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java
index 971a6d80a..5e9094796 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java
@@ -72,15 +72,15 @@ public PackageBinding(char[][] compoundName, PackageBinding parent, LookupEnviro
this.environment = environment;
this.knownTypes = null; // initialized if used... class counts can be very large 300-600
this.knownPackages = new HashtableOfPackage<PackageBinding>(3); // sub-package counts are typically 0-3
-
+
if (compoundName != CharOperation.NO_CHAR_CHAR)
checkIfNullAnnotationPackage();
-
+
if (enclosingModule != null)
this.enclosingModule = enclosingModule;
else if (parent != null)
this.enclosingModule = parent.enclosingModule; // stop-gap for any remaining calls that don't provide an enclosingModule (they should)
-
+
if (this.enclosingModule == null)
throw new IllegalStateException("Package should have an enclosing module"); //$NON-NLS-1$
}
@@ -456,7 +456,7 @@ public String toString() {
* be stripped and one less check during retrieval.
*/
public static class TeamPackageBinding extends PlainPackageBinding {
-
+
/**
* @param compoundName
* @param parent
@@ -473,7 +473,7 @@ public String toString() {
parent.addPackage(this, enclosingModule);
enclosingModule.declaredPackages.put(CharOperation.concatWith(compoundName, '.'), this);
}
-
+
/** For nested role files the compoundName may contain '$' and '__OT__' delimitors.
* Delete '__OT__' and split at '$' into a more fine grained compound name.
* @param compoundName
@@ -485,19 +485,19 @@ public String toString() {
for (int i = 0; i < compoundName.length; i++)
count += CharOperation.occurencesOf('$', compoundName[i]);
char[][] result = new char[count][];
-
+
int resultIdx = 0;
for (int i = 0; i < compoundName.length; i++) {
int currentPos = 0;
while (true) {
int prevPos = currentPos;
currentPos = CharOperation.indexOf('$', compoundName[i], prevPos);
-
+
char[] element = CharOperation.subarray(compoundName[i], prevPos, currentPos); // split at '$'
if (RoleSplitter.isClassPartName(element))
element = RoleSplitter.getInterfacePartName(element); // strip '__OT__'
result[resultIdx++] = element;
-
+
if (currentPos == -1)
break;
currentPos++;
@@ -505,7 +505,7 @@ public String toString() {
}
return result;
}
-
+
@Override
void addType(ReferenceBinding element) {
if (this.knownTypes == null)
@@ -513,7 +513,7 @@ public String toString() {
char[][] elementCompoundName = CharOperation.splitOn('$', element.compoundName[element.compoundName.length - 1]);
this.knownTypes.put(elementCompoundName[elementCompoundName.length-1], element);
}
-
+
/** Similar to PackageBinding.getType(), except that we allow nested types,
* which we search in the parent package.
*/
@@ -535,7 +535,7 @@ public String toString() {
return null;
}
}
-
+
if (binding == LookupEnvironment.TheNotFoundType)
return null;
if (binding instanceof UnresolvedReferenceBinding)
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding.java
index ecd234fa3..e6b066cf4 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding.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
* Technical University Berlin - extended API and implementation
@@ -70,7 +70,7 @@ public class ParameterizedGenericMethodBinding extends ParameterizedMethodBindin
* <p>
* In 1.8+ if the expected type is not yet available due to this call being an argument to an outer call which is not overload-resolved yet,
* the returned method binding will be a PolyParameterizedGenericMethodBinding.
- * </p>
+ * </p>
*/
public static MethodBinding computeCompatibleMethod(MethodBinding originalMethod, TypeBinding[] arguments, Scope scope, InvocationSite invocationSite)
{
@@ -145,7 +145,7 @@ public class ParameterizedGenericMethodBinding extends ParameterizedMethodBindin
if (expectedType != null && !originalMethod.returnType.mentionsAny(originalMethod.parameters, -1)) {
TypeBinding uncaptured = methodSubstitute.returnType.uncapture(scope);
if (!methodSubstitute.returnType.isCompatibleWith(expectedType) &&
- expectedType.isCompatibleWith(uncaptured)) {
+ expectedType.isCompatibleWith(uncaptured)) {
InferenceContext oldContext = inferenceContext;
inferenceContext = new InferenceContext(originalMethod);
// Include additional constraint pertaining to the expected type
@@ -162,7 +162,7 @@ public class ParameterizedGenericMethodBinding extends ParameterizedMethodBindin
inferenceContext = oldContext;
}
}
- }
+ }
}
}
}
@@ -184,17 +184,17 @@ public class ParameterizedGenericMethodBinding extends ParameterizedMethodBindin
for (int i = 0, length = typeVariables.length; i < length; i++) {
TypeVariableBinding typeVariable = typeVariables[i];
TypeBinding substitute = methodSubstitute.typeArguments[i]; // retain for diagnostics
- /* https://bugs.eclipse.org/bugs/show_bug.cgi?id=375394, To avoid spurious bounds check failures due to circularity in formal bounds,
+ /* https://bugs.eclipse.org/bugs/show_bug.cgi?id=375394, To avoid spurious bounds check failures due to circularity in formal bounds,
we should eliminate only the lingering embedded type variable references after substitution, not alien type variable references
that constitute the inference per se.
- */
+ */
TypeBinding substituteForChecks;
if (substitute instanceof TypeVariableBinding) {
substituteForChecks = substitute;
} else {
substituteForChecks = Scope.substitute(new LingeringTypeVariableEliminator(typeVariables, null, scope), substitute); // while using this for bounds check
}
-
+
if (uncheckedArguments != null && uncheckedArguments[i] == null) continue; // only bound check if inferred through 15.12.2.6
//{ObjectTeams: methods with generic declared lifting need to be checked in knowledge of the actual receiver type:
ReferenceBinding actualReceiverRefType = null;
@@ -229,13 +229,13 @@ public class ParameterizedGenericMethodBinding extends ParameterizedMethodBindin
}
public static MethodBinding computeCompatibleMethod18(MethodBinding originalMethod, TypeBinding[] arguments, final Scope scope, InvocationSite invocationSite) {
-
+
TypeVariableBinding[] typeVariables = originalMethod.typeVariables;
if (invocationSite.checkingPotentialCompatibility()) {
// Not interested in a solution, only that there could potentially be one.
return scope.environment().createParameterizedGenericMethod(originalMethod, typeVariables);
}
-
+
ParameterizedGenericMethodBinding methodSubstitute = null;
InferenceContext18 infCtx18 = invocationSite.freshInferenceContext(scope);
if (infCtx18 == null)
@@ -245,7 +245,7 @@ public class ParameterizedGenericMethodBinding extends ParameterizedMethodBindin
boolean invocationTypeInferred = false;
boolean requireBoxing = false;
boolean allArgumentsAreProper = true;
-
+
// See if we should start in loose inference mode.
TypeBinding [] argumentsCopy = new TypeBinding[arguments.length];
for (int i = 0, length = arguments.length, parametersLength = parameters.length ; i < length; i++) {
@@ -259,8 +259,8 @@ public class ParameterizedGenericMethodBinding extends ParameterizedMethodBindin
argumentsCopy[i] = argument;
}
}
- arguments = argumentsCopy; // either way, this allows the engine to update arguments without harming the callers.
-
+ arguments = argumentsCopy; // either way, this allows the engine to update arguments without harming the callers.
+
LookupEnvironment environment = scope.environment();
InferenceContext18 previousContext = environment.currentInferenceContext;
if (previousContext == null)
@@ -269,7 +269,7 @@ public class ParameterizedGenericMethodBinding extends ParameterizedMethodBindin
BoundSet provisionalResult = null;
BoundSet result = null;
// ---- 18.5.1 (Applicability): ----
- final boolean isPolyExpression = invocationSite instanceof Expression && ((Expression) invocationSite).isTrulyExpression() &&
+ final boolean isPolyExpression = invocationSite instanceof Expression && ((Expression) invocationSite).isTrulyExpression() &&
((Expression)invocationSite).isPolyExpression(originalMethod);
boolean isDiamond = isPolyExpression && originalMethod.isConstructor();
if (arguments.length == parameters.length) {
@@ -309,7 +309,7 @@ public class ParameterizedGenericMethodBinding extends ParameterizedMethodBindin
if (solutions != null) {
//{ObjectTeams: validate matching team anchors:
// TODO: could this be integrated with TypeVariableBinding.boundCheck(Substitution, TypeBinding, ReferenceBinding, Scope)
- // which already uses Substitutation.substituteAnchor(ITeamAnchor,int) internally?
+ // which already uses Substitutation.substituteAnchor(ITeamAnchor,int) internally?
for (int i = 0; i < solutions.length; i++) {
if (solutions[i] instanceof DependentTypeBinding
&& typeVariables[i].anchors != null
@@ -345,7 +345,7 @@ public class ParameterizedGenericMethodBinding extends ParameterizedMethodBindin
((ReferenceExpression) invocationSite).registerInferenceContext(methodSubstitute, infCtx18); // keep context so we can finish later
}
}
- return methodSubstitute;
+ return methodSubstitute;
}
}
return null;
@@ -357,7 +357,7 @@ public class ParameterizedGenericMethodBinding extends ParameterizedMethodBindin
environment.currentInferenceContext = previousContext;
}
}
-
+
MethodBinding boundCheck18(Scope scope, TypeBinding[] arguments, InvocationSite site) {
Substitution substitution = this;
ParameterizedGenericMethodBinding methodSubstitute = this;
@@ -366,17 +366,17 @@ public class ParameterizedGenericMethodBinding extends ParameterizedMethodBindin
for (int i = 0, length = originalTypeVariables.length; i < length; i++) {
TypeVariableBinding typeVariable = originalTypeVariables[i];
TypeBinding substitute = methodSubstitute.typeArguments[i]; // retain for diagnostics
- /* https://bugs.eclipse.org/bugs/show_bug.cgi?id=375394, To avoid spurious bounds check failures due to circularity in formal bounds,
+ /* https://bugs.eclipse.org/bugs/show_bug.cgi?id=375394, To avoid spurious bounds check failures due to circularity in formal bounds,
we should eliminate only the lingering embedded type variable references after substitution, not alien type variable references
that constitute the inference per se.
- */
+ */
TypeBinding substituteForChecks;
if (substitute instanceof TypeVariableBinding) {
substituteForChecks = substitute;
} else {
substituteForChecks = Scope.substitute(new LingeringTypeVariableEliminator(originalTypeVariables, null, scope), substitute); // while using this for bounds check
}
-
+
//{ObjectTeams: methods with generic declared lifting need to be checked in knowledge of the actual receiver type:
ReferenceBinding actualReceiverRefType = null;
if (site instanceof MessageSend) {
@@ -678,7 +678,7 @@ public class ParameterizedGenericMethodBinding extends ParameterizedMethodBindin
TypeBinding getErasure18_5_2(TypeBinding type, LookupEnvironment env, boolean substitute) {
// opportunistic interpretation of (JLS 18.5.2):
- // "If unchecked conversion was necessary ..., then ...
+ // "If unchecked conversion was necessary ..., then ...
// the return type and thrown types of the invocation type of m are given by
// the erasure of the return type and thrown types of m's type."
if (substitute)
@@ -797,7 +797,7 @@ public class ParameterizedGenericMethodBinding extends ParameterizedMethodBindin
are inferred to be the glb of the published bounds - as there can recursion in the formal bounds, the
inferred bounds would no longer be glb.
*/
-
+
this.typeArguments = Scope.substitute(this, this.typeArguments);
// adjust method types to reflect latest inference
@@ -838,7 +838,7 @@ public class ParameterizedGenericMethodBinding extends ParameterizedMethodBindin
/* https://bugs.eclipse.org/bugs/show_bug.cgi?id=347600 && https://bugs.eclipse.org/bugs/show_bug.cgi?id=242159
Sometimes due to recursion/circularity in formal bounds, even *published bounds* fail bound check. We need to
- break the circularity/self reference in order not to be overly strict during type equivalence checks.
+ break the circularity/self reference in order not to be overly strict during type equivalence checks.
See also http://bugs.sun.com/view_bug.do?bug_id=6932571
*/
private static class LingeringTypeVariableEliminator implements Substitution {
@@ -846,7 +846,7 @@ public class ParameterizedGenericMethodBinding extends ParameterizedMethodBindin
final private TypeVariableBinding [] variables;
final private TypeBinding [] substitutes; // when null, substitute type variables by unbounded wildcard
final private Scope scope;
-
+
/**
* @param variables
* @param substitutes when null, substitute type variable by unbounded wildcard
@@ -864,7 +864,7 @@ public class ParameterizedGenericMethodBinding extends ParameterizedMethodBindin
return typeVariable;
}
if (this.substitutes != null) {
- return Scope.substitute(new LingeringTypeVariableEliminator(this.variables, null, this.scope), this.substitutes[typeVariable.rank]);
+ return Scope.substitute(new LingeringTypeVariableEliminator(this.variables, null, this.scope), this.substitutes[typeVariable.rank]);
}
ReferenceBinding genericType = (ReferenceBinding) (typeVariable.declaringElement instanceof ReferenceBinding ? typeVariable.declaringElement : null);
return this.scope.environment().createWildcard(genericType, typeVariable.rank, null, null, Wildcard.UNBOUND, typeVariable.getTypeAnnotations());
@@ -915,7 +915,7 @@ public class ParameterizedGenericMethodBinding extends ParameterizedMethodBindin
* Check if the given variable was the result of substituting a variable from the original method.
* If so answer the corresponding variable of the original method.
* @param specificVariable a type variable from this method's scope.
- * @return either a type variable from the original method or the input specificVariable
+ * @return either a type variable from the original method or the input specificVariable
*/
public TypeVariableBinding reverseSubstitute(TypeVariableBinding specificVariable) {
int length = this.typeArguments.length;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding.java
index 76b75348e..67bccb774 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding.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
* Technical University Berlin - extended API and implementation
@@ -61,7 +61,7 @@ public class ParameterizedMethodBinding extends MethodBinding {
final int length = originalVariables.length;
//{ObjectTeams: along the tsuper-link staticness is ignored as methods can still be overridden:
/* orig:
- final boolean isStatic = originalMethod.isStatic();
+ final boolean isStatic = originalMethod.isStatic();
:giro */
final boolean isStatic = originalMethod.isStatic() && !RoleModel.hasTagBit(parameterizedDeclaringClass, RoleModel.IsViewedAsTSuper);
// SH}
@@ -376,8 +376,8 @@ public class ParameterizedMethodBinding extends MethodBinding {
public MethodBinding original() {
return this.originalMethod.original();
}
-
-
+
+
@Override
public MethodBinding shallowOriginal() {
return this.originalMethod;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java
index caa8c0903..72e161e9f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java
@@ -97,9 +97,9 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
//{ObjectTeams:
this(type, arguments, null, enclosingType, environment);
}
-
+
public ParameterizedTypeBinding(ReferenceBinding type, TypeBinding[] arguments, ITeamAnchor teamAnchor, ReferenceBinding enclosingType, LookupEnvironment environment){
-// orig:
+// orig:
this.environment = environment;
this.enclosingType = enclosingType; // never unresolved, but if type is an unresolved nested type, enclosingType is null here but set later in swapUnresolved.
if (!type.hasEnclosingInstanceContext() && arguments == null && !(this instanceof RawTypeBinding))
@@ -144,7 +144,7 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
ReferenceBinding realClass = super.getRealClass();
if (TypeBinding.equalsEquals(realClass, this))
return this; // no further wrapping if this _is_ the class part
- return this.environment.createParameterizedType(realClass, this.arguments, this.enclosingType());
+ return this.environment.createParameterizedType(realClass, this.arguments, this.enclosingType());
}
// FIXME(SH): this method causes regressions (still looks consistent, though):
// @Override
@@ -152,7 +152,7 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
// ReferenceBinding realType = super.getRealType();
// if (realType == this || isRawType())
// return this; // no further wrapping if this _is_ the ifc part
-// return this.environment.createParameterizedType(realType, this.arguments, realType.enclosingType());
+// return this.environment.createParameterizedType(realType, this.arguments, realType.enclosingType());
// }
/** {@inheritDoc} */
@Override
@@ -210,7 +210,7 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
ASTNode cud = compilationUnitScope.referenceContext;
long sourceLevel = this.environment.globalOptions.sourceLevel;
final boolean needUniqueCapture = sourceLevel >= ClassFileConstants.JDK1_8;
-
+
for (int i = 0; i < length; i++) {
TypeBinding argument = originalArguments[i];
if (argument.kind() == Binding.WILDCARD_TYPE) { // no capture for intersection types
@@ -219,8 +219,8 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
capturedArguments[i] = wildcard.bound;
else if (needUniqueCapture)
capturedArguments[i] = this.environment.createCapturedWildcard(wildcard, contextType, start, end, cud, compilationUnitScope.nextCaptureID());
- else
- capturedArguments[i] = new CaptureBinding(wildcard, contextType, start, end, cud, compilationUnitScope.nextCaptureID());
+ else
+ capturedArguments[i] = new CaptureBinding(wildcard, contextType, start, end, cud, compilationUnitScope.nextCaptureID());
} else {
capturedArguments[i] = argument;
}
@@ -441,7 +441,7 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
public char[] constantPoolName() {
return this.type.constantPoolName(); // erasure
}
-
+
@Override
public TypeBinding clone(TypeBinding outerType) {
return new ParameterizedTypeBinding(this.type, this.arguments, (ReferenceBinding) outerType, this.environment);
@@ -457,7 +457,7 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
public String debugName() {
if (this.hasTypeAnnotations())
return annotatedDebugName();
- StringBuffer nameBuffer = new StringBuffer(10);
+ StringBuffer nameBuffer = new StringBuffer(10);
if (this.type instanceof UnresolvedReferenceBinding) {
nameBuffer.append(this.type);
} else {
@@ -473,7 +473,7 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
}
return nameBuffer.toString();
}
-
+
@Override
public String annotatedDebugName() {
StringBuffer nameBuffer = new StringBuffer(super.annotatedDebugName());
@@ -521,11 +521,11 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
public ReferenceBinding upwardsProjection(Scope scope, TypeBinding[] mentionedTypeVariables) {
TypeBinding[] typeVariables = this.arguments;
if (typeVariables == null) return this; // How would that be possible?
-
+
TypeBinding[] a_i_primes = new TypeBinding[typeVariables.length];
for (int i = 0, length = typeVariables.length; i < length; i++) {
TypeBinding a_i = typeVariables[i];
-
+
// If Ai does not mention any restricted type variable, then Ai' = Ai.
int typeVariableKind = a_i.kind();
if (! a_i.mentionsAny(mentionedTypeVariables, -1)) {
@@ -537,7 +537,7 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
TypeVariableBinding[] g_vars = this.type.typeVariables();
if (g_vars == null || g_vars.length == 0) return this; // Careful - could be a MissingTypeBinding here
TypeBinding b_i = g_vars[i].upperBound();
-
+
// If U is not Object,
// and if either
// * the declared bound of the ith parameter of G, Bi, mentions a type parameter of G, or
@@ -557,10 +557,10 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
a_i_primes[i] = this.environment().createWildcard(genericType(), i, null, null, Wildcard.UNBOUND);
}
}
- } else {
+ } else {
WildcardBinding wildcard = (WildcardBinding)a_i;
if (wildcard.boundKind() == Wildcard.EXTENDS) {
- // If Ai is an upper-bounded wildcard that mentions a restricted type variable,
+ // If Ai is an upper-bounded wildcard that mentions a restricted type variable,
// then let U be the upward projection of the wildcard bound.
TypeBinding u = wildcard.bound().upwardsProjection(scope, mentionedTypeVariables);
// Ai' is a wildcard ? extends U.
@@ -584,18 +584,18 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
public ReferenceBinding downwardsProjection(Scope scope, TypeBinding[] mentionedTypeVariables) {
TypeBinding[] typeVariables = this.arguments;
if (typeVariables == null) return this; // How would that be possible?
-
+
TypeBinding[] a_i_primes = new TypeBinding[typeVariables.length];
for (int i = 0, length = typeVariables.length; i < length; i++) {
TypeBinding a_i = typeVariables[i];
-
+
// If Ai does not mention any restricted type variable, then Ai' = Ai.
int typeVariableKind = a_i.kind();
if (! a_i.mentionsAny(mentionedTypeVariables, -1)) {
a_i_primes[i] = a_i;
} else if (typeVariableKind != Binding.WILDCARD_TYPE) {
return null;
- } else {
+ } else {
WildcardBinding wildcard = (WildcardBinding)a_i;
if (wildcard.boundKind() == Wildcard.EXTENDS) {
// Ai is an upper-bounded wildcard that mentions a restricted type variable,
@@ -621,7 +621,7 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
}
return this.environment.createParameterizedType(this.type, a_i_primes, this.enclosingType);
}
-
+
/**
* @see org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#fieldCount()
*/
@@ -763,7 +763,7 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
}
return match;
}
-
+
/**
* @see org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#getExactMethod(char[], TypeBinding[],CompilationUnitScope)
*/
@@ -843,7 +843,7 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
fields(); // ensure fields have been initialized... must create all at once unlike methods
return ReferenceBinding.binarySearch(fieldName, this.fields);
}
-
+
/**
* @see org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#getMethods(char[])
*/
@@ -1032,7 +1032,7 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
return null;
}
// SH}
-
+
@Override
public boolean isBoundParameterizedType() {
return (this.tagBits & TagBits.IsBoundParameterizedType) != 0;
@@ -1052,7 +1052,7 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
case Binding.PARAMETERIZED_TYPE :
ParameterizedTypeBinding otherParamType = (ParameterizedTypeBinding) otherType;
- if (TypeBinding.notEquals(this.type, otherParamType.type))
+ if (TypeBinding.notEquals(this.type, otherParamType.type))
return false;
if (!isStatic()) { // static member types do not compare their enclosing
ReferenceBinding enclosing = enclosingType();
@@ -1084,11 +1084,11 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
return TypeBinding.equalsEquals(erasure(), otherType.erasure());
}
/* With the hybrid 1.4/1.5+ projects modes, while establishing type equivalence, we need to
- be prepared for a type such as Map appearing in one of three forms: As (a) a ParameterizedTypeBinding
- e.g Map<String, String>, (b) as RawTypeBinding Map#RAW and finally (c) as a BinaryTypeBinding
+ be prepared for a type such as Map appearing in one of three forms: As (a) a ParameterizedTypeBinding
+ e.g Map<String, String>, (b) as RawTypeBinding Map#RAW and finally (c) as a BinaryTypeBinding
When the usage of a type lacks type parameters, whether we land up with the raw form or not depends
on whether the underlying type was "seen to be" a generic type in the particular build environment or
- not. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=328827
+ not. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=328827
*/
if (TypeBinding.equalsEquals(erasure(), otherType)) {
return true;
@@ -1128,7 +1128,7 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
TypeBinding newArg = oldArg.substituteInferenceVariable(var, substituteType);
if (TypeBinding.notEquals(newArg, oldArg)) {
if (newArgs == null)
- System.arraycopy(this.arguments, 0, newArgs = new TypeBinding[length], 0, length);
+ System.arraycopy(this.arguments, 0, newArgs = new TypeBinding[length], 0, length);
newArgs[i] = newArg;
}
}
@@ -1246,7 +1246,7 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
if (j < this.methods.length && this.methods[j].original() == originalMethods[i])
newMethods[i] = this.methods[j++];
else
- newMethods[i] = createParameterizedMethod(originalMethods[i]);
+ newMethods[i] = createParameterizedMethod(originalMethods[i]);
}
return this.methods = newMethods;
}
@@ -1412,7 +1412,7 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
Just as with bounds check below, incremental build will propagate the change and
detect problems in source.
*/
-
+
// // arity check
// TypeVariableBinding[] refTypeVariables = resolvedType.typeVariables();
// if (refTypeVariables == Binding.NO_TYPE_VARIABLES) { // check generic
@@ -1592,7 +1592,7 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
}
TypeBinding substitute = currentType.arguments[originalVariable.rank];
return originalVariable.combineTypeAnnotations(substitute);
- }
+ }
}
// recurse on enclosing type, as it may hold more substitutions to perform
if (currentType.isStatic()) break;
@@ -1622,7 +1622,7 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
if (genericSuperclass == null) return null; // e.g. interfaces
this.superclass = (ReferenceBinding) Scope.substitute(this, genericSuperclass);
this.typeBits |= (this.superclass.typeBits & TypeIds.InheritableBits);
- if ((this.typeBits & (TypeIds.BitAutoCloseable|TypeIds.BitCloseable)) != 0) // avoid the side-effects of hasTypeBit()!
+ if ((this.typeBits & (TypeIds.BitAutoCloseable|TypeIds.BitCloseable)) != 0) // avoid the side-effects of hasTypeBit()!
this.typeBits |= applyCloseableClassWhitelists(this.environment.globalOptions);
}
return this.superclass;
@@ -1640,7 +1640,7 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
if (this.superInterfaces != null) {
for (int i = this.superInterfaces.length; --i >= 0;) {
this.typeBits |= (this.superInterfaces[i].typeBits & TypeIds.InheritableBits);
- if ((this.typeBits & (TypeIds.BitAutoCloseable|TypeIds.BitCloseable)) != 0) // avoid the side-effects of hasTypeBit()!
+ if ((this.typeBits & (TypeIds.BitAutoCloseable|TypeIds.BitCloseable)) != 0) // avoid the side-effects of hasTypeBit()!
this.typeBits |= applyCloseableInterfaceWhitelists();
}
}
@@ -1779,12 +1779,12 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
}
return Binding.NO_TYPE_VARIABLES;
}
-
+
@Override
public TypeBinding[] typeArguments() {
return this.arguments;
}
-
+
@Override
public FieldBinding[] unResolvedFields() {
return this.fields;
@@ -1802,7 +1802,7 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
TypeVariableBinding [] typeParameters = this.type.typeVariables();
for (int j = 0, length = typeParameters.length; j < length; j++) {
if (!typeParameters[j].boundCheck(declaringType, types[j], scope, null).isOKbyJLS())
- return new MethodBinding[] { new ProblemMethodBinding(TypeConstants.ANONYMOUS_METHOD, null, ProblemReasons.NotAWellFormedParameterizedType) };
+ return new MethodBinding[] { new ProblemMethodBinding(TypeConstants.ANONYMOUS_METHOD, null, ProblemReasons.NotAWellFormedParameterizedType) };
}
return declaringType.getInterfaceAbstractContracts(scope, replaceWildcards, filterDefaultMethods);
}
@@ -1813,7 +1813,7 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
@Override
public MethodBinding getSingleAbstractMethod(final Scope scope, boolean replaceWildcards) {
return getSingleAbstractMethod(scope, replaceWildcards, -1, -1 /* do not capture */);
- }
+ }
public MethodBinding getSingleAbstractMethod(final Scope scope, boolean replaceWildcards, int start, int end) {
int index = replaceWildcards ? end < 0 ? 0 : 1 : 2; // capturePosition >= 0 IFF replaceWildcard == true
if (this.singleAbstractMethod != null) {
@@ -1828,9 +1828,9 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
MethodBinding theAbstractMethod = genericType.getSingleAbstractMethod(scope, replaceWildcards);
if (theAbstractMethod == null || !theAbstractMethod.isValidBinding())
return this.singleAbstractMethod[index] = theAbstractMethod;
-
+
ParameterizedTypeBinding declaringType = null;
- TypeBinding [] types = this.arguments;
+ TypeBinding [] types = this.arguments;
if (replaceWildcards) {
types = getNonWildcardParameterization(scope);
if (types == null)
@@ -1838,7 +1838,7 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
} else if (types == null) {
types = NO_TYPES;
}
- if (end >= 0) {
+ if (end >= 0) {
// caller is going to require the sam's parameters to be treated as argument expressions, post substitution capture will lose identity, where substitution results in fan out
// capture first and then substitute.
for (int i = 0, length = types.length; i < length; i++) {
@@ -1849,7 +1849,7 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
TypeVariableBinding [] typeParameters = genericType.typeVariables();
for (int i = 0, length = typeParameters.length; i < length; i++) {
if (!typeParameters[i].boundCheck(declaringType, types[i], scope, null).isOKbyJLS())
- return this.singleAbstractMethod[index] = new ProblemMethodBinding(TypeConstants.ANONYMOUS_METHOD, null, ProblemReasons.NotAWellFormedParameterizedType);
+ return this.singleAbstractMethod[index] = new ProblemMethodBinding(TypeConstants.ANONYMOUS_METHOD, null, ProblemReasons.NotAWellFormedParameterizedType);
}
ReferenceBinding substitutedDeclaringType = (ReferenceBinding) declaringType.findSuperTypeOriginatingFrom(theAbstractMethod.declaringClass);
MethodBinding [] choices = substitutedDeclaringType.getMethods(theAbstractMethod.selector);
@@ -1965,7 +1965,7 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
} else {
newArguments[i] = arg.maybeWrapRoleType(typedNode, updater);
}
-
+
// must avoid nulls in arguments (no longer observed in otjld-tests):
if (newArguments[i] == null) {
@@ -1980,7 +1980,7 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
return this;
// yes, we have a modification
- return this.environment.createParameterizedType(this.type, newArguments, this.enclosingType());
+ return this.environment.createParameterizedType(this.type, newArguments, this.enclosingType());
}
// SH}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/PolyParameterizedGenericMethodBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/PolyParameterizedGenericMethodBinding.java
index 238f2f542..a1ddaa8d6 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/PolyParameterizedGenericMethodBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/PolyParameterizedGenericMethodBinding.java
@@ -15,12 +15,12 @@ package org.eclipse.jdt.internal.compiler.lookup;
public class PolyParameterizedGenericMethodBinding extends ParameterizedGenericMethodBinding { // confused citizen.
- private ParameterizedGenericMethodBinding wrappedBinding;
+ private ParameterizedGenericMethodBinding wrappedBinding;
public PolyParameterizedGenericMethodBinding(ParameterizedGenericMethodBinding applicableMethod) {
super(applicableMethod.originalMethod, applicableMethod.typeArguments, applicableMethod.environment, applicableMethod.inferredWithUncheckedConversion, false, applicableMethod.targetType);
this.wrappedBinding = applicableMethod;
}
-
+
@Override
public boolean equals(Object other) {
if (other instanceof PolyParameterizedGenericMethodBinding) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/PolyTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/PolyTypeBinding.java
index 5736e99ae..dfe3acec7 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/PolyTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/PolyTypeBinding.java
@@ -23,11 +23,11 @@ public class PolyTypeBinding extends TypeBinding {
Expression expression;
boolean vanillaCompatibilty = true;
-
+
public PolyTypeBinding(Expression expression) {
this.expression = expression;
}
-
+
@Override
public char[] constantPoolName() {
throw new UnsupportedOperationException(); // should never reach code generation
@@ -42,7 +42,7 @@ public class PolyTypeBinding extends TypeBinding {
public boolean isCompatibleWith(TypeBinding left, Scope scope) {
return this.vanillaCompatibilty ? this.expression.isCompatibleWith(left, scope) : this.expression.isBoxingCompatibleWith(left, scope);
}
-
+
@Override
public boolean isPotentiallyCompatibleWith(TypeBinding targetType, Scope scope) {
return this.expression.isPotentiallyCompatibleWith(targetType, scope);
@@ -52,7 +52,7 @@ public class PolyTypeBinding extends TypeBinding {
public boolean isPolyType() {
return true;
}
-
+
@Override
public boolean isFunctionalType() {
return this.expression.isFunctionalType();
@@ -83,13 +83,13 @@ public class PolyTypeBinding extends TypeBinding {
public boolean sIsMoreSpecific(TypeBinding s, TypeBinding t, Scope scope) {
return this.expression.sIsMoreSpecific(s, t, scope);
}
-
+
@Override
public String toString() {
StringBuffer buffer = new StringBuffer("PolyTypeBinding for: "); //$NON-NLS-1$
return this.expression.printExpression(0, buffer).toString();
}
-
+
@Override
public int kind() {
return Binding.POLY_TYPE;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/PolymorphicMethodBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/PolymorphicMethodBinding.java
index 578e13839..d8c7e10dc 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/PolymorphicMethodBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/PolymorphicMethodBinding.java
@@ -31,7 +31,7 @@ public class PolymorphicMethodBinding extends MethodBinding {
this.polymorphicMethod = polymorphicMethod;
this.tagBits = polymorphicMethod.tagBits;
}
-
+
public PolymorphicMethodBinding(MethodBinding polymorphicMethod, TypeBinding returnType, TypeBinding[] parameterTypes) {
super(
polymorphicMethod.modifiers,
@@ -48,7 +48,7 @@ public class PolymorphicMethodBinding extends MethodBinding {
public MethodBinding original() {
return this.polymorphicMethod;
}
-
+
@Override
public boolean isPolymorphic() {
return true;
@@ -78,7 +78,7 @@ public class PolymorphicMethodBinding extends MethodBinding {
// all arguments match
return true;
}
-
+
/*
* Even if polymorphic methods are varargs method, we don't want them to be treated as varargs method
*/
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/RawTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/RawTypeBinding.java
index f06959247..d77b06b13 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/RawTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/RawTypeBinding.java
@@ -92,7 +92,7 @@ public class RawTypeBinding extends ParameterizedTypeBinding {
sig.getChars(0, sigLength, uniqueKey, 0);
return uniqueKey;
}
-
+
@Override
public TypeBinding clone(TypeBinding outerType) {
return new RawTypeBinding(this.actualType(), (ReferenceBinding) outerType, this.environment);
@@ -239,17 +239,17 @@ public class RawTypeBinding extends ParameterizedTypeBinding {
}
this.arguments = typeArguments;
}
-
+
@Override
public ParameterizedTypeBinding capture(Scope scope, int start, int end) {
return this;
}
- @Override
+ @Override
public TypeBinding uncapture(Scope scope) {
return this;
}
-
+
@Override
//{ObjectTeams:
protected
@@ -272,7 +272,7 @@ public class RawTypeBinding extends ParameterizedTypeBinding {
MethodBinding theAbstractMethod = genericType.getSingleAbstractMethod(scope, replaceWildcards);
if (theAbstractMethod == null || !theAbstractMethod.isValidBinding())
return this.singleAbstractMethod[index] = theAbstractMethod;
-
+
ReferenceBinding declaringType = (ReferenceBinding) scope.environment().convertToRawType(genericType, true);
declaringType = (ReferenceBinding) declaringType.findSuperTypeOriginatingFrom(theAbstractMethod.declaringClass);
MethodBinding [] choices = declaringType.getMethods(theAbstractMethod.selector);
@@ -315,7 +315,7 @@ public class RawTypeBinding extends ParameterizedTypeBinding {
}
return shortReadableName;
}
-
+
//{ObjectTeams:
@Override
protected
@@ -333,11 +333,11 @@ public class RawTypeBinding extends ParameterizedTypeBinding {
public ReferenceBinding downwardsProjection(Scope scope, TypeBinding[] mentionedTypeVariables) {
return this;
}
-
+
@Override
public ReferenceBinding enclosingType() {
// ParameterizedTypeBinding earlier always had a resolved enclosed type, but now it does on-demand resolving.
- // Behaviour for RawTypeBinding should be unchanged.
+ // Behaviour for RawTypeBinding should be unchanged.
return this.enclosingType;
}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReductionResult.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReductionResult.java
index 1c157dba6..c99f2f85e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReductionResult.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReductionResult.java
@@ -26,14 +26,14 @@ public abstract class ReductionResult {
@Override
public String toString() { return "TRUE"; } //$NON-NLS-1$
};
- protected static final ConstraintTypeFormula FALSE = new ConstraintTypeFormula() {
- /* empty body just to make abstract class instantiable */
+ protected static final ConstraintTypeFormula FALSE = new ConstraintTypeFormula() {
+ /* empty body just to make abstract class instantiable */
@Override
public Object reduce(InferenceContext18 context) { return this; }
@Override
public String toString() { return "FALSE"; } //$NON-NLS-1$
};
-
+
// Relation kinds, mimic an enum:
protected static final int COMPATIBLE = 1;
protected static final int SUBTYPE = 2;
@@ -43,7 +43,7 @@ public abstract class ReductionResult {
protected static final int CAPTURE = 6;
static final int EXCEPTIONS_CONTAINED = 7;
protected static final int POTENTIALLY_COMPATIBLE = 8;
-
+
protected TypeBinding right; // note that the LHS differs between sub-classes.
protected int relation;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java
index 60e58c48f..e09e727b3 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java
@@ -543,7 +543,7 @@ public boolean canBeSeenBy(ReferenceBinding receiverType, ReferenceBinding invoc
do {
if (currentType.isCapture()) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=285002
if (TypeBinding.equalsEquals(originalDeclaringClass, currentType.erasure().original())) return true;
- } else {
+ } else {
if (TypeBinding.equalsEquals(originalDeclaringClass, currentType.original())) return true;
}
PackageBinding currentPackage = currentType.fPackage;
@@ -642,7 +642,7 @@ public char[] computeGenericTypeSignature(TypeVariableBinding[] typeVariables) {
}
public void computeId() {
- // note that more (configurable) ids are assigned from PackageBinding#checkIfNullAnnotationType()
+ // note that more (configurable) ids are assigned from PackageBinding#checkIfNullAnnotationType()
// try to avoid multiple checks against a package/type name
switch (this.compoundName.length) {
@@ -671,7 +671,7 @@ public void computeId() {
case 3: // only one type in this group, yet:
if (CharOperation.equals(TypeConstants.ORG_JUNIT_ASSERT, this.compoundName))
this.id = TypeIds.T_OrgJunitAssert;
- return;
+ return;
case 4:
if (!CharOperation.equals(TypeConstants.JAVA, packageName))
return;
@@ -691,7 +691,7 @@ public void computeId() {
default: return;
}
// ... at this point we know it's java.*.*
-
+
packageName = this.compoundName[1];
if (packageName.length == 0) return; // just to be safe
char[] typeName = this.compoundName[2];
@@ -704,7 +704,7 @@ public void computeId() {
switch (typeName[0]) {
case 'C' :
if (CharOperation.equals(typeName, TypeConstants.JAVA_IO_CLOSEABLE[2]))
- this.typeBits |= TypeIds.BitCloseable; // don't assign id, only typeBit (for analysis of resource leaks)
+ this.typeBits |= TypeIds.BitCloseable; // don't assign id, only typeBit (for analysis of resource leaks)
return;
case 'E' :
if (CharOperation.equals(typeName, TypeConstants.JAVA_IO_EXTERNALIZABLE[2]))
@@ -736,7 +736,7 @@ public void computeId() {
if (CharOperation.equals(typeName, TypeConstants.JAVA_UTIL_COLLECTION[2])) {
this.id = TypeIds.T_JavaUtilCollection;
this.typeBits |= TypeIds.BitCollection;
- }
+ }
return;
case 'I' :
if (CharOperation.equals(typeName, TypeConstants.JAVA_UTIL_ITERATOR[2]))
@@ -746,7 +746,7 @@ public void computeId() {
if (CharOperation.equals(typeName, TypeConstants.JAVA_UTIL_LIST[2])) {
this.id = TypeIds.T_JavaUtilList;
this.typeBits |= TypeIds.BitList;
- }
+ }
return;
case 'M' :
if (CharOperation.equals(typeName, TypeConstants.JAVA_UTIL_MAP[2])) {
@@ -772,7 +772,7 @@ public void computeId() {
case 13 :
if (CharOperation.equals(typeName, TypeConstants.JAVA_LANG_AUTOCLOSEABLE[2])) {
this.id = TypeIds.T_JavaLangAutoCloseable;
- this.typeBits |= TypeIds.BitAutoCloseable;
+ this.typeBits |= TypeIds.BitAutoCloseable;
}
return;
case 14:
@@ -1026,13 +1026,13 @@ public void computeId() {
return;
packageName = this.compoundName[1];
if (packageName.length == 0) return; // just to be safe
-
+
if (CharOperation.equals(TypeConstants.LANG, packageName)) {
packageName = this.compoundName[2];
if (packageName.length == 0) return; // just to be safe
switch (packageName[0]) {
case 'i' :
- if (CharOperation.equals(packageName, TypeConstants.INVOKE)) {
+ if (CharOperation.equals(packageName, TypeConstants.INVOKE)) {
typeName = this.compoundName[3];
if (typeName.length == 0) return; // just to be safe
switch (typeName[0]) {
@@ -1063,7 +1063,7 @@ public void computeId() {
if (packageName.length == 0) return; // just to be safe
switch (packageName[0]) {
case 'c' :
- if (CharOperation.equals(packageName, TypeConstants.CORE)) {
+ if (CharOperation.equals(packageName, TypeConstants.CORE)) {
typeName = this.compoundName[3];
if (typeName.length == 0) return; // just to be safe
switch (typeName[0]) {
@@ -1321,7 +1321,7 @@ public ReferenceBinding getMemberTypeRecurse(char[] typeName) {
/**
* Search the given sourceName in the list of sorted member types.
- *
+ *
* Neither the array of sortedMemberTypes nor the given sourceName may be null.
*/
static int binarySearch(char[] sourceName, ReferenceBinding[] sortedMemberTypes) {
@@ -1742,7 +1742,7 @@ public ReferenceBinding getRealClass() {
}
return this;
}
-/**
+/**
* Return a version of other that has the same type arguments as this.
*/
public ReferenceBinding transferTypeArguments(ReferenceBinding other) {
@@ -1798,8 +1798,8 @@ public boolean isCompatibleWith(TypeBinding otherType, boolean useObjectShortcut
this.compatibleCache.put(otherType, Boolean.TRUE);
return true;
}
- if (captureScope == null
- && this instanceof TypeVariableBinding
+ if (captureScope == null
+ && this instanceof TypeVariableBinding
&& ((TypeVariableBinding)this).firstBound instanceof ParameterizedTypeBinding) {
// see https://bugs.eclipse.org/395002#c9
// in this case a subsequent check with captureScope != null may actually get
@@ -1876,7 +1876,7 @@ private boolean isCompatibleWith0(TypeBinding otherType, boolean useObjectShortc
case Binding.GENERIC_TYPE :
case Binding.PARAMETERIZED_TYPE :
case Binding.RAW_TYPE :
- if (TypeBinding.equalsEquals(erasure(), otherType.erasure()))
+ if (TypeBinding.equalsEquals(erasure(), otherType.erasure()))
return false; // should have passed equivalence check
// above if same erasure
}
@@ -1932,11 +1932,11 @@ public boolean isSubtypeOf(TypeBinding other, boolean simulatingBugJDK8026527) {
return false;
if (TypeBinding.equalsEquals(candidate, other))
return true;
-
+
// T<Ai...> <: T#RAW:
if (other.isRawType() && TypeBinding.equalsEquals(candidate.erasure(), other.erasure()))
return true;
-
+
TypeBinding[] sis = other.typeArguments();
TypeBinding[] tis = candidate.typeArguments();
if (tis == null || sis == null)
@@ -2004,7 +2004,7 @@ public boolean isHierarchyBeingConnected() {
return (this.tagBits & TagBits.EndHierarchyCheck) == 0 && (this.tagBits & TagBits.BeginHierarchyCheck) != 0;
}
/**
- * Returns true if the type hierarchy is being connected "actively" i.e not paused momentatrily,
+ * Returns true if the type hierarchy is being connected "actively" i.e not paused momentatrily,
* while resolving type arguments. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=294057
*/
public boolean isHierarchyBeingActivelyConnected() {
@@ -2392,7 +2392,7 @@ public char[] shortReadableName(boolean showGenerics) /*Object*/ {
if ((typeVars = typeVariables()) != Binding.NO_TYPE_VARIABLES) {
:giro */
if ((typeVars = typeVariables()) != Binding.NO_TYPE_VARIABLES || valueParams != Binding.NO_SYNTH_ARGUMENTS) {
-// orig:
+// orig:
StringBuffer nameBuffer = new StringBuffer(10);
nameBuffer.append(shortReadableName).append('<');
// :giro
@@ -2457,7 +2457,7 @@ public char[] internalName() {
* Perform an upwards type projection as per JLS 4.10.5
* @param scope Relevant scope for evaluating type projection
* @param mentionedTypeVariables Filter for mentioned type variabled
- * @returns Upwards type projection of 'this', or null if downwards projection is undefined
+ * @returns Upwards type projection of 'this', or null if downwards projection is undefined
*/
@Override
public ReferenceBinding upwardsProjection(Scope scope, TypeBinding[] mentionedTypeVariables) {
@@ -2468,7 +2468,7 @@ public ReferenceBinding upwardsProjection(Scope scope, TypeBinding[] mentionedTy
* Perform a downwards type projection as per JLS 4.10.5
* @param scope Relevant scope for evaluating type projection
* @param mentionedTypeVariables Filter for mentioned type variabled
- * @returns Downwards type projection of 'this', or null if downwards projection is undefined
+ * @returns Downwards type projection of 'this', or null if downwards projection is undefined
*/
@Override
public ReferenceBinding downwardsProjection(Scope scope, TypeBinding[] mentionedTypeVariables) {
@@ -2618,7 +2618,7 @@ protected int applyCloseableInterfaceWhitelists() {
return 0;
}
-//{ObjectTeams: support for checking substitution of a value parameter
+//{ObjectTeams: support for checking substitution of a value parameter
public VariableBinding valueParamSynthArgAt(int typeParamPosition) {
SyntheticArgumentBinding[] args = valueParamSynthArgs();
if (args.length > typeParamPosition)
@@ -2628,16 +2628,16 @@ public VariableBinding valueParamSynthArgAt(int typeParamPosition) {
// SH}
protected MethodBinding [] getInterfaceAbstractContracts(Scope scope, boolean replaceWildcards, boolean filterDefaultMethods) throws InvalidInputException {
-
+
if (!isInterface() || !isValidBinding()) {
throw new InvalidInputException("Not a functional interface"); //$NON-NLS-1$
}
-
+
MethodBinding [] methods = methods();
MethodBinding [] contracts = new MethodBinding[0];
int contractsCount = 0;
int contractsLength = 0;
-
+
ReferenceBinding [] superInterfaces = superInterfaces();
for (int i = 0, length = superInterfaces.length; i < length; i++) {
// filterDefaultMethods=false => keep default methods needed to filter out any abstract methods they may override:
@@ -2654,9 +2654,9 @@ protected MethodBinding [] getInterfaceAbstractContracts(Scope scope, boolean re
LookupEnvironment environment = scope.environment();
for (int i = 0, length = methods == null ? 0 : methods.length; i < length; i++) {
final MethodBinding method = methods[i];
- if (method == null || method.isStatic() || method.redeclaresPublicObjectMethod(scope) || method.isPrivate())
+ if (method == null || method.isStatic() || method.redeclaresPublicObjectMethod(scope) || method.isPrivate())
continue;
- if (!method.isValidBinding())
+ if (!method.isValidBinding())
throw new InvalidInputException("Not a functional interface"); //$NON-NLS-1$
for (int j = 0; j < contractsCount;) {
if ( contracts[j] != null && MethodVerifier.doesMethodOverride(method, contracts[j], environment)) {
@@ -2693,7 +2693,7 @@ protected MethodBinding [] getInterfaceAbstractContracts(Scope scope, boolean re
// abstract method from one super type overridden by other super interface ==> contracts[j] = null;
if (j < contractsCount) {
System.arraycopy(contracts, j+1, contracts, j, contractsCount - j);
- }
+ }
j--;
if (j < i)
i--;
@@ -2705,8 +2705,8 @@ protected MethodBinding [] getInterfaceAbstractContracts(Scope scope, boolean re
// remove default method after it has eliminated any matching abstract methods from contracts
if (i < contractsCount) {
System.arraycopy(contracts, i+1, contracts, i, contractsCount - i);
- }
- i--;
+ }
+ i--;
}
}
if (contractsCount < contractsLength) {
@@ -2716,7 +2716,7 @@ protected MethodBinding [] getInterfaceAbstractContracts(Scope scope, boolean re
}
@Override
public MethodBinding getSingleAbstractMethod(Scope scope, boolean replaceWildcards) {
-
+
int index = replaceWildcards ? 0 : 1;
if (this.singleAbstractMethod != null) {
if (this.singleAbstractMethod[index] != null)
@@ -2751,12 +2751,12 @@ public MethodBinding getSingleAbstractMethod(Scope scope, boolean replaceWildcar
}
if (methods.length == 1)
return this.singleAbstractMethod[index] = methods[0];
-
+
final LookupEnvironment environment = scope.environment();
boolean genericMethodSeen = false;
int length = methods.length;
boolean analyseNullAnnotations = environment.globalOptions.isAnnotationBasedNullAnalysisEnabled;
-
+
next:for (int i = length - 1; i >= 0; --i) {
MethodBinding method = methods[i], otherMethod = null;
if (method.typeVariables != Binding.NO_TYPE_VARIABLES)
@@ -2768,13 +2768,13 @@ public MethodBinding getSingleAbstractMethod(Scope scope, boolean replaceWildcar
otherMethod = methods[j];
if (otherMethod.typeVariables != Binding.NO_TYPE_VARIABLES)
genericMethodSeen = true;
-
+
if (genericMethodSeen) { // adapt type parameters.
otherMethod = MethodVerifier.computeSubstituteMethod(otherMethod, method, environment);
if (otherMethod == null)
continue next;
}
- if (!MethodVerifier.isSubstituteParameterSubsignature(method, otherMethod, environment) || !MethodVerifier.areReturnTypesCompatible(method, otherMethod, environment))
+ if (!MethodVerifier.isSubstituteParameterSubsignature(method, otherMethod, environment) || !MethodVerifier.areReturnTypesCompatible(method, otherMethod, environment))
continue next;
if (analyseNullAnnotations) {
returnType = NullAnnotationMatching.strongerType(returnType, otherMethod.returnType, environment);
@@ -2788,7 +2788,7 @@ public MethodBinding getSingleAbstractMethod(Scope scope, boolean replaceWildcar
boolean shouldEraseThrows = theAbstractMethod.typeVariables == Binding.NO_TYPE_VARIABLES && genericMethodSeen;
boolean shouldAdaptThrows = theAbstractMethod.typeVariables != Binding.NO_TYPE_VARIABLES;
final int typeVariableLength = theAbstractMethod.typeVariables.length;
-
+
none:for (i = 0; i < length; i++) {
method = methods[i];
ReferenceBinding[] methodThrownExceptions = method.thrownExceptions;
@@ -2813,10 +2813,10 @@ public MethodBinding getSingleAbstractMethod(Scope scope, boolean replaceWildcar
int otherMethodExceptionsLength = otherMethodThrownExceptions == null ? 0 : otherMethodThrownExceptions.length;
if (otherMethodExceptionsLength == 0) break none;
if (shouldAdaptThrows && otherMethod != theAbstractMethod) {
- System.arraycopy(otherMethodThrownExceptions,
- 0,
- otherMethodThrownExceptions = new ReferenceBinding[otherMethodExceptionsLength],
- 0,
+ System.arraycopy(otherMethodThrownExceptions,
+ 0,
+ otherMethodThrownExceptions = new ReferenceBinding[otherMethodExceptionsLength],
+ 0,
otherMethodExceptionsLength);
for (int tv = 0; tv < typeVariableLength; tv++) {
if (otherMethodThrownExceptions[tv] instanceof TypeVariableBinding) {
@@ -2843,11 +2843,11 @@ public MethodBinding getSingleAbstractMethod(Scope scope, boolean replaceWildcar
if (exceptionsCount != exceptionsLength) {
System.arraycopy(exceptions, 0, exceptions = new ReferenceBinding[exceptionsCount], 0, exceptionsCount);
}
- this.singleAbstractMethod[index] = new MethodBinding(theAbstractMethod.modifiers | ClassFileConstants.AccSynthetic,
- theAbstractMethod.selector,
- returnType,
- parameters,
- exceptions,
+ this.singleAbstractMethod[index] = new MethodBinding(theAbstractMethod.modifiers | ClassFileConstants.AccSynthetic,
+ theAbstractMethod.selector,
+ returnType,
+ parameters,
+ exceptions,
theAbstractMethod.declaringClass);
this.singleAbstractMethod[index].typeVariables = theAbstractMethod.typeVariables;
return this.singleAbstractMethod[index];
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
index 5ae6e7ef4..c1556aca0 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
@@ -43,7 +43,7 @@
* Bug 427628 - [1.8] regression : The method * is ambiguous for the type *
* Bug 428352 - [1.8][compiler] Resolution errors don't always surface
* Bug 428366 - [1.8] [compiler] The method valueAt(ObservableList<Object>, int) is ambiguous for the type Bindings
- * Bug 424728 - [1.8][null] Unexpected error: The nullness annotation 'XXXX' is not applicable at this location
+ * Bug 424728 - [1.8][null] Unexpected error: The nullness annotation 'XXXX' is not applicable at this location
* Bug 428811 - [1.8][compiler] Type witness unnecessarily required
* Bug 429424 - [1.8][inference] Problem inferring type of method's parameter
* Bug 429958 - [1.8][null] evaluate new DefaultLocation attribute of @NonNullByDefault
@@ -145,7 +145,7 @@ public abstract class Scope {
public int kind() {
throw new IllegalStateException();
}
-
+
@Override
public char[] readableName() {
throw new IllegalStateException();
@@ -174,7 +174,7 @@ public abstract class Scope {
public int kind;
public Scope parent;
-
+
private static class NullDefaultRange {
final int start, end;
int value;
@@ -349,7 +349,7 @@ public abstract class Scope {
}
}
return originalType;
- }
+ }
public static TypeBinding getBaseType(char[] name) {
// list should be optimized (with most often used first)
@@ -495,7 +495,7 @@ public abstract class Scope {
continue; // assume we already have an error here
// Skip the following check if inference variables or CaptureBinding18 are involved,
// hopefully during inference a contradictory glb will simply not produce a solution
- // (should essentially be detected beforehand in CaptureBinding18.setUpperBounds()):
+ // (should essentially be detected beforehand in CaptureBinding18.setUpperBounds()):
if (!narrowType.isProperType(false) || !wideType.isProperType(false))
continue;
int numTypeArgs = wideType.arguments.length;
@@ -507,9 +507,9 @@ public abstract class Scope {
ReferenceBinding wideOriginal = (ReferenceBinding) wideType.original();
TypeBinding substitutedWideType =
environment.createParameterizedType(wideOriginal, bounds, wideOriginal.enclosingType());
- // if the narrow type is compatible with the substituted wide type, we keep silent,
+ // if the narrow type is compatible with the substituted wide type, we keep silent,
// substituting type variables with proper types can still satisfy all constraints,
- // otherwise ...
+ // otherwise ...
if (!narrowType.isCompatibleWith(substitutedWideType, scope)) {
// ... parameterized types are incompatible due to incompatible type arguments => unsatisfiable
return null;
@@ -576,9 +576,9 @@ public abstract class Scope {
* In raw mode (see {@link Substitution#isRawSubstitution()}),
* all parameterized types are converted to raw types.
* Cf. 4.8: "The type of a constructor (8.8), instance method (8.4, 9.4),
- * or non-static field (8.3) M of a raw type C that is not inherited from its
+ * or non-static field (8.3) M of a raw type C that is not inherited from its
* superclasses or superinterfaces is the raw type that corresponds to the erasure
- * of its type in the generic declaration corresponding to C."
+ * of its type in the generic declaration corresponding to C."
*/
public static TypeBinding substitute(Substitution substitution, TypeBinding originalType) {
return defaultSubstitutor.substitute(substitution, originalType);
@@ -592,7 +592,7 @@ public abstract class Scope {
return defaultSubstitutor.substitute(substitution, originalTypes);
}
- /** Bridge to non-static implementation in {@link Substitutor}, to make methods overridable. */
+ /** Bridge to non-static implementation in {@link Substitutor}, to make methods overridable. */
private static Substitutor defaultSubstitutor = new Substitutor();
public static class Substitutor {
/**
@@ -626,9 +626,9 @@ public abstract class Scope {
* In raw mode (see {@link Substitution#isRawSubstitution()}),
* all parameterized types are converted to raw types.
* Cf. 4.8: "The type of a constructor (8.8), instance method (8.4, 9.4),
- * or non-static field (8.3) M of a raw type C that is not inherited from its
+ * or non-static field (8.3) M of a raw type C that is not inherited from its
* superclasses or superinterfaces is the raw type that corresponds to the erasure
- * of its type in the generic declaration corresponding to C."
+ * of its type in the generic declaration corresponding to C."
*/
public TypeBinding substitute(Substitution substitution, TypeBinding originalType) {
if (originalType == null) return null;
@@ -638,10 +638,10 @@ public abstract class Scope {
// SH}
switch (originalType.kind()) {
-
+
case Binding.TYPE_PARAMETER:
return substitution.substitute((TypeVariableBinding) originalType);
-
+
case Binding.PARAMETERIZED_TYPE:
ParameterizedTypeBinding originalParameterizedType = (ParameterizedTypeBinding) originalType;
ReferenceBinding originalEnclosing = originalType.enclosingType();
@@ -672,7 +672,7 @@ public abstract class Scope {
originalParameterizedType.genericType(), substitutedArguments, substitutedEnclosing, originalType.getTypeAnnotations());
}
break;
-
+
case Binding.ARRAY_TYPE:
ArrayBinding originalArrayType = (ArrayBinding) originalType;
TypeBinding originalLeafComponentType = originalArrayType.leafComponentType;
@@ -681,7 +681,7 @@ public abstract class Scope {
return originalArrayType.environment.createArrayType(substitute.leafComponentType(), substitute.dimensions() + originalType.dimensions(), originalType.getTypeAnnotations());
}
break;
-
+
case Binding.WILDCARD_TYPE:
case Binding.INTERSECTION_TYPE:
WildcardBinding wildcard = (WildcardBinding) originalType;
@@ -711,7 +711,7 @@ public abstract class Scope {
}
return wildcard.environment.createWildcard(wildcard.genericType, wildcard.rank, substitutedBound, substitutedOtherBounds, wildcard.boundKind, wildcard.getTypeAnnotations());
}
- }
+ }
break;
case Binding.INTERSECTION_TYPE18:
@@ -732,7 +732,7 @@ public abstract class Scope {
if (isMemberTypeOfRaw(originalType, substitutedEnclosing))
return substitution.environment().createRawType(originalReferenceType, substitutedEnclosing, originalType.getTypeAnnotations());
}
-
+
// treat as if parameterized with its type variables (non generic type gets 'null' arguments)
if (substitutedEnclosing != originalEnclosing && originalReferenceType.hasEnclosingInstanceContext()) { //$IDENTITY-COMPARISON$
return substitution.isRawSubstitution()
@@ -745,12 +745,12 @@ public abstract class Scope {
originalEnclosing = originalType.enclosingType();
substitutedEnclosing = originalEnclosing;
if (originalEnclosing != null) {
- substitutedEnclosing = (ReferenceBinding) (originalType.isStatic() ? substitution.environment().convertToRawType(originalEnclosing, true) :
+ substitutedEnclosing = (ReferenceBinding) (originalType.isStatic() ? substitution.environment().convertToRawType(originalEnclosing, true) :
(ReferenceBinding) substitute(substitution, originalEnclosing));
if (isMemberTypeOfRaw(originalType, substitutedEnclosing))
return substitution.environment().createRawType(originalReferenceType, substitutedEnclosing, originalType.getTypeAnnotations());
}
-
+
if (substitution.isRawSubstitution()) {
return substitution.environment().createRawType(originalReferenceType, substitutedEnclosing, originalType.getTypeAnnotations());
}
@@ -761,20 +761,20 @@ public abstract class Scope {
}
return originalType;
}
-
+
private static boolean isMemberTypeOfRaw(TypeBinding originalType, ReferenceBinding substitutedEnclosing) {
// 4.8:
// "a raw type is defined to be one of:
// ...
- // * A non-static member type of a raw type R that is not
+ // * A non-static member type of a raw type R that is not
// inherited from a superclass or superinterface of R."
-
+
// Due to staticness, e.g., Map.Entry<String,Object> is *not* considered as a raw type
-
- return (substitutedEnclosing != null && substitutedEnclosing.isRawType())
+
+ return (substitutedEnclosing != null && substitutedEnclosing.isRawType())
&& ((originalType instanceof ReferenceBinding) && !((ReferenceBinding)originalType).isStatic());
}
-
+
/**
* Returns an array of types, where original types got substituted given a substitution.
* Only allocate an array if anything is different.
@@ -832,7 +832,7 @@ public abstract class Scope {
public boolean isLambdaScope() {
return false;
}
-
+
public boolean isLambdaSubscope() {
for (Scope scope = this; scope != null; scope = scope.parent) {
switch (scope.kind) {
@@ -863,11 +863,11 @@ public abstract class Scope {
* Internal use only
* Given a method, returns null if arguments cannot be converted to parameters.
* Will answer a substituted method in case the method was generic and type inference got triggered;
- * in case the method was originally compatible, then simply answer it back.
+ * in case the method was originally compatible, then simply answer it back.
*/
protected final MethodBinding computeCompatibleMethod(MethodBinding method, TypeBinding[] arguments, InvocationSite invocationSite) {
return computeCompatibleMethod(method, arguments, invocationSite, false);
- }
+ }
/**
* Internal use only
* Given a method, returns null if arguments cannot be converted to parameters.
@@ -946,7 +946,7 @@ public abstract class Scope {
}
return method;
}
- // if method is generic and type arguments have been supplied, only then answer a problem
+ // if method is generic and type arguments have been supplied, only then answer a problem
// of ParameterizedMethodTypeMismatch, else a non-generic method was invoked using type arguments
// in which case this problem category will be bogus
if (genericTypeArguments != null && typeVariables != Binding.NO_TYPE_VARIABLES)
@@ -1155,7 +1155,7 @@ public abstract class Scope {
//{ObjectTeams: TypeValueParameter has no 'binding':
if (!(typeParameters[i] instanceof TypeValueParameter))
// SH}
- typeParameters[i].binding.updateTagBits(); // <T extends List<U>, @NonNull U> --> tag T as having null type annotations
+ typeParameters[i].binding.updateTagBits(); // <T extends List<U>, @NonNull U> --> tag T as having null type annotations
return noProblems;
}
@@ -1262,13 +1262,13 @@ public abstract class Scope {
}
return null; // may answer null if no method around
}
-
+
public final MethodScope enclosingLambdaScope() {
Scope scope = this;
while ((scope = scope.parent) != null) {
if (scope instanceof MethodScope) {
MethodScope methodScope = (MethodScope) scope;
- if (methodScope.referenceContext instanceof LambdaExpression)
+ if (methodScope.referenceContext instanceof LambdaExpression)
return methodScope;
}
}
@@ -1325,9 +1325,9 @@ public abstract class Scope {
return ((CompilationUnitScope) unitScope).environment;
}
- /* Abstract method lookup (since maybe missing default abstract methods). "Default abstract methods" are methods that used to be emitted into
+ /* Abstract method lookup (since maybe missing default abstract methods). "Default abstract methods" are methods that used to be emitted into
abstract classes for unimplemented interface methods at JDK 1.1 time frame. See SourceTypeBinding.addDefaultAbstractMethods()
- See also https://bugs.eclipse.org/bugs/show_bug.cgi?id=174588 for details of problem addressed here. Problem was in the method call in the
+ See also https://bugs.eclipse.org/bugs/show_bug.cgi?id=174588 for details of problem addressed here. Problem was in the method call in the
*abstract* class. Unless the interface methods are looked up, we will emit code that results in infinite recursion.
*/
protected MethodBinding findDefaultAbstractMethod(
@@ -1347,13 +1347,13 @@ public abstract class Scope {
findMethodInSuperInterfaces(currentType, selector, found, visitedTypes, invocationSite);
currentType = currentType.superclass();
}
-
+
int candidatesCount = concreteMatches == null ? 0 : concreteMatches.length;
int foundSize = found.size;
MethodBinding[] candidates = new MethodBinding[foundSize - startFoundSize + candidatesCount];
if (concreteMatches != null)
System.arraycopy(concreteMatches, 0, candidates, 0, candidatesCount);
-
+
MethodBinding problemMethod = null;
if (foundSize > startFoundSize) {
// argument type compatibility check
@@ -1798,14 +1798,14 @@ public abstract class Scope {
}
}
return method;
- }
-
+ }
+
public MethodBinding findMethod0(ReferenceBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite, boolean inStaticContext) {
//{ObjectTeams: access to private method from "within" (need class part)?
if ( RoleTypeBinding.isRoleWithoutExplicitAnchor(receiverType)
|| (receiverType.isRole() && invocationSite.isTypeAccess()))
{
- ReferenceBinding enclosingType = this.enclosingSourceType();
+ ReferenceBinding enclosingType = this.enclosingSourceType();
if (isMethodMappingWrapper()) {
// retrieve the actual enclosing type of the mapping declaration:
for (ReferenceBinding declaringRole : MethodModel.getRoleHandledByThisWrapperMethod(methodScope().referenceMethod())) {
@@ -1964,7 +1964,7 @@ public abstract class Scope {
MethodBinding classMethod = (MethodBinding) found.elementAt(i);
if (!classMethod.isAbstract()) { // this check shouldn't matter, but to compatible with javac...
MethodBinding substitute = verifier.computeSubstituteMethod(original, classMethod);
- if (substitute != null && verifier.isSubstituteParameterSubsignature(classMethod, substitute))
+ if (substitute != null && verifier.isSubstituteParameterSubsignature(classMethod, substitute))
return new ProblemMethodBinding(interfaceMethod, selector, argumentTypes, ProblemReasons.ApplicableMethodOverriddenByInapplicable);
}
}
@@ -2040,7 +2040,7 @@ public abstract class Scope {
}
// SH}
}
-
+
switch (visiblesCount) {
case 0 :
MethodBinding interfaceMethod =
@@ -2527,24 +2527,24 @@ public abstract class Scope {
class MethodClashException extends RuntimeException {
private static final long serialVersionUID = -7996779527641476028L;
}
-
+
// For exact method references. 15.13.1
private MethodBinding getExactMethod(TypeBinding receiverType, TypeBinding type, char[] selector, InvocationSite invocationSite, MethodBinding candidate) {
if (type == null)
return null;
-
+
TypeBinding [] superInterfaces = type.superInterfaces();
TypeBinding [] typePlusSupertypes = new TypeBinding[2 + superInterfaces.length];
typePlusSupertypes[0] = type;
typePlusSupertypes[1] = type.superclass();
if (superInterfaces.length != 0)
System.arraycopy(superInterfaces, 0, typePlusSupertypes, 2, superInterfaces.length);
-
+
CompilationUnitScope unitScope = compilationUnitScope();
unitScope.recordTypeReference(type);
type = type.capture(this, invocationSite.sourceStart(), invocationSite.sourceEnd());
-
+
for (int i = 0, typesLength = typePlusSupertypes.length; i < typesLength; i++) {
MethodBinding[] methods = i == 0 ? type.getMethods(selector) : new MethodBinding [] { getExactMethod(receiverType, typePlusSupertypes[i], selector, invocationSite, candidate) };
for (int j = 0, length = methods.length; j < length; j++) {
@@ -2559,11 +2559,11 @@ public abstract class Scope {
} else {
candidate = currentMethod;
}
- }
+ }
}
return candidate;
}
-
+
// For exact method references. 15.13.1
public MethodBinding getExactMethod(TypeBinding receiverType, char[] selector, InvocationSite invocationSite) {
if (receiverType == null || !receiverType.isValidBinding() || receiverType.isBaseType())
@@ -2574,7 +2574,7 @@ public abstract class Scope {
return null;
currentType = getJavaLangObject();
}
-
+
MethodBinding exactMethod = null;
try {
exactMethod = getExactMethod(receiverType, currentType, selector, invocationSite, null);
@@ -2583,12 +2583,12 @@ public abstract class Scope {
}
if (exactMethod == null || !exactMethod.canBeSeenBy(invocationSite, this))
return null;
-
+
final TypeBinding[] typeArguments = invocationSite.genericTypeArguments();
TypeVariableBinding[] typeVariables = exactMethod.typeVariables();
if (exactMethod.isVarargs() || (typeVariables != Binding.NO_TYPE_VARIABLES && (typeArguments == null || typeArguments.length != typeVariables.length)))
return null;
-
+
if (receiverType.isArrayType()) {
if (CharOperation.equals(selector, TypeConstants.CLONE))
return ((ArrayBinding) receiverType).getCloneMethod(exactMethod);
@@ -2601,13 +2601,13 @@ public abstract class Scope {
{
return environment().createGetClassMethod(receiverType, exactMethod, this);
}
-
- if (typeVariables != Binding.NO_TYPE_VARIABLES)
+
+ if (typeVariables != Binding.NO_TYPE_VARIABLES)
return environment().createParameterizedGenericMethod(exactMethod, typeArguments);
-
+
return exactMethod;
}
-
+
// For exact constructor references. 15.13.1
public MethodBinding getExactConstructor(TypeBinding receiverType, InvocationSite invocationSite) {
if (receiverType == null || !receiverType.isValidBinding() || !receiverType.canBeInstantiated() || receiverType.isBaseType())
@@ -3138,7 +3138,7 @@ public abstract class Scope {
unitScope.recordQualifiedReference(TypeConstants.JAVA_LANG_INVOKE_LAMBDAMETAFACTORY);
return unitScope.environment.getResolvedJavaBaseType(TypeConstants.JAVA_LANG_INVOKE_LAMBDAMETAFACTORY, this);
}
-
+
public final ReferenceBinding getJavaLangInvokeSerializedLambda() {
CompilationUnitScope unitScope = compilationUnitScope();
unitScope.recordQualifiedReference(TypeConstants.JAVA_LANG_INVOKE_SERIALIZEDLAMBDA);
@@ -3180,13 +3180,13 @@ public abstract class Scope {
unitScope.recordQualifiedReference(TypeConstants.JAVA_LANG_THROWABLE);
return unitScope.environment.getResolvedJavaBaseType(TypeConstants.JAVA_LANG_THROWABLE, this);
}
-
+
public final ReferenceBinding getJavaLangIllegalArgumentException() {
CompilationUnitScope unitScope = compilationUnitScope();
unitScope.recordQualifiedReference(TypeConstants.JAVA_LANG_ILLEGALARGUMENTEXCEPTION);
return unitScope.environment.getResolvedJavaBaseType(TypeConstants.JAVA_LANG_ILLEGALARGUMENTEXCEPTION, this);
}
-
+
public final ReferenceBinding getJavaUtilIterator() {
CompilationUnitScope unitScope = compilationUnitScope();
unitScope.recordQualifiedReference(TypeConstants.JAVA_UTIL_ITERATOR);
@@ -3368,7 +3368,7 @@ public abstract class Scope {
Binding problemType(char[][] compoundName, int currentIndex, Binding previousProblem) {
if (previousProblem != null && previousProblem.problemId() != ProblemReasons.NotFound)
return previousProblem;
-
+
LookupEnvironment environment = environment();
if (environment.useModuleSystem && module() != environment.UnNamedModule) {
// try if the UnNamedModule can see the type:
@@ -3376,14 +3376,14 @@ public abstract class Scope {
if (notAccessibleType != null && notAccessibleType.isValidBinding())
return new ProblemReferenceBinding(compoundName, notAccessibleType, ProblemReasons.NotAccessible);
}
- return previousProblem != null
+ return previousProblem != null
? previousProblem
: new ProblemReferenceBinding(CharOperation.subarray(compoundName, 0, currentIndex), null, ProblemReasons.NotFound);
}
/* Answer the package from the compoundName or null if it begins with a type.
* Intended to be used while resolving a package name only.
- *
+ *
* Internal use only
*/
public final Binding getOnlyPackage(char[][] compoundName) {
@@ -3761,7 +3761,7 @@ public abstract class Scope {
}
}
}
- // In this location we had a fix for
+ // In this location we had a fix for
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=318401
// However, as of today (4.3M6 candidate) this fix seems unnecessary, while causing StackOverflowError in
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401271
@@ -4010,7 +4010,7 @@ public abstract class Scope {
if (two.declaringClass.isRawType()) continue next;
TypeBinding leafComponentType = two.original().parameters[i].leafComponentType();
- TypeBinding originalTwoParam = applyErasure ? leafComponentType.erasure() : leafComponentType;
+ TypeBinding originalTwoParam = applyErasure ? leafComponentType.erasure() : leafComponentType;
switch (originalTwoParam.kind()) {
case Binding.TYPE_PARAMETER :
if (((TypeVariableBinding) originalTwoParam).hasOnlyRawBounds())
@@ -4053,7 +4053,7 @@ public abstract class Scope {
}
if (one.isVarargs() && two.isVarargs()) {
- if (CompilerOptions.tolerateIllegalAmbiguousVarargsInvocation && this.compilerOptions().complianceLevel < ClassFileConstants.JDK1_7 &&
+ if (CompilerOptions.tolerateIllegalAmbiguousVarargsInvocation && this.compilerOptions().complianceLevel < ClassFileConstants.JDK1_7 &&
oneParamsLength > twoParamsLength) {
// special case when autoboxing makes (int, int...) better than (Object...) but not (int...) or (Integer, int...)
if (((ArrayBinding) twoParams[twoParamsLength - 1]).elementsType().id != TypeIds.T_JavaLangObject)
@@ -4069,7 +4069,7 @@ public abstract class Scope {
}
return false;
}
-
+
public boolean isBoxingCompatibleWith(TypeBinding expressionType, TypeBinding targetType) {
LookupEnvironment environment = environment();
if (environment.globalOptions.sourceLevel < ClassFileConstants.JDK1_5 || expressionType.isBaseType() == targetType.isBaseType())
@@ -4508,7 +4508,7 @@ public abstract class Scope {
} while (scope != null);
return null;
}
-
+
public final MethodScope namedMethodScope() {
Scope scope = this;
do {
@@ -4888,7 +4888,7 @@ public abstract class Scope {
Config.removeOrRestore(oldConfig, this);
}
// SH}
-
+
if (compatibleCount == 0) {
return new ProblemMethodBinding(visible[0].selector, argumentTypes, ProblemReasons.NotFound);
} else if (compatibleCount == 1) {
@@ -4901,16 +4901,16 @@ public abstract class Scope {
System.arraycopy(visible, 0, visible = new MethodBinding[visibleSize = compatibleCount], 0, compatibleCount);
System.arraycopy(compatibilityLevels, 0, compatibilityLevels = new int[compatibleCount], 0, compatibleCount);
}
-
-
+
+
MethodBinding[] moreSpecific = new MethodBinding[visibleSize];
if (isJdk18) {
// 15.12.2.5 Choosing the Most Specific Method
int count = 0;
-
+
nextJ: for (int j = 0; j < visibleSize; j++) {
MethodBinding mbj = visible[j].genericMethod();
- final TypeBinding[] mbjParameters = mbj.parameters;
+ final TypeBinding[] mbjParameters = mbj.parameters;
int levelj = compatibilityLevels[j];
nextK: for (int k = 0; k < visibleSize; k++) {
if (j == k) continue;
@@ -4922,18 +4922,18 @@ public abstract class Scope {
continue nextJ; // j cannot be more specific
}
//{ObjectTeams: one more reason for preferring one over the other:
- if (useTranslation[j] != useTranslation[k]) {
+ if (useTranslation[j] != useTranslation[k]) {
if (useTranslation[k])
continue nextK; // j is more specific than k
- else
- continue nextJ; // j cannot be more specific
+ else
+ continue nextJ; // j cannot be more specific
}
// SH}
MethodBinding mbk = visible[k].genericMethod();
final TypeBinding[] mbkParameters = mbk.parameters;
// TODO: should the following line also find diamond-typeVariables?
if (((invocationSite instanceof Invocation) || (invocationSite instanceof ReferenceExpression))
- && mbk.typeVariables() != Binding.NO_TYPE_VARIABLES)
+ && mbk.typeVariables() != Binding.NO_TYPE_VARIABLES)
{
// 18.5.4 More Specific Method Inference
Expression[] expressions = null;
@@ -4949,8 +4949,8 @@ public abstract class Scope {
} else {
for (int i = 0, length = argumentTypes.length; i < length; i++) {
TypeBinding argumentType = argumentTypes[i];
- TypeBinding s = InferenceContext18.getParameter(mbjParameters, i, levelj == VARARGS_COMPATIBLE);
- TypeBinding t = InferenceContext18.getParameter(mbkParameters, i, levelk == VARARGS_COMPATIBLE);
+ TypeBinding s = InferenceContext18.getParameter(mbjParameters, i, levelj == VARARGS_COMPATIBLE);
+ TypeBinding t = InferenceContext18.getParameter(mbkParameters, i, levelk == VARARGS_COMPATIBLE);
if (TypeBinding.equalsEquals(s, t))
continue;
if (!argumentType.sIsMoreSpecific(s,t, this)) {
@@ -4980,8 +4980,8 @@ public abstract class Scope {
}
} else {
- // JLS7 implementation
-
+ // JLS7 implementation
+
InvocationSite tieBreakInvocationSite = new InvocationSite() {
@Override
public TypeBinding[] genericTypeArguments() { return null; } // ignore genericTypeArgs
@@ -5025,7 +5025,7 @@ public abstract class Scope {
for (int j = 0; j < visibleSize; j++) {
if (i == j || compatibilityLevels[j] != level) continue;
//{ObjectTeams:
- if (!useTranslation[i] && useTranslation[j])
+ if (!useTranslation[i] && useTranslation[j])
continue;
// SH}
MethodBinding next = visible[j];
@@ -5034,7 +5034,7 @@ public abstract class Scope {
compatibilityLevels[j] = -1;
continue;
}
-
+
MethodBinding methodToTest = next;
if (next instanceof ParameterizedGenericMethodBinding) {
ParameterizedGenericMethodBinding pNext = (ParameterizedGenericMethodBinding) next;
@@ -5144,7 +5144,7 @@ public abstract class Scope {
if (next.original().typeVariables != Binding.NO_TYPE_VARIABLES) {
if (original.returnType.erasure().findSuperTypeOriginatingFrom(original2.returnType.erasure()) == null)
continue nextSpecific;
- } else if (!current.returnType.isCompatibleWith(next.returnType)) {
+ } else if (!current.returnType.isCompatibleWith(next.returnType)) {
continue nextSpecific;
}
// continue with original 15.12.2.5
@@ -5213,7 +5213,7 @@ public abstract class Scope {
if (i == j) continue;
if (TypeBinding.equalsEquals(currentException, allExceptions[j])) {
// duplicate same exception
- if (i < j)
+ if (i < j)
break; // take only the first occurrence
else
continue currents; // skip
@@ -5253,7 +5253,7 @@ public abstract class Scope {
} while (scope != null);
return lastMethodScope; // may answer null if no method around
}
-
+
// Version that just answers based on inference kind (at 1.8+) when available.
public int parameterCompatibilityLevel(MethodBinding method, TypeBinding[] arguments, InvocationSite site) {
if (method.problemId() == ProblemReasons.InvocationTypeInferenceFailure) {
@@ -5278,7 +5278,7 @@ public abstract class Scope {
}
/* 1.8+ Post inference compatibility check policy: For non-functional-type arguments, trust inference. For functional type arguments apply compatibility checks after inference
has completed to ensure arguments that were not pertinent to applicability which have only seen potential compatibility checks are actually compatible.
- */
+ */
if (site instanceof Invocation && context != null && context.stepCompleted >= InferenceContext18.TYPE_INFERRED) {
for (int i = 0, length = arguments.length; i < length; i++) {
TypeBinding argument = arguments[i];
@@ -5311,7 +5311,7 @@ public abstract class Scope {
public int parameterCompatibilityLevel(MethodBinding method, TypeBinding[] arguments) {
return parameterCompatibilityLevel(method, arguments, false);
- }
+ }
public int parameterCompatibilityLevel(MethodBinding method, TypeBinding[] arguments, boolean tiebreakingVarargsMethods) {
TypeBinding[] parameters = method.parameters;
int paramLength = parameters.length;
@@ -5398,16 +5398,16 @@ public abstract class Scope {
}
public int parameterCompatibilityLevel(TypeBinding arg, TypeBinding param) {
-
+
if (TypeBinding.equalsEquals(arg, param))
return COMPATIBLE;
-
+
if (arg == null || param == null)
return NOT_COMPATIBLE;
if (arg.isCompatibleWith(param, this))
return COMPATIBLE;
-
+
if (arg.kind() == Binding.POLY_TYPE || (arg.isBaseType() != param.isBaseType())) {
TypeBinding convertedType = environment().computeBoxingType(arg);
if (TypeBinding.equalsEquals(convertedType, param) || convertedType.isCompatibleWith(param, this))
@@ -5415,7 +5415,7 @@ public abstract class Scope {
}
return NOT_COMPATIBLE;
}
-
+
private int parameterCompatibilityLevel(TypeBinding arg, TypeBinding param, LookupEnvironment env, boolean tieBreakingVarargsMethods, MethodBinding method) {
// only called if env.options.sourceLevel >= ClassFileConstants.JDK1_5
if (arg == null || param == null)
@@ -5551,7 +5551,7 @@ public abstract class Scope {
} while ((current = current.parent) != null);
return null;
}
-
+
/**
* Returns the nearest original reference context, starting from current scope.
* If starting on a class, it will return current class. If starting on unitScope, returns unit.
@@ -5568,7 +5568,7 @@ public abstract class Scope {
expression = expression.original;
return expression;
}
- return context;
+ return context;
case CLASS_SCOPE :
return ((ClassScope) current).referenceContext;
case COMPILATION_UNIT_SCOPE :
@@ -5606,7 +5606,7 @@ public abstract class Scope {
could be found. This method is modeled after Scope.getConstructor and Scope.getMethod.
*/
public MethodBinding getStaticFactory (ParameterizedTypeBinding allocationType, ReferenceBinding originalEnclosingType, TypeBinding[] argumentTypes, final InvocationSite allocationSite) {
-
+
// allocationType is the diamond type. originalEnclosingType is the real enclosing type ==> may be parameterized, parameterized with own type variables, raw, just plain type or null.
int classTypeVariablesArity = 0;
TypeVariableBinding[] classTypeVariables = Binding.NO_TYPE_VARIABLES;
@@ -5619,14 +5619,14 @@ public abstract class Scope {
System.arraycopy(classTypeVariables, 0, classTypeVariables = new TypeVariableBinding[classTypeVariablesArity + length], 0, classTypeVariablesArity);
System.arraycopy(typeVariables, 0, classTypeVariables, classTypeVariablesArity, length);
classTypeVariablesArity += length;
- }
+ }
if (currentType.isStatic()) // any enclosing types cannot be parameterized, if generic treat as raw.
break;
currentType = currentType.enclosingType();
}
boolean isInterface = allocationType.isInterface();
ReferenceBinding typeToSearch = isInterface ? getJavaLangObject() : allocationType;
-
+
MethodBinding[] methods = typeToSearch.getMethods(TypeConstants.INIT, argumentTypes.length);
MethodBinding [] staticFactories = new MethodBinding[methods.length];
int sfi = 0;
@@ -5634,13 +5634,13 @@ public abstract class Scope {
MethodBinding method = methods[i];
if (!method.canBeSeenBy(allocationSite, this))
continue;
-
+
int paramLength = method.parameters.length;
boolean isVarArgs = method.isVarargs();
if (argumentTypes.length != paramLength)
if (!isVarArgs || argumentTypes.length < paramLength - 1)
continue; // incompatible
-
+
TypeVariableBinding[] methodTypeVariables = method.typeVariables();
int methodTypeVariablesArity = methodTypeVariables.length;
final int factoryArity = classTypeVariablesArity + methodTypeVariablesArity;
@@ -5649,7 +5649,7 @@ public abstract class Scope {
MethodBinding staticFactory = new SyntheticFactoryMethodBinding(targetMethod, environment, originalEnclosingType);
staticFactory.typeVariables = new TypeVariableBinding[factoryArity];
final SimpleLookupTable map = new SimpleLookupTable(factoryArity);
-
+
// Rename each type variable T of the type to T' or T'' or T''' based on the enclosing level to avoid a clash.
String prime = ""; //$NON-NLS-1$
Binding declaringElement = null;
@@ -5666,7 +5666,7 @@ public abstract class Scope {
// Rename each type variable U of method
prime += "'"; //$NON-NLS-1$
for (int j = classTypeVariablesArity, k = 0; j < factoryArity; j++, k++) {
- map.put(methodTypeVariables[k].unannotated(),
+ map.put(methodTypeVariables[k].unannotated(),
(staticFactory.typeVariables[j] = new TypeVariableBinding(CharOperation.concat(methodTypeVariables[k].sourceName, prime.toCharArray()),
staticFactory, j, environment)));
@@ -5699,7 +5699,7 @@ public abstract class Scope {
for (int j = 0; j < factoryArity; j++) {
TypeVariableBinding originalVariable = j < classTypeVariablesArity ? classTypeVariables[j] : methodTypeVariables[j - classTypeVariablesArity];
TypeVariableBinding substitutedVariable = (TypeVariableBinding) map.get(originalVariable.unannotated());
-
+
TypeBinding substitutedSuperclass = Scope.substitute(substitution, originalVariable.superclass);
ReferenceBinding[] substitutedInterfaces = Scope.substitute(substitution, originalVariable.superInterfaces);
if (originalVariable.firstBound != null) {
@@ -5730,7 +5730,7 @@ public abstract class Scope {
staticFactory.returnType = environment.createParameterizedType(genericType, Scope.substitute(substitution, genericType.typeVariables()), originalEnclosingType);
staticFactory.parameters = Scope.substitute(substitution, method.parameters);
staticFactory.thrownExceptions = Scope.substitute(substitution, method.thrownExceptions);
- if (staticFactory.thrownExceptions == null) {
+ if (staticFactory.thrownExceptions == null) {
staticFactory.thrownExceptions = Binding.NO_EXCEPTIONS;
}
staticFactories[sfi++] = new ParameterizedMethodBinding((ParameterizedTypeBinding) environment.convertToParameterizedType(isInterface ? allocationType : staticFactory.declaringClass),
@@ -5770,7 +5770,7 @@ public abstract class Scope {
} else {
nullAnnotationTagBit = tagBits & (TagBits.AnnotationNullMASK);
}
-
+
if (nullAnnotationTagBit != 0) {
if (type != null && type.isBaseType()) {
// type annotations are *always* illegal for 'void' (already reported)
@@ -5787,7 +5787,7 @@ public abstract class Scope {
* Record a NNBD annotation applying to a given source range within the current scope
* @param target the annotated element
* @param value bitset describing the default nullness (see Binding.NullnessDefaultMASK)
- * @param annotation the NNBD annotation
+ * @param annotation the NNBD annotation
* @param scopeStart start of the source range affected by the default
* @param scopeEnd end of the source range affected by the default
* @return <code>true</code> if the annotation was newly recorded, <code>false</code> if a corresponding entry already existed.
@@ -5796,7 +5796,7 @@ public abstract class Scope {
ReferenceContext context = referenceContext();
if (context instanceof LambdaExpression && context != ((LambdaExpression) context).original)
return false; // Do not record from copies. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=441929
-
+
if (this.nullDefaultRanges == null) {
this.nullDefaultRanges=new ArrayList<>(3);
}
@@ -5820,7 +5820,7 @@ public abstract class Scope {
* @param nullBits locally defined nullness default, see Binding.NullnessDefaultMASK
* @param sourceStart
* @return enclosing binding that already has a matching NonNullByDefault annotation,
- * or the special binding {@link #NOT_REDUNDANT}, indicating that a different enclosing nullness default was found,
+ * or the special binding {@link #NOT_REDUNDANT}, indicating that a different enclosing nullness default was found,
* or null to indicate that no enclosing nullness default was found.
*/
public Binding checkRedundantDefaultNullness(int nullBits, int sourceStart) {
@@ -5889,7 +5889,7 @@ public abstract class Scope {
}
return resolutionScope;
}
- // Some entity in the receiver scope is referencing instance data of enclosing type. Tag all intervening methods as instance methods.
+ // Some entity in the receiver scope is referencing instance data of enclosing type. Tag all intervening methods as instance methods.
public void tagAsAccessingEnclosingInstanceStateOf(ReferenceBinding enclosingType, boolean typeVariableAccess) {
MethodScope methodScope = methodScope();
if (methodScope != null && methodScope.referenceContext instanceof TypeDeclaration) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceModuleBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceModuleBinding.java
index 76d92b283..f3c93ae7f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceModuleBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceModuleBinding.java
@@ -46,7 +46,7 @@ public class SourceModuleBinding extends ModuleBinding {
this.requires = merge(this.requires, requires, javaBase, ModuleBinding[]::new);
this.requiresTransitive = merge(this.requiresTransitive, requiresTransitive, null, ModuleBinding[]::new);
}
-
+
public void setUses(TypeBinding[] uses) {
this.uses = merge(this.uses, uses, null, TypeBinding[]::new);
}
@@ -56,13 +56,13 @@ public class SourceModuleBinding extends ModuleBinding {
resolveTypes();
return super.getUses();
}
-
+
@Override
public TypeBinding[] getServices() {
resolveTypes();
return super.getServices();
}
-
+
@Override
public TypeBinding[] getImplementations(TypeBinding binding) {
resolveTypes();
@@ -103,7 +103,7 @@ public class SourceModuleBinding extends ModuleBinding {
System.arraycopy(two, 0, result, len0+len1, len2);
return result;
}
-
+
@Override
Stream<ModuleBinding> getRequiredModules(boolean transitiveOnly) {
// don't rely on "if (this.requires == NO_MODULES)" - could have been modified by completeIfNeeded()
@@ -157,7 +157,7 @@ public class SourceModuleBinding extends ModuleBinding {
@Override
SimpleLookupTable storedAnnotations(boolean forceInitialize, boolean forceStore) {
if (this.scope != null) { // scope null when no annotation cached, and module got processed fully (159631)
- SimpleLookupTable annotationTable = super.storedAnnotations(forceInitialize, forceStore);
+ SimpleLookupTable annotationTable = super.storedAnnotations(forceInitialize, forceStore);
if (annotationTable != null)
this.scope.referenceCompilationUnit().compilationResult.hasAnnotations = true;
return annotationTable;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
index 3625f7ac8..1ff49a565 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
@@ -194,7 +194,7 @@ public class SourceTypeBinding extends ReferenceBinding {
protected SourceTypeBinding() { super(); this.prototype = this; } // default ctor for Singleton membertypes NoBaseclass, ProblemBaseclass
//Markus Witte}
-
+
private SimpleLookupTable storedAnnotations = null; // keys are this ReferenceBinding & its fields and methods, value is an AnnotationHolder
public int defaultNullness;
@@ -203,7 +203,7 @@ public class SourceTypeBinding extends ReferenceBinding {
private ReferenceBinding containerAnnotationType = null;
public ExternalAnnotationProvider externalAnnotationProvider;
-
+
private SourceTypeBinding nestHost;
public HashSet<SourceTypeBinding> nestMembers;
@@ -241,11 +241,11 @@ public SourceTypeBinding(char[][] compoundName, PackageBinding fPackage, ClassSc
public SourceTypeBinding(SourceTypeBinding prototype) {
super(prototype);
-
+
this.prototype = prototype.prototype;
this.prototype.tagBits |= TagBits.HasAnnotatedVariants;
this.tagBits &= ~TagBits.HasAnnotatedVariants;
-
+
this.superclass = prototype.superclass;
this.superInterfaces = prototype.superInterfaces;
this.fields = prototype.fields;
@@ -264,7 +264,7 @@ public SourceTypeBinding(SourceTypeBinding prototype) {
this.containerAnnotationType = prototype.containerAnnotationType;
this.tagBits |= TagBits.HasUnresolvedMemberTypes; // see memberTypes()
this.isRecordDeclaration = this.prototype.isRecordDeclaration;
-
+
//{ObjectTeams: team?
if (prototype._teamModel != null)
setTeamModel(new TeamModel(this));
@@ -272,9 +272,9 @@ public SourceTypeBinding(SourceTypeBinding prototype) {
}
private void addDefaultAbstractMethods() {
-
+
if (!isPrototype()) throw new IllegalStateException();
-
+
if ((this.tagBits & TagBits.KnowsDefaultAbstractMethods) != 0) return;
this.tagBits |= TagBits.KnowsDefaultAbstractMethods;
@@ -353,9 +353,9 @@ private void addDefaultAbstractMethods() {
* Answer the new field or the existing field if one already existed.
*/
public FieldBinding addSyntheticFieldForInnerclass(LocalVariableBinding actualOuterLocalVariable) {
-
+
if (!isPrototype()) throw new IllegalStateException();
-
+
if (this.synthetics == null)
this.synthetics = new HashMap[MAX_SYNTHETICS];
if (this.synthetics[SourceTypeBinding.FIELD_EMUL] == null)
@@ -402,9 +402,9 @@ public FieldBinding addSyntheticFieldForInnerclass(LocalVariableBinding actualOu
* Answer the new field or the existing field if one already existed.
*/
public FieldBinding addSyntheticFieldForInnerclass(ReferenceBinding enclosingType) {
-
+
if (!isPrototype()) throw new IllegalStateException();
-
+
if (this.synthetics == null)
this.synthetics = new HashMap[MAX_SYNTHETICS];
if (this.synthetics[SourceTypeBinding.FIELD_EMUL] == null)
@@ -523,9 +523,9 @@ final public void computeValueParameterSlotSizes() {
* Answer the new field or the existing field if one already existed.
*/
public FieldBinding addSyntheticFieldForClassLiteral(TypeBinding targetType, BlockScope blockScope) {
-
+
if (!isPrototype()) throw new IllegalStateException();
-
+
if (this.synthetics == null)
this.synthetics = new HashMap[MAX_SYNTHETICS];
if (this.synthetics[SourceTypeBinding.CLASS_LITERAL_EMUL] == null)
@@ -565,9 +565,9 @@ public FieldBinding addSyntheticFieldForClassLiteral(TypeBinding targetType, Blo
* Answer the new field or the existing field if one already existed.
*/
public FieldBinding addSyntheticFieldForAssert(BlockScope blockScope) {
-
+
if (!isPrototype()) throw new IllegalStateException();
-
+
if (this.synthetics == null)
this.synthetics = new HashMap[MAX_SYNTHETICS];
if (this.synthetics[SourceTypeBinding.FIELD_EMUL] == null)
@@ -854,7 +854,7 @@ public SyntheticMethodBinding addSyntheticMethodForEnumInitialization(int begin,
this.synthetics[SourceTypeBinding.METHOD_EMUL] = new HashMap(5);
SyntheticMethodBinding accessMethod = new SyntheticMethodBinding(this, begin, end);
- SyntheticMethodBinding[] accessors = new SyntheticMethodBinding[2];
+ SyntheticMethodBinding[] accessors = new SyntheticMethodBinding[2];
this.synthetics[SourceTypeBinding.METHOD_EMUL].put(accessMethod.selector, accessors);
accessors[0] = accessMethod;
return accessMethod;
@@ -865,7 +865,7 @@ public SyntheticMethodBinding addSyntheticMethod(LambdaExpression lambda) {
this.synthetics = new HashMap[MAX_SYNTHETICS];
if (this.synthetics[SourceTypeBinding.METHOD_EMUL] == null)
this.synthetics[SourceTypeBinding.METHOD_EMUL] = new HashMap(5);
-
+
SyntheticMethodBinding lambdaMethod = null;
SyntheticMethodBinding[] lambdaMethods = (SyntheticMethodBinding[]) this.synthetics[SourceTypeBinding.METHOD_EMUL].get(lambda);
if (lambdaMethods == null) {
@@ -875,18 +875,18 @@ public SyntheticMethodBinding addSyntheticMethod(LambdaExpression lambda) {
} else {
lambdaMethod = lambdaMethods[0];
}
-
+
// Create a $deserializeLambda$ method if necessary, one is shared amongst all lambdas
if (lambda.isSerializable) {
addDeserializeLambdaMethod();
}
-
+
return lambdaMethod;
}
/*
* Add a synthetic method for the reference expression as a place holder for code generation
- * only if the reference expression's target is serializable
- *
+ * only if the reference expression's target is serializable
+ *
*/
public SyntheticMethodBinding addSyntheticMethod(ReferenceExpression ref) {
if (!isPrototype()) throw new IllegalStateException();
@@ -896,7 +896,7 @@ public SyntheticMethodBinding addSyntheticMethod(ReferenceExpression ref) {
this.synthetics = new HashMap[MAX_SYNTHETICS];
if (this.synthetics[SourceTypeBinding.METHOD_EMUL] == null)
this.synthetics[SourceTypeBinding.METHOD_EMUL] = new HashMap(5);
-
+
SyntheticMethodBinding lambdaMethod = null;
SyntheticMethodBinding[] lambdaMethods = (SyntheticMethodBinding[]) this.synthetics[SourceTypeBinding.METHOD_EMUL].get(ref);
if (lambdaMethods == null) {
@@ -908,7 +908,7 @@ public SyntheticMethodBinding addSyntheticMethod(ReferenceExpression ref) {
}
// Create a $deserializeLambda$ method, one is shared amongst all lambdas
- addDeserializeLambdaMethod();
+ addDeserializeLambdaMethod();
return lambdaMethod;
}
private void addDeserializeLambdaMethod() {
@@ -982,7 +982,7 @@ public SyntheticMethodBinding addSyntheticBaseCallSurrogate(MethodBinding callin
accessors[1] = accessMethod;
}
}
- return accessMethod;
+ return accessMethod;
}
// bridges towards a private role method
public SyntheticMethodBinding addSyntheticRoleMethodBridge(SourceTypeBinding declaringRole, ReferenceBinding originalRole, MethodBinding targetMethod, int bridgeKind) {
@@ -997,7 +997,7 @@ public SyntheticMethodBinding addSyntheticRoleMethodBridge(SourceTypeBinding dec
accessMethod = new SyntheticRoleBridgeMethodBinding(declaringRole, originalRole, targetMethod, bridgeKind);
this.synthetics[SourceTypeBinding.ROLE_BRIDGE].put(targetMethod, accessMethod);
}
- return accessMethod;
+ return accessMethod;
}
// and retrieve an existing accessor:
public SyntheticMethodBinding findOuterRoleMethodSyntheticAccessor(MethodBinding targetMethod) {
@@ -1007,7 +1007,7 @@ public SyntheticMethodBinding findOuterRoleMethodSyntheticAccessor(MethodBinding
if (accessor != null) {
if (accessor.isStatic() && isRole())
return ((SourceTypeBinding)enclosingType()).findOuterRoleMethodSyntheticAccessor(accessor);
- else
+ else
return accessor;
}
}
@@ -1378,14 +1378,14 @@ private void internalFaultInTypeForFieldsAndMethods() {
// NOTE: the type of each field of a source type is resolved when needed
@Override
public FieldBinding[] fields() {
-
+
if (!isPrototype()) {
if ((this.tagBits & TagBits.AreFieldsComplete) != 0)
return this.fields;
this.tagBits |= TagBits.AreFieldsComplete;
return this.fields = this.prototype.fields();
}
-
+
if ((this.tagBits & TagBits.AreFieldsComplete) != 0)
return this.fields;
@@ -1402,11 +1402,11 @@ public FieldBinding[] fields() {
FieldBinding[] fieldsSnapshot = this.fields;
for (int i = 0, length = fieldsSnapshot.length; i < length; i++) {
//{ObjectTeams: check discouraged field in @Instantation(ALWAYS) roles:
- if ( this.scope != null
- && (this.tagBits & TagBits.AnnotationInstantiation) != 0
+ if ( this.scope != null
+ && (this.tagBits & TagBits.AnnotationInstantiation) != 0
&& !fieldsSnapshot[i].isStatic())
this.scope.problemReporter().fieldInRoleWithInstantiationPolicy(this, fieldsSnapshot[i]);
-
+
// after compilation is finished we have no scope, can't resolve any better
// resolveTypeFor would NPE!
if ( this.model!=null
@@ -1452,7 +1452,7 @@ public FieldBinding[] fields() {
public char[] genericTypeSignature() {
if (!isPrototype())
return this.prototype.genericTypeSignature();
-
+
if (this.genericReferenceTypeSignature == null)
this.genericReferenceTypeSignature = computeGenericTypeSignature(this.typeVariables);
return this.genericReferenceTypeSignature;
@@ -1464,7 +1464,7 @@ public char[] genericTypeSignature() {
public char[] genericSignature() {
if (!isPrototype())
return this.prototype.genericSignature();
-
+
StringBuffer sig = null;
if (this.typeVariables != Binding.NO_TYPE_VARIABLES) {
sig = new StringBuffer(10);
@@ -1494,7 +1494,7 @@ public char[] genericSignature() {
/**
* Compute the tagbits for standard annotations. For source types, these could require
* lazily resolving corresponding annotation nodes, in case of forward references.
- * For type use bindings, this method still returns the tagbits corresponding to the type
+ * For type use bindings, this method still returns the tagbits corresponding to the type
* declaration binding.
* @see org.eclipse.jdt.internal.compiler.lookup.Binding#getAnnotationTagBits()
*/
@@ -1502,7 +1502,7 @@ public char[] genericSignature() {
public long getAnnotationTagBits() {
if (!isPrototype())
return this.prototype.getAnnotationTagBits();
-
+
if ((this.tagBits & TagBits.AnnotationResolved) == 0 && this.scope != null) {
if ((this.tagBits & TagBits.EndHierarchyCheck) == 0) {
CompilationUnitScope pkgCUS = this.scope.compilationUnitScope();
@@ -1527,7 +1527,7 @@ private void initAnnotationTagBits() {
ASTNode.resolveAnnotations(typeDecl.staticInitializerScope, typeDecl.annotations, this);
} finally {
typeDecl.staticInitializerScope.insideTypeAnnotation = old;
-//{ObjectTeams: @Instantation can only be applied to role classes
+//{ObjectTeams: @Instantation can only be applied to role classes
if ( (this.tagBits & TagBits.AnnotationInstantiation) != 0
&& (!isRole() || isInterface()))
this.scope.problemReporter().instantiationAnnotationInNonRole(typeDecl);
@@ -1539,7 +1539,7 @@ private void initAnnotationTagBits() {
public MethodBinding[] getDefaultAbstractMethods() {
if (!isPrototype())
return this.prototype.getDefaultAbstractMethods();
-
+
int count = 0;
for (int i = this.methods.length; --i >= 0;)
if (this.methods[i].isDefaultAbstract())
@@ -1558,7 +1558,7 @@ public MethodBinding[] getDefaultAbstractMethods() {
public MethodBinding getExactConstructor(TypeBinding[] argumentTypes) {
if (!isPrototype())
return this.prototype.getExactConstructor(argumentTypes);
-
+
int argCount = argumentTypes.length;
if ((this.tagBits & TagBits.AreMethodsComplete) != 0) { // have resolved all arg types & return type of the methods
long range;
@@ -1614,7 +1614,7 @@ public MethodBinding getExactConstructor(TypeBinding[] argumentTypes) {
public MethodBinding getExactMethod(char[] selector, TypeBinding[] argumentTypes, CompilationUnitScope refScope) {
if (!isPrototype())
return this.prototype.getExactMethod(selector, argumentTypes, refScope);
-
+
// sender from refScope calls recordTypeReference(this)
int argCount = argumentTypes.length;
boolean foundNothing = true;
@@ -1711,7 +1711,7 @@ public MethodBinding getExactMethod(char[] selector, TypeBinding[] argumentTypes
//NOTE: the type of a field of a source type is resolved when needed
@Override
public FieldBinding getField(char[] fieldName, boolean needResolve) {
-
+
if (!isPrototype())
return this.prototype.getField(fieldName, needResolve);
//{ObjectTeams: could be called before fields are present
@@ -1720,7 +1720,7 @@ public FieldBinding getField(char[] fieldName, boolean needResolve) {
if (this.fields == Binding.UNINITIALIZED_FIELDS)
return null;
// SH}
-
+
if ((this.tagBits & TagBits.AreFieldsComplete) != 0)
return ReferenceBinding.binarySearch(fieldName, this.fields);
@@ -1803,7 +1803,7 @@ public FieldBinding getField(char[] fieldName, boolean needResolve) {
public MethodBinding[] getMethods(char[] selector) {
if (!isPrototype())
return this.prototype.getMethods(selector);
-
+
if ((this.tagBits & TagBits.AreMethodsComplete) != 0) {
long range;
if ((range = ReferenceBinding.binarySearch(selector, this.methods)) >= 0) {
@@ -2109,7 +2109,7 @@ void initializeForStaticImports() {
@Override
int getNullDefault() {
-
+
if (!isPrototype()) {
return this.prototype.getNullDefault();
}
@@ -2133,7 +2133,7 @@ int getNullDefault() {
public boolean isEquivalentTo(TypeBinding otherType) {
if (!isPrototype())
return this.prototype.isEquivalentTo(otherType);
-
+
if (TypeBinding.equalsEquals(this, otherType)) return true;
if (otherType == null) return false;
switch(otherType.kind()) {
@@ -2200,7 +2200,7 @@ public boolean isTaggedRepeatable() { // tagged but not necessarily repeatable.
@Override
public boolean canBeSeenBy(Scope sco) {
SourceTypeBinding invocationType = sco.enclosingSourceType();
- if (TypeBinding.equalsEquals(invocationType, this))
+ if (TypeBinding.equalsEquals(invocationType, this))
return true;
return ((this.environment.canTypeBeAccessed(this, sco)) &&
super.canBeSeenBy(sco));
@@ -2294,14 +2294,14 @@ private int getImplicitMethod(char[] name) {
// NOTE: the return type, arg & exception types of each method of a source type are resolved when needed
@Override
public MethodBinding[] methods() {
-
+
if (!isPrototype()) {
if ((this.tagBits & TagBits.AreMethodsComplete) != 0)
return this.methods;
this.tagBits |= TagBits.AreMethodsComplete;
return this.methods = this.prototype.methods();
}
-
+
if ((this.tagBits & TagBits.AreMethodsComplete) != 0)
return this.methods;
@@ -2381,7 +2381,7 @@ public MethodBinding[] methods() {
if (complyTo15OrAbove) {
if (method.areParameterErasuresEqual(method2)) {
- // we now ignore return types in 1.7 when detecting duplicates, just as we did before 1.5
+ // we now ignore return types in 1.7 when detecting duplicates, just as we did before 1.5
// Only in 1.6, we have to make sure even return types are different
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=317719
if (compliance16 && method.returnType != null && method2.returnType != null) {
@@ -2443,7 +2443,7 @@ public MethodBinding[] methods() {
break;
}
}
-
+
}
if (index >= 0) {
// erasure of neither is equal to signature of other
@@ -2569,7 +2569,7 @@ public MethodBinding[] methods() {
}
private void checkRecordCanonicalConstructor(MethodBinding explicitCanonicalConstructor) {
-
+
AbstractMethodDeclaration methodDecl = explicitCanonicalConstructor.sourceMethod();
if (!explicitCanonicalConstructor.isPublic())
this.scope.problemReporter().recordCanonicalConstructorNotPublic(methodDecl);
@@ -2627,9 +2627,9 @@ public boolean isRecord() {
@Override
public ReferenceBinding containerAnnotationType() {
-
+
if (!isPrototype()) throw new IllegalStateException();
-
+
if (this.containerAnnotationType instanceof UnresolvedReferenceBinding) {
this.containerAnnotationType = (ReferenceBinding)BinaryTypeBinding.resolveType(this.containerAnnotationType, this.scope.environment(), false);
}
@@ -2637,7 +2637,7 @@ public ReferenceBinding containerAnnotationType() {
}
public FieldBinding resolveTypeFor(FieldBinding field) {
-
+
if (!isPrototype())
return this.prototype.resolveTypeFor(field);
@@ -2731,7 +2731,7 @@ public FieldBinding resolveTypeFor(FieldBinding field) {
if (fieldDecls[f].getKind() != AbstractVariableDeclaration.ENUM_CONSTANT) {
if (fieldDecls[f].type == null) // should not happen for non-enum types
throw new InternalCompilerError("Field "+fieldDecls[f]+" has no type in "+this);
-
+
field.copyInheritanceSrc = fieldDecls[f].copyInheritanceSrc;
field.maybeSetFieldTypeAnchorAttribute();
// anchored to tthis?
@@ -2743,9 +2743,9 @@ public FieldBinding resolveTypeFor(FieldBinding field) {
}
}
// need role field bridges?
- if ( isRole()
- && ((field.modifiers & ClassFileConstants.AccPrivate) != 0)
- && !CharOperation.prefixEquals(IOTConstants.OT_DOLLAR_NAME, field.name))
+ if ( isRole()
+ && ((field.modifiers & ClassFileConstants.AccPrivate) != 0)
+ && !CharOperation.prefixEquals(IOTConstants.OT_DOLLAR_NAME, field.name))
{
MethodBinding inner;
ReferenceBinding originalRole = field.declaringClass;
@@ -2798,7 +2798,7 @@ private MethodBinding resolveTypesWithSuspendedTempErrorHandlingPolicy(MethodBin
// SH}
if (!isPrototype())
return this.prototype.resolveTypesFor(method);
-
+
if ((method.modifiers & ExtraCompilerModifiers.AccUnresolved) == 0)
return method;
//{ObjectTeams: in state final we lost the scope, cannot use code below any more.
@@ -2889,7 +2889,7 @@ private MethodBinding resolveTypesWithSuspendedTempErrorHandlingPolicy(MethodBin
if (count < size)
System.arraycopy(method.thrownExceptions, 0, method.thrownExceptions = new ReferenceBinding[count], 0, count);
}
-
+
if (methodDecl.receiver != null) {
method.receiver = methodDecl.receiver.type.resolveType(methodDecl.scope, true /* check bounds*/);
}
@@ -2937,14 +2937,14 @@ private MethodBinding resolveTypesWithSuspendedTempErrorHandlingPolicy(MethodBin
// check if this argument was checked early as a type anchor for another argument:
try {
ASTNode.handleNonNullByDefault(methodDecl.scope, arg.annotations, arg);
- parameterType =
- (anchorFlags[i] && arg.type.resolvedType.isValidBinding()) ?
+ parameterType =
+ (anchorFlags[i] && arg.type.resolvedType.isValidBinding()) ?
arg.type.resolvedType :
arg.type.resolveType(methodDecl.scope, true /* check bounds*/);
// orig:
// parameterType = arg.type.resolveType(methodDecl.scope, true /* check bounds*/);
} finally {
- if (deferRawTypeCheck) {
+ if (deferRawTypeCheck) {
arg.type.bits &= ~ASTNode.IgnoreRawTypeCheck;
}
}
@@ -2978,12 +2978,12 @@ private MethodBinding resolveTypesWithSuspendedTempErrorHandlingPolicy(MethodBin
if (parameterType != null && !parameterType.isValidBinding() && ((parameterType.tagBits & TagBits.HasMissingType) == 0))
foundArgProblem = true;
// SH}
-
+
if (parameterType == null) {
foundArgProblem = true;
} else if (parameterType == TypeBinding.VOID) {
- if (this.isRecordDeclaration &&
- methodDecl instanceof ConstructorDeclaration &&
+ if (this.isRecordDeclaration &&
+ methodDecl instanceof ConstructorDeclaration &&
((methodDecl.bits & ASTNode.IsImplicit) != 0)) {
// do nothing - already raised for record component.
} else
@@ -2999,7 +2999,7 @@ private MethodBinding resolveTypesWithSuspendedTempErrorHandlingPolicy(MethodBin
newParameters[i] = parameterType;
if (checkAPIleak)
methodDecl.scope.detectAPILeaks(arg.type, parameterType);
-//{ObjectTeams: don't overwrite existing binding (only fill in detail)
+//{ObjectTeams: don't overwrite existing binding (only fill in detail)
// Note: possibly a binding has been created along this call chain:
// TypeParameter.connectTypeAnchors() -> TypeAnchorReference.[resolveType()->findVariable()] -> RoleTypeCreator.resolveTypeAnchoredToArgument() -> Argument.bind()
if (arg.binding != null)
@@ -3020,7 +3020,7 @@ private MethodBinding resolveTypesWithSuspendedTempErrorHandlingPolicy(MethodBin
if ((method.tagBits & TagBits.AnnotationSafeVarargs) != 0) {
if (!method.isVarargs()) {
methodDecl.scope.problemReporter().safeVarargsOnFixedArityMethod(method);
- } else if (!method.isStatic() && !method.isFinal() && !method.isConstructor()
+ } else if (!method.isStatic() && !method.isFinal() && !method.isConstructor()
&& !(sourceLevel >= ClassFileConstants.JDK9 && method.isPrivate())) {
methodDecl.scope.problemReporter().safeVarargsOnNonFinalInstanceMethod(method);
}
@@ -3055,7 +3055,7 @@ private MethodBinding resolveTypesWithSuspendedTempErrorHandlingPolicy(MethodBin
try {
methodType = returnType.resolveType(methodDecl.scope, true /* check bounds*/);
} finally {
- if (deferRawTypeCheck) {
+ if (deferRawTypeCheck) {
returnType.bits &= ~ASTNode.IgnoreRawTypeCheck;
}
}
@@ -3155,7 +3155,7 @@ private MethodBinding resolveTypesWithSuspendedTempErrorHandlingPolicy(MethodBin
}
//{ObjectTeams: need role method bridges?
int abstractStatic = ClassFileConstants.AccAbstract | ClassFileConstants.AccStatic;
- if ( isRole()
+ if ( isRole()
&& ( (method.modifiers & ClassFileConstants.AccPrivate) != 0
|| ((method.modifiers & abstractStatic) == abstractStatic) && !method.declaringClass.isInterface())
&& !CharOperation.prefixEquals(IOTConstants.OT_DOLLAR_NAME, method.selector)
@@ -3187,7 +3187,7 @@ private static void rejectTypeAnnotatedVoidMethod(AbstractMethodDeclaration meth
}
private void createArgumentBindings(MethodBinding method, CompilerOptions compilerOptions) {
-
+
if (!isPrototype()) throw new IllegalStateException();
if (compilerOptions.isAnnotationBasedNullAnalysisEnabled)
getNullDefault(); // ensure initialized
@@ -3204,9 +3204,9 @@ private void createArgumentBindings(MethodBinding method, CompilerOptions compil
}
public void evaluateNullAnnotations() {
-
+
if (!isPrototype()) throw new IllegalStateException();
-
+
if (this.nullnessDefaultInitialized > 0 || !this.scope.compilerOptions().isAnnotationBasedNullAnalysisEnabled)
return;
@@ -3279,9 +3279,9 @@ private void maybeMarkTypeParametersNonNull() {
@Override
boolean hasNonNullDefaultFor(int location, int sourceStart) {
-
+
if (!isPrototype()) throw new IllegalStateException();
-
+
if (this.scope == null) {
return (this.defaultNullness & location) != 0;
}
@@ -3345,7 +3345,7 @@ public void tagAsHavingDefectiveContainerType() {
// Propagate writes to all annotated variants so the clones evolve along.
public FieldBinding [] setFields(FieldBinding[] fields) {
-
+
if (!isPrototype())
return this.prototype.setFields(fields);
@@ -3371,7 +3371,7 @@ public FieldBinding [] setFields(FieldBinding[] fields) {
// We need to specialize member types, can't just propagate. Can't specialize here, clones could created post setMemberTypes()
public ReferenceBinding [] setMemberTypes(ReferenceBinding[] memberTypes) {
-
+
if (!isPrototype())
return this.prototype.setMemberTypes(memberTypes);
//{ObjectTeams: for post-hoc addition need to clear this flag:
@@ -3394,10 +3394,10 @@ public ReferenceBinding [] setMemberTypes(ReferenceBinding[] memberTypes) {
// Propagate writes to all annotated variants so the clones evolve along.
public MethodBinding [] setMethods(MethodBinding[] methods) {
-
+
if (!isPrototype())
return this.prototype.setMethods(methods);
-
+
if ((this.tagBits & TagBits.HasAnnotatedVariants) != 0) {
TypeBinding [] annotatedTypes = this.scope.environment().getAnnotatedTypes(this);
for (int i = 0, length = annotatedTypes == null ? 0 : annotatedTypes.length; i < length; i++) {
@@ -3423,10 +3423,10 @@ public MethodBinding [] setMethods(MethodBinding[] methods) {
// Propagate writes to all annotated variants so the clones evolve along.
public ReferenceBinding setSuperClass(ReferenceBinding superClass) {
-
+
if (!isPrototype())
return this.prototype.setSuperClass(superClass);
-
+
if ((this.tagBits & TagBits.HasAnnotatedVariants) != 0) {
TypeBinding [] annotatedTypes = this.scope.environment().getAnnotatedTypes(this);
for (int i = 0, length = annotatedTypes == null ? 0 : annotatedTypes.length; i < length; i++) {
@@ -3439,10 +3439,10 @@ public ReferenceBinding setSuperClass(ReferenceBinding superClass) {
// Propagate writes to all annotated variants so the clones evolve along.
public ReferenceBinding [] setSuperInterfaces(ReferenceBinding [] superInterfaces) {
-
+
if (!isPrototype())
return this.prototype.setSuperInterfaces(superInterfaces);
-
+
if ((this.tagBits & TagBits.HasAnnotatedVariants) != 0) {
TypeBinding [] annotatedTypes = this.scope.environment().getAnnotatedTypes(this);
for (int i = 0, length = annotatedTypes == null ? 0 : annotatedTypes.length; i < length; i++) {
@@ -3455,10 +3455,10 @@ public ReferenceBinding [] setSuperInterfaces(ReferenceBinding [] superInterface
// Propagate writes to all annotated variants so the clones evolve along.
public TypeVariableBinding [] setTypeVariables(TypeVariableBinding [] typeVariables) {
-
+
if (!isPrototype())
return this.prototype.setTypeVariables(typeVariables);
-
+
if ((this.tagBits & TagBits.HasAnnotatedVariants) != 0) {
TypeBinding [] annotatedTypes = this.scope.environment().getAnnotatedTypes(this);
for (int i = 0, length = annotatedTypes == null ? 0 : annotatedTypes.length; i < length; i++) {
@@ -3645,8 +3645,8 @@ public void resolveGeneratedMethod(AbstractMethodDeclaration methodDeclaration,
// manually detect overriding, if we're past the MethodVerifier:
if (StateHelper.hasState(this, ITranslationStates.STATE_METHODS_VERIFIED))
if (methodBinding != null && methodBinding.isValidBinding() && TypeBinding.notEquals(methodBinding.declaringClass, this))
- methodDeclaration.binding.modifiers |= methodBinding.declaringClass.isInterface()
- ? ExtraCompilerModifiers.AccImplementing
+ methodDeclaration.binding.modifiers |= methodBinding.declaringClass.isInterface()
+ ? ExtraCompilerModifiers.AccImplementing
: ExtraCompilerModifiers.AccOverriding;
methodDeclaration.resolve(this.scope);
}
@@ -3703,13 +3703,13 @@ public ReferenceBinding[] superInterfaces() {
}
public SyntheticMethodBinding[] syntheticMethods() {
-
+
if (!isPrototype()) throw new IllegalStateException();
-
+
//{ObjectTeams: two different kinds of synthetics:
/* orig:
- if (this.synthetics == null
- || this.synthetics[SourceTypeBinding.METHOD_EMUL] == null
+ if (this.synthetics == null
+ || this.synthetics[SourceTypeBinding.METHOD_EMUL] == null
|| this.synthetics[SourceTypeBinding.METHOD_EMUL].size() == 0) {
return null;
}
@@ -3720,7 +3720,7 @@ public SyntheticMethodBinding[] syntheticMethods() {
if (this.synthetics == null) return null;
int index = 0;
SyntheticMethodBinding[] bindings = new SyntheticMethodBinding[1];
- if (this.synthetics[SourceTypeBinding.METHOD_EMUL] != null && this.synthetics[METHOD_EMUL].size() > 0)
+ if (this.synthetics[SourceTypeBinding.METHOD_EMUL] != null && this.synthetics[METHOD_EMUL].size() > 0)
{
//orig:
Iterator methodArrayIterator = this.synthetics[SourceTypeBinding.METHOD_EMUL].values().iterator();
@@ -3731,14 +3731,14 @@ public SyntheticMethodBinding[] syntheticMethods() {
if (index+1 > bindings.length) {
System.arraycopy(bindings, 0, (bindings = new SyntheticMethodBinding[index + 1]), 0, index);
}
- bindings[index++] = methodAccessors[i];
+ bindings[index++] = methodAccessors[i];
}
}
}
// :giro
}
// more synthetics to generate:
- if (this.synthetics[SourceTypeBinding.ROLE_BRIDGE] != null && this.synthetics[SourceTypeBinding.ROLE_BRIDGE].size() > 0)
+ if (this.synthetics[SourceTypeBinding.ROLE_BRIDGE] != null && this.synthetics[SourceTypeBinding.ROLE_BRIDGE].size() > 0)
{
Iterator methodArrayIterator = this.synthetics[SourceTypeBinding.ROLE_BRIDGE].values().iterator();
while (methodArrayIterator.hasNext()) {
@@ -3747,7 +3747,7 @@ public SyntheticMethodBinding[] syntheticMethods() {
if (index+1 > bindings.length) {
System.arraycopy(bindings, 0, (bindings = new SyntheticMethodBinding[index + 1]), 0, index);
}
- bindings[index++] = methodAccessor;
+ bindings[index++] = methodAccessor;
}
}
}
@@ -3767,9 +3767,9 @@ public SyntheticMethodBinding[] syntheticMethods() {
* Answer the collection of synthetic fields to append into the classfile
*/
public FieldBinding[] syntheticFields() {
-
+
if (!isPrototype()) throw new IllegalStateException();
-
+
if (this.synthetics == null) return null;
int fieldSize = this.synthetics[SourceTypeBinding.FIELD_EMUL] == null ? 0 : this.synthetics[SourceTypeBinding.FIELD_EMUL].size();
int literalSize = this.synthetics[SourceTypeBinding.CLASS_LITERAL_EMUL] == null ? 0 :this.synthetics[SourceTypeBinding.CLASS_LITERAL_EMUL].size();
@@ -3800,7 +3800,7 @@ public String toString() {
if (this.hasTypeAnnotations()) {
return annotatedDebugName();
}
-
+
StringBuffer buffer = new StringBuffer(30);
buffer.append("(id="); //$NON-NLS-1$
if (this.id == TypeIds.NoId)
@@ -3909,9 +3909,9 @@ public TypeVariableBinding[] typeVariables() {
return this.typeVariables != null ? this.typeVariables : Binding.NO_TYPE_VARIABLES;
}
void verifyMethods(MethodVerifier verifier) {
-
+
if (!isPrototype()) throw new IllegalStateException();
-
+
//{ObjectTeams: shortcut for predefined confined types (override final methods???)
if (TypeAnalyzer.isTopConfined(this))
return;
@@ -3971,7 +3971,7 @@ public void tagIndirectlyAccessibleMembers() {
if (!this.memberTypes[i].isPrivate())
this.memberTypes[i].modifiers |= ExtraCompilerModifiers.AccLocallyUsed;
}
- if (this.superclass.isPrivate())
+ if (this.superclass.isPrivate())
if (this.superclass instanceof SourceTypeBinding) // should always be true because private super type can only be accessed in same CU
((SourceTypeBinding) this.superclass).tagIndirectlyAccessibleMembers();
}
@@ -4015,7 +4015,7 @@ public boolean isNestmateOf(SourceTypeBinding other) {
SourceTypeBinding otherHost = other.getNestHost();
return TypeBinding.equalsEquals(this, other) ||
- TypeBinding.equalsEquals(this.nestHost == null ? this : this.nestHost,
+ TypeBinding.equalsEquals(this.nestHost == null ? this : this.nestHost,
otherHost == null ? other : otherHost);
}
public void addNestMember(SourceTypeBinding member) {
@@ -4034,7 +4034,7 @@ public List<String> getNestMembers() {
.collect(Collectors.toList());
return list;
}
-/* Get the field bindings in the order of record component declaration
+/* Get the field bindings in the order of record component declaration
* should be called only after a called to fields() */
public FieldBinding[] getRecordComponents() {
return this.recordComponents;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SplitPackageBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SplitPackageBinding.java
index f35964546..d14f2d4aa 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SplitPackageBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SplitPackageBinding.java
@@ -22,7 +22,7 @@ import org.eclipse.jdt.core.compiler.CharOperation;
public class SplitPackageBinding extends PackageBinding {
Set<ModuleBinding> declaringModules;
public Set<PlainPackageBinding> incarnations;
-
+
/**
* Combine two potential package bindings, answering either the better of those if the other has a problem,
* or combine both into a split package.
@@ -119,7 +119,7 @@ public class SplitPackageBinding extends PackageBinding {
}
return childPackage;
}
-
+
@Override
ModuleBinding[] getDeclaringModules() {
return this.declaringModules.toArray(new ModuleBinding[this.declaringModules.size()]);
@@ -135,12 +135,12 @@ public class SplitPackageBinding extends PackageBinding {
for (PackageBinding incarnation : this.incarnations) {
PackageBinding package0 = incarnation.getPackage0(name);
if (package0 == null)
- return null; // if any incarnation lacks cached info, a full findPackage will be necessary
+ return null; // if any incarnation lacks cached info, a full findPackage will be necessary
candidate = combine(package0, candidate, this.enclosingModule);
}
if (candidate != null)
this.knownPackages.put(name, candidate);
-
+
return candidate;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticFactoryMethodBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticFactoryMethodBinding.java
index b17afb0a7..de075b8fc 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticFactoryMethodBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticFactoryMethodBinding.java
@@ -23,7 +23,7 @@ public class SyntheticFactoryMethodBinding extends MethodBinding {
private MethodBinding staticFactoryFor;
private LookupEnvironment environment;
private ReferenceBinding enclosingType;
-
+
public SyntheticFactoryMethodBinding(MethodBinding method, LookupEnvironment environment, ReferenceBinding enclosingType) {
super(method.modifiers | ClassFileConstants.AccStatic, TypeConstants.SYNTHETIC_STATIC_FACTORY,
null, null, null, method.declaringClass);
@@ -31,14 +31,14 @@ public class SyntheticFactoryMethodBinding extends MethodBinding {
this.staticFactoryFor = method;
this.enclosingType = enclosingType;
}
-
+
public MethodBinding getConstructor() {
return this.staticFactoryFor;
}
-
+
/** Apply the given type arguments on the (declaring class of the) actual constructor being represented by this factory method and
- if method type arguments is not empty materialize the parameterized generic constructor
- * @param targetType
+ if method type arguments is not empty materialize the parameterized generic constructor
+ * @param targetType
*/
public ParameterizedMethodBinding applyTypeArgumentsOnConstructor(TypeBinding[] typeArguments, TypeBinding[] constructorTypeArguments, boolean inferredWithUncheckedConversion, TypeBinding targetType) {
ReferenceBinding parameterizedType = typeArguments == null
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.java
index 7ecee27ec..6baec6d36 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.java
@@ -50,9 +50,9 @@ public class SyntheticMethodBinding extends MethodBinding {
public MethodBinding targetMethod; // method or constructor
public TypeBinding targetEnumType; // enum type
public LambdaExpression lambda;
-
+
/** Switch (one from many) linked to the switch table */
- public SwitchStatement switchStatement;
+ public SwitchStatement switchStatement;
/**
* Method reference expression whose target FI is Serializable. Should be set when
* purpose is {@link #SerializableMethodReference}
@@ -415,7 +415,7 @@ public class SyntheticMethodBinding extends MethodBinding {
this.modifiers |= ClassFileConstants.AccStrictfp;
}
}
-
+
/**
* Construct $deserializeLambda$ method
*/
@@ -432,7 +432,7 @@ public class SyntheticMethodBinding extends MethodBinding {
int methodId = knownAccessMethods == null ? 0 : knownAccessMethods.length;
this.index = methodId;
}
-
+
/**
* Construct enum special methods: values or valueOf methods
*/
@@ -442,7 +442,7 @@ public class SyntheticMethodBinding extends MethodBinding {
this.index = knownAccessMethods == null ? 0 : knownAccessMethods.length;
StringBuffer buffer = new StringBuffer();
buffer.append(TypeConstants.SYNTHETIC_ENUM_CONSTANT_INITIALIZATION_METHOD_PREFIX).append(this.index);
- this.selector = String.valueOf(buffer).toCharArray();
+ this.selector = String.valueOf(buffer).toCharArray();
this.modifiers = ClassFileConstants.AccPrivate | ClassFileConstants.AccStatic;
this.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
this.purpose = SyntheticMethodBinding.TooManyEnumsConstants;
@@ -536,7 +536,7 @@ public class SyntheticMethodBinding extends MethodBinding {
this.modifiers = ClassFileConstants.AccSynthetic | ClassFileConstants.AccPrivate | ClassFileConstants.AccStatic;
this.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
this.returnType = publicConstructor.declaringClass;
-
+
int realParametersLength = privateConstructor.parameters.length;
int enclosingInstancesLength = enclosingInstances.length;
int parametersLength = enclosingInstancesLength + realParametersLength;
@@ -544,7 +544,7 @@ public class SyntheticMethodBinding extends MethodBinding {
System.arraycopy(enclosingInstances, 0, this.parameters, 0, enclosingInstancesLength);
System.arraycopy(privateConstructor.parameters, 0, this.parameters, enclosingInstancesLength, realParametersLength);
this.fakePaddedParameters = publicConstructor.parameters.length - realParametersLength;
-
+
this.thrownExceptions = publicConstructor.thrownExceptions;
this.purpose = SyntheticMethodBinding.FactoryMethod;
this.targetMethod = publicConstructor;
@@ -718,12 +718,12 @@ public class SyntheticMethodBinding extends MethodBinding {
this.purpose = isSuperAccess ? SyntheticMethodBinding.SuperMethodAccess : SyntheticMethodBinding.MethodAccess;
//{ObjectTeams: is accessed role method also static?
- if (accessedMethod.needsSyntheticEnclosingTeamInstance()) {
+ if (accessedMethod.needsSyntheticEnclosingTeamInstance()) {
this.parameters = new TypeBinding[accessedMethod.parameters.length + 2];
this.parameters[0] = TypeBinding.INT; // dummy
this.parameters[1] = declaringSourceType.enclosingType(); // synth team arg
System.arraycopy(accessedMethod.parameters, 0, this.parameters, 2, accessedMethod.parameters.length);
- } else
+ } else
// SH}
if (accessedMethod.isStatic() || (isSuperAccess && receiverType.isInterface())) {
this.parameters = accessedMethod.parameters;
@@ -779,7 +779,7 @@ public class SyntheticMethodBinding extends MethodBinding {
protected boolean isConstructorRelated() {
return this.purpose == SyntheticMethodBinding.ConstructorAccess;
}
-
+
@Override
public LambdaExpression sourceLambda() {
return this.lambda;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java
index e39fe212a..a4389d252 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java
@@ -45,13 +45,13 @@ public interface TagBits {
// for method
long HasUncheckedTypeArgumentForBoundCheck = ASTNode.Bit9;
-
+
// local variable
long ForcedToBeRawType = ASTNode.Bit10;
// set when method has argument(s) that couldn't be resolved
long HasUnresolvedArguments = ASTNode.Bit10;
-
+
// for the type cycle hierarchy check used by ClassScope
long BeginHierarchyCheck = ASTNode.Bit9; // type
long EndHierarchyCheck = ASTNode.Bit10; // type
@@ -64,7 +64,7 @@ public interface TagBits {
long IsArgument = ASTNode.Bit11; // local
long ClearPrivateModifier = ASTNode.Bit10; // constructor binding
-
+
// for java 7 - this bit is also set if the variable is explicitly or implicitly final
long IsEffectivelyFinal = ASTNode.Bit12; // local
long MultiCatchParameter = ASTNode.Bit13; // local
@@ -73,7 +73,7 @@ public interface TagBits {
// for java 14 Records Canonical constructor (preview)
long IsCanonicalConstructor = ASTNode.Bit12; // constructor
long isImplicit = ASTNode.Bit13; // constructor and method
-
+
// have implicit null annotations been collected (inherited(?) & default)?
long IsNullnessKnown = ASTNode.Bit13; // method
@@ -97,7 +97,7 @@ public interface TagBits {
// set for parameterized type NOT of the form X<?,?>
long IsBoundParameterizedType = ASTNode.Bit24; // PTB only.
-
+
long HasAnnotatedVariants = ASTNode.Bit24; // TVB, STB
// used by BinaryTypeBinding
@@ -193,13 +193,13 @@ public interface TagBits {
| AnnotationNonNullByDefault
| AnnotationNullUnspecifiedByDefault
| AnnotationRepeatable;
-
+
long AnnotationNullMASK = AnnotationNullable | AnnotationNonNull;
/** @since 3.10 marks a type that has a nullness annotation directly or on a detail (array dimension/type argument). */
long HasNullTypeAnnotation = ASTNode.Bit21;
long HasTypeAnnotations = ASTNode.Bit22;
-
+
long DefaultValueResolved = ASTNode.Bit60L;
// set when type contains non-private constructor(s)
@@ -211,6 +211,6 @@ public interface TagBits {
// parameter/return incompatibility btw base-role?
long HasMappingIncompatibility = ASTNode.Bit64L; // for method mapping bindings
-
+
// SH}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java
index 5e2f9bc53..545b37426 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java
@@ -74,7 +74,7 @@ abstract public class TypeBinding extends Binding {
public long tagBits = 0; // See values in the interface TagBits below
protected AnnotationBinding [] typeAnnotations = Binding.NO_ANNOTATIONS;
-
+
// jsr 308
public static final ReferenceBinding TYPE_USE_BINDING = new ReferenceBinding() { /* used for type annotation resolution. */
{ this.id = TypeIds.T_undefined; }
@@ -83,7 +83,7 @@ abstract public class TypeBinding extends Binding {
@Override
public boolean hasTypeBit(int bit) { return false; }
};
-
+
/** Base type definitions */
public final static BaseTypeBinding INT = new BaseTypeBinding(
TypeIds.T_int, TypeConstants.INT, new char[] { 'I' });
@@ -117,7 +117,7 @@ abstract public class TypeBinding extends Binding {
public TypeBinding() {
super();
}
-
+
public TypeBinding(TypeBinding prototype) { // faithfully copy most instance state - clone operation should specialize/override suitably.
this.id = prototype.id;
this.tagBits = prototype.tagBits & ~TagBits.AnnotationNullMASK;
@@ -245,7 +245,7 @@ public void collectSubstitutes(Scope scope, TypeBinding actualType, InferenceCon
/** Virtual copy constructor: a copy is made of the receiver's entire instance state and then suitably
parameterized by the arguments to the clone operation as seen fit by each type. Parameters may not
make sense for every type in the hierarchy, in which case they are silently ignored. A type may
- choose to retain a copy of the prototype for reference.
+ choose to retain a copy of the prototype for reference.
*/
public TypeBinding clone(TypeBinding enclosingType) {
throw new IllegalStateException("TypeBinding#clone() should have been overridden"); //$NON-NLS-1$
@@ -294,7 +294,7 @@ public TypeBinding erasure() {
* Perform an upwards type projection as per JLS 4.10.5
* @param scope Relevant scope for evaluating type projection
* @param mentionedTypeVariables Filter for mentioned type variabled
- * @returns Upwards type projection of 'this', or null if downwards projection is undefined
+ * @returns Upwards type projection of 'this', or null if downwards projection is undefined
*/
public TypeBinding upwardsProjection(Scope scope, TypeBinding[] mentionedTypeVariables) {
return this;
@@ -304,7 +304,7 @@ public TypeBinding upwardsProjection(Scope scope, TypeBinding[] mentionedTypeVar
* Perform a downwards type projection as per JLS 4.10.5
* @param scope Relevant scope for evaluating type projection
* @param mentionedTypeVariables Filter for mentioned type variabled
- * @returns Downwards type projection of 'this', or null if downwards projection is undefined
+ * @returns Downwards type projection of 'this', or null if downwards projection is undefined
*/
public TypeBinding downwardsProjection(Scope scope, TypeBinding[] mentionedTypeVariables) {
return this;
@@ -498,11 +498,11 @@ public TypeBinding findSuperTypeOriginatingFrom(TypeBinding otherType) {
* Returns the type to use for generic cast, or null if none required
*/
public TypeBinding genericCast(TypeBinding targetType) {
- if (TypeBinding.equalsEquals(this, targetType))
+ if (TypeBinding.equalsEquals(this, targetType))
return null;
TypeBinding targetErasure = targetType.erasure();
// type var get replaced by upper bound
- if (erasure().findSuperTypeOriginatingFrom(targetErasure) != null)
+ if (erasure().findSuperTypeOriginatingFrom(targetErasure) != null)
return null;
//{ObjectTeams: don't cast if lowering is needed instead:
TypeBinding erasure= erasure();
@@ -632,7 +632,7 @@ public final boolean isPrimitiveOrBoxedPrimitiveType() {
case TypeIds.T_JavaLangInteger :
case TypeIds.T_JavaLangLong :
return true;
- default:
+ default:
return false;
}
}
@@ -650,7 +650,7 @@ public boolean isBoxedPrimitiveType() {
case TypeIds.T_JavaLangInteger :
case TypeIds.T_JavaLangLong :
return true;
- default:
+ default:
return false;
}
}
@@ -692,16 +692,16 @@ public boolean isPotentiallyCompatibleWith(TypeBinding right, /*@Nullable*/ Scop
/* Answer true if the receiver type can be assigned to the argument type (right) with boxing/unboxing applied.
*/
public boolean isBoxingCompatibleWith(TypeBinding right, /*@NonNull */ Scope scope) {
-
+
if (right == null)
return false;
if (TypeBinding.equalsEquals(this, right))
return true;
-
+
if (this.isCompatibleWith(right, scope))
return true;
-
+
if (this.isBaseType() != right.isBaseType()) {
TypeBinding convertedType = scope.environment().computeBoxingType(this);
if (TypeBinding.equalsEquals(convertedType, right) || convertedType.isCompatibleWith(right, scope))
@@ -800,7 +800,7 @@ public boolean isPlainDependentType() {
/**
* Returns true if the type is parameterized, e.g. List<String>.
- * Note that some instances of ParameterizedTypeBinding have no arguments, like for non-generic members
+ * Note that some instances of ParameterizedTypeBinding have no arguments, like for non-generic members
* of a parameterized type. Use {@link #isParameterizedTypeWithActualArguments()} instead to find out.
*/
public boolean isParameterizedType() {
@@ -833,7 +833,7 @@ public boolean isIntersectionType18() {
* i.e. {@link #isParameterizedType()} is not equivalent to testing <code>type.kind() == Binding.PARAMETERIZED_TYPE</code>
*/
public final boolean isParameterizedTypeWithActualArguments() {
- return (kind() == Binding.PARAMETERIZED_TYPE)
+ return (kind() == Binding.PARAMETERIZED_TYPE)
&& ((ParameterizedTypeBinding) this).arguments != null;
}
@@ -919,15 +919,15 @@ private boolean isProvableDistinctSubType(TypeBinding otherType) {
public boolean isProvablyDistinct(TypeBinding otherType) {
/* With the hybrid 1.4/1.5+ projects modes, while establishing type equivalence, we need to
- be prepared for a type such as Map appearing in one of three forms: As (a) a ParameterizedTypeBinding
- e.g Map<String, String>, (b) as RawTypeBinding Map#RAW and finally (c) as a BinaryTypeBinding
+ be prepared for a type such as Map appearing in one of three forms: As (a) a ParameterizedTypeBinding
+ e.g Map<String, String>, (b) as RawTypeBinding Map#RAW and finally (c) as a BinaryTypeBinding
When the usage of a type lacks type parameters, whether we land up with the raw form or not depends
on whether the underlying type was "seen to be" a generic type in the particular build environment or
not. See:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=186565
- https://bugs.eclipse.org/bugs/show_bug.cgi?id=328827
+ https://bugs.eclipse.org/bugs/show_bug.cgi?id=328827
https://bugs.eclipse.org/bugs/show_bug.cgi?id=329588
- */
+ */
if (equalsEquals(this, otherType))
return false;
@@ -1296,7 +1296,7 @@ public boolean isTypeArgumentContainedBy(TypeBinding otherType) {
if (cb18.firstBound != null) {
if (cb18.lowerBound != null)
return false; // type containment is not defined for variables with both upper and lower bound
- TypeBinding[] otherBounds = null;
+ TypeBinding[] otherBounds = null;
int len = cb18.upperBounds.length; // by construction non-null if firstBound is set
if (len > 1)
System.arraycopy(cb18.upperBounds, 1, otherBounds = new TypeBinding[len-1], 0, len-1);
@@ -1582,7 +1582,7 @@ public TypeBinding original() {
}
}
-/**
+/**
* Return this type minus its type annotations
*/
public TypeBinding unannotated() {
@@ -1591,7 +1591,7 @@ public TypeBinding unannotated() {
/**
* Return this type minus its toplevel null annotations. Any annotations on type arguments or
- * bounds are retained.
+ * bounds are retained.
*/
public TypeBinding withoutToplevelNullAnnotation() {
return this;
@@ -1713,8 +1713,8 @@ public TypeBinding maybeWrapRoleType (ASTNode typedNode, TypeArgumentUpdater upd
* In particular {@code null} is answered if the receiver is not a reference type, or is a problem type.
* @param scope scope
* @param replaceWildcards Should wildcards be replaced following JLS 9.8? Say false for lambdas with explicit argument types which should apply 18.5.3
- *
- * @return The single abstract method of a functional interface, or one of {@code null} or {@link ReferenceBinding#samProblemBinding}, if the receiver is not a functional interface.
+ *
+ * @return The single abstract method of a functional interface, or one of {@code null} or {@link ReferenceBinding#samProblemBinding}, if the receiver is not a functional interface.
*/
public MethodBinding getSingleAbstractMethod(Scope scope, boolean replaceWildcards) {
return null;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBindingVisitor.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBindingVisitor.java
index 108334942..32fa61d90 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBindingVisitor.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBindingVisitor.java
@@ -32,31 +32,31 @@ public class TypeBindingVisitor {
public boolean visit(ArrayBinding arrayBinding) {
return true; // continue traversal.
}
-
+
public boolean visit(TypeVariableBinding typeVariable) {
return true; // continue traversal.
}
-
+
public boolean visit(ReferenceBinding referenceBinding) {
return true; // continue traversal.
}
-
+
public boolean visit(WildcardBinding wildcardBinding) {
return true; // continue traversal.
}
-
+
public boolean visit(ParameterizedTypeBinding parameterizedTypeBinding) {
return true; // continue traversal.
}
-
+
public boolean visit(IntersectionTypeBinding18 intersectionTypeBinding18) {
return true; // continue traversal.
}
-
+
public boolean visit(RawTypeBinding rawTypeBinding) {
return true; // continue traversal.
}
-
+
public boolean visit(PolyTypeBinding polyTypeBinding) {
return true; // continue traversal.
}
@@ -69,9 +69,9 @@ public class TypeBindingVisitor {
public static void visit(TypeBindingVisitor visitor, TypeBinding type) {
- if (type == null)
+ if (type == null)
return;
-
+
SimpleLookupTable visitedCache = visitor.visitedCache;
if (visitedCache == null) {
visitor.visitedCache = new SimpleLookupTable(3);
@@ -83,7 +83,7 @@ public class TypeBindingVisitor {
return;
visitedCache.put(type, Boolean.TRUE);
switch (type.kind()) {
-
+
case Binding.TYPE_PARAMETER:
TypeVariableBinding typeVariableBinding = (TypeVariableBinding) type;
if (visitor.visit(typeVariableBinding)) {
@@ -92,7 +92,7 @@ public class TypeBindingVisitor {
visit(visitor, typeVariableBinding.superInterfaces);
}
break;
-
+
case Binding.PARAMETERIZED_TYPE:
ParameterizedTypeBinding parameterizedTypeBinding = (ParameterizedTypeBinding) type;
if (visitor.visit(parameterizedTypeBinding)) {
@@ -117,11 +117,11 @@ public class TypeBindingVisitor {
}
}
break;
-
+
case Binding.BASE_TYPE:
visitor.visit((BaseTypeBinding) type);
break;
-
+
case Binding.RAW_TYPE:
//{ObjectTeams: relax the type to include half-raw dependent types:
if (type.isRoleType())
@@ -129,7 +129,7 @@ public class TypeBindingVisitor {
// SH}
visitor.visit((RawTypeBinding) type);
break;
-
+
case Binding.TYPE:
case Binding.GENERIC_TYPE:
ReferenceBinding referenceBinding = (ReferenceBinding) type;
@@ -138,17 +138,17 @@ public class TypeBindingVisitor {
visit(visitor, referenceBinding.typeVariables());
}
break;
-
+
case Binding.INTERSECTION_TYPE18:
IntersectionTypeBinding18 intersectionTypeBinding18 = (IntersectionTypeBinding18) type;
if (visitor.visit(intersectionTypeBinding18))
visit(visitor, intersectionTypeBinding18.intersectingTypes);
break;
-
+
case Binding.POLY_TYPE:
visitor.visit((PolyTypeBinding) type);
break;
-
+
default:
throw new InternalError("Unexpected binding type"); //$NON-NLS-1$
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBound.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBound.java
index 770e02ce9..b91daac44 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBound.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBound.java
@@ -19,15 +19,15 @@ package org.eclipse.jdt.internal.compiler.lookup;
* Implementation of 18.1.3 in JLS8
*/
public class TypeBound extends ReductionResult {
-
+
InferenceVariable left;
-
+
// this flag contributes to the workaround controlled by InferenceContext18.ARGUMENT_CONSTRAINTS_ARE_SOFT:
boolean isSoft;
// here we accumulate null tagBits from any types that have been related to this type bound during incorporation:
long nullHints;
-
+
static TypeBound createBoundOrDependency(InferenceSubstitution theta, TypeBinding type, InferenceVariable variable) {
// Part of JLS8 sect 18.1.3:
return new TypeBound(variable, theta.substitute(theta, type), SUBTYPE, true);
@@ -37,7 +37,7 @@ public class TypeBound extends ReductionResult {
TypeBound(InferenceVariable inferenceVariable, TypeBinding typeBinding, int relation) {
this(inferenceVariable, typeBinding, relation, false);
}
-
+
TypeBound(InferenceVariable inferenceVariable, TypeBinding typeBinding, int relation, boolean isSoft) {
this.left = inferenceVariable;
this.right = typeBinding;
@@ -65,12 +65,12 @@ public class TypeBound extends ReductionResult {
boolean isBound() {
return this.right.isProperType(true);
}
-
+
@Override
public int hashCode() {
return this.left.hashCode() + this.right.hashCode() + this.relation;
}
-
+
@Override
public boolean equals(Object obj) {
if (obj instanceof TypeBound) {
@@ -79,7 +79,7 @@ public class TypeBound extends ReductionResult {
}
return false;
}
-
+
// debugging:
@Override
public String toString() {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java
index 8e9fc1bb3..f4f86f733 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java
@@ -143,7 +143,7 @@ public interface TypeConstants {
char[] DOM = "dom".toCharArray(); //$NON-NLS-1$
char[] ITYPEBINDING = "ITypeBinding".toCharArray(); //$NON-NLS-1$
char[] SPRING = "springframework".toCharArray(); //$NON-NLS-1$
-
+
// Constant compound names
char[][] JAVA_LANG = {JAVA, LANG};
char[][] JAVA_IO = {JAVA, IO};
@@ -255,7 +255,7 @@ public interface TypeConstants {
new CloseMethodRecord(GUAVA_CLOSEABLES, CLOSE, 1),
new CloseMethodRecord(APACHE_IOUTILS, CLOSE_QUIETLY, 1),
new CloseMethodRecord(APACHE_DBUTILS, CLOSE, 1),
- new CloseMethodRecord(APACHE_DBUTILS, CLOSE_QUIETLY, 3), // closeQuietly(Connection,Statement,ResultSet)
+ new CloseMethodRecord(APACHE_DBUTILS, CLOSE_QUIETLY, 3), // closeQuietly(Connection,Statement,ResultSet)
new CloseMethodRecord(APACHE_DBUTILS, "commitAndClose".toCharArray(), 1), //$NON-NLS-1$
new CloseMethodRecord(APACHE_DBUTILS, "commitAndCloseQuietly".toCharArray(), 1), //$NON-NLS-1$
new CloseMethodRecord(APACHE_DBUTILS, "rollbackAndClose".toCharArray(), 1), //$NON-NLS-1$
@@ -305,7 +305,7 @@ public interface TypeConstants {
{JAVA, "beans".toCharArray(), "XMLDecoder".toCharArray()}, //$NON-NLS-1$ //$NON-NLS-2$
{JAVAX, "sound".toCharArray(), "sampled".toCharArray(), "AudioInputStream".toCharArray()}, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
};
- char[][] JAVA_IO_RESOURCE_FREE_CLOSEABLES = new char[][] {
+ char[][] JAVA_IO_RESOURCE_FREE_CLOSEABLES = new char[][] {
"StringReader".toCharArray(), //$NON-NLS-1$
"StringWriter".toCharArray(), //$NON-NLS-1$
"ByteArrayInputStream".toCharArray(), //$NON-NLS-1$
@@ -348,7 +348,7 @@ public interface TypeConstants {
char[][] ORG_ECLIPSE_CORE_RUNTIME_ASSERT = new char[][] { ORG, ECLIPSE, CORE, RUNTIME, ASSERT_CLASS };
// ... methods:
char[] IS_NOTNULL = "isNotNull".toCharArray(); //$NON-NLS-1$
-
+
char[] JUNIT = "junit".toCharArray(); //$NON-NLS-1$
char[] FRAMEWORK = "framework".toCharArray(); //$NON-NLS-1$
char[] JUPITER = "jupiter".toCharArray(); //$NON-NLS-1$
@@ -364,7 +364,7 @@ public interface TypeConstants {
// ... annotations:
char[] METHOD_SOURCE = "MethodSource".toCharArray(); //$NON-NLS-1$
char[][] ORG_JUNIT_METHOD_SOURCE = new char[][] { ORG, JUNIT, JUPITER, PARAMS, PROVIDER, METHOD_SOURCE };
-
+
char[] VALIDATE_CLASS = "Validate".toCharArray(); //$NON-NLS-1$
char[][] ORG_APACHE_COMMONS_LANG_VALIDATE = new char[][] { ORG, APACHE, COMMONS, LANG, VALIDATE_CLASS };
char[][] ORG_APACHE_COMMONS_LANG3_VALIDATE = new char[][] { ORG, APACHE, COMMONS, LANG3, VALIDATE_CLASS };
@@ -375,7 +375,7 @@ public interface TypeConstants {
char[] IS_TRUE = "isTrue".toCharArray(); //$NON-NLS-1$
char[] NOT_NULL = "notNull".toCharArray(); //$NON-NLS-1$
- char[][] COM_GOOGLE_COMMON_BASE_PRECONDITIONS = new char[][] {
+ char[][] COM_GOOGLE_COMMON_BASE_PRECONDITIONS = new char[][] {
COM, GOOGLE, "common".toCharArray(), "base".toCharArray(), "Preconditions".toCharArray() }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
// ... methods:
char[] CHECK_NOT_NULL = "checkNotNull".toCharArray(); //$NON-NLS-1$
@@ -384,7 +384,7 @@ public interface TypeConstants {
// ... methods in java.util.Objects:
char[] REQUIRE_NON_NULL = "requireNonNull".toCharArray(); //$NON-NLS-1$
-
+
// different @Inject annotations are relevant for @NonNull fields
char[] INJECT_PACKAGE = "inject".toCharArray(); //$NON-NLS-1$
char[] INJECT_TYPE = "Inject".toCharArray(); //$NON-NLS-1$
@@ -392,7 +392,7 @@ public interface TypeConstants {
char[][] COM_GOOGLE_INJECT_INJECT = new char[][] {COM, GOOGLE, INJECT_PACKAGE, INJECT_TYPE };
// detail for the above:
char[] OPTIONAL = "optional".toCharArray(); //$NON-NLS-1$
-
+
// well-known methods with "dangerous" signatures:
char[][] JAVA_UTIL_MAP = new char[][] { JAVA, UTIL, "Map".toCharArray() }; //$NON-NLS-1$
char[] GET = "get".toCharArray(); //$NON-NLS-1$
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeIds.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeIds.java
index f83d0e453..00938d69e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeIds.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeIds.java
@@ -103,19 +103,19 @@ public interface TypeIds {
final int T_JavaIoExternalizable = 56;
final int T_JavaIoObjectStreamException = 57;
final int T_JavaIoException = 58;
-
+
final int T_JavaUtilCollection = 59;
-
+
// java 7
final int T_JavaLangSafeVarargs = 60;
-
+
final int T_JavaLangInvokeMethodHandlePolymorphicSignature = 61;
// java 7 java.lang.AutoCloseable
final int T_JavaLangAutoCloseable = 62;
-
+
// new in 3.8 for null annotations, removed in 4.6 (ids 65-67)
-
+
// new in 3.8 to identify org.eclipse.core.runtime.Assert
final int T_OrgEclipseCoreRuntimeAssert = 68;
// new in 3.9 to identify more assertion utilities:
@@ -138,7 +138,7 @@ public interface TypeIds {
// Java 8 - JEP 120
final int T_JavaLangAnnotationRepeatable = 90;
-
+
// classes with methods with "dangerous" signatures:
final int T_JavaUtilMap = 91;
final int T_JavaUtilList = 92;
@@ -151,7 +151,7 @@ public interface TypeIds {
// If you add new type id, make sure to bump up T_LastWellKnownTypeId if there is a cross over.
final int T_LastWellKnownTypeId = 128;
-
+
final int NoId = Integer.MAX_VALUE;
@@ -239,19 +239,19 @@ public interface TypeIds {
* @see ReferenceBinding#hasTypeBit(int)
*/
final int BitUninitialized = 0x8000000;
- /**
+ /**
* Marks all sub-types of java.lang.AutoCloseable.
* @see ReferenceBinding#hasTypeBit(int)
*/
final int BitAutoCloseable = 1;
- /**
+ /**
* Marks all sub-types of java.io.Closeable.
* @see ReferenceBinding#hasTypeBit(int)
*/
final int BitCloseable = 2;
/**
* Bit for members of a white list:
- * Subtypes of Closeable that wrap another resource without directly holding any OS resources.
+ * Subtypes of Closeable that wrap another resource without directly holding any OS resources.
*/
final int BitWrapperCloseable = 4;
/**
@@ -259,7 +259,7 @@ public interface TypeIds {
* Subtypes of Closeable that do not hold an OS resource that needs to be released.
*/
final int BitResourceFreeCloseable = 8;
-
+
final int BitUninternedType = 16;
/** Bit for a type configured as a @NonNull annotation. */
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeSystem.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeSystem.java
index 4d26fd536..3c7300110 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeSystem.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeSystem.java
@@ -31,47 +31,47 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.lookup.RoleTypeBindin
/* TypeSystem: An abstraction responsible for keeping track of types that undergo "derivation" of some sort and the derived types produced thus.
Here we use the term derivation in the Pascal sense and not per object oriented parlance.
-
+
As of Java SE8, a type can undergo derivation in a bunch of ways:
-
+
- By being created arrays out of,
- By being parameterized,
- By being created raw forms of,
- By being the generic type which a wildcard type or an intersection type parameterizes,
- By being annotated.
-
+
It is the responsibility of the TypeSystem to serve as the factory and ensure that unique types are created and maintained. Most of the
compiler depends on object identity given the derivation parameters are the same. E.g: If we dole out non-unique ParameterizedTypeBinding's
for two attempts to create List<String>, then one cannot be assigned to the other.
-
+
Till Java SE7, we could manage to create a single binding for a type - not so with annotations coming into the picture. In order for
two uses of the same type to be annotated differently, the bindings for them need to be distinct and cannot be shared. If we start
doling out different bindings, then validating type identity and equivalence becomes an issue.
-
+
What we do to solve the problem is produce different bindings when they need to be annotated differently, but stamp them with the
same id (TypeBinding#id). Thus types that fail == or != could quickly be ascertained to be mere annotation variants by comparing
the id field.
-
- This class is responsible for id stamping unique types. Only those types that are "derived from" in some form or participate in the
- derivation in some form (by being type arguments say) get tracked and id'd here. A type which is not thus derived from in one form or
+
+ This class is responsible for id stamping unique types. Only those types that are "derived from" in some form or participate in the
+ derivation in some form (by being type arguments say) get tracked and id'd here. A type which is not thus derived from in one form or
the other or participate in the derivation thus - we are completely oblivious to.
-
- TypeBinding.id computation: For primitive types and certain "well known" types, id assignment happens elsewhere. Here we start with an
- id value that is suitably high and proceed monotonically upwards so we will not accidentally collide with the id space in use already.
- id assignments happens in such a way that a naked type and its annotated variants - variously annotated - would all share the same id.
- Example: @T1 Map<@T2 String, @T3 Object> and Map<@T4 String, @T5 Object> and @T6 Map<String, Object> and @T7 Map<String, @T8 Object> and
- Map<String, @T9 Object> would all share the same id since the unadorned naked type in each case is the same: Map<String, Object>. None
- of this would share the id with Map<String, String>. Briefly put, if you take a certain annotated type and strip it of all annotations
- to come up with the naked type, that naked type and the annotated type would have the same id. Alternately, if you take a certain naked
- type and arrive at the universe of all differently annotated types, they would all share the same id while their bindings could be different -
+
+ TypeBinding.id computation: For primitive types and certain "well known" types, id assignment happens elsewhere. Here we start with an
+ id value that is suitably high and proceed monotonically upwards so we will not accidentally collide with the id space in use already.
+ id assignments happens in such a way that a naked type and its annotated variants - variously annotated - would all share the same id.
+ Example: @T1 Map<@T2 String, @T3 Object> and Map<@T4 String, @T5 Object> and @T6 Map<String, Object> and @T7 Map<String, @T8 Object> and
+ Map<String, @T9 Object> would all share the same id since the unadorned naked type in each case is the same: Map<String, Object>. None
+ of this would share the id with Map<String, String>. Briefly put, if you take a certain annotated type and strip it of all annotations
+ to come up with the naked type, that naked type and the annotated type would have the same id. Alternately, if you take a certain naked
+ type and arrive at the universe of all differently annotated types, they would all share the same id while their bindings could be different -
would be different unless they are identically annotated.
-
+
Thus subsystems that are annotation agnostic could quickly ascertain binding equality by comparing the id field.
*/
public class TypeSystem {
-
+
public final class HashedParameterizedTypes {
-
+
private final class PTBKey extends ReferenceBinding { // extends ReferenceBinding so it can be used as wrapper
protected ReferenceBinding type; // must ensure the type is resolved
public TypeBinding[] arguments;
@@ -125,7 +125,7 @@ public class TypeSystem {
}
@Override
public boolean equals(Object other) {
- PTBKey that = (PTBKey) other; // homogeneous container.
+ PTBKey that = (PTBKey) other; // homogeneous container.
//{ObjectTeams: more checks:
int thatValueParamPos = that.valueParamPosition;
ITeamAnchor thatAnchor = that.teamAnchor;
@@ -159,7 +159,7 @@ public class TypeSystem {
return hashCode;
}
}
-
+
HashMap<PTBKey, ParameterizedTypeBinding []> hashedParameterizedTypes = new HashMap<>(256);
//{ObjectTeams: more args:
@@ -168,8 +168,8 @@ public class TypeSystem {
:giro */
ParameterizedTypeBinding get(ReferenceBinding genericType, TypeBinding[] typeArguments, ITeamAnchor anchor, int valueParamPosition,
ReferenceBinding enclosingType, AnnotationBinding[] annotations) {
-// orig:
-
+// orig:
+
ReferenceBinding unannotatedGenericType = (ReferenceBinding) getUnannotatedType(genericType);
int typeArgumentsLength = typeArguments == null ? 0: typeArguments.length;
TypeBinding [] unannotatedTypeArguments = typeArguments == null ? null : new TypeBinding[typeArgumentsLength];
@@ -177,7 +177,7 @@ public class TypeSystem {
unannotatedTypeArguments[i] = getUnannotatedType(typeArguments[i]);
}
ReferenceBinding unannotatedEnclosingType = enclosingType == null ? null : (ReferenceBinding) getUnannotatedType(enclosingType);
-
+
/*
PTBKey key = new PTBKey(unannotatedGenericType, unannotatedTypeArguments, unannotatedEnclosingType, null);
:giro */
@@ -198,7 +198,7 @@ public class TypeSystem {
continue;
}
if (parameterizedType.enclosingType != enclosingTypeToMatch //$IDENTITY-COMPARISON$
- || !Util.effectivelyEqual(parameterizedType.typeArguments(), typeArgumentsToMatch))
+ || !Util.effectivelyEqual(parameterizedType.typeArguments(), typeArgumentsToMatch))
continue;
if (Util.effectivelyEqual(annotations, parameterizedType.getTypeAnnotations()))
return parameterizedType;
@@ -221,39 +221,39 @@ public class TypeSystem {
unannotatedTypeArguments[i] = getUnannotatedType(typeArguments[i]);
}
ReferenceBinding unannotatedEnclosingType = enclosingType == null ? null : (ReferenceBinding) getUnannotatedType(enclosingType);
-
+
/*
PTBKey key = new PTBKey(unannotatedGenericType, unannotatedTypeArguments, unannotatedEnclosingType, TypeSystem.this.environment);
:giro */
PTBKey key = new PTBKey(unannotatedGenericType, unannotatedTypeArguments, anchor, valueParamPosition,
unannotatedEnclosingType, TypeSystem.this.environment);
-// SH}
-
+// SH}
+
ParameterizedTypeBinding [] parameterizedTypeBindings = this.hashedParameterizedTypes.get(key);
int slot;
if (parameterizedTypeBindings == null) {
slot = 0;
parameterizedTypeBindings = new ParameterizedTypeBinding[1];
- } else {
+ } else {
slot = parameterizedTypeBindings.length;
System.arraycopy(parameterizedTypeBindings, 0, parameterizedTypeBindings = new ParameterizedTypeBinding[slot + 1], 0, slot);
}
parameterizedTypeBindings[slot] = parameterizedType;
this.hashedParameterizedTypes.put(key, parameterizedTypeBindings);
}
- }
-
+ }
+
private int typeid = TypeIds.T_LastWellKnownTypeId;
- private TypeBinding [][] types;
+ private TypeBinding [][] types;
protected HashedParameterizedTypes parameterizedTypes; // auxiliary fast lookup table for parameterized types.
private SimpleLookupTable annotationTypes; // cannot store in types, since AnnotationBinding is not a TypeBinding and we don't want types to operate at Binding level.
LookupEnvironment environment;
-
+
public TypeSystem(LookupEnvironment environment) {
this.environment = environment;
this.annotationTypes = new SimpleLookupTable(16);
this.typeid = TypeIds.T_LastWellKnownTypeId;
- this.types = new TypeBinding[TypeIds.T_LastWellKnownTypeId * 2][];
+ this.types = new TypeBinding[TypeIds.T_LastWellKnownTypeId * 2][];
this.parameterizedTypes = new HashedParameterizedTypes();
}
@@ -287,7 +287,7 @@ public class TypeSystem {
if (urb != null && urb.id == TypeIds.NoId)
urb.id = type.id;
}
-
+
return this.types[type.id][0] = type;
}
@@ -318,9 +318,9 @@ public class TypeSystem {
/* Note: parameters will not have type type annotations if lookup environment directly uses TypeSystem as its typeSystem. When ATS is used however
they may be annotated and we need to materialize the unannotated versions and work on them.
-
+
See ArrayBinding.swapUnresolved for further special case handling if incoming leafType is a URB that would resolve to a raw type later.
- */
+ */
public ArrayBinding getArrayType(TypeBinding leafType, int dimensions) {
if (leafType instanceof ArrayBinding) {
dimensions += leafType.dimensions();
@@ -331,7 +331,7 @@ public class TypeSystem {
int i, length = derivedTypes.length;
for (i = 0; i < length; i++) {
TypeBinding derivedType = derivedTypes[i];
- if (derivedType == null)
+ if (derivedType == null)
break;
if (!derivedType.isArrayType() || derivedType.hasTypeAnnotations())
continue;
@@ -349,7 +349,7 @@ public class TypeSystem {
this.types[this.typeid] = new TypeBinding[1];
return (ArrayBinding) (this.types[arrayType.id = this.typeid++][0] = arrayType);
}
-
+
public ArrayBinding getArrayType(TypeBinding leafComponentType, int dimensions, AnnotationBinding[] annotations) {
return getArrayType(leafComponentType, dimensions);
}
@@ -360,7 +360,7 @@ public class TypeSystem {
/* Note: parameters will not have type type annotations if lookup environment directly uses TypeSystem. When AnnotatableTypeSystem is in use
they may and we need to materialize the unannotated versions and work on them.
- */
+ */
public ParameterizedTypeBinding getParameterizedType(ReferenceBinding genericType, TypeBinding[] typeArguments, ReferenceBinding enclosingType) {
//{ObjectTeams: more arguments for role types:
return getParameterizedType(genericType, typeArguments, null, -1, enclosingType);
@@ -387,7 +387,7 @@ public class TypeSystem {
//{ObjectTeams: more arguments:
/* orig:
ParameterizedTypeBinding parameterizedType = this.parameterizedTypes.get(unannotatedGenericType, unannotatedTypeArguments, unannotatedEnclosingType, Binding.NO_ANNOTATIONS);
- if (parameterizedType != null)
+ if (parameterizedType != null)
return parameterizedType;
parameterizedType = new ParameterizedTypeBinding(unannotatedGenericType, unannotatedTypeArguments, unannotatedEnclosingType, this.environment);
@@ -396,7 +396,7 @@ public class TypeSystem {
:giro */
ParameterizedTypeBinding parameterizedType = this.parameterizedTypes.get(unannotatedGenericType, unannotatedTypeArguments, teamAnchor, valueParamPosition,
unannotatedEnclosingType, Binding.NO_ANNOTATIONS);
- if (parameterizedType != null)
+ if (parameterizedType != null)
return parameterizedType;
// dependent type?
@@ -437,19 +437,19 @@ public class TypeSystem {
/* Note: Parameters will not have type type annotations if lookup environment directly uses TypeSystem. However when AnnotatableTypeSystem is in use,
they may and we need to materialize the unannotated versions and work on them.
- */
+ */
public RawTypeBinding getRawType(ReferenceBinding genericType, ReferenceBinding enclosingType) {
if (!genericType.hasEnclosingInstanceContext() && enclosingType != null) {
enclosingType = (ReferenceBinding) enclosingType.original();
}
ReferenceBinding unannotatedGenericType = (ReferenceBinding) getUnannotatedType(genericType);
ReferenceBinding unannotatedEnclosingType = enclosingType == null ? null : (ReferenceBinding) getUnannotatedType(enclosingType);
-
+
TypeBinding[] derivedTypes = this.types[unannotatedGenericType.id];
int i, length = derivedTypes.length;
for (i = 0; i < length; i++) {
TypeBinding derivedType = derivedTypes[i];
- if (derivedType == null)
+ if (derivedType == null)
break;
if (!derivedType.isRawType() || derivedType.actualType() != unannotatedGenericType || derivedType.hasTypeAnnotations()) //$IDENTITY-COMPARISON$
continue;
@@ -462,7 +462,7 @@ public class TypeSystem {
System.arraycopy(derivedTypes, 0, derivedTypes = new TypeBinding[length * 2], 0, length);
this.types[unannotatedGenericType.id] = derivedTypes;
}
-
+
if(unannotatedGenericType.isStatic() && unannotatedEnclosingType != null) {
unannotatedEnclosingType=(ReferenceBinding) unannotatedEnclosingType.original();
}
@@ -473,18 +473,18 @@ public class TypeSystem {
this.types[this.typeid] = new TypeBinding[1];
return (RawTypeBinding) (this.types[rawTytpe.id = this.typeid++][0] = rawTytpe);
}
-
+
public RawTypeBinding getRawType(ReferenceBinding genericType, ReferenceBinding enclosingType, AnnotationBinding[] annotations) {
return getRawType(genericType, enclosingType);
}
/* Parameters will not have type type annotations if lookup environment directly uses TypeSystem. When AnnotatableTypeSystem is in use,
they may and we need to materialize the unannotated versions and work on them.
- */
+ */
public WildcardBinding getWildcard(ReferenceBinding genericType, int rank, TypeBinding bound, TypeBinding[] otherBounds, int boundKind) {
if (genericType == null) // pseudo wildcard denoting composite bounds for lub computation
genericType = ReferenceBinding.LUB_GENERIC;
-
+
ReferenceBinding unannotatedGenericType = (ReferenceBinding) getUnannotatedType(genericType);
int otherBoundsLength = otherBounds == null ? 0: otherBounds.length;
TypeBinding [] unannotatedOtherBounds = otherBounds == null ? null : new TypeBinding[otherBoundsLength];
@@ -499,7 +499,7 @@ public class TypeSystem {
int i, length = derivedTypes.length;
for (i = 0; i < length; i++) {
TypeBinding derivedType = derivedTypes[i];
- if (derivedType == null)
+ if (derivedType == null)
break;
if (!derivedType.isWildcard() || derivedType.actualType() != unannotatedGenericType || derivedType.hasTypeAnnotations()) //$IDENTITY-COMPARISON$
continue;
@@ -508,29 +508,29 @@ public class TypeSystem {
if (Util.effectivelyEqual(derivedType.additionalBounds(), unannotatedOtherBounds))
return (WildcardBinding) derivedType;
}
-
+
if (i == length) {
System.arraycopy(derivedTypes, 0, derivedTypes = new TypeBinding[length * 2], 0, length);
this.types[useDerivedTypesOfBound ? unannotatedBound.id :unannotatedGenericType.id] = derivedTypes;
}
TypeBinding wildcard = derivedTypes[i] = new WildcardBinding(unannotatedGenericType, rank, unannotatedBound, unannotatedOtherBounds, boundKind, this.environment);
-
+
int typesLength = this.types.length;
if (this.typeid == typesLength)
System.arraycopy(this.types, 0, this.types = new TypeBinding[typesLength * 2][], 0, typesLength);
this.types[this.typeid] = new TypeBinding[1];
return (WildcardBinding) (this.types[wildcard.id = this.typeid++][0] = wildcard);
}
-
+
// No need for an override in ATS, since interning is position specific and either the wildcard there is annotated or not.
public final CaptureBinding getCapturedWildcard(WildcardBinding wildcard, ReferenceBinding contextType, int start, int end, ASTNode cud, int id) {
-
+
WildcardBinding unannotatedWildcard = (WildcardBinding) getUnannotatedType(wildcard);
TypeBinding[] derivedTypes = this.types[unannotatedWildcard.id]; // by construction, cachedInfo != null now.
int i, length = derivedTypes.length;
-
+
/* Search backwards looking at recent captures, if we encounter a capture from a different compilation unit, this is a fresh uninterned capture.
- While compiling one file, we may reach into another file to build structure, we should not compile method bodies there, so we expect to see
+ While compiling one file, we may reach into another file to build structure, we should not compile method bodies there, so we expect to see
all captures from the same file together without being interleaved by captures from other files.
*/
int nullSlot = length;
@@ -540,7 +540,7 @@ public class TypeSystem {
break;
}
TypeBinding derivedType = derivedTypes[i];
- if (derivedType == null) {
+ if (derivedType == null) {
nullSlot = i;
continue;
}
@@ -555,7 +555,7 @@ public class TypeSystem {
continue;
return prior;
}
-
+
if (i == length) {
System.arraycopy(derivedTypes, 0, derivedTypes = new TypeBinding[length * 2], 0, length);
this.types[unannotatedWildcard.id] = derivedTypes;
@@ -563,7 +563,7 @@ public class TypeSystem {
return (CaptureBinding) (derivedTypes[i] = new CaptureBinding(wildcard, contextType, start, end, cud, id));
// the above constructor already registers the capture, don't repeat that here
}
-
+
public WildcardBinding getWildcard(ReferenceBinding genericType, int rank, TypeBinding bound, TypeBinding[] otherBounds, int boundKind, AnnotationBinding[] annotations) {
return getWildcard(genericType, rank, bound, otherBounds, boundKind);
}
@@ -571,16 +571,16 @@ public class TypeSystem {
public TypeBinding getAnnotatedType(TypeBinding type, AnnotationBinding[][] annotations) {
return type; // Nothing to do for plain vanilla type system.
}
-
+
protected final TypeBinding /* @NonNull */ [] getDerivedTypes(TypeBinding keyType) {
keyType = getUnannotatedType(keyType);
return this.types[keyType.id];
}
-
+
private TypeBinding cacheDerivedType(TypeBinding keyType, TypeBinding derivedType) {
if (keyType == null || derivedType == null || keyType.id == TypeIds.NoId)
throw new IllegalStateException();
-
+
TypeBinding[] derivedTypes = this.types[keyType.id];
// binary search for the *earliest* slot with a null reference. By design and construction, a null value will never be followed by a valid derived type.
int first, last,length = derivedTypes.length;
@@ -591,7 +591,7 @@ public class TypeSystem {
if (i == first || i > 0 && derivedTypes[i - 1] != null)
break;
last = i - 1;
- } else {
+ } else {
first = i + 1;
}
i = (first + last) / 2;
@@ -602,19 +602,19 @@ public class TypeSystem {
}
return derivedTypes[i] = derivedType;
}
-
+
protected final TypeBinding cacheDerivedType(TypeBinding keyType, TypeBinding nakedType, TypeBinding derivedType) {
-
+
/* Cache the derived type, tagging it as a derivative of both the key type and the naked type.
E.g: int @NonNull [] would be tagged as a derived type of both int and int []. This is not
needed for correctness, but for annotated object reuse. We provide two alternate ways to
- annotate a type:
-
+ annotate a type:
+
Taking parameterized types as an example, a call to getParamaterizedType can be made with annotations
to create @NonNull List<@NonNull String> in one stroke. Or a parameterized type can be created first
and then annotated via getAnnotatedType. In the former case, the tables get looked up with List as
the key, in the latter with List<String> as the key.
-
+
Binary vs source, substitutions, annotation re-attribution from SE7 locations etc trigger these
alternate code paths. Unless care is exercised, we will end up with duplicate objects (that share
the same TypeBinding.id => correctness is not an issue, but memory wastage is)
@@ -625,16 +625,16 @@ public class TypeSystem {
}
return derivedType;
}
-
+
/* Return a unique annotation binding for an annotation with either no or all default element-value pairs.
- We may return a resolved annotation when requested for unresolved one, but not vice versa.
+ We may return a resolved annotation when requested for unresolved one, but not vice versa.
*/
public final AnnotationBinding getAnnotationType(ReferenceBinding annotationType, boolean requiredResolved) {
AnnotationBinding annotation = (AnnotationBinding) this.annotationTypes.get(annotationType);
if (annotation == null) {
if (requiredResolved)
annotation = new AnnotationBinding(annotationType, Binding.NO_ELEMENT_VALUE_PAIRS);
- else
+ else
annotation = new UnresolvedAnnotationBinding(annotationType, Binding.NO_ELEMENT_VALUE_PAIRS, this.environment);
this.annotationTypes.put(annotationType, annotation);
}
@@ -664,7 +664,7 @@ public class TypeSystem {
this.types = new TypeBinding[TypeIds.T_LastWellKnownTypeId * 2][];
this.parameterizedTypes = new HashedParameterizedTypes();
}
-
+
public void updateCaches(UnresolvedReferenceBinding unresolvedType, ReferenceBinding resolvedType) {
final int unresolvedTypeId = unresolvedType.id;
if (resolvedType.id != TypeIds.NoId) {
@@ -701,13 +701,13 @@ public class TypeSystem {
TypeBinding keyType = intersectingTypes[0];
if (keyType == null || intersectingTypesLength == 1)
return keyType;
-
+
TypeBinding[] derivedTypes = getDerivedTypes(keyType);
int i, length = derivedTypes.length;
next:
for (i = 0; i < length; i++) {
TypeBinding derivedType = derivedTypes[i];
- if (derivedType == null)
+ if (derivedType == null)
break;
if (!derivedType.isIntersectionType18())
continue;
@@ -717,12 +717,12 @@ public class TypeSystem {
for (int j = 0; j < intersectingTypesLength; j++) {
if (intersectingTypes[j] != priorIntersectingTypes[j]) //$IDENTITY-COMPARISON$
continue next;
- }
+ }
return derivedType;
}
return cacheDerivedType(keyType, new IntersectionTypeBinding18(intersectingTypes, this.environment));
}
-
+
/**
* If a TVB was created with a dummy declaring element and needs to be fixed now,
* make sure that this update affects all early clones, too.
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java
index 1ac075359..7aaa42309 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.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
* Technical University Berlin - extended API and implementation
@@ -80,7 +80,7 @@ public class TypeVariableBinding extends ReferenceBinding {
// actual resolved variable supertypes (if no superclass bound, then associated to Object)
public ReferenceBinding superclass; // MUST NOT be modified directly, use setter !
public ReferenceBinding[] superInterfaces; // MUST NOT be modified directly, use setter !
-//{ObjectTeams: additions:
+//{ObjectTeams: additions:
// bound in <B base R>:
public ReferenceBinding roletype;
// anchor in C<R<@t ..>>:
@@ -88,7 +88,7 @@ public class TypeVariableBinding extends ReferenceBinding {
// SH}
public char[] genericTypeSignature;
LookupEnvironment environment;
-
+
public TypeVariableBinding(char[] sourceName, Binding declaringElement, int rank, LookupEnvironment environment) {
this.sourceName = sourceName;
this.declaringElement = declaringElement;
@@ -99,7 +99,7 @@ public class TypeVariableBinding extends ReferenceBinding {
this.typeBits = TypeIds.BitUninitialized;
computeId(environment);
}
-
+
// for subclass CaptureBinding
protected TypeVariableBinding(char[] sourceName, LookupEnvironment environment) {
this.sourceName = sourceName;
@@ -314,7 +314,7 @@ public class TypeVariableBinding extends ReferenceBinding {
}
// check value-dependent type-variable:
if (this.anchors != null && substitution != null) {
- ITeamAnchor anchor = substitution.substituteAnchor(this.anchors[0], 0); // TODO(SH): support multiple anchors
+ ITeamAnchor anchor = substitution.substituteAnchor(this.anchors[0], 0); // TODO(SH): support multiple anchors
if (anchor != null) {
if (!(argumentType instanceof DependentTypeBinding)) {
return BoundCheckStatus.MISMATCH;
@@ -517,7 +517,7 @@ public class TypeVariableBinding extends ReferenceBinding {
}
return this.superclass.constantPoolName(); // java/lang/Object
}
-
+
@Override
public TypeBinding clone(TypeBinding enclosingType) {
return new TypeVariableBinding(this);
@@ -699,7 +699,7 @@ public class TypeVariableBinding extends ReferenceBinding {
// to prevent infinite recursion when inspecting recursive generics:
boolean inRecursiveFunction = false;
-
+
@Override
public boolean enterRecursiveFunction() {
if (this.inRecursiveFunction)
@@ -714,7 +714,7 @@ public class TypeVariableBinding extends ReferenceBinding {
// to prevent infinite recursion when inspecting recursive generics:
boolean inRecursiveProjectionFunction = false;
-
+
public boolean enterRecursiveProjectionFunction() {
if (this.inRecursiveProjectionFunction)
return false;
@@ -730,7 +730,7 @@ public class TypeVariableBinding extends ReferenceBinding {
// handle recursive calls:
if (this.inRecursiveFunction) // be optimistic, since this node is not an inference variable
return true;
-
+
this.inRecursiveFunction = true;
try {
if (this.superclass != null && !this.superclass.isProperType(admitCapture18)) {
@@ -825,7 +825,7 @@ public class TypeVariableBinding extends ReferenceBinding {
public int kind() {
return Binding.TYPE_PARAMETER;
}
-
+
@Override
public boolean mentionsAny(TypeBinding[] parameters, int idx) {
if (this.inRecursiveFunction)
@@ -910,7 +910,7 @@ public class TypeVariableBinding extends ReferenceBinding {
return this;
long nullTagBits = this.tagBits & TagBits.AnnotationNullMASK;
-
+
TypeBinding oldSuperclass = this.superclass, oldFirstInterface = null;
if (this.superclass != null) {
ReferenceBinding resolveType = (ReferenceBinding) BinaryTypeBinding.resolveType(this.superclass, this.environment, true /* raw conversion */);
@@ -961,7 +961,7 @@ public class TypeVariableBinding extends ReferenceBinding {
this.modifiers &= ~ExtraCompilerModifiers.AccUnresolved;
return this;
}
-
+
@Override
public void setTypeAnnotations(AnnotationBinding[] annotations, boolean evalNullAnnotations) {
if (getClass() == TypeVariableBinding.class) {
@@ -985,12 +985,12 @@ public class TypeVariableBinding extends ReferenceBinding {
public ReferenceBinding superclass() {
return this.superclass;
}
-
+
@Override
public ReferenceBinding[] superInterfaces() {
return this.superInterfaces;
}
-
+
/**
* @see java.lang.Object#toString()
*/
@@ -1090,7 +1090,7 @@ public class TypeVariableBinding extends ReferenceBinding {
AnnotationBinding[] newAnnotations = this.environment.filterNullTypeAnnotations(this.typeAnnotations);
if (newAnnotations.length > 0)
return this.environment.createAnnotatedType(unannotated, newAnnotations);
- return unannotated;
+ return unannotated;
}
/**
* Upper bound doesn't perform erasure
@@ -1127,7 +1127,7 @@ public class TypeVariableBinding extends ReferenceBinding {
this.firstBound = nullMismatchOnBound(parameter, this.firstBound, superNullTagBits, nullTagBits, scope);
}
}
- }
+ }
ReferenceBinding[] interfaces = this.superInterfaces;
int length;
if (interfaces != null && (length = interfaces.length) != 0) {
@@ -1279,9 +1279,9 @@ public class TypeVariableBinding extends ReferenceBinding {
@Override
public boolean isFreeTypeVariable() {
- return this.environment.usesNullTypeAnnotations()
- && this.environment.globalOptions.pessimisticNullAnalysisForFreeTypeVariablesEnabled
- && (this.tagBits & TagBits.AnnotationNullMASK) == 0;
+ return this.environment.usesNullTypeAnnotations()
+ && this.environment.globalOptions.pessimisticNullAnalysisForFreeTypeVariablesEnabled
+ && (this.tagBits & TagBits.AnnotationNullMASK) == 0;
}
@Override
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.java
index 953b9ad7d..bb1435a2a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.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
* Fraunhofer FIRST - extended API and implementation
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/VariableBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/VariableBinding.java
index c90d6e506..7ac3ad40c 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/VariableBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/VariableBinding.java
@@ -67,9 +67,9 @@ public abstract class VariableBinding
public Constant constant() {
return this.constant;
}
-
+
/**
- * Call this variant during resolve / analyse, so we can handle the case
+ * Call this variant during resolve / analyse, so we can handle the case
* when a tentative lambda resolve triggers resolving of outside code.
*/
public Constant constant(Scope scope) {
@@ -91,7 +91,7 @@ public abstract class VariableBinding
public final boolean isFinal() {
return (this.modifiers & ClassFileConstants.AccFinal) != 0;
}
-
+
public final boolean isEffectivelyFinal() {
return (this.tagBits & TagBits.IsEffectivelyFinal) != 0;
}
@@ -99,14 +99,14 @@ public abstract class VariableBinding
/** Answer true if null annotations are enabled and this field is specified @NonNull */
public boolean isNonNull() {
return (this.tagBits & TagBits.AnnotationNonNull) != 0
- || (this.type != null
+ || (this.type != null
&& (this.type.tagBits & TagBits.AnnotationNonNull) != 0);
}
/** Answer true if null annotations are enabled and this field is specified @Nullable */
public boolean isNullable() {
return (this.tagBits & TagBits.AnnotationNullable) != 0
- || (this.type != null
+ || (this.type != null
&& (this.type.tagBits & TagBits.AnnotationNullable) != 0);
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/VoidTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/VoidTypeBinding.java
index be4354b34..76d61ff2d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/VoidTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/VoidTypeBinding.java
@@ -21,17 +21,17 @@ public class VoidTypeBinding extends BaseTypeBinding {
VoidTypeBinding() {
super(TypeIds.T_void, TypeConstants.VOID, new char[] { 'V' });
}
-
+
@Override
public TypeBinding clone(TypeBinding enclosingType) {
return this; // enforce solitude.
}
-
+
@Override
public void setTypeAnnotations(AnnotationBinding[] annotations, boolean evalNullAnnotations) {
return; // reject misguided attempt.
}
-
+
@Override
public TypeBinding unannotated() {
return this;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java
index bcfb172e3..baf2a8b43 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.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
* Technical University Berlin - extended API and implementation
@@ -122,12 +122,12 @@ public class WildcardBinding extends ReferenceBinding {
TypeBinding bound() {
return this.bound;
}
-
+
@Override
int boundKind() {
return this.boundKind;
}
-
+
public TypeBinding allBounds() {
if (this.otherBounds == null || this.otherBounds.length == 0)
return this.bound;
@@ -140,8 +140,8 @@ public class WildcardBinding extends ReferenceBinding {
}
return this.environment.createIntersectionType18(allBounds);
}
-
-
+
+
@Override
public void setTypeAnnotations(AnnotationBinding[] annotations, boolean evalNullAnnotations) {
this.tagBits |= TagBits.HasTypeAnnotations;
@@ -258,17 +258,17 @@ public class WildcardBinding extends ReferenceBinding {
return nullTagBits;
}
-
+
@Override
public ReferenceBinding actualType() {
return this.genericType;
}
-
+
@Override
TypeBinding[] additionalBounds() {
return this.otherBounds;
}
-
+
@Override
public int kind() {
return this.otherBounds == null ? Binding.WILDCARD_TYPE : Binding.INTERSECTION_TYPE;
@@ -596,7 +596,7 @@ public class WildcardBinding extends ReferenceBinding {
public TypeBinding clone(TypeBinding immaterial) {
return new WildcardBinding(this.genericType, this.rank, this.bound, this.otherBounds, this.boundKind, this.environment);
}
-
+
@Override
public String annotatedDebugName() {
StringBuffer buffer = new StringBuffer(16);
@@ -689,7 +689,7 @@ public class WildcardBinding extends ReferenceBinding {
this.fPackage = someGenericType.getPackage();
}
if (someBound != null) {
- this.tagBits |= someBound.tagBits & (TagBits.HasTypeVariable | TagBits.HasMissingType | TagBits.ContainsNestedTypeReferences |
+ this.tagBits |= someBound.tagBits & (TagBits.HasTypeVariable | TagBits.HasMissingType | TagBits.ContainsNestedTypeReferences |
TagBits.HasNullTypeAnnotation | TagBits.HasCapturedWildcard);
}
if (someOtherBounds != null) {
@@ -824,7 +824,7 @@ public class WildcardBinding extends ReferenceBinding {
int rank() {
return this.rank;
}
-
+
@Override
public char[] readableName() {
switch (this.boundKind) {
@@ -1072,7 +1072,7 @@ public class WildcardBinding extends ReferenceBinding {
if (!hasNullTypeAnnotations())
return this;
AnnotationBinding[] newAnnotations = this.environment.filterNullTypeAnnotations(getTypeAnnotations());
- return this.environment.createWildcard(this.genericType, this.rank, this.bound, this.otherBounds, this.boundKind, newAnnotations);
+ return this.environment.createWildcard(this.genericType, this.rank, this.bound, this.otherBounds, this.boundKind, newAnnotations);
}
@Override
public TypeBinding uncapture(Scope scope) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java
index 29744073a..052dcee22 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java
@@ -58,7 +58,7 @@ public abstract class AbstractCommentParser implements JavadocTagConstants {
public boolean reportProblems;
protected long complianceLevel;
protected long sourceLevel;
-
+
// Support for {@inheritDoc}
protected long [] inheritedPositions;
protected int inheritedPositionsPtr;
@@ -342,7 +342,7 @@ public abstract class AbstractCommentParser implements JavadocTagConstants {
}
refreshInlineTagPosition(previousPosition);
}
- if (!isFormatterParser && !considerTagAsPlainText)
+ if (!isFormatterParser && !considerTagAsPlainText)
this.textStart = this.index;
setInlineTagStarted(false);
} else {
@@ -1097,7 +1097,7 @@ public abstract class AbstractCommentParser implements JavadocTagConstants {
case TerminalTokens.TokenNameRestrictedIdentifierYield:
throw new InvalidInputException(); // unexpected.
-
+
case TerminalTokens.TokenNameDOT :
if ((iToken & 1) == 0) { // dots must be even tokens
throw new InvalidInputException();
@@ -1603,7 +1603,7 @@ public abstract class AbstractCommentParser implements JavadocTagConstants {
}
this.inheritedPositions[this.inheritedPositionsPtr++] = position;
}
-
+
/*
* Refresh start position and length of an inline tag.
*/
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ConflictedParser.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ConflictedParser.java
index 8452b9869..a4d973657 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ConflictedParser.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ConflictedParser.java
@@ -14,7 +14,7 @@
package org.eclipse.jdt.internal.compiler.parser;
public interface ConflictedParser {
-
+
/* Return true if at the configuration the parser finds itself in, token would need to be disambiguated.
At Java SE 8 time, we have three tokens that need to clarified: the use of '( and that of '<' and finally
whether an @ begins a SE8 style type annotation or a SE5 declaration annotation. Where they can co-exist,
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java
index 065d6678d..a41587237 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java
@@ -63,7 +63,7 @@ public class JavadocParser extends AbstractCommentParser {
// returns whether this JavadocParser should report errors or not (overrides reportProblems)
// see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=192449"
public boolean shouldReportProblems = true;
-
+
// flag to let the parser know that the current tag is waiting for a description
// see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=222900"
private int tagWaitingForDescription;
@@ -485,7 +485,7 @@ public class JavadocParser extends AbstractCommentParser {
}
break;
}
-
+
// Read tag name
char[] tagName = new char[32];
int length = 0;
@@ -633,7 +633,7 @@ public class JavadocParser extends AbstractCommentParser {
this.tagValue = TAG_LINKPLAIN_VALUE;
if (this.inlineTagStarted) {
valid = parseReference();
- }
+ }
} else if (length == TAG_LITERAL_LENGTH && this.inlineTagStarted && CharOperation.equals(TAG_LITERAL, tagName, 0, length)) {
this.tagValue = TAG_LITERAL_VALUE;
this.tagWaitingForDescription = this.tagValue;
@@ -1030,7 +1030,7 @@ public class JavadocParser extends AbstractCommentParser {
// Set positions
if (this.inheritedPositions != null && this.inheritedPositionsPtr != this.inheritedPositions.length) {
// Compact array by shrinking.
- System.arraycopy(this.inheritedPositions, 0,
+ System.arraycopy(this.inheritedPositions, 0,
this.inheritedPositions = new long[this.inheritedPositionsPtr], 0, this.inheritedPositionsPtr);
}
this.docComment.inheritedPositions = this.inheritedPositions;
@@ -1050,13 +1050,13 @@ public class JavadocParser extends AbstractCommentParser {
this.docComment.usesReferences = this.usesReferencesPtr >= 0 ? new IJavadocTypeReference[this.usesReferencesPtr+1] : NO_QUALIFIED_TYPE_REFERENCE;
for (int i = 0; i <= this.usesReferencesPtr; ++i) {
TypeReference ref = this.usesReferencesStack[i];
- this.docComment.usesReferences[i] = (IJavadocTypeReference)ref;
+ this.docComment.usesReferences[i] = (IJavadocTypeReference)ref;
}
this.docComment.providesReferences = this.providesReferencesPtr >= 0 ? new IJavadocTypeReference[this.providesReferencesPtr+1] : NO_QUALIFIED_TYPE_REFERENCE;
for (int i = 0; i <= this.providesReferencesPtr; ++i) {
TypeReference ref = this.providesReferencesStack[i];
- this.docComment.providesReferences[i] = (IJavadocTypeReference)ref;
+ this.docComment.providesReferences[i] = (IJavadocTypeReference)ref;
}
// If no nodes stored return
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java
index 7446d5b54..c41aa2b2b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java
@@ -118,7 +118,7 @@ public interface JavadocTagConstants {
public static final int TAG_IMPL_SPEC_VALUE = 28;
public static final int TAG_IMPL_NOTE_VALUE = 29;
public static final int TAG_OTHERS_VALUE = 100;
-
+
//{ObjectTeams: role tag
public static final char[] TAG_ROLE = "role".toCharArray(); //$NON-NLS-1$
public static final int TAG_ROLE_LENGTH = TAG_ROLE.length;
@@ -363,8 +363,8 @@ public interface JavadocTagConstants {
TAG_INDEX,
TAG_HIDDEN,
TAG_SUMMARY,
- TAG_API_NOTE,
- TAG_IMPL_SPEC,
+ TAG_API_NOTE,
+ TAG_IMPL_SPEC,
TAG_IMPL_NOTE,
};
public static final char[][] METHOD_TAGS = {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
index a56458fb8..abad7a57f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
@@ -13,7 +13,7 @@
* Tom Tromey - patch for readTable(String) as described in http://bugs.eclipse.org/bugs/show_bug.cgi?id=32196
* Fraunhofer FIRST - extended API and implementation
* Technical University Berlin - extended API and implementation
- * Stephan Herrmann - Contributions for
+ * Stephan Herrmann - Contributions for
* bug 366003 - CCE in ASTNode.resolveAnnotations(ASTNode.java:639)
* bug 374605 - Unreasonable warning for enum-based switch statements
* bug 393719 - [compiler] inconsistent warnings on iteration variables
@@ -97,12 +97,12 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.util.TypeAnalyzer;
*/
@SuppressWarnings({"rawtypes", "unchecked"})
public class Parser implements TerminalTokens, ParserBasicInformation, ConflictedParser, OperatorIds, TypeIds {
-
+
protected static final int THIS_CALL = ExplicitConstructorCall.This;
protected static final int SUPER_CALL = ExplicitConstructorCall.Super;
public static final char[] FALL_THROUGH_TAG = "$FALL-THROUGH$".toCharArray(); //$NON-NLS-1$
public static final char[] CASES_OMITTED_TAG = "$CASES-OMITTED$".toCharArray(); //$NON-NLS-1$
-
+
//{ObjectTeams: new constants for tsuper
protected static final int TSUPER_CALL = ExplicitConstructorCall.Tsuper;
protected static final int UNQUALIFIED = 0;
@@ -177,18 +177,18 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
private static final String UNEXPECTED_EOF = "Unexpected End Of File" ; //$NON-NLS-1$
public static boolean VERBOSE_RECOVERY = false;
-
+
private static enum LocalTypeKind {
LOCAL,
METHOD_REFERENCE,
LAMBDA,
}
-
+
// resumeOnSyntaxError codes:
protected static final int HALT = 0; // halt and throw up hands.
protected static final int RESTART = 1; // stacks adjusted, alternate goal from check point.
protected static final int RESUME = 2; // stacks untouched, just continue from where left off.
-
+
public Scanner scanner;
public int currentToken;
@@ -200,7 +200,7 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
}
}
public static int asi(int state) {
-
+
return asb[original_state(state)];
}
public final static short base_check(int i) {
@@ -231,9 +231,9 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
String file,
int length,
String[] tokens) {
-
+
byte[] result = new byte[length * 8];
-
+
for (int i = 0; i < tokens.length; i = i + 3) {
if("2".equals(tokens[i])) { //$NON-NLS-1$
int index = Integer.parseInt(tokens[i + 1]);
@@ -264,7 +264,7 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
} else if("recovery".equals(token)) { //$NON-NLS-1$
compliance = ClassFileConstants.JDK_DEFERRED;
}
-
+
int j = index * 8;
result[j] = (byte)(compliance >>> 56);
result[j + 1] = (byte)(compliance >>> 48);
@@ -276,22 +276,22 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
result[j + 7] = (byte)(compliance);
}
}
-
+
buildFileForTable(file, result);
}
private final static String[] buildFileForName(String filename, String contents) {
String[] result = new String[contents.length()];
result[0] = null;
int resultCount = 1;
-
+
StringBuffer buffer = new StringBuffer();
-
+
int start = contents.indexOf("name[]"); //$NON-NLS-1$
start = contents.indexOf('\"', start);
int end = contents.indexOf("};", start); //$NON-NLS-1$
-
+
contents = contents.substring(start, end);
-
+
boolean addLineSeparator = false;
int tokenStart = -1;
StringBuffer currentToken = new StringBuffer();
@@ -325,9 +325,9 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
if(currentToken.length() > 0) {
result[resultCount++] = currentToken.toString();
}
-
+
buildFileForTable(filename, buffer.toString().toCharArray());
-
+
System.arraycopy(result, 0, result = new String[resultCount], 0, resultCount);
return result;
}
@@ -337,11 +337,11 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
char[] newNonTerminalIndex,
String[] newName,
String[] tokens) {
-
+
ArrayList entries = new ArrayList();
-
+
boolean[] alreadyAdded = new boolean[newName.length];
-
+
for (int i = 0; i < tokens.length; i = i + 3) {
if("1".equals(tokens[i])) { //$NON-NLS-1$
int index = newNonTerminalIndex[newLhs[Integer.parseInt(tokens[i + 1])]];
@@ -391,7 +391,7 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
bytes[2 * i] = (byte) (chars[i] >>> 8);
bytes[2 * i + 1] = (byte) (chars[i] & 0xFF);
}
-
+
java.io.FileOutputStream stream = null;
try {
stream = new java.io.FileOutputStream(filename);
@@ -410,14 +410,14 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
System.out.println(filename + " creation complete"); //$NON-NLS-1$
}
private final static byte[] buildFileOfByteFor(String filename, String tag, String[] tokens) {
-
+
//transform the String tokens into chars before dumping then into file
-
+
int i = 0;
//read upto the tag
while (!tokens[i++].equals(tag)){/*empty*/}
//read upto the }
-
+
byte[] bytes = new byte[tokens.length]; //can't be bigger
int ic = 0;
String token;
@@ -425,22 +425,22 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
int c = Integer.parseInt(token);
bytes[ic++] = (byte) c;
}
-
+
//resize
System.arraycopy(bytes, 0, bytes = new byte[ic], 0, ic);
-
+
buildFileForTable(filename, bytes);
return bytes;
}
private final static char[] buildFileOfIntFor(String filename, String tag, String[] tokens) {
-
+
//transform the String tokens into chars before dumping then into file
-
+
int i = 0;
//read upto the tag
while (!tokens[i++].equals(tag)){/*empty*/}
//read upto the }
-
+
char[] chars = new char[tokens.length]; //can't be bigger
int ic = 0;
String token;
@@ -448,22 +448,22 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
int c = Integer.parseInt(token);
chars[ic++] = (char) c;
}
-
+
//resize
System.arraycopy(chars, 0, chars = new char[ic], 0, ic);
-
+
buildFileForTable(filename, chars);
return chars;
}
private final static void buildFileOfShortFor(String filename, String tag, String[] tokens) {
-
+
//transform the String tokens into chars before dumping then into file
-
+
int i = 0;
//read upto the tag
while (!tokens[i++].equals(tag)){/*empty*/}
//read upto the }
-
+
char[] chars = new char[tokens.length]; //can't be bigger
int ic = 0;
String token;
@@ -471,10 +471,10 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
int c = Integer.parseInt(token);
chars[ic++] = (char) (c + 32768);
}
-
+
//resize
System.arraycopy(chars, 0, chars = new char[ic], 0, ic);
-
+
buildFileForTable(filename, chars);
}
private static void buildFilesForRecoveryTemplates(
@@ -485,13 +485,13 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
String[] newName,
char[] newLhs,
String[] tokens) {
-
+
int[] newReverse = computeReverseTable(newTerminalIndex, newNonTerminalIndex, newName);
-
+
char[] newRecoveyTemplatesIndex = new char[newNonTerminalIndex.length];
char[] newRecoveyTemplates = new char[newNonTerminalIndex.length];
int newRecoveyTemplatesPtr = 0;
-
+
for (int i = 0; i < tokens.length; i = i + 3) {
if("3".equals(tokens[i])) { //$NON-NLS-1$
int length = newRecoveyTemplates.length;
@@ -499,11 +499,11 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
System.arraycopy(newRecoveyTemplates, 0, newRecoveyTemplates = new char[length * 2], 0, length);
}
newRecoveyTemplates[newRecoveyTemplatesPtr++] = 0;
-
+
int index = newLhs[Integer.parseInt(tokens[i + 1])];
-
+
newRecoveyTemplatesIndex[index] = (char)newRecoveyTemplatesPtr;
-
+
String token = tokens[i + 2].trim();
java.util.StringTokenizer st = new java.util.StringTokenizer(token, " "); //$NON-NLS-1$
String[] terminalNames = new String[st.countTokens()];
@@ -511,7 +511,7 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
while (st.hasMoreTokens()) {
terminalNames[t++] = st.nextToken();
}
-
+
for (int j = 0; j < terminalNames.length; j++) {
int symbol = getSymbol(terminalNames[j], newName, newReverse);
if(symbol > -1) {
@@ -526,7 +526,7 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
}
newRecoveyTemplates[newRecoveyTemplatesPtr++] = 0;
System.arraycopy(newRecoveyTemplates, 0, newRecoveyTemplates = new char[newRecoveyTemplatesPtr], 0, newRecoveyTemplatesPtr);
-
+
buildFileForTable(indexFilename, newRecoveyTemplatesIndex);
buildFileForTable(templatesFilename, newRecoveyTemplates);
}
@@ -535,25 +535,25 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
char[] newNonTerminalIndex,
char[] newLhs,
String[] tokens) {
-
+
char[] newStatementsRecoveryFilter = new char[newNonTerminalIndex.length];
-
+
for (int i = 0; i < tokens.length; i = i + 3) {
if("4".equals(tokens[i])) { //$NON-NLS-1$
int index = newLhs[Integer.parseInt(tokens[i + 1])];
-
+
newStatementsRecoveryFilter[index] = 1;
}
}
buildFileForTable(filename, newStatementsRecoveryFilter);
}
public final static void buildFilesFromLPG(String dataFilename, String dataFilename2) {
-
+
//RUN THIS METHOD TO GENERATE PARSER*.RSC FILES
-
+
//build from the lpg javadcl.java files that represents the parser tables
//lhs check_table asb asr symbol_index
-
+
//[org.eclipse.jdt.internal.compiler.parser.Parser.buildFilesFromLPG("d:/leapfrog/grammar/javadcl.java")]
char[] contents = CharOperation.NO_CHAR;
try {
@@ -571,7 +571,7 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
}
final String prefix = FILEPREFIX;
int i = 0;
-
+
char[] newLhs = buildFileOfIntFor(prefix + (++i) + ".rsc", "lhs", tokens); //$NON-NLS-1$ //$NON-NLS-2$
buildFileOfShortFor(prefix + (++i) + ".rsc", "check_table", tokens); //$NON-NLS-2$ //$NON-NLS-1$
buildFileOfIntFor(prefix + (++i) + ".rsc", "asb", tokens); //$NON-NLS-2$ //$NON-NLS-1$
@@ -581,7 +581,7 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
char[] newTerminalIndex = buildFileOfIntFor(prefix + (++i) + ".rsc", "terminal_index", tokens); //$NON-NLS-2$ //$NON-NLS-1$
char[] newNonTerminalIndex = buildFileOfIntFor(prefix + (++i) + ".rsc", "non_terminal_index", tokens); //$NON-NLS-1$ //$NON-NLS-2$
buildFileOfIntFor(prefix + (++i) + ".rsc", "term_action", tokens); //$NON-NLS-2$ //$NON-NLS-1$
-
+
buildFileOfIntFor(prefix + (++i) + ".rsc", "scope_prefix", tokens); //$NON-NLS-2$ //$NON-NLS-1$
buildFileOfIntFor(prefix + (++i) + ".rsc", "scope_suffix", tokens); //$NON-NLS-2$ //$NON-NLS-1$
buildFileOfIntFor(prefix + (++i) + ".rsc", "scope_lhs", tokens); //$NON-NLS-2$ //$NON-NLS-1$
@@ -589,7 +589,7 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
buildFileOfIntFor(prefix + (++i) + ".rsc", "scope_rhs", tokens); //$NON-NLS-2$ //$NON-NLS-1$
buildFileOfIntFor(prefix + (++i) + ".rsc", "scope_state", tokens); //$NON-NLS-2$ //$NON-NLS-1$
buildFileOfIntFor(prefix + (++i) + ".rsc", "in_symb", tokens); //$NON-NLS-2$ //$NON-NLS-1$
-
+
//{ObjectTeams: changed byte to char to support larger grammar:
/* orig:
byte[] newRhs = buildFileOfByteFor(prefix + (++i) + ".rsc", "rhs", tokens); //$NON-NLS-2$ //$NON-NLS-1$
@@ -598,9 +598,9 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
// SH}
buildFileOfIntFor(prefix + (++i) + ".rsc", "term_check", tokens); //$NON-NLS-2$ //$NON-NLS-1$
buildFileOfIntFor(prefix + (++i) + ".rsc", "scope_la", tokens); //$NON-NLS-2$ //$NON-NLS-1$
-
+
String[] newName = buildFileForName(prefix + (++i) + ".rsc", new String(contents)); //$NON-NLS-1$
-
+
contents = CharOperation.NO_CHAR;
try {
contents = Util.getFileCharContent(new File(dataFilename2), null);
@@ -614,10 +614,10 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
while (st.hasMoreTokens()) {
tokens[j++] = st.nextToken();
}
-
+
buildFileForCompliance(prefix + (++i) + ".rsc", newRhs.length, tokens);//$NON-NLS-1$
buildFileForReadableName(READABLE_NAMES_FILE+".props", newLhs, newNonTerminalIndex, newName, tokens);//$NON-NLS-1$
-
+
buildFilesForRecoveryTemplates(
prefix + (++i) + ".rsc", //$NON-NLS-1$
prefix + (++i) + ".rsc", //$NON-NLS-1$
@@ -626,14 +626,14 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
newName,
newLhs,
tokens);
-
+
buildFilesForStatementsRecoveryFilter(
prefix + (++i) + ".rsc", //$NON-NLS-1$
newNonTerminalIndex,
newLhs,
tokens);
-
-
+
+
System.out.println(Messages.parser_moveFiles);
}
protected static int[] computeReverseTable(char[] newTerminalIndex, char[] newNonTerminalIndex, String[] newName) {
@@ -669,7 +669,7 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
return in_symb[original_state(state)];
}
public final static void initTables() throws java.io.IOException {
-
+
final String prefix = FILEPREFIX;
int i = 0;
lhs = readTable(prefix + (++i) + ".rsc"); //$NON-NLS-1$
@@ -685,7 +685,7 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
terminal_index = readTable(prefix + (++i) + ".rsc"); //$NON-NLS-1$
non_terminal_index = readTable(prefix + (++i) + ".rsc"); //$NON-NLS-1$
term_action = readTable(prefix + (++i) + ".rsc"); //$NON-NLS-1$
-
+
scope_prefix = readTable(prefix + (++i) + ".rsc"); //$NON-NLS-1$
scope_suffix = readTable(prefix + (++i) + ".rsc"); //$NON-NLS-1$
scope_lhs = readTable(prefix + (++i) + ".rsc"); //$NON-NLS-1$
@@ -693,7 +693,7 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
scope_rhs = readTable(prefix + (++i) + ".rsc"); //$NON-NLS-1$
scope_state = readTable(prefix + (++i) + ".rsc"); //$NON-NLS-1$
in_symb = readTable(prefix + (++i) + ".rsc"); //$NON-NLS-1$
-
+
//{ObjectTeams: changed byte to char to support larger grammar:
/* orig:
rhs = readByteTable(prefix + (++i) + ".rsc"); //$NON-NLS-1$
@@ -702,20 +702,20 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
// SH}
term_check = readTable(prefix + (++i) + ".rsc"); //$NON-NLS-1$
scope_la = readTable(prefix + (++i) + ".rsc"); //$NON-NLS-1$
-
+
name = readNameTable(prefix + (++i) + ".rsc"); //$NON-NLS-1$
-
+
rules_compliance = readLongTable(prefix + (++i) + ".rsc"); //$NON-NLS-1$
-
+
readableName = readReadableNameTable(READABLE_NAMES_FILE + ".props"); //$NON-NLS-1$
-
+
reverse_index = computeReverseTable(terminal_index, non_terminal_index, name);
-
+
recovery_templates_index = readTable(prefix + (++i) + ".rsc"); //$NON-NLS-1$
recovery_templates = readTable(prefix + (++i) + ".rsc"); //$NON-NLS-1$
-
+
statements_recovery_filter = readTable(prefix + (++i) + ".rsc"); //$NON-NLS-1$
-
+
base_action = lhs;
}
public static int nasi(int state) {
@@ -729,9 +729,9 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
}
protected static byte[] readByteTable(String filename) throws java.io.IOException {
-
+
//files are located at Parser.class directory
-
+
InputStream stream = Parser.class.getResourceAsStream(filename);
if (stream == null) {
throw new java.io.IOException(Messages.bind(Messages.parser_missingFile, filename));
@@ -750,9 +750,9 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
return bytes;
}
protected static long[] readLongTable(String filename) throws java.io.IOException {
-
+
//files are located at Parser.class directory
-
+
InputStream stream = Parser.class.getResourceAsStream(filename);
if (stream == null) {
throw new java.io.IOException(Messages.bind(Messages.parser_missingFile, filename));
@@ -768,17 +768,17 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
// ignore
}
}
-
+
//minimal integrity check (even size expected)
int length = bytes.length;
if (length % 8 != 0)
throw new java.io.IOException(Messages.bind(Messages.parser_corruptedFile, filename));
-
+
// convert bytes into longs
long[] longs = new long[length / 8];
int i = 0;
int longIndex = 0;
-
+
while (true) {
longs[longIndex++] =
(((long) (bytes[i++] & 0xFF)) << 56)
@@ -789,7 +789,7 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
+ (((long) (bytes[i++] & 0xFF)) << 16)
+ (((long) (bytes[i++] & 0xFF)) << 8)
+ (bytes[i++] & 0xFF);
-
+
if (i == length)
break;
}
@@ -799,18 +799,18 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
protected static String[] readNameTable(String filename) throws java.io.IOException {
char[] contents = readTable(filename);
char[][] nameAsChar = CharOperation.splitOn('\n', contents);
-
+
String[] result = new String[nameAsChar.length + 1];
result[0] = null;
for (int i = 0; i < nameAsChar.length; i++) {
result[i + 1] = new String(nameAsChar[i]);
}
-
+
return result;
}
protected static String[] readReadableNameTable(String filename){
String[] result = new String[name.length];
-
+
InputStream is = Parser.class.getResourceAsStream(filename);
Properties props = new Properties();
try {
@@ -833,9 +833,9 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
return result;
}
protected static char[] readTable(String filename) throws java.io.IOException {
-
+
//files are located at Parser.class directory
-
+
InputStream stream = Parser.class.getResourceAsStream(filename);
if (stream == null) {
throw new java.io.IOException(Messages.bind(Messages.parser_missingFile, filename));
@@ -851,17 +851,17 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
// ignore
}
}
-
+
//minimal integrity check (even size expected)
int length = bytes.length;
if ((length & 1) != 0)
throw new java.io.IOException(Messages.bind(Messages.parser_corruptedFile, filename));
-
+
// convert bytes into chars
char[] chars = new char[length / 2];
int i = 0;
int charIndex = 0;
-
+
while (true) {
chars[charIndex++] = (char) (((bytes[i++] & 0xFF) << 8) + (bytes[i++] & 0xFF));
if (i == length)
@@ -895,7 +895,7 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
public CompilationUnitDeclaration compilationUnit; /*the result from parse()*/
protected RecoveredElement currentElement;
-
+
protected boolean diet = false; //tells the scanner to jump over some parts of the code/expressions like method bodies
protected int dietInt = 0; // if > 0 force the none-diet-parsing mode (even if diet if requested) [field parsing with anonymous inner classes...]
protected int endPosition; //accurate only when used ! (the start position is pushed into intStack while the end the current one)
@@ -906,23 +906,23 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
protected Expression[] expressionStack = new Expression[ExpressionStackIncrement];
protected int rBracketPosition;
public int firstToken ; // handle for multiple parsing goals
-
+
/* jsr308 -- Type annotation management, we now maintain type annotations in a separate stack
as otherwise they get interspersed with other expressions and some of the code is not prepared
- to handle such interleaving and will look ugly if changed.
-
- See consumeArrayCreationExpressionWithoutInitializer for example.
+ to handle such interleaving and will look ugly if changed.
+
+ See consumeArrayCreationExpressionWithoutInitializer for example.
Where SE8 annotations occur in a place SE5 annotations are legal, the SE8 annotations end up in
the expression stack as we have no way of distinguishing between the two.
- */
+ */
protected int typeAnnotationPtr;
protected int typeAnnotationLengthPtr;
protected Annotation [] typeAnnotationStack = new Annotation[TypeAnnotationStackIncrement];
protected int [] typeAnnotationLengthStack;
// annotation stack
protected final static int TypeAnnotationStackIncrement = 100;
-
+
// generics management
protected int genericsIdentifiersLengthPtr;
protected int[] genericsIdentifiersLengthStack = new int[GenericsStackIncrement];
@@ -1118,7 +1118,7 @@ public RecoveredElement buildInitialRecoveryState(){
/* ignore current stack state, since restarting from the beginnning
since could not trust simple brace count */
// restart recovery from scratch
-//{ObjectTeams: do not discard package declaration if it should still be needed
+//{ObjectTeams: do not discard package declaration if it should still be needed
// for role file linking:
if ( (this.firstToken == TokenNamePLUS_PLUS) // compilation unit
|| (this.firstToken == TokenNameQUESTION)) // package declaration
@@ -1409,7 +1409,7 @@ protected void checkForDiamond(TypeReference allocType) {
type.bits |= ASTNode.IsDiamond;
} // else don't even bother to recognize this as <>
}
- }
+ }
else if (allocType instanceof ParameterizedQualifiedTypeReference) {
ParameterizedQualifiedTypeReference type = (ParameterizedQualifiedTypeReference) allocType;
if (type.typeArguments[type.typeArguments.length - 1] == TypeReference.NO_TYPE_ARGUMENTS) { // Don't care for X<>.Y<> and X<>.Y<String>
@@ -1516,7 +1516,7 @@ protected ParameterizedQualifiedTypeReference computeQualifiedGenericsFromRightS
}
nameSize--;
}
-
+
if ((typeRef.annotations = typeAnnotations) != null) {
typeRef.bits |= ASTNode.HasTypeAnnotations;
}
@@ -2767,7 +2767,7 @@ protected void consumeCalloutBindingLeft(boolean hasSignature) {
// CalloutKind
calloutBinding.calloutKind = this.intStack[this.intPtr--];
- calloutBinding.bindingTokenStart = this.intStack[this.intPtr--];
+ calloutBinding.bindingTokenStart = this.intStack[this.intPtr--];
if (calloutBinding.calloutKind == TokenNameBINDOUT) // as apposed to '=>'
this.intPtr--; // from Scanner.currentPosition for LE.arrowPosition
calloutBinding.modifierEnd = calloutBinding.bindingTokenStart+1; // assume just '->' or '=>', until we find actual callout modifiers (get/set)
@@ -2951,7 +2951,7 @@ private void checkIllegalModifierInMapping(AbstractMethodMappingDeclaration meth
/** Check for a callout modifier in this.modifiers.
* If one is found convert the method spec to a field spec.
*/
-private void checkCalloutModifier(CalloutMappingDeclaration calloutBinding)
+private void checkCalloutModifier(CalloutMappingDeclaration calloutBinding)
{
FieldAccessSpec fieldAccessSpec = null;
if ( this.modifiers == TokenNameget
@@ -2961,14 +2961,14 @@ private void checkCalloutModifier(CalloutMappingDeclaration calloutBinding)
MethodSpec baseMethodSpec = calloutBinding.baseMethodSpec;
fieldAccessSpec = newFieldAccessSpec(baseMethodSpec.selector,
(((long)baseMethodSpec.sourceStart)<<32)+baseMethodSpec.sourceEnd,
- null, // no type, since callout-short
+ null, // no type, since callout-short
this.modifiers);
calloutBinding.baseMethodSpec = fieldAccessSpec;
this.modifiers = 0;
} else if (calloutBinding.baseMethodSpec instanceof FieldAccessSpec) {
fieldAccessSpec = (FieldAccessSpec)calloutBinding.baseMethodSpec;
}
-
+
if (fieldAccessSpec != null) {
calloutBinding.modifierStart = this.intStack[this.intPtr--];
calloutBinding.modifierEnd = this.intStack[this.intPtr--];
@@ -3062,7 +3062,7 @@ protected void consumeCaseLabel() {
}
protected void consumeCastExpressionLL1() {
//CastExpression ::= '(' Name ')' InsideCastExpressionLL1 UnaryExpressionNotPlusMinus
-
+
//optimize push/pop
@@ -3102,7 +3102,7 @@ protected void consumeCastExpressionLL1WithBounds() {
}
protected void consumeCastExpressionWithGenericsArray() {
// CastExpression ::= PushLPAREN Name TypeArguments Dimsopt AdditionalBoundsListOpt PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus
-
+
TypeReference[] bounds = null;
int additionalBoundsLength = this.genericsLengthStack[this.genericsLengthPtr--];
if (additionalBoundsLength > 0) {
@@ -3119,7 +3119,7 @@ protected void consumeCastExpressionWithGenericsArray() {
pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]);
if (additionalBoundsLength > 0) {
bounds[0] = getTypeReference(dim);
- castType = createIntersectionCastTypeReference(bounds);
+ castType = createIntersectionCastTypeReference(bounds);
} else {
castType = getTypeReference(dim);
}
@@ -3147,7 +3147,7 @@ protected void consumeCastExpressionWithNameArray() {
// handle type arguments
pushOnGenericsLengthStack(0);
pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]);
-
+
if (additionalBoundsLength > 0) {
bounds[0] = getTypeReference(this.intStack[this.intPtr--]);
castType = createIntersectionCastTypeReference(bounds);
@@ -3171,7 +3171,7 @@ protected void consumeCastExpressionWithPrimitiveType() {
this.genericsPtr -= additionalBoundsLength;
System.arraycopy(this.genericsStack, this.genericsPtr + 1, bounds, 1, additionalBoundsLength);
}
-
+
//optimize the push/pop
Expression exp;
Expression cast;
@@ -3179,7 +3179,7 @@ protected void consumeCastExpressionWithPrimitiveType() {
int end = this.intStack[this.intPtr--];
if (additionalBoundsLength > 0) {
bounds[0] = getTypeReference(this.intStack[this.intPtr--]);
- castType = createIntersectionCastTypeReference(bounds);
+ castType = createIntersectionCastTypeReference(bounds);
} else {
castType = getTypeReference(this.intStack[this.intPtr--]);
}
@@ -3210,9 +3210,9 @@ protected void consumeCastExpressionWithQualifiedGenericsArray() {
if (additionalBoundsLength > 0) {
bounds[0] = castType;
- castType = createIntersectionCastTypeReference(bounds);
+ castType = createIntersectionCastTypeReference(bounds);
}
-
+
this.intPtr--;
this.expressionStack[this.expressionPtr] = cast = new CastExpression(exp = this.expressionStack[this.expressionPtr], castType);
castType.sourceEnd = end - 1;
@@ -3248,7 +3248,7 @@ protected void consumeCatchFormalParameter() {
type.sourceEnd = this.endPosition;
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=391092
if (type instanceof UnionTypeReference) {
- this.problemReporter().illegalArrayOfUnionType(identifierName, type);
+ this.problemReporter().illegalArrayOfUnionType(identifierName, type);
}
}
this.astLengthPtr--;
@@ -3651,7 +3651,7 @@ protected void consumeClassInstanceCreationExpressionQualified() {
QualifiedAllocationExpression qae =
(QualifiedAllocationExpression) this.expressionStack[this.expressionPtr];
-
+
if (qae.anonymousType == null) {
this.expressionLengthPtr--;
this.expressionPtr--;
@@ -3715,10 +3715,10 @@ protected void consumeClassInstanceCreationExpressionQualifiedWithTypeArguments(
checkForDiamond(allocationExpression.type);
}
}
-
+
QualifiedAllocationExpression qae =
(QualifiedAllocationExpression) this.expressionStack[this.expressionPtr];
-
+
if (qae.anonymousType == null) {
this.expressionLengthPtr--;
this.expressionPtr--;
@@ -4423,12 +4423,12 @@ protected void consumeEnterAnonymousClassBody(boolean qualified) {
0,
argumentLength);
}
-
+
if (qualified) {
this.expressionLengthPtr--;
alloc.enclosingInstance = this.expressionStack[this.expressionPtr--];
}
-
+
alloc.type = typeReference;
anonymousType.sourceEnd = alloc.sourceEnd;
@@ -4450,7 +4450,7 @@ protected void consumeEnterAnonymousClassBody(boolean qualified) {
if (!(this.currentElement instanceof RecoveredAnnotation)) {
if (isIndirectlyInsideLambdaExpression())
this.ignoreNextOpeningBrace = true;
- else
+ else
this.currentToken = 0; // opening brace already taken into account
} else {
this.ignoreNextOpeningBrace = true;
@@ -4501,7 +4501,7 @@ private boolean isAFieldDeclarationInRecord() {
return false;
}
} else if (node instanceof AbstractMethodDeclaration) {
- if (this.nestedType != nestingTypeAndMethod[0] ||
+ if (this.nestedType != nestingTypeAndMethod[0] ||
this.nestedMethod[this.nestedType] != nestingTypeAndMethod[1])
return false;
} else if (node instanceof FieldDeclaration) {
@@ -4596,7 +4596,7 @@ protected void consumeEnterVariable() {
declaration.type = extendedDimensions == 0 ? type : augmentTypeWithAdditionalDimensions(type, extendedDimensions, annotationsOnExtendedDimensions, false);
declaration.bits |= (type.bits & ASTNode.HasTypeAnnotations);
-
+
this.variablesCounter[this.nestedType]++;
pushOnAstStack(declaration);
// recovery
@@ -5354,7 +5354,7 @@ protected void consumeFormalParameter(boolean isVarArgs) {
varArgsAnnotations = new Annotation[length],
0,
length);
- }
+ }
}
//{ObjectTeams: LiftingTypeReference?
// Inserted via LiftingTypeopt, e.g.,:
@@ -5387,8 +5387,8 @@ protected void consumeFormalParameter(boolean isVarArgs) {
// SH}
if (isVarArgs || extendedDimensions != 0) {
if (isVarArgs) {
- type = augmentTypeWithAdditionalDimensions(type, 1, varArgsAnnotations != null ? new Annotation[][] { varArgsAnnotations } : null, true);
- }
+ type = augmentTypeWithAdditionalDimensions(type, 1, varArgsAnnotations != null ? new Annotation[][] { varArgsAnnotations } : null, true);
+ }
if (extendedDimensions != 0) {
type = augmentTypeWithAdditionalDimensions(type, extendedDimensions, annotationsOnExtendedDimensions, false);
}
@@ -5404,8 +5404,8 @@ protected void consumeFormalParameter(boolean isVarArgs) {
Argument arg;
if (isReceiver) {
arg = new Receiver(
- identifierName,
- namePositions,
+ identifierName,
+ namePositions,
type,
qualifyingNameReference,
this.intStack[this.intPtr--] & ~ClassFileConstants.AccDeprecated);
@@ -5497,7 +5497,7 @@ protected void consumeGenericTypeWithDiamond() {
// zero type arguments == <>
pushOnGenericsLengthStack(-1);
concatGenericsLists();
- this.intPtr--; // pop the null dimension pushed in by consumeReferenceType, as we have no type between <>, getTypeReference won't kick in
+ this.intPtr--; // pop the null dimension pushed in by consumeReferenceType, as we have no type between <>, getTypeReference won't kick in
}
protected void consumeImportDeclaration() {
// SingleTypeImportDeclaration ::= SingleTypeImportDeclarationName ';'
@@ -5539,7 +5539,7 @@ protected void consumeInsideCastExpressionLL1WithBounds() {
pushOnGenericsLengthStack(0); // handle type arguments
pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]);
bounds[0] = getTypeReference(0);
-
+
for (int i = 0; i <= additionalBoundsLength; i++) {
pushOnExpressionStack(bounds[i]);
if (i > 0)
@@ -5645,8 +5645,8 @@ protected void consumeInterfaceDeclaration() {
//convert constructor that do not have the type's name into methods
typeDecl.checkConstructors(this);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=212713,
+
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=212713,
// reject initializers that have been tolerated by the grammar.
FieldDeclaration [] fields = typeDecl.fields;
int fieldCount = fields == null ? 0 : fields.length;
@@ -5896,7 +5896,7 @@ protected void consumeInvalidInterfaceDeclaration() {
protected void consumeInterfaceMethodDeclaration(boolean hasSemicolonBody) {
// InterfaceMemberDeclaration ::= DefaultMethodHeader MethodBody
// InterfaceMemberDeclaration ::= MethodHeader MethodBody
- // -- the next rule is illegal but allows to give a more canonical error message from inside consumeInterfaceMethodDeclaration():
+ // -- the next rule is illegal but allows to give a more canonical error message from inside consumeInterfaceMethodDeclaration():
// InterfaceMemberDeclaration ::= DefaultMethodHeader ';'
@@ -5916,9 +5916,9 @@ protected void consumeInterfaceMethodDeclaration(boolean hasSemicolonBody) {
// pop the position of the { (body of the method) pushed in block decl
this.intPtr--;
this.intPtr--;
-
+
explicitDeclarations = this.realBlockStack[this.realBlockPtr--];
-
+
//statements
int length;
if ((length = this.astLengthStack[this.astLengthPtr--]) != 0) {
@@ -5941,7 +5941,7 @@ protected void consumeInterfaceMethodDeclaration(boolean hasSemicolonBody) {
md.explicitDeclarations = explicitDeclarations;
md.bodyEnd = this.endPosition;
md.declarationSourceEnd = flushCommentsDefinedPriorTo(this.endStatementPosition);
-
+
boolean isDefault = (md.modifiers & ExtraCompilerModifiers.AccDefaultMethod) != 0;
boolean isStatic = (md.modifiers & ClassFileConstants.AccStatic) != 0;
boolean isPrivate = (md.modifiers & ClassFileConstants.AccPrivate) != 0;
@@ -6040,13 +6040,13 @@ private void consumeBeginLiftingType() {
// SH}
protected void consumeLocalVariableDeclarationStatement() {
-
+
int variableDeclaratorsCounter = this.astLengthStack[this.astLengthPtr];
if (variableDeclaratorsCounter == 1) {
LocalDeclaration localDeclaration = (LocalDeclaration) this.astStack[this.astPtr];
if (localDeclaration.isRecoveredFromLoneIdentifier()) {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430336, [1.8][compiler] Bad syntax error recovery: Lonely identifier should be variable name, not type
- // Mutate foo $missing; into foo = $missing$;
+ // Mutate foo $missing; into foo = $missing$;
Expression left;
if (localDeclaration.type instanceof QualifiedTypeReference) {
QualifiedTypeReference qtr = (QualifiedTypeReference) localDeclaration.type;
@@ -6056,17 +6056,17 @@ protected void consumeLocalVariableDeclarationStatement() {
}
left.sourceStart = localDeclaration.type.sourceStart;
left.sourceEnd = localDeclaration.type.sourceEnd;
-
+
Expression right = new SingleNameReference(localDeclaration.name, 0L);
right.sourceStart = localDeclaration.sourceStart;
right.sourceEnd = localDeclaration.sourceEnd;
-
+
Assignment assignment = new Assignment(left, right, 0);
int end = this.endStatementPosition;
- assignment.sourceEnd = (end == localDeclaration.sourceEnd) ? ++end : end;
+ assignment.sourceEnd = (end == localDeclaration.sourceEnd) ? ++end : end;
assignment.statementEnd = end;
this.astStack[this.astPtr] = assignment;
-
+
// also massage recovery scanner data.
if (this.recoveryScanner != null) {
RecoveryScannerData data = this.recoveryScanner.getData();
@@ -6079,7 +6079,7 @@ protected void consumeLocalVariableDeclarationStatement() {
if (position >= 0)
this.recoveryScanner.insertTokenAhead(TerminalTokens.TokenNameEQUAL, position);
}
-
+
if (this.currentElement != null) {
this.lastCheckPoint = assignment.sourceEnd + 1;
this.currentElement = this.currentElement.add(assignment, 0);
@@ -6955,7 +6955,7 @@ protected void consumeTypeAnnotation() {
// TypeAnnotation ::= NormalTypeAnnotation
// TypeAnnotation ::= MarkerTypeAnnotation
// TypeAnnotation ::= SingleMemberTypeAnnotation
-
+
if (!this.statementRecoveryActivated &&
this.options.sourceLevel < ClassFileConstants.JDK1_8 &&
this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) {
@@ -7015,7 +7015,7 @@ protected void consumeNormalAnnotation(boolean isTypeAnnotation) {
length);
}
normalAnnotation.declarationSourceEnd = this.rParenPos;
-
+
if (isTypeAnnotation) {
pushOnTypeAnnotationStack(normalAnnotation);
} else {
@@ -7225,7 +7225,7 @@ protected void consumeTargetModuleList() {
node.declarationSourceEnd = node.sourceEnd;
}
}
-
+
this.listLength = 0; // reset after having read target modules list
// recovery TBD
if (this.currentElement != null) { // is recovering
@@ -7392,7 +7392,7 @@ protected void consumeModuleModifiers() {
}
protected void consumeModuleHeader() {
// ModuleHeader ::= 'module' Name
-
+
int length;
char[][] tokens =
new char[length = this.identifierLengthStack[this.identifierLengthPtr--]][];
@@ -7661,8 +7661,8 @@ protected void consumePackageDeclarationNameWithModifiers() {
if (packageModifiers != 0) {
problemReporter().illegalModifiers(packageModifiersSourceStart, packageModifiersSourceEnd);
}
-
-
+
+
if (this.currentToken == TokenNameSEMICOLON){
impt.declarationSourceEnd = this.scanner.currentPosition - 1;
} else {
@@ -7754,7 +7754,7 @@ protected void consumeNestedParamMappings() {
jumpOverMethodBody();
pushOnIntStack(1); // signal that we have param mappings
pushOnAstLengthStack(0); // no mappings yet
-
+
this.scanner._insideParameterMapping = true;
}
//SH}
@@ -7788,7 +7788,7 @@ private void consumePrecedenceDeclaration(boolean isAfter) {
pushOnAstStack(new PrecedenceDeclaration(
this.intStack[this.intPtr--],
flushCommentsDefinedPriorTo(this.endStatementPosition),
- isAfter,
+ isAfter,
references));
// recovery
// if (this.currentElement != null) { // is recovering
@@ -8094,7 +8094,7 @@ protected void consumePrimaryNoNewArrayName() {
pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]);
pushOnGenericsLengthStack(0);
TypeReference typeReference = getTypeReference(0);
-
+
rejectIllegalTypeAnnotations(typeReference);
pushOnExpressionStack(
@@ -8207,11 +8207,11 @@ protected void consumePushCombineModifiers() {
// ModifiersWithDefault ::= Modifiersopt 'default' Modifiersopt'
// int stack on entry : ... Modifiers, ModifiersSourceStart, defaultSourceStart, defaultSourceEnd, Modifiers', Modifiers'SourceStart <<--- intPtr
// int stack on exit : ... combinedModifiers, combinedModifiersSourceStart <<--- intPtr
-
+
this.intPtr--; // pop modifiers'SourceStart, real location is with earlier block
int newModifiers = this.intStack[this.intPtr--] | ExtraCompilerModifiers.AccDefaultMethod; // pop modifiers
this.intPtr -= 2; // pop location of 'default' keyword
-
+
if ((this.intStack[this.intPtr - 1] & newModifiers) != 0) { // duplicate modifier(s) ?
newModifiers |= ExtraCompilerModifiers.AccAlternateModifierProblem;
}
@@ -8242,7 +8242,7 @@ protected void consumePushRealModifiers() {
}
protected void consumeQualifiedName(boolean qualifiedNameIsAnnotated) {
// QualifiedName ::= Name '.' SimpleName
- // QualifiedName ::= Name '.' TypeAnnotations SimpleName
+ // QualifiedName ::= Name '.' TypeAnnotations SimpleName
/*back from the recursive loop of QualifiedName.
Updates identifier length into the length stack*/
@@ -8330,7 +8330,7 @@ protected void consumeResourceSpecification() {
protected void consumeResourceOptionalTrailingSemiColon(boolean punctuated) {
// TrailingSemiColon ::= ';'
Statement statement = (Statement) this.astStack[this.astPtr];
-
+
if (punctuated) {
if (statement instanceof LocalDeclaration) {
((LocalDeclaration) statement).declarationSourceEnd = this.endStatementPosition;
@@ -8384,2680 +8384,2680 @@ protected void consumeZeroTypeAnnotations() {
protected void consumeRule(int act) {
switch ( act ) {
case 42 : if (DEBUG) { System.out.println("Type ::= PrimitiveType"); } //$NON-NLS-1$
- consumePrimitiveType();
+ consumePrimitiveType();
break;
-
+
case 56 : if (DEBUG) { System.out.println("ReferenceType ::= ClassOrInterfaceType"); } //$NON-NLS-1$
- consumeReferenceType();
+ consumeReferenceType();
break;
-
+
case 60 : if (DEBUG) { System.out.println("ClassOrInterface ::= Name"); } //$NON-NLS-1$
- consumeClassOrInterfaceName();
+ consumeClassOrInterfaceName();
break;
-
+
case 61 : if (DEBUG) { System.out.println("ClassOrInterface ::= GenericType DOT Name"); } //$NON-NLS-1$
- consumeClassOrInterface();
+ consumeClassOrInterface();
break;
-
+
case 62 : if (DEBUG) { System.out.println("GenericType ::= ClassOrInterface TypeArguments"); } //$NON-NLS-1$
- consumeGenericType();
+ consumeGenericType();
break;
-
+
case 63 : if (DEBUG) { System.out.println("GenericType ::= ClassOrInterface LESS GREATER"); } //$NON-NLS-1$
- consumeGenericTypeWithDiamond();
+ consumeGenericTypeWithDiamond();
break;
-
+
case 65 : if (DEBUG) { System.out.println("LiftingTypeopt ::= as BeginLiftingType Type"); } //$NON-NLS-1$
- consumeLiftingType();
+ consumeLiftingType();
break;
-
+
case 66 : if (DEBUG) { System.out.println("BeginLiftingType ::="); } //$NON-NLS-1$
- consumeBeginLiftingType();
+ consumeBeginLiftingType();
break;
-
+
case 68 : if (DEBUG) { System.out.println("CatchLiftingTypeopt ::= as Type"); } //$NON-NLS-1$
- consumeLiftingType();
+ consumeLiftingType();
break;
-
+
case 69 : if (DEBUG) { System.out.println("BaseAnchoredType ::= base DOT SimpleName"); } //$NON-NLS-1$
- consumeBaseAnchoredType();
+ consumeBaseAnchoredType();
break;
-
+
case 72 : if (DEBUG) { System.out.println("ArrayTypeWithTypeArgumentsName ::= GenericType DOT Name"); } //$NON-NLS-1$
- consumeArrayTypeWithTypeArgumentsName();
+ consumeArrayTypeWithTypeArgumentsName();
break;
-
+
case 73 : if (DEBUG) { System.out.println("ArrayType ::= PrimitiveType Dims"); } //$NON-NLS-1$
- consumePrimitiveArrayType();
+ consumePrimitiveArrayType();
break;
-
+
case 74 : if (DEBUG) { System.out.println("ArrayType ::= Name Dims"); } //$NON-NLS-1$
- consumeNameArrayType();
+ consumeNameArrayType();
break;
-
+
case 75 : if (DEBUG) { System.out.println("ArrayType ::= ArrayTypeWithTypeArgumentsName Dims"); } //$NON-NLS-1$
- consumeGenericTypeNameArrayType();
+ consumeGenericTypeNameArrayType();
break;
-
+
case 76 : if (DEBUG) { System.out.println("ArrayType ::= GenericType Dims"); } //$NON-NLS-1$
- consumeGenericTypeArrayType();
+ consumeGenericTypeArrayType();
break;
-
+
case 78 : if (DEBUG) { System.out.println("Name ::= SimpleName"); } //$NON-NLS-1$
- consumeZeroTypeAnnotations();
+ consumeZeroTypeAnnotations();
break;
-
+
case 83 : if (DEBUG) { System.out.println("UnannotatableName ::= UnannotatableName DOT SimpleName"); } //$NON-NLS-1$
- consumeUnannotatableQualifiedName();
+ consumeUnannotatableQualifiedName();
break;
-
+
case 84 : if (DEBUG) { System.out.println("QualifiedName ::= Name DOT SimpleName"); } //$NON-NLS-1$
- consumeQualifiedName(false);
+ consumeQualifiedName(false);
break;
-
+
case 85 : if (DEBUG) { System.out.println("QualifiedName ::= Name DOT TypeAnnotations SimpleName"); } //$NON-NLS-1$
- consumeQualifiedName(true);
+ consumeQualifiedName(true);
break;
-
+
case 86 : if (DEBUG) { System.out.println("TypeAnnotationsopt ::="); } //$NON-NLS-1$
- consumeZeroTypeAnnotations();
+ consumeZeroTypeAnnotations();
break;
-
+
case 87 : if (DEBUG) { System.out.println("TypeAnnotationsopt -> TypeAnnotations"); } //$NON-NLS-1$
- confirmTypeAnnotation();
+ confirmTypeAnnotation();
break;
-
+
case 90 : if (DEBUG) { System.out.println("TypeAnnotations0 ::= TypeAnnotations0 TypeAnnotation"); } //$NON-NLS-1$
- consumeOneMoreTypeAnnotation();
+ consumeOneMoreTypeAnnotation();
break;
-
+
case 91 : if (DEBUG) { System.out.println("TypeAnnotation ::= NormalTypeAnnotation"); } //$NON-NLS-1$
- consumeTypeAnnotation();
+ consumeTypeAnnotation();
break;
-
+
case 92 : if (DEBUG) { System.out.println("TypeAnnotation ::= MarkerTypeAnnotation"); } //$NON-NLS-1$
- consumeTypeAnnotation();
+ consumeTypeAnnotation();
break;
-
+
case 93 : if (DEBUG) { System.out.println("TypeAnnotation ::= SingleMemberTypeAnnotation"); } //$NON-NLS-1$
- consumeTypeAnnotation();
+ consumeTypeAnnotation();
break;
-
+
case 94 : if (DEBUG) { System.out.println("TypeAnnotationName ::= AT308 UnannotatableName"); } //$NON-NLS-1$
- consumeAnnotationName() ;
+ consumeAnnotationName() ;
break;
-
+
case 95 : if (DEBUG) { System.out.println("NormalTypeAnnotation ::= TypeAnnotationName LPAREN..."); } //$NON-NLS-1$
- consumeNormalAnnotation(true) ;
+ consumeNormalAnnotation(true) ;
break;
-
+
case 96 : if (DEBUG) { System.out.println("MarkerTypeAnnotation ::= TypeAnnotationName"); } //$NON-NLS-1$
- consumeMarkerAnnotation(true) ;
+ consumeMarkerAnnotation(true) ;
break;
-
+
case 97 : if (DEBUG) { System.out.println("SingleMemberTypeAnnotation ::= TypeAnnotationName LPAREN"); } //$NON-NLS-1$
- consumeSingleMemberAnnotation(true) ;
+ consumeSingleMemberAnnotation(true) ;
break;
-
+
case 98 : if (DEBUG) { System.out.println("RejectTypeAnnotations ::="); } //$NON-NLS-1$
- consumeNonTypeUseName();
+ consumeNonTypeUseName();
break;
-
+
case 99 : if (DEBUG) { System.out.println("PushZeroTypeAnnotations ::="); } //$NON-NLS-1$
- consumeZeroTypeAnnotations();
+ consumeZeroTypeAnnotations();
break;
-
+
case 100 : if (DEBUG) { System.out.println("VariableDeclaratorIdOrThis ::= this"); } //$NON-NLS-1$
- consumeExplicitThisParameter(false);
+ consumeExplicitThisParameter(false);
break;
-
+
case 101 : if (DEBUG) { System.out.println("VariableDeclaratorIdOrThis ::= UnannotatableName DOT..."); } //$NON-NLS-1$
- consumeExplicitThisParameter(true);
+ consumeExplicitThisParameter(true);
break;
-
+
case 102 : if (DEBUG) { System.out.println("VariableDeclaratorIdOrThis ::= VariableDeclaratorId"); } //$NON-NLS-1$
- consumeVariableDeclaratorIdParameter();
+ consumeVariableDeclaratorIdParameter();
break;
-
+
case 103 : if (DEBUG) { System.out.println("CompilationUnit ::= EnterCompilationUnit..."); } //$NON-NLS-1$
- consumeCompilationUnit();
+ consumeCompilationUnit();
break;
-
+
case 104 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration"); } //$NON-NLS-1$
- consumeInternalCompilationUnit();
+ consumeInternalCompilationUnit();
break;
-
+
case 105 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); } //$NON-NLS-1$
- consumeInternalCompilationUnit();
+ consumeInternalCompilationUnit();
break;
-
+
case 106 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); } //$NON-NLS-1$
- consumeInternalCompilationUnitWithTypes();
+ consumeInternalCompilationUnitWithTypes();
break;
-
+
case 107 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); } //$NON-NLS-1$
- consumeInternalCompilationUnitWithTypes();
+ consumeInternalCompilationUnitWithTypes();
break;
-
+
case 108 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ImportDeclarations..."); } //$NON-NLS-1$
- consumeInternalCompilationUnit();
+ consumeInternalCompilationUnit();
break;
-
+
case 109 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= TypeDeclarations"); } //$NON-NLS-1$
- consumeInternalCompilationUnitWithTypes();
+ consumeInternalCompilationUnitWithTypes();
break;
-
+
case 110 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ImportDeclarations..."); } //$NON-NLS-1$
- consumeInternalCompilationUnitWithTypes();
+ consumeInternalCompilationUnitWithTypes();
break;
-
+
case 111 : if (DEBUG) { System.out.println("InternalCompilationUnit ::="); } //$NON-NLS-1$
- consumeEmptyInternalCompilationUnit();
+ consumeEmptyInternalCompilationUnit();
break;
-
+
case 112 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ImportDeclarations..."); } //$NON-NLS-1$
- consumeInternalCompilationUnitWithModuleDeclaration();
+ consumeInternalCompilationUnitWithModuleDeclaration();
break;
-
+
case 113 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ModuleDeclaration"); } //$NON-NLS-1$
- consumeInternalCompilationUnitWithModuleDeclaration();
+ consumeInternalCompilationUnitWithModuleDeclaration();
break;
-
+
case 114 : if (DEBUG) { System.out.println("ModuleDeclaration ::= ModuleHeader ModuleBody"); } //$NON-NLS-1$
- consumeModuleDeclaration();
+ consumeModuleDeclaration();
break;
-
+
case 115 : if (DEBUG) { System.out.println("ModuleHeader ::= Modifiersopt ModuleModifieropt module"); } //$NON-NLS-1$
- consumeModuleHeader();
+ consumeModuleHeader();
break;
-
+
case 117 : if (DEBUG) { System.out.println("ModuleModifieropt ::= ModuleModifier"); } //$NON-NLS-1$
- consumeModuleModifiers();
+ consumeModuleModifiers();
break;
-
+
case 120 : if (DEBUG) { System.out.println("ModuleStatementsOpt ::="); } //$NON-NLS-1$
- consumeEmptyModuleStatementsOpt();
+ consumeEmptyModuleStatementsOpt();
break;
-
+
case 123 : if (DEBUG) { System.out.println("ModuleStatements ::= ModuleStatements ModuleStatement"); } //$NON-NLS-1$
- consumeModuleStatements();
+ consumeModuleStatements();
break;
-
+
case 129 : if (DEBUG) { System.out.println("RequiresStatement ::= SingleRequiresModuleName SEMICOLON"); } //$NON-NLS-1$
- consumeRequiresStatement();
+ consumeRequiresStatement();
break;
-
+
case 130 : if (DEBUG) { System.out.println("SingleRequiresModuleName ::= requires..."); } //$NON-NLS-1$
- consumeSingleRequiresModuleName();
+ consumeSingleRequiresModuleName();
break;
-
+
case 131 : if (DEBUG) { System.out.println("RequiresModifiersopt ::= RequiresModifiers"); } //$NON-NLS-1$
- consumeModifiers();
+ consumeModifiers();
break;
-
+
case 132 : if (DEBUG) { System.out.println("RequiresModifiersopt ::="); } //$NON-NLS-1$
- consumeDefaultModifiers();
+ consumeDefaultModifiers();
break;
-
+
case 134 : if (DEBUG) { System.out.println("RequiresModifiers ::= RequiresModifiers RequiresModifier"); } //$NON-NLS-1$
- consumeModifiers2();
+ consumeModifiers2();
break;
-
+
case 137 : if (DEBUG) { System.out.println("ExportsStatement ::= ExportsHeader TargetModuleListopt"); } //$NON-NLS-1$
- consumeExportsStatement();
+ consumeExportsStatement();
break;
-
+
case 138 : if (DEBUG) { System.out.println("ExportsHeader ::= exports SinglePkgName"); } //$NON-NLS-1$
- consumeExportsHeader();
+ consumeExportsHeader();
break;
-
+
case 140 : if (DEBUG) { System.out.println("TargetModuleListopt ::= to TargetModuleNameList"); } //$NON-NLS-1$
- consumeTargetModuleList();
+ consumeTargetModuleList();
break;
-
+
case 141 : if (DEBUG) { System.out.println("TargetModuleName ::= UnannotatableName"); } //$NON-NLS-1$
- consumeSingleTargetModuleName();
+ consumeSingleTargetModuleName();
break;
-
+
case 143 : if (DEBUG) { System.out.println("TargetModuleNameList ::= TargetModuleNameList COMMA..."); } //$NON-NLS-1$
- consumeTargetModuleNameList();
+ consumeTargetModuleNameList();
break;
-
+
case 144 : if (DEBUG) { System.out.println("SinglePkgName ::= UnannotatableName"); } //$NON-NLS-1$
- consumeSinglePkgName();
+ consumeSinglePkgName();
break;
-
+
case 145 : if (DEBUG) { System.out.println("OpensStatement ::= OpensHeader TargetModuleListopt..."); } //$NON-NLS-1$
- consumeOpensStatement();
+ consumeOpensStatement();
break;
-
+
case 146 : if (DEBUG) { System.out.println("OpensHeader ::= opens SinglePkgName"); } //$NON-NLS-1$
- consumeOpensHeader();
+ consumeOpensHeader();
break;
-
+
case 147 : if (DEBUG) { System.out.println("UsesStatement ::= UsesHeader SEMICOLON"); } //$NON-NLS-1$
- consumeUsesStatement();
+ consumeUsesStatement();
break;
-
+
case 148 : if (DEBUG) { System.out.println("UsesHeader ::= uses Name"); } //$NON-NLS-1$
- consumeUsesHeader();
+ consumeUsesHeader();
break;
-
+
case 149 : if (DEBUG) { System.out.println("ProvidesStatement ::= ProvidesInterface WithClause..."); } //$NON-NLS-1$
- consumeProvidesStatement();
+ consumeProvidesStatement();
break;
-
+
case 150 : if (DEBUG) { System.out.println("ProvidesInterface ::= provides Name"); } //$NON-NLS-1$
- consumeProvidesInterface();
+ consumeProvidesInterface();
break;
-
+
case 151 : if (DEBUG) { System.out.println("ServiceImplName ::= Name"); } //$NON-NLS-1$
- consumeSingleServiceImplName();
+ consumeSingleServiceImplName();
break;
-
+
case 153 : if (DEBUG) { System.out.println("ServiceImplNameList ::= ServiceImplNameList COMMA..."); } //$NON-NLS-1$
- consumeServiceImplNameList();
+ consumeServiceImplNameList();
break;
-
+
case 154 : if (DEBUG) { System.out.println("WithClause ::= with ServiceImplNameList"); } //$NON-NLS-1$
- consumeWithClause();
+ consumeWithClause();
break;
-
+
case 155 : if (DEBUG) { System.out.println("ReduceImports ::="); } //$NON-NLS-1$
- consumeReduceImports();
+ consumeReduceImports();
break;
-
+
case 156 : if (DEBUG) { System.out.println("EnterCompilationUnit ::="); } //$NON-NLS-1$
- consumeEnterCompilationUnit();
+ consumeEnterCompilationUnit();
break;
-
+
case 181 : if (DEBUG) { System.out.println("CatchHeader ::= catch LPAREN CatchFormalParameter RPAREN"); } //$NON-NLS-1$
- consumeCatchHeader();
+ consumeCatchHeader();
break;
-
+
case 183 : if (DEBUG) { System.out.println("ImportDeclarations ::= ImportDeclarations..."); } //$NON-NLS-1$
- consumeImportDeclarations();
+ consumeImportDeclarations();
break;
-
+
case 185 : if (DEBUG) { System.out.println("TypeDeclarations ::= TypeDeclarations TypeDeclaration"); } //$NON-NLS-1$
- consumeTypeDeclarations();
+ consumeTypeDeclarations();
break;
-
+
case 186 : if (DEBUG) { System.out.println("PackageDeclaration ::= PackageDeclarationName SEMICOLON"); } //$NON-NLS-1$
- consumePackageDeclaration();
+ consumePackageDeclaration();
break;
-
+
case 187 : if (DEBUG) { System.out.println("PackageDeclarationName ::= Modifiers package..."); } //$NON-NLS-1$
- consumePackageDeclarationNameWithModifiers();
+ consumePackageDeclarationNameWithModifiers();
break;
-
+
case 188 : if (DEBUG) { System.out.println("PackageDeclarationName ::= PackageComment package Name"); } //$NON-NLS-1$
- consumePackageDeclarationName();
+ consumePackageDeclarationName();
break;
-
+
case 189 : if (DEBUG) { System.out.println("PackageComment ::="); } //$NON-NLS-1$
- consumePackageComment();
+ consumePackageComment();
break;
-
+
case 195 : if (DEBUG) { System.out.println("SingleTypeImportDeclaration ::=..."); } //$NON-NLS-1$
- consumeImportDeclaration();
+ consumeImportDeclaration();
break;
-
+
case 196 : if (DEBUG) { System.out.println("SingleTypeImportDeclarationName ::= import ImportName..."); } //$NON-NLS-1$
- consumeSingleTypeImportDeclarationName();
+ consumeSingleTypeImportDeclarationName();
break;
-
+
case 198 : if (DEBUG) { System.out.println("ImportName ::= Name DOT team DOT Name"); } //$NON-NLS-1$
- consumeNameContainingTeam();
+ consumeNameContainingTeam();
break;
-
+
case 199 : if (DEBUG) { System.out.println("TypeImportOnDemandDeclaration ::=..."); } //$NON-NLS-1$
- consumeImportDeclaration();
+ consumeImportDeclaration();
break;
-
+
case 200 : if (DEBUG) { System.out.println("TypeImportOnDemandDeclarationName ::= import Name DOT..."); } //$NON-NLS-1$
- consumeTypeImportOnDemandDeclarationName();
+ consumeTypeImportOnDemandDeclarationName();
break;
-
+
case 203 : if (DEBUG) { System.out.println("TypeDeclaration ::= SEMICOLON"); } //$NON-NLS-1$
- consumeEmptyTypeDeclaration();
+ consumeEmptyTypeDeclaration();
break;
-
+
case 208 : if (DEBUG) { System.out.println("Modifiers ::= Modifiers Modifier"); } //$NON-NLS-1$
- consumeModifiers2();
+ consumeModifiers2();
break;
-
+
case 220 : if (DEBUG) { System.out.println("Modifier ::= Annotation"); } //$NON-NLS-1$
- consumeAnnotationAsModifier();
+ consumeAnnotationAsModifier();
break;
-
+
case 223 : if (DEBUG) { System.out.println("ClassDeclaration ::= ClassHeader ClassBody"); } //$NON-NLS-1$
- consumeClassDeclaration();
+ consumeClassDeclaration();
break;
-
+
case 224 : if (DEBUG) { System.out.println("ClassHeader ::= ClassHeaderName ClassHeaderExtendsopt..."); } //$NON-NLS-1$
- consumeClassHeader();
+ consumeClassHeader();
break;
-
+
case 225 : if (DEBUG) { System.out.println("ClassHeaderName ::= ClassHeaderName1 TypeParameters"); } //$NON-NLS-1$
- consumeTypeHeaderNameWithTypeParameters();
+ consumeTypeHeaderNameWithTypeParameters();
break;
-
+
case 227 : if (DEBUG) { System.out.println("ClassHeaderName1 ::= Modifiersopt class Identifier"); } //$NON-NLS-1$
- consumeClassHeaderName1();
+ consumeClassHeaderName1();
break;
-
+
case 228 : if (DEBUG) { System.out.println("ClassHeaderExtends ::= extends ClassType"); } //$NON-NLS-1$
- consumeClassHeaderExtends();
+ consumeClassHeaderExtends();
break;
-
+
case 229 : if (DEBUG) { System.out.println("ClassHeaderImplements ::= implements InterfaceTypeList"); } //$NON-NLS-1$
- consumeClassHeaderImplements();
+ consumeClassHeaderImplements();
break;
-
+
case 232 : if (DEBUG) { System.out.println("ClassHeaderPlayedBy ::= playedBy ClassType"); } //$NON-NLS-1$
- consumeClassHeaderPlayedBy();
+ consumeClassHeaderPlayedBy();
break;
-
+
case 238 : if (DEBUG) { System.out.println("PredicateHeader ::= when"); } //$NON-NLS-1$
- consumePredicate(false);
+ consumePredicate(false);
break;
-
+
case 240 : if (DEBUG) { System.out.println("BasePredicateHeader ::= base when"); } //$NON-NLS-1$
- consumePredicate(true);
+ consumePredicate(true);
break;
-
+
case 241 : if (DEBUG) { System.out.println("PredicateBody ::= LPAREN ForceNoDiet Expression..."); } //$NON-NLS-1$
- consumePredicateExpression();
+ consumePredicateExpression();
break;
-
+
case 242 : if (DEBUG) { System.out.println("PredicateBody ::= LPAREN RPAREN"); } //$NON-NLS-1$
- consumePredicateMissingExpression();
+ consumePredicateMissingExpression();
break;
-
+
case 243 : if (DEBUG) { System.out.println("ForceBaseIsIdentifier ::="); } //$NON-NLS-1$
- consumeForceBaseIsIdentifier();
+ consumeForceBaseIsIdentifier();
break;
-
+
case 244 : if (DEBUG) { System.out.println("RestoreBaseKeyword ::="); } //$NON-NLS-1$
- consumeRestoreBaseKeyword();
+ consumeRestoreBaseKeyword();
break;
-
+
case 246 : if (DEBUG) { System.out.println("InterfaceTypeList ::= InterfaceTypeList COMMA..."); } //$NON-NLS-1$
- consumeInterfaceTypeList();
+ consumeInterfaceTypeList();
break;
-
+
case 247 : if (DEBUG) { System.out.println("InterfaceType ::= ClassOrInterfaceType"); } //$NON-NLS-1$
- consumeInterfaceType();
+ consumeInterfaceType();
break;
-
+
case 250 : if (DEBUG) { System.out.println("ClassBodyDeclarations ::= ClassBodyDeclarations..."); } //$NON-NLS-1$
- consumeClassBodyDeclarations();
+ consumeClassBodyDeclarations();
break;
-
+
case 254 : if (DEBUG) { System.out.println("ClassBodyDeclaration ::= Diet NestedMethod..."); } //$NON-NLS-1$
- consumeClassBodyDeclaration();
+ consumeClassBodyDeclaration();
break;
-
+
case 255 : if (DEBUG) { System.out.println("Diet ::="); } //$NON-NLS-1$
- consumeDiet();
+ consumeDiet();
break;
case 256 : if (DEBUG) { System.out.println("Initializer ::= Diet NestedMethod CreateInitializer..."); } //$NON-NLS-1$
- consumeClassBodyDeclaration();
+ consumeClassBodyDeclaration();
break;
-
+
case 257 : if (DEBUG) { System.out.println("CreateInitializer ::="); } //$NON-NLS-1$
- consumeCreateInitializer();
+ consumeCreateInitializer();
break;
case 267 : if (DEBUG) { System.out.println("ClassMemberDeclaration ::= SEMICOLON"); } //$NON-NLS-1$
- consumeEmptyTypeDeclaration();
+ consumeEmptyTypeDeclaration();
break;
case 270 : if (DEBUG) { System.out.println("FieldDeclaration ::= Modifiersopt Type..."); } //$NON-NLS-1$
- consumeFieldDeclaration();
+ consumeFieldDeclaration();
break;
-
+
case 272 : if (DEBUG) { System.out.println("VariableDeclarators ::= VariableDeclarators COMMA..."); } //$NON-NLS-1$
- consumeVariableDeclarators();
+ consumeVariableDeclarators();
break;
-
+
case 275 : if (DEBUG) { System.out.println("EnterVariable ::="); } //$NON-NLS-1$
- consumeEnterVariable();
+ consumeEnterVariable();
break;
-
+
case 276 : if (DEBUG) { System.out.println("ExitVariableWithInitialization ::="); } //$NON-NLS-1$
- consumeExitVariableWithInitialization();
+ consumeExitVariableWithInitialization();
break;
-
+
case 277 : if (DEBUG) { System.out.println("ExitVariableWithoutInitialization ::="); } //$NON-NLS-1$
- consumeExitVariableWithoutInitialization();
+ consumeExitVariableWithoutInitialization();
break;
-
+
case 278 : if (DEBUG) { System.out.println("ForceNoDiet ::="); } //$NON-NLS-1$
- consumeForceNoDiet();
+ consumeForceNoDiet();
break;
-
+
case 279 : if (DEBUG) { System.out.println("RestoreDiet ::="); } //$NON-NLS-1$
- consumeRestoreDiet();
+ consumeRestoreDiet();
break;
-
+
case 284 : if (DEBUG) { System.out.println("MethodDeclaration ::= MethodHeader MethodBody"); } //$NON-NLS-1$
// set to true to consume a method with a body
- consumeMethodDeclaration(true, false);
+ consumeMethodDeclaration(true, false);
break;
-
+
case 285 : if (DEBUG) { System.out.println("MethodDeclaration ::= DefaultMethodHeader MethodBody"); } //$NON-NLS-1$
// set to true to consume a method with a body
- consumeMethodDeclaration(true, true);
+ consumeMethodDeclaration(true, true);
break;
-
+
case 286 : if (DEBUG) { System.out.println("AbstractMethodDeclaration ::= MethodHeader SEMICOLON"); } //$NON-NLS-1$
// set to false to consume a method without body
- consumeMethodDeclaration(false, false);
+ consumeMethodDeclaration(false, false);
break;
-
+
case 287 : if (DEBUG) { System.out.println("MethodHeader ::= MethodHeaderName FormalParameterListopt"); } //$NON-NLS-1$
- consumeMethodHeader();
+ consumeMethodHeader();
break;
-
+
case 288 : if (DEBUG) { System.out.println("DefaultMethodHeader ::= DefaultMethodHeaderName..."); } //$NON-NLS-1$
- consumeMethodHeader();
+ consumeMethodHeader();
break;
-
+
case 289 : if (DEBUG) { System.out.println("MethodHeaderName ::= Modifiersopt TypeParameters Type..."); } //$NON-NLS-1$
- consumeMethodHeaderNameWithTypeParameters(false);
+ consumeMethodHeaderNameWithTypeParameters(false);
break;
-
+
case 290 : if (DEBUG) { System.out.println("MethodHeaderName ::= Modifiersopt Type Identifier LPAREN"); } //$NON-NLS-1$
- consumeMethodHeaderName(false);
+ consumeMethodHeaderName(false);
break;
-
+
case 291 : if (DEBUG) { System.out.println("DefaultMethodHeaderName ::= ModifiersWithDefault..."); } //$NON-NLS-1$
- consumeMethodHeaderNameWithTypeParameters(false);
+ consumeMethodHeaderNameWithTypeParameters(false);
break;
-
+
case 292 : if (DEBUG) { System.out.println("DefaultMethodHeaderName ::= ModifiersWithDefault Type..."); } //$NON-NLS-1$
- consumeMethodHeaderName(false);
+ consumeMethodHeaderName(false);
break;
-
+
case 293 : if (DEBUG) { System.out.println("ModifiersWithDefault ::= Modifiersopt default..."); } //$NON-NLS-1$
- consumePushCombineModifiers();
+ consumePushCombineModifiers();
break;
-
+
case 294 : if (DEBUG) { System.out.println("MethodHeaderRightParen ::= RPAREN"); } //$NON-NLS-1$
- consumeMethodHeaderRightParen();
+ consumeMethodHeaderRightParen();
break;
-
+
case 295 : if (DEBUG) { System.out.println("MethodHeaderExtendedDims ::= Dimsopt"); } //$NON-NLS-1$
- consumeMethodHeaderExtendedDims();
+ consumeMethodHeaderExtendedDims();
break;
-
+
case 296 : if (DEBUG) { System.out.println("MethodHeaderThrowsClause ::= throws ClassTypeList"); } //$NON-NLS-1$
- consumeMethodHeaderThrowsClause();
+ consumeMethodHeaderThrowsClause();
break;
-
+
case 297 : if (DEBUG) { System.out.println("ConstructorHeader ::= ConstructorHeaderName..."); } //$NON-NLS-1$
- consumeConstructorHeader();
+ consumeConstructorHeader();
break;
-
+
case 298 : if (DEBUG) { System.out.println("ConstructorHeaderName ::= Modifiersopt TypeParameters..."); } //$NON-NLS-1$
- consumeConstructorHeaderNameWithTypeParameters();
+ consumeConstructorHeaderNameWithTypeParameters();
break;
-
+
case 299 : if (DEBUG) { System.out.println("ConstructorHeaderName ::= Modifiersopt Identifier LPAREN"); } //$NON-NLS-1$
- consumeConstructorHeaderName();
+ consumeConstructorHeaderName();
break;
-
+
case 301 : if (DEBUG) { System.out.println("FormalParameterList ::= FormalParameterList COMMA..."); } //$NON-NLS-1$
- consumeFormalParameterList();
+ consumeFormalParameterList();
break;
-
+
case 302 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Type LiftingTypeopt..."); } //$NON-NLS-1$
- consumeFormalParameter(false);
+ consumeFormalParameter(false);
break;
-
+
case 303 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Type LiftingTypeopt..."); } //$NON-NLS-1$
- consumeFormalParameter(true);
+ consumeFormalParameter(true);
break;
-
+
case 304 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Type LiftingTypeopt..."); } //$NON-NLS-1$
- consumeFormalParameter(true);
+ consumeFormalParameter(true);
break;
-
+
case 305 : if (DEBUG) { System.out.println("CatchFormalParameter ::= Modifiersopt CatchType..."); } //$NON-NLS-1$
- consumeCatchFormalParameter();
+ consumeCatchFormalParameter();
break;
-
+
case 306 : if (DEBUG) { System.out.println("CatchType ::= UnionType"); } //$NON-NLS-1$
- consumeCatchType();
+ consumeCatchType();
break;
-
+
case 307 : if (DEBUG) { System.out.println("UnionType ::= Type"); } //$NON-NLS-1$
- consumeUnionTypeAsClassType();
+ consumeUnionTypeAsClassType();
break;
-
+
case 308 : if (DEBUG) { System.out.println("UnionType ::= UnionType OR Type"); } //$NON-NLS-1$
- consumeUnionType();
+ consumeUnionType();
break;
-
+
case 310 : if (DEBUG) { System.out.println("ClassTypeList ::= ClassTypeList COMMA ClassTypeElt"); } //$NON-NLS-1$
- consumeClassTypeList();
+ consumeClassTypeList();
break;
-
+
case 311 : if (DEBUG) { System.out.println("ClassTypeElt ::= ClassType"); } //$NON-NLS-1$
- consumeClassTypeElt();
+ consumeClassTypeElt();
break;
-
+
case 312 : if (DEBUG) { System.out.println("MethodBody ::= Predicateopt NestedMethod LBRACE..."); } //$NON-NLS-1$
- consumeMethodBody();
+ consumeMethodBody();
break;
-
+
case 313 : if (DEBUG) { System.out.println("NestedMethod ::="); } //$NON-NLS-1$
- consumeNestedMethod();
+ consumeNestedMethod();
break;
-
+
case 317 : if (DEBUG) { System.out.println("CalloutBinding ::= CalloutHeaderLong..."); } //$NON-NLS-1$
- consumeCalloutBindingLong();
+ consumeCalloutBindingLong();
break;
-
+
case 318 : if (DEBUG) { System.out.println("CalloutHeaderLong ::= CalloutBindingLeftLong..."); } //$NON-NLS-1$
- consumeCalloutHeader();
+ consumeCalloutHeader();
break;
-
+
case 319 : if (DEBUG) { System.out.println("CalloutHeaderLong ::= CalloutBindingLeftLong..."); } //$NON-NLS-1$
- consumeCalloutHeader();
+ consumeCalloutHeader();
break;
-
+
case 320 : if (DEBUG) { System.out.println("CalloutBindingLeftLong ::= MethodSpecLong CalloutKind"); } //$NON-NLS-1$
- consumeCalloutBindingLeft(true);
+ consumeCalloutBindingLeft(true);
break;
-
+
case 321 : if (DEBUG) { System.out.println("CalloutBinding ::= Modifiersopt CalloutBindingLeftShort"); } //$NON-NLS-1$
- consumeCalloutHeader();
+ consumeCalloutHeader();
break;
-
+
case 322 : if (DEBUG) { System.out.println("CalloutBindingLeftShort ::= MethodSpecShort CalloutKind"); } //$NON-NLS-1$
- consumeCalloutBindingLeft(false);
+ consumeCalloutBindingLeft(false);
break;
-
+
case 323 : if (DEBUG) { System.out.println("CalloutBinding ::= Modifiersopt CalloutBindingLeftShort"); } //$NON-NLS-1$
- consumeCalloutParameterMappingsInvalid();
+ consumeCalloutParameterMappingsInvalid();
break;
-
+
case 328 : if (DEBUG) { System.out.println("CalloutModifier ::= get"); } //$NON-NLS-1$
- consumeCalloutModifier(TokenNameget);
+ consumeCalloutModifier(TokenNameget);
break;
-
+
case 329 : if (DEBUG) { System.out.println("CalloutModifier ::= set"); } //$NON-NLS-1$
- consumeCalloutModifier(TokenNameset);
+ consumeCalloutModifier(TokenNameset);
break;
-
+
case 331 : if (DEBUG) { System.out.println("CalloutParameterMappingsopt ::= SEMICOLON"); } //$NON-NLS-1$
- consumeParameterMappingsEmpty();
+ consumeParameterMappingsEmpty();
break;
-
+
case 332 : if (DEBUG) { System.out.println("CalloutParameterMappings ::= with NestedParamMappings..."); } //$NON-NLS-1$
- consumeParameterMappings();
+ consumeParameterMappings();
break;
-
+
case 335 : if (DEBUG) { System.out.println("CalloutParameterMappingList ::=..."); } //$NON-NLS-1$
- consumeParameterMappingList();
+ consumeParameterMappingList();
break;
-
+
case 336 : if (DEBUG) { System.out.println("CalloutParameterMappingList ::=..."); } //$NON-NLS-1$
- consumeParameterMappingList();
+ consumeParameterMappingList();
break;
-
+
case 337 : if (DEBUG) { System.out.println("ParameterMapping ::= Expression SYNTHBINDOUT Identifier"); } //$NON-NLS-1$
- consumeParameterMappingOut();
+ consumeParameterMappingOut();
break;
-
+
case 338 : if (DEBUG) { System.out.println("ParameterMapping ::= Identifier BINDIN..."); } //$NON-NLS-1$
- consumeParameterMappingIn();
+ consumeParameterMappingIn();
break;
-
+
case 339 : if (DEBUG) { System.out.println("NestedParamMappings ::="); } //$NON-NLS-1$
- consumeNestedParamMappings();
+ consumeNestedParamMappings();
break;
-
+
case 340 : if (DEBUG) { System.out.println("CallinBinding ::= CallinHeaderLong..."); } //$NON-NLS-1$
- consumeCallinBindingLong();
+ consumeCallinBindingLong();
break;
-
+
case 341 : if (DEBUG) { System.out.println("CallinHeaderLong ::= CallinBindingLeftLong..."); } //$NON-NLS-1$
- consumeCallinHeader();
+ consumeCallinHeader();
break;
-
+
case 342 : if (DEBUG) { System.out.println("CallinHeaderLong ::= Modifiersopt CallinLabel..."); } //$NON-NLS-1$
- consumeCallinHeader();
+ consumeCallinHeader();
break;
-
+
case 343 : if (DEBUG) { System.out.println("CallinBindingLeftLong ::= MethodSpecLong BINDIN"); } //$NON-NLS-1$
- consumeCallinBindingLeft(true);
+ consumeCallinBindingLeft(true);
break;
-
+
case 344 : if (DEBUG) { System.out.println("CallinBinding ::= Modifiersopt CallinBindingLeftShort..."); } //$NON-NLS-1$
- consumeCallinHeader();
+ consumeCallinHeader();
break;
-
+
case 345 : if (DEBUG) { System.out.println("CallinBinding ::= Modifiersopt CallinLabel Modifiersopt"); } //$NON-NLS-1$
- consumeCallinHeader();
+ consumeCallinHeader();
break;
-
+
case 346 : if (DEBUG) { System.out.println("CallinBindingLeftShort ::= MethodSpecShort BINDIN"); } //$NON-NLS-1$
- consumeCallinBindingLeft(false);
+ consumeCallinBindingLeft(false);
break;
-
+
case 347 : if (DEBUG) { System.out.println("CallinLabel ::= SimpleName COLON"); } //$NON-NLS-1$
- consumeCallinLabel();
+ consumeCallinLabel();
break;
-
+
case 348 : if (DEBUG) { System.out.println("CallinModifier ::= replace"); } //$NON-NLS-1$
- consumeCallinModifier(TokenNamereplace);
+ consumeCallinModifier(TokenNamereplace);
break;
-
+
case 349 : if (DEBUG) { System.out.println("CallinModifier ::= before"); } //$NON-NLS-1$
- consumeCallinModifier(TokenNamebefore);
+ consumeCallinModifier(TokenNamebefore);
break;
-
+
case 350 : if (DEBUG) { System.out.println("CallinModifier ::= after"); } //$NON-NLS-1$
- consumeCallinModifier(TokenNameafter);
+ consumeCallinModifier(TokenNameafter);
break;
-
+
case 351 : if (DEBUG) { System.out.println("InvalidCallinModifier ::="); } //$NON-NLS-1$
- consumeCallinModifierMissing();
+ consumeCallinModifierMissing();
break;
-
+
case 352 : if (DEBUG) { System.out.println("InvalidCallinBinding ::= Modifiersopt..."); } //$NON-NLS-1$
- consumeCallinBindingInvalid(false,false);
+ consumeCallinBindingInvalid(false,false);
break;
-
+
case 353 : if (DEBUG) { System.out.println("InvalidCallinBinding ::= Modifiersopt CallinLabel..."); } //$NON-NLS-1$
- consumeCallinBindingInvalid(false,false);
+ consumeCallinBindingInvalid(false,false);
break;
-
+
case 354 : if (DEBUG) { System.out.println("InvalidCallinBinding ::= Modifiersopt..."); } //$NON-NLS-1$
- consumeCallinBindingInvalid(false,true);
+ consumeCallinBindingInvalid(false,true);
break;
-
+
case 355 : if (DEBUG) { System.out.println("InvalidCallinBinding ::= Modifiersopt CallinLabel..."); } //$NON-NLS-1$
- consumeCallinBindingInvalid(false,true);
+ consumeCallinBindingInvalid(false,true);
break;
-
+
case 356 : if (DEBUG) { System.out.println("InvalidCallinBinding ::= CallinBindingLeftLong..."); } //$NON-NLS-1$
- consumeCallinBindingInvalid(true,false);
+ consumeCallinBindingInvalid(true,false);
break;
-
+
case 357 : if (DEBUG) { System.out.println("InvalidCallinBinding ::= Modifiersopt CallinLabel..."); } //$NON-NLS-1$
- consumeCallinBindingInvalid(true,false);
+ consumeCallinBindingInvalid(true,false);
break;
-
+
case 359 : if (DEBUG) { System.out.println("CallinParameterMappingsopt ::= SEMICOLON"); } //$NON-NLS-1$
- consumeParameterMappingsEmpty();
+ consumeParameterMappingsEmpty();
break;
-
+
case 360 : if (DEBUG) { System.out.println("CallinParameterMappings ::= with NestedParamMappings..."); } //$NON-NLS-1$
- consumeParameterMappings();
+ consumeParameterMappings();
break;
-
+
case 363 : if (DEBUG) { System.out.println("CallinParameterMappingList ::=..."); } //$NON-NLS-1$
- consumeParameterMappingList();
+ consumeParameterMappingList();
break;
-
+
case 364 : if (DEBUG) { System.out.println("CallinParameterMappingList ::=..."); } //$NON-NLS-1$
- consumeParameterMappingList();
+ consumeParameterMappingList();
break;
-
+
case 365 : if (DEBUG) { System.out.println("MethodSpecShort ::= SimpleName"); } //$NON-NLS-1$
- consumeMethodSpecShort();
+ consumeMethodSpecShort();
break;
-
+
case 366 : if (DEBUG) { System.out.println("MethodSpecLong ::= MethodHeaderName..."); } //$NON-NLS-1$
- consumeMethodSpecLong(false);
+ consumeMethodSpecLong(false);
break;
-
+
case 367 : if (DEBUG) { System.out.println("MethodSpecLong ::= ConstructorHeaderName..."); } //$NON-NLS-1$
- consumeMethodSpecLongCtor();
+ consumeMethodSpecLongCtor();
break;
-
+
case 368 : if (DEBUG) { System.out.println("BaseMethodSpecLong ::= MethodHeaderName..."); } //$NON-NLS-1$
- consumeMethodSpecLong(false);
+ consumeMethodSpecLong(false);
break;
-
+
case 369 : if (DEBUG) { System.out.println("BaseMethodSpecLong ::= MethodSpecNamePlus..."); } //$NON-NLS-1$
- consumeMethodSpecLong(true);
+ consumeMethodSpecLong(true);
break;
-
+
case 370 : if (DEBUG) { System.out.println("BaseMethodSpecLong ::= ConstructorHeaderName..."); } //$NON-NLS-1$
- consumeMethodSpecLong(false);
+ consumeMethodSpecLong(false);
break;
-
+
case 371 : if (DEBUG) { System.out.println("MethodSpecNamePlus ::= Modifiersopt Type PLUS Identifier"); } //$NON-NLS-1$
- consumeMethodHeaderName(false);
+ consumeMethodHeaderName(false);
break;
-
+
case 372 : if (DEBUG) { System.out.println("CalloutFieldSpecLong ::= CalloutModifier Type Identifier"); } //$NON-NLS-1$
- consumeFieldSpecLong();
+ consumeFieldSpecLong();
break;
-
+
case 375 : if (DEBUG) { System.out.println("BaseMethodSpecListShort ::= BaseMethodSpecListShort..."); } //$NON-NLS-1$
- consumeMethodSpecList();
+ consumeMethodSpecList();
break;
-
+
case 379 : if (DEBUG) { System.out.println("MethodSpecListLong ::= MethodSpecListLong COMMA..."); } //$NON-NLS-1$
- consumeMethodSpecList();
+ consumeMethodSpecList();
break;
-
+
case 380 : if (DEBUG) { System.out.println("PrecedenceDeclaration ::= precedence BindingNames..."); } //$NON-NLS-1$
- consumePrecedenceDeclaration(false);
+ consumePrecedenceDeclaration(false);
break;
-
+
case 381 : if (DEBUG) { System.out.println("PrecedenceDeclaration ::= precedence after BindingNames"); } //$NON-NLS-1$
- consumePrecedenceDeclaration(true);
+ consumePrecedenceDeclaration(true);
break;
-
+
case 383 : if (DEBUG) { System.out.println("BindingNames ::= BindingNames COMMA BindingName"); } //$NON-NLS-1$
- consumeBindingNames();
+ consumeBindingNames();
break;
-
+
case 384 : if (DEBUG) { System.out.println("BindingName ::= Name"); } //$NON-NLS-1$
- consumeBindingName();
+ consumeBindingName();
break;
-
+
case 385 : if (DEBUG) { System.out.println("StaticInitializer ::= StaticOnly Block"); } //$NON-NLS-1$
- consumeStaticInitializer();
+ consumeStaticInitializer();
break;
case 386 : if (DEBUG) { System.out.println("StaticOnly ::= static"); } //$NON-NLS-1$
- consumeStaticOnly();
+ consumeStaticOnly();
break;
-
+
case 387 : if (DEBUG) { System.out.println("ConstructorDeclaration ::= ConstructorHeader MethodBody"); } //$NON-NLS-1$
- consumeConstructorDeclaration() ;
+ consumeConstructorDeclaration() ;
break;
-
+
case 388 : if (DEBUG) { System.out.println("ConstructorDeclaration ::= ConstructorHeader SEMICOLON"); } //$NON-NLS-1$
- consumeInvalidConstructorDeclaration() ;
+ consumeInvalidConstructorDeclaration() ;
break;
-
+
case 389 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= this LPAREN..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocation(0, THIS_CALL);
+ consumeExplicitConstructorInvocation(0, THIS_CALL);
break;
-
+
case 390 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= OnlyTypeArguments this"); } //$NON-NLS-1$
- consumeExplicitConstructorInvocationWithTypeArguments(0,THIS_CALL);
+ consumeExplicitConstructorInvocationWithTypeArguments(0,THIS_CALL);
break;
-
+
case 391 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= super LPAREN..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocation(0,SUPER_CALL);
+ consumeExplicitConstructorInvocation(0,SUPER_CALL);
break;
-
+
case 392 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= OnlyTypeArguments..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocationWithTypeArguments(0,SUPER_CALL);
+ consumeExplicitConstructorInvocationWithTypeArguments(0,SUPER_CALL);
break;
-
+
case 393 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= tsuper LPAREN..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocation(0,TSUPER_CALL);
+ consumeExplicitConstructorInvocation(0,TSUPER_CALL);
break;
-
+
case 394 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT tsuper LPAREN"); } //$NON-NLS-1$
- consumeExplicitConstructorInvocation(2,TSUPER_CALL);
+ consumeExplicitConstructorInvocation(2,TSUPER_CALL);
break;
-
+
case 395 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT super..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocation(1, SUPER_CALL);
+ consumeExplicitConstructorInvocation(1, SUPER_CALL);
break;
-
+
case 396 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocationWithTypeArguments(1, SUPER_CALL);
+ consumeExplicitConstructorInvocationWithTypeArguments(1, SUPER_CALL);
break;
-
+
case 397 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT super LPAREN"); } //$NON-NLS-1$
- consumeExplicitConstructorInvocation(2, SUPER_CALL);
+ consumeExplicitConstructorInvocation(2, SUPER_CALL);
break;
-
+
case 398 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocationWithTypeArguments(2, SUPER_CALL);
+ consumeExplicitConstructorInvocationWithTypeArguments(2, SUPER_CALL);
break;
-
+
case 399 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT this..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocation(1, THIS_CALL);
+ consumeExplicitConstructorInvocation(1, THIS_CALL);
break;
-
+
case 400 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocationWithTypeArguments(1, THIS_CALL);
+ consumeExplicitConstructorInvocationWithTypeArguments(1, THIS_CALL);
break;
-
+
case 401 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT this LPAREN"); } //$NON-NLS-1$
- consumeExplicitConstructorInvocation(2, THIS_CALL);
+ consumeExplicitConstructorInvocation(2, THIS_CALL);
break;
-
+
case 402 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocationWithTypeArguments(2, THIS_CALL);
+ consumeExplicitConstructorInvocationWithTypeArguments(2, THIS_CALL);
break;
-
+
case 403 : if (DEBUG) { System.out.println("BaseConstructorExpression ::= base LPAREN..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocationBase(0);
+ consumeExplicitConstructorInvocationBase(0);
break;
-
+
case 404 : if (DEBUG) { System.out.println("BaseConstructorInvocation ::= base LPAREN..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocationBase(1);
+ consumeExplicitConstructorInvocationBase(1);
break;
-
+
case 405 : if (DEBUG) { System.out.println("BaseConstructorInvocation ::= Primary DOT base LPAREN..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocationBase(2);
+ consumeExplicitConstructorInvocationBase(2);
break;
-
+
case 406 : if (DEBUG) { System.out.println("BaseConstructorInvocation ::= Name DOT base LPAREN..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocationBase(3);
+ consumeExplicitConstructorInvocationBase(3);
break;
-
+
case 407 : if (DEBUG) { System.out.println("InterfaceDeclaration ::= InterfaceHeader InterfaceBody"); } //$NON-NLS-1$
- consumeInterfaceDeclaration();
+ consumeInterfaceDeclaration();
break;
-
+
case 408 : if (DEBUG) { System.out.println("InterfaceHeader ::= InterfaceHeaderName..."); } //$NON-NLS-1$
- consumeInterfaceHeader();
+ consumeInterfaceHeader();
break;
-
+
case 409 : if (DEBUG) { System.out.println("InterfaceHeaderName ::= InterfaceHeaderName1..."); } //$NON-NLS-1$
- consumeTypeHeaderNameWithTypeParameters();
+ consumeTypeHeaderNameWithTypeParameters();
break;
-
+
case 411 : if (DEBUG) { System.out.println("InterfaceHeaderName1 ::= Modifiersopt interface..."); } //$NON-NLS-1$
- consumeInterfaceHeaderName1();
+ consumeInterfaceHeaderName1();
break;
-
+
case 412 : if (DEBUG) { System.out.println("InterfaceHeaderExtends ::= extends InterfaceTypeList"); } //$NON-NLS-1$
- consumeInterfaceHeaderExtends();
+ consumeInterfaceHeaderExtends();
break;
-
+
case 415 : if (DEBUG) { System.out.println("InterfaceMemberDeclarations ::=..."); } //$NON-NLS-1$
- consumeInterfaceMemberDeclarations();
+ consumeInterfaceMemberDeclarations();
break;
-
+
case 416 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= SEMICOLON"); } //$NON-NLS-1$
- consumeEmptyTypeDeclaration();
+ consumeEmptyTypeDeclaration();
break;
-
+
case 418 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= DefaultMethodHeader..."); } //$NON-NLS-1$
- consumeInterfaceMethodDeclaration(false);
+ consumeInterfaceMethodDeclaration(false);
break;
-
+
case 419 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= MethodHeader MethodBody"); } //$NON-NLS-1$
- consumeInterfaceMethodDeclaration(false);
+ consumeInterfaceMethodDeclaration(false);
break;
-
+
case 420 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= DefaultMethodHeader..."); } //$NON-NLS-1$
- consumeInterfaceMethodDeclaration(true);
+ consumeInterfaceMethodDeclaration(true);
break;
-
+
case 421 : if (DEBUG) { System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader..."); } //$NON-NLS-1$
- consumeInvalidConstructorDeclaration(true);
+ consumeInvalidConstructorDeclaration(true);
break;
-
+
case 422 : if (DEBUG) { System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader..."); } //$NON-NLS-1$
- consumeInvalidConstructorDeclaration(false);
+ consumeInvalidConstructorDeclaration(false);
break;
-
+
case 434 : if (DEBUG) { System.out.println("RecordDeclaration ::= RecordHeaderPart RecordBody"); } //$NON-NLS-1$
- consumeRecordDeclaration();
+ consumeRecordDeclaration();
break;
-
+
case 435 : if (DEBUG) { System.out.println("RecordHeaderPart ::= RecordHeaderName RecordHeader..."); } //$NON-NLS-1$
- consumeRecordHeaderPart();
+ consumeRecordHeaderPart();
break;
-
+
case 436 : if (DEBUG) { System.out.println("RecordHeaderName ::= RecordHeaderName1 TypeParameters"); } //$NON-NLS-1$
- consumeRecordHeaderNameWithTypeParameters();
+ consumeRecordHeaderNameWithTypeParameters();
break;
-
+
case 438 : if (DEBUG) { System.out.println("RecordHeaderName1 ::= Modifiersopt..."); } //$NON-NLS-1$
- consumeRecordHeaderName1();
+ consumeRecordHeaderName1();
break;
-
+
case 439 : if (DEBUG) { System.out.println("RecordComponentHeaderRightParen ::= RPAREN"); } //$NON-NLS-1$
- consumeRecordComponentHeaderRightParen();
+ consumeRecordComponentHeaderRightParen();
break;
-
+
case 440 : if (DEBUG) { System.out.println("RecordHeader ::= LPAREN RecordComponentsopt..."); } //$NON-NLS-1$
- consumeRecordHeader();
+ consumeRecordHeader();
break;
-
+
case 441 : if (DEBUG) { System.out.println("RecordComponentsopt ::="); } //$NON-NLS-1$
- consumeRecordComponentsopt();
+ consumeRecordComponentsopt();
break;
-
+
case 444 : if (DEBUG) { System.out.println("RecordComponents ::= RecordComponents COMMA..."); } //$NON-NLS-1$
- consumeRecordComponents();
+ consumeRecordComponents();
break;
-
+
case 446 : if (DEBUG) { System.out.println("RecordComponent ::= Modifiersopt Type..."); } //$NON-NLS-1$
- consumeRecordComponent(false);
+ consumeRecordComponent(false);
break;
-
+
case 447 : if (DEBUG) { System.out.println("VariableArityRecordComponent ::= Modifiersopt Type..."); } //$NON-NLS-1$
- consumeRecordComponent(true);
+ consumeRecordComponent(true);
break;
-
+
case 448 : if (DEBUG) { System.out.println("VariableArityRecordComponent ::= Modifiersopt Type..."); } //$NON-NLS-1$
- consumeRecordComponent(true);
+ consumeRecordComponent(true);
break;
-
+
case 449 : if (DEBUG) { System.out.println("RecordBody ::= LBRACE RecordBodyDeclarationopt RBRACE"); } //$NON-NLS-1$
- consumeRecordBody();
+ consumeRecordBody();
break;
-
+
case 450 : if (DEBUG) { System.out.println("RecordBodyDeclarationopt ::="); } //$NON-NLS-1$
- consumeEmptyRecordBodyDeclaration();
+ consumeEmptyRecordBodyDeclaration();
break;
-
+
case 453 : if (DEBUG) { System.out.println("RecordBodyDeclarations ::= RecordBodyDeclarations..."); } //$NON-NLS-1$
- consumeRecordBodyDeclarations();
+ consumeRecordBodyDeclarations();
break;
-
+
case 454 : if (DEBUG) { System.out.println("RecordBodyDeclaration ::= ClassBodyDeclaration"); } //$NON-NLS-1$
- consumeRecordBodyDeclaration();
+ consumeRecordBodyDeclaration();
break;
-
+
case 455 : if (DEBUG) { System.out.println("RecordBodyDeclaration ::= CompactConstructorDeclaration"); } //$NON-NLS-1$
- consumeRecordBodyDeclaration();
+ consumeRecordBodyDeclaration();
break;
-
+
case 456 : if (DEBUG) { System.out.println("CompactConstructorDeclaration ::=..."); } //$NON-NLS-1$
- consumeCompactConstructorDeclaration();
+ consumeCompactConstructorDeclaration();
break;
-
+
case 457 : if (DEBUG) { System.out.println("CompactConstructorHeader ::=..."); } //$NON-NLS-1$
- consumeCompactConstructorHeader();
+ consumeCompactConstructorHeader();
break;
-
+
case 458 : if (DEBUG) { System.out.println("CompactConstructorHeaderName ::= Modifiersopt Identifier"); } //$NON-NLS-1$
- consumeCompactConstructorHeaderName();
+ consumeCompactConstructorHeaderName();
break;
-
+
case 459 : if (DEBUG) { System.out.println("CompactConstructorHeaderName ::= Modifiersopt..."); } //$NON-NLS-1$
- consumeCompactConstructorHeaderNameWithTypeParameters();
+ consumeCompactConstructorHeaderNameWithTypeParameters();
break;
-
+
case 461 : if (DEBUG) { System.out.println("InstanceofExpression ::= InstanceofExpression instanceof"); } //$NON-NLS-1$
- consumeInstanceOfExpression();
+ consumeInstanceOfExpression();
break;
-
+
case 465 : if (DEBUG) { System.out.println("TypeTestPattern ::= Type Identifier"); } //$NON-NLS-1$
- consumeTypeTestPattern();
+ consumeTypeTestPattern();
break;
-
+
case 467 : if (DEBUG) { System.out.println("PushLeftBrace ::="); } //$NON-NLS-1$
- consumePushLeftBrace();
+ consumePushLeftBrace();
break;
-
+
case 468 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace ,opt RBRACE"); } //$NON-NLS-1$
- consumeEmptyArrayInitializer();
+ consumeEmptyArrayInitializer();
break;
-
+
case 469 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace..."); } //$NON-NLS-1$
- consumeArrayInitializer();
+ consumeArrayInitializer();
break;
-
+
case 470 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace..."); } //$NON-NLS-1$
- consumeArrayInitializer();
+ consumeArrayInitializer();
break;
-
+
case 472 : if (DEBUG) { System.out.println("VariableInitializers ::= VariableInitializers COMMA..."); } //$NON-NLS-1$
- consumeVariableInitializers();
+ consumeVariableInitializers();
break;
-
+
case 473 : if (DEBUG) { System.out.println("Block ::= OpenBlock LBRACE BlockStatementsopt RBRACE"); } //$NON-NLS-1$
- consumeBlock();
+ consumeBlock();
break;
-
+
case 474 : if (DEBUG) { System.out.println("OpenBlock ::="); } //$NON-NLS-1$
- consumeOpenBlock() ;
+ consumeOpenBlock() ;
break;
-
+
case 475 : if (DEBUG) { System.out.println("BlockStatements ::= BlockStatement"); } //$NON-NLS-1$
- consumeBlockStatement() ;
+ consumeBlockStatement() ;
break;
-
+
case 476 : if (DEBUG) { System.out.println("BlockStatements ::= BlockStatements BlockStatement"); } //$NON-NLS-1$
- consumeBlockStatements() ;
+ consumeBlockStatements() ;
break;
-
+
case 484 : if (DEBUG) { System.out.println("BlockStatement ::= InterfaceDeclaration"); } //$NON-NLS-1$
- consumeInvalidInterfaceDeclaration();
+ consumeInvalidInterfaceDeclaration();
break;
-
+
case 485 : if (DEBUG) { System.out.println("BlockStatement ::= AnnotationTypeDeclaration"); } //$NON-NLS-1$
- consumeInvalidAnnotationTypeDeclaration();
+ consumeInvalidAnnotationTypeDeclaration();
break;
-
+
case 486 : if (DEBUG) { System.out.println("BlockStatement ::= EnumDeclaration"); } //$NON-NLS-1$
- consumeInvalidEnumDeclaration();
+ consumeInvalidEnumDeclaration();
break;
-
+
case 487 : if (DEBUG) { System.out.println("LocalVariableDeclarationStatement ::=..."); } //$NON-NLS-1$
- consumeLocalVariableDeclarationStatement();
+ consumeLocalVariableDeclarationStatement();
break;
-
+
case 488 : if (DEBUG) { System.out.println("LocalVariableDeclaration ::= Type PushModifiers..."); } //$NON-NLS-1$
- consumeLocalVariableDeclaration();
+ consumeLocalVariableDeclaration();
break;
-
+
case 489 : if (DEBUG) { System.out.println("LocalVariableDeclaration ::= Modifiers Type..."); } //$NON-NLS-1$
- consumeLocalVariableDeclaration();
+ consumeLocalVariableDeclaration();
break;
-
+
case 490 : if (DEBUG) { System.out.println("PushModifiers ::="); } //$NON-NLS-1$
- consumePushModifiers();
+ consumePushModifiers();
break;
-
+
case 491 : if (DEBUG) { System.out.println("PushModifiersForHeader ::="); } //$NON-NLS-1$
- consumePushModifiersForHeader();
+ consumePushModifiersForHeader();
break;
-
+
case 492 : if (DEBUG) { System.out.println("PushRealModifiers ::="); } //$NON-NLS-1$
- consumePushRealModifiers();
+ consumePushRealModifiers();
break;
-
+
case 521 : if (DEBUG) { System.out.println("EmptyStatement ::= SEMICOLON"); } //$NON-NLS-1$
- consumeEmptyStatement();
+ consumeEmptyStatement();
break;
-
+
case 522 : if (DEBUG) { System.out.println("LabeledStatement ::= Label COLON Statement"); } //$NON-NLS-1$
- consumeStatementLabel() ;
+ consumeStatementLabel() ;
break;
-
+
case 523 : if (DEBUG) { System.out.println("LabeledStatementNoShortIf ::= Label COLON..."); } //$NON-NLS-1$
- consumeStatementLabel() ;
+ consumeStatementLabel() ;
break;
-
+
case 524 : if (DEBUG) { System.out.println("Label ::= Identifier"); } //$NON-NLS-1$
- consumeLabel() ;
+ consumeLabel() ;
break;
-
+
case 525 : if (DEBUG) { System.out.println("ExpressionStatement ::= StatementExpression SEMICOLON"); } //$NON-NLS-1$
- consumeExpressionStatement();
+ consumeExpressionStatement();
break;
-
+
case 535 : if (DEBUG) { System.out.println("IfThenStatement ::= if LPAREN Expression RPAREN..."); } //$NON-NLS-1$
- consumeStatementIfNoElse();
+ consumeStatementIfNoElse();
break;
-
+
case 536 : if (DEBUG) { System.out.println("IfThenElseStatement ::= if LPAREN Expression RPAREN..."); } //$NON-NLS-1$
- consumeStatementIfWithElse();
+ consumeStatementIfWithElse();
break;
-
+
case 537 : if (DEBUG) { System.out.println("IfThenElseStatementNoShortIf ::= if LPAREN Expression..."); } //$NON-NLS-1$
- consumeStatementIfWithElse();
+ consumeStatementIfWithElse();
break;
-
+
case 538 : if (DEBUG) { System.out.println("SwitchStatement ::= switch LPAREN Expression RPAREN..."); } //$NON-NLS-1$
- consumeStatementSwitch() ;
+ consumeStatementSwitch() ;
break;
-
+
case 539 : if (DEBUG) { System.out.println("SwitchBlock ::= LBRACE RBRACE"); } //$NON-NLS-1$
- consumeEmptySwitchBlock() ;
+ consumeEmptySwitchBlock() ;
break;
-
+
case 542 : if (DEBUG) { System.out.println("SwitchBlock ::= LBRACE SwitchBlockStatements..."); } //$NON-NLS-1$
- consumeSwitchBlock() ;
+ consumeSwitchBlock() ;
break;
-
+
case 544 : if (DEBUG) { System.out.println("SwitchBlockStatements ::= SwitchBlockStatements..."); } //$NON-NLS-1$
- consumeSwitchBlockStatements() ;
+ consumeSwitchBlockStatements() ;
break;
-
+
case 546 : if (DEBUG) { System.out.println("SwitchBlockStatement ::= SwitchLabels BlockStatements"); } //$NON-NLS-1$
- consumeSwitchBlockStatement() ;
+ consumeSwitchBlockStatement() ;
break;
-
+
case 548 : if (DEBUG) { System.out.println("SwitchLabels ::= SwitchLabels SwitchLabel"); } //$NON-NLS-1$
- consumeSwitchLabels() ;
+ consumeSwitchLabels() ;
break;
-
+
case 549 : if (DEBUG) { System.out.println("SwitchLabel ::= SwitchLabelCaseLhs COLON"); } //$NON-NLS-1$
- consumeCaseLabel();
+ consumeCaseLabel();
break;
-
+
case 550 : if (DEBUG) { System.out.println("SwitchLabel ::= default COLON"); } //$NON-NLS-1$
- consumeDefaultLabel();
+ consumeDefaultLabel();
break;
-
+
case 553 : if (DEBUG) { System.out.println("SwitchExpression ::= switch LPAREN Expression RPAREN..."); } //$NON-NLS-1$
- consumeSwitchExpression() ;
+ consumeSwitchExpression() ;
break;
-
+
case 556 : if (DEBUG) { System.out.println("SwitchLabeledRule ::= SwitchLabeledThrowStatement"); } //$NON-NLS-1$
- consumeSwitchLabeledRule();
+ consumeSwitchLabeledRule();
break;
-
+
case 557 : if (DEBUG) { System.out.println("SwitchLabeledExpression ::= SwitchLabelExpr Expression"); } //$NON-NLS-1$
- consumeSwitchLabeledExpression();
+ consumeSwitchLabeledExpression();
break;
-
+
case 558 : if (DEBUG) { System.out.println("SwitchLabeledBlock ::= SwitchLabelExpr Block"); } //$NON-NLS-1$
- consumeSwitchLabeledBlock();
+ consumeSwitchLabeledBlock();
break;
-
+
case 559 : if (DEBUG) { System.out.println("SwitchLabeledThrowStatement ::= SwitchLabelExpr..."); } //$NON-NLS-1$
- consumeSwitchLabeledThrowStatement();
+ consumeSwitchLabeledThrowStatement();
break;
-
+
case 560 : if (DEBUG) { System.out.println("SwitchLabelExpr ::= default ARROW"); } //$NON-NLS-1$
- consumeDefaultLabelExpr();
+ consumeDefaultLabelExpr();
break;
-
+
case 561 : if (DEBUG) { System.out.println("SwitchLabelExpr ::= SwitchLabelCaseLhs BeginCaseExpr..."); } //$NON-NLS-1$
- consumeCaseLabelExpr();
+ consumeCaseLabelExpr();
break;
-
+
case 562 : if (DEBUG) { System.out.println("SwitchLabelCaseLhs ::= case ConstantExpressions"); } //$NON-NLS-1$
- consumeSwitchLabelCaseLhs();
+ consumeSwitchLabelCaseLhs();
break;
-
+
case 563 : if (DEBUG) { System.out.println("YieldStatement ::= RestrictedIdentifierYield Expression"); } //$NON-NLS-1$
- consumeStatementYield() ;
+ consumeStatementYield() ;
break;
-
+
case 564 : if (DEBUG) { System.out.println("WhileStatement ::= while LPAREN Expression RPAREN..."); } //$NON-NLS-1$
- consumeStatementWhile() ;
+ consumeStatementWhile() ;
break;
-
+
case 565 : if (DEBUG) { System.out.println("WhileStatementNoShortIf ::= while LPAREN Expression..."); } //$NON-NLS-1$
- consumeStatementWhile() ;
+ consumeStatementWhile() ;
break;
-
+
case 566 : if (DEBUG) { System.out.println("DoStatement ::= do Statement while LPAREN Expression..."); } //$NON-NLS-1$
- consumeStatementDo() ;
+ consumeStatementDo() ;
break;
-
+
case 567 : if (DEBUG) { System.out.println("ForStatement ::= for LPAREN ForInitopt SEMICOLON..."); } //$NON-NLS-1$
- consumeStatementFor() ;
+ consumeStatementFor() ;
break;
-
+
case 568 : if (DEBUG) { System.out.println("ForStatementNoShortIf ::= for LPAREN ForInitopt..."); } //$NON-NLS-1$
- consumeStatementFor() ;
+ consumeStatementFor() ;
break;
-
+
case 569 : if (DEBUG) { System.out.println("ForInit ::= StatementExpressionList"); } //$NON-NLS-1$
- consumeForInit() ;
+ consumeForInit() ;
break;
-
+
case 573 : if (DEBUG) { System.out.println("StatementExpressionList ::= StatementExpressionList..."); } //$NON-NLS-1$
- consumeStatementExpressionList() ;
+ consumeStatementExpressionList() ;
break;
-
+
case 574 : if (DEBUG) { System.out.println("WithinStatement ::= within LPAREN Expression RPAREN..."); } //$NON-NLS-1$
- consumeWithinStatement();
+ consumeWithinStatement();
break;
-
+
case 575 : if (DEBUG) { System.out.println("AssertStatement ::= assert Expression SEMICOLON"); } //$NON-NLS-1$
- consumeSimpleAssertStatement() ;
+ consumeSimpleAssertStatement() ;
break;
-
+
case 576 : if (DEBUG) { System.out.println("AssertStatement ::= assert Expression COLON Expression"); } //$NON-NLS-1$
- consumeAssertStatement() ;
+ consumeAssertStatement() ;
break;
-
+
case 577 : if (DEBUG) { System.out.println("BreakStatement ::= break SEMICOLON"); } //$NON-NLS-1$
- consumeStatementBreak() ;
+ consumeStatementBreak() ;
break;
-
+
case 578 : if (DEBUG) { System.out.println("BreakStatement ::= break Identifier SEMICOLON"); } //$NON-NLS-1$
- consumeStatementBreakWithLabel() ;
+ consumeStatementBreakWithLabel() ;
break;
-
+
case 579 : if (DEBUG) { System.out.println("ContinueStatement ::= continue SEMICOLON"); } //$NON-NLS-1$
- consumeStatementContinue() ;
+ consumeStatementContinue() ;
break;
-
+
case 580 : if (DEBUG) { System.out.println("ContinueStatement ::= continue Identifier SEMICOLON"); } //$NON-NLS-1$
- consumeStatementContinueWithLabel() ;
+ consumeStatementContinueWithLabel() ;
break;
-
+
case 581 : if (DEBUG) { System.out.println("ReturnStatement ::= return Expressionopt SEMICOLON"); } //$NON-NLS-1$
- consumeStatementReturn() ;
+ consumeStatementReturn() ;
break;
-
+
case 582 : if (DEBUG) { System.out.println("ThrowStatement ::= throw Expression SEMICOLON"); } //$NON-NLS-1$
- consumeStatementThrow();
+ consumeStatementThrow();
break;
-
+
case 583 : if (DEBUG) { System.out.println("ThrowExpression ::= throw Expression"); } //$NON-NLS-1$
- consumeThrowExpression() ;
+ consumeThrowExpression() ;
break;
-
+
case 584 : if (DEBUG) { System.out.println("SynchronizedStatement ::= OnlySynchronized LPAREN..."); } //$NON-NLS-1$
- consumeStatementSynchronized();
+ consumeStatementSynchronized();
break;
-
+
case 585 : if (DEBUG) { System.out.println("OnlySynchronized ::= synchronized"); } //$NON-NLS-1$
- consumeOnlySynchronized();
+ consumeOnlySynchronized();
break;
-
+
case 586 : if (DEBUG) { System.out.println("TryStatement ::= try TryBlock Catches"); } //$NON-NLS-1$
- consumeStatementTry(false, false);
+ consumeStatementTry(false, false);
break;
-
+
case 587 : if (DEBUG) { System.out.println("TryStatement ::= try TryBlock Catchesopt Finally"); } //$NON-NLS-1$
- consumeStatementTry(true, false);
+ consumeStatementTry(true, false);
break;
-
+
case 588 : if (DEBUG) { System.out.println("TryStatementWithResources ::= try ResourceSpecification"); } //$NON-NLS-1$
- consumeStatementTry(false, true);
+ consumeStatementTry(false, true);
break;
-
+
case 589 : if (DEBUG) { System.out.println("TryStatementWithResources ::= try ResourceSpecification"); } //$NON-NLS-1$
- consumeStatementTry(true, true);
+ consumeStatementTry(true, true);
break;
-
+
case 590 : if (DEBUG) { System.out.println("ResourceSpecification ::= LPAREN Resources ;opt RPAREN"); } //$NON-NLS-1$
- consumeResourceSpecification();
+ consumeResourceSpecification();
break;
-
+
case 591 : if (DEBUG) { System.out.println(";opt ::="); } //$NON-NLS-1$
- consumeResourceOptionalTrailingSemiColon(false);
+ consumeResourceOptionalTrailingSemiColon(false);
break;
-
+
case 592 : if (DEBUG) { System.out.println(";opt ::= SEMICOLON"); } //$NON-NLS-1$
- consumeResourceOptionalTrailingSemiColon(true);
+ consumeResourceOptionalTrailingSemiColon(true);
break;
-
+
case 593 : if (DEBUG) { System.out.println("Resources ::= Resource"); } //$NON-NLS-1$
- consumeSingleResource();
+ consumeSingleResource();
break;
-
+
case 594 : if (DEBUG) { System.out.println("Resources ::= Resources TrailingSemiColon Resource"); } //$NON-NLS-1$
- consumeMultipleResources();
+ consumeMultipleResources();
break;
-
+
case 595 : if (DEBUG) { System.out.println("TrailingSemiColon ::= SEMICOLON"); } //$NON-NLS-1$
- consumeResourceOptionalTrailingSemiColon(true);
+ consumeResourceOptionalTrailingSemiColon(true);
break;
-
+
case 596 : if (DEBUG) { System.out.println("Resource ::= Type PushModifiers VariableDeclaratorId..."); } //$NON-NLS-1$
- consumeResourceAsLocalVariableDeclaration();
+ consumeResourceAsLocalVariableDeclaration();
break;
-
+
case 597 : if (DEBUG) { System.out.println("Resource ::= Modifiers Type PushRealModifiers..."); } //$NON-NLS-1$
- consumeResourceAsLocalVariableDeclaration();
+ consumeResourceAsLocalVariableDeclaration();
break;
-
+
case 598 : if (DEBUG) { System.out.println("Resource ::= Name"); } //$NON-NLS-1$
- consumeResourceAsLocalVariable();
+ consumeResourceAsLocalVariable();
break;
-
+
case 599 : if (DEBUG) { System.out.println("Resource ::= FieldAccess"); } //$NON-NLS-1$
- consumeResourceAsFieldAccess();
+ consumeResourceAsFieldAccess();
break;
-
+
case 601 : if (DEBUG) { System.out.println("ExitTryBlock ::="); } //$NON-NLS-1$
- consumeExitTryBlock();
+ consumeExitTryBlock();
break;
-
+
case 603 : if (DEBUG) { System.out.println("Catches ::= Catches CatchClause"); } //$NON-NLS-1$
- consumeCatches();
+ consumeCatches();
break;
-
+
case 604 : if (DEBUG) { System.out.println("CatchClause ::= catch LPAREN CatchFormalParameter RPAREN"); } //$NON-NLS-1$
- consumeStatementCatch() ;
+ consumeStatementCatch() ;
break;
-
+
case 606 : if (DEBUG) { System.out.println("PushLPAREN ::= LPAREN"); } //$NON-NLS-1$
- consumeLeftParen();
+ consumeLeftParen();
break;
-
+
case 607 : if (DEBUG) { System.out.println("PushRPAREN ::= RPAREN"); } //$NON-NLS-1$
- consumeRightParen();
+ consumeRightParen();
break;
-
+
case 612 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= this"); } //$NON-NLS-1$
- consumePrimaryNoNewArrayThis();
+ consumePrimaryNoNewArrayThis();
break;
-
+
case 613 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PushLPAREN Expression_NotName..."); } //$NON-NLS-1$
- consumePrimaryNoNewArray();
+ consumePrimaryNoNewArray();
break;
-
+
case 614 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PushLPAREN Name PushRPAREN"); } //$NON-NLS-1$
- consumePrimaryNoNewArrayWithName();
+ consumePrimaryNoNewArrayWithName();
break;
-
+
case 618 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT this"); } //$NON-NLS-1$
- consumePrimaryNoNewArrayNameThis();
+ consumePrimaryNoNewArrayNameThis();
break;
-
+
case 619 : if (DEBUG) { System.out.println("QualifiedSuperReceiver ::= Name DOT super"); } //$NON-NLS-1$
- consumeQualifiedSuperReceiver();
+ consumeQualifiedSuperReceiver();
break;
-
+
case 620 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT class"); } //$NON-NLS-1$
- consumePrimaryNoNewArrayName();
+ consumePrimaryNoNewArrayName();
break;
-
+
case 621 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name Dims DOT class"); } //$NON-NLS-1$
- consumePrimaryNoNewArrayArrayType();
+ consumePrimaryNoNewArrayArrayType();
break;
-
+
case 622 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PrimitiveType Dims DOT class"); } //$NON-NLS-1$
- consumePrimaryNoNewArrayPrimitiveArrayType();
+ consumePrimaryNoNewArrayPrimitiveArrayType();
break;
-
+
case 623 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PrimitiveType DOT class"); } //$NON-NLS-1$
- consumePrimaryNoNewArrayPrimitiveType();
+ consumePrimaryNoNewArrayPrimitiveType();
break;
-
+
case 624 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS..."); } //$NON-NLS-1$
- consumeRoleClassLiteral();
+ consumeRoleClassLiteral();
break;
-
+
case 630 : if (DEBUG) { System.out.println("ReferenceExpressionTypeArgumentsAndTrunk0 ::=..."); } //$NON-NLS-1$
- consumeReferenceExpressionTypeArgumentsAndTrunk(false);
+ consumeReferenceExpressionTypeArgumentsAndTrunk(false);
break;
-
+
case 631 : if (DEBUG) { System.out.println("ReferenceExpressionTypeArgumentsAndTrunk0 ::=..."); } //$NON-NLS-1$
- consumeReferenceExpressionTypeArgumentsAndTrunk(true);
+ consumeReferenceExpressionTypeArgumentsAndTrunk(true);
break;
-
+
case 632 : if (DEBUG) { System.out.println("ReferenceExpression ::= PrimitiveType Dims COLON_COLON"); } //$NON-NLS-1$
- consumeReferenceExpressionTypeForm(true);
+ consumeReferenceExpressionTypeForm(true);
break;
-
+
case 633 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name Dimsopt COLON_COLON..."); } //$NON-NLS-1$
- consumeReferenceExpressionTypeForm(false);
+ consumeReferenceExpressionTypeForm(false);
break;
-
+
case 634 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name BeginTypeArguments..."); } //$NON-NLS-1$
- consumeReferenceExpressionGenericTypeForm();
+ consumeReferenceExpressionGenericTypeForm();
break;
-
+
case 635 : if (DEBUG) { System.out.println("ReferenceExpression ::= Primary COLON_COLON..."); } //$NON-NLS-1$
- consumeReferenceExpressionPrimaryForm();
+ consumeReferenceExpressionPrimaryForm();
break;
-
+
case 636 : if (DEBUG) { System.out.println("ReferenceExpression ::= QualifiedSuperReceiver..."); } //$NON-NLS-1$
- consumeReferenceExpressionPrimaryForm();
+ consumeReferenceExpressionPrimaryForm();
break;
-
+
case 637 : if (DEBUG) { System.out.println("ReferenceExpression ::= super COLON_COLON..."); } //$NON-NLS-1$
- consumeReferenceExpressionSuperForm();
+ consumeReferenceExpressionSuperForm();
break;
-
+
case 638 : if (DEBUG) { System.out.println("NonWildTypeArgumentsopt ::="); } //$NON-NLS-1$
- consumeEmptyTypeArguments();
+ consumeEmptyTypeArguments();
break;
-
+
case 640 : if (DEBUG) { System.out.println("IdentifierOrNew ::= Identifier"); } //$NON-NLS-1$
- consumeIdentifierOrNew(false);
+ consumeIdentifierOrNew(false);
break;
-
+
case 641 : if (DEBUG) { System.out.println("IdentifierOrNew ::= new"); } //$NON-NLS-1$
- consumeIdentifierOrNew(true);
+ consumeIdentifierOrNew(true);
break;
-
+
case 642 : if (DEBUG) { System.out.println("LambdaExpression ::= LambdaParameters ARROW EnterLambda"); } //$NON-NLS-1$
- consumeLambdaExpression();
+ consumeLambdaExpression();
break;
-
+
case 643 : if (DEBUG) { System.out.println("EnterLambda ::="); } //$NON-NLS-1$
- consumeLambdaHeader();
+ consumeLambdaHeader();
break;
-
+
case 644 : if (DEBUG) { System.out.println("NestedLambda ::="); } //$NON-NLS-1$
- consumeNestedLambda();
+ consumeNestedLambda();
break;
-
+
case 645 : if (DEBUG) { System.out.println("LambdaParameters ::= Identifier NestedLambda"); } //$NON-NLS-1$
- consumeTypeElidedLambdaParameter(false);
+ consumeTypeElidedLambdaParameter(false);
break;
-
+
case 651 : if (DEBUG) { System.out.println("TypeElidedFormalParameterList ::=..."); } //$NON-NLS-1$
- consumeFormalParameterList();
+ consumeFormalParameterList();
break;
-
+
case 652 : if (DEBUG) { System.out.println("TypeElidedFormalParameter ::= Modifiersopt Identifier"); } //$NON-NLS-1$
- consumeTypeElidedLambdaParameter(true);
+ consumeTypeElidedLambdaParameter(true);
break;
-
+
case 655 : if (DEBUG) { System.out.println("ElidedLeftBraceAndReturn ::="); } //$NON-NLS-1$
- consumeElidedLeftBraceAndReturn();
+ consumeElidedLeftBraceAndReturn();
break;
-
+
case 656 : if (DEBUG) { System.out.println("AllocationHeader ::= new ClassType LPAREN..."); } //$NON-NLS-1$
- consumeAllocationHeader();
+ consumeAllocationHeader();
break;
-
+
case 657 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= new..."); } //$NON-NLS-1$
- consumeClassInstanceCreationExpressionWithTypeArguments();
+ consumeClassInstanceCreationExpressionWithTypeArguments();
break;
-
+
case 658 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= new ClassType..."); } //$NON-NLS-1$
- consumeClassInstanceCreationExpression();
+ consumeClassInstanceCreationExpression();
break;
-
+
case 659 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= Primary DOT new..."); } //$NON-NLS-1$
- consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ;
+ consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ;
break;
-
+
case 660 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= Primary DOT new..."); } //$NON-NLS-1$
- consumeClassInstanceCreationExpressionQualified() ;
+ consumeClassInstanceCreationExpressionQualified() ;
break;
-
+
case 661 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::=..."); } //$NON-NLS-1$
- consumeClassInstanceCreationExpressionQualified() ;
+ consumeClassInstanceCreationExpressionQualified() ;
break;
-
+
case 662 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::=..."); } //$NON-NLS-1$
- consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ;
+ consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ;
break;
-
+
case 663 : if (DEBUG) { System.out.println("EnterInstanceCreationArgumentList ::="); } //$NON-NLS-1$
- consumeEnterInstanceCreationArgumentList();
+ consumeEnterInstanceCreationArgumentList();
break;
-
+
case 664 : if (DEBUG) { System.out.println("ClassInstanceCreationExpressionName ::= Name DOT new"); } //$NON-NLS-1$
- consumeClassInstanceCreationExpressionName() ;
+ consumeClassInstanceCreationExpressionName() ;
break;
-
+
case 665 : if (DEBUG) { System.out.println("UnqualifiedClassBodyopt ::="); } //$NON-NLS-1$
- consumeClassBodyopt();
+ consumeClassBodyopt();
break;
-
+
case 667 : if (DEBUG) { System.out.println("UnqualifiedEnterAnonymousClassBody ::="); } //$NON-NLS-1$
- consumeEnterAnonymousClassBody(false);
+ consumeEnterAnonymousClassBody(false);
break;
-
+
case 668 : if (DEBUG) { System.out.println("QualifiedClassBodyopt ::="); } //$NON-NLS-1$
- consumeClassBodyopt();
+ consumeClassBodyopt();
break;
-
+
case 670 : if (DEBUG) { System.out.println("QualifiedEnterAnonymousClassBody ::="); } //$NON-NLS-1$
- consumeEnterAnonymousClassBody(true);
+ consumeEnterAnonymousClassBody(true);
break;
-
+
case 672 : if (DEBUG) { System.out.println("ArgumentList ::= ArgumentList COMMA Expression"); } //$NON-NLS-1$
- consumeArgumentList();
+ consumeArgumentList();
break;
-
+
case 673 : if (DEBUG) { System.out.println("ArrayCreationHeader ::= new PrimitiveType..."); } //$NON-NLS-1$
- consumeArrayCreationHeader();
+ consumeArrayCreationHeader();
break;
-
+
case 674 : if (DEBUG) { System.out.println("ArrayCreationHeader ::= new ClassOrInterfaceType..."); } //$NON-NLS-1$
- consumeArrayCreationHeader();
+ consumeArrayCreationHeader();
break;
-
+
case 675 : if (DEBUG) { System.out.println("ArrayCreationWithoutArrayInitializer ::= new..."); } //$NON-NLS-1$
- consumeArrayCreationExpressionWithoutInitializer();
+ consumeArrayCreationExpressionWithoutInitializer();
break;
-
+
case 676 : if (DEBUG) { System.out.println("ArrayCreationWithArrayInitializer ::= new PrimitiveType"); } //$NON-NLS-1$
- consumeArrayCreationExpressionWithInitializer();
+ consumeArrayCreationExpressionWithInitializer();
break;
-
+
case 677 : if (DEBUG) { System.out.println("ArrayCreationWithoutArrayInitializer ::= new..."); } //$NON-NLS-1$
- consumeArrayCreationExpressionWithoutInitializer();
+ consumeArrayCreationExpressionWithoutInitializer();
break;
-
+
case 678 : if (DEBUG) { System.out.println("ArrayCreationWithArrayInitializer ::= new..."); } //$NON-NLS-1$
- consumeArrayCreationExpressionWithInitializer();
+ consumeArrayCreationExpressionWithInitializer();
break;
-
+
case 680 : if (DEBUG) { System.out.println("DimWithOrWithOutExprs ::= DimWithOrWithOutExprs..."); } //$NON-NLS-1$
- consumeDimWithOrWithOutExprs();
+ consumeDimWithOrWithOutExprs();
break;
-
+
case 682 : if (DEBUG) { System.out.println("DimWithOrWithOutExpr ::= TypeAnnotationsopt LBRACKET..."); } //$NON-NLS-1$
- consumeDimWithOrWithOutExpr();
+ consumeDimWithOrWithOutExpr();
break;
-
+
case 683 : if (DEBUG) { System.out.println("Dims ::= DimsLoop"); } //$NON-NLS-1$
- consumeDims();
+ consumeDims();
break;
-
+
case 686 : if (DEBUG) { System.out.println("OneDimLoop ::= LBRACKET RBRACKET"); } //$NON-NLS-1$
- consumeOneDimLoop(false);
+ consumeOneDimLoop(false);
break;
-
+
case 687 : if (DEBUG) { System.out.println("OneDimLoop ::= TypeAnnotations LBRACKET RBRACKET"); } //$NON-NLS-1$
- consumeOneDimLoop(true);
+ consumeOneDimLoop(true);
break;
-
+
case 688 : if (DEBUG) { System.out.println("FieldAccess ::= Primary DOT Identifier"); } //$NON-NLS-1$
- consumeFieldAccess(false);
+ consumeFieldAccess(false);
break;
-
+
case 689 : if (DEBUG) { System.out.println("FieldAccess ::= super DOT Identifier"); } //$NON-NLS-1$
- consumeFieldAccess(true);
+ consumeFieldAccess(true);
break;
-
+
case 690 : if (DEBUG) { System.out.println("FieldAccess ::= QualifiedSuperReceiver DOT Identifier"); } //$NON-NLS-1$
- consumeFieldAccess(false);
+ consumeFieldAccess(false);
break;
-
+
case 691 : if (DEBUG) { System.out.println("MethodInvocation ::= Name LPAREN ArgumentListopt RPAREN"); } //$NON-NLS-1$
- consumeMethodInvocationName();
+ consumeMethodInvocationName();
break;
-
+
case 692 : if (DEBUG) { System.out.println("MethodInvocation ::= Name DOT OnlyTypeArguments..."); } //$NON-NLS-1$
- consumeMethodInvocationNameWithTypeArguments();
+ consumeMethodInvocationNameWithTypeArguments();
break;
-
+
case 693 : if (DEBUG) { System.out.println("MethodInvocation ::= Primary DOT OnlyTypeArguments..."); } //$NON-NLS-1$
- consumeMethodInvocationPrimaryWithTypeArguments();
+ consumeMethodInvocationPrimaryWithTypeArguments();
break;
-
+
case 694 : if (DEBUG) { System.out.println("MethodInvocation ::= Primary DOT Identifier LPAREN..."); } //$NON-NLS-1$
- consumeMethodInvocationPrimary();
+ consumeMethodInvocationPrimary();
break;
-
+
case 695 : if (DEBUG) { System.out.println("MethodInvocation ::= QualifiedSuperReceiver DOT..."); } //$NON-NLS-1$
- consumeMethodInvocationPrimary();
+ consumeMethodInvocationPrimary();
break;
-
+
case 696 : if (DEBUG) { System.out.println("MethodInvocation ::= QualifiedSuperReceiver DOT..."); } //$NON-NLS-1$
- consumeMethodInvocationPrimaryWithTypeArguments();
+ consumeMethodInvocationPrimaryWithTypeArguments();
break;
-
+
case 697 : if (DEBUG) { System.out.println("MethodInvocation ::= super DOT OnlyTypeArguments..."); } //$NON-NLS-1$
- consumeMethodInvocationSuperWithTypeArguments();
+ consumeMethodInvocationSuperWithTypeArguments();
break;
-
+
case 698 : if (DEBUG) { System.out.println("MethodInvocation ::= super DOT Identifier LPAREN..."); } //$NON-NLS-1$
- consumeMethodInvocationSuper();
+ consumeMethodInvocationSuper();
break;
-
+
case 699 : if (DEBUG) { System.out.println("MethodInvocation ::= tsuper DOT Identifier LPAREN..."); } //$NON-NLS-1$
- consumeMethodInvocationTSuper(UNQUALIFIED);
+ consumeMethodInvocationTSuper(UNQUALIFIED);
break;
-
+
case 700 : if (DEBUG) { System.out.println("MethodInvocation ::= tsuper DOT OnlyTypeArguments..."); } //$NON-NLS-1$
- consumeMethodInvocationTSuperWithTypeArguments(0);
+ consumeMethodInvocationTSuperWithTypeArguments(0);
break;
-
+
case 701 : if (DEBUG) { System.out.println("MethodInvocation ::= Name DOT tsuper DOT Identifier..."); } //$NON-NLS-1$
- consumeMethodInvocationTSuper(QUALIFIED);
+ consumeMethodInvocationTSuper(QUALIFIED);
break;
-
+
case 702 : if (DEBUG) { System.out.println("MethodInvocation ::= Name DOT tsuper DOT..."); } //$NON-NLS-1$
- consumeMethodInvocationTSuperWithTypeArguments(2);
+ consumeMethodInvocationTSuperWithTypeArguments(2);
break;
-
+
case 703 : if (DEBUG) { System.out.println("MethodInvocation ::= base DOT Identifier LPAREN..."); } //$NON-NLS-1$
- consumeMethodInvocationBase(false);
+ consumeMethodInvocationBase(false);
break;
-
+
case 704 : if (DEBUG) { System.out.println("MethodInvocation ::= base DOT OnlyTypeArguments..."); } //$NON-NLS-1$
- consumeMethodInvocationBaseWithTypeArguments(false);
+ consumeMethodInvocationBaseWithTypeArguments(false);
break;
-
+
case 705 : if (DEBUG) { System.out.println("MethodInvocation ::= base DOT super DOT Identifier..."); } //$NON-NLS-1$
- consumeMethodInvocationBase(true);
+ consumeMethodInvocationBase(true);
break;
-
+
case 706 : if (DEBUG) { System.out.println("MethodInvocation ::= base DOT super DOT..."); } //$NON-NLS-1$
- consumeMethodInvocationBaseWithTypeArguments(true);
+ consumeMethodInvocationBaseWithTypeArguments(true);
break;
-
+
case 707 : if (DEBUG) { System.out.println("ArrayAccess ::= Name LBRACKET Expression RBRACKET"); } //$NON-NLS-1$
- consumeArrayAccess(true);
+ consumeArrayAccess(true);
break;
-
+
case 708 : if (DEBUG) { System.out.println("ArrayAccess ::= PrimaryNoNewArray LBRACKET Expression..."); } //$NON-NLS-1$
- consumeArrayAccess(false);
+ consumeArrayAccess(false);
break;
-
+
case 709 : if (DEBUG) { System.out.println("ArrayAccess ::= ArrayCreationWithArrayInitializer..."); } //$NON-NLS-1$
- consumeArrayAccess(false);
+ consumeArrayAccess(false);
break;
-
+
case 711 : if (DEBUG) { System.out.println("PostfixExpression ::= Name"); } //$NON-NLS-1$
- consumePostfixExpression();
+ consumePostfixExpression();
break;
-
+
case 714 : if (DEBUG) { System.out.println("PostIncrementExpression ::= PostfixExpression PLUS_PLUS"); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.PLUS,true);
+ consumeUnaryExpression(OperatorIds.PLUS,true);
break;
-
+
case 715 : if (DEBUG) { System.out.println("PostDecrementExpression ::= PostfixExpression..."); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.MINUS,true);
+ consumeUnaryExpression(OperatorIds.MINUS,true);
break;
-
+
case 716 : if (DEBUG) { System.out.println("PushPosition ::="); } //$NON-NLS-1$
- consumePushPosition();
+ consumePushPosition();
break;
-
+
case 719 : if (DEBUG) { System.out.println("UnaryExpression ::= PLUS PushPosition UnaryExpression"); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.PLUS);
+ consumeUnaryExpression(OperatorIds.PLUS);
break;
-
+
case 720 : if (DEBUG) { System.out.println("UnaryExpression ::= MINUS PushPosition UnaryExpression"); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.MINUS);
+ consumeUnaryExpression(OperatorIds.MINUS);
break;
-
+
case 722 : if (DEBUG) { System.out.println("PreIncrementExpression ::= PLUS_PLUS PushPosition..."); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.PLUS,false);
+ consumeUnaryExpression(OperatorIds.PLUS,false);
break;
-
+
case 723 : if (DEBUG) { System.out.println("PreDecrementExpression ::= MINUS_MINUS PushPosition..."); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.MINUS,false);
+ consumeUnaryExpression(OperatorIds.MINUS,false);
break;
-
+
case 725 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus ::= TWIDDLE PushPosition..."); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.TWIDDLE);
+ consumeUnaryExpression(OperatorIds.TWIDDLE);
break;
-
+
case 726 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus ::= NOT PushPosition..."); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.NOT);
+ consumeUnaryExpression(OperatorIds.NOT);
break;
-
+
case 728 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN PrimitiveType Dimsopt..."); } //$NON-NLS-1$
- consumeCastExpressionWithPrimitiveType();
+ consumeCastExpressionWithPrimitiveType();
break;
-
+
case 729 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); } //$NON-NLS-1$
- consumeCastExpressionWithGenericsArray();
+ consumeCastExpressionWithGenericsArray();
break;
-
+
case 730 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); } //$NON-NLS-1$
- consumeCastExpressionWithQualifiedGenericsArray();
+ consumeCastExpressionWithQualifiedGenericsArray();
break;
-
+
case 731 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name PushRPAREN..."); } //$NON-NLS-1$
- consumeCastExpressionLL1();
+ consumeCastExpressionLL1();
break;
-
+
case 732 : if (DEBUG) { System.out.println("CastExpression ::= BeginIntersectionCast PushLPAREN..."); } //$NON-NLS-1$
- consumeCastExpressionLL1WithBounds();
+ consumeCastExpressionLL1WithBounds();
break;
-
+
case 733 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name Dims..."); } //$NON-NLS-1$
- consumeCastExpressionWithNameArray();
+ consumeCastExpressionWithNameArray();
break;
-
+
case 734 : if (DEBUG) { System.out.println("AdditionalBoundsListOpt ::="); } //$NON-NLS-1$
- consumeZeroAdditionalBounds();
+ consumeZeroAdditionalBounds();
break;
-
+
case 738 : if (DEBUG) { System.out.println("OnlyTypeArgumentsForCastExpression ::= OnlyTypeArguments"); } //$NON-NLS-1$
- consumeOnlyTypeArgumentsForCastExpression();
+ consumeOnlyTypeArgumentsForCastExpression();
break;
-
+
case 739 : if (DEBUG) { System.out.println("InsideCastExpression ::="); } //$NON-NLS-1$
- consumeInsideCastExpression();
+ consumeInsideCastExpression();
break;
-
+
case 740 : if (DEBUG) { System.out.println("InsideCastExpressionLL1 ::="); } //$NON-NLS-1$
- consumeInsideCastExpressionLL1();
+ consumeInsideCastExpressionLL1();
break;
-
+
case 741 : if (DEBUG) { System.out.println("InsideCastExpressionLL1WithBounds ::="); } //$NON-NLS-1$
- consumeInsideCastExpressionLL1WithBounds ();
+ consumeInsideCastExpressionLL1WithBounds ();
break;
-
+
case 742 : if (DEBUG) { System.out.println("InsideCastExpressionWithQualifiedGenerics ::="); } //$NON-NLS-1$
- consumeInsideCastExpressionWithQualifiedGenerics();
+ consumeInsideCastExpressionWithQualifiedGenerics();
break;
-
+
case 744 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.MULTIPLY);
+ consumeBinaryExpression(OperatorIds.MULTIPLY);
break;
-
+
case 745 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.DIVIDE);
+ consumeBinaryExpression(OperatorIds.DIVIDE);
break;
-
+
case 746 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.REMAINDER);
+ consumeBinaryExpression(OperatorIds.REMAINDER);
break;
-
+
case 748 : if (DEBUG) { System.out.println("AdditiveExpression ::= AdditiveExpression PLUS..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.PLUS);
+ consumeBinaryExpression(OperatorIds.PLUS);
break;
-
+
case 749 : if (DEBUG) { System.out.println("AdditiveExpression ::= AdditiveExpression MINUS..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.MINUS);
+ consumeBinaryExpression(OperatorIds.MINUS);
break;
-
+
case 751 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression LEFT_SHIFT..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.LEFT_SHIFT);
+ consumeBinaryExpression(OperatorIds.LEFT_SHIFT);
break;
-
+
case 752 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression RIGHT_SHIFT..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.RIGHT_SHIFT);
+ consumeBinaryExpression(OperatorIds.RIGHT_SHIFT);
break;
-
+
case 753 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT);
+ consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT);
break;
-
+
case 755 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.LESS);
+ consumeBinaryExpression(OperatorIds.LESS);
break;
-
+
case 756 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression GREATER..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.GREATER);
+ consumeBinaryExpression(OperatorIds.GREATER);
break;
-
+
case 757 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS_EQUAL"); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.LESS_EQUAL);
+ consumeBinaryExpression(OperatorIds.LESS_EQUAL);
break;
-
+
case 758 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.GREATER_EQUAL);
+ consumeBinaryExpression(OperatorIds.GREATER_EQUAL);
break;
-
+
case 760 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression EQUAL_EQUAL..."); } //$NON-NLS-1$
- consumeEqualityExpression(OperatorIds.EQUAL_EQUAL);
+ consumeEqualityExpression(OperatorIds.EQUAL_EQUAL);
break;
-
+
case 761 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression NOT_EQUAL..."); } //$NON-NLS-1$
- consumeEqualityExpression(OperatorIds.NOT_EQUAL);
+ consumeEqualityExpression(OperatorIds.NOT_EQUAL);
break;
-
+
case 763 : if (DEBUG) { System.out.println("AndExpression ::= AndExpression AND EqualityExpression"); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.AND);
+ consumeBinaryExpression(OperatorIds.AND);
break;
-
+
case 765 : if (DEBUG) { System.out.println("ExclusiveOrExpression ::= ExclusiveOrExpression XOR..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.XOR);
+ consumeBinaryExpression(OperatorIds.XOR);
break;
-
+
case 767 : if (DEBUG) { System.out.println("InclusiveOrExpression ::= InclusiveOrExpression OR..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.OR);
+ consumeBinaryExpression(OperatorIds.OR);
break;
-
+
case 769 : if (DEBUG) { System.out.println("ConditionalAndExpression ::= ConditionalAndExpression..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.AND_AND);
+ consumeBinaryExpression(OperatorIds.AND_AND);
break;
-
+
case 771 : if (DEBUG) { System.out.println("ConditionalOrExpression ::= ConditionalOrExpression..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.OR_OR);
+ consumeBinaryExpression(OperatorIds.OR_OR);
break;
-
+
case 773 : if (DEBUG) { System.out.println("ConditionalExpression ::= ConditionalOrExpression..."); } //$NON-NLS-1$
- consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ;
+ consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ;
break;
-
+
case 776 : if (DEBUG) { System.out.println("Assignment ::= PostfixExpression AssignmentOperator..."); } //$NON-NLS-1$
- consumeAssignment();
+ consumeAssignment();
break;
-
+
case 778 : if (DEBUG) { System.out.println("Assignment ::= InvalidArrayInitializerAssignement"); } //$NON-NLS-1$
- ignoreExpressionAssignment();
+ ignoreExpressionAssignment();
break;
-
+
case 779 : if (DEBUG) { System.out.println("AssignmentOperator ::= EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(EQUAL);
+ consumeAssignmentOperator(EQUAL);
break;
-
+
case 780 : if (DEBUG) { System.out.println("AssignmentOperator ::= MULTIPLY_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(MULTIPLY);
+ consumeAssignmentOperator(MULTIPLY);
break;
-
+
case 781 : if (DEBUG) { System.out.println("AssignmentOperator ::= DIVIDE_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(DIVIDE);
+ consumeAssignmentOperator(DIVIDE);
break;
-
+
case 782 : if (DEBUG) { System.out.println("AssignmentOperator ::= REMAINDER_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(REMAINDER);
+ consumeAssignmentOperator(REMAINDER);
break;
-
+
case 783 : if (DEBUG) { System.out.println("AssignmentOperator ::= PLUS_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(PLUS);
+ consumeAssignmentOperator(PLUS);
break;
-
+
case 784 : if (DEBUG) { System.out.println("AssignmentOperator ::= MINUS_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(MINUS);
+ consumeAssignmentOperator(MINUS);
break;
-
+
case 785 : if (DEBUG) { System.out.println("AssignmentOperator ::= LEFT_SHIFT_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(LEFT_SHIFT);
+ consumeAssignmentOperator(LEFT_SHIFT);
break;
-
+
case 786 : if (DEBUG) { System.out.println("AssignmentOperator ::= RIGHT_SHIFT_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(RIGHT_SHIFT);
+ consumeAssignmentOperator(RIGHT_SHIFT);
break;
-
+
case 787 : if (DEBUG) { System.out.println("AssignmentOperator ::= UNSIGNED_RIGHT_SHIFT_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(UNSIGNED_RIGHT_SHIFT);
+ consumeAssignmentOperator(UNSIGNED_RIGHT_SHIFT);
break;
-
+
case 788 : if (DEBUG) { System.out.println("AssignmentOperator ::= AND_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(AND);
+ consumeAssignmentOperator(AND);
break;
-
+
case 789 : if (DEBUG) { System.out.println("AssignmentOperator ::= XOR_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(XOR);
+ consumeAssignmentOperator(XOR);
break;
-
+
case 790 : if (DEBUG) { System.out.println("AssignmentOperator ::= OR_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(OR);
+ consumeAssignmentOperator(OR);
break;
-
+
case 791 : if (DEBUG) { System.out.println("Expression ::= AssignmentExpression"); } //$NON-NLS-1$
- consumeExpression();
+ consumeExpression();
break;
-
+
case 794 : if (DEBUG) { System.out.println("Expressionopt ::="); } //$NON-NLS-1$
- consumeEmptyExpression();
+ consumeEmptyExpression();
break;
-
+
case 797 : if (DEBUG) { System.out.println("ConstantExpressions ::= ConstantExpressions COMMA..."); } //$NON-NLS-1$
- consumeConstantExpressions();
+ consumeConstantExpressions();
break;
-
+
case 801 : if (DEBUG) { System.out.println("ClassBodyDeclarationsopt ::="); } //$NON-NLS-1$
- consumeEmptyClassBodyDeclarationsopt();
+ consumeEmptyClassBodyDeclarationsopt();
break;
-
+
case 802 : if (DEBUG) { System.out.println("ClassBodyDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$
- consumeClassBodyDeclarationsopt();
+ consumeClassBodyDeclarationsopt();
break;
-
+
case 803 : if (DEBUG) { System.out.println("Modifiersopt ::="); } //$NON-NLS-1$
- consumeDefaultModifiers();
+ consumeDefaultModifiers();
break;
-
+
case 804 : if (DEBUG) { System.out.println("Modifiersopt ::= Modifiers"); } //$NON-NLS-1$
- consumeModifiers();
+ consumeModifiers();
break;
-
+
case 805 : if (DEBUG) { System.out.println("BlockStatementsopt ::="); } //$NON-NLS-1$
- consumeEmptyBlockStatementsopt();
+ consumeEmptyBlockStatementsopt();
break;
-
+
case 807 : if (DEBUG) { System.out.println("Dimsopt ::="); } //$NON-NLS-1$
- consumeEmptyDimsopt();
+ consumeEmptyDimsopt();
break;
-
+
case 809 : if (DEBUG) { System.out.println("ArgumentListopt ::="); } //$NON-NLS-1$
- consumeEmptyArgumentListopt();
+ consumeEmptyArgumentListopt();
break;
-
+
case 813 : if (DEBUG) { System.out.println("FormalParameterListopt ::="); } //$NON-NLS-1$
- consumeFormalParameterListopt();
+ consumeFormalParameterListopt();
break;
-
+
case 817 : if (DEBUG) { System.out.println("InterfaceMemberDeclarationsopt ::="); } //$NON-NLS-1$
- consumeEmptyInterfaceMemberDeclarationsopt();
+ consumeEmptyInterfaceMemberDeclarationsopt();
break;
-
+
case 818 : if (DEBUG) { System.out.println("InterfaceMemberDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$
- consumeInterfaceMemberDeclarationsopt();
+ consumeInterfaceMemberDeclarationsopt();
break;
-
+
case 819 : if (DEBUG) { System.out.println("NestedType ::="); } //$NON-NLS-1$
- consumeNestedType();
+ consumeNestedType();
break;
case 820 : if (DEBUG) { System.out.println("ForInitopt ::="); } //$NON-NLS-1$
- consumeEmptyForInitopt();
+ consumeEmptyForInitopt();
break;
-
+
case 822 : if (DEBUG) { System.out.println("ForUpdateopt ::="); } //$NON-NLS-1$
- consumeEmptyForUpdateopt();
+ consumeEmptyForUpdateopt();
break;
-
+
case 826 : if (DEBUG) { System.out.println("Catchesopt ::="); } //$NON-NLS-1$
- consumeEmptyCatchesopt();
+ consumeEmptyCatchesopt();
break;
-
+
case 828 : if (DEBUG) { System.out.println("EnumDeclaration ::= EnumHeader EnumBody"); } //$NON-NLS-1$
- consumeEnumDeclaration();
+ consumeEnumDeclaration();
break;
-
+
case 829 : if (DEBUG) { System.out.println("EnumHeader ::= EnumHeaderName ClassHeaderImplementsopt"); } //$NON-NLS-1$
- consumeEnumHeader();
+ consumeEnumHeader();
break;
-
+
case 830 : if (DEBUG) { System.out.println("EnumHeaderName ::= Modifiersopt enum Identifier"); } //$NON-NLS-1$
- consumeEnumHeaderName();
+ consumeEnumHeaderName();
break;
-
+
case 831 : if (DEBUG) { System.out.println("EnumHeaderName ::= Modifiersopt enum Identifier..."); } //$NON-NLS-1$
- consumeEnumHeaderNameWithTypeParameters();
+ consumeEnumHeaderNameWithTypeParameters();
break;
-
+
case 832 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumBodyDeclarationsopt RBRACE"); } //$NON-NLS-1$
- consumeEnumBodyNoConstants();
+ consumeEnumBodyNoConstants();
break;
-
+
case 833 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE COMMA EnumBodyDeclarationsopt..."); } //$NON-NLS-1$
- consumeEnumBodyNoConstants();
+ consumeEnumBodyNoConstants();
break;
-
+
case 834 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumConstants COMMA..."); } //$NON-NLS-1$
- consumeEnumBodyWithConstants();
+ consumeEnumBodyWithConstants();
break;
-
+
case 835 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumConstants..."); } //$NON-NLS-1$
- consumeEnumBodyWithConstants();
+ consumeEnumBodyWithConstants();
break;
-
+
case 837 : if (DEBUG) { System.out.println("EnumConstants ::= EnumConstants COMMA EnumConstant"); } //$NON-NLS-1$
- consumeEnumConstants();
+ consumeEnumConstants();
break;
-
+
case 838 : if (DEBUG) { System.out.println("EnumConstantHeaderName ::= Modifiersopt Identifier"); } //$NON-NLS-1$
- consumeEnumConstantHeaderName();
+ consumeEnumConstantHeaderName();
break;
-
+
case 839 : if (DEBUG) { System.out.println("EnumConstantHeader ::= EnumConstantHeaderName..."); } //$NON-NLS-1$
- consumeEnumConstantHeader();
+ consumeEnumConstantHeader();
break;
-
+
case 840 : if (DEBUG) { System.out.println("EnumConstant ::= EnumConstantHeader ForceNoDiet..."); } //$NON-NLS-1$
- consumeEnumConstantWithClassBody();
+ consumeEnumConstantWithClassBody();
break;
-
+
case 841 : if (DEBUG) { System.out.println("EnumConstant ::= EnumConstantHeader"); } //$NON-NLS-1$
- consumeEnumConstantNoClassBody();
+ consumeEnumConstantNoClassBody();
break;
-
+
case 842 : if (DEBUG) { System.out.println("Arguments ::= LPAREN ArgumentListopt RPAREN"); } //$NON-NLS-1$
- consumeArguments();
+ consumeArguments();
break;
-
+
case 843 : if (DEBUG) { System.out.println("Argumentsopt ::="); } //$NON-NLS-1$
- consumeEmptyArguments();
+ consumeEmptyArguments();
break;
-
+
case 845 : if (DEBUG) { System.out.println("EnumDeclarations ::= SEMICOLON ClassBodyDeclarationsopt"); } //$NON-NLS-1$
- consumeEnumDeclarations();
+ consumeEnumDeclarations();
break;
-
+
case 846 : if (DEBUG) { System.out.println("EnumBodyDeclarationsopt ::="); } //$NON-NLS-1$
- consumeEmptyEnumDeclarations();
+ consumeEmptyEnumDeclarations();
break;
-
+
case 848 : if (DEBUG) { System.out.println("EnhancedForStatement ::= EnhancedForStatementHeader..."); } //$NON-NLS-1$
- consumeEnhancedForStatement();
+ consumeEnhancedForStatement();
break;
-
+
case 849 : if (DEBUG) { System.out.println("EnhancedForStatementNoShortIf ::=..."); } //$NON-NLS-1$
- consumeEnhancedForStatement();
+ consumeEnhancedForStatement();
break;
-
+
case 850 : if (DEBUG) { System.out.println("EnhancedForStatementHeaderInit ::= for LPAREN Type..."); } //$NON-NLS-1$
- consumeEnhancedForStatementHeaderInit(false);
+ consumeEnhancedForStatementHeaderInit(false);
break;
-
+
case 851 : if (DEBUG) { System.out.println("EnhancedForStatementHeaderInit ::= for LPAREN Modifiers"); } //$NON-NLS-1$
- consumeEnhancedForStatementHeaderInit(true);
+ consumeEnhancedForStatementHeaderInit(true);
break;
-
+
case 852 : if (DEBUG) { System.out.println("EnhancedForStatementHeader ::=..."); } //$NON-NLS-1$
- consumeEnhancedForStatementHeader();
+ consumeEnhancedForStatementHeader();
break;
-
+
case 853 : if (DEBUG) { System.out.println("SingleBaseImportDeclaration ::=..."); } //$NON-NLS-1$
- consumeImportDeclaration();
+ consumeImportDeclaration();
break;
-
+
case 854 : if (DEBUG) { System.out.println("SingleBaseImportDeclarationName ::= import base Name"); } //$NON-NLS-1$
- consumeSingleBaseImportDeclarationName();
+ consumeSingleBaseImportDeclarationName();
break;
-
+
case 855 : if (DEBUG) { System.out.println("SingleStaticImportDeclaration ::=..."); } //$NON-NLS-1$
- consumeImportDeclaration();
+ consumeImportDeclaration();
break;
-
+
case 856 : if (DEBUG) { System.out.println("SingleStaticImportDeclarationName ::= import static Name"); } //$NON-NLS-1$
- consumeSingleStaticImportDeclarationName();
+ consumeSingleStaticImportDeclarationName();
break;
-
+
case 857 : if (DEBUG) { System.out.println("StaticImportOnDemandDeclaration ::=..."); } //$NON-NLS-1$
- consumeImportDeclaration();
+ consumeImportDeclaration();
break;
-
+
case 858 : if (DEBUG) { System.out.println("StaticImportOnDemandDeclarationName ::= import static..."); } //$NON-NLS-1$
- consumeStaticImportOnDemandDeclarationName();
+ consumeStaticImportOnDemandDeclarationName();
break;
-
+
case 859 : if (DEBUG) { System.out.println("TypeArguments ::= LESS TypeArgumentList1"); } //$NON-NLS-1$
- consumeTypeArguments();
+ consumeTypeArguments();
break;
-
+
case 860 : if (DEBUG) { System.out.println("OnlyTypeArguments ::= LESS TypeArgumentList1"); } //$NON-NLS-1$
- consumeOnlyTypeArguments();
+ consumeOnlyTypeArguments();
break;
-
+
case 862 : if (DEBUG) { System.out.println("TypeArgumentList1 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$
- consumeTypeArgumentList1();
+ consumeTypeArgumentList1();
break;
-
+
case 864 : if (DEBUG) { System.out.println("TypeArgumentList ::= TypeArgumentList COMMA TypeArgument"); } //$NON-NLS-1$
- consumeTypeArgumentList();
+ consumeTypeArgumentList();
break;
-
+
case 865 : if (DEBUG) { System.out.println("TypeArgument ::= ReferenceType"); } //$NON-NLS-1$
- consumeTypeArgument();
+ consumeTypeArgument();
break;
-
+
case 871 : if (DEBUG) { System.out.println("TypeAnchorOrAnnotatedTypeArgument -> AnyTypeAnchor"); } //$NON-NLS-1$
- confirmTypeAnchor();
+ confirmTypeAnchor();
break;
-
+
case 872 : if (DEBUG) { System.out.println("TypeAnchorOrAnnotatedTypeArgument ::=..."); } //$NON-NLS-1$
- consumeTypeArgumentFromAnchor();
+ consumeTypeArgumentFromAnchor();
break;
-
+
case 873 : if (DEBUG) { System.out.println("TypeAnchorOrAnnotatedTypeArgument ::=..."); } //$NON-NLS-1$
- consumeAnnotationsOnTypeArgumentFromAnchor();
+ consumeAnnotationsOnTypeArgumentFromAnchor();
break;
-
+
case 874 : if (DEBUG) { System.out.println("TypeAnchorOrAnnotatedTypeArgument1 ::= AnyTypeAnchor..."); } //$NON-NLS-1$
- confirmTypeAnchor();
+ confirmTypeAnchor();
break;
-
+
case 875 : if (DEBUG) { System.out.println("TypeAnchorOrAnnotatedTypeArgument1 ::=..."); } //$NON-NLS-1$
- consumeAnnotationsOnTypeArgumentFromAnchor();
+ consumeAnnotationsOnTypeArgumentFromAnchor();
break;
-
+
case 876 : if (DEBUG) { System.out.println("TypeAnchorOrAnnotatedTypeArgument1 ::=..."); } //$NON-NLS-1$
- consumeAnnotationsOnTypeArgumentFromAnchor();
+ consumeAnnotationsOnTypeArgumentFromAnchor();
break;
-
+
case 877 : if (DEBUG) { System.out.println("TypeAnchorOrAnnotatedTypeArgument2 ::= AnyTypeAnchor..."); } //$NON-NLS-1$
- confirmTypeAnchor();
+ confirmTypeAnchor();
break;
-
+
case 878 : if (DEBUG) { System.out.println("TypeAnchorOrAnnotatedTypeArgument2 ::=..."); } //$NON-NLS-1$
- consumeAnnotationsOnTypeArgumentFromAnchor();
+ consumeAnnotationsOnTypeArgumentFromAnchor();
break;
-
+
case 879 : if (DEBUG) { System.out.println("TypeAnchorOrAnnotatedTypeArgument2 ::=..."); } //$NON-NLS-1$
- consumeAnnotationsOnTypeArgumentFromAnchor();
+ consumeAnnotationsOnTypeArgumentFromAnchor();
break;
-
+
case 880 : if (DEBUG) { System.out.println("TypeAnchorOrAnnotatedTypeArgument3 ::= AnyTypeAnchor..."); } //$NON-NLS-1$
- confirmTypeAnchor();
+ confirmTypeAnchor();
break;
-
+
case 881 : if (DEBUG) { System.out.println("TypeAnchorOrAnnotatedTypeArgument3 ::=..."); } //$NON-NLS-1$
- consumeAnnotationsOnTypeArgumentFromAnchor();
+ consumeAnnotationsOnTypeArgumentFromAnchor();
break;
-
+
case 882 : if (DEBUG) { System.out.println("TypeAnchorOrAnnotatedTypeArgument3 ::=..."); } //$NON-NLS-1$
- consumeAnnotationsOnTypeArgumentFromAnchor();
+ consumeAnnotationsOnTypeArgumentFromAnchor();
break;
-
+
case 883 : if (DEBUG) { System.out.println("NotAnAnchor ::="); } //$NON-NLS-1$
- convertTypeAnchor(0);
+ convertTypeAnchor(0);
break;
-
+
case 884 : if (DEBUG) { System.out.println("NotAnAnchor ::= LPAREN SingleMemberAnnotationMemberValue"); } //$NON-NLS-1$
- convertTypeAnchor(1);
+ convertTypeAnchor(1);
break;
-
+
case 885 : if (DEBUG) { System.out.println("NotAnAnchor ::= LPAREN MemberValuePairsopt RPAREN"); } //$NON-NLS-1$
- convertTypeAnchor(2);
+ convertTypeAnchor(2);
break;
-
+
case 888 : if (DEBUG) { System.out.println("TentativeTypeAnchor ::= ATOT UnannotatableName"); } //$NON-NLS-1$
- consumeTypeAnchor(false);
+ consumeTypeAnchor(false);
break;
-
+
case 889 : if (DEBUG) { System.out.println("TypeAnchor ::= ATOT base"); } //$NON-NLS-1$
- consumeTypeAnchor(true);
+ consumeTypeAnchor(true);
break;
-
+
case 890 : if (DEBUG) { System.out.println("TypeAnchor ::= ATOT this"); } //$NON-NLS-1$
- skipThisAnchor();
+ skipThisAnchor();
break;
-
+
case 891 : if (DEBUG) { System.out.println("TypeAnchor ::= ATOT UnannotatableName DOT base"); } //$NON-NLS-1$
- consumeQualifiedBaseTypeAnchor();
+ consumeQualifiedBaseTypeAnchor();
break;
-
+
case 894 : if (DEBUG) { System.out.println("ReferenceType1 ::= ReferenceType GREATER"); } //$NON-NLS-1$
- consumeReferenceType1();
+ consumeReferenceType1();
break;
-
+
case 895 : if (DEBUG) { System.out.println("ReferenceType1 ::= ClassOrInterface LESS..."); } //$NON-NLS-1$
- consumeTypeArgumentReferenceType1();
+ consumeTypeArgumentReferenceType1();
break;
-
+
case 897 : if (DEBUG) { System.out.println("TypeArgumentList2 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$
- consumeTypeArgumentList2();
+ consumeTypeArgumentList2();
break;
-
+
case 900 : if (DEBUG) { System.out.println("ReferenceType2 ::= ReferenceType RIGHT_SHIFT"); } //$NON-NLS-1$
- consumeReferenceType2();
+ consumeReferenceType2();
break;
-
+
case 901 : if (DEBUG) { System.out.println("ReferenceType2 ::= ClassOrInterface LESS..."); } //$NON-NLS-1$
- consumeTypeArgumentReferenceType2();
+ consumeTypeArgumentReferenceType2();
break;
-
+
case 903 : if (DEBUG) { System.out.println("TypeArgumentList3 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$
- consumeTypeArgumentList3();
+ consumeTypeArgumentList3();
break;
-
+
case 906 : if (DEBUG) { System.out.println("ReferenceType3 ::= ReferenceType UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$
- consumeReferenceType3();
+ consumeReferenceType3();
break;
-
+
case 907 : if (DEBUG) { System.out.println("Wildcard ::= TypeAnnotationsopt QUESTION"); } //$NON-NLS-1$
- consumeWildcard();
+ consumeWildcard();
break;
-
+
case 908 : if (DEBUG) { System.out.println("Wildcard ::= TypeAnnotationsopt QUESTION WildcardBounds"); } //$NON-NLS-1$
- consumeWildcardWithBounds();
+ consumeWildcardWithBounds();
break;
-
+
case 909 : if (DEBUG) { System.out.println("WildcardBounds ::= extends ReferenceType"); } //$NON-NLS-1$
- consumeWildcardBoundsExtends();
+ consumeWildcardBoundsExtends();
break;
-
+
case 910 : if (DEBUG) { System.out.println("WildcardBounds ::= super ReferenceType"); } //$NON-NLS-1$
- consumeWildcardBoundsSuper();
+ consumeWildcardBoundsSuper();
break;
-
+
case 911 : if (DEBUG) { System.out.println("Wildcard1 ::= TypeAnnotationsopt QUESTION GREATER"); } //$NON-NLS-1$
- consumeWildcard1();
+ consumeWildcard1();
break;
-
+
case 912 : if (DEBUG) { System.out.println("Wildcard1 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$
- consumeWildcard1WithBounds();
+ consumeWildcard1WithBounds();
break;
-
+
case 913 : if (DEBUG) { System.out.println("WildcardBounds1 ::= extends ReferenceType1"); } //$NON-NLS-1$
- consumeWildcardBounds1Extends();
+ consumeWildcardBounds1Extends();
break;
-
+
case 914 : if (DEBUG) { System.out.println("WildcardBounds1 ::= super ReferenceType1"); } //$NON-NLS-1$
- consumeWildcardBounds1Super();
+ consumeWildcardBounds1Super();
break;
-
+
case 915 : if (DEBUG) { System.out.println("Wildcard2 ::= TypeAnnotationsopt QUESTION RIGHT_SHIFT"); } //$NON-NLS-1$
- consumeWildcard2();
+ consumeWildcard2();
break;
-
+
case 916 : if (DEBUG) { System.out.println("Wildcard2 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$
- consumeWildcard2WithBounds();
+ consumeWildcard2WithBounds();
break;
-
+
case 917 : if (DEBUG) { System.out.println("WildcardBounds2 ::= extends ReferenceType2"); } //$NON-NLS-1$
- consumeWildcardBounds2Extends();
+ consumeWildcardBounds2Extends();
break;
-
+
case 918 : if (DEBUG) { System.out.println("WildcardBounds2 ::= super ReferenceType2"); } //$NON-NLS-1$
- consumeWildcardBounds2Super();
+ consumeWildcardBounds2Super();
break;
-
+
case 919 : if (DEBUG) { System.out.println("Wildcard3 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$
- consumeWildcard3();
+ consumeWildcard3();
break;
-
+
case 920 : if (DEBUG) { System.out.println("Wildcard3 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$
- consumeWildcard3WithBounds();
+ consumeWildcard3WithBounds();
break;
-
+
case 921 : if (DEBUG) { System.out.println("WildcardBounds3 ::= extends ReferenceType3"); } //$NON-NLS-1$
- consumeWildcardBounds3Extends();
+ consumeWildcardBounds3Extends();
break;
-
+
case 922 : if (DEBUG) { System.out.println("WildcardBounds3 ::= super ReferenceType3"); } //$NON-NLS-1$
- consumeWildcardBounds3Super();
+ consumeWildcardBounds3Super();
break;
-
+
case 923 : if (DEBUG) { System.out.println("TypeParameterHeader ::= TypeAnnotationsopt Identifier"); } //$NON-NLS-1$
- consumeTypeParameterHeader();
+ consumeTypeParameterHeader();
break;
-
+
case 924 : if (DEBUG) { System.out.println("TypeParameters ::= LESS TypeParameterList1"); } //$NON-NLS-1$
- consumeTypeParameters();
+ consumeTypeParameters();
break;
-
+
case 926 : if (DEBUG) { System.out.println("TypeParameterList ::= TypeParameterList COMMA..."); } //$NON-NLS-1$
- consumeTypeParameterList();
+ consumeTypeParameterList();
break;
-
+
case 928 : if (DEBUG) { System.out.println("TypeParameter ::= TypeParameterHeader extends..."); } //$NON-NLS-1$
- consumeTypeParameterWithExtends();
+ consumeTypeParameterWithExtends();
break;
-
+
case 929 : if (DEBUG) { System.out.println("TypeParameter ::= TypeParameterHeader extends..."); } //$NON-NLS-1$
- consumeTypeParameterWithExtendsAndBounds();
+ consumeTypeParameterWithExtendsAndBounds();
break;
-
+
case 930 : if (DEBUG) { System.out.println("TypeParameter ::= TypeParameterHeader base ReferenceType"); } //$NON-NLS-1$
- consumeTypeParameterWithBase();
+ consumeTypeParameterWithBase();
break;
-
+
case 934 : if (DEBUG) { System.out.println("TypeValueParameter ::= TypeParameterHeader Identifier"); } //$NON-NLS-1$
- consumeTypeValueParameter();
+ consumeTypeValueParameter();
break;
-
+
case 939 : if (DEBUG) { System.out.println("TypeBoundOpt ::= extends ReferenceType"); } //$NON-NLS-1$
- consumeBoundsOfAnchoredTypeParameter();
+ consumeBoundsOfAnchoredTypeParameter();
break;
-
+
case 941 : if (DEBUG) { System.out.println("TypeBoundOpt1 ::= extends ReferenceType1"); } //$NON-NLS-1$
- consumeBoundsOfAnchoredTypeParameter();
+ consumeBoundsOfAnchoredTypeParameter();
break;
-
+
case 942 : if (DEBUG) { System.out.println("AnchoredTypeParameterHeader0 ::= TypeParameterHeader..."); } //$NON-NLS-1$
- consumeAnchoredTypeParameter();
+ consumeAnchoredTypeParameter();
break;
-
+
case 944 : if (DEBUG) { System.out.println("AdditionalBoundList ::= AdditionalBoundList..."); } //$NON-NLS-1$
- consumeAdditionalBoundList();
+ consumeAdditionalBoundList();
break;
-
+
case 945 : if (DEBUG) { System.out.println("AdditionalBound ::= AND ReferenceType"); } //$NON-NLS-1$
- consumeAdditionalBound();
+ consumeAdditionalBound();
break;
-
+
case 947 : if (DEBUG) { System.out.println("TypeParameterList1 ::= TypeParameterList COMMA..."); } //$NON-NLS-1$
- consumeTypeParameterList1();
+ consumeTypeParameterList1();
break;
-
+
case 948 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader GREATER"); } //$NON-NLS-1$
- consumeTypeParameter1();
+ consumeTypeParameter1();
break;
-
+
case 949 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader extends..."); } //$NON-NLS-1$
- consumeTypeParameter1WithExtends();
+ consumeTypeParameter1WithExtends();
break;
-
+
case 950 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader base..."); } //$NON-NLS-1$
- consumeTypeParameter1WithBase();
+ consumeTypeParameter1WithBase();
break;
-
+
case 951 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader extends..."); } //$NON-NLS-1$
- consumeTypeParameter1WithExtendsAndBounds();
+ consumeTypeParameter1WithExtendsAndBounds();
break;
-
+
case 953 : if (DEBUG) { System.out.println("AdditionalBoundList1 ::= AdditionalBoundList..."); } //$NON-NLS-1$
- consumeAdditionalBoundList1();
+ consumeAdditionalBoundList1();
break;
-
+
case 954 : if (DEBUG) { System.out.println("AdditionalBound1 ::= AND ReferenceType1"); } //$NON-NLS-1$
- consumeAdditionalBound1();
+ consumeAdditionalBound1();
break;
-
+
case 960 : if (DEBUG) { System.out.println("UnaryExpression_NotName ::= PLUS PushPosition..."); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.PLUS);
+ consumeUnaryExpression(OperatorIds.PLUS);
break;
-
+
case 961 : if (DEBUG) { System.out.println("UnaryExpression_NotName ::= MINUS PushPosition..."); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.MINUS);
+ consumeUnaryExpression(OperatorIds.MINUS);
break;
-
+
case 964 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus_NotName ::= TWIDDLE..."); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.TWIDDLE);
+ consumeUnaryExpression(OperatorIds.TWIDDLE);
break;
-
+
case 965 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus_NotName ::= NOT PushPosition"); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.NOT);
+ consumeUnaryExpression(OperatorIds.NOT);
break;
-
+
case 968 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.MULTIPLY);
+ consumeBinaryExpression(OperatorIds.MULTIPLY);
break;
-
+
case 969 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name MULTIPLY..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.MULTIPLY);
+ consumeBinaryExpressionWithName(OperatorIds.MULTIPLY);
break;
-
+
case 970 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.DIVIDE);
+ consumeBinaryExpression(OperatorIds.DIVIDE);
break;
-
+
case 971 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name DIVIDE..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.DIVIDE);
+ consumeBinaryExpressionWithName(OperatorIds.DIVIDE);
break;
-
+
case 972 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.REMAINDER);
+ consumeBinaryExpression(OperatorIds.REMAINDER);
break;
-
+
case 973 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name REMAINDER..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.REMAINDER);
+ consumeBinaryExpressionWithName(OperatorIds.REMAINDER);
break;
-
+
case 975 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.PLUS);
+ consumeBinaryExpression(OperatorIds.PLUS);
break;
-
+
case 976 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::= Name PLUS..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.PLUS);
+ consumeBinaryExpressionWithName(OperatorIds.PLUS);
break;
-
+
case 977 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.MINUS);
+ consumeBinaryExpression(OperatorIds.MINUS);
break;
-
+
case 978 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::= Name MINUS..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.MINUS);
+ consumeBinaryExpressionWithName(OperatorIds.MINUS);
break;
-
+
case 980 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.LEFT_SHIFT);
+ consumeBinaryExpression(OperatorIds.LEFT_SHIFT);
break;
-
+
case 981 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name LEFT_SHIFT..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.LEFT_SHIFT);
+ consumeBinaryExpressionWithName(OperatorIds.LEFT_SHIFT);
break;
-
+
case 982 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.RIGHT_SHIFT);
+ consumeBinaryExpression(OperatorIds.RIGHT_SHIFT);
break;
-
+
case 983 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name RIGHT_SHIFT..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.RIGHT_SHIFT);
+ consumeBinaryExpressionWithName(OperatorIds.RIGHT_SHIFT);
break;
-
+
case 984 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT);
+ consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT);
break;
-
+
case 985 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name UNSIGNED_RIGHT_SHIFT..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.UNSIGNED_RIGHT_SHIFT);
+ consumeBinaryExpressionWithName(OperatorIds.UNSIGNED_RIGHT_SHIFT);
break;
-
+
case 987 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= ShiftExpression_NotName"); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.LESS);
+ consumeBinaryExpression(OperatorIds.LESS);
break;
-
+
case 988 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name LESS..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.LESS);
+ consumeBinaryExpressionWithName(OperatorIds.LESS);
break;
-
+
case 989 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= ShiftExpression_NotName"); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.GREATER);
+ consumeBinaryExpression(OperatorIds.GREATER);
break;
-
+
case 990 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name GREATER..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.GREATER);
+ consumeBinaryExpressionWithName(OperatorIds.GREATER);
break;
-
+
case 991 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.LESS_EQUAL);
+ consumeBinaryExpression(OperatorIds.LESS_EQUAL);
break;
-
+
case 992 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name LESS_EQUAL..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.LESS_EQUAL);
+ consumeBinaryExpressionWithName(OperatorIds.LESS_EQUAL);
break;
-
+
case 993 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.GREATER_EQUAL);
+ consumeBinaryExpression(OperatorIds.GREATER_EQUAL);
break;
-
+
case 994 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name GREATER_EQUAL..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.GREATER_EQUAL);
+ consumeBinaryExpressionWithName(OperatorIds.GREATER_EQUAL);
break;
-
+
case 996 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::= Name instanceof..."); } //$NON-NLS-1$
- consumeInstanceOfExpressionWithName();
+ consumeInstanceOfExpressionWithName();
break;
-
+
case 997 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeInstanceOfExpression();
+ consumeInstanceOfExpression();
break;
-
+
case 999 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeEqualityExpression(OperatorIds.EQUAL_EQUAL);
+ consumeEqualityExpression(OperatorIds.EQUAL_EQUAL);
break;
-
+
case 1000 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::= Name EQUAL_EQUAL..."); } //$NON-NLS-1$
- consumeEqualityExpressionWithName(OperatorIds.EQUAL_EQUAL);
+ consumeEqualityExpressionWithName(OperatorIds.EQUAL_EQUAL);
break;
-
+
case 1001 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeEqualityExpression(OperatorIds.NOT_EQUAL);
+ consumeEqualityExpression(OperatorIds.NOT_EQUAL);
break;
-
+
case 1002 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::= Name NOT_EQUAL..."); } //$NON-NLS-1$
- consumeEqualityExpressionWithName(OperatorIds.NOT_EQUAL);
+ consumeEqualityExpressionWithName(OperatorIds.NOT_EQUAL);
break;
-
+
case 1004 : if (DEBUG) { System.out.println("AndExpression_NotName ::= AndExpression_NotName AND..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.AND);
+ consumeBinaryExpression(OperatorIds.AND);
break;
-
+
case 1005 : if (DEBUG) { System.out.println("AndExpression_NotName ::= Name AND EqualityExpression"); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.AND);
+ consumeBinaryExpressionWithName(OperatorIds.AND);
break;
-
+
case 1007 : if (DEBUG) { System.out.println("ExclusiveOrExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.XOR);
+ consumeBinaryExpression(OperatorIds.XOR);
break;
-
+
case 1008 : if (DEBUG) { System.out.println("ExclusiveOrExpression_NotName ::= Name XOR..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.XOR);
+ consumeBinaryExpressionWithName(OperatorIds.XOR);
break;
-
+
case 1010 : if (DEBUG) { System.out.println("InclusiveOrExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.OR);
+ consumeBinaryExpression(OperatorIds.OR);
break;
-
+
case 1011 : if (DEBUG) { System.out.println("InclusiveOrExpression_NotName ::= Name OR..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.OR);
+ consumeBinaryExpressionWithName(OperatorIds.OR);
break;
-
+
case 1013 : if (DEBUG) { System.out.println("ConditionalAndExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.AND_AND);
+ consumeBinaryExpression(OperatorIds.AND_AND);
break;
-
+
case 1014 : if (DEBUG) { System.out.println("ConditionalAndExpression_NotName ::= Name AND_AND..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.AND_AND);
+ consumeBinaryExpressionWithName(OperatorIds.AND_AND);
break;
-
+
case 1016 : if (DEBUG) { System.out.println("ConditionalOrExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.OR_OR);
+ consumeBinaryExpression(OperatorIds.OR_OR);
break;
-
+
case 1017 : if (DEBUG) { System.out.println("ConditionalOrExpression_NotName ::= Name OR_OR..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.OR_OR);
+ consumeBinaryExpressionWithName(OperatorIds.OR_OR);
break;
-
+
case 1019 : if (DEBUG) { System.out.println("ConditionalExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ;
+ consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ;
break;
-
+
case 1020 : if (DEBUG) { System.out.println("ConditionalExpression_NotName ::= Name QUESTION..."); } //$NON-NLS-1$
- consumeConditionalExpressionWithName(OperatorIds.QUESTIONCOLON) ;
+ consumeConditionalExpressionWithName(OperatorIds.QUESTIONCOLON) ;
break;
-
+
case 1024 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= Modifiers AT..."); } //$NON-NLS-1$
- consumeAnnotationTypeDeclarationHeaderName() ;
+ consumeAnnotationTypeDeclarationHeaderName() ;
break;
-
+
case 1025 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= Modifiers AT..."); } //$NON-NLS-1$
- consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ;
+ consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ;
break;
-
+
case 1026 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); } //$NON-NLS-1$
- consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ;
+ consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ;
break;
-
+
case 1027 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); } //$NON-NLS-1$
- consumeAnnotationTypeDeclarationHeaderName() ;
+ consumeAnnotationTypeDeclarationHeaderName() ;
break;
-
+
case 1028 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeader ::=..."); } //$NON-NLS-1$
- consumeAnnotationTypeDeclarationHeader() ;
+ consumeAnnotationTypeDeclarationHeader() ;
break;
-
+
case 1029 : if (DEBUG) { System.out.println("AnnotationTypeDeclaration ::=..."); } //$NON-NLS-1$
- consumeAnnotationTypeDeclaration() ;
+ consumeAnnotationTypeDeclaration() ;
break;
-
+
case 1031 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::="); } //$NON-NLS-1$
- consumeEmptyAnnotationTypeMemberDeclarationsopt() ;
+ consumeEmptyAnnotationTypeMemberDeclarationsopt() ;
break;
-
+
case 1032 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$
- consumeAnnotationTypeMemberDeclarationsopt() ;
+ consumeAnnotationTypeMemberDeclarationsopt() ;
break;
-
+
case 1034 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarations ::=..."); } //$NON-NLS-1$
- consumeAnnotationTypeMemberDeclarations() ;
+ consumeAnnotationTypeMemberDeclarations() ;
break;
-
+
case 1035 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt..."); } //$NON-NLS-1$
- consumeMethodHeaderNameWithTypeParameters(true);
+ consumeMethodHeaderNameWithTypeParameters(true);
break;
-
+
case 1036 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt Type..."); } //$NON-NLS-1$
- consumeMethodHeaderName(true);
+ consumeMethodHeaderName(true);
break;
-
+
case 1037 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::="); } //$NON-NLS-1$
- consumeEmptyMethodHeaderDefaultValue() ;
+ consumeEmptyMethodHeaderDefaultValue() ;
break;
-
+
case 1038 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::= DefaultValue"); } //$NON-NLS-1$
- consumeMethodHeaderDefaultValue();
+ consumeMethodHeaderDefaultValue();
break;
-
+
case 1039 : if (DEBUG) { System.out.println("AnnotationMethodHeader ::= AnnotationMethodHeaderName"); } //$NON-NLS-1$
- consumeMethodHeader();
+ consumeMethodHeader();
break;
-
+
case 1040 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclaration ::=..."); } //$NON-NLS-1$
- consumeAnnotationTypeMemberDeclaration() ;
+ consumeAnnotationTypeMemberDeclaration() ;
break;
-
+
case 1048 : if (DEBUG) { System.out.println("AnnotationName ::= AT UnannotatableName"); } //$NON-NLS-1$
- consumeAnnotationName() ;
+ consumeAnnotationName() ;
break;
-
+
case 1049 : if (DEBUG) { System.out.println("NormalAnnotation ::= AnnotationName LPAREN..."); } //$NON-NLS-1$
- consumeNormalAnnotation(false) ;
+ consumeNormalAnnotation(false) ;
break;
-
+
case 1050 : if (DEBUG) { System.out.println("MemberValuePairsopt ::="); } //$NON-NLS-1$
- consumeEmptyMemberValuePairsopt() ;
+ consumeEmptyMemberValuePairsopt() ;
break;
-
+
case 1053 : if (DEBUG) { System.out.println("MemberValuePairs ::= MemberValuePairs COMMA..."); } //$NON-NLS-1$
- consumeMemberValuePairs() ;
+ consumeMemberValuePairs() ;
break;
-
+
case 1054 : if (DEBUG) { System.out.println("MemberValuePair ::= SimpleName EQUAL EnterMemberValue"); } //$NON-NLS-1$
- consumeMemberValuePair() ;
+ consumeMemberValuePair() ;
break;
-
+
case 1055 : if (DEBUG) { System.out.println("EnterMemberValue ::="); } //$NON-NLS-1$
- consumeEnterMemberValue() ;
+ consumeEnterMemberValue() ;
break;
-
+
case 1056 : if (DEBUG) { System.out.println("ExitMemberValue ::="); } //$NON-NLS-1$
- consumeExitMemberValue() ;
+ consumeExitMemberValue() ;
break;
-
+
case 1058 : if (DEBUG) { System.out.println("MemberValue ::= Name"); } //$NON-NLS-1$
- consumeMemberValueAsName() ;
+ consumeMemberValueAsName() ;
break;
-
+
case 1061 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$
- consumeMemberValueArrayInitializer() ;
+ consumeMemberValueArrayInitializer() ;
break;
-
+
case 1062 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$
- consumeMemberValueArrayInitializer() ;
+ consumeMemberValueArrayInitializer() ;
break;
-
+
case 1063 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$
- consumeEmptyMemberValueArrayInitializer() ;
+ consumeEmptyMemberValueArrayInitializer() ;
break;
-
+
case 1064 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$
- consumeEmptyMemberValueArrayInitializer() ;
+ consumeEmptyMemberValueArrayInitializer() ;
break;
-
+
case 1065 : if (DEBUG) { System.out.println("EnterMemberValueArrayInitializer ::="); } //$NON-NLS-1$
- consumeEnterMemberValueArrayInitializer() ;
+ consumeEnterMemberValueArrayInitializer() ;
break;
-
+
case 1067 : if (DEBUG) { System.out.println("MemberValues ::= MemberValues COMMA MemberValue"); } //$NON-NLS-1$
- consumeMemberValues() ;
+ consumeMemberValues() ;
break;
-
+
case 1068 : if (DEBUG) { System.out.println("MarkerAnnotation ::= AnnotationName"); } //$NON-NLS-1$
- consumeMarkerAnnotation(false) ;
+ consumeMarkerAnnotation(false) ;
break;
-
+
case 1069 : if (DEBUG) { System.out.println("SingleMemberAnnotationMemberValue ::= MemberValue"); } //$NON-NLS-1$
- consumeSingleMemberAnnotationMemberValue() ;
+ consumeSingleMemberAnnotationMemberValue() ;
break;
-
+
case 1070 : if (DEBUG) { System.out.println("SingleMemberAnnotation ::= AnnotationName LPAREN..."); } //$NON-NLS-1$
- consumeSingleMemberAnnotation(false) ;
+ consumeSingleMemberAnnotation(false) ;
break;
-
+
case 1071 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt..."); } //$NON-NLS-1$
- consumeRecoveryMethodHeaderNameWithTypeParameters();
+ consumeRecoveryMethodHeaderNameWithTypeParameters();
break;
-
+
case 1072 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt Type..."); } //$NON-NLS-1$
- consumeRecoveryMethodHeaderName();
+ consumeRecoveryMethodHeaderName();
break;
-
+
case 1073 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= ModifiersWithDefault..."); } //$NON-NLS-1$
- consumeRecoveryMethodHeaderNameWithTypeParameters();
+ consumeRecoveryMethodHeaderNameWithTypeParameters();
break;
-
+
case 1074 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= ModifiersWithDefault Type"); } //$NON-NLS-1$
- consumeRecoveryMethodHeaderName();
+ consumeRecoveryMethodHeaderName();
break;
-
+
case 1075 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$
- consumeMethodHeader();
+ consumeMethodHeader();
break;
-
+
case 1076 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$
- consumeMethodHeader();
+ consumeMethodHeader();
break;
-
+
case 1079 : if (DEBUG) { System.out.println("RecoveryCallinHeader ::= RecoveryCallinBindingLeftLong"); } //$NON-NLS-1$
- consumeCallinHeader();
+ consumeCallinHeader();
break;
-
+
case 1080 : if (DEBUG) { System.out.println("RecoveryCallinHeader ::= Modifiersopt CallinLabel..."); } //$NON-NLS-1$
- consumeCallinHeader();
+ consumeCallinHeader();
break;
-
+
case 1081 : if (DEBUG) { System.out.println("RecoveryCallinBindingLeftLong ::=..."); } //$NON-NLS-1$
- consumeCallinBindingLeft(true);
+ consumeCallinBindingLeft(true);
break;
-
+
case 1082 : if (DEBUG) { System.out.println("RecoveryCallinHeader ::= Modifiersopt..."); } //$NON-NLS-1$
- consumeCallinHeader();
+ consumeCallinHeader();
break;
-
+
case 1083 : if (DEBUG) { System.out.println("RecoveryCallinHeader ::= Modifiersopt CallinLabel..."); } //$NON-NLS-1$
- consumeCallinHeader();
+ consumeCallinHeader();
break;
-
+
case 1084 : if (DEBUG) { System.out.println("RecoveryCalloutHeader ::=..."); } //$NON-NLS-1$
- consumeCalloutHeader();
+ consumeCalloutHeader();
break;
-
+
case 1085 : if (DEBUG) { System.out.println("RecoveryCalloutBindingLeftLong ::=..."); } //$NON-NLS-1$
- consumeCalloutBindingLeft(true);
+ consumeCalloutBindingLeft(true);
break;
-
+
case 1086 : if (DEBUG) { System.out.println("RecoveryCalloutHeader ::=..."); } //$NON-NLS-1$
- consumeCalloutHeader();
+ consumeCalloutHeader();
break;
-
+
case 1087 : if (DEBUG) { System.out.println("RecoveryCalloutHeader ::= Modifiersopt..."); } //$NON-NLS-1$
- consumeCalloutHeader();
+ consumeCalloutHeader();
break;
-
+
case 1088 : if (DEBUG) { System.out.println("RecoveryMethodSpecLong ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$
- consumeMethodSpecLong(false);
+ consumeMethodSpecLong(false);
break;
-
+
}
}
protected void consumeVariableDeclaratorIdParameter () {
@@ -11085,17 +11085,17 @@ public boolean isAssistParser() {
return false;
}
protected void consumeNestedLambda() {
- // NestedLambda ::= $empty - we get here just after the type+parenthesis elided singleton parameter or just before the '(' of the parameter list.
+ // NestedLambda ::= $empty - we get here just after the type+parenthesis elided singleton parameter or just before the '(' of the parameter list.
consumeNestedType();
this.nestedMethod[this.nestedType] ++;
LambdaExpression lambda = new LambdaExpression(this.compilationUnit.compilationResult, isAssistParser());
pushOnAstStack(lambda);
- this.processingLambdaParameterList = true;
+ this.processingLambdaParameterList = true;
}
protected void consumeLambdaHeader() {
// LambdaHeader ::= LambdaParameters '->' Synthetic/fake production with a synthetic non-terminal. Body not seen yet.
-
+
//{ObjectTeams: two unused ints from consumeToken() (for TokenNameARROW, for use as TokenNameBINDOUT):
this.intPtr-=2;
int arrowPosition = this.intStack[this.intPtr--] - 1; // saved during consumeToken()
@@ -11103,7 +11103,7 @@ protected void consumeLambdaHeader() {
int arrowPosition = this.scanner.currentPosition - 1;
*/
// SH}
-
+
Argument [] arguments = null;
int length = this.astLengthStack[this.astLengthPtr--];
this.astPtr -= length;
@@ -11163,11 +11163,11 @@ private void setArgumentsTypeVar(LambdaExpression lexp) {
}
}
protected void consumeLambdaExpression() {
-
+
// LambdaExpression ::= LambdaHeader LambdaBody
this.nestedType--;
-
+
this.astLengthPtr--; // pop length for LambdaBody (always 1)
Statement body = (Statement) this.astStack[this.astPtr--];
if (body instanceof Block) {
@@ -11183,7 +11183,7 @@ protected void consumeLambdaExpression() {
this.astLengthPtr--;
lexp.setBody(body);
lexp.sourceEnd = body.sourceEnd;
-
+
if (body instanceof Expression && ((Expression) body).isTrulyExpression()) {
Expression expression = (Expression) body;
expression.statementEnd = body.sourceEnd;
@@ -11202,7 +11202,7 @@ protected void consumeLambdaExpression() {
if (lexp.compilationResult.getCompilationUnit() == null) {
// unit built out of model. Stash a textual representation of lambda to enable LE.copy().
int length = lexp.sourceEnd - lexp.sourceStart + 1;
- System.arraycopy(this.scanner.getSource(), lexp.sourceStart, lexp.text = new char [length], 0, length);
+ System.arraycopy(this.scanner.getSource(), lexp.sourceStart, lexp.text = new char [length], 0, length);
}
}
@@ -11219,18 +11219,18 @@ protected Argument typeElidedArgument() {
ClassFileConstants.AccDefault,
true);
arg.declarationSourceStart = (int) (namePositions >>> 32);
- return arg;
+ return arg;
}
protected void consumeTypeElidedLambdaParameter(boolean parenthesized) {
// LambdaParameters ::= Identifier
// TypeElidedFormalParameter ::= Modifiersopt Identifier
-
+
int modifier = ClassFileConstants.AccDefault;
int annotationLength = 0;
int modifiersStart = 0;
- if (parenthesized) { // The grammar is permissive enough to allow optional modifiers for the parenthesized version, they should be rejected if present.
+ if (parenthesized) { // The grammar is permissive enough to allow optional modifiers for the parenthesized version, they should be rejected if present.
modifiersStart = this.intStack[this.intPtr--];
modifier = this.intStack[this.intPtr--];
// pop annotations
@@ -11242,7 +11242,7 @@ protected void consumeTypeElidedLambdaParameter(boolean parenthesized) {
if (modifier != ClassFileConstants.AccDefault || annotationLength != 0) {
problemReporter().illegalModifiersForElidedType(arg);
arg.declarationSourceStart = modifiersStart;
- }
+ }
if (!parenthesized) { // in the absence of '(' and ')', record positions.
pushOnIntStack(arg.declarationSourceStart);
pushOnIntStack(arg.declarationSourceEnd);
@@ -11262,13 +11262,13 @@ protected void consumeElidedLeftBraceAndReturn() {
this.stateStackLengthStack = new int[stackLength + 4], 0,
stackLength);
}
- this.stateStackLengthStack[this.valueLambdaNestDepth] = this.stateStackTop;
+ this.stateStackLengthStack[this.valueLambdaNestDepth] = this.stateStackTop;
}
protected void consumeExpression() {
/* Expression ::= AssignmentExpression
Alert ! Sleight of hand - Part II: See if we are at the state with the item: "ElidedLeftBraceAndReturn Expression .ElidedSemicolonAndRightBrace"
If so, push back the current token into the lexer stream, materialize the synthetic terminal marker symbol, switch and continue.
- */
+ */
if (this.valueLambdaNestDepth >= 0 && this.stateStackLengthStack[this.valueLambdaNestDepth] == this.stateStackTop - 1) {
this.valueLambdaNestDepth--;
this.scanner.ungetToken(this.currentToken);
@@ -11296,7 +11296,7 @@ public ReferenceExpression newReferenceExpression() {
}
protected void consumeReferenceExpressionTypeForm(boolean isPrimitive) { // actually Name or Type form.
-
+
// ReferenceExpression ::= PrimitiveType Dims '::' NonWildTypeArgumentsopt IdentifierOrNew
// ReferenceExpression ::= Name Dimsopt '::' NonWildTypeArgumentsopt IdentifierOrNew
@@ -11309,14 +11309,14 @@ protected void consumeReferenceExpressionTypeForm(boolean isPrimitive) { // actu
referenceExpression.nameSourceStart = (int) (this.identifierPositionStack[this.identifierPtr] >>> 32);
selector = this.identifierStack[this.identifierPtr--];
this.identifierLengthPtr--;
-
+
int length = this.genericsLengthStack[this.genericsLengthPtr--];
if (length > 0) {
this.genericsPtr -= length;
System.arraycopy(this.genericsStack, this.genericsPtr + 1, typeArguments = new TypeReference[length], 0, length);
this.intPtr--; // pop type arguments source start.
}
-
+
int dimension = this.intStack[this.intPtr--];
boolean typeAnnotatedName = false;
for (int i = this.identifierLengthStack[this.identifierLengthPtr], j = 0; i > 0 && this.typeAnnotationLengthPtr >= 0; --i, j++) {
@@ -11326,7 +11326,7 @@ protected void consumeReferenceExpressionTypeForm(boolean isPrimitive) { // actu
break;
}
}
-
+
if (dimension > 0 || typeAnnotatedName) {
if (!isPrimitive) {
pushOnGenericsLengthStack(0);
@@ -11360,7 +11360,7 @@ protected void consumeReferenceExpressionPrimaryForm() {
System.arraycopy(this.genericsStack, this.genericsPtr + 1, typeArguments = new TypeReference[length], 0, length);
this.intPtr--; // pop type arguments source start.
}
-
+
Expression primary = this.expressionStack[this.expressionPtr--];
this.expressionLengthPtr--;
referenceExpression.initialize(this.compilationUnit.compilationResult, primary, typeArguments, selector, sourceEnd);
@@ -11385,7 +11385,7 @@ protected void consumeReferenceExpressionSuperForm() {
System.arraycopy(this.genericsStack, this.genericsPtr + 1, typeArguments = new TypeReference[length], 0, length);
this.intPtr--; // pop type arguments source start.
}
-
+
SuperReference superReference = new SuperReference(this.intStack[this.intPtr--], this.endPosition);
referenceExpression.initialize(this.compilationUnit.compilationResult, superReference, typeArguments, selector, sourceEnd);
consumeReferenceExpression(referenceExpression);
@@ -11398,7 +11398,7 @@ protected void consumeReferenceExpression(ReferenceExpression referenceExpressio
if (referenceExpression.compilationResult.getCompilationUnit() == null) {
// unit built out of model. Stash a textual representation to enable RE.copy().
int length = referenceExpression.sourceEnd - referenceExpression.sourceStart + 1;
- System.arraycopy(this.scanner.getSource(), referenceExpression.sourceStart, referenceExpression.text = new char [length], 0, length);
+ System.arraycopy(this.scanner.getSource(), referenceExpression.sourceStart, referenceExpression.text = new char [length], 0, length);
}
this.referenceContext.compilationResult().hasFunctionalTypes = true;
markEnclosingMemberWithLocalOrFunctionalType(LocalTypeKind.METHOD_REFERENCE);
@@ -11412,7 +11412,7 @@ protected void consumeReferenceExpressionTypeArgumentsAndTrunk(boolean qualified
protected void consumeReferenceExpressionGenericTypeForm() {
// ReferenceExpression ::= Name BeginTypeArguments ReferenceExpressionTypeArgumentsAndTrunk '::' NonWildTypeArgumentsopt IdentifierOrNew
-
+
ReferenceExpression referenceExpression = newReferenceExpression();
TypeReference type;
TypeReference [] typeArguments = null;
@@ -11430,7 +11430,7 @@ protected void consumeReferenceExpressionGenericTypeForm() {
System.arraycopy(this.genericsStack, this.genericsPtr + 1, typeArguments = new TypeReference[length], 0, length);
this.intPtr--; // pop type arguments source start.
}
-
+
int typeSourceEnd = this.intStack[this.intPtr--];
boolean qualified = this.intStack[this.intPtr--] != 0;
int dims = this.intStack[this.intPtr--];
@@ -11438,13 +11438,13 @@ protected void consumeReferenceExpressionGenericTypeForm() {
Annotation [][] annotationsOnDimensions = dims == 0 ? null : getAnnotationsOnDimensions(dims);
TypeReference rightSide = getTypeReference(0);
type = computeQualifiedGenericsFromRightSide(rightSide, dims, annotationsOnDimensions);
- } else {
+ } else {
pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]);
type = getTypeReference(dims);
}
this.intPtr--; // pop '<' position
type.sourceEnd = typeSourceEnd;
-
+
referenceExpression.initialize(this.compilationUnit.compilationResult, type, typeArguments, selector, sourceEnd);
consumeReferenceExpression(referenceExpression);
@@ -11469,7 +11469,7 @@ protected void consumeSingleMemberAnnotation(boolean isTypeAnnotation) {
singleMemberAnnotation.memberValue = this.expressionStack[this.expressionPtr--];
this.expressionLengthPtr--;
singleMemberAnnotation.declarationSourceEnd = this.rParenPos;
-
+
if (isTypeAnnotation) {
pushOnTypeAnnotationStack(singleMemberAnnotation);
} else {
@@ -11925,7 +11925,7 @@ protected void consumeStatementTry(boolean withFinally, boolean hasResources) {
// TryStatement ::= 'try' Block Catchesopt Finally
// TryStatementWithResources ::= 'try' ResourceSpecification TryBlock Catchesopt
// TryStatementWithResources ::= 'try' ResourceSpecification TryBlock Catchesopt Finally
-
+
int length;
TryStatement tryStmt = new TryStatement();
//finally
@@ -11963,7 +11963,7 @@ protected void consumeStatementTry(boolean withFinally, boolean hasResources) {
length);
tryStmt.resources = stmts;
-
+
if (this.options.sourceLevel < ClassFileConstants.JDK1_7) {
problemReporter().autoManagedResourcesNotBelow17(stmts);
}
@@ -12099,9 +12099,9 @@ protected void consumeTextBlock() {
this.checkExternalizeStrings &&
this.lastPosistion < this.scanner.currentPosition &&
!this.statementRecoveryActivated) {
- textBlock =
+ textBlock =
new TextBlock(
- textBlock2,
+ textBlock2,
this.scanner.startPosition,
this.scanner.currentPosition - 1,
Util.getLineNumber(this.scanner.startPosition, this.scanner.lineEnds, 0, this.scanner.linePtr));
@@ -12120,7 +12120,7 @@ protected void consumeTextBlock() {
protected void consumeSwitchBlock() {
// SwitchBlock ::= '{' SwitchBlockStatements SwitchLabels '}'
concatNodeLists();
-
+
}
protected void consumeSwitchBlockStatement() {
// SwitchBlockStatement ::= SwitchLabels BlockStatements
@@ -12274,13 +12274,13 @@ protected void consumeSwitchLabeledExpression() {
yieldStatement.isImplicit = true;
this.astStack[this.astPtr] = yieldStatement;
concatNodeLists();
-}
+}
protected void consumeSwitchLabeledBlock() {
concatNodeLists();
-}
+}
protected void consumeSwitchLabeledThrowStatement() {
// TODO: Semicolon not there - so we call this early
- consumeStatementThrow();
+ consumeStatementThrow();
concatNodeLists();
}
protected void consumeThrowExpression() {
@@ -12774,7 +12774,7 @@ protected void consumeTypeAnchor(boolean haveBase) {
// where '@OT' is the synthetic token returned by the parser when a '@' is in a position suitable for a type anchor
// see also skipThisAnchor() and consumeQualifiedBaseTypeAnchor() for related productions
-
+
// could be either TypeAnchor or TypeAnnotation
// create TypeAnchor for now, two avoid awaiting the decision between Annotation w or w/o member values
NameReference anchor = haveBase ?
@@ -12865,7 +12865,7 @@ protected void confirmTypeAnchor() {
// TypeAnchorOrAnnotatedTypeArgument1 -> AnyTypeAnchor '>'
// TypeAnchorOrAnnotatedTypeArgument2 -> AnyTypeAnchor '>>'
// TypeAnchorOrAnnotatedTypeArgument3 -> AnyTypeAnchor '>>>'
-
+
// tentative type anchor is indeed a type anchor (not converted to type annotation).
// need to remove the empty type annotation list now (see consumeTypeAnchor()).
this.typeAnnotationLengthPtr--;
@@ -12875,7 +12875,7 @@ protected boolean confirmTypeAnnotation() {
// /.$putCase consumeZeroTypeAnnotations(); $break ./
// - internally calls confirmTypeAnnotation()
// TypeAnnotationsopt -> TypeAnnotations
-
+
int sentinelPos = -1;
if (this.typeAnnotationLengthPtr != -1) {
int len = this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr];
@@ -12943,7 +12943,7 @@ protected void consumeQualifiedBaseTypeAnchor() {
pushOnGenericsLengthStack(0); // handle type arguments
pushOnTypeAnnotationLengthStack(0); // unannotated by construction, but haven't yet pushed zero type annotatations
TypeReference prefix = getTypeReference(0); // consumes the above zero type annotations
-
+
Reference anchor = new QualifiedBaseReference(prefix, this.intStack[this.intPtr--], this.intStack[this.intPtr--]);
pushOnGenericsStack(new TypeAnchorReference(anchor, this.intStack[this.intPtr--]));
// anchor has not type annotations, yet it will be consumed in a context where type annotations are possible
@@ -13484,7 +13484,7 @@ protected void consumeRecordDeclaration() {
rd.declarationSourceEnd = flushCommentsDefinedPriorTo(this.endStatementPosition);
}
protected void consumeRecordHeaderPart() {
- // RecordHeaderPart ::= RecordHeaderName RecordHeader ClassHeaderImplementsopt
+ // RecordHeaderPart ::= RecordHeaderName RecordHeader ClassHeaderImplementsopt
TypeDeclaration typeDecl = (TypeDeclaration) this.astStack[this.astPtr];
assert typeDecl instanceof RecordDeclaration;
// do nothing
@@ -13570,11 +13570,11 @@ private void convertToFields(RecordDeclaration rd, Argument[] args) {
* declare the fields of the record class. Each record component in the RecordHeader
* declares one private final field in the record class whose name is same as the
* Identifier in the record component.
- *
+ *
* JLS 14 Sec 8.10.3 Record Components
* For each record component appearing in the record component list:
* An implicitly declared private final field with the same name as the record
- * component and the type as the declared type of the record component.
+ * component and the type as the declared type of the record component.
*/
f.modifiers |= ClassFileConstants.AccPrivate | ClassFileConstants.AccFinal;
f.modifiersSourceStart = arg.modifiersSourceStart;
@@ -13586,7 +13586,7 @@ private void convertToFields(RecordDeclaration rd, Argument[] args) {
* "This field is annotated with the annotation that appears on the corresponding
* record component, if this annotation type is applicable to a field declaration
* or type context."
- *
+ *
* However, at this point there is no sufficient information to conclude the ElementType
* targeted by the annotation. Hence, do a blanket assignment for now and later (read binding
* time) weed out the irrelevant ones.
@@ -13643,14 +13643,14 @@ protected void consumeRecordComponent(boolean isVarArgs) {
varArgsAnnotations = new Annotation[length],
0,
length);
- }
+ }
}
firstDimensions = this.intStack[this.intPtr--];
TypeReference type = getTypeReference(firstDimensions);
if (isVarArgs || extendedDimensions != 0) {
if (isVarArgs) {
- type = augmentTypeWithAdditionalDimensions(type, 1, varArgsAnnotations != null ? new Annotation[][] { varArgsAnnotations } : null, true);
- }
+ type = augmentTypeWithAdditionalDimensions(type, 1, varArgsAnnotations != null ? new Annotation[][] { varArgsAnnotations } : null, true);
+ }
if (extendedDimensions != 0) {
type = augmentTypeWithAdditionalDimensions(type, extendedDimensions, annotationsOnExtendedDimensions, false);
}
@@ -13921,7 +13921,7 @@ private void checkForRecordMemberErrors(RecordDeclaration recordDecl, int nCreat
if (f != null && !f.isStatic()) {
if (f instanceof Initializer)
problemReporter().recordInstanceInitializerBlockInRecord((Initializer) f);
- else
+ else
problemReporter().recordNonStaticFieldDeclarationInRecord(f);
}
}
@@ -14620,7 +14620,7 @@ protected void annotateTypeReference(Wildcard ref) {
}
protected TypeReference getTypeReference(int dim) {
//{ObjectTeams: wrap to introduce 2nd parameter
- return getTypeReference(dim, false);
+ return getTypeReference(dim, false);
}
protected TypeReference getTypeReference(int dim, boolean liftingTypeAllowed) {
if (this.astPtr > -1 && this.astStack[this.astPtr] instanceof LiftingTypeReference) {
@@ -14758,7 +14758,7 @@ protected TypeReference getTypeReferenceForGenericType(int dim, int identifierLe
}
/* We used to eagerly mark the PSTR as constituting diamond usage if we encountered <>, but that is too eager and
complicates error handling by making it hard to distinguish legitimate use cases from ill formed ones. We are
- more discriminating now and tag a type as being diamond only where <> can legally occur.
+ more discriminating now and tag a type as being diamond only where <> can legally occur.
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=339478#c11
*/
return parameterizedSingleTypeReference;
@@ -14800,7 +14800,7 @@ protected TypeReference getTypeReferenceForGenericType(int dim, int identifierLe
}
/* We used to eagerly mark the PQTR as constituting diamond usage if we encountered <>, but that is too eager and
complicates error handling by making it hard to distinguish legitimate use cases from ill formed ones. We are
- more discriminating now and tag a type as being diamond only where <> can legally occur.
+ more discriminating now and tag a type as being diamond only where <> can legally occur.
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=339478#c11
*/
return parameterizedQualifiedTypeReference;
@@ -15086,7 +15086,7 @@ public void initialize(boolean parsingCompilationUnit) {
this.referenceContext = null;
this.endStatementPosition = 0;
this.valueLambdaNestDepth = -1;
-
+
//remove objects from stack too, while the same parser/compiler couple is
//re-used between two compilations ....
@@ -15439,20 +15439,20 @@ protected void optimizedConcatNodeLists() {
}
@Override
public boolean atConflictScenario(int token) {
-
+
/* Answer true if the parser is at a configuration where the scanner must look ahead and help disambiguate between (a) '<' as an operator and '<' as the
start of <type argument> and (b) the use of '(' in '(' expression ')' and '( type ')' and '(' lambda formal parameters ')'. (c) whether the token @
- begins a Java SE5 style declaration annotation or if it begins a SE8 style type annotation. When requested thus, the scanner helps by fabricating
- synthetic tokens and injecting them into the stream ahead of the tokens that trigger conflicts in the absence of these artificial tokens. These
+ begins a Java SE5 style declaration annotation or if it begins a SE8 style type annotation. When requested thus, the scanner helps by fabricating
+ synthetic tokens and injecting them into the stream ahead of the tokens that trigger conflicts in the absence of these artificial tokens. These
manufactured token help transform the grammar into LALR(1) by splitting the states so that they have unambigious prefixes.
-
- We do this by claiming to the automaton that the next token seen is the (suitable) synthetic token and observing the response of the state machine.
+
+ We do this by claiming to the automaton that the next token seen is the (suitable) synthetic token and observing the response of the state machine.
Error signals we are NOT at a conflict site, while shift or shift/reduce signals that we are. Accept is impossible, while there may be intermediate
reductions that are called for -- It is axiomatic of the push down automaton that corresponds to the LALR grammar that it will never shift on invalid
input.
-
+
Obviously, the dry runs should not alter the parser state in any way or otherwise cause side effects. Proof by argument that this is the case:
-
+
- The only pieces of state needed to answer the question are: this.stack, this.stateStackTop and the last action variable `act`. None of the various
and sundry stacks used in the AST constructions process are touched here.
- As we reduce, we DON'T call the semantic action functions i.e the consume* method calls are skipped.
@@ -15460,10 +15460,10 @@ public boolean atConflictScenario(int token) {
- this.stateStackTop and the last action variable `act` of the automaton are readily cloned, these being primitives and changes are to the replicas.
- We never remove elements from the state stack here (or elsewhere for that matter). Pops are implemented by mere adjustments of the stack pointer.
- During this algorithm, either the stack pointer monotonically decreases or stays fixed. (The only way for the stack pointer to increase would call
- for a shift or a shift/reduce at which point the algorithm is ready to terminate already.) This means that we don't have to replicate the stack.
+ for a shift or a shift/reduce at which point the algorithm is ready to terminate already.) This means that we don't have to replicate the stack.
Pushes can be mimiced by writing to a local stackTopState variable, leaving the original stack untouched.
-
- Though this code looks complex, we should exit early in most situations.
+
+ Though this code looks complex, we should exit early in most situations.
*/
if (this.unstackedAct == ERROR_ACTION) { // automaton is not running.
return false;
@@ -15476,7 +15476,7 @@ public boolean atConflictScenario(int token) {
// SH}
token = token == TokenNameLPAREN ? TokenNameBeginLambda : TokenNameBeginTypeArguments;
}
-
+
return automatonWillShift(token, this.unstackedAct);
}
/*main loop of the automat
@@ -15505,7 +15505,7 @@ protected void parse() {
this.unstackedAct = ERROR_ACTION;
this.stateStackTop = -1;
this.currentToken = getFirstToken();
-
+
try {
this.scanner.setActiveParser(this);
ProcessTerminals : for (;;) {
@@ -15547,7 +15547,7 @@ try {
act = this.stack[this.stateStackTop--];
continue ProcessTerminals;
} else {
- // FALL THROUGH.
+ // FALL THROUGH.
}
}
}
@@ -15576,7 +15576,7 @@ try {
this.lastCheckPoint = this.scanner.currentPosition;
this.currentToken = 0;
this.restartRecovery = true;
- }
+ }
if(this.statementRecoveryActivated) {
jumpOverType();
}
@@ -15662,12 +15662,12 @@ try {
}
this.scanner.checkNonExternalizedStringLiterals = false;
-
+
if (this.scanner.checkUninternedIdentityComparison) {
this.compilationUnit.validIdentityComparisonLines = this.scanner.getIdentityComparisonLines();
this.scanner.checkUninternedIdentityComparison = false;
}
-
+
if (this.reportSyntaxErrorIsRequired && this.hasError && !this.statementRecoveryActivated) {
if(!this.options.performStatementsRecovery) {
reportSyntaxErrors(isDietParse, oldFirstToken);
@@ -16646,8 +16646,8 @@ protected void pushOnAstStack(ASTNode node) {
protected void pushOnTypeAnnotationStack(Annotation annotation) {
//{ObjectTeams: detect the situation of having pushed the sentinel plus exactly one type annotation:
- boolean atSentinel = this.typeAnnotationPtr > 0
- && this.typeAnnotationPtr <= this.typeAnnotationStack.length
+ boolean atSentinel = this.typeAnnotationPtr > 0
+ && this.typeAnnotationPtr <= this.typeAnnotationStack.length
&& this.typeAnnotationStack[this.typeAnnotationPtr-1] == annotationSentinel
&& this.typeAnnotationLengthPtr > -1
&& this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr] == 1;
@@ -16977,7 +16977,7 @@ public void recoveryExitFromVariable() {
} else if(this.currentElement instanceof RecoveredField
&& !(this.currentElement instanceof RecoveredInitializer)) {
// Do not move focus to parent if we are still inside an array initializer
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=292087
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=292087
if (this.currentElement.bracketBalance <= 0) {
int end = ((RecoveredField)this.currentElement).fieldDeclaration.sourceEnd;
this.currentElement.updateSourceEndIfNecessary(end);
@@ -17249,11 +17249,11 @@ protected void resetStacks() {
this.identifierPtr = -1;
this.identifierLengthPtr = -1;
this.intPtr = -1;
-
+
this.nestedMethod[this.nestedType = 0] = 0; // need to reset for further reuse
this.variablesCounter[this.nestedType] = 0;
this.switchNestingLevel = 0;
-
+
this.dimensions = 0 ;
this.realBlockStack[this.realBlockPtr = 0] = 0;
this.recoveredStaticInitializerStart = 0;
@@ -17465,11 +17465,11 @@ protected void updateSourcePosition(Expression exp) {
exp.sourceStart = this.intStack[this.intPtr--];
}
public void copyState(Parser from) {
-
+
Parser parser = from;
// Stack pointers.
-
+
this.stateStackTop = parser.stateStackTop;
this.unstackedAct = parser.unstackedAct;
this.identifierPtr = parser.identifierPtr;
@@ -17490,9 +17490,9 @@ public void copyState(Parser from) {
this.switchNestingLevel = parser.switchNestingLevel;
this.realBlockPtr = parser.realBlockPtr;
this.valueLambdaNestDepth = parser.valueLambdaNestDepth;
-
+
// Stacks.
-
+
int length;
System.arraycopy(parser.stack, 0, this.stack = new int [length = parser.stack.length], 0, length);
System.arraycopy(parser.identifierStack, 0, this.identifierStack = new char [length = parser.identifierStack.length][], 0, length);
@@ -17517,7 +17517,7 @@ public void copyState(Parser from) {
System.arraycopy(parser.stack, 0, this.stack = new int [length = parser.stack.length], 0, length);
// Loose variables.
-
+
this.listLength = parser.listLength;
this.listTypeParameterLength = parser.listTypeParameterLength;
this.dimensions = parser.dimensions;
@@ -17540,8 +17540,8 @@ public boolean automatonWillShift(int token, int lastAction) {
stackTop --;
lastAction += ERROR_ACTION;
}
- for (;;) {
- if (lastAction > ERROR_ACTION) {
+ for (;;) {
+ if (lastAction > ERROR_ACTION) {
lastAction -= ERROR_ACTION; /* reduce or shift-reduce on loop entry from above, reduce on loop back */
do { /* reduce */
stackTop -= rhs[lastAction] - 1;
@@ -17559,11 +17559,11 @@ public boolean automatonWillShift(int token, int lastAction) {
stackTopState = lastAction; // "push"
lastAction = tAction(lastAction, token); // can be looked up from a precomputed cache.
if (lastAction <= NUM_RULES) {
- stackTop --;
+ stackTop --;
lastAction += ERROR_ACTION;
continue;
}
- // Error => false, Shift, Shift/Reduce => true, Accept => impossible.
+ // Error => false, Shift, Shift/Reduce => true, Accept => impossible.
return lastAction != ERROR_ACTION;
}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredBlock.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredBlock.java
index 8a93709d2..6998df001 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredBlock.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredBlock.java
@@ -160,7 +160,7 @@ public RecoveredElement add(Statement stmt, int bracketBalanceValue) {
* Record a statement declaration
*/
public RecoveredElement add(Statement stmt, int bracketBalanceValue, boolean delegatedByParent) {
-
+
resetPendingModifiers();
/* do not consider a nested block starting passed the block end (if set)
@@ -307,7 +307,7 @@ public Block updatedBlock(int depth, Set<TypeDeclaration> knownTypes){
// if block was not marked to be preserved or empty, then ignore it
if (!this.preserveContent || this.statementCount == 0) return null;
-
+
Statement[] updatedStatements = new Statement[this.statementCount];
int updatedCount = 0;
@@ -362,7 +362,7 @@ public Block updatedBlock(int depth, Set<TypeDeclaration> knownTypes){
}
}
updatedStatements[updatedCount++] = updatedStatement;
-
+
if (updatedStatement instanceof LocalDeclaration) {
LocalDeclaration localDeclaration = (LocalDeclaration) updatedStatement;
if(localDeclaration.declarationSourceEnd > lastEnd) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredElement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredElement.java
index 479654530..680f039de 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredElement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredElement.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
* Fraunhofer FIRST - extended API and implementation
@@ -37,11 +37,11 @@ public class RecoveredElement {
public int bracketBalance;
public boolean foundOpeningBrace;
protected Parser recoveringParser;
-
+
// There is no RecoveredLambdaElement, we just keep track of entry and exit of lambdas via a counter. This allows to prevent certain incorrect mutations of current element.
// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=430667.
public int lambdaNestLevel;
-
+
public RecoveredElement(RecoveredElement parent, int bracketBalance){
this(parent, bracketBalance, null);
}
@@ -142,7 +142,7 @@ public RecoveredElement add(Statement statement, int bracketBalanceValue) {
if (this.parent == null) return this; // ignore
if (this instanceof RecoveredType) {
TypeDeclaration typeDeclaration = ((RecoveredType) this).typeDeclaration;
- if (typeDeclaration != null && (typeDeclaration.bits & ASTNode.IsAnonymousType) != 0) {
+ if (typeDeclaration != null && (typeDeclaration.bits & ASTNode.IsAnonymousType) != 0) {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=291040, new X(<SelectOnMessageSend:zoo()>) { ???
if (statement.sourceStart > typeDeclaration.sourceStart && statement.sourceEnd < typeDeclaration.sourceEnd) {
return this;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredExport.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredExport.java
index dda131eb8..531e5a9e0 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredExport.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredExport.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.parser;
@@ -23,7 +23,7 @@ public class RecoveredExport extends RecoveredElement {
public ExportsStatement exportReference;
RecoveredModuleReference[] targets;
int targetCount = 0;
-
+
public RecoveredExport(ExportsStatement exportReference, RecoveredElement parent, int bracketBalance) {
super(parent, bracketBalance);
this.exportReference = exportReference;
@@ -49,7 +49,7 @@ public class RecoveredExport extends RecoveredElement {
/* if target not finished, then target becomes current */
if (target.sourceEnd == 0) return element;
return this;
-
+
}
/*
* Answer the associated parsed structure
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredField.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredField.java
index 629d983d4..e97da2d1a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredField.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredField.java
@@ -39,7 +39,7 @@ public class RecoveredField extends RecoveredElement {
public RecoveredAnnotation[] annotations;
public int annotationCount;
-
+
public int modifiers;
public int modifiersStart;
@@ -71,7 +71,7 @@ public RecoveredElement add(FieldDeclaration addedfieldDeclaration, int bracketB
/* default behavior is to delegate recording to parent if any */
resetPendingModifiers();
if (this.parent == null) return this; // ignore
-
+
if (this.fieldDeclaration.declarationSourceStart == addedfieldDeclaration.declarationSourceStart) {
if (this.fieldDeclaration.initialization != null) {
this.updateSourceEndIfNecessary(this.fieldDeclaration.initialization.sourceEnd);
@@ -96,7 +96,7 @@ public RecoveredElement add(Statement statement, int bracketBalanceValue) {
if (statement.sourceEnd > 0)
this.alreadyCompletedFieldInitialization = true;
// else we may still be inside the initialization, having parsed only a part of it yet
- if (!(statement instanceof AllocationExpression) &&
+ if (!(statement instanceof AllocationExpression) &&
this.fieldDeclaration.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT) {
AllocationExpression alloc = new AllocationExpression();
alloc.arguments = new Expression[] {(Expression) statement};
@@ -249,7 +249,7 @@ public FieldDeclaration updatedFieldDeclaration(int depth, Set<TypeDeclaration>
recoveredInitializers.expressions[recoveredInitializersCount++] = anonymousType.allocation;
}
else {
- this.fieldDeclaration.initialization = anonymousType.allocation;
+ this.fieldDeclaration.initialization = anonymousType.allocation;
}
int end = anonymousType.declarationSourceEnd;
if (end > this.fieldDeclaration.declarationSourceEnd) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=307337
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredInitializer.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredInitializer.java
index 0889678c2..d770857db 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredInitializer.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredInitializer.java
@@ -68,7 +68,7 @@ public RecoveredElement add(Block nestedBlockDeclaration, int bracketBalanceValu
}
if (this.initializerBody == null) {
return this.initializerBody = new RecoveredBlock(nestedBlockDeclaration, this, bracketBalanceValue);
- }
+ }
this.initializerBody.blockDeclaration.sourceEnd = 0; /* needed to allow adding more elements to the existing initializerBody */
if (nestedBlockDeclaration.sourceEnd == 0) return this.initializerBody;
return this.initializerBody.add(nestedBlockDeclaration, bracketBalanceValue, true);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredMethodMapping.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredMethodMapping.java
index d8f65aac1..395c73fc9 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredMethodMapping.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredMethodMapping.java
@@ -341,7 +341,7 @@ public RecoveredElement updateOnClosingBrace(int braceStart, int braceEnd) {
// recover missing base method spec:
MethodSpec baseSpec = null;
if ( this.methodMappingDeclaration.isCallin()
- || (((CalloutMappingDeclaration)this.methodMappingDeclaration).baseMethodSpec == null))
+ || (((CalloutMappingDeclaration)this.methodMappingDeclaration).baseMethodSpec == null))
{
if (this.methodMappingDeclaration.hasSignature) {
if (parser.identifierPtr > 0) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredModule.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredModule.java
index 785f0996c..d2f333b59 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredModule.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredModule.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.parser;
@@ -24,7 +24,7 @@ import org.eclipse.jdt.internal.compiler.ast.RequiresStatement;
import org.eclipse.jdt.internal.compiler.ast.UsesStatement;
public class RecoveredModule extends RecoveredElement {
-
+
public RecoveredExportsStatement[] exports;
public int exportCount;
public RecoveredOpensStatement[] opens;
@@ -43,7 +43,7 @@ public class RecoveredModule extends RecoveredElement {
}
@Override
public RecoveredElement add(ModuleStatement moduleStatement, int bracketBalanceValue) {
-
+
// TODO: can't we do away with all these additions except for ProvidesStatement - to check
// if there are any corner cases that uses these.
if (moduleStatement instanceof ExportsStatement) {
@@ -61,7 +61,7 @@ public class RecoveredModule extends RecoveredElement {
if (moduleStatement instanceof UsesStatement) {
return add((UsesStatement) moduleStatement, bracketBalanceValue);
}
-
+
return this;
}
@@ -279,7 +279,7 @@ public class RecoveredModule extends RecoveredElement {
providesStmts[actualCount++] = this.services[i].updatedProvidesStatement();
}
mod.services = providesStmts;
- mod.servicesCount = actualCount;
+ mod.servicesCount = actualCount;
}
}
@Override
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredModuleReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredModuleReference.java
index e15b27e52..2a357d6d7 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredModuleReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredModuleReference.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.parser;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredStatement.java
index c4257c41f..7849d2ced 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredStatement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredStatement.java
@@ -29,7 +29,7 @@ public class RecoveredStatement extends RecoveredElement {
public Statement statement;
RecoveredBlock nestedBlock;
-
+
public RecoveredStatement(Statement statement, RecoveredElement parent, int bracketBalance){
super(parent, bracketBalance);
this.statement = statement;
@@ -84,7 +84,7 @@ public RecoveredElement updateOnClosingBrace(int braceStart, int braceEnd){
public RecoveredElement add(Block nestedBlockDeclaration, int bracketBalanceValue) {
if (this.statement instanceof ForeachStatement) {
ForeachStatement foreach = (ForeachStatement) this.statement;
-
+
// see RecoveredBlock.add(Block, int):
resetPendingModifiers();
@@ -103,7 +103,7 @@ public RecoveredElement add(Block nestedBlockDeclaration, int bracketBalanceValu
addBlockStatement(element);
}
this.nestedBlock = element;
-
+
if (nestedBlockDeclaration.sourceEnd == 0) return element;
return this;
} else {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredType.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredType.java
index 228753e8d..c8015a0eb 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredType.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredType.java
@@ -47,7 +47,7 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.ast.AbstractMethodMap
@SuppressWarnings({"rawtypes", "unchecked"})
public class RecoveredType extends RecoveredStatement implements TerminalTokens {
public static final int MAX_TYPE_DEPTH = 256;
-
+
public TypeDeclaration typeDeclaration;
public RecoveredAnnotation[] annotations;
@@ -582,7 +582,7 @@ public TypeDeclaration updatedTypeDeclaration(int depth, Set<TypeDeclaration> kn
if(knownTypes.contains(this.typeDeclaration)) return null;
knownTypes.add(this.typeDeclaration);
-
+
int lastEnd = this.typeDeclaration.bodyStart;
/* update annotations */
if (this.modifiers != 0) {
@@ -621,7 +621,7 @@ public TypeDeclaration updatedTypeDeclaration(int depth, Set<TypeDeclaration> kn
this.memberTypes[this.memberTypeCount - 1].typeDeclaration.declarationSourceEnd = bodyEndValue;
this.memberTypes[this.memberTypeCount - 1].typeDeclaration.bodyEnd = bodyEndValue;
}
-
+
int updatedCount = 0;
for (int i = 0; i < this.memberTypeCount; i++){
TypeDeclaration updatedTypeDeclaration = this.memberTypes[i].updatedTypeDeclaration(depth + 1, knownTypes);
@@ -633,8 +633,8 @@ public TypeDeclaration updatedTypeDeclaration(int depth, Set<TypeDeclaration> kn
int length = existingCount + updatedCount;
System.arraycopy(memberTypeDeclarations, 0, memberTypeDeclarations = new TypeDeclaration[length], 0, length);
}
-
- if (memberTypeDeclarations.length > 0) {
+
+ if (memberTypeDeclarations.length > 0) {
this.typeDeclaration.memberTypes = memberTypeDeclarations;
if(memberTypeDeclarations[memberTypeDeclarations.length - 1].declarationSourceEnd > lastEnd) {
lastEnd = memberTypeDeclarations[memberTypeDeclarations.length - 1].declarationSourceEnd;
@@ -662,14 +662,14 @@ public TypeDeclaration updatedTypeDeclaration(int depth, Set<TypeDeclaration> kn
for (int i = 0; i < this.fieldCount; i++){
fieldDeclarations[existingCount + i] = this.fields[i].updatedFieldDeclaration(depth, knownTypes);
}
-
+
for (int i = this.fieldCount - 1; 0 < i; i--) {
if (fieldDeclarations[existingCount + i - 1].declarationSourceStart == fieldDeclarations[existingCount + i].declarationSourceStart) {
fieldDeclarations[existingCount + i - 1].declarationSourceEnd = fieldDeclarations[existingCount + i].declarationSourceEnd;
fieldDeclarations[existingCount + i - 1].declarationEnd = fieldDeclarations[existingCount + i].declarationEnd;
}
}
-
+
this.typeDeclaration.fields = fieldDeclarations;
if(fieldDeclarations[fieldDeclarations.length - 1].declarationSourceEnd > lastEnd) {
lastEnd = fieldDeclarations[fieldDeclarations.length - 1].declarationSourceEnd;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredTypeReference.java
index a26f32a35..4355ce729 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredTypeReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredTypeReference.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.parser;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredUnit.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredUnit.java
index 45d483719..6b7f3d6bd 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredUnit.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredUnit.java
@@ -172,7 +172,7 @@ public RecoveredElement add(ModuleDeclaration moduleDeclaration, int bracketBala
}
@Override
public RecoveredElement add(TypeDeclaration typeDeclaration, int bracketBalanceValue) {
-
+
if ((typeDeclaration.bits & ASTNode.IsAnonymousType) != 0){
if (this.typeCount > 0) {
// add it to the last type
@@ -295,7 +295,7 @@ public CompilationUnitDeclaration updatedCompilationUnitDeclaration(){
this.types[this.typeCount - 1].typeDeclaration.declarationSourceEnd = this.unitDeclaration.sourceEnd;
this.types[this.typeCount - 1].typeDeclaration.bodyEnd = this.unitDeclaration.sourceEnd;
}
-
+
Set<TypeDeclaration> knownTypes = new HashSet<>();
int actualCount = existingCount;
for (int i = 0; i < this.typeCount; i++){
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveryScanner.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveryScanner.java
index 7e37c855e..933ba7928 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveryScanner.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveryScanner.java
@@ -44,7 +44,7 @@ public class RecoveryScanner extends Scanner {
scanner.previewEnabled);
setData(data);
}
-
+
public RecoveryScanner(
boolean tokenizeWhiteSpace,
boolean checkNonExternalizedStringLiterals,
@@ -103,7 +103,7 @@ public class RecoveryScanner extends Scanner {
this.data.insertedTokensPosition[this.data.insertedTokensPtr] = position;
this.data.insertedTokenUsed[this.data.insertedTokensPtr] = false;
}
-
+
public void insertTokenAhead(int token, int index) {
if(!this.record) return;
if (token == TerminalTokens.TokenNameRestrictedIdentifierrecord)
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java
index dd69d2b2f..ac7a4f5e9 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java
@@ -116,18 +116,18 @@ public class Scanner implements TerminalTokens {
public boolean _insideParameterMapping = false;
enum LookaheadState { INIT, ONE_TOKEN, ID_SEEN, TWO_TOKENS, ID_CONSUMED }
- /**
+ /**
* A little state machine for lookahead of up-to 2 tokens.
* This is used to disambiguate whether a '->' inside parameter mappings is
- * an ARROW (lambda) or a SYNTHBINDOUT (parameter mapping role-to-base)
+ * an ARROW (lambda) or a SYNTHBINDOUT (parameter mapping role-to-base)
*/
protected class BindoutLookahead {
-
+
LookaheadState state = LookaheadState.INIT;
int[] tokens = new int[2];
char[] identifier = null;
int[][] positions = new int[2][];
-
+
public BindoutLookahead() throws InvalidInputException {
int token = this.tokens[0] = getNextToken0();
this.positions[0] = new int[] {Scanner.this.startPosition, Scanner.this.currentPosition};
@@ -149,7 +149,7 @@ public class Scanner implements TerminalTokens {
this.state = LookaheadState.ONE_TOKEN;
return TerminalTokens.TokenNameNotAToken;
case ONE_TOKEN :
- // == we have one non-matching token => pop that token and unregister
+ // == we have one non-matching token => pop that token and unregister
Scanner.this._bindoutLookahead = null;
return popToken(0);
case ID_SEEN :
@@ -183,7 +183,7 @@ public class Scanner implements TerminalTokens {
}
}
protected BindoutLookahead _bindoutLookahead = null;
-
+
public char[] peekPendingIdentifier() {
if (this._bindoutLookahead != null)
return this._bindoutLookahead.identifier;
@@ -199,17 +199,17 @@ public class Scanner implements TerminalTokens {
this._insideParameterMapping = false;
this._bindoutLookahead = null;
}
-
+
public void setOTFlags(CompilerOptions options) {
this.parseOTJonly = !options.allowScopedKeywords;
this.parsePureJavaOnly = options.isPureJava;
}
-
+
public void copyOTFlags(Scanner other) {
this.parseOTJonly = other.parseOTJonly;
this.parsePureJavaOnly = other.parsePureJavaOnly;
}
-
+
/**
* Check whether a given terminal token is currently enabled.
* Some keywords can be disabled:
@@ -420,7 +420,7 @@ public class Scanner implements TerminalTokens {
private VanguardParser vanguardParser;
ConflictedParser activeParser = null;
private boolean consumingEllipsisAnnotations = false;
-
+
public static final int RoundBracket = 0;
public static final int SquareBracket = 1;
public static final int CurlyBracket = 2;
@@ -863,7 +863,7 @@ public char[] getCurrentTextBlock() {
}
}
}
- // The last line with closing delimiter is part of the
+ // The last line with closing delimiter is part of the
// determining line list even if empty
if (!blank || (i+1 == size)) {
if (prefix < 0 || whitespaces < prefix) {
@@ -934,7 +934,7 @@ private char[] normalize(char[] content) {
return result.toString().toCharArray();
}
// This method is for handling the left over escaped characters during the first
-// scanning (scanForStringLiteral). Admittedly this goes over the text block
+// scanning (scanForStringLiteral). Admittedly this goes over the text block
// content again char by char, but this is required in order to correctly
// treat all the white space and line endings
private boolean getLineContent(StringBuilder result, char[] line, int start, int end, boolean merge, boolean lastLine) {
@@ -995,13 +995,13 @@ private boolean getLineContent(StringBuilder result, char[] line, int start, int
// has read \ZeroToThree OctalDigit NonOctalDigit --> ignore last character
}
}
- } else {
+ } else {
// has read \OctalDigit NonDigit--> ignore last character
}
- } else {
+ } else {
// has read \OctalDigit NonOctalDigit--> ignore last character
}
- } else {
+ } else {
// has read \OctalDigit --> ignore last character
}
} catch (InvalidInputException e) {
@@ -1020,10 +1020,10 @@ private boolean getLineContent(StringBuilder result, char[] line, int start, int
}
}
}
- }
+ }
}
end = merge ? end : end >= line.length ? end : end + 1;
- char[] chars = lastPointer == 0 ?
+ char[] chars = lastPointer == 0 ?
CharOperation.subarray(line, start, end) :
CharOperation.subarray(line, lastPointer + 1, end);
// The below check is because CharOperation.subarray tend to return null when the
@@ -1255,14 +1255,14 @@ public final int getNextChar(char testedChar1, char testedChar2) {
}
/*
* This method consumes digits as well as underscores if underscores are located between digits
- * @throws InvalidInputException if underscores are not located between digits or if underscores are used in source < 1.7
+ * @throws InvalidInputException if underscores are not located between digits or if underscores are used in source < 1.7
*/
private final void consumeDigits(int radix) throws InvalidInputException {
consumeDigits(radix, false);
}
/*
* This method consumes digits as well as underscores if underscores are located between digits
- * @throws InvalidInputException if underscores are not located between digits or if underscores are used in source < 1.7
+ * @throws InvalidInputException if underscores are not located between digits or if underscores are used in source < 1.7
*/
private final void consumeDigits(int radix, boolean expectingDigitFirst) throws InvalidInputException {
final int USING_UNDERSCORE = 1;
@@ -1636,18 +1636,18 @@ private void updateCase(int token) {
this.inCase = true;
this.breakPreviewAllowed = true;
}
- if (token == TokenNameCOLON || token == TokenNameARROW)
+ if (token == TokenNameCOLON || token == TokenNameARROW)
this.inCase = false;
}
public int getNextToken() throws InvalidInputException {
-
+
int token;
if (this.nextToken != TokenNameNotAToken) {
token = this.nextToken;
this.nextToken = TokenNameNotAToken;
return token; // presumed to be unambiguous.
}
-
+
//{ObjectTeams: consume lookahead for parameter mappings:
if (this._bindoutLookahead != null) {
int result = this._bindoutLookahead.getNextToken();
@@ -2351,7 +2351,7 @@ private int scanForStringLiteral() throws InvalidInputException {
break;
}
this.unicodeAsBackSlash = false;
- if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\')
+ if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\')
&& (this.source[this.currentPosition] == 'u')) {
getNextUnicodeChar();
isUnicode = true;
@@ -2376,7 +2376,7 @@ private int scanForStringLiteral() throws InvalidInputException {
// Kludge, retain the '\' and also
// when scanEscapeCharacter reads space in form of \040 and
// set the next character to 's'
- // so, we get an escaped scape, i.e. \s, which will later be
+ // so, we get an escaped scape, i.e. \s, which will later be
// replaced by space
unicodeStore('\\');
this.currentCharacter = 's';
@@ -2390,7 +2390,7 @@ private int scanForStringLiteral() throws InvalidInputException {
this.currentPosition = oldPos;
this.currentCharacter = this.source[this.currentPosition];
break outer;
-
+
}
}
if (this.withoutUnicodePtr != 0) {
@@ -2701,7 +2701,7 @@ public final void jumpOverMethodBody(int found) {
} catch (InvalidInputException ex) {
// ignore
}
-
+
Inner: while (this.currentPosition <= this.eofPosition) {
if (isTextBlock) {
switch (this.currentCharacter) {
@@ -2719,7 +2719,7 @@ public final void jumpOverMethodBody(int found) {
firstClosingBrace = this.currentPosition;
break;
case '\r' :
- if (this.source[this.currentPosition] == '\n')
+ if (this.source[this.currentPosition] == '\n')
this.currentPosition++;
//$FALL-THROUGH$
case '\n' :
@@ -3670,7 +3670,7 @@ void updateScanContext(int token) {
case TokenNameprovides:
case TokenNameto:
case TokenNamewith:
- case TokenNametransitive:
+ case TokenNametransitive:
case TokenNameDOT:
case TokenNameimport:
case TokenNameAT:
@@ -3749,8 +3749,8 @@ private void parseTags() {
}
pos = CharOperation.indexOf(TAG_PREFIX, s, true, end, sourceEnd);
}
- }
-
+ }
+
if (this.checkUninternedIdentityComparison &&
(pos = CharOperation.indexOf(IDENTITY_COMPARISON_TAG, s, true, sourceStart, sourceEnd)) != -1) {
if (this.validIdentityComparisonLines == null) {
@@ -4761,7 +4761,7 @@ private int internalScanIdentifierOrKeyword(int index, int length, char[] data)
&& (data[++index] == 'r')
&& (data[++index] == 'n'))
return TokenNamereturn;
- else if ((data[index] == 'c')
+ else if ((data[index] == 'c')
&& (data[++index] == 'o')
&& (data[++index] == 'r')
&& (data[++index] == 'd'))
@@ -4778,10 +4778,10 @@ private int internalScanIdentifierOrKeyword(int index, int length, char[] data)
&& (data[++index] == 'e')
&& (data[++index] == 's')) {
return TokenNamerequires;
- } else
+ } else
return TokenNameIdentifier;
//{ObjectTeams: 'replace' (only if after "<-"):
- case 7:
+ case 7:
if (callinSeen) {
if ( (data[++index] == 'e')
&& (data[++index] == 'p')
@@ -4970,7 +4970,7 @@ private int internalScanIdentifierOrKeyword(int index, int length, char[] data)
case 'u' : //uses
switch(length) {
case 4 :
- if (areRestrictedModuleKeywordsActive()
+ if (areRestrictedModuleKeywordsActive()
&& (data[++index] == 's') && (data[++index] == 'e') && (data[++index] == 's'))
return TokenNameuses;
else
@@ -5844,12 +5844,12 @@ public static boolean isKeyword(int token) {
// Vanguard Scanner - A Private utility helper class for the scanner.
private static final class VanguardScanner extends Scanner {
-
+
public VanguardScanner(long sourceLevel, long complianceLevel, boolean previewEnabled) {
super (false /*comment*/, false /*whitespace*/, false /*nls*/, sourceLevel, complianceLevel, null/*taskTag*/,
null/*taskPriorities*/, false /*taskCaseSensitive*/, previewEnabled);
}
-
+
@Override
public int getNextToken() throws InvalidInputException {
int token;
@@ -5874,12 +5874,12 @@ private static final class VanguardScanner extends Scanner {
token = TokenNameAT308;
}
}
- return token == TokenNameEOF ? TokenNameNotAToken : token;
+ return token == TokenNameEOF ? TokenNameNotAToken : token;
}
}
private static class Goal {
-
+
int first; // steer the parser towards a single minded pursuit.
int [] follow; // the definite terminal symbols that signal the successful reduction to goal.
int rule;
@@ -5890,26 +5890,26 @@ private static class Goal {
static int VarargTypeAnnotationsRule = 0;
static int BlockStatementoptRule = 0;
static int YieldStatementRule = 0;
-
+
static Goal LambdaParameterListGoal;
static Goal IntersectionCastGoal;
static Goal VarargTypeAnnotationGoal;
static Goal ReferenceExpressionGoal;
static Goal BlockStatementoptGoal;
static Goal YieldStatementGoal;
-
+
static {
-
+
for (int i = 1; i <= ParserBasicInformation.NUM_RULES; i++) { // 0 == $acc
if ("ParenthesizedLambdaParameterList".equals(Parser.name[Parser.non_terminal_index[Parser.lhs[i]]])) //$NON-NLS-1$
LambdaParameterListRule = i;
- else
+ else
if ("ParenthesizedCastNameAndBounds".equals(Parser.name[Parser.non_terminal_index[Parser.lhs[i]]])) //$NON-NLS-1$
IntersectionCastRule = i;
- else
+ else
if ("ReferenceExpressionTypeArgumentsAndTrunk".equals(Parser.name[Parser.non_terminal_index[Parser.lhs[i]]])) //$NON-NLS-1$
ReferenceExpressionRule = i;
- else
+ else
if ("TypeAnnotations".equals(Parser.name[Parser.non_terminal_index[Parser.lhs[i]]])) //$NON-NLS-1$
VarargTypeAnnotationsRule = i;
else
@@ -5918,9 +5918,9 @@ private static class Goal {
else
if ("YieldStatement".equals(Parser.name[Parser.non_terminal_index[Parser.lhs[i]]])) //$NON-NLS-1$
YieldStatementRule = i;
-
+
}
-
+
LambdaParameterListGoal = new Goal(TokenNameARROW, new int[] { TokenNameARROW }, LambdaParameterListRule);
IntersectionCastGoal = new Goal(TokenNameLPAREN, followSetOfCast(), IntersectionCastRule);
VarargTypeAnnotationGoal = new Goal(TokenNameAT, new int[] { TokenNameELLIPSIS }, VarargTypeAnnotationsRule);
@@ -5935,7 +5935,7 @@ private static class Goal {
this.follow = follow;
this.rule = rule;
}
-
+
boolean hasBeenReached(int act, int token) {
/*
System.out.println("[Goal = " + Parser.name[Parser.non_terminal_index[Parser.lhs[this.rule]]] + "] " + "Saw: " + Parser.name[Parser.non_terminal_index[Parser.lhs[act]]] + "::" + //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
@@ -5951,10 +5951,10 @@ private static class Goal {
}
return false;
}
-
+
private static int [] followSetOfCast() {
return new int [] { TokenNameIdentifier, TokenNamenew, TokenNamesuper, TokenNamethis,
- TokenNamefalse, TokenNametrue, TokenNamenull,
+ TokenNamefalse, TokenNametrue, TokenNamenull,
TokenNameIntegerLiteral, TokenNameLongLiteral, TokenNameFloatingPointLiteral, TokenNameDoubleLiteral, TokenNameCharacterLiteral, TokenNameStringLiteral, TokenNameTextBlock,
TokenNameNOT, TokenNameTWIDDLE, TokenNameLPAREN
};
@@ -5962,10 +5962,10 @@ private static class Goal {
}
// Vanguard Parser - A Private utility helper class for the scanner.
private static class VanguardParser extends Parser {
-
+
public static final boolean SUCCESS = true;
public static final boolean FAILURE = false;
-
+
Goal currentGoal;
public VanguardParser(VanguardScanner scanner) {
@@ -5975,14 +5975,14 @@ private static class VanguardParser extends Parser {
public VanguardParser(ProblemReporter reporter) {
super(reporter, false);
}
-
+
// Canonical LALR pushdown automaton identical to Parser.parse() minus side effects of any kind, returns the rule reduced.
protected boolean parse(Goal goal) {
this.currentGoal = goal;
try {
int act = START_STATE;
this.stateStackTop = -1;
- this.currentToken = goal.first;
+ this.currentToken = goal.first;
ProcessTerminals : for (;;) {
int stackLength = this.stack.length;
if (++this.stateStackTop >= stackLength) {
@@ -6125,7 +6125,7 @@ protected final boolean maybeAtLambdaOrCast() { // Could the '(' we saw just now
return this.activeParser.atConflictScenario(TokenNameLPAREN);
}
}
-
+
protected final boolean maybeAtReferenceExpression() { // Did the '<' we saw just now herald a reference expression's type arguments and trunk ?
switch (this.lookBack[1]) {
@@ -6151,8 +6151,8 @@ protected final boolean maybeAtReferenceExpression() { // Did the '<' we saw jus
case TokenNameAND: // T extends Object & Comparable<? super T>
case TokenNameimplements: // class A implements I<Z>
case TokenNamethrows: // throws Y<Z>
- case TokenNameAT: // @Deprecated <T> void foo() {}
- case TokenNameinstanceof: // if (o instanceof List<E>[])
+ case TokenNameAT: // @Deprecated <T> void foo() {}
+ case TokenNameinstanceof: // if (o instanceof List<E>[])
return false;
default:
break;
@@ -6188,7 +6188,7 @@ private final boolean maybeAtEllipsisAnnotationsStart() { // Did the '@' we saw
protected final boolean atTypeAnnotation() { // Did the '@' we saw just now herald a type annotation ? We should not ask the parser whether it would shift @308 !
return !this.activeParser.atConflictScenario(TokenNameAT);
}
-//{ObjectTeams: one more variant of '@' to check:
+//{ObjectTeams: one more variant of '@' to check:
protected final boolean atTypeAnchor() { // Did the '@' we saw just now herald a type anchor ?
// Note: if we proceed with ATOT while actually a normal type annotation is present,
// the erroneous TypeAnchorReference is deconstructed again in Parser.convertTypeAnchor()!
@@ -6245,7 +6245,7 @@ int disambiguatedRestrictedIdentifierrecord(int restrictedIdentifierToken) {
return restrictedIdentifierToken;
if (this.sourceLevel < ClassFileConstants.JDK14 || !this.previewEnabled)
return TokenNameIdentifier;
-
+
return disambiguaterecordWithLookAhead() ?
restrictedIdentifierToken : TokenNameIdentifier;
}
@@ -6384,7 +6384,7 @@ int disambiguatedRestrictedKeyword(int restrictedKeywordToken) {
if (lookAhead == TokenNameSEMICOLON)
token = TokenNameIdentifier;
} catch (InvalidInputException e) {
- //
+ //
}
}
break;
@@ -6452,7 +6452,7 @@ protected boolean isAtAssistIdentifier() {
// Position the scanner at the next block statement and return the start token. We recognize empty statements.
public int fastForward(Statement unused) {
-
+
int token;
while (true) {
@@ -6461,7 +6461,7 @@ public int fastForward(Statement unused) {
} catch (InvalidInputException e) {
return TokenNameEOF;
}
- /* FOLLOW map of BlockStatement, since the non-terminal is recursive is a super set of its own FIRST set.
+ /* FOLLOW map of BlockStatement, since the non-terminal is recursive is a super set of its own FIRST set.
We use FOLLOW rather than FIRST since we want to recognize empty statements. i.e if (x > 10) { x = 0 }
*/
switch(token) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.java
index affd0f4b1..0b32416b4 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.java
@@ -32,7 +32,7 @@ package org.eclipse.jdt.internal.compiler.parser;
public interface TerminalTokens {
// special tokens not part of grammar - not autogenerated
- int
+ int
TokenNameNotAToken = 0,
TokenNameWHITESPACE = 1000,
TokenNameCOMMENT_LINE = 1001,
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser.java
index 8b7e50804..a5917212d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser.java
@@ -2616,11 +2616,11 @@ public class DiagnoseParser implements ParserBasicInformation, TerminalTokens, C
@Override
public boolean atConflictScenario(int token) {
/* There is too much voodoo that goes on here in DiagnoseParser (multiple machines, lexer stream reset etc.)
- So we take a simple minded view that we will always ask for disambiguation, except there is one scenario
+ So we take a simple minded view that we will always ask for disambiguation, except there is one scenario
that needs special handling, we let the lexer stream deal with that: In X<String>.Y<Integer>:: the second
'<' should not be tagged for disambiguation. If a synthetic token gets injected there, there will be syntax
error. See that this is not a problem for the regular/normal parser.
- */
+ */
return (token == TokenNameLPAREN || token == TokenNameAT || (token == TokenNameLESS && !this.lexStream.awaitingColonColon()));
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/IProblemRechecker.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/IProblemRechecker.java
index 0517b9b3c..57ca6acb6 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/IProblemRechecker.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/IProblemRechecker.java
@@ -21,10 +21,10 @@ package org.eclipse.jdt.internal.compiler.problem;
import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
import org.eclipse.jdt.internal.compiler.impl.IrritantSet;
-/**
+/**
* Protocol for rechecking problems that were detected early during compilation
* but might later turn out to be false alarms.
- *
+ *
* @author stephan
* @since 1.3.0
*/
@@ -34,7 +34,7 @@ public interface IProblemRechecker {
* Answer whether a given problem should actually be reported.
* Implementing classes are responsible for remembering enough context
* so that checking can be performed.
- *
+ *
* @param foundIrritants if reporting is suppressed by a suppress warnings annotation,
* the fact of suppression should be recorded in this array of irritant sets
* (cf. {@link CompilationUnitDeclaration#finalizeProblems()}).
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemHandler.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemHandler.java
index 1530b596e..d06ff0a61 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemHandler.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemHandler.java
@@ -49,7 +49,7 @@ public class ProblemHandler {
public IErrorHandlingPolicy policy;
public final IProblemFactory problemFactory;
public final CompilerOptions options;
-
+
/* When temporarily switching policies, store here the original root policy (for temporary resume). */
private IErrorHandlingPolicy rootPolicy;
@@ -138,7 +138,7 @@ public void handle(
try {
protectedHandle(problemId, problemArguments, elaborationId, messageArguments, severity, problemStartPosition, problemEndPosition, referenceContext, unitResult);
} finally {
- this.rechecker = null;
+ this.rechecker = null;
}
}
private void protectedHandle(
@@ -158,7 +158,7 @@ private void protectedHandle(
return;
boolean mandatory = (severity & (ProblemSeverities.Error | ProblemSeverities.Optional)) == ProblemSeverities.Error;
- if ((severity & ProblemSeverities.InternalError) == 0 && this.policy.ignoreAllErrors()) {
+ if ((severity & ProblemSeverities.InternalError) == 0 && this.policy.ignoreAllErrors()) {
// Error is not to be exposed, but clients may need still notification as to whether there are silently-ignored-errors.
// if no reference context, we need to abort from the current compilation process
if (referenceContext == null) {
@@ -177,7 +177,7 @@ private void protectedHandle(
if ((severity & ProblemSeverities.Optional) != 0 && problemId != IProblem.Task && !this.options.ignoreSourceFolderWarningOption) {
//{ObjectTeams: NPE prevention:
if (unitResult != null) {
-// orig:
+// orig:
ICompilationUnit cu = unitResult.getCompilationUnit();
try{
if (cu != null && cu.ignoreOptionalProblems())
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
index b62675f72..58f8edf75 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
@@ -35,7 +35,7 @@
* bug 382789 - [compiler][null] warn when syntactically-nonnull expression is compared against null
* bug 376590 - Private fields with @Inject are ignored by unused field validation
* bug 400761 - [compiler][null] null may be return as boolean without a diagnostic
- * 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 392384 - [1.8][compiler][null] Restore nullness info from type annotations in class files
@@ -690,25 +690,25 @@ public static int getIrritant(int problemID) {
case IProblem.ComparingIdentical:
return CompilerOptions.ComparingIdentical;
-
+
case IProblem.MissingSynchronizedModifierInInheritedMethod:
return CompilerOptions.MissingSynchronizedModifierInInheritedMethod;
case IProblem.ShouldImplementHashcode:
return CompilerOptions.ShouldImplementHashcode;
-
+
case IProblem.DeadCode:
return CompilerOptions.DeadCode;
-
+
case IProblem.Task :
return CompilerOptions.Tasks;
case IProblem.UnusedObjectAllocation:
return CompilerOptions.UnusedObjectAllocation;
-
+
case IProblem.MethodCanBeStatic:
return CompilerOptions.MethodCanBeStatic;
-
+
case IProblem.MethodCanBePotentiallyStatic:
return CompilerOptions.MethodCanBePotentiallyStatic;
@@ -720,14 +720,14 @@ public static int getIrritant(int problemID) {
return CompilerOptions.PotentiallyUnclosedCloseable;
case IProblem.ExplicitlyClosedAutoCloseable:
return CompilerOptions.ExplicitlyClosedAutoCloseable;
-
+
case IProblem.RedundantSpecificationOfTypeArguments:
return CompilerOptions.RedundantSpecificationOfTypeArguments;
//{ObjectTeams:
case IProblem.DeprecatedBaseclass:
case IProblem.CallinToDeprecated:
return CompilerOptions.AdaptingDeprecated;
-
+
case IProblem.DefinitelyMissingBaseCall:
case IProblem.DefinitelyDuplicateBaseCall:
case IProblem.PotentiallyMissingBaseCall:
@@ -743,14 +743,14 @@ public static int getIrritant(int problemID) {
case IProblem.FieldAccessHasNoEffect:
return CompilerOptions.EffectlessFieldaccess;
-
+
case IProblem.FragileCallinBindingReferenceType:
case IProblem.FragileCallinBindingBaseType:
return CompilerOptions.FragileCallin;
case IProblem.UnusedParamMap:
return CompilerOptions.UnusedParammap;
-
+
case IProblem.CallinOverriddenInTeam:
return CompilerOptions.EffectlessCallinBinding;
@@ -781,7 +781,7 @@ public static int getIrritant(int problemID) {
return CompilerOptions.Decapsulation;
case IProblem.DecapsulationFieldWrite:
return CompilerOptions.DecapsulationWrite;
-
+
case IProblem.RegularlyImportedBaseclass:
case IProblem.IllegalBaseImport:
case IProblem.IllegalBaseImportNoAspectBinding:
@@ -802,10 +802,10 @@ public static int getIrritant(int problemID) {
case IProblem.DangerousCallinBinding:
return CompilerOptions.DangerousCallin;
-
+
case IProblem.IgnoringRoleMethodReturn:
return CompilerOptions.IgnoringRoleReturn;
-
+
case IProblem.OtreCannotWeaveIntoJava8:
return CompilerOptions.OTREintoJava8;
@@ -827,11 +827,11 @@ public static int getIrritant(int problemID) {
case IProblem.JavadocRoleTagInRegular:
return CompilerOptions.InvalidJavadoc;
// SH}
-
+
case IProblem.MissingNonNullByDefaultAnnotationOnPackage:
case IProblem.MissingNonNullByDefaultAnnotationOnType:
return CompilerOptions.MissingNonNullByDefaultAnnotation;
-
+
case IProblem.UnusedTypeParameter:
return CompilerOptions.UnusedTypeParameter;
@@ -915,7 +915,7 @@ public static int getProblemCategory(int severity, int problemID) {
case CompilerOptions.APILeak:
case CompilerOptions.UnstableAutoModuleName:
return CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM;
-
+
case CompilerOptions.OverriddenPackageDefaultMethod :
case CompilerOptions.IncompatibleNonInheritedInterfaceMethod :
case CompilerOptions.LocalVariableHiding :
@@ -948,7 +948,7 @@ public static int getProblemCategory(int severity, int problemID) {
case CompilerOptions.Task :
return CategorizedProblem.CAT_UNSPECIFIED; // TODO may want to improve
-
+
case CompilerOptions.MissingJavadocComments :
case CompilerOptions.MissingJavadocTags :
case CompilerOptions.InvalidJavadoc :
@@ -959,11 +959,11 @@ public static int getProblemCategory(int severity, int problemID) {
case CompilerOptions.UncheckedTypeOperation :
case CompilerOptions.RawTypeReference :
return CategorizedProblem.CAT_UNCHECKED_RAW;
-
+
case CompilerOptions.ForbiddenReference :
case CompilerOptions.DiscouragedReference :
return CategorizedProblem.CAT_RESTRICTION;
-
+
//{ObjectTeams:
case CompilerOptions.NotExactlyOneBasecall:
case CompilerOptions.BaseclassCycle:
@@ -1665,7 +1665,7 @@ public void cannotReferToNonFinalOuterLocal(LocalVariableBinding local, ASTNode
public void cannotReferToNonEffectivelyFinalOuterLocal(VariableBinding local, ASTNode location) {
String[] arguments = new String[] { new String(local.readableName()) };
this.handle(
- IProblem.OuterLocalMustBeEffectivelyFinal,
+ IProblem.OuterLocalMustBeEffectivelyFinal,
arguments,
arguments,
nodeSourceStart(local, location),
@@ -1674,7 +1674,7 @@ public void cannotReferToNonEffectivelyFinalOuterLocal(VariableBinding local, AS
public void cannotReferToNonFinalField(VariableBinding local, ASTNode location) {
String[] arguments = new String[] { new String(local.readableName()) };
this.handle(
- IProblem.FieldMustBeFinal,
+ IProblem.FieldMustBeFinal,
arguments,
arguments,
nodeSourceStart(local, location),
@@ -1777,14 +1777,14 @@ public void lambdaParameterTypeMismatched(Argument argument, TypeReference type,
public void lambdaExpressionCannotImplementGenericMethod(LambdaExpression lambda, MethodBinding sam) {
final String selector = new String(sam.selector);
this.handle(
- IProblem.NoGenericLambda,
+ IProblem.NoGenericLambda,
new String[] { selector, new String(sam.declaringClass.readableName())},
new String[] { selector, new String(sam.declaringClass.shortReadableName())},
lambda.sourceStart,
lambda.diagnosticsSourceEnd());
}
public void missingValueFromLambda(LambdaExpression lambda, TypeBinding returnType) {
- this.handle(IProblem.MissingValueFromLambda,
+ this.handle(IProblem.MissingValueFromLambda,
new String[] {new String(returnType.readableName())},
new String[] {new String(returnType.shortReadableName())},
lambda.sourceStart,
@@ -1939,9 +1939,9 @@ public int computeSeverity(int problemID){
return ProblemSeverities.Ignore;
}
break;
- // For compatibility with javac 8b111 for now.
+ // For compatibility with javac 8b111 for now.
case IProblem.RepeatableAnnotationWithRepeatingContainerAnnotation:
- case IProblem.ToleratedMisplacedTypeAnnotations:
+ case IProblem.ToleratedMisplacedTypeAnnotations:
return ProblemSeverities.Warning;
case IProblem.IllegalUseOfUnderscoreAsAnIdentifier:
return this.underScoreIsError ? ProblemSeverities.Error : ProblemSeverities.Warning;
@@ -2038,7 +2038,7 @@ public void deprecatedMethod(final MethodBinding method, ASTNode location) {
String selector = new String(method.selector);
String signature = typesAsString(method, false);
String shortSignature = typesAsString(method, true);
-
+
boolean isConstructor = method.isConstructor();
int start = -1;
if (isConstructor) {
@@ -2135,7 +2135,7 @@ public void deprecatedModule(ModuleReference moduleReference, ModuleBinding requ
args,
args,
moduleReference.sourceStart,
- moduleReference.sourceEnd);
+ moduleReference.sourceEnd);
} else {
String[] args = { String.valueOf(requiredModule.name()) };
handle( isTerminally ? IProblem.UsingTerminallyDeprecatedModule : IProblem.UsingDeprecatedModule,
@@ -2636,7 +2636,7 @@ public void fakeReachable(ASTNode location) {
LocalDeclaration declaration = (LocalDeclaration) location;
sourceStart = declaration.declarationSourceStart;
sourceEnd = declaration.declarationSourceEnd;
- }
+ }
this.handle(
IProblem.DeadCode,
NoArgument,
@@ -2958,7 +2958,7 @@ public void hiddenCatchBlock(ReferenceBinding exceptionType, ASTNode location) {
public void hierarchyCircularity(SourceTypeBinding sourceType, ReferenceBinding superType, TypeReference reference) {
:giro */
public void hierarchyCircularity(SourceTypeBinding sourceType, ReferenceBinding superType, ASTNode reference) {
-// SH}
+// SH}
int start = 0;
int end = 0;
@@ -3320,7 +3320,7 @@ public void illegalModifierForInterfaceField(FieldDeclaration fieldDecl) {
fieldDecl.sourceEnd);
}
public void illegalModifierForInterfaceMethod(AbstractMethodDeclaration methodDecl, long level) {
-
+
int problem = level < ClassFileConstants.JDK1_8 ? IProblem.IllegalModifierForInterfaceMethod :
level < ClassFileConstants.JDK9 ? IProblem.IllegalModifierForInterfaceMethod18 : IProblem.IllegalModifierForInterfaceMethod9;
// cannot include parameter types since they are not resolved yet
@@ -3970,14 +3970,14 @@ public void indirectAccessToStaticMethod(ASTNode location, MethodBinding method)
}
public void inheritedDefaultMethodConflictsWithOtherInherited(SourceTypeBinding type, MethodBinding defaultMethod, MethodBinding otherMethod) {
TypeDeclaration typeDecl = type.scope.referenceContext;
- String[] problemArguments = new String[] {
- String.valueOf(defaultMethod.readableName()),
- String.valueOf(defaultMethod.declaringClass.readableName()),
+ String[] problemArguments = new String[] {
+ String.valueOf(defaultMethod.readableName()),
+ String.valueOf(defaultMethod.declaringClass.readableName()),
String.valueOf(otherMethod.declaringClass.readableName()) };
- String[] messageArguments = new String[] {
- String.valueOf(defaultMethod.shortReadableName()),
- String.valueOf(defaultMethod.declaringClass.shortReadableName()),
- String.valueOf(otherMethod.declaringClass.shortReadableName()) };
+ String[] messageArguments = new String[] {
+ String.valueOf(defaultMethod.shortReadableName()),
+ String.valueOf(defaultMethod.declaringClass.shortReadableName()),
+ String.valueOf(otherMethod.declaringClass.shortReadableName()) };
this.handle(IProblem.InheritedDefaultMethodConflictsWithOtherInherited,
problemArguments,
messageArguments,
@@ -4235,7 +4235,7 @@ public void invalidConstructor(Statement statement, MethodBinding targetConstruc
{
if (statement instanceof CopyInheritance.RoleConstructorCall)
statement = ((RoleConstructorCall)statement).allocationOrig;
- noSuchEnclosingInstance(targetConstructor.declaringClass.enclosingType(), statement,
+ noSuchEnclosingInstance(targetConstructor.declaringClass.enclosingType(), statement,
targetConstructor.problemId() == ProblemReasons.NonStaticReferenceInConstructorInvocation);
return;
}
@@ -4368,7 +4368,7 @@ public void invalidConstructor(Statement statement, MethodBinding targetConstruc
sourceStart,
sourceEnd);
return;
- case ProblemReasons.InferredApplicableMethodInapplicable:
+ case ProblemReasons.InferredApplicableMethodInapplicable:
case ProblemReasons.InvocationTypeInferenceFailure:
// FIXME(stephan): construct suitable message (https://bugs.eclipse.org/404675)
problemConstructor = (ProblemMethodBinding) targetConstructor;
@@ -4766,7 +4766,7 @@ public void invalidMethod(MessageSend messageSend, MethodBinding method, Scope s
ASTNode invocation = (messageSend instanceof CopyInheritance.RoleConstructorCall)
? ((RoleConstructorCall)messageSend).allocationOrig
: messageSend;
- noSuchEnclosingInstance(method.declaringClass.enclosingType(), invocation,
+ noSuchEnclosingInstance(method.declaringClass.enclosingType(), invocation,
method.problemId() == ProblemReasons.NonStaticReferenceInConstructorInvocation);
return;
}
@@ -4820,7 +4820,7 @@ public void invalidMethod(MessageSend messageSend, MethodBinding method, Scope s
// reverse the mapping from lower() to _OT$getBase():
if ( (method.problemId() == ProblemReasons.NotFound)
&& CharOperation.equals(messageSend.selector, IOTConstants._OT_GETBASE))
- method.selector = IOTConstants.LOWER;
+ method.selector = IOTConstants.LOWER;
// SH}
int id = IProblem.UndefinedMethod; //default...
@@ -5113,13 +5113,13 @@ public void invalidMethod(MessageSend messageSend, MethodBinding method, Scope s
if (messageSend.expressionContext == ExpressionContext.VANILLA_CONTEXT) {
TypeVariableBinding[] typeVariables = method.shallowOriginal().typeVariables;
String typeArguments = typesAsString(typeVariables, false);
- this.handle(IProblem.CannotInferInvocationType,
+ this.handle(IProblem.CannotInferInvocationType,
new String[] { typeArguments, String.valueOf(shownMethod.original().readableName()) },
new String[] { typeArguments, String.valueOf(shownMethod.original().shortReadableName()) },
messageSend.sourceStart,
messageSend.sourceEnd);
} else {
- // FIXME(stephan): turn into an exception once we are sure about this
+ // FIXME(stephan): turn into an exception once we are sure about this
this.handle(IProblem.GenericInferenceError,
new String[] { "Unknown error at invocation of "+String.valueOf(shownMethod.readableName())}, //$NON-NLS-1$
new String[] { "Unknown error at invocation of "+String.valueOf(shownMethod.shortReadableName())}, //$NON-NLS-1$
@@ -5621,7 +5621,7 @@ public void misplacedTypeAnnotations(Annotation first, Annotation last) {
NoArgument,
NoArgument,
first.sourceStart,
- last.sourceEnd);
+ last.sourceEnd);
}
public void illegalUsageOfTypeAnnotations(Annotation annotation) {
this.handle(
@@ -5629,7 +5629,7 @@ public void illegalUsageOfTypeAnnotations(Annotation annotation) {
NoArgument,
NoArgument,
annotation.sourceStart,
- annotation.sourceEnd);
+ annotation.sourceEnd);
}
public void illegalTypeAnnotationsInStaticMemberAccess(Annotation first, Annotation last) {
this.handle(
@@ -5640,7 +5640,7 @@ public void illegalTypeAnnotationsInStaticMemberAccess(Annotation first, Annotat
last.sourceEnd);
}
public void isClassPathCorrect(char[][] wellKnownTypeName, CompilationUnitDeclaration compUnitDecl, Object location, boolean implicitAnnotationUse) {
- // ProblemReporter is not designed to be reentrant. Just in case, we discovered a build path problem while we are already
+ // ProblemReporter is not designed to be reentrant. Just in case, we discovered a build path problem while we are already
// in the midst of reporting some other problem, save and restore reference context thereby mimicking a stack.
// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=442755.
ReferenceContext savedContext = this.referenceContext;
@@ -5867,7 +5867,7 @@ public void javadocDuplicatedThrowsClassName(TypeReference typeReference, int mo
}
}
public void javadocDuplicatedUsesTag(
-
+
int sourceStart, int sourceEnd){
this.handle(IProblem.JavadocDuplicateUsesTag, NoArgument, NoArgument, sourceStart, sourceEnd);
}
@@ -6717,7 +6717,7 @@ public void localVariableNonNullComparedToNull(LocalVariableBinding local, ASTNo
problemId = IProblem.SpecdNonNullLocalVariableComparisonYieldsFalse;
} else {
arguments = new String[] {new String(local.name) };
- problemId = IProblem.NonNullLocalVariableComparisonYieldsFalse;
+ problemId = IProblem.NonNullLocalVariableComparisonYieldsFalse;
}
this.handle(
problemId,
@@ -6743,7 +6743,7 @@ public void localVariableNullComparedToNonNull(LocalVariableBinding local, ASTNo
/**
* @param expr expression being compared for null or nonnull
- * @param checkForNull true if checking for null, false if checking for nonnull
+ * @param checkForNull true if checking for null, false if checking for nonnull
*/
public boolean expressionNonNullComparison(Expression expr, boolean checkForNull) {
int problemId = 0;
@@ -6774,7 +6774,7 @@ public boolean expressionNonNullComparison(Expression expr, boolean checkForNull
}
// check all those kinds of expressions that can possible answer NON_NULL from nullStatus():
if (expr instanceof MessageSend) {
- problemId = checkForNull
+ problemId = checkForNull
? IProblem.NonNullMessageSendComparisonYieldsFalse
: IProblem.RedundantNullCheckOnNonNullMessageSend;
MethodBinding method = ((MessageSend)expr).binding;
@@ -6792,12 +6792,12 @@ public boolean expressionNonNullComparison(Expression expr, boolean checkForNull
? IProblem.NonNullSpecdFieldComparisonYieldsFalse
: IProblem.RedundantNullCheckOnNonNullSpecdField;
char[][] nonNullName = this.options.nonNullAnnotationName;
- arguments = new String[] { new String(field.name),
+ arguments = new String[] { new String(field.name),
new String(nonNullName[nonNullName.length-1]) };
} else if (field.constant() != Constant.NotAConstant) {
- problemId = checkForNull ? IProblem.ConstNonNullFieldComparisonYieldsFalse : IProblem.RedundantNullCheckOnConstNonNullField;
+ problemId = checkForNull ? IProblem.ConstNonNullFieldComparisonYieldsFalse : IProblem.RedundantNullCheckOnConstNonNullField;
char[][] nonNullName = this.options.nonNullAnnotationName;
- arguments = new String[] { new String(field.name),
+ arguments = new String[] { new String(field.name),
new String(nonNullName[nonNullName.length-1]) };
} else {
// signaling redundancy based on syntactic analysis:
@@ -6809,8 +6809,8 @@ public boolean expressionNonNullComparison(Expression expr, boolean checkForNull
binding = field;
start = nodeSourceStart(binding, location);
end = nodeSourceEnd(binding, location);
- } else if (expr instanceof AllocationExpression
- || expr instanceof ArrayAllocationExpression
+ } else if (expr instanceof AllocationExpression
+ || expr instanceof ArrayAllocationExpression
|| expr instanceof ArrayInitializer
|| expr instanceof ClassLiteralAccess
|| expr instanceof ThisReference) {
@@ -6839,7 +6839,7 @@ public boolean expressionNonNullComparison(Expression expr, boolean checkForNull
}
if (problemId == 0) {
// standard case, fill in details now
- problemId = checkForNull
+ problemId = checkForNull
? IProblem.NonNullExpressionComparisonYieldsFalse
: IProblem.RedundantNullCheckOnNonNullExpression;
start = location.sourceStart;
@@ -6940,7 +6940,7 @@ public void localVariableNullReference(LocalVariableBinding local, ASTNode locat
public void fieldFreeTypeVariableReference(FieldBinding variable, long position) {
char[][] nullableName = this.options.nullableAnnotationName;
- String[] arguments = new String[] {new String(variable.type.readableName()),
+ String[] arguments = new String[] {new String(variable.type.readableName()),
new String(nullableName[nullableName.length-1])};
this.handle(
IProblem.UncheckedAccessOfValueOfFreeTypeVariable,
@@ -6955,7 +6955,7 @@ public void localVariableFreeTypeVariableReference(LocalVariableBinding local, A
int severity = computeSeverity(IProblem.UncheckedAccessOfValueOfFreeTypeVariable);
if (severity == ProblemSeverities.Ignore) return;
char[][] nullableName = this.options.nullableAnnotationName;
- String[] arguments = new String[] {new String(local.type.readableName()),
+ String[] arguments = new String[] {new String(local.type.readableName()),
new String(nullableName[nullableName.length-1])};
this.handle(
IProblem.UncheckedAccessOfValueOfFreeTypeVariable,
@@ -6970,7 +6970,7 @@ public void methodReturnTypeFreeTypeVariableReference(MethodBinding method, ASTN
int severity = computeSeverity(IProblem.UncheckedAccessOfValueOfFreeTypeVariable);
if (severity == ProblemSeverities.Ignore) return;
char[][] nullableName = this.options.nullableAnnotationName;
- String[] arguments = new String[] {new String(method.returnType.readableName()),
+ String[] arguments = new String[] {new String(method.returnType.readableName()),
new String(nullableName[nullableName.length-1])};
this.handle(
IProblem.UncheckedAccessOfValueOfFreeTypeVariable,
@@ -7047,10 +7047,10 @@ public void localVariableRedundantCheckOnNonNull(LocalVariableBinding local, AST
problemId = IProblem.RedundantNullCheckOnSpecdNonNullLocalVariable;
} else {
arguments = new String[] {new String(local.name) };
- problemId = IProblem.RedundantNullCheckOnNonNullLocalVariable;
+ problemId = IProblem.RedundantNullCheckOnNonNullLocalVariable;
}
this.handle(
- problemId,
+ problemId,
arguments,
arguments,
severity,
@@ -7920,7 +7920,7 @@ public void overridesDeprecatedMethod(MethodBinding localMethod, MethodBinding i
sinceValue},
localMethod.sourceStart(),
localMethod.sourceEnd());
-
+
} else {
this.handle(
(inheritedMethod.tagBits & TagBits.AnnotationTerminallyDeprecated) != 0
@@ -7995,7 +7995,7 @@ public void packageIsNotExpectedPackage(CompilationUnitDeclaration compUnitDecl)
end = -1;
} else {
end = hasPackageDeclaration ? 0 : compUnitDecl.currentPackage.sourceEnd;
- }
+ }
this.handle(
IProblem.PackageIsNotExpectedPackage,
arguments,
@@ -8715,7 +8715,7 @@ public void scannerError(Parser parser, String errorTokenName) {
endPos,
parser.compilationUnit.compilationResult);
}
-public void shouldImplementHashcode(SourceTypeBinding type) {
+public void shouldImplementHashcode(SourceTypeBinding type) {
this.handle(
IProblem.ShouldImplementHashcode,
new String[] {new String(type.readableName())},
@@ -9185,19 +9185,19 @@ public void typeMismatchError(TypeBinding typeArgument, TypeVariableBinding type
typeParamName = typeParameter.sourceName();
else
typeParamName = typeParameter.readableName();
-// orig:
+// orig:
this.handle(
//{OT
typeParameter.firstBound == null ? IProblem.ValueTypeArgumentMismatch :
//TO}
IProblem.TypeArgumentMismatch,
-/*
+/*
new String[] { new String(typeArgument.readableName()), new String(genericType.readableName()), new String(typeParameter.sourceName()), parameterBoundAsString(typeParameter, false) },
new String[] { new String(typeArgument.shortReadableName()), new String(genericType.shortReadableName()), new String(typeParameter.sourceName()), parameterBoundAsString(typeParameter, true) },
:giro */
new String[] { new String(typeArgument.readableName()), new String(genericType.readableName()), new String(typeParamName), parameterBoundAsString(typeParameter, false) },
new String[] { new String(typeArgument.shortReadableName()), new String(genericType.shortReadableName()), new String(typeParamName), parameterBoundAsString(typeParameter, true) },
-// SH}
+// SH}
location.sourceStart,
location.sourceEnd);
}
@@ -9339,8 +9339,8 @@ public void unhandledException(TypeBinding exceptionType, ASTNode location) {
if (this.referenceContext instanceof GuardPredicateDeclaration) {
checkedExceptionInGuard(exceptionType, location);
return;
- } else if (this.referenceContext instanceof MethodDeclaration
- && ((MethodDeclaration)this.referenceContext).isMappingWrapper == WrapperKind.CALLIN)
+ } else if (this.referenceContext instanceof MethodDeclaration
+ && ((MethodDeclaration)this.referenceContext).isMappingWrapper == WrapperKind.CALLIN)
{
// problem occurs in parameter mapping, declare exception now instead of reporting the error:
MethodDeclaration wrapperMethod = (MethodDeclaration) this.referenceContext;
@@ -9354,7 +9354,7 @@ public void unhandledException(TypeBinding exceptionType, ASTNode location) {
callinDespiteLiftingProblem(roleType, teamModel.canLiftingFail(roleType), location);
}
return;
- } else if (Lifting.isUnsafeLiftCall(exceptionType, location))
+ } else if (Lifting.isUnsafeLiftCall(exceptionType, location))
{
// add a specific link into the OTJLD to an otherwise normal error message:
this.handle(
@@ -9437,8 +9437,8 @@ public void uninitializedNonNullField(FieldBinding field, ASTNode location) {
char[][] nonNullAnnotationName = this.options.nonNullAnnotationName;
if(!field.isNonNull()) {
String[] arguments = new String[] {
- new String(field.readableName()),
- new String(field.type.readableName()),
+ new String(field.readableName()),
+ new String(field.type.readableName()),
new String(nonNullAnnotationName[nonNullAnnotationName.length-1])
};
this.handle(
@@ -9446,7 +9446,7 @@ public void uninitializedNonNullField(FieldBinding field, ASTNode location) {
arguments,
arguments,
nodeSourceStart(field, location),
- nodeSourceEnd(field, location));
+ nodeSourceEnd(field, location));
return;
}
String[] arguments = new String[] {
@@ -9478,7 +9478,7 @@ public void uninitializedLocalVariable(LocalVariableBinding binding, ASTNode loc
arguments,
nodeSourceStart(binding, location),
nodeSourceEnd(binding, location));
-
+
}
}
private boolean methodHasMissingSwitchDefault() {
@@ -9488,7 +9488,7 @@ private boolean methodHasMissingSwitchDefault() {
} else if (this.referenceContext instanceof AbstractMethodDeclaration) {
methodScope = ((AbstractMethodDeclaration)this.referenceContext).scope;
}
- return methodScope != null && methodScope.hasMissingSwitchDefault;
+ return methodScope != null && methodScope.hasMissingSwitchDefault;
}
public void unmatchedBracket(int position, ReferenceContext context, CompilationResult compilationResult) {
this.handle(
@@ -10007,19 +10007,19 @@ public void unusedLocalVariable(LocalDeclaration localDecl) {
}
public void unusedObjectAllocation(AllocationExpression allocationExpression) {
this.handle(
- IProblem.UnusedObjectAllocation,
- NoArgument,
- NoArgument,
- allocationExpression.sourceStart,
+ IProblem.UnusedObjectAllocation,
+ NoArgument,
+ NoArgument,
+ allocationExpression.sourceStart,
allocationExpression.sourceEnd);
}
public void unusedPrivateConstructor(ConstructorDeclaration constructorDecl) {
int severity = computeSeverity(IProblem.UnusedPrivateConstructor);
if (severity == ProblemSeverities.Ignore) return;
-
+
if (excludeDueToAnnotation(constructorDecl.annotations, IProblem.UnusedPrivateConstructor)) return;
-
+
MethodBinding constructor = constructorDecl.binding;
this.handle(
IProblem.UnusedPrivateConstructor,
@@ -10120,7 +10120,7 @@ public void unusedPrivateMethod(AbstractMethodDeclaration methodDecl) {
return;
}
if (excludeDueToAnnotation(methodDecl.annotations, IProblem.UnusedPrivateMethod)) return;
-
+
this.handle(
IProblem.UnusedPrivateMethod,
new String[] {
@@ -10278,7 +10278,7 @@ public void illegalUseOfUnderscoreAsAnIdentifier(int sourceStart, int sourceEnd,
sourceStart,
sourceEnd);
} finally {
- this.underScoreIsError = false;
+ this.underScoreIsError = false;
}
}
public void varargsArgumentNeedCast(MethodBinding method, TypeBinding argumentType, InvocationSite location) {
@@ -10349,7 +10349,7 @@ public void varargsConflict(MethodBinding method1, MethodBinding method2, Source
TypeBinding.equalsEquals(method1.declaringClass, type) ? method1.sourceEnd() : type.sourceEnd());
}
public void safeVarargsOnFixedArityMethod(MethodBinding method) {
- String [] arguments = new String[] { new String(method.isConstructor() ? method.declaringClass.shortReadableName() : method.selector)};
+ String [] arguments = new String[] { new String(method.isConstructor() ? method.declaringClass.shortReadableName() : method.selector)};
this.handle(
IProblem.SafeVarargsOnFixedArityMethod,
arguments,
@@ -10358,7 +10358,7 @@ public void safeVarargsOnFixedArityMethod(MethodBinding method) {
method.sourceEnd());
}
public void safeVarargsOnNonFinalInstanceMethod(MethodBinding method) {
- String [] arguments = new String[] { new String(method.isConstructor() ? method.declaringClass.shortReadableName() : method.selector)};
+ String [] arguments = new String[] { new String(method.isConstructor() ? method.declaringClass.shortReadableName() : method.selector)};
this.handle(
IProblem.SafeVarargsOnNonFinalInstanceMethod,
arguments,
@@ -10633,7 +10633,7 @@ public void cannotInferElidedTypes(AllocationExpression allocationExpression) {
IProblem.CannotInferElidedTypes,
arguments,
arguments,
- allocationExpression.sourceStart,
+ allocationExpression.sourceStart,
allocationExpression.sourceEnd);
}
public void diamondNotWithExplicitTypeArguments(TypeReference[] typeArguments) {
@@ -10641,7 +10641,7 @@ public void diamondNotWithExplicitTypeArguments(TypeReference[] typeArguments) {
IProblem.CannotUseDiamondWithExplicitTypeArguments,
NoArgument,
NoArgument,
- typeArguments[0].sourceStart,
+ typeArguments[0].sourceStart,
typeArguments[typeArguments.length - 1].sourceEnd);
}
public void rawConstructorReferenceNotWithExplicitTypeArguments(TypeReference[] typeArguments) {
@@ -10649,7 +10649,7 @@ public void rawConstructorReferenceNotWithExplicitTypeArguments(TypeReference[]
IProblem.IllegalTypeArgumentsInRawConstructorReference,
NoArgument,
NoArgument,
- typeArguments[0].sourceStart,
+ typeArguments[0].sourceStart,
typeArguments[typeArguments.length - 1].sourceEnd);
}
public void diamondNotWithAnoymousClasses(TypeReference type) {
@@ -10657,7 +10657,7 @@ public void diamondNotWithAnoymousClasses(TypeReference type) {
IProblem.CannotUseDiamondWithAnonymousClasses,
NoArgument,
NoArgument,
- type.sourceStart,
+ type.sourceStart,
type.sourceEnd);
}
public void anonymousDiamondWithNonDenotableTypeArguments(TypeReference type, TypeBinding tb) {
@@ -10665,7 +10665,7 @@ public void anonymousDiamondWithNonDenotableTypeArguments(TypeReference type, Ty
IProblem.NonDenotableTypeArgumentForAnonymousDiamond,
new String[]{new String(tb.leafComponentType().shortReadableName()), type.toString()},
new String[]{new String(tb.leafComponentType().shortReadableName()), type.toString()},
- type.sourceStart,
+ type.sourceStart,
type.sourceEnd);
}
public void redundantSpecificationOfTypeArguments(ASTNode location, TypeBinding[] argumentTypes) {
@@ -10731,7 +10731,7 @@ public void explicitlyClosedAutoCloseable(FakedTrackingVariable trackVar) {
args,
args,
trackVar.sourceStart,
- trackVar.sourceEnd);
+ trackVar.sourceEnd);
}
public void nullityMismatch(Expression expression, TypeBinding providedType, TypeBinding requiredType, int nullStatus, char[][] annotationName) {
@@ -10750,7 +10750,7 @@ public void nullityMismatch(Expression expression, TypeBinding providedType, Typ
if (var == null && expression instanceof Reference) {
var = ((Reference)expression).lastFieldBinding();
}
- if(var != null && var.type.isFreeTypeVariable()) {
+ if(var != null && var.type.isFreeTypeVariable()) {
nullityMismatchVariableIsFreeTypeVariable(var, expression);
return;
}
@@ -10791,7 +10791,7 @@ public void nullityMismatchIsNull(Expression expression, TypeBinding requiredTyp
argumentsShort = new String[] { new String(requiredType.sourceName()) };
} else {
arguments = new String[] { new String(requiredType.nullAnnotatedReadableName(this.options, false)) };
- argumentsShort = new String[] { new String(requiredType.nullAnnotatedReadableName(this.options, true)) };
+ argumentsShort = new String[] { new String(requiredType.nullAnnotatedReadableName(this.options, true)) };
}
}
this.handle(problemId, arguments, argumentsShort, expression.sourceStart, expression.sourceEnd);
@@ -11147,7 +11147,7 @@ public void roleFileMustDeclareOneType(CompilationUnitDeclaration roleUnit) {
public void roleFileMismatchingName(CompilationUnitDeclaration cud, TypeDeclaration roFiType) {
String[] args = new String[] {
new String(cud.getFileName()),
- new String(roFiType.name)
+ new String(roFiType.name)
};
this.handle(IProblem.RoleFileMismatchingName, args, args, roFiType.sourceStart, roFiType.sourceEnd);
}
@@ -11634,15 +11634,15 @@ public void illegalBaseImportNoAspectBinding(ImportReference ref, String project
}
public void baseImportFromSplitPackage(ImportReference ref, String expectedPlugin) {
- String[] args = {
+ String[] args = {
new String(CharOperation.concatWith(ref.tokens, '.')),
- expectedPlugin
+ expectedPlugin
};
this.handle(
- expectedPlugin.charAt(0) == '['
- ? IProblem.BaseImportFromSplitPackagePlural
+ expectedPlugin.charAt(0) == '['
+ ? IProblem.BaseImportFromSplitPackagePlural
: IProblem.BaseImportFromSplitPackage,
- args, args,
+ args, args,
ProblemSeverities.Warning,
ref.sourceStart, ref.sourceEnd);
}
@@ -11669,7 +11669,7 @@ public void ambiguousUpcastOrLowering(ASTNode location, TypeBinding expectedType
String[] args = { String.valueOf(providedType.readableName()),
String.valueOf(expectedType.readableName()),
String.valueOf(providedType.baseclass().readableName()) };
- this.handle(IProblem.AmbiguousUpcastOrLowering, args, args, location.sourceStart, location.sourceEnd);
+ this.handle(IProblem.AmbiguousUpcastOrLowering, args, args, location.sourceStart, location.sourceEnd);
}
//-- 2.3 --
public void noDefaultCtorInBoundRole(MessageSend send, MethodBinding binding) {
@@ -11733,7 +11733,7 @@ public void fieldInRoleWithInstantiationPolicy(ReferenceBinding typeBinding, Fie
int severity = 0;
switch (instantiationPolicy) {
case ONDEMAND: break; // no problem
- case ALWAYS:
+ case ALWAYS:
problemId = IProblem.FieldInRoleWithInstantiationPolicy;
severity = ProblemSeverities.Warning;
break;
@@ -12052,7 +12052,7 @@ public void abstractPotentiallyRelevantRole(RoleModel role, TeamModel teamModel)
TypeDeclaration typeDecl = role.getAst();
if (typeDecl == null)
typeDecl = teamModel.getAst();
- this.referenceContext = typeDecl;
+ this.referenceContext = typeDecl;
teamModel.tagBits |= TeamModel.HasAbstractRelevantRole;
String[] args = new String[] {
new String(teamModel.getBinding().sourceName()),
@@ -12070,7 +12070,7 @@ public void abstractRelevantRole(RoleModel role, TeamModel teamModel) {
TypeDeclaration typeDecl = role.getAst();
if (typeDecl == null)
typeDecl = teamModel.getAst();
- this.referenceContext = typeDecl;
+ this.referenceContext = typeDecl;
String[] args = new String[] {
new String(teamModel.getBinding().sourceName()),
new String(role.getBinding().sourceName())
@@ -12227,7 +12227,7 @@ public void callinCalloutUndeclaredException(
public void callinToCtorMustBeAfter(MethodSpec methodSpec, MethodBinding baseMethod) {
String[] args = new String[] {
- String.valueOf(baseMethod.readableName())
+ String.valueOf(baseMethod.readableName())
};
this.handle(IProblem.CallinToConstructorMustUseAfter, args, args, methodSpec.sourceStart, methodSpec.sourceEnd);
}
@@ -12497,22 +12497,22 @@ public void boundMethodProblem (MethodSpec spec, ReferenceBinding type, boolean
spec.sourceStart,
spec.sourceEnd);
return;
- case ProblemReasons.ParameterizedMethodTypeMismatch:
+ case ProblemReasons.ParameterizedMethodTypeMismatch:
code = IProblem.ParameterizedMethodArgumentTypeMismatch;
ProblemMethodBinding method = (ProblemMethodBinding) spec.resolvedMethod;
- shownMethod = method.closestMatch;
+ shownMethod = method.closestMatch;
args = new String[] {
new String(shownMethod.selector),
typesAsString(shownMethod, shownMethod.getSourceParameters(), false),
new String(shownMethod.declaringClass.readableName()),
typesAsString(((ParameterizedGenericMethodBinding)shownMethod).typeArguments, false),
- typesAsString(method, method.getSourceParameters(), false)
+ typesAsString(method, method.getSourceParameters(), false)
};
break;
}
}
if (code == -1) {
- String[] msgs = new String[] {"unexpected problem reason "+problemId }; //$NON-NLS-1$
+ String[] msgs = new String[] {"unexpected problem reason "+problemId }; //$NON-NLS-1$
this.handle(IProblem.MissingImplementation, msgs, msgs, spec.declarationSourceStart, spec.declarationSourceEnd);
} else {
this.handle(code, args, args, spec.declarationSourceStart, spec.declarationSourceEnd);
@@ -12631,7 +12631,7 @@ public void inferredCalloutInCompoundAssignment(ASTNode location, char[] fieldNa
public void calloutToEnclosing(CalloutMappingDeclaration mapping, RoleModel role) {
String[] args = { String.valueOf(role.getBinding().readableName()),
String.valueOf(role.getBaseTypeBinding().readableName()) };
- this.handle(IProblem.CalloutToEnclosing, args, args, mapping.sourceStart, mapping.sourceEnd);
+ this.handle(IProblem.CalloutToEnclosing, args, args, mapping.sourceStart, mapping.sourceEnd);
}
// -- 3.2 --
public void unusedParamMap(
@@ -13437,7 +13437,7 @@ public void ignoringRoleMethodReturn(MethodSpec roleMethodSpec) {
IProblem.IgnoringRoleMethodReturn,
args,
args,
- start,
+ start,
end);
}
@@ -13507,9 +13507,9 @@ public void baseArgInNonSimpleExpression(SingleNameReference nameRef) {
nameRef.sourceEnd);
}
public void illegalBindingDirectionNonReplaceCallin(ParameterMapping mapping) {
- this.handle(IProblem.IllegalBindingDirectionNonReplaceCallin,
- NoArgument, NoArgument,
- mapping.sourceStart,
+ this.handle(IProblem.IllegalBindingDirectionNonReplaceCallin,
+ NoArgument, NoArgument,
+ mapping.sourceStart,
mapping.sourceEnd);
}
// -- 4.5 --
@@ -13671,14 +13671,14 @@ public void mismatchingAfterInPrecedence(NameReference name, boolean precedenceI
CallinCalloutBinding binding = (CallinCalloutBinding) name.binding;
String[] args = new String[] { CallinMappingDeclaration.callinModifier(binding.callinModifier) };
this.handle(
- IProblem.NonAfterCallinInAfterPrecedence,
+ IProblem.NonAfterCallinInAfterPrecedence,
args,
args,
name.sourceStart,
name.sourceEnd);
} else {
this.handle(
- IProblem.AfterCallinInNonAfterPrecedence,
+ IProblem.AfterCallinInNonAfterPrecedence,
NoArgument,
NoArgument,
name.sourceStart,
@@ -14079,9 +14079,9 @@ public void valueParamWrongPosition(TypeAnchorReference reference) {
}
public void syntaxErrorInRoleClassLiteral(Expression typeExpr) {
- this.handle(IProblem.SyntaxErrorSingleTypeReferenceExpected,
+ this.handle(IProblem.SyntaxErrorSingleTypeReferenceExpected,
NoArgument, NoArgument, typeExpr.sourceStart, typeExpr.sourceEnd);
-
+
}
// ==== LIMITATIONS: ====
public void unsupportedUseOfGenerics(ASTNode location) {
@@ -14456,7 +14456,7 @@ public void incompatibleWeavingScheme(BinaryTypeBinding type, WeavingScheme sche
}
public void callinBindingToInterface(AbstractMethodMappingDeclaration callinMapping, ReferenceBinding baseIfc) {
String[] args = { String.valueOf(baseIfc.readableName()) };
- this.handle(IProblem.CallinBindingToInterface, args, args, callinMapping.sourceStart, callinMapping.sourceEnd);
+ this.handle(IProblem.CallinBindingToInterface, args, args, callinMapping.sourceStart, callinMapping.sourceEnd);
}
public void otreCannotWeaveIntoJava8(TypeReference baseclassRef, ReferenceBinding baseclass, int major) {
this.handle(IProblem.OtreCannotWeaveIntoJava8,
@@ -14509,9 +14509,9 @@ public void migrateToWrongBase(Expression expression, TypeBinding providedType,
private void nullityMismatchIsFreeTypeVariable(TypeBinding providedType, int sourceStart, int sourceEnd) {
char[][] nullableName = this.options.nullableAnnotationName;
char[][] nonNullName = this.options.nonNullAnnotationName;
- String[] arguments = new String[] {
- new String(nonNullName[nonNullName.length-1]),
- new String(providedType.readableName()),
+ String[] arguments = new String[] {
+ new String(nonNullName[nonNullName.length-1]),
+ new String(providedType.readableName()),
new String(nullableName[nullableName.length-1])};
this.handle(IProblem.RequiredNonNullButProvidedFreeTypeVariable, arguments, arguments, sourceStart, sourceEnd);
}
@@ -14534,14 +14534,14 @@ public void illegalRedefinitionToNonNullParameter(Argument argument, ReferenceBi
}
if (inheritedAnnotationName == null) {
this.handle(
- IProblem.IllegalDefinitionToNonNullParameter,
+ IProblem.IllegalDefinitionToNonNullParameter,
new String[] { new String(argument.name), new String(declaringClass.readableName()) },
new String[] { new String(argument.name), new String(declaringClass.shortReadableName()) },
sourceStart,
argument.type.sourceEnd);
} else {
this.handle(
- IProblem.IllegalRedefinitionToNonNullParameter,
+ IProblem.IllegalRedefinitionToNonNullParameter,
new String[] { new String(argument.name), new String(declaringClass.readableName()), CharOperation.toString(inheritedAnnotationName)},
new String[] { new String(argument.name), new String(declaringClass.shortReadableName()), new String(inheritedAnnotationName[inheritedAnnotationName.length-1])},
sourceStart,
@@ -14550,7 +14550,7 @@ public void illegalRedefinitionToNonNullParameter(Argument argument, ReferenceBi
}
public void parameterLackingNullableAnnotation(Argument argument, ReferenceBinding declaringClass, char[][] inheritedAnnotationName) {
this.handle(
- IProblem.ParameterLackingNullableAnnotation,
+ IProblem.ParameterLackingNullableAnnotation,
new String[] { new String(declaringClass.readableName()), CharOperation.toString(inheritedAnnotationName)},
new String[] { new String(declaringClass.shortReadableName()), new String(inheritedAnnotationName[inheritedAnnotationName.length-1])},
argument.type.sourceStart,
@@ -14558,7 +14558,7 @@ public void parameterLackingNullableAnnotation(Argument argument, ReferenceBindi
}
public void parameterLackingNonnullAnnotation(Argument argument, ReferenceBinding declaringClass, char[][] inheritedAnnotationName) {
this.handle(
- IProblem.ParameterLackingNonNullAnnotation,
+ IProblem.ParameterLackingNonNullAnnotation,
new String[] { new String(declaringClass.readableName()), CharOperation.toString(inheritedAnnotationName)},
new String[] { new String(declaringClass.shortReadableName()), new String(inheritedAnnotationName[inheritedAnnotationName.length-1])},
argument.type.sourceStart,
@@ -14590,7 +14590,7 @@ public void illegalParameterRedefinition(Argument argument, ReferenceBinding dec
}
}
this.handle(
- IProblem.IllegalParameterNullityRedefinition,
+ IProblem.IllegalParameterNullityRedefinition,
new String[] { new String(argument.name), new String(declaringClass.readableName()), new String(inheritedParameter.nullAnnotatedReadableName(this.options, false)) },
new String[] { new String(argument.name), new String(declaringClass.shortReadableName()), new String(inheritedParameter.nullAnnotatedReadableName(this.options, true)) },
sourceStart,
@@ -14635,14 +14635,14 @@ public void illegalReturnRedefinition(AbstractMethodDeclaration abstractMethodDe
// 1.7-
returnType.append('@').append(CharOperation.concatWith(nonNullAnnotationName, '.'));
returnType.append(' ').append(inheritedReturnType.readableName());
-
+
returnTypeShort.append('@').append(nonNullAnnotationName[nonNullAnnotationName.length-1]);
returnTypeShort.append(' ').append(inheritedReturnType.shortReadableName());
}
String[] arguments = new String[] { methodSignature.toString(), returnType.toString() };
String[] argumentsShort = new String[] { shortSignature.toString(), returnTypeShort.toString() };
this.handle(
- problemId,
+ problemId,
arguments,
argumentsShort,
sourceStart,
@@ -14744,7 +14744,7 @@ public void cannotImplementIncompatibleNullness(ReferenceContext context, Method
}
}
String[] problemArguments = {
- showReturn
+ showReturn
? new String(currentMethod.returnType.nullAnnotatedReadableName(this.options, false))+' '
: "", //$NON-NLS-1$
new String(currentMethod.selector),
@@ -14753,7 +14753,7 @@ public void cannotImplementIncompatibleNullness(ReferenceContext context, Method
new String(inheritedMethod.declaringClass.readableName())
};
String[] messageArguments = {
- showReturn
+ showReturn
? new String(currentMethod.returnType.nullAnnotatedReadableName(this.options, true))+' '
: "", //$NON-NLS-1$
new String(currentMethod.selector),
@@ -14865,7 +14865,7 @@ public void contradictoryNullAnnotationsInferred(MethodBinding inferredMethod, i
typesAsString(inferredMethod, true, true)
};
this.handle(
- isFunctionalExpression ? IProblem.ContradictoryNullAnnotationsInferredFunctionType : IProblem.ContradictoryNullAnnotationsInferred,
+ isFunctionalExpression ? IProblem.ContradictoryNullAnnotationsInferredFunctionType : IProblem.ContradictoryNullAnnotationsInferred,
arguments, shortArguments, sourceStart, sourceEnd);
}
@@ -14920,7 +14920,7 @@ public void conflictingInheritedNullAnnotations(ASTNode location, boolean previo
public void illegalAnnotationForBaseType(TypeReference type, Annotation[] annotations, long nullAnnotationTagBit)
{
- int typeBit = (nullAnnotationTagBit == TagBits.AnnotationNullable)
+ int typeBit = (nullAnnotationTagBit == TagBits.AnnotationNullable)
? TypeIds.BitNullableAnnotation : TypeIds.BitNonNullAnnotation;
char[][] annotationNames = (nullAnnotationTagBit == TagBits.AnnotationNonNull)
? this.options.nonNullAnnotationName
@@ -14971,7 +14971,7 @@ String internalAnnotatedTypeName(char[] annotationName, char[] typeName, int dim
char[] fullName;
if (dims > 0) {
int plainLen = annotationName.length+typeName.length+2; // adding '@' and ' ' ...
- fullName = new char[plainLen+(2*dims)]; // ... and []*
+ fullName = new char[plainLen+(2*dims)]; // ... and []*
System.arraycopy(typeName, 0, fullName, 0, typeName.length);
fullName[typeName.length] = ' ';
fullName[typeName.length+1] = '@';
@@ -14981,7 +14981,7 @@ String internalAnnotatedTypeName(char[] annotationName, char[] typeName, int dim
fullName[plainLen+i+1] = ']';
}
} else {
- fullName = new char[annotationName.length+typeName.length+2]; // adding '@' and ' '
+ fullName = new char[annotationName.length+typeName.length+2]; // adding '@' and ' '
fullName[0] = '@';
System.arraycopy(annotationName, 0, fullName, 1, annotationName.length);
fullName[annotationName.length+1] = ' ';
@@ -15054,9 +15054,9 @@ public void illegalModifiers(int modifierSourceStart, int modifiersSourceEnd) {
public void arrayReferencePotentialNullReference(ArrayReference arrayReference) {
// TODO(stephan): merge with other expressions
this.handle(IProblem.ArrayReferencePotentialNullReference, NoArgument, NoArgument, arrayReference.sourceStart, arrayReference.sourceEnd);
-
+
}
-public void nullityMismatchingTypeAnnotation(Expression expression, TypeBinding providedType, TypeBinding requiredType, NullAnnotationMatching status)
+public void nullityMismatchingTypeAnnotation(Expression expression, TypeBinding providedType, TypeBinding requiredType, NullAnnotationMatching status)
{
if (providedType == requiredType) return; //$IDENTITY-COMPARISON$
@@ -15090,7 +15090,7 @@ public void nullityMismatchingTypeAnnotation(Expression expression, TypeBinding
String[] arguments;
String[] shortArguments;
-
+
int problemId = 0;
String superHint = null;
String superHintShort = null;
@@ -15150,10 +15150,10 @@ public void nullityMismatchTypeArgument(TypeBinding typeVariable, TypeBinding ty
String.valueOf(typeArgument.nullAnnotatedReadableName(this.options, true))
};
this.handle(
- IProblem.NullityMismatchTypeArgument,
- arguments,
- shortArguments,
- location.sourceStart,
+ IProblem.NullityMismatchTypeArgument,
+ arguments,
+ shortArguments,
+ location.sourceStart,
location.sourceEnd);
}
@@ -15171,10 +15171,10 @@ public void cannotRedefineTypeArgumentNullity(TypeBinding typeVariable, Binding
shortArguments[1] = String.valueOf(superElement.shortReadableName());
}
this.handle(
- IProblem.IllegalRedefinitionOfTypeVariable,
- arguments,
- shortArguments,
- location.sourceStart,
+ IProblem.IllegalRedefinitionOfTypeVariable,
+ arguments,
+ shortArguments,
+ location.sourceStart,
location.sourceEnd);
}
@@ -15195,7 +15195,7 @@ public void nonNullTypeVariableInUnannotatedBinary(LookupEnvironment environment
char[][] nonNullName = this.options.nonNullAnnotationName;
String shortNonNullName = String.valueOf(nonNullName[nonNullName.length-1]);
-
+
if (typeVariable.declaringElement instanceof ReferenceBinding) {
String[] arguments = new String[] {
shortNonNullName,
@@ -15206,7 +15206,7 @@ public void nonNullTypeVariableInUnannotatedBinary(LookupEnvironment environment
String.valueOf(declaringClass.nullAnnotatedReadableName(this.options, true)),
String.valueOf(declaringClass.original().shortReadableName()) };
this.handle(IProblem.NonNullTypeVariableFromLegacyMethod,
- arguments,
+ arguments,
shortArguments,
severity,
expression.sourceStart,
@@ -15224,11 +15224,11 @@ public void nonNullTypeVariableInUnannotatedBinary(LookupEnvironment environment
String.valueOf(substitution.nullAnnotatedReadableName(this.options, true)),
String.valueOf(declaringClass.original().shortReadableName()) };
this.handle(IProblem.NonNullMethodTypeVariableFromLegacyMethod,
- arguments,
- shortArguments,
+ arguments,
+ shortArguments,
severity,
expression.sourceStart,
- expression.sourceEnd);
+ expression.sourceEnd);
}
}
}
@@ -15437,7 +15437,7 @@ public void danglingReference(ReferenceExpression expression, TypeBinding receiv
buffer.append(new String(parameters[i].readableName()));
shortBuffer.append(new String(parameters[i].shortReadableName()));
}
-
+
int id = IProblem.DanglingReference;
this.handle(
id,
@@ -15461,7 +15461,7 @@ public void incompatibleReturnType(ReferenceExpression expression, MethodBinding
new String[] { new String(method.declaringClass.shortReadableName()), new String(returnType.shortReadableName())},
expression.sourceStart,
expression.sourceEnd);
-
+
} else {
StringBuffer buffer = new StringBuffer();
StringBuffer shortBuffer = new StringBuffer();
@@ -15490,7 +15490,7 @@ public void illegalSuperAccess(TypeBinding superType, TypeBinding directSuperTyp
}
if (directSuperType.problemId() != ProblemReasons.AttemptToBypassDirectSuper)
needImplementation(location);
- handle(IProblem.SuperAccessCannotBypassDirectSuper,
+ handle(IProblem.SuperAccessCannotBypassDirectSuper,
new String[] { String.valueOf(superType.readableName()), String.valueOf(directSuperType.readableName()) },
new String[] { String.valueOf(superType.shortReadableName()), String.valueOf(directSuperType.shortReadableName()) },
location.sourceStart,
@@ -15529,23 +15529,23 @@ public void genericInferenceProblem(String message, InvocationSite invocationSit
start = invocationSite.sourceStart();
end = invocationSite.sourceEnd();
}
- this.handle(IProblem.GenericInferenceError, args, args, severity|ProblemSeverities.InternalError, start, end);
+ this.handle(IProblem.GenericInferenceError, args, args, severity|ProblemSeverities.InternalError, start, end);
}
public void uninternedIdentityComparison(EqualExpression expr, TypeBinding lhs, TypeBinding rhs, CompilationUnitDeclaration unit) {
-
+
char [] lhsName = lhs.sourceName();
char [] rhsName = rhs.sourceName();
-
+
if (CharOperation.equals(lhsName, "VoidTypeBinding".toCharArray()) //$NON-NLS-1$
|| CharOperation.equals(lhsName, "NullTypeBinding".toCharArray()) //$NON-NLS-1$
|| CharOperation.equals(lhsName, "ProblemReferenceBinding".toCharArray())) //$NON-NLS-1$
return;
-
+
if (CharOperation.equals(rhsName, "VoidTypeBinding".toCharArray()) //$NON-NLS-1$
|| CharOperation.equals(rhsName, "NullTypeBinding".toCharArray()) //$NON-NLS-1$
|| CharOperation.equals(rhsName, "ProblemReferenceBinding".toCharArray())) //$NON-NLS-1$
return;
-
+
boolean[] validIdentityComparisonLines = unit.validIdentityComparisonLines;
if (validIdentityComparisonLines != null) {
int problemStartPosition = expr.left.sourceStart;
@@ -15556,7 +15556,7 @@ public void uninternedIdentityComparison(EqualExpression expr, TypeBinding lhs,
if (lineNumber <= validIdentityComparisonLines.length && validIdentityComparisonLines[lineNumber - 1])
return;
}
-
+
this.handle(
IProblem.UninternedIdentityComparison,
new String[] {
@@ -15577,7 +15577,7 @@ public void invalidTypeArguments(TypeReference[] typeReference) {
typeReference[typeReference.length - 1].sourceEnd);
}
public void invalidModule(ModuleReference ref) {
- this.handle(IProblem.UndefinedModule,
+ this.handle(IProblem.UndefinedModule,
NoArgument, new String[] { CharOperation.charToString(ref.moduleName) },
ref.sourceStart, ref.sourceEnd);
}
@@ -15607,28 +15607,28 @@ public void exportingForeignPackage(PackageVisibilityStatement ref, ModuleBindin
ref.pkgRef.sourceEnd);
}
public void duplicateModuleReference(int problem, ModuleReference ref) {
- this.handle(problem,
+ this.handle(problem,
NoArgument, new String[] { CharOperation.charToString(ref.moduleName) },
ref.sourceStart, ref.sourceEnd);
}
public void duplicateTypeReference(int problem, TypeReference ref) {
- this.handle(problem,
+ this.handle(problem,
NoArgument, new String[] { ref.toString() },
ref.sourceStart, ref.sourceEnd);
}
public void duplicateTypeReference(int problem, TypeReference ref1, TypeReference ref2) {
- this.handle(problem,
+ this.handle(problem,
NoArgument, new String[] { ref1.toString(), ref2.toString() },
ref1.sourceStart, ref2.sourceEnd);
}
public void duplicateResourceReference(Reference ref) {
- this.handle(IProblem.DuplicateResource,
+ this.handle(IProblem.DuplicateResource,
NoArgument, new String[] {ref.toString() },
ProblemSeverities.Warning,
ref.sourceStart, ref.sourceEnd);
}
public void cyclicModuleDependency(ModuleBinding binding, ModuleReference ref) {
- this.handle(IProblem.CyclicModuleDependency,
+ this.handle(IProblem.CyclicModuleDependency,
NoArgument, new String[] { CharOperation.charToString(binding.moduleName), CharOperation.charToString(ref.moduleName) },
ref.sourceStart, ref.sourceEnd);
}
@@ -15647,13 +15647,13 @@ public void unlikelyArgumentType(Expression argument, MethodBinding method, Type
new String(argumentType.readableName()),
new String(method.readableName()),
new String(receiverType.readableName())
- },
+ },
new String[] {
new String(argumentType.shortReadableName()),
new String(method.shortReadableName()),
new String(receiverType.shortReadableName())
- },
- argument.sourceStart,
+ },
+ argument.sourceStart,
argument.sourceEnd);
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfInteger.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfInteger.java
index 4c8165c74..2000a4411 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfInteger.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfInteger.java
@@ -136,7 +136,7 @@ public final class HashtableOfInteger {
}
this.keyTable[index] = intKey;
this.valueTable[index] = value;
-
+
// assumes the threshold is never equal to the size of the table
if (++this.elementSize > this.threshold) {
rehash();
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfModule.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfModule.java
index 5cd85c902..f382a76ff 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfModule.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfModule.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.util;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfObject.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfObject.java
index a30af491b..79d6dc5a0 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfObject.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfObject.java
@@ -136,7 +136,7 @@ public final class HashtableOfObject implements Cloneable {
}
this.keyTable[index] = key;
this.valueTable[index] = value;
-
+
// assumes the threshold is never equal to the size of the table
if (++this.elementSize > this.threshold) {
rehash();
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/JRTUtil.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/JRTUtil.java
index 5216b5941..2234ec89d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/JRTUtil.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/JRTUtil.java
@@ -70,7 +70,7 @@ public class JRTUtil {
public FileVisitResult visitFile(T file, T mod, BasicFileAttributes attrs) throws IOException;
/**
- * Invoked when a root directory of a module being visited. The element returned
+ * Invoked when a root directory of a module being visited. The element returned
* contains only the module name segment - e.g. "java.base". Clients can use this to control
* how the JRT needs to be processed, for e.g., clients can skip a particular module
* by returning FileVisitResult.SKIP_SUBTREE
@@ -83,17 +83,17 @@ public class JRTUtil {
public FileVisitResult preVisitDirectory(T dir, BasicFileAttributes attrs) throws IOException {
return FileVisitResult.CONTINUE;
}
-
+
@Override
public FileVisitResult visitFile(T file, BasicFileAttributes attrs) throws IOException {
return FileVisitResult.CONTINUE;
}
-
+
@Override
public FileVisitResult visitFileFailed(T file, IOException exc) throws IOException {
return FileVisitResult.CONTINUE;
}
-
+
@Override
public FileVisitResult postVisitDirectory(T dir, IOException exc) throws IOException {
return FileVisitResult.CONTINUE;
@@ -123,7 +123,7 @@ public class JRTUtil {
images.put(key, system = JrtFileSystem.getNewJrtFileSystem(image, release));
} catch (IOException e) {
e.printStackTrace();
- // Needs better error handling downstream? But for now, make sure
+ // Needs better error handling downstream? But for now, make sure
// a dummy JrtFileSystem is not created.
}
}
@@ -143,9 +143,9 @@ public class JRTUtil {
*
* The file system contains the following top level directories:
* /modules/$MODULE/$PATH
- * /packages/$PACKAGE/$MODULE
+ * /packages/$PACKAGE/$MODULE
* The latter provides quick look up of the module that contains a particular package. However,
- * this method only notifies its clients of the entries within the modules (latter) sub-directory.
+ * this method only notifies its clients of the entries within the modules (latter) sub-directory.
* Clients can decide which notifications they want to receive. See {@link JRTUtil#NOTIFY_ALL},
* {@link JRTUtil#NOTIFY_FILES}, {@link JRTUtil#NOTIFY_PACKAGES} and {@link JRTUtil#NOTIFY_MODULES}.
*
@@ -218,7 +218,7 @@ class JrtFileSystemWithOlderRelease extends JrtFileSystem {
*
* @param jrt the path to the root of the JRE whose libraries we are interested in.
* @param release the older release where classes and modules should be searched for.
- * @throws IOException
+ * @throws IOException
*/
JrtFileSystemWithOlderRelease(File jrt, String release) throws IOException {
super(jrt);
@@ -227,7 +227,7 @@ class JrtFileSystemWithOlderRelease extends JrtFileSystem {
}
@Override
void initialize(File jdk) throws IOException {
- // Just to make sure we don't do anything in super.initialize()
+ // Just to make sure we don't do anything in super.initialize()
// before setting this.release
}
void initialize(File jdk, String rel) throws IOException {
@@ -322,7 +322,7 @@ class JrtFileSystemWithOlderRelease extends JrtFileSystem {
}
}
}
-
+
}
class JrtFileSystem {
private final Map<String, String> packageToModule = new HashMap<String, String>();
@@ -333,16 +333,16 @@ class JrtFileSystem {
Path modRoot = null;
String jdkHome = null;
public static JrtFileSystem getNewJrtFileSystem(File jrt, String release) throws IOException {
- return (release == null) ? new JrtFileSystem(jrt) :
+ return (release == null) ? new JrtFileSystem(jrt) :
new JrtFileSystemWithOlderRelease(jrt, release);
-
+
}
/**
* The jrt file system is based on the location of the JRE home whose libraries
* need to be loaded.
*
* @param jrt the path to the root of the JRE whose libraries we are interested in.
- * @throws IOException
+ * @throws IOException
*/
JrtFileSystem(File jrt) throws IOException {
initialize(jrt);
@@ -547,7 +547,7 @@ class JrtFileSystem {
JRTUtil.MODULE_TO_LOAD.indexOf(mod.toString()) == -1)) {
return FileVisitResult.SKIP_SUBTREE;
}
- return ((notify & JRTUtil.NOTIFY_MODULES) == 0) ?
+ return ((notify & JRTUtil.NOTIFY_MODULES) == 0) ?
FileVisitResult.CONTINUE : visitor.visitModule(dir, JRTUtil.sanitizedFileName(mod));
}
if ((notify & JRTUtil.NOTIFY_PACKAGES) == 0) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/ManifestAnalyzer.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/ManifestAnalyzer.java
index eb72d852c..79119d373 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/ManifestAnalyzer.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/ManifestAnalyzer.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,13 +32,13 @@ public class ManifestAnalyzer {
"Class-Path:".toCharArray(); //$NON-NLS-1$
private int classpathSectionsCount;
private ArrayList calledFilesNames;
-
+
/**
* Analyzes the manifest contents. The given input stream is read using a UTF-8 encoded reader.
* If the contents of the input stream is not encoded using a UTF-8 encoding, the analysis will fail.
- *
+ *
* @param inputStream the given input stream.
- *
+ *
* @return <code>true</code> if the analysis is successful, <code>false</code> otherwise.
* @throws IOException if an exception occurs while analyzing the file
*/
@@ -49,9 +49,9 @@ public class ManifestAnalyzer {
/**
* Analyzes the manifest contents.
- *
+ *
* @param chars the content of the manifest
- *
+ *
* @return <code>true</code> if the analysis is successful, <code>false</code> otherwise.
*/
public boolean analyzeManifestContents(char[] chars) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/Sorting.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/Sorting.java
index 607b2f21d..ab351f5d4 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/Sorting.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/Sorting.java
@@ -38,7 +38,7 @@ public class Sorting {
ReferenceBinding[] unsorted = new ReferenceBinding[len];
ReferenceBinding[] sorted = new ReferenceBinding[len];
System.arraycopy(types, 0, unsorted, 0, len);
-
+
int o = 0;
for(int i=0; i<len; i++)
o = sort(unsorted, i, sorted, o);
@@ -123,6 +123,6 @@ public class Sorting {
public int compare(InferenceVariable iv1, InferenceVariable iv2) {
return iv1.rank - iv2.rank;
}
- });
+ });
}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/Util.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/Util.java
index 2a4b7a99d..432cba4a5 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/Util.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/Util.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
* daolaf@gmail.com - Contribution for bug 3292227
@@ -791,10 +791,10 @@ public class Util implements SuffixConstants {
}
return true; // it is neither a ".java" file nor a ".class" file, so this is a potential archive name
}
-
+
public static final int ZIP_FILE = 0;
public static final int JMOD_FILE = 1;
-
+
/**
* Returns the kind of archive this file is. The format is one of
* #ZIP_FILE or {@link #JMOD_FILE}
@@ -807,7 +807,7 @@ public class Util implements SuffixConstants {
return -1; // dot was before the last file separator, it cannot be a zip archive name
int length = name.length();
int extensionLength = length - lastDot - 1;
-
+
if (extensionLength == EXTENSION_java.length()) {
for (int i = extensionLength-1; i >=0; i--) {
if (Character.toLowerCase(name.charAt(length - extensionLength + i)) != EXTENSION_java.charAt(i)) {
@@ -1437,7 +1437,7 @@ public class Util implements SuffixConstants {
if (c != C_ARRAY) {
throw newIllegalArgumentException(string, start);
}
-
+
c = string[++start];
while(c == C_ARRAY) {
// need a minimum 2 char
@@ -1726,7 +1726,7 @@ public class Util implements SuffixConstants {
}
return true;
}
-
+
public static void appendEscapedChar(StringBuffer buffer, char c, boolean stringLiteral) {
switch (c) {
case '\b' :
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/ConfigHelper.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/ConfigHelper.java
index 316e6b0c2..c59da3fd8 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/ConfigHelper.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/ConfigHelper.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2009 Stephan Herrmann
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/IOTConstants.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/IOTConstants.java
index 2236f73fe..f0254107e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/IOTConstants.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/IOTConstants.java
@@ -182,7 +182,7 @@ public interface IOTConstants
// OTDYN uses just one method for both:
public static final char[] ADD_REMOVE_ROLE = (OT_DOLLAR + "addOrRemoveRole").toCharArray();
-
+
// predefined classes and interfaces:
public static final char[] ORG = "org".toCharArray();
public static final char[] OBJECTTEAMS = "objectteams".toCharArray();
@@ -232,16 +232,16 @@ public interface IOTConstants
public static final char[][] ROLE_CAST_EXCEPTION = {ORG, OBJECTTEAMS,
"RoleCastException".toCharArray()};
- /**
+ /**
* @since 3.7 (OT 2.0)
*/
public static final char[] INSTANTIATION = "Instantiation".toCharArray();
- /**
+ /**
* @since 3.7 (OT 2.0)
*/
public static final char[][] ORG_OBJECTTEAMS_INSTANTIATION = {ORG, OBJECTTEAMS,
INSTANTIATION};
-
+
public static final char[][] ILLEGAL_ROLE_CREATION_EXCEPTION = {ORG, OBJECTTEAMS,
"IllegalRoleCreationException".toCharArray()};
public static final char[][] ORG_OBJECTTEAMS_ITEAMMIGRATABLE = {ORG, OBJECTTEAMS,
@@ -251,8 +251,8 @@ public interface IOTConstants
"IBaseMigratable".toCharArray()};
public static final char[] MIGRATE_TO_BASE = "migrateToBase".toCharArray();
- public static final char[][] OTRE_INTERNAL_ERROR = new char[][]{"org".toCharArray(),
- "objectteams".toCharArray(),
+ public static final char[][] OTRE_INTERNAL_ERROR = new char[][]{"org".toCharArray(),
+ "objectteams".toCharArray(),
"OTREInternalError".toCharArray()};
/**
* @since 3.9 (OT 2.2)
@@ -312,7 +312,7 @@ public interface IOTConstants
public static final char[] QUERY_MODULE_SUFFIX = "_Queries__OT__".toCharArray();
// decapsulation accessor prefix:
public static final char[] OT_DECAPS = "_OT$decaps$".toCharArray();
-
+
// --------- for MethodBinding.otBits: --------------------------
/**
* have types been wrapped in the signature?
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/InferenceKind.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/InferenceKind.java
index 09580f3d8..7937ebbb6 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/InferenceKind.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/InferenceKind.java
@@ -20,25 +20,25 @@ package org.eclipse.objectteams.otdt.core.compiler;
/**
* Kinds to differentiate inferred callouts.
- *
+ *
* @author stephan
* @since 1.3.2
*/
-public enum InferenceKind {
+public enum InferenceKind {
/** Not an inferred callout */
NONE,
/** Callout inferred from a declared super interface. */
INTERFACE,
/** Callout inferred from a self call. */
- SELFCALL,
+ SELFCALL,
/** Callout inferred from a reading field access (via 'this'). */
- FIELDGET,
+ FIELDGET,
/** Callout inferred from a writing field access (via 'this'). */
FIELDSET;
- /**
+ /**
* Some inferred callouts generate private methods that are not advertised in the interface,
- * Answer if this callout binding is advertised in the interface.
+ * Answer if this callout binding is advertised in the interface.
*/
public boolean isAdvertisedInInterface() {
if (this == NONE || this == INTERFACE)
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/OTNameUtils.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/OTNameUtils.java
index 71d4ab92a..4b774a08f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/OTNameUtils.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/OTNameUtils.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2009 Stephan Herrmann
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: OTNameUtils.java 23417 2010-02-03 20:13:55Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -30,7 +30,7 @@ import static org.eclipse.objectteams.otdt.core.compiler.IOTConstants.TSUPER_OT_
import org.eclipse.jdt.core.compiler.CharOperation;
/**
- * API class providing various operations for special names in generated OT/J code.
+ * API class providing various operations for special names in generated OT/J code.
* @author stephan
* @since 1.3.2
*/
@@ -39,7 +39,7 @@ public class OTNameUtils {
// for inferred callout to field:
private static final char[] SET = "set".toCharArray(); //$NON-NLS-1$
private static final char[] GET = "get".toCharArray(); //$NON-NLS-1$
-
+
/**
* Is selector the name of a predicate method?
*/
@@ -70,10 +70,10 @@ public class OTNameUtils {
return strippedName;
}
- /**
+ /**
* Given a fieldName (e.g. val) construct an accessor method name (getVal, or setVal) for inferred callout.
* @param isSetter asking for a "set" accessor?
- * @param fieldName
+ * @param fieldName
*/
public static char[] accessorName(boolean isSetter, char[] fieldName) {
if (fieldName == null)
@@ -84,10 +84,10 @@ public class OTNameUtils {
char[] prefix = isSetter ? OTNameUtils.SET : OTNameUtils.GET;
return CharOperation.concat(prefix, capitalized);
}
- /**
+ /**
* Given a fieldName (e.g. val) construct an accessor method name (getVal, or setVal) for inferred callout.
* @param isSetter asking for a "set" accessor?
- * @param fieldName
+ * @param fieldName
* @since 3.10 OT 2.3
*/
public static String accessorName(boolean isSetter, String fieldName) {
@@ -96,7 +96,7 @@ public class OTNameUtils {
int len = fieldName.length();
char[] accessor = new char[3+len];
System.arraycopy(isSetter ? OTNameUtils.SET : OTNameUtils.GET, 0, accessor, 0, 3);
- accessor[3] = Character.toUpperCase(fieldName.charAt(0));
+ accessor[3] = Character.toUpperCase(fieldName.charAt(0));
fieldName.getChars(1, len, accessor, 4);
return String.valueOf(accessor);
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/Pair.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/Pair.java
index f73e910b5..6d21dfa07 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/Pair.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/Pair.java
@@ -20,10 +20,10 @@ package org.eclipse.objectteams.otdt.core.compiler;
/**
* Simple pair structure.
- *
+ *
* @author stephan
* @since 0.9.27
- *
+ *
* @param <T1> type of the first element
* @param <T2> type of the second element
*/
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/exceptions/InternalCompilerError.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/exceptions/InternalCompilerError.java
index 10326d5dc..80edeac7b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/exceptions/InternalCompilerError.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/exceptions/InternalCompilerError.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: InternalCompilerError.java 23416 2010-02-03 19:59:31Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -32,33 +32,33 @@ public class InternalCompilerError extends Error
{
super();
}
-
+
public InternalCompilerError(String message)
{
super(message);
}
-
+
public InternalCompilerError(String message, Throwable cause)
{
super(message, cause);
}
-
+
private static final String INTRO = new String(
"You discovered a bug in the Object Teams Development Tooling." + (char)Character.LINE_SEPARATOR + //$NON-NLS-1$
"Please consider filing a bug including this stacktrace and a description how to reproduce at https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Objectteams" + (char)Character.LINE_SEPARATOR + //$NON-NLS-1$
"Thank you -- the OTDT Development Team." + (char)Character.LINE_SEPARATOR); //$NON-NLS-1$
-
+
@Override
public String getMessage()
{
return INTRO + super.getMessage();
}
-
+
public static void log(String message)
{
new InternalCompilerError(message).printStackTrace(System.out);
}
-
+
public static void log(String message, Throwable cause)
{
new InternalCompilerError(message, cause).printStackTrace(System.out);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/AbstractMethodMappingDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/AbstractMethodMappingDeclaration.java
index a45afa671..70b7579a8 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/AbstractMethodMappingDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/AbstractMethodMappingDeclaration.java
@@ -183,7 +183,7 @@ public abstract class AbstractMethodMappingDeclaration
{
this.ignoreFurtherInvestigation = true;
}
-
+
@Override
public void tagAsHavingIgnoredMandatoryErrors(int problemId) {
// nothing here
@@ -363,9 +363,9 @@ public abstract class AbstractMethodMappingDeclaration
try {
for (int i = 0; i < baseMethodSpecs.length; i++) {
MethodSpec methodSpec = baseMethodSpecs[i];
-
+
methodSpec.resolveFeatureWithArgMapping(baseType, this.scope, /*isBaseSide*/true, /*callinExpected*/false, /*allowEnclosing*/false);
-
+
if (!methodSpec.isValid()) {
if ( methodSpec.problemId() == ProblemReasons.NotVisible
&& canAccessInvisibleBase())
@@ -601,7 +601,7 @@ public abstract class AbstractMethodMappingDeclaration
for (ParameterMapping mapping : this.mappings)
if (mapping.direction == TerminalTokens.TokenNameBINDIN) // ident <- expr
mapping.expression.traverse(new BaseScopeMarker(), this.scope);
-
+
// check 4.4(c) - sentence 2:
if (isCallin() && !isReplaceCallin())
for (ParameterMapping mapping : this.mappings)
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/BaseAllocationExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/BaseAllocationExpression.java
index f50c08426..ca509a9f7 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/BaseAllocationExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/BaseAllocationExpression.java
@@ -142,7 +142,7 @@ public class BaseAllocationExpression extends Assignment {
if (!isArgOfOtherCtor(enclCtor, scope))
scope.problemReporter().baseConstructorExpressionOutsideCtorCall(this);
} else {
- if (enclCtor.statements[0] != this)
+ if (enclCtor.statements[0] != this)
scope.problemReporter().baseConstructorCallIsNotFirst(this);
}
@@ -313,7 +313,7 @@ public class BaseAllocationExpression extends Assignment {
TypeBinding.INT,
scope.createArrayType(scope.getJavaLangObject(), 1),
scope.getOrgObjectteamsITeam()
- },
+ },
Binding.NO_EXCEPTIONS,
(ReferenceBinding) baseclass);
allocSend.binding.returnType = scope.getJavaLangObject();
@@ -329,7 +329,7 @@ public class BaseAllocationExpression extends Assignment {
IntLiteral opKindLiteral = gen.intLiteral(0);
opKindLiteral.resolveType(scope);
-
+
Expression[] boxedArgs = null;
if (arguments != null) {
boxedArgs = new Expression[arguments.length];
@@ -348,7 +348,7 @@ public class BaseAllocationExpression extends Assignment {
boxedArgs[i] = argument;
}
}
- ArrayAllocationExpression packedArgs = gen.arrayAllocation(gen.qualifiedTypeReference(TypeConstants.JAVA_LANG_OBJECT),
+ ArrayAllocationExpression packedArgs = gen.arrayAllocation(gen.qualifiedTypeReference(TypeConstants.JAVA_LANG_OBJECT),
boxedArgs != null ? 1 : 0, boxedArgs); // arguments are already resolved at this point
ArrayBinding objectArray = scope.createArrayType(scope.getJavaLangObject(), 1);
if (packedArgs.initializer != null)
@@ -360,7 +360,7 @@ public class BaseAllocationExpression extends Assignment {
Reference teamReference = gen.qualifiedThisReference(scope.enclosingSourceType().enclosingType());
teamReference.resolveType(scope);
-
+
return new Expression[] { accessIdLiteral, opKindLiteral, packedArgs, teamReference };
}
@@ -489,7 +489,7 @@ public class BaseAllocationExpression extends Assignment {
return super.resolveType(scope);
return null;
}
-
+
@Override
public void computeConversion(Scope scope, TypeBinding runtimeType, TypeBinding compileTimeType) {
if (this.isExpression)
@@ -505,7 +505,7 @@ public class BaseAllocationExpression extends Assignment {
else
super.generateCode(currentScope, codeStream, valueRequired);
}
-
+
@Override
public String toString() {
if (this.expression == null)
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/BaseCallMessageSend.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/BaseCallMessageSend.java
index 54d377c3c..7a641be6d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/BaseCallMessageSend.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/BaseCallMessageSend.java
@@ -221,7 +221,7 @@ public class BaseCallMessageSend extends AbstractExpressionWrapper
// receiver:
ReferenceBinding roleType = scope.enclosingSourceType();
this._receiver.adjustReceiver(roleType, isStatic, callinMethodDecl, gen, weavingScheme);
-
+
// empty base call surrogate is handled using a synthetic base call surrogate:
boolean isCallinBound = SyntheticBaseCallSurrogate.isCallinMethodBoundIn(callinMethodBinding, callinMethodBinding.declaringClass);
@@ -230,7 +230,7 @@ public class BaseCallMessageSend extends AbstractExpressionWrapper
resolveSyntheticBaseCallSurrogate(callinMethodDecl, scope, weavingScheme);
return this.resolvedType;
}
-
+
// selector:
if (weavingScheme == WeavingScheme.OTDRE) {
wrappedSend.selector = CallinImplementorDyn.OT_CALL_NEXT;
@@ -291,8 +291,8 @@ public class BaseCallMessageSend extends AbstractExpressionWrapper
}
/* manual resolve for an empty base call surrogate, which is indeed generated by the compiler, not the OTRE. */
- private void resolveSyntheticBaseCallSurrogate(MethodDeclaration callinMethodDecl, BlockScope scope, WeavingScheme weavingScheme)
- {
+ private void resolveSyntheticBaseCallSurrogate(MethodDeclaration callinMethodDecl, BlockScope scope, WeavingScheme weavingScheme)
+ {
// find the method:
MethodBinding callinMethod = callinMethodDecl.binding;
if (callinMethod == null) {
@@ -307,7 +307,7 @@ public class BaseCallMessageSend extends AbstractExpressionWrapper
// find the receiver type:
this._receiver.resolve(scope);
int depth = 0;
- while (this._receiver.resolvedType.isLocalType()) {
+ while (this._receiver.resolvedType.isLocalType()) {
this._receiver.resolvedType = this._receiver.resolvedType.enclosingType();
depth++;
}
@@ -321,7 +321,7 @@ public class BaseCallMessageSend extends AbstractExpressionWrapper
TypeBinding[] sendparams = new TypeBinding[this._sendOrig.arguments.length];
for (int i=0; i<sendparams.length; i++)
sendparams[i] = this._sendOrig.arguments[i].resolveType(scope);
-
+
// check arguments:
int sourceArgsLen = 0;
if (this.sourceArgs != null)
@@ -348,9 +348,9 @@ public class BaseCallMessageSend extends AbstractExpressionWrapper
}
}
}
-
+
// create and link the synthetic method binding:
- MethodBinding surrogate = null;
+ MethodBinding surrogate = null;
MethodModel model = callinMethod.model;
if (model != null)
surrogate = model.getBaseCallSurrogate();
@@ -373,10 +373,10 @@ public class BaseCallMessageSend extends AbstractExpressionWrapper
@Override
public void computeConversion(Scope scope, TypeBinding runtimeTimeType, TypeBinding compileTimeType) {
- if ( this._sendOrig.binding instanceof SyntheticBaseCallSurrogate
+ if ( this._sendOrig.binding instanceof SyntheticBaseCallSurrogate
&& this._sendOrig == this._wrappee // otherwise wrappee contains conversion
&& this.resolvedType.isBaseType()
- && this.resolvedType != TypeBinding.VOID)
+ && this.resolvedType != TypeBinding.VOID)
{
ReferenceBinding boxType = (ReferenceBinding) scope.getType(AstGenerator.boxTypeName((BaseTypeBinding) this.resolvedType), 3);
this._sendOrig.valueCast = boxType; // triggers insertion of checkcast to boxType
@@ -384,13 +384,13 @@ public class BaseCallMessageSend extends AbstractExpressionWrapper
}
super.computeConversion(scope, runtimeTimeType, compileTimeType);
}
-
+
private MethodDeclaration getEnclosingCallinMethod(Scope scope) {
if (this.enclosingCallinMethod == null)
this.enclosingCallinMethod = findEnclosingCallinMethod(scope, this);
return this.enclosingCallinMethod;
}
-
+
public static MethodDeclaration findEnclosingCallinMethod(Scope scope, ASTNode errorLocation) { // errorLocation == null => don't report
AbstractMethodDeclaration methodDecl = null;
MethodScope methodScope = scope.methodScope();
@@ -404,7 +404,7 @@ public class BaseCallMessageSend extends AbstractExpressionWrapper
}
if (errorLocation != null) {
if (methodDecl == null) {
- scope.problemReporter().baseCallOutsideMethod(errorLocation);
+ scope.problemReporter().baseCallOutsideMethod(errorLocation);
} else {
scope.problemReporter().basecallInRegularMethod(errorLocation, methodDecl);
}
@@ -467,9 +467,9 @@ public class BaseCallMessageSend extends AbstractExpressionWrapper
* <li>static callin method
* <li>containing a lambda
* <li>containing a base call
- * </ul>
+ * </ul>
* In this structure the base call (_OT$callNext()) needs to tunnel the call target
- * (team instance) through yet another synthetic argument.
+ * (team instance) through yet another synthetic argument.
*/
public static void lambdaCapture(LambdaExpression lambda, BlockScope currentScope) {
if (currentScope.compilerOptions().weavingScheme != WeavingScheme.OTDRE)
@@ -477,7 +477,7 @@ public class BaseCallMessageSend extends AbstractExpressionWrapper
MethodScope methodScope = currentScope.methodScope();
if (methodScope == null || methodScope.extraSyntheticArguments == null)
return;
- SyntheticArgumentBinding[] extraSyntheticArguments = methodScope.extraSyntheticArguments;
+ SyntheticArgumentBinding[] extraSyntheticArguments = methodScope.extraSyntheticArguments;
ASTVisitor findBaseCalls = new ASTVisitor() {
@Override
public boolean visit(BaseCallMessageSend messageSend, BlockScope scope) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/CallinMappingDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/CallinMappingDeclaration.java
index 112d7c558..d777cc9e4 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/CallinMappingDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/CallinMappingDeclaration.java
@@ -266,7 +266,7 @@ public class CallinMappingDeclaration extends AbstractMethodMappingDeclaration
if (baseMethod.isConstructor()) {
if (this.callinModifier != TokenNameafter) {
this.scope.problemReporter().callinToCtorMustBeAfter(this.baseMethodSpecs[i], baseMethod);
- this.binding.tagBits |= TagBits.HasMappingIncompatibility;
+ this.binding.tagBits |= TagBits.HasMappingIncompatibility;
}
}
}
@@ -293,7 +293,7 @@ public class CallinMappingDeclaration extends AbstractMethodMappingDeclaration
return false;
} else {
// before modifying the parameters array copy it:
- System.arraycopy(this.roleMethodSpec.parameters, 0,
+ System.arraycopy(this.roleMethodSpec.parameters, 0,
this.roleMethodSpec.parameters = new TypeBinding[roleParams.length], 0,
roleParams.length);
for (int j = 0; j < roleParams.length; j++) {
@@ -362,7 +362,7 @@ public class CallinMappingDeclaration extends AbstractMethodMappingDeclaration
methodSpec.argNeedsTranslation[j] = true;
this.roleMethodSpec.argNeedsTranslation[j] = true;
this.roleMethodSpec.parameters[j] = roleToLiftTo; // this applies to all bindings
-
+
// still need to check for ambiguity/abstract role:
ReferenceBinding enclosingTeam = this.scope.enclosingSourceType().enclosingType();
int iProblem = enclosingTeam.getTeamModel().canLiftingFail((ReferenceBinding)roleToLiftTo.leafComponentType());
@@ -462,7 +462,7 @@ public class CallinMappingDeclaration extends AbstractMethodMappingDeclaration
break;
}
}
- }
+ }
}
}
TypeVariableBinding returnVariable= MethodModel.checkedGetReturnTypeVariable(this.roleMethodSpec.resolvedMethod);
@@ -609,7 +609,7 @@ public class CallinMappingDeclaration extends AbstractMethodMappingDeclaration
}
}
}
-
+
private boolean typeUsesTypeVariable(TypeBinding type, TypeBinding variable) {
if (TypeBinding.equalsEquals(type.leafComponentType(), variable))
return true;
@@ -644,11 +644,11 @@ public class CallinMappingDeclaration extends AbstractMethodMappingDeclaration
}
/** Check details that require analyseCode() of methods to be finished: */
- public void analyseDetails(TypeDeclaration roleClass, WeavingScheme weavingScheme)
- {
+ public void analyseDetails(TypeDeclaration roleClass, WeavingScheme weavingScheme)
+ {
// check validity of base-super call
if ( this.roleMethodSpec.isValid()
- && MethodModel.hasCallinFlag(this.roleMethodSpec.resolvedMethod, CALLIN_FLAG_BASE_SUPER_CALL))
+ && MethodModel.hasCallinFlag(this.roleMethodSpec.resolvedMethod, CALLIN_FLAG_BASE_SUPER_CALL))
{
for (int i = 0; i < this.baseMethodSpecs.length; i++) {
MethodBinding baseMethod = this.baseMethodSpecs[i].resolvedMethod;
@@ -663,7 +663,7 @@ public class CallinMappingDeclaration extends AbstractMethodMappingDeclaration
}
// check whether a base result is missing
if ( this.baseMethodNeedingResultFromBasecall != null
- && !this.isResultMapped)
+ && !this.isResultMapped)
{
if (MethodModel.hasCallinFlag(this.roleMethodSpec.resolvedMethod, CALLIN_FLAG_DEFINITELY_MISSING_BASECALL))
{
@@ -967,7 +967,7 @@ public class CallinMappingDeclaration extends AbstractMethodMappingDeclaration
}
/**
- * Answer the name of the role that introduced this callin mapping
+ * Answer the name of the role that introduced this callin mapping
* (support for overriding in otredyn).
*/
public char[] declaringRoleName() {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/FieldAccessSpec.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/FieldAccessSpec.java
index ac158341d..439d48d4e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/FieldAccessSpec.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/FieldAccessSpec.java
@@ -146,7 +146,7 @@ public class FieldAccessSpec extends MethodSpec {
}
} else if (baseType.isTeam()) {
// base class is a team, construct simple anchor
-
+
ReferenceBinding enclRole = scope.enclosingSourceType();
newAnchor = TypeAnalyzer.findField(enclRole, IOTConstants._OT_BASE, /*don't check static*/false, /*outer*/false);
} // else fieldLeafType might already be a anchored type,
@@ -161,7 +161,7 @@ public class FieldAccessSpec extends MethodSpec {
}
if ( !baseType.isRole()
- && this.resolvedField.canBeSeenBy(scope.enclosingReceiverType().baseclass(), this, scope))
+ && this.resolvedField.canBeSeenBy(scope.enclosingReceiverType().baseclass(), this, scope))
{
// no accessor method needed
this.implementationStrategy = ImplementationStrategy.DIRECT;
@@ -432,7 +432,7 @@ public class FieldAccessSpec extends MethodSpec {
}
@Override
- public int createAccessAttribute(RoleModel roleModel) {
+ public int createAccessAttribute(RoleModel roleModel) {
return roleModel.addAccessedBaseField(this.resolvedField, this.calloutModifier, null);
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/LiftingTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/LiftingTypeReference.java
index 4e92f3c4a..02d8ea986 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/LiftingTypeReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/LiftingTypeReference.java
@@ -284,7 +284,7 @@ public class LiftingTypeReference extends TypeReference {
public char[][] getParameterizedTypeName() {
return this.baseReference.getParameterizedTypeName();
}
-
+
@Override
public char[] getLastToken() {
return this.baseReference.getLastToken();
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/MethodSpec.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/MethodSpec.java
index 2abf114db..3829f6d54 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/MethodSpec.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/MethodSpec.java
@@ -297,13 +297,13 @@ public class MethodSpec extends ASTNode implements InvocationSite
enhancedParameters = MethodSignatureEnhancer.enhanceParameters(scope, this.parameters);
CompilationResult compilationResult = scope.referenceContext().compilationResult();
CheckPoint cp = compilationResult.getCheckPoint(scope.referenceContext());
-
+
this.resolvedMethod = TypeAnalyzer.findMethod(scope, receiverClass, realSelector, enhancedParameters, isBaseSide, isBaseSide ? this : null);
boolean notFound = false, isVarargs = false;
if (this.resolvedMethod.isValidBinding())
isVarargs = this.resolvedMethod.isVarargs();
else
- notFound = this.resolvedMethod.problemId() == ProblemReasons.NotFound;
+ notFound = this.resolvedMethod.problemId() == ProblemReasons.NotFound;
if (notFound || (isVarargs && ((this.bits & IsVarArgs) == 0))) {
// second+ chance: try plain:
while (receiverClass != null) {
@@ -343,13 +343,13 @@ public class MethodSpec extends ASTNode implements InvocationSite
if (this.resolvedMethod != null) {
if (this.resolvedMethod.isValidBinding()) {
// check visibility of role-side in callin:
- if (!isBaseSide
- && scope.referenceContext() instanceof CallinMappingDeclaration
- && !this.resolvedMethod.canBeSeenBy(this, scope))
+ if (!isBaseSide
+ && scope.referenceContext() instanceof CallinMappingDeclaration
+ && !this.resolvedMethod.canBeSeenBy(this, scope))
{
scope.problemReporter().invisibleMethod(this, this.resolvedMethod);
this.resolvedMethod = new ProblemMethodBinding(this.resolvedMethod, this.selector, this.parameters, ProblemReasons.NotVisible);
- }
+ }
}
if (!this.resolvedMethod.isValidBinding() && this.resolvedMethod.declaringClass == null)
this.resolvedMethod.declaringClass = receiverClass; // needed for computeUniqueKey (via CallinCalloutBinding.computeUniqueKey)
@@ -490,7 +490,7 @@ public class MethodSpec extends ASTNode implements InvocationSite
default:
scope.problemReporter().missingImplementation(this, "Unexpected compile error at MethodSpec "+this); //$NON-NLS-1$
return;
- }
+ }
}
initTranslationBits();
}
@@ -514,7 +514,7 @@ public class MethodSpec extends ASTNode implements InvocationSite
void checkDecapsulation(ReferenceBinding baseClass, Scope scope) {
if (!this.resolvedMethod.canBeSeenBy(baseClass, this, scope)) {
WeavingScheme weavingScheme = scope.compilerOptions().weavingScheme;
- this.implementationStrategy = weavingScheme == WeavingScheme.OTDRE
+ this.implementationStrategy = weavingScheme == WeavingScheme.OTDRE
? ImplementationStrategy.DYN_ACCESS : ImplementationStrategy.DECAPS_WRAPPER;
this.accessId = createAccessAttribute(scope.enclosingSourceType().roleModel);
scope.problemReporter().decapsulation(this, baseClass, scope);
@@ -609,7 +609,7 @@ public class MethodSpec extends ASTNode implements InvocationSite
if (!TypeAnalyzer.isSameType(
scope.enclosingSourceType(),
specifiedArgType.resolvedType,
- realParameter))
+ realParameter))
{
scope.problemReporter().differentParamInMethodSpec(
this, specifiedArgType, realParameter,
@@ -672,7 +672,7 @@ public class MethodSpec extends ASTNode implements InvocationSite
return signature(this.resolvedMethod, weavingScheme);
}
/**
- * This method is used by
+ * This method is used by
* {@link org.eclipse.objectteams.otdt.internal.core.compiler.bytecode.CallinMethodMappingsAttribute CallinMethodMappingsAttribute}
* for decoding a mapping from its bytecode attribute.
* @param method
@@ -691,7 +691,7 @@ public class MethodSpec extends ASTNode implements InvocationSite
// manual retrenching?
boolean shouldRetrench = weavingScheme == WeavingScheme.OTRE && method.isCallin();
int offset = shouldRetrench ? MethodSignatureEnhancer.getEnhancingArgLen(weavingScheme) : 0;
- int paramLen = method.parameters.length;
+ int paramLen = method.parameters.length;
for (int i = offset; i < paramLen; i++) {
// 'weaken' to that erasure that was used in the tsuper version:
TypeBinding targetParameter = method.getCodeGenType(i);
@@ -702,8 +702,8 @@ public class MethodSpec extends ASTNode implements InvocationSite
? MethodModel.getReturnType(method)
: method.returnType;
// 'weaken' to that erasure that was used in the tsuper version:
- MethodBinding tsuperOriginal = (method.otBits & IOTConstants.IsCopyOfParameterized) != 0
- ? method.copyInheritanceSrc.original()
+ MethodBinding tsuperOriginal = (method.otBits & IOTConstants.IsCopyOfParameterized) != 0
+ ? method.copyInheritanceSrc.original()
: null;
TypeBinding returnType = (tsuperOriginal != null && tsuperOriginal.returnType.isTypeVariable() && !sourceReturnType.isTypeVariable())
? tsuperOriginal.returnType
@@ -779,7 +779,7 @@ public class MethodSpec extends ASTNode implements InvocationSite
public boolean isSuperAccess() {
return true; // grant access to inherited methods
}
-
+
@Override
public boolean isTypeAccess() {
return this.resolvedMethod != null && this.resolvedMethod.isStatic();
@@ -787,7 +787,7 @@ public class MethodSpec extends ASTNode implements InvocationSite
@Override
public void setActualReceiverType(ReferenceBinding receiverType) {
- // ignored
+ // ignored
}
@Override
@@ -797,7 +797,7 @@ public class MethodSpec extends ASTNode implements InvocationSite
@Override
public void setFieldIndex(int depth) {
- // ignored
+ // ignored
}
/**
@@ -807,7 +807,7 @@ public class MethodSpec extends ASTNode implements InvocationSite
public TypeBinding invocationTargetType() {
return null;
}
-
+
@Override
public InferenceContext18 freshInferenceContext(Scope scope) {
int nArgs = this.arguments.length;
@@ -821,13 +821,13 @@ public class MethodSpec extends ASTNode implements InvocationSite
return new InferenceContext18(scope, expressions, this, null);
}
-
+
@Override
public ExpressionContext getExpressionContext() {
return ExpressionContext.ASSIGNMENT_CONTEXT;
}
-
+
public int createAccessAttribute(RoleModel roleModel) {
- return roleModel.addInaccessibleBaseMethod(this.resolvedMethod);
+ return roleModel.addInaccessibleBaseMethod(this.resolvedMethod);
}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/PotentialLiftExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/PotentialLiftExpression.java
index 661fa93c6..b9195d9d4 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/PotentialLiftExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/PotentialLiftExpression.java
@@ -61,12 +61,12 @@ public class PotentialLiftExpression extends PotentialTranslationExpression {
// indeed needed can be propagated via the MethodSpec to the CallinMethodMappingsAttribute.
// Update (1.3.0M3): This is now done by a registered job (callback):
private Runnable liftingConfirmJob;
-
+
private TypeReference expectedTypeReference = null;
/** Job to perform if analysis confirms that lifting is required. */
public void onLiftingRequired(Runnable job) {
- this.liftingConfirmJob = job;
+ this.liftingConfirmJob = job;
}
/**
@@ -85,7 +85,7 @@ public class PotentialLiftExpression extends PotentialTranslationExpression {
this.operator = "lift"; //$NON-NLS-1$
this.teamExpr = teamExpr;
}
-
+
/**
* Create a wrapper for an expression that might require lifting.
*
@@ -113,7 +113,7 @@ public class PotentialLiftExpression extends PotentialTranslationExpression {
return null; // no chance
if (providedType.isParameterizedType())
providedType = providedType.erasure();
-
+
if (this.expectedType == null)
this.expectedType = this.expectedTypeReference.resolvedType;
this.checked = true;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/PotentialLowerExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/PotentialLowerExpression.java
index af61a275c..c27a2e545 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/PotentialLowerExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/PotentialLowerExpression.java
@@ -62,7 +62,7 @@ public class PotentialLowerExpression extends PotentialTranslationExpression {
{
this(expression, expectedType, null);
}
-
+
public PotentialLowerExpression(
Expression expression,
TypeBinding expectedType,
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/PotentialRoleReceiverExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/PotentialRoleReceiverExpression.java
index 0bb366d23..61f0853fb 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/PotentialRoleReceiverExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/PotentialRoleReceiverExpression.java
@@ -41,7 +41,7 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.util.AstGenerator;
* - direct
* - using a role reference as the implicit receiver
* Used to wrap RHS expressions in callin parameter mappings.
- *
+ *
* @author stephan
* @since 1.3.1
*/
@@ -50,9 +50,9 @@ public class PotentialRoleReceiverExpression extends Expression {
Expression expression;
char[] roleVarName;
TypeReference roleClassRef;
-
+
private Expression altExpression;
-
+
public PotentialRoleReceiverExpression(Expression expression, char[] roleName, TypeReference roleClassRef) {
super();
this.expression = expression;
@@ -84,20 +84,20 @@ public class PotentialRoleReceiverExpression extends Expression {
else
this.expression.generateCode(currentScope, codeStream, valueRequired);
}
-
+
@Override
public TypeBinding resolveType(BlockScope scope) {
ReferenceContext referenceContext = scope.referenceContext();
CompilationResult compilationResult = referenceContext.compilationResult();
CheckPoint cp = compilationResult.getCheckPoint(referenceContext);
-
+
// try normal:
this.resolvedType = this.expression.resolveType(scope);
if (this.resolvedType != null && this.resolvedType.isValidBinding()) {
this.constant = this.expression.constant;
return this.resolvedType;
}
-
+
// try alternative:
TypeBinding altResult = null;
AstGenerator gen = new AstGenerator(this.expression);
@@ -106,7 +106,7 @@ public class PotentialRoleReceiverExpression extends Expression {
if (this.expression instanceof SingleNameReference) {
this.altExpression = gen.fieldReference(
gen.castExpression(
- gen.singleNameReference(this.roleVarName),
+ gen.singleNameReference(this.roleVarName),
this.roleClassRef,
CastExpression.NEED_CLASS),
((SingleNameReference)this.expression).token);
@@ -126,7 +126,7 @@ public class PotentialRoleReceiverExpression extends Expression {
((MessageSend)this.expression).actualReceiverType = ((MessageSend)this.altExpression).actualReceiverType;
}
}
-
+
// evaluate results:
if (altResult != null && altResult.isValidBinding()) {
compilationResult.rollBack(cp);
@@ -137,7 +137,7 @@ public class PotentialRoleReceiverExpression extends Expression {
this.constant = this.expression.constant;
return this.resolvedType;
}
-
+
@Override
public StringBuffer printExpression(int indent, StringBuffer output) {
return this.expression.printExpression(indent, output);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/PrecedenceDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/PrecedenceDeclaration.java
index a5ee865f0..e40d44617 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/PrecedenceDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/PrecedenceDeclaration.java
@@ -283,7 +283,7 @@ public class PrecedenceDeclaration extends ASTNode {
count--;
} else {
if (i < len)
- type.scope.problemReporter().incompatiblePrecedenceLists(findPrecedenceSource(precedences[i], precedences[j], type),
+ type.scope.problemReporter().incompatiblePrecedenceLists(findPrecedenceSource(precedences[i], precedences[j], type),
type, precedences[i], precedences[j]);
else
throw new InternalCompilerError("Incompatible inherited precedence lists"); //$NON-NLS-1$
@@ -301,7 +301,7 @@ public class PrecedenceDeclaration extends ASTNode {
}
return precedences;
}
-
+
private static ASTNode findPrecedenceSource(PrecedenceBinding prec1, PrecedenceBinding prec2, TypeDeclaration type) {
if (type.precedences != null)
for (int i = 0; i < type.precedences.length; i++)
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/PrivateRoleMethodCall.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/PrivateRoleMethodCall.java
index bfb79c7d5..aceeac713 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/PrivateRoleMethodCall.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/PrivateRoleMethodCall.java
@@ -1,18 +1,18 @@
-/**
+/**
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2014 GK Software AG
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
- * Contributors:
+ *
+ * Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
package org.eclipse.objectteams.otdt.internal.core.compiler.ast;
@@ -33,7 +33,7 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.util.AstGenerator;
/**
* A message send to a private role method requiring redirection via a pair of bridge methods.
* Directly hooks into generateCode to achieve the necessary modifications.
- *
+ *
* (Before 3.7 (OT 2.0) this was an anonymous class inside CalloutImplementor).
* @author stephan
* @since 3.7 OT 2.0
@@ -41,7 +41,7 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.util.AstGenerator;
public class PrivateRoleMethodCall extends MessageSend {
private boolean isCalloutToField;
private AstGenerator gen;
-
+
public PrivateRoleMethodCall(Expression receiver, char[] selector, Expression[] arguments, boolean isCalloutToField,
Scope scope, ReferenceBinding targetClass, MethodBinding targetMethod, AstGenerator gen)
{
@@ -67,7 +67,7 @@ public class PrivateRoleMethodCall extends MessageSend {
ITeamAnchor teamAnchor = ((RoleTypeBinding)this.actualReceiverType)._teamAnchor;
TypeAnchorReference syntheticReceiver = this.gen.typeAnchorReference(teamAnchor);
syntheticReceiver.isExpression = true;
- receiverReference = syntheticReceiver;
+ receiverReference = syntheticReceiver;
} else {
isCallinAccess = true;
// call from inside a otre-dyn callin wrapper: receiver is the current team:
@@ -82,12 +82,12 @@ public class PrivateRoleMethodCall extends MessageSend {
// for method callout or callin to private *add* the team instance to the front of pushes
// original role instance receiver will become the first implicit argument
receiverReference.generateCode(currentScope, codeStream, true/*valueRequired*/);
-
+
if (isCallinAccess) {
// might need more synthetic args:
if (this.binding.isStatic()) {
codeStream.aconst_null(); // first arg in role bridge: (null) role
- codeStream.iconst_0(); // enclosingTeamInstance: dummy value
+ codeStream.iconst_0(); // enclosingTeamInstance: dummy value
codeStream.aload_0(); // enclosingTeamInstance: team instance
}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/QualifiedBaseReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/QualifiedBaseReference.java
index 92d4c5178..5b770f7a2 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/QualifiedBaseReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/QualifiedBaseReference.java
@@ -31,17 +31,17 @@ import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
import org.eclipse.objectteams.otdt.core.compiler.IOTConstants;
-/**
+/**
* This class represents a reference of the form <code>Type.base</code>
* for use as a type anchor in a {@link TypeAnchorReference}.
- *
+ *
* @author stephan
* @since 1.4.0
*/
public class QualifiedBaseReference extends QualifiedThisReference {
FieldBinding baseField;
-
+
public QualifiedBaseReference(TypeReference name, int sourceStart, int sourceEnd) {
super(name, sourceStart, sourceEnd);
}
@@ -63,9 +63,9 @@ public class QualifiedBaseReference extends QualifiedThisReference {
if (this.baseField == null)
this.baseField = new ProblemFieldBinding((ReferenceBinding)this.resolvedType, IOTConstants.BASE, ProblemReasons.NotFound);
scope.problemReporter().unboundQualifiedBase((ReferenceBinding)this.qualification.resolvedType, this);
- return null;
+ return null;
}
-
+
@Override
public TypeBinding resolveType(ClassScope scope) {
// for baseclass reference we indeed need to resolve from a class scope,
@@ -81,7 +81,7 @@ public class QualifiedBaseReference extends QualifiedThisReference {
codeStream.fieldAccess(Opcodes.OPC_getfield, this.baseField, this.baseField.declaringClass);
codeStream.recordPositionsFrom(pc, this.sourceStart);
}
-
+
@Override
public StringBuffer printExpression(int indent, StringBuffer output) {
return this.qualification.print(0, output).append(".base"); //$NON-NLS-1$
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/RoleClassLiteralAccess.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/RoleClassLiteralAccess.java
index 8add6d987..8e080092a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/RoleClassLiteralAccess.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/RoleClassLiteralAccess.java
@@ -87,13 +87,13 @@ public class RoleClassLiteralAccess extends ClassLiteralAccess {
generateMessageSend(expressionType);
}
- /**
+ /**
* Constructor for use by the Parser.
*/
public RoleClassLiteralAccess(SingleTypeReference typeRef) {
super(typeRef.sourceEnd, typeRef);
}
-
+
private void generateMessageSend(TypeBinding expressionType) {
AstGenerator gen = new AstGenerator(this.type.sourceStart, this.sourceEnd);
ReferenceBinding roleBinding = (ReferenceBinding)this.type.resolvedType;
@@ -151,7 +151,7 @@ public class RoleClassLiteralAccess extends ClassLiteralAccess {
if (this.type instanceof ParameterizedSingleTypeReference) {
// directly created from parsing R<@t>.class
this.constant = Constant.NotAConstant;
-
+
ParameterizedSingleTypeReference typeRef = (ParameterizedSingleTypeReference)this.type;
if (typeRef.token == null) {
// syntax error, however, we can still check the type anchor:
@@ -161,7 +161,7 @@ public class RoleClassLiteralAccess extends ClassLiteralAccess {
return null;
}
TypeBinding roleType = this.type.resolveType(scope);
- if (roleType != null && roleType.isValidBinding())
+ if (roleType != null && roleType.isValidBinding())
generateMessageSend(roleType);
}
// clients might still use this (obsolete) field?
@@ -200,7 +200,7 @@ public class RoleClassLiteralAccess extends ClassLiteralAccess {
}
private static TypeBinding ensureGetClassMethodPart(TypeDeclaration teamDecl, ReferenceBinding teamBinding,
- TypeDeclaration roleDecl, ReferenceBinding roleBinding, char[] selector)
+ TypeDeclaration roleDecl, ReferenceBinding roleBinding, char[] selector)
{
MethodBinding[] existingMethods = teamBinding.getMethods(selector);
if (existingMethods != NO_METHODS)
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/TSuperMessageSend.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/TSuperMessageSend.java
index a7b0045b3..495e5bbf3 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/TSuperMessageSend.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/TSuperMessageSend.java
@@ -103,21 +103,21 @@ public class TSuperMessageSend extends MessageSend {
@Override
protected TypeBinding findMethodBinding(BlockScope scope) {
-
+
// check: is a tsuper call legal in the current context?
-
+
AbstractMethodDeclaration context = scope.methodScope().referenceMethod();
- if (context == null
+ if (context == null
|| !CharOperation.equals(this.selector, context.selector)
- || context.binding.parameters.length != this.argumentTypes.length)
+ || context.binding.parameters.length != this.argumentTypes.length)
{
scope.problemReporter().tsuperCallsWrongMethod(this);
return null;
}
ReferenceBinding receiverRole;
- if (!(this.actualReceiverType instanceof ReferenceBinding)
- || !(receiverRole = (ReferenceBinding)this.actualReceiverType).isSourceRole())
+ if (!(this.actualReceiverType instanceof ReferenceBinding)
+ || !(receiverRole = (ReferenceBinding)this.actualReceiverType).isSourceRole())
{
scope.problemReporter().tsuperOutsideRole(context, this, this.actualReceiverType);
return null;
@@ -157,7 +157,7 @@ public class TSuperMessageSend extends MessageSend {
resolvePolyExpressionArguments(this, this.binding, this.argumentTypes, scope);
return this.binding.returnType;
}
- if (bestMatch == null ||
+ if (bestMatch == null ||
(bestMatch.problemId() == ProblemReasons.NotFound && candidate.problemId() != ProblemReasons.NotFound))
bestMatch = candidate;
}
@@ -168,20 +168,20 @@ public class TSuperMessageSend extends MessageSend {
this.binding = bestMatch;
return this.binding.returnType;
}
-
+
@Override
- public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean valueRequired)
+ public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean valueRequired)
{
- // for code gen we need to add the marker arg...
+ // for code gen we need to add the marker arg...
int len = this.binding.parameters.length;
TypeBinding[] extendedParameters = new TypeBinding[len+1];
System.arraycopy(this.binding.parameters, 0, extendedParameters, 0, len);
char[] tSuperMarkName = TSuperHelper.getTSuperMarkName(this.tsuperReference.resolvedType.enclosingType());
extendedParameters[len] = currentScope.getType(tSuperMarkName);
-
+
// ... and find the copied method binding
MethodBinding codegenBinding = currentScope.getMethod(this.actualReceiverType, this.selector, extendedParameters, this);
-
+
if (codegenBinding.problemId() == ProblemReasons.NotFound) {
// tsuper.m() may in fact refer to tsuper.super.m().
// try to find the method as super.tsuper() instead:
@@ -197,7 +197,7 @@ public class TSuperMessageSend extends MessageSend {
this.receiver.constant = Constant.NotAConstant;
this.actualReceiverType = superRole;
}
-
+
MethodBinding tsuperMethod = this.binding;
this.binding = codegenBinding;
try {
@@ -205,7 +205,7 @@ public class TSuperMessageSend extends MessageSend {
} finally {
this.binding = tsuperMethod;
}
-
+
if (valueRequired && this.binding.isCallin()) {
if (this.resolvedType != null && this.resolvedType.isValidBinding()) {
if (this.resolvedType.isBaseType()) {
@@ -223,7 +223,7 @@ public class TSuperMessageSend extends MessageSend {
@SuppressWarnings("hiding")
@Override
- public void generateArguments(MethodBinding binding, Expression[] arguments, BlockScope currentScope, CodeStream codeStream)
+ public void generateArguments(MethodBinding binding, Expression[] arguments, BlockScope currentScope, CodeStream codeStream)
{
super.generateArguments(binding, arguments, currentScope, codeStream);
// check if we need to pass the marker arg, too:
@@ -267,7 +267,7 @@ public class TSuperMessageSend extends MessageSend {
if (this.binding != null && this.binding.isCallin())
// restore return type which has been generalized to 'Object':
return this.resolvedType= MethodModel.getReturnType(this.binding);
-
+
return answer;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/TypeAnchorReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/TypeAnchorReference.java
index 1066618e4..aaef33a23 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/TypeAnchorReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/TypeAnchorReference.java
@@ -137,13 +137,13 @@ public class TypeAnchorReference extends TypeReference implements InvocationSite
} else if (reference instanceof QualifiedBaseReference) {
QualifiedBaseReference baseRef = (QualifiedBaseReference) reference;
char[][] tokens = baseRef.qualification.getTypeName();
- int len = tokens.length;
+ int len = tokens.length;
System.arraycopy(tokens, 0, result=new char[len+1][], 0, len);
result[len] = IOTConstants.BASE;
} else if (reference instanceof QualifiedThisReference) {
QualifiedThisReference thisRef = (QualifiedThisReference) reference;
char[][] tokens = thisRef.qualification.getTypeName();
- int len = tokens.length;
+ int len = tokens.length;
System.arraycopy(tokens, 0, result=new char[len+1][], 0, len);
result[len] = "this".toCharArray(); //$NON-NLS-1$
} else {
@@ -221,12 +221,12 @@ public class TypeAnchorReference extends TypeReference implements InvocationSite
this.resolvedType = result.getResolvedType();
return result;
}
-
+
ITeamAnchor resolveAnchor(Scope scope, Reference reference) {
ITeamAnchor prefix = null;
ITeamAnchor currentAnchor = null;
char[] currentToken = null; // for lookup and creation of problem binding
-
+
// be careful not to trigger fields() which may be where we are called from!
if (reference instanceof SingleNameReference) {
SingleNameReference singleAnchor = (SingleNameReference)reference;
@@ -243,20 +243,20 @@ public class TypeAnchorReference extends TypeReference implements InvocationSite
prefix = resolveAnchor(scope, (Reference)prefixExpr);
currentToken = fieldRef.token;
// fieldRef holds on to problem binding:
- fieldRef.binding = TypeAnalyzer.findField(((ReferenceBinding)prefix.getResolvedType()).getRealClass(), currentToken, false/*static*/, true/*outer*/);
+ fieldRef.binding = TypeAnalyzer.findField(((ReferenceBinding)prefix.getResolvedType()).getRealClass(), currentToken, false/*static*/, true/*outer*/);
currentAnchor = checkAnchor(scope, reference, currentToken, reference.sourceStart, reference.sourceEnd, fieldRef.binding);
} else if (reference instanceof QualifiedBaseReference) {
QualifiedBaseReference baseRef = (QualifiedBaseReference) reference;
if (scope instanceof BlockScope)
baseRef.resolveType((BlockScope)scope);
- else
+ else
baseRef.resolveType((ClassScope)scope);
currentAnchor = baseRef.baseField;
} else if (reference instanceof QualifiedThisReference) {
QualifiedThisReference thisRef = (QualifiedThisReference) reference;
if (scope instanceof BlockScope)
thisRef.resolveType((BlockScope)scope);
- else
+ else
thisRef.resolveType((ClassScope)scope);
if (thisRef.resolvedType.isTeam())
currentAnchor = ((ReferenceBinding)thisRef.resolvedType).getTeamModel().getTThis();
@@ -310,7 +310,7 @@ public class TypeAnchorReference extends TypeReference implements InvocationSite
if (fieldType instanceof SourceTypeBinding) {
SourceTypeBinding stb = (SourceTypeBinding)fieldType;
if ((stb.scope != null)
- && (stb.scope.compilationUnitScope() != scope.compilationUnitScope())
+ && (stb.scope.compilationUnitScope() != scope.compilationUnitScope())
&& (stb.tagBits & (TagBits.BeginHierarchyCheck|TagBits.EndHierarchyCheck)) == (TagBits.BeginHierarchyCheck|TagBits.EndHierarchyCheck)
&& StateHelper.isReadyToProcess(stb, ITranslationStates.STATE_LENV_DONE_FIELDS_AND_METHODS))
Dependencies.ensureBindingState(stb, ITranslationStates.STATE_LENV_DONE_FIELDS_AND_METHODS);
@@ -344,7 +344,7 @@ public class TypeAnchorReference extends TypeReference implements InvocationSite
} else if (currentAnchor.isValidBinding()) {
if (prefix != null && !(prefix instanceof TThisBinding))
currentAnchor = currentAnchor.setPathPrefix(prefix);
-
+
// fill anchor with resolved data:
reference.resolvedType = currentAnchor.getResolvedType();
reference.bits &= ~RestrictiveFlagMASK; // clear bits
@@ -458,7 +458,7 @@ public class TypeAnchorReference extends TypeReference implements InvocationSite
else if (reference instanceof FieldReference)
scope.problemReporter().invalidField((FieldReference)reference, ((FieldReference)reference).actualReceiverType);
return null;
- }
+ }
if (!anchorBinding.hasValidReferenceType()) {
scope.problemReporter().typeAnchorReferenceNotAnObjectRef(start, end);
return null;
@@ -487,7 +487,7 @@ public class TypeAnchorReference extends TypeReference implements InvocationSite
{
TypeBinding type = typeReference.resolvedType;
ITeamAnchor anchorBinding = null;
- if (this.anchor instanceof NameReference)
+ if (this.anchor instanceof NameReference)
anchorBinding = (ITeamAnchor)((NameReference)this.anchor).binding;
else if (this.anchor instanceof FieldReference)
anchorBinding = ((FieldReference)this.anchor).binding;
@@ -552,7 +552,7 @@ public class TypeAnchorReference extends TypeReference implements InvocationSite
return this.anchor.printExpression(indent, output);
}
- /**
+ /**
* Fetch a bitset marking all those arguments that are referenced as a type anchor from an argument or type parameter.
*/
public static boolean[] fetchAnchorFlags(Argument[] arguments, TypeParameter[] typeParameters) {
@@ -566,7 +566,7 @@ public class TypeAnchorReference extends TypeReference implements InvocationSite
}
if (typeParameters != null)
for (int i = 0; i < typeParameters.length; i++)
- if (typeParameters[i].type instanceof TypeAnchorReference)
+ if (typeParameters[i].type instanceof TypeAnchorReference)
checkTypeAnchorXRef((TypeAnchorReference)typeParameters[i].type, arguments, -1, flags);
return flags;
}
@@ -580,7 +580,7 @@ public class TypeAnchorReference extends TypeReference implements InvocationSite
break;
}
}
- }
+ }
}
// === implement InvocationSite: ===
@@ -617,7 +617,7 @@ public class TypeAnchorReference extends TypeReference implements InvocationSite
public void setFieldIndex(int depth) {
// ignored
}
-
+
@Override
public InferenceContext18 freshInferenceContext(Scope scope) {
throw new InternalCompilerError("Method not applicable"); //$NON-NLS-1$
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/WithinStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/WithinStatement.java
index d2f1dd674..ac4fef2a1 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/WithinStatement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/WithinStatement.java
@@ -58,13 +58,13 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.util.AstGenerator;
*/
public class WithinStatement extends Block implements IOTConstants
{
- /**
+ /**
* This class marks the single name reference refering to the synthetic local variable.
* As such it is actually a substitute for the team expression.
- * Used for error reporting (null checks).
+ * Used for error reporting (null checks).
*/
- public class SubstitutedReference extends SingleNameReference
- {
+ public class SubstitutedReference extends SingleNameReference
+ {
public SubstitutedReference(char[] teamVarName, long pos) {
super(teamVarName, pos);
}
@@ -217,7 +217,7 @@ public class WithinStatement extends Block implements IOTConstants
}
@Override
- public void traverse(ASTVisitor visitor, BlockScope blockScope)
+ public void traverse(ASTVisitor visitor, BlockScope blockScope)
{
if (visitor.visit(this, blockScope)) {
this.getTeamExpression().traverse(visitor, blockScope);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/AnchorUsageRanksAttribute.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/AnchorUsageRanksAttribute.java
index 818decc59..3772334f5 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/AnchorUsageRanksAttribute.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/AnchorUsageRanksAttribute.java
@@ -33,15 +33,15 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.model.FieldModel;
* This attribute stores interdependencies between value and type parameters.
* Consider, e.g., a generic class
* <pre>class MyClass&lt;MyTeam t, U, R1&lt;@t&gt;, R2&lt;@t&gt;&gt;</pre>
- *
+ *
* From this a final field <code>t</code> is generated to which this attribute
* is attached. The attribute value is a list of ranks (zero-based), here <code>1,2</code>
* referring to the second and third type parameter (not counting the value
* parameter <code>t</code>), saying that those parameters <code>R1</code>
* and <code>R2</code> are anchored to the field <code>t</code>.
- *
+ *
* Format of this attribute: list of unsigned short
- *
+ *
* @author stephan
* @since 1.3.2
*/
@@ -49,13 +49,13 @@ public class AnchorUsageRanksAttribute extends ListValueAttribute {
FieldBinding field;
List<Integer> ranks;
-
+
/** Create a new instance during compiling the generic type. */
public AnchorUsageRanksAttribute(FieldBinding field) {
super(IOTConstants.ANCHOR_USAGE_RANKS, 0/*still unknown*/, 2);
this.field = field;
}
-
+
/** Create a new attribute from bytecode. */
public AnchorUsageRanksAttribute(FieldInfo info, int readOffset, int structOffset, int[] constantPoolOffsets) {
super(ANCHOR_USAGE_RANKS, 0, 2);
@@ -80,7 +80,7 @@ public class AnchorUsageRanksAttribute extends ListValueAttribute {
void writeElementValue(int i) {
writeUnsignedShort(this.ranks.get(i));
}
-
+
@Override
void read(int i) {
if (i == 0)
@@ -92,7 +92,7 @@ public class AnchorUsageRanksAttribute extends ListValueAttribute {
public void evaluate(Binding binding, LookupEnvironment environment, char[][][] missingTypeNames) {
// nop / not used
}
-
+
@Override
public boolean evaluate(FieldBinding binding) {
binding.modifiers |= ExtraCompilerModifiers.AccValueParam;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/BytecodeTransformer.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/BytecodeTransformer.java
index 1e41ba7a0..4ea8214ed 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/BytecodeTransformer.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/BytecodeTransformer.java
@@ -110,7 +110,7 @@ public class BytecodeTransformer
if (dstType.isTeam()) {
ReferenceBinding orgObjectteamsTeam = scope.getOrgObjectteamsTeam();
if ( !TypeAnalyzer.isOrgObjectteamsTeam(dstType)
- && !dstType.superclass.isTeam())
+ && !dstType.superclass.isTeam())
{
TeamMethodGenerator tmg = scope.environment().getTeamMethodGenerator();
if (tmg.requestBytes()) { // if o.o.Team is converted we don't have the bytecode - and shouldn't need it
@@ -164,7 +164,7 @@ public class BytecodeTransformer
dstMethod.binding.bytecodeMissing= true;
return;
}
-
+
if (CharOperation.equals(CalloutImplementorDyn.OT_ACCESS, dstMethod.selector)
||CharOperation.equals(CalloutImplementorDyn.OT_ACCESS_STATIC, dstMethod.selector))
return;
@@ -232,7 +232,7 @@ public class BytecodeTransformer
// keep this offset for updating the stored value after adjustTail():
int copyInhSrcLineOffsetOffset;
// first phase of adjustment (method prefix and attributes except code):
- ConstantPoolSimpleConverter conv = constantPoolOffsets == null
+ ConstantPoolSimpleConverter conv = constantPoolOffsets == null
? ConstantPoolSimpleConverter.create(srcRole, srcMethodBinding, methodCode, classFile)
: new ConstantPoolSimpleConverter(srcConstantPool, constantPoolOffsets, offset, methodCode, classFile);
@@ -305,7 +305,7 @@ public class BytecodeTransformer
dstMethod.maybeRecordByteCode(classFile, newMethodOffset);
}
-
+
/**
* @param srcConstantPool
* @param offset start of this method (within srcConstantPool)
@@ -440,7 +440,7 @@ public class BytecodeTransformer
{
if (isAddingMarkerArg) {
OTByteCodes.setInt(dest, offset+destOff-4, attrLen+2); // grow attr by 2
-
+
int paramCount = OTByteCodes.getUnsignedByte(src, srcOffset+offset);
dest[offset+destOff] = (byte)(paramCount+1); // grow paramCount by 1
offset++;
@@ -471,7 +471,7 @@ public class BytecodeTransformer
conv.updateName(offset); // annotation name
offset += 2;
int numMembers = OTByteCodes.getWord(src, srcOffset+offset);
- offset += 2;
+ offset += 2;
if (numMembers > 0)
for (int k=0; k<numMembers; k++) {
conv.updateName(offset);
@@ -485,8 +485,8 @@ public class BytecodeTransformer
* SH: inspired by AnnotationInfo.scanElementValue(int);
* @return the next offset to read.
*/
- private int adjustAnnotationElementValue(ConstantPoolSimpleConverter conv, byte[] src, int srcOffset, int offset)
- throws IllegalArgumentException
+ private int adjustAnnotationElementValue(ConstantPoolSimpleConverter conv, byte[] src, int srcOffset, int offset)
+ throws IllegalArgumentException
{
int currentOffset = offset;
int tag = OTByteCodes.getUnsignedByte(src, srcOffset+currentOffset);
@@ -554,7 +554,7 @@ public class BytecodeTransformer
* @param dstClassFile This is the destination Classfile wich contains the later flushed ConstantPool
* @param mModel the destination method
* @param codeToAdjust this is the duplicated code-part of the code_attribute (see getCodeByteCode)
- * @param codeAttributeOffset attribute offset within codeToAdjust
+ * @param codeAttributeOffset attribute offset within codeToAdjust
* @param codeLength length of codeToAdjust
* @param isCtorAddingMarkArg are we copying into a tsuper ctor with additional marger arg?
*/
@@ -702,9 +702,9 @@ public class BytecodeTransformer
ConstantPoolObject src_cpo = it.next();
ConstantPoolObject dst_cpo = src_cpo.isClass()
? new ConstantPoolObject(
- ClassFileConstants.ClassTag,
+ ClassFileConstants.ClassTag,
ConstantPoolObjectMapper.mapClass(srcTeamBinding, src_cpo.getClassObject(), dstType))
- : src_cpo;
+ : src_cpo;
this._writer.writeConstantPoolObject(dst_cpo);
}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/CallinMethodMappingsAttribute.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/CallinMethodMappingsAttribute.java
index a9cf5f1db..68ba7b9a6 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/CallinMethodMappingsAttribute.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/CallinMethodMappingsAttribute.java
@@ -336,7 +336,7 @@ public class CallinMethodMappingsAttribute extends AbstractAttribute {
*
* @param reader this reader holds the bytes to read
* @param readOffset offset where to start reading
- * @param constantPoolOffsets constant pool offset to be used during reading
+ * @param constantPoolOffsets constant pool offset to be used during reading
*/
public CallinMethodMappingsAttribute(ClassFileStruct reader, int readOffset, int[] constantPoolOffsets) {
super(IOTConstants.CALLIN_METHOD_MAPPINGS);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/CalloutMappingsAttribute.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/CalloutMappingsAttribute.java
index 2bad97ef7..85cdfe395 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/CalloutMappingsAttribute.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/CalloutMappingsAttribute.java
@@ -258,13 +258,13 @@ public class CalloutMappingsAttribute extends ListValueAttribute {
private boolean methodMatchesSignature(MethodBinding methodBinding, char[] signature) {
if (CharOperation.equals(methodBinding.signature(), signature))
return true;
-
+
char[][] signatureTypes = scanSignature(signature);
-
+
TypeBinding type = methodBinding.returnType;
if (!typeMatchesSignature(type, signatureTypes[0]))
return false;
-
+
char[][] types = CharOperation.subarray(signatureTypes, 1, -1);
if (types.length != methodBinding.parameters.length)
return false;
@@ -285,7 +285,7 @@ public class CalloutMappingsAttribute extends ListValueAttribute {
}
return CharOperation.equals(bindingType, signatureType);
}
-
+
private char[] getSignatureSimpleName(char[] signatureType) {
if (signatureType[signatureType.length-1]!=';')
return signatureType;
@@ -311,7 +311,7 @@ public class CalloutMappingsAttribute extends ListValueAttribute {
// Ignore synthetic argument for member types or enum types.
int startIndex = 0;
// NOTE: no callout to ctor, thus no check 'isConstructor()'
-
+
int size = numOfParams - startIndex;
char[][] result= new char[size+1][]; // [0] is returnType
if (size > 0) {
@@ -331,7 +331,7 @@ public class CalloutMappingsAttribute extends ListValueAttribute {
result[0] = CharOperation.subarray(methodDescriptor, index + 1, -1);
return result;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.objectteams.otdt.internal.core.compiler.bytecode.ListValueAttribute#toString(int)
*/
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/ConstantPoolObjectReader.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/ConstantPoolObjectReader.java
index 680f72805..f34856bb4 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/ConstantPoolObjectReader.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/ConstantPoolObjectReader.java
@@ -413,9 +413,9 @@ public class ConstantPoolObjectReader extends ClassFileStruct implements ClassFi
throw new InternalCompilerError("synthetic method "+new String(name)+" has unexpected signature"); //$NON-NLS-1$ //$NON-NLS-2$
}
if ( isSynthMethodName(name)
- || SyntheticBaseCallSurrogate.isBaseCallSurrogateName(name))
+ || SyntheticBaseCallSurrogate.isBaseCallSurrogateName(name))
{
- // for normal access methods class_rb should not be a BinaryTypeBinding,
+ // for normal access methods class_rb should not be a BinaryTypeBinding,
// because in that case the above loop should have found the method
// (access$n are stored like normal methods).
if (class_rb.isBinaryBinding()) {
@@ -489,7 +489,7 @@ public class ConstantPoolObjectReader extends ClassFileStruct implements ClassFi
}
boolean isSynthMethodName(char[] name) {
- return
+ return
CharOperation.prefixEquals(TypeConstants.SYNTHETIC_ACCESS_METHOD_PREFIX, name)
|| CharOperation.prefixEquals(TypeConstants.SYNTHETIC_SWITCH_ENUM_TABLE, name)
|| CharOperation.equals(CalloutImplementorDyn.OT_ACCESS, name)
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/ConstantPoolSimpleConverter.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/ConstantPoolSimpleConverter.java
index 23e8fbe06..ce90d2af1 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/ConstantPoolSimpleConverter.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/ConstantPoolSimpleConverter.java
@@ -74,7 +74,7 @@ public class ConstantPoolSimpleConverter extends ClassFileStruct {
this.dest = destBytes;
this.dstClassFile = dstClassFile;
}
-
+
public ConstantPoolSimpleConverter(byte[] bytes, int[] constantPoolOffsets, int methodOffset, byte[] destBytes, ClassFile dstClassFile) {
super(bytes, constantPoolOffsets, 0);
this.srcOffset = methodOffset;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/ListValueAttribute.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/ListValueAttribute.java
index 9ca5f4ae6..5f666f935 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/ListValueAttribute.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/ListValueAttribute.java
@@ -70,7 +70,7 @@ public abstract class ListValueAttribute
// this code is mainly stolen from ClassFile.addAttributes().
super.write(classFile);
- int attributeSize = getAttributeSize();
+ int attributeSize = getAttributeSize();
if (this._contentsOffset + 6 + attributeSize >= this._contents.length) {
this._contents = classFile.getResizedContents(6 + attributeSize);
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/OTByteCodes.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/OTByteCodes.java
index f4581ab13..066431786 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/OTByteCodes.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/OTByteCodes.java
@@ -19,14 +19,14 @@
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
- *
+ *
* This file is a modified version of class org.apache.bcel.Constants
- * originating from the Apache BCEL project which was provided under the
+ * originating from the Apache BCEL project which was provided under the
* Apache 2.0 license. Original Copyright from BCEL:
- *
+ *
* Copyright 2000-2004 The Apache Software Foundation
*
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -36,7 +36,7 @@
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
- * limitations under the License.
+ * limitations under the License.
**********************************************************************/
package org.eclipse.objectteams.otdt.internal.core.compiler.bytecode;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/OTDynCallinBindingsAttribute.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/OTDynCallinBindingsAttribute.java
index c968d4b8a..6e1c324ab 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/OTDynCallinBindingsAttribute.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/OTDynCallinBindingsAttribute.java
@@ -1,17 +1,17 @@
-/**
+/**
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2009, 2019 Stephan Herrmann
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors: Stephan Herrmann - Initial API and implementation
**********************************************************************/
package org.eclipse.objectteams.otdt.internal.core.compiler.bytecode;
@@ -45,7 +45,7 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.model.TeamModel;
/**
* Encodes all callin bindings of a team class.
* Structure:
- * <pre>
+ * <pre>
* CallinBindings_attribute {
* u2 attribute_name_index;
* u4 attribute_length;
@@ -60,7 +60,7 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.model.TeamModel;
* u2 base_class_index_table; // internal name: java/util/Map$Entry
* u2 file_name_index_table; // for SMAP
* u2 line_number; // for SMAP
- * u2 line_offset; // for SMAP
+ * u2 line_offset; // for SMAP
* u2 base_methods_count;
* {
* u2 base_method_name_index_table;
@@ -72,13 +72,13 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.model.TeamModel;
* } bindings[bindings_count];
* }
* </pre>
- *
+ *
* This attribute is inherited / copied / merged into all sub and tsub teams, as to advise
* the OTDRE to generate dispatch code into the team.
- *
+ *
* No team declares callinIds that would conflict with any of its supers/tsupers
* (see TeamModel.nextCallinID and the methods operating on it).
- *
+ *
* @author stephan
* @since 1.3.0M3
*/
@@ -92,14 +92,14 @@ public class OTDynCallinBindingsAttribute extends ListValueAttribute {
public static final short COVARIANT_BASE_RETURN = 8;
public static final short BASE_SUPER_CALL = 16;
-
+
private class Mapping {
char[] roleClassName, declaringRoleName, callinName, roleSelector, roleSignature, callinModifier, baseClassName, fileName;
int flags; // STATIC_ROLE_METHOD, INHERITED, COVARIANT_BASE_RETURN
int lineNumber, lineOffset;
BaseMethod[] baseMethods;
MethodBinding roleMethod;
- Mapping(char[] roleClassName, char[] declaringRoleName, char[] callinName, char[] roleSelector, char[] roleSignature, char[] callinModifer, int flags, char[] baseClassName, int baseMethodCount, MethodBinding roleMethod)
+ Mapping(char[] roleClassName, char[] declaringRoleName, char[] callinName, char[] roleSelector, char[] roleSignature, char[] callinModifer, int flags, char[] baseClassName, int baseMethodCount, MethodBinding roleMethod)
{
this.roleClassName = roleClassName;
this.declaringRoleName = declaringRoleName;
@@ -137,9 +137,9 @@ public class OTDynCallinBindingsAttribute extends ListValueAttribute {
(short)Util.getLineNumber(decl.declarationSourceEnd, lineEnds, 0, lineEnds.length-1);
this.lineOffset = (short)(lineEnd - this.lineNumber);
}
-
- /**
+
+ /**
* Compute the name of the file containing the given callin mapping.
* Do consider packages but no projects or source folders.
*/
@@ -189,7 +189,7 @@ public class OTDynCallinBindingsAttribute extends ListValueAttribute {
return buf.toString();
}
}
-
+
/* Encodes the binding to one individual base method. */
private class BaseMethod {
static final int CALLIN = 1;
@@ -208,23 +208,23 @@ public class OTDynCallinBindingsAttribute extends ListValueAttribute {
this.translationFlags = translationFlags;
}
}
-
+
private List<Mapping> mappings;
private TeamModel theTeam;
-
+
OTDynCallinBindingsAttribute(TeamModel theTeam) {
super(ATTRIBUTE_NAME, -1/*size pending*/, -1/*variable entry size*/);
this.theTeam = theTeam;
this.theTeam.addAttribute(this);
this.mappings = new ArrayList<Mapping>();
}
-
+
private OTDynCallinBindingsAttribute(TeamModel theTeam, List<Mapping> mappings) {
super(ATTRIBUTE_NAME, mappings.size(), -1/*variable entry size*/);
this.theTeam = theTeam;
this.mappings = mappings;
}
-
+
/**
* Read the attribute from byte code.
*
@@ -242,7 +242,7 @@ public class OTDynCallinBindingsAttribute extends ListValueAttribute {
for (int i=0; i<this._count; i++)
this.mappings.add(readMapping());
}
-
+
@Override
protected int getAttributeSize() {
int s = 2; // entry count
@@ -252,7 +252,7 @@ public class OTDynCallinBindingsAttribute extends ListValueAttribute {
}
void addMappings(char[] baseClassName, CallinMappingDeclaration callinDecl) {
MethodSpec roleSpec = callinDecl.roleMethodSpec;
- int flags = 0;
+ int flags = 0;
if (callinDecl.roleMethodSpec.resolvedMethod.isStatic())
flags |= STATIC_ROLE_METHOD;
if (callinDecl.hasCovariantReturn())
@@ -260,7 +260,7 @@ public class OTDynCallinBindingsAttribute extends ListValueAttribute {
MethodSpec[] baseMethodSpecs = callinDecl.getBaseMethodSpecs();
Mapping mapping = new Mapping(callinDecl.scope.enclosingSourceType().sourceName(), // indeed: simple name
callinDecl.declaringRoleName(), callinDecl.name, roleSpec.selector, roleSpec.signature(WeavingScheme.OTDRE),
- callinDecl.getCallinModifier(), flags,
+ callinDecl.getCallinModifier(), flags,
baseClassName, baseMethodSpecs.length,
roleSpec.resolvedMethod);
for (int i=0; i<baseMethodSpecs.length; i++) {
@@ -276,7 +276,7 @@ public class OTDynCallinBindingsAttribute extends ListValueAttribute {
baseFlags |= BaseMethod.PRIVATE;
if (baseSpec.isPublic())
baseFlags |= BaseMethod.PUBLIC;
- mapping.addBaseMethod(i, baseSpec.codegenSeletor(), baseSpec.signature(WeavingScheme.OTDRE),
+ mapping.addBaseMethod(i, baseSpec.codegenSeletor(), baseSpec.signature(WeavingScheme.OTDRE),
baseSpec.resolvedMethod.declaringClass.constantPoolName(),
baseSpec.getCallinId(this.theTeam, callinDecl.explicitName()),
baseFlags, baseSpec.getTranslationFlags());
@@ -285,11 +285,11 @@ public class OTDynCallinBindingsAttribute extends ListValueAttribute {
this.mappings.add(mapping);
this._count = this.mappings.size();
}
-
+
public static void createOrMerge(TeamModel theTeam, char[] baseClassName, CallinMappingDeclaration[] mappingDecls) {
AbstractAttribute existingAttr = theTeam.getAttribute(ATTRIBUTE_NAME);
- OTDynCallinBindingsAttribute theAttr = existingAttr != null
- ? (OTDynCallinBindingsAttribute)existingAttr
+ OTDynCallinBindingsAttribute theAttr = existingAttr != null
+ ? (OTDynCallinBindingsAttribute)existingAttr
: new OTDynCallinBindingsAttribute(theTeam);
for (CallinMappingDeclaration callinDecl : mappingDecls)
theAttr.addMappings(baseClassName, callinDecl);
@@ -324,7 +324,7 @@ public class OTDynCallinBindingsAttribute extends ListValueAttribute {
buf.append('\n');
return buf.toString();
}
-
+
@Override
void writeElementValue(int i) {
Mapping mapping = this.mappings.get(i);
@@ -353,7 +353,7 @@ public class OTDynCallinBindingsAttribute extends ListValueAttribute {
writeUnsignedShort(baseMethods[j].translationFlags);
}
}
-
+
Mapping readMapping() {
char[] roleClassName = consumeName();
char[] callinName = consumeName();
@@ -370,7 +370,7 @@ public class OTDynCallinBindingsAttribute extends ListValueAttribute {
char[] declaringRoleName = CharOperation.subarray(callinName, 0, pos);
callinName = CharOperation.subarray(callinName, pos+1, -1);
- Mapping result = new Mapping(roleClassName, declaringRoleName, callinName, roleSelector, roleSignature, callinModifer, flags, baseClassName, baseMethodCount, null);
+ Mapping result = new Mapping(roleClassName, declaringRoleName, callinName, roleSelector, roleSignature, callinModifer, flags, baseClassName, baseMethodCount, null);
result.setSMAPInfo(fileName, lineNumber, lineOffset);
for (int i=0; i<baseMethodCount; i++) {
char[] baseMethodName = consumeName();
@@ -383,7 +383,7 @@ public class OTDynCallinBindingsAttribute extends ListValueAttribute {
}
return result;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.objectteams.otdt.internal.core.compiler.bytecode.AbstractAttribute#evaluate(org.eclipse.jdt.internal.compiler.lookup.Binding, org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment)
*/
@@ -393,7 +393,7 @@ public class OTDynCallinBindingsAttribute extends ListValueAttribute {
if (((ReferenceBinding)binding).isTeam())
((ReferenceBinding)binding).getTeamModel().addAttribute(this);
}
-
+
// Evaluate CallinMethodMappingAttribute late, because we need our methods to be in place.
@Override
public void evaluateLateAttribute(ReferenceBinding teamBinding, int state)
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/OTSpecialAccessAttribute.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/OTSpecialAccessAttribute.java
index 61222161c..8c10e3dbf 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/OTSpecialAccessAttribute.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/OTSpecialAccessAttribute.java
@@ -68,7 +68,7 @@ public class OTSpecialAccessAttribute extends AbstractAttribute {
* This form of ids is then stored in the attribute.
* Stored ids are consumed and translated by OTREDyn to obtain those global IDs that uniquely identify the
* base feature within a generated _OT$access or _OT$accessStatic method.
- *
+ *
* AccessIds are generated during resolve and stored in these AST nodes:
* - MethodSpec / FieldAccessSpec
* - From here it is directly picked up by CallinImplementorDyn to insert
@@ -322,7 +322,7 @@ public class OTSpecialAccessAttribute extends AbstractAttribute {
int M_SIZE = this._weavingScheme == WeavingScheme.OTDRE ? 8 : 6;
int F_SIZE = this._weavingScheme == WeavingScheme.OTDRE ? 9 : 7;
attributeSize += this._decapsulatedMethods.size() * (1+M_SIZE); // 1 byte kind, 3 names (+1 short for otredyn)
- attributeSize += this._calloutToFields.size() * (1+F_SIZE); // 1 byte kind, 1 byte flags, 3 names (+1 byte for otredyn)
+ attributeSize += this._calloutToFields.size() * (1+F_SIZE); // 1 byte kind, 1 byte flags, 3 names (+1 byte for otredyn)
attributeSize += this._superMethods.size() * 9; // 1 byte kind, 4 names
attributeSize += this._adaptedBaseclasses.size() * 3; // 1 name + 1 byte flag
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/StaticReplaceBindingsAttribute.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/StaticReplaceBindingsAttribute.java
index 029f99c99..014e16ff6 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/StaticReplaceBindingsAttribute.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/StaticReplaceBindingsAttribute.java
@@ -237,7 +237,7 @@ public class StaticReplaceBindingsAttribute extends AbstractAttribute {
*
* @param reader this reader holds the bytes to read
* @param readOffset offset where to start reading
- * @param constantPoolOffsets constant pool offset to be used during reading
+ * @param constantPoolOffsets constant pool offset to be used during reading
*/
public StaticReplaceBindingsAttribute(ClassFileStruct reader, int readOffset, int[] constantPoolOffsets) {
super(IOTConstants.STATIC_REPLACE_BINDINGS);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/WordValueAttribute.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/WordValueAttribute.java
index 2a535d814..d4c5c9f83 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/WordValueAttribute.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/WordValueAttribute.java
@@ -94,7 +94,7 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.util.TypeAnalyzer;
* Only used by the compiler:
* - CALLIN_FLAG_DEFINITELY_MISSING_BASECALL: For base call flow analysis including super calls
* - CALLIN_FLAG_POTENTIALLY_MISSING_BASECALL: For base call flow analysis including super calls
- * - CALLIN_FLAG_BASE_SUPER_CALL: Is the base call targeting the base's super?
+ * - CALLIN_FLAG_BASE_SUPER_CALL: Is the base call targeting the base's super?
* OTRE part is handled via OTSpecialAccess attribute (kind SUPER_METHOD_ACCESS).
* - bits 9-12 (CALLIN_RETURN_MASK): Encoding of original non-reference return type.
*
@@ -239,7 +239,7 @@ public class WordValueAttribute
switch (weavingScheme) {
case OTRE:
break; // is the default
- case OTDRE:
+ case OTDRE:
this._value |= OTDRE_FLAG;
break;
}
@@ -359,11 +359,11 @@ public class WordValueAttribute
&& !environment.globalOptions.isPureJava)
{
switch (environment.globalOptions.weavingScheme) {
- case OTRE:
+ case OTRE:
if ((this._value & OTDRE_FLAG) != 0)
environment.problemReporter.incompatibleWeavingScheme(type, WeavingScheme.OTDRE);
break;
- case OTDRE:
+ case OTDRE:
if ((this._value & OTDRE_FLAG) == 0)
environment.problemReporter.incompatibleWeavingScheme(type, WeavingScheme.OTRE);
break;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/Config.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/Config.java
index 96f853121..a5beedb1b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/Config.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/Config.java
@@ -55,7 +55,7 @@ import org.eclipse.objectteams.otdt.core.exceptions.InternalCompilerError;
* We don't use ThreadLocal, since we do cleanup manually using release().
*/
public class Config implements ConfigHelper.IConfig, Comparable<Config> {
-
+
@SuppressWarnings("serial")
public static class NotConfiguredException extends RuntimeException {
public NotConfiguredException(String string) {
@@ -63,7 +63,7 @@ public class Config implements ConfigHelper.IConfig, Comparable<Config> {
}
public void logWarning(String msg) {
try {
- JavaCore.getJavaCore().getLog().log(new Status(IStatus.WARNING, JavaCore.PLUGIN_ID, msg, this));
+ JavaCore.getJavaCore().getLog().log(new Status(IStatus.WARNING, JavaCore.PLUGIN_ID, msg, this));
} catch (NoClassDefFoundError ncdfe) {
System.err.println("Warning: "+msg); //$NON-NLS-1$
this.printStackTrace(System.err);
@@ -293,7 +293,7 @@ public class Config implements ConfigHelper.IConfig, Comparable<Config> {
return false;
return config.client.get() == client;
}
-
+
static Config getOrCreateMatchingConfig(Object client, Parser parser, LookupEnvironment environment) {
Config config = safeGetConfig();
if (configMatchesRequest(config, client, parser, environment)) {
@@ -302,7 +302,7 @@ public class Config implements ConfigHelper.IConfig, Comparable<Config> {
return config;
}
boolean shouldCleanUp = false;
- criticalSection: synchronized (configsByClient) {
+ criticalSection: synchronized (configsByClient) {
if (parser == null || environment == null) {
config = configsByClient.get(client);
if (configMatchesRequest(config, client, parser, environment)) {
@@ -338,7 +338,7 @@ public class Config implements ConfigHelper.IConfig, Comparable<Config> {
System.out.println("Client "+key.getClass()); //$NON-NLS-1$
}
}
- synchronized (configsByClient) {
+ synchronized (configsByClient) {
Object[] keys = Collections.synchronizedMap(configsByClient).values().toArray();
Arrays.sort(keys);
int threshold = keys.length-LOWER_THRESHOLD;
@@ -398,7 +398,7 @@ public class Config implements ConfigHelper.IConfig, Comparable<Config> {
}
}
}
-
+
static boolean getVerifyMethods() {
return getConfig().verifyMethods;
}
@@ -439,10 +439,10 @@ public class Config implements ConfigHelper.IConfig, Comparable<Config> {
}
public static void setLoweringPossible(boolean val) {
- getConfig().loweringPossible = val;
+ getConfig().loweringPossible = val;
}
- /**
+ /**
* Has type checking detected that lowering is possible but not required due to expected type java.lang.Object?
* (see OTJLD 2.2(f))
*/
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/Dependencies.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/Dependencies.java
index b8f9a2deb..773c5b20f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/Dependencies.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/Dependencies.java
@@ -282,7 +282,7 @@ public class Dependencies implements ITranslationStates {
boolean done = true;
if (StateHelper.unitHasState(unit, state))
return new Pair<Boolean,Success>(done, Success.OK);
-
+
if (environment == null) {
if (unit.scope != null && unit.scope.environment != null)
environment = unit.scope.environment;
@@ -384,7 +384,7 @@ public class Dependencies implements ITranslationStates {
e.logWarning("Processing CU "+String.valueOf(unit.getFileName())+" failed"); //$NON-NLS-1$ //$NON-NLS-2$
success = Success.Fail;
}
-
+
return new Pair<Boolean,Success>(done, success);
}
@@ -1537,7 +1537,7 @@ public class Dependencies implements ITranslationStates {
faultInRoleImports(roleType);
}
}
-
+
// if (teamDecl.isRole()) {
// ensureRoleState(teamDecl.getRoleModel(), STATE_TYPES_ADJUSTED);
// }
@@ -1560,7 +1560,7 @@ public class Dependencies implements ITranslationStates {
* For team:
* 1. copy synthetic access methods
* For role:
- * 0. Binary roles: bindings for methods to be created by the OTRE
+ * 0. Binary roles: bindings for methods to be created by the OTRE
* 1. creation methods
* 2. getTeam methods
* 3. add method from non-role superclasses to the interface part.
@@ -1663,13 +1663,13 @@ public class Dependencies implements ITranslationStates {
// 5. special case roles which need an abstract _OT$getBase() method:
StandardElementGenerator.createGetBaseForUnboundLowerable(clazz);
-
+
// 6. resolve method mappings and create callout methods:
MethodMappingResolver resolver = resolveCalloutMappings(clazz);
CalloutImplementor.transformCallouts(clazz);
if (resolver != null)
resolver.resolve(false/*doCallout*/); // callins last so all methods incl. callout are already in place
-
+
if (subRoleDecl != null)
checkMissingMethods(subRole, subRoleDecl);
@@ -1678,7 +1678,7 @@ public class Dependencies implements ITranslationStates {
}
// detail of STATE_METHODS_CREATED (binary case):
- private static void createCreators(RoleModel clazz, TypeDeclaration teamType, ReferenceBinding subRole, SourceTypeBinding subTeam)
+ private static void createCreators(RoleModel clazz, TypeDeclaration teamType, ReferenceBinding subRole, SourceTypeBinding subTeam)
{
boolean needMethodBodies = needMethodBodies(teamType);
MethodBinding[] methodBindings = subRole.methods();
@@ -1706,7 +1706,7 @@ public class Dependencies implements ITranslationStates {
}
// detail of STATE_METHODS_CREATED (AST case):
- private static void createCtorsAndCreators(RoleModel clazz, TypeDeclaration teamType, TypeDeclaration subRoleDecl, SourceTypeBinding subTeam)
+ private static void createCtorsAndCreators(RoleModel clazz, TypeDeclaration teamType, TypeDeclaration subRoleDecl, SourceTypeBinding subTeam)
{
// ensure we have all constructors from tsuper (incl. default ctor)
for (ReferenceBinding tsuperRole : clazz.getTSuperRoleBindings())
@@ -1720,8 +1720,8 @@ public class Dependencies implements ITranslationStates {
if (methodDeclarations != null)
for (int i=0; i<methodDeclarations.length; i++)
if (methodDeclarations[i].isConstructor() && !TSuperHelper.isTSuper(methodDeclarations[i].binding)) {
- hasConstructor = true;
- break;
+ hasConstructor = true;
+ break;
}
if (!hasConstructor) {
ConstructorDeclaration defCtor = subRoleDecl.createDefaultConstructor(needMethodBodies, false);
@@ -1756,7 +1756,7 @@ public class Dependencies implements ITranslationStates {
}
// detail of STATE_METHODS_CREATED:
- private static MethodMappingResolver resolveCalloutMappings(RoleModel role)
+ private static MethodMappingResolver resolveCalloutMappings(RoleModel role)
{
ReferenceBinding roleBinding = role.getBinding();
@@ -1765,7 +1765,7 @@ public class Dependencies implements ITranslationStates {
&& Config.getConfig().verifyMethods)
{
boolean hasBaseclassProblem = role.hasBaseclassProblem();
-
+
if (!hasBaseclassProblem) {
ReferenceBinding baseclass = role.getBaseTypeBinding();
if (baseclass != null && !role._playedByEnclosing)
@@ -1784,7 +1784,7 @@ public class Dependencies implements ITranslationStates {
// make sure tsuper wrappers are copied to current role:
CopyInheritance.copyGeneratedFeatures(role);
-
+
// actually need to proceed even with no base class, because
// method mappings without baseclass are reported within resolve() below:
MethodMappingResolver resolver = new MethodMappingResolver(role, !hasBaseclassProblem && needMethodBodies(roleDecl));
@@ -1802,12 +1802,12 @@ public class Dependencies implements ITranslationStates {
return;
ClassScope scope = roleDecl.scope;
boolean missing = false;
- MethodBinding equals = roleBinding.getExactMethod(TypeConstants.EQUALS,
+ MethodBinding equals = roleBinding.getExactMethod(TypeConstants.EQUALS,
new TypeBinding[] {scope.getJavaLangObject()}, scope.compilationUnitScope());
if (equals == null || !equals.isValidBinding() || TypeBinding.notEquals(equals.declaringClass, roleBinding)) {
missing = true;
} else {
- MethodBinding hashCode = roleBinding.getExactMethod(TypeConstants.HASHCODE,
+ MethodBinding hashCode = roleBinding.getExactMethod(TypeConstants.HASHCODE,
Binding.NO_PARAMETERS, scope.compilationUnitScope());
if (hashCode == null || !hashCode.isValidBinding() || TypeBinding.notEquals(hashCode.declaringClass, roleBinding))
missing = true;
@@ -1816,7 +1816,7 @@ public class Dependencies implements ITranslationStates {
scope.problemReporter().missingEqualsHashCodeWithInstantation(scope.referenceContext, instantiationPolicy);
}
}
- // copied abstract methods are not yet checked for callout inference (which is normally triggered from checkMethods())
+ // copied abstract methods are not yet checked for callout inference (which is normally triggered from checkMethods())
if (roleBinding.isClass() && roleDecl.methods != null) {
for (AbstractMethodDeclaration method : roleDecl.methods) {
if (((method.modifiers & ClassFileConstants.AccAbstract) != 0) && method.isCopied) {
@@ -1865,7 +1865,7 @@ public class Dependencies implements ITranslationStates {
}
CopyInheritance.weakenTeamMethodSignatures(teamDecl);
-
+
}
teamModel.setState(STATE_TYPES_ADJUSTED);
return true;
@@ -2001,7 +2001,7 @@ public class Dependencies implements ITranslationStates {
TypeDeclaration roleDecl = role.getAst();
WeavingScheme weavingScheme = role.getWeavingScheme(); // always trigger initialization
if (Config.getConfig().verifyMethods)
- {
+ {
if (roleDecl == null) {
TeamModel teamModel = role.getTeamModel();
if (teamModel != null && teamModel.getAst() != null) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/ITranslationStates.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/ITranslationStates.java
index 687761ce8..880e4aea1 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/ITranslationStates.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/ITranslationStates.java
@@ -46,7 +46,7 @@ public interface ITranslationStates {
public static final int STATE_LENV_DONE_FIELDS_AND_METHODS= 7;//LookupEnvironment & Deps.
public static final int STATE_ROLES_LINKED = 8;//LookupEnvironment & RoleSplitter
public static final int STATE_METHODS_PARSED = 9;//Compiler
-// removed state:
+// removed state:
// public static final int STATE_ROLE_INIT_METHODS = 10;//RoleInitializationMethod
//
public static final int STATE_ROLE_HIERARCHY_ANALYZED = 10;//Lifting
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/StateHelper.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/StateHelper.java
index ab3cdd0e5..4133c155e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/StateHelper.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/StateHelper.java
@@ -236,20 +236,20 @@ public class StateHelper
return false;
return isReadyToProcess(type.model, state);
}
-
+
public static boolean isDefinitelyReadyToProcess(ReferenceBinding type, ReferenceBinding requestingSite, int state) {
-
+
if (!(type instanceof SourceTypeBinding))
return false; // most treatment not needed for binary types
SourceTypeBinding sourceType = (SourceTypeBinding) type;
-
- if (TypeBinding.equalsEquals(sourceType.outermostEnclosingType().erasure(), requestingSite.outermostEnclosingType().erasure())
+
+ if (TypeBinding.equalsEquals(sourceType.outermostEnclosingType().erasure(), requestingSite.outermostEnclosingType().erasure())
|| CharOperation.equals(type.getFileName(), requestingSite.getFileName()))
return false; // could infinitely recurse to the same inclosing of kind
-
+
if (!StateHelper.isReadyToProcess(sourceType, state))
return false;
-
+
try {
StateMemento unitState = sourceType.scope.compilationUnitScope().referenceContext.state;
if (unitState.isReadyToProcess(state))
@@ -257,7 +257,7 @@ public class StateHelper
} catch (NullPointerException npe) {
// be shy, if any enclosing thing was missing don't risk infinite recursion.
}
-
+
return false;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lifting/ArrayLifting.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lifting/ArrayLifting.java
index f4f7d2d4a..897819cd5 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lifting/ArrayLifting.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lifting/ArrayLifting.java
@@ -39,7 +39,7 @@ public class ArrayLifting extends ArrayTranslations {
BlockScope scope,
Expression teamExpr,
Expression expression,
- TypeBinding providedType,
+ TypeBinding providedType,
TypeBinding requiredType)
{
this._teamExpr = teamExpr;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lifting/ArrayLowering.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lifting/ArrayLowering.java
index dd5b12f05..200844f00 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lifting/ArrayLowering.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lifting/ArrayLowering.java
@@ -41,7 +41,7 @@ public class ArrayLowering extends ArrayTranslations {
public ArrayLowering(Expression teamExpression) {
this._teamExpr = teamExpression;
}
-
+
/** API for Lowering. */
Expression lowerArray(
BlockScope scope,
@@ -59,7 +59,7 @@ public class ArrayLowering extends ArrayTranslations {
this._teamExpr.resolveType(scope);
return translateArray(scope, expression, providedType, requiredType, /*isLifting*/false, deferredResolve);
}
-
+
@Override
public MethodBinding ensureTransformMethod(BlockScope scope, Expression teamExpr, TypeBinding providedType, TypeBinding requiredType, boolean isLifting) {
TypeBinding providedLeaf = providedType.leafComponentType();
@@ -67,7 +67,7 @@ public class ArrayLowering extends ArrayTranslations {
TypeBinding requiredLeaf = requiredType.leafComponentType();
if (TypeBinding.notEquals(matchingBase, requiredLeaf) && matchingBase.isCompatibleWith(requiredLeaf, scope)) {
requiredType = scope.environment().createArrayType(matchingBase, requiredType.dimensions());
- }
+ }
return super.ensureTransformMethod(scope, teamExpr, providedType, requiredType, isLifting);
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lifting/DeclaredLifting.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lifting/DeclaredLifting.java
index 901fd3cc3..f80df77df 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lifting/DeclaredLifting.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lifting/DeclaredLifting.java
@@ -232,7 +232,7 @@ public class DeclaredLifting implements IOTConstants {
// spare the details during completion - see comment regarding local.declaration.initialization inside
// InternalExtendedCompletionContext.searchVisibleVariablesAndMethods(Scope, ObjectVector, ObjectVector, ObjectVector, boolean)
- if (!Config.isUsingAssistParser()) {
+ if (!Config.isUsingAssistParser()) {
if ( roleRef.isValidBinding()
&& roleRef.isRole()
&& (roleRef.tagBits & TagBits.HierarchyHasProblems) == 0
@@ -252,7 +252,7 @@ public class DeclaredLifting implements IOTConstants {
baseType = (ReferenceBinding) baseScope.getType(ltr.baseTokens, ltr.baseTokens.length);
baseScope.originalScope = null;
}
- }
+ }
if (baseType == null || !baseType.isValidBinding())
// fall back to normal scope:
baseType = (ReferenceBinding)scope.getType(ltr.baseTokens, ltr.baseTokens.length);
@@ -413,19 +413,19 @@ public class DeclaredLifting implements IOTConstants {
return TypeBinding.equalsEquals(((MemberTypeBinding)type).enclosingType(), enclosingTeam.erasure());
return false;
}
-
+
/**
* A team constructor copied for declared lifting requests access to targetMethod.
* This can happen in two ways:
* - create a new copy of the target constructor
* - create a turning constructor that delegates to the target constructor using a real super call.
- * The strategy is chosen by searching the argument types for role types.
+ * The strategy is chosen by searching the argument types for role types.
*/
- public static MethodBinding createCopyOrTurningCtor(Scope scope,
+ public static MethodBinding createCopyOrTurningCtor(Scope scope,
MethodBinding targetConstructor,
TypeBinding[] argumentTypes,
boolean needsLifting,
- AstGenerator gen)
+ AstGenerator gen)
{
if (RoleTypeBinding.hasNonExternalizedRoleParameter(targetConstructor))
return copyTeamConstructorForDeclaredLifting(
@@ -491,7 +491,7 @@ public class DeclaredLifting implements IOTConstants {
ConstructorDeclaration srcCtor = (ConstructorDeclaration)src;
if (src.isCopied) {
if (src.model != null)
- selfcall = src.model.adjustedSelfcall;
+ selfcall = src.model.adjustedSelfcall;
} else if (srcCtor.constructorCall != null) {
Dependencies.ensureTeamState(superTeamCtor.declaringClass.getTeamModel(),
ITranslationStates.STATE_RESOLVED);
@@ -542,7 +542,7 @@ public class DeclaredLifting implements IOTConstants {
ClassFileConstants.AccPublic,
teamDecl.name,
AstConverter.createArgumentsFromParameters(providedWithMarker, gen));
-
+
// adjust argument-anchored types in this signature:
for (int i=0; i<superTeamCtor.parameters.length; i++)
if (RoleTypeBinding.isRoleWithExplicitAnchor(superTeamCtor.parameters[i])) {
@@ -573,7 +573,7 @@ public class DeclaredLifting implements IOTConstants {
* A constructor being copied contains a self call which might require
* transitive copying of more team constructors.
* @param scope scope of the location triggering this copy operation
- * @param selfcall
+ * @param selfcall
* @param providedArgs arguments provided to the selfcall
* @param needsLifting has the context required lifting of any args? pass this info down.
* @param gen
@@ -724,12 +724,12 @@ public class DeclaredLifting implements IOTConstants {
char[] dynamicLiftingSelector = dynamicLiftSelector(roleType);
if (teamDecl.binding.getMethods(dynamicLiftingSelector) != Binding.NO_METHODS)
return; // already present
-
+
if (roleType.isArrayType()) {
teamDecl.scope.problemReporter().missingImplementation(ref, "Generic lifting of array not yet implemented.");
} else if (roleType.isBaseType()) {
teamDecl.scope.problemReporter().primitiveTypeNotAllowedForLifting(teamDecl, ref, roleType);
- } else {
+ } else {
// reference type
AstGenerator gen = new AstGenerator(ref);
MethodDeclaration dynLiftMeth = gen.method(teamDecl.compilationResult(),
@@ -739,7 +739,7 @@ public class DeclaredLifting implements IOTConstants {
new Argument[] {
gen.argument(IOTConstants.BASE, gen.qualifiedTypeReference(TypeConstants.JAVA_LANG_OBJECT))
});
-
+
dynLiftMeth.statements = new Statement[] { gen.emptyStatement() }; // to be replaced below
int problemId = teamDecl.getTeamModel().canLiftingFail((ReferenceBinding) roleType.erasure());
if (problemId == 0) {
@@ -756,10 +756,10 @@ public class DeclaredLifting implements IOTConstants {
}
if (problemId != 0)
- AstEdit.addException(dynLiftMeth,
- gen.qualifiedTypeReference(IOTConstants.O_O_LIFTING_FAILED_EXCEPTION),
+ AstEdit.addException(dynLiftMeth,
+ gen.qualifiedTypeReference(IOTConstants.O_O_LIFTING_FAILED_EXCEPTION),
false/*resolve*/);
-
+
dynLiftMeth.hasParsedStatements = true;
AstEdit.addMethod(teamDecl, dynLiftMeth);
dynLiftMeth.binding.returnType = ((ReferenceBinding)roleType).getRealType().erasure(); // force erased type after signature resolve
@@ -805,19 +805,19 @@ public class DeclaredLifting implements IOTConstants {
return ifStat;
}
- private static IfStatement genNewIf(BlockScope scope, AstGenerator gen, ReferenceBinding boundDescendant,
- LookupEnvironment environment)
+ private static IfStatement genNewIf(BlockScope scope, AstGenerator gen, ReferenceBinding boundDescendant,
+ LookupEnvironment environment)
{
TypeBinding boundBase = boundDescendant.baseclass();
if (RoleTypeBinding.isRoleWithExplicitAnchor(boundBase)) {
if (boundBase.isParameterizedType()) {
// tricky case: need to discard type parameters, but retain/recreate the role type wrapping:
RoleTypeBinding baseRole = (RoleTypeBinding)boundBase;
- boundBase = environment.createParameterizedType(baseRole._declaredRoleType,
+ boundBase = environment.createParameterizedType(baseRole._declaredRoleType,
null, // erase type parameters
baseRole._teamAnchor, // but retain anchor
-1, // valueParamPosition
- baseRole.enclosingType(),
+ baseRole.enclosingType(),
Binding.NO_ANNOTATIONS);
}
// only RTB but not parameterized: leave unchanged.
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lifting/Lifting.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lifting/Lifting.java
index a348d4d42..bf181ca39 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lifting/Lifting.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lifting/Lifting.java
@@ -118,12 +118,12 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.util.TypeAnalyzer;
public class Lifting extends SwitchOnBaseTypeGenerator
implements TypeIds, ClassFileConstants, ExtraCompilerModifiers
{
-
+
public static enum InstantiationPolicy { NEVER, ONDEMAND, SINGLETON, ALWAYS, ERROR;
public boolean isAlways() { return this == ALWAYS; }
public boolean isOndemand() { return this == ONDEMAND; }
}
-
+
private RoleModel _boundRootRoleModel = null;
private AstGenerator _gen = null;
private long _sourceLevel;
@@ -278,7 +278,7 @@ public class Lifting extends SwitchOnBaseTypeGenerator
}
);
gen.addNonNullAnnotation(arg, scope.environment());
-
+
RoleModel implicitSuperRole = roleModel.getImplicitSuperRole();
// default arg name is base.
@@ -493,13 +493,13 @@ public class Lifting extends SwitchOnBaseTypeGenerator
} else {
// here an (unnecessary) cast to j.l.Object prevents a warning re OTJLD 2.2(f):
roleExpression = gen.castExpression(
- roleExpression,
- gen.qualifiedTypeReference(TypeConstants.JAVA_LANG_OBJECT),
+ roleExpression,
+ gen.qualifiedTypeReference(TypeConstants.JAVA_LANG_OBJECT),
CastExpression.RAW);
}
statements[1] =
// OTDYN: Slightly different methods depending on the weaving strategy:
- boundRootRoleModel.getWeavingScheme() == WeavingScheme.OTDRE
+ boundRootRoleModel.getWeavingScheme() == WeavingScheme.OTDRE
? gen.messageSend(
gen.castExpression(
gen.singleNameReference(_OT_BASE),
@@ -792,9 +792,9 @@ public class Lifting extends SwitchOnBaseTypeGenerator
ReferenceBinding roleClassBinding = roleModel.getBinding();
if (this._boundRootRoleModel.isRoleFile()) {
- this._gen = MethodModel.setupSourcePositionMapping(liftToMethodDeclaration,
+ this._gen = MethodModel.setupSourcePositionMapping(liftToMethodDeclaration,
teamBinding._teamModel.getAst(),
- roleModel,
+ roleModel,
this._gen);
}
@@ -815,7 +815,7 @@ public class Lifting extends SwitchOnBaseTypeGenerator
// conditional generation (see below)
maybeCreateTeamMemberCheck(baseClassBinding),
- (RoleModel.getInstantiationPolicy(roleClassBinding).isOndemand())
+ (RoleModel.getInstantiationPolicy(roleClassBinding).isOndemand())
// if(!_OT$team_param._OT$cache_OT$RootRole.containsKey(base))
? createRoleExistentCheck(
roleClassBinding,
@@ -924,7 +924,7 @@ public class Lifting extends SwitchOnBaseTypeGenerator
return this._gen.block(
// (create a role of the best matching type:)
new Statement[] {
- caseObjects.length > 0
+ caseObjects.length > 0
? createSwitchStatement(teamType, roleType, caseObjects, problemId, this._gen)
: genLiftingFailedException(BASE, roleType, problemId, this._gen)});
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lifting/LiftingEnvironment.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lifting/LiftingEnvironment.java
index 1a4b64878..8da6d8aef 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lifting/LiftingEnvironment.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lifting/LiftingEnvironment.java
@@ -160,7 +160,7 @@ public class LiftingEnvironment
ReflectionGenerator.createRoleQueryMethods(this._teamType, weavingScheme);
return;
}
-
+
if (lateRole == null)
TeamMethodGenerator.addFakedTeamRegistrationMethods(this._teamType.binding);
@@ -198,7 +198,7 @@ public class LiftingEnvironment
}
}
}
-
+
/**
* @param lifting
* @param node representing the role to generate for
@@ -329,14 +329,14 @@ public class LiftingEnvironment
// Somehow, this doesn't happen automagically.
// But by declaring the caches public the issue is completely avoided,
// hoping, that no-one maliciously accesses the cache.
-
+
// if base is generic, we refer to it via the raw type, suppress that warning:
// if (usingRawType) {
// field.annotations = new Annotation[] {
-// gen.singleStringsMemberAnnotation(TypeConstants.JAVA_LANG_SUPPRESSWARNINGS, new char[][]{"rawtypes".toCharArray()}) //$NON-NLS-1$
+// gen.singleStringsMemberAnnotation(TypeConstants.JAVA_LANG_SUPPRESSWARNINGS, new char[][]{"rawtypes".toCharArray()}) //$NON-NLS-1$
// };
// }
-
+
AstEdit.addField(teamDecl, field, true, false/*typeProblem*/, false);
teamDecl.getTeamModel().addCache(field);
}
@@ -358,7 +358,7 @@ public class LiftingEnvironment
{
AstGenerator gen = new AstGenerator(teamType.sourceStart, teamType.sourceEnd);
gen.shiftPosition(); // don't let @SuppressWarnings interfere with non-generated code.
-
+
initMethod = gen.method(
teamType.compilationResult,
ClassFileConstants.AccPrivate, // no overriding!!
@@ -367,7 +367,7 @@ public class LiftingEnvironment
null);
initMethod.statements = new Statement[0]; // to be filled by fillInitCaches()
initMethod.annotations = new Annotation[] { // in case base type is a raw type
- gen.singleStringsMemberAnnotation(TypeConstants.JAVA_LANG_SUPPRESSWARNINGS, new char[][]{"all".toCharArray()}) //$NON-NLS-1$
+ gen.singleStringsMemberAnnotation(TypeConstants.JAVA_LANG_SUPPRESSWARNINGS, new char[][]{"all".toCharArray()}) //$NON-NLS-1$
};
AstEdit.addMethod(teamType, initMethod);
initMethod.modifiers |= ExtraCompilerModifiers.AccLocallyUsed; // prevent 'unused' warning
@@ -386,7 +386,7 @@ public class LiftingEnvironment
}
// Serialization: generate restore methods to initialize caches/register roles:
- SerializationGenerator.generateRestoreMethods(teamType, gen);
+ SerializationGenerator.generateRestoreMethods(teamType, gen);
}
return initMethod;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lifting/Lowering.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lifting/Lowering.java
index 2a40af45c..e6a56bf3c 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lifting/Lowering.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lifting/Lowering.java
@@ -153,7 +153,7 @@ public class Lowering implements IOTConstants {
if (unloweredExpression.constant == null)
unloweredExpression.resolveType(scope);
callLower.resolvedType = roleType.baseclass();
-
+
callLower.binding =
StandardElementGenerator.getGetBaseMethod(
scope,
@@ -210,7 +210,7 @@ public class Lowering implements IOTConstants {
}
return loweringExpr;
}
-
+
@NonNull LocalVariableBinding makeNewLocal(BlockScope scope, TypeBinding variableType, int sourceStart, int sourceEnd, boolean deferredResolve) {
char[] name = ("_OT$unlowered$"+sourceStart).toCharArray(); //$NON-NLS-1$
LocalVariableBinding varBinding = new LocalVariableBinding(name, variableType, 0, false);
@@ -221,10 +221,10 @@ public class Lowering implements IOTConstants {
varBinding.useFlag = LocalVariableBinding.USED;
return varBinding;
}
-
+
/** A conditional expression that checks for null before performing the actual lowering. */
static class CheckedLoweringExpression extends ConditionalExpression {
-
+
private final LocalVariableBinding localVar;
Expression origExpression;
private Expression teamExpression;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/AbstractOTReferenceBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/AbstractOTReferenceBinding.java
index dd3dd34fb..c6fd64b64 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/AbstractOTReferenceBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/AbstractOTReferenceBinding.java
@@ -74,11 +74,11 @@ public abstract class AbstractOTReferenceBinding extends TypeBinding
// allow to see this as a ReferenceBinding:
protected abstract ReferenceBinding _this();
-
+
public AbstractOTReferenceBinding(ReferenceBinding prototype) {
super(prototype);
}
-
+
protected AbstractOTReferenceBinding() {
super();
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/AnchorMapping.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/AnchorMapping.java
index 5e7176f1c..6003a0021 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/AnchorMapping.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/AnchorMapping.java
@@ -122,7 +122,7 @@ public class AnchorMapping {
* a list of parameters. This means to propagate type anchors into all role types.
* @param scope For resolving names.
* @param parameters formal parameters of 'currentMethod' - to be instantiated from this anchor mapping
- * @param currentMethod a candidate for the current method call - can be null when checking method mappings
+ * @param currentMethod a candidate for the current method call - can be null when checking method mappings
* @return new array or 'parameters'
*/
public static TypeBinding[] instantiateParameters(Scope scope, TypeBinding[] parameters, MethodBinding currentMethod)
@@ -137,7 +137,7 @@ public class AnchorMapping {
{
if (this._arguments != null && this._arguments.length != parameters.length)
return parameters; // don't bother to instantiate if lenghts disagree (=> varargs and param-anchored types don't work together)
-
+
if (scope == null)
scope = this._scope; // scope would be more specific but _scope is OK, too.
TypeBinding[] newParams = null;
@@ -158,10 +158,10 @@ public class AnchorMapping {
return newParams;
return parameters;
}
- // PRE: this._arguments != null => this._arguments.length == parameters.length
+ // PRE: this._arguments != null => this._arguments.length == parameters.length
private TypeBinding instantiateParameter(final Scope scope, final TypeBinding parameter, final int i, final MethodBinding currentMethod, final boolean isMethodEnhanced)
{
- return RoleTypeCreator.deepSubstitute(parameter, scope.environment(),
+ return RoleTypeCreator.deepSubstitute(parameter, scope.environment(),
new IDependentTypeSubstitution() {
@Override
@SuppressWarnings("synthetic-access")
@@ -170,11 +170,11 @@ public class AnchorMapping {
ITeamAnchor anchor = null;
if (AnchorMapping.this._arguments != null)
anchor = translateAnchor(scope, AnchorMapping.this._arguments[srcIdx], paramDependentType, currentMethod);
-
+
// missing a required anchor?
if (anchor == null && paramDependentType.hasAnchorWithinThisMethodsSignature(currentMethod))
return new ProblemReferenceBinding(paramDependentType.sourceName(), ProblemReasons.AnchorNotFound, paramDependentType);
-
+
if (anchor == null && AnchorMapping.this._receiver != null)
{
if (DependentTypeBinding.isDependentTypeOf(
@@ -196,7 +196,7 @@ public class AnchorMapping {
}
}
if (DependentTypeBinding.isDependentTypeVariable(currentMethod.parameters[i])) {
- TypeVariableBinding typeVariable = (TypeVariableBinding) ((DependentTypeBinding)currentMethod.parameters[i]).type;
+ TypeVariableBinding typeVariable = (TypeVariableBinding) ((DependentTypeBinding)currentMethod.parameters[i]).type;
ITeamAnchor[] anchors = typeVariable.anchors;
if (anchors != null && anchors[0] instanceof LocalVariableBinding) { // FIXME(SH): more positions?
int pos = ((LocalVariableBinding)anchors[0]).resolvedPosition;
@@ -213,8 +213,8 @@ public class AnchorMapping {
}
});
}
-
- private ITeamAnchor translateAnchor(Scope scope, ASTNode typedNode, DependentTypeBinding paramDependentType, MethodBinding currentMethod)
+
+ private ITeamAnchor translateAnchor(Scope scope, ASTNode typedNode, DependentTypeBinding paramDependentType, MethodBinding currentMethod)
{
ProblemReporter problemReporter = scope != null ? scope.problemReporter() : null;
ITeamAnchor anchor = null;
@@ -230,7 +230,7 @@ public class AnchorMapping {
roleType, // roleType
problemReporter, //
typedNode); // typedNode
- else // when resolving a method spec, we interpret an Argument as an anchor expression
+ else // when resolving a method spec, we interpret an Argument as an anchor expression
anchor = ((Argument)anchorExpr).binding;
} else if (paramDependentType._teamAnchor instanceof TThisBinding)
@@ -267,7 +267,7 @@ public class AnchorMapping {
return anchor;
}
- // if anchor is valid return it otherwise null
+ // if anchor is valid return it otherwise null
private ITeamAnchor validAnchor(ITeamAnchor anchor) {
if ( (anchor != null)
&& (anchor != RoleTypeBinding.NoAnchor)
@@ -307,13 +307,13 @@ public class AnchorMapping {
}
return false;
}
-
+
/** Is 'instantiation' a legal instantiation for 'typeVariable' in terms of team anchors? */
public static boolean isLegalInstantiation(TypeVariableBinding typeVariable, DependentTypeBinding instantiation) {
AnchorMapping currentMapping = currentMappings.get();
if (currentMapping != null)
return currentMapping.internalIsLegalInstantiation(typeVariable, instantiation);
- return false;
+ return false;
}
private boolean internalIsLegalInstantiation(TypeVariableBinding typeVariable, DependentTypeBinding instantiation) {
ITeamAnchor[] anchors = typeVariable.anchors;
@@ -327,10 +327,10 @@ public class AnchorMapping {
return false;
}
- private boolean areTypeEqual(RoleTypeBinding role1, RoleTypeBinding role2, MethodBinding currentMethod)
+ private boolean areTypeEqual(RoleTypeBinding role1, RoleTypeBinding role2, MethodBinding currentMethod)
{
ITeamAnchor anchor = translateAnchor(null/*scope*/, null/*node*/, role1, currentMethod);
-
+
if (anchor != null)
return role2.isSameType(role1, anchor);
@@ -385,7 +385,7 @@ public class AnchorMapping {
}
} else if ( loweringPossible // if we detected lowering possible before, recheck here
&& arguments[i].resolvedType != null
- && arguments[i].resolvedType.isRoleType())
+ && arguments[i].resolvedType.isRoleType())
{
((DependentTypeBinding)arguments[i].resolvedType).recheckAmbiguousLowering(parameters[i], arguments[i], scope, messageSend.binding);
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/CallinCalloutBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/CallinCalloutBinding.java
index 42baab57b..3d7d939eb 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/CallinCalloutBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/CallinCalloutBinding.java
@@ -313,7 +313,7 @@ public class CallinCalloutBinding extends Binding
return CharOperation.concat(theName, currentType.readableName(), '$');
}
/**
- * Answer the name of the role that introduced this callin mapping
+ * Answer the name of the role that introduced this callin mapping
* (support for overriding in otredyn).
*/
public ReferenceBinding introducingRoleClass() {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/CallinCalloutScope.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/CallinCalloutScope.java
index 5fc2c17d7..97d331360 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/CallinCalloutScope.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/CallinCalloutScope.java
@@ -127,7 +127,7 @@ public class CallinCalloutScope extends MethodScope {
if (!(binding instanceof LocalVariableBinding)) // local
return binding;
LocalVariableBinding localBinding = (LocalVariableBinding)binding;
- if ( localBinding.declaringScope != null
+ if ( localBinding.declaringScope != null
&& localBinding.declaringScope.isMethodMappingWrapper()) // defined in a method mapping wrapper
{
// hide internal local var but re-resolve:
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/DependentTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/DependentTypeBinding.java
index d67a885f3..39eab7146 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/DependentTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/DependentTypeBinding.java
@@ -60,7 +60,7 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.statemachine.transfor
*
* Current limitations:
* - Only one value parameter is supported, yet.
- *
+ *
* Design note: since 1.3.0 this class is a subclass of ParameterizedTypeBinding in order to
* support combinations of value parameters and type parameters, specifically, generic role types.
*
@@ -92,11 +92,11 @@ public class DependentTypeBinding extends ParameterizedTypeBinding {
private ArrayBinding[] _arrayBindings = null;
/** Public constructor for clients (FIXME: let only environment create us) */
- public DependentTypeBinding(ReferenceBinding type, TypeBinding[] typeArguments, ITeamAnchor teamAnchor, int paramPosition, ReferenceBinding enclosingType, LookupEnvironment lookupEnvironment)
+ public DependentTypeBinding(ReferenceBinding type, TypeBinding[] typeArguments, ITeamAnchor teamAnchor, int paramPosition, ReferenceBinding enclosingType, LookupEnvironment lookupEnvironment)
{
super(type, typeArguments, teamAnchor, enclosingType, lookupEnvironment);
initializeFromType(type);
- initializeDependentType(teamAnchor, paramPosition);
+ initializeDependentType(teamAnchor, paramPosition);
}
/** For subclasses. Still need to call initializeDependentType afterwards. */
@@ -110,7 +110,7 @@ public class DependentTypeBinding extends ParameterizedTypeBinding {
this.modifiers = givenType.modifiers;
this.tagBits = givenType.tagBits;
this.tagBits &= ~(TagBits.AreMethodsSorted|TagBits.AreMethodsComplete); // in case the generic type was already processed
-
+
this.compoundName = givenType.compoundName;
this.sourceName = givenType.sourceName;
this.constantPoolName = givenType.constantPoolName;
@@ -136,7 +136,7 @@ public class DependentTypeBinding extends ParameterizedTypeBinding {
// registerAnchor();
}
- void initializeDependentType(ITeamAnchor anchor, int valueParamPosition)
+ void initializeDependentType(ITeamAnchor anchor, int valueParamPosition)
{
// don't store baseclass, will be initialized by baseclass()
@@ -152,7 +152,7 @@ public class DependentTypeBinding extends ParameterizedTypeBinding {
else if (anchor instanceof FieldBinding)
((FieldBinding)anchor).modifiers |= ExtraCompilerModifiers.AccLocallyUsed; // avoid unused-warning
}
-
+
public void updateAnchor(Argument[] methodArguments) {
if (this._argumentPosition > -1) {
this._teamAnchor = methodArguments[this._argumentPosition].binding;
@@ -249,7 +249,7 @@ public class DependentTypeBinding extends ParameterizedTypeBinding {
public void collectSubstitutes(Scope scope, TypeBinding actualType, InferenceContext inferenceContext, int constraint) {
this.transferTypeArguments(this.type).collectSubstitutes(scope, actualType, inferenceContext, constraint);
}
-
+
// implement new method from Substitution:
@Override
@@ -273,7 +273,7 @@ public class DependentTypeBinding extends ParameterizedTypeBinding {
return true; // could be anchored type variable
return binding.valueParamSynthArgs() != NO_SYNTH_ARGUMENTS;
}
-
+
@Override
public boolean isParameterizedType() {
return this.arguments != null; // by inheritance we'd be parameterized, but if we don't have arguments, it's only value parameters.
@@ -283,7 +283,7 @@ public class DependentTypeBinding extends ParameterizedTypeBinding {
public DependentTypeBinding asPlainDependentType() {
return this;
}
-
+
@Override
public boolean isPlainDependentType() {
return true;
@@ -332,16 +332,16 @@ public class DependentTypeBinding extends ParameterizedTypeBinding {
// for internal casting purposes type anchors can be ignored:
return getRealType().isProvablyDistinct(otherType);
}
-
+
@Override
public int kind() {
return (this.arguments != null) ? Binding.PARAMETERIZED_TYPE : this.type.kind();
}
/**
- * Re-check lowering ambiguity (OTJLD 2.2(f)) after type checking had detected this situation before.
+ * Re-check lowering ambiguity (OTJLD 2.2(f)) after type checking had detected this situation before.
* (see {@link Config#getLoweringPossible()}).
- *
+ *
* @param otherType declared type to which a value of this type is being attached.
* @param location AST node for problem reporting
* @param scope scope for problem reporting
@@ -360,7 +360,7 @@ public class DependentTypeBinding extends ParameterizedTypeBinding {
if ( CharOperation.equals(resolvedMethod.selector, ReflectionGenerator.UNREGISTER_ROLE)
&& ( resolvedMethod.parameters.length == 1
|| resolvedMethod.parameters.length == 2))
- return;
+ return;
}
}
scope.problemReporter().ambiguousUpcastOrLowering(location, otherType, this);
@@ -410,7 +410,7 @@ public class DependentTypeBinding extends ParameterizedTypeBinding {
public ReferenceBinding rawBaseclass() {
return this.type.rawBaseclass();
}
-
+
@Override
public TypeBinding original() {
return this.type.original();
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/PrecedenceBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/PrecedenceBinding.java
index be63651f4..f4f3ff60d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/PrecedenceBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/PrecedenceBinding.java
@@ -393,7 +393,7 @@ public class PrecedenceBinding extends Binding {
names[i] = "<unresolved>".toCharArray(); //$NON-NLS-1$
else if (this.elements[i].kind() == Binding.BINDING)
names[i] = ((CallinCalloutBinding)this.elements[i]).name;
- else
+ else
names[i] = ((ReferenceBinding)this.elements[i]).sourceName();
}
return CharOperation.concatWith(names, ',');
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/ProblemAnchorBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/ProblemAnchorBinding.java
index 2953f8d9a..6c7f5fd49 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/ProblemAnchorBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/ProblemAnchorBinding.java
@@ -24,9 +24,9 @@ import org.eclipse.jdt.internal.compiler.lookup.Scope;
/**
- * Represents a team anchor for which a problem has been detected but not
+ * Represents a team anchor for which a problem has been detected but not
* immediately been reported.
- *
+ *
* @author stephan
* @since 1.4.0
*/
@@ -34,7 +34,7 @@ public class ProblemAnchorBinding extends TeamAnchor {
TeamAnchor closestMatch;
int problemId;
-
+
public ProblemAnchorBinding(TeamAnchor closestMatch, int problemId) {
super();
this.closestMatch = closestMatch;
@@ -70,19 +70,19 @@ public class ProblemAnchorBinding extends TeamAnchor {
public boolean isFinal() {
return this.closestMatch.isFinal();
}
-
+
@Override
public int problemId() {
return this.problemId;
}
- /**
+ /**
* Check if given anchor is a ProblemAnchorBinding and report error if suitable.
* @param scope for reporting
* @param location for reporting
* @param anchor given anchor to check
* @param typeName for reporting
- * @return true if anchor is valid, false if it is null or a ProblemAnchorBinding.
+ * @return true if anchor is valid, false if it is null or a ProblemAnchorBinding.
*/
public static boolean checkAnchor(Scope scope, ASTNode location, ITeamAnchor anchor, char[] typeName) {
if (anchor == null)
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/RoleTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/RoleTypeBinding.java
index 7c8a2bfba..997e521ef 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/RoleTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/RoleTypeBinding.java
@@ -155,13 +155,13 @@ public class RoleTypeBinding extends DependentTypeBinding
// ============= CREATION AND INSTANCE REGISTRY: ===================
- public RoleTypeBinding(ReferenceBinding genericType, TypeBinding[] typeArguments, ITeamAnchor teamAnchor, ReferenceBinding enclosingType, LookupEnvironment lookupEnvironment)
+ public RoleTypeBinding(ReferenceBinding genericType, TypeBinding[] typeArguments, ITeamAnchor teamAnchor, ReferenceBinding enclosingType, LookupEnvironment lookupEnvironment)
{
super(genericType.getRealType(), typeArguments, teamAnchor, enclosingType, lookupEnvironment);
initialize(genericType, teamAnchor);
}
- private void initialize(ReferenceBinding roleType, ITeamAnchor teamAnchor)
+ private void initialize(ReferenceBinding roleType, ITeamAnchor teamAnchor)
{
// FIXME(SH): is it OK to strip ParameterizedFields?
if (teamAnchor instanceof ParameterizedFieldBinding)
@@ -216,7 +216,7 @@ public class RoleTypeBinding extends DependentTypeBinding
this._staticallyKnownRoleClass = transferTypeArguments(this._staticallyKnownRoleClass);
}
this._staticallyKnownRoleType = transferTypeArguments(this._staticallyKnownRoleType);
-
+
this._declaredRoleType = this._staticallyKnownRoleType;
// keep these consistent with _declaredRoleType:
this.roleModel = this._declaredRoleType.roleModel;
@@ -239,7 +239,7 @@ public class RoleTypeBinding extends DependentTypeBinding
// record as known role type at teamAnchor and in our own cache
registerAnchor();
}
-
+
@Override
public TypeBinding clone(TypeBinding outerType) {
RoleTypeBinding clone = new RoleTypeBinding(this.type, typeArguments(), this._teamAnchor, (ReferenceBinding) outerType, this.environment);
@@ -257,10 +257,10 @@ public class RoleTypeBinding extends DependentTypeBinding
@Override
public ReferenceBinding weakenFrom(ReferenceBinding other) {
if (other instanceof RoleTypeBinding) {
- if (this.weakenedTypes == null)
+ if (this.weakenedTypes == null)
this.weakenedTypes = new HashMap<ReferenceBinding, DependentTypeBinding>();
ReferenceBinding knownWeakened = this.weakenedTypes.get(other);
- if (knownWeakened != null)
+ if (knownWeakened != null)
return knownWeakened;
RoleTypeBinding otherRTB = (RoleTypeBinding)other;
DependentTypeBinding newWeakened = new WeakenedTypeBinding(this, otherRTB._declaredRoleType, this.environment);
@@ -338,7 +338,7 @@ public class RoleTypeBinding extends DependentTypeBinding
public boolean isRoleType() {
return true;
}
-
+
@Override
public boolean isPlainDependentType() {
return false;
@@ -386,7 +386,7 @@ public class RoleTypeBinding extends DependentTypeBinding
return false;
return !((DependentTypeBinding)type).hasExplicitAnchor();
}
-
+
@Override
public DependentTypeBinding asPlainDependentType() {
return null;
@@ -444,7 +444,7 @@ public class RoleTypeBinding extends DependentTypeBinding
public TypeBinding erasure() {
return this.type.erasure();
}
-
+
@Override
public ReferenceBinding genericType() {
// check if any regular genericity is involved:
@@ -518,7 +518,7 @@ public class RoleTypeBinding extends DependentTypeBinding
return this.type.getMethods(selector);
return super.getMethods(selector);
}
-
+
@Override
public MethodBinding[] availableMethods() {
return this._staticallyKnownRoleType.availableMethods();
@@ -694,7 +694,7 @@ public class RoleTypeBinding extends DependentTypeBinding
return null;
}
-
+
@Override
public boolean isHierarchyConnected() {
return this.type.isHierarchyConnected();
@@ -851,7 +851,7 @@ public class RoleTypeBinding extends DependentTypeBinding
rightTeam))
{
rightRole = (RoleTypeBinding)this._teamAnchor.getMemberTypeOfType(rightRole.internalName());
-
+
} else {
return false;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/SyntheticBaseCallSurrogate.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/SyntheticBaseCallSurrogate.java
index 36b20525c..e306bdd11 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/SyntheticBaseCallSurrogate.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/SyntheticBaseCallSurrogate.java
@@ -45,7 +45,7 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.util.TSuperHelper;
/**
* This class represents placeholder base-call surrogates which only throw
* an OTREInternalError -> no need to have these generated by the OTRE.
- *
+ *
* @author stephan
* @since 1.3.0
*/
@@ -56,11 +56,11 @@ public class SyntheticBaseCallSurrogate extends SyntheticOTMethodBinding
private TypeBinding errorType;
private ReferenceBinding stringType;
-
+
/**
* Create a binding for a synthetic base-call surrogate.
- *
- * @param callinMethod the callin method potentially holding base-calls
+ *
+ * @param callinMethod the callin method potentially holding base-calls
* @param declaringClass the class that will hold the surrogate implementation: normally the role, for static callin methods: the team.
*/
public SyntheticBaseCallSurrogate(MethodBinding callinMethod, SourceTypeBinding declaringClass) {
@@ -78,7 +78,7 @@ public class SyntheticBaseCallSurrogate extends SyntheticOTMethodBinding
Scope scope = declaringClass.scope;
this.errorType = scope.getType(IOTConstants.OTRE_INTERNAL_ERROR, 3);
this.stringType = scope.getJavaLangString();
- // the synthetic methods of a class will be sorted according to a per-class index, find the index now:
+ // the synthetic methods of a class will be sorted according to a per-class index, find the index now:
SyntheticMethodBinding[] knownAccessMethods = declaringClass.syntheticMethods();
this.index = knownAccessMethods == null ? 0 : knownAccessMethods.length;
this.sourceStart = declaringClass.scope.referenceContext.sourceStart;
@@ -126,7 +126,7 @@ public class SyntheticBaseCallSurrogate extends SyntheticOTMethodBinding
/**
* Add any required base-call surrogates to the given type.
- * @param type must be a role class.
+ * @param type must be a role class.
*/
public static void addFakedBaseCallSurrogates(SourceTypeBinding type, LookupEnvironment environment) {
if (type.methods() == null)
@@ -151,7 +151,7 @@ public class SyntheticBaseCallSurrogate extends SyntheticOTMethodBinding
*/
public static MethodBinding getBaseCallSurrogate(MethodBinding callinMethod, RoleModel clazz, LookupEnvironment environment)
{
-
+
try {
if (TSuperHelper.isTSuper(callinMethod))
return null;
@@ -161,7 +161,7 @@ public class SyntheticBaseCallSurrogate extends SyntheticOTMethodBinding
ReferenceBinding roleType = callinMethod.declaringClass;
ReferenceBinding teamType = roleType.enclosingType();
ReferenceBinding declaringClass = callinMethod.isStatic() ? teamType : roleType;
-
+
char[] roleName = roleType.sourceName();
char[] selector =
genSurrogateName(callinMethod.selector, roleName, callinMethod.isStatic());
@@ -169,7 +169,7 @@ public class SyntheticBaseCallSurrogate extends SyntheticOTMethodBinding
TypeBinding[] baseCallParameters = callinMethod.parameters;
if (!callinMethod.isStatic())
baseCallParameters = addIsSuperAccessArg(baseCallParameters, environment.globalOptions.weavingScheme);
-
+
// search existing surrogate:
candidates:
for (MethodBinding candidate : declaringClass.getMethods(selector)) {
@@ -190,7 +190,7 @@ public class SyntheticBaseCallSurrogate extends SyntheticOTMethodBinding
baseCallParameters,
null /*exceptions*/,
declaringClass);
- else
+ else
result = ((SourceTypeBinding)declaringClass).addSyntheticBaseCallSurrogate(callinMethod);
MethodModel.getModel(result)._fakeKind = MethodModel.FakeKind.BASECALL_SURROGATE;
RoleTypeCreator.wrapTypesInMethodBindingSignature(result, environment);
@@ -230,8 +230,8 @@ public class SyntheticBaseCallSurrogate extends SyntheticOTMethodBinding
if (!areTypesEqual(enclosingOne, enclosingTwo)) return false;
return CharOperation.equals(one.sourceName(), two.sourceName());
}
-
- static TypeBinding[] addIsSuperAccessArg(TypeBinding[] baseCallParameters, WeavingScheme weavingScheme)
+
+ static TypeBinding[] addIsSuperAccessArg(TypeBinding[] baseCallParameters, WeavingScheme weavingScheme)
{
int len = baseCallParameters.length;
TypeBinding[] newParams = new TypeBinding[len+1];
@@ -271,5 +271,5 @@ public class SyntheticBaseCallSurrogate extends SyntheticOTMethodBinding
return selector;
}
-
+
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/SyntheticOTMethodBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/SyntheticOTMethodBinding.java
index 367e15f52..d55fd2a53 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/SyntheticOTMethodBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/SyntheticOTMethodBinding.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010 GK Software AG
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -25,7 +25,7 @@ import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
public abstract class SyntheticOTMethodBinding extends SyntheticMethodBinding {
- public SyntheticOTMethodBinding(SourceTypeBinding declaringClass, int modifiers, char[] selector, TypeBinding[] parameters, TypeBinding returnType)
+ public SyntheticOTMethodBinding(SourceTypeBinding declaringClass, int modifiers, char[] selector, TypeBinding[] parameters, TypeBinding returnType)
{
super(declaringClass, modifiers, selector, parameters, returnType);
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/SyntheticOTTargetMethod.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/SyntheticOTTargetMethod.java
index f9c3f0484..1ae047fcb 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/SyntheticOTTargetMethod.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/SyntheticOTTargetMethod.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2014 GK Software AG
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -34,7 +34,7 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.model.TeamModel;
/**
* A synthetic method binding, which used as an invocation target needs to
* influence code generation.
- *
+ *
* @since 2.3.1
*/
public abstract class SyntheticOTTargetMethod extends SyntheticMethodBinding {
@@ -42,7 +42,7 @@ public abstract class SyntheticOTTargetMethod extends SyntheticMethodBinding {
protected SyntheticOTTargetMethod(MethodBinding targetMethod, int purpose) {
super(targetMethod, purpose);
}
-
+
protected SyntheticOTTargetMethod(FieldBinding targetField, boolean isReadAccess, boolean isSuperAccess, SourceTypeBinding declaringClass) {
super(targetField, isReadAccess, isSuperAccess, declaringClass);
}
@@ -59,7 +59,7 @@ public abstract class SyntheticOTTargetMethod extends SyntheticMethodBinding {
* invoke still needs to be generated.
*/
public abstract byte prepareOrGenerateInvocation(CodeStream codeStream, byte opcode);
-
+
/**
* Represents an inferred callout-to-field.
* May need to tweak invokestatic (for regular access$n methods) into invokevirtual (for the generated c-t-f method).
@@ -76,7 +76,7 @@ public abstract class SyntheticOTTargetMethod extends SyntheticMethodBinding {
return opcode;
}
}
-
+
/**
* Represents a decapsulating field access while targeting OTDRE.
* We need to generate a special sequence to call _OT$access(int,int,Object[],ITeam)
@@ -91,7 +91,7 @@ public abstract class SyntheticOTTargetMethod extends SyntheticMethodBinding {
private TypeBinding originalType;
private ASTNode site;
private BlockScope scope;
-
+
/**
* Create a binding for a field access using decapsulation.
* @param fakedMethod this method is member of the base class, representing the otdre-generated access method.
@@ -122,7 +122,7 @@ public abstract class SyntheticOTTargetMethod extends SyntheticMethodBinding {
else
codeStream.iconst_1();
// no args to pack for read access:
- codeStream.aconst_null();
+ codeStream.aconst_null();
// enclosing team instance:
Object[] emulationPath = this.scope.getEmulationPath(this.enclosingTeam, true /*only exact match*/, false/*consider enclosing arg*/);
codeStream.generateOuterAccess(emulationPath, this.site, this.enclosingTeam, this.scope);
@@ -156,7 +156,7 @@ public abstract class SyntheticOTTargetMethod extends SyntheticMethodBinding {
private TypeBinding originalReturnType;
private ASTNode site;
private BlockScope scope;
-
+
/**
* Create a binding for a method access using decapsulation.
* @param targetMethod this method is member of the base class, representing the otdre-generated access method.
@@ -214,7 +214,7 @@ public abstract class SyntheticOTTargetMethod extends SyntheticMethodBinding {
codeStream.bipush((byte) this.accessId);
codeStream.swap();
// accessId, array
-
+
// opKind (ignored):
codeStream.iconst_0();
codeStream.swap();
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/SyntheticRoleBridgeMethodBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/SyntheticRoleBridgeMethodBinding.java
index a1a750b64..948cfe7b9 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/SyntheticRoleBridgeMethodBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/SyntheticRoleBridgeMethodBinding.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010 GK Software AG
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/SyntheticRoleFieldAccess.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/SyntheticRoleFieldAccess.java
index be1b681b2..2eaa4dd87 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/SyntheticRoleFieldAccess.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/SyntheticRoleFieldAccess.java
@@ -83,7 +83,7 @@ public class SyntheticRoleFieldAccess extends SyntheticOTTargetMethod {
public SyntheticRoleFieldAccess(FieldBinding targetField, boolean isReadAccess, SourceTypeBinding declaringClass) {
super(targetField, isReadAccess, false, declaringClass);
-
+
if (targetField.declaringClass instanceof SourceTypeBinding && ((SourceTypeBinding)targetField.declaringClass).scope != null) {
FieldDeclaration sourceField = targetField.sourceField();
if (sourceField != null) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/TeamAnchor.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/TeamAnchor.java
index 8f7147d15..a7745c8a6 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/TeamAnchor.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/TeamAnchor.java
@@ -298,7 +298,7 @@ public abstract class TeamAnchor extends Binding implements ITeamAnchor {
}
} else if (expression instanceof TypeAnchorReference) {
bind = (Binding) ((TypeAnchorReference)expression).getResolvedAnchor();
- }
+ }
if (bind != null && (bind instanceof TeamAnchor))
return (TeamAnchor)bind;
TypeBinding type = expression.resolvedType;
@@ -790,16 +790,16 @@ public abstract class TeamAnchor extends Binding implements ITeamAnchor {
int paramPosition = -1;
if (roleBinding instanceof DependentTypeBinding)
paramPosition = ((DependentTypeBinding)roleBinding)._valueParamPosition;
-
- if (roleBinding instanceof RoleTypeBinding)
+
+ if (roleBinding instanceof RoleTypeBinding)
if (!this.isTeamContainingRole(roleBinding)) // need to switch to outer anchor?
return this.asAnchorFor(roleBinding).getDependentTypeBinding(roleBinding, paramPosition, arguments, dimensions, ((RoleTypeBinding)roleBinding).environment);
-
+
if (roleBinding instanceof WeakenedTypeBinding) {
if (((WeakenedTypeBinding)roleBinding)._teamAnchor == this)
return roleBinding;
}
-
+
if (roleBinding instanceof ParameterizedTypeBinding)
return getDependentTypeBinding(roleBinding, paramPosition, arguments, dimensions, ((ParameterizedTypeBinding)roleBinding).environment);
return getDependentTypeBinding(roleBinding, paramPosition, arguments, dimensions);
@@ -834,7 +834,7 @@ public abstract class TeamAnchor extends Binding implements ITeamAnchor {
int paramPosition,
TypeBinding[] arguments,
int dimensions,
- LookupEnvironment env)
+ LookupEnvironment env)
{
DependentTypeBinding dependentTypeBinding =
(DependentTypeBinding)env.createParameterizedType(typeBinding, arguments, this, paramPosition, typeBinding.enclosingType(), typeBinding.getTypeAnnotations());
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/WeakenedTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/WeakenedTypeBinding.java
index 3c82dec46..faf2df73d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/WeakenedTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/WeakenedTypeBinding.java
@@ -84,7 +84,7 @@ public class WeakenedTypeBinding extends DependentTypeBinding {
return this.type.isCompatibleWith(otherStrong)
&& otherWeak.isCompatibleWith(this.weakenedType);
}
-
+
// ----- BYTE CODE VIEW -----
@Override
public char[] constantPoolName() {
@@ -139,17 +139,17 @@ public class WeakenedTypeBinding extends DependentTypeBinding {
public boolean isSignificantlyWeakened() {
return TypeBinding.notEquals(this.weakenedType, this.type.getRealType());
}
-
+
@Override
public boolean isRoleType() {
return this.type.isRoleType();
}
-
+
@Override
public boolean isPlainDependentType() {
return this.type.isPlainDependentType();
}
-
+
/**
* Weakening implies that the interfaces are used to ensure compatibility,
* so never use the signature of a class part.
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CallinImplementor.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CallinImplementor.java
index ad1b10925..1f601a6cf 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CallinImplementor.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CallinImplementor.java
@@ -386,7 +386,7 @@ public class CallinImplementor extends MethodMappingImplementor
newMethod.isMappingWrapper = WrapperKind.CALLIN;
newMethod.returnType.setBaseclassDecapsulation(DecapsulationState.REPORTED);
newMethod.typeParameters= typeParams;
-
+
gen.maybeAddTypeParametersToMethod(baseTypeBinding, newMethod);
int iProblem = teamDecl.getTeamModel().canLiftingFail(this._role.getBinding());
@@ -435,7 +435,7 @@ public class CallinImplementor extends MethodMappingImplementor
/** Declare to throw LiftingFailedException and report problem for each role in callinBindingDeclaration#rolesWithBindingAmbiguity */
protected void declareLiftingFailedException(CallinMappingDeclaration callinBindingDeclaration,
MethodDeclaration wrapperMethod,
- AstGenerator gen)
+ AstGenerator gen)
{
TypeReference liftingFailed = gen.qualifiedTypeReference(IOTConstants.O_O_LIFTING_FAILED_EXCEPTION);
AstEdit.addException(wrapperMethod, liftingFailed, false/*resolve*/);
@@ -462,7 +462,7 @@ public class CallinImplementor extends MethodMappingImplementor
if (this._role.isRoleFile()) {
this.synthGen = MethodModel.setupSourcePositionMapping(callinWrapperDecl,
- this._role.getTeamModel().getAst(),
+ this._role.getTeamModel().getAst(),
this._role,
null);
if (this.synthGen != null)
@@ -507,7 +507,7 @@ public class CallinImplementor extends MethodMappingImplementor
// from here on all statements go into the try block - with "finally { resetFlag(); }"
ArrayList<Statement> tryStatements = new ArrayList<Statement>();
-
+
// -------------- call receiver & arguments --------------
//_OT$role.myRoleMethod(_OT$param0, ...);
// or:
@@ -549,7 +549,7 @@ public class CallinImplementor extends MethodMappingImplementor
} else {
receiver = gen.singleNameReference(ROLE_VAR_NAME);
needRoleVar = true;
-
+
// receiver for private method (doesn't exist in ifc-part) needs to be casted to the class.
// Scope.findMethod() takes care of visibility if isMethodMappingWrapper() is detected.
if (roleMethodBinding.isPrivate())
@@ -563,7 +563,7 @@ public class CallinImplementor extends MethodMappingImplementor
// with CastExpression.RAW a RawTypeBinding might occur that is not recognized by Scope.findMethod()
// see testA12_genericRoleFeature16f() which reports bogus visibility problem is RAW is used.
}
-
+
//MyRole _OT$role = _OT$liftToMyRole(_OT$base_arg);
if (needRoleVar)
tryStatements.add(createLiftedRoleVar(callinBindingDeclaration, roleModel, baseTypeBinding, otBaseArg, gen));
@@ -633,11 +633,11 @@ public class CallinImplementor extends MethodMappingImplementor
// $endif
Expression roleMessageSendExpression = roleMessageSend;
-
+
if (roleMethodBinding.returnType.isArrayType()) {
// if return from role method requires array-lowering, we must determine how to access the team (receiver of lowering-method):
TypeBinding returnLeaf = roleMethodBinding.returnType.leafComponentType();
- findEnclosingTeam:
+ findEnclosingTeam:
if (returnLeaf.isRole()) {
ReferenceBinding returnEnclosing = returnLeaf.enclosingType(); // the team type containing the returned role
ReferenceBinding currentType = roleModel.getBinding();
@@ -655,7 +655,7 @@ public class CallinImplementor extends MethodMappingImplementor
tryStatements.add(gen.assignment(
gen.singleNameReference(IOTConstants.OT_RESULT),
roleMessageSendExpression));
-
+
// ResultNotProvidedException?
if (isReturnBoxed && !callinBindingDeclaration.isResultMapped)
{
@@ -677,7 +677,7 @@ public class CallinImplementor extends MethodMappingImplementor
tryStatements.add(
stepOverGen.returnStatement(stepOverGen.singleNameReference(IOTConstants.OT_RESULT)));
}
-
+
TryStatement tryFinally = gen.tryFinally(
tryStatements.toArray(new Statement[tryStatements.size()]),
new Statement[] {resetFlag});
@@ -755,11 +755,11 @@ public class CallinImplementor extends MethodMappingImplementor
IOTConstants.SET_EXECUTING_CALLIN,
new Expression[] { stepOverGen.singleNameReference(OLD_IS_EXECUTING)} );
}
- private Statement createLiftedRoleVar(CallinMappingDeclaration callinBindingDeclaration,
+ private Statement createLiftedRoleVar(CallinMappingDeclaration callinBindingDeclaration,
RoleModel roleModel,
- ReferenceBinding baseTypeBinding,
- char[] otBaseArg,
- AstGenerator gen)
+ ReferenceBinding baseTypeBinding,
+ char[] otBaseArg,
+ AstGenerator gen)
{
MessageSend liftCall = Lifting.liftCall(
callinBindingDeclaration.scope,
@@ -1099,7 +1099,7 @@ public class CallinImplementor extends MethodMappingImplementor
public void run() {
if (srcPos != -1)
sourceMethodSpec.argNeedsTranslation[srcPos] = true;
- implementationMethodSpec.argNeedsTranslation[srcIdx] = true;
+ implementationMethodSpec.argNeedsTranslation[srcIdx] = true;
}});
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CallinImplementorDyn.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CallinImplementorDyn.java
index 6a9e2cdb9..65d6b4750 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CallinImplementorDyn.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CallinImplementorDyn.java
@@ -1,17 +1,17 @@
-/**
+/**
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2009, 2019 Stephan Herrmann
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors: Stephan Herrmann - Initial API and implementation
**********************************************************************/
package org.eclipse.objectteams.otdt.internal.core.compiler.mappings;
@@ -85,8 +85,8 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.util.RoleTypeCreator;
/**
* This class translates callin binding to the dynamic weaving strategy.
- * This strategy is enabled by defining the property <code>ot.weaving=dynamic</code>
- *
+ * This strategy is enabled by defining the property <code>ot.weaving=dynamic</code>
+ *
* @author stephan
* @since 1.3.0M3
*/
@@ -105,7 +105,7 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
public static final char[] OT_CALL_ORIG_STATIC = "_OT$callOrigStatic".toCharArray(); //$NON-NLS-1$
private static final char[] OT_TERMINAL_CALL_NEXT = "_OT$terminalCallNext".toCharArray(); //$NON-NLS-1$
-
+
// variable names (arguments ...)
static final char[] TEAMS = "teams".toCharArray(); //$NON-NLS-1$
static final char[] INDEX = "index".toCharArray(); //$NON-NLS-1$
@@ -116,7 +116,7 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
static final char[] RESULT = "result".toCharArray(); //$NON-NLS-1$
static final String LOCAL_ROLE = "local$role$"; //$NON-NLS-1$
static final char[] _BASE$ = "_base$".toCharArray(); //$NON-NLS-1$
-
+
// for call next:
private static final char[] BASE_CALL_ARGS = "baseCallArguments".toCharArray(); //$NON-NLS-1$
private static final char[] BASE_CALL_FLAGS = "baseCallFlags".toCharArray(); //$NON-NLS-1$
@@ -130,12 +130,12 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
static final char[] CATCH_ARG = "_OT$caughtException".toCharArray(); //$NON-NLS-1$
-
+
private ClassScope _roleScope;
/**
* Main entry from Dependencies - roles.
- *
+ *
* Generates the byte code attributes.
*/
public void transformRole(RoleModel role)
@@ -143,7 +143,7 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
this._role = role;
this._roleScope = role.getAst().scope; // we definitely have an AST here
this.bindingDirection = TerminalTokens.TokenNameBINDIN;
-
+
AbstractMethodMappingDeclaration[] methodMappings = this._role.getAst().callinCallouts;
if(methodMappings == null || methodMappings.length == 0)
{
@@ -264,7 +264,7 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
((PotentialLiftExpression)liftExpr).onLiftingRequired(new Runnable() {@Override
public void run() {
sourceMethodSpec.argNeedsTranslation[srcPos] = true;
- implementationMethodSpec.argNeedsTranslation[srcIdx] = true;
+ implementationMethodSpec.argNeedsTranslation[srcIdx] = true;
}});
}
@@ -281,16 +281,16 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
if (cu == null) return expression; // FIXME: do we need a fallback when cu is built from model?
final Parser parser = new Parser(scope.problemReporter(), false);
char[] source = cu.getContents();
- return parser.parseExpression(source, expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1,
+ return parser.parseExpression(source, expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1,
scope.referenceCompilationUnit(), false /* record line separators */);
}
/**
* Main entry from Dependencies - teams.
- *
+ *
* Creates the dispatch methods.
*/
- public void transformTeam(TeamModel aTeam)
+ public void transformTeam(TeamModel aTeam)
{
List<CallinMappingDeclaration> beforeMappings = new ArrayList<CallinMappingDeclaration>();
List<CallinMappingDeclaration> replaceMappings = new ArrayList<CallinMappingDeclaration>();
@@ -327,7 +327,7 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
generateCallOrigStatic(mappingsWithStaticBase, aTeam);
}
- private void generateDispatchMethod(char[] methodName, final boolean isReplace, final boolean isAfter, final List<CallinMappingDeclaration> callinDecls, final TeamModel aTeam)
+ private void generateDispatchMethod(char[] methodName, final boolean isReplace, final boolean isAfter, final List<CallinMappingDeclaration> callinDecls, final TeamModel aTeam)
{
// FIXME(SH): once we know that Team has empty implementations (and checked cases involving team inheritance)
// we probably want to avoid generating empty methods here.
@@ -337,7 +337,7 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
final AstGenerator gen = new AstGenerator(teamDecl);
gen.replaceableEnclosingClass = teamDecl.binding;
-
+
// public void _OT$callBefore (IBoundBase2 base, int boundMethodId, int callinId, Object[] args)
// public void _OT$callAfter (IBoundBase2 base, int boundMethodId, int callinId, Object[] args, Object result)
// public void _OT$callReplace (IBoundBase2 base, Team[] teams, int index, int boundMethodId, int[] callinIds, Object[] args)
@@ -346,7 +346,7 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
length = 6;
else if (isAfter)
length = 5;
- Argument[] arguments = new Argument[length];
+ Argument[] arguments = new Argument[length];
int a = 0;
arguments[a++] = gen.argument(_BASE$, gen.qualifiedTypeReference(IOTConstants.ORG_OBJECTTEAMS_IBOUNDBASE2));
if (isReplace)
@@ -360,17 +360,17 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
arguments[a++] = gen.argument(ARGUMENTS, gen.qualifiedArrayTypeReference(TypeConstants.JAVA_LANG_OBJECT, 1));
if (isAfter)
arguments[a++] = gen.argument(_OT_RESULT, gen.qualifiedTypeReference(TypeConstants.JAVA_LANG_OBJECT));
-
+
TypeReference returnTypeRef = isReplace ? gen.qualifiedTypeReference(TypeConstants.JAVA_LANG_OBJECT) : gen.typeReference(TypeBinding.VOID);
-
+
final MethodDeclaration callMethod = gen.method(teamDecl.compilationResult, AccPublic, returnTypeRef, methodName, arguments);
callMethod.isMappingWrapper = AbstractMethodDeclaration.WrapperKind.CALLIN;
-
+
AstEdit.addMethod(teamDecl, callMethod);
MethodModel.addCallinFlag(callMethod, IOTConstants.CALLIN_FLAG_WRAPPER);
callMethod.model._declaringMappings = callinDecls;
-
+
MethodModel.getModel(callMethod).setStatementsGenerator(new AbstractStatementsGenerator() {
@Override
@@ -387,15 +387,15 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
SwitchStatement switchStat = new SwitchStatement();
switchStat.expression =
- isReplace
+ isReplace
? gen.arrayReference(gen.singleNameReference(CALLIN_ID), gen.singleNameReference(INDEX)) // switch(callinId[index]) { ...
: gen.singleNameReference(CALLIN_ID); // switch(callinId) { ...
-
+
// statements for the body of the switchStatement:
List<Statement> statements = new ArrayList<Statement>();
// count callins:
- for (CallinMappingDeclaration callinDecl : callinDecls)
+ for (CallinMappingDeclaration callinDecl : callinDecls)
for (MethodSpec baseSpec : callinDecl.baseMethodSpecs)
baseSpec.getCallinId(aTeam, callinDecl.explicitName());
int callinIdCount = teamDecl.getTeamModel().getCallinIdCount();
@@ -404,7 +404,7 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
// do we need to catch LiftingFailedException?
boolean canLiftingFail = false;
// one case block per callin mapping:
- for (CallinMappingDeclaration callinDecl : callinDecls)
+ for (CallinMappingDeclaration callinDecl : callinDecls)
{
if (callinDecl.ignoreFurtherInvestigation)
continue;
@@ -420,40 +420,40 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
// one case label per bound base method:
for (MethodSpec baseSpec : callinDecl.baseMethodSpecs) {
int callinID = baseSpec.getCallinId(aTeam, callinDecl.name);
- statements.add(callinGen.caseStatement(callinGen.intLiteral(callinID))); // case <baseMethod.callinId>:
+ statements.add(callinGen.caseStatement(callinGen.intLiteral(callinID))); // case <baseMethod.callinId>:
handledCallinIds[callinID] = true;
PredicateGenerator predGen = new PredicateGenerator(
callinDecl.binding._declaringRoleClass,
callinDecl.isReplaceCallin());
-
+
TypeBinding baseReturn = baseSpec.resolvedType();
boolean isStaticRoleMethod = callinDecl.getRoleMethod().isStatic();
ReferenceBinding roleType = callinDecl.scope.enclosingSourceType();
if (roleType.isGenericType()) // cannot handle generic role in this generated code
roleType = (ReferenceBinding) callinDecl.scope.environment().convertToRawType(roleType, false);
MethodBinding roleMethodBinding = callinDecl.getRoleMethod();
-
+
boolean needLiftedRoleVar = !isStaticRoleMethod
&& roleType.isCompatibleWith(roleMethodBinding.declaringClass);
-
+
List<Statement> blockStatements = new ArrayList<Statement>();
// do we need to expose _OT$result as result?
char[] resultName = null;
if (callinDecl.callinModifier == TerminalTokens.TokenNameafter
- && (callinDecl.mappings != null || callinDecl.predicate != null)
+ && (callinDecl.mappings != null || callinDecl.predicate != null)
&& baseReturn != TypeBinding.VOID) {
resultName = RESULT;
- callinDecl.resultVar = callinGen.localBaseVariable(RESULT, baseReturn, // BaseReturnType result = (BaseReturnType)_OT$result;
+ callinDecl.resultVar = callinGen.localBaseVariable(RESULT, baseReturn, // BaseReturnType result = (BaseReturnType)_OT$result;
callinGen.createCastOrUnboxing(callinGen.singleNameReference(_OT_RESULT), baseReturn, true/*baseAccess*/));
blockStatements.add(callinDecl.resultVar);
}
// expose casted _base$ as "base":
blockStatements.add(callinGen.localVariable(IOTConstants.BASE,
callinGen.alienScopeTypeReference(callinGen.baseTypeReference(roleType.baseclass()),callinDecl.scope),
- callinGen.castExpression(callinGen.baseNameReference(_BASE$),
- callinGen.alienScopeTypeReference(callinGen.baseTypeReference(roleType.baseclass()),callinDecl.scope),
+ callinGen.castExpression(callinGen.baseNameReference(_BASE$),
+ callinGen.alienScopeTypeReference(callinGen.baseTypeReference(roleType.baseclass()),callinDecl.scope),
CastExpression.RAW)));
// -------------- base predicate check -------
@@ -485,9 +485,9 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
char[] roleVar = null;
if (!isStaticRoleMethod) {
if (needLiftedRoleVar) {
-
+
canLiftingFail |= checkLiftingProblem(teamDecl, callinDecl, roleType);
-
+
roleVar = (LOCAL_ROLE+statements.size()).toCharArray();
TypeReference roleTypeReference = callinGen.roleTypeReference(teamDecl.getTeamModel().getTThis(), roleType, 0);
blockStatements.add(callinGen.localVariable(roleVar, // RoleType local$n = this._OT$liftToRoleType((BaseType)base);
@@ -509,7 +509,7 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
} else {
receiver = callinGen.singleNameReference(callinDecl.getRoleMethod().declaringClass.sourceName());
}
-
+
int baseArgOffset = 0;
if (baseSpec.isCallin()) baseArgOffset+=MethodSignatureEnhancer.getEnhancingArgLen(WeavingScheme.OTDRE);
if (baseSpec.isStatic() && baseSpec.getDeclaringClass().isRole()) baseArgOffset+=2;
@@ -540,7 +540,7 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
}
}
}
-
+
// -- assemble arguments:
TypeBinding[] roleParams = callinDecl.roleMethodSpec.resolvedParameters();
Expression[] callArgs = new Expression [roleParams.length + (isReplace ? MethodSignatureEnhancer.getEnhancingArgLen(WeavingScheme.OTDRE) : 0)];
@@ -548,10 +548,10 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
if (isReplace)
for (char[] argName : REPLACE_ARG_NAMES)
callArgs[idx++] = callinGen.singleNameReference(argName); // prepare: base, teams, boundMethodId, callinIds, index, arguments ...
-
+
// prepare parameter mappings:
callinDecl.traverse(new ReplaceResultReferenceVisitor(callinDecl), callinDecl.scope.classScope());
-
+
boolean hasArgError = false;
for (int i=0; i<roleParams.length; i++) {
Expression arg;
@@ -606,10 +606,10 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
localTypeRef = callinGen.typeReference(roleParam.erasure()); // cannot explicitly mention this TVB
else
localTypeRef = callinGen.typeReference(roleParam);
-
+
arg = getArgument(callinDecl, // prepare: <mappedArg<n>>
(MethodDeclaration) methodDecl,
- callinDecl.getRoleMethod().parameters,
+ callinDecl.getRoleMethod().parameters,
i+idx,
baseSpec,
roleVar);
@@ -619,7 +619,7 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
}
if (Lifting.isLiftToMethodCall(arg))
canLiftingFail |= checkLiftingProblem(teamDecl, callinDecl, roleType);
- boolean isBaseReference = arg instanceof SingleNameReference
+ boolean isBaseReference = arg instanceof SingleNameReference
&& CharOperation.equals(((SingleNameReference)arg).token, IOTConstants.BASE);
if (needLiftedRoleVar)
arg = new PotentialRoleReceiverExpression(arg, roleVar, callinGen.typeReference(roleType.getRealClass()));
@@ -630,13 +630,13 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
char[] localName = (OT_LOCAL+i).toCharArray(); // RoleParamType _OT$local$n = preparedArg<n>;
blockStatements.add(callinGen.localVariable(localName, callinGen.alienScopeTypeReference(localTypeRef, callinDecl.scope), arg));
callArgs[i+idx] = callinGen.singleNameReference(localName); // prepare: ... _OT$local$ ...
-
+
}
if (hasArgError)
continue;
// -- role side predicate:
- Expression[] predicateArgs = isReplace
+ Expression[] predicateArgs = isReplace
? MethodSignatureEnhancer.retrenchBasecallArguments(callArgs, true, WeavingScheme.OTDRE)
: callArgs;
predicateArgs = maybeAddResultReference(callinDecl, predicateArgs, resultName, callinGen);
@@ -650,17 +650,17 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
if (rolePredicateCheck != null)
// predicateCheck(_OT$role)
blockStatements.add(rolePredicateCheck);
-
+
// -- assemble the method call: // local$n.roleMethod((ArgType0)args[0], .. (ArgTypeN)args[n]);
boolean lhsResolvesToTeamMethod = TypeBinding.equalsEquals(callinDecl.getRoleMethod().declaringClass, roleType.enclosingType()); // TODO(SH): more levels
// (callin positions for error reporting:)
MessageSend roleMethodCall = (callinDecl.getRoleMethod().isPrivate() && !lhsResolvesToTeamMethod)
- ? new PrivateRoleMethodCall(receiver, callinDecl.roleMethodSpec.selector, callArgs, false/*c-t-f*/,
+ ? new PrivateRoleMethodCall(receiver, callinDecl.roleMethodSpec.selector, callArgs, false/*c-t-f*/,
callinDecl.scope, roleType, callinDecl.getRoleMethod(), callinGen)
: callinGen.messageSend(receiver, callinDecl.roleMethodSpec.selector, callArgs);
roleMethodCall.isGenerated = true; // for PrivateRoleMethodCall
roleMethodCall.isPushedOutRoleMethodCall = true;
-
+
// -- post processing:
Statement[] messageSendStatements;
if (isReplace) {
@@ -684,7 +684,7 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
if (isResultBoxed)
result = callinGen.createUnboxing(result, (BaseTypeBinding) baseReturn);
Expression mappedResult = callinDecl.getResultExpression(baseSpec, isResultBoxed, callinGen/*stepOverGen*/);
- if (!isStaticRoleMethod)
+ if (!isStaticRoleMethod)
mappedResult = new PotentialRoleReceiverExpression(
mappedResult,
roleVar,
@@ -700,14 +700,14 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
if (isResultBoxed) { // $if_need_result_unboxing$
messageSendStatements = new Statement[] {
callinGen.localVariable(IOTConstants.OT_RESULT, // Object _OT$result = role.roleMethod(args);
- callinGen.qualifiedTypeReference(TypeConstants.JAVA_LANG_OBJECT),
+ callinGen.qualifiedTypeReference(TypeConstants.JAVA_LANG_OBJECT),
result),
CallinImplementor.genResultNotProvidedCheck( // if (_OT$result == null)
teamDecl.binding.readableName(), // throw new ResultNotProvidedException(..)
roleType.readableName(),
- roleMethodBinding,
- roleType.baseclass(),
- baseSpec,
+ roleMethodBinding,
+ roleType.baseclass(),
+ baseSpec,
callinGen),
callinGen.returnStatement(callinGen.singleNameReference(IOTConstants.OT_RESULT)) // return _OT$result;
};
@@ -724,7 +724,7 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
// assemble:
// try { roleMessageSend(); }
// catch(Exception _OT$caughtException) { throw new SneakyException(_OT$caughtException); }
- // finally { _OT$setExecutingCallin(_OT$oldIsExecutingCallin); }
+ // finally { _OT$setExecutingCallin(_OT$oldIsExecutingCallin); }
blockStatements.add(protectRoleMethodCall(messageSendStatements, roleMethodBinding, stepIntoGen));
statements.add(callinGen.block(blockStatements.toArray(new Statement[blockStatements.size()])));
// collectively report the problem(s)
@@ -732,7 +732,7 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
for (Map.Entry<ReferenceBinding, Integer> entry : callinDecl.rolesWithLiftingProblem.entrySet())
callinDecl.scope.problemReporter().callinDespiteLiftingProblem(entry.getKey(), entry.getValue(), callinDecl);
}
- } // END for (CallinMappingDeclaration callinDecl : callinDecls)
+ } // END for (CallinMappingDeclaration callinDecl : callinDecls)
boolean needSuperCall = false;
// do we have a relevant super team, which possibly defines more callins?
@@ -779,32 +779,32 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
Statement catchStatement1 = gen.emptyStatement();
Statement catchStatement2 = gen.emptyStatement();
- if (isReplace) {
+ if (isReplace) {
// default: callNext:
Expression[] callArgs = new Expression[REPLACE_ARG_NAMES.length+2];
for (int idx=0; idx < REPLACE_ARG_NAMES.length; idx++)
callArgs[idx] = gen.singleNameReference(REPLACE_ARG_NAMES[idx]);
callArgs[callArgs.length-2] = gen.nullLiteral(); // no explicit baseCallArguments
- callArgs[callArgs.length-1] = gen.intLiteral(0); // not a base call
+ callArgs[callArgs.length-1] = gen.intLiteral(0); // not a base call
statements.add(gen.caseStatement(null)); // default:
statements.add(gen.returnStatement( // return _OT$callNext(..);
stepIntoGen.messageSend(
- stepIntoGen.qualifiedThisReference(aTeam.getBinding()),
- OT_CALL_NEXT,
+ stepIntoGen.qualifiedThisReference(aTeam.getBinding()),
+ OT_CALL_NEXT,
callArgs)));
catchStatement1 = gen.returnStatement(
stepIntoGen.messageSend(
- stepIntoGen.qualifiedThisReference(aTeam.getBinding()),
- OT_CALL_NEXT,
+ stepIntoGen.qualifiedThisReference(aTeam.getBinding()),
+ OT_CALL_NEXT,
callArgs));
catchStatement2 = gen.returnStatement(
stepIntoGen.messageSend(
- stepIntoGen.qualifiedThisReference(aTeam.getBinding()),
- OT_CALL_NEXT,
+ stepIntoGen.qualifiedThisReference(aTeam.getBinding()),
+ OT_CALL_NEXT,
callArgs));
}
-
+
// ==== overall assembly: ====
switchStat.statements = statements.toArray(new Statement[statements.size()]);
Argument[] exceptionArguments;
@@ -822,7 +822,7 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
gen.argument("ex".toCharArray(), //$NON-NLS-1$
gen.qualifiedTypeReference(IOTConstants.ORG_OBJECTTEAMS_LIFTING_VETO))
};
- exceptionStatementss = new Statement[][]{{catchStatement1}};
+ exceptionStatementss = new Statement[][]{{catchStatement1}};
}
tryStats.add(switchStat);
@@ -871,9 +871,9 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
}
return predicateArgs;
}
-
+
private void generateCallNext(final List<CallinMappingDeclaration> callinDecls, final TeamModel aTeam) {
- // public Object _OT$callNext(IBoundBase2 baze, Team[] teams, int idx, int[] callinIds, int boundMethodId, Object[] args, Object[] baseCallArgs)
+ // public Object _OT$callNext(IBoundBase2 baze, Team[] teams, int idx, int[] callinIds, int boundMethodId, Object[] args, Object[] baseCallArgs)
final TypeDeclaration teamDecl = aTeam.getAst();
if (teamDecl == null) return;
final AstGenerator gen = new AstGenerator(teamDecl);
@@ -891,17 +891,17 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
Expression[] superArgs = new Expression[args.length];
for (int i=0; i<args.length;i++)
superArgs[i] = gen.singleNameReference(args[i].name);
-
+
MethodDeclaration decl = gen.method(teamDecl.compilationResult,
AccPublic,
gen.qualifiedTypeReference(TypeConstants.JAVA_LANG_OBJECT),
OT_CALL_NEXT,
args);
-
+
// the payload: reverse parameter mappings:
SwitchStatement swStat = new SwitchStatement();
swStat.expression = gen.arrayReference(gen.singleNameReference(CALLIN_ID), gen.singleNameReference(INDEX)); // switch(callinId[index]) { ...
- List<Statement> swStatements = new ArrayList<Statement>();
+ List<Statement> swStatements = new ArrayList<Statement>();
char[] resultVar = RESULT;
for (CallinMappingDeclaration mapping : callinDecls) {
int nLabels = 0;
@@ -914,9 +914,9 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
for (int i=0; i<roleParams.length; i++)
if (roleParams[i].isRole() && TeamModel.isTeamContainingRole(teamDecl.binding, (ReferenceBinding) roleParams[i]))
roleParams[i] = TeamModel.strengthenRoleType(teamDecl.binding, roleParams[i]);
-
+
List<Statement> repackingStats = new ArrayList<Statement>();
-
+
if (mapping.positions != null) {
int[] poss = mapping.positions;
nLabels = caseBlockStats.size();
@@ -928,7 +928,7 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
for (int i=0; i<poss.length; i++)
// arguments[basepos] = baseCallArguments[i]
if (poss[i] > 0) {
- // FIXME(SH): this is cheating: should obtain translation info from actual
+ // FIXME(SH): this is cheating: should obtain translation info from actual
// parameter mapping (see cast in test432_expressionInReplaceParameterMapping11)
TypeBinding roleSideParameter = roleParams[i];
TypeBinding baseSideParameter = baseSpec.resolvedParameters()[poss[i]-1];
@@ -959,10 +959,10 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
basecallArg));
}
}
- caseBlockStats.add(gen.ifStatement(gen.nullCheck(gen.singleNameReference(BASE_CALL_ARGS)), // if (baseCallArgs == null) {} { arguments[i] = ...; ... }
+ caseBlockStats.add(gen.ifStatement(gen.nullCheck(gen.singleNameReference(BASE_CALL_ARGS)), // if (baseCallArgs == null) {} { arguments[i] = ...; ... }
gen.emptyStatement(),
gen.block(repackingStats.toArray(new Statement[repackingStats.size()]))));
-
+
Expression result = genSuperCallNext(gen, teamDecl.binding, superArgs); // return cast+lift?(super._OT$callNext(..));
if (baseSpec.returnNeedsTranslation) {
// lifting:
@@ -978,8 +978,8 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
: genTeamThis(gen, returnTypes[0]);
resultVar = CharOperation.append(resultVar, '$');
caseBlockStats.add(gen.localVariable(resultVar, gen.qualifiedTypeReference(TypeConstants.JAVA_LANG_OBJECT), result));
- caseBlockStats.add(gen.ifStatement(gen.equalExpression(gen.singleNameReference(BASE_CALL_FLAGS), gen.intLiteral(0), OperatorIds.NOT_EQUAL),
- gen.assignment(gen.singleNameReference(resultVar),
+ caseBlockStats.add(gen.ifStatement(gen.equalExpression(gen.singleNameReference(BASE_CALL_FLAGS), gen.intLiteral(0), OperatorIds.NOT_EQUAL),
+ gen.assignment(gen.singleNameReference(resultVar),
Lifting.liftCall(mapping.scope,
liftReceiver,
gen.castExpression(gen.singleNameReference(resultVar),
@@ -993,7 +993,7 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
result = gen.singleNameReference(resultVar);
}
caseBlockStats.add(gen.returnStatement(result));
-
+
if (caseBlockStats.size() > nLabels) { // any action added ?
swStatements.addAll(caseBlockStats);
}
@@ -1001,7 +1001,7 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
}
if (swStatements.size() == 0)
return; // don't add useless method
-
+
swStat.statements = swStatements.toArray(new Statement[swStatements.size()]);
decl.statements = new Statement[] {
swStat,
@@ -1053,7 +1053,7 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
};
return gen.tryCatch(
statements,
- new Argument[] {catch1Arg, catch2Arg},
+ new Argument[] {catch1Arg, catch2Arg},
new Statement[][] {catch1Stat, catch2Stat});
}
@@ -1088,10 +1088,10 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
gen.qualifiedTypeReference(TypeConstants.JAVA_LANG_OBJECT),
OT_CALL_ORIG_STATIC,
args);
-
+
SwitchStatement swStat = new SwitchStatement();
swStat.expression = gen.singleNameReference(CALLIN_ID); // switch(callinId) { ...
- List<Statement> swStatements = new ArrayList<Statement>();
+ List<Statement> swStatements = new ArrayList<Statement>();
for (CallinMappingDeclaration mapping : callinDecls) {
for (MethodSpec baseSpec : mapping.baseMethodSpecs) {
MethodBinding baseMethod = baseSpec.resolvedMethod;
@@ -1100,7 +1100,7 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
int callinId = baseSpec.getCallinId(aTeam, mapping.explicitName());
swStatements.add(gen.caseStatement(gen.intLiteral( callinId))); // case baseSpecCallinId:
Expression result = gen.fakeMessageSend(gen.baseTypeReference(baseClass), // return BaseClass._OT$callOrigStatic(boundMethodId, args);
- OT_CALL_ORIG_STATIC,
+ OT_CALL_ORIG_STATIC,
passThroughArgs,
baseMethod.declaringClass,
mapping.scope.getJavaLangObject());
@@ -1110,7 +1110,7 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
} // } // end-switch
if (swStatements.size() == 0)
return; // don't add useless method
-
+
swStat.statements = swStatements.toArray(new Statement[swStatements.size()]);
decl.statements = new Statement[] {
swStat,
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CalloutImplementor.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CalloutImplementor.java
index 389af4bed..a7d8cd3a4 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CalloutImplementor.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CalloutImplementor.java
@@ -112,7 +112,7 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.util.TypeAnalyzer;
* set of locals.
* Where: createCallout links roleMethodSpec and wrapper
* getArgument links baseMethodSpec and wrapper (if not parameter mappings are given).
- *
+ *
* What: Callout to private members of a role-as-base require access via two bridges
* Why: private methods are not exposed in the ifc-part, implicit inheritance needs
* redirection via the team instance, fields need accessors anyway
@@ -323,7 +323,7 @@ public class CalloutImplementor extends MethodMappingImplementor
MethodBinding templateBinding,
CalloutMappingDeclaration calloutBindingDeclaration)
{
- IProtectable baseFeature = null;
+ IProtectable baseFeature = null;
MethodSpec baseMethodSpec = calloutBindingDeclaration.baseMethodSpec;
if (baseMethodSpec != null) // else syntax error?
baseFeature = calloutBindingDeclaration.isCalloutToField()
@@ -377,7 +377,7 @@ public class CalloutImplementor extends MethodMappingImplementor
}
if (calloutBindingDeclaration.binding.inferred == InferenceKind.NONE) { // don't advertise inferred callout via the interface.
- if (templateBinding.isStatic()) // no real ifc part for static method, fake it!
+ if (templateBinding.isStatic()) // no real ifc part for static method, fake it!
createInterfaceFakeStatic(templateBinding, calloutBindingDeclaration);
else if (((modifiers & AccPrivate) == 0) && !overridesExplicitNonRole) // also no ifc part for privates and methods from explicit non-role super
createAbstractRoleMethodDeclarationPart(templateBinding,
@@ -616,8 +616,8 @@ public class CalloutImplementor extends MethodMappingImplementor
case DYN_ACCESS:
baseAccess = CalloutImplementorDyn.baseAccessExpression(calloutDecl.scope, this._role, baseType, receiver, calloutDecl.baseMethodSpec, arguments, gen);
break;
- }
- }
+ }
+ }
boolean success = true;
ArrayList<Statement> statements = new ArrayList<Statement>(3);
@@ -926,7 +926,7 @@ public class CalloutImplementor extends MethodMappingImplementor
if (idx >= implParameters.length) // CLOVER: never true in jacks suite
return mappedArgExpr; // arg is invisible to receiver, don't lower
TypeBinding expectedType = implParameters[idx];
-
+
// if type is anchored to another arg of the same binding, we have to translate:
// 1.) is it a param-anchored type?
if (expectedType.leafComponentType() instanceof DependentTypeBinding) {
@@ -1323,9 +1323,9 @@ public class CalloutImplementor extends MethodMappingImplementor
callout.scope= new CallinCalloutScope(roleClass.scope, callout);
CallinCalloutBinding calloutBinding= callout.scope.createBinding(callout);
callout.resolveMethodSpecs(roleClass.getRoleModel(), baseclass, true);
-
+
calloutBinding.inferred= isSetter ? InferenceKind.FIELDSET : InferenceKind.FIELDGET;
- if (callout.baseMethodSpec.resolvedMethod != null) {
+ if (callout.baseMethodSpec.resolvedMethod != null) {
calloutBinding._baseMethods = new MethodBinding[] {callout.baseMethodSpec.resolvedMethod};
} else {
calloutBinding._baseField = ((FieldAccessSpec)callout.baseMethodSpec).resolvedField;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CalloutImplementorDyn.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CalloutImplementorDyn.java
index b9faf1451..6933f1825 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CalloutImplementorDyn.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CalloutImplementorDyn.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2011, 2015 GK Software AG and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -38,7 +38,7 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.util.AstGenerator;
/**
* This class only contains those parts of callout generation that for
* dynamic weaving deviated from the normal strategy.
- *
+ *
* @author stephan
*/
public class CalloutImplementorDyn {
@@ -46,11 +46,11 @@ public class CalloutImplementorDyn {
// wrapper methods for decapsulating callout
public static final char[] OT_ACCESS = "_OT$access".toCharArray(); //$NON-NLS-1$
public static final char[] OT_ACCESS_STATIC = "_OT$accessStatic".toCharArray(); //$NON-NLS-1$
-
- public static Expression baseAccessExpression(Scope scope, RoleModel roleModel, ReferenceBinding baseType,
+
+ public static Expression baseAccessExpression(Scope scope, RoleModel roleModel, ReferenceBinding baseType,
Expression receiver, MethodSpec baseSpec, Expression[] arguments,
- AstGenerator gen)
+ AstGenerator gen)
{
char[] selector = ensureAccessor(scope, baseType, baseSpec.isStatic()).selector;
TeamModel teamModel = roleModel.getTeamModel();
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/MethodMappingImplementor.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/MethodMappingImplementor.java
index eb27dae13..9d9520598 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/MethodMappingImplementor.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/MethodMappingImplementor.java
@@ -84,13 +84,13 @@ public abstract class MethodMappingImplementor {
protected MethodMappingImplementor() {
// empty
}
-
+
MethodSignatureEnhancer getMethodSignatureEnhancer() {
if (this.methodSignatureEnhancer == null)
this.methodSignatureEnhancer = MethodSignatureEnhancer.variants[this._role.getWeavingScheme().ordinal()];
return this.methodSignatureEnhancer;
}
-
+
/**
* Make arguments for message send which implements a callout or a callin wrapper.
* For a callout mapping this method is used only if signatures are given
@@ -121,7 +121,7 @@ public abstract class MethodMappingImplementor {
if (methodMapping.isReplaceCallin())
((CallinMappingDeclaration)methodMapping).checkResultMapping();
}
-
+
Argument[] wrapperMethodArguments = wrapperMethodDeclaration.arguments;
Expression[] arguments = null;
@@ -143,7 +143,7 @@ public abstract class MethodMappingImplementor {
// in decapsulation scenarios OTREDyn uses non-static accessor for non-static fields
if (!baseFieldSpec.isSetter())
implementationArgLen = 0; // if resolved to a 4-arg _OT$access, don't consider these args during AST gen.
- } else if (this._role.getWeavingScheme() == WeavingScheme.OTRE
+ } else if (this._role.getWeavingScheme() == WeavingScheme.OTRE
&& !((FieldAccessSpec)methodMapping.getBaseMethodSpecs()[0]).isStatic()) {
// for OTRE, non-static field access is mapped to static method with additional first parameter _OT$base:
expressionsOffset = 1;
@@ -160,7 +160,7 @@ public abstract class MethodMappingImplementor {
gen.baseclassReference(baseType),
baseType.isRole() ? CastExpression.NEED_CLASS : CastExpression.RAW); // FIXME (see also CalloutImplementor.makeArguments)
}
- }
+ }
if (arguments == null) {
arguments = new Expression[implementationArgLen];
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/MethodMappingResolver.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/MethodMappingResolver.java
index 584d0569a..0eb7edd8c 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/MethodMappingResolver.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/MethodMappingResolver.java
@@ -101,7 +101,7 @@ public class MethodMappingResolver
} else if (methodMapping.isCallin() && this._role.getBinding().baseclass().isInterface()) {
this._roleScope.problemReporter().callinBindingToInterface(methodMapping, this._role.getBinding().baseclass());
methodMapping.tagAsHavingErrors();
- this.resolveBaseMethods = false;
+ this.resolveBaseMethods = false;
}
}
@@ -131,7 +131,7 @@ public class MethodMappingResolver
result &= checkForDuplicateMethodMappings(roleMethodKey);
}
}
-
+
return result;
}
@@ -187,11 +187,11 @@ public class MethodMappingResolver
calloutMappingDeclaration.binding._roleMethodBinding = roleMethodBinding;
if (this.resolveBaseMethods) {
MethodSpec baseMethodSpec = calloutMappingDeclaration.baseMethodSpec;
- if ( baseMethodSpec != null) {
+ if ( baseMethodSpec != null) {
if (baseMethodSpec.resolvedMethod != null) {
calloutMappingDeclaration.binding._baseMethods = new MethodBinding[]{baseMethodSpec.resolvedMethod};
} else if ( baseMethodSpec instanceof FieldAccessSpec
- && ((FieldAccessSpec)baseMethodSpec).resolvedField != null)
+ && ((FieldAccessSpec)baseMethodSpec).resolvedField != null)
{
calloutMappingDeclaration.binding._baseField = ((FieldAccessSpec)baseMethodSpec).resolvedField;
} else {
@@ -200,11 +200,11 @@ public class MethodMappingResolver
}
}
}
- if ( roleMethodBinding != null
+ if ( roleMethodBinding != null
&& (roleMethodBinding.isValidBinding()
|| (roleMethodBinding.problemId() == ProblemReasons.NotFound && calloutMappingDeclaration.hasSignature))) // short-hand, method will be generated
{
- // store the methodMapping in a map indexed by the role method's name&signature
+ // store the methodMapping in a map indexed by the role method's name&signature
// for later duplication check.
String methodKey = String.valueOf(CharOperation.concat(roleMethodBinding.selector, roleMethodBinding.signature()));
List<CalloutMappingDeclaration> mappings = this._foundRoleMethods.get(methodKey);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/FieldModel.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/FieldModel.java
index ee1844784..db9c17f3a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/FieldModel.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/FieldModel.java
@@ -153,8 +153,8 @@ public class FieldModel extends ModelElement {
AnchorUsageRanksAttribute attr = (AnchorUsageRanksAttribute) getAttribute(ANCHOR_USAGE_RANKS);
attr.addUsageRank(rank);
}
-
- /** Create a faked method binding for a getAccessor to a given base field.
+
+ /** Create a faked method binding for a getAccessor to a given base field.
* @param isGetter select getter or setter
*/
public static MethodBinding getDecapsulatingFieldAccessor(Scope scope,
@@ -167,11 +167,11 @@ public class FieldModel extends ModelElement {
MethodBinding accessor = isGetter ? model._decapsulatingGetter : model._decapsulatingSetter;
if (accessor != null)
return accessor;
-
+
if (strategy == ImplementationStrategy.DYN_ACCESS) {
accessor = CalloutImplementorDyn.ensureAccessor(scope, baseType, resolvedField.isStatic());
} else {
- TypeBinding[] argTypes = resolvedField.isStatic()
+ TypeBinding[] argTypes = resolvedField.isStatic()
? (isGetter
? new TypeBinding[0]
: new TypeBinding[]{resolvedField.type})
@@ -188,7 +188,7 @@ public class FieldModel extends ModelElement {
baseType.addMethod(accessor);
}
MethodModel.getModel(accessor)._fakeKind = FakeKind.BASE_FIELD_ACCESSOR;
- if (isGetter)
+ if (isGetter)
model._decapsulatingGetter = accessor;
else
model._decapsulatingSetter = accessor;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/MethodModel.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/MethodModel.java
index e5556e618..6812d725b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/MethodModel.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/MethodModel.java
@@ -70,8 +70,8 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.statemachine.transfor
import org.eclipse.objectteams.otdt.internal.core.compiler.util.AstGenerator;
/**
- * A fragment of method {@link #toString()} has been copied from
- * {@link AbstractMethodDeclaration} of the Eclipse JDT.
+ * A fragment of method {@link #toString()} has been copied from
+ * {@link AbstractMethodDeclaration} of the Eclipse JDT.
*
* What: Flag abstract creation methods in non-abstract team
* Why: Must forbid their use.
@@ -119,13 +119,13 @@ public class MethodModel extends ModelElement {
private MethodBinding _binding = null;
private boolean _callsBaseCtor = false; // may be uninitialized before analyseCode
public int callinFlags = 0;
- // for method generated from one or more method mappings
+ // for method generated from one or more method mappings
// (otredyn implements multiple callins in common wrapper methods)
public List<CallinMappingDeclaration> _declaringMappings = null;
// for methods residing in a team but belonging to a role store the role type here:
public TypeDeclaration _sourceDeclaringType = null;
- // also what was originally a 'this' reference may now be passed as first argument:
+ // also what was originally a 'this' reference may now be passed as first argument:
public Argument _thisSubstitution;
// for creation methods store the original constructor here:
@@ -415,7 +415,7 @@ public class MethodModel extends ModelElement {
public boolean hasBytes() {
if (this._bytes == null)
setupByteCode(false);
- return this._bytes != null;
+ return this._bytes != null;
}
public int getStructOffset() {
return this._structOffset;
@@ -513,7 +513,7 @@ public class MethodModel extends ModelElement {
model.setCallsBaseCtor();
}
- /**
+ /**
* Does the method contain a call to a base constructor?
* Note: don't call before analyseCode because we may need our tsupers to be analysed, too.
*/
@@ -735,7 +735,7 @@ public class MethodModel extends ModelElement {
return handledRoles;
}
- /**
+ /**
* Try to create an AST generator that assigns remapped positions (SMAP).
* @param hostTypeDecl type declaration that will hold the generated byte code
* @param srcTypeBinding type holding the declaration from which this method is generated
@@ -743,7 +743,7 @@ public class MethodModel extends ModelElement {
* @param srcPos start position within the source type correspongind to this method.
* @return either a re-mapping AstGenerator or null (if line number information is not available).
*/
- public AstGenerator getSynthPosGen(TypeDeclaration hostTypeDecl, ReferenceBinding srcTypeBinding, CompilationResult srcCompilationResult, int srcPos)
+ public AstGenerator getSynthPosGen(TypeDeclaration hostTypeDecl, ReferenceBinding srcTypeBinding, CompilationResult srcCompilationResult, int srcPos)
{
int[] lineSeparatorPositions = srcCompilationResult.lineSeparatorPositions;
if (lineSeparatorPositions != null) {
@@ -751,8 +751,8 @@ public class MethodModel extends ModelElement {
int sourceLineNumber = Util.getLineNumber(srcPos, lineSeparatorPositions, 0, lineSeparatorPositions.length-1);
LineNumberProvider lineNumberProvider = TypeModel.getLineNumberProvider(hostTypeDecl);
LineInfo mappedLineInfo = lineNumberProvider.addLineInfo(srcTypeBinding, sourceLineNumber, 1);
-
- CompilationResult hostCompilationResult = hostTypeDecl.compilationResult;
+
+ CompilationResult hostCompilationResult = hostTypeDecl.compilationResult;
int mappedSourceStart = hostCompilationResult.requestSyntheticSourcePosition(mappedLineInfo.getOutputStartLine());
return new AstGenerator(mappedSourceStart, mappedSourceStart);
}
@@ -762,15 +762,15 @@ public class MethodModel extends ModelElement {
public static AstGenerator setupSourcePositionMapping(AbstractMethodDeclaration methodDecl,
TypeDeclaration hostTypeDecl,
RoleModel sourceRoleModel,
- AstGenerator defaultGen)
+ AstGenerator defaultGen)
{
TypeDeclaration sourceRoleDecl = sourceRoleModel.getAst();
if (sourceRoleDecl == null || sourceRoleDecl.isPurelyCopied)
return defaultGen; // don't have more detailed source positions
MethodModel model = methodDecl.getModel();
- AstGenerator gen = model.getSynthPosGen(hostTypeDecl,
+ AstGenerator gen = model.getSynthPosGen(hostTypeDecl,
sourceRoleModel.getBinding(),
- sourceRoleDecl.compilationResult,
+ sourceRoleDecl.compilationResult,
methodDecl.sourceStart);
if (gen != null) {
// re-position the method, these positions will be used by codeGen for generating line numbers:
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/RoleModel.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/RoleModel.java
index 9f1f346fd..a04322bd5 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/RoleModel.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/RoleModel.java
@@ -106,10 +106,10 @@ public class RoleModel extends TypeModel
// Flag constants for tagBits:
// is parameterized type instantiated via tsuper-link?
public static final int IsViewedAsTSuper = ASTNode.Bit1;
-
+
// had the baseclass field/playedBy problems?
public static final int BaseclassHasProblems = ASTNode.Bit2;
-
+
// several issues making lifting impossible
public static final int HasLiftingProblem = ASTNode.Bit3;
@@ -178,7 +178,7 @@ public class RoleModel extends TypeModel
/** does this bound role have a binding ambiguity prohibiting lifting? */
public boolean _hasBindingAmbiguity = false;
-
+
/** is the baseclass an (indirect) enclosing class? */
public boolean _playedByEnclosing = false;
@@ -328,10 +328,10 @@ public class RoleModel extends TypeModel
return true;
return false;
}
-
+
public static void setTagBit(ReferenceBinding role, int tagBit) {
- role.roleModel.tagBits |= tagBit;
+ role.roleModel.tagBits |= tagBit;
}
public static boolean hasTagBit(ReferenceBinding typeBinding, int tagBit) {
@@ -1185,7 +1185,7 @@ public class RoleModel extends TypeModel
/**
* @param srcField a synthetic field from tsuper
- * @param newField the synthetic new field copy
+ * @param newField the synthetic new field copy
*/
public void addSyntheticFieldMapping(FieldBinding srcField, FieldBinding newField) {
this._syntheticMap.put(srcField, newField);
@@ -1412,7 +1412,7 @@ public class RoleModel extends TypeModel
CopyInheritance.copyGeneratedFeatures(this);
super.evaluateLateAttributes(state);
}
-
+
public synchronized void releaseClassFile() {
this._classFile= null;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/TeamModel.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/TeamModel.java
index 8221cd121..26ee419be 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/TeamModel.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/TeamModel.java
@@ -93,7 +93,7 @@ public class TeamModel extends TypeModel {
// can lifting fail due to role abstractness?
public static final int HasAbstractRelevantRole = ASTNode.Bit10;
-
+
// did a nested team require correction of team/role flags?
public static final int HasClassKindProblem = ASTNode.Bit11;
@@ -640,7 +640,7 @@ public class TeamModel extends TypeModel {
return anchor.getRoleTypeBinding(roleRefType, dimensions);
}
/**
- * Starting at site look for an enclosing type that is compatible to targetEnclosing.
+ * Starting at site look for an enclosing type that is compatible to targetEnclosing.
*/
public static ReferenceBinding strengthenEnclosing(ReferenceBinding site, ReferenceBinding targetEnclosing) {
ReferenceBinding currentEnclosing = site;
@@ -962,7 +962,7 @@ public class TeamModel extends TypeModel {
LookupEnvironment environment = this._ast.scope.environment();
for (Pair<MethodBinding, Integer> entry : existing) {
MethodBinding baseMethod = baseMethodSpec.resolvedMethod;
- if (baseMethod == entry.first
+ if (baseMethod == entry.first
|| MethodVerifier.doesMethodOverride(baseMethodSpec.resolvedMethod, entry.first, environment)) {
return entry.second;
}
@@ -1006,7 +1006,7 @@ public class TeamModel extends TypeModel {
recordCallinId(((OTDynCallinBindingsAttribute)attr).getCallinIdMax());
} else {
super.addOrMergeAttribute(attr);
- }
+ }
}
// SH}
public boolean isAmbiguousLifting(ReferenceBinding staticRole, ReferenceBinding baseBinding) {
@@ -1037,7 +1037,7 @@ public class TeamModel extends TypeModel {
public static interface UpdatableAccessId {
void update(int offset);
}
-
+
public static class UpdatableIntLiteral extends IntLiteral implements UpdatableAccessId {
int val;
public UpdatableIntLiteral(int val, int start, int end) {
@@ -1064,7 +1064,7 @@ public class TeamModel extends TypeModel {
/** Update all recorded accessIds to stay clear of id ranges used by super teams. */
public int updateDecapsAccessIds() {
if (this.accessIdOffset > -1 || getWeavingScheme() == WeavingScheme.OTRE) return this.accessIdOffset;
-
+
this.accessIdOffset = 0;
TeamModel superTeam = getSuperTeam();
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/TypeModel.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/TypeModel.java
index 748bfaefe..9394e22f6 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/TypeModel.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/TypeModel.java
@@ -124,7 +124,7 @@ public class TypeModel extends ModelElement {
* Version number of the compiler that created a (binary) type;
*/
public int _compilerVersion;
-
+
WeavingScheme weavingScheme;
public void setCompilerVersion(int version, WeavingScheme weavingScheme) {
@@ -166,7 +166,7 @@ public class TypeModel extends ModelElement {
|| this._binding.kind() == Binding.INTERSECTION_TYPE
|| this._binding.kind() == Binding.INTERSECTION_TYPE18)
return new TypeModel[0]; // has no members
-
+
if (this._binding.isUnresolvedType())
return new TypeModel[0]; // members unknown and cannot resolve here :(
@@ -547,7 +547,7 @@ public class TypeModel extends ModelElement {
this._lineNumberProvider = new LineNumberProvider(this._binding, this._maxLineNumber);
return this._lineNumberProvider;
}
-
+
public static LineNumberProvider getLineNumberProvider(TypeDeclaration type) {
if (type.isRole())
return type.getRoleModel().getLineNumberProvider();
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/smap/AbstractSmapGenerator.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/smap/AbstractSmapGenerator.java
index 1ee3e8da3..fb26940e7 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/smap/AbstractSmapGenerator.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/smap/AbstractSmapGenerator.java
@@ -40,7 +40,7 @@ public abstract class AbstractSmapGenerator
protected TypeDeclaration _type;
protected List <SmapStratum>_strata;
private String _defaultStratum;
-
+
private static String DEFAULT_PACKAGE=""; //$NON-NLS-1$
public AbstractSmapGenerator(TypeDeclaration type)
@@ -134,13 +134,13 @@ public abstract class AbstractSmapGenerator
pkgBinding = toplevelBinding.getPackage();
String pkgName = String.valueOf(pkgBinding.readableName());
pkgName = pkgName.replace('.',ISMAPConstants.OTJ_PATH_DELIMITER_CHAR);
-
+
if (pkgName != null && pkgName.length() > 0)
return pkgName + ISMAPConstants.OTJ_PATH_DELIMITER;
-
+
return DEFAULT_PACKAGE;
}
-
+
protected FileInfo getOrCreateFileInfoForType(SmapStratum stratum, ReferenceBinding typeBinding) {
String sourceName = String.valueOf(typeBinding.sourceName()) + ISMAPConstants.OTJ_JAVA_ENDING;
String absoluteSourceName = getPackagePathFromRefBinding(typeBinding) + sourceName;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/smap/LineNumberProvider.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/smap/LineNumberProvider.java
index 6bd413aa4..573db6fcb 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/smap/LineNumberProvider.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/smap/LineNumberProvider.java
@@ -97,7 +97,7 @@ public class LineNumberProvider
{
if (!this._sourceToLineInfos.containsKey(copySrc))
this._sourceToLineInfos.put(copySrc, new Vector<LineInfo>());
-
+
List <LineInfo>lineInfos = this._sourceToLineInfos.get(copySrc);
int outputStartLine;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/smap/RoleSmapGenerator.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/smap/RoleSmapGenerator.java
index 0325019f7..d037e7dd5 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/smap/RoleSmapGenerator.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/smap/RoleSmapGenerator.java
@@ -143,7 +143,7 @@ public class RoleSmapGenerator extends AbstractSmapGenerator
{
LineNumberProvider provider = this._type.getRoleModel().getLineNumberProvider();
FileInfo fileInfo;
-
+
List<FileInfo> knownFileInfos = stratum.getFileInfos();
if (this._type.isPurelyCopied && !knownFileInfos.isEmpty()) {
fileInfo = knownFileInfos.get(0); // current type has no source, add special lines to existing fileInfo
@@ -151,7 +151,7 @@ public class RoleSmapGenerator extends AbstractSmapGenerator
fileInfo = getOrCreateFileInfoForType(stratum, getCUType(this._type.binding));
int[] lineSeparatorPositions = this._type.compilationResult.lineSeparatorPositions;
- int startLine = lineSeparatorPositions == null
+ int startLine = lineSeparatorPositions == null
? 1
: Util.getLineNumber(this._type.sourceStart, lineSeparatorPositions, 0, lineSeparatorPositions.length-1);
for (int idx = startLine; idx <= provider.getSourceEndLineNumber(); idx++)
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/copyinheritance/CopyInheritance.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/copyinheritance/CopyInheritance.java
index b2c6707a7..12438f159 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/copyinheritance/CopyInheritance.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/copyinheritance/CopyInheritance.java
@@ -731,9 +731,9 @@ public class CopyInheritance implements IOTConstants, ClassFileConstants, ExtraC
&& !OTNameUtils.isTSuperMarkerInterface(name))
{
ReferenceBinding tsuperRole = superTeam.getMemberType(name);
- if ((tsuperRole == null ||
+ if ((tsuperRole == null ||
(!tsuperRole.isValidBinding() && tsuperRole.problemId() == ProblemReasons.NotFound))
- && superTeam instanceof SourceTypeBinding)
+ && superTeam instanceof SourceTypeBinding)
{
TypeDeclaration tsuperDecl = internalCheckCopyLateRoleFile(((SourceTypeBinding)superTeam), name);
if (tsuperDecl != null)
@@ -839,7 +839,7 @@ public class CopyInheritance implements IOTConstants, ClassFileConstants, ExtraC
subTeam.copyAttributeFrom(superTeam.getTeamModel(), OTDynCallinBindingsAttribute.ATTRIBUTE_NAME);
OTSpecialAccessAttribute attrib = (OTSpecialAccessAttribute)superTeam.getTeamModel().getAttribute(IOTConstants.OTSPECIAL_ACCESS);
if (attrib != null)
- attrib.addFieldAccessesTo(subTeam);
+ attrib.addFieldAccessesTo(subTeam);
}
/**
* If adjustSuperinterfaces updates a superinterface, we will check compatibility,
@@ -974,9 +974,9 @@ public class CopyInheritance implements IOTConstants, ClassFileConstants, ExtraC
// Synthetic methods are not read from byte code.
// FIXME(SH): this last note is not true any more.
- if ( targetRoleDecl.isTeam()
- &&
- ( ReflectionGenerator.isReflectionMethod(method)
+ if ( targetRoleDecl.isTeam()
+ &&
+ ( ReflectionGenerator.isReflectionMethod(method)
|| SerializationGenerator.isSerializationMethod(method)))
return;
if (MethodModel.isFakedMethod(method))
@@ -1105,14 +1105,14 @@ public class CopyInheritance implements IOTConstants, ClassFileConstants, ExtraC
if (methodFound != null)
TSuperHelper.addMarkerArg(newMethodDecl, srcTeam);
-
+
if(newMethodDecl.isConstructor()){
// comments (SH):
// other phases may depend on this field (constructorCall) being set,
// although it carries no real information.
ConstructorDeclaration cd = (ConstructorDeclaration)newMethodDecl;
cd.constructorCall = SuperReference.implicitSuperConstructorCall();
-
+
if ( Lifting.isLiftingCtor(method)
&& method.parameters[0].isRole())
{
@@ -1317,7 +1317,7 @@ public class CopyInheritance implements IOTConstants, ClassFileConstants, ExtraC
MethodBinding dstOrigMethod = ConstantPoolObjectMapper.mapMethod(srcMethod, srcMethod.targetMethod, null, targetTeamDecl.binding);
if (dstOrigMethod.isCallin())
dstMethod = tgtTypeDecl.binding.addSyntheticBaseCallSurrogate(dstOrigMethod);
- else
+ else
dstMethod = tgtTypeDecl.binding.addSyntheticMethod(dstOrigMethod, isSuperAccess);
break;
case SyntheticMethodBinding.BridgeMethod:
@@ -1413,7 +1413,7 @@ public class CopyInheritance implements IOTConstants, ClassFileConstants, ExtraC
AstConverter.createField(field, roleDeclaration, gen);
AstEdit.addField(roleDeclaration,fieldDeclaration, true, false/*typeProblem*/, false);
if (fieldDeclaration.binding != null) {
- fieldDeclaration.binding.modifiers |= ExtraCompilerModifiers.AccLocallyUsed;
+ fieldDeclaration.binding.modifiers |= ExtraCompilerModifiers.AccLocallyUsed;
fieldDeclaration.binding.modifiers |= (field.modifiers&ExtraCompilerModifiers.AccBlankFinal); // BlankFinal was omitted on the fieldDecl
}
@@ -1721,7 +1721,7 @@ public class CopyInheritance implements IOTConstants, ClassFileConstants, ExtraC
}
}
}
-
+
public static class RoleConstructorCall extends MessageSend {
public AllocationExpression allocationOrig;
@@ -2221,7 +2221,7 @@ public class CopyInheritance implements IOTConstants, ClassFileConstants, ExtraC
if (newType != argument.type)
{
changed = true;
-
+
newType.setBaseclassDecapsulation(argument.type.getBaseclassDecapsulation());
// local variable:
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/copyinheritance/TypeLevel.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/copyinheritance/TypeLevel.java
index cc394a5fd..18c5df401 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/copyinheritance/TypeLevel.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/copyinheritance/TypeLevel.java
@@ -76,17 +76,17 @@ public class TypeLevel {
// in earlier invocations as ClassScope.connectTeamMemberTypes(..) descends depth first
ReferenceBinding tsuperRole = tsuperRoles[tsuperRoles.length-1];
assert(tsuperRole.isDirectRole());
-
+
// don't bother with AST, we are called after hierarchies have been connected
// at the binding level.
mergeSuperinterfaces(superTeam, tsuperRole, destRole);
if (!roleDecl.isInterface())
copyAdjustSuperclass(tsuperRole, roleDecl, obligations);
copyBaseclass(tsuperRole, roleDecl);
-
+
} else {
// no tsupers to merge with, but still need to adjust the super class:
- copyAdjustSuperclass(null, roleDecl, obligations);
+ copyAdjustSuperclass(null, roleDecl, obligations);
}
adjustSuperinterfaces(superTeam, destRole, obligations);
@@ -317,7 +317,7 @@ public class TypeLevel {
*
* @param tsuperRole may be null
* @param destRoleDecl @pre: !isInterface()
- * @param obligations
+ * @param obligations
*/
static void copyAdjustSuperclass(ReferenceBinding tsuperRole, TypeDeclaration destRoleDecl, ArrayList<SupertypeObligation> obligations) {
if(tsuperRole != null) {
@@ -346,7 +346,7 @@ public class TypeLevel {
* @param destRoleDecl @pre: !isInterface()
* @param destTeam
* @param tsuperRole (may be null)
- * @param obligations record here any sub-type relations that need checking after all roles have been adjusted
+ * @param obligations record here any sub-type relations that need checking after all roles have been adjusted
*/
private static void checkAdjustSuperclass(
TypeDeclaration destRoleDecl,
@@ -373,7 +373,7 @@ public class TypeLevel {
&& !refineToTeam // an implicit extends to org.objectteams.Team is NOT dropped if the tsuper was not a team
&& ((newSuperclass.id == TypeIds.T_JavaLangObject) || destScope.isOrgObjectteamsTeam(newSuperclass))) // otherwise it was copied from a tsuper role
{
- newSuperclass = null; // drop default 'extends java.lang.Object' or o.o.Team
+ newSuperclass = null; // drop default 'extends java.lang.Object' or o.o.Team
}
// extends __OT_Confined overriding nothing or __OT__Confined is OK:
@@ -438,7 +438,7 @@ public class TypeLevel {
// and then only the old node has source positions..
}
}
-
+
// don't use TeamModel.strengthenRole because we don't want a RoleTypeBinding.
static ReferenceBinding strengthenSuper(ReferenceBinding destTeam, ReferenceBinding superRole) {
if (!superRole.isRole())
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/InsertTypeAdjustmentsVisitor.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/InsertTypeAdjustmentsVisitor.java
index 4c2938a4d..3d04d5ac4 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/InsertTypeAdjustmentsVisitor.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/InsertTypeAdjustmentsVisitor.java
@@ -155,8 +155,8 @@ public class InsertTypeAdjustmentsVisitor extends ASTVisitor {
if (syntheticAccessors != null) {
for (int i = 0; i < syntheticAccessors.length; i++) {
MethodBinding accessor = syntheticAccessors[i];
- if (accessor instanceof SyntheticMethodBinding
- && ((SyntheticMethodBinding)accessor).purpose == SyntheticMethodBinding.InferredCalloutToField)
+ if (accessor instanceof SyntheticMethodBinding
+ && ((SyntheticMethodBinding)accessor).purpose == SyntheticMethodBinding.InferredCalloutToField)
return; // already redirecting to base, prevent double-lowering
}
}
@@ -200,7 +200,7 @@ public class InsertTypeAdjustmentsVisitor extends ASTVisitor {
TypeBinding leafType = arrayInitializer.binding.elementsType();
for (int i = 0; i < expressions.length; i++)
expressions[i] = maybeWrap(scope, expressions[i], leafType);
- }
+ }
}
@Override
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/MethodSignatureEnhancer.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/MethodSignatureEnhancer.java
index 6af37ffc5..fa5dc3e2a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/MethodSignatureEnhancer.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/MethodSignatureEnhancer.java
@@ -76,7 +76,7 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.util.AstGenerator;
@SuppressWarnings("nls")
public class MethodSignatureEnhancer implements IOTConstants, TypeConstants, ClassFileConstants
{
-
+
private final static char[] OBJECT_SIGNATURE = "Ljava/lang/Object;".toCharArray();
/**
@@ -88,9 +88,9 @@ public class MethodSignatureEnhancer implements IOTConstants, TypeConstants, Cla
/** Length of the sublist of enhancing arguments. */
public final int ENHANCING_ARG_LEN;
public final char[] UNUSED_ARGS;
-
+
public static MethodSignatureEnhancer[] variants = new MethodSignatureEnhancer[WeavingScheme.values().length];
-
+
private WeavingScheme weavingScheme;
// {OT/JamVM support:
@@ -105,8 +105,8 @@ public class MethodSignatureEnhancer implements IOTConstants, TypeConstants, Cla
this.weavingScheme = weavingScheme;
if (weavingScheme == WeavingScheme.OTDRE) {
this.ENHANCING_ARG_NAMES = new char[][] {
- "_OT$baseArg".toCharArray(),
- "_OT$teams".toCharArray(),
+ "_OT$baseArg".toCharArray(),
+ "_OT$teams".toCharArray(),
"_OT$index".toCharArray(),
"_OT$callinIds".toCharArray(),
"_OT$boundMethodId".toCharArray(),
@@ -132,7 +132,7 @@ public class MethodSignatureEnhancer implements IOTConstants, TypeConstants, Cla
this.UNUSED_ARGS = this.ENHANCING_ARG_NAMES[this.ENHANCING_ARG_LEN-1];
}
// SH}
-
+
/** Get Typebindings for all enhancing arguments. */
private static TypeBinding[] getEnhancingArgTypes (Scope scope) {
//{OTDyn: configurable:
@@ -142,8 +142,8 @@ public class MethodSignatureEnhancer implements IOTConstants, TypeConstants, Cla
scope.createArrayType(scope.getOrgObjectteamsITeam(), 1), // _OT$teams
TypeBinding.INT, // _OT$index
scope.createArrayType(TypeBinding.INT, 1), // _OT$callinIds
- TypeBinding.INT, // _OT$boundMethodId
- scope.createArrayType(scope.getJavaLangObject(), 1), // _OT$args
+ TypeBinding.INT, // _OT$boundMethodId
+ scope.createArrayType(scope.getJavaLangObject(), 1), // _OT$args
};
// SH}
// {OT/JamVM support:
@@ -187,7 +187,7 @@ public class MethodSignatureEnhancer implements IOTConstants, TypeConstants, Cla
int fullLen = this.ENHANCING_ARG_LEN;
if (arguments != null) fullLen += arguments.length; // source arguments?
Argument[] newArgs = new Argument[fullLen];
- TypeReference[] enhanceTypes =
+ TypeReference[] enhanceTypes =
//{OTDyn: configurable:
this.weavingScheme == WeavingScheme.OTDRE
? new TypeReference[] {
@@ -197,7 +197,7 @@ public class MethodSignatureEnhancer implements IOTConstants, TypeConstants, Cla
new ArrayTypeReference(TypeConstants.INT, 1, gen.pos), // _OT$callinIds
gen.singleTypeReference(TypeConstants.INT), // _OT$boundMethodId
gen.qualifiedArrayTypeReference(JAVA_LANG_OBJECT, 1), // _OT$args
- }
+ }
// SH}
// {OT/JamVM support:
: JAMVM_ASPECTBI
@@ -398,18 +398,18 @@ public class MethodSignatureEnhancer implements IOTConstants, TypeConstants, Cla
String typeString = types.toString();
String prefix =
//{OTDyn: configurable:
- weavingScheme == WeavingScheme.OTDRE
- ? (makeShort
+ weavingScheme == WeavingScheme.OTDRE
+ ? (makeShort
? "IBoundBase2, ITeam[], int, int[], int, Object[]"
: "org.objectteams.IBoundBase2, org.objectteams.ITeam[], int, int[], int, java.lang.Object[]")
// SH}
// {OT/JamVM support:
: JAMVM_ASPECTBI
- ? (makeShort
+ ? (makeShort
? "Object, int, int, Object[]"
: "java.lang.Object, int, int, java.lang.Object[]")
// CH}
- : (makeShort
+ : (makeShort
? "ITeam[], int[], int, int, int, Object[]"
: "org.objectteams.ITeam[], int[], int, int, int, java.lang.Object[]");
if (typeString.startsWith(prefix)) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/PredicateGenerator.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/PredicateGenerator.java
index 3e5a4717b..dc38f07eb 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/PredicateGenerator.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/PredicateGenerator.java
@@ -347,7 +347,7 @@ public class PredicateGenerator extends SwitchOnBaseTypeGenerator
|| weavingScheme == WeavingScheme.OTDRE) // under OTREDyn base is passed as IBoundBase => always need to cast.
{
result= gen.castExpression(result, gen.baseTypeReference(roleType.baseclass()), CastExpression.RAW);
- }
+ }
}
return result;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/ReflectionGenerator.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/ReflectionGenerator.java
index cd933ce67..f74014223 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/ReflectionGenerator.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/ReflectionGenerator.java
@@ -606,7 +606,7 @@ public class ReflectionGenerator implements IOTConstants, ClassFileConstants {
gen.qualifiedTypeReference(ORG_OBJECTTEAMS_IBOUNDBASE2),
CastExpression.RAW),
ADD_REMOVE_ROLE,
- new Expression[] {gen.singleNameReference(_OT_ROLE_ARG),
+ new Expression[] {gen.singleNameReference(_OT_ROLE_ARG),
gen.booleanLiteral(false)}) // isAdding=false
: gen.messageSend(
gen.castExpression(
@@ -877,7 +877,7 @@ public class ReflectionGenerator implements IOTConstants, ClassFileConstants {
gen.qualifiedTypeReference(ORG_OBJECTTEAMS_IBOUNDBASE2),
CastExpression.RAW),
ADD_REMOVE_ROLE,
- new Expression[] {gen.singleNameReference(_OT_ROLE_ARG),
+ new Expression[] {gen.singleNameReference(_OT_ROLE_ARG),
gen.booleanLiteral(false)}) // isAdding=false
: gen.messageSend(
gen.castExpression(
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/ReplaceResultReferenceVisitor.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/ReplaceResultReferenceVisitor.java
index 803673d0e..9d03b3a39 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/ReplaceResultReferenceVisitor.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/ReplaceResultReferenceVisitor.java
@@ -32,7 +32,7 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.util.AstGenerator;
/**
* This visitor replaces SingleNameReference("result") in param mappings
- * with ResultReferences, provided they are on the correct side of the binding token.
+ * with ResultReferences, provided they are on the correct side of the binding token.
*
* @author stephan
*/
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/RoleMigrationImplementor.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/RoleMigrationImplementor.java
index 4cdd1143c..4e87498eb 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/RoleMigrationImplementor.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/RoleMigrationImplementor.java
@@ -321,7 +321,7 @@ public class RoleMigrationImplementor
codeStream.aload_0(); // this
codeStream.fieldAccess(Opcodes.OPC_getfield,
enclosingInstanceField(roleBinding), // this.this$n
- roleBinding);
+ roleBinding);
codeStream.fieldAccess(Opcodes.OPC_getfield,
roleBinding.enclosingType().getField(cacheName, true),// this.this$n._OT$cache$R
roleBinding.enclosingType());
@@ -355,7 +355,7 @@ public class RoleMigrationImplementor
codeStream.return_();
}
-
+
static MethodBinding getMethod(ReferenceBinding declaringClass, char[] selector, int numParams) {
MethodBinding[] methods = declaringClass.getMethods(selector);
MethodBinding found = null;
@@ -378,20 +378,20 @@ public class RoleMigrationImplementor
switch (scope.compilerOptions().weavingScheme) {
case OTDRE:
// _OT$addOrRemoveRole(role, isAdding)
- if (isAdding)
+ if (isAdding)
codeStream.iconst_1(); // isAdding=true
else
- codeStream.iconst_0(); // isAdding=false
+ codeStream.iconst_0(); // isAdding=false
codeStream.invoke(Opcodes.OPC_invokeinterface,
iboundBase.getMethod(scope, IOTConstants.ADD_REMOVE_ROLE),
iboundBase);
break;
case OTRE:
// _OT$addRole(role) or _OT$removeRole(role):
- codeStream.invoke(Opcodes.OPC_invokeinterface,
- isAdding
- ? iboundBase.getMethod(scope, IOTConstants.ADD_ROLE)
- : iboundBase.getMethod(scope, IOTConstants.REMOVE_ROLE),
+ codeStream.invoke(Opcodes.OPC_invokeinterface,
+ isAdding
+ ? iboundBase.getMethod(scope, IOTConstants.ADD_ROLE)
+ : iboundBase.getMethod(scope, IOTConstants.REMOVE_ROLE),
iboundBase);
}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/RoleSplitter.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/RoleSplitter.java
index b4a80064a..8438a8d04 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/RoleSplitter.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/RoleSplitter.java
@@ -177,11 +177,11 @@ public class RoleSplitter
if (((abstractMethod.modifiers) & AccPrivate) == 0) {
final MethodDeclaration newmethod = AstConverter.genRoleIfcMethod(teamDecl, method);
AstEdit.addMethod(roleIfcDecl, newmethod);
- roleIfcDecl.getRoleModel()._state.addJob(ITranslationStates.STATE_ROLE_HIERARCHY_ANALYZED, // calls methods();
+ roleIfcDecl.getRoleModel()._state.addJob(ITranslationStates.STATE_ROLE_HIERARCHY_ANALYZED, // calls methods();
new Runnable() { @Override
public void run() {
- if ( method.binding != null
- && (method.binding.modifiers & ClassFileConstants.AccDeprecated) != 0
+ if ( method.binding != null
+ && (method.binding.modifiers & ClassFileConstants.AccDeprecated) != 0
&& newmethod.binding != null)
{
newmethod.binding.modifiers |= ClassFileConstants.AccDeprecated;
@@ -402,7 +402,7 @@ public class RoleSplitter
}
- /**
+ /**
* API for LookupEnvironment:
* Establish necessary links between ifc- and class-part of each role in the given unit.
*/
@@ -420,7 +420,7 @@ public class RoleSplitter
}
if (type.memberTypes != null)
for (TypeDeclaration member : type.memberTypes)
- linkRoles(member);
+ linkRoles(member);
}
/**
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/SerializationGenerator.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/SerializationGenerator.java
index 7d4d1f840..d8e9b093b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/SerializationGenerator.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/SerializationGenerator.java
@@ -58,9 +58,9 @@ public class SerializationGenerator {
private static final char[] CLASS_ARG_NAME = "clazz".toCharArray(); //$NON-NLS-1$
private static final char[] CASTED_ROLE = "castedRole".toCharArray(); //$NON-NLS-1$
- /**
+ /**
* Generate a restore() and a restoreRole(Class,Object) method.
- * The latter remains empty at this point and must be filled later using
+ * The latter remains empty at this point and must be filled later using
* {@link #fillRestoreRole(TypeDeclaration,FieldDeclaration[])}.
* @param teamType the AST where to add the methods.
* @param gen AstGenerator with proper positions for generating.
@@ -80,12 +80,12 @@ public class SerializationGenerator {
gen.markerAnnotation(TypeConstants.JAVA_LANG_OVERRIDE)
};
AstEdit.addMethod(teamType, restore);
-
+
MethodDeclaration restoreRole = gen.method(
- teamType.compilationResult,
+ teamType.compilationResult,
ClassFileConstants.AccProtected,
- TypeBinding.VOID,
- RESTORE_ROLE,
+ TypeBinding.VOID,
+ RESTORE_ROLE,
new Argument[] {
gen.argument(CLASS_ARG_NAME, gen.parameterizedQualifiedTypeReference(TypeConstants.JAVA_LANG_CLASS, new TypeReference[]{gen.wildcard(Wildcard.UNBOUND)})),
gen.argument(ROLE_ARG_NAME, gen.qualifiedTypeReference(TypeConstants.JAVA_LANG_OBJECT))
@@ -94,7 +94,7 @@ public class SerializationGenerator {
restoreRole.annotations = new Annotation[] {
gen.markerAnnotation(TypeConstants.JAVA_LANG_OVERRIDE)
};
- AstEdit.addMethod(teamType, restoreRole);
+ AstEdit.addMethod(teamType, restoreRole);
}
/**
@@ -111,14 +111,14 @@ public class SerializationGenerator {
AstGenerator gen = new AstGenerator(restoreMethod); // re-use position
Statement[] statements = new Statement[caches.length+(superIsTeam?1:0)];
-
+
// find the matching cache for argument Class clazz:
for (int i = 0; i < caches.length; i++) {
// FIXME(SH): unclear if needed after allowing generated qualified role type referneces:
TypeReference cacheTypeRef = caches[i].type; // robustness, but with wrong source position
-
+
if (! cacheTypeRef.resolvedType.isParameterizedType()
- || ((ParameterizedTypeBinding)cacheTypeRef.resolvedType).arguments.length != 2)
+ || ((ParameterizedTypeBinding)cacheTypeRef.resolvedType).arguments.length != 2)
{
if (teamType.scope.environment().globalOptions.complianceLevel < ClassFileConstants.JDK1_5) {
restoreMethod.statements = new Statement[] { gen.emptyStatement() };
@@ -127,28 +127,28 @@ public class SerializationGenerator {
}
throw new InternalCompilerError("Unexpected resolved cache type "+cacheTypeRef.resolvedType); //$NON-NLS-1$
}
-
+
// reconstruct a type reference from the resolved cache type
ParameterizedTypeBinding oldBinding = (ParameterizedTypeBinding)cacheTypeRef.resolvedType;
ReferenceBinding roleBinding = (ReferenceBinding)oldBinding.arguments[1];
// respect different status for base/role types (scope, decapsulation).
cacheTypeRef = gen.getCacheTypeReference(teamType.scope, roleBinding.roleModel);
-
+
statements[i] = gen.ifStatement(
// if (Role.class.isAssignableFrom(clazz)) { ...
- gen.messageSend(gen.classLiteralAccess(gen.typeReference(roleBinding)),
- IS_ASSIGNABLE_FROM,
+ gen.messageSend(gen.classLiteralAccess(gen.typeReference(roleBinding)),
+ IS_ASSIGNABLE_FROM,
new Expression[] { gen.singleNameReference(CLASS_ARG_NAME)}),
gen.block(new Statement[] {
- // Role castedRole = (Role) role;
- gen.localVariable(CASTED_ROLE, roleBinding,
- gen.castExpression(gen.singleNameReference(ROLE_ARG_NAME),
+ // Role castedRole = (Role) role;
+ gen.localVariable(CASTED_ROLE, roleBinding,
+ gen.castExpression(gen.singleNameReference(ROLE_ARG_NAME),
gen.typeReference(roleBinding), CastExpression.RAW)),
// Base base = role._OT$getBase();
gen.localVariable(IOTConstants.BASE, gen.baseclassReference(roleBinding.baseclass(), true /*erase*/),
gen.messageSend(
- gen.singleNameReference(CASTED_ROLE),
- IOTConstants._OT_GETBASE,
+ gen.singleNameReference(CASTED_ROLE),
+ IOTConstants._OT_GETBASE,
null/*arguments*/)),
// <roleCache[i]>.put(base, castedRole);
gen.messageSend(
@@ -162,12 +162,12 @@ public class SerializationGenerator {
// OTDYN: Slightly different methods depending on the weaving strategy:
teamType.scope.compilerOptions().weavingScheme == WeavingScheme.OTDRE
? gen.messageSend(
- gen.castExpression(gen.singleNameReference(IOTConstants.BASE),
+ gen.castExpression(gen.singleNameReference(IOTConstants.BASE),
gen.qualifiedTypeReference(IOTConstants.ORG_OBJECTTEAMS_IBOUNDBASE2), CastExpression.RAW),
IOTConstants.ADD_REMOVE_ROLE,
new Expression[]{gen.singleNameReference(CASTED_ROLE), gen.booleanLiteral(true)})
: gen.messageSend(
- gen.castExpression(gen.singleNameReference(IOTConstants.BASE),
+ gen.castExpression(gen.singleNameReference(IOTConstants.BASE),
gen.qualifiedTypeReference(IOTConstants.ORG_OBJECTTEAMS_IBOUNDBASE), CastExpression.RAW),
IOTConstants.ADD_ROLE,
new Expression[]{gen.singleNameReference(CASTED_ROLE)}),
@@ -175,7 +175,7 @@ public class SerializationGenerator {
gen.returnStatement(null)
}));
}
-
+
if (superIsTeam) {
// if no suitable cache found so far:
// super.restoreRole(clazz, role);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/StandardElementGenerator.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/StandardElementGenerator.java
index 46d6e5e10..b309977fc 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/StandardElementGenerator.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/StandardElementGenerator.java
@@ -210,7 +210,7 @@ public class StandardElementGenerator {
*/
boolean shouldWeaken = (teamModel.getState() >= ITranslationStates.STATE_TYPES_ADJUSTED); // weakening for other methods already done?
MethodBinding superMethod = null;
-
+
roleType = roleType.getRealType();
char[] methodName = CharOperation.concat(CAST_PREFIX, roleType.sourceName());
if (dimensions > 0)
@@ -346,7 +346,7 @@ public class StandardElementGenerator {
AstEdit.addGeneratedMethod(teamClass, castMethod);
if (clearPrivateModifier)
castMethod.binding.tagBits = TagBits.ClearPrivateModifier;
-
+
if (superMethod != null)
CopyInheritance.weakenSignature(castMethod, superMethod);
return castMethod.binding;
@@ -525,7 +525,7 @@ public class StandardElementGenerator {
createGetBaseMethod(roleType, baseclass, _OT_GETBASE, AccPublic|AccAbstract|AccSemicolonBody);
} else {
checkCreateBaseField(roleType, baseclass, true);
-
+
// all actual base fields are accessible by a corresponding method:
// for role classes create two versions (ifc/class)
createGetBaseMethod(role.getInterfaceAst(), baseclass, _OT_GETBASE, AccPublic|AccAbstract|AccSemicolonBody);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/SwitchOnBaseTypeGenerator.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/SwitchOnBaseTypeGenerator.java
index eeac5c190..bb14148c2 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/SwitchOnBaseTypeGenerator.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/SwitchOnBaseTypeGenerator.java
@@ -95,7 +95,7 @@ public abstract class SwitchOnBaseTypeGenerator implements IOTConstants {
RoleModel[] rolesToSort = new RoleModel[caseObjects.length];
System.arraycopy(caseObjects, 0, rolesToSort, 0, caseObjects.length);
caseObjects = Sorting.sortRoles(rolesToSort);
-
+
Statement[] stmts = new Statement[2];
Expression baseArg = gen.singleNameReference(baseVarName());
ReferenceBinding castType = null;
@@ -107,10 +107,10 @@ public abstract class SwitchOnBaseTypeGenerator implements IOTConstants {
baseArg = gen.castExpression(baseArg, gen.baseTypeReference(castType), CastExpression.RAW);
char[] LOCAL_BASE_NAME = "_OT$local$base".toCharArray(); //$NON-NLS-1$
stmts[0] = gen.localVariable(LOCAL_BASE_NAME, gen.baseclassReference(staticBaseType), baseArg);
-
+
IfStatement prevIf = null;
- /*
+ /*
* if (_OT$local$base instanceof MySubBaseA)
* <action for MySubRoleA playedBy MySubBaseA>
* else if (_OT$local$base instanceof MySubBaseB)
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/TeamMethodGenerator.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/TeamMethodGenerator.java
index 05f651873..baacca10b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/TeamMethodGenerator.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/TeamMethodGenerator.java
@@ -77,18 +77,18 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.util.AstGenerator;
* This class adds methods and fields from org.objectteams.Team to those teams that
* extend a non-team class and thus cannot inherit these necessary members.
* Methods are copied via byte-code copy, fields are generated at AST-level (incl. initialization).
- *
+ *
* Technical note: the way this generator is constructed it assumes that org.objectteams.Team
* exists in binary form, i.e., a team leveraging this generator cannot be compiled together
* with org.objectteams.Team.
- *
+ *
* @since 1.4.0
*/
public class TeamMethodGenerator {
static final char[][] JAVA_LANG_WEAKHASHMAP = new char[][] {"java".toCharArray(), "util".toCharArray(), "WeakHashMap".toCharArray()}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
static final char[][] JAVA_LANG_THREAD = new char[][] {"java".toCharArray(), "lang".toCharArray(), "Thread".toCharArray()}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
static final char[][] JAVA_LANG_THREADLOCAL = new char[][] {"java".toCharArray(), "lang".toCharArray(), "ThreadLocal".toCharArray()}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
+
/** Simple structure to represent one method of o.o.Team. */
static class MethodDescriptor {
String selector;
@@ -96,12 +96,12 @@ public class TeamMethodGenerator {
Type args;
Type returnType;
int modifiers;
-
+
// store from binary method of o.o.Team:
int methodCodeOffset;
ReferenceBinding declaringClass;
MethodBinding binding;
-
+
MethodDescriptor(String selector, String signature, Type args, Type returnType, int modifiers) {
super();
this.selector = selector;
@@ -115,15 +115,15 @@ public class TeamMethodGenerator {
Argument[] makeArgs(AstGenerator gen) {
switch (this.args) {
case THREAD:
- return new Argument[] {
+ return new Argument[] {
gen.argument("thread".toCharArray(), gen.qualifiedTypeReference(JAVA_LANG_THREAD))
};
case BOOLEAN:
- return new Argument[] {
+ return new Argument[] {
gen.argument("flag".toCharArray(), gen.baseTypeReference(TypeConstants.BOOLEAN))
};
case INT:
- return new Argument[] {
+ return new Argument[] {
gen.argument("flags".toCharArray(), gen.baseTypeReference(TypeConstants.INT))
};
case OTDYNARGS1:
@@ -171,7 +171,7 @@ public class TeamMethodGenerator {
return null;
}
}
-
+
TypeReference makeReturnRef(AstGenerator gen) {
switch (this.returnType) {
case BOOLEAN:
@@ -187,11 +187,11 @@ public class TeamMethodGenerator {
}
}
}
- enum Type {
+ enum Type {
NONE {
@Override public int length() { return 0; }
- },
- THREAD, BOOLEAN, INT, OBJECT,
+ },
+ THREAD, BOOLEAN, INT, OBJECT,
OTDYNARGS1 { @Override int length() { return 6; } },
OTDYNARGS2 { @Override int length() { return 8; } },
OTDYNARGS3 { @Override int length() { return 4; } },
@@ -222,17 +222,17 @@ public class TeamMethodGenerator {
};
@SuppressWarnings("nls")
final MethodDescriptor[] methodDescriptorsDyn = new MethodDescriptor[] {
- new MethodDescriptor("_OT$callAllBindings", "(Lorg/objectteams/IBoundBase2;[Lorg/objectteams/ITeam;I[II[Ljava/lang/Object;)Ljava/lang/Object;",
+ new MethodDescriptor("_OT$callAllBindings", "(Lorg/objectteams/IBoundBase2;[Lorg/objectteams/ITeam;I[II[Ljava/lang/Object;)Ljava/lang/Object;",
Type.OTDYNARGS1, Type.OBJECT, AccPublic),
- new MethodDescriptor("_OT$callNext", "(Lorg/objectteams/IBoundBase2;[Lorg/objectteams/ITeam;I[II[Ljava/lang/Object;[Ljava/lang/Object;I)Ljava/lang/Object;",
+ new MethodDescriptor("_OT$callNext", "(Lorg/objectteams/IBoundBase2;[Lorg/objectteams/ITeam;I[II[Ljava/lang/Object;[Ljava/lang/Object;I)Ljava/lang/Object;",
Type.OTDYNARGS2, Type.OBJECT, AccPublic),
- new MethodDescriptor("_OT$callReplace", "(Lorg/objectteams/IBoundBase2;[Lorg/objectteams/ITeam;I[II[Ljava/lang/Object;)Ljava/lang/Object;",
+ new MethodDescriptor("_OT$callReplace", "(Lorg/objectteams/IBoundBase2;[Lorg/objectteams/ITeam;I[II[Ljava/lang/Object;)Ljava/lang/Object;",
Type.OTDYNARGS1, Type.OBJECT, AccPublic),
- new MethodDescriptor("_OT$callBefore", "(Lorg/objectteams/IBoundBase2;II[Ljava/lang/Object;)V",
+ new MethodDescriptor("_OT$callBefore", "(Lorg/objectteams/IBoundBase2;II[Ljava/lang/Object;)V",
Type.OTDYNARGS3, Type.NONE, AccPublic),
- new MethodDescriptor("_OT$callAfter", "(Lorg/objectteams/IBoundBase2;II[Ljava/lang/Object;Ljava/lang/Object;)V",
+ new MethodDescriptor("_OT$callAfter", "(Lorg/objectteams/IBoundBase2;II[Ljava/lang/Object;Ljava/lang/Object;)V",
Type.OTDYNARGS4, Type.NONE, AccPublic),
- new MethodDescriptor("_OT$callOrigStatic", "(II[Ljava/lang/Object;)Ljava/lang/Object;",
+ new MethodDescriptor("_OT$callOrigStatic", "(II[Ljava/lang/Object;)Ljava/lang/Object;",
Type.OTDYNARGS5, Type.OBJECT, AccPublic)
};
@@ -242,7 +242,7 @@ public class TeamMethodGenerator {
// --- variant if o.o.Team is a SourceTypeBinding:
public SourceTypeBinding ooTeamBinding;
// ==== ====
-
+
public TeamMethodGenerator(WeavingScheme weavingScheme) {
if (weavingScheme == WeavingScheme.OTDRE) {
int l1 = this.methodDescriptors.length;
@@ -259,7 +259,7 @@ public class TeamMethodGenerator {
try {
char[] selector = method.getSelector();
char[] descriptor = method.getMethodDescriptor();
- File file = new File(String.valueOf(binaryType.getFileName()));
+ File file = new File(String.valueOf(binaryType.getFileName()));
ClassFileReader reader = ClassFileReader.read(file, true);
for (IBinaryMethod binMethod : reader.getMethods()) {
if (CharOperation.equals(selector, binMethod.getSelector())
@@ -278,9 +278,9 @@ public class TeamMethodGenerator {
public void registerTeamMethod(IBinaryMethod method, MethodBinding methodBinding) {
String selector = String.valueOf(method.getSelector());
String descriptor = String.valueOf(method.getMethodDescriptor());
- registerTeamMethod(methodBinding.declaringClass, methodBinding, selector, descriptor, -1/*structOffset not yet known*/);
+ registerTeamMethod(methodBinding.declaringClass, methodBinding, selector, descriptor, -1/*structOffset not yet known*/);
}
-
+
/** When o.o.Team is read from .class file, record the byte code here. */
public synchronized void maybeRegisterTeamClassBytes(ClassFileReader teamClass, ReferenceBinding teamClassBinding) {
if (this.classBytes != null)
@@ -351,14 +351,14 @@ public class TeamMethodGenerator {
return registerTeamMethod(method.declaringClass, method, selector, signature, -1/*no structOffset before class is complete*/);
}
// ==============
- /**
+ /**
* Add the AST representing all relevant methods and fields from o.o.Team,
* and prepare methods for byte-code copy.
*/
public void addMethodsAndFields(TypeDeclaration teamDecl) {
// FIXME(SH): test subteams of teams already treated by this generator!
AstGenerator gen = new AstGenerator(teamDecl);
-
+
boolean hasBoundRole = false;
// check what will be generated:
boolean hasCallinBefore = false, hasCallinAfter = false, hasCallinReplace = false;
@@ -396,13 +396,13 @@ public class TeamMethodGenerator {
if (hasBoundRole) {
newMethod = new CopiedTeamMethod(teamDecl.compilationResult, methodDescriptor, gen);
} else {
- newMethod = gen.method(teamDecl.compilationResult,
- methodDescriptor.modifiers,
- methodDescriptor.makeReturnRef(gen),
- methodDescriptor.selector.toCharArray(),
+ newMethod = gen.method(teamDecl.compilationResult,
+ methodDescriptor.modifiers,
+ methodDescriptor.makeReturnRef(gen),
+ methodDescriptor.selector.toCharArray(),
null,
new Statement[0]); // regular empty method.
- }
+ }
}
AstEdit.addGeneratedMethod(teamDecl, newMethod);
}
@@ -428,16 +428,16 @@ public class TeamMethodGenerator {
void addFields(TypeDeclaration teamDecl, AstGenerator gen) {
// private WeakHashMap<Thread, Boolean> _OT$activatedThreads = new WeakHashMap<Thread, Boolean>();
addPrivateField(teamDecl, gen,
- weakHashMapTypeReference(gen),
+ weakHashMapTypeReference(gen),
"_OT$activatedThreads".toCharArray(),
gen.allocation(weakHashMapTypeReference(gen), null));
-
+
// private Object _OT$registrationLock= new Object();
addPrivateField(teamDecl, gen,
- gen.qualifiedTypeReference(TypeConstants.JAVA_LANG_OBJECT),
+ gen.qualifiedTypeReference(TypeConstants.JAVA_LANG_OBJECT),
"_OT$registrationLock".toCharArray(),
gen.allocation(gen.qualifiedTypeReference(TypeConstants.JAVA_LANG_OBJECT), null));
-
+
// private boolean _OT$lazyGlobalActiveFlag = false;
addPrivateField(teamDecl, gen,
gen.baseTypeReference(TypeConstants.BOOLEAN),
@@ -449,19 +449,19 @@ public class TeamMethodGenerator {
gen.baseTypeReference(TypeConstants.BOOLEAN),
"_OT$isExecutingCallin".toCharArray(),
gen.booleanLiteral(false));
-
+
// private int _OT$registrationState = _OT$UNREGISTERED;
addPrivateField(teamDecl, gen,
gen.baseTypeReference(TypeConstants.INT),
"_OT$registrationState".toCharArray(),
gen.intLiteral(0));
-
+
// private boolean _OT$globalActive = false;
addPrivateField(teamDecl, gen,
gen.baseTypeReference(TypeConstants.BOOLEAN),
"_OT$globalActive".toCharArray(),
gen.booleanLiteral(false));
-
+
// private ThreadLocal<Integer> _OT$implicitActivationsPerThread = new ThreadLocal<Integer>() {
// protected synchronized Integer initialValue() {
// return Integer.valueOf(0);
@@ -469,13 +469,13 @@ public class TeamMethodGenerator {
// };
TypeDeclaration anonThreadLocal = gen.anonymousType(teamDecl.compilationResult);
anonThreadLocal.methods = new MethodDeclaration[] {
- gen.method( teamDecl.compilationResult,
- AccProtected|AccSynchronized,
- gen.qualifiedTypeReference(TypeConstants.JAVA_LANG_INTEGER),
- "initialValue".toCharArray(),
+ gen.method( teamDecl.compilationResult,
+ AccProtected|AccSynchronized,
+ gen.qualifiedTypeReference(TypeConstants.JAVA_LANG_INTEGER),
+ "initialValue".toCharArray(),
null/*arguments*/,
new Statement[] {
- gen.returnStatement(gen.intLiteral(0)) // rely on autoboxing
+ gen.returnStatement(gen.intLiteral(0)) // rely on autoboxing
})
};
addPrivateField(teamDecl, gen,
@@ -488,11 +488,11 @@ public class TeamMethodGenerator {
boolean teamHasProblems = teamDecl.ignoreFurtherInvestigation;
AstEdit.addField(teamDecl, field, !teamHasProblems, false, false);
if (!teamHasProblems)
- field.binding.modifiers |= ExtraCompilerModifiers.AccLocallyUsed;
+ field.binding.modifiers |= ExtraCompilerModifiers.AccLocallyUsed;
}
QualifiedTypeReference weakHashMapTypeReference(AstGenerator gen) {
return gen.parameterizedQualifiedTypeReference(
- JAVA_LANG_WEAKHASHMAP,
+ JAVA_LANG_WEAKHASHMAP,
new TypeReference[]{
gen.qualifiedTypeReference(JAVA_LANG_THREAD),
gen.qualifiedTypeReference(TypeConstants.JAVA_LANG_BOOLEAN)
@@ -505,8 +505,8 @@ public class TeamMethodGenerator {
gen.qualifiedTypeReference(TypeConstants.JAVA_LANG_INTEGER)
});
}
-
- /**
+
+ /**
* Add fake method bindings for methods that will be generated by the OTRE.
* These bindings are needed by the TeamConstantPoolMapper.
*/
@@ -569,16 +569,16 @@ public class TeamMethodGenerator {
offsets = TeamMethodGenerator.this.constantPoolOffsets;
structOffset = this.descriptor.methodCodeOffset;
}
- ConstantPoolObjectReader reader = new ConstantPoolObjectReader( bytes,
- offsets,
- this.descriptor.declaringClass.getTeamModel(),
+ ConstantPoolObjectReader reader = new ConstantPoolObjectReader( bytes,
+ offsets,
+ this.descriptor.declaringClass.getTeamModel(),
this.scope.environment());
new BytecodeTransformer().doCopyMethodCode( null /*srcRoleModel*/, this.binding, // source
(SourceTypeBinding)this.binding.declaringClass, this, // destination
bytes, // source bytes
offsets,
structOffset,
- reader, mapper, // mapping strategies
+ reader, mapper, // mapping strategies
classFile); // final destination
}
}
@@ -599,7 +599,7 @@ public class TeamMethodGenerator {
@Override
public ConstantPoolObject mapConstantPoolObject(ConstantPoolObject src_cpo) {
int type=src_cpo.getType();
-
+
TypeBinding clazz = null;
switch (type) {
case MethodRefTag:
@@ -613,7 +613,7 @@ public class TeamMethodGenerator {
}
if (TypeBinding.notEquals(clazz, this.srcType))
return src_cpo; // only map references to o.o.Team
-
+
// perform the mapping:
switch(type){
case FieldRefTag:
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/TransformStatementsVisitor.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/TransformStatementsVisitor.java
index 4d9e98136..9ac76ccf2 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/TransformStatementsVisitor.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/transformer/TransformStatementsVisitor.java
@@ -82,7 +82,7 @@ public class TransformStatementsVisitor
private boolean isLocalTypeInCallin = false;
private WeavingScheme weavingScheme;
-
+
public TransformStatementsVisitor(WeavingScheme weavingScheme) {
this.weavingScheme = weavingScheme;
}
@@ -154,7 +154,7 @@ public class TransformStatementsVisitor
messageSend.bits |= ASTNode.HasBeenTransformed; // only the outer has been transformed so far.
return true;
}
-
+
/** May need to add arguments to a 'recursive' callin message send. */
@Override
public boolean visit(MessageSend messageSend, BlockScope scope) {
@@ -177,7 +177,7 @@ public class TransformStatementsVisitor
int len = args.length;
if (methodDecl.isStatic()) // chop of premature isSuperAccess flag:
System.arraycopy(args, 1, args=new Expression[len-1], 0, len-1);
- }
+ }
}
}
messageSend.arguments = MethodSignatureEnhancer.enhanceArguments(args, messageSend.sourceEnd+1, this.weavingScheme);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstConverter.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstConverter.java
index 01cd46f7a..c402c69ef 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstConverter.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstConverter.java
@@ -211,7 +211,7 @@ public class AstConverter implements ClassFileConstants, ExtraCompilerModifiers,
fieldDeclaration.copyInheritanceSrc = fieldBinding.copyInheritanceSrc;
else
fieldDeclaration.copyInheritanceSrc = fieldBinding;
-
+
AnnotationBinding[] annotBindings = fieldBinding.getAnnotations();
if (annotBindings != Binding.NO_ANNOTATIONS) {
ProblemReporter pr = fieldBinding.isStatic() ?
@@ -238,7 +238,7 @@ public class AstConverter implements ClassFileConstants, ExtraCompilerModifiers,
pr.unexpectedAnnotationStructure(annotTypeName, fieldBinding.name, gen.sourceStart, gen.sourceEnd);
hasAnnotationError = true;
} else
- if ( numPairs == 1
+ if ( numPairs == 1
&& CharOperation.equals(names[0], TypeConstants.VALUE)) {
annotDecls[i] = gen.singleMemberAnnotation(annotTypeName, values[0]);
} else {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstEdit.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstEdit.java
index eca5735b2..1eeb2f1d6 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstEdit.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstEdit.java
@@ -180,7 +180,7 @@ public class AstEdit {
TypeDeclaration classTypeDeclaration,
AbstractMethodDeclaration methodDeclaration,
boolean wasSynthetic,
- boolean addToFront,
+ boolean addToFront,
MethodBinding copyInheritanceSrc)
{
addMethod(classTypeDeclaration, methodDeclaration, wasSynthetic, addToFront, copyInheritanceSrc, true);
@@ -199,7 +199,7 @@ public class AstEdit {
TypeDeclaration classTypeDeclaration,
AbstractMethodDeclaration methodDeclaration,
boolean wasSynthetic,
- boolean addToFront,
+ boolean addToFront,
MethodBinding original,
boolean isCopyInheritance)
{
@@ -264,7 +264,7 @@ public class AstEdit {
decl.methods = null;
} else {
AbstractMethodDeclaration[] methods = new AbstractMethodDeclaration[length - 1];
-
+
if (decl.methods != null) {
for (int i = 0; i < decl.methods.length; i++) {
if (method == decl.methods[i].binding) {
@@ -273,7 +273,7 @@ public class AstEdit {
}
}
}
-
+
if (pos >= 0) {
System.arraycopy(decl.methods, 0, methods, 0, pos);
System.arraycopy(
@@ -530,7 +530,7 @@ public class AstEdit {
addImplementsReference(roleClassDecl, implementsRef);
}
- public static void addException(AbstractMethodDeclaration methodDecl, TypeReference exceptionRef, boolean resolve)
+ public static void addException(AbstractMethodDeclaration methodDecl, TypeReference exceptionRef, boolean resolve)
{
if (methodDecl.thrownExceptions != null) {
int len = methodDecl.thrownExceptions.length;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstFactory.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstFactory.java
index 107bab5c1..dfde07fb3 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstFactory.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstFactory.java
@@ -57,7 +57,7 @@ public abstract class AstFactory implements ClassFileConstants, ExtraCompilerMod
this._sourcePosition = new SourcePosition(this.sourceStart, this.sourceEnd, this.pos);
}
- /**
+ /**
* This method shifts the generators position off by one.
* If adding a @SuppressWarnings annotation with this offset,
* non-generated code will not be affected by that annotation.
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstGenerator.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstGenerator.java
index 4b186b2f7..88f44b5ca 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstGenerator.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstGenerator.java
@@ -86,20 +86,20 @@ public class AstGenerator extends AstFactory {
static final int AccIfcMethod = AccAbstract|AccSemicolonBody;
public long sourceLevel = ClassFileConstants.JDK1_5;
- /**
- * If set to non-null, base anchored types matching this anchor are not encoded using the base field
+ /**
+ * If set to non-null, base anchored types matching this anchor are not encoded using the base field
* (possibly with static prefix),
* but a simple name "base" is used, representing the base argument in a callin wrapper.
*/
public ITeamAnchor replaceableBaseAnchor = null;
-
+
/**
* If this reference is non-null, qualifications in qualified this references that refer
- * to <code>replaceableEnclosingClass</code>'s super class should be updated to
+ * to <code>replaceableEnclosingClass</code>'s super class should be updated to
* <code>replaceableEnclosingClass</code> itself (strengthening during copy).
*/
public ReferenceBinding replaceableEnclosingClass;
-
+
public AstGenerator(int start, int end) {
super(start, end);
}
@@ -531,7 +531,7 @@ public class AstGenerator extends AstFactory {
compoundName = CharOperation.splitOn('$', tokenString);
TypeReference[][] arguments = new TypeReference[compoundName.length][];
int argPos = compoundName.length-1;
- boolean haveArguments = false;
+ boolean haveArguments = false;
do {
TypeBinding[] argumentTypes = paramType.arguments;
if (argumentTypes != null) {
@@ -725,9 +725,9 @@ public class AstGenerator extends AstFactory {
result.sourceEnd = this.sourceEnd;
return result;
}
-
- public LiftingTypeReference liftingTypeReference(TypeReference baseReference, TypeReference roleReference,
- char[] roleToken, char[][] baseTokens)
+
+ public LiftingTypeReference liftingTypeReference(TypeReference baseReference, TypeReference roleReference,
+ char[] roleToken, char[][] baseTokens)
{
LiftingTypeReference result = new LiftingTypeReference();
result.sourceStart = this.sourceStart;
@@ -740,7 +740,7 @@ public class AstGenerator extends AstFactory {
result.roleToken = roleToken;
return result;
}
-
+
public FieldDeclaration field(int modifiers, TypeReference typeRef, char[] name, Expression init)
{
FieldDeclaration field = new FieldDeclaration(name, this.sourceStart, this.sourceEnd);
@@ -804,7 +804,7 @@ public class AstGenerator extends AstFactory {
}
/** If typeBinding has a free type parameter, we need to push this param out as a method parameter. */
- public void maybeAddTypeParametersToMethod(ReferenceBinding typeBinding, MethodDeclaration methodDecl)
+ public void maybeAddTypeParametersToMethod(ReferenceBinding typeBinding, MethodDeclaration methodDecl)
{
if (typeBinding.isParameterizedType()) {
TypeBinding[] arguments = ((ParameterizedTypeBinding)typeBinding).arguments;
@@ -877,13 +877,13 @@ public class AstGenerator extends AstFactory {
// skip the receiver unless its again a hooked message send:
if (this.receiver.getClass() == this.getClass())
this.receiver.resolveType(scope);
-
+
this.binding = method;
this.resolvedType = method.returnType;
// the main payload:
hook.run(scope);
-
+
this.actualReceiverType = this.binding.declaringClass;
return this.resolvedType;
}
@@ -919,8 +919,8 @@ public class AstGenerator extends AstFactory {
}
/** Create a message send to a method that will be created by the otre. */
- public MessageSend fakeMessageSend(Expression receiver, char[] selector, Expression[] parameters,
- final ReferenceBinding receiverType, final TypeBinding resolvedReturn)
+ public MessageSend fakeMessageSend(Expression receiver, char[] selector, Expression[] parameters,
+ final ReferenceBinding receiverType, final TypeBinding resolvedReturn)
{
MessageSend messageSend = new MessageSend() {
@Override
@@ -929,7 +929,7 @@ public class AstGenerator extends AstFactory {
CheckPoint cp = referenceContext.compilationResult().getCheckPoint(referenceContext);
super.resolveType(scope);
referenceContext.compilationResult().rollBack(cp);
- this.binding = new MethodBinding(ClassFileConstants.AccStatic|ClassFileConstants.AccPublic, this.selector,
+ this.binding = new MethodBinding(ClassFileConstants.AccStatic|ClassFileConstants.AccPublic, this.selector,
resolvedReturn, this.binding.parameters, Binding.NO_EXCEPTIONS, receiverType);
return this.resolvedType = resolvedReturn;
}
@@ -980,7 +980,7 @@ public class AstGenerator extends AstFactory {
}
public QualifiedAllocationExpression anonymousAllocation(
- TypeReference superType, Expression[] arguments, TypeDeclaration anonymousType)
+ TypeReference superType, Expression[] arguments, TypeDeclaration anonymousType)
{
QualifiedAllocationExpression result = new QualifiedAllocationExpression();
result.enclosingInstance = null;
@@ -988,7 +988,7 @@ public class AstGenerator extends AstFactory {
result.arguments = arguments;
result.anonymousType = anonymousType;
anonymousType.allocation = result;
- return setPos(result);
+ return setPos(result);
}
public TypeDeclaration anonymousType(CompilationResult compilationResult) {
@@ -1004,7 +1004,7 @@ public class AstGenerator extends AstFactory {
anonymousType.isGenerated = true;
return anonymousType;
}
-
+
public ExplicitConstructorCall explicitConstructorCall(int accessMode) {
ExplicitConstructorCall call = new ExplicitConstructorCall(accessMode);
call.sourceStart = this.sourceStart;
@@ -1079,7 +1079,7 @@ public class AstGenerator extends AstFactory {
}
/**
* Assemble an ifstatement with negated condition, that hides the branch instruction from the debugger,
- * even when stepping into the condition.
+ * even when stepping into the condition.
*/
public IfStatement stealthIfNotStatement(final Expression condition, Statement thenStatement) {
// mark step-over after the condition:
@@ -1088,7 +1088,7 @@ public class AstGenerator extends AstFactory {
public StringBuffer printExpression(int indent, StringBuffer output) { return condition.print(indent, output); }
@Override
public TypeBinding resolveType(BlockScope scope) {
- return condition.resolveType(scope);
+ return condition.resolveType(scope);
}
@Override
public void computeConversion(Scope scope, TypeBinding runtimeType, TypeBinding compileTimeType) {
@@ -1097,10 +1097,10 @@ public class AstGenerator extends AstFactory {
this.bits = condition.bits;
}
@Override
- public Constant optimizedBooleanConstant() {
+ public Constant optimizedBooleanConstant() {
this.constant = condition.optimizedBooleanConstant();
this.bits = condition.bits;
- return this.constant;
+ return this.constant;
}
@Override
public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo, boolean valueRequired) {
@@ -1122,7 +1122,7 @@ public class AstGenerator extends AstFactory {
new UnaryExpression( // NOT
recordingCondition,
OperatorIds.NOT),
- thenStatement,
+ thenStatement,
this.sourceStart, this.sourceEnd);
}
public ThrowStatement throwStatement(Expression exception) {
@@ -1368,7 +1368,7 @@ public class AstGenerator extends AstFactory {
ParameterizedQualifiedTypeReference fieldTypeRef;
TypeReference[] typeArguments = new TypeReference[] {
baseclassReference(baseTypeBinding, true/*erase*/),
- singleTypeReference(rootRoleBinding.sourceName())
+ singleTypeReference(rootRoleBinding.sourceName())
};
fieldTypeRef = (ParameterizedQualifiedTypeReference)parameterizedQualifiedTypeReference(
WEAK_HASH_MAP,
@@ -1428,7 +1428,7 @@ public class AstGenerator extends AstFactory {
else
return castExpression(expression, alienScopeTypeReference(typeReference(expectedType), originalScope), CastExpression.RAW);
}
-
+
// ========= Method Mappings: =========
public CalloutMappingDeclaration calloutMappingDeclaration(
CompilationResult compilationResult) {
@@ -1483,7 +1483,7 @@ public class AstGenerator extends AstFactory {
result.memberValue = arrayInitializer;
return result;
}
-
+
public NormalAnnotation normalAnnotation(char[][] compoundName, char[][] names, Expression[] values) {
assert names.length == values.length : "names and values must have same length"; //$NON-NLS-1$
NormalAnnotation result = new NormalAnnotation(qualifiedTypeReference(compoundName), this.sourceStart);
@@ -1496,7 +1496,7 @@ public class AstGenerator extends AstFactory {
result.memberValuePairs = pairs;
return result;
}
-
+
public MarkerAnnotation markerAnnotation(char[][] compoundName) {
return new MarkerAnnotation(qualifiedTypeReference(compoundName), this.sourceStart);
}
@@ -1530,7 +1530,7 @@ public class AstGenerator extends AstFactory {
origScope = ((IAlienScopeTypeReference)original).getAlienScope();
// if (origScope.parent.kind == Scope.CLASS_SCOPE)
// origScope = (ClassScope)origScope.parent;
-
+
TypeReference result;
if (original instanceof ParameterizedSingleTypeReference) {
ParameterizedSingleTypeReference pstRef = (ParameterizedSingleTypeReference) original;
@@ -1539,7 +1539,7 @@ public class AstGenerator extends AstFactory {
} else if (original instanceof SingleTypeReference) {
if (original instanceof ArrayTypeReference && original.dimensions() > 0) { // could be parameterized type reference
ArrayTypeReference singleTypeRef = (ArrayTypeReference) original;
- result = new AlienScopeArrayTypeReference(singleTypeRef.token, this.pos, singleTypeRef.dimensions, origScope);
+ result = new AlienScopeArrayTypeReference(singleTypeRef.token, this.pos, singleTypeRef.dimensions, origScope);
} else {
SingleTypeReference singleTypeRef = (SingleTypeReference) original;
result = new AlienScopeSingleTypeReference(singleTypeRef.token, this.pos, origScope);
@@ -1547,7 +1547,7 @@ public class AstGenerator extends AstFactory {
} else if (original instanceof QualifiedTypeReference) {
if (original instanceof ArrayQualifiedTypeReference && original.dimensions() > 0) { // could be parameterized type reference
ArrayQualifiedTypeReference qTypeRef= (ArrayQualifiedTypeReference)original;
- result = new AlienScopeArrayQualifiedTypeReference(qTypeRef.tokens, qTypeRef.sourcePositions, qTypeRef.dimensions(), origScope);
+ result = new AlienScopeArrayQualifiedTypeReference(qTypeRef.tokens, qTypeRef.sourcePositions, qTypeRef.dimensions(), origScope);
} else if (original instanceof ParameterizedQualifiedTypeReference) {
ParameterizedQualifiedTypeReference qTypeRef= (ParameterizedQualifiedTypeReference)original;
result = new AlienScopeParameterizedQualifiedTypeReference(qTypeRef, origScope);
@@ -1555,7 +1555,7 @@ public class AstGenerator extends AstFactory {
QualifiedTypeReference qTypeRef= (QualifiedTypeReference)original;
result = new AlienScopeQualifiedTypeReference(qTypeRef.tokens, qTypeRef.sourcePositions, origScope);
}
- } else {
+ } else {
throw new InternalCompilerError("Unexpected type reference: "+original); //$NON-NLS-1$
}
result.setBaseclassDecapsulation(DecapsulationState.REPORTED);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/IAlienScopeTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/IAlienScopeTypeReference.java
index 4f92545c0..afc16e6ef 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/IAlienScopeTypeReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/IAlienScopeTypeReference.java
@@ -162,7 +162,7 @@ public interface IAlienScopeTypeReference {
return super.resolveType((BlockScope) this.alienScope, checkBounds);
}
}
-
+
class AlienScopeQualifiedTypeReference extends QualifiedTypeReference implements IAlienScopeTypeReference
{
Scope alienScope;
@@ -202,7 +202,7 @@ public interface IAlienScopeTypeReference {
// no-op, simply suppress this warning.
}
}
-
+
class AlienScopeParameterizedQualifiedTypeReference extends ParameterizedQualifiedTypeReference implements IAlienScopeTypeReference
{
@@ -243,8 +243,8 @@ public interface IAlienScopeTypeReference {
// no-op, simply suppress this warning.
}
}
-
-
+
+
class AlienScopeArrayQualifiedTypeReference extends ArrayQualifiedTypeReference implements IAlienScopeTypeReference
{
Scope alienScope;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/IDependentTypeSubstitution.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/IDependentTypeSubstitution.java
index f8b80db88..abf6f4b7a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/IDependentTypeSubstitution.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/IDependentTypeSubstitution.java
@@ -29,9 +29,9 @@ public interface IDependentTypeSubstitution {
* @param original the atomic type to substitute
* @param typeArguments type arguments to re-apply during/after substitution
* @param dimensions array dimensions to re-apply during/after substitution
- * @return null signals an error has been reported,
+ * @return null signals an error has been reported,
* returning original signals no substitutions were needed,
- * otherwise a substituted type is return.
+ * otherwise a substituted type is return.
*/
TypeBinding substitute(DependentTypeBinding original, TypeBinding[] typeArguments, int dimensions);
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/Protections.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/Protections.java
index 33b306900..7305abb44 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/Protections.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/Protections.java
@@ -282,7 +282,7 @@ public class Protections implements ClassFileConstants, ExtraCompilerModifiers {
if (invocationType.roleModel.hasTSuperRole(declaringClass))
return true;
}
-
+
if (binding.isProtected()) {
// answer true if the invocationType is the declaringClass or they are in the same package
// OR the invocationType is a subclass of the declaringClass
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/RoleTypeCreator.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/RoleTypeCreator.java
index 4421a6ab1..db211bde2 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/RoleTypeCreator.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/RoleTypeCreator.java
@@ -135,7 +135,7 @@ public class RoleTypeCreator implements TagBits {
TypeBinding originalType,
final ASTNode typedNode,
ReferenceBinding refBinding,
- int dimensions)
+ int dimensions)
{
ReferenceBinding site = scope.enclosingSourceType();
assert( ! (site == null));
@@ -187,13 +187,13 @@ public class RoleTypeCreator implements TagBits {
boolean decapsulationAllowed = false;
if (typedNode instanceof Expression)
decapsulationAllowed = ((Expression)typedNode).getBaseclassDecapsulation().isAllowed();
-
+
if ( (variableBinding instanceof VariableBinding)
- && (((VariableBinding)variableBinding).otBits & IOTConstants.IsFreshTeamInstance) != 0)
+ && (((VariableBinding)variableBinding).otBits & IOTConstants.IsFreshTeamInstance) != 0)
{
if (!refBinding.isRoleType())
return variableBinding.getDependentTypeBinding(refBinding, -1, null, dimensions);
- return
+ return
originalType;
} else if (variableBinding == null) {
if (needAnchor)
@@ -317,18 +317,18 @@ public class RoleTypeCreator implements TagBits {
// anchored to argument, instantiate directly:
Expression anchorExpr = send.arguments[roleReturn._argumentPosition];
TypeBinding anchorType = anchorExpr.resolvedType;
-
+
ITeamAnchor anchor = null;
if (anchorType.isRole() && ((ReferenceBinding)anchorType).isCompatibleViaLowering(roleEnclosing)) {
// see 1.1.31-otjld-stacked-teams-1 f.
if (anchorExpr.isThis())
anchor = ((ReferenceBinding)anchorType).getField(IOTConstants._OT_BASE, true);
else
- return returnType; // cannot improve, error will be reported upstream
+ return returnType; // cannot improve, error will be reported upstream
} else {
if (anchorType.isRole())
anchorType = ((ReferenceBinding)anchorType).getRealClass(); // ignore role-ness of team anchor
- if (!anchorType.isCompatibleWith(roleEnclosing))
+ if (!anchorType.isCompatibleWith(roleEnclosing))
return returnType; // cannot improve, anchor doesn't match expected team.
anchor = (ITeamAnchor)((NameReference)anchorExpr).binding;
}
@@ -547,16 +547,16 @@ public class RoleTypeCreator implements TagBits {
// consider arrays:
int dimensions = typeToWrap.dimensions();
typeToWrap = typeToWrap.leafComponentType();
-
+
// consider parameterized:
TypeBinding[] arguments = null;
- if (typeToWrap.isParameterizedType())
+ if (typeToWrap.isParameterizedType())
arguments = ((ParameterizedTypeBinding)typeToWrap).arguments;
// easy problems first:
if (!(typeToWrap instanceof ReferenceBinding) || typeToWrap.isEnum())
return originalType;
-
+
if (typeToWrap instanceof UnresolvedReferenceBinding) {
// defer wrapping until resolve():
return ((UnresolvedReferenceBinding) typeToWrap).deferredWrappableType(scope, site, typedNode, problemReporter);
@@ -716,14 +716,14 @@ public class RoleTypeCreator implements TagBits {
/* Wraps either relative to defaultAnchor or unqualified. */
private static TypeBinding maybeWrapSignatureType(TypeBinding type, MethodScope scope, ASTNode typedNode, ITeamAnchor defaultAnchor) {
- if ( defaultAnchor != null
+ if ( defaultAnchor != null
&& !type.leafComponentType().isBaseType()
&& defaultAnchor.isTeamContainingRole((ReferenceBinding) type.leafComponentType()))
{
return defaultAnchor.getDependentTypeBinding(
- (ReferenceBinding) type.leafComponentType(),
- 0, // typeParamPosition
- Binding.NO_PARAMETERS,
+ (ReferenceBinding) type.leafComponentType(),
+ 0, // typeParamPosition
+ Binding.NO_PARAMETERS,
type.dimensions());
} else {
return maybeWrapUnqualifiedRoleType(type, scope, typedNode);
@@ -922,7 +922,7 @@ public class RoleTypeCreator implements TagBits {
return cannotWrapType(roleType, problemReporter, typedNode);
}
}
- else if (anchorExpr instanceof AllocationExpression)
+ else if (anchorExpr instanceof AllocationExpression)
{
// this anchor matches nothing
String displayName = "fresh-instance-of-"+((AllocationExpression)anchorExpr).type.toString(); //$NON-NLS-1$
@@ -1630,10 +1630,10 @@ public class RoleTypeCreator implements TagBits {
return false;
}
- /**
+ /**
* Decompose a given type into atomic types (taking into account arrays and type arguments)
- * perform a given type substitution for each atomic type and
- * re-assemble to a type of the same shape as the given type.
+ * perform a given type substitution for each atomic type and
+ * re-assemble to a type of the same shape as the given type.
* @param original the given type to be substituted
* @param environment for creation of parameterized types and array types
* @param substitution what to perform on each atomic dependent type
@@ -1643,7 +1643,7 @@ public class RoleTypeCreator implements TagBits {
TypeBinding type = original;
int dimensions = type.dimensions();
type = type.leafComponentType();
-
+
TypeBinding[] typeArguments = null;
boolean hasInstantiated = false;
if (type.isParameterizedType()) {
@@ -1666,7 +1666,7 @@ public class RoleTypeCreator implements TagBits {
}
if (type instanceof DependentTypeBinding) {
- TypeBinding substituted = substitution.substitute((DependentTypeBinding) type, typeArguments, dimensions);
+ TypeBinding substituted = substitution.substitute((DependentTypeBinding) type, typeArguments, dimensions);
if (substituted != type) // includes substituted == null //$IDENTITY-COMPARISON$
return substituted;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/Sorting.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/Sorting.java
index 18dcc72e4..62ac2c6b5 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/Sorting.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/Sorting.java
@@ -47,7 +47,7 @@ public class Sorting {
ReferenceBinding[] unsorted = new ReferenceBinding[len];
ReferenceBinding[] sorted = new ReferenceBinding[len];
System.arraycopy(enclosing.memberTypes, 0, unsorted, 0, len);
-
+
int o = 0;
for(int i=0; i<len; i++)
o = sort(enclosing, unsorted, i, sorted, o);
@@ -99,10 +99,10 @@ public class Sorting {
}
// --- similar for role models:
-
+
public static RoleModel[] sortRoles(RoleModel[] unsorted) {
int len = unsorted.length;
-
+
RoleModel[] sorted = new RoleModel[len];
int o = 0;
for(int i=0; i<len; i++)
@@ -130,17 +130,17 @@ public class Sorting {
return 0;
}
});
-
+
return sorted;
}
-
+
// Transfer input[i] and all its supers into output[o] ff.
private static int sort(RoleModel[] input, int i,
RoleModel[] output, int o)
{
if (input[i] == null || input[i].getBinding() == null)
return o;
-
+
ReferenceBinding inBinding = input[i].getBinding();
ReferenceBinding superclass = inBinding.superclass();
o = sortSuper(superclass, input, output, o);
@@ -170,7 +170,7 @@ public class Sorting {
break;
}
if (inScope) {
-
+
// search superclass within input:
int j = 0;
for(j=0; j<input.length; j++)
@@ -184,7 +184,7 @@ public class Sorting {
}
return o;
}
-
+
/** Apply the sorting from member type bindings to their ASTs, too. */
public static void sortMemberTypes(TypeDeclaration typeDeclaration) {
if (typeDeclaration.memberTypes == null) return;
@@ -194,7 +194,7 @@ public class Sorting {
int l = 0;
allMembers: for (int i=0; i<bindings.length; i++) {
ReferenceBinding current = bindings[i];
- if (current.isBinaryBinding())
+ if (current.isBinaryBinding())
continue; // no AST: phantom or reused rofi
// find corresponding AST
for (int j=0; j<unsorted.length; j++) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/TypeAnalyzer.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/TypeAnalyzer.java
index c554ba935..dae45049d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/TypeAnalyzer.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/TypeAnalyzer.java
@@ -164,7 +164,7 @@ public class TypeAnalyzer {
public static boolean isSameType(ReferenceBinding site, TypeBinding t1, TypeBinding t2)
{
if (TypeBinding.equalsEquals(t1, t2)) return true;
- if (t1 == null || t2 == null)
+ if (t1 == null || t2 == null)
return false;
if (t1.isArrayType()) {
if ( !t2.isArrayType()
@@ -270,7 +270,7 @@ public class TypeAnalyzer {
char[][] tname1 = compoundNameOfReferenceType((ReferenceBinding)tsuperType, true, true);
char[][] tname2 = compoundNameOfReferenceType((ReferenceBinding)currentType, true, true);
- if (CharOperation.equals(tname1, tname2)) {
+ if (CharOperation.equals(tname1, tname2)) {
if (TypeBinding.notEquals(tsuperType, currentType) && tsuperType.isValidBinding()) // don't complain about different missing types
throw new InternalCompilerError("different bindings for the same type??"+currentType+':'+tsuperType); //$NON-NLS-1$
return true;
@@ -548,7 +548,7 @@ public class TypeAnalyzer {
}
if (!allowOuter)
return null;
- isStaticScope = type.isStatic();
+ isStaticScope = type.isStatic();
type = type.enclosingType();
}
return null;
@@ -606,7 +606,7 @@ public class TypeAnalyzer {
@Override public int sourceEnd() { return 0; }
@Override public void setFieldIndex(int depth) { /* nop */ }
@Override public void setDepth(int depth) { /* nop */ }
-
+
@Override public void setActualReceiverType(ReferenceBinding receiverType) { /* nop */ }
@Override public boolean receiverIsImplicitThis() { return false; }
@Override public boolean isTypeAccess() { return false; }
@@ -614,17 +614,17 @@ public class TypeAnalyzer {
@Override public boolean isQualifiedSuper() { return false; }
@Override public boolean checkingPotentialCompatibility() { return false; }
@Override public void acceptPotentiallyCompatibleMethods(MethodBinding[] methods) { /* nop */ }
-
+
@Override
public TypeBinding invocationTargetType() {
return scope.getJavaLangObject();
}
-
+
@Override
public ExpressionContext getExpressionContext() {
return ExpressionContext.ASSIGNMENT_CONTEXT;
}
-
+
@Override
public TypeBinding[] genericTypeArguments() {
return null;
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java
index 83b087580..e3f199f2c 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java
@@ -135,7 +135,7 @@ public final class AST {
* @since 3.1
*/
/*package*/ static final int JLS2_INTERNAL = JLS2;
-
+
/**
* Constant for indicating the AST API that handles JLS3.
* <p>
@@ -152,7 +152,7 @@ public final class AST {
* @deprecated Clients should use the {@link #JLS_Latest} AST API instead.
*/
public static final int JLS3 = 3;
-
+
/**
* Internal synonym for {@link #JLS3}. Use to alleviate
* deprecation warnings.
@@ -176,14 +176,14 @@ public final class AST {
* @deprecated Clients should use the {@link #JLS_Latest} AST API instead.
*/
public static final int JLS4 = 4;
-
+
/**
* Internal synonym for {@link #JLS4}. Use to alleviate
* deprecation warnings.
* @since 3.10
*/
/*package*/ static final int JLS4_INTERNAL = JLS4;
-
+
/**
* Constant for indicating the AST API that handles JLS8.
* <p>
@@ -207,7 +207,7 @@ public final class AST {
* @since 3.14
*/
/*package*/ static final int JLS8_INTERNAL = JLS8;
-
+
/**
* Constant for indicating the AST API that handles JLS9.
* <p>
@@ -231,7 +231,7 @@ public final class AST {
* @since 3.14
*/
/*package*/ static final int JLS9_INTERNAL = JLS9;
-
+
/**
* Constant for indicating the AST API that handles JLS10.
* <p>
@@ -276,10 +276,10 @@ public final class AST {
/**
* Internal synonym for {@link #JLS11}. Use to alleviate
* deprecation warnings once JLS11 is deprecated
- * @since 3.14
+ * @since 3.14
*/
/*package*/ static final int JLS11_INTERNAL = JLS11;
-
+
/**
* Constant for indicating the AST API that handles JLS12.
* <p>
@@ -298,10 +298,10 @@ public final class AST {
/**
* Internal synonym for {@link #JLS12}. Use to alleviate
* deprecation warnings once JLS12 is deprecated
- * @since 3.18
+ * @since 3.18
*/
static final int JLS12_INTERNAL = JLS12;
-
+
/**
* Constant for indicating the AST API that handles JLS13.
* <p>
@@ -317,11 +317,11 @@ public final class AST {
* @since 3.20
*/
public static final int JLS13 = 13;
-
+
/**
* Internal synonym for {@link #JLS13}. Use to alleviate
* deprecation warnings once JLS13 is deprecated
- * @since 3.20
+ * @since 3.20
*/
static final int JLS13_INTERNAL = JLS13;
@@ -340,7 +340,7 @@ public final class AST {
* @since 3.22
*/
public static final int JLS14 = 14;
-
+
/**
* Internal synonym for {@link #JLS14}. Use to alleviate
* deprecation warnings once JLS14 is deprecated
@@ -351,7 +351,7 @@ public final class AST {
@SuppressWarnings("unused")
/* Used for Java doc only*/
private static final int JLS_Latest = JLS14;
-
+
/*
* Must not collide with a value for ICompilationUnit constants
*/
@@ -478,7 +478,7 @@ public final class AST {
public static AST newAST(int level) {
return new AST(level, false);
}
-
+
/**
* Creates a new Java abstract syntax tree
* (AST) following the specified set of API rules.
@@ -955,7 +955,7 @@ public final class AST {
null/*taskPriorities*/,
true/*taskCaseSensitive*/,
false/*isPreviewEnabled*/);
- break;
+ break;
case JLS9_INTERNAL :
this.apiLevel = level;
// initialize a scanner
@@ -969,7 +969,7 @@ public final class AST {
null/*taskPriorities*/,
true/*taskCaseSensitive*/,
false/*isPreviewEnabled*/);
- break;
+ break;
case JLS10_INTERNAL :
this.apiLevel = level;
// initialize a scanner
@@ -983,7 +983,7 @@ public final class AST {
null/*taskPriorities*/,
true/*taskCaseSensitive*/,
false/*isPreviewEnabled*/);
- break;
+ break;
case JLS11_INTERNAL :
this.apiLevel = level;
// initialize a scanner
@@ -1832,7 +1832,7 @@ public final class AST {
/**
* Creates an unparented creation reference node owned by this AST.
* By default, the type is unspecified (but legal), and there are no type arguments.
- *
+ *
* @return a new unparented creation reference expression node
* @exception UnsupportedOperationException if this operation is used in a JLS2, JLS3 or JLS4 AST
* @since 3.10
@@ -2189,7 +2189,7 @@ public final class AST {
* Creates an unparented lambda expression node owned by this AST.
* By default, the new lambda expression has parentheses enabled, contains an empty argument
* list, and the body is an empty block.
- *
+ *
* @return a new unparented lambda expression node
* @exception UnsupportedOperationException if this operation is used in a JLS2, JLS3 or JLS4 AST
* @since 3.10
@@ -2293,7 +2293,7 @@ public final class AST {
result.setConstructor(false);
result.setParent(declaringType, declaringType.getBodyDeclarationsProperty());
return result;
- }
+ }
// SH}
/**
@@ -2949,7 +2949,7 @@ public final class AST {
/**
* Creates and returns a new unparented switch expression node
- * owned by this AST. By default, the expression is unspecified, but legal,
+ * owned by this AST. By default, the expression is unspecified, but legal,
* and there are no statements or switch cases.
*
* @return a new unparented labeled switch expression node
@@ -2959,11 +2959,11 @@ public final class AST {
SwitchExpression result = new SwitchExpression(this);
return result;
}
-
+
/**
* Creates a new unparented switch case statement node owned by
- * this AST. By default, the node has no expression, but legal, and
- * switchLabeledRule is false which indicates ":".
+ * this AST. By default, the node has no expression, but legal, and
+ * switchLabeledRule is false which indicates ":".
*
* @return a new unparented switch case node
*/
@@ -3035,7 +3035,7 @@ public final class AST {
TagElement result = new TagElement(this);
return result;
}
-
+
/**
* Creates an unparented yield statement node owned by this AST. The yield statement has no
* label/identifier/expression and is not implicit.
@@ -3183,7 +3183,7 @@ public final class AST {
* Creates an unparented type method reference node owned by this AST.
* By default, the type and method name are unspecified (but legal),
* and there are no type arguments.
- *
+ *
* @return a new unparented type method reference node
* @exception UnsupportedOperationException if this operation is used in a JLS2, JLS3 or JLS4 AST
* @since 3.10
@@ -3903,10 +3903,10 @@ public final class AST {
throw new UnsupportedOperationException("Operation not supported in JLS2 AST"); //$NON-NLS-1$
}
}
-
-
+
+
/**
- *
+ *
* @return If previewEnabled flag is set to <code>true</code>, return <code>true</code> else <code>false</code>
* @since 3.21
* @noreference This method is not intended to be referenced by clients.
@@ -3916,7 +3916,7 @@ public final class AST {
}
/**
- *
+ *
* @return If preview is enabled and apiLevel is latest, return <code>true</code> else <code>false</code>
* @since 3.19
*/
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java
index 688160f66..097f2b036 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java
@@ -315,7 +315,7 @@ class ASTConverter {
// Convert javadoc
convert(typeDeclaration.javadoc, typeDecl);
}
-
+
protected void buildBodyDeclarations(
org.eclipse.jdt.internal.compiler.ast.TypeDeclaration typeDeclaration,
RecordDeclaration recordDeclaration,
@@ -351,7 +351,7 @@ class ASTConverter {
} else {
fieldsIndex++;
}
-
+
}
if (methodsIndex < methodsLength) {
nextMethodDeclaration = methods[methodsIndex];
@@ -360,11 +360,11 @@ class ASTConverter {
position = nextMethodDeclaration.declarationSourceStart;
nextDeclarationType = 1; // METHOD
}
-
- } else {
- methodsIndex++;
+
+ } else {
+ methodsIndex++;
}
-
+
}
if (membersIndex < membersLength) {
nextMemberDeclaration = members[membersIndex];
@@ -563,7 +563,7 @@ class ASTConverter {
private static void internalSetExpression(SwitchCase switchCase, Expression exp) {
switchCase.setExpression(exp);
}
- /**
+ /**
* Internal access method to SingleVariableDeclaration#setExtraDimensions() for avoiding deprecated warnings
*
* @param node
@@ -573,7 +573,7 @@ class ASTConverter {
private static void internalSetExtraDimensions(SingleVariableDeclaration node, int dimensions) {
node.setExtraDimensions(dimensions);
}
- /**
+ /**
* Internal access method to VariableDeclarationFragment#setExtraDimensions() for avoiding deprecated warnings
*
* @param node
@@ -583,7 +583,7 @@ class ASTConverter {
private static void internalSetExtraDimensions(VariableDeclarationFragment node, int dimensions) {
node.setExtraDimensions(dimensions);
}
- /**
+ /**
* Internal access method to MethodDeclaration#setExtraDimension() for avoiding deprecated warnings
*
* @param node
@@ -593,7 +593,7 @@ class ASTConverter {
private static void internalSetExtraDimensions(MethodDeclaration node, int dimensions) {
node.setExtraDimensions(dimensions);
}
- /**
+ /**
* Internal access method to MethodDeclaration#thrownExceptions() for avoiding deprecated warnings
*
* @param node
@@ -726,7 +726,7 @@ class ASTConverter {
}
}
}
-
+
/**
* @deprecated
*/
@@ -774,7 +774,7 @@ class ASTConverter {
}
internalThownExceptions(methodDecl).add(thrownException);
} while (i < thrownExceptionsLength);
- methodHeaderEnd = thrownException.getStartPosition() + thrownException.getLength();
+ methodHeaderEnd = thrownException.getStartPosition() + thrownException.getLength();
} else {
Type thrownExceptionType;
int i = 0;
@@ -782,7 +782,7 @@ class ASTConverter {
thrownExceptionType = convertType(thrownExceptions[i++]);
methodDecl.thrownExceptionTypes().add(thrownExceptionType);
} while (i < thrownExceptionsLength);
- methodHeaderEnd = thrownExceptionType.getStartPosition() + thrownExceptionType.getLength();
+ methodHeaderEnd = thrownExceptionType.getStartPosition() + thrownExceptionType.getLength();
}
}
@@ -1658,13 +1658,13 @@ class ASTConverter {
this.scanner.setSource(source, unit.compilationResult);
CompilationUnit compilationUnit = new CompilationUnit(this.ast);
compilationUnit.setStatementsRecoveryData(unit.compilationResult.recoveryScannerData);
-
+
// Parse comments
int[][] comments = unit.comments;
if (comments != null) {
buildCommentsTable(compilationUnit, comments);
}
-
+
// handle the package declaration immediately
// There is no node corresponding to the package declaration
if (this.resolveBindings) {
@@ -1681,7 +1681,7 @@ class ASTConverter {
compilationUnit.imports().add(convertImport(imports[i]));
}
}
-
+
org.eclipse.jdt.internal.compiler.ast.ModuleDeclaration mod = unit.moduleDeclaration;
if (mod != null) {
ASTNode declaration = convertToModuleDeclaration(mod);
@@ -2418,7 +2418,7 @@ class ASTConverter {
public void convert(org.eclipse.jdt.internal.compiler.ast.Javadoc javadoc, IGetJavaDoc getJ, ISetJavaDoc setJ) {
if (getJ.getJavaDoc() == null) {
Javadoc docComment = convert(javadoc);
- if (docComment != null)
+ if (docComment != null)
setJ.setJavadoc(docComment);
}
}
@@ -2670,7 +2670,7 @@ class ASTConverter {
public Expression convert(org.eclipse.jdt.internal.compiler.ast.LambdaExpression lambda) {
if (this.ast.apiLevel < AST.JLS8_INTERNAL) {
- return createFakeNullLiteral(lambda);
+ return createFakeNullLiteral(lambda);
}
final LambdaExpression lambdaExpression = new LambdaExpression(this.ast);
if (this.resolveBindings) {
@@ -2695,10 +2695,10 @@ class ASTConverter {
}
variableDeclarationFragment.setName(simpleName);
variableDeclarationFragment.setSourceRange(start, end - start + 1);
- lambdaExpression.parameters().add(variableDeclarationFragment);
+ lambdaExpression.parameters().add(variableDeclarationFragment);
} else {
SingleVariableDeclaration singleVariableDeclaration = convert(argument);
- lambdaExpression.parameters().add(singleVariableDeclaration);
+ lambdaExpression.parameters().add(singleVariableDeclaration);
}
}
}
@@ -3106,12 +3106,12 @@ class ASTConverter {
if (this.resolveBindings) {
recordNodes(result, reference);
}
- int sourceStart = reference.sourceStart;
+ int sourceStart = reference.sourceStart;
result.setSourceRange(sourceStart, reference.sourceEnd - sourceStart + 1);
return result;
}
-
+
public ReturnStatement convert(org.eclipse.jdt.internal.compiler.ast.ReturnStatement statement) {
final ReturnStatement returnStatement = new ReturnStatement(this.ast);
returnStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1);
@@ -3283,10 +3283,10 @@ class ASTConverter {
literal.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1);
return literal;
}
-
+
public Expression convert(org.eclipse.jdt.internal.compiler.ast.SwitchExpression expression) {
if (this.ast.apiLevel < AST.JLS14) {
- return createFakeNullLiteral(expression);
+ return createFakeNullLiteral(expression);
}
SwitchExpression switchExpression = new SwitchExpression(this.ast);
if (this.resolveBindings) {
@@ -3310,7 +3310,7 @@ class ASTConverter {
}
return switchExpression;
}
-
+
public SwitchStatement convert(org.eclipse.jdt.internal.compiler.ast.SwitchStatement statement) {
SwitchStatement switchStatement = new SwitchStatement(this.ast);
switchStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1);
@@ -3342,7 +3342,7 @@ class ASTConverter {
public Expression convert(org.eclipse.jdt.internal.compiler.ast.TextBlock expression) {
if (!this.ast.isPreviewEnabled()) {
- return createFakeNullLiteral(expression);
+ return createFakeNullLiteral(expression);
}
int length = expression.sourceEnd - expression.sourceStart + 1;
int sourceStart = expression.sourceStart;
@@ -3354,7 +3354,7 @@ class ASTConverter {
literal.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1);
return literal;
}
-
+
public Expression convert(org.eclipse.jdt.internal.compiler.ast.ThisReference reference) {
if (reference.isImplicitThis()) {
// There is no source associated with an implicit this
@@ -3680,7 +3680,7 @@ class ASTConverter {
public Statement convert(org.eclipse.jdt.internal.compiler.ast.YieldStatement statement) {
if (this.ast.apiLevel < AST.JLS14) {
- return createFakeEmptyStatement(statement);
+ return createFakeEmptyStatement(statement);
}
YieldStatement yieldStatement = new YieldStatement(this.ast);
// We don't need to record Nodes
@@ -3689,7 +3689,7 @@ class ASTConverter {
yieldStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1);
return yieldStatement;
}
-
+
public ImportDeclaration convertImport(org.eclipse.jdt.internal.compiler.ast.ImportReference importReference) {
final ImportDeclaration importDeclaration = new ImportDeclaration(this.ast);
Name name = getImportName(importReference);
@@ -3842,7 +3842,7 @@ class ASTConverter {
}
return enumDeclaration2;
}
-
+
private RecordDeclaration convertToRecordDeclaration(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration typeDeclaration) {
checkCanceled();
// record declaration cannot be built if the source is not >= 14, since record is then seen as an identifier
@@ -3854,7 +3854,7 @@ class ASTConverter {
recordDeclaration.setName(typeName);
recordDeclaration.setSourceRange(typeDeclaration.declarationSourceStart, typeDeclaration.bodyEnd - typeDeclaration.declarationSourceStart + 1);
recordDeclaration.setRestrictedIdentifierStartPosition(typeDeclaration.restrictedIdentifierStart);
-
+
org.eclipse.jdt.internal.compiler.ast.TypeReference[] superInterfaces = typeDeclaration.superInterfaces;
if (superInterfaces != null) {
for (TypeReference superInterface : superInterfaces) {
@@ -3907,9 +3907,9 @@ class ASTConverter {
}
/**
- * If there is a parsing error causing a recovered module the source positions may be updated only partially.
- * See bug 518843 for a case where this issue occurred. This method provide a safety net with
- * source positions updated even in case of a recovery - if there is no recovery, the source positions will
+ * If there is a parsing error causing a recovered module the source positions may be updated only partially.
+ * See bug 518843 for a case where this issue occurred. This method provide a safety net with
+ * source positions updated even in case of a recovery - if there is no recovery, the source positions will
* be retained in-tact identical to the compile time ast module node.
*/
private int getKnownEnd(ModuleDeclaration md, int sourceEnd, int declSourceEnd) {
@@ -3965,7 +3965,7 @@ class ASTConverter {
TypeReference usesRef = usesStatement.serviceInterface;
Name name = convert(usesRef);
stmt.setName(name);
- stmt.setSourceRange(usesStatement.declarationSourceStart, usesStatement.declarationSourceEnd - usesStatement.declarationSourceStart + 1);
+ stmt.setSourceRange(usesStatement.declarationSourceStart, usesStatement.declarationSourceEnd - usesStatement.declarationSourceStart + 1);
tSet.add(stmt);
}
for (int i = 0; i < moduleDeclaration.servicesCount; ++i) {
@@ -4073,7 +4073,7 @@ class ASTConverter {
int typeEnd = type.getStartPosition() + type.getLength() - 1;
// https://bugs.eclipse.org/393719 - [compiler] inconsistent warnings on iteration variables
// compiler considers collectionExpression as within the declarationSourceEnd, DOM AST must use the shorter range to avoid overlap
- int sourceEnd = ((localDeclaration.bits & org.eclipse.jdt.internal.compiler.ast.ASTNode.IsForeachElementVariable) != 0)
+ int sourceEnd = ((localDeclaration.bits & org.eclipse.jdt.internal.compiler.ast.ASTNode.IsForeachElementVariable) != 0)
? localDeclaration.sourceEnd : localDeclaration.declarationSourceEnd;
int rightEnd = Math.max(typeEnd, sourceEnd);
/*
@@ -4214,7 +4214,7 @@ class ASTConverter {
}
}
}
-
+
private void setTypeAnnotationsAndSourceRangeOnArray(ArrayType arrayType, org.eclipse.jdt.internal.compiler.ast.Annotation[][] annotationsOnDimensions) {
List dimensions = arrayType.dimensions();
Type elementType = arrayType.getElementType();
@@ -4234,7 +4234,7 @@ class ASTConverter {
end = startArray - 1;
}
arrayType.setSourceRange(start, end - start + 1);
-
+
start = startArray;
for (int i = 0; i < dimensions.size(); i++) {
Dimension currentDimension = (Dimension) dimensions.get(i);
@@ -4256,7 +4256,7 @@ class ASTConverter {
if (this.ast.apiLevel() >= AST.JLS10_INTERNAL && type.isVar()) {
SimpleName varName = (SimpleName) ((SimpleType) type).getName();
varName.setVar(true);
- recordNodes(varName, localDeclaration);
+ recordNodes(varName, localDeclaration);
}
}
if (localDeclaration.modifiersSourceStart != -1) {
@@ -4383,7 +4383,7 @@ class ASTConverter {
if (positions[0] != -1) {
simpleName.setSourceRange(positions[0], end - positions[0] + 1);
} else {
- simpleName.setSourceRange(sourceStart, end - sourceStart + 1);
+ simpleName.setSourceRange(sourceStart, end - sourceStart + 1);
}
switch(this.ast.apiLevel) {
@@ -4405,7 +4405,7 @@ class ASTConverter {
annotateType(simpleType, annotations);
}
int newSourceStart = simpleType.getStartPosition();
- if (newSourceStart > 0 && newSourceStart < sourceStart)
+ if (newSourceStart > 0 && newSourceStart < sourceStart)
sourceStart = newSourceStart;
final ParameterizedType parameterizedType = new ParameterizedType(this.ast);
parameterizedType.setType(simpleType);
@@ -4512,10 +4512,10 @@ class ASTConverter {
isTypeArgumentBased = false;
break;
}
- }
+ }
int start = (int) (positions[0] >>> 32);
int end = (int) positions[firstTypeIndex];
-
+
Type currentType = createBaseType(typeReference, positions, typeAnnotations, tokens, lenth, firstTypeIndex, isTypeArgumentBased);
int indexOfEnclosingType = 1;
if (typeArguments != null && (arguments = typeArguments[firstTypeIndex]) != null) {
@@ -4526,7 +4526,7 @@ class ASTConverter {
if (this.resolveBindings) {
recordNodes(parameterizedType, typeReference);
}
- Type type2 = null;
+ Type type2 = null;
for (int i = 0; i < arglen; ++i ) {
type2 = convertType(arguments[i]);
parameterizedType.typeArguments().add(type2);
@@ -4538,7 +4538,7 @@ class ASTConverter {
parameterizedType.setSourceRange(start, end - start + 1);
currentType = parameterizedType;
}
-
+
for (int i = firstTypeIndex + 1; i < lenth; ++i) {
SimpleName simpleName = new SimpleName(this.ast);
simpleName.setIdentifier(new String(tokens[i]));
@@ -4566,7 +4566,7 @@ class ASTConverter {
}
currentType = qualifiedType;
indexOfEnclosingType++;
-
+
if (typeArguments != null && (arguments = typeArguments[i]) != null) {
int arglen = arguments.length;
qualifiedType.index = indexOfEnclosingType;
@@ -4576,7 +4576,7 @@ class ASTConverter {
if (this.resolveBindings) {
recordNodes(parameterizedType, typeReference);
}
- Type type2 = null;
+ Type type2 = null;
for (int j = 0; j < arglen; ++j ) {
type2 = convertType(arguments[j]);
parameterizedType.typeArguments().add(type2);
@@ -4591,14 +4591,14 @@ class ASTConverter {
}
type = currentType;
}
- } else if (typeReference instanceof org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference) {
+ } else if (typeReference instanceof org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference) {
QualifiedTypeReference qualifiedTypeReference = (QualifiedTypeReference) typeReference;
long[] positions = ((org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference) typeReference).sourcePositions;
org.eclipse.jdt.internal.compiler.ast.Annotation [][] typeAnnotations = typeReference.annotations;
char [][] tokens = qualifiedTypeReference.tokens;
int lenth = tokens.length;
int firstTypeIndex = lenth;
-
+
if (typeAnnotations != null) {
for (int i = 0; i < lenth; ++i) {
if (typeAnnotations[i] != null) {
@@ -4606,7 +4606,7 @@ class ASTConverter {
break;
}
}
- }
+ }
//{ObjectTeams: revert anchored types like in MyTeam.this._OT$base.R => base.R
org.eclipse.jdt.internal.compiler.lookup.TypeBinding typeBindingOT =
((org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference) typeReference).resolvedType;
@@ -4711,7 +4711,7 @@ class ASTConverter {
break;
}
}
- }
+ }
if (sawDiamond) {
switch(this.ast.apiLevel) {
case AST.JLS2_INTERNAL :
@@ -4750,12 +4750,12 @@ class ASTConverter {
nameQualifiedType.setQualifier(name);
nameQualifiedType.setName(createSimpleName(typeReference, positions, tokens, firstTypeIndex));
setSourceRangeAnnotationsAndRecordNodes(typeReference, nameQualifiedType, positions, typeAnnotations, firstTypeIndex, 0, firstTypeIndex);
- currentType = nameQualifiedType;
+ currentType = nameQualifiedType;
} else {
- SimpleType simpleType = this.ast.newSimpleType(name);
+ SimpleType simpleType = this.ast.newSimpleType(name);
setSourceRangeAnnotationsAndRecordNodes(typeReference, simpleType, positions, typeAnnotations, 0, 0, name.index > 0 ? name.index - 1 : 0);
currentType = createQualifiedType(typeReference, positions, typeAnnotations, tokens, firstTypeIndex, simpleType);
- if (createNameQualifiedType)
+ if (createNameQualifiedType)
currentType.setFlags(currentType.getFlags() | ASTNode.MALFORMED);
}
}
@@ -4801,7 +4801,7 @@ class ASTConverter {
}
}
- private void setSourceRangeAnnotationsAndRecordNodes(TypeReference typeReference, AnnotatableType annotatableType,
+ private void setSourceRangeAnnotationsAndRecordNodes(TypeReference typeReference, AnnotatableType annotatableType,
long[] positions, org.eclipse.jdt.internal.compiler.ast.Annotation[][] typeAnnotations, int index, int startIndex, int endIndex) {
int start = (int) (positions[startIndex] >>> 32);
int end = (int) positions[endIndex];
@@ -5502,7 +5502,7 @@ class ASTConverter {
/**
* This method is used to retrieve the start and end position of a name or primitive type token.
- *
+ *
* @return int[] a single dimensional array, with two elements, for the start and end positions of the name respectively
*/
protected int[] retrieveEndOfElementTypeNamePosition(int start, int end) {
@@ -5685,7 +5685,7 @@ class ASTConverter {
if (hasAnnotations) {
if (token == TerminalTokens.TokenNameLPAREN) ++lParenCount;
else if (token == TerminalTokens.TokenNameRPAREN) {
- --lParenCount;
+ --lParenCount;
continue;
}
if (lParenCount > 0) continue;
@@ -5753,7 +5753,7 @@ class ASTConverter {
}
return -1;
}
-
+
protected int retrieveProperRightBracketPosition(int bracketNumber, int start) {
return retrieveProperRightBracketPosition(bracketNumber, start, this.compilationUnitSourceLength);
}
@@ -5968,7 +5968,7 @@ class ASTConverter {
this.scanner.resetTo(enumDeclaration2.declarationSourceStart, enumDeclaration2.sourceStart);
this.setModifiers(enumDeclaration, enumDeclaration2.annotations, enumDeclaration2.sourceStart);
}
-
+
protected void setModifiers(RecordDeclaration recordDeclaration, org.eclipse.jdt.internal.compiler.ast.TypeDeclaration recordDeclaration2) {
this.scanner.resetTo(recordDeclaration2.declarationSourceStart, recordDeclaration2.sourceStart);
this.setModifiers(recordDeclaration, recordDeclaration2.annotations, recordDeclaration2.sourceStart);
@@ -6558,7 +6558,7 @@ class ASTConverter {
/** extracts the subArrayType for a given declaration for AST levels less
* @param arrayType parent type
- * @param remainingDimensions
+ * @param remainingDimensions
* @param dimensionsToRemove
* @return an ArrayType
*/
@@ -6661,7 +6661,7 @@ class ASTConverter {
singleVariableDeclaration.setType(subarrayType);
}
checkAndSetMalformed(type, singleVariableDeclaration);
-
+
} else {
singleVariableDeclaration.setType(type);
}
@@ -6940,7 +6940,7 @@ class ASTConverter {
result.setSourceRange(start, end-start+1);
return result;
}
-
+
/**
* annotations for method mappings:
* @param mappingDecl
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTMatcher.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTMatcher.java
index fc9f7e44e..1f80f6d19 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTMatcher.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTMatcher.java
@@ -1183,9 +1183,9 @@ public class ASTMatcher {
return false;
}
InstanceofExpression o = (InstanceofExpression) other;
- return
+ return
safeSubtreeMatch(node.getLeftOperand(), o.getLeftOperand())
- && safeSubtreeMatch(node.getRightOperand(), o.getRightOperand())
+ && safeSubtreeMatch(node.getRightOperand(), o.getRightOperand())
&& ((DOMASTUtil.isInstanceofExpressionPatternSupported(node.getAST())) ? safeSubtreeMatch(node.getPatternVariable(), o.getPatternVariable())
: true);
}
@@ -1296,7 +1296,7 @@ public class ASTMatcher {
* other object is a node of the same type with structurally isomorphic
* child subtrees. Subclasses may override this method as needed.
* </p>
- *
+ *
* @param node the node
* @param other the other object, or <code>null</code>
* @return <code>true</code> if the subtree matches, or
@@ -1974,7 +1974,7 @@ public class ASTMatcher {
&& safeSubtreeListMatch(node.bodyDeclarations(), o.bodyDeclarations())
&& safeSubtreeMatch(node.recordComponents(), o.recordComponents()));
}
-
+
/**
* Returns whether the given node and the other object match.
* <p>
@@ -2277,7 +2277,7 @@ public class ASTMatcher {
* @return <code>true</code> if the subtree matches, or
* <code>false</code> if they do not match or the other object has a
* different node type or is <code>null</code>
- *
+ *
* @since 3.10
*/
public boolean match(SuperMethodReference node, Object other) {
@@ -2313,7 +2313,7 @@ public class ASTMatcher {
? safeSubtreeListMatch(node.expressions(), o.expressions())
: compareDeprecatedSwitchExpression(node, o));
}
-
+
/**
* Return whether the deprecated comment strings of the given java doc are equals.
* <p>
@@ -2331,7 +2331,7 @@ public class ASTMatcher {
* other object is a node of the same type with structurally isomorphic
* child subtrees. Subclasses may override this method as needed.
* </p>
- *
+ *
* @param node the node
* @param other the other object, or <code>null</code>
* @return <code>true</code> if the subtree matches, or
@@ -2445,7 +2445,7 @@ public class ASTMatcher {
TextBlock o = (TextBlock) other;
return safeEquals(node.getEscapedValue(), o.getEscapedValue());
}
-
+
/**
* Returns whether the given node and the other object match.
* <p>
@@ -2894,7 +2894,7 @@ public class ASTMatcher {
&& node.isUpperBound() == o.isUpperBound()
&& safeSubtreeMatch(node.getBound(), o.getBound());
}
-
+
/**
* Returns whether the given node and the other object match.
* <p>
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java
index 44e574ea0..daea82c91 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java
@@ -131,7 +131,7 @@ public abstract class ASTNode {
/*
* ATTENTION: When doing anything to the ASTNode hierarchy, do not try to
* reinvent the wheel.
- *
+ *
* Look out for precedents with
* - the same structural property type
* - for child node properties: the same optionality (can be null / lazy initialization blurbs and impl.)
@@ -139,9 +139,9 @@ public abstract class ASTNode {
* - a similar history (added in JLSx API, below JLSx only, replaced by {@link #xx})
* ..., and copy what was done there. Most of the code and
* Javadoc in this package should look like it was created by a code generator.
- *
+ *
* In subclasses of ASTNode, order properties by order of occurrence in source.
- * In general classes that list all AST node types, order alphabetically.
+ * In general classes that list all AST node types, order alphabetically.
*/
/*
@@ -181,27 +181,27 @@ public abstract class ASTNode {
/*
* INSTRUCTIONS FOR ADDING A NEW PROPERTY TO AN AST NODE TYPE
- *
+ *
* For concrete node types, use e.g. properties of SimpleName or ClassInstanceCreation
* as templates:
- *
+ *
* 1. Copy/paste the field, property descriptor, and getter/setter.
- *
+ *
* 2. Adjust everything to the new property name and type. In the field's
* Javadoc, properly document default value, initialization, and applicable
* API levels.
- *
+ *
* 3. Add/remove @since tags as necessary.
- *
+ *
* 4. Search for references to the members in the template, and add similar
* references in corresponding places for the new property.
- *
- *
+ *
+ *
* For abstract node types, use AbstractTypeDeclaration as a template:
- *
+ *
* 1. Same steps as above, but take extra care to copy and adjust the
- * *internal*() methods as well.
- *
+ * *internal*() methods as well.
+ *
* 2. Search for references to the members in the template, and add similar
* references in corresponding places for the new property (e.g. property
* descriptor in each leaf type).
@@ -209,17 +209,17 @@ public abstract class ASTNode {
/*
* INSTRUCTIONS FOR REPLACING/DEPRECATING A PROPERTY OF AN AST NODE
- *
+ *
* To replace a simple property with a child list property, see e.g. how
* SingleVariableDeclaration replaced MODIFIERS_PROPERTY with
* MODIFIERS2_PROPERTY.
- *
+ *
* 1. Reuse the old property id.
- *
+ *
* 2. Deprecate all references to the old property, except for the old
* getter, which should compute the value from the new property in
* later API levels.
- *
+ *
* To completely replace a property, see how ClassInstanceCreation replaced
* NAME_PROPERTY with TYPE_PROPERTY.
*/
@@ -915,7 +915,7 @@ public abstract class ASTNode {
* @since 3.14
*/
public static final int REQUIRES_DIRECTIVE = 94;
-
+
/**
* Node type constant indicating a node of type
* <code>ExportsDirective</code>.
@@ -931,7 +931,7 @@ public abstract class ASTNode {
* @since 3.14
*/
public static final int OPENS_DIRECTIVE = 96;
-
+
/**
* Node type constant indicating a node of type
* <code>UsesDirective</code>.
@@ -955,7 +955,7 @@ public abstract class ASTNode {
* @since 3.14
*/
public static final int MODULE_MODIFIER = 99;
-
+
/**
* Node type constant indicating a node of type
* <code>SwitchExpression</code>.
@@ -963,7 +963,7 @@ public abstract class ASTNode {
* @since 3.18
*/
public static final int SWITCH_EXPRESSION = 100;
-
+
/**
* Node type constant indicating a node of type
* <code>YieldStatement</code>.
@@ -971,7 +971,7 @@ public abstract class ASTNode {
* @since 3.20
*/
public static final int YIELD_STATEMENT = 101;
-
+
/**
* Node type constant indicating a node of type
* <code>TextBlock</code>.
@@ -979,7 +979,7 @@ public abstract class ASTNode {
* @since 3.20
*/
public static final int TEXT_BLOCK = 102;
-
+
/**
* Node type constant indicating a node of type
* <code>RecordDeclaration</code>.
@@ -987,7 +987,7 @@ public abstract class ASTNode {
* @since 3.22
*/
public static final int RECORD_DECLARATION = 103;
-
+
//{ObjectTeams: required OT specific node type constants added
private static final int LAST_JDT = 103;
@@ -2103,7 +2103,7 @@ public abstract class ASTNode {
*/
abstract List internalStructuralPropertiesForType(int apiLevel);
-
+
/**
* Returns a list of property descriptors for this node type.
* Clients must not modify the result. This abstract method
@@ -2123,7 +2123,7 @@ public abstract class ASTNode {
List internalStructuralPropertiesForType(int apiLevel, boolean previewEnabled) {
return internalStructuralPropertiesForType(apiLevel);
}
-
+
/**
* Internal helper method that starts the building a list of
* property descriptors for the given node type.
@@ -2175,7 +2175,7 @@ public abstract class ASTNode {
* <p>
* Use this method to prevent access to new properties that have been added in JLS3.
* </p>
- *
+ *
* @exception UnsupportedOperationException if this operation is used in a JLS2 AST
* @since 3.0
*/
@@ -2191,7 +2191,7 @@ public abstract class ASTNode {
* <p>
* Use this method to prevent access to new properties that have been added in JLS4.
* </p>
- *
+ *
* @exception UnsupportedOperationException if this operation is used in a JLS2 or JLS3 AST
* @since 3.7
*/
@@ -2200,14 +2200,14 @@ public abstract class ASTNode {
throw new UnsupportedOperationException("Operation only supported in JLS4 and later AST"); //$NON-NLS-1$
}
}
-
+
/**
* Checks that this AST operation is not used when
* building JLS2 or JLS3 or JLS4 level ASTs.
* <p>
* Use this method to prevent access to new properties that have been added in JLS8.
* </p>
- *
+ *
* @exception UnsupportedOperationException if this operation is used below JLS8
* @since 3.10
*/
@@ -2255,14 +2255,14 @@ public abstract class ASTNode {
* </p>
*
* @exception UnsupportedOperationException if this operation is used below JLS11
- * @since 3.14
+ * @since 3.14
*/
final void unsupportedBelow11() {
if (this.ast.apiLevel < AST.JLS11_INTERNAL) {
throw new UnsupportedOperationException("Operation only supported in ASTs with level JLS11 and above"); //$NON-NLS-1$
}
}
-
+
/**
* Checks that this AST operation is not used when
* building JLS2, JLS3, JLS4, JLS8, JLS9,JLS10 or JLS11 level ASTs.
@@ -2272,14 +2272,14 @@ public abstract class ASTNode {
*
* @exception UnsupportedOperationException if this operation is used below JLS12
* @deprecated
- * @since 3.16
+ * @since 3.16
*/
final void unsupportedBelow12() {
if (this.ast.apiLevel < AST.JLS12_INTERNAL) {
throw new UnsupportedOperationException("Operation only supported in ASTs with level JLS12 and above"); //$NON-NLS-1$
}
}
-
+
/**
* Checks that this AST operation is not used when
* building JLS2, JLS3, JLS4, JLS8, JLS9, JLS10, JLS11, JLS12 or JSL13 level ASTs.
@@ -2295,8 +2295,8 @@ public abstract class ASTNode {
throw new UnsupportedOperationException("Operation only supported in ASTs with level JLS14 and above"); //$NON-NLS-1$
}
}
-
-
+
+
/**
* Checks that this AST operation is not used when
* building ASTs without previewEnabled flag.
@@ -2312,7 +2312,7 @@ public abstract class ASTNode {
throw new UnsupportedOperationException("Operation only supported in ASTs with previewEnabled flag as true"); //$NON-NLS-1$
}
}
-
+
/**
* Checks that this AST operation is only used when
* building JLS2 level ASTs.
@@ -2336,7 +2336,7 @@ public abstract class ASTNode {
* <p>
* Use this method to prevent access to deprecated properties (deprecated in JLS8).
* </p>
- *
+ *
* @exception UnsupportedOperationException if this operation is used in an AST later than JLS4
* @since 3.10
*/
@@ -2346,7 +2346,7 @@ public abstract class ASTNode {
throw new UnsupportedOperationException("Operation only supported in JLS2, JLS3 and JLS4 ASTs"); //$NON-NLS-1$
}
}
-
+
/**
* Checks that this AST operation is only used when
* building JLS12 level ASTs.
@@ -2363,7 +2363,7 @@ public abstract class ASTNode {
throw new UnsupportedOperationException("Operation only supported in JLS12 AST"); //$NON-NLS-1$
}
}
-
+
/**
* Checks that this AST operation is only used when
* building JLS13 level ASTs.
@@ -2379,7 +2379,7 @@ public abstract class ASTNode {
throw new UnsupportedOperationException("Operation only supported in JLS13 AST"); //$NON-NLS-1$
}
}
-
+
/**
* Checks that this AST operation is only used when
* building JLS13 level ASTs.
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTParser.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTParser.java
index 154b1eec3..3c20e3f12 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTParser.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTParser.java
@@ -131,7 +131,7 @@ public class ASTParser {
* Kind constant used to request that the source be parsed
* as a parameter mapping.
*/
- public static final int K_PARAMETER_MAPPING = 0x10;
+ public static final int K_PARAMETER_MAPPING = 0x10;
// SH}
/**
@@ -160,7 +160,7 @@ public class ASTParser {
* Compiler options. Defaults to JavaCore.getOptions().
*/
private Map<String, String> compilerOptions;
-
+
/**
* The focal point for a partial AST request.
* Only used when <code>partial</code> is <code>true</code>.
@@ -812,8 +812,8 @@ public class ASTParser {
* A successful call to this method returns all settings to their
* default values so the object is ready to be reused.
* </p>
- * <p>For identifying a module-info.java file as a special file instead of an ordinary
- * Java file (Since Java 9), a call to this should be preceded by a call to
+ * <p>For identifying a module-info.java file as a special file instead of an ordinary
+ * Java file (Since Java 9), a call to this should be preceded by a call to
* {@link #setUnitName(String)} that sets the unit name as module-info.java</p>
*
* @param monitor the progress monitor used to report progress and request cancellation,
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTVisitor.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTVisitor.java
index a126ca168..0433fa5d8 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTVisitor.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTVisitor.java
@@ -1344,7 +1344,7 @@ public abstract class ASTVisitor {
public boolean visit(RecordDeclaration node) {
return true;
}
-
+
/**
* Visits the given type-specific AST node.
* <p>
@@ -1541,7 +1541,7 @@ public abstract class ASTVisitor {
public boolean visit(SwitchCase node) {
return true;
}
-
+
/**
* Visits the given type-specific AST node.
* <p>
@@ -1560,7 +1560,7 @@ public abstract class ASTVisitor {
public boolean visit(SwitchExpression node) {
return true;
}
-
+
/**
* Visits the given type-specific AST node.
* <p>
@@ -1630,7 +1630,7 @@ public abstract class ASTVisitor {
public boolean visit(TextBlock node) {
return true;
}
-
+
/**
* Visits the given type-specific AST node.
* <p>
@@ -1755,7 +1755,7 @@ public abstract class ASTVisitor {
* @return <code>true</code> if the children of this node should be
* visited, and <code>false</code> if the children of this node should
* be skipped
- *
+ *
* @since 3.10
*/
public boolean visit(TypeMethodReference node) {
@@ -1912,7 +1912,7 @@ public abstract class ASTVisitor {
public boolean visit(YieldStatement node) {
return true;
}
-
+
//{ObjectTeams: visit methods for OT-specific types
/**
* Visits the given type-specific AST node.
@@ -2694,7 +2694,7 @@ public abstract class ASTVisitor {
public void endVisit(LambdaExpression node) {
// default implementation: do nothing
}
-
+
/**
* End of visit the given type-specific AST node.
* <p>
@@ -2752,8 +2752,8 @@ public abstract class ASTVisitor {
public void endVisit(RecordDeclaration node) {
// default implementation: do nothing
}
-
-
+
+
/**
* End of visit the given type-specific AST node.
* <p>
@@ -2970,7 +2970,7 @@ public abstract class ASTVisitor {
public void endVisit(TextBlock node) {
// default implementation: do nothing
}
-
+
/**
* End of visit the given type-specific AST node.
* <p>
@@ -3333,7 +3333,7 @@ public abstract class ASTVisitor {
* </p>
*
* @param node the node to visit
- *
+ *
* @since 3.10
*/
public void endVisit(TypeMethodReference node) {
@@ -3452,7 +3452,7 @@ public abstract class ASTVisitor {
public void endVisit(WildcardType node) {
// default implementation: do nothing
}
-
+
/**
* End of visit the given type-specific AST node.
* <p>
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AnnotatableType.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AnnotatableType.java
index e4d43309c..d15f8bc49 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AnnotatableType.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AnnotatableType.java
@@ -18,7 +18,7 @@ import java.util.List;
/**
* Abstract base class of AST nodes that represent an annotatable type (added in JLS8 API).
* <p>
- * Introduced in JLS8, type references that can be annotated are represented by
+ * Introduced in JLS8, type references that can be annotated are represented by
* AnnotatableType. For the list of types extending AnnotatableType, see {@link Type}.
* </p>
* <p>
@@ -31,7 +31,7 @@ import java.util.List;
* @since 3.10
*/
public abstract class AnnotatableType extends Type {
-
+
/**
* The annotations (element type: {@link Annotation}).
* Null in JLS < 8. Added in JLS8; defaults to an empty list
@@ -90,7 +90,7 @@ public abstract class AnnotatableType extends Type {
* Syntactically, type annotations can also be part of an associated declaration node's
* <code>modifiers()</code> list.
* </p>
- *
+ *
* @return the live list of annotations (element type: {@link Annotation})
* @exception UnsupportedOperationException if this operation is used below JLS8
* @see ITypeBinding#getTypeAnnotations()
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ArrayType.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ArrayType.java
index 0c8fef753..eb9b58e88 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ArrayType.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ArrayType.java
@@ -24,10 +24,10 @@ import java.util.List;
* be an array type) and a list of dimensions, each of which may have a list of annotations.
* </p>
* <pre>
- * ArrayType:
+ * ArrayType:
* Type Dimension <b>{</b> Dimension <b>}</b>
* </pre>
- *
+ *
* In JLS4 and before, array types were expressed in a recursive manner, one dimension at a time:
* <pre>
* ArrayType:
@@ -42,7 +42,7 @@ import java.util.List;
* is an <u><code>@A</code></u>-array of<br>
* <code><u>int </u>&nbsp;&nbsp;&nbsp;&nbsp;<u> @B[] @C[]</u></code>,
* but such a component type is not representable by nested <code>ArrayType</code>s with contiguous source ranges.
- *
+ *
* @since 2.0
* @noinstantiate This class is not intended to be instantiated by clients.
*/
@@ -63,14 +63,14 @@ public class ArrayType extends Type {
* @since 3.10
*/
public static final ChildPropertyDescriptor ELEMENT_TYPE_PROPERTY =
- new ChildPropertyDescriptor(ArrayType.class, "elementType", Type.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$
-
+ new ChildPropertyDescriptor(ArrayType.class, "elementType", Type.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$
+
/**
* The "dimensions" structural property of this node type (element type: {@link Dimension}) (added in JLS8 API).
* @since 3.10
*/
public static final ChildListPropertyDescriptor DIMENSIONS_PROPERTY =
- new ChildListPropertyDescriptor(ArrayType.class, "dimensions", Dimension.class, CYCLE_RISK); //$NON-NLS-1$
+ new ChildListPropertyDescriptor(ArrayType.class, "dimensions", Dimension.class, CYCLE_RISK); //$NON-NLS-1$
/**
* A list of property descriptors (element type:
* {@link StructuralPropertyDescriptor}),
@@ -131,7 +131,7 @@ public class ArrayType extends Type {
* (element type: {@link Dimension}).
* Null before JLS8. Added in JLS8; defaults to a list with one element
* (see constructor).
- *
+ *
* @since 3.10
*/
private ASTNode.NodeList dimensions = null;
@@ -219,7 +219,7 @@ public class ArrayType extends Type {
ArrayType result;
if (this.ast.apiLevel < AST.JLS8_INTERNAL) {
result = new ArrayType(target);
- result.setComponentType((Type) getComponentType().clone(target));
+ result.setComponentType((Type) getComponentType().clone(target));
} else {
result = new ArrayType(target, 0);
result.setElementType((Type) getElementType().clone(target));
@@ -242,7 +242,7 @@ public class ArrayType extends Type {
if (visitChildren) {
// visit children in normal left to right reading order
if (this.ast.apiLevel < AST.JLS8_INTERNAL) {
- acceptChild(visitor, getComponentType());
+ acceptChild(visitor, getComponentType());
} else {
acceptChild(visitor, getElementType());
acceptChildren(visitor, this.dimensions);
@@ -374,7 +374,7 @@ public class ArrayType extends Type {
dimension++;
t = ((ArrayType) t).getComponentType();
}
- return dimension;
+ return dimension;
}
/**
@@ -382,7 +382,7 @@ public class ArrayType extends Type {
* <p>
* For the array type to be plausible, the list should contain at least one element.
* </p>
- *
+ *
* @return the live list of dimensions with optional annotations (element type: {@link Dimension})
* @exception UnsupportedOperationException if this operation is used below JLS8
* @since 3.10
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BaseCallMessageSend.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BaseCallMessageSend.java
index f1281e28b..6519e83b0 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BaseCallMessageSend.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BaseCallMessageSend.java
@@ -122,7 +122,7 @@ public class BaseCallMessageSend extends Expression implements Invocation
public ChildListPropertyDescriptor getArgumentsProperty() {
return ARGUMENTS_PROPERTY;
}
-
+
@Override
final List internalStructuralPropertiesForType(int apiLevel)
{
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BindingComparator.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BindingComparator.java
index 960059a4f..409843d3e 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BindingComparator.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BindingComparator.java
@@ -177,7 +177,7 @@ class BindingComparator {
return moduleBinding2 == null;
if (moduleBinding2 == null)
return false;
- return CharOperation.equals(moduleBinding.moduleName, moduleBinding2.moduleName);
+ return CharOperation.equals(moduleBinding.moduleName, moduleBinding2.moduleName);
}
static boolean isEqual(VariableBinding variableBinding, VariableBinding variableBinding2) {
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BindingResolver.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BindingResolver.java
index 4da202d82..f4310f069 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BindingResolver.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BindingResolver.java
@@ -303,7 +303,7 @@ class BindingResolver {
boolean isResolvedTypeInferredFromExpectedType(ClassInstanceCreation classInstanceCreation) {
return false;
}
-
+
/**
* Returns the compiler lookup environment used by this binding resolver.
* Returns <code>null</code> if none.
@@ -742,7 +742,7 @@ class BindingResolver {
* @param module declaration of interest
* @return the binding for the given module declaration, or
* <code>null</code> if no binding is available
- *
+ *
* @since 3.14
*/
IModuleBinding resolveModule(ModuleDeclaration module) {
@@ -918,7 +918,7 @@ class BindingResolver {
ITypeBinding resolveType(EnumDeclaration type) {
return null;
}
-
+
/**
* Resolves the given record declaration and returns the binding
* for it.
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BreakStatement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BreakStatement.java
index 25ca48c8e..ac5165990 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BreakStatement.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BreakStatement.java
@@ -23,7 +23,7 @@ import java.util.List;
* <pre>
* BreakStatement:
* <b>break</b> [ Identifier ] <b>;</b>
- *
+ *
* Break statement allows expression as part of Java 12 preview feature (JEP 325)
* <b>break</b> <b>{ Identifier | Expression }</b>
* </pre>
@@ -40,7 +40,7 @@ public class BreakStatement extends Statement {
*/
public static final ChildPropertyDescriptor LABEL_PROPERTY =
new ChildPropertyDescriptor(BreakStatement.class, "label", SimpleName.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$
-
+
/**
* The "expression" structural property of this node type (child type: {@link Expression}). (added in JEP 325).
* @noreference This property is not intended to be referenced by clients as it is a part of Java preview feature.
@@ -56,7 +56,7 @@ public class BreakStatement extends Statement {
* or null if uninitialized.
*/
private static final List PROPERTY_DESCRIPTORS;
-
+
/**
* <code>true</code> indicates implicit and <code>false</code> indicates not implicit.
*/
@@ -83,7 +83,7 @@ public class BreakStatement extends Statement {
public static List propertyDescriptors(int apiLevel) {
return PROPERTY_DESCRIPTORS;
}
-
+
/**
* Returns a list of structural property descriptors for this node type.
* Clients must not modify the result.
@@ -106,7 +106,7 @@ public class BreakStatement extends Statement {
* The label, or <code>null</code> if none; none by default.
*/
private SimpleName optionalLabel = null;
-
+
/**
* The expression; <code>null</code> for none
*/
@@ -129,7 +129,7 @@ public class BreakStatement extends Statement {
final List internalStructuralPropertiesForType(int apiLevel) {
return propertyDescriptors(apiLevel);
}
-
+
@Override
final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) {
if (property == LABEL_PROPERTY) {
@@ -139,7 +139,7 @@ public class BreakStatement extends Statement {
setLabel((SimpleName) child);
return null;
}
- }
+ }
if (property == EXPRESSION_PROPERTY) {
if (get) {
return getExpression();
@@ -208,7 +208,7 @@ public class BreakStatement extends Statement {
this.optionalLabel = label;
postReplaceChild(oldChild, label, LABEL_PROPERTY);
}
-
+
/**
* Returns the expression of this break statement, or <code>null</code> if
* there is none.
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CompilationUnit.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CompilationUnit.java
index 841b7f4a2..d9090f415 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CompilationUnit.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CompilationUnit.java
@@ -40,12 +40,12 @@ import org.eclipse.text.edits.TextEdit;
* CompilationUnit:
* OrdinaryCompilationUnit
* ModularCompilationUnit
- *
+ *
* OrdinaryCompilationUnit:
* [ PackageDeclaration ]
* { ImportDeclaration }
* { TypeDeclaration | EnumDeclaration | AnnotationTypeDeclaration | <b>;</b> }
- *
+ *
* ModularCompilationUnit:
* {ImportDeclaration}
* ModuleDeclaration
@@ -1117,7 +1117,7 @@ public class CompilationUnit extends ASTNode {
*
* Sets internal data used to perform statements recovery.
* @param data
- *
+ *
* @since 3.5
*/
void setStatementsRecoveryData(Object data) {
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java
index d3c8444de..5147ee757 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java
@@ -125,7 +125,7 @@ class CompilationUnitResolver extends Compiler {
CategorizedProblem abortProblem;
private IProgressMonitor monitor;
-
+
/**
* Set to <code>true</code> if the receiver was initialized using a java project name environment
*/
@@ -191,7 +191,7 @@ class CompilationUnitResolver extends Compiler {
SourceTypeElementInfo sourceType = (SourceTypeElementInfo) sourceTypes[0];
accept((org.eclipse.jdt.internal.compiler.env.ICompilationUnit) sourceType.getHandle().getCompilationUnit(), accessRestriction);
}
-
+
@Override
public synchronized void accept(org.eclipse.jdt.internal.compiler.env.ICompilationUnit sourceUnit, AccessRestriction accessRestriction) {
super.accept(sourceUnit, accessRestriction);
@@ -582,7 +582,7 @@ class CompilationUnitResolver extends Compiler {
}
} else {
//fill the methods bodies in order for the code to be generated
- //real parse of the method....
+ //real parse of the method....
org.eclipse.jdt.internal.compiler.ast.TypeDeclaration[] types = compilationUnitDeclaration.types;
if (types != null) {
for (int j = 0, typeLength = types.length; j < typeLength; j++) {
@@ -1282,10 +1282,10 @@ class CompilationUnitResolver extends Compiler {
}
// type checking
unit.resolve();
-
+
// flow analysis
if (analyzeCode) unit.analyseCode();
-
+
// code generation
if (generateCode) unit.generateCode();
*/
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CreationReference.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CreationReference.java
index f0fbc7e31..a4ed9f9b5 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CreationReference.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CreationReference.java
@@ -18,10 +18,10 @@ import java.util.List;
/**
* Creation reference expression AST node type (added in JLS8 API).
- *
+ *
* <pre>
* CreationReference:
- * Type <b>::</b>
+ * Type <b>::</b>
* [ <b>&lt;</b> Type { <b>,</b> Type } <b>&gt;</b> ]
* <b>new</b>
* </pre>
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultASTVisitor.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultASTVisitor.java
index 9ad64e250..fc66de79f 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultASTVisitor.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultASTVisitor.java
@@ -742,7 +742,7 @@ class DefaultASTVisitor extends ASTVisitor {
public boolean visit(SwitchCase node) {
return visitNode(node);
}
-
+
@Override
public boolean visit(SwitchExpression node) {
return visitNode(node);
@@ -767,7 +767,7 @@ class DefaultASTVisitor extends ASTVisitor {
public boolean visit(TextBlock node) {
return visitNode(node);
}
-
+
@Override
public boolean visit(TextElement node) {
return visitNode(node);
@@ -817,7 +817,7 @@ class DefaultASTVisitor extends ASTVisitor {
public boolean visit(UnionType node) {
return visitNode(node);
}
-
+
@Override
public boolean visit(VariableDeclarationExpression node) {
return visitNode(node);
@@ -842,7 +842,7 @@ class DefaultASTVisitor extends ASTVisitor {
public boolean visit(WildcardType node) {
return visitNode(node);
}
-
+
@Override
public boolean visit(YieldStatement node) {
return visitNode(node);
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultBindingResolver.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultBindingResolver.java
index 0f4b7f6e4..76e7957ef 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultBindingResolver.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultBindingResolver.java
@@ -174,12 +174,12 @@ class DefaultBindingResolver extends BindingResolver {
* Toggle controlling whether DOM bindings should be created when missing internal compiler bindings..
*/
boolean isRecoveringBindings;
-
+
/**
* Set to <code>true</code> if initialized from a java project
*/
boolean fromJavaProject;
-
+
/**
* Constructor for DefaultBindingResolver.
*/
@@ -374,7 +374,7 @@ class DefaultBindingResolver extends BindingResolver {
TypeReference[][] typeArguments = typeReference.typeArguments;
int value = 0;
org.eclipse.jdt.internal.compiler.ast.Annotation[][] typeAnnotations = typeReference.annotations;
- int length = typeReference.tokens.length;
+ int length = typeReference.tokens.length;
for (int i = 0; i < length; ++i) {
if (value != 0 || (typeArguments != null && typeArguments[i] != null) ||
(typeAnnotations != null && typeAnnotations[i] != null )) {
@@ -1656,7 +1656,7 @@ class DefaultBindingResolver extends BindingResolver {
QualifiedSuperReference qualifiedSuperReference = (QualifiedSuperReference) node;
return this.getTypeBinding(qualifiedSuperReference.qualification.resolvedType);
} else if (node instanceof LocalDeclaration) {
- return name.getAST().apiLevel() >= AST.JLS10_INTERNAL && name instanceof SimpleName && ((SimpleName) name).isVar() ?
+ return name.getAST().apiLevel() >= AST.JLS10_INTERNAL && name instanceof SimpleName && ((SimpleName) name).isVar() ?
resolveTypeBindingForName(name) :
this.getVariableBinding(((LocalDeclaration)node).binding);
} else if (node instanceof JavadocFieldReference) {
@@ -1788,7 +1788,7 @@ class DefaultBindingResolver extends BindingResolver {
/**
* @see BindingResolver#resolveModule(ModuleDeclaration)
- * @since 3.14
+ * @since 3.14
*/
@Override
IModuleBinding resolveModule(ModuleDeclaration module) {
@@ -1879,7 +1879,7 @@ class DefaultBindingResolver extends BindingResolver {
}
return null;
}
-
+
@Override
ITypeBinding resolveType(RecordDeclaration type) {
final Object node = this.newAstToOldAst.get(type);
@@ -1898,8 +1898,8 @@ class DefaultBindingResolver extends BindingResolver {
}
return null;
}
-
-
+
+
@Override
synchronized ITypeBinding resolveType(Type type) {
@@ -2237,7 +2237,7 @@ class DefaultBindingResolver extends BindingResolver {
actualDimensions += typeBinding.getDimensions();
}
if (!(leafComponentType instanceof TypeBinding)) return null;
- org.eclipse.jdt.internal.compiler.lookup.TypeBinding leafTypeBinding =
+ org.eclipse.jdt.internal.compiler.lookup.TypeBinding leafTypeBinding =
((TypeBinding) leafComponentType).binding;
if (leafTypeBinding instanceof VoidTypeBinding) {
throw new IllegalArgumentException();
@@ -2253,7 +2253,7 @@ class DefaultBindingResolver extends BindingResolver {
actualDimensions));
}
}
-
+
private org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding[] insertAnnotations(
org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding[] annots, int dimensions) {
if (dimensions == 0 || annots == null || annots.length == 0) {
@@ -2269,7 +2269,7 @@ class DefaultBindingResolver extends BindingResolver {
}
if (dimensions < 0) dimensions = 0; // Just means there were no annotations
}
- org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding[] newAnnots =
+ org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding[] newAnnots =
new org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding[annots.length - index + dimensions];
System.arraycopy(annots, index, newAnnots, dimensions, annots.length - index);
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Dimension.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Dimension.java
index 8dfea062a..fbae596c0 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Dimension.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Dimension.java
@@ -26,7 +26,7 @@ import java.util.List;
* <li>extra dimension in the following node types:
* {@link SingleVariableDeclaration}, {@link VariableDeclarationFragment}, {@link MethodDeclaration}</li>
* </ul>
- *
+ *
* <pre>
* Dimension:
* { Annotation } <b>[]</b>
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DoStatement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DoStatement.java
index dcfcb5eb3..1e2c5db95 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DoStatement.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DoStatement.java
@@ -44,7 +44,7 @@ public class DoStatement extends Statement {
*/
public static final ChildPropertyDescriptor EXPRESSION_PROPERTY =
new ChildPropertyDescriptor(DoStatement.class, "expression", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$
-
+
/**
* A list of property descriptors (element type:
* {@link StructuralPropertyDescriptor}),
@@ -79,7 +79,7 @@ public class DoStatement extends Statement {
* The body statement; lazily initialized; defaults to an empty block.
*/
private Statement body = null;
-
+
/**
* The expression; lazily initialized; defaults to an unspecified, but
* legal, expression.
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DocCommentParser.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DocCommentParser.java
index 0d2e1c5ae..b559ead1d 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DocCommentParser.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DocCommentParser.java
@@ -488,7 +488,7 @@ class DocCommentParser extends AbstractCommentParser {
} else if (length == TAG_LITERAL_LENGTH && CharOperation.equals(TAG_LITERAL, tagName)) {
this.tagValue = TAG_LITERAL_VALUE;
}
-
+
if (this.tagValue != NO_TAG_VALUE && this.tagValue != TAG_LITERAL_VALUE) {
if (this.inlineTagStarted) {
valid = parseReference();
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ExportsDirective.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ExportsDirective.java
index b4fc31f03..f5f3f29eb 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ExportsDirective.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ExportsDirective.java
@@ -23,7 +23,7 @@ import java.util.List;
* </pre>
*
* @since 3.14
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
*/
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ExpressionMethodReference.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ExpressionMethodReference.java
index 0892bf33c..5cdaee377 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ExpressionMethodReference.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ExpressionMethodReference.java
@@ -20,7 +20,7 @@ import java.util.List;
* Expression method reference AST node type (added in JLS8 API).
* <pre>
* ExpressionMethodReference:
- * Expression <b>::</b>
+ * Expression <b>::</b>
* [ <b>&lt;</b> Type { <b>,</b> Type } <b>&gt;</b> ]
* Identifier
* </pre>
@@ -37,7 +37,7 @@ public class ExpressionMethodReference extends MethodReference {
new ChildPropertyDescriptor(ExpressionMethodReference.class, "expression", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$
/**
- * The "typeArguments" structural property of this node type (element type: {@link Type})
+ * The "typeArguments" structural property of this node type (element type: {@link Type})
*/
public static final ChildListPropertyDescriptor TYPE_ARGUMENTS_PROPERTY =
internalTypeArgumentsFactory(ExpressionMethodReference.class);
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IBinding.java
index 5e212cad4..ed7c045b7 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IBinding.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IBinding.java
@@ -133,7 +133,7 @@ public interface IBinding {
* <p>
* <b>Note:</b> This method only returns declaration annotations.
* <em>Type annotations</em> in the sense of JLS8 9.7.4 are <em>not</em> returned.
- * Type annotations can be retrieved via {@link ITypeBinding#getTypeAnnotations()}.
+ * Type annotations can be retrieved via {@link ITypeBinding#getTypeAnnotations()}.
* </p>
*
* @return the list of resolved declaration annotations, or the empty list if there are no
@@ -354,7 +354,7 @@ public interface IBinding {
* different clusters of bindings, the binding objects may or may
* not be different objects; in these cases, the binding keys
* are used where available.
- *
+ *
* <p>
* Note that type bindings that only differ in their {@link ITypeBinding#getTypeAnnotations() type annotations}
* have the same {@link IBinding#getKey() key}, and hence this method returns
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IDocElement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IDocElement.java
index 7e61430cc..a2e25bd64 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IDocElement.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IDocElement.java
@@ -15,7 +15,7 @@
package org.eclipse.jdt.core.dom;
/**
- * Common marker interface for AST nodes that represent fragments in doc elements.
+ * Common marker interface for AST nodes that represent fragments in doc elements.
* These are node types that can legitimately be included in {@link TagElement#fragments()}.
* <pre>
* IDocElement:
@@ -25,7 +25,7 @@ package org.eclipse.jdt.core.dom;
* {@link TagElement}
* {@link TextElement}
* </pre>
- *
+ *
* @since 3.11, internal interface since 3.0
* @see TagElement#fragments()
* @noextend This interface is not intended to be extended by clients.
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IMethodBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IMethodBinding.java
index 34a8283e8..f5429a189 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IMethodBinding.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IMethodBinding.java
@@ -98,7 +98,7 @@ public interface IMethodBinding extends IBinding {
* <li>If the lambda expression is declared in the body of a method,
* answers the binding of that declaring method.
* </li>
- * <li>Otherwise, if the lambda expression is declared in the
+ * <li>Otherwise, if the lambda expression is declared in the
* initializer of a field, answers the binding of that declaring field.
* </li>
* <li>Otherwise, if the lambda expression is declared in a static initializer or an
@@ -147,8 +147,8 @@ public interface IMethodBinding extends IBinding {
* <p>
* <b>Note:</b> This method only returns declaration annotations.
* <em>Type annotations</em> in the sense of JLS8 9.7.4 are <em>not</em> returned.
- * Type annotations can be retrieved from a parameter type
- * via {@link ITypeBinding#getTypeAnnotations()}.
+ * Type annotations can be retrieved from a parameter type
+ * via {@link ITypeBinding#getTypeAnnotations()}.
* </p>
*
* @param paramIndex the index of the parameter of interest
@@ -184,22 +184,22 @@ public interface IMethodBinding extends IBinding {
public ITypeBinding[] getParameterTypes();
/**
- * Returns the type of this method's receiver or <code>null</code>
+ * Returns the type of this method's receiver or <code>null</code>
* if there is no receiver declared explicitly.
- *
- * @return the type of this method's receiver or <code>null</code>
+ *
+ * @return the type of this method's receiver or <code>null</code>
* if there is no receiver declared explicitly.
- *
+ *
* @since 3.10
*/
public ITypeBinding getDeclaredReceiverType();
-
+
/**
* Returns the binding for the return type of this method. Returns the
* special primitive <code>void</code> return type for constructors.
* <p>
- * For methods, the type binding that is returned contains type annotations
- * if any. For e.g. the following code would get the type annotations on a
+ * For methods, the type binding that is returned contains type annotations
+ * if any. For e.g. the following code would get the type annotations on a
* method: <br><br>
* <code> IAnnotationBinding[] annots = getReturnType().getTypeAnnotations() </code>
* </p>
@@ -384,13 +384,13 @@ public interface IMethodBinding extends IBinding {
* @since 3.1
*/
public boolean overrides(IMethodBinding method);
-
+
/**
* Returns a list of variable bindings representing the synthetic outer
- * local variables. Returns an empty array for non-lambda expressions or if
+ * local variables. Returns an empty array for non-lambda expressions or if
* this method does not have any synthetic parameters.
- *
+ *
* @return a (possibly empty) list of variable bindings for the synthetic
* outer locals of this method if this is a lambda expression, else an empty array.
* @since 3.18
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IMethodNode.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IMethodNode.java
index f2237549b..d324ba451 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IMethodNode.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IMethodNode.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2012 GK Software AG
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IModuleBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IModuleBinding.java
index fbd6f20bf..bb6ebd195 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IModuleBinding.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IModuleBinding.java
@@ -38,7 +38,7 @@ public interface IModuleBinding extends IBinding {
/**
* Returns all required modules.
* <p>The resulting bindings are in no particular order.</p>
- *
+ *
* @return all required modules
*/
public abstract IModuleBinding[] getRequiredModules();
@@ -52,9 +52,9 @@ public interface IModuleBinding extends IBinding {
public abstract IPackageBinding[] getExportedPackages();
/**
- * If this module exports the given package to specific modules, returns the array of names of
+ * If this module exports the given package to specific modules, returns the array of names of
* modules, otherwise returns an empty array.
- *
+ *
* @param packageBinding a package binding for which targeted modules are declared
* @return array of names of targeted modules
*/
@@ -81,7 +81,7 @@ public interface IModuleBinding extends IBinding {
/**
* Returns the services used by this module.
* <p>The resulting bindings are in no particular order.</p>
- *
+ *
* @return array of type bindings
*/
public abstract ITypeBinding[] getUses();
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IPackageBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IPackageBinding.java
index f91a7c748..d620045f7 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IPackageBinding.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IPackageBinding.java
@@ -57,7 +57,7 @@ public interface IPackageBinding extends IBinding {
* Returns the binding of the module associated with this package binding.
* @return the binding of the module associated with this package, or
* <code>null</code> if none
- *
+ *
* @since 3.14
*/
public default IModuleBinding getModule() {
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ITypeBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ITypeBinding.java
index bb5501433..ac543e67b 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ITypeBinding.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ITypeBinding.java
@@ -102,7 +102,7 @@ public interface ITypeBinding extends IBinding {
* @since 3.1
*/
public ITypeBinding getBound();
-
+
/**
* Returns the generic type associated with this wildcard type, if it has one.
* Returns <code>null</code> if this is not a wildcard type.
@@ -123,7 +123,7 @@ public interface ITypeBinding extends IBinding {
* @since 3.5
*/
public int getRank();
-
+
/**
* Returns the binding representing the component type of this array type,
* or <code>null</code> if this is not an array type binding. The component
@@ -295,14 +295,14 @@ public interface ITypeBinding extends IBinding {
*
* <p>The module of a recovered type reference binding is the module
* associated with the package returned by {@link #getPackage()} ie either
- * the module associated with the package of the enclosing type, or,
- * if the type name is the name of a {@linkplain AST#resolveWellKnownType(String)
- * well-known type}, the module associated with the package of the matching
+ * the module associated with the package of the enclosing type, or,
+ * if the type name is the name of a {@linkplain AST#resolveWellKnownType(String)
+ * well-known type}, the module associated with the package of the matching
* well-known type.</p>
*
* @return the binding of the module associated with the package
- * in which this class, interface, enum, or annotation type is declared,
- * or <code>null</code> if this type binding represents a primitive type, an array type,
+ * in which this class, interface, enum, or annotation type is declared,
+ * or <code>null</code> if this type binding represents a primitive type, an array type,
* the null type, a type variable, a wildcard type or a capture binding.
*
* @since 3.14
@@ -323,9 +323,9 @@ public interface ITypeBinding extends IBinding {
* Returns the binding representing the element type of this array type,
* or <code>null</code> if this is not an array type binding. The element
* type of an array type is never itself an array type.
- *
+ *
* To get the type annotations on dimensions, clients should repeatedly
- * call getComponentType() and get the type annotations from there.
+ * call getComponentType() and get the type annotations from there.
*
* @return the element type binding, or <code>null</code> if this is
* not an array type
@@ -359,17 +359,17 @@ public interface ITypeBinding extends IBinding {
* @since 3.1
*/
public ITypeBinding getErasure();
-
+
/**
- * Returns the single abstract method that constitutes the single function
- * contract (aside from any redeclarations of methods of <code>java.lang.Object</code>)
- * of the receiver interface type or <code>null</code> if there is no such contract or if the receiver
+ * Returns the single abstract method that constitutes the single function
+ * contract (aside from any redeclarations of methods of <code>java.lang.Object</code>)
+ * of the receiver interface type or <code>null</code> if there is no such contract or if the receiver
* is not an interface.
* <p>
* The returned method binding may be synthetic and its {@link #getDeclaringClass() declaring type}
* may be a super interface type of this type binding.
* </p>
- *
+ *
* @return the single abstract method that represents the single function contract, or
* <code>null</code> if the receiver is not a functional interface type
*
@@ -580,19 +580,19 @@ public interface ITypeBinding extends IBinding {
public ITypeBinding getSuperclass();
/**
- * Returns the type annotations that this type reference is annotated with. Since JLS8,
- * multiple instances of type bindings may be created if they are annotated with
+ * Returns the type annotations that this type reference is annotated with. Since JLS8,
+ * multiple instances of type bindings may be created if they are annotated with
* different type use annotations.
* <p>
- * For example, the following three type references would produce three distinct type
+ * For example, the following three type references would produce three distinct type
* bindings for java.lang.String that share the same key:
* <ul>
* <li>java.lang.@Marker1 String</li>
* <li>java.lang.@Marker2 String</li>
* <li>java.lang.String</li>
* </ul>
- * To get the type annotations on dimensions, clients should repeatedly call
- * {@link #getComponentType()} and get the type annotations from there.
+ * To get the type annotations on dimensions, clients should repeatedly call
+ * {@link #getComponentType()} and get the type annotations from there.
* @return type annotations specified on this type reference, or an empty array if
* no type use annotations are found.
@@ -625,7 +625,7 @@ public interface ITypeBinding extends IBinding {
public ITypeBinding[] getTypeArguments();
/**
- * Returns the upper type bounds of this type variable, wildcard, capture, or intersectionType.
+ * Returns the upper type bounds of this type variable, wildcard, capture, or intersectionType.
* If the variable, wildcard, or capture had no explicit bound, then it returns an empty list.
* <p>
* Note that per construction, it can only contain one class or array type,
@@ -873,8 +873,8 @@ public interface ITypeBinding extends IBinding {
* Returns whether this type binding represents an intersection binding.
* <p>
* Intersection types can be derived from type parameter bounds and cast
- * expressions; they also arise in the processes of capture conversion
- * and least upper bound computation as specified in section 4.9 of
+ * expressions; they also arise in the processes of capture conversion
+ * and least upper bound computation as specified in section 4.9 of
* <em>The Java Language Specification, Java SE 8 Edition</em> (JLS8).
* </p>
* <p>
@@ -964,11 +964,11 @@ public interface ITypeBinding extends IBinding {
* of another class or interface. A local class is a subspecies of nested
* type, and mutually exclusive with member types. For anonymous
* classes, which are considered a subspecies of local classes, this method
- * returns true.
+ * returns true.
* </p>
* <p>
- * Note: This deviates from JLS3 14.3, which states that anonymous types are
- * not local types since they do not have a name. Also note that interfaces
+ * Note: This deviates from JLS3 14.3, which states that anonymous types are
+ * not local types since they do not have a name. Also note that interfaces
* and annotation types cannot be local.
* </p>
*
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/InstanceofExpression.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/InstanceofExpression.java
index edcb045c9..5e61a657b 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/InstanceofExpression.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/InstanceofExpression.java
@@ -59,7 +59,7 @@ public class InstanceofExpression extends Expression {
* or null if uninitialized.
*/
private static final List PROPERTY_DESCRIPTORS;
-
+
/**
* A list of property descriptors (element type:
* {@link StructuralPropertyDescriptor}),
@@ -125,7 +125,7 @@ public class InstanceofExpression extends Expression {
* but legal, simple type.
*/
private Type rightOperand = null;
-
+
/**
* The patternVariable declaration.
*/
@@ -146,7 +146,7 @@ public class InstanceofExpression extends Expression {
final List internalStructuralPropertiesForType(int apiLevel) {
return propertyDescriptors(apiLevel);
}
-
+
@Override
final List internalStructuralPropertiesForType(int apiLevel, boolean previewEnabled) {
return propertyDescriptors(apiLevel, previewEnabled);
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/InternalASTRewrite.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/InternalASTRewrite.java
index a1cde5fb4..32431dc6d 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/InternalASTRewrite.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/InternalASTRewrite.java
@@ -46,7 +46,7 @@ class InternalASTRewrite extends NodeEventHandler {
protected final RewriteEventStore eventStore;
protected final NodeInfoStore nodeStore;
- /** ASTNode clone -> ASTNode original */
+ /** ASTNode clone -> ASTNode original */
protected final Hashtable clonedNodes;
int cloneDepth = 0;
@@ -111,7 +111,7 @@ class InternalASTRewrite extends NodeEventHandler {
/*
* A modified node cannot be considered as cloned any more.
* we can't copy the original formatting/comments and at the same time modify the node.
- *
+ *
* Workaround for https://bugs.eclipse.org/405699 is to remove such nodes from clonedNodes
* and instead mark all children as cloned (or skip them if they are not in clonedNodes).
*/
@@ -132,11 +132,11 @@ class InternalASTRewrite extends NodeEventHandler {
}
}
}
-
+
node = node.getParent();
}
}
-
+
ASTNode source = (ASTNode)this.clonedNodes.get(newChild);
if(source != null) {
if(this.cloneDepth == 0) {
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IntersectionType.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IntersectionType.java
index 1046ec51d..b1312eaa6 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IntersectionType.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IntersectionType.java
@@ -73,7 +73,7 @@ public class IntersectionType extends Type {
/**
* Creates a new unparented node for an intersection type owned by the given AST.
* By default, it has no types.<p>
- *
+ *
* N.B. This constructor is package-private.
* </p>
*
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/LambdaExpression.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/LambdaExpression.java
index 7730ba02f..c283cc1d9 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/LambdaExpression.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/LambdaExpression.java
@@ -24,14 +24,14 @@ import java.util.List;
* <b>(</b> [ Identifier { <b>,</b> Identifier } ] <b>)</b> <b>-></b> Body
* <b>(</b> [ FormalParameter { <b>,</b> FormalParameter } ] <b>)</b> <b>-></b> Body
* </pre>
- *
- *<p>
+ *
+ *<p>
* The first two forms use {@link VariableDeclarationFragment} for the parameter or parameters,
* while the third form uses {@link SingleVariableDeclaration}.</p>
*<p>The Body can be either a {@link Block} or an {@link Expression}.</p>
*
* @since 3.10
- * @noinstantiate This class is not intended to be instantiated by clients
+ * @noinstantiate This class is not intended to be instantiated by clients
*/
public class LambdaExpression extends Expression {
@@ -54,7 +54,7 @@ public class LambdaExpression extends Expression {
*/
public static final ChildListPropertyDescriptor PARAMETERS_PROPERTY =
new ChildListPropertyDescriptor(LambdaExpression.class, "parameters", VariableDeclaration.class, CYCLE_RISK); //$NON-NLS-1$
-
+
/**
* The "body" structural property of this node type (child type: {@link ASTNode},
* must be either a {@link Block} or an {@link Expression}).
@@ -68,7 +68,7 @@ public class LambdaExpression extends Expression {
* or null if uninitialized.
*/
private static final List PROPERTY_DESCRIPTORS_8_0;
-
+
static {
List propertyList = new ArrayList(4);
createPropertyList(LambdaExpression.class, propertyList);
@@ -77,7 +77,7 @@ public class LambdaExpression extends Expression {
addProperty(BODY_PROPERTY, propertyList);
PROPERTY_DESCRIPTORS_8_0 = reapPropertyList(propertyList);
}
-
+
/**
* Returns a list of structural property descriptors for this node type.
* Clients must not modify the result.
@@ -92,7 +92,7 @@ public class LambdaExpression extends Expression {
/**
* Indicates whether parentheses are present or not.
- * Defaults to <code>true</code>.
+ * Defaults to <code>true</code>.
*/
private boolean hasParentheses = true;
@@ -207,7 +207,7 @@ public class LambdaExpression extends Expression {
* just a single {@link VariableDeclarationFragment}.
* ASTRewrite may ignore this property if necessary.
* </p>
- *
+ *
* @return <code>true</code> if this lambda expression has parentheses around
* its parameters and <code>false</code> otherwise
*/
@@ -249,7 +249,7 @@ public class LambdaExpression extends Expression {
/**
* Returns the body of this lambda expression.
- *
+ *
* @return the lambda expression body, which can be either a {@link Block} or an {@link Expression}
*/
public ASTNode getBody() {
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MemberValuePairBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MemberValuePairBinding.java
index a312d1532..5241ae610 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MemberValuePairBinding.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MemberValuePairBinding.java
@@ -154,7 +154,7 @@ class MemberValuePairBinding implements IMemberValuePairBinding {
this.value = NoValue;
IMethodBinding methodBinding = getMethodBinding();
if (methodBinding.getReturnType().isArray() && !this.value.getClass().isArray()) {
- this.value = new Object[] { this.value };
+ this.value = new Object[] { this.value };
}
}
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodBinding.java
index 1866c2800..616b7287a 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodBinding.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodBinding.java
@@ -261,7 +261,7 @@ class MethodBinding implements IMethodBinding {
((metaTagBits & TagBits.AnnotationTargetMASK) != 0)) {
continue;
}
-
+
final IAnnotationBinding annotationInstance = this.resolver.getAnnotationInstance(internalAnnotation);
if (annotationInstance == null) {
continue;
@@ -270,7 +270,7 @@ class MethodBinding implements IMethodBinding {
}
if (convertedAnnotationCount == length) return tempAnnotations;
if (convertedAnnotationCount == 0) return AnnotationBinding.NoAnnotations;
-
+
System.arraycopy(tempAnnotations, 0, (tempAnnotations = new IAnnotationBinding[convertedAnnotationCount]), 0, convertedAnnotationCount);
return tempAnnotations;
}
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodDeclaration.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodDeclaration.java
index db7c8a212..f16a75f05 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodDeclaration.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodDeclaration.java
@@ -99,7 +99,7 @@ public class MethodDeclaration extends BodyDeclaration
*/
public static final SimplePropertyDescriptor CONSTRUCTOR_PROPERTY =
new SimplePropertyDescriptor(MethodDeclaration.class, "constructor", boolean.class, MANDATORY); //$NON-NLS-1$
-
+
/**
* The "compact constructor" structural property of record node type (type: {@link Boolean}).
* @since 3.22
@@ -137,7 +137,7 @@ public class MethodDeclaration extends BodyDeclaration
*/
public static final SimplePropertyDescriptor EXTRA_DIMENSIONS_PROPERTY =
new SimplePropertyDescriptor(MethodDeclaration.class, "extraDimensions", int.class, MANDATORY); //$NON-NLS-1$
-
+
/**
* The "extraDimensions2" structural property of this node type (element type: {@link Dimension}) (added in JLS8 API).
* @since 3.10
@@ -165,7 +165,7 @@ public class MethodDeclaration extends BodyDeclaration
*/
public static final ChildPropertyDescriptor RECEIVER_TYPE_PROPERTY =
new ChildPropertyDescriptor(MethodDeclaration.class, "receiverType", Type.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$
-
+
/**
* The "receiverQualifier" structural property of this node type (child type: {@link SimpleName}) (added in JLS8 API).
* @since 3.10
@@ -227,7 +227,7 @@ public class MethodDeclaration extends BodyDeclaration
* @since 3.10
*/
private static final List PROPERTY_DESCRIPTORS_8_0;
-
+
/**
* A list of property descriptors (element type:
* {@link StructuralPropertyDescriptor}),
@@ -288,7 +288,7 @@ public class MethodDeclaration extends BodyDeclaration
// SH}
addProperty(BODY_PROPERTY, propertyList);
PROPERTY_DESCRIPTORS_8_0 = reapPropertyList(propertyList);
-
+
propertyList = new ArrayList(14);
createPropertyList(MethodDeclaration.class, propertyList);
addProperty(JAVADOC_PROPERTY, propertyList);
@@ -319,7 +319,7 @@ public class MethodDeclaration extends BodyDeclaration
public static List propertyDescriptors(int apiLevel) {
return propertyDescriptors(apiLevel, false);
}
-
+
/**
* Returns a list of structural property descriptors for this node type.
* Clients must not modify the result.
@@ -349,7 +349,7 @@ public class MethodDeclaration extends BodyDeclaration
* Defaults to method.
*/
private boolean isConstructor = false;
-
+
/**
* <code>true</code> for a compact constructor in a record, <code>false</code> for a method.
@@ -369,7 +369,7 @@ public class MethodDeclaration extends BodyDeclaration
* @since 3.10
*/
private Type optionalReceiverType = null;
-
+
/**
* Qualifying name of the explicit </code>this</code> parameter, or <code>null</code> if none.
* Defaults to none.
@@ -421,7 +421,7 @@ public class MethodDeclaration extends BodyDeclaration
* (element type: {@link Dimension}).
* Null before JLS8. Added in JLS8; defaults to an empty list
* (see constructor).
- *
+ *
* @since 3.10
*/
private ASTNode.NodeList extraDimensions = null;
@@ -438,7 +438,7 @@ public class MethodDeclaration extends BodyDeclaration
* The list of thrown exception Types (element type: {@link Type}).
* Null before JLS8. Added in JLS8; defaults to an empty list
* (see constructor).
- *
+ *
* @since 3.10
*/
private ASTNode.NodeList thrownExceptionTypes = null;
@@ -493,7 +493,7 @@ public class MethodDeclaration extends BodyDeclaration
final List internalStructuralPropertiesForType(int apiLevel, boolean previewEnabled) {
return propertyDescriptors(apiLevel, previewEnabled);
}
-
+
@Override
final int internalGetSetIntProperty(SimplePropertyDescriptor property, boolean get, int value) {
if (property == MODIFIERS_PROPERTY) {
@@ -536,8 +536,8 @@ public class MethodDeclaration extends BodyDeclaration
// allow default implementation to flag the error
return super.internalGetSetBooleanProperty(property, get, value);
}
-
-
+
+
@Override
final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) {
@@ -627,7 +627,7 @@ public class MethodDeclaration extends BodyDeclaration
}
if (property == THROWN_EXCEPTION_TYPES_PROPERTY) {
return thrownExceptionTypes();
- }
+ }
if (property == EXTRA_DIMENSIONS2_PROPERTY) {
return extraDimensions();
}
@@ -689,7 +689,7 @@ public class MethodDeclaration extends BodyDeclaration
if (this.ast.apiLevel() >= AST.JLS8_INTERNAL) {
result.thrownExceptionTypes().addAll(ASTNode.copySubtrees(target, thrownExceptionTypes()));
} else {
- result.thrownExceptions().addAll(ASTNode.copySubtrees(target, thrownExceptions()));
+ result.thrownExceptions().addAll(ASTNode.copySubtrees(target, thrownExceptions()));
}
//{ObjectTeams:
result.setGuardPredicate((GuardPredicateDeclaration)ASTNode.copySubtree(target, getGuardPredicate()));
@@ -733,9 +733,9 @@ public class MethodDeclaration extends BodyDeclaration
acceptChildren(visitor, this.parameters);
if (this.ast.apiLevel() >= AST.JLS8_INTERNAL) {
acceptChildren(visitor, this.extraDimensions);
- acceptChildren(visitor, this.thrownExceptionTypes);
+ acceptChildren(visitor, this.thrownExceptionTypes);
} else {
- acceptChildren(visitor, this.thrownExceptions);
+ acceptChildren(visitor, this.thrownExceptions);
}
acceptChild(visitor, getBody());
}
@@ -772,9 +772,9 @@ public class MethodDeclaration extends BodyDeclaration
* @since 3.22
* @noreference This method is not intended to be referenced by clients.
* @exception UnsupportedOperationException if this operation is not used in JLS14
- * @exception UnsupportedOperationException if this operation is used with previewEnabled flag as false
+ * @exception UnsupportedOperationException if this operation is used with previewEnabled flag as false
*/
-
+
public boolean isCompactConstructor() {
supportedOnlyIn14();
unsupportedWithoutPreviewError();
@@ -789,9 +789,9 @@ public class MethodDeclaration extends BodyDeclaration
* @since 3.22
* @noreference This method is not intended to be referenced by clients.
* @exception UnsupportedOperationException if this operation is not used in JLS14
- * @exception UnsupportedOperationException if this operation is used with previewEnabled flag as false
+ * @exception UnsupportedOperationException if this operation is used with previewEnabled flag as false
*/
-
+
public void setCompactConstructor(boolean isCompactConstructor) {
preValueChange(COMPACT_CONSTRUCTOR_PROPERTY);
this.isCompactConstructor = isCompactConstructor;
@@ -861,10 +861,10 @@ public class MethodDeclaration extends BodyDeclaration
}
/**
- * Returns the receiver type explicitly declared in the method or constructor
+ * Returns the receiver type explicitly declared in the method or constructor
* declaration (added in JLS8 API).
*
- * If the receiver is not explicitly declared in the method or constructor
+ * If the receiver is not explicitly declared in the method or constructor
* declaration, <code>null</code> is returned.
*
* @return the receiver type or <code>null</code> if receiver is not declared explicitly
@@ -881,7 +881,7 @@ public class MethodDeclaration extends BodyDeclaration
* <p>
* A receiver type is only legal in Java code if it appears on an instance method or on a constructor of an inner class.
* </p>
- *
+ *
* @param receiverType type of the explicit receiver parameter, or <code>null</code> if there is none
* @exception UnsupportedOperationException if this operation is used below JLS8
* @since 3.10
@@ -899,7 +899,7 @@ public class MethodDeclaration extends BodyDeclaration
* <p>
* A receiver qualifier is only legal in Java code if it appears on a constructor of an inner class.
* </p>
- *
+ *
* @return the qualifying name or <code>null</code> if a qualifier was not specified
* @exception UnsupportedOperationException if this operation is used below JLS8
* @since 3.10
@@ -908,10 +908,10 @@ public class MethodDeclaration extends BodyDeclaration
unsupportedIn2_3_4();
return this.optionalReceiverQualifier;
}
-
+
/**
* Sets the given simple name as the qualifier for the receiver (added in JLS8 API).
- *
+ *
* @param receiverQualifier explicit receiver parameter to be added to the method declaration
* @exception UnsupportedOperationException if this operation is used below JLS8
* @since 3.10
@@ -923,7 +923,7 @@ public class MethodDeclaration extends BodyDeclaration
this.optionalReceiverQualifier = receiverQualifier;
postReplaceChild(oldChild, receiverQualifier, RECEIVER_QUALIFIER_PROPERTY);
}
-
+
/**
* Returns the live ordered list of method parameter declarations for this
* method declaration.
@@ -997,7 +997,7 @@ public class MethodDeclaration extends BodyDeclaration
* @return the live list of exception types
* (element type: {@link Type})
* @exception UnsupportedOperationException if this operation is used
- * in a JLS2, JLS3 or JLS4 AST
+ * in a JLS2, JLS3 or JLS4 AST
* @since 3.10
*/
public List thrownExceptionTypes() {
@@ -1202,7 +1202,7 @@ public class MethodDeclaration extends BodyDeclaration
* @exception IllegalArgumentException if the number of dimensions is
* negative
* @exception UnsupportedOperationException if this operation is used in
- * a JLS8 or later AST
+ * a JLS8 or later AST
* @since 2.1
* @deprecated In the JLS8 API, this method is replaced by
* {@link #extraDimensions()} which contains a list of {@link Dimension} nodes.
@@ -1222,7 +1222,7 @@ public class MethodDeclaration extends BodyDeclaration
/**
* Returns the live ordered list of extra dimensions with optional annotations (added in JLS8 API).
- *
+ *
* @return the live list of extra dimensions with optional annotations (element type: {@link Dimension})
* @exception UnsupportedOperationException if this operation is used below JLS8
* @since 3.10
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodMappingBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodMappingBinding.java
index 78cb24691..430c566e5 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodMappingBinding.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodMappingBinding.java
@@ -135,7 +135,7 @@ class MethodMappingBinding implements IMethodMappingBinding
return this.baseMethods;
}
-
+
@Override
public IVariableBinding getBaseField()
{
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodReference.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodReference.java
index 6bc27c033..23206453d 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodReference.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodReference.java
@@ -18,7 +18,7 @@ import java.util.List;
/**
* Abstract base class of all AST node types that represent a method reference
* expression (added in JLS8 API).
- *
+ *
* <pre>
* MethodReference:
* CreationReference
@@ -29,7 +29,7 @@ import java.util.List;
* <p>
* A method reference that is represented by a simple or qualified name,
* followed by <code>::</code>, followed by a simple name can be represented
- * as {@link ExpressionMethodReference} or as {@link TypeMethodReference}.
+ * as {@link ExpressionMethodReference} or as {@link TypeMethodReference}.
* The ASTParser currently prefers the first form.
* </p>
*
@@ -48,9 +48,9 @@ public abstract class MethodReference extends Expression {
ASTNode.NodeList typeArguments;
/**
- * Creates and returns a structural property descriptor for the "typeArguments"
+ * Creates and returns a structural property descriptor for the "typeArguments"
* property declared on the given concrete node type (element type: {@link Type}).
- *
+ *
* @return the property descriptor
*/
static final ChildListPropertyDescriptor internalTypeArgumentsFactory(Class nodeClass) {
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ModuleBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ModuleBinding.java
index ffadbaa53..4415e0ddd 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ModuleBinding.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ModuleBinding.java
@@ -89,7 +89,7 @@ class ModuleBinding implements IModuleBinding {
@Override
public String getName() {
if (this.name == null) {
- char[] tmp = this.binding.moduleName;
+ char[] tmp = this.binding.moduleName;
return tmp != null && tmp.length != 0 ? new String(tmp) : Util.EMPTY_STRING;
}
return this.name;
@@ -116,7 +116,7 @@ class ModuleBinding implements IModuleBinding {
// TODO Auto-generated method stub
// TODO Java 9 no reference seen in jvms draft - only in sotm
// check on version change and after compiler ast implements isSynthetic return this.binding.isSynthetic();
-
+
return false;
}
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NameEnvironmentWithProgress.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NameEnvironmentWithProgress.java
index 9b0e9a204..0a29d911e 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NameEnvironmentWithProgress.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NameEnvironmentWithProgress.java
@@ -31,7 +31,7 @@ import org.eclipse.jdt.internal.core.NameLookup;
*/
class NameEnvironmentWithProgress extends FileSystem implements INameEnvironmentWithProgress {
IProgressMonitor monitor;
-
+
public NameEnvironmentWithProgress(Classpath[] paths, String[] initialFileNames, IProgressMonitor monitor) {
super(paths, initialFileNames, false);
setMonitor(monitor);
@@ -90,7 +90,7 @@ class NameEnvironmentWithProgress extends FileSystem implements INameEnvironment
checkCanceled();
return super.isPackage(compoundName, packageName);
}
-
+
@Override
public void setMonitor(IProgressMonitor monitor) {
this.monitor = monitor;
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NameQualifiedType.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NameQualifiedType.java
index 1785f9e6f..0c4c29ee8 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NameQualifiedType.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NameQualifiedType.java
@@ -19,12 +19,12 @@ import java.util.List;
/**
* Node for a name-qualified type (added in JLS8 API).
- *
+ *
* <pre>
* NameQualifiedType:
* Name <b>.</b> { Annotation } SimpleName
* </pre>
- *
+ *
* <p>
* The qualifier can resolve to a type or to a package.
* </p>
@@ -36,7 +36,7 @@ import java.util.List;
*
* @see SimpleType
* @see QualifiedType
- *
+ *
* @since 3.10
* @noinstantiate This class is not intended to be instantiated by clients.
*/
@@ -53,13 +53,13 @@ public class NameQualifiedType extends AnnotatableType {
*/
public static final ChildListPropertyDescriptor ANNOTATIONS_PROPERTY =
internalAnnotationsPropertyFactory(NameQualifiedType.class);
-
+
/**
* The "name" structural property of this node type (child type: {@link SimpleName}).
*/
public static final ChildPropertyDescriptor NAME_PROPERTY =
new ChildPropertyDescriptor(NameQualifiedType.class, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$
-
+
/**
* A list of property descriptors (element type:
* {@link StructuralPropertyDescriptor}),
@@ -90,7 +90,7 @@ public class NameQualifiedType extends AnnotatableType {
}
/**
- * The qualifier node; lazily initialized; defaults to
+ * The qualifier node; lazily initialized; defaults to
* an unspecified, but legal, simple name.
*/
private Name qualifier = null;
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NodeFinder.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NodeFinder.java
index d5206d8e2..0028d3a2f 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NodeFinder.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NodeFinder.java
@@ -131,7 +131,7 @@ public final class NodeFinder {
/**
* Maps a selection to an ASTNode, where the selection is defined using a source range.
* Calls <code>perform(root, range.getOffset(), range.getLength())</code>.
- *
+ *
* @param root the root node from which the search starts
* @param range the selection range
* @return the innermost node that exactly matches the selection, or the first node that contains the selection
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/OpensDirective.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/OpensDirective.java
index bb69aaef9..d83fb0842 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/OpensDirective.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/OpensDirective.java
@@ -23,7 +23,7 @@ import java.util.List;
* </pre>
*
* @since 3.14
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
*/
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/PackageDeclaration.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/PackageDeclaration.java
index a21882c7d..44ab3860c 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/PackageDeclaration.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/PackageDeclaration.java
@@ -63,7 +63,7 @@ public class PackageDeclaration extends ASTNode {
public static final ChildListPropertyDescriptor MODIFIERS_PROPERTY =
new ChildListPropertyDescriptor(PackageDeclaration.class, "modifiers", IExtendedModifier.class, CYCLE_RISK); //$NON-NLS-1$
// SH}
-
+
/**
* A list of property descriptors (element type:
* {@link StructuralPropertyDescriptor}),
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/PrimitiveType.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/PrimitiveType.java
index 6450bf5c3..18ff64f9f 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/PrimitiveType.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/PrimitiveType.java
@@ -165,7 +165,7 @@ public class PrimitiveType extends AnnotatableType {
*/
public static final ChildListPropertyDescriptor ANNOTATIONS_PROPERTY =
internalAnnotationsPropertyFactory(PrimitiveType.class);
-
+
/**
* The "primitiveTypeCode" structural property of this node type (type: {@link PrimitiveType.Code}).
* @since 3.0
@@ -191,7 +191,7 @@ public class PrimitiveType extends AnnotatableType {
createPropertyList(PrimitiveType.class, propertyList);
addProperty(PRIMITIVE_TYPE_CODE_PROPERTY, propertyList);
PROPERTY_DESCRIPTORS = reapPropertyList(propertyList);
-
+
propertyList = new ArrayList(3);
createPropertyList(PrimitiveType.class, propertyList);
addProperty(ANNOTATIONS_PROPERTY, propertyList);
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ProvidesDirective.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ProvidesDirective.java
index 8cd255189..02d993a9b 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ProvidesDirective.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ProvidesDirective.java
@@ -23,7 +23,7 @@ import java.util.List;
* </pre>
*
* @since 3.14
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
*/
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/QualifiedType.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/QualifiedType.java
index b24cffef0..4d42ddc24 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/QualifiedType.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/QualifiedType.java
@@ -19,7 +19,7 @@ import java.util.List;
/**
* Type node for a qualified type (added in JLS3 API).
- *
+ *
* <pre>
* QualifiedType:
* Type <b>.</b> { Annotation } SimpleName
@@ -62,10 +62,10 @@ import java.util.List;
* same rules.
* </li>
* </ul>
- *
+ *
* @see SimpleType
* @see NameQualifiedType
- *
+ *
* @since 3.1
* @noinstantiate This class is not intended to be instantiated by clients.
*/
@@ -88,13 +88,13 @@ public class QualifiedType extends AnnotatableType {
*/
public static final ChildListPropertyDescriptor ANNOTATIONS_PROPERTY =
internalAnnotationsPropertyFactory(QualifiedType.class);
-
+
/**
* The "name" structural property of this node type (child type: {@link SimpleName}).
*/
public static final ChildPropertyDescriptor NAME_PROPERTY =
new ChildPropertyDescriptor(QualifiedType.class, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$
-
+
/**
* A list of property descriptors (element type:
* {@link StructuralPropertyDescriptor}),
@@ -115,7 +115,7 @@ public class QualifiedType extends AnnotatableType {
addProperty(QUALIFIER_PROPERTY, propertyList);
addProperty(NAME_PROPERTY, propertyList);
PROPERTY_DESCRIPTORS = reapPropertyList(propertyList);
-
+
propertyList = new ArrayList(4);
createPropertyList(QualifiedType.class, propertyList);
addProperty(QUALIFIER_PROPERTY, propertyList);
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecordDeclaration.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecordDeclaration.java
index 1ef06ce82..ca788347f 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecordDeclaration.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecordDeclaration.java
@@ -71,7 +71,7 @@ public class RecordDeclaration extends AbstractTypeDeclaration {
public static final ChildPropertyDescriptor NAME_PROPERTY =
internalNamePropertyFactory(RecordDeclaration.class);
-
+
/**
* The "superInterfaceTypes" structural property of this node type (element type: {@link Type}).
* @since 3.22
@@ -85,7 +85,7 @@ public class RecordDeclaration extends AbstractTypeDeclaration {
*/
public static final ChildListPropertyDescriptor TYPE_PARAMETERS_PROPERTY =
new ChildListPropertyDescriptor(RecordDeclaration.class, "typeParameters", TypeParameter.class, NO_CYCLE_RISK); //$NON-NLS-1$
-
+
/**
* The "recordComponents" structural property of this node type (element type: {@link SingleVariableDeclaration}).
* @since 3.22
@@ -99,7 +99,7 @@ public class RecordDeclaration extends AbstractTypeDeclaration {
*/
public static final ChildListPropertyDescriptor BODY_DECLARATIONS_PROPERTY =
internalBodyDeclarationPropertyFactory(RecordDeclaration.class);
-
+
/**
* A character index into the original restricted identifier source string,
@@ -195,7 +195,7 @@ public class RecordDeclaration extends AbstractTypeDeclaration {
* @since 3.22
*/
private ASTNode.NodeList superInterfaceTypes = new ASTNode.NodeList(SUPER_INTERFACE_TYPES_PROPERTY);
-
+
/**
* The parameters (element type: {@link SingleVariableDeclaration}).
* defaults to an empty list
@@ -203,7 +203,7 @@ public class RecordDeclaration extends AbstractTypeDeclaration {
* @since 3.22
*/
private ASTNode.NodeList recordComponents = new ASTNode.NodeList(RECORD_COMPONENTS_PROPERTY);
-
+
/**
* Creates a new AST node for a type declaration owned by the given
@@ -231,7 +231,7 @@ public class RecordDeclaration extends AbstractTypeDeclaration {
final List internalStructuralPropertiesForType(int apiLevel) {
return propertyDescriptors(apiLevel);
}
-
+
@Override
final List internalStructuralPropertiesForType(int apiLevel, boolean previewEnabled) {
return propertyDescriptors(apiLevel, previewEnabled);
@@ -373,7 +373,7 @@ public class RecordDeclaration extends AbstractTypeDeclaration {
public List superInterfaceTypes() {
return this.superInterfaceTypes;
}
-
+
/**
* Returns the live ordered list of recordComponents of record declaration.
*
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecoveredPackageBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecoveredPackageBinding.java
index 26bb449f8..5ed3ec7c1 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecoveredPackageBinding.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecoveredPackageBinding.java
@@ -37,7 +37,7 @@ class RecoveredPackageBinding implements IPackageBinding {
this.binding = binding;
this.resolver = resolver;
}
-
+
@Override
public IAnnotationBinding[] getAnnotations() {
return AnnotationBinding.NoAnnotations;
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecoveredTypeBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecoveredTypeBinding.java
index 550d7dcaa..29adfec8e 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecoveredTypeBinding.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecoveredTypeBinding.java
@@ -181,7 +181,7 @@ class RecoveredTypeBinding implements ITypeBinding {
}
return null;
}
-
+
@Override
public ITypeBinding getErasure() {
return this;
@@ -191,7 +191,7 @@ class RecoveredTypeBinding implements ITypeBinding {
public IMethodBinding getFunctionalInterfaceMethod() {
return null;
}
-
+
@Override
public ITypeBinding[] getInterfaces() {
return TypeBinding.NO_TYPE_BINDINGS;
@@ -410,7 +410,7 @@ class RecoveredTypeBinding implements ITypeBinding {
public boolean isEnum() {
return false;
}
-
+
@Override
public boolean isRecord() {
return false;
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SimpleType.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SimpleType.java
index f60a7367f..fdb2ee227 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SimpleType.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SimpleType.java
@@ -33,10 +33,10 @@ import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
* In JLS8 and later, the SimpleType may have optional annotations.
* If annotations are present, then the name must be a {@link SimpleName}.
* Annotated qualified names are represented as {@link QualifiedType} or {@link NameQualifiedType}.
- *
+ *
* @see QualifiedType
* @see NameQualifiedType
- *
+ *
* @since 2.0
* @noinstantiate This class is not intended to be instantiated by clients.
*/
@@ -49,7 +49,7 @@ public class SimpleType extends AnnotatableType {
*/
public static final ChildListPropertyDescriptor ANNOTATIONS_PROPERTY =
internalAnnotationsPropertyFactory(SimpleType.class);
-
+
/**
* The "name" structural property of this node type (child type: {@link Name}).
* @since 3.0
@@ -76,7 +76,7 @@ public class SimpleType extends AnnotatableType {
createPropertyList(SimpleType.class, propertyList);
addProperty(NAME_PROPERTY, propertyList);
PROPERTY_DESCRIPTORS = reapPropertyList(propertyList);
-
+
propertyList = new ArrayList(3);
createPropertyList(SimpleType.class, propertyList);
addProperty(ANNOTATIONS_PROPERTY, propertyList);
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SingleVariableDeclaration.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SingleVariableDeclaration.java
index b0450636f..4acedd041 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SingleVariableDeclaration.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SingleVariableDeclaration.java
@@ -206,7 +206,7 @@ public class SingleVariableDeclaration extends VariableDeclaration {
* The type annotations on the varargs token (element type: {@link Annotation}).
* Null before JLS8. Added in JLS8; defaults to an empty list
* (see constructor).
- *
+ *
* @since 3.10
*/
private ASTNode.NodeList varargsAnnotations = null;
@@ -221,7 +221,7 @@ public class SingleVariableDeclaration extends VariableDeclaration {
//{ObjectTeams: emulation for declared lifting:
private SingleVariableDeclaration fakedRoleVariable;
- public static final ChildPropertyDescriptor FAKED_ROLE_VARIABLE =
+ public static final ChildPropertyDescriptor FAKED_ROLE_VARIABLE =
new ChildPropertyDescriptor(SingleVariableDeclaration.class, "fakedRoleVariable", SingleVariableDeclaration.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$
SingleVariableDeclaration newFakedRoleVariable(LiftingType liftingType) {
@@ -287,7 +287,7 @@ public class SingleVariableDeclaration extends VariableDeclaration {
final ChildListPropertyDescriptor internalExtraDimensions2Property() {
return EXTRA_DIMENSIONS2_PROPERTY;
}
-
+
@Override
final ChildPropertyDescriptor internalInitializerProperty() {
return INITIALIZER_PROPERTY;
@@ -636,7 +636,7 @@ public class SingleVariableDeclaration extends VariableDeclaration {
*/
public List varargsAnnotations() {
if (this.varargsAnnotations == null) {
- unsupportedIn2_3_4();
+ unsupportedIn2_3_4();
}
return this.varargsAnnotations;
}
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SuperMethodReference.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SuperMethodReference.java
index 3f9808f34..3450deb86 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SuperMethodReference.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SuperMethodReference.java
@@ -18,14 +18,14 @@ import java.util.List;
/**
* Super method reference AST node type (added in JLS8 API).
- *
+ *
* <pre>
* SuperMethodReference:
* [ ClassName <b>.</b> ] <b>super</b> <b>::</b>
* [ <b>&lt;</b> Type { <b>,</b> Type } <b>&gt;</b> ]
* Identifier
* </pre>
- *
+ *
* @since 3.10
* @noinstantiate This class is not intended to be instantiated by clients
*/
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SwitchCase.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SwitchCase.java
index 52094dc6d..cfa1220eb 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SwitchCase.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SwitchCase.java
@@ -24,7 +24,7 @@ import java.util.List;
* SwitchCase:
* <b>case</b> Expression <b>:</b>
* <b>default</b> <b>:</b>
- *
+ *
* Switch case allows multiple expressions and '->' as part of Java 12 preview feature (JEP 325)
* <b>case</b> [ Expression { <b>,</b> Expression } ] <b>{ : | ->}</b>
* <b>default</b> <b>{ : | ->}</b>
@@ -51,7 +51,7 @@ public class SwitchCase extends Statement {
*/
public static final ChildListPropertyDescriptor EXPRESSIONS2_PROPERTY =
new ChildListPropertyDescriptor(SwitchCase.class, "expression", Expression.class, CYCLE_RISK); //$NON-NLS-1$);
-
+
/**
* The "switchLabeledRule" structural property of this node type (type: {@link Boolean}).
* @noreference This property is not intended to be referenced by clients as it is a part of Java preview feature.
@@ -59,14 +59,14 @@ public class SwitchCase extends Statement {
*/
public static final SimplePropertyDescriptor SWITCH_LABELED_RULE_PROPERTY =
new SimplePropertyDescriptor(SwitchCase.class, "switchLabeledRule", boolean.class, MANDATORY); //$NON-NLS-1$
-
+
/**
* A list of property descriptors (element type:
* {@link StructuralPropertyDescriptor}),
* or null if uninitialized.
*/
private static final List PROPERTY_DESCRIPTORS;
-
+
/**
* A list of property descriptors (element type:
* {@link StructuralPropertyDescriptor}),
@@ -79,7 +79,7 @@ public class SwitchCase extends Statement {
createPropertyList(SwitchCase.class, propertyList);
addProperty(EXPRESSION_PROPERTY, propertyList);
PROPERTY_DESCRIPTORS = reapPropertyList(propertyList);
-
+
propertyList = new ArrayList(2);
createPropertyList(SwitchCase.class, propertyList);
addProperty(EXPRESSIONS2_PROPERTY , propertyList);
@@ -110,15 +110,15 @@ public class SwitchCase extends Statement {
* @see #expressionInitialized
*/
private Expression optionalExpression = null;
-
+
/**
* <code>true</code> indicates "->" and <code>false</code> indicates ":".
*/
private boolean switchLabeledRule = false;
-
+
/**
- * The expression list; <code>empty</code> for none;
+ * The expression list; <code>empty</code> for none;
*/
private ASTNode.NodeList expressions = null;
@@ -182,7 +182,7 @@ public class SwitchCase extends Statement {
// allow default implementation to flag the error
return super.internalGetChildListProperty(property);
}
-
+
@Override
final int getNodeType0() {
return SWITCH_CASE;
@@ -244,7 +244,7 @@ public class SwitchCase extends Statement {
}
return this.optionalExpression;
}
-
+
/**
* Returns the list of expressions of this switch case, or
* <code>empty</code> if there is none (the "default:" case).
@@ -283,7 +283,7 @@ public class SwitchCase extends Statement {
this.expressionInitialized = true;
postReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
}
-
+
/**
* Sets the switchLabeledRule of this switch case as <code>true</code> or <code>false</code>.
* <code>true</code> indicates "->" and <code>false</code> indicates ":".
@@ -298,7 +298,7 @@ public class SwitchCase extends Statement {
this.switchLabeledRule = switchLabeledRule;
postValueChange(SWITCH_LABELED_RULE_PROPERTY);
}
-
+
/**
* Gets the switchLabeledRule of this switch case as <code>true</code> or <code>false</code>.
*<code>true</code> indicates "->" and <code>false</code> indicates ":".
@@ -340,6 +340,6 @@ public class SwitchCase extends Statement {
memSize()
+ (this.optionalExpression == null ? 0 : this.optionalExpression.treeSize());
}
-
+
}
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SwitchExpression.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SwitchExpression.java
index 3345546f2..dca6c0d8a 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SwitchExpression.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SwitchExpression.java
@@ -77,7 +77,7 @@ public class SwitchExpression extends Expression {
public static List propertyDescriptors(int apiLevel) {
return PROPERTY_DESCRIPTORS;
}
-
+
/**
* The expression; lazily initialized; defaults to a unspecified, but legal,
* expression.
@@ -112,7 +112,7 @@ public class SwitchExpression extends Expression {
final List internalStructuralPropertiesForType(int apiLevel) {
return propertyDescriptors(apiLevel);
}
-
+
@Override
final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) {
if (property == EXPRESSION_PROPERTY) {
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TSuperConstructorInvocation.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TSuperConstructorInvocation.java
index e268d85a2..742935d89 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TSuperConstructorInvocation.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TSuperConstructorInvocation.java
@@ -102,7 +102,7 @@ public class TSuperConstructorInvocation extends Statement implements Invocation
{
super(ast);
}
-
+
@Override
public ChildListPropertyDescriptor getArgumentsProperty() {
return ARGUMENTS_PROPERTY;
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TagElement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TagElement.java
index 544569fb4..10aa5e760 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TagElement.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TagElement.java
@@ -112,7 +112,7 @@ public final class TagElement extends ASTNode implements IDocElement {
* Standard doc tag name (value {@value}).
*/
public static final String TAG_EXCEPTION = "@exception"; //$NON-NLS-1$
-
+
/**
* Standard doc tag name (value {@value}).
* @since 3.18
@@ -124,7 +124,7 @@ public final class TagElement extends ASTNode implements IDocElement {
* @since 3.18
*/
public static final String TAG_INDEX = "@index"; //$NON-NLS-1$
-
+
/**
* Standard inline doc tag name (value {@value}).
*/
@@ -159,7 +159,7 @@ public final class TagElement extends ASTNode implements IDocElement {
* @since 3.18
*/
public static final String TAG_PROVIDES = "@provides"; //$NON-NLS-1$
-
+
/**
* Standard doc tag name (value {@value}).
*/
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TextBlock.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TextBlock.java
index 85d87c18e..77d11c8a9 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TextBlock.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TextBlock.java
@@ -26,7 +26,7 @@ import org.eclipse.jdt.internal.compiler.parser.TerminalTokens;
/**
* TextBolck AST node type.
*
- * These are block of String literal nodes.
+ * These are block of String literal nodes.
*
* @since 3.20
* @noinstantiate This class is not intended to be instantiated by clients.
@@ -116,7 +116,7 @@ public class TextBlock extends Expression {
final List internalStructuralPropertiesForType(int apiLevel) {
return propertyDescriptors(apiLevel);
}
-
+
@Override
final List internalStructuralPropertiesForType(int apiLevel, boolean previewEnabled) {
return propertyDescriptors(apiLevel, previewEnabled);
@@ -246,7 +246,7 @@ public class TextBlock extends Expression {
if (len < 7) {
throw new IllegalArgumentException();
}
-
+
int start = -1;
loop: for (int i = 3; i < len; i++) {
char c = escaped[i];
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TryStatement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TryStatement.java
index a21679da5..90d5535ff 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TryStatement.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TryStatement.java
@@ -30,9 +30,9 @@ import java.util.List;
* <p>
* Not all node arrangements will represent legal Java constructs. In particular,
* at least one resource, catch clause, or finally block must be present.</p>
- *
+ *
* <p>A resource is either a {@link VariableDeclarationExpression} or (since JLS9) a {@link Name}.</p>
- *
+ *
* @since 2.0
* @noinstantiate This class is not intended to be instantiated by clients.
* @noextend This class is not intended to be subclassed by clients.
@@ -40,7 +40,7 @@ import java.util.List;
@SuppressWarnings({"rawtypes", "unchecked"})
public class TryStatement extends Statement {
-
+
/**
* The "resources" structural property of this node type (element type: {@link VariableDeclarationExpression}) (added in JLS4 API).
* @deprecated In the JLS9 API, this property is replaced by {@link #RESOURCES2_PROPERTY}.
@@ -83,7 +83,7 @@ public class TryStatement extends Statement {
* or null if uninitialized.
*/
private static final List PROPERTY_DESCRIPTORS;
-
+
/**
* A list of property descriptors (element type:
* {@link StructuralPropertyDescriptor}),
@@ -360,7 +360,7 @@ public class TryStatement extends Statement {
/**
* Returns the live ordered list of resources for this try statement (added in JLS4 API).
- *
+ *
* <p>A resource is either a {@link VariableDeclarationExpression} or (since JLS9) a {@link Name}.</p>
*
* @return the live list of resources (element type: {@link Expression}).
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Type.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Type.java
index a5637bed8..85ea4ea7f 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Type.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Type.java
@@ -36,7 +36,7 @@ package org.eclipse.jdt.core.dom;
* ParameterizedType
* UnionType
* IntersectionType
- *
+ *
* {@link PrimitiveType}:
* { Annotation } <b>byte</b>
* { Annotation } <b>short</b>
@@ -68,7 +68,7 @@ package org.eclipse.jdt.core.dom;
* @since 2.0
*/
public abstract class Type extends ASTNode {
-
+
/**
* Creates a new AST node for a type owned by the given AST.
* <p>
@@ -218,14 +218,14 @@ public abstract class Type extends ASTNode {
public final boolean isWildcardType() {
return (this instanceof WildcardType);
}
-
+
/**
* Returns whether this type can be annotated. All sub-classes of
* {@link AnnotatableType} can be annotated.
*
* @return <code>true</code> if this type is an instance of {@link AnnotatableType}, and
* <code>false</code> otherwise
- *
+ *
* @since 3.10
*/
public boolean isAnnotatable() {
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeBinding.java
index ba8099442..1ee31ce6a 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeBinding.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeBinding.java
@@ -245,7 +245,7 @@ class TypeBinding implements ITypeBinding {
}
return null;
}
-
+
@Override
public ITypeBinding getGenericTypeOfWildcardType() {
switch (this.binding.kind()) {
@@ -258,7 +258,7 @@ class TypeBinding implements ITypeBinding {
}
return null;
}
-
+
@Override
public int getRank() {
switch (this.binding.kind()) {
@@ -270,7 +270,7 @@ class TypeBinding implements ITypeBinding {
return -1;
}
}
-
+
@Override
public ITypeBinding getComponentType() {
if (!isArray()) {
@@ -538,12 +538,12 @@ class TypeBinding implements ITypeBinding {
return this.resolver.getTypeBinding(((ParameterizedTypeBinding)this.binding).genericType());
return this.resolver.getTypeBinding(this.binding.unannotated());
}
-
+
@Override
public ITypeBinding getErasure() {
return this.resolver.getTypeBinding(this.binding.erasure());
}
-
+
@Override
public IMethodBinding getFunctionalInterfaceMethod() {
Scope scope = this.resolver.scope();
@@ -646,7 +646,7 @@ class TypeBinding implements ITypeBinding {
return this.interfaces = NO_TYPE_BINDINGS;
//{ObjectTeams: conclude try-with-resources from above
}
-// SH}
+// SH}
}
private ITypeBinding[] getIntersectingTypes() {
@@ -1186,7 +1186,7 @@ class TypeBinding implements ITypeBinding {
@Override
public boolean isAssignmentCompatible(ITypeBinding type) {
-//{ObjectTeams: prepare for calling into the compiler (isCompatibleWith(..))
+//{ObjectTeams: prepare for calling into the compiler (isCompatibleWith(..))
// save and reset flags:
Config oldConfig = Config.createOrResetConfig(this);
// orig:
@@ -1255,7 +1255,7 @@ class TypeBinding implements ITypeBinding {
public boolean isEnum() {
return this.binding.isEnum();
}
-
+
@Override
public boolean isRecord() {
return this.binding.isRecord();
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeDeclaration.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeDeclaration.java
index 8cb24af82..10886f1a7 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeDeclaration.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeDeclaration.java
@@ -23,7 +23,7 @@ import java.util.List;
/**
* Type declaration AST node type. A type declaration
* is the union of a class declaration and an interface declaration.
- *
+ *
* <pre>
* TypeDeclaration:
* ClassDeclaration
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeMethodReference.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeMethodReference.java
index 8ae7f515e..edd1efdc8 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeMethodReference.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeMethodReference.java
@@ -20,7 +20,7 @@ import java.util.List;
* Type method reference expression AST node type (added in JLS8 API).
* <pre>
* TypeMethodReference:
- * Type <b>::</b>
+ * Type <b>::</b>
* [ <b>&lt;</b> Type { <b>,</b> Type } <b>&gt;</b> ]
* Identifier
* </pre>
@@ -54,7 +54,7 @@ public class TypeMethodReference extends MethodReference {
* or null if uninitialized.
*/
private static final List PROPERTY_DESCRIPTORS_8_0;
-
+
static {
List propertyList = new ArrayList(4);
createPropertyList(TypeMethodReference.class, propertyList);
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeParameter.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeParameter.java
index c2a0e1991..d58acd415 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeParameter.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeParameter.java
@@ -20,7 +20,7 @@ import java.util.List;
/**
* Type parameter declaration node (added in JLS3 API).
- *
+ *
* <pre>
* TypeParameter:
* { ExtendedModifier } Identifier [ <b>extends</b> Type { <b>&amp;</b> Type } ]
@@ -38,7 +38,7 @@ public class TypeParameter extends ASTNode {
*/
public static final ChildListPropertyDescriptor MODIFIERS_PROPERTY =
new ChildListPropertyDescriptor(TypeParameter.class, "modifiers", IExtendedModifier.class, CYCLE_RISK); //$NON-NLS-1$
-
+
/**
* The "name" structural property of this node type (child type: {@link SimpleName}).
*/
@@ -81,7 +81,7 @@ public class TypeParameter extends ASTNode {
addProperty(VALUE_PARAMETER_PROPERTY, propertyList);
// SH}
PROPERTY_DESCRIPTORS = reapPropertyList(propertyList);
-
+
propertyList = new ArrayList(4);
createPropertyList(TypeParameter.class, propertyList);
addProperty(MODIFIERS_PROPERTY, propertyList);
@@ -138,7 +138,7 @@ public class TypeParameter extends ASTNode {
* (see constructor).
*/
private ASTNode.NodeList modifiers = null;
-
+
/**
* Creates a new unparented node for a parameterized type owned by the
* given AST. By default, an unspecified, but legal, type variable name,
@@ -312,7 +312,7 @@ public class TypeParameter extends ASTNode {
public List typeBounds() {
return this.typeBounds;
}
-
+
/**
* Returns the live ordered list of modifiers for this TypeParameter node (added in JLS8 API).
*
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/UnionType.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/UnionType.java
index 77de29cce..5d365bb22 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/UnionType.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/UnionType.java
@@ -74,7 +74,7 @@ public class UnionType extends Type {
/**
* Creates a new unparented node for an union type owned by the given AST.
* By default, it has no types.<p>
- *
+ *
* N.B. This constructor is package-private.
* </p>
*
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableBinding.java
index f2bc37e66..919dc28c8 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableBinding.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableBinding.java
@@ -336,7 +336,7 @@ class VariableBinding implements IVariableBinding {
return ((LiftingTypeReference)decl.type).fakedArgument.binding.id;
}
}
- return getVariableId();
+ return getVariableId();
}
// SH}
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableDeclaration.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableDeclaration.java
index dc4ff57f0..bdf87c44a 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableDeclaration.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableDeclaration.java
@@ -51,7 +51,7 @@ public abstract class VariableDeclaration extends ASTNode {
* (element type: {@link Dimension}).
* Null before JLS8. Added in JLS8; defaults to an empty list
* (see constructor).
- *
+ *
* @since 3.10
*/
ASTNode.NodeList extraDimensions = null;
@@ -82,7 +82,7 @@ public abstract class VariableDeclaration extends ASTNode {
static final SimplePropertyDescriptor internalExtraDimensionsPropertyFactory(Class nodeClass) {
return new SimplePropertyDescriptor(nodeClass, "extraDimensions", int.class, MANDATORY); //$NON-NLS-1$
}
-
+
/**
* Creates and returns a structural property descriptor for the
* "extraDimensions2" property declared on the given concrete node type (element type: {@link Dimension}).
@@ -92,7 +92,7 @@ public abstract class VariableDeclaration extends ASTNode {
static final ChildListPropertyDescriptor internalExtraDimensions2PropertyFactory(Class nodeClass) {
return new ChildListPropertyDescriptor(nodeClass, "extraDimensions2", Dimension.class, CYCLE_RISK); //$NON-NLS-1$
}
-
+
/**
* Creates and returns a structural property descriptor for the
* "initializer" property declared on the given concrete node type (child type: {@link Expression}).
@@ -123,7 +123,7 @@ public abstract class VariableDeclaration extends ASTNode {
return internalNameProperty();
}
-
+
/**
* Returns the structural property descriptor for the "extraDimensions" property
* of this node (type: {@link Integer}) (below JLS8 only).
@@ -154,7 +154,7 @@ public abstract class VariableDeclaration extends ASTNode {
* @since 3.10
*/
abstract ChildListPropertyDescriptor internalExtraDimensions2Property();
-
+
/**
* Returns the structural property descriptor for the "extraDimensions" property
* of this node (element type: {@link Dimension}) (added in JLS8 API).
@@ -165,7 +165,7 @@ public abstract class VariableDeclaration extends ASTNode {
public final ChildListPropertyDescriptor getExtraDimensions2Property() {
return internalExtraDimensions2Property();
}
-
+
/**
* Returns structural property descriptor for the "initializer" property
* of this node (child type: {@link Expression}).
@@ -287,7 +287,7 @@ public abstract class VariableDeclaration extends ASTNode {
* @exception IllegalArgumentException if the number of dimensions is
* negative
* @exception UnsupportedOperationException if this operation is used in
- * a JLS8 or later AST
+ * a JLS8 or later AST
* @deprecated In the JLS8 API, this method is replaced by
* {@link #extraDimensions()} which contains a list of {@link Dimension} nodes.
* @since 2.1
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableDeclarationFragment.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableDeclarationFragment.java
index 909915c87..b923cbed4 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableDeclarationFragment.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableDeclarationFragment.java
@@ -143,7 +143,7 @@ public class VariableDeclarationFragment extends VariableDeclaration {
final ChildListPropertyDescriptor internalExtraDimensions2Property() {
return EXTRA_DIMENSIONS2_PROPERTY;
}
-
+
@Override
final ChildPropertyDescriptor internalInitializerProperty() {
return INITIALIZER_PROPERTY;
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/WildcardType.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/WildcardType.java
index 7af7d1aad..2627070f0 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/WildcardType.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/WildcardType.java
@@ -41,7 +41,7 @@ public class WildcardType extends AnnotatableType {
*/
public static final ChildListPropertyDescriptor ANNOTATIONS_PROPERTY =
internalAnnotationsPropertyFactory(WildcardType.class);
-
+
/**
* The "bound" structural property of this node type (child type: {@link Type}).
*/
@@ -74,7 +74,7 @@ public class WildcardType extends AnnotatableType {
addProperty(BOUND_PROPERTY, propertyList);
addProperty(UPPER_BOUND_PROPERTY, propertyList);
PROPERTY_DESCRIPTORS = reapPropertyList(propertyList);
-
+
propertyList = new ArrayList(4);
createPropertyList(WildcardType.class, propertyList);
addProperty(ANNOTATIONS_PROPERTY, propertyList);
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/YieldStatement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/YieldStatement.java
index abf924f64..9ab51ff2c 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/YieldStatement.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/YieldStatement.java
@@ -47,7 +47,7 @@ public class YieldStatement extends Statement {
* <code>true</code> indicates implicit and <code>false</code> indicates not implicit.
*/
private boolean isImplicit = false;
-
+
static {
List properyList = new ArrayList(2);
createPropertyList(YieldStatement.class, properyList);
@@ -99,7 +99,7 @@ public class YieldStatement extends Statement {
final List internalStructuralPropertiesForType(int apiLevel, boolean previewEnabled) {
return propertyDescriptors(apiLevel);
}
-
+
@Override
final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) {
if (property == EXPRESSION_PROPERTY) {
@@ -142,11 +142,11 @@ public class YieldStatement extends Statement {
if (visitChildren) {
if (this.ast.apiLevel >= AST.JLS13_INTERNAL) {
acceptChild(visitor, getExpression());
- }
+ }
}
visitor.endVisit(this);
}
-
+
/**
* Returns the expression of this Yield statement, or <code>null</code> if
* there is none.
@@ -206,7 +206,7 @@ public class YieldStatement extends Statement {
this.isImplicit = isImplicit;
}
-
+
@Override
int memSize() {
return super.memSize() + 2 * 4;
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ASTRewrite.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ASTRewrite.java
index 556c906d3..36279d178 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ASTRewrite.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ASTRewrite.java
@@ -119,7 +119,7 @@ public class ASTRewrite {
* @since 3.1
*/
private TargetSourceRangeComputer targetSourceRangeComputer = null;
-
+
/**
* Primary field used in representing rewrite properties efficiently.
* If <code>null</code>, this rewrite has no properties.
@@ -128,7 +128,7 @@ public class ASTRewrite {
* If a {@link Map}, this is the table of property name-value
* mappings.
* Initially <code>null</code>.
- *
+ *
* @see #property2
*/
private Object property1 = null;
@@ -564,7 +564,7 @@ public class ASTRewrite {
Map m = (Map) this.property1;
return m.get(propertyName);
}
-
+
/**
* Returns an object that tracks the source range of the given node
* across the rewrite to its AST. Upon return, the result object reflects
@@ -624,14 +624,14 @@ public class ASTRewrite {
if (!RewriteEventStore.DEBUG) {
return;
}
-
+
if (value == null) {
if (prop.isSimpleProperty() && ((SimplePropertyDescriptor) prop).isMandatory()
|| prop.isChildProperty() && ((ChildPropertyDescriptor) prop).isMandatory()) {
String message = "Can not remove property " + prop.getId(); //$NON-NLS-1$
throw new IllegalArgumentException(message);
}
-
+
} else {
Class valueType;
if (prop.isSimpleProperty()) {
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ImportRewrite.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ImportRewrite.java
index a5d03d1dc..886077af6 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ImportRewrite.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ImportRewrite.java
@@ -109,7 +109,7 @@ import org.eclipse.text.edits.TextEdit;
public final class ImportRewrite {
/**
* Used to determine how a type will be used, so that unwanted annotations can be filtered,
- * which is in particular relevant for avoiding redundant null annotations in the scope of {@code @NonNullByDefault}.
+ * which is in particular relevant for avoiding redundant null annotations in the scope of {@code @NonNullByDefault}.
* This enum is a superset of org.eclipse.jdt.annotation.DefaultLocation, and roughly corresponds
* to the classification of type locations as introduced by JSR 308.
*
@@ -118,49 +118,49 @@ public final class ImportRewrite {
public enum TypeLocation {
/**
* see org.eclipse.jdt.annotation.DefaultLocation.PARAMETER
- *
+ *
* @since 3.13
*/
PARAMETER,
/**
* see org.eclipse.jdt.annotation.DefaultLocation.RETURN_TYPE
- *
+ *
* @since 3.13
*/
RETURN_TYPE,
/**
* see org.eclipse.jdt.annotation.DefaultLocation.FIELD
- *
+ *
* @since 3.13
*/
FIELD,
/**
* see org.eclipse.jdt.annotation.DefaultLocation.TYPE_PARAMETER
- *
+ *
* @since 3.13
*/
TYPE_PARAMETER,
/**
* see org.eclipse.jdt.annotation.DefaultLocation.TYPE_BOUND
- *
+ *
* @since 3.13
*/
TYPE_BOUND,
/**
* see org.eclipse.jdt.annotation.DefaultLocation.TYPE_ARGUMENT
- *
+ *
* @since 3.13
*/
TYPE_ARGUMENT,
/**
* see org.eclipse.jdt.annotation.DefaultLocation.ARRAY_CONTENTS
- *
+ *
* @since 3.13
*/
ARRAY_CONTENTS,
@@ -169,7 +169,7 @@ public final class ImportRewrite {
* The special value {@link #LOCAL_VARIABLE} is used for local variables: their nullness is determines by flow analysis,
* so top level nullness annotations are usually not needed for local variables (unless their type is a free
* type variable). Does not correspond to a value in org.eclipse.jdt.annotation.DefaultLocation.
- *
+ *
* @since 3.13
*/
LOCAL_VARIABLE,
@@ -178,25 +178,25 @@ public final class ImportRewrite {
* The special value {@link #CAST} is used for casts.
* Casts are never affected by {@code @NonNullByDefault}
* Does not correspond to a value in org.eclipse.jdt.annotation.DefaultLocation.
- *
+ *
* @since 3.13
*/
CAST,
-
+
/**
* The special value {@link #INSTANCEOF} is used for {@code instanceof} expressions.
* Null annotations are not supported in this location.
* Does not correspond to a value in org.eclipse.jdt.annotation.DefaultLocation.
- *
+ *
* @since 3.13
*/
INSTANCEOF,
/**
- * The special value {@link #NEW} is used for {@code new} expressions (object allocations).
+ * The special value {@link #NEW} is used for {@code new} expressions (object allocations).
* Null annotations are not supported in this location.
* Does not correspond to a value in org.eclipse.jdt.annotation.DefaultLocation.
- *
+ *
* @since 3.13
*/
NEW,
@@ -205,7 +205,7 @@ public final class ImportRewrite {
* The special value {@link #RECEIVER} is used for the receiver type in a method declaration or method reference.
* Null annotations are not supported in this location.
* Does not correspond to a value in org.eclipse.jdt.annotation.DefaultLocation.
- *
+ *
* @since 3.13
*/
RECEIVER,
@@ -213,7 +213,7 @@ public final class ImportRewrite {
/**
* The special value {@link #EXCEPTION} is used for exception types in catch and throws declarations, which are
* implicitly non-null. Does not correspond to a value in org.eclipse.jdt.annotation.DefaultLocation.
- *
+ *
* @since 3.13
*/
EXCEPTION,
@@ -222,7 +222,7 @@ public final class ImportRewrite {
* The special value {@link #OTHER} is used for locations where type annotations are illegal, like type literals
* (X.class), annotations, or as scope for static field accesses. Does not correspond to a value in
* org.eclipse.jdt.annotation.DefaultLocation.
- *
+ *
* @since 3.13
*/
OTHER,
@@ -230,7 +230,7 @@ public final class ImportRewrite {
/**
* The special value {@link #UNKNOWN} is used for invocations that don't specify the intended type usage. Does not
* correspond to a value in org.eclipse.jdt.annotation.DefaultLocation.
- *
+ *
* @since 3.13
*/
UNKNOWN,
@@ -479,7 +479,7 @@ public final class ImportRewrite {
this.importOrder= CharOperation.NO_STRINGS;
this.importOnDemandThreshold= 99;
this.staticImportOnDemandThreshold= 99;
-
+
this.importsKindMap = new HashMap();
}
@@ -557,10 +557,10 @@ public final class ImportRewrite {
* Note: {@link #setUseContextToFilterImplicitImports(boolean)} can be used to filter implicit imports
* when a context is used.
* </p>
- *
+ *
* @param filterImplicitImports
* if <code>true</code>, implicit imports will be filtered
- *
+ *
* @see #setUseContextToFilterImplicitImports(boolean)
*/
public void setFilterImplicitImports(boolean filterImplicitImports) {
@@ -577,16 +577,16 @@ public final class ImportRewrite {
* whether an import can be filtered because the type is implicitly visible. Note that too many imports
* may be kept if this option is set and <code>addImport*(...)</code> methods are called without a context.
* </p>
- *
+ *
* @param useContextToFilterImplicitImports the given setting
- *
+ *
* @see #setFilterImplicitImports(boolean)
* @since 3.6
*/
public void setUseContextToFilterImplicitImports(boolean useContextToFilterImplicitImports) {
this.useContextToFilterImplicitImports = useContextToFilterImplicitImports;
}
-
+
private static int compareImport(char prefix, String qualifier, String name, String curr) {
if (curr.charAt(0) != prefix || !curr.endsWith(name)) {
return ImportRewriteContext.RES_NAME_UNKNOWN;
@@ -645,14 +645,14 @@ public final class ImportRewrite {
|| mainTypeName.equals(Util.concatenateName(qualifier, name, '.'))) {
return ImportRewriteContext.RES_NAME_FOUND;
}
-
+
if (this.astRoot != null) {
List<AbstractTypeDeclaration> types = this.astRoot.types();
int nTypes = types.size();
for (int i = 0; i < nTypes; i++) {
AbstractTypeDeclaration type = types.get(i);
SimpleName simpleName = type.getName();
- if (simpleName.getIdentifier().equals(name)) {
+ if (simpleName.getIdentifier().equals(name)) {
return qualifier.equals(packageName)
? ImportRewriteContext.RES_NAME_FOUND
: ImportRewriteContext.RES_NAME_CONFLICT;
@@ -697,7 +697,7 @@ public final class ImportRewrite {
* to use the default context (only using the available imports)
* @return an annotation node. The returned annotation contains unqualified type names where
* an import could be added or was already known. Type names are fully qualified if an import conflict prevented an import.
- *
+ *
* @since 3.10
*/
public Annotation addAnnotation(IAnnotationBinding annotation, AST ast, ImportRewriteContext context) {
@@ -989,7 +989,7 @@ public final class ImportRewrite {
* in the code. The type binding can be an array binding, type variable or wildcard.
* If the binding is a generic type, the type parameters are ignored. For parameterized types, also the type
* arguments are processed and imports added if necessary. Anonymous types inside type arguments are normalized to their base type, wildcard
- * of wildcards are ignored. If type annotations or type arguments are present at any point, the import is added up to that point and
+ * of wildcards are ignored. If type annotations or type arguments are present at any point, the import is added up to that point and
* the type is retained from that point with type annotations and type arguments.
* <p>
* No imports are added for types that are already known. If a import for a type is recorded to be removed, this record is discarded instead.
@@ -1012,7 +1012,7 @@ public final class ImportRewrite {
* in the code. The type binding can be an array binding, type variable or wildcard.
* If the binding is a generic type, the type parameters are ignored. For parameterized types, also the type
* arguments are processed and imports added if necessary. Anonymous types inside type arguments are normalized to their base type, wildcard
- * of wildcards are ignored. If type annotations or type arguments are present at any point, the import is added up to that point and
+ * of wildcards are ignored. If type annotations or type arguments are present at any point, the import is added up to that point and
* the type is retained from that point with type annotations and type arguments
* <p>
* No imports are added for types that are already known. If a import for a type is recorded to be removed, this record is discarded instead.
@@ -1037,7 +1037,7 @@ public final class ImportRewrite {
* in the code. The type binding can be an array binding, type variable or wildcard.
* If the binding is a generic type, the type parameters are ignored. For parameterized types, also the type
* arguments are processed and imports added if necessary. Anonymous types inside type arguments are normalized to their base type, wildcard
- * of wildcards are ignored. If type annotations or type arguments are present at any point, the import is added up to that point and
+ * of wildcards are ignored. If type annotations or type arguments are present at any point, the import is added up to that point and
* the type is retained from that point with type annotations and type arguments
* <p>
* No imports are added for types that are already known. If a import for a type is recorded to be removed, this record is discarded instead.
@@ -1055,7 +1055,7 @@ public final class ImportRewrite {
* or else qualified names if an import conflict prevented an import.
* @since 3.13
*/
- public Type addImport(ITypeBinding binding, AST ast, ImportRewriteContext context, TypeLocation location) {
+ public Type addImport(ITypeBinding binding, AST ast, ImportRewriteContext context, TypeLocation location) {
ITypeBinding bindingPoint = checkAnnotationAndGenerics(binding);
Type type = internalAddImport(bindingPoint == null ? binding : bindingPoint, ast, context, null, /* getBase */ true, bindingPoint != null && !bindingPoint.equals(binding) ? TypeLocation.OTHER : location);
if (bindingPoint != null && !bindingPoint.equals(binding)) {
@@ -1335,7 +1335,7 @@ public final class ImportRewrite {
* @since 3.9
*/
public boolean removeImportBase(String qualifiedName) {
- return removeEntry(BASE_PREFIX + qualifiedName);
+ return removeEntry(BASE_PREFIX + qualifiedName);
}
// SH}
@@ -1399,7 +1399,7 @@ public final class ImportRewrite {
computer.addImport(isStatic, isBase, qualifiedName);
// SH}
}
-
+
for (String removedImport : this.removedImports) {
boolean isStatic = STATIC_PREFIX == removedImport.charAt(0);
String qualifiedName = removedImport.substring(1);
@@ -1634,7 +1634,7 @@ public final class ImportRewrite {
String qualifiedName= getRawQualifiedName(normalizedBinding);
String res = qualifiedName.length() > 0 ? internalAddImport(qualifiedName, context) : getRawName(normalizedBinding);
-
+
if (annotsPresent) {
int dotIndex = res != null ? res.lastIndexOf('.') : -1;
if (dotIndex > 0) {
@@ -1693,7 +1693,7 @@ public final class ImportRewrite {
// SH}
Type type = null;
ITypeBinding normalizedBinding = null;
-
+
if (binding.isPrimitive()) {
type = ast.newPrimitiveType(PrimitiveType.toCode(binding.getName()));
normalizedBinding= binding;
@@ -1725,7 +1725,7 @@ public final class ImportRewrite {
if (getBase) {
type = createBaseType(ast, context, normalizedBinding, location);
} else {
- type = currentType != null ? (Type) ast.newQualifiedType(currentType, ast.newSimpleName(getRawName(normalizedBinding))) :
+ type = currentType != null ? (Type) ast.newQualifiedType(currentType, ast.newSimpleName(getRawName(normalizedBinding))) :
ast.newSimpleType(ast.newName(getRawName(normalizedBinding)));
type = annotateType(normalizedBinding, ast, context, type, location);
}
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/NaiveASTFlattener.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/NaiveASTFlattener.java
index 32761d096..ca5395a56 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/NaiveASTFlattener.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/NaiveASTFlattener.java
@@ -52,7 +52,7 @@ public class NaiveASTFlattener extends ASTVisitor {
* @since 3.4
*/
private static final int JLS2 = AST.JLS2;
-
+
/**
* Internal synonym for {@link AST#JLS3}. Use to alleviate
* deprecation warnings.
@@ -84,7 +84,7 @@ public class NaiveASTFlattener extends ASTVisitor {
* @since 3.14
*/
private static final int JLS9 = AST.JLS9;
-
+
/**
* The string buffer into which the serialized representation of the AST is
* written.
@@ -254,7 +254,7 @@ public class NaiveASTFlattener extends ASTVisitor {
this.buffer.append('>');
}
}
-
+
private void visitTypeAnnotations(AnnotatableType node) {
if (node.getAST().apiLevel() >= JLS8) {
visitAnnotationsList(node.annotations());
@@ -268,7 +268,7 @@ public class NaiveASTFlattener extends ASTVisitor {
this.buffer.append(' ');
}
}
-
+
/**
* Resets this printer so that it can be used again.
*/
@@ -598,7 +598,7 @@ public class NaiveASTFlattener extends ASTVisitor {
this.buffer.append(";\n");//$NON-NLS-1$
return false;
}
-
+
@Override
public boolean visit(CreationReference node) {
node.getType().accept(this);
@@ -1044,11 +1044,11 @@ public class NaiveASTFlattener extends ASTVisitor {
if (it.hasNext()) {
this.buffer.append(", ");//$NON-NLS-1$
}
- }
+ }
this.buffer.append(" ");//$NON-NLS-1$
- }
+ }
} else {
- if (!node.thrownExceptionTypes().isEmpty()) {
+ if (!node.thrownExceptionTypes().isEmpty()) {
this.buffer.append(" throws ");//$NON-NLS-1$
for (Iterator it = node.thrownExceptionTypes().iterator(); it.hasNext(); ) {
Type n = (Type) it.next();
@@ -1056,8 +1056,8 @@ public class NaiveASTFlattener extends ASTVisitor {
if (it.hasNext()) {
this.buffer.append(", ");//$NON-NLS-1$
}
- }
- this.buffer.append(" ");//$NON-NLS-1$
+ }
+ this.buffer.append(" ");//$NON-NLS-1$
}
}
if (node.getBody() == null) {
@@ -1329,7 +1329,7 @@ public class NaiveASTFlattener extends ASTVisitor {
this.buffer.append("record ");//$NON-NLS-1$
node.getName().accept(this);
this.buffer.append(" ");//$NON-NLS-1$
-
+
if (!node.typeParameters().isEmpty()) {
this.buffer.append("<");//$NON-NLS-1$
for (Iterator it = node.typeParameters().iterator(); it.hasNext(); ) {
@@ -1374,7 +1374,7 @@ public class NaiveASTFlattener extends ASTVisitor {
this.buffer.append("}\n");//$NON-NLS-1$
return false;
}
-
+
@Override
public boolean visit(RequiresDirective node) {
printIndent();
@@ -1547,7 +1547,7 @@ public class NaiveASTFlattener extends ASTVisitor {
/*
* @see ASTVisitor#visit(SuperMethodReference)
- *
+ *
* @since 3.10
*/
@Override
@@ -1623,14 +1623,14 @@ public class NaiveASTFlattener extends ASTVisitor {
this.indent--;
printIndent();
this.buffer.append("}\n");//$NON-NLS-1$
-
+
}
@Override
public boolean visit(SwitchExpression node) {
visitSwitchNode(node);
return false;
}
-
+
@Override
public boolean visit(SwitchStatement node) {
visitSwitchNode(node);
@@ -1694,7 +1694,7 @@ public class NaiveASTFlattener extends ASTVisitor {
this.buffer.append(node.getEscapedValue());
return false;
}
-
+
@Override
public boolean visit(TextElement node) {
this.buffer.append(node.getText());
@@ -1846,7 +1846,7 @@ public class NaiveASTFlattener extends ASTVisitor {
/*
* @see ASTVisitor#visit(TypeMethodReference)
- *
+ *
* @since 3.10
*/
@Override
@@ -1991,7 +1991,7 @@ public class NaiveASTFlattener extends ASTVisitor {
}
return false;
}
-
+
@Override
public boolean visit(YieldStatement node) {
if ((node.getAST().apiLevel() >= AST.JLS14) && node.isImplicit() && node.getExpression() == null) {
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/SourceRangeVerifier.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/SourceRangeVerifier.java
index 6f8721f35..a16c18260 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/SourceRangeVerifier.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/SourceRangeVerifier.java
@@ -29,9 +29,9 @@ public class SourceRangeVerifier extends ASTVisitor {
public static boolean DEBUG = false;
public static boolean DEBUG_THROW = false;
-
- private StringBuffer bugs;
-
+
+ private StringBuffer bugs;
+
/**
* Verifies proper node nesting as specified in {@link ASTParser#setKind(int)}:
* <p>
@@ -39,7 +39,7 @@ public class SourceRangeVerifier extends ASTVisitor {
* within the source range of its parent, and the source ranges of sibling
* nodes never overlap.
* </p>
- *
+ *
* @param node
* @return <code>null</code> if everything is OK; a list of errors otherwise
*/
@@ -52,11 +52,11 @@ public class SourceRangeVerifier extends ASTVisitor {
return null;
return buffer.toString();
}
-
+
@Override
public boolean preVisit2(ASTNode node) {
ASTNode previous = null;
-
+
List properties = node.structuralPropertiesForType();
for (int i = 0; i < properties.size(); i++) {
StructuralPropertyDescriptor property = (StructuralPropertyDescriptor) properties.get(i);
@@ -89,24 +89,24 @@ public class SourceRangeVerifier extends ASTVisitor {
private boolean checkChild(ASTNode parent, ASTNode previous, ASTNode child) {
if ((parent.getFlags() & (ASTNode.RECOVERED | ASTNode.MALFORMED)) != 0
|| (child.getFlags() & (ASTNode.RECOVERED | ASTNode.MALFORMED)) != 0)
- return false;
+ return false;
if (DOMASTUtil.isRecordDeclarationSupported(child.getAST()) && child instanceof SingleVariableDeclaration) {
if (previous != null && previous instanceof MethodDeclaration && ((MethodDeclaration)previous).isCompactConstructor()) {
return true; // For compact constructors, do not validate for parameters
}
}
-
+
int parentStart = parent.getStartPosition();
int parentEnd = parentStart + parent.getLength();
-
+
int childStart = child.getStartPosition();
int childEnd = childStart + child.getLength();
-
+
if (previous != null) {
// Turn a blind eye on a known problem ... see https://bugs.eclipse.org/391894#c4
if (child.getLocationInParent() == ArrayCreation.DIMENSIONS_PROPERTY)
return false;
-
+
int previousStart = previous.getStartPosition();
int previousEnd = previousStart + previous.getLength();
if (childStart < previousEnd) {
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java
index 364ce8138..e61aae316 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java
@@ -83,7 +83,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
/** @deprecated using deprecated code */
private static final ChildPropertyDescriptor INTERNAL_METHOD_RETURN_TYPE_PROPERTY = MethodDeclaration.RETURN_TYPE_PROPERTY;
-
+
/** @deprecated using deprecated code */
private static final SimplePropertyDescriptor INTERNAL_METHOD_EXTRA_DIMENSIONS_PROPERTY = MethodDeclaration.EXTRA_DIMENSIONS_PROPERTY;
@@ -95,10 +95,10 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
/** @deprecated using deprecated code */
private static final ChildPropertyDescriptor INTERNAL_TYPE_SUPERCLASS_PROPERTY = TypeDeclaration.SUPERCLASS_PROPERTY;
-
+
/** @deprecated using deprecated code */
private static final ChildListPropertyDescriptor INTERNAL_TYPE_SUPER_INTERFACES_PROPERTY = TypeDeclaration.SUPER_INTERFACES_PROPERTY;
-
+
/** @deprecated using deprecated code */
private static final ChildPropertyDescriptor INTERNAL_CIC_NAME_PROPERTY = ClassInstanceCreation.NAME_PROPERTY;
@@ -122,16 +122,16 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
/** @deprecated using deprecated code */
private static final ChildListPropertyDescriptor INTERNAL_TRY_STATEMENT_RESOURCES_PROPERTY = TryStatement.RESOURCES_PROPERTY;
-
+
/** @deprecated using deprecated code */
private static final ChildPropertyDescriptor INTERNAL_SWITCH_EXPRESSION_PROPERTY = SwitchCase.EXPRESSION_PROPERTY;
/** @deprecated using deprecated code */
private static final int JLS2_INTERNAL = AST.JLS2;
-
+
/** @deprecated using deprecated code */
private static final int JLS3_INTERNAL = AST.JLS3;
-
+
/** @deprecated using deprecated code */
private static final int JLS4_INTERNAL = AST.JLS4;
@@ -140,7 +140,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
/** @deprecated using deprecated code */
private static final int JLS9_INTERNAL = AST.JLS9;
-
+
TextEdit currentEdit;
final RewriteEventStore eventStore; // used from inner classes
@@ -156,17 +156,17 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
private final NodeInfoStore nodeInfos;
private final TargetSourceRangeComputer extendedSourceRangeComputer;
private final LineCommentEndOffsets lineCommentEndOffsets;
-
+
private int beforeRequiredSpaceIndex = -1;
-
+
Map options;
-
+
private RecoveryScannerData recoveryScannerData;
/**
* Constructor for ASTRewriteAnalyzer.
* <p>The given options cannot be null.</p>
- *
+ *
* @param content the content of the compilation unit to rewrite.
* @param lineInfo line information for the content of the compilation unit to rewrite.
* @param rootEdit the edit to add all generated edits to
@@ -201,9 +201,9 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
this.extendedSourceRangeComputer = extendedSourceRangeComputer;
this.lineCommentEndOffsets= new LineCommentEndOffsets(comments);
-
+
this.options = options;
-
+
this.recoveryScannerData = recoveryScannerData;
}
@@ -212,7 +212,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
CompilerOptions compilerOptions = new CompilerOptions(this.options);
Scanner scanner;
if (this.recoveryScannerData == null) {
- scanner =
+ scanner =
new Scanner(
true,/*tokenizeComments*/
false,/*tokenizeWhiteSpace*/
@@ -665,7 +665,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
if (separatorState == EXISTING) {
updateIndent(prevMark, currPos, i, editGroup);
}
-
+
doTextInsert(currPos, node, getNodeIndent(i), true, editGroup); // insert node
separatorState= NEW;
@@ -710,8 +710,8 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
}
if (currPos < newOffset) {
currPos = extendedOffset;
- }
- prevEnd = newOffset;
+ }
+ prevEnd = newOffset;
} catch (CoreException e) {
// ignore
}
@@ -726,7 +726,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
if (i < lastNonDelete) {
updateIndent(prevMark, currPos, i, editGroup);
}
-
+
// remove element and next separator
int end= getStartOfNextNode(nextIndex, currEnd); // start of next
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=306524
@@ -763,7 +763,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
TextEditGroup editGroup= getEditGroup(currEvent);
ASTNode changed= (ASTNode) currEvent.getNewValue();
-
+
updateIndent(prevMark, currPos, i, editGroup);
// make sure that comments between last modified source position and extended starting position of
// node to be replaced are not touched
@@ -785,7 +785,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
}
if (currPos < newOffset) {
currPos = extendedOffset;
- }
+ }
} catch (CoreException e) {
// ignore
}
@@ -814,7 +814,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
separatorState= EXISTING;
}
}
-
+
prevMark = currMark;
}
return currPos;
@@ -823,7 +823,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
public final int rewriteList(ASTNode parent, StructuralPropertyDescriptor property, int offset, String keyword) {
return rewriteList(parent, property, keyword, null, offset);
}
-
+
protected void updateIndent(int prevMark, int originalOffset, int nodeIndex, TextEditGroup editGroup) {
// Do nothing.
}
@@ -870,7 +870,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
case RewriteEvent.REMOVED: {
ASTNode node= (ASTNode) event.getOriginalValue();
TextEditGroup editGroup= getEditGroup(event);
-
+
// if there is a prefix, remove the prefix as well
int nodeEnd;
int len;
@@ -1052,7 +1052,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
}
return pos;
}
-
+
private int rewriteExpressionOptionalQualifier(SwitchCase parent, StructuralPropertyDescriptor property, int startPos) {
RewriteEvent event= getEvent(parent, property);
if (event != null) {
@@ -1128,7 +1128,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
protected String getSeparatorString(int nodeIndex) {
return getSeparatorString(nodeIndex, nodeIndex + 1);
}
-
+
protected String getSeparatorString(int nodeIndex, int nextNodeIndex) {
int newLines= this.separatorLines == -1 ? getNewLines(nodeIndex) : this.separatorLines;
@@ -1202,7 +1202,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
}
return 0;
}
-
+
@Override
protected boolean mustRemoveSeparator(int originalOffset, int nodeIndex) {
// Do not remove separator if the previous non removed node is on the same line and the next node is on another line
@@ -1210,10 +1210,10 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
while (previousNonRemovedNodeIndex >= 0 && this.list[previousNonRemovedNodeIndex].getChangeKind() == RewriteEvent.REMOVED) {
previousNonRemovedNodeIndex--;
}
-
+
if (previousNonRemovedNodeIndex > -1) {
LineInformation lineInformation = getLineInformation();
-
+
RewriteEvent prevEvent = this.list[previousNonRemovedNodeIndex];
int prevKind = prevEvent.getChangeKind();
if (prevKind == RewriteEvent.UNCHANGED || prevKind == RewriteEvent.REPLACED) {
@@ -1221,23 +1221,23 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
int prevEndPosition = prevNode.getStartPosition() + prevNode.getLength();
int prevLine = lineInformation.getLineOfOffset(prevEndPosition);
int line = lineInformation.getLineOfOffset(originalOffset);
-
+
if (prevLine == line && nodeIndex + 1 < this.list.length) {
RewriteEvent nextEvent = this.list[nodeIndex + 1];
int nextKind = nextEvent.getChangeKind();
-
+
if (nextKind == RewriteEvent.UNCHANGED || prevKind == RewriteEvent.REPLACED) {
ASTNode nextNode = (ASTNode) nextEvent.getOriginalValue();
int nextStartPosition = nextNode.getStartPosition();
int nextLine = lineInformation.getLineOfOffset(nextStartPosition);
-
+
return nextLine == line;
}
return false;
}
}
}
-
+
return true;
}
}
@@ -1485,7 +1485,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
}
currPos= offset;
} else {
- // If in the first line, there are cases (eg: catch clause) where the line will not be prefixed with
+ // If in the first line, there are cases (eg: catch clause) where the line will not be prefixed with
// proper indentation - see https://bugs.eclipse.org/bugs/show_bug.cgi?id=350285
int lineOffset = getCurrentLineStart(formatted, offset);
String destIndentString = (lineOffset == 0)
@@ -1532,7 +1532,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
}
return 0;
}
-
+
private void rewriteModifiers(ASTNode parent, StructuralPropertyDescriptor property, int offset) {
RewriteEvent event= getEvent(parent, property);
if (event == null || event.getChangeKind() != RewriteEvent.REPLACED) {
@@ -1630,7 +1630,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
//
// Prefix formatterPrefix = this.formatter.CASE_SEPARATION;
//
-// int endPos= new ModifierRewriter(formatterPrefix).rewriteList(node, property, pos, keyword, " "); //$NON-NLS-1$
+// int endPos= new ModifierRewriter(formatterPrefix).rewriteList(node, property, pos, keyword, " "); //$NON-NLS-1$
//
// try {
// int nextPos= getScanner().getNextStartOffset(endPos, false);
@@ -1654,7 +1654,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
// }
// return endPos;
// }
-
+
private int rewriteModifiers2(ASTNode node, ChildListPropertyDescriptor property, int pos) {
RewriteEvent event= getEvent(node, property);
if (event == null || event.getChangeKind() == RewriteEvent.UNCHANGED) {
@@ -1676,7 +1676,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
}
}
- boolean isAnnotationsProperty = isVarargsAnnotationsProperty
+ boolean isAnnotationsProperty = isVarargsAnnotationsProperty
|| node instanceof AnnotatableType && property == ((AnnotatableType) node).getAnnotationsProperty();
Prefix formatterPrefix;
if (property == SingleVariableDeclaration.MODIFIERS2_PROPERTY ||
@@ -1694,7 +1694,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
formatterPrefix= this.formatter.ANNOTATION_SEPARATION;
}
- int endPos= new ModifierRewriter(formatterPrefix).rewriteList(node, property, pos, keyword, " "); //$NON-NLS-1$
+ int endPos= new ModifierRewriter(formatterPrefix).rewriteList(node, property, pos, keyword, " "); //$NON-NLS-1$
try {
int nextPos= getScanner().getNextStartOffset(endPos, false);
@@ -1719,7 +1719,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
}
return endPos;
}
-
+
private int rewriteTypeAnnotations(ASTNode node, ChildListPropertyDescriptor property, int pos) {
return rewriteModifiers2(node, property, pos);
}
@@ -1778,7 +1778,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
addEdit(edit);
this.currentEdit= edit;
}
-
+
ensureSpaceBeforeReplace(node);
}
@@ -1808,10 +1808,10 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
}
int startPos = 0;
boolean isModuleInfo = node.getAST().apiLevel() >= JLS9_INTERNAL && node.getModule() != null;
-
+
if (!isModuleInfo) {
startPos = rewriteNode(node, CompilationUnit.PACKAGE_PROPERTY, 0, ASTRewriteFormatter.NONE);
-
+
if (getChangeKind(node, CompilationUnit.PACKAGE_PROPERTY) == RewriteEvent.INSERTED) {
doTextInsert(0, getLineDelimiter(), getEditGroup(node, CompilationUnit.PACKAGE_PROPERTY));
}
@@ -1873,7 +1873,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
pos= rewriteRequiredNode(node, TypeDeclaration.NAME_PROPERTY);
if (!isJLS2) {
- pos= rewriteOptionalTypeParameters(node, TypeDeclaration.TYPE_PARAMETERS_PROPERTY, pos, Util.EMPTY_STRING, false, true);
+ pos= rewriteOptionalTypeParameters(node, TypeDeclaration.TYPE_PARAMETERS_PROPERTY, pos, Util.EMPTY_STRING, false, true);
}
// superclass
@@ -1936,7 +1936,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
firstStart= ((ASTNode) origNodes.get(0)).getStartPosition();
}
doTextReplace(pos, firstStart - pos, keyword, getEditGroup(node, TypeDeclaration.INTERFACE_PROPERTY));
- keyword= Util.EMPTY_STRING;
+ keyword= Util.EMPTY_STRING;
pos= firstStart;
}
}
@@ -1997,7 +1997,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
}
}
}
-
+
private int rewriteMethodReceiver(MethodDeclaration method, int offset) throws CoreException {
offset= getScanner().getTokenEndOffset(TerminalTokens.TokenNameLPAREN, offset);
if (method.getAST().apiLevel() < JLS8_INTERNAL) {
@@ -2101,7 +2101,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
}
return i < size ? prev : null;
}
-
+
private int getPreviousTokenEndOffset(ASTNode node, int token) {
int offset = -1;
ASTNode prev = getPreviousNode(node);
@@ -2115,13 +2115,13 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
}
return offset;
}
-
+
@Override
public boolean visit(Dimension node) {
if (!hasChildrenChanges(node)) {
return doVisitUnchangedChildren(node);
}
-
+
boolean keywordSpace = true;
ASTNode parent = node.getParent();
if (parent.getNodeType() == ASTNode.ARRAY_TYPE) {
@@ -2179,7 +2179,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
// parameters
try {
pos= rewriteMethodReceiver(node, pos);
- pos= rewriteNodeList(node, MethodDeclaration.PARAMETERS_PROPERTY, pos, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
+ pos= rewriteNodeList(node, MethodDeclaration.PARAMETERS_PROPERTY, pos, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
pos= getScanner().getTokenEndOffset(TerminalTokens.TokenNameRPAREN, pos);
ChildListPropertyDescriptor exceptionsProperty = apiLevel < JLS8_INTERNAL ? INTERNAL_METHOD_THROWN_EXCEPTIONS_PROPERTY : MethodDeclaration.THROWN_EXCEPTION_TYPES_PROPERTY;
@@ -2203,7 +2203,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
}
pos= rewriteNodeList(node, exceptionsProperty, pos, " throws ", ", "); //$NON-NLS-1$ //$NON-NLS-2$
-
+
rewriteMethodBody(node, pos);
} catch (CoreException e) {
// ignore
@@ -2277,10 +2277,10 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
// name
pos= rewriteRequiredNode(node, RecordDeclaration.NAME_PROPERTY);
- pos= rewriteOptionalTypeParameters(node, RecordDeclaration.TYPE_PARAMETERS_PROPERTY, pos, Util.EMPTY_STRING, false, true);
+ pos= rewriteOptionalTypeParameters(node, RecordDeclaration.TYPE_PARAMETERS_PROPERTY, pos, Util.EMPTY_STRING, false, true);
+
+ pos= rewriteNodeList(node, RecordDeclaration.RECORD_COMPONENTS_PROPERTY, pos, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
- pos= rewriteNodeList(node, RecordDeclaration.RECORD_COMPONENTS_PROPERTY, pos, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
-
// extended interfaces
ChildListPropertyDescriptor superInterfaceProperty= RecordDeclaration.SUPER_INTERFACE_TYPES_PROPERTY;
@@ -2288,7 +2288,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
if (interfaceEvent == null || interfaceEvent.getChangeKind() == RewriteEvent.UNCHANGED) {
pos= doVisit(node, superInterfaceProperty, pos);
} else {
- String keyword= " implements "; //$NON-NLS-1$
+ String keyword= " implements "; //$NON-NLS-1$
pos= rewriteNodeList(node, superInterfaceProperty, pos, keyword, ", "); //$NON-NLS-1$
}
@@ -2299,18 +2299,18 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
rewriteParagraphList(node, RecordDeclaration.BODY_DECLARATIONS_PROPERTY, startPos, startIndent, -1, 2);
return false;
}
-
+
@Override
public boolean visit(ReturnStatement node) {
try {
this.beforeRequiredSpaceIndex = getScanner().getTokenEndOffset(TerminalTokens.TokenNamereturn, node.getStartPosition());
-
+
if (!hasChildrenChanges(node)) {
return doVisitUnchangedChildren(node);
}
-
+
ensureSpaceBeforeReplace(node);
-
+
rewriteNode(node, ReturnStatement.EXPRESSION_PROPERTY, this.beforeRequiredSpaceIndex, ASTRewriteFormatter.SPACE);
} catch (CoreException e) {
handleException(e);
@@ -2564,7 +2564,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
}
int startPos= getPosAfterLeftBrace(node.getStartPosition());
- rewriteNodeList(node, ArrayInitializer.EXPRESSIONS_PROPERTY, startPos, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
+ rewriteNodeList(node, ArrayInitializer.EXPRESSIONS_PROPERTY, startPos, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
return false;
}
@@ -2590,13 +2590,13 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
public boolean visit(AssertStatement node) {
try {
this.beforeRequiredSpaceIndex = getScanner().getNextEndOffset(node.getStartPosition(), true);
-
+
if (!hasChildrenChanges(node)) {
return doVisitUnchangedChildren(node);
}
-
+
ensureSpaceBeforeReplace(node);
-
+
int offset= rewriteRequiredNode(node, AssertStatement.EXPRESSION_PROPERTY);
rewriteNode(node, AssertStatement.MESSAGE_PROPERTY, offset, ASTRewriteFormatter.ASSERT_COMMENT);
} catch (CoreException e) {
@@ -2704,7 +2704,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
if (isChanged(node, ClassInstanceCreation.ARGUMENTS_PROPERTY)) {
try {
int startpos= getScanner().getTokenEndOffset(TerminalTokens.TokenNameLPAREN, pos);
- rewriteNodeList(node, ClassInstanceCreation.ARGUMENTS_PROPERTY, startpos, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
+ rewriteNodeList(node, ClassInstanceCreation.ARGUMENTS_PROPERTY, startpos, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
} catch (CoreException e) {
handleException(e);
}
@@ -2745,11 +2745,11 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
}
int pos= node.getStartPosition();
if (node.getAST().apiLevel() >= JLS3_INTERNAL) {
- pos= rewriteOptionalTypeParameters(node, ConstructorInvocation.TYPE_ARGUMENTS_PROPERTY, pos, Util.EMPTY_STRING, false, false);
+ pos= rewriteOptionalTypeParameters(node, ConstructorInvocation.TYPE_ARGUMENTS_PROPERTY, pos, Util.EMPTY_STRING, false, false);
}
try {
pos= getScanner().getTokenEndOffset(TerminalTokens.TokenNameLPAREN, pos);
- rewriteNodeList(node, ConstructorInvocation.ARGUMENTS_PROPERTY, pos, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
+ rewriteNodeList(node, ConstructorInvocation.ARGUMENTS_PROPERTY, pos, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
} catch (CoreException e) {
handleException(e);
}
@@ -2834,7 +2834,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
return doVisitUnchangedChildren(node);
}
int pos = rewriteRequiredNode(node, ExportsDirective.NAME_PROPERTY);
- rewriteNodeList(node, ExportsDirective.MODULES_PROPERTY, pos, "to ", ", "); //$NON-NLS-1$ //$NON-NLS-2$
+ rewriteNodeList(node, ExportsDirective.MODULES_PROPERTY, pos, "to ", ", "); //$NON-NLS-1$ //$NON-NLS-2$
return false;
}
@@ -2875,7 +2875,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
pos= rewriteRequiredNode(node, FieldDeclaration.TYPE_PROPERTY);
ensureSpaceAfterReplace(node, FieldDeclaration.TYPE_PROPERTY);
- rewriteNodeList(node, FieldDeclaration.FRAGMENTS_PROPERTY, pos, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
+ rewriteNodeList(node, FieldDeclaration.FRAGMENTS_PROPERTY, pos, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
return false;
}
@@ -2891,7 +2891,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
if (isChanged(node, ForStatement.INITIALIZERS_PROPERTY)) {
// position after opening parent
int startOffset= getScanner().getTokenEndOffset(TerminalTokens.TokenNameLPAREN, pos);
- pos= rewriteNodeList(node, ForStatement.INITIALIZERS_PROPERTY, startOffset, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
+ pos= rewriteNodeList(node, ForStatement.INITIALIZERS_PROPERTY, startOffset, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
} else {
pos= doVisit(node, ForStatement.INITIALIZERS_PROPERTY, pos);
}
@@ -2903,7 +2903,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
if (isChanged(node, ForStatement.UPDATERS_PROPERTY)) {
int startOffset= getScanner().getTokenEndOffset(TerminalTokens.TokenNameSEMICOLON, pos);
- pos= rewriteNodeList(node, ForStatement.UPDATERS_PROPERTY, startOffset, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
+ pos= rewriteNodeList(node, ForStatement.UPDATERS_PROPERTY, startOffset, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
} else {
pos= doVisit(node, ForStatement.UPDATERS_PROPERTY, pos);
}
@@ -2939,7 +2939,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
try {
int tok= getScanner().readNext(pos, true); // after the closing parent
pos= (tok == TerminalTokens.TokenNameRPAREN) ? getScanner().getCurrentEndOffset() : getScanner().getCurrentStartOffset();
-
+
int indent= getIndent(node.getStartPosition());
int endPos= -1;
@@ -3041,12 +3041,12 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
Expression right= node.getRightOperand();
int pos;
-
+
RewriteEvent leftEvent= getEvent(node, InfixExpression.LEFT_OPERAND_PROPERTY);
boolean removeLeft = leftEvent != null && leftEvent.getChangeKind() == RewriteEvent.REMOVED;
RewriteEvent rightEvent= getEvent(node, InfixExpression.RIGHT_OPERAND_PROPERTY);
boolean removeRight = rightEvent != null && rightEvent.getChangeKind() == RewriteEvent.REMOVED;
-
+
if (removeLeft) {
Expression left= node.getLeftOperand();
int leftStart= getExtendedOffset(left);
@@ -3154,12 +3154,12 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
}
}
}
-
+
private void ensureSpaceBeforeReplace(ASTNode node) {
if (this.beforeRequiredSpaceIndex == -1) return;
-
+
List events = this.eventStore.getChangedPropertieEvents(node);
-
+
for (Iterator iterator = events.iterator(); iterator.hasNext();) {
RewriteEvent event = (RewriteEvent) iterator.next();
if (event.getChangeKind() == RewriteEvent.REPLACED && event.getOriginalValue() instanceof ASTNode) {
@@ -3170,7 +3170,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
}
}
}
-
+
if (this.beforeRequiredSpaceIndex < getExtendedOffset(node)) {
this.beforeRequiredSpaceIndex = -1;
}
@@ -3241,7 +3241,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
insertParentheses = true;
}
}
-
+
int pos = node.getStartPosition();
if (insertParentheses) {
doTextInsert(pos, "(", editGroup); //$NON-NLS-1$
@@ -3288,7 +3288,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
int pos= rewriteOptionalQualifier(node, MethodInvocation.EXPRESSION_PROPERTY, node.getStartPosition());
if (node.getAST().apiLevel() >= JLS3_INTERNAL) {
- pos= rewriteOptionalTypeParameters(node, MethodInvocation.TYPE_ARGUMENTS_PROPERTY, pos, Util.EMPTY_STRING, false, false);
+ pos= rewriteOptionalTypeParameters(node, MethodInvocation.TYPE_ARGUMENTS_PROPERTY, pos, Util.EMPTY_STRING, false, false);
}
pos= rewriteRequiredNode(node, MethodInvocation.NAME_PROPERTY);
@@ -3297,7 +3297,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
// eval position after opening parent
try {
int startOffset= getScanner().getTokenEndOffset(TerminalTokens.TokenNameLPAREN, pos);
- rewriteNodeList(node, MethodInvocation.ARGUMENTS_PROPERTY, startOffset, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
+ rewriteNodeList(node, MethodInvocation.ARGUMENTS_PROPERTY, startOffset, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
} catch (CoreException e) {
handleException(e);
}
@@ -3535,14 +3535,14 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
int pos= rewriteOptionalQualifier(node, SuperConstructorInvocation.EXPRESSION_PROPERTY, node.getStartPosition());
if (node.getAST().apiLevel() >= JLS3_INTERNAL) {
- pos= rewriteOptionalTypeParameters(node, SuperConstructorInvocation.TYPE_ARGUMENTS_PROPERTY, pos, Util.EMPTY_STRING, false, false);
+ pos= rewriteOptionalTypeParameters(node, SuperConstructorInvocation.TYPE_ARGUMENTS_PROPERTY, pos, Util.EMPTY_STRING, false, false);
}
if (isChanged(node, SuperConstructorInvocation.ARGUMENTS_PROPERTY)) {
// eval position after opening parent
try {
pos= getScanner().getTokenEndOffset(TerminalTokens.TokenNameLPAREN, pos);
- rewriteNodeList(node, SuperConstructorInvocation.ARGUMENTS_PROPERTY, pos, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
+ rewriteNodeList(node, SuperConstructorInvocation.ARGUMENTS_PROPERTY, pos, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
} catch (CoreException e) {
handleException(e);
}
@@ -3575,7 +3575,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
if (isChanged(node, SuperMethodInvocation.TYPE_ARGUMENTS_PROPERTY)) {
try {
pos= getScanner().getTokenEndOffset(TerminalTokens.TokenNameDOT, pos);
- rewriteOptionalTypeParameters(node, SuperMethodInvocation.TYPE_ARGUMENTS_PROPERTY, pos, Util.EMPTY_STRING, false, false);
+ rewriteOptionalTypeParameters(node, SuperMethodInvocation.TYPE_ARGUMENTS_PROPERTY, pos, Util.EMPTY_STRING, false, false);
} catch (CoreException e) {
handleException(e);
}
@@ -3588,7 +3588,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
// eval position after opening parent
try {
pos= getScanner().getTokenEndOffset(TerminalTokens.TokenNameLPAREN, pos);
- rewriteNodeList(node, SuperMethodInvocation.ARGUMENTS_PROPERTY, pos, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
+ rewriteNodeList(node, SuperMethodInvocation.ARGUMENTS_PROPERTY, pos, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
} catch (CoreException e) {
handleException(e);
}
@@ -3640,18 +3640,18 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
public SwitchListLabeledRuleRewriter(int initialIndent) {
super(initialIndent);
}
-
+
@Override
protected String getSeparatorString(int nodeIndex, int nextNodeIndex) {
boolean isSwitchLabelRule = isSwitchLabeledRule(nodeIndex, nextNodeIndex);
String spaceDelim = JavaCore.INSERT.equals(ASTRewriteAnalyzer.this.options.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ARROW_IN_SWITCH_CASE))? " ":""; //$NON-NLS-1$ //$NON-NLS-2$
String lineDelim = isSwitchLabelRule ? spaceDelim : getLineDelimiter();
-
+
StringBuffer buf= new StringBuffer(lineDelim);
buf.append(createIndentString(getNodeIndent(nextNodeIndex)));
return buf.toString();
}
-
+
@Override
protected int getNodeIndent(int nodeIndex) {
int indent= getInitialIndent();
@@ -3675,7 +3675,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
}
return indent;
}
-
+
private boolean isSwitchLabeledRule(int nodeIndex, int nextNodeIndex) {
ASTNode curr= getNode(nodeIndex);
ASTNode next= getNode(nodeIndex +1);
@@ -3686,43 +3686,43 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
return false;
}
}
-
+
class SwitchListRewriter extends ParagraphListRewriter {
protected boolean indentSwitchStatementsCompareToCases;
public SwitchListRewriter(int initialIndent) {
super(initialIndent, 0);
- this.indentSwitchStatementsCompareToCases =
+ this.indentSwitchStatementsCompareToCases =
DefaultCodeFormatterConstants.TRUE.equals(ASTRewriteAnalyzer.this.options.get(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_CASES));
}
@Override
protected int getNodeIndent(int nodeIndex) {
int indent= getInitialIndent();
-
+
if (this.indentSwitchStatementsCompareToCases) {
RewriteEvent event = this.list[nodeIndex];
int changeKind = event.getChangeKind();
-
+
ASTNode node;
if (changeKind == RewriteEvent.INSERTED || changeKind == RewriteEvent.REPLACED) {
node= (ASTNode)event.getNewValue();
} else {
node= (ASTNode)event.getOriginalValue();
}
-
+
if (node.getNodeType() != ASTNode.SWITCH_CASE) {
indent++;
}
}
return indent;
}
-
+
@Override
protected String getSeparatorString(int nodeIndex) {
int total = this.list.length;
-
+
int nextNodeIndex = nodeIndex + 1;
while (nextNodeIndex < total && this.list[nextNodeIndex].getChangeKind() == RewriteEvent.REMOVED) {
nextNodeIndex++;
@@ -3732,20 +3732,20 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
}
return getSeparatorString(nodeIndex, nextNodeIndex);
}
-
+
@Override
protected void updateIndent(int prevMark, int originalOffset, int nodeIndex, TextEditGroup editGroup) {
if (prevMark != RewriteEvent.UNCHANGED && prevMark != RewriteEvent.REPLACED) return;
-
+
// Do not change indent if the previous non removed node is on the same line
int previousNonRemovedNodeIndex = nodeIndex - 1;
while (previousNonRemovedNodeIndex >= 0 && this.list[previousNonRemovedNodeIndex].getChangeKind() == RewriteEvent.REMOVED) {
previousNonRemovedNodeIndex--;
}
-
+
if (previousNonRemovedNodeIndex > -1) {
LineInformation lineInformation = getLineInformation();
-
+
RewriteEvent prevEvent = this.list[previousNonRemovedNodeIndex];
int prevKind = prevEvent.getChangeKind();
if (prevKind == RewriteEvent.UNCHANGED || prevKind == RewriteEvent.REPLACED) {
@@ -3753,27 +3753,27 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
int prevEndPosition = prevNode.getStartPosition() + prevNode.getLength();
int prevLine = lineInformation.getLineOfOffset(prevEndPosition);
int line = lineInformation.getLineOfOffset(originalOffset);
-
+
if (prevLine == line) {
return;
}
}
}
-
+
int total = this.list.length;
while (nodeIndex < total && this.list[nodeIndex].getChangeKind() == RewriteEvent.REMOVED) {
nodeIndex++;
}
-
+
int originalIndent = getIndent(originalOffset);
int newIndent = getNodeIndent(nodeIndex);
-
+
if (originalIndent != newIndent) {
-
+
int line= getLineInformation().getLineOfOffset(originalOffset);
if (line >= 0) {
int lineStart= getLineInformation().getLineOffset(line);
-
+
doTextRemove(lineStart, originalOffset - lineStart, editGroup); // remove previous indentation
doTextInsert(lineStart, createIndentString(newIndent), editGroup); // add new indentation
}
@@ -3797,7 +3797,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
if (DefaultCodeFormatterConstants.TRUE.equals(this.options.get(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH))) {
insertIndent++;
}
-
+
ParagraphListRewriter listRewriter= new SwitchListLabeledRuleRewriter(insertIndent);
StringBuffer leadString= new StringBuffer();
leadString.append(getLineDelimiter());
@@ -3811,7 +3811,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
}
return false;
}
-
+
@Override
public boolean visit(SwitchStatement node) {
if (!hasChildrenChanges(node)) {
@@ -3872,11 +3872,11 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
public boolean visit(ThrowStatement node) {
try {
this.beforeRequiredSpaceIndex = getScanner().getTokenEndOffset(TerminalTokens.TokenNamethrow, node.getStartPosition());
-
+
if (!hasChildrenChanges(node)) {
return doVisitUnchangedChildren(node);
}
-
+
ensureSpaceBeforeReplace(node);
rewriteRequiredNode(node, ThrowStatement.EXPRESSION_PROPERTY);
@@ -3906,7 +3906,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
}
pos= rewriteRequiredNode(node, TryStatement.BODY_PROPERTY);
-
+
if (isChanged(node, TryStatement.CATCH_CLAUSES_PROPERTY)) {
int indent= getIndent(node.getStartPosition());
String prefix= this.formatter.CATCH_BLOCK.getPrefix(indent);
@@ -3973,7 +3973,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
rewriteModifiers2(node, VariableDeclarationExpression.MODIFIERS2_PROPERTY, pos);
}
pos= rewriteRequiredNode(node, VariableDeclarationExpression.TYPE_PROPERTY);
- rewriteNodeList(node, VariableDeclarationExpression.FRAGMENTS_PROPERTY, pos, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
+ rewriteNodeList(node, VariableDeclarationExpression.FRAGMENTS_PROPERTY, pos, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
return false;
}
@@ -4021,7 +4021,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
}
pos= rewriteRequiredNode(node, VariableDeclarationStatement.TYPE_PROPERTY);
- rewriteNodeList(node, VariableDeclarationStatement.FRAGMENTS_PROPERTY, pos, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
+ rewriteNodeList(node, VariableDeclarationStatement.FRAGMENTS_PROPERTY, pos, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
return false;
}
@@ -4070,7 +4070,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
// eval position after opening parent
try {
int startOffset= getScanner().getTokenEndOffset(TerminalTokens.TokenNameLPAREN, pos);
- rewriteNodeList(node, MethodRef.PARAMETERS_PROPERTY, startOffset, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
+ rewriteNodeList(node, MethodRef.PARAMETERS_PROPERTY, startOffset, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
} catch (CoreException e) {
handleException(e);
}
@@ -4162,7 +4162,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
return false;
}
-
+
@Override
public boolean visit(TextElement node) {
if (!hasChildrenChanges(node)) {
@@ -4249,7 +4249,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
int nextTok= getScanner().readNext(pos, true);
boolean hasParents= (nextTok == TerminalTokens.TokenNameLPAREN);
boolean isAllRemoved= hasParents && isAllOfKind(children, RewriteEvent.REMOVED);
- String prefix= Util.EMPTY_STRING;
+ String prefix= Util.EMPTY_STRING;
if (!hasParents) {
prefix= "("; //$NON-NLS-1$
} else if (!isAllRemoved) {
@@ -4300,7 +4300,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
pos= getPosAfterLeftBrace(pos);
- String leadString= Util.EMPTY_STRING;
+ String leadString= Util.EMPTY_STRING;
RewriteEvent constEvent= getEvent(node, EnumDeclaration.ENUM_CONSTANTS_PROPERTY);
if (constEvent != null && constEvent.getChangeKind() != RewriteEvent.UNCHANGED) {
@@ -4424,7 +4424,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
// eval position after opening parent
try {
int startOffset= getScanner().getTokenEndOffset(TerminalTokens.TokenNameLPAREN, pos);
- rewriteNodeList(node, NormalAnnotation.VALUES_PROPERTY, startOffset, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
+ rewriteNodeList(node, NormalAnnotation.VALUES_PROPERTY, startOffset, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
} catch (CoreException e) {
handleException(e);
}
@@ -4460,7 +4460,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
// eval position after opening parent
try {
int startOffset= getScanner().getTokenEndOffset(TerminalTokens.TokenNameLESS, pos);
- rewriteNodeList(node, ParameterizedType.TYPE_ARGUMENTS_PROPERTY, startOffset, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
+ rewriteNodeList(node, ParameterizedType.TYPE_ARGUMENTS_PROPERTY, startOffset, Util.EMPTY_STRING, ", "); //$NON-NLS-1$
} catch (CoreException e) {
handleException(e);
}
@@ -4572,7 +4572,7 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
}
return false;
}
-
+
@Override
public boolean visit(YieldStatement node) {
if (!hasChildrenChanges(node)) {
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFlattener.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFlattener.java
index 327e3aa6d..3a0c71223 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFlattener.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFlattener.java
@@ -39,7 +39,7 @@ public class ASTRewriteFlattener extends ASTVisitor {
/** @deprecated using deprecated code */
private static final ChildPropertyDescriptor INTERNAL_METHOD_RETURN_TYPE_PROPERTY = MethodDeclaration.RETURN_TYPE_PROPERTY;
-
+
/** @deprecated using deprecated code */
private static final SimplePropertyDescriptor INTERNAL_METHOD_EXTRA_DIMENSIONS_PROPERTY = MethodDeclaration.EXTRA_DIMENSIONS_PROPERTY;
@@ -96,7 +96,7 @@ public class ASTRewriteFlattener extends ASTVisitor {
/** @deprecated using deprecated code */
private static final int JLS9_INTERNAL = AST.JLS9;
-
+
public static String asString(ASTNode node, RewriteEventStore store) {
ASTRewriteFlattener flattener= new ASTRewriteFlattener(store);
node.accept(flattener);
@@ -761,15 +761,15 @@ public class ASTRewriteFlattener extends ASTVisitor {
}
}
}
-
+
visitList(node, MethodDeclaration.PARAMETERS_PROPERTY, String.valueOf(','));
this.result.append(')');
}
visitExtraDimensions(node, INTERNAL_METHOD_EXTRA_DIMENSIONS_PROPERTY, MethodDeclaration.EXTRA_DIMENSIONS2_PROPERTY);
- ChildListPropertyDescriptor exceptionsProperty = node.getAST().apiLevel() < JLS8_INTERNAL ?
+ ChildListPropertyDescriptor exceptionsProperty = node.getAST().apiLevel() < JLS8_INTERNAL ?
INTERNAL_METHOD_THROWN_EXCEPTIONS_PROPERTY : MethodDeclaration.THROWN_EXCEPTION_TYPES_PROPERTY;
- visitList(node, exceptionsProperty, String.valueOf(','), " throws ", Util.EMPTY_STRING); //$NON-NLS-1$
+ visitList(node, exceptionsProperty, String.valueOf(','), " throws ", Util.EMPTY_STRING); //$NON-NLS-1$
//{ObjectTeams: predicate
ASTNode guardPredicate = getChildNode(node, MethodDeclaration.GUARD_PROPERTY);
if (guardPredicate != null) {
@@ -911,9 +911,9 @@ public class ASTRewriteFlattener extends ASTVisitor {
this.result.append("record ");//$NON-NLS-1$
getChildNode(node, RecordDeclaration.NAME_PROPERTY).accept(this);
this.result.append(' ');
-
+
visitList(node, RecordDeclaration.TYPE_PARAMETERS_PROPERTY, String.valueOf(','), String.valueOf('<'), String.valueOf('>'));
-
+
this.result.append('(');
visitList(node, RecordDeclaration.RECORD_COMPONENTS_PROPERTY, String.valueOf(','));
this.result.append(')');
@@ -926,7 +926,7 @@ public class ASTRewriteFlattener extends ASTVisitor {
this.result.append('}');
return false;
}
-
+
@Override
public boolean visit(RequiresDirective node) {
this.result.append("requires "); //$NON-NLS-1$
@@ -1055,7 +1055,7 @@ public class ASTRewriteFlattener extends ASTVisitor {
t.accept(this);
this.result.append(it.hasNext() ? ", " : ""); //$NON-NLS-1$ //$NON-NLS-2$
}
- this.result.append(getBooleanAttribute(node, SwitchCase.SWITCH_LABELED_RULE_PROPERTY) ? " ->" : ":");//$NON-NLS-1$ //$NON-NLS-2$
+ this.result.append(getBooleanAttribute(node, SwitchCase.SWITCH_LABELED_RULE_PROPERTY) ? " ->" : ":");//$NON-NLS-1$ //$NON-NLS-2$
}
} else {
ASTNode expression= getChildNode(node, INTERNAL_SWITCH_EXPRESSION_PROPERTY);
@@ -1075,7 +1075,7 @@ public class ASTRewriteFlattener extends ASTVisitor {
visitSwitchNode(node);
return false;
}
-
+
private void visitSwitchNode(ASTNode node) {
this.result.append("switch ("); //$NON-NLS-1$
if (node instanceof SwitchExpression) {
@@ -1092,10 +1092,10 @@ public class ASTRewriteFlattener extends ASTVisitor {
else if (node instanceof SwitchStatement) {
visitList(node, SwitchStatement.STATEMENTS_PROPERTY, null);
}
-
+
this.result.append('}');
}
-
+
@Override
public boolean visit(SwitchStatement node) {
visitSwitchNode(node);
@@ -1358,7 +1358,7 @@ public class ASTRewriteFlattener extends ASTVisitor {
this.result.append(getAttribute(node, TextBlock.ESCAPED_VALUE_PROPERTY));
return false;
}
-
+
@Override
public boolean visit(TextElement node) {
this.result.append(getAttribute(node, TextElement.TEXT_PROPERTY));
@@ -1591,13 +1591,13 @@ public class ASTRewriteFlattener extends ASTVisitor {
}
return false;
}
-
+
@Override
public boolean visit(YieldStatement node) {
if (node.getAST().apiLevel() >= AST.JLS14 && node.isImplicit() && node.getExpression() == null) {
return false;
}
-
+
this.result.append("yield"); //$NON-NLS-1$
ASTNode expression = getChildNode(node, YieldStatement.EXPRESSION_PROPERTY);
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter.java
index 3fea04d6b..4bdc21c22 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter.java
@@ -5,7 +5,7 @@
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
- *
+ *
*
* SPDX-License-Identifier: EPL-2.0
*
@@ -135,14 +135,14 @@ public final class ASTRewriteFormatter {
public ASTRewriteFormatter(NodeInfoStore placeholders, RewriteEventStore eventStore, Map options, String lineDelimiter) {
this.placeholders= placeholders;
this.eventStore= eventStore;
-
+
this.options= options == null ? JavaCore.getOptions() : (Map) new HashMap(options);
this.options.put(
DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_RESOURCES_IN_TRY,
DefaultCodeFormatterConstants.createAlignmentValue(true, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
this.lineDelimiter= lineDelimiter;
-
+
this.tabWidth= IndentManipulation.getTabWidth(options);
this.indentWidth= IndentManipulation.getIndentWidth(options);
}
@@ -607,12 +607,12 @@ public final class ASTRewriteFormatter {
public final Prefix VARARGS= new FormattingPrefix("void foo(A ... a) { }", "A ." , CodeFormatter.K_CLASS_BODY_DECLARATIONS); //$NON-NLS-1$ //$NON-NLS-2$
public final Prefix TRY_RESOURCES = new FormattingPrefix("try (A a = new A(); B b = new B()) {}", "; B" , CodeFormatter.K_STATEMENTS); //$NON-NLS-1$ //$NON-NLS-2$
public final Prefix TRY_RESOURCES_PAREN = new FormattingPrefix("try (A a = new A(); B b = new B()) {}", "y (" , CodeFormatter.K_STATEMENTS); //$NON-NLS-1$ //$NON-NLS-2$
-
+
public final BlockContext IF_BLOCK_WITH_ELSE= new BlockFormattingPrefixSuffix("if (true)", "else{}", 8); //$NON-NLS-1$ //$NON-NLS-2$
public final BlockContext IF_BLOCK_NO_ELSE= new BlockFormattingPrefix("if (true)", 8); //$NON-NLS-1$
public final BlockContext ELSE_AFTER_STATEMENT= new BlockFormattingPrefix("if (true) foo();else ", 15); //$NON-NLS-1$
public final BlockContext ELSE_AFTER_BLOCK= new BlockFormattingPrefix("if (true) {}else ", 11); //$NON-NLS-1$
-
+
public final Prefix CASE_SEPARATION= new FormattingPrefix("case A, B", "A" , CodeFormatter.K_EXPRESSION); //$NON-NLS-1$ //$NON-NLS-2$
public final BlockContext FOR_BLOCK= new BlockFormattingPrefix("for (;;) ", 7); //$NON-NLS-1$
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore.java
index e842dd8cb..6e60bf25f 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore.java
@@ -38,13 +38,13 @@ public final class RewriteEventStore {
* If enabled, then {@link ASTRewrite} and {@link ListRewrite}
* throw an {@link IllegalArgumentException} if a rewrite operation tries to insert an
* AST node in a place where nodes of this type are not allowed (node type not a subtype of
- * the structural property's type).
+ * the structural property's type).
* </p>
* <p>
* Disabled by default, since this hasn't been enforced from the beginning, and there are clients
* (e.g. in JDT UI refactorings) that rely on a bit of leeway here.
* E.g. the qualifier of a QualifiedName cannot be a MethodInvocation expression or a SimpleType, but
- * that's sometimes the easiest solution for such a change, and ASTRewrite has no problems with it.
+ * that's sometimes the easiest solution for such a change, and ASTRewrite has no problems with it.
* </p>
*/
public static boolean DEBUG = false;
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportGroupComparator.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportGroupComparator.java
index a227dbb0d..f90387555 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportGroupComparator.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportGroupComparator.java
@@ -73,7 +73,7 @@ final class ImportGroupComparator implements Comparator<ImportName>{
this.staticImportGroupByName = staticImportGroupsByName;
giro: */
final NavigableMap<String, ImportGroup> baseImportGroupByName; // OT
-
+
IndexedImportGroups(
NavigableMap<String, ImportGroup> typeImportGroupsByName,
NavigableMap<String, ImportGroup> staticImportGroupsByName,
@@ -105,7 +105,7 @@ final class ImportGroupComparator implements Comparator<ImportName>{
if (!needsTypeMatchAll && !needsStaticMatchAll) {
:giro */
boolean needsBaseMatchAll = !importOrder.contains(BASE_MATCH_ALL);
-
+
if (!needsTypeMatchAll && !needsStaticMatchAll) {
// SH}
return importOrder;
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/util/DOMASTUtil.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/util/DOMASTUtil.java
index 30306f841..e01136b4a 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/util/DOMASTUtil.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/util/DOMASTUtil.java
@@ -22,7 +22,7 @@ public class DOMASTUtil {
/**
* Validates if the given <code>AST</code> supports the provided <code>nodeType</code>. This API checks for node
* types supported from JLS 14 onwards and will return <code>true></code> for nodes added before JLS14.
- *
+ *
* @param ast
* the AST to be evaluated
* @param nodeType
@@ -40,7 +40,7 @@ public class DOMASTUtil {
* Validates if the given <code>apiLevel</code> and <code>previewEnabled</code> supports the provided
* <code>nodeType</code>. This API checks for node types supported from JLS 14 onwards and will return
* <code>true></code> for nodes added before JLS14.
- *
+ *
* @param apiLevel
* the level to be checked
* @param previewEnabled
@@ -88,7 +88,7 @@ public class DOMASTUtil {
public static boolean isRecordDeclarationSupported(int apiLevel, boolean previewEnabled) {
return isNodeTypeSupportedinAST(apiLevel, previewEnabled, ASTNode.RECORD_DECLARATION);
}
-
+
public static boolean isInstanceofExpressionPatternSupported(AST ast) {
return isNodeTypeSupportedinAST(ast, ASTNode.INSTANCEOF_EXPRESSION);
}
@@ -96,7 +96,7 @@ public class DOMASTUtil {
public static boolean isInstanceofExpressionPatternSupported(int apiLevel, boolean previewEnabled) {
return isNodeTypeSupportedinAST(apiLevel, previewEnabled, ASTNode.INSTANCEOF_EXPRESSION);
}
-
+
@SuppressWarnings("deprecation")
public static void checkASTLevel(int level) {
switch (level) {
@@ -113,7 +113,7 @@ public class DOMASTUtil {
return;
}
throw new IllegalArgumentException();
-
+
}
}
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetAllocationExpression.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetAllocationExpression.java
index ca0a8d555..5c2de268a 100644
--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetAllocationExpression.java
+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetAllocationExpression.java
@@ -15,7 +15,7 @@
* Bug 409245 - [1.8][compiler] Type annotations dropped when call is routed through a synthetic bridge method
* Bug 409250 - [1.8][compiler] Various loose ends in 308 code generation
* Stephan Herrmann - Contribution for
- * Bug 400874 - [1.8][compiler] Inference infrastructure should evolve to meet JLS8 18.x (Part G of JSR335 spec)
+ * Bug 400874 - [1.8][compiler] Inference infrastructure should evolve to meet JLS8 18.x (Part G of JSR335 spec)
* Bug 424415 - [1.8][compiler] Eventual resolution of ReferenceExpression is not seen to be happening.
* Bug 427438 - [1.8][compiler] NPE at org.eclipse.jdt.internal.compiler.ast.ConditionalExpression.generateCode(ConditionalExpression.java:280)
*******************************************************************************/
@@ -111,7 +111,7 @@ public void generateCode(BlockScope currentScope, CodeStream codeStream, boolea
codeStream.aastore();
if (i < argsLength - 1) {
codeStream.dup();
- }
+ }
}
} else {
codeStream.generateInlinedValue(0);
@@ -122,7 +122,7 @@ public void generateCode(BlockScope currentScope, CodeStream codeStream, boolea
}
codeStream.recordPositionsFrom(pc, this.sourceStart);
}
-/* Inner emulation consists in either recording a dependency
+/* Inner emulation consists in either recording a dependency
* link only, or performing one level of propagation.
*
* Dependency mechanism is used whenever dealing with source target
@@ -225,11 +225,11 @@ public TypeBinding resolveType(BlockScope scope) {
}
this.resolvedType = this.type.resolvedType = scope.environment().createParameterizedType(((ParameterizedTypeBinding) this.resolvedType).genericType(), inferredTypes, ((ParameterizedTypeBinding) this.resolvedType).enclosingType());
}
-
+
ReferenceBinding allocatedType = (ReferenceBinding) this.resolvedType;
this.binding = findConstructorBinding(scope, this, allocatedType, this.argumentTypes);
- if (!this.binding.isValidBinding()) {
+ if (!this.binding.isValidBinding()) {
if (this.binding instanceof ProblemMethodBinding
&& ((ProblemMethodBinding) this.binding).problemId() == NotVisible) {
if (this.evaluationContext.declaringTypeName != null) {
@@ -240,7 +240,7 @@ public TypeBinding resolveType(BlockScope scope) {
}
if (this.type != null && !this.type.resolvedType.isValidBinding()) {
return null;
- }
+ }
scope.problemReporter().invalidConstructor(this, this.binding);
return this.resolvedType;
}
@@ -250,11 +250,11 @@ public TypeBinding resolveType(BlockScope scope) {
}
if (this.type != null && !this.type.resolvedType.isValidBinding()) {
return null;
- }
+ }
scope.problemReporter().invalidConstructor(this, this.binding);
return this.resolvedType;
}
- CodeSnippetScope localScope = new CodeSnippetScope(scope);
+ CodeSnippetScope localScope = new CodeSnippetScope(scope);
MethodBinding privateBinding = localScope.getConstructor((ReferenceBinding)this.delegateThis.type, this.argumentTypes, this);
if (!privateBinding.isValidBinding()) {
if (this.binding.declaringClass == null) {
@@ -262,19 +262,19 @@ public TypeBinding resolveType(BlockScope scope) {
}
if (this.type != null && !this.type.resolvedType.isValidBinding()) {
return null;
- }
+ }
scope.problemReporter().invalidConstructor(this, this.binding);
return this.resolvedType;
} else {
this.binding = privateBinding;
- }
+ }
} else {
if (this.binding.declaringClass == null) {
this.binding.declaringClass = allocatedType;
}
if (this.type != null && !this.type.resolvedType.isValidBinding()) {
return null;
- }
+ }
scope.problemReporter().invalidConstructor(this, this.binding);
return this.resolvedType;
}
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetClassFile.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetClassFile.java
index c8c263274..6d4044466 100644
--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetClassFile.java
+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetClassFile.java
@@ -72,7 +72,7 @@ public CodeSnippetClassFile(
this.headerOffset += 2;
this.constantPool = new ConstantPool(this);
int accessFlags = aType.getAccessFlags();
-
+
if (!aType.isInterface()) { // class or enum
accessFlags |= ClassFileConstants.AccSuper;
}
@@ -206,7 +206,7 @@ public static void createProblemType(TypeDeclaration typeDeclaration, Compilatio
if (method == null) continue;
if (abstractMethodsOnly) {
method.modifiers = ClassFileConstants.AccPublic | ClassFileConstants.AccAbstract;
- }
+ }
if (method.isConstructor()) {
if (typeBinding.isInterface()) continue;
classFile.addProblemConstructor(methodDecl, method, problemsCopy);
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetCompiler.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetCompiler.java
index ebd78d191..c574533bf 100644
--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetCompiler.java
+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetCompiler.java
@@ -21,14 +21,14 @@ import org.eclipse.jdt.internal.compiler.env.INameEnvironment;
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
/**
- * A compiler that compiles code snippets.
+ * A compiler that compiles code snippets.
*/
public class CodeSnippetCompiler extends Compiler {
-
+
EvaluationContext evaluationContext;
int codeSnippetStart;
int codeSnippetEnd;
-
+
/**
* Creates a new code snippet compiler initialized with a code snippet parser.
*/
@@ -55,7 +55,7 @@ public class CodeSnippetCompiler extends Compiler {
this.parseThreshold = 1;
// fully parse only the code snippet compilation unit
}
-
+
@Override
public void initializeParser() {
this.parser =
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetEvaluator.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetEvaluator.java
index 58eef0afb..850d1811f 100644
--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetEvaluator.java
+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetEvaluator.java
@@ -68,13 +68,13 @@ protected void addEvaluationResultForCompilationProblem(Map<char[], EvaluationRe
switch(evaluationType) {
case EvaluationResult.T_PACKAGE:
evaluationID = this.context.packageName;
-
+
// shift line number, source start and source end
problem.setSourceLineNumber(1);
problem.setSourceStart(0);
problem.setSourceEnd(evaluationID.length - 1);
break;
-
+
case EvaluationResult.T_IMPORT:
evaluationID = sourceMapper.getImport(pbLineNumber);
@@ -86,13 +86,13 @@ protected void addEvaluationResultForCompilationProblem(Map<char[], EvaluationRe
case EvaluationResult.T_CODE_SNIPPET:
evaluationID = this.codeSnippet;
-
+
// shift line number, source start and source end
problem.setSourceLineNumber(pbLineNumber - this.mapper.lineNumberOffset);
problem.setSourceStart(problem.getSourceStart() - this.mapper.startPosOffset);
problem.setSourceEnd(problem.getSourceEnd() - this.mapper.startPosOffset);
break;
-
+
case EvaluationResult.T_INTERNAL:
evaluationID = cuSource;
break;
@@ -120,18 +120,18 @@ Compiler getCompiler(ICompilerRequestor compilerRequestor) {
Compiler compiler = null;
if (!DEVELOPMENT_MODE) {
// If we are not developping the code snippet support classes,
- // use a regular compiler and feed its lookup environment with
+ // use a regular compiler and feed its lookup environment with
// the code snippet support classes
CompilerOptions compilerOptions = new CompilerOptions(this.options);
compilerOptions.performMethodsFullRecovery = true;
compilerOptions.performStatementsRecovery = true;
- compiler =
+ compiler =
new CodeSnippetCompiler(
- this.environment,
- DefaultErrorHandlingPolicies.exitAfterAllProblems(),
- compilerOptions,
- compilerRequestor,
+ this.environment,
+ DefaultErrorHandlingPolicies.exitAfterAllProblems(),
+ compilerOptions,
+ compilerRequestor,
this.problemFactory,
this.context,
getMapper().startPosOffset,
@@ -164,10 +164,10 @@ Compiler getCompiler(ICompilerRequestor compilerRequestor) {
compilerOptions.performMethodsFullRecovery = true;
compilerOptions.performStatementsRecovery = true;
compiler = new Compiler(
- getWrapperEnvironment(),
- DefaultErrorHandlingPolicies.exitAfterAllProblems(),
- compilerOptions,
- compilerRequestor,
+ getWrapperEnvironment(),
+ DefaultErrorHandlingPolicies.exitAfterAllProblems(),
+ compilerOptions,
+ compilerRequestor,
this.problemFactory);
}
return compiler;
@@ -183,17 +183,17 @@ private CodeSnippetToCuMapper getMapper() {
} else {
varClassName = installedVars.className;
}
-
+
}
this.mapper = new CodeSnippetToCuMapper(
- this.codeSnippet,
+ this.codeSnippet,
this.context.packageName,
this.context.imports,
getClassName(),
varClassName,
- this.context.localVariableNames,
- this.context.localVariableTypeNames,
- this.context.localVariableModifiers,
+ this.context.localVariableNames,
+ this.context.localVariableTypeNames,
+ this.context.localVariableModifiers,
this.context.declaringTypeName,
this.context.lineSeparator,
CompilerOptions.versionToJdkLevel(this.options.get(JavaCore.COMPILER_COMPLIANCE))
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetFieldReference.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetFieldReference.java
index ba1aceacc..a5c596137 100644
--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetFieldReference.java
+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetFieldReference.java
@@ -15,7 +15,7 @@
* Bug 458396 - NPE in CodeStream.invoke()
*******************************************************************************/
package org.eclipse.jdt.internal.eval;
-
+
import org.eclipse.jdt.internal.compiler.ast.Assignment;
import org.eclipse.jdt.internal.compiler.ast.CompoundAssignment;
import org.eclipse.jdt.internal.compiler.ast.Expression;
@@ -158,10 +158,10 @@ public void generateCompoundAssignment(BlockScope currentScope, CodeStream codeS
codeStream.generateImplicitConversion(this.implicitConversion);
// generate the increment value (will by itself be promoted to the operation value)
if (expression == IntLiteral.One){ // prefix operation
- codeStream.generateConstant(expression.constant, this.implicitConversion);
+ codeStream.generateConstant(expression.constant, this.implicitConversion);
} else {
expression.generateCode(currentScope, codeStream, true);
- }
+ }
// perform the operation
codeStream.sendOperator(operator, operationTypeID);
// cast the value back to the array reference type
@@ -195,10 +195,10 @@ public void generateCompoundAssignment(BlockScope currentScope, CodeStream codeS
codeStream.generateImplicitConversion(this.implicitConversion);
// generate the increment value (will by itself be promoted to the operation value)
if (expression == IntLiteral.One){ // prefix operation
- codeStream.generateConstant(expression.constant, this.implicitConversion);
+ codeStream.generateConstant(expression.constant, this.implicitConversion);
} else {
expression.generateCode(currentScope, codeStream, true);
- }
+ }
// perform the operation
codeStream.sendOperator(operator, operationTypeID);
// cast the value back to the array reference type
@@ -214,7 +214,7 @@ public void generateCompoundAssignment(BlockScope currentScope, CodeStream codeS
}
}
// current stack is:
- // value field receiver value
+ // value field receiver value
codeStream.generateEmulatedWriteAccessForField(codegenBinding);
}
}
@@ -294,9 +294,9 @@ public void manageSyntheticAccessIfNecessary(BlockScope currentScope, FlowInfo f
public TypeBinding resolveType(BlockScope scope) {
// Answer the signature type of the field.
// constants are propaged when the field is final
- // and initialized with a (compile time) constant
+ // and initialized with a (compile time) constant
- // regular receiver reference
+ // regular receiver reference
this.actualReceiverType = this.receiver.resolveType(scope);
if (this.actualReceiverType == null){
this.constant = Constant.NotAConstant;
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetMessageSend.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetMessageSend.java
index eaf1af6eb..2d955e3fd 100644
--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetMessageSend.java
+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetMessageSend.java
@@ -86,7 +86,7 @@ public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean
this.receiver.generateCode(currentScope, codeStream, !isStatic);
if ((this.bits & NeedReceiverGenericCast) != 0) {
codeStream.checkcast(this.actualReceiverType);
- }
+ }
codeStream.recordPositionsFrom(pc, this.sourceStart);
}
// generate arguments
@@ -116,7 +116,7 @@ public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean
this.receiver.generateCode(currentScope, codeStream, !isStatic);
if ((this.bits & NeedReceiverGenericCast) != 0) {
codeStream.checkcast(this.actualReceiverType);
- }
+ }
codeStream.recordPositionsFrom(pc, this.sourceStart);
}
if (isStatic) {
@@ -203,7 +203,7 @@ public void manageSyntheticAccessIfNecessary(BlockScope currentScope, FlowInfo f
public TypeBinding resolveType(BlockScope scope) {
// Answer the signature return type
// Base type promotion
-
+
if (this.constant != Constant.NotAConstant) {
this.constant = Constant.NotAConstant;
boolean receiverCast = false;
@@ -274,9 +274,9 @@ public TypeBinding resolveType(BlockScope scope) {
} finally {
AnchorMapping.removeCurrentMapping(anchorMapping);
}
- afterMethodLookup(scope, anchorMapping, this.argumentTypes, this.binding.returnType);
+ afterMethodLookup(scope, anchorMapping, this.argumentTypes, this.binding.returnType);
//jwl}
-
+
if (!this.binding.isValidBinding()) {
if (this.binding instanceof ProblemMethodBinding
&& ((ProblemMethodBinding) this.binding).problemId() == ProblemReasons.NotVisible) {
@@ -349,7 +349,7 @@ public TypeBinding resolveType(BlockScope scope) {
this.receiver.computeConversion(scope, this.actualReceiverType, this.actualReceiverType);
if (TypeBinding.notEquals(this.actualReceiverType, oldReceiverType) && TypeBinding.notEquals(this.receiver.postConversionType(scope), this.actualReceiverType)) { // record need for explicit cast at codegen since receiver could not handle it
this.bits |= NeedReceiverGenericCast;
- }
+ }
}
}
if (checkInvocationArguments(scope, this.receiver, this.actualReceiverType, this.binding, this.arguments, this.argumentTypes, this.argsContainCast, this)) {
@@ -374,12 +374,12 @@ public TypeBinding resolveType(BlockScope scope) {
this.resolvedType = this.actualReceiverType;
} else {
TypeBinding returnType = this.binding.returnType;
-
+
if (returnType != null) {
if ((this.bits & ASTNode.Unchecked) != 0 && this.genericTypeArguments == null) {
returnType = scope.environment().convertToRawType(returnType.erasure(), true);
}
- returnType = returnType.capture(scope, this.sourceStart, this.sourceEnd);
+ returnType = returnType.capture(scope, this.sourceStart, this.sourceEnd);
}
this.resolvedType = returnType;
}
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetParser.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetParser.java
index fdc6db831..575587fe3 100644
--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetParser.java
+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetParser.java
@@ -76,7 +76,7 @@ protected void classInstanceCreation(boolean alwaysQualified) {
}
alloc.type = getTypeReference(0);
checkForDiamond(alloc.type);
-
+
//the default constructor with the correct number of argument
//will be created and added by the TC (see createsInternalConstructorWithBinding)
alloc.sourceStart = this.intStack[this.intPtr--];
@@ -366,10 +366,10 @@ protected void consumeMethodDeclaration(boolean isNotAbstract, boolean isDefault
newStatements[varCount] = tryStatement;
methodDecl.statements = newStatements;
-//{ObjectTeams: new flag:
+//{ObjectTeams: new flag:
methodDecl.hasParsedStatements = true;
-// SH}
-
+// SH}
+
}
}
@Override
@@ -420,20 +420,20 @@ protected void consumeMethodInvocationNameWithTypeArguments() {
&& this.scanner.startPosition <= this.codeSnippetEnd + 1 + this.lineSeparatorLength // 14838
&& isTopLevelType()) {
-
+
MessageSend m = newMessageSendWithTypeArguments();
m.sourceEnd = this.rParenPos;
m.sourceStart =
(int) ((m.nameSourcePosition = this.identifierPositionStack[this.identifierPtr]) >>> 32);
m.selector = this.identifierStack[this.identifierPtr--];
this.identifierLengthPtr--;
-
+
// handle type arguments
int length = this.genericsLengthStack[this.genericsLengthPtr--];
this.genericsPtr -= length;
System.arraycopy(this.genericsStack, this.genericsPtr + 1, m.typeArguments = new TypeReference[length], 0, length);
this.intPtr--;
-
+
m.receiver = getUnspecifiedReference();
m.sourceStart = m.receiver.sourceStart;
pushOnExpressionStack(m);
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetQualifiedNameReference.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetQualifiedNameReference.java
index 5a2bd8d0b..1df9f03c1 100644
--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetQualifiedNameReference.java
+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetQualifiedNameReference.java
@@ -172,8 +172,8 @@ public void generateAssignment(BlockScope currentScope, CodeStream codeStream, A
break;
default :
codeStream.dup_x2();
- break;
- }
+ break;
+ }
}
codeStream.generateEmulatedWriteAccessForField(lastFieldBinding);
if (valueRequired) {
@@ -233,7 +233,7 @@ public void generateCompoundAssignment(BlockScope currentScope, CodeStream codeS
break;
default :
codeStream.dup_x2();
- break;
+ break;
}
}
// current stack is:
@@ -257,8 +257,8 @@ public void generatePostIncrement(BlockScope currentScope, CodeStream codeStream
break;
default :
codeStream.dup();
- break;
- }
+ break;
+ }
}
codeStream.generateEmulationForField(lastFieldBinding);
if ((TypeBinding.equalsEquals(lastFieldBinding.type, TypeBinding.LONG)) || (TypeBinding.equalsEquals(lastFieldBinding.type, TypeBinding.DOUBLE))) {
@@ -301,7 +301,7 @@ public FieldBinding generateReadSequence(BlockScope currentScope, CodeStream cod
TypeBinding lastGenericCast;
TypeBinding lastReceiverType;
boolean complyTo14 = currentScope.compilerOptions().complianceLevel >= ClassFileConstants.JDK1_4;
-
+
switch (this.bits & RestrictiveFlagMASK) {
case Binding.FIELD :
lastFieldBinding = ((FieldBinding) this.binding).original();
@@ -361,7 +361,7 @@ public FieldBinding generateReadSequence(BlockScope currentScope, CodeStream cod
}
break;
default : // should not occur
- return null;
+ return null;
}
// all intermediate field accesses are read accesses
// only the last field binding is a write access
@@ -444,10 +444,10 @@ public FieldBinding generateReadSequence(BlockScope currentScope, CodeStream cod
if (lastFieldBinding.isStatic()) {
codeStream.aconst_null();
}
- }
+ }
}
}
- return lastFieldBinding;
+ return lastFieldBinding;
}
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetReturnStatement.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetReturnStatement.java
index ccd04ea61..920630b2c 100644
--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetReturnStatement.java
+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetReturnStatement.java
@@ -57,7 +57,7 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl
*/
@Override
public void generateReturnBytecode(CodeStream codeStream) {
-
+
// output the return bytecode
codeStream.return_();
}
@@ -85,7 +85,7 @@ public void generateStoreSaveValueIfNecessary(Scope scope, CodeStream codeStream
}
// generate wrapper if needed
- if (this.expression.resolvedType.isBaseType() && this.expression.resolvedType != TypeBinding.NULL) {
+ if (this.expression.resolvedType.isBaseType() && this.expression.resolvedType != TypeBinding.NULL) {
codeStream.generateBoxingConversion(this.expression.resolvedType.id);
}
@@ -121,7 +121,7 @@ public boolean needValue(){
}
@Override
public void prepareSaveValueLocation(TryStatement targetTryStatement){
-
+
// do nothing: no storage is necessary for snippets
}
@Override
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetScope.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetScope.java
index 3a77881df..1f7426124 100644
--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetScope.java
+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetScope.java
@@ -13,7 +13,7 @@
* Jesper S Moller <jesper@selskabet.org> - Contributions for
* bug 378674 - "The method can be declared as static" is wrong
* Stephan Herrmann - Contribution for
- * Bug 424167 - [1.8] Fully integrate type inference with overload resolution
+ * Bug 424167 - [1.8] Fully integrate type inference with overload resolution
*******************************************************************************/
package org.eclipse.jdt.internal.eval;
@@ -133,7 +133,7 @@ public final boolean canBeSeenByForCodeSnippet(FieldBinding fieldBinding, TypeBi
TypeBinding originalDeclaringClass = fieldBinding.declaringClass .original();
do {
if (type.isCapture()) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=285002
- if (TypeBinding.equalsEquals(originalDeclaringClass, type.erasure().original())) return true;
+ if (TypeBinding.equalsEquals(originalDeclaringClass, type.erasure().original())) return true;
} else {
if (TypeBinding.equalsEquals(originalDeclaringClass, type.original())) return true;
}
@@ -229,9 +229,9 @@ public final boolean canBeSeenByForCodeSnippet(ReferenceBinding referenceBinding
if (TypeBinding.equalsEquals(receiverType, referenceBinding)) return true;
if (referenceBinding.isProtected()) {
- // answer true if the receiver (or its enclosing type) is the superclass
+ // answer true if the receiver (or its enclosing type) is the superclass
// of the receiverType or in the same package
- return receiverType.fPackage == referenceBinding.fPackage
+ return receiverType.fPackage == referenceBinding.fPackage
|| referenceBinding.isSuperclassOf(receiverType)
|| referenceBinding.enclosingType().isSuperclassOf(receiverType); // protected types always have an enclosing one
}
@@ -425,7 +425,7 @@ public MethodBinding findMethodForArray(ArrayBinding receiverType, char[] select
Only if all of the input is consumed is the type answered
All other conditions are errors, and a problem binding is returned.
-
+
NOTE: If a problem binding is returned, senders should extract the compound name
from the binding & not assume the problem applies to the entire compoundName.
@@ -466,7 +466,7 @@ public Binding getBinding(char[][] compoundName, int mask, InvocationSite invoca
if (binding instanceof ReferenceBinding) {
if (!binding.isValidBinding())
return new ProblemReferenceBinding(
- CharOperation.subarray(compoundName, 0, currentIndex),
+ CharOperation.subarray(compoundName, 0, currentIndex),
(ReferenceBinding)((ReferenceBinding)binding).closestMatch(),
binding.problemId());
if (!this.canBeSeenByForCodeSnippet((ReferenceBinding) binding, receiverType))
@@ -488,8 +488,8 @@ public Binding getBinding(char[][] compoundName, int mask, InvocationSite invoca
if ((binding = findFieldForCodeSnippet(typeBinding, nextName, invocationSite)) != null) {
if (!binding.isValidBinding()) {
return new ProblemFieldBinding(
- (FieldBinding)binding,
- ((FieldBinding)binding).declaringClass,
+ (FieldBinding)binding,
+ ((FieldBinding)binding).declaringClass,
CharOperation.concatWith(CharOperation.subarray(compoundName, 0, currentIndex), '.'),
binding.problemId());
}
@@ -499,7 +499,7 @@ public Binding getBinding(char[][] compoundName, int mask, InvocationSite invoca
return new ProblemBinding(CharOperation.subarray(compoundName, 0, currentIndex), typeBinding, ProblemReasons.NotFound);
if (!binding.isValidBinding())
return new ProblemReferenceBinding(
- CharOperation.subarray(compoundName, 0, currentIndex),
+ CharOperation.subarray(compoundName, 0, currentIndex),
(ReferenceBinding)((ReferenceBinding)binding).closestMatch(),
binding.problemId());
}
@@ -508,12 +508,12 @@ public Binding getBinding(char[][] compoundName, int mask, InvocationSite invoca
FieldBinding field = (FieldBinding) binding;
if (!field.isStatic()) {
return new ProblemFieldBinding(
- field,
+ field,
field.declaringClass,
CharOperation.concatWith(CharOperation.subarray(compoundName, 0, currentIndex), '.'),
ProblemReasons.NonStaticReferenceInStaticContext);
}
- // Since a qualified reference must be for a static member, it won't affect static-ness of the enclosing method,
+ // Since a qualified reference must be for a static member, it won't affect static-ness of the enclosing method,
// so we don't have to call resetEnclosingMethodStaticFlag() in this case
return binding;
}
@@ -528,7 +528,7 @@ public Binding getBinding(char[][] compoundName, int mask, InvocationSite invoca
Answer the constructor binding that corresponds to receiverType, argumentTypes.
- InvocationSite implements
+ InvocationSite implements
isSuperAccess(); this is used to determine if the discovered constructor is visible.
If no visible constructor is discovered, an error binding is answered.
@@ -595,7 +595,7 @@ public FieldBinding getFieldForCodeSnippet(TypeBinding receiverType, char[] fiel
Answer the method binding that corresponds to selector, argumentTypes.
Start the lookup at the enclosing type of the receiver.
- InvocationSite implements
+ InvocationSite implements
isSuperAccess(); this is used to determine if the discovered method is visible.
setDepth(int); this is used to record the depth of the discovered method
relative to the enclosing type of the receiver. (If the method is defined
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetSingleNameReference.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetSingleNameReference.java
index e1ec3dd8d..6872a5bfb 100644
--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetSingleNameReference.java
+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetSingleNameReference.java
@@ -471,7 +471,7 @@ public void generateCompoundAssignment(BlockScope currentScope, CodeStream codeS
default:
codeStream.dup_x2();
break;
- }
+ }
}
// current stack is:
// value field receiver value
@@ -489,7 +489,7 @@ public void generateCompoundAssignment(BlockScope currentScope, CodeStream codeS
default:
codeStream.dup();
break;
- }
+ }
}
codeStream.store(localBinding, false);
}
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton.java
index b2bd84512..06dc1f809 100644
--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton.java
+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton.java
@@ -45,7 +45,7 @@ public class CodeSnippetSkeleton implements IBinaryType, EvaluationConstants {
char[] methodDescriptor;
char[] selector;
boolean isConstructor;
-
+
public BinaryMethodSkeleton(char[] selector, char[] methodDescriptor, char[][] exceptionTypeNames, boolean isConstructor) {
this.selector = selector;
this.methodDescriptor = methodDescriptor;
@@ -90,7 +90,7 @@ public class CodeSnippetSkeleton implements IBinaryType, EvaluationConstants {
}
@Override
public IBinaryTypeAnnotation[] getTypeAnnotations() {
- return null;
+ return null;
}
@Override
public char[] getSelector() {
@@ -130,7 +130,7 @@ public class CodeSnippetSkeleton implements IBinaryType, EvaluationConstants {
false
)
};
-
+
/**
* CodeSnippetSkeleton constructor comment.
*/
@@ -143,7 +143,7 @@ public IBinaryAnnotation[] getAnnotations() {
}
@Override
public IBinaryTypeAnnotation[] getTypeAnnotations() {
- return null;
+ return null;
}
@Override
public char[] getEnclosingMethod() {
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetSuperReference.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetSuperReference.java
index 4468892c2..f78b16e89 100644
--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetSuperReference.java
+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetSuperReference.java
@@ -24,13 +24,13 @@ import org.eclipse.jdt.internal.compiler.lookup.Scope;
import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
/**
- * A super reference inside a code snippet denotes a reference to the super type of
- * the remote receiver object (that is, the receiver of the context in the stack frame). This is
+ * A super reference inside a code snippet denotes a reference to the super type of
+ * the remote receiver object (that is, the receiver of the context in the stack frame). This is
* used to report an error through JavaModelException according to the fact that super
* reference are not supported in code snippet.
*/
public class CodeSnippetSuperReference extends SuperReference implements EvaluationConstants, InvocationSite {
-
+
public CodeSnippetSuperReference(int pos, int sourceEnd) {
super(pos, sourceEnd);
}
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetThisReference.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetThisReference.java
index 7b1a4aef0..469ece42a 100644
--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetThisReference.java
+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetThisReference.java
@@ -35,11 +35,11 @@ import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
* receiver object (that is, the receiver of the context in the stack frame)
*/
public class CodeSnippetThisReference extends ThisReference implements EvaluationConstants, InvocationSite {
-
+
EvaluationContext evaluationContext;
FieldBinding delegateThis;
boolean isImplicit;
-
+
/**
* CodeSnippetThisReference constructor comment.
* @param s int
@@ -50,7 +50,7 @@ public class CodeSnippetThisReference extends ThisReference implements Evaluatio
this.evaluationContext = evaluationContext;
this.isImplicit = isImplicit;
}
-
+
@Override
public boolean checkAccess(BlockScope scope, ReferenceBinding thisType) {
// this/super cannot be used in constructor call
@@ -59,7 +59,7 @@ public class CodeSnippetThisReference extends ThisReference implements Evaluatio
methodScope.problemReporter().fieldsOrThisBeforeConstructorInvocation(this);
return false;
}
-
+
// static may not refer to this/super
if (this.evaluationContext.declaringTypeName == null || this.evaluationContext.isStatic) {
methodScope.problemReporter().errorThisSuperInStatic(this);
@@ -68,7 +68,7 @@ public class CodeSnippetThisReference extends ThisReference implements Evaluatio
scope.tagAsAccessingEnclosingInstanceStateOf(thisType, false /* type variable access */);
return true;
}
-
+
@Override
public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean valueRequired) {
int pc = codeStream.position;
@@ -78,15 +78,15 @@ public class CodeSnippetThisReference extends ThisReference implements Evaluatio
}
codeStream.recordPositionsFrom(pc, this.sourceStart);
}
-
+
/**
* @see org.eclipse.jdt.internal.compiler.lookup.InvocationSite#genericTypeArguments()
*/
@Override
public TypeBinding[] genericTypeArguments() {
return null;
- }
-
+ }
+
@Override
public InferenceContext18 freshInferenceContext(Scope scope) {
return null;
@@ -96,24 +96,24 @@ public class CodeSnippetThisReference extends ThisReference implements Evaluatio
public boolean isSuperAccess(){
return false;
}
-
+
@Override
public boolean isTypeAccess(){
return false;
}
-
+
@Override
public StringBuffer printExpression(int indent, StringBuffer output){
-
+
char[] declaringType = this.evaluationContext.declaringTypeName;
output.append('(');
- if (declaringType == null)
+ if (declaringType == null)
output.append("<NO DECLARING TYPE>"); //$NON-NLS-1$
- else
+ else
output.append(declaringType);
return output.append(")this"); //$NON-NLS-1$
}
-
+
@Override
public TypeBinding resolveType(BlockScope scope) {
// implicit this
@@ -123,7 +123,7 @@ public class CodeSnippetThisReference extends ThisReference implements Evaluatio
if (!this.isImplicit && !checkAccess(scope, snippetType)) {
return null;
}
-
+
this.delegateThis = scope.getField(snippetType, DELEGATE_THIS, this);
if (this.delegateThis == null || !this.delegateThis.isValidBinding()) {
// should not happen
@@ -133,17 +133,17 @@ public class CodeSnippetThisReference extends ThisReference implements Evaluatio
}
return this.resolvedType = this.delegateThis.type;
}
-
+
@Override
public void setActualReceiverType(ReferenceBinding receiverType) {
// ignored
}
-
+
@Override
public void setDepth(int depth){
// ignored
}
-
+
@Override
public void setFieldIndex(int index){
// ignored
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetToCuMapper.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetToCuMapper.java
index e513324c5..00be115f4 100644
--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetToCuMapper.java
+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetToCuMapper.java
@@ -41,7 +41,7 @@ class CodeSnippetToCuMapper implements EvaluationConstants {
* The generated compilation unit.
*/
public char[] cuSource;
-
+
/**
* Where the code snippet starts in the generated compilation unit.
*/
@@ -52,14 +52,14 @@ class CodeSnippetToCuMapper implements EvaluationConstants {
char[] codeSnippet;
char[] snippetPackageName;
char[][] snippetImports;
- char[] snippetClassName;
+ char[] snippetClassName;
char[] snippetVarClassName;
char[] snippetDeclaringTypeName;
// Mapping of external local variables
char[][] localVarNames;
char[][] localVarTypeNames;
-
+
long complianceVersion;
/**
@@ -168,7 +168,7 @@ private void buildCUSource(String lineSeparator) {
}
/**
* Returns a completion requestor that wraps the given requestor and shift the results
- * according to the start offset and line number offset of the code snippet in the generated compilation unit.
+ * according to the start offset and line number offset of the code snippet in the generated compilation unit.
*/
public CompletionRequestor getCompletionRequestor(final CompletionRequestor originalRequestor) {
return new CompletionRequestor() {
@@ -182,11 +182,11 @@ public CompletionRequestor getCompletionRequestor(final CompletionRequestor orig
// Remove completion on generated class name or generated global variable class name
char[] packageName = proposal.getDeclarationSignature();
char[] className = Signature.getSignatureSimpleName(proposal.getSignature());
- if (CharOperation.equals(packageName, CodeSnippetToCuMapper.this.snippetPackageName)
+ if (CharOperation.equals(packageName, CodeSnippetToCuMapper.this.snippetPackageName)
&& (CharOperation.equals(className, CodeSnippetToCuMapper.this.snippetClassName)
|| CharOperation.equals(className, CodeSnippetToCuMapper.this.snippetVarClassName))) return;
-
- if (CharOperation.equals(packageName, PACKAGE_NAME)
+
+ if (CharOperation.equals(packageName, PACKAGE_NAME)
&& CharOperation.equals(className, ROOT_CLASS_NAME)) return;
}
break;
@@ -196,17 +196,17 @@ public CompletionRequestor getCompletionRequestor(final CompletionRequestor orig
// Remove completion on generated method
char[] declaringTypePackageName = Signature.getSignatureQualifier(proposal.getDeclarationSignature());
char[] declaringTypeName = Signature.getSignatureSimpleName(proposal.getDeclarationSignature());
-
- if (CharOperation.equals(declaringTypePackageName, CodeSnippetToCuMapper.this.snippetPackageName)
+
+ if (CharOperation.equals(declaringTypePackageName, CodeSnippetToCuMapper.this.snippetPackageName)
&& CharOperation.equals(declaringTypeName, CodeSnippetToCuMapper.this.snippetClassName)) return;
-
- if (CharOperation.equals(declaringTypePackageName, PACKAGE_NAME)
+
+ if (CharOperation.equals(declaringTypePackageName, PACKAGE_NAME)
&& CharOperation.equals(declaringTypeName, ROOT_CLASS_NAME)) return;
break;
}
originalRequestor.accept(proposal);
}
-
+
@Override
public void completionFailure(IProblem problem) {
problem.setSourceStart(problem.getSourceStart() - CodeSnippetToCuMapper.this.startPosOffset);
@@ -214,32 +214,32 @@ public CompletionRequestor getCompletionRequestor(final CompletionRequestor orig
problem.setSourceLineNumber(problem.getSourceLineNumber() - CodeSnippetToCuMapper.this.lineNumberOffset);
originalRequestor.completionFailure(problem);
}
-
+
@Override
public void acceptContext(CompletionContext context) {
originalRequestor.acceptContext(context);
}
-
+
@Override
public void beginReporting() {
originalRequestor.beginReporting();
}
-
+
@Override
public void endReporting() {
originalRequestor.endReporting();
}
-
+
@Override
public boolean isIgnored(int completionProposalKind) {
return originalRequestor.isIgnored(completionProposalKind);
}
-
+
@Override
public void setIgnored(int completionProposalKind, boolean ignore) {
originalRequestor.setIgnored(completionProposalKind, ignore);
}
-
+
@Override
public boolean isAllowingRequiredProposals(int mainKind, int requiredKind) {
return originalRequestor.isAllowingRequiredProposals(mainKind, requiredKind);
@@ -263,7 +263,7 @@ public char[] getCUSource(String lineSeparator) {
public int getEvaluationType(int lineNumber) {
int currentLine = 1;
- // check package declaration
+ // check package declaration
if (this.snippetPackageName != null && this.snippetPackageName.length != 0) {
if (lineNumber == 1) {
return EvaluationResult.T_PACKAGE;
@@ -280,7 +280,7 @@ public int getEvaluationType(int lineNumber) {
// check generated fields
currentLine +=
- (this.snippetDeclaringTypeName == null ? 0 : 1)
+ (this.snippetDeclaringTypeName == null ? 0 : 1)
+ (this.localVarNames == null ? 0 : this.localVarNames.length);
if (currentLine > lineNumber) {
return EvaluationResult.T_INTERNAL;
@@ -296,7 +296,7 @@ public int getEvaluationType(int lineNumber) {
return EvaluationResult.T_INTERNAL;
}
/**
- * Returns the import defined at the given line number.
+ * Returns the import defined at the given line number.
*/
public char[] getImport(int lineNumber) {
int importStartLine = this.lineNumberOffset - 1 - this.snippetImports.length;
@@ -304,7 +304,7 @@ public char[] getImport(int lineNumber) {
}
/**
* Returns a selection requestor that wraps the given requestor and shift the problems
- * according to the start offset and line number offset of the code snippet in the generated compilation unit.
+ * according to the start offset and line number offset of the code snippet in the generated compilation unit.
*/
public ISelectionRequestor getSelectionRequestor(final ISelectionRequestor originalRequestor) {
return new ISelectionRequestor() {
@@ -331,7 +331,7 @@ public ISelectionRequestor getSelectionRequestor(final ISelectionRequestor origi
public void acceptPackage(char[] packageName) {
originalRequestor.acceptPackage(packageName);
}
-
+
@Override
public void acceptTypeParameter(char[] declaringTypePackageName, char[] declaringTypeName, char[] typeParameterName, boolean isDeclaration, int start, int end) {
originalRequestor.acceptTypeParameter(declaringTypePackageName, declaringTypeName, typeParameterName, isDeclaration, start, end);
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetTypeDeclaration.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetTypeDeclaration.java
index c2cf37f4a..330d96b22 100644
--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetTypeDeclaration.java
+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetTypeDeclaration.java
@@ -35,7 +35,7 @@ public CodeSnippetTypeDeclaration(CompilationResult compilationResult){
public void generateCode(ClassFile enclosingClassFile) {
if ((this.bits & ASTNode.HasBeenGenerated) != 0) return;
this.bits |= ASTNode.HasBeenGenerated;
-
+
if (this.ignoreFurtherInvestigation) {
if (this.binding == null)
return;
@@ -74,7 +74,7 @@ public void generateCode(ClassFile enclosingClassFile) {
this.methods[i].generateCode(this.scope, classFile);
}
}
-
+
// generate all methods
classFile.addSpecialMethods();
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/EvaluationConstants.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/EvaluationConstants.java
index 59ebb94c3..ef4155ee4 100644
--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/EvaluationConstants.java
+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/EvaluationConstants.java
@@ -30,5 +30,5 @@ public interface EvaluationConstants {
public static final String RESULT_TYPE_FIELD = "resultType"; //$NON-NLS-1$
public static final char[] LOCAL_VAR_PREFIX = "val$".toCharArray(); //$NON-NLS-1$
public static final char[] DELEGATE_THIS = "val$this".toCharArray(); //$NON-NLS-1$
-
+
}
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/EvaluationContext.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/EvaluationContext.java
index d5e103e80..cbd41a8ac 100644
--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/EvaluationContext.java
+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/EvaluationContext.java
@@ -63,7 +63,7 @@ public class EvaluationContext implements EvaluationConstants, SuffixConstants {
int[] localVariableModifiers;
char[][] localVariableTypeNames;
char[][] localVariableNames;
-
+
/* can 'this' be used in this context */
boolean isStatic;
boolean isConstructorCall;
@@ -92,12 +92,12 @@ public GlobalVariable[] allVariables() {
* Computes a completion at the specified position of the given code snippet.
* (Note that this evaluation context's VM doesn't need to be running.)
*
- * @param environment
+ * @param environment
* used to resolve type/package references and search for types/packages
* based on partial names.
*
- * @param requestor
- * since the engine might produce answers of various forms, the engine
+ * @param requestor
+ * since the engine might produce answers of various forms, the engine
* is associated with a requestor able to accept all possible completions.
*
* @param options
@@ -105,7 +105,7 @@ public GlobalVariable[] allVariables() {
*
* @param owner
* the owner of working copies that take precedence over their original compilation units
- *
+ *
* @param monitor
* the progress monitor used to report progress
*/
@@ -137,14 +137,14 @@ public void complete(
final char[] className = "CodeSnippetCompletion".toCharArray(); //$NON-NLS-1$
final long complianceVersion = CompilerOptions.versionToJdkLevel(options.get(JavaCore.COMPILER_COMPLIANCE));
final CodeSnippetToCuMapper mapper = new CodeSnippetToCuMapper(
- codeSnippet,
- this.packageName,
- this.imports,
- className,
+ codeSnippet,
+ this.packageName,
+ this.imports,
+ className,
this.installedVars == null ? null : this.installedVars.className,
- this.localVariableNames,
- this.localVariableTypeNames,
- this.localVariableModifiers,
+ this.localVariableNames,
+ this.localVariableTypeNames,
+ this.localVariableModifiers,
this.declaringTypeName,
this.lineSeparator,
complianceVersion
@@ -176,15 +176,15 @@ public void complete(
return null;
}
};
-
+
CompletionEngine engine = new CompletionEngine(environment, mapper.getCompletionRequestor(requestor), options, project, owner, monitor);
-
+
if (this.installedVars != null) {
IBinaryType binaryType = getRootCodeSnippetBinary();
if (binaryType != null) {
engine.lookupEnvironment.cacheBinaryType(binaryType, null /*no access restriction*/);
}
-
+
ClassFile[] classFiles = this.installedVars.classFiles;
for (int i = 0; i < classFiles.length; i++) {
ClassFile classFile = classFiles[i];
@@ -197,7 +197,7 @@ public void complete(
engine.lookupEnvironment.cacheBinaryType(binary, null /*no access restriction*/);
}
}
-
+
engine.complete(sourceUnit, mapper.startPosOffset + completionPosition, mapper.startPosOffset, null/*extended context isn't computed*/);
}
/**
@@ -239,7 +239,7 @@ private void deployCodeSnippetClassIfNeeded(IRequestor requestor) throws Install
return EvaluationConstants.ROOT_COMPOUND_NAME;
}
}
- },
+ },
null))
throw new InstallException();
}
@@ -249,9 +249,9 @@ private void deployCodeSnippetClassIfNeeded(IRequestor requestor) throws Install
* @exception org.eclipse.jdt.internal.eval.InstallException if the code snippet class files could not be deployed.
*/
public void evaluate(
- char[] codeSnippet,
+ char[] codeSnippet,
char[][] contextLocalVariableTypeNames,
- char[][] contextLocalVariableNames,
+ char[][] contextLocalVariableNames,
int[] contextLocalVariableModifiers,
char[] contextDeclaringTypeName,
boolean contextIsStatic,
@@ -291,16 +291,16 @@ public void evaluate(
if (this.varsChanged) {
evaluateVariables(environment, options, forwardingRequestor, problemFactory);
}
-
+
// Compile code snippet if there was no errors while evaluating the variables
if (!forwardingRequestor.hasErrors) {
- Evaluator evaluator =
+ Evaluator evaluator =
new CodeSnippetEvaluator(
codeSnippet,
- this,
+ this,
environment,
- options,
- requestor,
+ options,
+ requestor,
problemFactory);
ClassFile[] classes = evaluator.getClasses();
// Send code snippet on target
@@ -422,7 +422,7 @@ public void evaluateVariables(INameEnvironment environment, Map<String, String>
return -1;
}
});
-
+
// Send classes
if (!requestor.acceptClassFiles(classes, null)) {
throw new InstallException();
@@ -431,7 +431,7 @@ public void evaluateVariables(INameEnvironment environment, Map<String, String>
// Remember that the variables have been installed
int count = this.variableCount;
GlobalVariable[] variablesCopy = new GlobalVariable[count];
- System.arraycopy(this.variables, 0, variablesCopy, 0, count);
+ System.arraycopy(this.variables, 0, variablesCopy, 0, count);
this.installedVars = new VariablesInfo(evaluator.getPackageName(), evaluator.getClassName(), classes, variablesCopy, count);
VAR_CLASS_COUNTER++;
}
@@ -532,7 +532,7 @@ public char[][] getImports() {
}
/**
* Returns the dot-separated name of the package code snippets are run into.
- * Returns an empty array for the default package. This is the default if
+ * Returns an empty array for the default package. This is the default if
* the package name has never been set.
*/
public char[] getPackageName() {
@@ -571,23 +571,23 @@ public GlobalVariable newVariable(char[] typeName, char[] name, char[] initializ
* (Note that this evaluation context's VM doesn't need to be running.)
* @param codeSnippet char[]
* The code snipper source
- *
+ *
* @param selectionSourceStart int
- *
+ *
* @param selectionSourceEnd int
- *
+ *
* @param environment org.eclipse.jdt.internal.core.SearchableEnvironment
* used to resolve type/package references and search for types/packages
* based on partial names.
*
* @param requestor org.eclipse.jdt.internal.codeassist.ISelectionRequestor
- * since the engine might produce answers of various forms, the engine
+ * since the engine might produce answers of various forms, the engine
* is associated with a requestor able to accept all possible selections.
*
* @param options java.util.Map
* set of options used to configure the code assist engine.
*/
-public void select(
+public void select(
char[] codeSnippet,
int selectionSourceStart,
int selectionSourceEnd,
@@ -599,14 +599,14 @@ public void select(
final char[] className = "CodeSnippetSelection".toCharArray(); //$NON-NLS-1$
final long complianceVersion = CompilerOptions.versionToJdkLevel(options.get(JavaCore.COMPILER_COMPLIANCE));
final CodeSnippetToCuMapper mapper = new CodeSnippetToCuMapper(
- codeSnippet,
- this.packageName,
- this.imports,
- className,
+ codeSnippet,
+ this.packageName,
+ this.imports,
+ className,
this.installedVars == null ? null : this.installedVars.className,
- this.localVariableNames,
- this.localVariableTypeNames,
- this.localVariableModifiers,
+ this.localVariableNames,
+ this.localVariableTypeNames,
+ this.localVariableModifiers,
this.declaringTypeName,
this.lineSeparator,
complianceVersion
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/EvaluationResult.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/EvaluationResult.java
index 4cf3fa160..d04422e39 100644
--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/EvaluationResult.java
+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/EvaluationResult.java
@@ -16,7 +16,7 @@ package org.eclipse.jdt.internal.eval;
import org.eclipse.jdt.core.compiler.CategorizedProblem;
/**
- * An EvaluationResult is the result of a code snippet evaluation, a global
+ * An EvaluationResult is the result of a code snippet evaluation, a global
* variable evaluation or it is used to report problems against imports and
* package declaration.
* It primarily contains the representation of the resulting value (e.g. its
@@ -27,7 +27,7 @@ import org.eclipse.jdt.core.compiler.CategorizedProblem;
public class EvaluationResult {
static final CategorizedProblem[] NO_PROBLEMS = new CategorizedProblem[0];
-
+
char[] evaluationID;
int evaluationType;
CategorizedProblem[] problems;
@@ -63,7 +63,7 @@ public class EvaluationResult {
* The evaluation result reports an internal problem.
*/
public static final int T_INTERNAL = 5;
-
+
public EvaluationResult(char[] evaluationID, int evaluationType, char[] displayString, char[] typeName) {
this.evaluationID = evaluationID;
this.evaluationType = evaluationType;
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/Evaluator.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/Evaluator.java
index 3ae91e627..14b19a4e3 100644
--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/Evaluator.java
+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/Evaluator.java
@@ -62,7 +62,7 @@ protected abstract void addEvaluationResultForCompilationProblem(Map<char[], Eva
/**
* Returns the evaluation results that converts the given compilation result that has problems.
* If the compilation result has more than one problem, then the problems are broken down so that
- * each evaluation result has the same evaluation id.
+ * each evaluation result has the same evaluation id.
*/
protected EvaluationResult[] evaluationResultsForCompilationProblems(CompilationResult result, char[] cuSource) {
// Break down the problems and group them by ids in evaluation results
@@ -111,8 +111,8 @@ ClassFile[] getClasses() {
ClassFile[] classFiles = result.getClassFiles();
for (int i = 0; i < classFiles.length; i++) {
ClassFile classFile = classFiles[i];
-/*
-
+/*
+
char[] filename = classFile.fileName();
int length = filename.length;
char[] relativeName = new char[length + 6];
@@ -121,8 +121,8 @@ ClassFile[] getClasses() {
CharOperation.replace(relativeName, '/', java.io.File.separatorChar);
ClassFile.writeToDisk("d:/test/snippet", new String(relativeName), classFile.getBytes());
String str = "d:/test/snippet" + "/" + new String(relativeName);
- System.out.println(org.eclipse.jdt.core.tools.classfmt.disassembler.ClassFileDisassembler.disassemble(str));
- */
+ System.out.println(org.eclipse.jdt.core.tools.classfmt.disassembler.ClassFileDisassembler.disassemble(str));
+ */
classDefinitions.add(classFile);
}
}
@@ -181,10 +181,10 @@ Compiler getCompiler(ICompilerRequestor compilerRequestor) {
compilerOptions.performMethodsFullRecovery = true;
compilerOptions.performStatementsRecovery = true;
return new Compiler(
- this.environment,
- DefaultErrorHandlingPolicies.exitAfterAllProblems(),
- compilerOptions,
- compilerRequestor,
+ this.environment,
+ DefaultErrorHandlingPolicies.exitAfterAllProblems(),
+ compilerOptions,
+ compilerRequestor,
this.problemFactory);
}
/**
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/InstallException.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/InstallException.java
index 7355e1896..645f1e1c2 100644
--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/InstallException.java
+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/InstallException.java
@@ -18,7 +18,7 @@ package org.eclipse.jdt.internal.eval;
* for any reason.
*/
public class InstallException extends Exception {
-
+
private static final long serialVersionUID = -5870897747810654203L; // backward compatible
/**
* Constructs a <code>InstallException</code> with no detail message.
@@ -27,8 +27,8 @@ public InstallException() {
super();
}
/**
- * Constructs a <code>InstallException</code> with the specified
- * detail message.
+ * Constructs a <code>InstallException</code> with the specified
+ * detail message.
*
* @param s the detail message.
*/
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/VariablesEvaluator.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/VariablesEvaluator.java
index dd0470651..7826b05d0 100644
--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/VariablesEvaluator.java
+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/VariablesEvaluator.java
@@ -48,7 +48,7 @@ protected void addEvaluationResultForCompilationProblem(Map<char[], EvaluationRe
int pbLine = problem.getSourceLineNumber();
int currentLine = 1;
- // check package declaration
+ // check package declaration
char[] packageName = getPackageName();
if (packageName.length > 0) {
if (pbLine == 1) {
@@ -82,7 +82,7 @@ protected void addEvaluationResultForCompilationProblem(Map<char[], EvaluationRe
int varCount = this.context.variableCount;
if ((currentLine <= pbLine) && (pbLine < currentLine + varCount)) {
GlobalVariable var = this.context.variables[pbLine - currentLine];
-
+
// set evaluation id and type
evaluationID = var.getName();
evaluationType = EvaluationResult.T_VARIABLE;
@@ -150,7 +150,7 @@ protected char[] getClassName() {
@Override
Compiler getCompiler(ICompilerRequestor compilerRequestor) {
Compiler compiler = super.getCompiler(compilerRequestor);
-
+
// Initialize the compiler's lookup environment with the already compiled super class
IBinaryType binaryType = this.context.getRootCodeSnippetBinary();
if (binaryType != null) {
@@ -172,8 +172,8 @@ Compiler getCompiler(ICompilerRequestor compilerRequestor) {
compiler.lookupEnvironment.cacheBinaryType(binary, null /*no access restriction*/);
}
}
-
- return compiler;
+
+ return compiler;
}
/**
* Returns the name of package of the current compilation unit.
@@ -188,7 +188,7 @@ protected char[] getPackageName() {
protected char[] getSource() {
StringBuffer buffer = new StringBuffer();
int lineNumberOffset = 1;
-
+
// package declaration
char[] packageName = getPackageName();
if (packageName.length != 0) {
@@ -277,7 +277,7 @@ protected char[] getSource() {
}
}
buffer.append("\t}").append(this.context.lineSeparator); //$NON-NLS-1$
-
+
// end of class declaration
buffer.append('}').append(this.context.lineSeparator);
diff --git a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/CodeFormatter.java b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/CodeFormatter.java
index ade7f181d..39071a473 100644
--- a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/CodeFormatter.java
+++ b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/CodeFormatter.java
@@ -100,7 +100,7 @@ public abstract class CodeFormatter {
* </p>
*/
public static final int K_COMPILATION_UNIT = 0x08;
-
+
//{ObjectTeams: a separate kind is necessary because of separate parsing method (parser.parseParameterMapping)
/**
* Kind used to format a parameter mapping.
@@ -110,7 +110,7 @@ public abstract class CodeFormatter {
* the method parse.parseParameterMapping is used.
*/
public static final int K_PARAMETER_MAPPING = 0x80;
-//jsv}
+//jsv}
/**
* Kind used to format a single-line comment
@@ -126,7 +126,7 @@ public abstract class CodeFormatter {
/**
* Kind used to format a Javadoc comment
- *
+ *
* @since 3.1
*/
public static final int K_JAVA_DOC = 0x40;
@@ -182,7 +182,7 @@ public abstract class CodeFormatter {
* public class X {
* &#047;&#042;&#042;
* &#042; This is just a simple example to show that comments will be formatted while processing a compilation unit only if the constant flag <code>F_INCLUDE_COMMENT</code> flag is set.
- * &#042;
+ * &#042;
* &#042; &#064;param str The input string
* &#042;&#047;
* void foo(String str){
@@ -198,7 +198,7 @@ public abstract class CodeFormatter {
* &#042; This is just a simple example to show that comments will be formatted
* &#042; while processing a compilation unit only if the constant flag
* &#042; <code>F_INCLUDE_COMMENT</code> flag is set.
- * &#042;
+ * &#042;
* &#042; &#064;param str
* &#042; The input string
* &#042;&#047;
@@ -218,7 +218,7 @@ public abstract class CodeFormatter {
*/
public static final int F_INCLUDE_COMMENTS = 0x1000;
- /**
+ /**
* Format <code>source</code>,
* and returns a text edit that correspond to the difference between the given
* string and the formatted string.
@@ -229,7 +229,7 @@ public abstract class CodeFormatter {
* whitespaces. It would be up to the caller to get rid of preceding
* whitespaces.
* </p>
- *
+ *
* @param kind Use to specify the kind of the code snippet to format. It can
* be any of these:
* <ul>
@@ -250,7 +250,7 @@ public abstract class CodeFormatter {
* @param source the source to format
* @param offset the given offset to start recording the edits (inclusive).
* @param length the given length to stop recording the edits (exclusive).
- * @param indentationLevel the initial indentation level, used
+ * @param indentationLevel the initial indentation level, used
* to shift left/right the entire source fragment. An initial indentation
* level of zero or below has no effect.
* @param lineSeparator the line separator to use in formatted source,
@@ -260,19 +260,19 @@ public abstract class CodeFormatter {
* length is greater than source length.
*/
public abstract TextEdit format(int kind, String source, int offset, int length, int indentationLevel, String lineSeparator);
-
- /**
+
+ /**
* Format <code>source</code>,
* and returns a text edit that correspond to the difference between the given string and the formatted string.
* <p>It returns null if the given string cannot be formatted.</p>
- *
+ *
* <p>If an offset position is matching a whitespace, the result can include whitespaces. It would be up to the
* caller to get rid of preceding whitespaces.</p>
- *
+ *
* <p>No region in <code>regions</code> must overlap with any other region in <code>regions</code>.
* Each region must be within source. There must be at least one region. Regions must be sorted
* by their offsets, smaller offset first.</p>
- *
+ *
* @param kind Use to specify the kind of the code snippet to format. It can
* be any of these:
* <ul>
@@ -292,7 +292,7 @@ public abstract class CodeFormatter {
* detailed explanation).
* @param source the source to format
* @param regions a set of regions in source to format
- * @param indentationLevel the initial indentation level, used
+ * @param indentationLevel the initial indentation level, used
* to shift left/right the entire source fragment. An initial indentation
* level of zero or below has no effect.
* @param lineSeparator the line separator to use in formatted source,
@@ -303,14 +303,14 @@ public abstract class CodeFormatter {
* @since 3.4
*/
public abstract TextEdit format(int kind, String source, IRegion[] regions, int indentationLevel, String lineSeparator);
-
+
/**
* Answers the string that corresponds to the indentation to the given indentation level or an empty string
* if the indentation cannot be computed.
* <p>This method needs to be overridden in a subclass.</p>
- *
+ *
* <p>The default implementation returns an empty string.</p>
- *
+ *
* @param indentationLevel the given indentation level
* @return the string corresponding to the right indentation level
* @exception IllegalArgumentException if the given indentation level is lower than zero
diff --git a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/CodeFormatterApplication.java b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/CodeFormatterApplication.java
index 612cea3cd..b1880d253 100644
--- a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/CodeFormatterApplication.java
+++ b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/CodeFormatterApplication.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Ben Konrath <ben@bagu.org> - initial implementation
* Red Hat Incorporated - improvements based on comments from JDT developers
@@ -40,9 +40,9 @@ import org.eclipse.text.edits.TextEdit;
/**
* Implements an Eclipse Application for org.eclipse.jdt.core.JavaCodeFormatter.
- *
+ *
* <p>On MacOS, when invoked using the Eclipse executable, the "user.dir" property is set to the folder
- * in which the eclipse.ini file is located. This makes it harder to use relative paths to point to the
+ * in which the eclipse.ini file is located. This makes it harder to use relative paths to point to the
* files to be formatted or the configuration file to use to set the code formatter's options.</p>
*
* <p>There are a couple improvements that could be made: 1. Make a list of all the
@@ -77,7 +77,7 @@ public class CodeFormatterApplication implements IApplication {
public static String CommandLineErrorFileDir;
public static String CommandLineErrorQuietVerbose;
-
+
public static String CommandLineErrorNoConfigFile;
public static String CommandLineFormatting;
@@ -103,7 +103,7 @@ public class CodeFormatterApplication implements IApplication {
/**
* Bind the given message's substitution locations with the given string
* values.
- *
+ *
* @param message
* the message to be manipulated
* @return the manipulated String
@@ -115,7 +115,7 @@ public class CodeFormatterApplication implements IApplication {
/**
* Bind the given message's substitution locations with the given string
* values.
- *
+ *
* @param message
* the message to be manipulated
* @param binding
@@ -131,7 +131,7 @@ public class CodeFormatterApplication implements IApplication {
/**
* Bind the given message's substitution locations with the given string
* values.
- *
+ *
* @param message
* the message to be manipulated
* @param binding1
@@ -149,7 +149,7 @@ public class CodeFormatterApplication implements IApplication {
/**
* Bind the given message's substitution locations with the given string
* values.
- *
+ *
* @param message
* the message to be manipulated
* @param bindings
@@ -179,7 +179,7 @@ public class CodeFormatterApplication implements IApplication {
private boolean verbose = false;
- /**
+ /**
* Display the command line usage message.
*/
private void displayHelp() {
@@ -269,11 +269,11 @@ public class CodeFormatterApplication implements IApplication {
final int DEFAULT_MODE = 0;
final int CONFIG_MODE = 1;
-
+
int mode = DEFAULT_MODE;
final int INITIAL_SIZE = 1;
int fileCounter = 0;
-
+
File[] filesToFormat = new File[INITIAL_SIZE];
loop: while (index < argCount) {
@@ -286,7 +286,7 @@ public class CodeFormatterApplication implements IApplication {
}
if (ARG_HELP.equals(currentArg)) {
displayHelp();
- return null;
+ return null;
}
if (ARG_VERBOSE.equals(currentArg)) {
this.verbose = true;
@@ -330,12 +330,12 @@ public class CodeFormatterApplication implements IApplication {
}
mode = DEFAULT_MODE;
continue loop;
- }
+ }
}
if (mode == CONFIG_MODE || this.options == null) {
displayHelp(Messages.bind(Messages.CommandLineErrorNoConfigFile));
- return null;
+ return null;
}
if (this.quiet && this.verbose) {
displayHelp(
@@ -425,7 +425,7 @@ public class CodeFormatterApplication implements IApplication {
formatDirTree(file, codeFormatter);
} else if (Util.isJavaLikeFileName(file.getPath())) {
formatFile(file, codeFormatter);
- }
+ }
}
if (!this.quiet) {
System.out.println(Messages.bind(Messages.CommandLineDone));
diff --git a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.java b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.java
index 1033c3153..7f0a16962 100644
--- a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.java
+++ b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.java
@@ -85,7 +85,7 @@ public class DefaultCodeFormatterConstants {
* @since 3.15
*/
public static final String FORMATTER_ALIGN_VARIABLE_DECLARATIONS_ON_COLUMNS = JavaCore.PLUGIN_ID + ".formatter.align_variable_declarations_on_columns"; //$NON-NLS-1$
-
+
/**
* <pre>
* FORMATTER / Option to align assignment statements on column
@@ -98,7 +98,7 @@ public class DefaultCodeFormatterConstants {
* @since 3.15
*/
public static final String FORMATTER_ALIGN_ASSIGNMENT_STATEMENTS_ON_COLUMNS = JavaCore.PLUGIN_ID + ".formatter.align_assignment_statements_on_columns"; //$NON-NLS-1$
-
+
/**
* <pre>
* FORMATTER / Option to use spaces when aligning members, independent of selected tabulation character
@@ -287,7 +287,7 @@ public class DefaultCodeFormatterConstants {
* - possible values: values returned by <code>createAlignmentValue(boolean, int, int)</code> call
* - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
* </pre>
- *
+ *
* @see #createAlignmentValue(boolean, int, int)
* @since 3.0
* @deprecated Use new settings instead: {@link #FORMATTER_ALIGNMENT_FOR_MULTIPLICATIVE_OPERATOR},
@@ -1065,7 +1065,7 @@ public class DefaultCodeFormatterConstants {
* @since 3.12
*/
public static final String FORMATTER_PARENTHESES_POSITIONS_IN_ENUM_CONSTANT_DECLARATION = JavaCore.PLUGIN_ID + ".formatter.parentheses_positions_in_enum_constant_declaration"; //$NON-NLS-1$
-
+
/**
* <pre>
* FORMATTER / Option to position parentheses in record declarations
@@ -1269,7 +1269,7 @@ public class DefaultCodeFormatterConstants {
* {@link #FORMATTER_COMMENT_FORMAT_LINE_COMMENT} option has been set to
* {@link #FALSE} or the formatter is created with the mode
* {@link ToolFactory#M_FORMAT_NEW}.
- *
+ *
* @see #TRUE
* @see #FALSE
* @see ToolFactory#createCodeFormatter(Map, int)
@@ -1390,14 +1390,14 @@ public class DefaultCodeFormatterConstants {
* - possible values: { TRUE, FALSE }
* - default: TRUE
* </pre>
- *
+ *
* Note that at most one of these options can be set to {@code TRUE}:
* <ul>
* <li>{@code FORMATTER_COMMENT_INDENT_ROOT_TAGS},
* <li>{@code FORMATTER_COMMENT_ALIGN_TAGS_NAMES_DESCRIPTIONS},
* <li>{@code FORMATTER_COMMENT_ALIGN_TAGS_DESCREIPTIONS_GROUPED}.
* </ul>
- *
+ *
* @see #TRUE
* @see #FALSE
* @see #FORMATTER_COMMENT_ALIGN_TAGS_NAMES_DESCRIPTIONS
@@ -1413,14 +1413,14 @@ public class DefaultCodeFormatterConstants {
* - possible values: { TRUE, FALSE }
* - default: TRUE
* </pre>
- *
+ *
* Note that at most one of these options can be set to {@code TRUE}:
* <ul>
* <li>{@code FORMATTER_COMMENT_INDENT_ROOT_TAGS},
* <li>{@code FORMATTER_COMMENT_ALIGN_TAGS_NAMES_DESCRIPTIONS},
* <li>{@code FORMATTER_COMMENT_ALIGN_TAGS_DESCREIPTIONS_GROUPED}.
* </ul>
- *
+ *
* @see #TRUE
* @see #FALSE
* @see #FORMATTER_COMMENT_INDENT_ROOT_TAGS
@@ -1436,14 +1436,14 @@ public class DefaultCodeFormatterConstants {
* - possible values: { TRUE, FALSE }
* - default: TRUE
* </pre>
- *
+ *
* Note that at most one of these options can be set to {@code TRUE}:
* <ul>
* <li>{@code FORMATTER_COMMENT_INDENT_ROOT_TAGS},
* <li>{@code FORMATTER_COMMENT_ALIGN_TAGS_NAMES_DESCRIPTIONS},
* <li>{@code FORMATTER_COMMENT_ALIGN_TAGS_DESCREIPTIONS_GROUPED}.
* </ul>
- *
+ *
* @see #TRUE
* @see #FALSE
* @see #FORMATTER_COMMENT_INDENT_ROOT_TAGS
@@ -1587,14 +1587,14 @@ public class DefaultCodeFormatterConstants {
* - option id: "org.eclipse.jdt.core.formatter.disabling_tag"
* - possible values: String, with constraints mentioned below
* - default: "@formatter:off"
- *
+ *
* See the {@link #FORMATTER_ENABLING_TAG} option to re-enable it.
* </pre>
- *
+ *
* <p>
* Note that:
* <ol>
- * <li>This tag is used by the formatter only if the
+ * <li>This tag is used by the formatter only if the
* {@link #FORMATTER_USE_ON_OFF_TAGS} option is set to {@link #TRUE}.</li>
* <li>The tag name will be trimmed. Hence if it does contain white spaces
* at the beginning or at the end, they will not be taken into account while
@@ -1714,11 +1714,11 @@ public class DefaultCodeFormatterConstants {
* - possible values: String, with constraints mentioned below
* - default: "@formatter:on"
* </pre>
- *
+ *
* <p>
* Note that:
* <ol>
- * <li>This tag is used by the formatter only if the
+ * <li>This tag is used by the formatter only if the
* {@link #FORMATTER_USE_ON_OFF_TAGS} option is set to {@link #TRUE}.</li>
* <li>The tag name will be trimmed. Hence if it does contain white spaces
* at the beginning or at the end, they will not be taken into account while
@@ -2151,7 +2151,7 @@ public class DefaultCodeFormatterConstants {
* @see JavaCore#DO_NOT_INSERT
* @since 3.6
*/
- public static final String FORMATTER_INSERT_NEW_LINE_AFTER_LABEL = JavaCore.PLUGIN_ID + ".formatter.insert_new_line_after_label"; //$NON-NLS-1$
+ public static final String FORMATTER_INSERT_NEW_LINE_AFTER_LABEL = JavaCore.PLUGIN_ID + ".formatter.insert_new_line_after_label"; //$NON-NLS-1$
/**
* <pre>
@@ -3210,7 +3210,7 @@ public class DefaultCodeFormatterConstants {
public static final String FORMATTER_INSERT_SPACE_AFTER_SEMICOLON_IN_FOR = JavaCore.PLUGIN_ID + ".formatter.insert_space_after_semicolon_in_for"; //$NON-NLS-1$
/**
* <pre>
- * FORMATTER / Option to insert a space after semicolons following each resource declaration in a try with
+ * FORMATTER / Option to insert a space after semicolons following each resource declaration in a try with
* resources statement
* - option id: "org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources"
* - possible values: { INSERT, DO_NOT_INSERT }
@@ -4983,7 +4983,7 @@ public class DefaultCodeFormatterConstants {
/**
* <pre>
* FORMATTER / Option to specify whether the formatter can join wrapped lines or not
- *
+ *
* For example, the wrapped lines of method foo return statement in following test case:
* class X {
* String foo() {
@@ -5014,7 +5014,7 @@ public class DefaultCodeFormatterConstants {
/**
* <pre>
* FORMATTER / Option to specify whether the formatter can join text lines in comments or not
- *
+ *
* For example, the following comment:
* /**
* * The foo method.
@@ -5022,7 +5022,7 @@ public class DefaultCodeFormatterConstants {
* *&#0047;
* public class X {
* }
- *
+ *
* will be unchanged by the formatter when this new preference is used,
* even if the maximum line width would give it enough space to join the lines.
*
@@ -5267,7 +5267,7 @@ public class DefaultCodeFormatterConstants {
* then the preference needs to be set to {@link #FALSE} to retrieve the previous formatter behavior.</li>
* <li>The new strategy currently only applies to nested method calls, but might be extended to other nested expressions in future versions</li>
* </ol>
- *
+ *
* @see #TRUE
* @see #FALSE
* @since 3.6
@@ -5422,7 +5422,7 @@ public class DefaultCodeFormatterConstants {
* @since 3.12
*/
public static final String SEPARATE_LINES_IF_WRAPPED = "separate_lines_if_wrapped"; //$NON-NLS-1$
-
+
/**
* <pre>
* FORMATTER / Value to set parentheses location on separate lines from their contents,
diff --git a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/CommentsPreparator.java b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/CommentsPreparator.java
index c9be5d93a..ac03d5fec 100644
--- a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/CommentsPreparator.java
+++ b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/CommentsPreparator.java
@@ -641,7 +641,7 @@ public class CommentsPreparator extends ASTVisitor {
}
javadocRootTags.add(tagTokens);
}
-
+
if (this.options.comment_align_tags_names_descriptions) {
int maxTagNameLength = 0;
int maxParamNameLength = 0;
@@ -690,7 +690,7 @@ public class CommentsPreparator extends ASTVisitor {
}
}
}
-
+
private void handleJavadocBlankLines(Javadoc node) {
List<TagElement> tagElements = node.tags();
List<Integer> tagIndexes = tagElements.stream()
@@ -699,7 +699,7 @@ public class CommentsPreparator extends ASTVisitor {
.collect(Collectors.toList());
tagIndexes.addAll(this.commonAttributeAnnotations);
Collections.sort(tagIndexes);
-
+
String previousName = null;
if (!tagIndexes.isEmpty()) {
int firstIndex = tagIndexes.get(0);
@@ -1184,7 +1184,7 @@ public class CommentsPreparator extends ASTVisitor {
for (Token token : formattedTokens)
token.setAlign(token.getAlign() + openingToken.getAlign() + openingToken.getIndent());
fixJavadocTagAlign(openingToken, closingTagFirstIndex);
-
+
// there are too few linebreaks at the start and end
Token start = formattedTokens.get(0);
start.putLineBreaksBefore(start.getLineBreaksBefore() + 1);
diff --git a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatter.java b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatter.java
index 98bf7549b..46db5fe9e 100644
--- a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatter.java
+++ b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatter.java
@@ -336,7 +336,7 @@ public class DefaultCodeFormatter extends CodeFormatter {
for (int kindToTry : kindsToTry) {
ASTNode astNode = createParser(kindToTry).createAST(null);
if (!hasErrors(astNode)) {
- if (kindToTry == K_MODULE_INFO)
+ if (kindToTry == K_MODULE_INFO)
tokenizeSource(kindToTry); // run scanner again to get module specific tokens
return astNode;
}
diff --git a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatterOptions.java b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatterOptions.java
index 991f08a5d..cbe879cba 100644
--- a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatterOptions.java
+++ b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatterOptions.java
@@ -125,7 +125,7 @@ public class DefaultCodeFormatterOptions {
// accept non-OT/J code?
public boolean scopedKeywords = false;
public boolean isPureJava = false;
-// SH}
+// SH}
public int alignment_for_arguments_in_allocation_expression;
public int alignment_for_arguments_in_annotation;
@@ -1668,7 +1668,7 @@ public class DefaultCodeFormatterOptions {
if (insertNewLineBeforeWhileInDoStatementOption != null) {
this.insert_new_line_before_while_in_do_statement = JavaCore.INSERT.equals(insertNewLineBeforeWhileInDoStatementOption);
}
-
+
setString(settings, DefaultCodeFormatterConstants.FORMATTER_KEEP_ANNOTATION_DECLARATION_ON_ONE_LINE, KEEP_ON_ONE_LINE_VALUES,
v -> this.keep_annotation_declaration_on_one_line = v);
setString(settings, DefaultCodeFormatterConstants.FORMATTER_KEEP_ANONYMOUS_TYPE_DECLARATION_ON_ONE_LINE, KEEP_ON_ONE_LINE_VALUES,
@@ -2468,7 +2468,7 @@ public class DefaultCodeFormatterOptions {
// reverse values swapping performed by IndentationTabPage
if (!JavaCore.SPACE.equals(settings.get(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR)))
this.tab_size = tabSize;
- if (!DefaultCodeFormatterConstants.MIXED.equals(settings.get(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR)))
+ if (!DefaultCodeFormatterConstants.MIXED.equals(settings.get(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR)))
this.indentation_size = tabSize;
}
final Object useTabsOnlyForLeadingIndentationsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS);
@@ -2637,7 +2637,7 @@ public class DefaultCodeFormatterOptions {
* so that the formatter recognizes those deprecated options when used with project specific formatter profiles.
* (see <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=544776">Bug 544776</a>)
* </p>
- *
+ *
* @param settings the given map
* @deprecated
*/
@@ -2657,17 +2657,17 @@ public class DefaultCodeFormatterOptions {
this.comment_clear_blank_lines_in_block_comment = DefaultCodeFormatterConstants.TRUE.equals(commentClearBlankLinesInBlockCommentOption);
}
}
-
+
// New line after annotations
final Object insertNewLineAfterAnnotationOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION);
-
+
final Object insertNewLineAfterAnnotationOnMemberOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_MEMBER);
final Object insertNewLineAfterAnnotationOnTypeOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_TYPE);
final Object insertNewLineAfterAnnotationOnEnumConstantOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_ENUM_CONSTANT);
final Object insertNewLineAfterAnnotationOnFieldOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_FIELD);
final Object insertNewLineAfterAnnotationOnMethodOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_METHOD);
final Object insertNewLineAfterAnnotationOnPackageOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PACKAGE);
-
+
final Object insertNewLineAfterAnnotationOnParameterOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PARAMETER);
final Object insertNewLineAfterAnnotationOnLocalVariableOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_LOCAL_VARIABLE);
@@ -2684,7 +2684,7 @@ public class DefaultCodeFormatterOptions {
this.insert_new_line_after_annotation_on_field = insert;
this.insert_new_line_after_annotation_on_method = insert;
this.insert_new_line_after_annotation_on_package = insert;
-
+
// and use the other 3.4 options if available
if (insertNewLineAfterAnnotationOnParameterOption != null) {
this.insert_new_line_after_annotation_on_parameter = JavaCore.INSERT.equals(insertNewLineAfterAnnotationOnParameterOption);
@@ -2983,7 +2983,7 @@ public class DefaultCodeFormatterOptions {
this.comment_new_lines_at_javadoc_boundaries = true;
this.comment_line_length = 80;
this.comment_count_line_length_from_starting_position = true;
- this.comment_preserve_white_space_between_code_and_line_comments= false;
+ this.comment_preserve_white_space_between_code_and_line_comments= false;
this.continuation_indentation = 2;
this.continuation_indentation_for_array_initializer = 2;
this.blank_lines_after_imports = 0;
@@ -3369,7 +3369,7 @@ public class DefaultCodeFormatterOptions {
this.comment_new_lines_at_javadoc_boundaries = true;
this.comment_line_length = 80;
this.comment_count_line_length_from_starting_position = true;
- this.comment_preserve_white_space_between_code_and_line_comments= false;
+ this.comment_preserve_white_space_between_code_and_line_comments= false;
this.continuation_indentation = 2;
this.continuation_indentation_for_array_initializer = 2;
this.blank_lines_after_imports = 1;
diff --git a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/LineBreaksPreparator.java b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/LineBreaksPreparator.java
index 57e11f25f..73aa0f66d 100644
--- a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/LineBreaksPreparator.java
+++ b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/LineBreaksPreparator.java
@@ -167,7 +167,7 @@ public class LineBreaksPreparator extends ASTVisitor {
indent(node.getGuardPredicate());
indent(node.getGuardPredicate());
this.tm.firstTokenAfter(node.getGuardPredicate(), TokenNameLBRACE).breakBefore();
- }
+ }
// SH}
handleBodyDeclarations(node.bodyDeclarations());
@@ -812,7 +812,7 @@ public class LineBreaksPreparator extends ASTVisitor {
private void handleBracedCode(ASTNode node, ASTNode nodeBeforeOpenBrace, String bracePosition, boolean indentBody) {
handleBracedCode(node, nodeBeforeOpenBrace, bracePosition, indentBody, 0, 0);
}
-
+
private void handleBracedCode(ASTNode node, ASTNode nodeBeforeOpenBrace, String bracePosition, boolean indentBody,
int blankLinesAfterOpeningBrace, int blankLinesBeforeClosingBrace) {
int openBraceIndex = nodeBeforeOpenBrace == null
diff --git a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/OneLineEnforcer.java b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/OneLineEnforcer.java
index d3638545f..b5cbff873 100644
--- a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/OneLineEnforcer.java
+++ b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/OneLineEnforcer.java
@@ -10,7 +10,7 @@
*
* Contributors:
* Mateusz Matela <mateusz.matela@gmail.com> - Initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.formatter;
diff --git a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/SpacePreparator.java b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/SpacePreparator.java
index 10e71c194..0641d1e7c 100644
--- a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/SpacePreparator.java
+++ b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/SpacePreparator.java
@@ -227,7 +227,7 @@ public class SpacePreparator extends ASTVisitor {
int from = this.tm.firstIndexIn(node.getName(), TokenNameIdentifier) + 1;
AnonymousClassDeclaration classDeclaration = node.getAnonymousClassDeclaration();
int to = classDeclaration != null ? this.tm.firstIndexBefore(classDeclaration, -1)
- : this.tm.lastIndexIn(node, -1);
+ : this.tm.lastIndexIn(node, -1);
for (int i = from; i <= to; i++) {
if (this.tm.get(i).tokenType == TokenNameLPAREN) {
openingParen = this.tm.get(i);
@@ -307,7 +307,7 @@ public class SpacePreparator extends ASTVisitor {
handleToken(node.getName(), TokenNameLPAREN, beforeOpenParen, false);
} else {
handleToken(node.getName(), TokenNameLPAREN, beforeOpenParen, afterOpenParen);
-
+
boolean beforeCloseParen = node.isConstructor()
? this.options.insert_space_before_closing_paren_in_constructor_declaration
: this.options.insert_space_before_closing_paren_in_method_declaration;
@@ -325,7 +325,7 @@ public class SpacePreparator extends ASTVisitor {
: this.options.insert_space_after_comma_in_method_declaration_parameters;
if (node.getReceiverType() != null) {
params = new ArrayList<>(params);
- params.add(0, null); // space for explicit receiver, null OK - first value not read in handleCommas
+ params.add(0, null); // space for explicit receiver, null OK - first value not read in handleCommas
}
handleCommas(params, beforeComma, afterComma);
}
@@ -1176,7 +1176,7 @@ public class SpacePreparator extends ASTVisitor {
handleModuleStatementCommas(node.modules());
return true;
}
-
+
@Override
public boolean visit(OpensDirective node) {
handleModuleStatementCommas(node.modules());
diff --git a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/TokenManager.java b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/TokenManager.java
index 9a066adca..7328e9797 100644
--- a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/TokenManager.java
+++ b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/TokenManager.java
@@ -332,7 +332,7 @@ public class TokenManager implements Iterable<Token> {
/**
* Calculates the length of a source code fragment.
* @param originalStart the first position of the source code fragment
- * @param originalEnd the last position of the source code fragment
+ * @param originalEnd the last position of the source code fragment
* @param startPosition position in line of the first character (affects tabs calculation)
* @return length, considering tabs and escaping characters as HTML entities
*/
diff --git a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/linewrap/WrapExecutor.java b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/linewrap/WrapExecutor.java
index aa844603d..52f39fbb3 100644
--- a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/linewrap/WrapExecutor.java
+++ b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/linewrap/WrapExecutor.java
@@ -203,7 +203,7 @@ public class WrapExecutor {
this.isNextLineWrapped = true;
if (this.firstPotentialWrap < 0)
this.firstPotentialWrap = index + 1;
- return false;
+ return false;
}
boolean isLineEnd = getLineBreaksAfter() > 0 || getNext() == null || (getNext().isNextLineOnWrap()
@@ -465,7 +465,7 @@ public class WrapExecutor {
token.setWrapped(false);
this.wrapSearchStack.pop();
this.wrapSearchResults.put(item, wrapResult);
- assert wrapResult.nextWrap == null || this.wrapSearchResults.get(wrapResult.nextWrap) != null;
+ assert wrapResult.nextWrap == null || this.wrapSearchResults.get(wrapResult.nextWrap) != null;
if (item.wrapTokenIndex == startTokenIndex && item.indent == indent)
break;
} else {
@@ -483,7 +483,7 @@ public class WrapExecutor {
/**
* The main algorithm that looks for optimal places to wrap.
- * Calls itself recursively to get results for wrapped sub-lines.
+ * Calls itself recursively to get results for wrapped sub-lines.
*/
private WrapResult findWraps(int wrapTokenIndex, int indent) {
final int lastIndex = this.lineAnalyzer.analyzeLine(wrapTokenIndex, indent);
@@ -521,7 +521,7 @@ public class WrapExecutor {
if (this.lineAnalyzer.minStructureDepth < currentDepth)
depthLimit = currentDepth;
}
- // optimization: turns out there's no point checking multiple wraps with the same policy
+ // optimization: turns out there's no point checking multiple wraps with the same policy
LinkedHashSet<WrapPolicy> policiesTried = new LinkedHashSet<>();
for (int i = lastIndex; firstPotentialWrap >= 0 && i >= firstPotentialWrap; i--) {
diff --git a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/linewrap/WrapPreparator.java b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/linewrap/WrapPreparator.java
index 489cd8096..d64687420 100644
--- a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/linewrap/WrapPreparator.java
+++ b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/linewrap/WrapPreparator.java
@@ -1337,7 +1337,7 @@ public class WrapPreparator extends ASTVisitor {
wrapMode = WrapMode.FORCE;
} else if (isAlreadyWrapped) {
wrapMode = WrapMode.DISABLED; // to avoid triggering top priority wrapping
- } else if (isTopPriority) {
+ } else if (isTopPriority) {
wrapMode = WrapMode.TOP_PRIORITY;
}
extraIndent *= this.options.indentation_size;
diff --git a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/old/CodeFormatter.java b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/old/CodeFormatter.java
index 9c3df2df0..cef6e13da 100644
--- a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/old/CodeFormatter.java
+++ b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/old/CodeFormatter.java
@@ -166,5 +166,5 @@ public class CodeFormatter implements TerminalTokens, org.eclipse.jdt.core.ICode
}
}
return org.eclipse.jdt.internal.core.util.Util.editedString(string, textEdit);
- }
+ }
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/BindingKey.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/BindingKey.java
index 043322247..f7f2de857 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/BindingKey.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/BindingKey.java
@@ -207,11 +207,11 @@ public final class BindingKey {
* @param genericTypeKey the binding key of the generic type
* @param boundKind one of {@link Signature#C_STAR}, {@link Signature#C_SUPER}, or {@link Signature#C_EXTENDS}
* @param boundTypeKey the binding key of the bounding type.
- * @param rank the relative position of this wild card type in the parameterization of the generic type.
+ * @param rank the relative position of this wild card type in the parameterization of the generic type.
* @return a new wildcard type binding key
* @since 3.5
*/
-
+
public static String createWildcardTypeBindingKey(String genericTypeKey, char boundKind, String boundTypeKey, int rank) {
// Note this implementation is heavily dependent on WildcardBinding#computeUniqueKey()
String wildCardKey;
@@ -234,11 +234,11 @@ public final class BindingKey {
/**
* Returns the binding key of the declaring type of the element represented by this binding key. If the binding key
* does not represent a member or if the member doesn't have a declaring type, returns <code>null</code>.
- *
+ *
* <p>
* Note that only binding keys for references to methods and fields
* are fully supported. The binding keys for declarations will not have type parameters.
- *
+ *
* @return the type binding key or <code>null</code>
* @since 3.7.1
*/
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CompletionContext.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CompletionContext.java
index 53ee5126e..11b441ee3 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CompletionContext.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CompletionContext.java
@@ -55,7 +55,7 @@ public class CompletionContext {
* @since 3.4
*/
public static final int TL_STATEMENT_START = 2;
-
+
/**
* The completed token is the first token of a constructor
* invocation expression.<br>
@@ -170,7 +170,7 @@ public class CompletionContext {
public char[][] getExpectedTypesSignatures() {
return null; // default overridden by concrete implementation
}
-
+
/**
* Return keys of expected types of a potential completion proposal at the completion position.
*
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CompletionProposal.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CompletionProposal.java
index ba57ebe51..6edfb3e5e 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CompletionProposal.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CompletionProposal.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
* Fraunhofer FIRST - extended API and implementation
@@ -773,7 +773,7 @@ public class CompletionProposal {
* @since 3.4
*/
public static final int FIELD_REF_WITH_CASTED_RECEIVER = 25;
-
+
/**
* Completion is a reference to a constructor.
* This kind of completion might occur in a context like
@@ -805,11 +805,11 @@ public class CompletionProposal {
*
* @see #getKind()
* @see CompletionRequestor#setAllowsRequiredProposals(int, int, boolean)
- *
+ *
* @since 3.5
*/
public static final int CONSTRUCTOR_INVOCATION = 26;
-
+
/**
* Completion is a reference of a constructor of an anonymous class.
* This kind of completion might occur in a context like
@@ -845,7 +845,7 @@ public class CompletionProposal {
*
* @see #getKind()
* @see CompletionRequestor#setAllowsRequiredProposals(int, int, boolean)
- *
+ *
* @since 3.5
*/
public static final int ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION = 27;
@@ -922,7 +922,7 @@ public class CompletionProposal {
* <pre>String bar(double d) -> String bar(double d);</pre>
*/
public static final int OT_METHOD_SPEC= METHOD_DECLARATION + 7 * INTWRAP;
-
+
/**
* Generate a role type declaration overriding an implicitly inherited role from the super team.
*/
@@ -1127,7 +1127,7 @@ public class CompletionProposal {
* @param completion the completion string
*/
public void setCompletion(char[] completion) {
- // default overridden by concrete implementation
+ // default overridden by concrete implementation
}
/**
@@ -1242,9 +1242,9 @@ public class CompletionProposal {
* <li><code>METHOD_DECLARATION</code> - type signature
* of the type that declares the method that is being
* implemented or overridden</li>
- * <li><code>MODULE_DECLARATION</code> -
+ * <li><code>MODULE_DECLARATION</code> -
* possible name of the module that is being declared</li>
- * <li><code>MODULE_REF</code> -
+ * <li><code>MODULE_REF</code> -
* name of the module that is referenced</li>
* <li><code>PACKAGE_REF</code> - dot-based package
* name of the package that is referenced</li>
@@ -1847,17 +1847,17 @@ public class CompletionProposal {
// default overridden by concrete implementation
}
- /**
+ /**
* Returns whether it is safe to use the '<>' (diamond) operator in place of explicitly specifying
* type arguments for this proposal.
- *
+ *
* <p>
* This is only relevant for source level 1.7 or greater.
* </p>
- *
+ *
* @param coreContext the completion context associated with the proposal
* @since 3.7.1
- * @return <code>true</code> if it is safe to use the diamond operator for the constructor invocation,
+ * @return <code>true</code> if it is safe to use the diamond operator for the constructor invocation,
* <code>false</code> otherwise. Also returns <code>false</code> for source levels below 1.7
*/
public boolean canUseDiamond(CompletionContext coreContext) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CompletionRequestor.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CompletionRequestor.java
index 1465be709..60b8a5db8 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CompletionRequestor.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CompletionRequestor.java
@@ -367,7 +367,7 @@ public abstract class CompletionRequestor {
/**
* If this returns true, exclude test sources and dependencies.
- *
+ *
* @return <code>true</code> if this requestor does not want to get any completions from test code.
* @see IClasspathAttribute#TEST
* @since 3.14
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CorrectionEngine.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CorrectionEngine.java
index 4628df13a..3d97ca1ed 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CorrectionEngine.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CorrectionEngine.java
@@ -242,7 +242,7 @@ public class CorrectionEngine {
Map<String,String> currentProjectOptions = this.compilationUnit.getJavaProject().getOptions(true);
long sourceLevel = CompilerOptions.versionToJdkLevel(currentProjectOptions.get(JavaCore.COMPILER_SOURCE));
long complianceLevel = CompilerOptions.versionToJdkLevel(currentProjectOptions.get(JavaCore.COMPILER_COMPLIANCE));
-
+
Scanner scanner =
new Scanner(
false /*comment*/,
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/Flags.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/Flags.java
index 6cfb7a81e..2749666b8 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/Flags.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/Flags.java
@@ -196,11 +196,11 @@ public final class Flags {
* @since 3.10
*/
public static final int AccAnnotationDefault = ClassFileConstants.AccAnnotationDefault;
-
+
/**
* Module declaration property flag.
* Used to flag a compilation unit or a class file that contains a module declaration.
- *
+ *
* @since 3.14
*/
public static final int AccModule = ClassFileConstants.AccModule;
@@ -215,7 +215,7 @@ public final class Flags {
* @noreference This field is not intended to be referenced by clients as it is a part of Java preview feature.
*/
public static final int AccRecord = ExtraCompilerModifiers.AccRecord;
-
+
/**
* Not instantiable.
*/
@@ -497,7 +497,7 @@ public final class Flags {
public static boolean isAnnnotationDefault(int flags) {
return (flags & AccAnnotationDefault) != 0;
}
-
+
/**
* Returns whether the given integer has the <code>AccModule</code>
* bit set.
@@ -505,7 +505,7 @@ public final class Flags {
* @return <code>true</code> if the <code>AccModule</code> flag is included
* @see #AccModule
* @since 3.14
- */
+ */
public static boolean isModule(int flags) {
return (flags & AccModule) != 0;
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IAccessRule.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IAccessRule.java
index 20250929c..850cd4b45 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IAccessRule.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IAccessRule.java
@@ -56,10 +56,10 @@ import org.eclipse.core.runtime.IPath;
* </p>
*
* @since 3.1
- *
+ *
* @see JavaCore#newAccessRule(IPath, int)
* @see IClasspathEntry#getExclusionPatterns()
- *
+ *
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IAccessRule {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IClasspathAttribute.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IClasspathAttribute.java
index 84cd2bd1a..6189c6175 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IClasspathAttribute.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IClasspathAttribute.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,26 +57,26 @@ public interface IClasspathAttribute {
/**
* Constant for the name of the javadoc location attribute.
- *
+ *
* <p>The value for this attribute has to be the string representation of a URL.</p>
*
* @since 3.1
*/
String JAVADOC_LOCATION_ATTRIBUTE_NAME = "javadoc_location"; //$NON-NLS-1$
-
+
/**
* Constant for the name of the index location attribute.
- *
+ *
* <p>The value for this attribute has to be the string representation of a URL.
* It should point to an existing index file in a folder or a jar. The URL can also be of platform protocol.</p>
- *
+ *
* @since 3.8
*/
String INDEX_LOCATION_ATTRIBUTE_NAME = "index_location"; //$NON-NLS-1$
/**
* Constant for the name of the encoding to be used for source attachments.
- *
+ *
* <p>The value of this attribute has to be a string representation of a valid encoding. The encoding
* for a source attachment is determined in the following order: </p>
*
@@ -131,7 +131,7 @@ public interface IClasspathAttribute {
/**
* Constant for the name of the add-exports attribute.
- *
+ *
* <p>The value of this attribute must adhere to the syntax of <code>javac's</code>
* {@code --add-exports} command line option: {@code <source-module>/<package>=<target-module>(,<target-module>)*}.
* Multiple such options are packed as a ':' separated list into a single classpath attribute.
@@ -139,14 +139,14 @@ public interface IClasspathAttribute {
*
* <p>Classpath entries with this attribute should also have a {@link #MODULE} attribute
* with value <code>"true"</code>.</p>
- *
+ *
* @since 3.14
*/
String ADD_EXPORTS = "add-exports"; //$NON-NLS-1$
/**
* Constant for the name of the add-opens attribute.
- *
+ *
* <p>The value of this attribute must adhere to the syntax of <code>javac's</code>
* {@code --add-opens} command line option: {@code <source-module>/<package>=<target-module>(,<target-module>)*}.
* Multiple such options are packed as a ':' separated list into a single classpath attribute.
@@ -154,19 +154,19 @@ public interface IClasspathAttribute {
*
* <p>Classpath entries with this attribute should also have a {@link #MODULE} attribute
* with value <code>"true"</code>.</p>
- *
+ *
* @since 3.18
*/
String ADD_OPENS = "add-opens"; //$NON-NLS-1$
/**
* Constant for the name of the add-reads attribute.
- *
+ *
* <p>The value of this attribute must adhere to the syntax of <code>javac's</code>
* {@code --add-reads} command line option: {@code <source-module>=<target-module>}.
* Multiple such options are packed as a ':' separated list into a single classpath attribute.
* The given reads edge will be added at compile time.</p>
- *
+ *
* @since 3.14
*/
String ADD_READS = "add-reads"; //$NON-NLS-1$
@@ -207,12 +207,12 @@ public interface IClasspathAttribute {
/**
* Constant for the name of the limit-modules attribute.
- *
+ *
* <p>The value of this attribute must be a comma-separated list of names of modules
* defined in the classpath entry, to which this attribute is attached.
* The set of modules observable through this entry will be limited to
* the transitive closure of modules in this list.</p>
- *
+ *
* <p>This attribute is supported for classpath entries of kind
* {@link IClasspathEntry#CPE_CONTAINER}.
* A classpath entry having this attribute must also have the
@@ -226,29 +226,29 @@ public interface IClasspathAttribute {
* Constant of the name of the module-main-class attribute.
* The classpath entry holding this attribute must refer to a source folder
* containing the implementation of a module.
- *
+ *
* <p>The value of this attribute must be the name of a class defined in this module.
* It will be used for generating the <code>ModuleMainClass</code> attribute
* in <code>module-info.class</code>.</p>
- *
+ *
* @since 3.14
*/
String MODULE_MAIN_CLASS = "module-main-class"; //$NON-NLS-1$
/**
- * Constant for the name of the external annotation path attribute.
- *
+ * Constant for the name of the external annotation path attribute.
+ *
* <p>The value for this attribute has to be the string representation of a path.
* It should point to an existing directory where external annotations can be
* found to support annotation based null analysis involving 3rd party libraries.</p>
- *
+ *
* @since 3.11
*/
String EXTERNAL_ANNOTATION_PATH = "annotationpath"; //$NON-NLS-1$
/**
* Constant for the name of the test attribute.
- *
+ *
* <p>
* The possible values for this attribute are <code>"true"</code> or <code>"false"</code>. When not present,
* <code>"false"</code> is assumed. If the value of this attribute is <code>"true"</code>, and the classpath entry
@@ -259,20 +259,20 @@ public interface IClasspathAttribute {
* not have the test attribute set to to "true". During the compilation of test sources, all code is visible as if
* this attribute didn't exist at all.
* </p>
- *
+ *
* @since 3.14
*/
String TEST = "test"; //$NON-NLS-1$
/**
* Constant for the name of the without_test_code attribute.
- *
+ *
* <p>
* The possible values for this attribute are <code>"true"</code> or <code>"false"</code>. When not present,
* <code>"false"</code> is assumed. If the value of this attribute is <code>"true"</code>, and the classpath entry
* is a project, any test code reachable via that classpath entry will not be visible even to test sources.
* </p>
- *
+ *
* @since 3.14
*/
String WITHOUT_TEST_CODE = "without_test_code"; //$NON-NLS-1$
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IClasspathContainer.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IClasspathContainer.java
index ba3afda8f..1bfd25794 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IClasspathContainer.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IClasspathContainer.java
@@ -30,7 +30,7 @@ import org.eclipse.core.runtime.IPath;
* <li> project entries (<code>CPE_PROJECT</code>) </li>
* </ul>
* In particular, a classpath container can neither reference further classpath containers or classpath variables.
- * <p>
+ * <p>
* A library entry can reference other libraries through the Class-Path section of the JAR's MANIFEST.MF file. If the
* container wants such referenced entries to be part of the classpath, the container must explicitly add them to the
* array returned from {@link #getClasspathEntries()}.
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IClasspathEntry.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IClasspathEntry.java
index ad735bc07..cc134387a 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IClasspathEntry.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IClasspathEntry.java
@@ -417,23 +417,23 @@ public interface IClasspathEntry {
*/
IPath getSourceAttachmentRootPath();
-
+
/**
- * Returns the classpath entry that is making a reference to this classpath entry. For entry kinds
- * {@link #CPE_LIBRARY}, the return value is the entry that is representing the JAR that includes
- * <code>this</code> in the MANIFEST.MF file's Class-Path section. For entry kinds other than
- * {@link #CPE_LIBRARY}, this returns <code>null</code>. For those entries that are on the raw classpath already,
- * this returns <code>null</code>.
+ * Returns the classpath entry that is making a reference to this classpath entry. For entry kinds
+ * {@link #CPE_LIBRARY}, the return value is the entry that is representing the JAR that includes
+ * <code>this</code> in the MANIFEST.MF file's Class-Path section. For entry kinds other than
+ * {@link #CPE_LIBRARY}, this returns <code>null</code>. For those entries that are on the raw classpath already,
+ * this returns <code>null</code>.
* <p>
* It is possible that multiple library entries refer to the same entry
- * via the MANIFEST.MF file. In those cases, this method returns the first classpath entry
- * that appears in the raw classpath. However, this does not mean that the other referencing
- * entries do not relate to their referenced entries.
- * See {@link JavaCore#getReferencedClasspathEntries(IClasspathEntry, IJavaProject)} for
+ * via the MANIFEST.MF file. In those cases, this method returns the first classpath entry
+ * that appears in the raw classpath. However, this does not mean that the other referencing
+ * entries do not relate to their referenced entries.
+ * See {@link JavaCore#getReferencedClasspathEntries(IClasspathEntry, IJavaProject)} for
* more details.
* </p>
- *
- * @return the classpath entry that is referencing this entry or <code>null</code> if
+ *
+ * @return the classpath entry that is referencing this entry or <code>null</code> if
* not applicable.
* @since 3.6
*/
@@ -475,7 +475,7 @@ public interface IClasspathEntry {
/**
* This is a convience method, that returns <code>true</code> if the extra attributes contain an attribute whose name
* is {@link IClasspathAttribute#TEST} and whose value is 'true'.
- *
+ *
* @see #getExtraAttributes()
* @see IClasspathAttribute#TEST
* @return <code>true</code>, if if the extra attributes contain a attribute whose name is
@@ -493,7 +493,7 @@ public interface IClasspathEntry {
/**
* This is a convience method, that returns <code>true</code> if the extra attributes contain an attribute whose name
* is {@link IClasspathAttribute#WITHOUT_TEST_CODE} and whose value is 'true'.
- *
+ *
* @see #getExtraAttributes()
* @see IClasspathAttribute#WITHOUT_TEST_CODE
* @return <code>true</code>, if if the extra attributes contain a attribute whose name is
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ICodeAssist.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ICodeAssist.java
index 0e0a5f595..28792ca45 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ICodeAssist.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ICodeAssist.java
@@ -87,7 +87,7 @@ public interface ICodeAssist {
*/
void codeComplete(int offset, CompletionRequestor requestor)
throws JavaModelException;
-
+
/**
* Performs code completion at the given offset position in this compilation unit,
* reporting results to the given completion requestor. The <code>offset</code>
@@ -99,7 +99,7 @@ public interface ICodeAssist {
* can be very long to compute are proposed. To avoid that the code assist operation
* take too much time a {@link IProgressMonitor} which automatically cancel the code
* assist operation when a specified amount of time is reached could be used.
- *
+ *
* <pre>
* new IProgressMonitor() {
* private final static int TIMEOUT = 500; //ms
@@ -188,7 +188,7 @@ public interface ICodeAssist {
*/
void codeComplete(int offset, CompletionRequestor requestor, WorkingCopyOwner owner)
throws JavaModelException;
-
+
/**
* Performs code completion at the given offset position in this compilation unit,
* reporting results to the given completion requestor. The <code>offset</code>
@@ -207,7 +207,7 @@ public interface ICodeAssist {
* can be very long to compute are proposed. To avoid that the code assist operation
* take too much time a {@link IProgressMonitor} which automatically cancel the code
* assist operation when a specified amount of time is reached could be used.
- *
+ *
* <pre>
* new IProgressMonitor() {
* private final static int TIMEOUT = 500; //ms
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ICompilationUnit.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ICompilationUnit.java
index 62addd9e6..0507a4d90 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ICompilationUnit.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ICompilationUnit.java
@@ -421,7 +421,7 @@ ICompilationUnit getPrimary();
* Returns <code>null</code> if this <code>ICompilationUnit</code> is the primary
* working copy, or this <code>ICompilationUnit</code> is not a working copy,
* otherwise the <code>WorkingCopyOwner</code>
- *
+ *
* @return <code>null</code> if this <code>ICompilationUnit</code> is the primary
* working copy, or this <code>ICompilationUnit</code> is not a working copy,
* otherwise the <code>WorkingCopyOwner</code>
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IElementChangedListener.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IElementChangedListener.java
index a877f00f1..0e463393c 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IElementChangedListener.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IElementChangedListener.java
@@ -19,7 +19,7 @@ package org.eclipse.jdt.core;
* <p>
* This interface may be implemented by clients.
* </p>
- *
+ *
* @see JavaCore#addElementChangedListener(IElementChangedListener)
*/
public interface IElementChangedListener {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaModelMarker.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaModelMarker.java
index 6e6a32040..9348af131 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaModelMarker.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaModelMarker.java
@@ -70,7 +70,7 @@ public interface IJavaModelMarker {
* <p>If the argument contains a '#', the character is doubled.<br>
* {"foo#test", "bar" } is encoded as "2:foo##test#bar"
* </p>
- *
+ *
* @since 2.0
* @see CorrectionEngine#getProblemArguments(IMarker)
*/
@@ -117,12 +117,12 @@ public interface IJavaModelMarker {
* @since 2.0
*/
String CLASSPATH_FILE_FORMAT = "classpathFileFormat"; //$NON-NLS-1$
-
+
/**
- * Output overlapping another source attribute (value <code>"outputOverlappingSource"</code>).
- * Used only on buildpath problem markers. The value of this attribute is
+ * Output overlapping another source attribute (value <code>"outputOverlappingSource"</code>).
+ * Used only on buildpath problem markers. The value of this attribute is
* either "true" or "false".
- *
+ *
* @since 3.6.4
*/
String OUTPUT_OVERLAPPING_SOURCE = "outputOverlappingSource"; //$NON-NLS-1$
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaModelStatusConstants.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaModelStatusConstants.java
index 1604a57d4..46669acd5 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaModelStatusConstants.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaModelStatusConstants.java
@@ -132,12 +132,12 @@ public interface IJavaModelStatusConstants {
/**
* Status constant indicating that a destination provided for a copy/move/rename operation
- * is invalid. The destination for a package fragment must be a package fragment root; the
- * destination for a compilation unit must be a package fragment; the destination for
- * a package declaration or import declaration must be a compilation unit; the
- * destination for a type must be a type or compilation unit; the destination for any
+ * is invalid. The destination for a package fragment must be a package fragment root; the
+ * destination for a compilation unit must be a package fragment; the destination for
+ * a package declaration or import declaration must be a compilation unit; the
+ * destination for a type must be a type or compilation unit; the destination for any
* type member (other than a type) must be a type. <br>
- *
+ *
* The destination element can be retrieved using <code>getElements</code> on the status object.
*/
public static final int INVALID_DESTINATION = 978;
@@ -339,13 +339,13 @@ public interface IJavaModelStatusConstants {
* @since 3.4
*/
public static final int BAD_TEXT_EDIT_LOCATION = 1011;
-
+
/**
* <p>Status constant indicating that the attached javadoc content cannot be retrieved due to timeout
* @since 3.7
*/
public static final int CANNOT_RETRIEVE_ATTACHED_JAVADOC_TIMEOUT = 1012;
-
+
/**
* <p>Status constant indicating that the default or specific output folder is overlapping
* with another source location. </p>
@@ -359,9 +359,9 @@ public interface IJavaModelStatusConstants {
* @see org.eclipse.jdt.core.IClasspathAttribute#EXTERNAL_ANNOTATION_PATH
*/
public static final int CP_INVALID_EXTERNAL_ANNOTATION_PATH = 1014;
-
+
/**
- * Status constant indicating that a source folder marked to contain test sources has no separate output location, but the project also contains main sources.
+ * Status constant indicating that a source folder marked to contain test sources has no separate output location, but the project also contains main sources.
* preference settings.
* @see IClasspathAttribute#TEST
* @since 3.14
@@ -380,7 +380,7 @@ public interface IJavaModelStatusConstants {
* Status constant indicating that the project has only main source folders but depends on a project that has only
* test source folders.
* </p>
- *
+ *
* @since 3.16
*/
public static final int MAIN_ONLY_PROJECT_DEPENDS_ON_TEST_ONLY_PROJECT = 1017;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaProject.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaProject.java
index 0938c2f4c..07f4d3d90 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaProject.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaProject.java
@@ -54,7 +54,7 @@ import org.eclipse.jdt.core.eval.IEvaluationContext;
* The children of a Java project are the package fragment roots that are
* defined by the classpath and contained in this project (in other words, it
* does not include package fragment roots for other projects). The children
- * (i.e. the package fragment roots) appear in the order they are defined by
+ * (i.e. the package fragment roots) appear in the order they are defined by
* the classpath.
* <p>
* An instance of one of these handles can be created via
@@ -69,11 +69,11 @@ public interface IJavaProject extends IParent, IJavaElement, IOpenable {
/**
* Path of the file containing the project's classpath relative to the project's root.
- *
+ *
* <p>The file is a child of the project folder.</p>
* <p>The format of this file is unspecified and it is not meant to be modified.
* Its contents is modified by using the <code>IJavaProject#setRawClasspath(..)</code> methods.</p>
- *
+ *
* @see #setRawClasspath(IClasspathEntry[], IProgressMonitor)
* @see #setRawClasspath(IClasspathEntry[], boolean, IProgressMonitor)
* @see #setRawClasspath(IClasspathEntry[], IPath, IProgressMonitor)
@@ -235,7 +235,7 @@ public interface IJavaProject extends IParent, IJavaElement, IOpenable {
* <p>
* The result does not include package fragment roots in other projects
* referenced on this project's classpath.
- *
+ *
* @param entry the given entry
* @return the existing package fragment roots identified by the given entry
* @see IClasspathContainer
@@ -251,7 +251,7 @@ public interface IJavaProject extends IParent, IJavaElement, IOpenable {
* <p>
* This API can be used to bypass any filter and get really all roots to which the given entry is resolved.
* </p>
- *
+ *
* @param entry a classpath entry of this Java project
* @return the unfiltered array of package fragment roots to which the classpath entry resolves
* @see #findPackageFragmentRoots(IClasspathEntry)
@@ -431,7 +431,7 @@ public interface IJavaProject extends IParent, IJavaElement, IOpenable {
* If the returned module descriptor is part of a compilation unit, its owner is the given owner.
* @param moduleName the given module name
* @param owner the owner of the returned module descriptor's compilation unit
- *
+ *
* @exception JavaModelException if this project does not exist or if an
* exception occurs while accessing its corresponding resource
* @return the first module found following this project's module path
@@ -554,7 +554,7 @@ public interface IJavaProject extends IParent, IJavaElement, IOpenable {
* Returns all of the package fragment roots contained in this
* project, identified on this project's resolved classpath. The result
* does not include package fragment roots in other projects referenced
- * on this project's classpath. The package fragment roots appear in the
+ * on this project's classpath. The package fragment roots appear in the
* order they are defined by the classpath.
*
* <p>NOTE: This is equivalent to <code>getChildren()</code>.
@@ -578,7 +578,7 @@ public interface IJavaProject extends IParent, IJavaElement, IOpenable {
* <p>
* The result does not include package fragment roots in other projects
* referenced on this project's classpath.
- *
+ *
* @param entry the given entry
* @return the existing package fragment roots identified by the given entry
* @see IClasspathContainer
@@ -610,16 +610,16 @@ public interface IJavaProject extends IParent, IJavaElement, IOpenable {
IProject getProject();
/**
- * Returns the {@link IModuleDescription} this project represents or
- * null if the Java project doesn't represent any named module. A Java
- * project is said to represent a module if any of its source package
- * fragment roots (see {@link IPackageFragmentRoot#K_SOURCE}) contains a
+ * Returns the {@link IModuleDescription} this project represents or
+ * null if the Java project doesn't represent any named module. A Java
+ * project is said to represent a module if any of its source package
+ * fragment roots (see {@link IPackageFragmentRoot#K_SOURCE}) contains a
* valid Java module descriptor, or if one of its classpath entries
* has a valid {@link IClasspathAttribute#PATCH_MODULE} attribute
* affecting the current project.
* In the latter case the corresponding module description of the
* location referenced by that classpath entry is returned.
- *
+ *
* @return the {@link IModuleDescription} this project represents.
* @exception JavaModelException if this element does not exist or if an
* exception occurs while accessing its corresponding resource
@@ -628,13 +628,13 @@ public interface IJavaProject extends IParent, IJavaElement, IOpenable {
IModuleDescription getModuleDescription() throws JavaModelException;
/**
- * Returns the <code>IModuleDescription</code> owned by this project or
- * null if the Java project doesn't own a valid Java module descriptor.
+ * Returns the <code>IModuleDescription</code> owned by this project or
+ * null if the Java project doesn't own a valid Java module descriptor.
* This method considers only module descriptions contained in any of the
* project's source package fragment roots (see {@link IPackageFragmentRoot#K_SOURCE}).
* In particular any {@link IClasspathAttribute#PATCH_MODULE} attribute
* is not considered.
- *
+ *
* @return the {@link IModuleDescription} this project owns.
* @exception JavaModelException if this element does not exist or if an
* exception occurs while accessing its corresponding resource
@@ -701,8 +701,8 @@ public interface IJavaProject extends IParent, IJavaElement, IOpenable {
* Because of this, hanging on resolved classpath is not recommended.
* </p>
* <p>
- * Note that if the resolution creates duplicate entries
- * (i.e. {@link IClasspathEntry entries} which are {@link Object#equals(Object)}),
+ * Note that if the resolution creates duplicate entries
+ * (i.e. {@link IClasspathEntry entries} which are {@link Object#equals(Object)}),
* only the first one is added to the resolved classpath.
* </p>
*
@@ -1095,23 +1095,23 @@ public interface IJavaProject extends IParent, IJavaElement, IOpenable {
void setRawClasspath(IClasspathEntry[] entries, boolean canModifyResources, IProgressMonitor monitor) throws JavaModelException;
/**
- * Works similar to {@link #setRawClasspath(IClasspathEntry[], IPath, IProgressMonitor)} and
+ * Works similar to {@link #setRawClasspath(IClasspathEntry[], IPath, IProgressMonitor)} and
* additionally allows persisting the given array of referenced entries for this project.
- * The referenced entries and their attributes are stored in the .classpath file of this
- * project. For details on referenced entries, see
+ * The referenced entries and their attributes are stored in the .classpath file of this
+ * project. For details on referenced entries, see
* {@link JavaCore#getReferencedClasspathEntries(IClasspathEntry, IJavaProject)}
* and {@link IClasspathEntry#getReferencingEntry()}.
* <p>
- * Since the referenced entries are stored in the .classpath file, clients can store additional
+ * Since the referenced entries are stored in the .classpath file, clients can store additional
* information that belong to these entries and retrieve them across sessions, though the referenced
* entries themselves may not be present in the raw classpath. By passing a <code>null</code>
* referencedEntries, clients can choose not to modify the already persisted referenced entries,
* which is fully equivalent to {@link #setRawClasspath(IClasspathEntry[], IPath, IProgressMonitor)}.
- * If an empty array is passed as referencedEntries, the already persisted referenced entries,
- * if any, will be cleared.
+ * If an empty array is passed as referencedEntries, the already persisted referenced entries,
+ * if any, will be cleared.
* </p> <p>
- * If there are duplicates of a referenced entry or if any of the <code>referencedEntries</code>
- * is already present in the raw classpath(<code>entries</code>) those referenced entries will
+ * If there are duplicates of a referenced entry or if any of the <code>referencedEntries</code>
+ * is already present in the raw classpath(<code>entries</code>) those referenced entries will
* be excluded and not be persisted.
*</p>
* @param entries a list of classpath entries
@@ -1132,8 +1132,8 @@ public interface IJavaProject extends IParent, IJavaElement, IOpenable {
IProgressMonitor monitor) throws JavaModelException;
/**
- * Returns the list of referenced classpath entries stored in the .classpath file of <code>this</code>
- * java project. Clients can store the referenced classpath entries using
+ * Returns the list of referenced classpath entries stored in the .classpath file of <code>this</code>
+ * java project. Clients can store the referenced classpath entries using
* {@link #setRawClasspath(IClasspathEntry[], IClasspathEntry[], IPath, IProgressMonitor)}
* If the client has not stored any referenced entries for this project, an empty array is returned.
*
@@ -1143,7 +1143,7 @@ public interface IJavaProject extends IParent, IJavaElement, IOpenable {
* @since 3.6
*/
IClasspathEntry[] getReferencedClasspathEntries() throws JavaModelException;
-
+
/**
* Sets the classpath of this project using a list of classpath entries. In particular such a classpath may contain
* classpath variable entries. Classpath variable entries can be resolved individually ({@link JavaCore#getClasspathVariable(String)}),
@@ -1231,7 +1231,7 @@ public interface IJavaProject extends IParent, IJavaElement, IOpenable {
/**
* Returns the classpath entry that refers to the given path or <code>null</code> if there is no reference to the
* path.
- *
+ *
* @param path
* IPath
* @return the classpath entry or <code>null</code>.
@@ -1246,7 +1246,7 @@ public interface IJavaProject extends IParent, IJavaElement, IOpenable {
* test-only dependencies that should not be mentioned in the module-info.java). When executing test code that was
* compiled like this, corresponding "--add-reads" options need to be passed to the java runtime. This method
* returns the list of modules on the project's classpath for which this is the case.
- *
+ *
* @return the set of module names
* @throws JavaModelException
* when access to the classpath or module description of the given project fails.
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ILocalVariable.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ILocalVariable.java
index 4fefad46b..4bd8da87e 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ILocalVariable.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ILocalVariable.java
@@ -57,10 +57,10 @@ public interface ILocalVariable extends IJavaElement, ISourceReference, IAnnotat
* @see Signature
*/
String getTypeSignature();
-
+
/**
* Returns <code>true</code> if this local variable is a method parameter, <code>false</code> otherwise.
- *
+ *
* @return <code>true</code> if this local variable is a method parameter, <code>false</code> otherwise
* @since 3.7
*/
@@ -69,7 +69,7 @@ public interface ILocalVariable extends IJavaElement, ISourceReference, IAnnotat
/**
* Returns the modifier flags for this local variable. The flags can be examined using class
* {@link Flags}.
- *
+ *
* <p>Note that only flags as indicated in the source are returned.</p>
*
* @return the modifier flags for this local variable
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IMethod.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IMethod.java
index d0f780485..e2a41e7d4 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IMethod.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IMethod.java
@@ -111,7 +111,7 @@ int getNumberOfParameters();
* <p>For binary types, associated source is used to retrieve the {@link ILocalVariable#getNameRange() name range},
* {@link ILocalVariable#getSourceRange() source range} and the {@link ILocalVariable#getFlags() flags}.</p>
* <p>These local variables can be used to retrieve the {@link ILocalVariable#getAnnotations() parameter annotations}.</p>
- *
+ *
* @return the parameters of this method
* @throws JavaModelException if this element does not exist or if an
* exception occurs while accessing its corresponding resource.
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IModularClassFile.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IModularClassFile.java
index d67fe823b..6a1ed9556 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IModularClassFile.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IModularClassFile.java
@@ -24,7 +24,7 @@ public interface IModularClassFile extends IClassFile {
* Returns the module description contained in this type root.
* An error-free {@link IModularClassFile} should always have a module.
*
- * @throws JavaModelException
+ * @throws JavaModelException
* @return the module description contained in the type root.
*/
@Override
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IModuleDescription.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IModuleDescription.java
index bf5eed5c9..9d077fac8 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IModuleDescription.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IModuleDescription.java
@@ -36,7 +36,7 @@ public interface IModuleDescription extends IMember, IAnnotatable {
* @since 3.14
*/
String[] getRequiredModuleNames() throws JavaModelException;
-
+
/**
* Get provided service names for this module.
*
@@ -45,7 +45,7 @@ public interface IModuleDescription extends IMember, IAnnotatable {
* @since 3.18
*/
String[] getProvidedServiceNames() throws JavaModelException;
-
+
/**
* Get used service names for this module.
*
@@ -76,7 +76,7 @@ public interface IModuleDescription extends IMember, IAnnotatable {
String[] getOpenedPackageNames(IModuleDescription targetModule) throws JavaModelException;
/**
- *
+ *
* @return true if automatic module, else false
* @since 3.14
*/
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IOpenable.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IOpenable.java
index 40f9d6545..ab5a6aaa9 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IOpenable.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IOpenable.java
@@ -118,10 +118,10 @@ boolean hasUnsavedChanges() throws JavaModelException;
boolean isConsistent() throws JavaModelException;
/**
* Returns whether this openable is open. This is a handle-only method.
- *
+ *
* <p>Note: This method doesn't tell whether an {@link IJavaProject}'s {@link IJavaProject#getProject() getProject()} is open.
* It is <b>not</b> equivalent to {@link IProject#isOpen()}!</p>
- *
+ *
* <p>Note: Although {@link #isOpen} is exposed in the API, clients
* rarely have a need to rely on this internal state of the Java model.</p>
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IOrdinaryClassFile.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IOrdinaryClassFile.java
index cc1d5ca86..9e3153abf 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IOrdinaryClassFile.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IOrdinaryClassFile.java
@@ -15,7 +15,7 @@ package org.eclipse.jdt.core;
/**
* Ordinary form of a {@link IClassFile} which holds exactly one <code>IType</code>.
- *
+ *
* @since 3.14
* @noimplement This interface is not intended to be implemented by clients.
*/
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IPackageFragment.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IPackageFragment.java
index 592084485..d28c2e89e 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IPackageFragment.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IPackageFragment.java
@@ -105,7 +105,7 @@ public interface IPackageFragment extends IParent, IJavaElement, IOpenable, ISou
* Returns the class file for <code>"module-info.class"</code> in this package.
* This is a handle-only method. The class file may or may not be present.
* If the class file is present, then it is guaranteed to contain an {@link IModuleDescription}.
- *
+ *
* @since 3.14
* @return the class file representing "module-info.class" in this package.
*/
@@ -117,7 +117,7 @@ public interface IPackageFragment extends IParent, IJavaElement, IOpenable, ISou
* <p>Note: it is possible that a package fragment contains only
* compilation units (in other words, its kind is <code>K_SOURCE</code>), in
* which case this method returns an empty collection.</p>
- *
+ *
* <p>Note: the returned list may contain ordinary class files as well as
* a modular class file (for "module-info.class").</p>
*
@@ -127,11 +127,11 @@ public interface IPackageFragment extends IParent, IJavaElement, IOpenable, ISou
* @since 3.14
*/
IClassFile[] getAllClassFiles() throws JavaModelException;
-
+
/**
* Returns all of the ordinary class files in this package fragment.
- *
- * <p>Note: this list never includes a modular class file
+ *
+ * <p>Note: this list never includes a modular class file
* (see {@link #getModularClassFile()}).</p>
*
* <p>Note: it is possible that a package fragment contains only
@@ -153,7 +153,7 @@ public interface IPackageFragment extends IParent, IJavaElement, IOpenable, ISou
* <p>Note: it is possible that a package fragment contains only
* compilation units (in other words, its kind is <code>K_SOURCE</code>), in
* which case this method returns an empty collection.</p>
- *
+ *
* @exception JavaModelException if this element does not exist or if an
* exception occurs while accessing its corresponding resource.
* @return all of the ordinary class files in this package fragment
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IPackageFragmentRoot.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IPackageFragmentRoot.java
index 20b09a0d6..9a9d080ea 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IPackageFragmentRoot.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IPackageFragmentRoot.java
@@ -314,15 +314,15 @@ public interface IPackageFragmentRoot
* @since 2.0
*/
IClasspathEntry getRawClasspathEntry() throws JavaModelException;
-
+
/**
* Returns the first resolved classpath entry that corresponds to this package fragment root.
* A resolved classpath entry is said to correspond to a root if the path of the resolved
* entry is equal to the root's path.
- *
+ *
* @return the first resolved classpath entry that corresponds to this package fragment root
* @throws JavaModelException if this element does not exist or if an
- * exception occurs while accessing its corresponding resource.
+ * exception occurs while accessing its corresponding resource.
* @since 3.6
*/
IClasspathEntry getResolvedClasspathEntry() throws JavaModelException;
@@ -454,7 +454,7 @@ public interface IPackageFragmentRoot
* Returns the <code>IModuleDescription</code> that this package fragment root contains.
* Returns <code>null</code> if the root doesn't contain any named module or if the project compiler compliance is 1.8 or lower.
* If present the module descriptor is found as a child of the package fragment representing the default package.
- *
+ *
* Note that only one of the source package fragment roots in a Java Project can legally
* contain a module descriptor.
*
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ISourceRange.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ISourceRange.java
index 8a642cad2..3e8acf6fd 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ISourceRange.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ISourceRange.java
@@ -20,7 +20,7 @@ package org.eclipse.jdt.core;
* <p>Clients may use the method {@link org.eclipse.jdt.core.SourceRange#isAvailable(ISourceRange)}
* in order to find out if a source range is available. This method returns <code>false</code>
* when the source range offset is equals to <code>-1</code>.</p>
- *
+ *
* <p>Clients may use the default implementation provided by {@link SourceRange}.</p>
*
* @see SourceRange
@@ -39,11 +39,11 @@ int getLength();
/**
* Returns the 0-based index of the first character of the source code for this element,
* relative to the source buffer in which this element is contained. However, if the element
- * has no associated source code, an implementation may return -1.
+ * has no associated source code, an implementation may return -1.
*
* @return the 0-based index of the first character of the source code for this element,
* relative to the source buffer in which this element is contained. However, if the element
- * has no associated source code, an implementation may return -1.
+ * has no associated source code, an implementation may return -1.
*/
int getOffset();
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ISourceReference.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ISourceReference.java
index 0387cebdf..4edc4b897 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ISourceReference.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ISourceReference.java
@@ -78,13 +78,13 @@ ISourceRange getSourceRange() throws JavaModelException;
/**
* Returns the name range associated with this element.
- *
+ *
* <p>If the element is an {@link IMember}, it returns
* the source range of this member's simple name,
* or <code>null</code> if this member does not have a name
* (for example, an initializer), or if this member does not have
* associated source code (for example, a binary type).</p>
- *
+ *
* <p>If this element is an {@link IImportDeclaration}, the source range
* of this import declaration's name, or <code>null</code> if this import
* declaration does not have associated source code (for example, a binary type).
@@ -93,17 +93,17 @@ ISourceRange getSourceRange() throws JavaModelException;
* </p>
*
* <p>If this element is an {@link IPackageDeclaration}, the source range of
- * this package declaration's name, or <code>null</code> if this package
+ * this package declaration's name, or <code>null</code> if this package
* declaration does not have associated source code (for example, a binary type).</p>
*
* <p>If this element is an {@link IAnnotation}, the source range of
* this annotation's name, or <code>null</code> if this annotation does not have
* associated source code (for example, in a binary type).</p>
- *
- * <p>If this element is an {@link ITypeParameter}, the source range of this
+ *
+ * <p>If this element is an {@link ITypeParameter}, the source range of this
* type parameter's name, or <code>null</code> if this type parameter does not have
* associated source code (for example, in a binary type).</p>
- *
+ *
* <p>If this element is an {@link ITypeRoot} or {@link IImportContainer}, it
* returns null.</p>
*
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IType.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IType.java
index 8de84af7e..e511ae155 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IType.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IType.java
@@ -25,9 +25,9 @@ import org.eclipse.core.runtime.IProgressMonitor;
* types are subkinds of classes and interfaces, respectively.
* <p>
* Note that the element name of an anonymous source type and lambda expressions
- * is always empty. Types representing lambda expressions are pseudo-elements
- * and not included in the children of their parent. Lambda expressions are created
- * as the result of a <code>ICodeAssist.codeSelect(...)</code>. For more information
+ * is always empty. Types representing lambda expressions are pseudo-elements
+ * and not included in the children of their parent. Lambda expressions are created
+ * as the result of a <code>ICodeAssist.codeSelect(...)</code>. For more information
* on such pseudo-elements, see <code>ILocalVariable</code>.
* </p><p>
* If a binary type cannot be parsed, its structure remains unknown.
@@ -166,7 +166,7 @@ public interface IType extends IMember, IAnnotatable {
boolean isStatic,
CompletionRequestor requestor)
throws JavaModelException;
-
+
/**
* Do code completion inside a code snippet in the context of the current type.
*
@@ -178,7 +178,7 @@ public interface IType extends IMember, IAnnotatable {
* can be very long to compute are proposed. To avoid that the code assist operation
* take too much time a {@link IProgressMonitor} which automatically cancel the code
* assist operation when a specified amount of time is reached could be used.
- *
+ *
* <pre>
* new IProgressMonitor() {
* private final static int TIMEOUT = 500; //ms
@@ -269,7 +269,7 @@ public interface IType extends IMember, IAnnotatable {
CompletionRequestor requestor,
WorkingCopyOwner owner)
throws JavaModelException;
-
+
/**
* Do code completion inside a code snippet in the context of the current type.
* It considers types in the working copies with the given owner first. In other words,
@@ -288,7 +288,7 @@ public interface IType extends IMember, IAnnotatable {
* can be very long to compute are proposed. To avoid that the code assist operation
* take too much time a {@link IProgressMonitor} which automatically cancel the code
* assist operation when a specified amount of time is reached could be used.
- *
+ *
* <pre>
* new IProgressMonitor() {
* private final static int TIMEOUT = 500; //ms
@@ -490,7 +490,7 @@ public interface IType extends IMember, IAnnotatable {
* <p>
* The results are listed in the order in which they appear in the source or class file.
* </p>
- *
+ *
* @return the children for the given category.
* @exception JavaModelException if this element does not exist or if an
* exception occurs while accessing its corresponding resource.
@@ -501,7 +501,7 @@ public interface IType extends IMember, IAnnotatable {
/**
* Returns the simple name of this type, unqualified by package or enclosing type.
* This is a handle-only method.
- *
+ *
* Note that the element name of an anonymous source type and lambda expressions
* is always empty.
*
@@ -521,7 +521,7 @@ public interface IType extends IMember, IAnnotatable {
IField getField(String name);
/**
- * Returns the fields declared by this type in the order in which they appear
+ * Returns the fields declared by this type in the order in which they appear
* in the source or class file. For binary types, this includes synthetic fields.
*
* @exception JavaModelException if this element does not exist or if an
@@ -601,9 +601,9 @@ public interface IType extends IMember, IAnnotatable {
IInitializer getInitializer(int occurrenceCount);
/**
- * Returns the initializers declared by this type. For binary types this is an
- * empty collection. For source types, the results are listed in the order in
- * which they appear in the source.
+ * Returns the initializers declared by this type. For binary types this is an
+ * empty collection. For source types, the results are listed in the order in
+ * which they appear in the source.
*
* @exception JavaModelException if this element does not exist or if an
* exception occurs while accessing its corresponding resource.
@@ -636,7 +636,7 @@ public interface IType extends IMember, IAnnotatable {
* The type signatures may be either unresolved (for source types)
* or resolved (for binary types), and either basic (for basic types)
* or rich (for parameterized types). See {@link Signature} for details.
- * Note that the parameter type signatures for binary methods are expected
+ * Note that the parameter type signatures for binary methods are expected
* to be dot-based.
* </p>
*
@@ -651,7 +651,7 @@ public interface IType extends IMember, IAnnotatable {
* For binary types, this may include the special <code>&lt;clinit&gt;</code> method
* and synthetic methods.
* <p>
- * The results are listed in the order in which they appear in the source or class file.
+ * The results are listed in the order in which they appear in the source or class file.
* </p>
*
* @exception JavaModelException if this element does not exist or if an
@@ -941,10 +941,10 @@ public interface IType extends IMember, IAnnotatable {
boolean isAnnotation() throws JavaModelException;
/**
- * Returns whether this type represents a local type. For an anonymous type,
+ * Returns whether this type represents a local type. For an anonymous type,
* this method returns true.
* <p>
- * Note: This deviates from JLS3 14.3, which states that anonymous types are
+ * Note: This deviates from JLS3 14.3, which states that anonymous types are
* not local types since they do not have a name.
* </p>
*
@@ -1240,7 +1240,7 @@ public interface IType extends IMember, IAnnotatable {
* @since 3.0
*/
String[][] resolveType(String typeName, WorkingCopyOwner owner) throws JavaModelException;
-
+
/**
* Returns whether this type represents a lambda expression.
*
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ITypeParameter.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ITypeParameter.java
index 7aa938246..68b544be1 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ITypeParameter.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ITypeParameter.java
@@ -45,12 +45,12 @@ public interface ITypeParameter extends IJavaElement, ISourceReference {
String[] getBounds() throws JavaModelException;
/**
- * Returns the signatures for this type parameter's bounds. The type parameter may have
- * been declared as part of a type or a method. The signatures represent only the individual
- * bounds and do not include the type variable name or the <code>extends</code> keyword.
- * The signatures may be either unresolved (for source types) or resolved (for binary types).
+ * Returns the signatures for this type parameter's bounds. The type parameter may have
+ * been declared as part of a type or a method. The signatures represent only the individual
+ * bounds and do not include the type variable name or the <code>extends</code> keyword.
+ * The signatures may be either unresolved (for source types) or resolved (for binary types).
* See {@link Signature} for details.
- *
+ *
* @return the signatures for the bounds of this formal type parameter
* @throws JavaModelException
* if this element does not exist or if an exception occurs while accessing its corresponding resource.
@@ -58,7 +58,7 @@ public interface ITypeParameter extends IJavaElement, ISourceReference {
* @since 3.6
*/
String[] getBoundsSignatures() throws JavaModelException;
-
+
/**
* Returns the declaring member of this type parameter. This can be either an <code>IType</code>
* or an <code>IMethod</code>.
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ITypeRoot.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ITypeRoot.java
index 1556b177b..4e18644d3 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ITypeRoot.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ITypeRoot.java
@@ -41,7 +41,7 @@ IType findPrimaryType();
* in this type root.
* <p>Only subtype {@link IModularClassFile} promises to return non-null.</p>
*
- * @throws JavaModelException
+ * @throws JavaModelException
* @since 3.14
* @return the module description contained in the type root or null.
*/
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaConventions.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaConventions.java
index b18211867..042e28458 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaConventions.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaConventions.java
@@ -336,7 +336,7 @@ public final class JavaConventions {
IStatus status = validateIdentifier(id, sourceLevel, complianceLevel);
return status;
} finally {
- SCANNER.parsePureJavaOnly = old;
+ SCANNER.parsePureJavaOnly = old;
}
}
}
@@ -408,9 +408,9 @@ public final class JavaConventions {
/**
* Validate the given Java type name, either simple or qualified, for the given source and compliance levels.
- *
+ *
* <p>For example, <code>"java.lang.Object"</code>, or <code>"Object"</code>.</p>
- *
+ *
* <p>The source level and compliance level values should be taken from the constant defined inside
* {@link JavaCore} class. The constants are named <code>JavaCore#VERSION_1_x</code>, x being set
* between '1' and '8'.
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java
index 8cca42e87..e2f943f66 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java
@@ -111,7 +111,7 @@
* Harry Terkelsen (het@google.com) - Bug 449262 - Allow the use of third-party Java formatters
* Gábor Kövesdán - Contribution for Bug 350000 - [content assist] Include non-prefix matches in auto-complete suggestions
* Karsten Thoms - Bug 532505 - Reduce memory footprint of ClasspathAccessRule
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.core;
@@ -237,7 +237,7 @@ public final class JavaCore extends Plugin {
public static final String OTDT_PLUGIN_ID = "org.eclipse.objectteams.otdt"; //$NON-NLS-1$
public static final String OTJ_BUILDER_ID = OTDT_PLUGIN_ID + ".builder.OTJBuilder"; //$NON-NLS-1$
-
+
public static final String OTJ_NATURE_ID = OTDT_PLUGIN_ID + ".OTJavaNature"; //$NON-NLS-1$
//SH}
@@ -624,7 +624,7 @@ public final class JavaCore extends Plugin {
/**
* Compiler option ID: Reporting Unused Type Parameter.
- * <p>When enabled, the compiler will issue an error or a warning whenever it encounters an
+ * <p>When enabled, the compiler will issue an error or a warning whenever it encounters an
* unused type parameter. </p>
* <dl>
* <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedTypeParameter"</code></dd>
@@ -1196,7 +1196,7 @@ public final class JavaCore extends Plugin {
* </dl>
* @since 3.5
* @category CompilerOptionID
- */
+ */
public static final String COMPILER_PB_DEAD_CODE_IN_TRIVIAL_IF_STATEMENT = PLUGIN_ID + ".compiler.problem.deadCodeInTrivialIfStatement"; //$NON-NLS-1$
/**
* Compiler option ID: Reporting Incomplete Enum Switch.
@@ -1232,7 +1232,7 @@ public final class JavaCore extends Plugin {
public static final String COMPILER_PB_MISSING_ENUM_CASE_DESPITE_DEFAULT = PLUGIN_ID + ".compiler.problem.missingEnumCaseDespiteDefault"; //$NON-NLS-1$
/**
* Compiler option ID: Reporting Missing Default Case In Switch.
- * <p>When enabled, the compiler will issue an error or a warning
+ * <p>When enabled, the compiler will issue an error or a warning
* against each switch statement that lacks a default case.</p>
* <dl>
* <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingDefaultCase"</code></dd>
@@ -1391,7 +1391,7 @@ public final class JavaCore extends Plugin {
/**
* Compiler option ID: Reporting Missing Javadoc Tags for Method Type Parameters.
* <p>Specify whether a missing <code>@param</code> for a type parameter in a method declaration should be reported.
- * When enabled, the compiler will issue a missing Javadoc tag error or warning for a type parameter without a
+ * When enabled, the compiler will issue a missing Javadoc tag error or warning for a type parameter without a
* corresponding <code>@param</code> tag.</p>
* <p>This option only has an effect if the compiler compliance is 1.5 or greater.</p>
* <dl>
@@ -1445,7 +1445,7 @@ public final class JavaCore extends Plugin {
//{ObjectTeams: new option: scoped keywords (use stateful scanner?)
public static final String COMPILER_OPT_SCOPED_KEYWORDS = OTDT_PLUGIN_ID + ".compiler.option.scoped_keywords"; //$NON-NLS-1$
-
+
/**
* @since 3.10 OT 2.3
*/
@@ -1536,7 +1536,7 @@ public final class JavaCore extends Plugin {
/**
* Compiler option ID: Reporting a resource that is not closed properly.
* <p>When enabled, the compiler will issue an error or a warning if
- * a local variable holds a value of type <code>java.lang.AutoCloseable</code> (compliance>=1.7)
+ * a local variable holds a value of type <code>java.lang.AutoCloseable</code> (compliance>=1.7)
* or a value of type <code>java.io.Closeable</code> (compliance<=1.6) and if
* flow analysis shows that the method <code>close()</code> is not invoked locally on that value.</p>
* <dl>
@@ -1551,9 +1551,9 @@ public final class JavaCore extends Plugin {
/**
* Compiler option ID: Reporting a resource that may not be closed properly.
* <p>When enabled, the compiler will issue an error or a warning if
- * a local variable holds a value of type <code>java.lang.AutoCloseable</code> (compliance>=1.7)
+ * a local variable holds a value of type <code>java.lang.AutoCloseable</code> (compliance>=1.7)
* or a value of type <code>java.io.Closeable</code> (compliance<=1.6) and if
- * flow analysis shows that the method <code>close()</code> is
+ * flow analysis shows that the method <code>close()</code> is
* not invoked locally on that value for all execution paths.</p>
* <dl>
* <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable"</code></dd>
@@ -1566,7 +1566,7 @@ public final class JavaCore extends Plugin {
public static final String COMPILER_PB_POTENTIALLY_UNCLOSED_CLOSEABLE = PLUGIN_ID + ".compiler.problem.potentiallyUnclosedCloseable"; //$NON-NLS-1$
/**
* Compiler option ID: Reporting a resource that is not managed by try-with-resources.
- * <p>When enabled, the compiler will issue an error or a warning if a local variable
+ * <p>When enabled, the compiler will issue an error or a warning if a local variable
* holds a value of type <code>java.lang.AutoCloseable</code>, and if the method
* <code>close()</code> is explicitly invoked on that resource, but the resource is
* not managed by a try-with-resources block.</p>
@@ -1617,7 +1617,7 @@ public final class JavaCore extends Plugin {
/**
* Compiler option ID: Reporting a method invocation providing an argument of an unlikely type to method 'equals'.
* <p>
- * When enabled, the compiler will issue an error or warning when {@link java.lang.Object#equals(Object)} is used with an argument type
+ * When enabled, the compiler will issue an error or warning when {@link java.lang.Object#equals(Object)} is used with an argument type
* that seems to be not related to the receiver's type, or correspondingly when the arguments of {@link java.util.Objects#equals(Object, Object)}
* have types that seem to be not related to each other.
* </p>
@@ -1627,7 +1627,7 @@ public final class JavaCore extends Plugin {
* <dd><code>{ "error", "warning", "info", "ignore" }</code></dd>
* <dt>Default:</dt><dd><code>"info"</code></dd>
* </dl>
- *
+ *
* @since 3.13
* @category CompilerOptionID
*/
@@ -1651,12 +1651,12 @@ public final class JavaCore extends Plugin {
* <dd><code>{ "error", "warning", "info", "ignore" }</code></dd>
* <dt>Default:</dt><dd><code>"warning"</code></dd>
* </dl>
- *
+ *
* @since 3.14
* @category CompilerOptionID
*/
public static final String COMPILER_PB_API_LEAKS = PLUGIN_ID + ".compiler.problem.APILeak"; //$NON-NLS-1$
-
+
/**
* Compiler option ID: Reporting when a module requires an auto module with an unstable name.
* <p>
@@ -1671,7 +1671,7 @@ public final class JavaCore extends Plugin {
* <dd><code>{ "error", "warning", "info", "ignore" }</code></dd>
* <dt>Default:</dt><dd><code>"warning"</code></dd>
* </dl>
- *
+ *
* @since 3.14
* @category CompilerOptionID
*/
@@ -1687,19 +1687,19 @@ public final class JavaCore extends Plugin {
* <p>
* When enabled, the compiler will issue an error, warning or info when a {@code @SuppressWarnings} annotation
* was not observed to be necessary, but analysis of the suppressed group of problems was incomplete.
- *
+ *
* <dl>
* <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.suppressWarningsNotFullyAnalysed"</code></dd>
* <dt>Possible values:</dt>
* <dd><code>{ "error", "warning", "info", "ignore" }</code></dd>
* <dt>Default:</dt><dd><code>"info"</code></dd>
* </dl>
- *
+ *
* @since 3.20
* @category CompilerOptionID
*/
public static final String COMPILER_PB_SUPPRESS_WARNINGS_NOT_FULLY_ANALYSED = PLUGIN_ID + ".compiler.problem.suppressWarningsNotFullyAnalysed"; //$NON-NLS-1$
-
+
/**
* Compiler option ID: Annotation-based Null Analysis.
* <p>This option controls whether the compiler will use null annotations for
@@ -1863,7 +1863,7 @@ public final class JavaCore extends Plugin {
* Compiler option ID: Reporting missing default nullness annotation.
* <p>When enabled, the compiler will issue an error or a warning in the following cases:</p>
* <ul>
- * <li> When a package does not contain a default nullness annotation, as a result of missing package-info.java
+ * <li> When a package does not contain a default nullness annotation, as a result of missing package-info.java
* or missing default nullness annotation in package-info.java.</li>
* <li> When a type inside a default package does not contain a default nullness annotation.</li>
* </ul>
@@ -1918,7 +1918,7 @@ public final class JavaCore extends Plugin {
*/
public static final String COMPILER_PB_NULL_SPECIFICATION_VIOLATION = PLUGIN_ID + ".compiler.problem.nullSpecViolation"; //$NON-NLS-1$
/**
- * Compiler option ID: Reporting conflicts between declared null annotation and inferred null value
+ * Compiler option ID: Reporting conflicts between declared null annotation and inferred null value
* <p>When enabled, the compiler will issue an error or a warning whenever one of the
* following situations is detected:</p>
* <ol>
@@ -2033,7 +2033,7 @@ public final class JavaCore extends Plugin {
* after transitively applying inheritance and after applying any default nullness
* (see {@link #COMPILER_NONNULL_BY_DEFAULT_ANNOTATION_NAME}) at the site of the overridden method.</p>
* <p>If different implicit null annotations (from a nonnull default and/or overridden methods) are applicable
- * to the same type in a method signature, this is flagged as an error
+ * to the same type in a method signature, this is flagged as an error
* and an explicit null annotation must be used to disambiguate.</p>
* <dl>
* <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations"</code></dd>
@@ -2046,7 +2046,7 @@ public final class JavaCore extends Plugin {
public static final String COMPILER_INHERIT_NULL_ANNOTATIONS = JavaCore.PLUGIN_ID+".compiler.annotation.inheritNullAnnotations"; //$NON-NLS-1$
/**
* Compiler option ID: Reporting Dropped Nonnull Parameter Annotations.
- * <p>When enabled, the compiler will issue an error or a warning against a parameter of
+ * <p>When enabled, the compiler will issue an error or a warning against a parameter of
* a method that overrides an inherited method
* if all of the following hold:</p>
* <ul>
@@ -2059,7 +2059,7 @@ public final class JavaCore extends Plugin {
* because the compiler's null ananysis cannot decide wither <code>null</code> is or is not a legal value for this parameter.
* However, the annotation in the overridden method <em>suggests</em> that the parameter should also be annotated as non-null.
* If that is not intended or possible, it is recommended to annotate the parameter as nullable,
- * in order to make this (legal) change of contract explicit.</p>
+ * in order to make this (legal) change of contract explicit.</p>
* <dl>
* <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped"</code></dd>
* <dt>Possible values:</dt><dd><code>{ "error", "warning", "info", "ignore" }</code></dd>
@@ -2081,7 +2081,7 @@ public final class JavaCore extends Plugin {
* </ul>
* <p>This particular situation leverages the option to consistently substitute all occurrences of a type variable
* with a nonnull type, but it bears the risk that the library type may not be aware of null annotations thus lacking
- * a necessary <code>@Nullable</code> annotation for a particular occurrence of a type variable.</p>
+ * a necessary <code>@Nullable</code> annotation for a particular occurrence of a type variable.</p>
* <p>This option only has an effect if the option {@link #COMPILER_ANNOTATION_NULL_ANALYSIS} is enabled and when
* the configured set of null annotations declares the target <code>TYPE_USE</code></p>
* <dl>
@@ -2153,7 +2153,7 @@ public final class JavaCore extends Plugin {
* <p>When enabled, the compiler will compile against the system libraries from release
* of the specified compliance level</p>
* <p>Setting this option sets the {@link #COMPILER_CODEGEN_TARGET_PLATFORM}) and {@link #COMPILER_SOURCE} to
- * the same level as the compiler compliance. This option is available to a project only when a supporting
+ * the same level as the compiler compliance. This option is available to a project only when a supporting
* JDK is found in the project's build path</p>
* <dl>
* <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.release"</code></dd>
@@ -2276,7 +2276,7 @@ public final class JavaCore extends Plugin {
/**
* Compiler option ID: Further Determining the Effect of <code>@SuppressWarnings</code> if also
* {@link #COMPILER_PB_SUPPRESS_WARNINGS} is enabled.
- * <p>When enabled, the <code>@SuppressWarnings</code> annotation can additionally be used to suppress
+ * <p>When enabled, the <code>@SuppressWarnings</code> annotation can additionally be used to suppress
* optional compiler diagnostics that have been configured as {@link #ERROR}.</p>
* <p>When disabled, all <code>@SuppressWarnings</code> annotations only affects warnings.</p>
* <dl>
@@ -2606,7 +2606,7 @@ public final class JavaCore extends Plugin {
* Core option ID: Reporting an output location overlapping another source location.
* <p> Indicate the severity of the problem reported when a source entry's output location overlaps another
* source entry.</p>
- *
+ *
* <dl>
* <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource"</code></dd>
* <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd>
@@ -2618,9 +2618,9 @@ public final class JavaCore extends Plugin {
/**
* Core option ID: Reporting if a project which has only main sources depends on a project with only test sources.
- * <p> Indicate the severity of the problem reported when a project that has one or more main source folders but
+ * <p> Indicate the severity of the problem reported when a project that has one or more main source folders but
* no test source folders has a project on its build path that only has one or more test source folders, but no main source folders.</p>
- *
+ *
* <dl>
* <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.classpath.mainOnlyProjectHasTestOnlyDependency"</code></dd>
* <dt>Possible values:</dt><dd><code>{ "error", "ignore" }</code></dd>
@@ -3152,9 +3152,9 @@ public final class JavaCore extends Plugin {
VERSION_1_6, VERSION_1_7, VERSION_1_8, VERSION_9, VERSION_10, VERSION_11, VERSION_12, VERSION_13, VERSION_14));
/**
- * Returns all {@link JavaCore}{@code #VERSION_*} levels in the order of their
+ * Returns all {@link JavaCore}{@code #VERSION_*} levels in the order of their
* introduction. For e.g., {@link JavaCore#VERSION_1_8} appears before {@link JavaCore#VERSION_10}
- *
+ *
* @return all available versions
* @since 3.14
*/
@@ -3163,13 +3163,13 @@ public final class JavaCore extends Plugin {
}
/**
- * Returns whether the given version of Java or Java Runtime is supported
+ * Returns whether the given version of Java or Java Runtime is supported
* by the Java Development Toolkit.
- *
+ *
* A true indicates that the given version is supported. For e.g., if the argument
- * is <code>11.0.1</code> and {@link #getAllVersions()} contains <code>11</code>,
+ * is <code>11.0.1</code> and {@link #getAllVersions()} contains <code>11</code>,
* the method returns <code>true</code>.
- *
+ *
* @return a boolean indicating support for the given version of Java or Java Runtime.
* @since 3.16
*/
@@ -3346,7 +3346,7 @@ public final class JavaCore extends Plugin {
* <dt>Default:</dt><dd><code>"disabled"</code></dd>
* </dl>
* @since 2.0 (OTDT)
- * @category CoreOptionID
+ * @category CoreOptionID
*/
public static final String AST_INCLUDES_ROLE_FILES = JavaCore.PLUGIN_ID+".ASTIncludesRoleFiles"; //$NON-NLS-1$
// SH}
@@ -4874,7 +4874,7 @@ public final class JavaCore extends Plugin {
* {@link IAccessRule#IGNORE_IF_BETTER}
* @return a new access rule
* @since 3.1
- *
+ *
* @see IClasspathEntry#getExclusionPatterns()
*/
public static IAccessRule newAccessRule(IPath filePattern, int kind) {
@@ -5155,7 +5155,7 @@ public final class JavaCore extends Plugin {
* to the workspace root), or externally to the workspace (absolute path in the file system).
* The target root folder can also be defined internally to the workspace (absolute path relative
* to the workspace root), or - since 3.4 - externally to the workspace (absolute path in the file system).
- * Since 3.5, the path to the library can also be relative to the project using ".." as the first segment.
+ * Since 3.5, the path to the library can also be relative to the project using ".." as the first segment.
* </p>
* <p>
* e.g. Here are some examples of binary path usage
@@ -5738,28 +5738,28 @@ public final class JavaCore extends Plugin {
false, // no access rules to combine
extraAttributes);
}
-
+
/**
- * Returns an array of classpath entries that are referenced directly or indirectly
- * by a given classpath entry. For the entry kind {@link IClasspathEntry#CPE_LIBRARY},
- * the method returns the libraries that are included in the Class-Path section of
- * the MANIFEST.MF file. If a referenced JAR file has further references to other library
- * entries, they are processed recursively and added to the list. For entry kinds other
+ * Returns an array of classpath entries that are referenced directly or indirectly
+ * by a given classpath entry. For the entry kind {@link IClasspathEntry#CPE_LIBRARY},
+ * the method returns the libraries that are included in the Class-Path section of
+ * the MANIFEST.MF file. If a referenced JAR file has further references to other library
+ * entries, they are processed recursively and added to the list. For entry kinds other
* than {@link IClasspathEntry#CPE_LIBRARY}, this method returns an empty array.
- * <p>
- * When a non-null project is passed, any additional attributes that may have been stored
- * previously in the project's .classpath file are retrieved and populated in the
+ * <p>
+ * When a non-null project is passed, any additional attributes that may have been stored
+ * previously in the project's .classpath file are retrieved and populated in the
* corresponding referenced entry. If the project is <code>null</code>, the raw referenced
- * entries are returned without any persisted attributes.
- * For more details on storing referenced entries, see
- * {@link IJavaProject#setRawClasspath(IClasspathEntry[], IClasspathEntry[], IPath,
- * IProgressMonitor)}.
+ * entries are returned without any persisted attributes.
+ * For more details on storing referenced entries, see
+ * {@link IJavaProject#setRawClasspath(IClasspathEntry[], IClasspathEntry[], IPath,
+ * IProgressMonitor)}.
* </p>
- *
- * @param libraryEntry the library entry whose referenced entries are sought
+ *
+ * @param libraryEntry the library entry whose referenced entries are sought
* @param project project where the persisted referenced entries to be retrieved from. If <code>null</code>
* persisted attributes are not attempted to be retrieved.
- * @return an array of classpath entries that are referenced directly or indirectly by the given entry.
+ * @return an array of classpath entries that are referenced directly or indirectly by the given entry.
* If not applicable, returns an empty array.
* @since 3.6
*/
@@ -5851,10 +5851,10 @@ public final class JavaCore extends Plugin {
/**
* Deletes the index, then rebuilds any portions of the index that are
* currently needed by the workspace.
- *
+ *
* @param monitor a progress monitor, or <code>null</code> if progress
* reporting and cancellation are not desired
- * @throws CoreException
+ * @throws CoreException
* @since 3.13
*/
public static void rebuildIndex(IProgressMonitor monitor) throws CoreException {
@@ -6040,7 +6040,7 @@ public final class JavaCore extends Plugin {
/**
* Sets the value of the given classpath variable.
* The path must not be null.
- * Since 3.5, the path to a library can also be relative to the project using ".." as the first segment.
+ * Since 3.5, the path to a library can also be relative to the project using ".." as the first segment.
* <p>
* This functionality cannot be used while the resource tree is locked.
* </p>
@@ -6269,10 +6269,10 @@ public final class JavaCore extends Plugin {
return Long.compare(CompilerOptions.versionToJdkLevel(first), CompilerOptions.versionToJdkLevel(second));
}
/**
- * Returns an array of module names referenced by this project indirectly.
- * This is a helper method that can be used to construct a Java module
- * description of an existing project. The referenced modules can either be
- * system modules or user modules found in project build path in the form of
+ * Returns an array of module names referenced by this project indirectly.
+ * This is a helper method that can be used to construct a Java module
+ * description of an existing project. The referenced modules can either be
+ * system modules or user modules found in project build path in the form of
* libraries.
* The prerequisites for this to be effective are:
* <ul>
@@ -6291,14 +6291,14 @@ public final class JavaCore extends Plugin {
}
/**
- * Returns the <code>IModuleDescription</code> that the given java element contains
+ * Returns the <code>IModuleDescription</code> that the given java element contains
* when regarded as an automatic module. The element must be an <code>IPackageFragmentRoot</code>
* or an <code>IJavaProject</code>.
- *
+ *
* <p>The returned module descriptor has a name (<code>getElementName()</code>) following
* the specification of <code>java.lang.module.ModuleFinder.of(Path...)</code>, but it
* contains no other useful information.</p>
- *
+ *
* @return the <code>IModuleDescription</code> representing this java element as an automatic module,
* never <code>null</code>.
* @throws JavaModelException
@@ -6350,7 +6350,7 @@ public final class JavaCore extends Plugin {
* @param module handle for the <code>module-info.java</code> file to be compiled.
* @param classFileAttributes map of attribute names and values to be used during class file generation
* @return the compiled byte code
- *
+ *
* @throws JavaModelException
* @throws IllegalArgumentException if the map of classFileAttributes contains an unsupported key.
* @since 3.14
@@ -6365,7 +6365,7 @@ public final class JavaCore extends Plugin {
* Returns the module name computed for a jar. If the file is a jar and contains a module-info.class, the name
* specified in it is used, otherwise, the algorithm for automatic module naming is used, which first looks for a
* module name in the Manifest.MF and as last resort computes it from the file name.
- *
+ *
* @param file the jar to examine
* @return null if file is not a file, otherwise the module name.
* @since 3.14
@@ -6393,11 +6393,11 @@ public final class JavaCore extends Plugin {
}
return new String(moduleName);
}
-
+
/**
* Returns the names of the modules required by the module-info.class in the jar. If the file is not jar or a jar
* that has no module-info.class is present, the empty set is returned.
- *
+ *
* @param file the jar to examine
* @return set of module names.
* @since 3.14
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/NamingConventions.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/NamingConventions.java
index f2be556ad..9d2bf6b1b 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/NamingConventions.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/NamingConventions.java
@@ -29,16 +29,16 @@ import org.eclipse.jdt.internal.core.InternalNamingConventions;
* <ul>
* <li> {@link JavaCore#CODEASSIST_FIELD_PREFIXES} : Define the Prefixes for Field Name.</li>
* <li> {@link JavaCore#CODEASSIST_FIELD_SUFFIXES} : Define the Suffixes for Field Name.</li>
- *
+ *
* <li> {@link JavaCore#CODEASSIST_STATIC_FIELD_PREFIXES} : Define the Prefixes for Static Field Name.</li>
* <li> {@link JavaCore#CODEASSIST_STATIC_FIELD_SUFFIXES} : Define the Suffixes for Static Field Name.</li>
- *
+ *
* <li> {@link JavaCore#CODEASSIST_STATIC_FINAL_FIELD_PREFIXES} : Define the Prefixes for Static Final Field Name.</li>
* <li> {@link JavaCore#CODEASSIST_STATIC_FINAL_FIELD_SUFFIXES} : Define the Suffixes for Static Final Field Name.</li>
- *
+ *
* <li> {@link JavaCore#CODEASSIST_LOCAL_PREFIXES} : Define the Prefixes for Local Variable Name.</li>
* <li> {@link JavaCore#CODEASSIST_LOCAL_SUFFIXES} : Define the Suffixes for Local Variable Name.</li>
- *
+ *
* <li> {@link JavaCore#CODEASSIST_ARGUMENT_PREFIXES} : Define the Prefixes for Argument Name.</li>
* <li> {@link JavaCore#CODEASSIST_ARGUMENT_SUFFIXES} : Define the Suffixes for Argument Name.</li>
* </ul>
@@ -244,51 +244,51 @@ public final class NamingConventions {
/**
* Variable kind which represents a static field.
- *
+ *
* @since 3.5
*/
public static final int VK_STATIC_FIELD = InternalNamingConventions.VK_STATIC_FIELD;
/**
* Variable kind which represents an instance field.
- *
+ *
* @since 3.5
*/
public static final int VK_INSTANCE_FIELD = InternalNamingConventions.VK_INSTANCE_FIELD;
/**
* Variable kind which represents a static final field.
- *
+ *
* @since 3.5
*/
public static final int VK_STATIC_FINAL_FIELD = InternalNamingConventions.VK_STATIC_FINAL_FIELD;
/**
* Variable kind which represents an argument.
- *
+ *
* @since 3.5
*/
public static final int VK_PARAMETER = InternalNamingConventions.VK_PARAMETER;
/**
* Variable kind which represents a local variable.
- *
+ *
* @since 3.5
*/
public static final int VK_LOCAL = InternalNamingConventions.VK_LOCAL;
-
+
/**
* The base name associated to this base name kind is a simple name.
* When this base name is used the whole name is considered.
- *
+ *
* @see #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean)
- *
+ *
* @since 3.5
*/
public static final int BK_NAME = InternalNamingConventions.BK_SIMPLE_NAME;
-
+
/**
* The base name associated to this base name kind is a simple type name.
* When this base name is used all the words of the name are considered.
- *
+ *
* @see #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean)
- *
+ *
* @since 3.5
*/
public static final int BK_TYPE_NAME = InternalNamingConventions.BK_SIMPLE_TYPE_NAME;
@@ -336,7 +336,7 @@ public final class NamingConventions {
* @return char[] the name without prefix and suffix.
* @see JavaCore#setOptions(java.util.Hashtable)
* @see JavaCore#getDefaultOptions()
- *
+ *
* @deprecated Use {@link #getBaseName(int, String, IJavaProject)} instead with {@link #VK_PARAMETER} as variable kind.
*/
public static char[] removePrefixAndSuffixForArgumentName(IJavaProject javaProject, char[] argumentName) {
@@ -365,7 +365,7 @@ public final class NamingConventions {
* @return char[] the name without prefix and suffix.
* @see JavaCore#setOptions(java.util.Hashtable)
* @see JavaCore#getDefaultOptions()
- *
+ *
* @deprecated Use {@link #getBaseName(int, String, IJavaProject)} instead with {@link #VK_PARAMETER} as variable kind.
*/
public static String removePrefixAndSuffixForArgumentName(IJavaProject javaProject, String argumentName) {
@@ -397,7 +397,7 @@ public final class NamingConventions {
* @see Flags
* @see JavaCore#setOptions(java.util.Hashtable)
* @see JavaCore#getDefaultOptions()
- *
+ *
* @deprecated Use {@link #getBaseName(int, String, IJavaProject)} instead
* with {@link #VK_INSTANCE_FIELD} or {@link #VK_STATIC_FIELD} as variable kind.
*/
@@ -434,7 +434,7 @@ public final class NamingConventions {
* @see Flags
* @see JavaCore#setOptions(java.util.Hashtable)
* @see JavaCore#getDefaultOptions()
- *
+ *
* @deprecated Use {@link #getBaseName(int, String, IJavaProject)} instead
* with {@link #VK_INSTANCE_FIELD} or {@link #VK_STATIC_FIELD} as variable kind.
*/
@@ -464,7 +464,7 @@ public final class NamingConventions {
* @return char[] the name without prefix and suffix.
* @see JavaCore#setOptions(java.util.Hashtable)
* @see JavaCore#getDefaultOptions()
- *
+ *
* @deprecated Use {@link #getBaseName(int, String, IJavaProject)} instead with {@link #VK_LOCAL} as variable kind.
*/
public static char[] removePrefixAndSuffixForLocalVariableName(IJavaProject javaProject, char[] localName) {
@@ -493,13 +493,13 @@ public final class NamingConventions {
* @return char[] the name without prefix and suffix.
* @see JavaCore#setOptions(java.util.Hashtable)
* @see JavaCore#getDefaultOptions()
- *
+ *
* @deprecated Use {@link #getBaseName(int, String, IJavaProject)} instead with {@link #VK_LOCAL} as variable kind.
*/
public static String removePrefixAndSuffixForLocalVariableName(IJavaProject javaProject, String localName) {
return String.valueOf(removePrefixAndSuffixForLocalVariableName(javaProject, localName.toCharArray()));
}
-
+
/**
* Returns a base name which could be used to generate the given variable name with {@link #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean)}.
* <p>
@@ -522,12 +522,12 @@ public final class NamingConventions {
* If the variable is a {@link #VK_LOCAL}, the variable name is <code>preVariableNamesuf</code>, a possible prefix is <code>pre</code> and a possible suffix is <code>suf</code>
* then the base name will be <code>variableName</code>.<br>
* </p>
- *
+ *
* @param variableKind specifies what type the variable is: {@link #VK_LOCAL}, {@link #VK_PARAMETER}, {@link #VK_STATIC_FIELD},
* {@link #VK_INSTANCE_FIELD} or {@link #VK_STATIC_FINAL_FIELD}.
* @param variableName a variable name
* @param javaProject project which contains the variable or <code>null</code> to take into account only workspace settings.
- *
+ *
* @see #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean)
* @since 3.5
*/
@@ -537,7 +537,7 @@ public final class NamingConventions {
IJavaProject javaProject) {
return String.valueOf(InternalNamingConventions.getBaseName(variableKind, javaProject, variableName.toCharArray(), true));
}
-
+
private static int getFieldVariableKind(int modifiers) {
if (Flags.isStatic(modifiers)) {
if (Flags.isFinal(modifiers)) {
@@ -585,15 +585,15 @@ public final class NamingConventions {
* @return char[][] an array of names.
* @see JavaCore#setOptions(java.util.Hashtable)
* @see JavaCore#getDefaultOptions()
- *
+ *
* @deprecated Use {@link #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean)} instead with {@link #VK_PARAMETER} as variable kind.
*/
public static char[][] suggestArgumentNames(IJavaProject javaProject, char[] packageName, char[] qualifiedTypeName, int dim, char[][] excludedNames) {
if(qualifiedTypeName == null || qualifiedTypeName.length == 0)
return CharOperation.NO_CHAR_CHAR;
-
+
char[] typeName = CharOperation.lastSegment(qualifiedTypeName, '.');
-
+
NamingRequestor requestor = new NamingRequestor();
InternalNamingConventions.suggestVariableNames(
VK_PARAMETER,
@@ -605,7 +605,7 @@ public final class NamingConventions {
excludedNames,
true,
requestor);
-
+
return requestor.getResults();
}
@@ -636,7 +636,7 @@ public final class NamingConventions {
* @return char[][] an array of names.
* @see JavaCore#setOptions(java.util.Hashtable)
* @see JavaCore#getDefaultOptions()
- *
+ *
* @deprecated Use {@link #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean)} instead with {@link #VK_PARAMETER} as variable kind.
*/
public static String[] suggestArgumentNames(IJavaProject javaProject, String packageName, String qualifiedTypeName, int dim, String[] excludedNames) {
@@ -680,16 +680,16 @@ public final class NamingConventions {
* @see Flags
* @see JavaCore#setOptions(java.util.Hashtable)
* @see JavaCore#getDefaultOptions()
- *
- * @deprecated Use {@link #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean)} instead
+ *
+ * @deprecated Use {@link #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean)} instead
* with {@link #VK_INSTANCE_FIELD} or {@link #VK_STATIC_FIELD} as variable kind.
*/
public static char[][] suggestFieldNames(IJavaProject javaProject, char[] packageName, char[] qualifiedTypeName, int dim, int modifiers, char[][] excludedNames) {
if(qualifiedTypeName == null || qualifiedTypeName.length == 0)
return CharOperation.NO_CHAR_CHAR;
-
+
char[] typeName = CharOperation.lastSegment(qualifiedTypeName, '.');
-
+
NamingRequestor requestor = new NamingRequestor();
InternalNamingConventions.suggestVariableNames(
Flags.isStatic(modifiers) ? VK_STATIC_FIELD : VK_INSTANCE_FIELD,
@@ -701,7 +701,7 @@ public final class NamingConventions {
excludedNames,
true,
requestor);
-
+
return requestor.getResults();
}
@@ -736,8 +736,8 @@ public final class NamingConventions {
* @see Flags
* @see JavaCore#setOptions(java.util.Hashtable)
* @see JavaCore#getDefaultOptions()
- *
- * @deprecated Use {@link #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean)} instead
+ *
+ * @deprecated Use {@link #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean)} instead
* with {@link #VK_INSTANCE_FIELD} or {@link #VK_STATIC_FIELD} as variable kind.
*/
public static String[] suggestFieldNames(IJavaProject javaProject, String packageName, String qualifiedTypeName, int dim, int modifiers, String[] excludedNames) {
@@ -750,7 +750,7 @@ public final class NamingConventions {
modifiers,
convertStringToChars(excludedNames)));
}
-
+
/**
* Suggest name for a getter method. The name is computed from field's name
* and possible prefixes or suffixes are removed.
@@ -869,15 +869,15 @@ public final class NamingConventions {
* @return char[][] an array of names.
* @see JavaCore#setOptions(java.util.Hashtable)
* @see JavaCore#getDefaultOptions()
- *
+ *
* @deprecated Use {@link #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean)} instead with {@link #VK_LOCAL} as variable kind.
*/
public static char[][] suggestLocalVariableNames(IJavaProject javaProject, char[] packageName, char[] qualifiedTypeName, int dim, char[][] excludedNames) {
if(qualifiedTypeName == null || qualifiedTypeName.length == 0)
return CharOperation.NO_CHAR_CHAR;
-
+
char[] typeName = CharOperation.lastSegment(qualifiedTypeName, '.');
-
+
NamingRequestor requestor = new NamingRequestor();
InternalNamingConventions.suggestVariableNames(
VK_LOCAL,
@@ -889,7 +889,7 @@ public final class NamingConventions {
excludedNames,
true,
requestor);
-
+
return requestor.getResults();
}
@@ -920,7 +920,7 @@ public final class NamingConventions {
* @return char[][] an array of names.
* @see JavaCore#setOptions(java.util.Hashtable)
* @see JavaCore#getDefaultOptions()
- *
+ *
* @deprecated Use {@link #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean)} instead with {@link #VK_LOCAL} as variable kind.
*/
public static String[] suggestLocalVariableNames(IJavaProject javaProject, String packageName, String qualifiedTypeName, int dim, String[] excludedNames) {
@@ -950,7 +950,7 @@ public final class NamingConventions {
}
return newName;
}
-
+
/**
* Suggest name for a setter method. The name is computed from field's name
* and possible prefixes or suffixes are removed.
@@ -1045,7 +1045,7 @@ public final class NamingConventions {
isBoolean,
convertStringToChars(excludedNames)));
}
-
+
/**
* Suggests names for a variable. The name is computed from a base name and possible prefixes or suffixes are added.
*
@@ -1116,7 +1116,7 @@ public final class NamingConventions {
* @return String[] an array of names.
* @see JavaCore#setOptions(java.util.Hashtable)
* @see JavaCore#getDefaultOptions()
- *
+ *
* @since 3.5
*/
public static String[] suggestVariableNames(
@@ -1127,7 +1127,7 @@ public final class NamingConventions {
int dim,
String[] excluded,
boolean evaluateDefault) {
-
+
NamingRequestor requestor = new NamingRequestor();
InternalNamingConventions.suggestVariableNames(
variableKind,
@@ -1142,7 +1142,7 @@ public final class NamingConventions {
return convertCharsToString(requestor.getResults());
}
-
+
private NamingConventions() {
// Not instantiable
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/Signature.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/Signature.java
index 5b9276392..cb451d254 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/Signature.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/Signature.java
@@ -147,7 +147,7 @@ import org.eclipse.jdt.internal.compiler.util.Util;
* </p>
* <p>Note: An empty signature is considered to be syntactically incorrect. So most methods will throw
* an IllegalArgumentException if an empty signature is provided.</p>
- *
+ *
* @noinstantiate This class is not intended to be instantiated by clients.
*/
@SuppressWarnings({"rawtypes", "unchecked"})
@@ -418,7 +418,7 @@ public final class Signature {
* Value is <code>"Z"</code>.
*/
public static final String SIG_BOOLEAN = "Z"; //$NON-NLS-1$
-
+
/**
* String constant for the signature of the primitive type byte.
* Value is <code>"B"</code>.
@@ -1133,7 +1133,7 @@ public static char[] createCharArrayTypeSignature(char[] typeName, boolean isRes
/**
* Creates a new intersection type signature from the given type signatures.
- *
+ *
* <p>The encoded type signature is dot-based.</p>
*
* @param typeSignatures the given type signatures
@@ -1153,7 +1153,7 @@ public static String createIntersectionTypeSignature(char[][] typeSignatures) {
}
/**
* Creates a new union type signature from the given type signatures.
- *
+ *
* <p>The encoded type signature is dot-based.</p>
*
* @param typeSignatures the given type signatures
@@ -1174,7 +1174,7 @@ private static String createUnionTypeSignature(char[][] typeSignatures) {
/**
* Creates a new intersection type signature from the given type signatures.
- *
+ *
* <p>The encoded type signature is dot-based.</p>
*
* @param typeSignatures the given type signatures
@@ -1191,7 +1191,7 @@ public static String createIntersectionTypeSignature(String[] typeSignatures) {
}
/**
* Creates a new union type signature from the given type signatures.
- *
+ *
* <p>The encoded type signature is dot-based.</p>
*
* @param typeSignatures the given type signatures
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/SourceRange.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/SourceRange.java
index 9cbad97fd..1547a09c4 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/SourceRange.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/SourceRange.java
@@ -42,7 +42,7 @@ public final class SourceRange implements ISourceRange {
/**
* Instantiate a new source range using the given offset and the given length.
- *
+ *
* @param offset the given offset
* @param length the given length
*/
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/WorkingCopyOwner.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/WorkingCopyOwner.java
index ba7a912eb..035906cb4 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/WorkingCopyOwner.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/WorkingCopyOwner.java
@@ -92,16 +92,16 @@ public abstract class WorkingCopyOwner {
public IProblemRequestor getProblemRequestor(ICompilationUnit workingCopy) {
return null;
}
-
+
/**
* Returns the source of the compilation unit that defines the given type in
* the given package, or <code>null</code> if the type is unknown to this
* owner.
- * <p>This method is called before the normal lookup (i.e. before looking
- * at the project's classpath and before looking at the working copies of this
+ * <p>This method is called before the normal lookup (i.e. before looking
+ * at the project's classpath and before looking at the working copies of this
* owner.)</p>
- * <p>This allows to provide types that are not normally available, or to hide
- * types that would normally be available by returning an empty source for
+ * <p>This allows to provide types that are not normally available, or to hide
+ * types that would normally be available by returning an empty source for
* the given type and package.</p>
* <p>Example of use:
* <pre>
@@ -128,7 +128,7 @@ public abstract class WorkingCopyOwner {
* // Working copy on X.java with the following contents:
* // public class X extends to.be.Generated {
* // }
- * ICompilationUnit workingCopy = ...
+ * ICompilationUnit workingCopy = ...
* ASTParser parser = ASTParser.newParser(AST.JLS3);
* parser.setSource(workingCopy);
* parser.setResolveBindings(true);
@@ -136,7 +136,7 @@ public abstract class WorkingCopyOwner {
* CompilationUnit cu = (CompilationUnit) parser.createAST(null);
* assert cu.getProblems().length == 0;
* </pre>
- *
+ *
* @param typeName the simple name of the type to lookup
* @param packageName the dot-separated name of the package of type
* @return the source of the compilation unit that defines the given type in
@@ -147,16 +147,16 @@ public abstract class WorkingCopyOwner {
public String findSource(String typeName, String packageName) {
return null;
}
-
+
/**
* Returns whether the given package segments represent a package.
- * <p>This method is called before the normal lookup (i.e. before looking
- * at the project's classpath and before looking at the working copies of this
+ * <p>This method is called before the normal lookup (i.e. before looking
+ * at the project's classpath and before looking at the working copies of this
* owner.)</p>
* <p>This allows to provide packages that are not normally available.</p>
- * <p>If <code>false</code> is returned, then normal lookup is used on
+ * <p>If <code>false</code> is returned, then normal lookup is used on
* this package.</p>
- *
+ *
* @param pkg the segments of a package to lookup
* @return whether the given package segments represent a package.
* @see #findSource(String, String)
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/compiler/CompilationParticipant.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/compiler/CompilationParticipant.java
index f996bc574..3f4e7032d 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/compiler/CompilationParticipant.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/compiler/CompilationParticipant.java
@@ -125,7 +125,7 @@ public boolean isActive(IJavaProject project) {
* <p>
* Default is to return <code>false</code>.
* </p>
- *
+ *
* @return whether this participant is interested in Annotations
*/
public boolean isAnnotationProcessor() {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/compiler/ITerminalSymbols.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/compiler/ITerminalSymbols.java
index 1fe00e155..60b8a6d66 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/compiler/ITerminalSymbols.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/compiler/ITerminalSymbols.java
@@ -32,11 +32,11 @@ public interface ITerminalSymbols {
int TokenNameCOMMENT_JAVADOC = 1003;
/**
- * @deprecated With the introduction of "restricted keywords" in Java 9, classification of tokens
+ * @deprecated With the introduction of "restricted keywords" in Java 9, classification of tokens
* by a scanner is inherently unreliable. Any token classified as an identifier could still
* be a "restricted keyword". Future versions of Java will introduce more words that have
* special syntactical meaning in specific contexts.
- * For reliably detecting an identifier the only real solution is to use a parser instead
+ * For reliably detecting an identifier the only real solution is to use a parser instead
* (see also the caveat at the top of the interface documentation of {@link IScanner}).
*/
@Deprecated
@@ -215,7 +215,7 @@ public interface ITerminalSymbols {
TokenNamewhen = 5018,
TokenNameprecedence = 5019;
/**
- * @deprecated Modifier 'readonly' is no longer recognized. It was never truly supported.
+ * @deprecated Modifier 'readonly' is no longer recognized. It was never truly supported.
*/
@Deprecated
int TokenNamereadonly = 5015;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/eval/IEvaluationContext.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/eval/IEvaluationContext.java
index 4f14cd522..a1a4137d7 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/eval/IEvaluationContext.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/eval/IEvaluationContext.java
@@ -178,7 +178,7 @@ public interface IEvaluationContext {
int position,
CompletionRequestor requestor)
throws JavaModelException;
-
+
/**
* Performs a code completion at the given position in the given code snippet,
* reporting results to the given completion requestor.
@@ -189,7 +189,7 @@ public interface IEvaluationContext {
* can be very long to compute are proposed. To avoid that the code assist operation
* take too much time a {@link IProgressMonitor} which automatically cancel the code
* assist operation when a specified amount of time is reached could be used.
- *
+ *
* <pre>
* new IProgressMonitor() {
* private final static int TIMEOUT = 500; //ms
@@ -224,7 +224,7 @@ public interface IEvaluationContext {
CompletionRequestor requestor,
IProgressMonitor monitor)
throws JavaModelException;
-
+
/**
* Performs a code completion at the given position in the given code snippet,
* reporting results to the given completion requestor.
@@ -258,7 +258,7 @@ public interface IEvaluationContext {
CompletionRequestor requestor,
WorkingCopyOwner owner)
throws JavaModelException;
-
+
/**
* Performs a code completion at the given position in the given code snippet,
* reporting results to the given completion requestor.
@@ -276,7 +276,7 @@ public interface IEvaluationContext {
* can be very long to compute are proposed. To avoid that the code assist operation
* take too much time a {@link IProgressMonitor} which automatically cancel the code
* assist operation when a specified amount of time is reached could be used.
- *
+ *
* <pre>
* new IProgressMonitor() {
* private final static int TIMEOUT = 500; //ms
@@ -313,7 +313,7 @@ public interface IEvaluationContext {
WorkingCopyOwner owner,
IProgressMonitor monitor)
throws JavaModelException;
-
+
/**
* Resolves and returns a collection of Java elements corresponding to the source
* code at the given positions in the given code snippet.
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/provisional/JavaModelAccess.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/provisional/JavaModelAccess.java
index 0bdc29809..97a83a106 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/provisional/JavaModelAccess.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/provisional/JavaModelAccess.java
@@ -23,7 +23,7 @@ import org.eclipse.jdt.internal.core.PackageFragmentRoot;
/**
* Provisional API for use by JDT/UI or JDT/Debug, which may possibly be removed in a future version.
- * See <a href="https://bugs.eclipse.org/522391">Bug 522391</a>.
+ * See <a href="https://bugs.eclipse.org/522391">Bug 522391</a>.
*/
public class JavaModelAccess {
/**
@@ -38,14 +38,14 @@ public class JavaModelAccess {
}
/**
- * Returns the <code>IModuleDescription</code> that the given java element contains
+ * Returns the <code>IModuleDescription</code> that the given java element contains
* when regarded as an automatic module. The element must be an <code>IPackageFragmentRoot</code>
* or an <code>IJavaProject</code>.
- *
+ *
* <p>The returned module descriptor has a name (<code>getElementName()</code>) following
* the specification of <code>java.lang.module.ModuleFinder.of(Path...)</code>, but it
* contains no other useful information.</p>
- *
+ *
* @return the <code>IModuleDescription</code> representing this java element as an automatic module,
* never <code>null</code>.
* @throws JavaModelException
@@ -67,7 +67,7 @@ public class JavaModelAccess {
/**
* Answer whether the given module is a system module.
* <p><em>This provisional API may likely be changed into a direct method {@code IModuleDescription.isSystemModule()}.</em></p>
- *
+ *
* @param module the module being queried about
* @return {@code true} iff the module is defined in the system library (also known as JRE).
* @since 3.18
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/ExternalAnnotationUtil.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/ExternalAnnotationUtil.java
index 67dba5de3..f4d6ad654 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/ExternalAnnotationUtil.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/ExternalAnnotationUtil.java
@@ -47,7 +47,7 @@ import org.eclipse.jdt.internal.core.util.KeyToSignature;
/**
* Utilities for accessing and manipulating text files that externally define annotations for a given Java type.
* Files are assumed to be in ".eea format", a textual representation of annotated signatures of members of a given type.
- *
+ *
* @since 3.11
* @noinstantiate This class is not intended to be instantiated by clients.
*/
@@ -198,18 +198,18 @@ public final class ExternalAnnotationUtil {
* the containing jar file and finally the sought annotation file.
*/
public static IFile getAnnotationFile(IJavaProject project, ITypeBinding type, IProgressMonitor monitor) throws CoreException {
-
+
IType targetType = project.findType(type.getErasure().getQualifiedName());
if (!targetType.exists())
return null;
String binaryTypeName = targetType.getFullyQualifiedName('$').replace('.', '/');
-
+
IPackageFragmentRoot packageRoot = (IPackageFragmentRoot) targetType.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT);
IClasspathEntry entry = packageRoot.getResolvedClasspathEntry();
IPath annotationPath = ClasspathEntry.getExternalAnnotationPath(entry, project.getProject(), false);
-
- if (annotationPath == null)
+
+ if (annotationPath == null)
return null;
IWorkspaceRoot workspaceRoot = project.getProject().getWorkspace().getRoot();
@@ -219,7 +219,7 @@ public final class ExternalAnnotationUtil {
if (annotationZip.exists())
return null;
}
-
+
annotationPath = annotationPath.append(binaryTypeName).addFileExtension(ExternalAnnotationProvider.ANNOTATION_FILE_EXTENSION);
return workspaceRoot.getFile(annotationPath);
}
@@ -516,7 +516,7 @@ public final class ExternalAnnotationUtil {
}
/**
- * Insert that given annotation at the given position into the given signature.
+ * Insert that given annotation at the given position into the given signature.
* @param mergeStrategy if set to {@link MergeStrategy#ADD_ANNOTATIONS}, refuse to
* overwrite any existing annotation in the specified location.
*/
@@ -543,7 +543,7 @@ public final class ExternalAnnotationUtil {
if (mergeStrategy == MergeStrategy.REPLACE_SIGNATURE) {
buf.append(newType);
return false;
- }
+ }
try {
SignatureWrapper oWrap = new SignatureWrapper(oldType, true, true); // may already contain annotations
SignatureWrapper nWrap = new SignatureWrapper(newType, true, true); // may already contain annotations
@@ -572,7 +572,7 @@ public final class ExternalAnnotationUtil {
|| match(buf, oWrap, nWrap, '-', false))
{
return true; // annotation allowed after this (not included in oldType / newType)
- } else {
+ } else {
buf.append(oldType);
}
} catch (ArrayIndexOutOfBoundsException aioobe) { // from several locations inside match() or mergeAnnotation().
@@ -589,7 +589,7 @@ public final class ExternalAnnotationUtil {
if (mergeStrategy == MergeStrategy.REPLACE_SIGNATURE) {
buf.append(newType);
return false;
- }
+ }
try {
SignatureWrapper oWrap = new SignatureWrapper(oldType, true, true); // may already contain annotations
SignatureWrapper nWrap = new SignatureWrapper(newType, true, true); // may already contain annotations
@@ -648,7 +648,7 @@ public final class ExternalAnnotationUtil {
if (match1 != match2) {
StringBuilder msg = new StringBuilder("Mismatching type structures ") //$NON-NLS-1$
.append(sig1.signature).append(" vs ").append(sig2.signature); //$NON-NLS-1$
- throw new IllegalArgumentException(msg.toString());
+ throw new IllegalArgumentException(msg.toString());
}
if (match1) {
buf.append(expected);
@@ -664,7 +664,7 @@ public final class ExternalAnnotationUtil {
/**
* If a current char of 'oldS' and/or 'newS' represents a null annotation, insert it into 'buf' guided by 'mergeStrategy'.
- * If the new char is NO_ANNOTATION and strategy is OVERWRITE_ANNOTATIONS, silently skip over any null annotations in 'oldS'.
+ * If the new char is NO_ANNOTATION and strategy is OVERWRITE_ANNOTATIONS, silently skip over any null annotations in 'oldS'.
*/
private static void mergeAnnotation(StringBuffer buf, SignatureWrapper oldS, SignatureWrapper newS, MergeStrategy mergeStrategy) {
// if atEnd use a char that's different from NULLABLE, NONNULL and NO_ANNOTATION:
@@ -692,8 +692,8 @@ public final class ExternalAnnotationUtil {
switch (oldAnn) { case NULLABLE: case NONNULL: oldS.start++; } // just skip
break;
default:
- switch (oldAnn) {
- case NULLABLE: case NONNULL:
+ switch (oldAnn) {
+ case NULLABLE: case NONNULL:
oldS.start++;
buf.append(oldAnn); // keep
}
@@ -715,7 +715,7 @@ public final class ExternalAnnotationUtil {
String nextLines, BufferedReader tailReader, IProgressMonitor monitor)
throws CoreException, IOException
{
- head.append(' ').append(annotatedSignature).append('\n');
+ head.append(' ').append(annotatedSignature).append('\n');
if (nextLines != null)
head.append(nextLines).append('\n');
String line;
@@ -727,7 +727,7 @@ public final class ExternalAnnotationUtil {
private static void createNewFile(IFile file, String newContent, IProgressMonitor monitor) throws CoreException {
ensureExists(file.getParent(), monitor);
-
+
try {
file.create(new ByteArrayInputStream(newContent.getBytes("UTF-8")), false, monitor); //$NON-NLS-1$
} catch (UnsupportedEncodingException e) {
@@ -789,7 +789,7 @@ public final class ExternalAnnotationUtil {
/**
* Apply the specified changes on the given type.
* This method can be used as a dry run without modifying an annotation file.
- *
+ *
* @param originalSignature the original type signature, may be annotated already
* @param annotatedType a type signature with additional annotations (incl. {@link #NO_ANNOTATION}).
* @param mergeStrategy controls how old and new signatures should be merged
@@ -816,7 +816,7 @@ public final class ExternalAnnotationUtil {
/**
* Apply the specified changes on the return type of the given signature.
* This method can be used as a dry run without modifying an annotation file.
- *
+ *
* @param originalSignature the original full signature, may be annotated already
* @param annotatedType a type signature with additional annotations (incl. {@link #NO_ANNOTATION}).
* @param mergeStrategy controls how old and new signatures should be merged
@@ -841,12 +841,12 @@ public final class ExternalAnnotationUtil {
result[3] = ""; //$NON-NLS-1$
return result;
}
-
+
/**
* Apply the specified changes on a parameter within the given signature.
* This method can be used as a dry run without modifying an annotation file.
- *
+ *
* @param originalSignature the original full signature, may be annotated already
* @param annotatedType a type signature with additional annotations (incl. {@link #NO_ANNOTATION}).
* @param paramIdx the index of a parameter to annotate
@@ -868,7 +868,7 @@ public final class ExternalAnnotationUtil {
wrapper.start = wrapper.skipAngleContents(wrapper.computeEnd()) + 1;
int start = wrapper.start;
int end = wrapper.skipAngleContents(wrapper.computeEnd());
- result[0] = originalSignature.substring(0, start);
+ result[0] = originalSignature.substring(0, start);
buf = new StringBuffer();
result[1] = originalSignature.substring(start, end+1);
updateType(buf, result[1].toCharArray(), annotatedType.toCharArray(), mergeStrategy);
@@ -880,7 +880,7 @@ public final class ExternalAnnotationUtil {
/**
* Apply the specified changes on a type parameter within the given signature.
* This method can be used as a dry run without modifying an annotation file.
- *
+ *
* @param originalSignature the original full signature, may be annotated already
* @param annotatedType a type signature with additional annotations (incl. {@link #NO_ANNOTATION}).
* @param rank the index of a type parameter to annotate
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IAttributeNamesConstants.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IAttributeNamesConstants.java
index a7ecd19b0..c3f2ddaba 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IAttributeNamesConstants.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IAttributeNamesConstants.java
@@ -147,7 +147,7 @@ public interface IAttributeNamesConstants {
* @since 3.2
*/
char[] STACK_MAP = "StackMap".toCharArray(); //$NON-NLS-1$
-
+
/**
* "RuntimeVisibleTypeAnnotations" attribute (added in jsr 308).
* @since 3.10
@@ -190,10 +190,10 @@ public interface IAttributeNamesConstants {
* @since 3.14
*/
char[] MODULE_MAIN_CLASS = "ModuleMainClass".toCharArray(); //$NON-NLS-1$
-
+
/**
* "NestHost" attribute (JVMS 11).
- * @since 3.16
+ * @since 3.16
*/
char[] NEST_HOST = "NestHost".toCharArray(); //$NON-NLS-1$
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IComponentInfo.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IComponentInfo.java
index ad615e4bc..a88b8ff93 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IComponentInfo.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IComponentInfo.java
@@ -73,7 +73,7 @@ public interface IComponentInfo {
* Returns an empty collection if none
*/
IClassFileAttribute[] getAttributes();
-
+
/**
* Answer back the total size
* @return the size of the component info
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IConstantPoolConstant.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IConstantPoolConstant.java
index 0c2e4dee8..cb62f32e7 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IConstantPoolConstant.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IConstantPoolConstant.java
@@ -48,8 +48,8 @@ public interface IConstantPoolConstant {
* proposed new name in JVMLS11
* @since 3.16
*/
- int CONSTANT_DynamicCallSite = CONSTANT_InvokeDynamic;
-
+ int CONSTANT_DynamicCallSite = CONSTANT_InvokeDynamic;
+
/**
* @since 3.14
*/
@@ -60,7 +60,7 @@ public interface IConstantPoolConstant {
int CONSTANT_Package = 20;
/**
* For the proposed section of JVMLS11 4.4.13 The CONSTANT_Dynamic_info Structure
- * @since 3.16
+ * @since 3.16
*/
int CONSTANT_Dynamic = 17;
@@ -89,7 +89,7 @@ public interface IConstantPoolConstant {
int CONSTANT_InvokeDynamic_SIZE = 5;
/**
- * @since 3.16
+ * @since 3.16
*/
int CONSTANT_Dynamic_SIZE = 5;
/**
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IConstantPoolEntry.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IConstantPoolEntry.java
index c1529c8ce..220948863 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IConstantPoolEntry.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IConstantPoolEntry.java
@@ -205,7 +205,7 @@ public interface IConstantPoolEntry {
* CONSTANT_InterfaceMethodref type entry. This value is set only when decoding the
* CONSTANT_Methodref, CONSTANT_InterfaceMethodref, CONSTANT_MethodType
* or CONSTANT_InvokeDynamic entry.
- *
+ *
* Returns null otherwise.
*
* @return the method descriptor value for a CONSTANT_Methodref,
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IConstantPoolEntry2.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IConstantPoolEntry2.java
index 7c77a948e..89759b2ab 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IConstantPoolEntry2.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IConstantPoolEntry2.java
@@ -50,7 +50,7 @@ public interface IConstantPoolEntry2 extends IConstantPoolEntry {
* @see IConstantPoolConstant#CONSTANT_MethodHandle
*/
int getReferenceIndex();
-
+
/**
* Returns the bootstrap method attribute index. This value is set only when decoding a InvokeDynamic entry.
* The value is unspecified otherwise.
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IExtendedAnnotation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IExtendedAnnotation.java
index 871158f39..18c7cef79 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IExtendedAnnotation.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IExtendedAnnotation.java
@@ -31,10 +31,10 @@ public interface IExtendedAnnotation extends IAnnotation {
* @return the target type
*/
int getTargetType();
-
+
/**
* Answer back the offset.
- *
+ *
* For a target_type value equals to:
* <table border="1">
* <tr>
@@ -56,73 +56,73 @@ public interface IExtendedAnnotation extends IAnnotation {
* may have been discarded by the compiler if it were a no-op.</td>
* </tr>
* </table>
- *
- *
+ *
+ *
* @return the offset
*/
int getOffset();
-
+
/**
* Answer back the exception table index when the target_type is EXCEPTION_PARAMETER.
- *
+ *
* @return the exception table index
*/
int getExceptionTableIndex();
-
+
/**
* Answer back the local variable reference info table length of this entry as specified in
* the JVM specifications.
- *
+ *
* <p>This is defined only for annotations related to a local variable.</p>
*
* @return the local variable reference info table length of this entry as specified in
* the JVM specifications
*/
int getLocalVariableRefenceInfoLength();
-
+
/**
* Answer back the local variable reference info table of this entry as specified in
* the JVM specifications. Answer an empty array if none.
- *
+ *
* <p>This is defined only for annotations related to a local variable.</p>
*
* @return the local variable reference info table of this entry as specified in
* the JVM specifications. Answer an empty array if none
*/
ILocalVariableReferenceInfo[] getLocalVariableTable();
-
+
/**
* Answer back the method parameter index.
- *
+ *
* <p>The index is 0-based.</p>
- *
+ *
* @return the method parameter index
*/
int getParameterIndex();
/**
* Answer back the index of the type parameter of the class or method
- *
+ *
* <p>The index is 0-based.</p>
- *
+ *
* @return the index of the type parameter of the class or method
*/
int getTypeParameterIndex();
/**
* Answer back the index of the bound of the type parameter of the method or class
- *
+ *
* <p>The index is 0-based.</p>
- *
+ *
* @return the index of the bound of the type parameter of the method or class
*/
int getTypeParameterBoundIndex();
/**
* Answer back the index in the given different situations.
- *
+ *
* <p>The index is 0-based.</p>
- *
+ *
* <table border="1">
* <tr>
* <th>target_type</th>
@@ -130,13 +130,13 @@ public interface IExtendedAnnotation extends IAnnotation {
* </tr>
* <tr>
* <td>0x10 (CLASS_EXTENDS)</td>
- * <td>the index of the type in the clause: <code>-1 (65535)</code> is used if the annotation is on
+ * <td>the index of the type in the clause: <code>-1 (65535)</code> is used if the annotation is on
* the superclass type, and the value <code>i</code> is used if the annotation is on the <code>i</code>th
* superinterface type (counting from zero).</td>
* </tr>
* <tr>
* <td>0x17 (THROWS)</td>
- * <td>the index of the exception type in the clause: the value <code>i</code> denotes an annotation of the
+ * <td>the index of the exception type in the clause: the value <code>i</code> denotes an annotation of the
* <code>i</code>th exception type (counting from zero).</td>
* </tr>
* <tr>
@@ -148,14 +148,14 @@ public interface IExtendedAnnotation extends IAnnotation {
* @return the index in the given different situations
*/
int getAnnotationTypeIndex();
-
+
/**
* Answer back the locations of the annotated type as described in the JVM specifications.
- *
+ *
* <p>This is used for parameterized and array types.</p>
*
* @return the locations of the annotated type
*/
int[][] getTypePath();
-
+
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IExtendedAnnotationConstants.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IExtendedAnnotationConstants.java
index b23f8f80c..ebeeaa9e5 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IExtendedAnnotationConstants.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IExtendedAnnotationConstants.java
@@ -26,7 +26,7 @@ import org.eclipse.jdt.internal.compiler.codegen.AnnotationTargetTypeConstants;
* @noextend This interface is not intended to be extended by clients.
*/
public interface IExtendedAnnotationConstants {
-
+
int CLASS_TYPE_PARAMETER = AnnotationTargetTypeConstants.CLASS_TYPE_PARAMETER;
int METHOD_TYPE_PARAMETER = AnnotationTargetTypeConstants.METHOD_TYPE_PARAMETER;
@@ -51,7 +51,7 @@ public interface IExtendedAnnotationConstants {
int METHOD_INVOCATION_TYPE_ARGUMENT = AnnotationTargetTypeConstants.METHOD_INVOCATION_TYPE_ARGUMENT;
int CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT = AnnotationTargetTypeConstants.CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT;
int METHOD_REFERENCE_TYPE_ARGUMENT = AnnotationTargetTypeConstants.METHOD_REFERENCE_TYPE_ARGUMENT;
-
+
// Type path entry kinds
int TYPE_PATH_DEEPER_IN_ARRAY = 0;
int TYPE_PATH_DEEPER_IN_INNER_TYPE = 1;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IMethodParametersAttribute.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IMethodParametersAttribute.java
index f016b2ca6..c3a0dcdc9 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IMethodParametersAttribute.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IMethodParametersAttribute.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Jesper Steen Moeller - initial API and implementation
*******************************************************************************/
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/INestHostAttribute.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/INestHostAttribute.java
index a37e97f96..3db46181a 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/INestHostAttribute.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/INestHostAttribute.java
@@ -13,7 +13,7 @@ package org.eclipse.jdt.core.util;
/**
* Description of a nest host attribute as described in the JVM
* specifications.
- * @since 3.16
+ * @since 3.16
*/
public interface INestHostAttribute {
/**
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/INestMemberAttributeEntry.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/INestMemberAttributeEntry.java
index d89df66b2..797c7b7d9 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/INestMemberAttributeEntry.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/INestMemberAttributeEntry.java
@@ -13,7 +13,7 @@ package org.eclipse.jdt.core.util;
/**
* Description of a nest host attribute as described in the JVM
* specifications.
- * @since 3.16
+ * @since 3.16
*/
public interface INestMemberAttributeEntry {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/INestMembersAttribute.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/INestMembersAttribute.java
index 2032b7ca4..77011dd31 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/INestMembersAttribute.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/INestMembersAttribute.java
@@ -14,7 +14,7 @@ package org.eclipse.jdt.core.util;
* Description of nest members attribute as described in the JVM
* specifications.
*
- * @since 3.16
+ * @since 3.16
*/
public interface INestMembersAttribute extends IClassFileAttribute {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/DocumentElementParser.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/DocumentElementParser.java
index a9fcb9903..dd5444a92 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/DocumentElementParser.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/DocumentElementParser.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
*******************************************************************************/
@@ -527,7 +527,7 @@ protected void consumeEnterVariable() {
declaration.type = extendedTypeDimension != 0 ? augmentTypeWithAdditionalDimensions(type, extendedTypeDimension, annotationsOnExtendedDimensions, false) : type;
declaration.bits |= (type.bits & ASTNode.HasTypeAnnotations);
-
+
this.variablesCounter[this.nestedType]++;
this.nestedMethod[this.nestedType]++;
pushOnAstStack(declaration);
@@ -753,15 +753,15 @@ protected void consumeFormalParameter(boolean isVarArgs) {
varArgsAnnotations = new Annotation[length],
0,
length);
- }
+ }
}
int firstDimensions = this.intStack[this.intPtr--];
TypeReference type = getTypeReference(firstDimensions);
if (isVarArgs || extendedDimensions != 0) {
if (isVarArgs) {
- type = augmentTypeWithAdditionalDimensions(type, 1, varArgsAnnotations != null ? new Annotation[][] { varArgsAnnotations } : null, true);
- }
+ type = augmentTypeWithAdditionalDimensions(type, 1, varArgsAnnotations != null ? new Annotation[][] { varArgsAnnotations } : null, true);
+ }
if (extendedDimensions != 0) { // combination illegal.
type = augmentTypeWithAdditionalDimensions(type, extendedDimensions, annotationsOnExtendedDimensions, false);
}
@@ -777,8 +777,8 @@ protected void consumeFormalParameter(boolean isVarArgs) {
Argument arg;
if (isReceiver) {
arg = new Receiver(
- parameterName,
- namePositions,
+ parameterName,
+ namePositions,
type,
qualifyingNameReference,
this.intStack[this.intPtr + 1] & ~ClassFileConstants.AccDeprecated);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/ExtraFlags.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/ExtraFlags.java
index 11b8214cc..7c41d6531 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/ExtraFlags.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/ExtraFlags.java
@@ -24,21 +24,21 @@ public final class ExtraFlags {
public final static int HasNonPrivateStaticMemberTypes = 0x0001;
public final static int IsMemberType = 0x0002;
public final static int IsLocalType = 0x0004;
-
+
//internal flags
public final static int ParameterTypesStoredAsSignature = 0x0010;
-
+
public static int getExtraFlags(ClassFileReader reader) {
int extraFlags = 0;
-
+
if (reader.isNestedType()) {
extraFlags |= ExtraFlags.IsMemberType;
}
-
+
if (reader.isLocal()) {
extraFlags |= ExtraFlags.IsLocalType;
}
-
+
IBinaryNestedType[] memberTypes = reader.getMemberTypes();
int memberTypeCounter = memberTypes == null ? 0 : memberTypes.length;
if (memberTypeCounter > 0) {
@@ -50,23 +50,23 @@ public final class ExtraFlags {
break done;
}
}
-
+
}
-
+
return extraFlags;
}
-
+
public static int getExtraFlags(IType type) throws JavaModelException {
int extraFlags = 0;
-
+
if (type.isMember()) {
extraFlags |= ExtraFlags.IsMemberType;
}
-
+
if (type.isLocal()) {
extraFlags |= ExtraFlags.IsLocalType;
}
-
+
IType[] memberTypes = type.getTypes();
int memberTypeCounter = memberTypes == null ? 0 : memberTypes.length;
if (memberTypeCounter > 0) {
@@ -79,13 +79,13 @@ public final class ExtraFlags {
}
}
}
-
+
return extraFlags;
}
-
+
public static int getExtraFlags(TypeDeclaration typeDeclaration) {
int extraFlags = 0;
-
+
if (typeDeclaration.enclosingType != null) {
extraFlags |= ExtraFlags.IsMemberType;
}
@@ -101,7 +101,7 @@ public final class ExtraFlags {
}
}
}
-
+
return extraFlags;
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/ISourceElementRequestor.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/ISourceElementRequestor.java
index 09b117cd4..7e7782fb8 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/ISourceElementRequestor.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/ISourceElementRequestor.java
@@ -34,7 +34,7 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.ast.MethodSpec;
*
* The structural investigation includes: - package statement - import
* statements - top-level types: package member, member types (member types of
- * member types...) - fields - methods. From Java 9 onwards it includes the
+ * member types...) - fields - methods. From Java 9 onwards it includes the
* module name in a module declaration
*
* If reference information is requested, then all source constructs are
@@ -293,7 +293,7 @@ public interface ISourceElementRequestor {
public void exitCalloutToFieldMapping(int sourceEnd, int declarationSourceEnd);
public void exitCallinMapping(int sourceEnd, int declarationSourceEnd);
//ak, jwl, gbr}
-
+
default void enterModule(ModuleInfo info) {
// do nothing
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementNotifier.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementNotifier.java
index 4c9e05d52..ed3130524 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementNotifier.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementNotifier.java
@@ -304,7 +304,7 @@ protected void notifySourceElementRequestor(AbstractMethodDeclaration methodDecl
Argument[] arguments = MethodSignatureEnhancer.getSourceArguments(methodDeclaration);
boolean [] baseclassFlags = null;
// SH}
- ParameterInfo[] parameterInfos = null;
+ ParameterInfo[] parameterInfos = null;
ISourceElementRequestor.MethodInfo methodInfo = new ISourceElementRequestor.MethodInfo();
methodInfo.typeAnnotated = ((methodDeclaration.bits & ASTNode.HasTypeAnnotations) != 0);
@@ -720,7 +720,7 @@ public void notifySourceElementRequestor(
nodes[index++] = types[i];
}
}
-
+
if (parsedUnit.moduleDeclaration != null)
nodes[index++] = parsedUnit.moduleDeclaration;
@@ -1080,7 +1080,7 @@ protected void notifySourceElementRequestor(TypeDeclaration typeDeclaration, boo
case 1 :
methodIndex++;
//{ObjectTeams: don't convert generated methods:
- if (nextMethodDeclaration.isGenerated && !(nextMethodDeclaration instanceof GuardPredicateDeclaration))
+ if (nextMethodDeclaration.isGenerated && !(nextMethodDeclaration instanceof GuardPredicateDeclaration))
break;
// SH}
notifySourceElementRequestor(nextMethodDeclaration, typeDeclaration, currentPackage);
@@ -1135,7 +1135,7 @@ private void fillModuleInfo(ModuleDeclaration mod, ISourceElementRequestor.Modul
}
}
exps[i] = exp;
- }
+ }
modInfo.exports = exps;
}
if (mod.servicesCount > 0) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementParser.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementParser.java
index 502b7fce0..568f7f6e4 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementParser.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementParser.java
@@ -981,7 +981,7 @@ public TypeReference getTypeReference(int dim) {
*/
//{ObjectTeams: wrap to introduce 2nd parameter
- return getTypeReference(dim, false);
+ return getTypeReference(dim, false);
}
@Override
protected TypeReference getTypeReference(int dim, boolean liftingTypeAllowed) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter.java
index 4b6a638bd..3ced99817 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter.java
@@ -153,7 +153,7 @@ public class SourceTypeConverter extends TypeConverter {
} catch (CoreException e) { /* ignore */ }
// SH}
final CompilationUnitElementInfo compilationUnitElementInfo = (CompilationUnitElementInfo) ((JavaElement) this.cu).getElementInfo();
- if (this.has1_5Compliance &&
+ if (this.has1_5Compliance &&
(compilationUnitElementInfo.annotationNumber >= CompilationUnitElementInfo.ANNOTATION_THRESHOLD_FOR_DIET_PARSE ||
(compilationUnitElementInfo.hasFunctionalTypes && (this.flags & LOCAL_TYPE) != 0))) {
// If more than 10 annotations, diet parse as this is faster, but not if
@@ -251,7 +251,7 @@ public class SourceTypeConverter extends TypeConverter {
ModuleDescriptionInfo moduleInfo = (ModuleDescriptionInfo) module;
org.eclipse.jdt.core.ICompilationUnit cuHandle = moduleInfo.getHandle().getCompilationUnit();
this.cu = (ICompilationUnit) cuHandle;
- // always parse, because (a) dietParse is always sufficient, (b) we don't yet have the necessary conversion methods for module directives
+ // always parse, because (a) dietParse is always sufficient, (b) we don't yet have the necessary conversion methods for module directives
return new Parser(this.problemReporter, true).dietParse(this.cu, compilationResult);
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/parser/TypeConverter.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/parser/TypeConverter.java
index 6b38402ee..e2bfa9eff 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/parser/TypeConverter.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/parser/TypeConverter.java
@@ -405,7 +405,7 @@ public abstract class TypeConverter {
// anchors including a 'base' token are encoded differently:
if (CharOperation.equals(identifiers[identCount-1], IOTConstants.BASE)) {
TypeReference qualification;
- if (identCount == 2) {
+ if (identCount == 2) {
qualification = new SingleTypeReference(identifiers[0], positions[0]);
} else {
System.arraycopy(positions, 0, positions=new long[positions.length-1], 0, positions.length-1);
@@ -539,11 +539,11 @@ public abstract class TypeConverter {
case '<' :
/* We need to convert and preserve 1.5 specific constructs either if compliance is 1.5 or above,
or the caller has explicitly requested generics to be included. The parameter includeGenericsAnyway
- should be used by the caller to signal that in the calling context generics information must be
+ should be used by the caller to signal that in the calling context generics information must be
internalized even when the requesting project is 1.4. But in all cases, we must skip over them to
see if there are any applicable type fragments after the type parameters: i.e we just aren't done
- having seen a '<' in 1.4 mode.
-
+ having seen a '<' in 1.4 mode.
+
Because of the way type signatures are encoded, TypeConverter.decodeType(String, int, int, int) is immune
to this problem. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=325633
*/
@@ -585,7 +585,7 @@ public abstract class TypeConverter {
/*
* Method should be inlined.
- *
+ *
* Only extracted to work around https://bugs.eclipse.org/471835 :
* Random crashes in PhaseIdealLoop::build_loop_late_post when C2 JIT tries to compile TypeConverter::decodeType
*/
@@ -813,7 +813,7 @@ public abstract class TypeConverter {
/**
* @param methodMapping
* @param compilationResult
- * @throws JavaModelException
+ * @throws JavaModelException
*/
protected CallinMappingDeclaration convertCallin(
IMethodMapping methodMapping, CompilationResult compilationResult) throws JavaModelException
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/AbstractClassFile.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/AbstractClassFile.java
index 6a3ec8063..b3457dc35 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/AbstractClassFile.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/AbstractClassFile.java
@@ -62,10 +62,10 @@ public abstract class AbstractClassFile extends Openable implements IClassFile,
if (perWorkingCopyInfo == null) {
// close cu and its children
close();
-
+
BecomeWorkingCopyOperation operation = new BecomeWorkingCopyOperation(workingCopy, problemRequestor);
operation.runOperation(monitor);
-
+
return workingCopy;
}
return perWorkingCopyInfo.workingCopy;
@@ -109,7 +109,7 @@ public abstract class AbstractClassFile extends Openable implements IClassFile,
}
@Override
public abstract void codeComplete(int offset, CompletionRequestor requestor, WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaModelException;
-
+
/**
* @see ICodeAssist#codeSelect(int, int)
*/
@@ -119,7 +119,7 @@ public abstract class AbstractClassFile extends Openable implements IClassFile,
}
@Override
public abstract IJavaElement[] codeSelect(int offset, int length, WorkingCopyOwner owner) throws JavaModelException;
-
+
/**
* Returns a new element info for this element.
*/
@@ -133,7 +133,7 @@ public abstract class AbstractClassFile extends Openable implements IClassFile,
AbstractClassFile other = (AbstractClassFile) o;
return this.name.equals(other.name) && this.parent.equals(other.parent);
}
-
+
/**
* Finds the deepest <code>IJavaElement</code> in the hierarchy of
* <code>elt</elt>'s children (including <code>elt</code> itself)
@@ -160,7 +160,7 @@ public abstract class AbstractClassFile extends Openable implements IClassFile,
}
return elt;
}
-
+
@Override
public byte[] getBytes() throws JavaModelException {
JavaElement pkg = (JavaElement) getParent();
@@ -213,7 +213,7 @@ public abstract class AbstractClassFile extends Openable implements IClassFile,
throw new OperationCanceledException();
return contents;
}
-
+
@Override
public IBuffer getBuffer() throws JavaModelException {
IStatus status = validateClassFile();
@@ -235,7 +235,7 @@ public abstract class AbstractClassFile extends Openable implements IClassFile,
public ITypeRoot getTypeRoot() {
return this;
}
-
+
/**
* A class file has a corresponding resource unless it is contained
* in a jar.
@@ -260,7 +260,7 @@ public abstract class AbstractClassFile extends Openable implements IClassFile,
} else {
int index = this.name.indexOf('$');
int prefixLength = index < 0 ? this.name.length() : index;
-
+
IType type = null;
int start = -1;
int end = Integer.MAX_VALUE;
@@ -269,14 +269,14 @@ public abstract class AbstractClassFile extends Openable implements IClassFile,
if (children[i] instanceof IOrdinaryClassFile) {
IOrdinaryClassFile classFile = (IOrdinaryClassFile) children[i];
String childName = classFile.getElementName();
-
+
int childIndex = childName.indexOf('$');
int childPrefixLength = childIndex < 0 ? childName.indexOf('.') : childIndex;
if (prefixLength == childPrefixLength && this.name.regionMatches(0, childName, 0, prefixLength)) {
-
+
// ensure this class file's buffer is open so that source ranges are computed
classFile.getBuffer();
-
+
SourceRange range = mapper.getSourceRange(classFile.getType());
if (range == SourceMapper.UNKNOWN_RANGE) continue;
int newStart = range.getOffset();
@@ -320,7 +320,7 @@ public abstract class AbstractClassFile extends Openable implements IClassFile,
return getParent().getPath().append(getElementName());
}
}
-
+
/*
* @see IJavaElement
*/
@@ -391,7 +391,7 @@ public abstract class AbstractClassFile extends Openable implements IClassFile,
IJavaProject project = getJavaProject();
return JavaConventions.validateClassFileName(getElementName(), project.getOption(JavaCore.COMPILER_SOURCE, true), project.getOption(JavaCore.COMPILER_COMPLIANCE, true));
}
-
+
/**
* @see ICodeAssist#codeComplete(int, ICodeCompletionRequestor)
@@ -467,7 +467,7 @@ public abstract class AbstractClassFile extends Openable implements IClassFile,
}
});
}
-
+
@Override
protected IStatus validateExistence(IResource underlyingResource) {
// check whether the class file can be opened
@@ -484,7 +484,7 @@ public abstract class AbstractClassFile extends Openable implements IClassFile,
}
return JavaModelStatus.VERIFIED_OK;
}
-
+
@Override
public ISourceRange getNameRange() {
return null;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/AbstractModule.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/AbstractModule.java
index b95f90011..16daf4ffa 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/AbstractModule.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/AbstractModule.java
@@ -28,14 +28,14 @@ import org.eclipse.jdt.internal.compiler.env.IModule.IPackageExport;
import org.eclipse.jdt.internal.compiler.env.IModule.IService;
public interface AbstractModule extends IModuleDescription {
-
+
/**
* Handle for an automatic module.
*
* <p>Note, that by definition this is mostly a fake, only {@link #getElementName()} provides a useful value.</p>
*/
static class AutoModule extends NamedMember implements AbstractModule {
-
+
private boolean nameFromManifest;
public AutoModule(JavaElement parent, String name, boolean nameFromManifest) {
@@ -75,7 +75,7 @@ public interface AbstractModule extends IModuleDescription {
buffer.append(this.name);
}
}
-
+
// "forward declaration" for a method from JavaElement:
abstract Object getElementInfo() throws JavaModelException;
@@ -123,7 +123,7 @@ public interface AbstractModule extends IModuleDescription {
default IService[] getProvidedServices() throws JavaModelException {
return getModuleInfo().provides();
}
- @Override
+ @Override
default String[] getProvidedServiceNames() throws JavaModelException {
ArrayList<String> results = new ArrayList<>();
IService[] services = getProvidedServices();
@@ -131,12 +131,12 @@ public interface AbstractModule extends IModuleDescription {
results.add(new String(service.name()));
}
return results.toArray(new String[0]);
-
+
}
default char[][] getUsedServices() throws JavaModelException {
return getModuleInfo().uses();
}
- @Override
+ @Override
default String[] getUsedServiceNames() throws JavaModelException {
ArrayList<String> results = new ArrayList<>();
char[][] services = getUsedServices();
@@ -144,7 +144,7 @@ public interface AbstractModule extends IModuleDescription {
char[] service = services[i];
results.add(new String(service));
}
- return results.toArray(new String[0]);
+ return results.toArray(new String[0]);
}
default IPackageExport[] getOpenedPackages() throws JavaModelException {
return getModuleInfo().opens();
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMember.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMember.java
index 91b06990a..ed2c849f7 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMember.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMember.java
@@ -32,7 +32,7 @@ import org.eclipse.jdt.internal.core.util.Util;
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
public abstract class BinaryMember extends NamedMember {
-
+
/*
* Constructs a binary member.
*/
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMethod.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMethod.java
index b28330778..a8bfec99b 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMethod.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMethod.java
@@ -48,7 +48,7 @@ public class BinaryMethod extends BinaryMember implements IMethod {
*/
protected String[] parameterTypes;
protected String [] erasedParamaterTypes; // lazily initialized via call to getErasedParameterTypes
-
+
/**
* The parameter names for the method.
*/
@@ -313,7 +313,7 @@ public String[] getParameterNames() throws JavaModelException {
projectInfo.javadocCache.put(declaringType, BinaryType.EMPTY_JAVADOC);
}
}
-
+
String methodDoc = null;
if (javadocContents == null) {
long timeOut = 50; // default value
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryModule.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryModule.java
index e2bb12ed8..5b96a3925 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryModule.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryModule.java
@@ -32,7 +32,7 @@ import org.eclipse.jdt.internal.core.JavaModelManager.PerProjectInfo;
public class BinaryModule extends BinaryMember implements AbstractModule {
private IBinaryModule info;
-
+
/** For creating a pure handle from its memento. */
public BinaryModule(JavaElement parent, String name) {
super(parent, name);
@@ -46,7 +46,7 @@ public class BinaryModule extends BinaryMember implements AbstractModule {
public IModule getModuleInfo() throws JavaModelException {
if (this.info == null) {
ModularClassFile classFile = (ModularClassFile) this.parent;
- this.info = classFile.getBinaryModuleInfo();
+ this.info = classFile.getBinaryModuleInfo();
}
return this.info;
}
@@ -108,7 +108,7 @@ public class BinaryModule extends BinaryMember implements AbstractModule {
synchronized (projectInfo.javadocCache) {
cachedJavadoc = (JavadocContents) projectInfo.javadocCache.get(this);
}
-
+
if (cachedJavadoc != null && cachedJavadoc != BinaryType.EMPTY_JAVADOC) {
return cachedJavadoc;
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryType.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryType.java
index 78f6c8d56..517a8e9fe 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryType.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryType.java
@@ -81,7 +81,7 @@ public class BinaryType extends BinaryMember implements IType, SuffixConstants {
this.name = this.name.substring(IOTConstants.OT_DELIM_LEN);
}
this.storedEnclosingTypeName = enclosingTypeName;
- this.enclosingNameSet = true;
+ this.enclosingNameSet = true;
}
}
// SH}
@@ -1042,7 +1042,7 @@ public JavadocContents getJavadocContents(IProgressMonitor monitor) throws JavaM
synchronized (projectInfo.javadocCache) {
cachedJavadoc = (JavadocContents) projectInfo.javadocCache.get(this);
}
-
+
if (cachedJavadoc != null && cachedJavadoc != EMPTY_JAVADOC) {
return cachedJavadoc;
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CancelableNameEnvironment.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CancelableNameEnvironment.java
index 3b55a7af1..fa12a481c 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CancelableNameEnvironment.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CancelableNameEnvironment.java
@@ -67,7 +67,7 @@ public class CancelableNameEnvironment extends SearchableEnvironment implements
checkCanceled();
super.findTypes(prefix, findMembers, camelCaseMatch, searchFor, storage, progressMonitor);
}
-
+
@Override
public void setMonitor(IProgressMonitor monitor) {
this.monitor = monitor;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFile.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFile.java
index 346a3fd39..d7cc7ece9 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFile.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFile.java
@@ -85,7 +85,7 @@ protected boolean buildStructure(OpenableElementInfo info, IProgressMonitor pm,
info.setChildren(JavaElement.NO_ELEMENTS);
return false;
}
-
+
// Make the type
//{ObjectTeams: pass the enclosing name and register ot types:
/* orig:
@@ -245,7 +245,7 @@ private IBinaryType getJarBinaryTypeInfo() throws CoreException, IOException, Cl
} else {
result = BinaryTypeFactory.readType(descriptor, null);
}
-
+
if (result == null) {
return null;
}
@@ -269,7 +269,7 @@ private IBinaryType getJarBinaryTypeInfo() throws CoreException, IOException, Cl
IProject project = javaProject.getProject();
IPath externalAnnotationPath = ClasspathEntry.getExternalAnnotationPath(entry, project, false); // unresolved for use in ExternalAnnotationTracker
if (externalAnnotationPath != null) {
- result = setupExternalAnnotationProvider(project, externalAnnotationPath, result,
+ result = setupExternalAnnotationProvider(project, externalAnnotationPath, result,
entryName.substring(0, entryName.length() - SuffixConstants.SUFFIX_CLASS.length));
} else if (entry.getEntryKind() == IClasspathEntry.CPE_SOURCE) {
result = new ExternalAnnotationDecorator(result, true);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFileInfo.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFileInfo.java
index 88ed7d375..129acc043 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFileInfo.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFileInfo.java
@@ -220,7 +220,7 @@ private IMemberValuePair[] getRetentionPolicy(long tagBits) {
retention = new String(CharOperation.concatWith(TypeConstants.JAVA_LANG_ANNOTATION_RETENTIONPOLICY, '.')) + '.' + new String(TypeConstants.UPPER_CLASS);
}
final String value = retention;
- return
+ return
new IMemberValuePair[] {
new IMemberValuePair() {
@Override
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java
index 374d12803..629c80b58 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.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
* Terry Parker <tparker@google.com> - DeltaProcessor misses state changes in archive files, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=357425
@@ -90,9 +90,9 @@ import org.w3c.dom.Text;
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
public class ClasspathEntry implements IClasspathEntry {
-
+
public static class AssertionFailedException extends RuntimeException {
-
+
private static final long serialVersionUID = -171699380721189572L;
public AssertionFailedException(String message) {
@@ -226,7 +226,7 @@ public class ClasspathEntry implements IClasspathEntry {
* a non-<code>null</code> value.
*/
public IPath sourceAttachmentRootPath;
-
+
/**
* See {@link IClasspathEntry#getReferencingEntry()}
*/
@@ -241,7 +241,7 @@ public class ClasspathEntry implements IClasspathEntry {
* A constant indicating an output location.
*/
public static final int K_OUTPUT = 10;
-
+
public static final String DOT_DOT = ".."; //$NON-NLS-1$
/**
@@ -268,13 +268,13 @@ public class ClasspathEntry implements IClasspathEntry {
boolean combineAccessRules,
IClasspathAttribute[] extraAttributes) {
- this( contentKind,
- entryKind,
- path,
- inclusionPatterns,
- exclusionPatterns,
- sourceAttachmentPath,
- sourceAttachmentRootPath,
+ this( contentKind,
+ entryKind,
+ path,
+ inclusionPatterns,
+ exclusionPatterns,
+ sourceAttachmentPath,
+ sourceAttachmentRootPath,
specificOutputLocation,
null,
isExported,
@@ -282,7 +282,7 @@ public class ClasspathEntry implements IClasspathEntry {
combineAccessRules,
extraAttributes);
}
-
+
/**
* Creates a class path entry of the specified kind with the given path.
*/
@@ -307,7 +307,7 @@ public class ClasspathEntry implements IClasspathEntry {
this.inclusionPatterns = inclusionPatterns;
this.exclusionPatterns = exclusionPatterns;
this.referencingEntry = referencingEntry;
-
+
int length;
if (accessRules != null && (length = accessRules.length) > 0) {
AccessRule[] rules = new AccessRule[length];
@@ -394,7 +394,7 @@ public class ClasspathEntry implements IClasspathEntry {
return this;
}
-
+
public ClasspathEntry withExtraAttributeRemoved(String attrName) {
IClasspathAttribute[] changedAttributes = Arrays.stream(this.getExtraAttributes())
.filter(a -> !a.getName().equals(attrName)).toArray(IClasspathAttribute[]::new);
@@ -414,7 +414,7 @@ public class ClasspathEntry implements IClasspathEntry {
changedAttributes);
}
-
+
private IAccessRule[] combine(IAccessRule[] referringRules, IAccessRule[] rules, boolean combine) {
if (!combine) return rules;
if (rules == null || rules.length == 0) return referringRules;
@@ -656,9 +656,9 @@ public class ClasspathEntry implements IClasspathEntry {
boolean hasRestrictions = getAccessRuleSet() != null; // access rule set is null if no access rules
ArrayList unknownChildren = unknownXmlElements != null ? unknownXmlElements.children : null;
boolean hasUnknownChildren = unknownChildren != null;
-
+
/* close tag if no extra attributes, no restriction and no unknown children */
- String tagName = isReferencedEntry ? TAG_REFERENCED_ENTRY : TAG_CLASSPATHENTRY;
+ String tagName = isReferencedEntry ? TAG_REFERENCED_ENTRY : TAG_CLASSPATHENTRY;
writer.printTag(
tagName,
parameters,
@@ -853,10 +853,10 @@ public class ClasspathEntry implements IClasspathEntry {
String projSegment = path.segment(0);
if (projSegment != null && projSegment.equals(project.getElementName())) { // this project
entry = JavaCore.newSourceEntry(
- path,
- inclusionPatterns,
- exclusionPatterns,
- outputLocation,
+ path,
+ inclusionPatterns,
+ exclusionPatterns,
+ outputLocation,
extraAttributes);
} else {
if (path.segmentCount() == 1) {
@@ -870,10 +870,10 @@ public class ClasspathEntry implements IClasspathEntry {
} else {
// an invalid source folder
entry = JavaCore.newSourceEntry(
- path,
- inclusionPatterns,
- exclusionPatterns,
- outputLocation,
+ path,
+ inclusionPatterns,
+ exclusionPatterns,
+ outputLocation,
extraAttributes);
}
}
@@ -923,7 +923,7 @@ public class ClasspathEntry implements IClasspathEntry {
return entry;
}
-
+
/*
* Returns whether the given path as a ".." segment
*/
@@ -975,7 +975,7 @@ public class ClasspathEntry implements IClasspathEntry {
return NO_PATHS;
return (IPath[]) result.toArray(new IPath[result.size()]);
}
-
+
private static void resolvedChainedLibraries(IPath jarPath, HashSet visited, ArrayList result) {
if (visited.contains( jarPath))
return;
@@ -1060,7 +1060,7 @@ public class ClasspathEntry implements IClasspathEntry {
List calledFileNames = null;
try {
char[] manifestContents = getManifestContents(jarPath);
- if (manifestContents == null)
+ if (manifestContents == null)
return null;
// non-null implies regular file
ManifestAnalyzer analyzer = new ManifestAnalyzer();
@@ -1351,7 +1351,7 @@ public class ClasspathEntry implements IClasspathEntry {
* </ol>
* In case of ambiguity, workspace lookup has higher priority than filesystem lookup
* (in fact filesystem paths are never validated).
- *
+ *
* @param entry classpath entry to work on
* @param project project whose classpath we are analysing
* @param resolve if true, any workspace-relative paths will be resolved to filesystem paths.
@@ -1435,7 +1435,7 @@ public class ClasspathEntry implements IClasspathEntry {
}
return new JavaModelStatus(IJavaModelStatusConstants.CP_INVALID_EXTERNAL_ANNOTATION_PATH,
javaProject,
- Messages.bind(Messages.classpath_invalidExternalAnnotationPath,
+ Messages.bind(Messages.classpath_invalidExternalAnnotationPath,
new String[] { annotationPath.toString(), project.getName(), this.path.toString()}));
}
@@ -1496,7 +1496,7 @@ public class ClasspathEntry implements IClasspathEntry {
}
return null;
}
-
+
/**
* Returns the kind of a <code>PackageFragmentRoot</code> from its <code>String</code> form.
*/
@@ -1663,7 +1663,7 @@ public class ClasspathEntry implements IClasspathEntry {
}
return buffer.toString();
}
-
+
public ClasspathEntry resolvedDotDot(IPath reference) {
IPath resolvedPath = resolveDotDot(reference, this.path);
if (resolvedPath == this.path)
@@ -1683,7 +1683,7 @@ public class ClasspathEntry implements IClasspathEntry {
this.combineAccessRules,
this.extraAttributes);
}
-
+
/*
* Read the Class-Path clause of the manifest of the jar pointed by this entry, and return
* the corresponding library entries.
@@ -1713,7 +1713,7 @@ public class ClasspathEntry implements IClasspathEntry {
}
return result;
}
-
+
/**
* Answers an ID which is used to distinguish entries during package
* fragment root computations
@@ -1754,7 +1754,7 @@ public class ClasspathEntry implements IClasspathEntry {
return JavaCore.getResolvedClasspathEntry(this);
}
-
+
/**
* This function computes the URL of the index location for this classpath entry. It returns null if the URL is
* invalid.
@@ -1965,7 +1965,7 @@ public class ClasspathEntry implements IClasspathEntry {
IPath customOutput;
if ((customOutput = resolvedEntry.getOutputLocation()) != null) {
if(mainOutputLocations.contains(customOutput)) {
- return new JavaModelStatus(IJavaModelStatusConstants.TEST_OUTPUT_FOLDER_MUST_BE_SEPARATE_FROM_MAIN_OUTPUT_FOLDERS, javaProject, resolvedEntry.getPath());
+ return new JavaModelStatus(IJavaModelStatusConstants.TEST_OUTPUT_FOLDER_MUST_BE_SEPARATE_FROM_MAIN_OUTPUT_FOLDERS, javaProject, resolvedEntry.getPath());
}
} else {
if(sourceEntryCount > testSourcesFolders.size()) {
@@ -2098,18 +2098,18 @@ public class ClasspathEntry implements IClasspathEntry {
// Bug 287164 : Report errors of overlapping output locations only if the user sets the corresponding preference.
// The check is required for backward compatibility with bug-fix 36465.
String option = javaProject.getOption(JavaCore.CORE_OUTPUT_LOCATION_OVERLAPPING_ANOTHER_SOURCE, true);
- if (otherEntry.getPath().equals(output)
+ if (otherEntry.getPath().equals(output)
&& !JavaCore.IGNORE.equals(option)) {
boolean opStartsWithProject = projectName.equals(otherEntry.getPath().segment(0));
String otherPathMsg = opStartsWithProject ? otherEntry.getPath().removeFirstSegments(1).toString() : otherEntry.getPath().makeRelative().toString();
if (JavaCore.ERROR.equals(option)) {
- return new JavaModelStatus(IStatus.ERROR, IJavaModelStatusConstants.OUTPUT_LOCATION_OVERLAPPING_ANOTHER_SOURCE,
+ return new JavaModelStatus(IStatus.ERROR, IJavaModelStatusConstants.OUTPUT_LOCATION_OVERLAPPING_ANOTHER_SOURCE,
Messages.bind(Messages.classpath_cannotUseDistinctSourceFolderAsOutput, new String[] {
entryPathMsg, otherPathMsg, projectName }));
}
if (cachedStatus == null) {
// Note that the isOK() is being overridden to return true. This is an exceptional scenario
- cachedStatus = new JavaModelStatus(IStatus.OK, IJavaModelStatusConstants.OUTPUT_LOCATION_OVERLAPPING_ANOTHER_SOURCE,
+ cachedStatus = new JavaModelStatus(IStatus.OK, IJavaModelStatusConstants.OUTPUT_LOCATION_OVERLAPPING_ANOTHER_SOURCE,
Messages.bind(Messages.classpath_cannotUseDistinctSourceFolderAsOutput, new String[] {
entryPathMsg, otherPathMsg, projectName })){
@Override
@@ -2166,9 +2166,9 @@ public class ClasspathEntry implements IClasspathEntry {
}
}
}
-
+
// NOTE: The above code that checks for IJavaModelStatusConstants.OUTPUT_LOCATION_OVERLAPPING_ANOTHER_SOURCE, can be configured to return
- // a WARNING status and hence should be at the end of this validation method. Any other code that might return a more severe ERROR should be
+ // a WARNING status and hence should be at the end of this validation method. Any other code that might return a more severe ERROR should be
// inserted before the mentioned code.
if (cachedStatus != null) return cachedStatus;
@@ -2194,7 +2194,7 @@ public class ClasspathEntry implements IClasspathEntry {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=171136 and https://bugs.eclipse.org/bugs/show_bug.cgi?id=300136
// Ignore class path errors from optional entries.
int statusCode = status.getCode();
- if ( (statusCode == IJavaModelStatusConstants.INVALID_CLASSPATH ||
+ if ( (statusCode == IJavaModelStatusConstants.INVALID_CLASSPATH ||
statusCode == IJavaModelStatusConstants.CP_CONTAINER_PATH_UNBOUND ||
statusCode == IJavaModelStatusConstants.CP_VARIABLE_PATH_UNBOUND ||
statusCode == IJavaModelStatusConstants.INVALID_PATH) &&
@@ -2202,7 +2202,7 @@ public class ClasspathEntry implements IClasspathEntry {
return JavaModelStatus.VERIFIED_OK;
return status;
}
-
+
private static IJavaModelStatus validateClasspathEntry(IJavaProject project, IClasspathEntry entry, IClasspathContainer entryContainer, boolean checkSourceAttachment, boolean referredByContainer){
IPath path = entry.getPath();
@@ -2306,11 +2306,11 @@ public class ClasspathEntry implements IClasspathEntry {
// library entry check
case IClasspathEntry.CPE_LIBRARY :
path = ClasspathEntry.resolveDotDot(project.getProject().getLocation(), path);
-
+
// do not validate entries from Class-Path: in manifest
// (these entries are considered optional since the user cannot act on them)
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=252392
-
+
String containerInfo = null;
if (entryContainer != null) {
if (entryContainer instanceof UserLibraryClasspathContainer) {
@@ -2341,11 +2341,11 @@ public class ClasspathEntry implements IClasspathEntry {
long prereqProjectTargetJDK = CompilerOptions.versionToJdkLevel(prereqProject.getOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, true));
if (prereqProjectTargetJDK > projectTargetJDK) {
return new JavaModelStatus(IJavaModelStatusConstants.INCOMPATIBLE_JDK_LEVEL,
- project, path,
+ project, path,
Messages.bind(Messages.classpath_incompatibleLibraryJDKLevel,
new String[] {
project.getElementName(),
- CompilerOptions.versionFromJdkLevel(projectTargetJDK),
+ CompilerOptions.versionFromJdkLevel(projectTargetJDK),
path.makeRelative().toString(),
CompilerOptions.versionFromJdkLevel(prereqProjectTargetJDK)}));
}
@@ -2407,7 +2407,7 @@ public class ClasspathEntry implements IClasspathEntry {
}
Object target = JavaModel.getTarget(path, true);
if (target == null) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=248661
- IPath workspaceLocation = workspaceRoot.getLocation();
+ IPath workspaceLocation = workspaceRoot.getLocation();
if (workspaceLocation.isPrefixOf(path)) {
target = JavaModel.getTarget(path.makeRelativeTo(workspaceLocation).makeAbsolute(), true);
}
@@ -2428,11 +2428,11 @@ public class ClasspathEntry implements IClasspathEntry {
CompilerOptions.versionFromJdkLevel(libraryJDK)}));
} else {
return new JavaModelStatus(IJavaModelStatusConstants.INCOMPATIBLE_JDK_LEVEL,
- project, path,
+ project, path,
Messages.bind(Messages.classpath_incompatibleLibraryJDKLevel,
new String[] {
project.getElementName(),
- CompilerOptions.versionFromJdkLevel(projectTargetJDK),
+ CompilerOptions.versionFromJdkLevel(projectTargetJDK),
path.makeRelative().toString(),
CompilerOptions.versionFromJdkLevel(libraryJDK)}));
}
@@ -2457,7 +2457,7 @@ public class ClasspathEntry implements IClasspathEntry {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=229042
// Validate the contents of the archive
IJavaModelStatus status = validateLibraryContents(path, project, entryPathMsg);
- if (status != JavaModelStatus.VERIFIED_OK)
+ if (status != JavaModelStatus.VERIFIED_OK)
return status;
break;
case IResource.FOLDER : // internal binary folder
@@ -2493,7 +2493,7 @@ public class ClasspathEntry implements IClasspathEntry {
// Validate the contents of the archive
if(file.isFile()) {
IJavaModelStatus status = validateLibraryContents(path, project, entryPathMsg);
- if (status != JavaModelStatus.VERIFIED_OK)
+ if (status != JavaModelStatus.VERIFIED_OK)
return status;
}
}
@@ -2503,12 +2503,12 @@ public class ClasspathEntry implements IClasspathEntry {
if (container != null) {
return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_unboundLibraryInContainer, new String[] {path.toOSString(), container}));
} else {
- return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_unboundLibrary, new String[] {path.toOSString(), project.getElementName()}));
+ return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_unboundLibrary, new String[] {path.toOSString(), project.getElementName()}));
}
} else {
- if (entryPathMsg == null)
+ if (entryPathMsg == null)
entryPathMsg = project.getElementName().equals(path.segment(0)) ? path.removeFirstSegments(1).makeRelative().toString() : path.toString();
- if (container!= null) {
+ if (container!= null) {
return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_unboundLibraryInContainer, new String[] {entryPathMsg, container}));
} else {
return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_unboundLibrary, new String[] {entryPathMsg, project.getElementName()}));
@@ -2516,7 +2516,7 @@ public class ClasspathEntry implements IClasspathEntry {
}
}
} else {
- if (entryPathMsg == null)
+ if (entryPathMsg == null)
entryPathMsg = project.getElementName().equals(path.segment(0)) ? path.removeFirstSegments(1).makeRelative().toString() : path.toString();
if (container != null) {
return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_illegalLibraryPathInContainer, new String[] {entryPathMsg, container}));
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathValidation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathValidation.java
index 14a914f84..ae7b04754 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathValidation.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathValidation.java
@@ -64,9 +64,9 @@ public class ClasspathValidation {
if (!status.isOK())
this.project.createClasspathProblemMarker(status);
- // update overlapping output problem markers
+ // update overlapping output problem markers
this.project.flushClasspathProblemMarkers(false/*cycle*/, false/*format*/, true/*overlapping*/);
-
+
// update resolved classpath problems
this.project.flushClasspathProblemMarkers(false/*cycle*/, false/*format*/, false/*overlapping*/);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnit.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnit.java
index 90299c1dd..c0a597de4 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnit.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnit.java
@@ -1227,12 +1227,12 @@ protected IBuffer openBuffer(IProgressMonitor pm, Object info) throws JavaModelE
buffer.setContents(Util.getResourceContentsAsCharArray(file));
}
}
-
+
// add buffer to buffer cache
// note this may cause existing buffers to be removed from the buffer cache, but only primary compilation unit's buffer
// can be closed, thus no call to a client's IBuffer#close() can be done in this synchronized block.
bufManager.addBuffer(buffer);
-
+
// listen to buffer changes
buffer.addBufferChangedListener(this);
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitElementInfo.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitElementInfo.java
index 6c8b15ce4..c2b6ec8a9 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitElementInfo.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitElementInfo.java
@@ -17,7 +17,7 @@ import org.eclipse.jdt.core.ISourceRange;
import org.eclipse.jdt.core.SourceRange;
public class CompilationUnitElementInfo extends OpenableElementInfo {
-
+
/**
* Count that will be used by SourceTypeConverter to decide whether or not to diet parse.
*/
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitProblemFinder.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitProblemFinder.java
index 5a0449cd6..46a0f2653 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitProblemFinder.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitProblemFinder.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
* Fraunhofer FIRST - extended API and implementation
@@ -116,15 +116,15 @@ public class CompilationUnitProblemFinder extends Compiler {
CompilationResult result =
new CompilationResult(sourceTypes[0].getFileName(), 1, 1, this.options.maxProblemsPerUnit);
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=305259, build the compilation unit in its own sand box.
final long savedComplianceLevel = this.options.complianceLevel;
final long savedSourceLevel = this.options.sourceLevel;
-
+
LookupEnvironment environment = packageBinding.environment;
if (environment == null)
environment = this.lookupEnvironment;
-
+
try {
IJavaProject project = ((SourceTypeElementInfo) sourceTypes[0]).getHandle().getJavaProject();
this.options.complianceLevel = CompilerOptions.versionToJdkLevel(project.getOption(JavaCore.COMPILER_COMPLIANCE, true));
@@ -169,14 +169,14 @@ public class CompilationUnitProblemFinder extends Compiler {
}
CompilationResult result =
new CompilationResult(TypeConstants.MODULE_INFO_FILE_NAME, 1, 1, this.options.maxProblemsPerUnit);
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=305259, build the compilation unit in its own sand box.
final long savedComplianceLevel = this.options.complianceLevel;
final long savedSourceLevel = this.options.sourceLevel;
-
+
if (environment == null)
environment = this.lookupEnvironment;
-
+
try {
IJavaProject project = handle.getJavaProject();
this.options.complianceLevel = CompilerOptions.versionToJdkLevel(project.getOption(JavaCore.COMPILER_COMPLIANCE, true));
@@ -259,7 +259,7 @@ public class CompilationUnitProblemFinder extends Compiler {
}
/*
- * Can return null if the process was aborted or canceled
+ * Can return null if the process was aborted or canceled
*/
public static CompilationUnitDeclaration process(
CompilationUnit unitElement,
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor.java
index ff89590a0..797fa7c96 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor.java
@@ -69,7 +69,7 @@ import org.eclipse.objectteams.otdt.internal.core.util.MethodData;
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
public class CompilationUnitStructureRequestor extends ReferenceInfoAdapter implements ISourceElementRequestor {
-
+
/**
* The handle to the compilation unit being parsed
*/
@@ -395,7 +395,7 @@ public void enterInitializer(int declarationSourceStart, int modifiers) {
Assert.isTrue(false); // Should not happen
}
resolveDuplicates(handle);
-
+
addToChildren(parentInfo, handle);
this.infoStack.push(new int[] {declarationSourceStart, modifiers});
@@ -435,7 +435,7 @@ public void enterMethod(MethodInfo methodInfo) {
this.infoStack.push(methodInfo);
this.handleStack.push(handle);
-
+
addToChildren(parentInfo, handle);
parentInfo.childrenCategories.put(handle, methodInfo.categories);
}
@@ -486,7 +486,7 @@ private SourceMethodElementInfo createMethodInfo(MethodInfo methodInfo, SourceMe
if (methodInfo.node != null && methodInfo.node.arguments != null) {
//{ObjectTeams: don't expose enhancement args:
/* orig:
- info.arguments = acceptMethodParameters(methodInfo.node.arguments, handle, methodInfo);
+ info.arguments = acceptMethodParameters(methodInfo.node.arguments, handle, methodInfo);
:giro */
Argument[] sourceArguments = MethodSignatureEnhancer.getSourceArguments(methodInfo.node);
info.arguments = acceptMethodParameters(sourceArguments, handle, methodInfo);
@@ -508,7 +508,7 @@ private LocalVariable[] acceptMethodParameters(Argument[] arguments, JavaElement
localVarInfo.setSourceRangeEnd(argument.declarationSourceStart);
localVarInfo.setNameSourceStart(argument.sourceStart);
localVarInfo.setNameSourceEnd(argument.sourceEnd);
-
+
String paramTypeSig = JavaModelManager.getJavaModelManager().intern(Signature.createTypeSignature(methodInfo.parameterTypes[i], false));
result[i] = new LocalVariable(
methodHandle,
@@ -519,7 +519,7 @@ private LocalVariable[] acceptMethodParameters(Argument[] arguments, JavaElement
argument.sourceEnd,
paramTypeSig,
argument.annotations,
- argument.modifiers,
+ argument.modifiers,
true);
this.newElements.put(result[i], localVarInfo);
this.infoStack.push(localVarInfo);
@@ -542,7 +542,7 @@ public void enterModule(ModuleInfo info) {
Object parentInfo = this.infoStack.peek();
JavaElement parentHandle= (JavaElement) this.handleStack.peek();
JavaElement handle = createModuleHandle(parentHandle, info);
-
+
this.infoStack.push(info);
this.handleStack.push(handle);
@@ -647,7 +647,7 @@ private SourceTypeElementInfo createTypeInfo(TypeInfo typeInfo, SourceType handl
Map.Entry entry = (Map.Entry) iterator.next();
info.addCategories((IJavaElement) entry.getKey(), (char[][]) entry.getValue());
}
-
+
}
if (typeInfo.typeAnnotated) {
this.unitInfo.annotationNumber = CompilationUnitElementInfo.ANNOTATION_THRESHOLD_FOR_DIET_PARSE;
@@ -755,7 +755,7 @@ public void exitField(int initializationStart, int declarationEnd, int declarati
info.setSourceRangeEnd(declarationSourceEnd);
this.handleStack.pop();
this.infoStack.pop();
-
+
// remember initializer source if field is a constant
if (initializationStart != -1) {
int flags = info.flags;
@@ -783,14 +783,14 @@ public void exitInitializer(int declarationEnd) {
JavaElement handle = (JavaElement) this.handleStack.peek();
int[] initializerInfo = (int[]) this.infoStack.peek();
IJavaElement[] elements = getChildren(initializerInfo);
-
+
InitializerElementInfo info = elements.length == 0 ? new InitializerElementInfo() : new InitializerWithChildrenInfo(elements);
info.setSourceRangeStart(initializerInfo[0]);
info.setFlags(initializerInfo[1]);
info.setSourceRangeEnd(declarationEnd);
this.newElements.put(handle, info);
-
+
this.handleStack.pop();
this.infoStack.pop();
}
@@ -801,10 +801,10 @@ public void exitInitializer(int declarationEnd) {
public void exitMethod(int declarationEnd, Expression defaultValue) {
SourceMethod handle = (SourceMethod) this.handleStack.peek();
MethodInfo methodInfo = (MethodInfo) this.infoStack.peek();
-
+
SourceMethodElementInfo info = createMethodInfo(methodInfo, handle);
info.setSourceRangeEnd(declarationEnd);
-
+
// remember default value of annotation method
if (info.isAnnotationMethod() && defaultValue != null) {
SourceAnnotationMethodInfo annotationMethodInfo = (SourceAnnotationMethodInfo) info;
@@ -815,7 +815,7 @@ public void exitMethod(int declarationEnd, Expression defaultValue) {
defaultMemberValuePair.value = getMemberValue(defaultMemberValuePair, defaultValue);
annotationMethodInfo.defaultValue = defaultMemberValuePair;
}
-
+
this.handleStack.pop();
this.infoStack.pop();
}
@@ -1031,7 +1031,7 @@ private SourceMethodMappingInfo createMappingInfo(MappingElementInfo mappingInfo
else
info.setCalloutKind(mappingInfo.isOverride(), mappingInfo.getDeclaredModifiers());
JavaModelManager manager = JavaModelManager.getJavaModelManager();
-
+
IMethodSpec roleMethod = mappingInfo.getRoleMethod();
{
String[] parameterNames = roleMethod.getArgumentNames();
@@ -1054,10 +1054,10 @@ private SourceMethodMappingInfo createMappingInfo(MappingElementInfo mappingInfo
for (int i = 0, length = parameterTypes.length; i < length; i++)
parameterTypes[i] = manager.intern(parameterTypes[i]);
baseParameterTypes[m] = parameterTypes;
-
+
String returnType = baseMethods[m].getReturnType();
if (returnType == null) returnType = "void"; //$NON-NLS-1$
- baseReturnTypes[m] = manager.intern(returnType);
+ baseReturnTypes[m] = manager.intern(returnType);
}
info.setBaseArgumentNames(baseParameterNames);
info.setBaseArgumentTypes(baseParameterTypes);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CopyResourceElementsOperation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CopyResourceElementsOperation.java
index fb35f2a77..5cea5b616 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CopyResourceElementsOperation.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CopyResourceElementsOperation.java
@@ -279,7 +279,7 @@ public class CopyResourceElementsOperation extends MultiOperation implements Suf
*/
protected void prepareDeltas(IJavaElement sourceElement, IJavaElement destinationElement, boolean isMove, boolean overWriteCU) {
if (Util.isExcluded(sourceElement) || Util.isExcluded(destinationElement)) return;
-
+
IJavaProject destProject = destinationElement.getJavaProject();
if (isMove) {
IJavaProject sourceProject = sourceElement.getJavaProject();
@@ -374,7 +374,7 @@ public class CopyResourceElementsOperation extends MultiOperation implements Suf
// register the correct change deltas
boolean contentChanged = this.force && destFile.exists();
prepareDeltas(source, destCU, isMove(), contentChanged);
-
+
if (newCUName != null) {
//the main type has been renamed
String oldName = Util.getNameWithoutJavaLikeExtension(source.getElementName());
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ExternalAnnotationTracker.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ExternalAnnotationTracker.java
index 1723b427c..bec2449fb 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ExternalAnnotationTracker.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ExternalAnnotationTracker.java
@@ -48,9 +48,9 @@ public class ExternalAnnotationTracker implements IResourceChangeListener {
*/
static class DirectoryNode {
- DirectoryNode parent;
+ DirectoryNode parent;
IPath path;
-
+
/** Key is a full workspace path. */
Map<IPath,DirectoryNode> children;
/**
@@ -59,7 +59,7 @@ public class ExternalAnnotationTracker implements IResourceChangeListener {
*/
Map<IPath, ClassFile> classFiles;
IPackageFragmentRoot modelRoot; // TODO: for handling zipped annotations
-
+
public DirectoryNode(DirectoryNode parent, IPath path) {
this.parent = parent;
this.path = path;
@@ -123,13 +123,13 @@ public class ExternalAnnotationTracker implements IResourceChangeListener {
private static ExternalAnnotationTracker singleton;
private ExternalAnnotationTracker() { }
-
+
/** Start listening. */
static void start(IWorkspace workspace) {
singleton = new ExternalAnnotationTracker();
workspace.addResourceChangeListener(singleton);
}
-
+
/** Stop listening & clean up. */
static void shutdown(IWorkspace workspace) {
if (singleton != null) {
@@ -146,7 +146,7 @@ public class ExternalAnnotationTracker implements IResourceChangeListener {
* @param relativeAnnotationPath path corresponding to the qualified name of the main type of the class file.
* The path is relative to 'annotationBase'.
* When appending the file extension for annotation files it points to the annotation file
- * that would correspond to the given class file. The annotation file may or may not yet exist.
+ * that would correspond to the given class file. The annotation file may or may not yet exist.
* @param classFile the ClassFile to register.
*/
public static void registerClassFile(IPath annotationBase, IPath relativeAnnotationPath, ClassFile classFile) {
@@ -239,6 +239,6 @@ public class ExternalAnnotationTracker implements IResourceChangeListener {
} else {
traverseForClassFiles(classFiles, delta, baseDepth);
}
- }
+ }
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/INameEnvironmentWithProgress.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/INameEnvironmentWithProgress.java
index fa03c7026..b758f65e0 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/INameEnvironmentWithProgress.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/INameEnvironmentWithProgress.java
@@ -21,18 +21,18 @@ import org.eclipse.jdt.internal.compiler.env.INameEnvironmentExtension;
* can use to look up types, compilation units, and packages in the
* current environment. The name environment is passed to the compiler
* on creation.
- *
+ *
* This name environment can be canceled using the monitor passed as an argument to
* {@link #setMonitor(IProgressMonitor)}.
- *
+ *
* @since 3.6
*/
public interface INameEnvironmentWithProgress extends INameEnvironmentExtension {
/**
* Set the monitor for the given name environment. In order to be able to cancel this name environment calls,
- * a non-null monitor should be given.
- *
+ * a non-null monitor should be given.
+ *
* @param monitor the given monitor
*/
void setMonitor(IProgressMonitor monitor);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ImportContainerInfo.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ImportContainerInfo.java
index 86246b1a9..fd57b361c 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ImportContainerInfo.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ImportContainerInfo.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/model/org/eclipse/jdt/internal/core/InitializerWithChildrenInfo.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/InitializerWithChildrenInfo.java
index 925783dc8..e168e50a6 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/InitializerWithChildrenInfo.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/InitializerWithChildrenInfo.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
*******************************************************************************/
@@ -18,7 +18,7 @@ import org.eclipse.jdt.core.IJavaElement;
public class InitializerWithChildrenInfo extends InitializerElementInfo {
protected IJavaElement[] children;
-
+
public InitializerWithChildrenInfo(IJavaElement[] children) {
this.children = children;
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/InternalNamingConventions.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/InternalNamingConventions.java
index 36b3f1d7e..05b707d0e 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/InternalNamingConventions.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/InternalNamingConventions.java
@@ -93,11 +93,11 @@ public class InternalNamingConventions {
private static char[][] computeNonBaseTypeNames(char[] sourceName, boolean isConstantField, boolean onlyLongest){
int length = sourceName.length;
-
+
if (length == 0) {
return CharOperation.NO_CHAR_CHAR;
}
-
+
if (length == 1) {
if (isConstantField) {
return generateConstantName(new char[][]{CharOperation.toLowerCase(sourceName)}, 0, onlyLongest);
@@ -105,31 +105,31 @@ public class InternalNamingConventions {
return generateNonConstantName(new char[][]{CharOperation.toLowerCase(sourceName)}, 0, onlyLongest);
}
}
-
+
char[][] nameParts = new char[length][];
int namePartsPtr = -1;
-
+
int endIndex = length;
char c = sourceName[length - 1];
-
+
final int IS_LOWER_CASE = 1;
final int IS_UPPER_CASE = 2;
final int IS_UNDERSCORE = 3;
final int IS_OTHER = 4;
-
+
int previousCharKind =
ScannerHelper.isLowerCase(c) ? IS_LOWER_CASE :
ScannerHelper.isUpperCase(c) ? IS_UPPER_CASE :
c == '_' ? IS_UNDERSCORE : IS_OTHER;
-
+
for(int i = length - 1 ; i >= 0 ; i--){
c = sourceName[i];
-
+
int charKind =
ScannerHelper.isLowerCase(c) ? IS_LOWER_CASE :
ScannerHelper.isUpperCase(c) ? IS_UPPER_CASE :
c == '_' ? IS_UNDERSCORE : IS_OTHER;
-
+
switch (charKind) {
case IS_LOWER_CASE:
if (previousCharKind == IS_UPPER_CASE) {
@@ -157,7 +157,7 @@ public class InternalNamingConventions {
switch (previousCharKind) {
case IS_UNDERSCORE:
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=283539
- // Process consecutive underscores only for constant types
+ // Process consecutive underscores only for constant types
if (isConstantField) {
if (i > 0) {
char pc = sourceName[i - 1];
@@ -198,15 +198,15 @@ public class InternalNamingConventions {
if (namePartsPtr == -1) {
return new char[][] { sourceName };
}
-
+
if (isConstantField) {
return generateConstantName(nameParts, namePartsPtr, onlyLongest);
} else {
return generateNonConstantName(nameParts, namePartsPtr, onlyLongest);
}
}
-
-
+
+
private static char[] excludeNames(
char[] suffixName,
@@ -229,7 +229,7 @@ public class InternalNamingConventions {
}
return suffixName;
}
-
+
private static char[][] generateNonConstantName(char[][] nameParts, int namePartsPtr, boolean onlyLongest) {
char[][] names;
if (onlyLongest) {
@@ -237,28 +237,28 @@ public class InternalNamingConventions {
} else {
names = new char[namePartsPtr + 1][];
}
-
+
char[] namePart = nameParts[0];
-
+
char[] name = CharOperation.toLowerCase(namePart);
-
+
if (!onlyLongest) {
names[namePartsPtr] = name;
}
-
+
char[] nameSuffix = namePart;
-
+
for (int i = 1; i <= namePartsPtr; i++) {
namePart = nameParts[i];
-
+
name = CharOperation.concat(CharOperation.toLowerCase(namePart), nameSuffix);
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=283539
// Only the first word is converted to lower case and the rest of them are not changed for non-constants
-
+
if (!onlyLongest) {
names[namePartsPtr - i] = name;
}
-
+
nameSuffix = CharOperation.concat(namePart, nameSuffix);
}
if (onlyLongest) {
@@ -274,17 +274,17 @@ public class InternalNamingConventions {
} else {
names = new char[namePartsPtr + 1][];
}
-
+
char[] namePart = CharOperation.toUpperCase(nameParts[0]);
int namePartLength = namePart.length;
System.arraycopy(namePart, 0, namePart, 0, namePartLength);
-
+
char[] name = namePart;
-
+
if (!onlyLongest) {
names[namePartsPtr] = name;
}
-
+
for (int i = 1; i <= namePartsPtr; i++) {
namePart = CharOperation.toUpperCase(nameParts[i]);
namePartLength = namePart.length;
@@ -293,7 +293,7 @@ public class InternalNamingConventions {
} else {
name = CharOperation.concat(namePart, name);
}
-
+
if (!onlyLongest) {
names[namePartsPtr - i] = name;
}
@@ -303,20 +303,20 @@ public class InternalNamingConventions {
}
return names;
}
-
+
public static char[] getBaseName(
int variableKind,
IJavaProject javaProject,
char[] name,
boolean updateFirstCharacter) {
-
+
AssistOptions assistOptions;
if (javaProject != null) {
assistOptions = new AssistOptions(javaProject.getOptions(true));
} else {
assistOptions = new AssistOptions(JavaCore.getOptions());
}
-
+
char[][] prefixes = null;
char[][] suffixes = null;
switch (variableKind) {
@@ -341,20 +341,20 @@ public class InternalNamingConventions {
suffixes = assistOptions.argumentSuffixes;
break;
}
-
-
+
+
return getBaseName(name, prefixes, suffixes, variableKind == VK_STATIC_FINAL_FIELD, updateFirstCharacter);
}
private static char[] getBaseName(char[] name, char[][] prefixes, char[][] suffixes, boolean isConstant, boolean updateFirstCharacter) {
char[] nameWithoutPrefixAndSiffix = removeVariablePrefixAndSuffix(name, prefixes, suffixes, updateFirstCharacter);
-
+
char[] baseName;
if (isConstant) {
int length = nameWithoutPrefixAndSiffix.length;
baseName = new char[length];
int baseNamePtr = -1;
-
+
boolean previousIsUnderscore = false;
for (int i = 0; i < length; i++) {
char c = nameWithoutPrefixAndSiffix[i];
@@ -373,10 +373,10 @@ public class InternalNamingConventions {
} else {
baseName = nameWithoutPrefixAndSiffix;
}
-
+
return baseName;
}
-
+
public static char[] removeVariablePrefixAndSuffix(
int variableKind,
IJavaProject javaProject,
@@ -387,7 +387,7 @@ public class InternalNamingConventions {
} else {
assistOptions = new AssistOptions(JavaCore.getOptions());
}
-
+
char[][] prefixes = null;
char[][] suffixes = null;
switch (variableKind) {
@@ -412,10 +412,10 @@ public class InternalNamingConventions {
suffixes = assistOptions.argumentSuffixes;
break;
}
-
+
return InternalNamingConventions.removeVariablePrefixAndSuffix(name, prefixes, suffixes, true);
}
-
+
private static char[] removeVariablePrefixAndSuffix(char[] name, char[][] prefixes, char[][] suffixes, boolean updateFirstCharacter) {
// remove longer prefix
char[] withoutPrefixName = name;
@@ -528,13 +528,13 @@ public class InternalNamingConventions {
return withoutPrefixName;
}
-
+
public static final int VK_STATIC_FIELD = 1;
public static final int VK_INSTANCE_FIELD = 2;
public static final int VK_STATIC_FINAL_FIELD = 3;
public static final int VK_PARAMETER = 4;
public static final int VK_LOCAL = 5;
-
+
public static final int BK_SIMPLE_NAME = 1;
public static final int BK_SIMPLE_TYPE_NAME = 2;
@@ -548,10 +548,10 @@ public class InternalNamingConventions {
char[][] excluded,
boolean evaluateDefault,
INamingRequestor requestor) {
-
+
if(baseName == null || baseName.length == 0)
return;
-
+
Map<String, String> options;
if (javaProject != null) {
options = javaProject.getOptions(true);
@@ -560,9 +560,9 @@ public class InternalNamingConventions {
}
CompilerOptions compilerOptions = new CompilerOptions(options);
AssistOptions assistOptions = new AssistOptions(options);
-
+
boolean isConstantField = false;
-
+
char[][] prefixes = null;
char[][] suffixes = null;
switch (variableKind) {
@@ -588,7 +588,7 @@ public class InternalNamingConventions {
suffixes = assistOptions.argumentSuffixes;
break;
}
-
+
if(prefixes == null || prefixes.length == 0) {
prefixes = new char[1][0];
} else {
@@ -604,7 +604,7 @@ public class InternalNamingConventions {
System.arraycopy(suffixes, 0, suffixes = new char[length+1][], 0, length);
suffixes[length] = CharOperation.NO_CHAR;
}
-
+
if(internalPrefix == null) {
internalPrefix = CharOperation.NO_CHAR;
} else {
@@ -612,11 +612,11 @@ public class InternalNamingConventions {
}
char[][] tempNames = null;
-
+
Scanner nameScanner = getNameScanner(compilerOptions);
if (baseNameKind == BK_SIMPLE_TYPE_NAME) {
boolean isBaseType = false;
-
+
try{
nameScanner.setSource(baseName);
switch (nameScanner.getNextToken()) {
@@ -637,7 +637,7 @@ public class InternalNamingConventions {
if (isBaseType) {
// compute variable name from base type
if (internalPrefix.length > 0) return;
-
+
tempNames = computeBaseTypeNames(baseName, isConstantField, excluded);
} else {
// compute variable name for non base type
@@ -652,11 +652,11 @@ public class InternalNamingConventions {
for (int i = 0; i < tempNames.length; i++) {
char[] tempName = tempNames[i];
-
+
// add English plural form is necessary
if(dim > 0) {
int length = tempName.length;
-
+
if (isConstantField) {
if (tempName[length-1] == 'S'){
if(tempName.length > 1 && tempName[length-2] == 'S') {
@@ -725,13 +725,13 @@ public class InternalNamingConventions {
}
}
}
-
+
char[] unprefixedName = tempName;
-
+
int matchingIndex = -1;
if (!isConstantField) {
unprefixedName[0] = ScannerHelper.toUpperCase(unprefixedName[0]);
-
+
done : for (int j = 0; j <= internalPrefix.length; j++) {
if(j == internalPrefix.length ||
CharOperation.prefixEquals(CharOperation.subarray(internalPrefix, j, -1), unprefixedName, j != 0 /*do not check case when there is no prefix*/)) {
@@ -749,7 +749,7 @@ public class InternalNamingConventions {
matchingIndex = j;
break done;
}
-
+
}
}
}
@@ -765,7 +765,7 @@ public class InternalNamingConventions {
tempName = CharOperation.concat(CharOperation.subarray(CharOperation.toUpperCase(internalPrefix), 0, matchingIndex), unprefixedName);
}
}
-
+
for (int k = 0; k < prefixes.length; k++) {
if (!isConstantField) {
if(prefixes[k].length > 0
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JModPackageFragmentRoot.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JModPackageFragmentRoot.java
index 6370b878e..b4a753a83 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JModPackageFragmentRoot.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JModPackageFragmentRoot.java
@@ -24,7 +24,7 @@ import org.eclipse.jdt.internal.core.util.HashtableOfArrayToObject;
*
* <p>NOTE: The only visible entries from a Jmod package fragment root
* are .class files. The sub folder "classes" where the .class files are nested under
- * is hidden from clients. THe package fragments appear to be directly under the
+ * is hidden from clients. THe package fragments appear to be directly under the
* package fragment roots.
* <p>NOTE: A JMod package fragment root may or may not have an associated resource.
*
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JarPackageFragmentRoot.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JarPackageFragmentRoot.java
index ca2312a01..1d0928e0d 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JarPackageFragmentRoot.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JarPackageFragmentRoot.java
@@ -92,7 +92,7 @@ public class JarPackageFragmentRoot extends PackageFragmentRoot {
super(resource, project);
this.jarPath = externalJarPath;
if (attributes == null) {
- // attributes could either be
+ // attributes could either be
// (1) provided by the caller (particularly when creating from memento),
// (2) retrieved from the corresponding classpath entry (if a resolved classpath is available).
// These two cases should cover all normal scenarios, else extraAttributes will be null.
@@ -130,7 +130,7 @@ public class JarPackageFragmentRoot extends PackageFragmentRoot {
if (JavaIndex.isEnabled()) {
JavaIndex index = JavaIndex.getIndex();
try (IReader reader = index.getNd().acquireReadLock()) {
- IPath resourcePath = JavaIndex.getLocationForElement(this);
+ IPath resourcePath = JavaIndex.getLocationForElement(this);
if (!resourcePath.isEmpty()) {
NdResourceFile resourceFile = index.getResourceFile(resourcePath.toString().toCharArray());
if (index.isUpToDate(resourceFile)) {
@@ -142,9 +142,9 @@ public class JarPackageFragmentRoot extends PackageFragmentRoot {
String filename = next.getFileName().getString();
initRawPackageInfo(rawPackageInfo, filename, filename.endsWith("/"), compliance); //$NON-NLS-1$
}
-
+
// Locate all the classfile entries
- for (NdType type : resourceFile.getTypes()) {
+ for (NdType type : resourceFile.getTypes()) {
String path = new String(type.getTypeId().getBinaryName()) + ".class"; //$NON-NLS-1$
initRawPackageInfo(rawPackageInfo, path, false, compliance);
}
@@ -178,7 +178,7 @@ public class JarPackageFragmentRoot extends PackageFragmentRoot {
}
}
}
-
+
String[] supportedVersions = versions.toArray(new String[versions.size()]);
if (supportedVersions.length > 0) {
this.multiVersion = true;
@@ -480,7 +480,7 @@ public class JarPackageFragmentRoot extends PackageFragmentRoot {
public URL getIndexPath() {
try {
IClasspathEntry entry = ((JavaProject) getParent()).getClasspathEntryFor(getPath());
- if (entry != null) return ((ClasspathEntry)entry).getLibraryIndexLocation();
+ if (entry != null) return ((ClasspathEntry)entry).getLibraryIndexLocation();
} catch (JavaModelException e) {
// ignore exception
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JarPackageFragmentRootInfo.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JarPackageFragmentRootInfo.java
index 1de10d272..fd4e91c48 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JarPackageFragmentRootInfo.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JarPackageFragmentRootInfo.java
@@ -24,5 +24,5 @@ class JarPackageFragmentRootInfo extends PackageFragmentRootInfo {
// a map from package name (String[]) to a size-2 array of Array<String>, the first element being the .class file names, and the second element being the non-Java resource names
HashtableOfArrayToObject rawPackageInfo;
Map<String, String> overriddenClasses;
-
+
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaCorePreferenceInitializer.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaCorePreferenceInitializer.java
index 1e57fd3f8..7ebced345 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaCorePreferenceInitializer.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaCorePreferenceInitializer.java
@@ -138,9 +138,9 @@ public class JavaCorePreferenceInitializer extends AbstractPreferenceInitializer
}
/**
- * Note: For deprecated formatter options, you may also add migration to their replacement options in
+ * Note: For deprecated formatter options, you may also add migration to their replacement options in
* {@link org.eclipse.jdt.internal.formatter.DefaultCodeFormatterOptions#setDeprecatedOptions}.
- *
+ *
* @deprecated As using deprecated options
*/
private void initializeDeprecatedOptions() {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElement.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElement.java
index 69686b722..a0fa07191 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElement.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElement.java
@@ -107,23 +107,23 @@ public abstract class JavaElement extends PlatformObject implements IJavaElement
public static final char JEM_LAMBDA_METHOD = '&';
public static final char JEM_STRING = '"';
public static final char JEM_MODULE = '`';
-
+
/**
* Before ')', '&' and '"' became the newest additions as delimiters, the former two
- * were allowed as part of element attributes and possibly stored. Trying to recreate
- * elements from such memento would cause undesirable results. Consider the following
+ * were allowed as part of element attributes and possibly stored. Trying to recreate
+ * elements from such memento would cause undesirable results. Consider the following
* valid project name: (abc)
* If we were to use ')' alone as the delimiter and decode the above name, the memento
- * would be wrongly identified to contain a lambda expression.
+ * would be wrongly identified to contain a lambda expression.
*
- * In order to differentiate delimiters from characters that are part of element attributes,
- * the following escape character is being introduced and all the new delimiters must
+ * In order to differentiate delimiters from characters that are part of element attributes,
+ * the following escape character is being introduced and all the new delimiters must
* be escaped with this. So, a lambda expression would be written as: "=)..."
- *
+ *
* @see JavaElement#appendEscapedDelimiter(StringBuffer, char)
*/
public static final char JEM_DELIMITER_ESCAPE = JEM_JAVAPROJECT;
-
+
/**
* This element's parent, or <code>null</code> if this
@@ -134,7 +134,7 @@ public abstract class JavaElement extends PlatformObject implements IJavaElement
protected static final String[] NO_STRINGS = new String[0];
protected static final JavaElement[] NO_ELEMENTS = new JavaElement[0];
protected static final Object NO_INFO = new Object();
-
+
private static Set<String> invalidURLs = null;
private static Set<String> validURLs = null;
@@ -812,7 +812,7 @@ public abstract class JavaElement extends PlatformObject implements IJavaElement
catch(JavaModelException jme) {
// Proceed with raw classpath
}
-
+
entry= root.getRawClasspathEntry();
switch (entry.getEntryKind()) {
case IClasspathEntry.CPE_LIBRARY:
@@ -820,7 +820,7 @@ public abstract class JavaElement extends PlatformObject implements IJavaElement
return getLibraryJavadocLocation(entry);
default:
return null;
- }
+ }
}
return null;
}
@@ -878,15 +878,15 @@ public abstract class JavaElement extends PlatformObject implements IJavaElement
}
return false;
}
-
+
/*
- * This method caches a list of good and bad Javadoc locations in the current eclipse session.
+ * This method caches a list of good and bad Javadoc locations in the current eclipse session.
*/
protected void validateAndCache(URL baseLoc, FileNotFoundException e) throws JavaModelException {
String url = baseLoc.toString();
if (validURLs != null && validURLs.contains(url)) return;
-
- if (invalidURLs != null && invalidURLs.contains(url))
+
+ if (invalidURLs != null && invalidURLs.contains(url))
throw new JavaModelException(e, IJavaModelStatusConstants.CANNOT_RETRIEVE_ATTACHED_JAVADOC);
InputStream input = null;
@@ -898,7 +898,7 @@ public abstract class JavaElement extends PlatformObject implements IJavaElement
}
validURLs.add(url);
} catch (Exception e1) {
- if (invalidURLs == null) {
+ if (invalidURLs == null) {
invalidURLs = new HashSet<String>(1);
}
invalidURLs.add(url);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElementDelta.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElementDelta.java
index 31f79891a..c715db6ca 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElementDelta.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElementDelta.java
@@ -75,12 +75,12 @@ public class JavaElementDelta extends SimpleDelta implements IJavaElementDelta {
* Empty array of IJavaElementDelta
*/
static IJavaElementDelta[] EMPTY_DELTA= new IJavaElementDelta[] {};
-
+
/**
* Child index is needed iff affectedChildren.length >= NEED_CHILD_INDEX
*/
static int NEED_CHILD_INDEX = 3;
-
+
/**
* On-demand index into affectedChildren
*/
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElementDeltaBuilder.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElementDeltaBuilder.java
index 428b51177..b7f476419 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElementDeltaBuilder.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElementDeltaBuilder.java
@@ -319,7 +319,7 @@ private void findContentChange(JavaElementInfo oldInfo, JavaElementInfo newInfo,
char[] oldName = oldMappingInfo.getCallinName();
char[] newName = newMappingInfo.getCallinName();
if ( oldMappingInfo.isCallin()
- && !(oldName[0] == '<' && newName[0] == '<') // if both are generated don't bother to compare
+ && !(oldName[0] == '<' && newName[0] == '<') // if both are generated don't bother to compare
&& !CharOperation.equals(oldName, newName))
this.delta.changed(newElement, IJavaElementDelta.F_CONTENT);
if (!oldMappingInfo.signaturesEqual(newMappingInfo))
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElementRequestor.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElementRequestor.java
index 00308e0fa..0fe7444db 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElementRequestor.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElementRequestor.java
@@ -153,7 +153,7 @@ public void acceptModule(IModuleDescription module) {
if (this.modules == null) {
this.modules= new ArrayList();
}
- this.modules.add(module);
+ this.modules.add(module);
}
/**
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelCache.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelCache.java
index 87e604659..bd76465c1 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelCache.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelCache.java
@@ -81,7 +81,7 @@ public class JavaModelCache {
* Cache of open children of openable Java Model Java elements
*/
protected Map<IJavaElement, Object> childrenCache;
-
+
/**
* Cache of access rules
*/
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java
index c455691cb..23709fb8e 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java
@@ -5414,7 +5414,7 @@ public class JavaModelManager implements ISaveParticipant, IContentTypeChangeLis
| IResourceChangeEvent.PRE_DELETE
| IResourceChangeEvent.PRE_CLOSE
| IResourceChangeEvent.PRE_REFRESH);
-
+
// New index is disabled, see bug 544898
// Indexer.getInstance().addListener(this.deltaState);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelStatus.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelStatus.java
index f725a4356..aa6c38505 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelStatus.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelStatus.java
@@ -382,7 +382,7 @@ public class JavaModelStatus extends Status implements IJavaModelStatus, IJavaMo
return Messages.bind(Messages.status_cannot_retrieve_attached_javadoc, this.string, "");//$NON-NLS-1$
}
break;
-
+
case CANNOT_RETRIEVE_ATTACHED_JAVADOC_TIMEOUT :
if (this.elements != null && this.elements.length == 1) {
if (this.string != null) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java
index 0eb133917..f81628fb3 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java
@@ -293,7 +293,7 @@ public class JavaProject
return false;
return true;
}
-
+
private static boolean areClasspathsEqual(IClasspathEntry[] first, IClasspathEntry[] second) {
if (first != second){
if (first == null) return false;
@@ -324,7 +324,7 @@ public class JavaProject
if (IS_CASE_SENSITIVE) {
return externalPath;
}
-
+
// if not external path, return original path
IWorkspace workspace = ResourcesPlugin.getWorkspace();
if (workspace == null) return externalPath; // protection during shutdown (30487)
@@ -433,7 +433,7 @@ public class JavaProject
cycleString.append('}');
first = false;
}
-
+
IMarker cycleMarker = project.getCycleMarker();
String circularCPOption = project.getOption(JavaCore.CORE_CIRCULAR_CLASSPATH, true);
int circularCPSeverity = JavaCore.ERROR.equals(circularCPOption) ? IMarker.SEVERITY_ERROR : IMarker.SEVERITY_WARNING;
@@ -500,7 +500,7 @@ public class JavaProject
module = root.getModuleDescription();
if (module != null) {
if (current != null) {
- throw new JavaModelException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID,
+ throw new JavaModelException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID,
Messages.bind(Messages.classpath_duplicateEntryPath, TypeConstants.MODULE_INFO_FILE_NAME_STRING, getElementName())));
}
current = module;
@@ -535,7 +535,7 @@ public class JavaProject
/**
* Internal computation of an expanded classpath. It will eliminate duplicates, and produce copies
* of exported or restricted classpath entries to avoid possible side-effects ever after.
- * @param excludeTestCode
+ * @param excludeTestCode
*/
private void computeExpandedClasspath(
ClasspathEntry referringEntry,
@@ -570,7 +570,7 @@ public class JavaProject
rootIDs.put(rootID, Boolean.FALSE);
for (int j = 0; j < accumulatedEntries.size(); j++) {
// it is unclear how oldEntry and combinedEntry could be merged.
- // main code compilation should remain untouched as far as possible,
+ // main code compilation should remain untouched as far as possible,
// so take all settings from oldEntry and just remove WITHOUT_TEST_CODE
ClasspathEntry oldEntry = accumulatedEntries.get(j);
if (oldEntry.rootID().equals(rootID)) {
@@ -821,7 +821,7 @@ public class JavaProject
boolean isPotentialRoot = !isJavaDotStart; // always include non-java.*
if (!hasJavaDotSE)
isPotentialRoot |= isJavaDotStart; // no java.se => add all java.*
-
+
if (isPotentialRoot) {
IModule module = getModule.apply(mod);
if (module != null) {
@@ -864,7 +864,7 @@ public class JavaProject
Map<String, JrtPackageFragmentRoot> modNames2Roots = new HashMap<>();
Map<String, IModule> modules = new HashMap<>();
Set<IModule> resultModuleSet = new HashSet<>();
-
+
public ModuleLookup(File jrtFile) {
this.jrtFile = jrtFile;
}
@@ -932,7 +932,7 @@ public class JavaProject
}
}
- private void loadModulesInJimage(final IPath imagePath, final ObjectVector roots, final Map rootToResolvedEntries,
+ private void loadModulesInJimage(final IPath imagePath, final ObjectVector roots, final Map rootToResolvedEntries,
final IClasspathEntry resolvedEntry, final IClasspathEntry referringEntry) {
try {
org.eclipse.jdt.internal.compiler.util.JRTUtil.walkModuleImage(imagePath.toFile(),
@@ -951,7 +951,7 @@ public class JavaProject
public FileVisitResult visitModule(java.nio.file.Path path, String name) throws IOException {
JrtPackageFragmentRoot root = new JrtPackageFragmentRoot(imagePath, name, JavaProject.this, resolvedEntry.getExtraAttributes());
roots.add(root);
- if (rootToResolvedEntries != null)
+ if (rootToResolvedEntries != null)
rootToResolvedEntries.put(root, ((ClasspathEntry)resolvedEntry).combineWith((ClasspathEntry) referringEntry));
return FileVisitResult.SKIP_SUBTREE;
}
@@ -1262,8 +1262,8 @@ public class JavaProject
/**
* Reads and decode an XML classpath string. Returns a two-dimensional array, where the number of elements in the row is fixed to 2.
* The first element is an array of raw classpath entries and the second element is an array of referenced entries that may have been stored
- * by the client earlier. See {@link IJavaProject#getReferencedClasspathEntries()} for more details.
- *
+ * by the client earlier. See {@link IJavaProject#getReferencedClasspathEntries()} for more details.
+ *
*/
public IClasspathEntry[][] decodeClasspath(String xmlClasspath, Map unknownElements) throws IOException, ClasspathEntry.AssertionFailedException {
@@ -1304,7 +1304,7 @@ public class JavaProject
entries[0] = new IClasspathEntry[pathSize + (defaultOutput == null ? 0 : 1)];
paths.toArray(entries[0]);
if (defaultOutput != null) entries[0][pathSize] = defaultOutput; // ensure output is last item
-
+
paths.clear();
list = cpElement.getElementsByTagName(ClasspathEntry.TAG_REFERENCED_ENTRY);
length = list.getLength();
@@ -1413,7 +1413,7 @@ public class JavaProject
((ClasspathEntry) referencedEntries[i]).elementEncode(xmlWriter, this.project.getFullPath(), indent, true, unknownElements, true);
}
}
-
+
xmlWriter.endTag(ClasspathEntry.TAG_CLASSPATH, indent, true/*insert new line*/);
writer.flush();
writer.close();
@@ -1679,10 +1679,10 @@ public class JavaProject
type = originalOuter.getType(innerName);
if (type.exists())
return type; // nested type found locally, don't create a PhantomType
-
+
if (!OTModelManager.isTeam(originalOuter))
return null; // traverse hierarchy only if outer is a team
-
+
ITypeHierarchy hierarchy = originalOuter.newSupertypeHierarchy(progressMonitor);
IType currentOuter = originalOuter;
List<IType> realTypes = new ArrayList<IType>();
@@ -2047,7 +2047,7 @@ public class JavaProject
token = memento.nextToken();
if (token != null) {
mod = token;
-
+
}
}
continue;
@@ -2062,7 +2062,7 @@ public class JavaProject
rootPath += token;
}
IClasspathAttribute[] attributesArray = null;
- if (!attributes.isEmpty())
+ if (!attributes.isEmpty())
attributesArray = attributes.toArray(new IClasspathAttribute[attributes.size()]);
JavaElement root = (mod == null) ?
(JavaElement)getPackageFragmentRoot(new Path(rootPath), attributesArray) :
@@ -2184,7 +2184,7 @@ public class JavaProject
}
//{ObjectTeams: mark non-OT projects:
try {
- if (!this.project.hasNature(JavaCore.OTJ_NATURE_ID))
+ if (!this.project.hasNature(JavaCore.OTJ_NATURE_ID))
projectOptions.put(CompilerOptions.OPTION_PureJavaOnly, CompilerOptions.ENABLED);
else
projectOptions.remove(CompilerOptions.OPTION_PureJavaOnly); // remove left-overs (perhaps nature was added late?)
@@ -2451,7 +2451,7 @@ public class JavaProject
public IClasspathEntry[] getReferencedClasspathEntries() throws JavaModelException {
return getPerProjectInfo().referencedEntries;
}
-
+
/**
* @see IJavaProject#getRequiredProjectNames()
*/
@@ -2631,7 +2631,7 @@ public class JavaProject
public int hashCode() {
return this.project.hashCode();
}
-
+
private boolean hasUTF8BOM(byte[] bytes) {
if (bytes.length > IContentDescription.BOM_UTF_8.length) {
for (int i = 0, length = IContentDescription.BOM_UTF_8.length; i < length; i++) {
@@ -2734,7 +2734,7 @@ public class JavaProject
if (isOnClasspathEntry(elementPath, isFolderPath, isPackageFragmentRoot, resolvedClasspath[index]))
return true;
}
-
+
return false;
}
@@ -2885,7 +2885,7 @@ public class JavaProject
* and that should be used as a temporary info.
*/
public PerProjectInfo newTemporaryInfo() {
- return
+ return
new PerProjectInfo(this.project.getProject()) {
@Override
protected ClasspathChange addClasspathChange() {
@@ -2985,8 +2985,8 @@ public class JavaProject
* Reads the classpath file entries of this project's .classpath file.
* Returns a two-dimensional array, where the number of elements in the row is fixed to 2.
* The first element is an array of raw classpath entries, which includes the output entry,
- * and the second element is an array of referenced entries that may have been stored
- * by the client earlier.
+ * and the second element is an array of referenced entries that may have been stored
+ * by the client earlier.
* See {@link IJavaProject#getReferencedClasspathEntries()} for more details.
* As a side effect, unknown elements are stored in the given map (if not null)
* Throws exceptions if the file cannot be accessed or is malformed.
@@ -3122,15 +3122,15 @@ public class JavaProject
// project doesn't exist
return null;
}
- }
-
+ }
+
/*
* Resolve the given raw classpath.
*/
public IClasspathEntry[] resolveClasspath(IClasspathEntry[] rawClasspath) throws JavaModelException {
return resolveClasspath(rawClasspath, false/*don't use previous session*/, true/*resolve chained libraries*/).resolvedClasspath;
}
-
+
static class ResolvedClasspath {
IClasspathEntry[] resolvedClasspath;
IJavaModelStatus unresolvedEntryStatus = JavaModelStatus.VERIFIED_OK;
@@ -3138,7 +3138,7 @@ public class JavaProject
Map rootPathToResolvedEntries = new HashMap();
IClasspathEntry[] referencedEntries = null;
}
-
+
public ResolvedClasspath resolveClasspath(IClasspathEntry[] rawClasspath, boolean usePreviousSession, boolean resolveChainedLibraries) throws JavaModelException {
return resolveClasspath(rawClasspath, null, usePreviousSession, resolveChainedLibraries);
}
@@ -3152,10 +3152,10 @@ public class JavaProject
Map referencedEntriesMap = new HashMap();
Set<IPath> rawLibrariesPath = new LinkedHashSet<>();
LinkedHashSet resolvedEntries = new LinkedHashSet();
-
+
if(resolveChainedLibraries) {
for (int index = 0; index < rawClasspath.length; index++) {
- IClasspathEntry currentEntry = rawClasspath[index];
+ IClasspathEntry currentEntry = rawClasspath[index];
if (currentEntry.getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
rawLibrariesPath.add(ClasspathEntry.resolveDotDot(getProject().getLocation(), currentEntry.getPath()));
}
@@ -3177,7 +3177,7 @@ public class JavaProject
}
}
}
-
+
int length = rawClasspath.length;
for (int i = 0; i < length; i++) {
@@ -3242,12 +3242,12 @@ public class JavaProject
}
// if container is exported or restricted, then its nested entries must in turn be exported (21749) and/or propagate restrictions
cEntry = cEntry.combineWith((ClasspathEntry) rawEntry);
-
+
if (cEntry.getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
// resolve ".." in library path
cEntry = cEntry.resolvedDotDot(getProject().getLocation());
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=313965
- // Do not resolve if the system attribute is set to false
+ // Do not resolve if the system attribute is set to false
if (resolveChainedLibraries
&& JavaModelManager.getJavaModelManager().resolveReferencedLibrariesForContainers
&& result.rawReverseMap.get(cEntry.getPath()) == null) {
@@ -3267,7 +3267,7 @@ public class JavaProject
case IClasspathEntry.CPE_LIBRARY:
// resolve ".." in library path
resolvedEntry = ((ClasspathEntry) rawEntry).resolvedDotDot(getProject().getLocation());
-
+
if (resolveChainedLibraries && result.rawReverseMap.get(resolvedEntry.getPath()) == null) {
// resolve Class-Path: in manifest
ClasspathEntry[] extraEntries = ((ClasspathEntry) resolvedEntry).resolvedChainedLibraries();
@@ -3335,12 +3335,12 @@ public class JavaProject
resolvedEntry.extraAttributes = attributes;
}
}
-
+
/*
* File#exists() takes lot of time for an unmapped drive. Hence, cache the info.
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=338649
*/
- private boolean driveExists(IPath sourcePath, Map knownDrives) {
+ private boolean driveExists(IPath sourcePath, Map knownDrives) {
String drive = sourcePath.getDevice();
if (drive == null) return true;
Boolean good = (Boolean)knownDrives.get(drive);
@@ -3355,7 +3355,7 @@ public class JavaProject
}
return good.booleanValue();
}
-
+
/*
* Resolve the given perProjectInfo's raw classpath and store the resolved classpath in the perProjectInfo.
*/
@@ -3382,7 +3382,7 @@ public class JavaProject
}
ResolvedClasspath result = resolveClasspath(classpath[0], classpath[1], usePreviousSession, true/*resolve chained libraries*/);
-
+
if (CP_RESOLUTION_BP_LISTENERS != null)
breakpoint(2, this);
@@ -3396,7 +3396,7 @@ public class JavaProject
breakpoint(3, this);
}
}
-
+
/**
* Answers an ID which is used to distinguish project/entries during package
* fragment root computations
@@ -3421,7 +3421,7 @@ public class JavaProject
Map unknownElements = new HashMap();
IClasspathEntry[][] fileEntries = readFileEntries(unknownElements);
- if (fileEntries[0] != JavaProject.INVALID_CLASSPATH &&
+ if (fileEntries[0] != JavaProject.INVALID_CLASSPATH &&
areClasspathsEqual(newClasspath, newOutputLocation, fileEntries[0])
&& (referencedEntries == null || areClasspathsEqual(referencedEntries, fileEntries[1])) ) {
// no need to save it, it is the same
@@ -3608,13 +3608,13 @@ public class JavaProject
true/*can change resource (as per API contract)*/,
monitor);
}
-
+
@Override
public void setRawClasspath(IClasspathEntry[] entries, IClasspathEntry[] referencedEntries, IPath outputLocation,
IProgressMonitor monitor) throws JavaModelException {
setRawClasspath(entries, referencedEntries, outputLocation, true, monitor);
}
-
+
protected void setRawClasspath(IClasspathEntry[] newRawClasspath, IClasspathEntry[] referencedEntries, IPath newOutputLocation,
boolean canModifyResources, IProgressMonitor monitor) throws JavaModelException {
@@ -3695,16 +3695,16 @@ public class JavaProject
private List<IPath> pathToCycle;
public final List<IPath> cycle;
-
+
public CycleInfo(List<IPath> pathToCycle, List<IPath> cycle) {
this.pathToCycle = new ArrayList<>(pathToCycle);
this.cycle = new ArrayList<>(cycle);
}
-
+
public static Optional<CycleInfo> findCycleContaining(Collection<List<CycleInfo>> infos, IPath path) {
return infos.stream().flatMap(l -> l.stream()).filter(c -> c.cycle.contains(path)).findAny();
}
-
+
public static void add(IPath project, List<IPath> prefix, List<IPath> cycle, Map<IPath, List<CycleInfo>> cyclesPerProject) {
List<CycleInfo> list = cyclesPerProject.get(project);
if (list == null) {
@@ -3723,11 +3723,11 @@ public class JavaProject
}
list.add(new CycleInfo(prefix, cycle));
}
-
+
public String pathToCycleAsString() {
return this.pathToCycle.stream().map(IPath::lastSegment).collect(Collectors.joining(", ")); //$NON-NLS-1$
}
-
+
public String cycleAsString() {
return this.cycle.stream().map(IPath::lastSegment).collect(Collectors.joining(", ")); //$NON-NLS-1$
}
@@ -3933,7 +3933,7 @@ public class JavaProject
}
public void setModuleDescription(IModuleDescription module) throws JavaModelException {
- JavaProjectElementInfo info = (JavaProjectElementInfo) getElementInfo();
+ JavaProjectElementInfo info = (JavaProjectElementInfo) getElementInfo();
IModuleDescription current = info.getModule();
if (current != null) {
IPackageFragmentRoot root = (IPackageFragmentRoot) current.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT);
@@ -3944,7 +3944,7 @@ public class JavaProject
}
info.setModule(module);
}
-
+
private boolean isUnNamedModule() throws JavaModelException {
JavaProjectElementInfo info = (JavaProjectElementInfo) getElementInfo();
IModuleDescription module = info.getModule();
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavadocContents.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavadocContents.java
index 7cba0a46f..7883d8444 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavadocContents.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavadocContents.java
@@ -26,27 +26,27 @@ import org.eclipse.jdt.internal.compiler.util.HashtableOfObjectToIntArray;
import org.eclipse.jdt.internal.core.util.Util;
public class JavadocContents {
- private static final int[] UNKNOWN_FORMAT = new int[0];
-
+ private static final int[] UNKNOWN_FORMAT = new int[0];
+
private BinaryType type;
private char[] content;
-
+
private int childrenStart;
-
+
private boolean hasComputedChildrenSections = false;
private int indexOfFieldDetails;
private int indexOfConstructorDetails;
private int indexOfMethodDetails;
private int indexOfEndOfClassData;
-
+
private int indexOfFieldsBottom;
private int indexOfAllMethodsTop;
private int indexOfAllMethodsBottom;
-
+
private int[] typeDocRange;
private HashtableOfObjectToIntArray fieldDocRanges;
private HashtableOfObjectToIntArray methodDocRanges;
-
+
private int[] fieldAnchorIndexes;
private int fieldAnchorIndexesCount;
private int fieldLastAnchorFoundIndex;
@@ -59,12 +59,12 @@ public class JavadocContents {
private int[] tempAnchorIndexes;
private int tempAnchorIndexesCount;
private int tempLastAnchorFoundIndex;
-
+
public JavadocContents(BinaryType type, String content) {
this(content);
this.type = type;
}
-
+
public JavadocContents(String content) {
this.content = content != null ? content.toCharArray() : null;
}
@@ -73,20 +73,20 @@ public class JavadocContents {
*/
public String getTypeDoc() throws JavaModelException {
if (this.content == null) return null;
-
+
synchronized (this) {
if (this.typeDocRange == null) {
computeTypeRange();
}
}
-
+
if (this.typeDocRange != null) {
if (this.typeDocRange == UNKNOWN_FORMAT) throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.UNKNOWN_JAVADOC_FORMAT, this.type));
return String.valueOf(CharOperation.subarray(this.content, this.typeDocRange[0], this.typeDocRange[1]));
}
return null;
}
-
+
public String getPackageDoc() throws JavaModelException {
if (this.content == null) return null;
int[] range = null;
@@ -97,7 +97,7 @@ public class JavadocContents {
if (index != -1) {
index = CharOperation.indexOf(JavadocConstants.ANCHOR_SUFFIX, this.content, false, index);
if (index == -1) return null;
-
+
int start = CharOperation.indexOf(JavadocConstants.H2_PREFIX, this.content, false, index);
if (start != -1) {
start = CharOperation.indexOf(JavadocConstants.H2_SUFFIX, this.content, false, start);
@@ -114,7 +114,7 @@ public class JavadocContents {
}
return null;
}
-
+
public String getModuleDoc() throws JavaModelException {
if (this.content == null) return null;
int index = CharOperation.indexOf(JavadocConstants.MODULE_DESCRIPTION_START, this.content, false, 0);
@@ -123,13 +123,13 @@ public class JavadocContents {
if (end == -1) end = this.content.length -1;
return String.valueOf(CharOperation.subarray(this.content, index, end));
}
-
+
/*
* Returns the part of the javadoc that describe a field of the type
*/
public String getFieldDoc(IField child) throws JavaModelException {
if (this.content == null) return null;
-
+
int[] range = null;
synchronized (this) {
if (this.fieldDocRanges == null) {
@@ -137,26 +137,26 @@ public class JavadocContents {
} else {
range = this.fieldDocRanges.get(child);
}
-
+
if (range == null) {
range = computeFieldRange(child);
this.fieldDocRanges.put(child, range);
}
}
-
+
if (range != null) {
if (range == UNKNOWN_FORMAT) throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.UNKNOWN_JAVADOC_FORMAT, child));
return String.valueOf(CharOperation.subarray(this.content, range[0], range[1]));
}
return null;
}
-
+
/*
* Returns the part of the javadoc that describe a method of the type
*/
public String getMethodDoc(IMethod child) throws JavaModelException {
if (this.content == null) return null;
-
+
int[] range = null;
synchronized (this) {
if (this.methodDocRanges == null) {
@@ -164,13 +164,13 @@ public class JavadocContents {
} else {
range = this.methodDocRanges.get(child);
}
-
+
if (range == null) {
range = computeMethodRange(child);
this.methodDocRanges.put(child, range);
}
}
-
+
if (range != null) {
if (range == UNKNOWN_FORMAT) {
throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.UNKNOWN_JAVADOC_FORMAT, child));
@@ -179,29 +179,29 @@ public class JavadocContents {
}
return null;
}
-
+
/*
* Compute the ranges of the parts of the javadoc that describe each method of the type
*/
private int[] computeChildRange(char[] anchor, int indexOfSectionBottom) throws JavaModelException {
-
+
// checks each known anchor locations
if (this.tempAnchorIndexesCount > 0) {
for (int i = 0; i < this.tempAnchorIndexesCount; i++) {
int anchorEndStart = this.tempAnchorIndexes[i];
-
+
if (anchorEndStart != -1 && CharOperation.prefixEquals(anchor, this.content, false, anchorEndStart)) {
-
+
this.tempAnchorIndexes[i] = -1;
-
+
return computeChildRange(anchorEndStart, anchor, indexOfSectionBottom);
}
}
}
-
+
int fromIndex = this.tempLastAnchorFoundIndex;
int[] index;
-
+
// check each next unknown anchor locations
index = getAnchorIndex(fromIndex);
while (index[0] != -1 && (index[0] < indexOfSectionBottom || indexOfSectionBottom == -1)) {
@@ -210,19 +210,19 @@ public class JavadocContents {
int anchorEndStart = index[0] + index[1];
this.tempLastAnchorFoundIndex = anchorEndStart;
-
+
if (CharOperation.prefixEquals(anchor, this.content, false, anchorEndStart)) {
return computeChildRange(anchorEndStart, anchor, indexOfSectionBottom);
} else {
if (this.tempAnchorIndexes.length == this.tempAnchorIndexesCount) {
System.arraycopy(this.tempAnchorIndexes, 0, this.tempAnchorIndexes = new int[this.tempAnchorIndexesCount + 20], 0, this.tempAnchorIndexesCount);
}
-
+
this.tempAnchorIndexes[this.tempAnchorIndexesCount++] = anchorEndStart;
}
index = getAnchorIndex(fromIndex);
}
-
+
return null;
}
private int[] getAnchorIndex(int fromIndex) {
@@ -241,7 +241,7 @@ public class JavadocContents {
}
private int[] computeChildRange(int anchorEndStart, char[] anchor, int indexOfBottom) {
int[] range = null;
-
+
// try to find the bottom of the section
if (indexOfBottom != -1) {
// try to find the end of the anchor
@@ -249,7 +249,7 @@ public class JavadocContents {
if (indexOfEndLink != -1) {
// try to find the next anchor
int indexOfNextElement = getAnchorIndex(indexOfEndLink)[0];
-
+
int javadocStart = indexOfEndLink + JavadocConstants.ANCHOR_SUFFIX_LENGTH;
int javadocEnd = indexOfNextElement == -1 ? indexOfBottom : Math.min(indexOfNextElement, indexOfBottom);
range = new int[]{javadocStart, javadocEnd};
@@ -261,7 +261,7 @@ public class JavadocContents {
// the detail section has no bottom
range = UNKNOWN_FORMAT;
}
-
+
return range;
}
@@ -273,31 +273,31 @@ public class JavadocContents {
// try to find field detail start
this.indexOfFieldDetails = CharOperation.indexOf(JavadocConstants.FIELD_DETAIL, this.content, false, lastIndex);
lastIndex = this.indexOfFieldDetails == -1 ? lastIndex : this.indexOfFieldDetails;
-
+
// try to find constructor detail start
this.indexOfConstructorDetails = CharOperation.indexOf(JavadocConstants.CONSTRUCTOR_DETAIL, this.content, false, lastIndex);
lastIndex = this.indexOfConstructorDetails == -1 ? lastIndex : this.indexOfConstructorDetails;
-
+
// try to find method detail start
this.indexOfMethodDetails = CharOperation.indexOf(JavadocConstants.METHOD_DETAIL, this.content, false, lastIndex);
lastIndex = this.indexOfMethodDetails == -1 ? lastIndex : this.indexOfMethodDetails;
-
+
// we take the end of class data
this.indexOfEndOfClassData = CharOperation.indexOf(JavadocConstants.END_OF_CLASS_DATA, this.content, false, lastIndex);
-
+
// try to find the field detail end
this.indexOfFieldsBottom =
this.indexOfConstructorDetails != -1 ? this.indexOfConstructorDetails :
this.indexOfMethodDetails != -1 ? this.indexOfMethodDetails:
this.indexOfEndOfClassData;
-
+
this.indexOfAllMethodsTop =
this.indexOfConstructorDetails != -1 ?
this.indexOfConstructorDetails :
this.indexOfMethodDetails;
-
+
this.indexOfAllMethodsBottom = this.indexOfEndOfClassData;
-
+
this.hasComputedChildrenSections = true;
}
@@ -308,13 +308,13 @@ public class JavadocContents {
if (!this.hasComputedChildrenSections) {
computeChildrenSections();
}
-
+
StringBuffer buffer = new StringBuffer(field.getElementName());
buffer.append(JavadocConstants.ANCHOR_PREFIX_END);
char[] anchor = String.valueOf(buffer).toCharArray();
-
+
int[] range = null;
-
+
if (this.indexOfFieldDetails == -1 || this.indexOfFieldsBottom == -1) {
// the detail section has no top or bottom, so the doc has an unknown format
if (this.unknownFormatAnchorIndexes == null) {
@@ -322,13 +322,13 @@ public class JavadocContents {
this.unknownFormatAnchorIndexesCount = 0;
this.unknownFormatLastAnchorFoundIndex = this.childrenStart;
}
-
+
this.tempAnchorIndexes = this.unknownFormatAnchorIndexes;
this.tempAnchorIndexesCount = this.unknownFormatAnchorIndexesCount;
this.tempLastAnchorFoundIndex = this.unknownFormatLastAnchorFoundIndex;
-
+
range = computeChildRange(anchor, this.indexOfFieldsBottom);
-
+
this.unknownFormatLastAnchorFoundIndex = this.tempLastAnchorFoundIndex;
this.unknownFormatAnchorIndexesCount = this.tempAnchorIndexesCount;
this.unknownFormatAnchorIndexes = this.tempAnchorIndexes;
@@ -338,21 +338,21 @@ public class JavadocContents {
this.fieldAnchorIndexesCount = 0;
this.fieldLastAnchorFoundIndex = this.indexOfFieldDetails;
}
-
+
this.tempAnchorIndexes = this.fieldAnchorIndexes;
this.tempAnchorIndexesCount = this.fieldAnchorIndexesCount;
this.tempLastAnchorFoundIndex = this.fieldLastAnchorFoundIndex;
-
+
range = computeChildRange(anchor, this.indexOfFieldsBottom);
-
+
this.fieldLastAnchorFoundIndex = this.tempLastAnchorFoundIndex;
this.fieldAnchorIndexesCount = this.tempAnchorIndexesCount;
this.fieldAnchorIndexes = this.tempAnchorIndexes;
}
-
+
return range;
}
-
+
/*
* Compute the ranges of the parts of the javadoc that describe each method of the type
*/
@@ -360,11 +360,11 @@ public class JavadocContents {
if (!this.hasComputedChildrenSections) {
computeChildrenSections();
}
-
+
char[] anchor = computeMethodAnchorPrefixEnd((BinaryMethod)method).toCharArray();
-
+
int[] range = null;
-
+
if (this.indexOfAllMethodsTop == -1 || this.indexOfAllMethodsBottom == -1) {
// the detail section has no top or bottom, so the doc has an unknown format
if (this.unknownFormatAnchorIndexes == null) {
@@ -372,43 +372,43 @@ public class JavadocContents {
this.unknownFormatAnchorIndexesCount = 0;
this.unknownFormatLastAnchorFoundIndex = this.childrenStart;
}
-
+
this.tempAnchorIndexes = this.unknownFormatAnchorIndexes;
this.tempAnchorIndexesCount = this.unknownFormatAnchorIndexesCount;
this.tempLastAnchorFoundIndex = this.unknownFormatLastAnchorFoundIndex;
-
+
range = computeChildRange(anchor, this.indexOfFieldsBottom);
if (range == null) {
range = computeChildRange(getJavadoc8Anchor(anchor), this.indexOfAllMethodsBottom);
}
-
+
this.unknownFormatLastAnchorFoundIndex = this.tempLastAnchorFoundIndex;
this.unknownFormatAnchorIndexesCount = this.tempAnchorIndexesCount;
this.unknownFormatAnchorIndexes = this.tempAnchorIndexes;
- } else {
+ } else {
if (this.methodAnchorIndexes == null) {
this.methodAnchorIndexes = new int[this.type.getFields().length];
this.methodAnchorIndexesCount = 0;
this.methodLastAnchorFoundIndex = this.indexOfAllMethodsTop;
}
-
+
this.tempAnchorIndexes = this.methodAnchorIndexes;
this.tempAnchorIndexesCount = this.methodAnchorIndexesCount;
this.tempLastAnchorFoundIndex = this.methodLastAnchorFoundIndex;
-
+
range = computeChildRange(anchor, this.indexOfAllMethodsBottom);
if (range == null) {
range = computeChildRange(getJavadoc8Anchor(anchor), this.indexOfAllMethodsBottom);
}
-
+
this.methodLastAnchorFoundIndex = this.tempLastAnchorFoundIndex;
this.methodAnchorIndexesCount = this.tempAnchorIndexesCount;
this.methodAnchorIndexes = this.tempAnchorIndexes;
}
-
+
return range;
}
-
+
private static char[] getJavadoc8Anchor(char[] anchor) {
// fix for bug 432284: [1.8] Javadoc-8-style anchors not found by IMethod#getAttachedJavadoc(..)
char[] anchor8 = new char[anchor.length];
@@ -454,7 +454,7 @@ public class JavadocContents {
} else {
typeQualifiedName = this.type.getElementName();
}
-
+
String methodName = method.getElementName();
if (method.isConstructor()) {
methodName = typeQualifiedName;
@@ -493,7 +493,7 @@ public class JavadocContents {
}
return anchor + JavadocConstants.ANCHOR_PREFIX_END;
}
-
+
/*
* Compute the range of the part of the javadoc that describe the type
*/
@@ -533,7 +533,7 @@ public class JavadocContents {
// try to find method summary start
indexOfNextSummary = CharOperation.indexOf(JavadocConstants.METHOD_SUMMARY, this.content, false, indexOfNextSeparator);
}
-
+
if (indexOfNextSummary == -1) {
// we take the end of class data
indexOfNextSummary = CharOperation.indexOf(JavadocConstants.END_OF_CLASS_DATA, this.content, false, indexOfNextSeparator);
@@ -541,7 +541,7 @@ public class JavadocContents {
// improve performance of computation of children ranges
this.childrenStart = indexOfNextSummary + 1;
}
-
+
if (indexOfNextSummary == -1) {
this.typeDocRange = UNKNOWN_FORMAT;
return;
@@ -564,7 +564,7 @@ public class JavadocContents {
if (afterHierarchy != indexOfNextSummary) {
start = afterHierarchy;
}
-
+
this.typeDocRange = new int[]{start, indexOfNextSummary};
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JrtPackageFragmentRoot.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JrtPackageFragmentRoot.java
index 201ffe821..0028c34c6 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JrtPackageFragmentRoot.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JrtPackageFragmentRoot.java
@@ -45,9 +45,9 @@ import org.eclipse.jdt.internal.core.util.Util;
public class JrtPackageFragmentRoot extends JarPackageFragmentRoot implements IModulePathEntry {
String moduleName;
-
+
public static final ThreadLocal<Boolean> workingOnOldClasspath = new ThreadLocal<>();
-
+
/**
* Constructs a package fragment root which represents a module
* contained in a JRT.
@@ -155,7 +155,7 @@ public class JrtPackageFragmentRoot extends JarPackageFragmentRoot implements IM
}
return null;
}
-
+
@Override
protected boolean isComplianceJava9OrHigher() {
return true;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/LambdaExpression.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/LambdaExpression.java
index 90d920ca3..aae2b242d 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/LambdaExpression.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/LambdaExpression.java
@@ -39,24 +39,24 @@ public class LambdaExpression extends SourceType {
SourceTypeElementInfo elementInfo;
LambdaMethod lambdaMethod;
-
- // These fields could be materialized from elementInfo, but for ease of use stashed here
+
+ // These fields could be materialized from elementInfo, but for ease of use stashed here
protected int sourceStart;
protected int sourceEnd;
protected int arrowPosition;
protected String interphase;
-
-
+
+
// Construction from AST node
LambdaExpression(JavaElement parent, org.eclipse.jdt.internal.compiler.ast.LambdaExpression lambdaExpression) {
super(parent, new String(CharOperation.NO_CHAR));
this.sourceStart = lambdaExpression.sourceStart;
this.sourceEnd = lambdaExpression.sourceEnd;
this.arrowPosition = lambdaExpression.arrowPosition;
-
+
TypeBinding supertype = findLambdaSuperType(lambdaExpression);
this.interphase = new String(CharOperation.replaceOnCopy(supertype.genericTypeSignature(), '/', '.'));
- this.elementInfo = makeTypeElementInfo(this, this.interphase, this.sourceStart, this.sourceEnd, this.arrowPosition);
+ this.elementInfo = makeTypeElementInfo(this, this.interphase, this.sourceStart, this.sourceEnd, this.arrowPosition);
this.lambdaMethod = LambdaFactory.createLambdaMethod(this, lambdaExpression);
this.elementInfo.children = new IJavaElement[] { this.lambdaMethod };
}
@@ -103,7 +103,7 @@ public class LambdaExpression extends SourceType {
}
return original;
}
-
+
// Construction from memento
LambdaExpression(JavaElement parent, String interphase, int sourceStart, int sourceEnd, int arrowPosition) {
super(parent, new String(CharOperation.NO_CHAR));
@@ -114,7 +114,7 @@ public class LambdaExpression extends SourceType {
this.elementInfo = makeTypeElementInfo(this, interphase, this.sourceStart = sourceStart, sourceEnd, arrowPosition);
// Method is in the process of being fabricated, will be attached shortly.
}
-
+
// Construction from subtypes.
LambdaExpression(JavaElement parent, String interphase, int sourceStart, int sourceEnd, int arrowPosition, LambdaMethod lambdaMethod) {
super(parent, new String(CharOperation.NO_CHAR));
@@ -125,33 +125,33 @@ public class LambdaExpression extends SourceType {
this.elementInfo = makeTypeElementInfo(this, interphase, this.sourceStart = sourceStart, sourceEnd, arrowPosition);
this.elementInfo.children = new IJavaElement[] { this.lambdaMethod = lambdaMethod };
}
-
+
// Lambda expression is not backed by model, fabricate element information structure and stash it.
static private SourceTypeElementInfo makeTypeElementInfo (LambdaExpression handle, String interphase, int sourceStart, int sourceEnd, int arrowPosition) {
-
+
SourceTypeElementInfo elementInfo = new SourceTypeElementInfo();
-
+
elementInfo.setFlags(0);
elementInfo.setHandle(handle);
elementInfo.setSourceRangeStart(sourceStart);
elementInfo.setSourceRangeEnd(sourceEnd);
-
+
elementInfo.setNameSourceStart(sourceStart);
elementInfo.setNameSourceEnd(arrowPosition);
elementInfo.setSuperclassName(null);
elementInfo.addCategories(handle, null);
-
+
JavaModelManager manager = JavaModelManager.getJavaModelManager();
char[][] superinterfaces = new char [][] { manager.intern(Signature.toString(interphase).toCharArray()) }; // drops marker interfaces - to fix.
elementInfo.setSuperInterfaceNames(superinterfaces);
return elementInfo;
}
-
+
@Override
protected void closing(Object info) throws JavaModelException {
// nothing to do, not backed by model ATM.
}
-
+
@Override
public boolean equals(Object o) {
if (this == o)
@@ -170,12 +170,12 @@ public class LambdaExpression extends SourceType {
}
return false;
}
-
+
@Override
public int hashCode() {
return Util.combineHashCodes(super.hashCode(), this.sourceStart);
}
-
+
@Override
public Object getElementInfo(IProgressMonitor monitor) throws JavaModelException {
return this.elementInfo;
@@ -185,16 +185,16 @@ public class LambdaExpression extends SourceType {
protected char getHandleMementoDelimiter() {
return JavaElement.JEM_LAMBDA_EXPRESSION;
}
-
+
@Override
protected void getHandleMemento(StringBuffer buff) {
getHandleMemento(buff, true, true);
// lambda method and lambda expression cannot share the same memento - add a trailing discriminator.
appendEscapedDelimiter(buff, getHandleMementoDelimiter());
}
-
+
protected void getHandleMemento(StringBuffer buff, boolean serializeParent, boolean serializeChild) {
- if (serializeParent)
+ if (serializeParent)
((JavaElement)getParent()).getHandleMemento(buff);
appendEscapedDelimiter(buff, getHandleMementoDelimiter());
appendEscapedDelimiter(buff, JEM_STRING);
@@ -208,13 +208,13 @@ public class LambdaExpression extends SourceType {
if (serializeChild)
this.lambdaMethod.getHandleMemento(buff, false);
}
-
+
@Override
public IJavaElement getHandleFromMemento(String token, MementoTokenizer memento, WorkingCopyOwner workingCopyOwner) {
if (token.charAt(0) != JEM_LAMBDA_METHOD)
return null;
-
+
// ----
if (!memento.hasMoreTokens()) return this;
String selector = memento.nextToken();
@@ -249,7 +249,7 @@ public class LambdaExpression extends SourceType {
return this.lambdaMethod.getHandleFromMemento(memento, workingCopyOwner);
case JEM_LAMBDA_EXPRESSION:
default:
- return this;
+ return this;
}
}
@@ -262,7 +262,7 @@ public class LambdaExpression extends SourceType {
public boolean isLocal() {
return true;
}
-
+
@Override
public JavaElement resolved(Binding binding) {
ResolvedLambdaExpression resolvedHandle = new ResolvedLambdaExpression(this.parent, this, new String(binding.computeUniqueKey()));
@@ -272,7 +272,7 @@ public class LambdaExpression extends SourceType {
public IMethod getMethod() {
return this.lambdaMethod;
}
-
+
@Override
public boolean isLambda() {
return true;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/LambdaFactory.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/LambdaFactory.java
index e2536b189..0447bd6f0 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/LambdaFactory.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/LambdaFactory.java
@@ -90,7 +90,7 @@ public class LambdaFactory {
info.setExceptionTypeNames(CharOperation.NO_CHAR_CHAR);
info.arguments = null; // will be updated shortly, parent has to come into existence first.
- return isBinary ? new BinaryLambdaMethod(parent, selector, key, sourceStart, parameterTypes, parameterNames, returnType, info) :
+ return isBinary ? new BinaryLambdaMethod(parent, selector, key, sourceStart, parameterTypes, parameterNames, returnType, info) :
new LambdaMethod(parent, selector, key, sourceStart, parameterTypes, parameterNames, returnType, info);
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/LambdaMethod.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/LambdaMethod.java
index a71d8af00..aa6742ee3 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/LambdaMethod.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/LambdaMethod.java
@@ -29,7 +29,7 @@ public class LambdaMethod extends SourceMethod {
private String returnTypeString;
SourceMethodElementInfo elementInfo;
private String key;
-
+
LambdaMethod(JavaElement parent, String name, String key, int sourceStart, String [] parameterTypes, String [] parameterNames, String returnType, SourceMethodElementInfo elementInfo) {
super(parent, name, parameterTypes);
this.sourceStart = sourceStart;
@@ -38,7 +38,7 @@ public class LambdaMethod extends SourceMethod {
this.elementInfo = elementInfo;
this.key = key;
}
-
+
/**
* @see IMethod
*/
@@ -60,12 +60,12 @@ public class LambdaMethod extends SourceMethod {
public boolean isLambdaMethod() {
return true;
}
-
+
@Override
protected void closing(Object info) {
// nothing to do.
}
-
+
@Override
public boolean equals(Object o) {
if (!(o instanceof LambdaMethod)) return false;
@@ -77,7 +77,7 @@ public class LambdaMethod extends SourceMethod {
public Object getElementInfo(IProgressMonitor monitor) throws JavaModelException {
return this.elementInfo;
}
-
+
public void getHandleMemento(StringBuffer buff, boolean serializeParent) {
if (serializeParent) {
((LambdaExpression) getParent()).getHandleMemento(buff, true, false);
@@ -108,27 +108,27 @@ public class LambdaMethod extends SourceMethod {
// lambda method and lambda expression cannot share the same memento - add a trailing discriminator.
appendEscapedDelimiter(buff, getHandleMementoDelimiter());
}
-
+
@Override
protected char getHandleMementoDelimiter() {
return JavaElement.JEM_LAMBDA_METHOD;
}
-
+
@Override
public String getKey() {
return this.key;
}
-
+
@Override
public int hashCode() {
return Util.combineHashCodes(super.hashCode(), this.sourceStart);
}
-
+
@Override
public boolean isResolved() {
return true; // we maintain enough information so as not to need another layer of abstraction.
}
-
+
@Override
public JavaElement resolved(Binding binding) {
return this;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/LocalVariable.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/LocalVariable.java
index 5fab35006..f5b41531f 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/LocalVariable.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/LocalVariable.java
@@ -41,7 +41,7 @@ import org.eclipse.jdt.internal.core.util.Util;
public class LocalVariable extends SourceRefElement implements ILocalVariable {
public static final ILocalVariable[] NO_LOCAL_VARIABLES = new ILocalVariable[0];
-
+
String name;
public int declarationSourceStart, declarationSourceEnd;
public int nameStart, nameEnd;
@@ -86,7 +86,7 @@ public class LocalVariable extends SourceRefElement implements ILocalVariable {
int flags,
boolean isParameter,
org.eclipse.jdt.internal.compiler.ast.Annotation[][] astAnnotationsOnDimensions) {
-
+
this(parent, name, declarationSourceStart, declarationSourceEnd, nameStart,
nameEnd, typeSignature, astAnnotations, flags, isParameter);
@@ -281,9 +281,9 @@ public class LocalVariable extends SourceRefElement implements ILocalVariable {
protected void getHandleMemento(StringBuffer buff) {
getHandleMemento(buff, true);
}
-
+
protected void getHandleMemento(StringBuffer buff, boolean memoizeParent) {
- if (memoizeParent)
+ if (memoizeParent)
((JavaElement)getParent()).getHandleMemento(buff);
buff.append(getHandleMementoDelimiter());
buff.append(this.name);
@@ -316,7 +316,7 @@ public class LocalVariable extends SourceRefElement implements ILocalVariable {
public IResource getCorrespondingResource() {
return null;
}
-
+
/**
* {@inheritDoc}
* @since 3.7
@@ -477,7 +477,7 @@ public class LocalVariable extends SourceRefElement implements ILocalVariable {
public int hashCode() {
return Util.combineHashCodes(this.parent.hashCode(), this.nameStart);
}
-
+
/**
* {@inheritDoc}
* @since 3.7
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Member.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Member.java
index 1abf0024b..5c2e24724 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Member.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Member.java
@@ -185,17 +185,17 @@ public IJavaElement getHandleFromMemento(String token, MementoTokenizer memento,
return this;
if (!memento.hasMoreTokens()) return this;
String interphase = memento.nextToken();
- if (!memento.hasMoreTokens() || memento.nextToken() != MementoTokenizer.COUNT)
+ if (!memento.hasMoreTokens() || memento.nextToken() != MementoTokenizer.COUNT)
return this;
int sourceStart = Integer.parseInt(memento.nextToken());
- if (!memento.hasMoreTokens() || memento.nextToken() != MementoTokenizer.COUNT)
+ if (!memento.hasMoreTokens() || memento.nextToken() != MementoTokenizer.COUNT)
return this;
int sourceEnd = Integer.parseInt(memento.nextToken());
- if (!memento.hasMoreTokens() || memento.nextToken() != MementoTokenizer.COUNT)
+ if (!memento.hasMoreTokens() || memento.nextToken() != MementoTokenizer.COUNT)
return this;
int arrowPosition = Integer.parseInt(memento.nextToken());
LambdaExpression expression = LambdaFactory.createLambdaExpression(this, interphase, sourceStart, sourceEnd, arrowPosition);
- if (!memento.hasMoreTokens() || (token = memento.nextToken()) != MementoTokenizer.LAMBDA_METHOD)
+ if (!memento.hasMoreTokens() || (token = memento.nextToken()) != MementoTokenizer.LAMBDA_METHOD)
return expression;
return expression.getHandleFromMemento(token, memento, workingCopyOwner);
case JEM_TYPE:
@@ -389,7 +389,7 @@ protected boolean isMainMethod(IMethod method) throws JavaModelException {
int flags= method.getFlags();
IType declaringType = null;
if (Flags.isStatic(flags) &&
- (Flags.isPublic(flags) ||
+ (Flags.isPublic(flags) ||
((declaringType = getDeclaringType()) != null && declaringType.isInterface()))) {
String[] paramTypes= method.getParameterTypes();
if (paramTypes.length == 1) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/MemberElementInfo.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/MemberElementInfo.java
index 7fdf13edf..a475da62a 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/MemberElementInfo.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/MemberElementInfo.java
@@ -40,7 +40,7 @@ package org.eclipse.jdt.internal.core;
public int getNameSourceStart() {
return -1;
}
-
+
/**
* @see org.eclipse.jdt.internal.compiler.env.IGenericType#getModifiers()
* @see org.eclipse.jdt.internal.compiler.env.IGenericMethod#getModifiers()
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModularClassFile.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModularClassFile.java
index 9928ec4a1..14addc395 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModularClassFile.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModularClassFile.java
@@ -43,7 +43,7 @@ public class ModularClassFile extends AbstractClassFile implements IModularClass
}
/**
- * Creates the single child element for this class file adding the resulting
+ * Creates the single child element for this class file adding the resulting
* new handle (of type {@link IBinaryModule}) and info object to the newElements table.
* Returns true if successful, or false if an error is encountered parsing the class file.
*
@@ -59,8 +59,8 @@ public class ModularClassFile extends AbstractClassFile implements IModularClass
info.setChildren(JavaElement.NO_ELEMENTS);
return false;
}
-
- // Create & link a handle:
+
+ // Create & link a handle:
BinaryModule module = new BinaryModule(this, moduleInfo);
newElements.put(module, moduleInfo);
info.setChildren(new IJavaElement[] {module});
@@ -103,17 +103,17 @@ public class ModularClassFile extends AbstractClassFile implements IModularClass
public IType findPrimaryType() {
return null;
}
-
+
@Override
public boolean isClass() throws JavaModelException {
return false;
}
-
+
@Override
public boolean isInterface() throws JavaModelException {
return false;
}
-
+
@Override
public IType getType() {
throw new UnsupportedOperationException("IClassFile#getType() cannot be used on an IModularClassFile"); //$NON-NLS-1$
@@ -154,10 +154,10 @@ public class ModularClassFile extends AbstractClassFile implements IModularClass
}
}
}
-
+
private IBinaryModule getJarBinaryModuleInfo() throws CoreException, IOException, ClassFormatException {
BinaryModuleDescriptor descriptor = BinaryModuleFactory.createDescriptor(this);
-
+
if (descriptor == null) {
return null;
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Module.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Module.java
index 73cbf39e4..9fd6fa1d4 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Module.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Module.java
@@ -41,7 +41,7 @@ package org.eclipse.jdt.internal.core;
// }
// @Override
// public IModuleDeclaration getDeclaration() {
-// //
+// //
// if (this.declaration == null) {
// try {
// if (this.isBinary) {
@@ -56,9 +56,9 @@ package org.eclipse.jdt.internal.core;
// }
// return this.declaration;
// }
-//
+//
// public String toString() {
// return new String(this.name());
-//
+//
// }
//}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModuleDescriptionInfo.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModuleDescriptionInfo.java
index cead80ab7..9795cfeeb 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModuleDescriptionInfo.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModuleDescriptionInfo.java
@@ -132,8 +132,8 @@ public class ModuleDescriptionInfo extends AnnotatableInfo implements ISourceMod
mod.requires[i+1].modifiers = refs[i].modifiers;
}
} else {
- mod.requires = CharOperation.equals(module.moduleName, TypeConstants.JAVA_BASE)
- ? NO_REQUIRES
+ mod.requires = CharOperation.equals(module.moduleName, TypeConstants.JAVA_BASE)
+ ? NO_REQUIRES
: new ModuleReferenceInfo[] { getJavaBaseReference() };
}
if (module.exportsCount > 0) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModulePathContainer.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModulePathContainer.java
index b503fe229..f6c05b2d0 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModulePathContainer.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModulePathContainer.java
@@ -64,19 +64,19 @@ public class ModulePathContainer implements IClasspathContainer{
@Override
public String getDescription() {
- //
+ //
return "Module path"; //$NON-NLS-1$
}
@Override
public int getKind() {
- //
+ //
return K_APPLICATION;
}
@Override
public IPath getPath() {
- //
+ //
return new Path(JavaCore.MODULE_PATH_CONTAINER_ID);
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModuleSourcePathManager.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModuleSourcePathManager.java
index 5256cc798..689ad61a0 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModuleSourcePathManager.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModuleSourcePathManager.java
@@ -102,7 +102,7 @@ public class ModuleSourcePathManager {
try {
seekModule(name, false, requestor);
} catch (JavaModelException e) {
- //
+ //
}
IModuleDescription[] modules = requestor.getModules();
if (modules.length > 0) {
@@ -113,7 +113,7 @@ public class ModuleSourcePathManager {
e.printStackTrace();
}
}
- return null;
+ return null;
}
// public IModuleDeclaration[] getModules() {
// if (this.knownModules.size() == 0) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModuleUpdater.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModuleUpdater.java
index 8984f57d8..092f13d07 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModuleUpdater.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModuleUpdater.java
@@ -55,7 +55,7 @@ public class ModuleUpdater {
* Detects any ADD_EXPORTS or ADD_READS classpath attributes, parses the value,
* and collects the resulting module updates.
* @param entry a classpath entry of the current project.
- * @throws JavaModelException
+ * @throws JavaModelException
*/
public void computeModuleUpdates(IClasspathEntry entry) throws JavaModelException {
for (IClasspathAttribute attribute : entry.getExtraAttributes()) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/NameLookup.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/NameLookup.java
index 857d09b04..69a500aca 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/NameLookup.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/NameLookup.java
@@ -1085,7 +1085,7 @@ public class NameLookup implements SuffixConstants {
public boolean isPackage(String[] pkgName, IPackageFragmentRoot[] moduleContext) {
if (moduleContext == null) // includes the case where looking for module UNNAMED or ANY
return isPackage(pkgName);
-
+
for (IPackageFragmentRoot moduleRoot : moduleContext) {
if (moduleRoot.getPackageFragment(String.join(".", pkgName)).exists()) //$NON-NLS-1$
return true;
@@ -1172,16 +1172,16 @@ public class NameLookup implements SuffixConstants {
* @param partialMatch partial name matches qualify when <code>true</code>;
* only exact name matches qualify when <code>false</code>
*/
- public void seekTypes(String pkgName, String name, boolean partialMatch, IJavaElementRequestor requestor,
+ public void seekTypes(String pkgName, String name, boolean partialMatch, IJavaElementRequestor requestor,
int acceptFlags, IPackageFragmentRoot[] moduleContext, String moduleName) {
Selector selector = new Selector(moduleName);
- seekPackageFragments(pkgName, true /*partialMatch*/, selector, moduleContext);
+ seekPackageFragments(pkgName, true /*partialMatch*/, selector, moduleContext);
if (selector.pkgFragments.size() == 0) return;
for (IPackageFragment pkg : selector.pkgFragments) {
seekTypes(name, pkg, partialMatch, acceptFlags, requestor);
}
}
-
+
private void seekModuleAwarePartialPackageFragments(String name, IJavaElementRequestor requestor, IPackageFragmentRoot[] moduleContext) {
boolean allPrefixMatch = CharOperation.equals(name.toCharArray(), CharOperation.ALL_PREFIX);
String lName = name.toLowerCase();
@@ -1292,8 +1292,8 @@ public class NameLookup implements SuffixConstants {
}
public void seekModule(char[] name, boolean prefixMatch, IJavaElementRequestor requestor) {
- IPrefixMatcherCharArray prefixMatcher = prefixMatch
- ? CharOperation.equals(name, CharOperation.ALL_PREFIX)
+ IPrefixMatcherCharArray prefixMatcher = prefixMatch
+ ? CharOperation.equals(name, CharOperation.ALL_PREFIX)
? (x, y, isCaseSensitive) -> true
: CharOperation::prefixEquals
: CharOperation::equals;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragment.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragment.java
index 0bf5f9b16..2f5b38752 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragment.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragment.java
@@ -587,7 +587,7 @@ public String getAttachedJavadoc(IProgressMonitor monitor) throws JavaModelExcep
String contents = getURLContents(baseLocation, String.valueOf(pathBuffer));
if (monitor != null && monitor.isCanceled()) throw new OperationCanceledException();
if (contents == null) return null;
-
+
contents = (new JavadocContents(contents)).getPackageDoc();
if (contents == null) contents = ""; //$NON-NLS-1$
synchronized (projectInfo.javadocCache) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ProjectEntry.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ProjectEntry.java
index 7b0447e36..4173c0e62 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ProjectEntry.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ProjectEntry.java
@@ -38,9 +38,9 @@ public class ProjectEntry implements IModulePathEntry {
}
JavaProject project;
-
+
public ProjectEntry(JavaProject project) {
- //
+ //
this.project = project;
}
@Override
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedBinaryType.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedBinaryType.java
index c49a4ecfb..e75550f33 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedBinaryType.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedBinaryType.java
@@ -41,7 +41,7 @@ public class ResolvedBinaryType extends BinaryType {
public String getKey() {
return this.uniqueKey;
}
-
+
@Override
public String getKey(boolean forceOpen) throws JavaModelException {
return this.uniqueKey;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SearchableEnvironment.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SearchableEnvironment.java
index ec2e0476d..1fe4af8f9 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SearchableEnvironment.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SearchableEnvironment.java
@@ -502,7 +502,7 @@ private void findPackagesFromRequires(char[] prefix, boolean isMatchAllPrefix, I
/**
* Must be used only by CompletionEngine.
* The progress monitor is used to be able to cancel completion operations
- *
+ *
* Find the top-level types that are defined
* in the current environment and whose name starts with the
* given prefix. The prefix is a qualified name separated by periods
@@ -518,7 +518,7 @@ private void findPackagesFromRequires(char[] prefix, boolean isMatchAllPrefix, I
* types are found relative to their enclosing type.
*/
public void findTypes(char[] prefix, final boolean findMembers, boolean camelCaseMatch, int searchFor, final ISearchRequestor storage, IProgressMonitor monitor) {
-
+
/*
if (true){
findTypes(new String(prefix), storage, NameLookup.ACCEPT_CLASSES | NameLookup.ACCEPT_INTERFACES);
@@ -605,7 +605,7 @@ private void findPackagesFromRequires(char[] prefix, boolean isMatchAllPrefix, I
storage.acceptType(packageName, simpleTypeName, enclosingTypeNames, modifiers, access);
}
};
-
+
int matchRule = SearchPattern.R_PREFIX_MATCH;
if (camelCaseMatch) matchRule |= SearchPattern.R_CAMELCASE_MATCH;
if (monitor != null) {
@@ -678,11 +678,11 @@ private void findPackagesFromRequires(char[] prefix, boolean isMatchAllPrefix, I
convertSearchFilterToModelFilter(searchFor));
}
}
-
+
/**
* Must be used only by CompletionEngine.
* The progress monitor is used to be able to cancel completion operations
- *
+ *
* Find constructor declarations that are defined
* in the current environment and whose name starts with the
* given prefix. The prefix is a qualified name separated by periods
@@ -699,7 +699,7 @@ private void findPackagesFromRequires(char[] prefix, boolean isMatchAllPrefix, I
} else {
excludePath = null;
}
-
+
int lastDotIndex = CharOperation.lastIndexOf('.', prefix);
char[] qualification, simpleName;
if (lastDotIndex < 0) {
@@ -755,7 +755,7 @@ private void findPackagesFromRequires(char[] prefix, boolean isMatchAllPrefix, I
// implements interface method
}
};
-
+
IRestrictedAccessConstructorRequestor constructorRequestor = new IRestrictedAccessConstructorRequestor() {
@Override
public void acceptConstructor(
@@ -772,14 +772,14 @@ private void findPackagesFromRequires(char[] prefix, boolean isMatchAllPrefix, I
AccessRestriction access) {
if (excludePath != null && excludePath.equals(path))
return;
-
+
storage.acceptConstructor(
modifiers,
simpleTypeName,
parameterCount,
signature,
parameterTypes,
- parameterNames,
+ parameterNames,
typeModifiers,
packageName,
extraFlags,
@@ -787,7 +787,7 @@ private void findPackagesFromRequires(char[] prefix, boolean isMatchAllPrefix, I
access);
}
};
-
+
int matchRule = SearchPattern.R_PREFIX_MATCH;
if (camelCaseMatch) matchRule |= SearchPattern.R_CAMELCASE_MATCH;
if (monitor != null) {
@@ -818,7 +818,7 @@ private void findPackagesFromRequires(char[] prefix, boolean isMatchAllPrefix, I
public String getJobFamily() {
return ""; //$NON-NLS-1$
}
-
+
}, IJob.WaitUntilReady, monitor);
new BasicSearchEngine(this.workingCopies).searchAllConstructorDeclarations(
qualification,
@@ -907,7 +907,7 @@ private void findPackagesFromRequires(char[] prefix, boolean isMatchAllPrefix, I
return null;
case Unnamed:
case Any:
- // if in pre-9 mode we may still search the unnamed module
+ // if in pre-9 mode we may still search the unnamed module
if (this.knownModuleLocations == null) {
if ((this.owner != null && this.owner.isPackage(pkgName))
|| this.nameLookup.isPackage(pkgName))
@@ -958,7 +958,7 @@ private void findPackagesFromRequires(char[] prefix, boolean isMatchAllPrefix, I
return false;
case Unnamed:
case Any:
- // if in pre-9 mode we may still search the unnamed module
+ // if in pre-9 mode we may still search the unnamed module
if (this.knownModuleLocations == null) {
if (this.nameLookup.hasCompilationUnit(pkgName, null))
return true;
@@ -1103,7 +1103,7 @@ private void findPackagesFromRequires(char[] prefix, boolean isMatchAllPrefix, I
result.add(root);
}
}
- }
+ }
}
if (!result.isEmpty())
return result.toArray(new IPackageFragmentRoot[result.size()]);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SelectionRequestor.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SelectionRequestor.java
index 79b0bf850..e402b9935 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SelectionRequestor.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SelectionRequestor.java
@@ -475,7 +475,7 @@ public void acceptLocalVariable(LocalVariableBinding binding, org.eclipse.jdt.in
HashSet existingElements = new HashSet();
HashMap knownScopes = new HashMap();
parent = this.handleFactory.createElement(binding.declaringScope, local.sourceStart, (ICompilationUnit) unit, existingElements, knownScopes);
- } else {
+ } else {
parent = findLocalElement(local.sourceStart, binding.declaringScope.methodScope()); // findLocalElement() cannot find local variable
}
LocalVariable localVar = null;
@@ -991,7 +991,7 @@ protected IJavaElement findLocalElement(int pos, MethodScope scope) {
/**
* This method returns an IMethod element from the given method and declaring type bindings. However,
- * unlike {@link Util#findMethod(IType, char[], String[], boolean)} , this does not require an IType to get
+ * unlike {@link Util#findMethod(IType, char[], String[], boolean)} , this does not require an IType to get
* the IMethod element.
* @param method the given method binding
* @param signatures the type signatures of the method arguments
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SetClasspathOperation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SetClasspathOperation.java
index 5956c85f6..bdd12aed2 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SetClasspathOperation.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SetClasspathOperation.java
@@ -45,7 +45,7 @@ public class SetClasspathOperation extends ChangeClasspathOperation {
this(project, newRawClasspath, null, newOutputLocation, canChangeResource);
}
-
+
/**
* When executed, this operation sets the raw classpath and output location of the given project.
*/
@@ -84,7 +84,7 @@ public class SetClasspathOperation extends ChangeClasspathOperation {
done();
}
}
-
+
@Override
protected ISchedulingRule getSchedulingRule() {
if (this.canChangeResources) {
@@ -92,7 +92,7 @@ public class SetClasspathOperation extends ChangeClasspathOperation {
return new MultiRule(new ISchedulingRule[] {
// use project modification rule as this is needed to create the .classpath file if it doesn't exist yet, or to update project references
ruleFactory.modifyRule(this.project.getProject()),
-
+
// and external project modification rule in case the external folders are modified
ruleFactory.modifyRule(JavaModelManager.getExternalManager().getExternalFoldersProject())
});
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SingleTypeRequestor.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SingleTypeRequestor.java
index 0b3544a7f..5d8e499a1 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SingleTypeRequestor.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SingleTypeRequestor.java
@@ -62,7 +62,7 @@ public void acceptMethod(IMethod method) {
*/
@Override
public void acceptModule(IModuleDescription module) {
- // implements interface method
+ // implements interface method
}
/**
* @see IJavaElementRequestor
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceConstructorWithChildrenInfo.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceConstructorWithChildrenInfo.java
index fdb490681..c5a09621a 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceConstructorWithChildrenInfo.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceConstructorWithChildrenInfo.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
*******************************************************************************/
@@ -18,7 +18,7 @@ import org.eclipse.jdt.core.IJavaElement;
public class SourceConstructorWithChildrenInfo extends SourceConstructorInfo {
protected IJavaElement[] children;
-
+
public SourceConstructorWithChildrenInfo(IJavaElement[] children) {
this.children = children;
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceFieldWithChildrenInfo.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceFieldWithChildrenInfo.java
index a6397acc0..7a3049d00 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceFieldWithChildrenInfo.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceFieldWithChildrenInfo.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
*******************************************************************************/
@@ -18,7 +18,7 @@ import org.eclipse.jdt.core.IJavaElement;
public class SourceFieldWithChildrenInfo extends SourceFieldElementInfo {
protected IJavaElement[] children;
-
+
public SourceFieldWithChildrenInfo(IJavaElement[] children) {
this.children = children;
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMapper.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMapper.java
index f0a368cb0..56db33fa6 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMapper.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMapper.java
@@ -76,7 +76,7 @@ import org.eclipse.jdt.internal.core.util.ReferenceInfoAdapter;
/**
* A SourceMapper maps source code in a ZIP file to binary types or
- * binary modules in a JAR. The SourceMapper uses the fuzzy parser
+ * binary modules in a JAR. The SourceMapper uses the fuzzy parser
* to identify source fragments in a .java file, and attempts to match
* the source code with children in a binary type.
* Since a module has no children in the Java Model no such matching
@@ -93,7 +93,7 @@ public class SourceMapper
public static class LocalVariableElementKey {
String parent;
String name;
-
+
public LocalVariableElementKey(IJavaElement method, String name) {
StringBuffer buffer = new StringBuffer();
buffer
@@ -201,7 +201,7 @@ public class SourceMapper
* Keys are the special local variable elements, entries are <code>char[][]</code>.
*/
protected HashMap parametersRanges;
-
+
/**
* Set that contains all final local variables.
*/
@@ -263,7 +263,7 @@ public class SourceMapper
SourceRange moduleNameRange;
int moduleDeclarationStart;
int moduleModifiers;
-
+
/**
* Anonymous counter in case we want to map the source of an anonymous class.
*/
@@ -498,12 +498,12 @@ public class SourceMapper
this.containsADefaultPackage = containsADefaultPackage;
this.containsJavaSource = containsJavaSource;
}
-
+
@Override
public FileVisitResult visitPackage(java.nio.file.Path dir, java.nio.file.Path mod, BasicFileAttributes attrs) throws IOException {
return FileVisitResult.CONTINUE;
}
-
+
@Override
public FileVisitResult visitFile(java.nio.file.Path file, java.nio.file.Path mod, BasicFileAttributes attrs) throws IOException {
String entryName = file.toString();
@@ -556,7 +556,7 @@ public class SourceMapper
String complianceLevel = null;
if (Util.isJrt(pkgFragmentRootPath.toOSString())) {
try {
- JrtPackageNamesAdderVisitor jrtPackageNamesAdderVisitor = new JrtPackageNamesAdderVisitor(firstLevelPackageNames,
+ JrtPackageNamesAdderVisitor jrtPackageNamesAdderVisitor = new JrtPackageNamesAdderVisitor(firstLevelPackageNames,
sourceLevel, complianceLevel, containsADefaultPackage, containsJavaSource, root);
org.eclipse.jdt.internal.compiler.util.JRTUtil.walkModuleImage(root.getPath().toFile(), jrtPackageNamesAdderVisitor, JRTUtil.NOTIFY_FILES);
sourceLevel = jrtPackageNamesAdderVisitor.sourceLevel;
@@ -856,14 +856,14 @@ public class SourceMapper
// categories
addCategories(currentType, typeInfo.categories);
}
-
+
@Override
public void enterModule(ModuleInfo moduleInfo) {
this.moduleNameRange =
new SourceRange(moduleInfo.nameSourceStart, moduleInfo.nameSourceEnd - moduleInfo.nameSourceStart + 1);
this.moduleDeclarationStart = moduleInfo.declarationStart;
-
-
+
+
// module type modifiers
this.moduleModifiers = moduleInfo.modifiers;
@@ -1237,7 +1237,7 @@ public class SourceMapper
} catch (CoreException e) {
// Ignore
}
-
+
// try to get the entry
ZipEntry entry = null;
ZipFile zip = null;
@@ -1583,7 +1583,7 @@ public class SourceMapper
}
sourceFileName = ((BinaryType) this.binaryTypeOrModule).sourceFileName(info);
boolean isAnonymousClass = info.isAnonymous();
-
+
char[] fullName = info.getName();
if (isAnonymousClass) {
String eltName = this.binaryTypeOrModule.getParent().getElementName();
@@ -1596,7 +1596,7 @@ public class SourceMapper
}
doFullParse = hasToRetrieveSourceRangesForLocalClass(fullName);
} else {
- sourceFileName = TypeConstants.MODULE_INFO_CLASS_NAME_STRING;
+ sourceFileName = TypeConstants.MODULE_INFO_CLASS_NAME_STRING;
}
parser = new SourceElementParser(this, factory, new CompilerOptions(this.options), doFullParse, true/*optimize string literals*/);
parser.javadocParser.checkDocComment = false; // disable javadoc parsing
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMethodElementInfo.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMethodElementInfo.java
index ffa40ccd8..c9b4c1e2b 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMethodElementInfo.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMethodElementInfo.java
@@ -42,7 +42,7 @@ public abstract class SourceMethodElementInfo extends AnnotatableInfo implements
* For example, Hashtable or java.util.Hashtable.
*/
protected char[][] exceptionTypes;
-
+
protected ILocalVariable[] arguments;
/*
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMethodWithChildrenInfo.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMethodWithChildrenInfo.java
index 082cebfe3..d702e2dbf 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMethodWithChildrenInfo.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMethodWithChildrenInfo.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
*******************************************************************************/
@@ -18,7 +18,7 @@ import org.eclipse.jdt.core.IJavaElement;
public class SourceMethodWithChildrenInfo extends SourceMethodInfo {
protected IJavaElement[] children;
-
+
public SourceMethodWithChildrenInfo(IJavaElement[] children) {
this.children = children;
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceType.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceType.java
index a4328df72..116002781 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceType.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceType.java
@@ -210,7 +210,7 @@ public IType createType(String contents, IJavaElement sibling, boolean force, IP
@Override
public boolean equals(Object o) {
if (!(o instanceof SourceType)) return false;
- if (((SourceType) o).isLambda())
+ if (((SourceType) o).isLambda())
return false;
return super.equals(o);
}
@@ -392,7 +392,7 @@ public IJavaElement getHandleFromMemento(String token, MementoTokenizer memento,
}
//{ObjectTeams: method mappings:
case OTJavaElement.OTEM_METHODMAPPING:
-
+
// kind and flags:
int kind = 0;
int callinKind = 0;
@@ -400,7 +400,7 @@ public IJavaElement getHandleFromMemento(String token, MementoTokenizer memento,
boolean isOverride = false;
boolean isSetter = false;
{
- String bindingKind = memento.nextToken();
+ String bindingKind = memento.nextToken();
switch(bindingKind.charAt(0)) {
case 'a': kind = IOTJavaElement.CALLIN_MAPPING; callinKind = ICallinMapping.KIND_AFTER; break;
case 'b': kind = IOTJavaElement.CALLIN_MAPPING; callinKind = ICallinMapping.KIND_BEFORE; break;
@@ -415,7 +415,7 @@ public IJavaElement getHandleFromMemento(String token, MementoTokenizer memento,
hasSign = bindingKind.charAt(1) == 'l'; // long?
memento.nextToken(); // skip separator
}
-
+
// name (callin only):
String bindingName = null;
if (kind == IOTJavaElement.CALLIN_MAPPING) {
@@ -433,10 +433,10 @@ public IJavaElement getHandleFromMemento(String token, MementoTokenizer memento,
memento.nextToken(); // consume separator OTEM_METHODMAPPING
}
}
-
+
// role method:
MethodData roleMethod = MethodMapping.createMethodData(memento, memento.nextToken());
-
+
// base methods:
List<MethodData> baseMethods = new ArrayList<MethodData>();
if (kind != IOTJavaElement.CALLOUT_TO_FIELD_MAPPING) {
@@ -446,7 +446,7 @@ public IJavaElement getHandleFromMemento(String token, MementoTokenizer memento,
tok = memento.nextToken();
}
}
-
+
// assemble:
IRoleType ottype = (IRoleType) OTModelManager.getOTElement(this);
IMethod corrJavaMethod = getMethod(roleMethod.getSelector(), roleMethod.getArgumentTypes());
@@ -938,7 +938,7 @@ public ITypeHierarchy newTypeHierarchy(IJavaProject project, WorkingCopyOwner ow
@Override
public ITypeHierarchy newTypeHierarchy(IProgressMonitor monitor) throws JavaModelException {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=228845, The new type hierarchy should consider changes in primary
- // working copy.
+ // working copy.
return newTypeHierarchy(DefaultWorkingCopyOwner.PRIMARY, monitor);
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceTypeElementInfo.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceTypeElementInfo.java
index dbfc83301..f199b06a2 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceTypeElementInfo.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceTypeElementInfo.java
@@ -36,7 +36,7 @@ public class SourceTypeElementInfo extends AnnotatableInfo implements ISourceTyp
protected static final SourceType[] NO_TYPES = new SourceType[0];
protected IJavaElement[] children = JavaElement.NO_ELEMENTS;
-
+
/**
* The name of the superclass for this type. This name
* is fully qualified for binary types and is NOT always
@@ -45,7 +45,7 @@ public class SourceTypeElementInfo extends AnnotatableInfo implements ISourceTyp
protected char[] superclassName;
//{ObjectTeams: addition: baseclass reference
/**
- * The name of the baseclass for this (role) type, if any.
+ * The name of the baseclass for this (role) type, if any.
* This name is fully qualified for binary types and is NOT
* fully qualified for source types.
*/
@@ -54,7 +54,7 @@ public class SourceTypeElementInfo extends AnnotatableInfo implements ISourceTyp
public char[] getBaseclassName() {
return this.baseclassName;
}
-
+
protected void setBaseclassName(char[] baseclassName) {
this.baseclassName = baseclassName;
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/TypeParameter.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/TypeParameter.java
index 42687792d..42145ac8c 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/TypeParameter.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/TypeParameter.java
@@ -46,28 +46,28 @@ public class TypeParameter extends SourceRefElement implements ITypeParameter {
TypeParameterElementInfo info = (TypeParameterElementInfo) getElementInfo();
return CharOperation.toStrings(info.bounds);
}
-
+
@Override
public String[] getBoundsSignatures() throws JavaModelException {
-
+
String[] boundSignatures = null;
TypeParameterElementInfo info = (TypeParameterElementInfo) this.getElementInfo();
-
+
// For a binary type or method, the signature is already available from the .class file.
// No need to construct again
if (this.parent instanceof BinaryMember) {
char[][] boundsSignatures = info.boundsSignatures;
if (boundsSignatures == null || boundsSignatures.length == 0) {
- return CharOperation.NO_STRINGS;
+ return CharOperation.NO_STRINGS;
}
return CharOperation.toStrings(info.boundsSignatures);
}
-
+
char[][] bounds = info.bounds;
if (bounds == null || bounds.length == 0) {
return CharOperation.NO_STRINGS;
}
-
+
int boundsLength = bounds.length;
boundSignatures = new String[boundsLength];
for (int i = 0; i < boundsLength; i++) {
@@ -75,7 +75,7 @@ public class TypeParameter extends SourceRefElement implements ITypeParameter {
}
return boundSignatures;
}
-
+
@Override
public IMember getDeclaringMember() {
return (IMember) getParent();
@@ -95,18 +95,18 @@ public class TypeParameter extends SourceRefElement implements ITypeParameter {
protected char getHandleMementoDelimiter() {
return JavaElement.JEM_TYPE_PARAMETER;
}
-
+
public String getKey(boolean forceOpen) throws JavaModelException {
StringBuilder buf = new StringBuilder();
if (this.parent instanceof IType) {
if (this.parent instanceof BinaryType)
buf.append(((BinaryType) this.parent).getKey(forceOpen));
- else
+ else
buf.append(((IType) this.parent).getKey());
} else if (this.parent instanceof IMember) {
if (this.parent instanceof BinaryMember)
buf.append(((BinaryMember) this.parent).getKey(forceOpen));
- else
+ else
buf.append(((IMethod) this.parent).getKey());
}
buf.append(":T"); //$NON-NLS-1$
@@ -151,7 +151,7 @@ public class TypeParameter extends SourceRefElement implements ITypeParameter {
public IClassFile getClassFile() {
return ((JavaElement)getParent()).getClassFile();
}
-
+
/**
* {@inheritDoc}
* @since 3.7
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/TypeParameterElementInfo.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/TypeParameterElementInfo.java
index f45a306aa..8f1f0930d 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/TypeParameterElementInfo.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/TypeParameterElementInfo.java
@@ -31,9 +31,9 @@ public class TypeParameterElementInfo extends SourceRefElementInfo {
* The bounds names of this type parameter.
*/
public char[][] bounds;
-
+
/*
- * The bounds' signatures for this type parameter.
+ * The bounds' signatures for this type parameter.
*/
public char[][] boundsSignatures;
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/TypeVector.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/TypeVector.java
index fe63810bc..5c660dba9 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/TypeVector.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/TypeVector.java
@@ -26,7 +26,7 @@ public final class TypeVector {
int maxSize;
IType[] elements;
/**
- * {@link HashMap} that contains the same elements as the {@link #elements}. Used to speed up {@link #contains}
+ * {@link HashMap} that contains the same elements as the {@link #elements}. Used to speed up {@link #contains}
* for large lists. It is lazily constructed the first time it is needed for vectors larger than
* {@link #MIN_ELEMENTS_FOR_HASHSET}. Set to null if not constructed yet. The keys and values are the same
*/
@@ -79,13 +79,13 @@ public boolean contains(IType element) {
return this.elementSet.containsKey(element);
}
- for (int i = this.size; --i >= 0;)
+ for (int i = this.size; --i >= 0;)
if (element.equals(this.elements[i]))
return true;
return false;
}
/**
- *
+ *
*/
private void constructElementSetIfNecessary() {
if (this.elementSet == null && this.size >= MIN_ELEMENTS_FOR_HASHSET) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/UserLibrary.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/UserLibrary.java
index 6666c148b..ebcdc4c4d 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/UserLibrary.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/UserLibrary.java
@@ -177,7 +177,7 @@ public class UserLibrary {
String pathString = element.getAttribute(TAG_PATH);
String sourceAttachString = element.hasAttribute(TAG_SOURCEATTACHMENT) ? element.getAttribute(TAG_SOURCEATTACHMENT) : null;
String sourceAttachRootString = element.hasAttribute(TAG_SOURCEATTACHMENTROOT) ? element.getAttribute(TAG_SOURCEATTACHMENTROOT) : null;
- IPath entryPath = null;
+ IPath entryPath = null;
IPath sourceAttachPath = null;
IPath sourceAttachRootPath = null;
if (version.equals(VERSION_ONE)) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/UserLibraryManager.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/UserLibraryManager.java
index 969b6de97..d3bce173e 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/UserLibraryManager.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/UserLibraryManager.java
@@ -153,7 +153,7 @@ public class UserLibraryManager {
} catch (IOException | ClasspathEntry.AssertionFailedException ase) {
Util.log(ase, "Exception while decoding user library '"+ libName +"'."); //$NON-NLS-1$ //$NON-NLS-2$
}
-
+
}
public void removeUserLibrary(String libName) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/AbstractImageBuilder.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/AbstractImageBuilder.java
index 77d6deda0..8b8edff9e 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/AbstractImageBuilder.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/AbstractImageBuilder.java
@@ -726,7 +726,7 @@ protected void storeProblemsFor(SourceFile sourceFile, CategorizedProblem[] prob
// we may use a different resource for certain problems such as IProblem.MissingNonNullByDefaultAnnotationOnPackage
// but at the start of the next problem we should reset it to the source file's resource
IResource resource = sourceFile.resource;
-
+
// handle buildpath problems (missing classfile, unresolved add-reads...)
String buildPathProblemMessage = null;
if (id == IProblem.IsClassPathCorrect) {
@@ -771,7 +771,7 @@ protected void storeProblemsFor(SourceFile sourceFile, CategorizedProblem[] prob
PackageFragment pkg = null;
if (pkgEnd != -1)
pkg = (PackageFragment) Util.getPackageFragment(sourceFile.getFileName(), pkgEnd, -1 /*no jar separator for java files*/);
-
+
if (pkg != null) {
try {
IMarker[] existingMarkers = pkg.resource().findMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, false, IResource.DEPTH_ZERO);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/BatchImageBuilder.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/BatchImageBuilder.java
index 97a0a0e81..ec2f1f1db 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/BatchImageBuilder.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/BatchImageBuilder.java
@@ -108,7 +108,7 @@ protected void cleanOutputFolders(boolean copyBack) throws CoreException {
if (deleteAll) {
if (this.compilationGroup != CompilationGroup.TEST) {
// CompilationGroup.MAIN is done first, so this notifies the participants only once
- // calling this for CompilationGroup.TEST could cases generated files for CompilationGroup.MAIN to be deleted.
+ // calling this for CompilationGroup.TEST could cases generated files for CompilationGroup.MAIN to be deleted.
if (this.javaBuilder.participants != null)
for (int i = 0, l = this.javaBuilder.participants.length; i < l; i++)
this.javaBuilder.participants[i].cleanStarting(this.javaBuilder.javaProject);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathDirectory.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathDirectory.java
index 1b78beb64..28cda7d03 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathDirectory.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathDirectory.java
@@ -268,7 +268,7 @@ public String debugPathString() {
@Override
public NameEnvironmentAnswer findClass(String typeName, String qualifiedPackageName, String moduleName, String qualifiedBinaryFileName) {
- //
+ //
return findClass(typeName, qualifiedPackageName, moduleName, qualifiedBinaryFileName, false, null);
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJar.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJar.java
index 3df9438f4..365a8ab77 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJar.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJar.java
@@ -252,7 +252,7 @@ public boolean equals(Object o) {
if (!Util.equalOrNull(this.compliance, jar.compliance)) {
return false;
}
- return this.zipFilename.equals(jar.zipFilename)
+ return this.zipFilename.equals(jar.zipFilename)
&& lastModified() == jar.lastModified()
&& this.isOnModulePath == jar.isOnModulePath
&& areAllModuleOptionsEqual(jar);
@@ -293,8 +293,8 @@ public NameEnvironmentAnswer findClass(String binaryFileName, String qualifiedPa
}
if (this.accessRuleSet == null)
return new NameEnvironmentAnswer(reader, null, modName);
- return new NameEnvironmentAnswer(reader,
- this.accessRuleSet.getViolatedRestriction(fileNameWithoutExtension.toCharArray()),
+ return new NameEnvironmentAnswer(reader,
+ this.accessRuleSet.getViolatedRestriction(fileNameWithoutExtension.toCharArray()),
modName);
}
} catch (IOException | ClassFormatException e) { // treat as if class file is missing
@@ -388,7 +388,7 @@ public IModule getModule() {
@Override
public NameEnvironmentAnswer findClass(String typeName, String qualifiedPackageName, String moduleName, String qualifiedBinaryFileName) {
- //
+ //
return findClass(typeName, qualifiedPackageName, moduleName, qualifiedBinaryFileName, false, null);
}
public Manifest getManifest() {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrt.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrt.java
index 197e682e1..c09b30ad8 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrt.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrt.java
@@ -82,7 +82,7 @@ static HashMap<String, SimpleSet> findPackagesInModules(final ClasspathJrt jrt)
PackageCache.put(zipFileName, packagesInModule);
try {
final File imageFile = new File(zipFileName);
- org.eclipse.jdt.internal.compiler.util.JRTUtil.walkModuleImage(imageFile,
+ org.eclipse.jdt.internal.compiler.util.JRTUtil.walkModuleImage(imageFile,
new org.eclipse.jdt.internal.compiler.util.JRTUtil.JrtFileVisitor<Path>() {
SimpleSet packageSet = null;
@Override
@@ -164,7 +164,7 @@ protected String getKey() {
return this.zipFilename;
}
void acceptModule(byte[] content) {
- if (content == null)
+ if (content == null)
return;
ClassFileReader reader = null;
try {
@@ -252,7 +252,7 @@ public int hashCode() {
@Override
public char[][] getModulesDeclaringPackage(String qualifiedPackageName, String moduleName) {
List<String> moduleNames = JRTUtil.getModulesDeclaringPackage(new File(this.zipFilename), qualifiedPackageName, moduleName);
- return CharOperation.toCharArrays(moduleNames);
+ return CharOperation.toCharArrays(moduleNames);
}
@Override
public boolean hasCompilationUnit(String qualifiedPackageName, String moduleName) {
@@ -335,7 +335,7 @@ protected void addRequired(String mod, Set<String> allModules) {
}
@Override
public NameEnvironmentAnswer findClass(String typeName, String qualifiedPackageName, String moduleName, String qualifiedBinaryFileName) {
- //
+ //
return findClass(typeName, qualifiedPackageName, moduleName, qualifiedBinaryFileName, false, null);
}
/** TEST ONLY */
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrtWithReleaseOption.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrtWithReleaseOption.java
index 5a3dc959f..7220b0e0a 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrtWithReleaseOption.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrtWithReleaseOption.java
@@ -104,16 +104,16 @@ public class ClasspathJrtWithReleaseOption extends ClasspathJrt {
} catch (IOException e) {
this.fs = null;
}
- return false;
+ return false;
}
/*
* Set up the paths where modules and regular classes need to be read. We need to deal with two different kind of
* formats of cy.sym: Post JDK 12: ct.sym -> 9 -> java/ -> lang/* 9-modules -> java.base -> module-info.sig
- *
+ *
* From JDK 12 onward: ct.sym -> 9 -> java.base -> module-info.sig java/ -> lang/* Notably, 1) in JDK 12 modules
* classes and ordinary classes are located in the same location 2) in JDK 12, ordinary classes are found inside
* their respective modules
- *
+ *
*/
protected void initialize() throws CoreException {
this.releaseInHex = Integer.toHexString(Integer.parseInt(this.release)).toUpperCase();
@@ -144,7 +144,7 @@ public class ClasspathJrtWithReleaseOption extends ClasspathJrt {
this.modulePath = modPath;
this.modPathString = this.zipFilename + "|"+ modPath.toString(); //$NON-NLS-1$
}
-
+
if (!Files.exists(this.releasePath.resolve(this.releaseInHex))) {
Exception e = new IllegalArgumentException("release " + this.release + " is not found in the system"); //$NON-NLS-1$//$NON-NLS-2$
throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, e.getMessage(), e));
@@ -299,7 +299,7 @@ public class ClasspathJrtWithReleaseOption extends ClasspathJrt {
inner: if (this.isJRE12Plus) {
if (moduleName != null) {
p = this.fs.getPath(rel, moduleName, qualifiedBinaryFileName);
- }
+ }
else {
try (DirectoryStream<java.nio.file.Path> stream = Files
.newDirectoryStream(this.fs.getPath(rel))) {
@@ -332,7 +332,7 @@ public class ClasspathJrtWithReleaseOption extends ClasspathJrt {
moduleNameFilter);
}
return createAnswer(fileNameWithoutExtension, reader);
- } catch (ClassFormatException | IOException e) {
+ } catch (ClassFormatException | IOException e) {
// treat as if class file is missing
}
return null;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathLocation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathLocation.java
index 436922d72..4cdb930aa 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathLocation.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathLocation.java
@@ -129,9 +129,9 @@ public static ClasspathLocation forBinaryFolder(IContainer binaryFolder, boolean
return new ClasspathDirectory(binaryFolder, isOutputFolder, accessRuleSet, externalAnnotationPath, autoModule);
}
-static ClasspathLocation forLibrary(String libraryPathname,
- long lastModified,
- AccessRuleSet accessRuleSet,
+static ClasspathLocation forLibrary(String libraryPathname,
+ long lastModified,
+ AccessRuleSet accessRuleSet,
IPath annotationsPath,
boolean isOnModulePath,
String compliance) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathMultiDirectory.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathMultiDirectory.java
index b72832d89..8ae5fb01b 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathMultiDirectory.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathMultiDirectory.java
@@ -58,7 +58,7 @@ public boolean equals(Object o) {
// if (this.module != md.module)
// if (this.module == null || !this.module.equals(md.module))
// return false;
- return this.ignoreOptionalProblems == md.ignoreOptionalProblems
+ return this.ignoreOptionalProblems == md.ignoreOptionalProblems
&& this.sourceFolder.equals(md.sourceFolder) && this.binaryFolder.equals(md.binaryFolder)
&& CharOperation.equals(this.inclusionPatterns, md.inclusionPatterns)
&& CharOperation.equals(this.exclusionPatterns, md.exclusionPatterns);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/JavaBuilder.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/JavaBuilder.java
index dc6fce914..307b00c3d 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/JavaBuilder.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/JavaBuilder.java
@@ -281,7 +281,7 @@ private void buildAll() {
BatchImageBuilder testImageBuilder = new BatchImageBuilder(imageBuilder, true, CompilationGroup.TEST);
imageBuilder.build();
if (testImageBuilder.sourceLocations.length > 0) {
- // Note: testImageBuilder *MUST* have a separate output folder, or it will delete the files created by imageBuilder.build()
+ // Note: testImageBuilder *MUST* have a separate output folder, or it will delete the files created by imageBuilder.build()
testImageBuilder.build();
} else {
testImageBuilder.cleanUp();
@@ -538,7 +538,7 @@ private boolean hasJdtCoreSettingsChange(SimpleLookupTable deltas) {
}
private boolean hasClasspathChanged() {
- return hasClasspathChanged(CompilationGroup.MAIN) || hasClasspathChanged(CompilationGroup.TEST);
+ return hasClasspathChanged(CompilationGroup.MAIN) || hasClasspathChanged(CompilationGroup.TEST);
}
private boolean hasClasspathChanged(CompilationGroup compilationGroup) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ModuleEntryProcessor.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ModuleEntryProcessor.java
index 69a77bafa..f26d20d55 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ModuleEntryProcessor.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ModuleEntryProcessor.java
@@ -27,7 +27,7 @@ import org.eclipse.jdt.internal.core.ClasspathEntry;
import org.eclipse.jdt.internal.core.JavaProject;
import org.eclipse.jdt.internal.core.ModuleUpdater;
-/**
+/**
* Collection of functions to process classpath attributes relating to modules (from JEP 261).
* For <code>add-exports</code> and <code>add-reads</code> see {@link ModuleUpdater}.
*/
@@ -100,7 +100,7 @@ class ModuleEntryProcessor {
String extraAttribute = ClasspathEntry.getExtraAttribute(entry, IClasspathAttribute.LIMIT_MODULES);
if (extraAttribute == null)
return null;
-
+
// collect the transitive closure of modules contained in limitSet
return new LinkedHashSet<>(Arrays.asList(extraAttribute.split(","))); //$NON-NLS-1$
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ModuleInfoBuilder.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ModuleInfoBuilder.java
index d987595f9..849fa027b 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ModuleInfoBuilder.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ModuleInfoBuilder.java
@@ -40,7 +40,7 @@ import org.eclipse.jdt.internal.core.ModuleUpdater;
/** Implementation of {@link org.eclipse.jdt.core.JavaCore#compileWithAttributes(IModuleDescription, Map)}. */
public class ModuleInfoBuilder {
-
+
static class BytecodeCollector implements ICompilerRequestor {
byte[] bytes;
@@ -52,14 +52,14 @@ public class ModuleInfoBuilder {
this.bytes = classFiles[0].getBytes();
}
}
-
+
public byte[] compileWithAttributes(IModuleDescription module, Map<String,String> classFileAttributes) throws JavaModelException {
IJavaProject javaProject = module.getJavaProject();
NameEnvironment nameEnvironment = new NameEnvironment(javaProject, CompilationGroup.MAIN);
addModuleUpdates(module, nameEnvironment.moduleUpdater, classFileAttributes);
-
- ClasspathMultiDirectory sourceLocation = getSourceLocation(javaProject, nameEnvironment, module);
+
+ ClasspathMultiDirectory sourceLocation = getSourceLocation(javaProject, nameEnvironment, module);
IFile file = (IFile) module.getCompilationUnit().getCorrespondingResource();
ICompilationUnit[] sourceUnits = { new SourceFile(file, sourceLocation) };
BytecodeCollector collector = new BytecodeCollector();
@@ -95,7 +95,7 @@ public class ModuleInfoBuilder {
private ClasspathMultiDirectory getSourceLocation(IJavaProject javaProject, NameEnvironment nameEnvironment, IModuleDescription module)
throws JavaModelException {
IPackageFragmentRoot root = (IPackageFragmentRoot) module.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT);
- IResource rootResource = root.getCorrespondingResource();
+ IResource rootResource = root.getCorrespondingResource();
for (ClasspathMultiDirectory sourceLocation : nameEnvironment.sourceLocations) {
if (sourceLocation.sourceFolder.equals(rootResource)) {
return sourceLocation;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/NameEnvironment.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/NameEnvironment.java
index d94b9ac09..577b3eed7 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/NameEnvironment.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/NameEnvironment.java
@@ -10,7 +10,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Terry Parker <tparker@google.com>
+ * Terry Parker <tparker@google.com>
* - Contribution for https://bugs.eclipse.org/bugs/show_bug.cgi?id=372418
* - Another problem with inner classes referenced from jars or class folders: "The type ... cannot be resolved"
* Stephan Herrmann - Contribution for
@@ -177,9 +177,9 @@ private void computeClasspathLocations(
bLocation.patchModuleName = patchedModuleName;
} else {
ClasspathLocation sourceLocation = ClasspathLocation.forSourceFolder(
- (IContainer) target,
+ (IContainer) target,
outputFolder,
- entry.fullInclusionPatternChars(),
+ entry.fullInclusionPatternChars(),
entry.fullExclusionPatternChars(),
entry.ignoreOptionalProblems());
if (patchedModule != null) {
@@ -378,7 +378,7 @@ private void computeClasspathLocations(
this.binaryLocations[index++] = (ClasspathLocation) outputFolders.get(i);
for (int i = 0, l = bLocations.size(); i < l; i++)
this.binaryLocations[index++] = (ClasspathLocation) bLocations.get(i);
-
+
if (moduleEntries != null && !moduleEntries.isEmpty())
this.modulePathEntries = moduleEntries;
}
@@ -482,7 +482,7 @@ private NameEnvironmentAnswer findClass(String qualifiedTypeName, char[] typeNam
// if we answer X.java & it no longer defines Y then the binary type looking for Y will think the class path is wrong
// let the recompile loop fix up dependents when the secondary type Y has been deleted from X.java
// Only enclosing type names are present in the additional units table, so strip off inner class specifications
- // when doing the lookup (https://bugs.eclipse.org/372418).
+ // when doing the lookup (https://bugs.eclipse.org/372418).
// Also take care of $ in the name of the class (https://bugs.eclipse.org/377401)
// and prefer name with '$' if unit exists rather than failing to search for nested class (https://bugs.eclipse.org/392727)
SourceFile unit = (SourceFile) this.additionalUnits.get(qualifiedTypeName); // doesn't have file extension
@@ -545,7 +545,7 @@ public NameEnvironmentAnswer findType(char[][] compoundName, char[] moduleName)
if (compoundName != null)
return findClass(
String.valueOf(CharOperation.concatWith(compoundName, '/')),
- compoundName[compoundName.length - 1],
+ compoundName[compoundName.length - 1],
LookupStrategy.get(moduleName),
LookupStrategy.getStringName(moduleName));
return null;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/State.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/State.java
index 15dd1655a..218373da7 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/State.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/State.java
@@ -574,7 +574,7 @@ void write(DataOutputStream out) throws IOException {
out.writeUTF(jar.externalAnnotationPath != null ? jar.externalAnnotationPath : ""); //$NON-NLS-1$
out.writeBoolean(jar.isOnModulePath);
out.writeUTF(jar.compliance == null ? "" : jar.compliance); //$NON-NLS-1$
-
+
} else if (c instanceof ClasspathJrt) {
ClasspathJrt jrt = (ClasspathJrt) c;
out.writeByte(EXTERNAL_JAR);
@@ -616,7 +616,7 @@ void write(DataOutputStream out) throws IOException {
} catch (IOException e) {
// ignore
}
-
+
});
} else {
out.writeInt(0);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyBuilder.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyBuilder.java
index a1c04b842..68baebe8a 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyBuilder.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyBuilder.java
@@ -143,7 +143,7 @@ public abstract class HierarchyBuilder {
IType superclassHandle,
IType[] tsuperclassHandles,
boolean[] arePhantoms,
- IType[] superinterfaceHandles)
+ IType[] superinterfaceHandles)
{
connect(type, typeHandle, superclassHandle, superinterfaceHandles);
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyResolver.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyResolver.java
index d59d59cc5..5bc8ad360 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyResolver.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyResolver.java
@@ -160,7 +160,7 @@ public void accept(ICompilationUnit sourceUnit, AccessRestriction accessRestrict
CompilationResult unitResult = new CompilationResult(sourceUnit, 1, 1, this.options.maxProblemsPerUnit);
CompilationUnitDeclaration parsedUnit = basicParser().dietParse(sourceUnit, unitResult);
this.lookupEnvironment.buildTypeBindings(parsedUnit, accessRestriction);
- this.lookupEnvironment.completeTypeBindings(parsedUnit, true); // work done inside checkAndSetImports()
+ this.lookupEnvironment.completeTypeBindings(parsedUnit, true); // work done inside checkAndSetImports()
} else {
//System.out.println("Cannot accept compilation units inside the HierarchyResolver.");
this.lookupEnvironment.problemReporter.abortDueToInternalError(
@@ -590,11 +590,11 @@ private void rememberAllTypes(CompilationUnitDeclaration parsedUnit, org.eclipse
}
if (!includeLocalTypes || (parsedUnit.localTypes == null && parsedUnit.functionalExpressions == null))
return;
-
+
HandleFactory factory = new HandleFactory();
HashSet existingElements = new HashSet(parsedUnit.localTypeCount + parsedUnit.functionalExpressionsCount);
HashMap knownScopes = new HashMap(parsedUnit.localTypeCount + parsedUnit.functionalExpressionsCount);
-
+
if (parsedUnit.localTypes != null) {
for (int i = 0; i < parsedUnit.localTypeCount; i++) {
LocalTypeBinding localType = parsedUnit.localTypes[i];
@@ -704,7 +704,7 @@ private void reportHierarchy(IType focus, TypeDeclaration focusLocalType, Refere
for (int current = this.typeIndex; current >= 0; current--) {
if (progressMonitor != null && progressMonitor.isCanceled())
throw new OperationCanceledException();
-
+
ReferenceBinding typeBinding = this.typeBindings[current];
// java.lang.Object treated at the end
@@ -730,7 +730,7 @@ private void reportHierarchy(IType focus, TypeDeclaration focusLocalType, Refere
}
if (typeBinding.isSynthInterface())
continue; // don't report synthetic ifc parts
-
+
// prepare additional info to pass to the builder (viz. the OTTypeHierarchies team)
IType[] tsuperClasses = new IType[0];
boolean[] arePhantoms = new boolean[0]; // one flag for each role in tsuperClasses
@@ -797,7 +797,7 @@ private void reset(){
*/
public void resolve(IGenericType suppliedType) {
//{ObjectTeams: conditional setup
-/* orig:
+/* orig:
try {
:giro */
try (Config config = Dependencies.setup(this, null, this.lookupEnvironment, true, false))
@@ -935,10 +935,10 @@ public void resolve(Openable[] openables, HashSet localTypes, IProgressMonitor m
flags,
this.lookupEnvironment.problemReporter,
result);
-
- // We would have got all the necessary local types by now and hence there is no further need
- // to parse the method bodies. Parser.getMethodBodies, which is called latter in this function,
- // will not parse the method statements if ASTNode.HasAllMethodBodies is set.
+
+ // We would have got all the necessary local types by now and hence there is no further need
+ // to parse the method bodies. Parser.getMethodBodies, which is called latter in this function,
+ // will not parse the method statements if ASTNode.HasAllMethodBodies is set.
if (containsLocalType && parsedUnit != null) parsedUnit.bits |= ASTNode.HasAllMethodBodies;
} else {
// create parsed unit from file
@@ -1170,7 +1170,7 @@ private boolean subTypeOfType(ReferenceBinding subType, ReferenceBinding typeBin
// {ObjectTeams: check implicit inheritance:
if (subType.isSourceRole())
for (ReferenceBinding tsuperBinding : subType.roleModel.getTSuperRoleBindings())
- if (subTypeOfType(tsuperBinding, typeBinding))
+ if (subTypeOfType(tsuperBinding, typeBinding))
return true;
// SH}
if (superInterfaces != null) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyType.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyType.java
index 31584a7ae..ec728caa4 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyType.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyType.java
@@ -69,7 +69,7 @@ public int getModifiers() {
public boolean isBinaryType() {
return false;
}
-/**
+/**
* Answer whether the receiver is an anonymous type
*/
public boolean isAnonymous() {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java
index 1f803d59b..8edc58ba9 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java
@@ -673,7 +673,7 @@ private static void legacySearchAllPossibleSubTypes(
type = ((IRoleType)OTModelManager.getOTElement(type)).getTeamJavaType();
queue.add(type.getElementName().toCharArray());
}
-// SH}
+// SH}
try {
while (queue.start <= queue.end) {
subMonitor.setWorkRemaining(Math.max(queue.end - queue.start + 1, 100));
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.java
index be5166f66..6fa76434b 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.java
@@ -364,7 +364,7 @@ public void fireChange() {
System.out.println(" for hierarchy focused on " + ((JavaElement)this.focusType).toStringWithAncestors()); //$NON-NLS-1$
}
}
-
+
for (int i= 0; i < listeners.size(); i++) {
final ITypeHierarchyChangedListener listener= listeners.get(i);
SafeRunner.run(new ISafeRunnable() {
@@ -1030,7 +1030,7 @@ private boolean isAffectedByPackageFragmentRoot(IJavaElementDelta delta, IJavaEl
protected boolean isAffectedByOpenable(IJavaElementDelta delta, IJavaElement element, int eventType) {
if (element instanceof CompilationUnit) {
CompilationUnit cu = (CompilationUnit)element;
- ICompilationUnit focusCU =
+ ICompilationUnit focusCU =
this.focusType != null ? this.focusType.getCompilationUnit() : null;
if (focusCU != null && focusCU.getOwner() != cu.getOwner())
return false;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/BindingKeyParser.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/BindingKeyParser.java
index 8fc649fd1..be908a437 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/BindingKeyParser.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/BindingKeyParser.java
@@ -375,7 +375,7 @@ public class BindingKeyParser {
while (this.index < this.source.length && "0123456789".indexOf(this.source[this.index]) != -1) //$NON-NLS-1$
this.index++;
}
-
+
void skipThrownStart() {
while (this.index < this.source.length && this.source[this.index] == C_THROWN)
this.index++;
@@ -396,12 +396,12 @@ public class BindingKeyParser {
if (this.index < this.source.length && this.source[this.index] == ';')
this.index++;
}
-
+
void skipRankStart() {
if (this.index < this.source.length && this.source[this.index] == '{')
this.index++;
}
-
+
void skipRankEnd() {
if (this.index < this.source.length && this.source[this.index] == '}')
this.index++;
@@ -487,11 +487,11 @@ public class BindingKeyParser {
private Scanner scanner;
private boolean hasTypeName = true;
-
+
private boolean hasModuleName;
private boolean isMalformed;
-
+
private boolean isParsingThrownExceptions = false; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=336451
public BindingKeyParser(BindingKeyParser parser) {
@@ -520,7 +520,7 @@ public class BindingKeyParser {
}
public void consumeCapture18ID(int id, int position) {
- // default is to do nothing
+ // default is to do nothing
}
public void consumeException() {
@@ -614,7 +614,7 @@ public class BindingKeyParser {
public void consumeWildCard(int kind) {
// default is to do nothing
}
-
+
public void consumeWildcardRank(int rank) {
// default is to do nothing
}
@@ -791,7 +791,7 @@ public class BindingKeyParser {
malformedKey();
return;
}
-
+
int start = this.scanner.start;
if (this.scanner.nextToken() == Scanner.TYPE) {
if (!CharOperation.equals(this.scanner.getTokenSource(), new char[] {'i', 'n', 'f', 'o'})) {
@@ -939,9 +939,9 @@ public class BindingKeyParser {
source = this.scanner.getTokenSource();
int id = Integer.parseInt(new String(source));
this.scanner.skipRankEnd(); // }
-
+
consumeCapture18ID(id, position);
-
+
this.scanner.skipTypeEnd();
}
@@ -1118,7 +1118,7 @@ public class BindingKeyParser {
consumeWildcardRank(Integer.parseInt(new String(source)));
this.scanner.skipRankEnd();
}
-
+
private void parseWildcardBound() {
/*
* The call parser.parse() might have a side-effect on the current token type
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/BindingKeyResolver.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/BindingKeyResolver.java
index 722ce5b7f..4b6934ffb 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/BindingKeyResolver.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/BindingKeyResolver.java
@@ -89,7 +89,7 @@ public class BindingKeyResolver extends BindingKeyParser {
}
return this.key;
}
-
+
@Override
public MethodBinding getEnclosingMethod() {
return this.enclosingMethod;
@@ -125,7 +125,7 @@ public class BindingKeyResolver extends BindingKeyParser {
TypeBinding typeBinding;
TypeDeclaration typeDeclaration;
ArrayList types = new ArrayList();
-
+
int wildcardRank;
CompilationUnitDeclaration outerMostParsedUnit;
@@ -630,7 +630,7 @@ public class BindingKeyResolver extends BindingKeyParser {
public void consumeWildcardRank(int aRank) {
this.wildcardRank = aRank;
}
-
+
@Override
public void consumeWildCard(int kind) {
switch (kind) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/BootstrapMethodsAttribute.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/BootstrapMethodsAttribute.java
index 6c60e6040..fcb0f8173 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/BootstrapMethodsAttribute.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/BootstrapMethodsAttribute.java
@@ -47,7 +47,7 @@ public class BootstrapMethodsAttribute extends ClassFileAttribute implements IBo
BootstrapMethodsEntry entry;
for (int i = 0; i < length; i++) {
this.entries[i] = entry = new BootstrapMethodsEntry(classFileBytes, constantPool, offset + readOffset);
- readOffset += 4 + 2 * entry.getBootstrapArguments().length;
+ readOffset += 4 + 2 * entry.getBootstrapArguments().length;
}
} else {
this.entries = NO_ENTRIES;
@@ -61,7 +61,7 @@ public class BootstrapMethodsAttribute extends ClassFileAttribute implements IBo
public IBootstrapMethodsEntry[] getBootstrapMethods() {
return this.entries;
}
-
+
@Override
public int getBootstrapMethodsLength() {
return this.numberOfBootstrapMethods;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/CodeSnippetParsingUtil.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/CodeSnippetParsingUtil.java
index a479c5a1f..7aa80059d 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/CodeSnippetParsingUtil.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/CodeSnippetParsingUtil.java
@@ -41,7 +41,7 @@ public class CodeSnippetParsingUtil {
public RecordedParsingInformation recordedParsingInformation;
public boolean ignoreMethodBodies;
-
+
public CodeSnippetParsingUtil(boolean ignoreMethodBodies) {
this.ignoreMethodBodies = ignoreMethodBodies;
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ConstantPoolEntry2.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ConstantPoolEntry2.java
index ab1df0f1b..9ac57026f 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ConstantPoolEntry2.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ConstantPoolEntry2.java
@@ -26,7 +26,7 @@ public class ConstantPoolEntry2 extends ConstantPoolEntry implements IConstantPo
private int referenceKind;
private int referenceIndex;
private int bootstrapMethodAttributeIndex;
-
+
private int moduleIndex;
private char[] moduleName;
private int packageIndex;
@@ -87,7 +87,7 @@ public class ConstantPoolEntry2 extends ConstantPoolEntry implements IConstantPo
public void setBootstrapMethodAttributeIndex(int bootstrapMethodAttributeIndex) {
this.bootstrapMethodAttributeIndex = bootstrapMethodAttributeIndex;
}
-
+
public void setModuleIndex(int moduleIndex) {
this.moduleIndex = moduleIndex;
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/DOMFinder.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/DOMFinder.java
index 91270b1cb..0e20c8352 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/DOMFinder.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/DOMFinder.java
@@ -258,7 +258,7 @@ public class DOMFinder extends ASTVisitor {
public boolean visit(SingleVariableDeclaration node) {
if (found(node, node.getName()) && this.resolveBinding)
this.foundBinding = node.resolveBinding();
- return true;
+ return true;
}
@Override
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Disassembler.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Disassembler.java
index bc9b455ab..8bb273a84 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Disassembler.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Disassembler.java
@@ -264,7 +264,7 @@ public class Disassembler extends ClassFileBytesDisassembler {
writeNewLine(buffer, lineSeparator, tabNumber + 1);
buffer.append(Messages.disassembler_annotationentryend);
}
-
+
private void disassemble(IExtendedAnnotation extendedAnnotation, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) {
writeNewLine(buffer, lineSeparator, tabNumber + 1);
final int typeIndex = extendedAnnotation.getTypeIndex();
@@ -324,7 +324,7 @@ public class Disassembler extends ClassFileBytesDisassembler {
Integer.toString(extendedAnnotation.getAnnotationTypeIndex()),
}));
break;
-
+
case IExtendedAnnotationConstants.CLASS_TYPE_PARAMETER_BOUND :
case IExtendedAnnotationConstants.METHOD_TYPE_PARAMETER_BOUND :
buffer.append(
@@ -332,7 +332,7 @@ public class Disassembler extends ClassFileBytesDisassembler {
Integer.toString(extendedAnnotation.getTypeParameterIndex()),
Integer.toString(extendedAnnotation.getTypeParameterBoundIndex()),
}));
- break;
+ break;
case IExtendedAnnotationConstants.FIELD :
case IExtendedAnnotationConstants.METHOD_RETURN :
case IExtendedAnnotationConstants.METHOD_RECEIVER :
@@ -378,7 +378,7 @@ public class Disassembler extends ClassFileBytesDisassembler {
Integer.toString(extendedAnnotation.getExceptionTableIndex()),
}));
break;
-
+
case IExtendedAnnotationConstants.INSTANCEOF :
case IExtendedAnnotationConstants.NEW :
case IExtendedAnnotationConstants.CONSTRUCTOR_REFERENCE :
@@ -974,7 +974,7 @@ public class Disassembler extends ClassFileBytesDisassembler {
final int classNameLength = className.length;
final int accessFlags = classFileReader.getAccessFlags();
final boolean isEnum = (accessFlags & IModifierConstants.ACC_ENUM) != 0;
-
+
StringBuffer buffer = new StringBuffer();
ISourceAttribute sourceAttribute = classFileReader.getSourceFileAttribute();
IClassFileAttribute classFileAttribute = Util.getAttribute(classFileReader, IAttributeNamesConstants.SIGNATURE);
@@ -1013,7 +1013,7 @@ public class Disassembler extends ClassFileBytesDisassembler {
}
}
final int lastDotIndexInClassName = CharOperation.lastIndexOf('.', className);
-
+
if (checkMode(mode, WORKING_COPY) && lastDotIndexInClassName != -1) {
// we print a package declaration
buffer.append("package ");//$NON-NLS-1$
@@ -1021,7 +1021,7 @@ public class Disassembler extends ClassFileBytesDisassembler {
buffer.append(';');
writeNewLine(buffer, lineSeparator, 0);
}
-
+
INestMembersAttribute nestMembersAttribute = classFileReader.getNestMembersAttribute();
IInnerClassesAttribute innerClassesAttribute = classFileReader.getInnerClassesAttribute();
IClassFileAttribute runtimeVisibleAnnotationsAttribute = Util.getAttribute(classFileReader, IAttributeNamesConstants.RUNTIME_VISIBLE_ANNOTATIONS);
@@ -1070,7 +1070,7 @@ public class Disassembler extends ClassFileBytesDisassembler {
}
}
}
-
+
final boolean isAnnotation = (accessFlags & IModifierConstants.ACC_ANNOTATION) != 0;
final boolean isModule = (accessFlags & IModifierConstants.ACC_MODULE) != 0;
boolean isInterface = false;
@@ -1092,7 +1092,7 @@ public class Disassembler extends ClassFileBytesDisassembler {
buffer.append("interface "); //$NON-NLS-1$
isInterface = true;
}
-
+
if (checkMode(mode, WORKING_COPY)) {
// we print the simple class name
final int start = lastDotIndexInClassName + 1;
@@ -1104,7 +1104,7 @@ public class Disassembler extends ClassFileBytesDisassembler {
} else if (!isModule) {
buffer.append(className);
}
-
+
char[] superclassName = classFileReader.getSuperclassName();
if (superclassName != null) {
CharOperation.replace(superclassName, '/', '.');
@@ -1307,7 +1307,7 @@ public class Disassembler extends ClassFileBytesDisassembler {
}
}
private void convertModuleNames(StringBuffer buffer, char[] name) {
- buffer.append(CharOperation.replaceOnCopy(CharOperation.replaceOnCopy(name, '$','.'), '/','.'));
+ buffer.append(CharOperation.replaceOnCopy(CharOperation.replaceOnCopy(name, '$','.'), '/','.'));
}
private void disassembleModule(IModulePackagesAttribute modulePackagesAttribute, StringBuffer buffer, String lineSeparator, int tabNumber) {
@@ -1318,7 +1318,7 @@ public class Disassembler extends ClassFileBytesDisassembler {
char[][] names = modulePackagesAttribute.getPackageNames();
for (int i = 0, l = modulePackagesAttribute.getPackagesCount(); i < l; ++i) {
writeNewLine(buffer, lineSeparator, tabNumber + 1);
- convertModuleNames(buffer, names[i]);
+ convertModuleNames(buffer, names[i]);
}
writeNewLine(buffer, lineSeparator, 0);
}
@@ -1328,7 +1328,7 @@ public class Disassembler extends ClassFileBytesDisassembler {
writeNewLine(buffer, lineSeparator, tabNumber);
buffer.append(Messages.disassembler_modulemainclassattributeheader);
writeNewLine(buffer, lineSeparator, tabNumber + 1);
- convertModuleNames(buffer, moduleMainClassAttribute.getMainClassName());
+ convertModuleNames(buffer, moduleMainClassAttribute.getMainClassName());
writeNewLine(buffer, lineSeparator, 0);
}
@@ -1347,10 +1347,10 @@ public class Disassembler extends ClassFileBytesDisassembler {
.append(Messages.disassembler_comma)
.append(Messages.disassembler_space);
}
- convertModuleNames(buffer, implementations[i]);
+ convertModuleNames(buffer, implementations[i]);
}
}
- buffer.append(';');
+ buffer.append(';');
}
private void disassemble(INestHostAttribute nestHostAttribute, StringBuffer buffer, String lineSeparator, int tabNumber) {
@@ -1483,7 +1483,7 @@ public class Disassembler extends ClassFileBytesDisassembler {
buffer.append(isExports ? "exports" : "opens"); //$NON-NLS-1$ //$NON-NLS-2$
buffer.append(Messages.disassembler_space);
convertModuleNames(buffer, iPackageVisibilityInfo.getPackageName());
- char[][] targets = iPackageVisibilityInfo.getTargetModuleNames();
+ char[][] targets = iPackageVisibilityInfo.getTargetModuleNames();
if (targets.length > 0) {
buffer.append(Messages.disassembler_space);
buffer.append( "to"); //$NON-NLS-1$
@@ -1497,14 +1497,14 @@ public class Disassembler extends ClassFileBytesDisassembler {
buffer.append(targets[i]);
}
}
- buffer.append(';');
+ buffer.append(';');
}
private void disassemble(IRequiresInfo iRequiresInfo, StringBuffer buffer, String lineSeparator, int tabNumber) {
buffer.append("requires "); //$NON-NLS-1$
decodeModifiersForModuleRequires(buffer, iRequiresInfo.getRequiresFlags());
buffer.append(iRequiresInfo.getRequiresModuleName());
- buffer.append(';');
+ buffer.append(';');
}
private void disassembleGenericSignature(int mode, StringBuffer buffer, final char[] signature) {
@@ -1720,7 +1720,7 @@ public class Disassembler extends ClassFileBytesDisassembler {
} else if (CharOperation.equals(attribute.getAttributeName(),IAttributeNamesConstants.RUNTIME_VISIBLE_TYPE_ANNOTATIONS)) {
disassemble((IRuntimeVisibleTypeAnnotationsAttribute) attribute, buffer, lineSeparator, tabNumber, mode);
} else if (CharOperation.equals(attribute.getAttributeName(),IAttributeNamesConstants.RUNTIME_INVISIBLE_TYPE_ANNOTATIONS)) {
- disassemble((IRuntimeInvisibleTypeAnnotationsAttribute) attribute, buffer, lineSeparator, tabNumber, mode);
+ disassemble((IRuntimeInvisibleTypeAnnotationsAttribute) attribute, buffer, lineSeparator, tabNumber, mode);
} else if (attribute != lineNumberAttribute
&& attribute != localVariableAttribute
&& attribute != localVariableTypeAttribute) {
@@ -2102,7 +2102,7 @@ public class Disassembler extends ClassFileBytesDisassembler {
}
}
}
-
+
private String getReferenceKind(int referenceKind) {
String message = null;
switch(referenceKind) {
@@ -2471,7 +2471,7 @@ public class Disassembler extends ClassFileBytesDisassembler {
disassemble(i, parameterAnnotations[i], buffer, lineSeparator, tabNumber + 1, mode);
}
}
-
+
private void disassemble(IRuntimeInvisibleTypeAnnotationsAttribute runtimeInvisibleTypeAnnotationsAttribute, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) {
writeNewLine(buffer, lineSeparator, tabNumber + 1);
buffer.append(Messages.disassembler_runtimeinvisibletypeannotationsattributeheader);
@@ -2480,7 +2480,7 @@ public class Disassembler extends ClassFileBytesDisassembler {
disassemble(extendedAnnotations[i], buffer, lineSeparator, tabNumber + 1, mode);
}
}
-
+
private void disassemble(IRuntimeVisibleAnnotationsAttribute runtimeVisibleAnnotationsAttribute, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) {
writeNewLine(buffer, lineSeparator, tabNumber + 1);
buffer.append(Messages.disassembler_runtimevisibleannotationsattributeheader);
@@ -2498,7 +2498,7 @@ public class Disassembler extends ClassFileBytesDisassembler {
disassemble(i, parameterAnnotations[i], buffer, lineSeparator, tabNumber + 1, mode);
}
}
-
+
private void disassemble(IRuntimeVisibleTypeAnnotationsAttribute runtimeVisibleTypeAnnotationsAttribute, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) {
writeNewLine(buffer, lineSeparator, tabNumber + 1);
buffer.append(Messages.disassembler_runtimevisibletypeannotationsattributeheader);
@@ -2939,7 +2939,7 @@ public class Disassembler extends ClassFileBytesDisassembler {
buffer.append(lineSeparator);
dumpTab(tabNumber, buffer);
}
-
+
private String toTypePathString(int[][] typepath) {
StringBuffer buffer = new StringBuffer();
buffer.append('[');
@@ -2970,7 +2970,7 @@ public class Disassembler extends ClassFileBytesDisassembler {
}
}
buffer.append(']');
- return String.valueOf(buffer);
+ return String.valueOf(buffer);
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ExtendedAnnotation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ExtendedAnnotation.java
index 078f80ed6..58b7a53ee 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ExtendedAnnotation.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ExtendedAnnotation.java
@@ -76,7 +76,7 @@ public class ExtendedAnnotation extends ClassFileStruct implements IExtendedAnno
private int parameterIndex;
private int exceptionTableIndex;
private ILocalVariableReferenceInfo[] localVariableTable = NO_LOCAL_VARIABLE_TABLE_ENTRIES;
-
+
/**
* Constructor for ExtendedAnnotation, builds an annotation from the supplied bytestream.
*
@@ -94,7 +94,7 @@ public class ExtendedAnnotation extends ClassFileStruct implements IExtendedAnno
int index = u1At(classFileBytes,0,offset);
this.targetType = index;
this.readOffset = 1;
-
+
readTargetInfo(index, classFileBytes, constantPool, offset);
// Read type_path
@@ -111,7 +111,7 @@ public class ExtendedAnnotation extends ClassFileStruct implements IExtendedAnno
typePathEntry[1] = u1At(classFileBytes, this.readOffset++, offset);
}
}
-
+
// Read annotation
index = u2At(classFileBytes, this.readOffset, offset);
this.typeIndex = index;
@@ -142,7 +142,7 @@ public class ExtendedAnnotation extends ClassFileStruct implements IExtendedAnno
this.annotationTypeIndex = -1;
}
}
-
+
private void readTargetInfo(
int localTargetType,
byte[] classFileBytes,
@@ -167,24 +167,24 @@ public class ExtendedAnnotation extends ClassFileStruct implements IExtendedAnno
this.typeParameterBoundIndex = u1At(classFileBytes, this.readOffset, localOffset);
this.readOffset++;
break;
-
+
case IExtendedAnnotationConstants.FIELD :
case IExtendedAnnotationConstants.METHOD_RETURN :
case IExtendedAnnotationConstants.METHOD_RECEIVER :
// nothing to do, target_info is empty_target
break;
-
+
case IExtendedAnnotationConstants.METHOD_FORMAL_PARAMETER :
this.parameterIndex = u1At(classFileBytes, this.readOffset, localOffset);
this.readOffset++;
break;
-
+
case IExtendedAnnotationConstants.THROWS :
this.annotationTypeIndex = u2At(classFileBytes, this.readOffset, localOffset);
this.readOffset+=2;
break;
-
+
case IExtendedAnnotationConstants.LOCAL_VARIABLE :
case IExtendedAnnotationConstants.RESOURCE_VARIABLE :
int tableLength = u2At(classFileBytes, this.readOffset, localOffset);
@@ -207,11 +207,11 @@ public class ExtendedAnnotation extends ClassFileStruct implements IExtendedAnno
case IExtendedAnnotationConstants.CONSTRUCTOR_REFERENCE :
this.offset = u2At(classFileBytes, this.readOffset, localOffset);
this.readOffset += 2;
- break;
+ break;
case IExtendedAnnotationConstants.CAST :
this.offset = u2At(classFileBytes, this.readOffset, localOffset);
- this.readOffset += 2;
+ this.readOffset += 2;
// read type_argument_index
this.annotationTypeIndex = u1At(classFileBytes, this.readOffset, localOffset);
this.readOffset++;
@@ -258,7 +258,7 @@ public class ExtendedAnnotation extends ClassFileStruct implements IExtendedAnno
public int getTargetType() {
return this.targetType;
}
-
+
@Override
public int getExceptionTableIndex() {
return this.exceptionTableIndex;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/HandleFactory.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/HandleFactory.java
index 0874ed606..afed2c1f9 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/HandleFactory.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/HandleFactory.java
@@ -104,7 +104,7 @@ public class HandleFactory {
String module = null;
String rootPath = this.lastPkgFragmentRoot.getPath().toOSString();
if (org.eclipse.jdt.internal.compiler.util.Util.isJrt(rootPath)) {
- module = resourcePath.substring(separatorIndex + 1,
+ module = resourcePath.substring(separatorIndex + 1,
(separatorIndex = resourcePath.lastIndexOf(IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR)));
}
String classFilePath= resourcePath.substring(separatorIndex + 1);
@@ -240,7 +240,7 @@ public class HandleFactory {
if (scope.isLambdaScope()) {
parentElement = createElement(scope.parent, elementPosition, unit, existingElements, knownScopes);
LambdaExpression expression = (LambdaExpression) scope.originalReferenceContext();
- if (expression.resolvedType != null && expression.resolvedType.isValidBinding() &&
+ if (expression.resolvedType != null && expression.resolvedType.isValidBinding() &&
!(expression.descriptor instanceof ProblemMethodBinding)) { // chain in lambda element only if resolved properly.
//newElement = new org.eclipse.jdt.internal.core.SourceLambdaExpression((JavaElement) parentElement, expression).getMethod();
newElement = LambdaFactory.createLambdaExpression((JavaElement) parentElement, expression).getMethod();
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/HashtableOfArrayToObject.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/HashtableOfArrayToObject.java
index e3984a736..b1a180b1d 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/HashtableOfArrayToObject.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/HashtableOfArrayToObject.java
@@ -100,7 +100,7 @@ public final class HashtableOfArrayToObject implements Cloneable {
}
return -1;
}
-
+
public Object[] getKey(Object[] key, int keyLength) {
int length = this.keyTable.length;
int index = hashCode(key, keyLength) % length;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/MementoTokenizer.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/MementoTokenizer.java
index 1c53ce663..4b376f010 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/MementoTokenizer.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/MementoTokenizer.java
@@ -65,9 +65,9 @@ public class MementoTokenizer {
case JavaElement.JEM_COUNT:
return COUNT;
case JavaElement.JEM_JAVAPROJECT:
- // Also covers JavaElement#JEM_DELIMITER_ESCAPE, in which case,
+ // Also covers JavaElement#JEM_DELIMITER_ESCAPE, in which case,
// we seek ahead by one char and check if it's an escaped delimiter
- // and if that's true, we return that as the token.
+ // and if that's true, we return that as the token.
// Else, we decide that JEM_JAVAPROJECT is the current token.
if (this.index < this.length) {
char nextChar = this.memento[this.index++];
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Messages.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Messages.java
index 1e03e5d1b..989b64b8b 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Messages.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Messages.java
@@ -416,7 +416,7 @@ public final class Messages extends NLS {
public static String disassembler_frame_same_frame;
public static String disassembler_frame_same_locals_1_stack_item;
public static String internal_error;
-
+
public static String disassembler_method_type_ref_getfield;
public static String disassembler_method_type_ref_putfield;
public static String disassembler_method_type_ref_getstatic;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/MethodParametersAttribute.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/MethodParametersAttribute.java
index 8ee67ab6b..7cc80b5d6 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/MethodParametersAttribute.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/MethodParametersAttribute.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Jesper Steen Moeller - initial API and implementation
*******************************************************************************/
@@ -27,15 +27,15 @@ public class MethodParametersAttribute extends ClassFileAttribute implements IMe
private static final char[][] NO_NAMES = new char[0][];
private static final short[] NO_ACCES_FLAGS = new short[0];
-
+
private final int numberOfEntries;
private final char[][] names;
private final short[] accessFlags;
-
+
MethodParametersAttribute(byte[] classFileBytes, IConstantPool constantPool, int offset) throws ClassFormatException {
super(classFileBytes, constantPool, offset);
-
+
final int length = u1At(classFileBytes, 6, offset);
this.numberOfEntries = length;
if (length != 0) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ModuleUtil.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ModuleUtil.java
index cba6c052f..c6268bdec 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ModuleUtil.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ModuleUtil.java
@@ -123,7 +123,7 @@ public class ModuleUtil {
if (units.length != 0) {
String pack = fragment.getElementName();
for (ICompilationUnit iUnit : units) {
- org.eclipse.jdt.internal.compiler.env.ICompilationUnit sourceFile =
+ org.eclipse.jdt.internal.compiler.env.ICompilationUnit sourceFile =
new BasicCompilationUnit(iUnit.getSource().toCharArray(),
CharOperation.splitOn('.', pack.toCharArray()),
iUnit.getPath().toOSString(),
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/NestMembersAttributeEntry.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/NestMembersAttributeEntry.java
index 5456c78f8..7185085a2 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/NestMembersAttributeEntry.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/NestMembersAttributeEntry.java
@@ -43,7 +43,7 @@ public class NestMembersAttributeEntry extends ClassFileStruct implements INestM
public int getNestMemberIndex() {
return this.memberClassNameIndex;
}
-
+
@Override
public String toString() {
return new String(this.memberClassName);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/PublicScanner.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/PublicScanner.java
index e70825689..1ce4e7990 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/PublicScanner.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/PublicScanner.java
@@ -905,14 +905,14 @@ public final int getNextChar(char testedChar1, char testedChar2) {
}
/*
* This method consumes digits as well as underscores if underscores are located between digits
- * @throws InvalidInputException if underscores are not located between digits or if underscores are used in source < 1.7
+ * @throws InvalidInputException if underscores are not located between digits or if underscores are used in source < 1.7
*/
private final void consumeDigits(int radix) throws InvalidInputException {
consumeDigits(radix, false);
}
/*
* This method consumes digits as well as underscores if underscores are located between digits
- * @throws InvalidInputException if underscores are not located between digits or if underscores are used in source < 1.7
+ * @throws InvalidInputException if underscores are not located between digits or if underscores are used in source < 1.7
*/
private final void consumeDigits(int radix, boolean expectingDigitFirst) throws InvalidInputException {
final int USING_UNDERSCORE = 1;
@@ -1432,7 +1432,7 @@ public int getNextToken() throws InvalidInputException {
return TokenNameMINUS_EQUAL;
// FIXME:
if (getNextChar('>'))
- return TokenNameARROW;
+ return TokenNameARROW;
//{ObjectTeams: check for callout binding after '-' tokens
else {
if (test < 0 && this._isOTSource)
@@ -2214,7 +2214,7 @@ public final void jumpOverMethodBody() {
firstClosingBrace = this.currentPosition;
break;
case '\r' :
- if (this.source[this.currentPosition] == '\n')
+ if (this.source[this.currentPosition] == '\n')
this.currentPosition++;
//$FALL-THROUGH$
case '\n' :
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Util.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Util.java
index 2d2910eb9..ff1a749d1 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Util.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Util.java
@@ -955,7 +955,7 @@ public class Util {
if (lineSeparator != null)
return lineSeparator;
}
-
+
// line delimiter in workspace preference
scopeContext= new IScopeContext[] { InstanceScope.INSTANCE };
lineSeparator = Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, null, scopeContext);
@@ -1071,7 +1071,7 @@ public class Util {
/**
* Encode the argument by doubling the '#' if present into the argument value.
- *
+ *
* <p>This stores the encoded argument into the given buffer.</p>
*
* @param argument the given argument
@@ -2784,7 +2784,7 @@ public class Util {
}
return signature;
}
-
+
private static String[] typeSignatures(TypeReference[] types) {
int length = types.length;
String[] typeSignatures = new String[length];
@@ -2894,7 +2894,7 @@ public class Util {
char[] typeName = org.eclipse.jdt.core.Signature.toCharArray(CharOperation.replaceOnCopy(binaryAnnotation.getTypeName(), '/', '.'));
return new Annotation(parent, new String(typeName), memberValuePairName);
}
-
+
public static Object getAnnotationMemberValue(JavaElement parent, MemberValuePair memberValuePair, Object binaryValue) {
if (binaryValue instanceof Constant) {
return getAnnotationMemberValue(memberValuePair, (Constant) binaryValue);
@@ -2983,7 +2983,7 @@ public class Util {
return null;
}
}
-
+
/*
* Creates a member value from the given constant in case of negative numerals,
* and sets the valueKind on the given memberValuePair
@@ -3379,8 +3379,8 @@ public class Util {
}
}
/**
- * Finds the IMethod element corresponding to the given selector,
- * without creating a new dummy instance of a binary method.
+ * Finds the IMethod element corresponding to the given selector,
+ * without creating a new dummy instance of a binary method.
* @param type the type in which the method is declared
* @param selector the method name
* @param paramTypeSignatures the type signatures of the method arguments
@@ -3393,7 +3393,7 @@ public class Util {
int startingIndex = 0;
String[] args;
IType enclosingType = type.getDeclaringType();
- // If the method is a constructor of a non-static inner type, add the enclosing type as an
+ // If the method is a constructor of a non-static inner type, add the enclosing type as an
// additional parameter to the constructor
if (enclosingType != null
&& isConstructor
@@ -3409,7 +3409,7 @@ public class Util {
args[i] = paramTypeSignatures[i-startingIndex];
}
method = type.getMethod(new String(selector), args);
-
+
IMethod[] methods = type.findMethods(method);
if (methods != null && methods.length > 0) {
method = methods[0];
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/ICallinMapping.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/ICallinMapping.java
index 12f7c1838..d63c4ac88 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/ICallinMapping.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/ICallinMapping.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: ICallinMapping.java 23416 2010-02-03 19:59:31Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -29,7 +29,7 @@ import org.eclipse.jdt.core.JavaModelException;
/**
* Specialized form of a IMethodMapping which provides information about
* its kind and direct links to (possible) multiple base methods.
- *
+ *
* @author jwloka
* @version $Id: ICallinMapping.java 23416 2010-02-03 19:59:31Z stephan $
* @noimplement This interface is not intended to be implemented by clients.
@@ -39,16 +39,16 @@ public interface ICallinMapping extends IMethodMapping
public static final int KIND_BEFORE = 1;
public static final int KIND_AFTER = 2;
public static final int KIND_REPLACE = 3;
-
+
/**
* Returns the kind of callin e.g. replace
* @return possible return values are: ICallinMapping.KIND_BEFORE
* ICallinMapping.KIND_AFTER
- * ICallinMapping.KIND_REPLACE
+ * ICallinMapping.KIND_REPLACE
*/
public int getCallinKind();
-
- /**
+
+ /**
* Returns whether at least one of the bound base method is captured including
* overrides with covariant return types (marked as "RT+ bm()")
*/
@@ -58,18 +58,18 @@ public interface ICallinMapping extends IMethodMapping
* Dynamically resolves associated base methods from the JavaModel
* @return all JavaModel base method elements, at least there should
* be one entry
- */
+ */
public IMethod[] getBoundBaseMethods() throws JavaModelException;
/**
* Retrieve a handles for the base methods.
- *
- * @return handles representing the base method specs
+ *
+ * @return handles representing the base method specs
*/
public IMethodSpec[] getBaseMethodHandles();
-
+
/**
- * Returns whether this callin mapping has a 'callin label'. If false,
+ * Returns whether this callin mapping has a 'callin label'. If false,
* getName() will return a generated label.
*/
public boolean hasName();
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/ICalloutMapping.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/ICalloutMapping.java
index 1f38a3232..00f8b76fe 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/ICalloutMapping.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/ICalloutMapping.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: ICalloutMapping.java 23416 2010-02-03 19:59:31Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -29,7 +29,7 @@ import org.eclipse.jdt.core.JavaModelException;
/**
* Specialized form of a IMethodMapping which provides a direct link to
* its base method.
- *
+ *
* @author jwloka
* @version $Id: ICalloutMapping.java 23416 2010-02-03 19:59:31Z stephan $
* @noimplement This interface is not intended to be implemented by clients.
@@ -39,21 +39,21 @@ public interface ICalloutMapping extends IMethodMapping
/**
* Dynamically resolves the associated base method from the JavaModel
* @return a base method JavaModel element
- */
+ */
public IMethod getBoundBaseMethod() throws JavaModelException;
-
+
/**
* Retrieve a handle for the base method.
- *
- * @return handle representing the base method spec
+ *
+ * @return handle representing the base method spec
*/
public IMethodSpec getBaseMethodHandle();
-
+
/**
* Is this a callout-override ('=>')?
*/
public boolean isOverride();
-
+
/** modifiers if they have been specified in source code, otherwise 0. */
public int getDeclaredModifiers();
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/ICalloutToFieldMapping.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/ICalloutToFieldMapping.java
index d4cdb8ec6..9e8cc8185 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/ICalloutToFieldMapping.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/ICalloutToFieldMapping.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: ICalloutToFieldMapping.java 23416 2010-02-03 19:59:31Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -28,7 +28,7 @@ import org.eclipse.jdt.core.JavaModelException;
/**
* Specialized form of an IMethodMapping which provides a direct link to
* its base field.
- *
+ *
* @author brcan
* @noimplement This interface is not intended to be implemented by clients.
*/
@@ -36,18 +36,18 @@ public interface ICalloutToFieldMapping extends IMethodMapping
{
/**
* Dynamically resolves the associated base field from the JavaModel.
- *
+ *
* @return the JavaModel element representing the base field
- */
+ */
public IField getBoundBaseField() throws JavaModelException;
-
+
/**
* Retrieve a handle for the base field.
- *
- * @return handle representing the base field spec
+ *
+ * @return handle representing the base field spec
*/
public IFieldAccessSpec getBaseFieldHandle();
-
+
/**
* Is this a callout-override ('=>')?
*/
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IFieldAccessSpec.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IFieldAccessSpec.java
index 9563bcc2a..34c9542df 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IFieldAccessSpec.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IFieldAccessSpec.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010 GK Software AG
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -20,7 +20,7 @@ package org.eclipse.objectteams.otdt.core;
/**
* Represents a field access spec in a callout-to-field mapping in the extended Java model.
- *
+ *
* @author stephan
* @since 3.7
* @noimplement This interface is not intended to be implemented by clients.
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IMethodMapping.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IMethodMapping.java
index 5d34e748e..2120e13ea 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IMethodMapping.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IMethodMapping.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -28,7 +28,7 @@ import org.eclipse.jdt.core.IMethod;
/**
* OTM Method mapping element
- *
+ *
* @author jwloka
* @noimplement This interface is not intended to be implemented by clients.
*/
@@ -45,45 +45,45 @@ public interface IMethodMapping extends IOTJavaElement, IMember, IAnnotatable
/**
* Dynamically resolves associated role method from the JavaModel
* @return a role method JavaModel element
- */
+ */
public IMethod getRoleMethod();
/**
* Retrieve a handle for the role method.
- * Used by the SelectionRequestor to find out about the role method spec,
+ * Used by the SelectionRequestor to find out about the role method spec,
* if no role method can be resolved (short-hand callout).
- * @return the role-side method spec
+ * @return the role-side method spec
*/
public IMethodSpec getRoleMethodHandle();
-
+
/**
* Returns the start position of the 'name' part of this method mapping.
* For labelled callin mappings it is the label, otherwise the name
* of the role method spec.
*/
public int getSourceStart();
-
+
/**
* Returns the end position of the 'name' part of this method mapping.
* For labelled callin mappings it is the label, otherwise the name
* of the role method spec.
*/
public int getSourceEnd();
-
+
/**
* Returns the start position of this MethodMapping declaration within
- * the CompilationUnit
- * @return start position in characters
- */
+ * the CompilationUnit
+ * @return start position in characters
+ */
public int getDeclarationSourceStart();
/**
* Returns the end position of this MethodMapping declaration within
- * the CompilationUnit
- * @return end position in characters
- */
+ * the CompilationUnit
+ * @return end position in characters
+ */
public int getDeclarationSourceEnd();
-
+
/**
* Is this method mapping a long version with signatures?
* (callout with signature is a candidate for short-hand callout).
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IMethodSpec.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IMethodSpec.java
index c714e1511..558f15a1a 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IMethodSpec.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IMethodSpec.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010 GK Software AG
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -23,7 +23,7 @@ import org.eclipse.jdt.core.ITypeParameter;
/**
* Represents a method spec in a method mapping (callout/callin) in the extended Java model.
- *
+ *
* @author stephan
* @since 3.7
* @noimplement This interface is not intended to be implemented by clients.
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IOTJavaElement.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IOTJavaElement.java
index 4314f7a38..4ad05abf8 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IOTJavaElement.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IOTJavaElement.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: IOTJavaElement.java 23416 2010-02-03 19:59:31Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -34,9 +34,9 @@ import org.eclipse.jdt.core.IJavaElement;
public interface IOTJavaElement extends IJavaElement
{
/** OTElement type identifier for a Team */
-//{OTModelUpdate : types had been defined from 0x01 to 0x04, this doesn't
-// work for the updated model since the result of getType() is in some
-// places interpreted as a JavaElement type
+//{OTModelUpdate : types had been defined from 0x01 to 0x04, this doesn't
+// work for the updated model since the result of getType() is in some
+// places interpreted as a JavaElement type
//orig: public int TEAM = 0x01;
public int TEAM = 100;
@@ -47,18 +47,18 @@ public interface IOTJavaElement extends IJavaElement
/** OTElement type identifier for a Callin Mapping */
//orig: public int CALLIN_MAPPING = 0x03;
public int CALLIN_MAPPING = 102;
-
+
/** OTElement type identifier for a Callout Mapping */
-//orig: public int CALLOUT_MAPPING = 0x04;
+//orig: public int CALLOUT_MAPPING = 0x04;
public int CALLOUT_MAPPING = 103;
-
+
/** OTElement type identifier for a Callout To Field Mapping */
public int CALLOUT_TO_FIELD_MAPPING = 104;
//haebor, gbr}
/**
* Get elements simple name e.g. getElementName() for "my.namespace.MyTeam.MyRole"
- * returns "MyRole"
+ * returns "MyRole"
* @return simple name (unqualified by package or enclosing type)
*/
@Override
@@ -71,13 +71,13 @@ public interface IOTJavaElement extends IJavaElement
*/
@Override
public int getElementType();
-
+
/**
* Returns the corresponding element from the JavaModel.
- *
+ *
* @return linked java element
*/
public IJavaElement getCorrespondingJavaElement();
-
+
public void toString(int tab, StringBuffer buffer);
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IOTType.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IOTType.java
index 53a818dcc..85733f10a 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IOTType.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IOTType.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: IOTType.java 23416 2010-02-03 19:59:31Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -44,7 +44,7 @@ public interface IOTType extends IOTJavaElement, IType
*/
public static final int ROLEFILE = 2;
/**
- * If the given team is also role, traverse its implicit super hierarchy and
+ * If the given team is also role, traverse its implicit super hierarchy and
* include the roles of all implicit super teams
*/
public static final int IMPLICTLY_INHERITED = 4;
@@ -53,7 +53,7 @@ public interface IOTType extends IOTJavaElement, IType
*/
public static final int EXPLICITLY_INHERITED = 8;
/**
- * Only search the roles in the super hierarchy. Must be combined with
+ * Only search the roles in the super hierarchy. Must be combined with
* EXPLICITLY_INHERITED or IMPLICITLY_INHERITED
*/
public static final int EXCLUDE_SELF = 16;
@@ -63,14 +63,14 @@ public interface IOTType extends IOTJavaElement, IType
* INLINED | ROLEFILE | IMPLICTLY_INHERITED | EXPLICITLY_INHERITED;
*/
public static final int ALL = INLINED | ROLEFILE | IMPLICTLY_INHERITED | EXPLICITLY_INHERITED;
-
+
/**
- * Indicates whether this type is a role or not
+ * Indicates whether this type is a role or not
*/
public boolean isRole();
/**
- * Indicates whether this type is a team or not
+ * Indicates whether this type is a team or not
*/
public boolean isTeam();
@@ -78,23 +78,23 @@ public interface IOTType extends IOTJavaElement, IType
* Returns the flags from parsing. These flags provide additional
* information about the type's modifiers e.g. IConstants.AccTeam
* @see Flags
- */
+ */
@Override
public int getFlags();
/**
* Returns all types defined in this type.
- * @return array of IType's or an empty array
+ * @return array of IType's or an empty array
*/
public IType[] getInnerTypes();
-
+
/**
* Returns the role type associated conceptually contained by this team type
* or null.
* @param simpleName - the name of the desired role
*/
public IType getRoleType(String simpleName);
-
+
/**
* Similar to getRoleType(String), but directly use the search engine
* thus avoiding exists() test on a non-existent ROFI type.
@@ -105,22 +105,22 @@ public interface IOTType extends IOTJavaElement, IType
* Returns all role types (inlined and role files) contained by this team.
*/
public IType[] getRoleTypes() throws JavaModelException;
-
+
/**
- * Returns all roles of this team. Either the inlined, the role files or both are
+ * Returns all roles of this team. Either the inlined, the role files or both are
* returned.
* See {@link IOTType#getRoleTypes()} for gathering all role types.
- *
+ *
* @param which an ORed combination of IOTType.INLINED, IOTType.ROLEFILE, IOTType.IMPLICITLY_INHERITED,
* IOTType.EXPLICITLY_INHERITED and IOTType.EXCLUDE_SELF
*/
public IType[] getRoleTypes(int which) throws JavaModelException;
-
+
/**
- * Returns roles named roleName of this team. Either the inlined, the role files or both are
+ * Returns roles named roleName of this team. Either the inlined, the role files or both are
* returned.
* See {@link IOTType#getRoleTypes()} for gathering all role types.
- *
+ *
* @param which an ORed combination of IOTType.INLINED, IOTType.ROLEFILE, IOTType.IMPLICITLY_INHERITED,
* IOTType.EXPLICITLY_INHERITED and IOTType.EXCLUDE_SELF
*/
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IOTTypeHierarchy.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IOTTypeHierarchy.java
index 37a65f795..091e4015f 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IOTTypeHierarchy.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IOTTypeHierarchy.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: IOTTypeHierarchy.java 23416 2010-02-03 19:59:31Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -38,22 +38,22 @@ public interface IOTTypeHierarchy extends ITypeHierarchy
* The default mode is off.
* In phantom mode PhantomTypes may be returned by getXXX() methods.
* In non phantom mode all PhantomTypes are filtered or replaced.
- * @param flag true - sets phantom mode, false - sets non phantom mode
+ * @param flag true - sets phantom mode, false - sets non phantom mode
*/
public void setPhantomMode(boolean flag);
-
+
/**
* Returns wether or not this hierarchy is in phantom mode.
* @return phantom mode
*/
public boolean isPhantomMode();
-
+
/**
* Returns the focus type for which the hierarchy was created.
* @return focus type
*/
public IType getFocusType();
-
+
public IOTTypeHierarchy getOTSuperTypeHierarchy(IType type) throws JavaModelException;
/**
@@ -61,11 +61,11 @@ public interface IOTTypeHierarchy extends ITypeHierarchy
* in no particular order, limited to the types in this
* type hierarchy's graph.
* If the type is a class, this returns the resolved subclasses.
- * If the type is an interface, this returns both the classes which implement
+ * If the type is an interface, this returns both the classes which implement
* the interface and the interfaces which extend it.
* If the type is a role, implicit sub roles are included.
* In phantom mode, sub roles may be PhantomTypes.
- *
+ *
* @param type the given type
* @return the direct resolved subtypes of the given type limited to the
* types in this type hierarchy's graph
@@ -85,29 +85,29 @@ public interface IOTTypeHierarchy extends ITypeHierarchy
*/
public IType[] getAllTSuperTypes(IType type);
-
+
/**
* Returns all implicit subtypes (direct and indirect)
* of the given type, in no particular order, limited to the
* types in this type hierarchy's graph. An empty array
* is returned if there are no resolved subtypes for the
* given type.
- *
+ *
* @param type the given type
* @return all tsubtypes (direct and indirect) of the given type
*/
public IType[] getAllTSubtypes(IType type);
-
+
/**
* Returns the type's explicit superclass.
* For roles the explicit superclass relationship
* is either declared by the role itself,
* or by one of it's implicit superroles.
- *
+ *
* In the latter case, only the 'nearest'
* implicit supertype may contributes it's
* explicit superclass.
- *
+ *
* @return explicit superclass or null
*/
public IType getExplicitSuperclass(IType type);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IPhantomType.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IPhantomType.java
index a91ded9bc..bbb9edf31 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IPhantomType.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IPhantomType.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010 GK Software AG
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -25,7 +25,7 @@ import org.eclipse.jdt.core.IType;
* A phantom role is a role that is inherited from a super team,
* and not overridden in the current team, i.e., the current team
* has no source corresponding to the phantom role.
- *
+ *
* @since 3.7
* @noimplement This interface is not intended to be implemented by clients.
*/
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IRoleFileType.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IRoleFileType.java
index fbc7e01fc..d318bc862 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IRoleFileType.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IRoleFileType.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: IRoleFileType.java 23416 2010-02-03 19:59:31Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IRoleType.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IRoleType.java
index aa2a4bd7f..782da849e 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IRoleType.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/IRoleType.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2009 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: IRoleType.java 23417 2010-02-03 20:13:55Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -39,7 +39,7 @@ public interface IRoleType extends IOTType
* Return role's team
*/
public IOTType getTeam();
-
+
/**
* Return a role's team, use the plain Java representation.
*/
@@ -54,7 +54,7 @@ public interface IRoleType extends IOTType
// Note: powers of 2!
public static int CALLINS = 1;
public static int CALLOUTS = 2;
-
+
/**
* Convenience method returns all method mappings of a given type
* defined in this role
@@ -67,25 +67,25 @@ public interface IRoleType extends IOTType
* Dynamically resolves role's base class declared by "playedBy"
* @throws JavaModelException if resolving fails
* @return associated IType JavaModel element or null if this role doesn't have a bound base class
- */
+ */
public IType getBaseClass() throws JavaModelException;
-
+
public String getBaseclassName();
-
+
/** If the base type is anchored, represent it using '<@..>' */
public String getFullBaseclassName();
-
+
/**
* Returns true if this Role Type is defined in a Role File.
* @return whether the type is a role file
*/
public boolean isRoleFile();
-
+
/**
* Get all tsuper roles of this role.
* If multiple tsuper roles exist (due to team nesting) the resulting array
* will list those first that are induced by inner team inheritance and going out from there.
- *
+ *
* @return an array of tsuper roles or null;
* @throws JavaModelException thrown if some type lookup failed
* @since 1.2.8
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/OTJavaElementDelta.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/OTJavaElementDelta.java
index e37b41f7d..2341bad3a 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/OTJavaElementDelta.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/OTJavaElementDelta.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: OTJavaElementDelta.java 23416 2010-02-03 19:59:31Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -35,7 +35,7 @@ import org.eclipse.jdt.core.dom.CompilationUnit;
* @author Jochen
*
*/
-public class OTJavaElementDelta implements IJavaElementDelta
+public class OTJavaElementDelta implements IJavaElementDelta
{
private IJavaElementDelta delegate;
private Map<IJavaElement,IOTJavaElement> otElemMapping;
@@ -57,59 +57,59 @@ public class OTJavaElementDelta implements IJavaElementDelta
public IJavaElement getElement() {
return maybeTransformElement(this.delegate.getElement());
}
-
+
@Override
public IJavaElementDelta[] getAddedChildren() {
return wrapChildren(this.delegate.getAddedChildren());
}
-
+
@Override
public IJavaElementDelta[] getAffectedChildren() {
return wrapChildren(this.delegate.getAffectedChildren());
}
-
+
@Override
public IJavaElementDelta[] getChangedChildren() {
return wrapChildren(this.delegate.getChangedChildren());
}
-
-
+
+
@Override
public IJavaElement getMovedFromElement() {
return maybeTransformElement(this.delegate.getMovedFromElement());
}
-
+
@Override
public IJavaElement getMovedToElement() {
return maybeTransformElement(this.delegate.getMovedToElement());
}
-
+
@Override
public IJavaElementDelta[] getRemovedChildren() {
return wrapChildren(this.delegate.getRemovedChildren());
}
-
+
@Override
public IJavaElementDelta[] getAnnotationDeltas() {
return wrapChildren(this.delegate.getAnnotationDeltas());
}
-//pure delegates
+//pure delegates
@Override
public IResourceDelta[] getResourceDeltas() {
return this.delegate.getResourceDeltas();
}
-
+
@Override
public String toString() {
return this.delegate.toString();
}
-
+
@Override
public int getFlags() {
return this.delegate.getFlags();
}
-
+
@Override
public int getKind() {
return this.delegate.getKind();
@@ -119,14 +119,14 @@ public class OTJavaElementDelta implements IJavaElementDelta
public CompilationUnit getCompilationUnitAST() {
return this.delegate.getCompilationUnitAST();
}
-
-
+
+
//end of delegates
//helpers
private OTJavaElementDelta[] wrapChildren(IJavaElementDelta[] deltas) {
return wrapDeltas(deltas);
}
-
+
private OTJavaElementDelta[] wrapDeltas(IJavaElementDelta[] deltas) {
OTJavaElementDelta[] result = new OTJavaElementDelta[deltas.length];
for(int idx = 0; idx < deltas.length; idx++)
@@ -134,10 +134,10 @@ public class OTJavaElementDelta implements IJavaElementDelta
return result;
}
-
+
private IJavaElement maybeTransformElement(IJavaElement element) {
if(element instanceof IType) {
- IOTJavaElement otElement =
+ IOTJavaElement otElement =
OTModelManager.getOTElement((IType)element);
if(otElement != null) {
return otElement;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/OTModelManager.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/OTModelManager.java
index 99a60c410..4257d543d 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/OTModelManager.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/OTModelManager.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2016 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany, and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -45,25 +45,25 @@ import org.eclipse.objectteams.otdt.internal.core.util.MethodData;
/**
* Manager provides connection between JavaModel and OTM.
- *
+ *
* @author jwloka
* @version $Id: OTModelManager.java 23416 2010-02-03 19:59:31Z stephan $
*/
public class OTModelManager
{
-
- /**
- * Expose this constant from {@link ExternalJavaProject} for use by other OT plugins.
+
+ /**
+ * Expose this constant from {@link ExternalJavaProject} for use by other OT plugins.
* @since 3.7
*/
public static final String EXTERNAL_PROJECT_NAME = ExternalJavaProject.EXTERNAL_PROJECT_NAME;
private final static OTModel MAPPING = OTModel.getSharedInstance();
-
+
private static OTModelManager singleton;
private OTModelReconcileListener reconcileListener;
-
+
protected OTModelManager()
{
singleton = this;
@@ -71,17 +71,17 @@ public class OTModelManager
this.reconcileListener = new OTModelReconcileListener();
JavaCore.addElementChangedListener(this.reconcileListener, ElementChangedEvent.POST_RECONCILE);
}
-
+
public static OTModelManager getSharedInstance()
{
if (singleton == null)
{
new OTModelManager();
}
-
+
return singleton;
}
-
+
public static void dispose()
{
if (singleton != null)
@@ -89,7 +89,7 @@ public class OTModelManager
JavaCore.removeElementChangedListener(singleton.reconcileListener);
OTModel.dispose();
}
-
+
singleton = null;
}
@@ -99,12 +99,12 @@ public class OTModelManager
}
/**
- * Add the propriate Object Teams Model element for a given IType
+ * Add the propriate Object Teams Model element for a given IType
*/
public IOTType addType(IType elem, int typeDeclFlags, String baseClassName, String baseClassAnchor, boolean isRoleFile)
{
IJavaElement parent = elem.getParent();
- IOTType result = null;
+ IOTType result = null;
while (parent != null) {
switch (parent.getElementType())
@@ -115,21 +115,21 @@ public class OTModelManager
{ // could also be a teeam, which is handled inside the constructor
if (elem.isBinary())
{
- MAPPING.addOTElement( result = new BinaryRoleType(elem,
- parent,
- typeDeclFlags,
+ MAPPING.addOTElement( result = new BinaryRoleType(elem,
+ parent,
+ typeDeclFlags,
baseClassName,
baseClassAnchor));
}
else
{
- MAPPING.addOTElement( result = new RoleFileType(elem,
- parent,
- typeDeclFlags,
+ MAPPING.addOTElement( result = new RoleFileType(elem,
+ parent,
+ typeDeclFlags,
baseClassName,
baseClassAnchor));
}
- }
+ }
else if (TypeHelper.isTeam(typeDeclFlags))
{
MAPPING.addOTElement( result = new OTType(IOTJavaElement.TEAM, elem, null, typeDeclFlags) );
@@ -137,9 +137,9 @@ public class OTModelManager
return result;
case IJavaElement.TYPE:
IType encType = (IType)parent;
- IOTType otmParent = MAPPING.getOTElement(encType);
-
- return maybeAddRoleType(elem, otmParent, typeDeclFlags, baseClassName, baseClassAnchor);
+ IOTType otmParent = MAPPING.getOTElement(encType);
+
+ return maybeAddRoleType(elem, otmParent, typeDeclFlags, baseClassName, baseClassAnchor);
case IJavaElement.METHOD:
break;
case IJavaElement.INITIALIZER:
@@ -155,24 +155,24 @@ public class OTModelManager
return result;
}
- private IOTType maybeAddRoleType(IType elem, IOTType otmParent,
+ private IOTType maybeAddRoleType(IType elem, IOTType otmParent,
int typeDeclFlags, String baseClassName, String baseClassAnchor)
{
IOTType result = null;
- if ((otmParent != null)
- && (TypeHelper.isTeam(otmParent.getFlags())
+ if ((otmParent != null)
+ && (TypeHelper.isTeam(otmParent.getFlags())
|| (TypeHelper.isRole(otmParent.getFlags())) ) )
- {
- MAPPING.addOTElement( result = new RoleType(elem,
- otmParent,
- typeDeclFlags,
+ {
+ MAPPING.addOTElement( result = new RoleType(elem,
+ otmParent,
+ typeDeclFlags,
baseClassName,
baseClassAnchor));
}
return result;
}
-
+
/**
* @noreference This method is not intended to be referenced by clients.
* @nooverride This method is not intended to be re-implemented or extended by clients.
@@ -180,15 +180,15 @@ public class OTModelManager
public ICallinMapping addCallinBinding(IType role, MappingElementInfo info)
{
IOTType otmRole = MAPPING.getOTElement(role);
-
+
if ((otmRole != null) && (otmRole instanceof IRoleType))
{
//{OTModelUpdate
IMethodSpec corrRoleMethData = info.getRoleMethod();
- IMethod correspondingRoleMethod =
- role.getMethod(corrRoleMethData.getSelector(),
- corrRoleMethData.getArgumentTypes());
-//haebor}
+ IMethod correspondingRoleMethod =
+ role.getMethod(corrRoleMethData.getSelector(),
+ corrRoleMethData.getArgumentTypes());
+//haebor}
return new CallinMapping(info.getDeclarationSourceStart(),
info.getSourceStart(),
info.getSourceEnd(),
@@ -197,13 +197,13 @@ public class OTModelManager
//{OTModelUpdate
//orig: (IMethod) otmRole.getParent(),
correspondingRoleMethod,
-//haebor}
+//haebor}
info.getCallinName(),
info.getCallinKind(),
info.getRoleMethod(),
- info.getBaseMethods(), info.hasSignature());
+ info.getBaseMethods(), info.hasSignature());
}
-
+
return null;
}
@@ -214,15 +214,15 @@ public class OTModelManager
public ICalloutMapping addCalloutBinding(IType role, MappingElementInfo info)
{
IOTType otmRole = MAPPING.getOTElement(role);
-
+
if ((otmRole != null) && (otmRole instanceof IRoleType))
{
//{OTModelUpdate
IMethodSpec corrRoleMethData = info.getRoleMethod();
- IMethod correspondingRoleMethod =
- role.getMethod(corrRoleMethData.getSelector(),
- corrRoleMethData.getArgumentTypes());
-//haebor}
+ IMethod correspondingRoleMethod =
+ role.getMethod(corrRoleMethData.getSelector(),
+ corrRoleMethData.getArgumentTypes());
+//haebor}
MethodData[] baseMethods = info.getBaseMethods();
return new CalloutMapping(info.getDeclarationSourceStart(),
info.getSourceStart(),
@@ -237,10 +237,10 @@ public class OTModelManager
info.getDeclaredModifiers(),
true/*addAsChild*/);
}
-
+
return null;
}
-
+
/**
* @noreference This method is not intended to be referenced by clients.
* @nooverride This method is not intended to be re-implemented or extended by clients.
@@ -248,13 +248,13 @@ public class OTModelManager
public ICalloutToFieldMapping addCalloutToFieldBinding(IType role, MappingElementInfo info)
{
IOTType otmRole = MAPPING.getOTElement(role);
-
+
if ((otmRole != null) && (otmRole instanceof IRoleType))
{
IMethodSpec corrRoleMethData = info.getRoleMethod();
- IMethod correspondingRoleMethod =
- role.getMethod(corrRoleMethData.getSelector(),
- corrRoleMethData.getArgumentTypes());
+ IMethod correspondingRoleMethod =
+ role.getMethod(corrRoleMethData.getSelector(),
+ corrRoleMethData.getArgumentTypes());
return new CalloutToFieldMapping(info.getDeclarationSourceStart(),
info.getSourceStart(),
info.getSourceEnd(),
@@ -268,10 +268,10 @@ public class OTModelManager
info.getDeclaredModifiers(),
true/*addAsChild*/);
}
-
+
return null;
}
-
+
public void addOTElement(IOTType otType)
{
MAPPING.addOTElement(otType);
@@ -279,7 +279,7 @@ public class OTModelManager
/**
* Returns associated OTM element for a given type if there is one.
- *
+ *
* @return corresponding OTM element or null if no such element exists
*/
public static IOTType getOTElement(@Nullable IType type)
@@ -299,20 +299,20 @@ public class OTModelManager
}
return false;
}
-
+
public static void removeOTElement(IType type)
{
removeOTElement(type, false);
}
/**
- * @see OTModel#removeOTElement(IType, boolean)
+ * @see OTModel#removeOTElement(IType, boolean)
*/
public static void removeOTElement(IType type, boolean hasChanged)
{
MAPPING.removeOTElement(type, hasChanged);
}
-
+
/**
* Utility function.
* @param type
@@ -322,7 +322,7 @@ public class OTModelManager
IOTType ottype = getOTElement(type);
return ottype != null && ottype.isRole();
}
-
+
/**
* Utility function.
* @param type
@@ -340,13 +340,13 @@ public class OTModelManager
return false;
}
}
-
+
/**
* returns true if this member belongs to a role. Takes binary role-interfaceparts into account.
* FIXME (carp): this is mostly a workaround for binary role-interfaceparts. When this problem is
* fixed conceptually, check and "port" all clients of this method.
*/
- public static boolean belongsToRole(IMember member)
+ public static boolean belongsToRole(IMember member)
{
IType enclosing = member.getDeclaringType();
if (enclosing != null)
@@ -354,7 +354,7 @@ public class OTModelManager
IOTType otType = getOTElement(enclosing);
return otType != null && otType.isRole();
}
-
+
return false;
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/OTModelReconcileListener.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/OTModelReconcileListener.java
index 8870f183f..57d926c27 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/OTModelReconcileListener.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/OTModelReconcileListener.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: OTModelReconcileListener.java 23416 2010-02-03 19:59:31Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -37,20 +37,20 @@ import org.eclipse.objectteams.otdt.internal.core.OTType;
/**
* The OTModelListener performs the necessary updating of the OTM in order
* to sync with the JavaModel.
- *
+ *
* @author kaiser
* @version $Id: OTModelReconcileListener.java 23416 2010-02-03 19:59:31Z stephan $
*/
public class OTModelReconcileListener implements IElementChangedListener
-{
+{
/**
* Invoked when some or more JavaModel elements have changed, which may
- * require additional changes within the OTM
+ * require additional changes within the OTM
* @param event - event describing changes
*/
@Override
public void elementChanged(ElementChangedEvent event)
- {
+ {
removeAffectedModelElements( new IJavaElementDelta[] { event.getDelta() } );
}
@@ -63,7 +63,7 @@ public class OTModelReconcileListener implements IElementChangedListener
private void removeAffectedModelElements(IJavaElementDelta[] deltas)
{
assert (deltas != null);
-
+
for (int idx = 0; idx < deltas.length; idx++)
{
IJavaElementDelta delta = deltas[idx];
@@ -72,7 +72,7 @@ public class OTModelReconcileListener implements IElementChangedListener
// check for nested deltas
if (elem instanceof IParent)
{
- // visit child deltas
+ // visit child deltas
removeAffectedModelElements(delta.getAffectedChildren());
}
@@ -81,7 +81,7 @@ public class OTModelReconcileListener implements IElementChangedListener
{
// check for changed modifiers on element-changed deltas because
// this means that the JavaModel IType element has been recreated
- // and old instances need to be removed from the OTM
+ // and old instances need to be removed from the OTM
if ((delta.getKind() == IJavaElementDelta.CHANGED)
&& ((delta.getFlags() & IJavaElementDelta.F_MODIFIERS) != 0))
{
@@ -119,7 +119,7 @@ public class OTModelReconcileListener implements IElementChangedListener
}
}
}
-
+
if ((delta.getFlags() & IJavaElementDelta.F_PRIMARY_WORKING_COPY) != 0)
{
if (!unit.isWorkingCopy() && unit.exists())
@@ -140,7 +140,7 @@ public class OTModelReconcileListener implements IElementChangedListener
IOTType t1 = OTModelManager.getOTElement(currentType);
IOTType t2 = OTModelManager.getOTElement(wcType);
}
-
+
if (otType != null) // need to update the workingcopy
{
ICompilationUnit otUnit = otType.getCompilationUnit();
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/TypeHelper.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/TypeHelper.java
index fe6996e60..ece40fb1a 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/TypeHelper.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/core/TypeHelper.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: TypeHelper.java 23416 2010-02-03 19:59:31Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -56,7 +56,7 @@ public class TypeHelper
{
public static final String JAVA_LANG_OBJECT = "java.lang.Object"; //$NON-NLS-1$
public static final String ORG_OBJECTTEAMS_TEAM = new String(IOTConstants.STR_ORG_OBJECTTEAMS_TEAM);
-
+
private static final String ICONFINED = new String(IOTConstants.ICONFINED);
private static final String CONFINED = new String(IOTConstants.CONFINED);
private static final String ILOWERABLE = new String(IOTConstants.ILOWERABLE);
@@ -84,8 +84,8 @@ public class TypeHelper
/**
* Returns all super types __including the given type__ for a given type.
* The hierarchy is created in the sense of ordinary object inheritance.
- *
- * The returned elements are arranged from the current to the top most
+ *
+ * The returned elements are arranged from the current to the top most
* parent.
*/
public static IType[] getSuperTypes(IType type) throws JavaModelException
@@ -105,11 +105,11 @@ public class TypeHelper
}
/**
- * Returns the corresponding Java elements (ITypes) from the JavaModel of
- * all super types __including the given type__ for a given role. The
+ * Returns the corresponding Java elements (ITypes) from the JavaModel of
+ * all super types __including the given type__ for a given role. The
* hierarchy is created in the sense of implicit inheritance.
- *
- * The returned elements are arranged from the current to the top most
+ *
+ * The returned elements are arranged from the current to the top most
* parent.
*/
public static IType[] getImplicitSuperTypes(IRoleType role) throws JavaModelException
@@ -118,7 +118,7 @@ public class TypeHelper
while (role != null)
{
- parents.add(role.getCorrespondingJavaElement());
+ parents.add(role.getCorrespondingJavaElement());
role = getParentTeamRoleType(role);
}
@@ -174,10 +174,10 @@ public class TypeHelper
&& children[idx].getElementName().equals(roleName))
{
IOTType otType = OTModelManager.getOTElement(children[idx]);
-
+
if ((otType != null) && (otType instanceof IRoleType))
{
- result = (IRoleType)otType;
+ result = (IRoleType)otType;
}
else
{
@@ -194,36 +194,36 @@ public class TypeHelper
}
/**
- * Find a role type within a given team.
+ * Find a role type within a given team.
* Respect inline roles and role files.
- *
+ *
* @param teamType where to look
* @param roleName what to look for
* @return null in cases the type is not found
*/
- public static IType findRoleType(IType teamType, String roleName)
+ public static IType findRoleType(IType teamType, String roleName)
{
IType roleType = teamType.getType(roleName);
-
+
// inline roles exit here:
if (roleType.exists())
return roleType;
-
+
// look for a team package:
// TODO(SH): does not yet account for all kinds of nesting!
IJavaElement parent = teamType.getParent();
if (parent.getElementType() == IJavaElement.COMPILATION_UNIT)
parent = parent.getParent();
- if (parent.getElementType() == IJavaElement.PACKAGE_FRAGMENT)
+ if (parent.getElementType() == IJavaElement.PACKAGE_FRAGMENT)
{
IPackageFragment enclosingPackage = (IPackageFragment)parent;
- IPackageFragmentRoot root = (IPackageFragmentRoot)enclosingPackage.getParent();
- try
+ IPackageFragmentRoot root = (IPackageFragmentRoot)enclosingPackage.getParent();
+ try
{
IPackageFragment teamPackage = root.getPackageFragment(enclosingPackage.getElementName()+'.'+teamType.getElementName());
- if (teamPackage.exists())
+ if (teamPackage.exists())
{
-
+
// found the team package, look for the role file:
IJavaElement[] cus = teamPackage.getChildren();
for (int i = 0; i < cus.length; i++) {
@@ -236,7 +236,7 @@ public class TypeHelper
{
return (IType)children[j];
}
- }
+ }
}
}
}
@@ -253,7 +253,7 @@ public class TypeHelper
* @param qualRoleName role name relative to the given team, e.g. <code>"T1.T2.T3.R1"</code>.
* @return found role type or <code>null</code>, e.g. <code>T1.T2.T3.R1</code>.
*/
- public static IType findNestedRoleType(IType teamType, String qualRoleName)
+ public static IType findNestedRoleType(IType teamType, String qualRoleName)
{
if (teamType == null || qualRoleName == null)
{
@@ -277,11 +277,11 @@ public class TypeHelper
return null;
}
}
-
+
return currType;
}
-
-
+
+
/**
* Returns the method mapping element that binds the given method or
* null, if there is none. Search scope is the role, that declares
@@ -297,12 +297,12 @@ public class TypeHelper
{
if ( (method == null) || (teamType == null) )
return null;
-
+
IType t = OTModelManager.getOTElement(method.getDeclaringType());
IRoleType role = TypeHelper.getTeamRoleType(teamType, (IRoleType)t);
if (role == null)
return null;
-
+
String signature = TypeHelper.getMethodSignature(method);
IRoleType[] roles = getImplicitSuperRoles(role);
for (int roleIdx = 0; roleIdx < roles.length; roleIdx++)
@@ -323,12 +323,12 @@ public class TypeHelper
/**
* Returns all super types __including the given type__ for a given role.
* The hierarchy is created in the sense of ordinary object inheritance.
- *
- * This method uses TypeHelper.getSuperTypes(), but for role types
+ *
+ * This method uses TypeHelper.getSuperTypes(), but for role types
* the supertype hierarchy needs to be build not on the IRoleType,
* but on the corresponding java element.
- *
- * The returned elements are arranged from the current to the top most
+ *
+ * The returned elements are arranged from the current to the top most
* parent.
*/
public static IType[] getRoleSuperTypes(IRoleType role) throws JavaModelException
@@ -343,8 +343,8 @@ public class TypeHelper
return null;
}
}
-
-
+
+
/**
* Get all teams in the super type hierarchy for the specified team,
* including the team itself. The returned elements are arranged
@@ -369,28 +369,28 @@ public class TypeHelper
ITypeHierarchy hierarchy =
teamType.newSupertypeHierarchy(new NullProgressMonitor());
-
+
IType[] superTeams = hierarchy.getAllSuperclasses(teamType);
result.addAll(Arrays.asList(superTeams));
}
return result.toArray(new IType[result.size()]);
- }
-
-
+ }
+
+
/**
* Gets implicit inherited methods of specified role of a team.
* @param teamType The role's team
* @param roleName Name of the Role
* @return Array of role methods
* @throws JavaModelException if creation of supertype hierarchy fails
- */
+ */
public static IMethod[] getInheritedRoleMethods(IType teamType, String roleName)
throws JavaModelException
{
return getRoleMethods(teamType, roleName, true);
}
-
+
/**
* Gets all methods of the specified role of a team.
@@ -405,7 +405,7 @@ public class TypeHelper
{
return getRoleMethods(teamType, roleName, false);
}
-
+
/**
* Gets all methods of the specified role of a team.
* When only implicit inherited methods
@@ -419,22 +419,22 @@ public class TypeHelper
throws JavaModelException
{
Map<String, IMethod> result = new HashMap<String, IMethod>();
-
+
IType[] teams = getSuperTeams(teamType);
-
+
// for all superteams
for (int teamsIdx = 0; teamsIdx < teams.length; teamsIdx++) {
-
+
if (onlySuperTeams && teamsIdx == 0)
{
continue;
}
-
+
if (teams[teamsIdx].getFullyQualifiedName().compareTo(ORG_OBJECTTEAMS_TEAM) == 0)
{
break;
}
-
+
IType currentRole = OTModelManager.getOTElement(teams[teamsIdx]).getRoleType(roleName);
if (currentRole != null)
{
@@ -446,7 +446,7 @@ public class TypeHelper
{
continue;
}
-
+
if (!roleMethods[methIdx].isConstructor())
{
String key = getMethodSignature(roleMethods[methIdx]);
@@ -459,9 +459,9 @@ public class TypeHelper
}
}
}
-
+
return result.values().toArray(new IMethod[result.size()]);
-
+
}
/**
@@ -491,7 +491,7 @@ public class TypeHelper
}
return result;
}
-
+
//TODO(mkr) remove
public static List<IMethod> getAllImplicitInheritedMethods(IRoleType role)
throws JavaModelException
@@ -502,9 +502,9 @@ public class TypeHelper
{
result.addAll(Arrays.asList(superRoles[roleIdx].getMethods()));
}
- return result;
+ return result;
}
-
+
//TODO(mkr) check dependencies with getAllRegularInheritedMethods()
//TODO(mkr) this one needs more tests.
public static IMethod[] getRoleMethodsComplete(IRoleType role)
@@ -513,58 +513,58 @@ public class TypeHelper
Map<String,IMethod> result = new HashMap<String,IMethod>();
List<IMethod> methods = new LinkedList<IMethod>();
IRoleType[] roles = getImplicitSuperRoles(role);
-
+
// for all roles add declared role methods
for (int roleIdx = 0; roleIdx < roles.length; roleIdx++)
{
methods.addAll(Arrays.asList(roles[roleIdx].getMethods()));
}
-
+
// for all roles add regular inherited methods
for (int roleIdx = 0; roleIdx < roles.length; roleIdx++)
{
methods.addAll(getAllRegularInheritedMethods(roles[roleIdx]));
}
-
+
for (Iterator<IMethod> methIdx = methods.iterator(); methIdx.hasNext();)
{
IMethod meth = methIdx.next();
-
+
// Just in case
if (meth == null)
{
continue;
}
-
+
// filter _OT$ methods
if (meth.getElementName().startsWith(IOTConstants.OT_DOLLAR))
{
continue;
}
-
+
// filter constructors and main()
if (meth.isConstructor() || meth.isMainMethod())
{
continue;
}
-
+
String key = getMethodSignature(meth);
if (!result.containsKey(key))
{
result.put(key, meth);
}
}
-
+
return result.values().toArray(new IMethod[result.size()]);
}
-
+
/**
* Returns all implicit super role classes __including__ the given role
* for a given role. This is similar to
* <code>TypeHelper.getImplicitSuperType()</code>,
* except the result is typed different and the supertype hierarchy of
* the enclosing team is created only once.
- * The returned elements are arranged from the current to the top most
+ * The returned elements are arranged from the current to the top most
* parent.
* @param role
* @return Roles in the type hierarchy of the enclosing team with the same
@@ -572,16 +572,16 @@ public class TypeHelper
* @throws JavaModelException
*/
public static IRoleType[] getImplicitSuperRoles(IRoleType role)
- throws JavaModelException
+ throws JavaModelException
{
List<IRoleType> result = new LinkedList<IRoleType>();
IType teamType = role.getTeam();
- IType[] teams = getSuperTeams(teamType);
-
+ IType[] teams = getSuperTeams(teamType);
+
// for all superteams
for (int teamsIdx = 0; teamsIdx < teams.length; teamsIdx++) {
-
+
if (teams[teamsIdx].getFullyQualifiedName().compareTo(ORG_OBJECTTEAMS_TEAM) == 0)
{
break;
@@ -598,8 +598,8 @@ public class TypeHelper
}
return result.toArray(new IRoleType[result.size()]);
}
-
-
+
+
/**
* Gets only inherited role types for a specified team.
* @param teamType Team
@@ -612,7 +612,7 @@ public class TypeHelper
return getRoleTypes(teamType, true);
}
-
+
/**
* Gets inherited and declared role types for a specified team.
* @param teamType Team
@@ -624,8 +624,8 @@ public class TypeHelper
{
return getRoleTypes(teamType, false);
}
-
-
+
+
/**
* Gets role types for a specified team.
* @param teamType Team
@@ -640,15 +640,15 @@ public class TypeHelper
IType[] roles = null;
IType currentRole = null;
- IType[] superTeams = getSuperTeams(teamType);
-
- for (int teamsIdx = 0; teamsIdx < superTeams.length; teamsIdx++)
+ IType[] superTeams = getSuperTeams(teamType);
+
+ for (int teamsIdx = 0; teamsIdx < superTeams.length; teamsIdx++)
{
if (onlySuperTeams && teamsIdx == 0)
{
continue;
}
-
+
if ( superTeams[teamsIdx].getFullyQualifiedName().compareTo(ORG_OBJECTTEAMS_TEAM) == 0
|| !isTeam(superTeams[teamsIdx].getFlags()))
{
@@ -657,13 +657,13 @@ public class TypeHelper
// find implicit roles of superteams
roles = OTModelManager.getOTElement(superTeams[teamsIdx]).getRoleTypes();
- for (int roleIdx = 0; roleIdx < roles.length; roleIdx++)
+ for (int roleIdx = 0; roleIdx < roles.length; roleIdx++)
{
currentRole = roles[roleIdx];
-
+
// when handling binary types, ignore OT elements
if (currentRole.isBinary())
- {
+ {
if (currentRole.isInterface())
{
String name = currentRole.getElementName();
@@ -672,7 +672,7 @@ public class TypeHelper
|| name.equals(ILOWERABLE)
|| name.equals(CONFINED)
|| name.equals(ICONFINED))
- {
+ {
continue;
}
}
@@ -682,14 +682,14 @@ public class TypeHelper
}
}
- if (!result.containsKey(currentRole.getElementName()))
+ if (!result.containsKey(currentRole.getElementName()))
{
result.put(currentRole.getElementName(),
OTModelManager.getOTElement(currentRole));
}
}
}
-
+
return result.values().toArray(new IRoleType[result.size()]);
}
@@ -701,12 +701,12 @@ public class TypeHelper
public static String getMethodSignature(IMethod method)
{
StringBuffer result = new StringBuffer();
-
+
if (method != null)
{
result.append(method.getElementName());
result.append('(');
-
+
String[] parameterTypes = method.getParameterTypes();
for (int idx = 0; idx < parameterTypes.length; idx++)
{
@@ -719,20 +719,20 @@ public class TypeHelper
}
result.append(')');
}
-
+
return result.toString();
}
-
+
@SuppressWarnings("rawtypes") // uses method.parameters(), which returns a raw List.
public static String getMethodSignature(MethodDeclaration method)
{
StringBuffer result = new StringBuffer();
-
+
if (method != null)
{
result.append(method.getName().getIdentifier());
result.append('(');
-
+
Iterator params = method.parameters().iterator();
while (params.hasNext())
{
@@ -759,7 +759,7 @@ public class TypeHelper
while (currentType != null) {
result.insert(0, currentType.getElementName());
-
+
if (currentType.isClass()) {
int flags = currentType.getFlags();
if (/*Flags.isTeam(flags) &&*/ Flags.isRole(flags))
@@ -769,12 +769,12 @@ public class TypeHelper
if (currentType != null) // enclosing available, insert separator
result.insert(0, '$');
}
-
+
String packageName = type.getPackageFragment().getElementName();
if (packageName.equals(IPackageFragment.DEFAULT_PACKAGE_NAME)) {
return result.toString();
}
-
+
return packageName + '.' + result.toString();
}
@@ -782,7 +782,7 @@ public class TypeHelper
{
return CharOperation.equals(IOTConstants.STR_ORG_OBJECTTEAMS_TEAM, type.getFullyQualifiedName().toCharArray());
}
-
+
public static boolean isConfined(IType type) {
String simpleTypeName = type.getElementName();
return CONFINED.equals(simpleTypeName) || ICONFINED.equals(simpleTypeName);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/AbstractCalloutMapping.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/AbstractCalloutMapping.java
index e9b1d5954..6c4890f56 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/AbstractCalloutMapping.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/AbstractCalloutMapping.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2012 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany, and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -30,46 +30,46 @@ import org.eclipse.objectteams.otdt.core.IRoleType;
import org.eclipse.objectteams.otdt.core.OTModelManager;
import org.eclipse.objectteams.otdt.internal.core.util.MethodData;
-/**
- * Common super-class of callout and callout-to-field.
+/**
+ * Common super-class of callout and callout-to-field.
* Purpose: implement a view of this mapping that can be used for searching.
- * This view pretends to be a method
+ * This view pretends to be a method
* (actually short-hand callouts indeed are translated to a method ;-)
- *
+ *
* @author stephan
*/
public abstract class AbstractCalloutMapping extends MethodMapping implements IMethod {
- public AbstractCalloutMapping(int declarationSourceStart,
- int sourceStart,
- int sourceEnd,
- int declarationSourceEnd,
- int elementType,
- IMethod corrJavaMethod,
- IType parentRole,
- MethodData roleMethodHandle,
- boolean hasSignature)
+ public AbstractCalloutMapping(int declarationSourceStart,
+ int sourceStart,
+ int sourceEnd,
+ int declarationSourceEnd,
+ int elementType,
+ IMethod corrJavaMethod,
+ IType parentRole,
+ MethodData roleMethodHandle,
+ boolean hasSignature)
{
- super(declarationSourceStart, sourceStart, sourceEnd, declarationSourceEnd,
- elementType, corrJavaMethod, parentRole,
- roleMethodHandle,
+ super(declarationSourceStart, sourceStart, sourceEnd, declarationSourceEnd,
+ elementType, corrJavaMethod, parentRole,
+ roleMethodHandle,
hasSignature);
}
- public AbstractCalloutMapping(int declarationSourceStart,
- int sourceStart,
- int sourceEnd,
- int declarationSourceEnd,
- int elementType,
+ public AbstractCalloutMapping(int declarationSourceStart,
+ int sourceStart,
+ int sourceEnd,
+ int declarationSourceEnd,
+ int elementType,
IMethod corrJavaMethod,
- IType parentRole,
- MethodData roleMethodHandle,
- boolean hasSignature,
- boolean addAsChild)
+ IType parentRole,
+ MethodData roleMethodHandle,
+ boolean hasSignature,
+ boolean addAsChild)
{
- super(declarationSourceStart, sourceStart, sourceEnd, declarationSourceEnd,
- elementType, corrJavaMethod, parentRole,
- roleMethodHandle,
+ super(declarationSourceStart, sourceStart, sourceEnd, declarationSourceEnd,
+ elementType, corrJavaMethod, parentRole,
+ roleMethodHandle,
hasSignature, addAsChild);
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/BinaryRoleType.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/BinaryRoleType.java
index ddcc756d5..f1d268311 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/BinaryRoleType.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/BinaryRoleType.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2009 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: BinaryRoleType.java 23417 2010-02-03 20:13:55Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -30,12 +30,12 @@ import org.eclipse.objectteams.otdt.core.IOTType;
/**
* @author gis
*/
-public class BinaryRoleType extends RoleType
+public class BinaryRoleType extends RoleType
{
public BinaryRoleType(
- IType correspondingJavaType,
+ IType correspondingJavaType,
IJavaElement parent,
- int flags,
+ int flags,
String baseClassName,
String baseClassAnchor)
{
@@ -44,10 +44,10 @@ public class BinaryRoleType extends RoleType
@Override
IType resolveInType(IOTType referenceType, String type)
- throws JavaModelException
+ throws JavaModelException
{
// binary type may have resolved type name
- if (type.indexOf('.') != -1) // already qualified/resolved (from binary)?
+ if (type.indexOf('.') != -1) // already qualified/resolved (from binary)?
// directly find the type:
return this.getCorrespondingJavaElement().getJavaProject().findType(type);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/CallinMapping.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/CallinMapping.java
index afaaf1ffa..fb2a568bb 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/CallinMapping.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/CallinMapping.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2012 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany, and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -51,49 +51,49 @@ public class CallinMapping extends MethodMapping implements ICallinMapping
private MethodData[] baseMethodHandles;
private String name;
-
+
public CallinMapping(
int declarationSourceStart,
int sourceStart,
int sourceEnd,
int declarationSourceEnd,
- IRoleType parent,
+ IRoleType parent,
IMethod corrJavaMeth,
char[] name,
int callinKind,
MethodData roleMethodHandle,
- MethodData[] baseMethodHandles,
+ MethodData[] baseMethodHandles,
boolean hasSignature)
{
- this(declarationSourceStart, sourceStart, sourceEnd, declarationSourceEnd,
- parent, corrJavaMeth,
- name, callinKind, roleMethodHandle, baseMethodHandles,
+ this(declarationSourceStart, sourceStart, sourceEnd, declarationSourceEnd,
+ parent, corrJavaMeth,
+ name, callinKind, roleMethodHandle, baseMethodHandles,
hasSignature, /*addAsChild*/true);
}
-
- // for use by sub-class ResolvedCallinMapping
+
+ // for use by sub-class ResolvedCallinMapping
public CallinMapping(
int declarationSourceStart,
int sourceStart,
int sourceEnd,
int declarationSourceEnd,
- IRoleType parent,
+ IRoleType parent,
IMethod corrJavaMeth,
char[] name,
int callinKind,
MethodData roleMethodHandle,
- MethodData[] baseMethodHandles,
+ MethodData[] baseMethodHandles,
boolean hasSignature,
boolean addAsChild)
{
- super(declarationSourceStart, sourceStart, sourceEnd, declarationSourceEnd,
- CALLIN_MAPPING, corrJavaMeth, parent,
- roleMethodHandle,
+ super(declarationSourceStart, sourceStart, sourceEnd, declarationSourceEnd,
+ CALLIN_MAPPING, corrJavaMeth, parent,
+ roleMethodHandle,
hasSignature, addAsChild);
- this.name = new String(name);
+ this.name = new String(name);
this.callinKind = callinKind;
- this.baseMethodHandles = baseMethodHandles;
+ this.baseMethodHandles = baseMethodHandles;
}
// ==== memento generation: ====
@@ -115,7 +115,7 @@ public class CallinMapping extends MethodMapping implements ICallinMapping
protected void getBaseMethodsForHandle(StringBuffer buff) {
for (IMethodSpec baseMethod : this.baseMethodHandles)
getMethodForHandle(baseMethod, buff);
- }
+ }
// ====
@Override
@@ -138,14 +138,14 @@ public class CallinMapping extends MethodMapping implements ICallinMapping
return this.name;
return super.getSourceName();
}
-
+
@Override
@SuppressWarnings("nls")
public String getElementName()
{
StringBuffer elementName = new StringBuffer(super.getElementName());
elementName.append(" <- ");
-
+
if (this.baseMethodHandles.length > 1)
{
elementName.append("{");
@@ -182,7 +182,7 @@ public class CallinMapping extends MethodMapping implements ICallinMapping
}
return elementName.toString();
}
-
+
/**
* @return Does this mapping have a name (aka callin label) in the source code?
*/
@@ -190,7 +190,7 @@ public class CallinMapping extends MethodMapping implements ICallinMapping
public boolean hasName() {
return this.name != null && !this.name.startsWith("<"); // generated names start with '<'. //$NON-NLS-1$
}
-
+
@Override
public String getName() {
return this.name;
@@ -210,11 +210,11 @@ public class CallinMapping extends MethodMapping implements ICallinMapping
{
return this.callinKind;
}
-
+
@Override
public boolean hasCovariantReturn() {
if (this.baseMethodHandles != null)
- for (IMethodSpec baseMethod : this.baseMethodHandles)
+ for (IMethodSpec baseMethod : this.baseMethodHandles)
if (baseMethod.hasCovariantReturn())
return true;
return false;
@@ -225,7 +225,7 @@ public class CallinMapping extends MethodMapping implements ICallinMapping
{
return findBaseMethods();
}
-
+
@Override
public boolean equals(Object obj)
{
@@ -244,14 +244,14 @@ public class CallinMapping extends MethodMapping implements ICallinMapping
return true;
return this.callinKind == other.callinKind;
}
-
+
@Override
@SuppressWarnings("nls")
public String toString()
{
return "callin " + super.toString();
}
-
+
/**
* Performs resolving of all bound base methods
*/
@@ -280,20 +280,20 @@ public class CallinMapping extends MethodMapping implements ICallinMapping
for (int idx = 0; idx < this.baseMethodHandles.length; idx++)
{
IMethod baseMethod = findMethod(typeParents, this.baseMethodHandles[idx]);
-
+
// TODO(jwl): A warning from the compiler should be given to the developer, elsewhere!
// TODO(jwl): Do we really want an inconsistant OT model??
- // Only existing base methods are added, if an assigned base method
+ // Only existing base methods are added, if an assigned base method
// doesn't exist, it just will be ignored
if (baseMethod != null)
{
baseMethods.add(baseMethod);
- }
+ }
}
-
+
return baseMethods.toArray(new IMethod[baseMethods.size()]);
}
-
+
// added for the SourceTypeConverter
@Override
public IMethodSpec[] getBaseMethodHandles()
@@ -304,7 +304,7 @@ public class CallinMapping extends MethodMapping implements ICallinMapping
/**
* Converts the ICallinMapping.KIND_ constants to TerminalTokens constants.
*/
- public static int convertModelToTerminalToken(int icallinmappingKind)
+ public static int convertModelToTerminalToken(int icallinmappingKind)
{
switch (icallinmappingKind)
{
@@ -318,7 +318,7 @@ public class CallinMapping extends MethodMapping implements ICallinMapping
}
}
- public static int convertTerminalTokenToModel(int terminalTokensCallinKind)
+ public static int convertTerminalTokenToModel(int terminalTokensCallinKind)
{
switch (terminalTokensCallinKind)
{
@@ -335,21 +335,21 @@ public class CallinMapping extends MethodMapping implements ICallinMapping
// implementation and alternate API of resolved(Binding)
@Override
public OTJavaElement resolved(char[] uniqueKey) {
- ResolvedCallinMapping resolvedHandle =
+ ResolvedCallinMapping resolvedHandle =
new ResolvedCallinMapping(
getDeclarationSourceStart(),
getSourceStart(),
getSourceEnd(),
getDeclarationSourceEnd(),
- (IRoleType) getParent(),
+ (IRoleType) getParent(),
getIMethod(),
this.name.toCharArray(),
this.callinKind,
getRoleMethodHandle(),
- this.baseMethodHandles,
- hasSignature(),
+ this.baseMethodHandles,
+ hasSignature(),
new String(uniqueKey));
-
+
return resolvedHandle;
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/CalloutMapping.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/CalloutMapping.java
index 1d12a4084..43361d0e0 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/CalloutMapping.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/CalloutMapping.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2013 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany, and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -43,7 +43,7 @@ public class CalloutMapping extends AbstractCalloutMapping implements ICalloutMa
private IMethod baseMethod;
private MethodData baseMethodHandle; // Note: may be null!
private int declaredModifiers;
-
+
public CalloutMapping(int declarationSourceStart,
int sourceStart,
int sourceEnd,
@@ -108,14 +108,14 @@ public class CalloutMapping extends AbstractCalloutMapping implements ICalloutMa
public boolean isOverride() {
return this.isOverride;
}
-
+
@Override
@SuppressWarnings("nls")
public String getElementName()
{
StringBuffer name = new StringBuffer(super.getElementName());
name.append(" -> ");
-
+
if (this.baseMethodHandle == null)
{
name.append("(unknown)");
@@ -131,7 +131,7 @@ public class CalloutMapping extends AbstractCalloutMapping implements ICalloutMa
name.append(this.baseMethodHandle.getSelector());
}
}
-
+
return name.toString();
}
@@ -139,8 +139,8 @@ public class CalloutMapping extends AbstractCalloutMapping implements ICalloutMa
public int getMappingKind()
{
return CALLOUT_MAPPING;
- }
-
+ }
+
@Override
public int getDeclaredModifiers() {
return this.declaredModifiers;
@@ -159,7 +159,7 @@ public class CalloutMapping extends AbstractCalloutMapping implements ICalloutMa
{
this.baseMethod = findBaseMethod();
}
-
+
return this.baseMethod;
}
@@ -173,7 +173,7 @@ public class CalloutMapping extends AbstractCalloutMapping implements ICalloutMa
return super.equals(obj);
}
-
+
@Override
@SuppressWarnings("nls")
public String toString()
@@ -188,14 +188,14 @@ public class CalloutMapping extends AbstractCalloutMapping implements ICalloutMa
{
if (this.baseMethodHandle == null)
return null;
-
+
IRoleType roleClass = getDeclaringRole();
IType baseClass = roleClass.getBaseClass();
IType[] typeParents = TypeHelper.getSuperTypes(baseClass);
-
+
return findMethod(typeParents, this.baseMethodHandle);
}
-
+
// added for the SourceTypeConverter
@Override
public IMethodSpec getBaseMethodHandle()
@@ -215,26 +215,26 @@ public class CalloutMapping extends AbstractCalloutMapping implements ICalloutMa
getMethodForHandle(this.baseMethodHandle, buff);
}
// ====
-
+
// implementation and alternate API of resolved(Binding)
@Override
public OTJavaElement resolved(char[] uniqueKey) {
- ResolvedCalloutMapping resolvedHandle =
+ ResolvedCalloutMapping resolvedHandle =
new ResolvedCalloutMapping(
getDeclarationSourceStart(),
getSourceStart(),
getSourceEnd(),
getDeclarationSourceEnd(),
getElementType(),
- (IType) getParent(),
+ (IType) getParent(),
getIMethod(),
getRoleMethodHandle(),
- this.baseMethodHandle,
- hasSignature(),
+ this.baseMethodHandle,
+ hasSignature(),
isOverride(),
getDeclaredModifiers(),
new String(uniqueKey));
-
+
return resolvedHandle;
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/CalloutToFieldMapping.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/CalloutToFieldMapping.java
index 48cbdbf2d..711f2083d 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/CalloutToFieldMapping.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/CalloutToFieldMapping.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2016 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany, and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -37,7 +37,7 @@ import org.eclipse.objectteams.otdt.internal.core.util.MethodData;
/**
* Callout to field mapping implementation.
- *
+ *
* @author brcan
*/
public class CalloutToFieldMapping extends AbstractCalloutMapping implements ICalloutToFieldMapping
@@ -53,7 +53,7 @@ public class CalloutToFieldMapping extends AbstractCalloutMapping implements ICa
int sourceEnd,
int declarationSourceEnd,
IType role,
- IMethod correspondingJavaElem,
+ IMethod correspondingJavaElem,
MethodData roleMethodHandle,
IFieldAccessSpec baseFieldHandle,
boolean hasSignature,
@@ -65,13 +65,13 @@ public class CalloutToFieldMapping extends AbstractCalloutMapping implements ICa
}
protected CalloutToFieldMapping(
- int declarationSourceStart,
+ int declarationSourceStart,
int sourceStart,
int sourceEnd,
int declarationSourceEnd,
int elementType,
IType parentRole,
- IMethod correspondingJavaElem,
+ IMethod correspondingJavaElem,
MethodData roleMethodHandle,
IFieldAccessSpec baseFieldHandle,
boolean hasSignature,
@@ -80,15 +80,15 @@ public class CalloutToFieldMapping extends AbstractCalloutMapping implements ICa
{
this(declarationSourceStart, sourceStart, sourceEnd, declarationSourceEnd, CALLOUT_TO_FIELD_MAPPING, parentRole, correspondingJavaElem, roleMethodHandle, baseFieldHandle, hasSignature, isOverride, declaredModifiers, true);
}
-
+
protected CalloutToFieldMapping(
- int declarationSourceStart,
+ int declarationSourceStart,
int sourceStart,
int sourceEnd,
int declarationSourceEnd,
int elementType,
IType parentRole,
- IMethod correspondingJavaElem,
+ IMethod correspondingJavaElem,
MethodData roleMethodHandle,
IFieldAccessSpec baseFieldHandle,
boolean hasSignature,
@@ -99,24 +99,24 @@ public class CalloutToFieldMapping extends AbstractCalloutMapping implements ICa
super(declarationSourceStart,
sourceStart,
sourceEnd,
- declarationSourceEnd,
- elementType,
- correspondingJavaElem,
- parentRole,
- roleMethodHandle,
+ declarationSourceEnd,
+ elementType,
+ correspondingJavaElem,
+ parentRole,
+ roleMethodHandle,
hasSignature,
addAsChild);
-
+
this.isOverride = isOverride;
this.baseFieldHandle = baseFieldHandle;
this.declaredModifiers = declaredModifiers;
}
-
+
@Override
public boolean isOverride() {
return this.isOverride;
}
-
+
@Override
public int getFlags() throws JavaModelException {
return this.declaredModifiers;
@@ -126,10 +126,10 @@ public class CalloutToFieldMapping extends AbstractCalloutMapping implements ICa
@SuppressWarnings("nls")
public String getElementName()
{
-
+
StringBuffer name = new StringBuffer(super.getElementName());
name.append(" -> ");
-
+
if (hasSignature())
{
name.append(this.baseFieldHandle.toString());
@@ -138,7 +138,7 @@ public class CalloutToFieldMapping extends AbstractCalloutMapping implements ICa
{
name.append(this.baseFieldHandle.getSelector());
}
-
+
return name.toString();
}
@@ -146,7 +146,7 @@ public class CalloutToFieldMapping extends AbstractCalloutMapping implements ICa
public int getMappingKind()
{
return CALLOUT_TO_FIELD_MAPPING;
- }
+ }
@Override
public IField getBoundBaseField() throws JavaModelException
@@ -155,7 +155,7 @@ public class CalloutToFieldMapping extends AbstractCalloutMapping implements ICa
{
this.baseField = findBaseField();
}
-
+
return this.baseField;
}
@@ -176,7 +176,7 @@ public class CalloutToFieldMapping extends AbstractCalloutMapping implements ICa
return super.equals(obj);
}
-
+
@Override
@SuppressWarnings("nls")
public String toString()
@@ -191,14 +191,14 @@ public class CalloutToFieldMapping extends AbstractCalloutMapping implements ICa
{
IType baseClass = getDeclaringRole().getBaseClass();
IType[] typeParents = TypeHelper.getSuperTypes(baseClass);
-
+
return findField(typeParents, this.baseFieldHandle);
}
-
+
/**
* Tries to find an IField matching the given field handle in a set
* of types.
- *
+ *
* @return the first matching IField in the set of types or null if
* nothing found
*/
@@ -213,7 +213,7 @@ public class CalloutToFieldMapping extends AbstractCalloutMapping implements ICa
for (int idy = 0; idy < fields.length; idy++)
{
IField tmpField = fields[idy];
- // check for equal field name
+ // check for equal field name
if (tmpField.getElementName().equals(fieldHandle.getSelector()))
{
// return immmediately on first match
@@ -223,7 +223,7 @@ public class CalloutToFieldMapping extends AbstractCalloutMapping implements ICa
}
return null;
}
-
+
// ==== memento generation: ====
@Override
protected char getMappingKindChar() {
@@ -262,29 +262,29 @@ public class CalloutToFieldMapping extends AbstractCalloutMapping implements ICa
return new FieldData(selector, fieldType, isSetter);
}
// ====
-
- // implementation and alternate API of resolved(Binding)
+
+ // implementation and alternate API of resolved(Binding)
@Override
public OTJavaElement resolved(char[] uniqueKey) {
- ResolvedCalloutToFieldMapping resolvedHandle =
+ ResolvedCalloutToFieldMapping resolvedHandle =
new ResolvedCalloutToFieldMapping(
getDeclarationSourceStart(),
getSourceStart(),
getSourceEnd(),
getDeclarationSourceEnd(),
getElementType(),
- (IType) getParent(),
+ (IType) getParent(),
getIMethod(),
getRoleMethodHandle(),
- this.baseFieldHandle,
- hasSignature(),
+ this.baseFieldHandle,
+ hasSignature(),
isOverride(),
this.declaredModifiers,
new String(uniqueKey));
return resolvedHandle;
}
-
+
// disable method that does not apply to c-t-f:
@Override
public String[] getExceptionTypes() throws JavaModelException {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/CompilationUnitMapping.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/CompilationUnitMapping.java
index 89e25d6b3..a9bbdbbc5 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/CompilationUnitMapping.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/CompilationUnitMapping.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: CompilationUnitMapping.java 23416 2010-02-03 19:59:31Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -34,7 +34,7 @@ import org.eclipse.objectteams.otdt.internal.core.OTTypeList.OTTypeIterator;
/**
* Maps an ICompilationUnit to the contained IOTTypes.
- *
+ *
* @author kaiser
* @version $Id: CompilationUnitMapping.java 23416 2010-02-03 19:59:31Z stephan $
*/
@@ -54,7 +54,7 @@ public class CompilationUnitMapping
}
public void add(IJavaElement unit, OTTypeList otElems)
- {
+ {
this.data.put(getHashkeyElement(unit), otElems == null ? new OTTypeList() : otElems);
}
@@ -70,43 +70,43 @@ public class CompilationUnitMapping
/**
* This method needs to return an ordenary list, due to nameclashes when an
- * OTTypeList is used. An OTTypeList can be seen as hashed list.
- *
- * @return All IOTTypes which the mapping consists of.
+ * OTTypeList is used. An OTTypeList can be seen as hashed list.
+ *
+ * @return All IOTTypes which the mapping consists of.
*/
public List<OTType> getOTElements()
{
List<OTType> result = new LinkedList<OTType>();
-
+
for (Iterator<OTTypeList> iter = this.data.values().iterator(); iter.hasNext(); )
{
- OTTypeList cuTypes = iter.next();
+ OTTypeList cuTypes = iter.next();
for (OTTypeIterator iterator = cuTypes.getIterator(); iterator.hasNext();)
{
- result.add(iterator.getNext());
- }
+ result.add(iterator.getNext());
+ }
}
-
+
return result;
}
-
+
private IJavaElement getHashkeyElement(IJavaElement elem)
{
return elem;
-
+
// This below code here causes that WorkingCopies and ICompilationUnits are
// treated identically. I.e. OTModelManager.getOTType() would return the identical
// IOTType for a working copy as it would return for the real ICompilationUnit.
// I don't think this is correct.
// Testcases that break with this behavior are RenameMethodInInterfaceTests.testMethodAlreadyExists*
// (carp)
-
+
// if (elem != null)
// {
-// if (elem.getElementType() == IJavaElement.COMPILATION_UNIT)
+// if (elem.getElementType() == IJavaElement.COMPILATION_UNIT)
// {
-// ICompilationUnit unit = (ICompilationUnit)elem;
+// ICompilationUnit unit = (ICompilationUnit)elem;
// if (unit.isWorkingCopy())
// {
// return unit.getPrimary();
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/MappingElementInfo.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/MappingElementInfo.java
index 1ce6d6700..89e5f1f50 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/MappingElementInfo.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/MappingElementInfo.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: MappingElementInfo.java 23416 2010-02-03 19:59:31Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -30,7 +30,7 @@ import org.eclipse.objectteams.otdt.internal.core.util.MethodData;
/**
* Data structure holding mapping related informations provided by the
* SourceElementParser and CompilationUnitStructureRequestor.
- *
+ *
* @author kaiser
* @version $Id: MappingElementInfo.java 23416 2010-02-03 19:59:31Z stephan $
*/
@@ -50,18 +50,18 @@ public class MappingElementInfo
private int declaredModifiers;
char[][] categories;
public Annotation[] annotations;
-
-
+
+
public MethodData getRoleMethod()
{
return this.roleMethod;
}
-
+
public MethodData[] getBaseMethods()
{
return this.baseMethods;
}
-
+
public IFieldAccessSpec getBaseField()
{
return this.baseField;
@@ -72,22 +72,22 @@ public class MappingElementInfo
return this.declarationSourceStart;
}
- public int getSourceStart()
+ public int getSourceStart()
{
return this.sourceStart;
}
- public int getSourceEnd()
+ public int getSourceEnd()
{
return this.sourceEnd;
}
-
+
public int getDeclarationSourceEnd()
{
return this.declarationSourceEnd;
}
-
- public char[] getCallinName()
+
+ public char[] getCallinName()
{
return this.callinName;
}
@@ -106,7 +106,7 @@ public class MappingElementInfo
{
this.roleMethod = data;
}
-
+
public void setBaseMethods(MethodData[] data)
{
this.baseMethods = data;
@@ -116,32 +116,32 @@ public class MappingElementInfo
{
this.baseField = data;
}
-
+
public void setDeclarationStart(int start)
{
this.declarationSourceStart = start;
}
-
- public void setSourceStart(int start)
+
+ public void setSourceStart(int start)
{
this.sourceStart = start;
}
-
- public void setSourceEnd(int end)
+
+ public void setSourceEnd(int end)
{
this.sourceEnd = end;
}
-
+
public void setDeclarationSourceEnd(int end)
{
this.declarationSourceEnd = end;
}
- public void setCallinName(char[] callinName)
+ public void setCallinName(char[] callinName)
{
this.callinName = callinName;
}
-
+
public void setCallinKind(int terminalTokenCallinKind)
{
this.callinKind = CallinMapping.convertTerminalTokenToModel(terminalTokenCallinKind);
@@ -151,12 +151,12 @@ public class MappingElementInfo
{
return this.hasSignature;
}
-
+
public void setHasSignature(boolean signature)
{
this.hasSignature = signature;
}
-
+
public void setCategories(char[][] categories)
{
this.categories = categories;
@@ -165,7 +165,7 @@ public class MappingElementInfo
public boolean isOverride() {
return this.isOverride;
}
-
+
public void setOverride(boolean flag) {
this.isOverride = flag;
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/MethodMapping.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/MethodMapping.java
index 7c1fd8f1a..b047118bf 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/MethodMapping.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/MethodMapping.java
@@ -6,7 +6,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Fraunhofer FIRST - extended API and implementation
@@ -66,10 +66,10 @@ import org.eclipse.objectteams.otdt.internal.core.util.MethodData;
* OT_COPY_PASTE from Member.getCategories()
* from Member.getJavadocRange()
* from SourceRefElement.getOpenableParent()
- *
+ *
* Generic Method Mapping, needs to be subclassed to add missing behaviour
* for IMethodMapping.getMappingKind()
- *
+ *
* @author jwloka
*/
public abstract class MethodMapping extends OTJavaElement implements IMethodMapping
@@ -93,7 +93,7 @@ public abstract class MethodMapping extends OTJavaElement implements IMethodMapp
int type,
IMethod correspondingJavaElem,
IType parent,
- MethodData roleMethodHandle,
+ MethodData roleMethodHandle,
boolean hasSignature)
{
super(type, correspondingJavaElem, parent);
@@ -104,7 +104,7 @@ public abstract class MethodMapping extends OTJavaElement implements IMethodMapp
this.declarationSourceEnd = declarationSourceEnd;
this.hasSignature = hasSignature;
}
-
+
public MethodMapping(int declarationSourceStart,
int sourceStart,
int sourceEnd,
@@ -112,7 +112,7 @@ public abstract class MethodMapping extends OTJavaElement implements IMethodMapp
int type,
IMethod correspondingJavaElem,
IType parent,
- MethodData roleMethodHandle,
+ MethodData roleMethodHandle,
boolean hasSignature,
boolean addAsChild)
{
@@ -124,7 +124,7 @@ public abstract class MethodMapping extends OTJavaElement implements IMethodMapp
this.declarationSourceEnd = declarationSourceEnd;
this.hasSignature = hasSignature;
}
-
+
// ==== memento generation: ====
@Override
public String getHandleIdentifier() {
@@ -152,14 +152,14 @@ public abstract class MethodMapping extends OTJavaElement implements IMethodMapp
return buff.toString();
}
protected void getNameForHandle(StringBuffer buff) { /* default: mapping has no name. */ }
- /**
+ /**
* Answer a char encoding the mapping kind with this information:
- * callin: a=after, b=before, r=replace;
+ * callin: a=after, b=before, r=replace;
* callout: o=regular, g=getter, s=setter [capital=isOverride].
*/
abstract protected char getMappingKindChar();
abstract protected void getBaseMethodsForHandle(StringBuffer buff);
-
+
protected void getMethodForHandle(IMethodSpec method, StringBuffer buff) {
escapeMementoName(buff, method.getSelector());
if (this.hasSignature) {
@@ -172,12 +172,12 @@ public abstract class MethodMapping extends OTJavaElement implements IMethodMapp
}
buff.append(OTJavaElement.OTEM_METHODMAPPING);
}
- // ==== retreive method spec from memento: ===
+ // ==== retreive method spec from memento: ===
public static MethodData createMethodData(MementoTokenizer memento, String selector) {
String cur = memento.nextToken();
if (cur.charAt(0) == JavaElement.JEM_METHOD)
cur = memento.nextToken(); // skip initial separator
- List<String> argTypes = new ArrayList<String>();
+ List<String> argTypes = new ArrayList<String>();
while (cur.charAt(0) != OTJavaElement.OTEM_METHODMAPPING) {
StringBuffer buffer = new StringBuffer();
while (cur.length() == 1 && Signature.C_ARRAY == cur.charAt(0)) { // backward compatible with 3.0 mementos
@@ -198,7 +198,7 @@ public abstract class MethodMapping extends OTJavaElement implements IMethodMapp
return new MethodData(selector, argTypes.toArray(new String[argTypes.size()]), null, returnType, false);
}
// ====
-
+
@Override
public IMethod getRoleMethod()
{
@@ -211,7 +211,7 @@ public abstract class MethodMapping extends OTJavaElement implements IMethodMapp
this.hasSearchedRoleMethod = true;
}
}
-
+
return this.roleMethod;
}
@@ -221,7 +221,7 @@ public abstract class MethodMapping extends OTJavaElement implements IMethodMapp
{
return this.roleMethodHandle;
}
-
+
public IMethod getRoleMethodThrowingException() throws JavaModelException
{
if (!this.hasSearchedRoleMethod) {
@@ -231,7 +231,7 @@ public abstract class MethodMapping extends OTJavaElement implements IMethodMapp
this.hasSearchedRoleMethod = true;
}
}
-
+
return this.roleMethod;
}
@@ -239,9 +239,9 @@ public abstract class MethodMapping extends OTJavaElement implements IMethodMapp
{
this.roleMethod = meth;
}
-
+
/**
- * Only returns the role-methods part -- subclasses must override and
+ * Only returns the role-methods part -- subclasses must override and
* construct the whole element name!
*/
@Override
@@ -260,19 +260,19 @@ public abstract class MethodMapping extends OTJavaElement implements IMethodMapp
{
return this.declarationSourceStart;
}
-
+
@Override
public int getSourceStart()
{
return this.sourceStart;
}
-
+
@Override
public int getSourceEnd()
{
return this.sourceEnd;
}
-
+
@Override
public int getDeclarationSourceEnd()
{
@@ -283,13 +283,13 @@ public abstract class MethodMapping extends OTJavaElement implements IMethodMapp
public boolean equals(Object obj)
{
MethodMapping other = (MethodMapping)obj;
-
+
return super.equals(other)
// && declarationSourceStart == other.getDeclarationSourceStart()
// && _declarationSourceEnd == other.getDeclarationSourceEnd()
&& getElementName().equals(other.getElementName());
}
-
+
@Override
@SuppressWarnings("nls")
public String toString()
@@ -309,11 +309,11 @@ public abstract class MethodMapping extends OTJavaElement implements IMethodMapp
// collect all parents in role type hierarchy
for (int idx = 0; idx < implicitParents.length; idx++)
{
- IType elem = implicitParents[idx];
+ IType elem = implicitParents[idx];
// build super class hierarchy for element
ITypeHierarchy hierarchy =
- elem.newSupertypeHierarchy( new NullProgressMonitor() );
+ elem.newSupertypeHierarchy( new NullProgressMonitor() );
IType[] superTypes = hierarchy.getAllSuperclasses(elem);
// add implicit parent...
@@ -322,12 +322,12 @@ public abstract class MethodMapping extends OTJavaElement implements IMethodMapp
if (superTypes.length > 0)
{
allParents.addAll(Arrays.asList(superTypes));
- }
+ }
}
return findMethod(allParents.toArray(new IType[allParents.size()]),
this.roleMethodHandle);
}
-
+
protected abstract IRoleType getDeclaringRole();
/**
@@ -347,7 +347,7 @@ public abstract class MethodMapping extends OTJavaElement implements IMethodMapp
for (int methIdx = 0; methIdx < methods.length; methIdx++)
{
IMethod tmpMethod = methods[methIdx];
- // check for equal method name and signature
+ // check for equal method name and signature
String selector = tmpMethod.getElementName();
if (isEqualMethod(methodHandle, tmpMethod, selector))
// return immediately on first match
@@ -359,7 +359,7 @@ public abstract class MethodMapping extends OTJavaElement implements IMethodMapp
AbstractCalloutMapping tmpMethod = (AbstractCalloutMapping)mapping;
if (tmpMethod == this)
continue; // callout fakes its own role method, but don't take it for real here!
- // check for equal method name and signature
+ // check for equal method name and signature
String selector = tmpMethod.getCorrespondingJavaElement().getElementName();
if (isEqualMethod(methodHandle, tmpMethod, selector))
// return immediately on first match
@@ -375,7 +375,7 @@ public abstract class MethodMapping extends OTJavaElement implements IMethodMapp
if (methods != null && methods.length == 1)
return methods[0];
}
- return null;
+ return null;
}
// helper for above to generalize over real methods and callouts:
@@ -386,14 +386,14 @@ public abstract class MethodMapping extends OTJavaElement implements IMethodMapp
return true;
return Util.equalArraysOrNull(foundMethodOrCallout.getParameterTypes(), baseMethodHandle.getArgumentTypes());
}
-
+
//{OT_COPY_PASTE: SourceRefElement, STATE: 3.4 M7
/**
* Return the first instance of IOpenable in the hierarchy of this
* type (going up the hierarchy from this type);
*/
@Override
- public IOpenable getOpenableParent()
+ public IOpenable getOpenableParent()
{
IJavaElement current = getParent();
while (current != null){
@@ -407,19 +407,19 @@ public abstract class MethodMapping extends OTJavaElement implements IMethodMapp
IOTType otElement = (IOTType) current;
current = otElement.getCorrespondingJavaElement();
}
-//haebor}
+//haebor}
current = current.getParent();
}
return null;
}
-
+
//{OTModelUpdate : many of this methods shouldn't be delegated
// to the corresponding method. Started with these three.
// public String getSource() throws JavaModelException
// {
// return getIMethod().getSource();
// }
-//
+//
// public ISourceRange getSourceRange() throws JavaModelException
// {
// return getIMethod().getSourceRange();
@@ -428,32 +428,32 @@ public abstract class MethodMapping extends OTJavaElement implements IMethodMapp
// {
// return getIMethod().getNameRange();
// }
-
+
//haebor}
/**
* @see ISourceReference
*/
@Override
- public String getSource() throws JavaModelException
+ public String getSource() throws JavaModelException
{
IOpenable openable = getOpenableParent();
IBuffer buffer = openable.getBuffer();
- if (buffer == null)
+ if (buffer == null)
{
return null;
}
ISourceRange range = getSourceRange();
int offset = range.getOffset();
int length = range.getLength();
- if (offset == -1 || length == 0 )
+ if (offset == -1 || length == 0 )
{
return null;
}
- try
+ try
{
return buffer.getText(offset, length);
- }
- catch(RuntimeException ex)
+ }
+ catch(RuntimeException ex)
{
return null;
}
@@ -462,16 +462,16 @@ public abstract class MethodMapping extends OTJavaElement implements IMethodMapp
* @see ISourceReference
*/
@Override
- public ISourceRange getSourceRange() throws JavaModelException
+ public ISourceRange getSourceRange() throws JavaModelException
{
//{ObjectTeams: we don't have an ElementInfo but we know sourcestart, sourceend
return new SourceRange(this.declarationSourceStart, this.declarationSourceEnd - this.declarationSourceStart + 1);
-//haebor}
-//orig:
+//haebor}
+//orig:
// SourceRefElementInfo info = (SourceRefElementInfo) getElementInfo();
// return info.getSourceRange();
}
-
+
//haebor}
@Override
public ISourceRange getNameRange() throws JavaModelException
@@ -483,18 +483,18 @@ public abstract class MethodMapping extends OTJavaElement implements IMethodMapp
protected String getSourceName() {
return super.getElementName();
}
-
-//delegates
+
+//delegates
IMethod getIMethod()
{
return (IMethod) getCorrespondingJavaElement();
}
-
+
public String[] getExceptionTypes() throws JavaModelException
{
return getIMethod().getExceptionTypes();
}
-
+
/**
* @deprecated (cf. IMethod.getTypeParameterSignatures())
*/
@@ -502,12 +502,12 @@ public abstract class MethodMapping extends OTJavaElement implements IMethodMapp
{
return getIMethod().getTypeParameterSignatures();
}
-
+
public int getNumberOfParameters()
{
return getIMethod().getNumberOfParameters();
}
-
+
public String[] getParameterNames() throws JavaModelException
{
if ( this.roleMethodHandle != null
@@ -515,12 +515,12 @@ public abstract class MethodMapping extends OTJavaElement implements IMethodMapp
return this.roleMethodHandle.getArgumentNames();
return getIMethod().getParameterNames();
}
-
+
public String[] getParameterTypes()
{
return getIMethod().getParameterTypes();
}
-
+
public String getReturnType() throws JavaModelException
{
if ( this.roleMethodHandle != null
@@ -528,61 +528,61 @@ public abstract class MethodMapping extends OTJavaElement implements IMethodMapp
return this.roleMethodHandle.getReturnType();
return getIMethod().getReturnType();
}
-
+
public String getSignature() throws JavaModelException
{
return getIMethod().getSignature();
}
-
+
public boolean isConstructor() throws JavaModelException
{
return getIMethod().isConstructor();
}
-
+
public boolean isMainMethod() throws JavaModelException
{
return getIMethod().isMainMethod();
}
-
+
public boolean isLambdaMethod() {
return false;
}
-
+
public boolean isSimilar(IMethod method)
{
return getIMethod().isSimilar(method);
}
-
+
@Override
public IClassFile getClassFile()
{
return getIMethod().getClassFile();
}
-
+
@Override
public ICompilationUnit getCompilationUnit()
{
return getIMethod().getCompilationUnit();
}
-
+
@Override
public IType getDeclaringType()
{
return getIMethod().getDeclaringType();
}
-
+
@Override
public int getFlags() throws JavaModelException
{
return 0; // SH: method mappings have no regular flags. orig: getIMethod().getFlags();
}
-
+
@Override
public IType getType(String name, int count)
{
return getIMethod().getType(name, count);
}
-
+
@Override
public boolean isBinary()
{
@@ -593,31 +593,31 @@ public abstract class MethodMapping extends OTJavaElement implements IMethodMapp
{
getIMethod().copy(container, sibling, rename, replace, monitor);
}
-
+
@Override
public void delete(boolean force, IProgressMonitor monitor) throws JavaModelException
{
getIMethod().delete(force, monitor);
}
-
+
@Override
public void move(IJavaElement container, IJavaElement sibling, String rename, boolean replace, IProgressMonitor monitor) throws JavaModelException
{
getIMethod().move(container, sibling, rename, replace, monitor);
}
-
+
@Override
public void rename(String name, boolean replace, IProgressMonitor monitor) throws JavaModelException
{
getIMethod().rename(name, replace, monitor);
}
-
+
@Override
public boolean hasSignature()
{
return this.hasSignature;
}
-
+
@Override
public boolean exists()
{
@@ -647,16 +647,16 @@ public abstract class MethodMapping extends OTJavaElement implements IMethodMapp
// See exists()
return getParent().isStructureKnown();
}
-
+
public String getKey() {
// km: perhaps: calculating own key would be better
return getIMethod().getKey();
}
-
+
public ITypeParameter[] getTypeParameters() throws JavaModelException {
return NO_TYPE_PARAMETERS; // must not return null!
}
-
+
public String[] getRawParameterNames() throws JavaModelException {
return EMPTY_STRING_ARRAY;
}
@@ -668,7 +668,7 @@ public abstract class MethodMapping extends OTJavaElement implements IMethodMapp
public boolean isResolved() {
return false;
}
-
+
@Override
public String getAttachedJavadoc(IProgressMonitor monitor) throws JavaModelException {
return null;
@@ -691,7 +691,7 @@ public abstract class MethodMapping extends OTJavaElement implements IMethodMapp
return categories;
}
}
-
+
//OT_COPY_PASTE from Member.getJavadocRange(). STATE: 3.4 M7
@Override
public ISourceRange getJavadocRange() throws JavaModelException {
@@ -715,7 +715,7 @@ public abstract class MethodMapping extends OTJavaElement implements IMethodMapp
try {
int docOffset= -1;
int docEnd= -1;
-
+
int terminal= scanner.getNextToken();
loop: while (true) {
switch(terminal) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/OTJavaElement.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/OTJavaElement.java
index c37bbcd50..1a21b51a7 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/OTJavaElement.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/OTJavaElement.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2012 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany, and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -42,7 +42,7 @@ import org.eclipse.objectteams.otdt.core.IOTJavaElement;
/**
* OTJavaElement implementation.
- *
+ *
* @author jwloka
* @version $Id: OTJavaElement.java 23416 2010-02-03 19:59:31Z stephan $
*/
@@ -61,7 +61,7 @@ public abstract class OTJavaElement extends Member implements IOTJavaElement
private int type;
private List<IJavaElement> children;
private IJavaElement correspondingJavaElem;
-
+
public OTJavaElement(int type, IJavaElement correspondingJavaElem, IJavaElement parent)
{
this(type, correspondingJavaElem, parent, true);
@@ -86,7 +86,7 @@ public abstract class OTJavaElement extends Member implements IOTJavaElement
{
return this.children.size() > 0;
}
-
+
@Override
public IJavaElement[] getChildren()
{
@@ -100,26 +100,26 @@ public abstract class OTJavaElement extends Member implements IOTJavaElement
return this.children.toArray( new IJavaElement[this.children.size()] );
}
}
-
+
public void addChild(IOTJavaElement child)
{
if (child != null)
this.children.add(child);
}
-
+
@Override
public IJavaElement getParent()
{
//{OTModelUpdate : if null return the parent of the wrapped java element
//orig: return _parent;
IJavaElement result = this.parent;
-
+
if (result == null)
result = getCorrespondingJavaElement().getParent();
-
+
return result;
-//jwl}
- }
+//jwl}
+ }
@Override
public String getElementName()
@@ -132,15 +132,15 @@ public abstract class OTJavaElement extends Member implements IOTJavaElement
{
return this.type;
}
-
+
/**
* Assumes instanceof check is done in subclasses!
*/
@Override
public boolean equals(Object obj)
{
- if (this == obj)
- {
+ if (this == obj)
+ {
return true;
}
if(obj == null)
@@ -149,12 +149,12 @@ public abstract class OTJavaElement extends Member implements IOTJavaElement
}
OTJavaElement other = (OTJavaElement)obj;
-
+
return getParent().equals(other.getParent())
&& (this.type == other.type)
&& getCorrespondingJavaElement().equals(other.getCorrespondingJavaElement());
}
-
+
/**
* COPIED basically from JavaElement
@@ -174,15 +174,15 @@ public abstract class OTJavaElement extends Member implements IOTJavaElement
@SuppressWarnings("nls")
public String toString()
{
- return "OTJavaElement " + getElementName();
+ return "OTJavaElement " + getElementName();
}
-
+
@Override
public IJavaElement getCorrespondingJavaElement()
{
return this.correspondingJavaElem;
}
-
+
@Override
public OTJavaElement resolved(Binding binding) {
return this;
@@ -205,7 +205,7 @@ public abstract class OTJavaElement extends Member implements IOTJavaElement
super.close();
((JavaElement) this.correspondingJavaElem).close();
}
-
+
@Override
public IJavaElement getAncestor(int ancestorType)
{
@@ -292,17 +292,17 @@ public abstract class OTJavaElement extends Member implements IOTJavaElement
{
return this.correspondingJavaElem.isStructureKnown();
}
-
+
@Override
public <T> T getAdapter(Class<T> adapter)
{
T result = super.getAdapter(adapter);
if (result == null)
result = this.correspondingJavaElem.getAdapter(adapter);
-
+
return result;
}
-
+
@Override
public void toString(int tab, StringBuffer buffer) {
for (int i = tab; i > 0; i--)
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/OTModel.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/OTModel.java
index 9b60ed813..5df3c9749 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/OTModel.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/OTModel.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: OTModel.java 23416 2010-02-03 19:59:31Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -33,46 +33,46 @@ import org.eclipse.objectteams.otdt.core.OTModelManager;
/**
* The Object Teams Model (OTM) main class. It provides an interface to
* handle the underlying mapping for addition, change and removal of IOTTypes.
- *
+ *
* @see org.eclipse.objectteams.otdt.internal.core.OTTypeMapping
- * @see org.eclipse.objectteams.otdt.internal.core.CompilationUnitMapping
+ * @see org.eclipse.objectteams.otdt.internal.core.CompilationUnitMapping
* @author jwloka
* @version $Id: OTModel.java 23416 2010-02-03 19:59:31Z stephan $
*/
-public class OTModel
+public class OTModel
{
private static OTModel _singleton;
-
+
private OTTypeMapping data = new OTTypeMapping();
-
+
private WeakHashSet /*<IType>*/ unopenedTypes = new WeakHashSet();
-
+
protected OTModel()
{
}
-
+
public static OTModel getSharedInstance()
{
if (_singleton == null)
{
_singleton = new OTModel();
}
-
+
return _singleton;
}
-
+
public static void dispose()
{
_singleton = null;
}
-
+
/** Register a type of which we don't yet have the flags. */
public void addUnopenedType(IType type) {
synchronized (this.unopenedTypes) {
this.unopenedTypes.add(type);
}
}
-
+
/**
* Add given element to the OTM.
*/
@@ -86,7 +86,7 @@ public class OTModel
/**
* Indicates whether a JavaModel element has a corresponding OTM element
- */
+ */
public boolean hasOTElementFor(IType type)
{
return this.data.contains(type);
@@ -95,10 +95,10 @@ public class OTModel
/**
* Returns associated OTM element for a given type if there is any.
* Also consider opening an _unopenedType on demand.
- *
- * @return corresponding OTM element or null if no corresponding
+ *
+ * @return corresponding OTM element or null if no corresponding
* element exists
- */
+ */
public IOTType getOTElement(IType type)
{
IOTType result = this.data.get(type);
@@ -120,16 +120,16 @@ public class OTModel
}
return null;
}
-
+
/**
* Removes the given type. Removal depends on its delta state.
- *
+ *
* @param type - element to remove
* @param hasChanged - false forces removal,
* true takes care about changed JavaModel elements
* since we neither know the original element nor
- * anything about its existence
- */
+ * anything about its existence
+ */
public void removeOTElement(IType type, boolean hasChanged)
{
if ((type != null) && (this.data.contains(type)))
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/OTType.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/OTType.java
index 2a0f86602..a0dd591ff 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/OTType.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/OTType.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: OTType.java 23417 2010-02-03 20:13:55Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -66,20 +66,20 @@ import org.eclipse.objectteams.otdt.internal.core.search.matching.ReferenceToTea
/**
* Generic OTType implementation. Actually this instance is only used to
* represent teams.
- *
+ *
* @author jwloka
* @version $Id: OTType.java 23417 2010-02-03 20:13:55Z stephan $
*/
public class OTType extends OTJavaElement implements IOTType
{
int flags;
-
+
public OTType(int type, IType correspondingJavaType, IJavaElement parent, int flags)
{
super(type, correspondingJavaType, parent);
this.flags = flags;
}
-
+
public OTType(int type, IType correspondingJavaType, IJavaElement parent, int flags, boolean addToParent)
{
super(type, correspondingJavaType, parent, addToParent);
@@ -109,7 +109,7 @@ public class OTType extends OTJavaElement implements IOTType
{
return ((ICompilationUnit)javaParent).getCorrespondingResource();
}
-
+
return null;
}
@@ -122,38 +122,38 @@ public class OTType extends OTJavaElement implements IOTType
{
List<IType> result = new LinkedList<IType>();
IJavaElement[] children = getChildren();
-
+
for (int idx = 0; idx < children.length; idx++)
{
if (children[idx] instanceof IOTType)
{
result.add((IType)children[idx]);
}
- }
-
+ }
+
return result.toArray(new IType[result.size()]);
- }
-
+ }
+
/**
* {@inheritDoc}.
*/
@Override
- public IType[] getRoleTypes(int which) throws JavaModelException
+ public IType[] getRoleTypes(int which) throws JavaModelException
{
return getRoleTypes(which, null);
}
-
+
/**
* {@inheritDoc}
*/
@Override
- public IType[] getRoleTypes(int which, String roleName) throws JavaModelException
+ public IType[] getRoleTypes(int which, String roleName) throws JavaModelException
{
ArrayList<IType> result = new ArrayList<IType>();
IType[] typesToConsider = null;
-
+
final int BOTH_HIERARCHIES_MASK = IMPLICTLY_INHERITED | EXPLICITLY_INHERITED;
-
+
if ((which & BOTH_HIERARCHIES_MASK) != 0)
{
ITypeHierarchy hierarchy = ((IType)getCorrespondingJavaElement()).newSupertypeHierarchy(new NullProgressMonitor());
@@ -174,16 +174,16 @@ public class OTType extends OTJavaElement implements IOTType
if (typesToConsider == null)
throw new IllegalArgumentException("EXCLUDE_SELF without a hierarchy requested"); //$NON-NLS-1$
-
+
typesToConsider = fixTypesToConsider(typesToConsider);
-
+
//TODO(haebor) consider that roles from binaries can't be differentiated since external roles are inlined
if ((which & ROLEFILE) != 0)
{
// packageSearchGetRoleFiles(result);
result.addAll(searchEngineGetRoleFiles(typesToConsider, roleName));
}
-
+
if ((which & INLINED) != 0)
{
for (int i = 0; i < typesToConsider.length; i++)
@@ -197,7 +197,7 @@ public class OTType extends OTJavaElement implements IOTType
}
}
}
-
+
return result.toArray(new IType[result.size()]);
}
@@ -206,11 +206,11 @@ public class OTType extends OTJavaElement implements IOTType
// default case:
return hierarchy.getAllSuperclasses(this);
}
-
+
private static IType[] fixTypesToConsider(IType[] typesToConsider)
{
ArrayList<IType> result = new ArrayList<IType>(typesToConsider.length);
-
+
for (int i = 0; i < typesToConsider.length; i++)
{
IType type = typesToConsider[i];
@@ -221,7 +221,7 @@ public class OTType extends OTJavaElement implements IOTType
result.add(role);
}
}
-
+
return result.toArray(new IType[result.size()]);
}
@@ -229,7 +229,7 @@ public class OTType extends OTJavaElement implements IOTType
{
final List<IType> searchResult = new ArrayList<IType>();
char[] role = (roleName == null) ? null : roleName.toCharArray();
-
+
try
{
@@ -242,15 +242,15 @@ public class OTType extends OTJavaElement implements IOTType
searchResult.add((IType)match.getElement());
}
};
-
+
for (int i = 0; i < teamsToConsider.length; i++)
{
IType currentType = teamsToConsider[i];
IOTType ottype = OTModelManager.getOTElement(currentType);
if (ottype == null || !ottype.isTeam())
continue;
-
- SearchPattern pattern =
+
+ SearchPattern pattern =
new ReferenceToTeamPackagePattern(currentType.getFullyQualifiedName().toCharArray(), role,
SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE);
searchEngine.search(pattern, scope, requestor, new NullProgressMonitor());
@@ -272,13 +272,13 @@ public class OTType extends OTJavaElement implements IOTType
{
return getRoleTypes(IOTType.INLINED | IOTType.ROLEFILE);
}
-
+
@Override
public int getFlags()
{
return this.flags;
}
-
+
@Override
public IType getRoleType(String simpleName)
{
@@ -297,10 +297,10 @@ public class OTType extends OTJavaElement implements IOTType
return null;
}
}
-
+
return null;
}
-
+
@Override
public IType searchRoleType(String simpleName) {
try
@@ -308,7 +308,7 @@ public class OTType extends OTJavaElement implements IOTType
List<IType> roleFiles = searchEngineGetRoleFiles(new IType[] { this }, simpleName);
if (roleFiles.size() > 0)
return roleFiles.get(0); // actually there may be more, due to multiple src-folders...
-
+
// previous implementation without search engine
// String encTeamName = this.getFullyQualifiedName();
// String qualName = encTeamName + "." + simpleName;
@@ -321,20 +321,20 @@ public class OTType extends OTJavaElement implements IOTType
catch (JavaModelException ignored) { /* not found */ }
return null;
}
-
+
@Override
public boolean equals(Object obj)
{
if (obj == this.getCorrespondingJavaElement())
return true;
-
+
if(!(obj instanceof OTType))
{
return false;
}
OTType other = (OTType)obj;
-
+
return super.equals(other)
&& getFlags() == other.getFlags();
}
@@ -345,12 +345,12 @@ public class OTType extends OTJavaElement implements IOTType
{
return "OTType " + getElementName() + " for type: " + getCorrespondingJavaElement().toString();
}
-
+
private IType getIType()
{
return (IType)super.getCorrespondingJavaElement();
}
-
+
/**
* @deprecated Use {@link #codeComplete(char[],int,int,char[][],char[][],int[],boolean,CompletionRequestor)} instead.
*/
@@ -369,13 +369,13 @@ public class OTType extends OTJavaElement implements IOTType
}
@Override
public void codeComplete(char[] snippet, int insertion, int position, char[][] localVariableTypeNames, char[][] localVariableNames, int[] localVariableModifiers, boolean isStatic, CompletionRequestor requestor, IProgressMonitor monitor)
- throws JavaModelException
+ throws JavaModelException
{
- getIType().codeComplete(snippet, insertion, position, localVariableTypeNames, localVariableNames, localVariableModifiers, isStatic, requestor, monitor);
+ getIType().codeComplete(snippet, insertion, position, localVariableTypeNames, localVariableNames, localVariableModifiers, isStatic, requestor, monitor);
}
@Override
public void codeComplete(char[] snippet, int insertion, int position, char[][] localVariableTypeNames, char[][] localVariableNames, int[] localVariableModifiers, boolean isStatic, CompletionRequestor requestor, WorkingCopyOwner owner, IProgressMonitor monitor)
- throws JavaModelException
+ throws JavaModelException
{
getIType().codeComplete(snippet, insertion, position, localVariableTypeNames, localVariableNames, localVariableModifiers, isStatic, requestor, owner, monitor);
}
@@ -466,7 +466,7 @@ public class OTType extends OTJavaElement implements IOTType
public IAnnotation[] getAnnotations() throws JavaModelException {
return getIType().getAnnotations();
}
-
+
@Override
public IPackageFragment getPackageFragment()
{
@@ -677,7 +677,7 @@ public class OTType extends OTJavaElement implements IOTType
public ITypeRoot getTypeRoot() {
return getIType().getTypeRoot();
}
-
+
@Override
public IType getDeclaringType()
{
@@ -803,7 +803,7 @@ public class OTType extends OTJavaElement implements IOTType
super.close();
OTModelManager.removeOTElement(this);
}
-
+
@Override
protected Object createElementInfo() {
throw new UnsupportedOperationException("Not yet implemented for OTType");
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/OTTypeList.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/OTTypeList.java
index ee1c6a736..7157caba7 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/OTTypeList.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/OTTypeList.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: OTTypeList.java 23416 2010-02-03 19:59:31Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -31,7 +31,7 @@ import org.eclipse.objectteams.otdt.core.IOTType;
/**
* Hashed list of IOTTypes.
- *
+ *
* @author kaiser
* @version $Id: OTTypeList.java 23416 2010-02-03 19:59:31Z stephan $
*/
@@ -63,7 +63,7 @@ public class OTTypeList
{
return;
}
-
+
this.data.put(elem.getFullyQualifiedName(), elem);
}
@@ -78,7 +78,7 @@ public class OTTypeList
}
}
}
-
+
public void remove(String simpleName)
{
if (simpleName == null)
@@ -87,16 +87,16 @@ public class OTTypeList
}
this.data.remove(simpleName);
}
-
+
public int getSize()
{
return this.data.size();
}
-
+
public OTTypeIterator getIterator()
{
final Iterator<IOTType> _rawIter = this.data.values().iterator();
-
+
return new OTTypeIterator()
{
@Override
@@ -104,7 +104,7 @@ public class OTTypeList
{
return _rawIter.hasNext();
}
-
+
@Override
public OTType getNext()
{
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/OTTypeMapping.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/OTTypeMapping.java
index a901eb4c9..dfd93aeb3 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/OTTypeMapping.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/OTTypeMapping.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: OTTypeMapping.java 23416 2010-02-03 19:59:31Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -31,8 +31,8 @@ import org.eclipse.objectteams.otdt.core.IOTType;
/**
- * Maps an IType from the JavaModel to an OTType.
- *
+ * Maps an IType from the JavaModel to an OTType.
+ *
* @author kaiser
* @version $Id: OTTypeMapping.java 23416 2010-02-03 19:59:31Z stephan $
*/
@@ -46,48 +46,48 @@ public class OTTypeMapping
}
public void put(IType type, IOTType otType)
- {
+ {
if (type != null && otType != null)
{
IJavaElement key= getParent(type);
-
+
if (this.data.contains(key))
{
- this.data.getOTTypes(key).add(otType);
+ this.data.getOTTypes(key).add(otType);
}
else
{
this.data.add(key, new OTTypeList(otType));
- }
+ }
}
}
/**
- * Removes the given IType from cache and all its children. The entire
- * mapping (ICompilationUnit::OTTypeList) is remove if no more bound type
+ * Removes the given IType from cache and all its children. The entire
+ * mapping (ICompilationUnit::OTTypeList) is remove if no more bound type
* is cached.
*/
public void remove(IType type)
{
if (type != null)
{
- ICompilationUnit unit = type.getCompilationUnit();
-
+ ICompilationUnit unit = type.getCompilationUnit();
+
OTTypeList list = this.data.getOTTypes(unit);
IOTType otType = get(type);
if (otType != null)
- {
+ {
IType[] innerTypes = otType.getInnerTypes();
for (int idx = 0; idx < innerTypes.length; idx++)
{
// TODO(jwl): simplify later
remove((IType)((IOTType)innerTypes[idx]).getCorrespondingJavaElement());
- }
-
+ }
+
list.remove(type.getElementName());
}
-
+
if (list.getSize() == 0)
{
this.data.remove(unit);
@@ -97,49 +97,49 @@ public class OTTypeMapping
/**
* Removes an changed IType, if it is not of the same instance as the given
- * IType. This method is used for JavaElementDelta.ElementChanged. It
+ * IType. This method is used for JavaElementDelta.ElementChanged. It
* preserves the newly created type from removal.
- *
+ *
* @see org.eclipse.objectteams.otdt.core.OTModelReconcileListener
*/
public void removeChangedElement(IType elem)
{
IOTType otType = get(elem);
-
+
// removes changed element only if they are not equal, this is necessary
// to avoid removal if an element has been newly created
if ((otType != null) && (otType.getCorrespondingJavaElement() != elem))
{
remove(elem);
- }
+ }
}
public IOTType get(IType type)
{
IOTType otElem = null;
-
- if (type != null)
+
+ if (type != null)
{
IJavaElement key = getParent(type);
if (key != null)
{
OTTypeList elems = this.data.getOTTypes(key);
-
+
if (elems != null)
{
- otElem = elems.get(type.getFullyQualifiedName());
+ otElem = elems.get(type.getFullyQualifiedName());
}
}
}
-
+
return otElem;
}
-
+
public List<OTType> getOTElements()
{
return this.data.getOTElements();
}
-
+
public boolean contains(IType type)
{
return (get(type) != null);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/PhantomType.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/PhantomType.java
index 3c42438e2..f715cbae8 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/PhantomType.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/PhantomType.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: PhantomType.java 23416 2010-02-03 19:59:31Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -60,11 +60,11 @@ import org.eclipse.objectteams.otdt.core.IPhantomType;
* for roles created by ObjectTeams copy inheritance. A PhantomType wraps
* its 'nearest' declared (non-phantom) implicit super role,
* but is located in a different team context.
- *
+ *
* A PhantomType wraps it's 'nearest' tsuper in _realType,
- * but may store any number of tsuper types from different levels of team nesting.
+ * but may store any number of tsuper types from different levels of team nesting.
* However, only direct tsupers are remembered, not tsupers of tsupers.
- *
+ *
* Most methods of this type are forwarded to the nearest real role type
* or the enclosing team type.
* A PhantomType (as its wrappee) may also be a nested team.
@@ -77,11 +77,11 @@ public class PhantomType implements IPhantomType
private IType _realType;
private IType _enclosingTeam;
private IType[] _allRealTypes;
-
+
public PhantomType(IType enclosingTeam, IType tsuperRole)
{
this._enclosingTeam = enclosingTeam;
- this.setRealType(tsuperRole);
+ this.setRealType(tsuperRole);
}
public PhantomType(IType enclosingTeam, IType[] allRealTsuperRoles)
@@ -90,9 +90,9 @@ public class PhantomType implements IPhantomType
this._realType = allRealTsuperRoles[0];
this._allRealTypes = allRealTsuperRoles;
}
-
+
// === cannot code complete inside a phantom role for which no source exists: ===
-
+
/**
* @see org.eclipse.jdt.core.IType#codeComplete(char[], int, int, char[][], char[][], int[], boolean, org.eclipse.jdt.core.ICompletionRequestor)
* @deprecated Use {@link #codeComplete(char[],int,int,char[][],char[][],int[],boolean,CompletionRequestor)} instead.
@@ -125,7 +125,7 @@ public class PhantomType implements IPhantomType
char[][] localVariableTypeNames, char[][] localVariableNames,
int[] localVariableModifiers, boolean isStatic,
CompletionRequestor requestor, IProgressMonitor monitor)
- throws JavaModelException
+ throws JavaModelException
{
handleUnsupported();
}
@@ -135,11 +135,11 @@ public class PhantomType implements IPhantomType
char[][] localVariableTypeNames, char[][] localVariableNames,
int[] localVariableModifiers, boolean isStatic,
CompletionRequestor requestor, WorkingCopyOwner owner,
- IProgressMonitor monitor) throws JavaModelException
+ IProgressMonitor monitor) throws JavaModelException
{
handleUnsupported();
}
-
+
@Override
public void codeComplete(char[] snippet, int insertion, int position, char[][] localVariableTypeNames, char[][] localVariableNames, int[] localVariableModifiers, boolean isStatic, CompletionRequestor requestor) throws JavaModelException {
handleUnsupported();
@@ -258,7 +258,7 @@ public class PhantomType implements IPhantomType
{
return this._enclosingTeam.getFullyQualifiedName(enclosingTypeSeparator)
+ enclosingTypeSeparator
- + getElementName();
+ + getElementName();
}
/* (non-Javadoc)
@@ -315,7 +315,7 @@ public class PhantomType implements IPhantomType
private String getSimpleMethodSignature(IMethod method) {
String[] params= method.getParameterTypes(); // TODO(SH) types may be type variables (see MethodProposalInfo.isSameMethodSignature)
StringBuffer sign = new StringBuffer();
- for (int i = 0; i < params.length; i++) {
+ for (int i = 0; i < params.length; i++) {
String simpleName= Signature.getSimpleName(params[i]);
sign.append(simpleName);
if (i>0)
@@ -332,7 +332,7 @@ public class PhantomType implements IPhantomType
{
return this._enclosingTeam.getPackageFragment();
}
-
+
/**
* If the type is a role file decide for the role files CU.
* @see IMember#getTypeRoot()
@@ -680,10 +680,10 @@ public class PhantomType implements IPhantomType
*/
@Override
public int getFlags() throws JavaModelException
- {
+ {
return this._realType.getFlags();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.jdt.core.IMember#getNameRange()
*/
@@ -968,19 +968,19 @@ public class PhantomType implements IPhantomType
{
return this._realType.getAdapter(adapter);
}
-
+
@Override
@SuppressWarnings("nls")
public String toString()
{
return "(" + getFullyQualifiedName() + "|" + this._realType.getFullyQualifiedName('.') + ")";
}
-
+
public IType getRealType()
{
return this._realType;
}
-
+
private void setRealType(IType type)
{
if (type instanceof PhantomType)
@@ -988,13 +988,13 @@ public class PhantomType implements IPhantomType
else
this._realType = type;
}
-
+
@Override
public int hashCode()
- {
+ {
return getFullyQualifiedName().hashCode();
}
-
+
@Override
public boolean equals(Object arg0)
{
@@ -1002,7 +1002,7 @@ public class PhantomType implements IPhantomType
{
return false;
}
-
+
PhantomType other = (PhantomType)arg0;
return this._enclosingTeam.equals(other._enclosingTeam)
&& (this._realType.equals(other._realType));
@@ -1013,17 +1013,17 @@ public class PhantomType implements IPhantomType
throw new UnsupportedOperationException("Unsupported operation on PhantomType " //$NON-NLS-1$
+ getFullyQualifiedName());
}
-
+
@Override
public ITypeParameter[] getTypeParameters() throws JavaModelException {
return this._realType.getTypeParameters();
}
-
+
@Override
public boolean isResolved() {
return this._realType.isResolved() && this._enclosingTeam.isResolved();
}
-
+
// TODO: check whether we need to support any of those methods
@Override
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/ResolvedCallinMapping.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/ResolvedCallinMapping.java
index ef32801db..949c437e0 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/ResolvedCallinMapping.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/ResolvedCallinMapping.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: ResolvedCallinMapping.java 23416 2010-02-03 19:59:31Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -28,11 +28,11 @@ import org.eclipse.objectteams.otdt.internal.core.util.MethodData;
public class ResolvedCallinMapping extends CallinMapping {
private String uniqueKey;
-
+
/*
* undocumented.
*/
- public ResolvedCallinMapping(
+ public ResolvedCallinMapping(
int declarationStart,
int sourceStart,
int sourceEnd,
@@ -44,15 +44,15 @@ public class ResolvedCallinMapping extends CallinMapping {
MethodData roleMethodHandle,
MethodData[] baseMethodHandles,
boolean hasSignature,
- String uniqueKey)
+ String uniqueKey)
{
- super(declarationStart, sourceStart, sourceEnd, declarationEnd,
- parent, corrJavaMeth,
- name, callinKind, roleMethodHandle, baseMethodHandles,
+ super(declarationStart, sourceStart, sourceEnd, declarationEnd,
+ parent, corrJavaMeth,
+ name, callinKind, roleMethodHandle, baseMethodHandles,
hasSignature, /*addAsChild*/false);
this.uniqueKey = uniqueKey;
}
-
+
@Override
public String getKey() {
return this.uniqueKey;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/ResolvedCalloutMapping.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/ResolvedCalloutMapping.java
index 3df883818..83eeaeb6f 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/ResolvedCalloutMapping.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/ResolvedCalloutMapping.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: ResolvedCalloutMapping.java 23416 2010-02-03 19:59:31Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -28,11 +28,11 @@ import org.eclipse.objectteams.otdt.internal.core.util.MethodData;
public class ResolvedCalloutMapping extends CalloutMapping {
private String uniqueKey;
-
+
/*
* See class comments.
*/
- public ResolvedCalloutMapping(
+ public ResolvedCalloutMapping(
int declarationStart,
int sourceStart,
int sourceEnd,
@@ -49,7 +49,7 @@ public class ResolvedCalloutMapping extends CalloutMapping {
super(declarationStart, sourceStart, sourceEnd, declarationEnd, elementType, role, corrJavaMethod, roleMethodHandle, baseMethodHandle, hasSignature, isOverride, declaredModifiers, false);
this.uniqueKey = uniqueKey;
}
-
+
@Override
public String getKey() {
return this.uniqueKey;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/ResolvedCalloutToFieldMapping.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/ResolvedCalloutToFieldMapping.java
index 49074cb0f..215d5877a 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/ResolvedCalloutToFieldMapping.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/ResolvedCalloutToFieldMapping.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2016 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: ResolvedCalloutToFieldMapping.java 23416 2010-02-03 19:59:31Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -33,7 +33,7 @@ public class ResolvedCalloutToFieldMapping extends CalloutToFieldMapping {
/*
* See class comments.
*/
- public ResolvedCalloutToFieldMapping(
+ public ResolvedCalloutToFieldMapping(
int declarationSourceStart,
int sourceStart,
int sourceEnd,
@@ -46,12 +46,12 @@ public class ResolvedCalloutToFieldMapping extends CalloutToFieldMapping {
boolean hasSignature,
boolean isOverride,
int declaredModifiers,
- String uniqueKey) {
-
+ String uniqueKey) {
+
super(declarationSourceStart, sourceStart, sourceEnd, declarationSourceEnd, elementType, role, corrJavaMethod, roleMethodHandle, baseFieldHandle, hasSignature, isOverride, declaredModifiers, false);
this.uniqueKey = uniqueKey;
}
-
+
@Override
public String getKey() {
return this.uniqueKey;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/RoleFileType.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/RoleFileType.java
index 2143c2607..6e7004e04 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/RoleFileType.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/RoleFileType.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: RoleFileType.java 23416 2010-02-03 19:59:31Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -53,15 +53,15 @@ public class RoleFileType extends RoleType implements IRoleFileType
Util.log(ex);
}
- return null;
+ return null;
}
-
+
@Override
public boolean isRoleFile()
{
return true;
}
-
+
@Override
public String getFullyQualifiedName(char enclosingTypeSeparator) {
IType teamType = this.getTeamJavaType();
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/RoleType.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/RoleType.java
index d2c6eb02c..71212853e 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/RoleType.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/RoleType.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2012 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany, and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -52,7 +52,7 @@ import org.eclipse.osgi.util.NLS;
/**
* IRoleType implementation
- *
+ *
* @author jwloka
*/
public class RoleType extends OTType implements IRoleType
@@ -73,7 +73,7 @@ public class RoleType extends OTType implements IRoleType
}
/**
- * A role's team is represented by the element's team
+ * A role's team is represented by the element's team
*/
@Override
public IOTType getTeam()
@@ -88,7 +88,7 @@ public class RoleType extends OTType implements IRoleType
// nope.
return null;
}
-
+
@Override
public IType getTeamJavaType() {
return ((IType)getCorrespondingJavaElement()).getDeclaringType();
@@ -101,7 +101,7 @@ public class RoleType extends OTType implements IRoleType
}
/**
- * @param type An ORed combination of IRoleType.CALLINS and IRoleType.CALLOUTS
+ * @param type An ORed combination of IRoleType.CALLINS and IRoleType.CALLOUTS
*/
@Override
public IMethodMapping[] getMethodMappings(int type)
@@ -118,10 +118,10 @@ public class RoleType extends OTType implements IRoleType
NLS.bind("Retrieving callouts of role class ''{0}'' failed!", new Object[] {getElementName()})); //$NON-NLS-1$
}
}
-
+
return result.toArray(new IMethodMapping[result.size()]);
}
-
+
private void filterMethodMappings(IJavaElement[] children, int type, List<IMethodMapping> result) {
for (int idx = 0; idx < children.length; idx++) {
if (children[idx] instanceof IMethodMapping) {
@@ -149,7 +149,7 @@ public class RoleType extends OTType implements IRoleType
{
return false;
}
-
+
public void setBaseClass(IType baseClass)
{
this.baseClass = baseClass;
@@ -164,7 +164,7 @@ public class RoleType extends OTType implements IRoleType
if (this.baseClass == null)
{
JavaModelException jex = null;
-
+
try
{
// System.out.println("RoleType.getBaseClass(): " + getElementName());
@@ -185,9 +185,9 @@ public class RoleType extends OTType implements IRoleType
if (this.baseClass == null && (this.baseClassName != null || jex != null))
{
IStatus status = new Status(
- IStatus.WARNING,
- JavaCore.PLUGIN_ID,
- IStatus.OK,
+ IStatus.WARNING,
+ JavaCore.PLUGIN_ID,
+ IStatus.OK,
NLS.bind("Base class for role {0} not found.", //$NON-NLS-1$
new Object[] { getTypeQualifiedName('.') }),
jex
@@ -195,10 +195,10 @@ public class RoleType extends OTType implements IRoleType
throw new JavaModelException(new CoreException(status));
}
}
-
+
return this.baseClass;
}
-
+
@Override
public String getBaseclassName() {
if (this._baseAnchor != null)
@@ -222,20 +222,20 @@ public class RoleType extends OTType implements IRoleType
}
RoleType other = (RoleType)obj;
-
+
// only compare base class name, resolving the class is too expensive and unnecessary.
if ((this.baseClassName==null) != (other.baseClassName==null))
{
return false;
}
- if (this.baseClassName != null && !this.baseClassName.equals(other.baseClassName))
+ if (this.baseClassName != null && !this.baseClassName.equals(other.baseClassName))
{
return false;
}
-
+
return super.equals(other);
}
-
+
@Override
@SuppressWarnings("nls")
public String toString()
@@ -245,26 +245,26 @@ public class RoleType extends OTType implements IRoleType
/**
* Tries to resolve this role's base class in the JavaModel.
- *
- * @return resolved JavaModel type or null if nothing found
+ *
+ * @return resolved JavaModel type or null if nothing found
*/
private IType findBaseClass(ITypeHierarchy hierarchy) throws JavaModelException
{
if (this.baseClassName == null)
return findSuperBaseClass(hierarchy);
-
+
if (this._baseAnchor != null)
{
IOTType baseAnchorType = resolveBaseAnchor();
if (baseAnchorType == null)
return null;
-
+
// lookup via the anchor needs simple name:
String simpleBaseName = this.baseClassName;
int dotpos = this.baseClassName.lastIndexOf('.');
if (dotpos != -1)
simpleBaseName = this.baseClassName.substring(dotpos+1);
-
+
IType[] baseClasses = baseAnchorType.getRoleTypes(IOTType.ALL, simpleBaseName);
if (baseClasses.length >= 1)
return baseClasses[0]; // the bottom-most in the hierarchy
@@ -284,7 +284,7 @@ public class RoleType extends OTType implements IRoleType
IType baseType = getBaseOf(currentType, hierarchy);
if (baseType != null)
return baseType;
- currentType = hierarchy.getSuperclass(currentType); // relies on OTTypeHierarchies whereby getSuperclass() produces the full (t)super linearization
+ currentType = hierarchy.getSuperclass(currentType); // relies on OTTypeHierarchies whereby getSuperclass() produces the full (t)super linearization
}
return null;
}
@@ -296,7 +296,7 @@ public class RoleType extends OTType implements IRoleType
IOTType otType = OTModelManager.getOTElement(type);
if (otType == null) // i.e. non-role superclass
return null;
-
+
if (otType.isRole())
{
RoleType tsuperRole = (RoleType) otType;
@@ -305,7 +305,7 @@ public class RoleType extends OTType implements IRoleType
return tsuperBase;
}
}
-
+
return null;
}
@@ -313,11 +313,11 @@ public class RoleType extends OTType implements IRoleType
{
if (this._baseAnchor == null)
return null;
-
+
IOTType enclosingTeam = getTeam();
if (enclosingTeam == null || !enclosingTeam.exists())
return null;
-
+
IType currentType= enclosingTeam;
String anchorField= this._baseAnchor;
int pos= this._baseAnchor.lastIndexOf('.');
@@ -335,7 +335,7 @@ public class RoleType extends OTType implements IRoleType
IRoleType enclosingRole = (IRoleType)currentOTType;
assert(enclosingRole != this);
-
+
anchorType = enclosingRole.getBaseClass();
}
else
@@ -358,13 +358,13 @@ public class RoleType extends OTType implements IRoleType
if (fieldType != null)
anchorType = resolveInType(enclosingTeam, fieldType);
}
-
+
if (anchorType == null || !anchorType.exists())
return null;
return OTModelManager.getOTElement(anchorType);
}
-
+
IType resolveInType(IOTType referenceType, String type) throws JavaModelException
{
// perform a search by name in the scope of this type
@@ -375,12 +375,12 @@ public class RoleType extends OTType implements IRoleType
{
String fqBaseName = Util.concatenateName(qualifiedTypes[0][0], qualifiedTypes[0][1], '.');
// get JavaModel element by resolved name
- return referenceType.getJavaProject().findType(fqBaseName);
+ return referenceType.getJavaProject().findType(fqBaseName);
}
-
+
return null;
}
-
+
@Override
public IType[] getTSuperRoles() throws JavaModelException {
ArrayList<IType> tsuperRoles = new ArrayList<IType>();
@@ -409,7 +409,7 @@ public class RoleType extends OTType implements IRoleType
}
// no direct tsuper, search in tsuper-team if some exist:
if (teamType.isRole())
- for (IType tsuperTeam : ((IRoleType)teamType).getTSuperRoles())
+ for (IType tsuperTeam : ((IRoleType)teamType).getTSuperRoles())
checkAddTSuperRole(tsuperTeam.getFullyQualifiedName('.'), tsuperRoles);
return tsuperRoles.toArray(new IType[tsuperRoles.size()]);
}
@@ -439,7 +439,7 @@ public class RoleType extends OTType implements IRoleType
// showErrorMessage(ActionMessages.getString("StepIntoSelectionActionDelegate.Step_into_selection_only_available_for_types_in_Java_projects._1")); //$NON-NLS-1$
// return null;
// }
-//
+//
// IMethod method = null;
// try {
// IJavaElement[] resolve = codeAssist.codeSelect(textSelection.getOffset(), 0);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/SourceMethodMappingInfo.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/SourceMethodMappingInfo.java
index 5e72f4a27..b681f812b 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/SourceMethodMappingInfo.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/SourceMethodMappingInfo.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010 Stephan Herrmann
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -31,7 +31,7 @@ public class SourceMethodMappingInfo extends AnnotatableInfo {
private static final int CALLOUT= 4;
private static final int GET = 5;
private static final int SET = 6;
-
+
private String[] roleParameterNames;
// other bits would change the effective signature
@@ -39,28 +39,28 @@ public class SourceMethodMappingInfo extends AnnotatableInfo {
private String[][] baseParameterNames;
private String[][] baseParameterTypes;
private String[] baseReturnTypes;
-
+
private int _mappingKind=0;
private boolean _hasSignature;
private boolean _isOverride; // callout override.
private int _declaredModifiers;
-
+
private char[] callinName = null;
-
+
public void setRoleArgumentNames(String[] parameterNames) {
- this.roleParameterNames = parameterNames;
+ this.roleParameterNames = parameterNames;
}
public void setBaseArgumentNames(String[][] parameterNames) {
checkBaseCount(parameterNames.length);
- this.baseParameterNames = parameterNames;
+ this.baseParameterNames = parameterNames;
}
public void setBaseArgumentTypes(String[][] parameterTypes) {
checkBaseCount(parameterTypes.length);
this.baseParameterTypes = parameterTypes;
}
-
+
public void setBaseReturnType(String[] returnTypes) {
checkBaseCount(returnTypes.length);
this.baseReturnTypes = returnTypes;
@@ -72,27 +72,27 @@ public class SourceMethodMappingInfo extends AnnotatableInfo {
else if (this.nBaseMethods != baseCount)
throw new IllegalArgumentException("Mismatching array size: "+this.nBaseMethods+" vs. "+baseCount); //$NON-NLS-1$ //$NON-NLS-2$
}
-
+
public void setCallinKind(int kind, boolean hasSignature, char[] name) {
this._mappingKind = kind;
this._hasSignature = hasSignature;
this.callinName = name;
}
-
+
public void setCalloutKind(boolean override, int declaredModifiers) {
this._isOverride = override;
this._declaredModifiers = declaredModifiers;
this._mappingKind = CALLOUT;
-
+
}
public void setCalloutKind(boolean override, int declaredModifiers, boolean isSetter) {
this._isOverride = override;
this._declaredModifiers = declaredModifiers;
this._mappingKind = isSetter ? SET : GET;
-
+
}
-
+
public boolean modifiersEqual(SourceMethodMappingInfo other) {
if (this._hasSignature != other._hasSignature)
return false;
@@ -102,7 +102,7 @@ public class SourceMethodMappingInfo extends AnnotatableInfo {
return this._isOverride == other._isOverride && this._declaredModifiers == other._declaredModifiers;
return true;
}
-
+
public boolean signaturesEqual(SourceMethodMappingInfo other) {
if (!Util.equalArraysOrNull(this.roleParameterNames, other.roleParameterNames))
return false;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/TypeHierarchyConnector.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/TypeHierarchyConnector.java
index 854e00c7b..387fc5dcb 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/TypeHierarchyConnector.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/TypeHierarchyConnector.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: TypeHierarchyConnector.java 23416 2010-02-03 19:59:31Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -35,17 +35,17 @@ import org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy;
* @author anklam
*
* This class is used to access the information of a TypeHierarchy.
- *
+ *
* @version $Id: TypeHierarchyConnector.java 23416 2010-02-03 19:59:31Z stephan $
*/
public class TypeHierarchyConnector extends TypeHierarchy
{
-
+
public TypeHierarchyConnector(IType focus, IJavaProject project, boolean computeSubtypes)
{
super(focus, new ICompilationUnit[0], project, computeSubtypes);
}
-
+
public TypeHierarchyConnector(IType type, IJavaSearchScope scope, boolean computeSubtypes) {
super(type, new ICompilationUnit[0], scope, computeSubtypes);
}
@@ -55,7 +55,7 @@ public class TypeHierarchyConnector extends TypeHierarchy
{
return this.classToSuperclass;
}
-
+
@SuppressWarnings("rawtypes") // accessing super field with raw type
public Map getTypeToSubtypes()
{
@@ -73,18 +73,18 @@ public class TypeHierarchyConnector extends TypeHierarchy
{
return this.typeFlags;
}
-
+
@Override
public IType[] getRootClasses()
{
// This is a workaround.
// because a role focus type is contained as
- // root class even with a resolved superclass.
+ // root class even with a resolved superclass.
if (this.classToSuperclass.keySet().contains(this.focusType))
{
TypeVector result = new TypeVector(super.getRootClasses());
result.remove(this.focusType);
- return result.elements();
+ return result.elements();
}
else
{
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/builder/OTJBuilder.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/builder/OTJBuilder.java
index 3a9b6ad25..8fa6755ff 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/builder/OTJBuilder.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/builder/OTJBuilder.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2007 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: OTJBuilder.java 23417 2010-02-03 20:13:55Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -28,12 +28,12 @@ import org.eclipse.jdt.internal.core.builder.JavaBuilder;
/**
* Extend the JavaBuilder for handling role files.
- *
+ *
* @author stephan
* @version $Id: OTJBuilder.java 23417 2010-02-03 20:13:55Z stephan $
*/
public class OTJBuilder extends JavaBuilder {
-
+
// place this builder into the name space of the plug-in org.eclipse.objectteams.otdt:
public static final String BUILDER_ID = "org.eclipse.objectteams.otdt.builder.OTJBuilder"; //$NON-NLS-1$
@@ -42,12 +42,12 @@ public class OTJBuilder extends JavaBuilder {
return BUILDER_ID;
}
- /**
+ /**
* Create and initialize a matching IncrementalImageBuilder.
*/
@Override
protected IncrementalImageBuilder makeImageBuilder(SimpleLookupTable deltas) {
return new OTJIncrementalImageBuilder(this);
}
-
+
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/builder/OTJIncrementalImageBuilder.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/builder/OTJIncrementalImageBuilder.java
index 114c61528..92431b226 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/builder/OTJIncrementalImageBuilder.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/builder/OTJIncrementalImageBuilder.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2008 Technical University Berlin, Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Technical University Berlin - Initial API and implementation
**********************************************************************/
@@ -24,9 +24,9 @@ import org.eclipse.jdt.internal.core.builder.JavaBuilder;
import org.eclipse.jdt.internal.core.builder.SourceFile;
/**
- * Specialize the IncrementalImageBuilder to include teams of role files in
+ * Specialize the IncrementalImageBuilder to include teams of role files in
* the incremental compilation process.
- *
+ *
* @author stephan
* @version $Id: OTJIncrementalImageBuilder.java 23401 2010-02-02 23:56:05Z stephan $
*/
@@ -36,7 +36,7 @@ public class OTJIncrementalImageBuilder extends IncrementalImageBuilder {
public OTJIncrementalImageBuilder(JavaBuilder javaBuilder) {
super(javaBuilder);
}
-
+
/**
* For each affected source file, guess whether it could be a role
* file and include its team in the compilation process.
@@ -52,7 +52,7 @@ public class OTJIncrementalImageBuilder extends IncrementalImageBuilder {
}
}
}
-
+
private void checkAddTeamFile(SourceFile file) {
IPath path = file.getPath();
// TODO (SH): should we try more than one level?
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/util/FieldData.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/util/FieldData.java
index 4f700959d..1d05579cc 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/util/FieldData.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/util/FieldData.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: FieldData.java 23416 2010-02-03 19:59:31Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -34,7 +34,7 @@ public class FieldData implements IFieldAccessSpec
private String selector;
//attention: this field seems to use the constant pool encoding of types
private String fieldType;
-
+
private boolean isSetter;
public FieldData(String selector, String fieldType, boolean isSetter)
@@ -43,7 +43,7 @@ public class FieldData implements IFieldAccessSpec
this.fieldType = fieldType;
this.isSetter = isSetter;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.objectteams.otdt.core.util.IFieldAccessSpec#getSelector()
*/
@@ -52,7 +52,7 @@ public class FieldData implements IFieldAccessSpec
{
return this.selector;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.objectteams.otdt.core.util.IFieldAccessSpec#getFieldType()
*/
@@ -61,16 +61,16 @@ public class FieldData implements IFieldAccessSpec
{
return this.fieldType;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.objectteams.otdt.core.util.IFieldAccessSpec#isSetter()
*/
@Override
- public boolean isSetter()
+ public boolean isSetter()
{
return this.isSetter;
}
-
+
@Override
public String toString()
{
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/util/MethodData.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/util/MethodData.java
index be4610e58..2126db0af 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/util/MethodData.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/util/MethodData.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: MethodData.java 23416 2010-02-03 19:59:31Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -31,16 +31,16 @@ import org.eclipse.objectteams.otdt.core.IMethodSpec;
/**
* The implementation of methods getTypeParameterBounds & getTypeParameterNames
- * has been copied from class org.eclipse.jdt.internal.core.SourceMethodElementInfo
+ * has been copied from class org.eclipse.jdt.internal.core.SourceMethodElementInfo
* of the Eclipse JDT.
- *
+ *
* @author kaiser
* @version $Id$
*/
-public class MethodData implements IMethodSpec
+public class MethodData implements IMethodSpec
{
private static final String [] EMPTY_STRING_ARRAY = new String[0];
-
+
private String selector;
// attention: this field seems to use the constant pool encoding of types:
private String[] argumentsTypes;
@@ -51,10 +51,10 @@ public class MethodData implements IMethodSpec
static final ITypeParameter[] NO_TYPE_PARAMETERS = new ITypeParameter[0];
public ITypeParameter[] typeParameters = NO_TYPE_PARAMETERS;
-
+
private boolean isDeclaration = false;
private boolean covariantReturn= false;
-
+
// FIXME(SH): fill with values:
private int sourceStart, sourceEnd;
@@ -68,30 +68,30 @@ public class MethodData implements IMethodSpec
this.argumentsTypes = types;
this.argumentsNames = names;
this.returnType = returnType;
-
+
assert types != null: "Long method spec must have types"; //$NON-NLS-1$
if (names == null)
this.argumentsNames = EMPTY_STRING_ARRAY;
-
+
this.isDeclaration = isDeclaration;
}
-
+
public MethodData(String selector, String[] types, String[] names, String returnType, boolean isDeclaration,
- boolean covariantReturn)
+ boolean covariantReturn)
{
this(selector, types, names, returnType, isDeclaration);
this.covariantReturn= covariantReturn;
}
-
+
/** Create a short method spec (no signature). */
public MethodData(String selector, boolean isDeclaration)
{
this.selector = selector;
this.returnType = null; // TODO(SH): is this OK??
-
+
this.argumentsTypes = EMPTY_STRING_ARRAY;
this.argumentsNames = EMPTY_STRING_ARRAY;
-
+
this.isDeclaration = isDeclaration;
}
/**
@@ -129,7 +129,7 @@ public class MethodData implements IMethodSpec
{
return this.argumentsTypes;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.objectteams.otdt.core.util.IMethodSpec#getArgumentNames()
*/
@@ -147,7 +147,7 @@ public class MethodData implements IMethodSpec
{
return this.selector;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.objectteams.otdt.core.util.IMethodSpec#getReturnType()
*/
@@ -164,7 +164,7 @@ public class MethodData implements IMethodSpec
public String getSignature() {
return Signature.createMethodSignature(this.argumentsTypes, this.returnType);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.objectteams.otdt.core.util.IMethodSpec#isDeclaration()
*/
@@ -172,7 +172,7 @@ public class MethodData implements IMethodSpec
public boolean isDeclaration() {
return this.isDeclaration;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.objectteams.otdt.core.util.IMethodSpec#hasCovariantReturn()
*/
@@ -180,7 +180,7 @@ public class MethodData implements IMethodSpec
public boolean hasCovariantReturn() {
return this.covariantReturn;
}
-
+
@Override
public ITypeParameter[] getTypeParameters() {
return this.typeParameters;
@@ -203,7 +203,7 @@ public class MethodData implements IMethodSpec
public String toString()
{
String signature = this.selector + "("; //$NON-NLS-1$
-
+
if (this.argumentsTypes != null)
{
for (int idx=0; idx < this.argumentsTypes.length; idx++)
@@ -213,7 +213,7 @@ public class MethodData implements IMethodSpec
}
}
signature += ")"; //$NON-NLS-1$
-
+
return signature;
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/index/JavaIndexer.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/index/JavaIndexer.java
index 64351fabf..5d9f52fe0 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/index/JavaIndexer.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/index/JavaIndexer.java
@@ -21,7 +21,7 @@ import org.eclipse.jdt.internal.core.search.indexing.DefaultJavaIndexer;
/**
* {@link JavaIndexer} provides functionality to generate index files which can be used by the JDT {@link SearchEngine}.
* The generated index files can be used as a classpath attribute for the particular classpath entry.
- *
+ *
* <p> The search engine indexes all the elements referred in the classpath entries of the project into
* index files. These index files are used to search the elements faster. Indexing for bigger jars could
* take some time. To avoid this time, one can generate the index file and specify it when the jar is added
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/index/JavaIndexerApplication.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/index/JavaIndexerApplication.java
index c552c3ceb..9b00a10e5 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/index/JavaIndexerApplication.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/index/JavaIndexerApplication.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
*******************************************************************************/
@@ -24,14 +24,14 @@ import org.eclipse.osgi.util.NLS;
/**
* Implements an Eclipse Application for {@link org.eclipse.jdt.core.index.JavaIndexer}.
- *
+ *
* <p>
* On MacOS, when invoked using the Eclipse executable, the "user.dir" property is set to the folder in which the
* eclipse.ini file is located. This makes it harder to use relative paths to point to the files to be jar'd or to
* the index file that is generated.
* </p>
- *
- *
+ *
+ *
* @since 3.8
* @noinstantiate This class is not intended to be instantiated by clients.
* @noextend This class is not intended to be subclassed by clients.
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/FieldDeclarationMatch.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/FieldDeclarationMatch.java
index 9da6ad7d4..4443a5b4a 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/FieldDeclarationMatch.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/FieldDeclarationMatch.java
@@ -22,14 +22,14 @@ import org.eclipse.jdt.core.IJavaElement;
* <p>
* This class is intended to be instantiated and subclassed by clients.
* </p>
- *
+ *
* @since 3.0
*/
public class FieldDeclarationMatch extends SearchMatch {
/**
* Creates a new field declaration match.
- *
+ *
* @param element the field declaration
* @param accuracy one of A_ACCURATE or A_INACCURATE
* @param offset the offset the match starts at, or -1 if unknown
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/FieldReferenceMatch.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/FieldReferenceMatch.java
index 022820b29..de864bcdb 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/FieldReferenceMatch.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/FieldReferenceMatch.java
@@ -22,7 +22,7 @@ import org.eclipse.jdt.core.IJavaElement;
* <p>
* This class is intended to be instantiated and subclassed by clients.
* </p>
- *
+ *
* @since 3.0
*/
public class FieldReferenceMatch extends ReferenceMatch {
@@ -32,7 +32,7 @@ private boolean isWriteAccess;
/**
* Creates a new field reference match.
- *
+ *
* @param enclosingElement the inner-most enclosing member that references
* this field
* @param accuracy one of {@link #A_ACCURATE} or {@link #A_INACCURATE}
@@ -54,7 +54,7 @@ public FieldReferenceMatch(IJavaElement enclosingElement, int accuracy, int offs
/**
* Returns whether the field reference is a read access to the field.
* Note that a field reference can be read and written at once in case of compound assignments (e.g. i += 0;)
- *
+ *
* @return whether the field reference is a read access to the field.
*/
public final boolean isReadAccess() {
@@ -64,7 +64,7 @@ public final boolean isReadAccess() {
/**
* Returns whether the field reference is a write access to the field.
* Note that a field reference can be read and written at once in case of compound assignments (e.g. i += 0;)
- *
+ *
* @return whether the field reference is a write access to the field.
*/
public final boolean isWriteAccess() {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/IJavaSearchConstants.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/IJavaSearchConstants.java
index d7c0f9260..d7933b874 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/IJavaSearchConstants.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/IJavaSearchConstants.java
@@ -33,49 +33,49 @@ public interface IJavaSearchConstants {
* of match in unknown.
*/
int UNKNOWN = -1;
-
+
/* Nature of searched element */
-
+
/**
* The searched element is a type, which may include classes, interfaces,
* enums, and annotation types.
- *
+ *
* @category searchFor
*/
int TYPE= 0;
/**
* The searched element is a method.
- *
+ *
* @category searchFor
*/
int METHOD= 1;
/**
* The searched element is a package.
- *
+ *
* @category searchFor
*/
int PACKAGE= 2;
/**
* The searched element is a constructor.
- *
+ *
* @category searchFor
*/
int CONSTRUCTOR= 3;
/**
* The searched element is a field.
- *
+ *
* @category searchFor
*/
int FIELD= 4;
/**
- * The searched element is a class.
+ * The searched element is a class.
* More selective than using {@link #TYPE}.
- *
+ *
* @category searchFor
*/
int CLASS= 5;
@@ -83,7 +83,7 @@ public interface IJavaSearchConstants {
/**
* The searched element is an interface.
* More selective than using {@link #TYPE}.
- *
+ *
* @category searchFor
*/
int INTERFACE= 6;
@@ -91,7 +91,7 @@ public interface IJavaSearchConstants {
/**
* The searched element is an enum.
* More selective than using {@link #TYPE}.
- *
+ *
* @since 3.1
* @category searchFor
*/
@@ -100,7 +100,7 @@ public interface IJavaSearchConstants {
/**
* The searched element is an annotation type.
* More selective than using {@link #TYPE}.
- *
+ *
* @since 3.1
* @category searchFor
*/
@@ -109,7 +109,7 @@ public interface IJavaSearchConstants {
/**
* The searched element is a class or enum type.
* More selective than using {@link #TYPE}.
- *
+ *
* @since 3.1
* @category searchFor
*/
@@ -118,12 +118,12 @@ public interface IJavaSearchConstants {
/**
* The searched element is a class or interface type.
* More selective than using {@link #TYPE}.
- *
+ *
* @since 3.1
* @category searchFor
*/
int CLASS_AND_INTERFACE= 10;
-
+
/**
* The searched element is an interface or annotation type.
* More selective than using {@link #TYPE}.
@@ -144,18 +144,18 @@ public interface IJavaSearchConstants {
* The search result is a declaration.
* Can be used in conjunction with any of the nature of searched elements
* so as to better narrow down the search.
- *
+ *
* @category limitTo
*/
int DECLARATIONS= 0;
/**
- * The search result is a type that implements an interface or extends a class.
+ * The search result is a type that implements an interface or extends a class.
* Used in conjunction with either TYPE or CLASS or INTERFACE, it will
* respectively search for any type implementing/extending a type,
* or rather exclusively search for classes implementing/extending the type, or
* interfaces extending the type.
- *
+ *
* @category limitTo
*/
int IMPLEMENTORS= 1;
@@ -166,17 +166,17 @@ public interface IJavaSearchConstants {
* so as to better narrow down the search.
* References can contain implementers since they are more generic kind
* of matches.
- *
+ *
* @category limitTo
*/
int REFERENCES= 2;
/**
- * The search result is a declaration, a reference, or an implementer
+ * The search result is a declaration, a reference, or an implementer
* of an interface.
* Can be used in conjunction with any of the nature of searched elements
* so as to better narrow down the search.
- *
+ *
* @category limitTo
*/
int ALL_OCCURRENCES= 3;
@@ -185,17 +185,17 @@ public interface IJavaSearchConstants {
* When searching for field matches, it will exclusively find read accesses, as
* opposed to write accesses. Note that some expressions are considered both
* as field read/write accesses: for example, x++; x+= 1;
- *
+ *
* @since 2.0
* @category limitTo
*/
int READ_ACCESSES = 4;
-
+
/**
* When searching for field matches, it will exclusively find write accesses, as
* opposed to read accesses. Note that some expressions are considered both
* as field read/write accesses: for example, x++; x+= 1;
- *
+ *
* @since 2.0
* @category limitTo
*/
@@ -210,7 +210,7 @@ public interface IJavaSearchConstants {
* @category limitTo
*/
int MODULE_GRAPH = 6;
-
+
//{ObjectTeams: search for playedBy references only:
/**
* When searching for type references, it will exclusively find references
@@ -224,7 +224,7 @@ public interface IJavaSearchConstants {
/**
* Ignore declaring type while searching result.
* Can be used in conjunction with any of the nature of match.
- *
+ *
* @since 3.1
* @category limitTo
*/
@@ -243,7 +243,7 @@ public interface IJavaSearchConstants {
* @category limitTo
*/
int IGNORE_RETURN_TYPE = 0x20;
-
+
/**
* Return only type references used as the type of a field declaration.
* <p>
@@ -254,7 +254,7 @@ public interface IJavaSearchConstants {
* @category limitTo
*/
int FIELD_DECLARATION_TYPE_REFERENCE = 0x40;
-
+
/**
* Return only type references used as the type of a local variable declaration.
* <p>
@@ -265,7 +265,7 @@ public interface IJavaSearchConstants {
* @category limitTo
*/
int LOCAL_VARIABLE_DECLARATION_TYPE_REFERENCE = 0x80;
-
+
/**
* Return only type references used as the type of a method parameter
* declaration.
@@ -277,7 +277,7 @@ public interface IJavaSearchConstants {
* @category limitTo
*/
int PARAMETER_DECLARATION_TYPE_REFERENCE = 0x100;
-
+
/**
* Return only type references used as a super type or as a super interface.
* <p>
@@ -288,7 +288,7 @@ public interface IJavaSearchConstants {
* @category limitTo
*/
int SUPERTYPE_TYPE_REFERENCE = 0x200;
-
+
/**
* Return only type references used in a throws clause.
* <p>
@@ -299,7 +299,7 @@ public interface IJavaSearchConstants {
* @category limitTo
*/
int THROWS_CLAUSE_TYPE_REFERENCE = 0x400;
-
+
/**
* Return only type references used in a cast expression.
* <p>
@@ -310,7 +310,7 @@ public interface IJavaSearchConstants {
* @category limitTo
*/
int CAST_TYPE_REFERENCE = 0x800;
-
+
/**
* Return only type references used in a catch header.
* <p>
@@ -321,7 +321,7 @@ public interface IJavaSearchConstants {
* @category limitTo
*/
int CATCH_TYPE_REFERENCE = 0x1000;
-
+
/**
* Return only type references used in class instance creation.
* <p>
@@ -346,7 +346,7 @@ public interface IJavaSearchConstants {
* @category limitTo
*/
int CLASS_INSTANCE_CREATION_TYPE_REFERENCE = 0x2000;
-
+
/**
* Return only type references used as a method return type.
* <p>
@@ -357,7 +357,7 @@ public interface IJavaSearchConstants {
* @category limitTo
*/
int RETURN_TYPE_REFERENCE = 0x4000;
-
+
/**
* Return only type references used in an import declaration.
* <p>
@@ -425,7 +425,7 @@ public interface IJavaSearchConstants {
* @category limitTo
*/
int INSTANCEOF_TYPE_REFERENCE = 0x100000;
-
+
/**
* Return only super field accesses or super method invocations (e.g. using the
* <code>super</code> qualifier).
@@ -442,7 +442,7 @@ public interface IJavaSearchConstants {
* @category limitTo
*/
int SUPER_REFERENCE = 0x1000000;
-
+
/**
* Return only qualified field accesses or qualified method invocations.
* <p>
@@ -458,7 +458,7 @@ public interface IJavaSearchConstants {
* @category limitTo
*/
int QUALIFIED_REFERENCE = 0x2000000;
-
+
/**
* Return only primary field accesses or primary method invocations (e.g. using
* the <code>this</code> qualifier).
@@ -475,7 +475,7 @@ public interface IJavaSearchConstants {
* @category limitTo
*/
int THIS_REFERENCE = 0x4000000;
-
+
/**
* Return only field accesses or method invocations without any qualification.
* <p>
@@ -504,26 +504,26 @@ public interface IJavaSearchConstants {
int METHOD_REFERENCE_EXPRESSION = 0x10000000;
/* Syntactic match modes */
-
+
/**
* The search pattern matches exactly the search result,
* that is, the source of the search result equals the search pattern.
- *
+ *
* @deprecated Use {@link SearchPattern#R_EXACT_MATCH} instead.
* @category matchRule
*/
int EXACT_MATCH = 0;
/**
* The search pattern is a prefix of the search result.
- *
+ *
* @deprecated Use {@link SearchPattern#R_PREFIX_MATCH} instead.
* @category matchRule
*/
int PREFIX_MATCH = 1;
/**
- * The search pattern contains one or more wild cards ('*') where a
+ * The search pattern contains one or more wild cards ('*') where a
* wild-card can replace 0 or more characters in the search result.
- *
+ *
* @deprecated Use {@link SearchPattern#R_PATTERN_MATCH} instead.
* @category matchRule
*/
@@ -531,11 +531,11 @@ public interface IJavaSearchConstants {
/* Case sensitivity */
-
+
/**
* The search pattern matches the search result only
* if cases are the same.
- *
+ *
* @deprecated Use the methods that take the matchMode
* with {@link SearchPattern#R_CASE_SENSITIVE} as a matchRule instead.
* @category matchRule
@@ -543,16 +543,16 @@ public interface IJavaSearchConstants {
boolean CASE_SENSITIVE = true;
/**
* The search pattern ignores cases in the search result.
- *
+ *
* @deprecated Use the methods that take the matchMode
* without {@link SearchPattern#R_CASE_SENSITIVE} as a matchRule instead.
* @category matchRule
*/
boolean CASE_INSENSITIVE = false;
-
+
/* Waiting policies */
-
+
/**
* The search operation starts immediately, even if the underlying indexer
* has not finished indexing the workspace. Results will more likely
@@ -565,7 +565,7 @@ public interface IJavaSearchConstants {
*/
int CANCEL_IF_NOT_READY_TO_SEARCH = IJob.CancelIfNotReady;
/**
- * The search operation waits for the underlying indexer to finish indexing
+ * The search operation waits for the underlying indexer to finish indexing
* the workspace before starting the search.
*/
int WAIT_UNTIL_READY_TO_SEARCH = IJob.WaitUntilReady;
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/IJavaSearchResultCollector.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/IJavaSearchResultCollector.java
index 640b24a96..e4c766081 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/IJavaSearchResultCollector.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/IJavaSearchResultCollector.java
@@ -31,10 +31,10 @@ import org.eclipse.jdt.core.IJavaElement;
* case can occur when a problem prevented the <code>SearchEngine</code> from resolving the match.
* </p>
* <p>
- * The order of the results is unspecified. Clients must not rely on this order to display results,
+ * The order of the results is unspecified. Clients must not rely on this order to display results,
* but they should sort these results (for example, in syntactical order).
* <p>
- * The <code>IJavaSearchResultCollector</code> is also used to provide a progress monitor to the
+ * The <code>IJavaSearchResultCollector</code> is also used to provide a progress monitor to the
* <code>SearchEngine</code>.
* </p>
* <p>
@@ -48,7 +48,7 @@ import org.eclipse.jdt.core.IJavaElement;
public interface IJavaSearchResultCollector {
/**
* The search result corresponds exactly to the search pattern.
- *
+ *
* @deprecated Use {@link SearchMatch#A_ACCURATE} instead.
*/
int EXACT_MATCH = 0;
@@ -57,14 +57,14 @@ public interface IJavaSearchResultCollector {
* The search result is potentially a match for the search pattern,
* but a problem prevented the search engine from being more accurate
* (typically because of the classpath was not correctly set).
- *
+ *
* @deprecated Use {@link SearchMatch#A_INACCURATE} instead.
*/
int POTENTIAL_MATCH = 1;
/**
* Called before the actual search starts.
- *
+ *
* @deprecated Replaced by {@link SearchRequestor#beginReporting()}.
*/
public void aboutToStart();
@@ -74,7 +74,7 @@ public void aboutToStart();
* @param resource the resource in which the match has been found
* @param start the start position of the match, -1 if it is unknown
* @param end the end position of the match, -1 if it is unknown;
- * the ending offset is exclusive, meaning that the actual range of characters
+ * the ending offset is exclusive, meaning that the actual range of characters
* covered is <code>[start, end]</code>
* @param enclosingElement the Java element that contains the character range
* <code>[start, end]</code>; the value can be <code>null</code> indicating that
@@ -93,7 +93,7 @@ public void accept(
throws CoreException;
/**
* Called when the search has ended.
- *
+ *
* @deprecated Replaced by {@link SearchRequestor#endReporting()}.
*/
public void done();
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/IJavaSearchScope.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/IJavaSearchScope.java
index 212b552c0..5e0b9334d 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/IJavaSearchScope.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/IJavaSearchScope.java
@@ -57,9 +57,9 @@ int REFERENCED_PROJECTS = 8;
*
* @param resourcePath if the resource is contained in
* a JAR file, the path is composed of 2 paths separated
- * by <code>JAR_FILE_ENTRY_SEPARATOR</code>: the first path is the full OS path
+ * by <code>JAR_FILE_ENTRY_SEPARATOR</code>: the first path is the full OS path
* to the JAR (if it is an external JAR), or the workspace relative <code>IPath</code>
- * to the JAR (if it is an internal JAR),
+ * to the JAR (if it is an internal JAR),
* the second path is the path to the resource inside the JAR.
* @return whether the resource is enclosed by this scope
*/
@@ -87,14 +87,14 @@ public boolean encloses(IJavaElement element);
* For example, d:\libs\mylib.jar
* </li>
* </ul>
- *
+ *
* @return an array of paths to the enclosing projects and JARS.
*/
IPath[] enclosingProjectsAndJars();
/**
* Returns whether this scope contains any <code>.class</code> files (either
* in folders or within JARs).
- *
+ *
* @return whether this scope contains any <code>.class</code> files
* @deprecated Use
* {@link org.eclipse.jdt.core.search.SearchEngine#createJavaSearchScope(IJavaElement[])}
@@ -102,9 +102,9 @@ IPath[] enclosingProjectsAndJars();
*/
boolean includesBinaries();
/**
- * Returns whether this scope includes classpaths defined by
+ * Returns whether this scope includes classpaths defined by
* the projects of the resources of this search scope.
- *
+ *
* @return whether this scope includes classpaths
* @deprecated Use
* {@link org.eclipse.jdt.core.search.SearchEngine#createJavaSearchScope(IJavaElement[])}
@@ -114,7 +114,7 @@ boolean includesClasspaths();
/**
* Sets whether this scope contains any <code>.class</code> files (either
* in folders or within JARs).
- *
+ *
* @param includesBinaries whether this scope contains any <code>.class</code> files
* @deprecated Use
* {@link org.eclipse.jdt.core.search.SearchEngine#createJavaSearchScope(IJavaElement[])}
@@ -122,9 +122,9 @@ boolean includesClasspaths();
*/
public void setIncludesBinaries(boolean includesBinaries);
/**
- * Sets whether this scope includes the classpaths defined by
+ * Sets whether this scope includes the classpaths defined by
* the projects of the resources of this search scope.
- *
+ *
* @param includesClasspaths whether this scope includes classpaths
* @deprecated Use
* {@link org.eclipse.jdt.core.search.SearchEngine#createJavaSearchScope(IJavaElement[])}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/ITypeNameRequestor.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/ITypeNameRequestor.java
index a2ebba8df..e160d3484 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/ITypeNameRequestor.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/ITypeNameRequestor.java
@@ -29,7 +29,7 @@ public interface ITypeNameRequestor {
*
* @param packageName the dot-separated name of the package of the class
* @param simpleTypeName the simple name of the class
- * @param enclosingTypeNames if the class is a member type,
+ * @param enclosingTypeNames if the class is a member type,
* the simple names of the enclosing types from the outer-most to the
* direct parent of the class (for example, if the class is x.y.A$B$C then
* the enclosing types are [A, B]. This is an empty array if the class
@@ -37,9 +37,9 @@ public interface ITypeNameRequestor {
* @param path the full path to the resource containing the class. If the resource is a .class file
* or a source file, this is the full path in the workspace to this resource. If the
* resource is an archive (that is, a .zip or .jar file), the path is composed of 2 paths separated
- * by <code>IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR</code>:
- * the first path is the full OS path to the archive (if it is an external archive),
- * or the workspace relative <code>IPath</code> to the archive (if it is an internal archive),
+ * by <code>IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR</code>:
+ * the first path is the full OS path to the archive (if it is an external archive),
+ * or the workspace relative <code>IPath</code> to the archive (if it is an internal archive),
* the second path is the path to the resource inside the archive.
*/
void acceptClass(char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, String path);
@@ -48,7 +48,7 @@ void acceptClass(char[] packageName, char[] simpleTypeName, char[][] enclosingTy
*
* @param packageName the dot-separated name of the package of the interface
* @param simpleTypeName the simple name of the interface
- * @param enclosingTypeNames if the interface is a member type,
+ * @param enclosingTypeNames if the interface is a member type,
* the simple names of the enclosing types from the outer-most to the
* direct parent of the interface (for example, if the interface is x.y.A$B$I then
* the enclosing types are [A, B]. This is an empty array if the interface
@@ -56,9 +56,9 @@ void acceptClass(char[] packageName, char[] simpleTypeName, char[][] enclosingTy
* @param path the full path to the resource containing the interface. If the resource is a .class file
* or a source file, this is the full path in the workspace to this resource. If the
* resource is an archive (that is, a .zip or .jar file), the path is composed of 2 paths separated
- * by <code>IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR</code>:
- * the first path is the full OS path to the archive (if it is an external archive),
- * or the workspace relative <code>IPath</code> to the archive (if it is an internal archive),
+ * by <code>IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR</code>:
+ * the first path is the full OS path to the archive (if it is an external archive),
+ * or the workspace relative <code>IPath</code> to the archive (if it is an internal archive),
* the second path is the path to the resource inside the archive.
* */
void acceptInterface(char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, String path);
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/LocalVariableDeclarationMatch.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/LocalVariableDeclarationMatch.java
index 251aa8609..868f8c3d6 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/LocalVariableDeclarationMatch.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/LocalVariableDeclarationMatch.java
@@ -22,14 +22,14 @@ import org.eclipse.jdt.core.IJavaElement;
* <p>
* This class is intended to be instantiated and subclassed by clients.
* </p>
- *
+ *
* @since 3.0
*/
public class LocalVariableDeclarationMatch extends SearchMatch {
/**
* Creates a new local variable declaration match.
- *
+ *
* @param element the local variable declaration
* @param accuracy one of A_ACCURATE or A_INACCURATE
* @param offset the offset the match starts at, or -1 if unknown
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/LocalVariableReferenceMatch.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/LocalVariableReferenceMatch.java
index dcf6820df..e73554c94 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/LocalVariableReferenceMatch.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/LocalVariableReferenceMatch.java
@@ -22,7 +22,7 @@ import org.eclipse.jdt.core.IJavaElement;
* <p>
* This class is intended to be instantiated and subclassed by clients.
* </p>
- *
+ *
* @since 3.0
*/
public class LocalVariableReferenceMatch extends SearchMatch {
@@ -32,7 +32,7 @@ public class LocalVariableReferenceMatch extends SearchMatch {
/**
* Creates a new local variable reference match.
- *
+ *
* @param enclosingElement the inner-most enclosing member that references this local variable
* @param accuracy one of {@link #A_ACCURATE} or {@link #A_INACCURATE}
* @param offset the offset the match starts at, or -1 if unknown
@@ -54,7 +54,7 @@ public class LocalVariableReferenceMatch extends SearchMatch {
/**
* Returns whether the local variable reference is a read access to the variable.
* Note that a local variable reference can be read and written at once in case of compound assignments (e.g. i += 0;)
- *
+ *
* @return whether the local variable reference is a read access to the variable.
*/
public final boolean isReadAccess() {
@@ -64,7 +64,7 @@ public class LocalVariableReferenceMatch extends SearchMatch {
/**
* Returns whether the local variable reference is a write access to the variable.
* Note that a local variable reference can be read and written at once in case of compound assignments (e.g. i += 0;)
- *
+ *
* @return whether the local variable reference is a write access to the variable.
*/
public final boolean isWriteAccess() {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/MethodDeclarationMatch.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/MethodDeclarationMatch.java
index 587dbfc7a..45a747df0 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/MethodDeclarationMatch.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/MethodDeclarationMatch.java
@@ -22,14 +22,14 @@ import org.eclipse.jdt.core.IJavaElement;
* <p>
* This class is intended to be instantiated and subclassed by clients.
* </p>
- *
+ *
* @since 3.0
*/
public class MethodDeclarationMatch extends SearchMatch {
/**
* Creates a new method declaration match.
- *
+ *
* @param element the method declaration
* @param accuracy one of A_ACCURATE or A_INACCURATE
* @param offset the offset the match starts at, or -1 if unknown
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/MethodNameRequestor.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/MethodNameRequestor.java
index 27e9b712d..1be01eba5 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/MethodNameRequestor.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/MethodNameRequestor.java
@@ -14,27 +14,27 @@
package org.eclipse.jdt.core.search;
/**
- *
+ *
* A <code> MethodDeclarationRequestor</code> collects search results from a <code> searchAllMethodDeclarations</code>
* query to a <code>SearchEngine</code>. Clients must subclass this abstract class and pass an instance to the
- * <code>SearchEngine.searchAllMethodDeclarations</code> method.
- *
+ * <code>SearchEngine.searchAllMethodDeclarations</code> method.
+ *
* <p>
* This class may be subclassed by clients
* </p>
* @since 3.12
- *
+ *
*/
public abstract class MethodNameRequestor {
-
+
/**
* Accepts a method.
- *
+ *
* <p>
- * The default implementation of this method does nothing.
+ * The default implementation of this method does nothing.
* Subclasses should override.
* </p>
- *
+ *
* @param methodName name of the method.
* @param parameterCount number of parameters in this method.
* @param declaringQualifier the qualified name of parent of the enclosing type of this method.
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/MethodReferenceMatch.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/MethodReferenceMatch.java
index 4ea6923cc..4e11a3fa9 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/MethodReferenceMatch.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/MethodReferenceMatch.java
@@ -22,7 +22,7 @@ import org.eclipse.jdt.core.IJavaElement;
* <p>
* This class is intended to be instantiated and subclassed by clients.
* </p>
- *
+ *
* @since 3.0
*/
public class MethodReferenceMatch extends ReferenceMatch {
@@ -32,7 +32,7 @@ public class MethodReferenceMatch extends ReferenceMatch {
/**
* Creates a new method reference match.
- *
+ *
* @param enclosingElement the inner-most enclosing member that references this method
* @param accuracy one of {@link #A_ACCURATE} or {@link #A_INACCURATE}
* @param offset the offset the match starts at, or -1 if unknown
@@ -48,7 +48,7 @@ public MethodReferenceMatch(IJavaElement enclosingElement, int accuracy, int off
/**
* Creates a new method reference match.
- *
+ *
* @param enclosingElement the inner-most enclosing member that references this method
* @param accuracy one of {@link #A_ACCURATE} or {@link #A_INACCURATE}
* @param offset the offset the match starts at, or -1 if unknown
@@ -71,7 +71,7 @@ public MethodReferenceMatch(IJavaElement enclosingElement, int accuracy, int off
/**
* Creates a new method reference match.
- *
+ *
* @param enclosingElement the inner-most enclosing member that references this method
* @param accuracy one of {@link #A_ACCURATE} or {@link #A_INACCURATE}
* @param offset the offset the match starts at, or -1 if unknown
@@ -107,7 +107,7 @@ public final boolean isConstructor() {
* Returns whether the reference is on a synthetic element.
* Note that this field is only used for constructor reference. This happens when default constructor
* declaration is used or implicit super constructor is called.
- *
+ *
* @return whether the reference is synthetic or not.
* @since 3.1
*/
@@ -120,7 +120,7 @@ public final boolean isSynthetic() {
* which is a super type of the searched method declaring type.
* If <code>true</code>, the method called at run-time may or may not be
* the search target, depending on the run-time type of the receiver object.
- *
+ *
* @return <code>true</code> if the reference is on a message sent from
* a super-type of the searched method declaring class, <code>false</code> otherwise
* @since 3.3
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/ModuleReferenceMatch.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/ModuleReferenceMatch.java
index 1e99e6a85..e88a6a82d 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/ModuleReferenceMatch.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/ModuleReferenceMatch.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/search/org/eclipse/jdt/core/search/PackageDeclarationMatch.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/PackageDeclarationMatch.java
index 8886fa241..7f1000256 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/PackageDeclarationMatch.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/PackageDeclarationMatch.java
@@ -22,14 +22,14 @@ import org.eclipse.jdt.core.IJavaElement;
* <p>
* This class is intended to be instantiated and subclassed by clients.
* </p>
- *
+ *
* @since 3.0
*/
public class PackageDeclarationMatch extends SearchMatch {
/**
* Creates a new package declaration match.
- *
+ *
* @param element the package declaration
* @param accuracy one of A_ACCURATE or A_INACCURATE
* @param offset the offset the match starts at, or -1 if unknown
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/PackageReferenceMatch.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/PackageReferenceMatch.java
index 79623c89e..471af46ec 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/PackageReferenceMatch.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/PackageReferenceMatch.java
@@ -22,14 +22,14 @@ import org.eclipse.jdt.core.IJavaElement;
* <p>
* This class is intended to be instantiated and subclassed by clients.
* </p>
- *
+ *
* @since 3.0
*/
public class PackageReferenceMatch extends ReferenceMatch {
/**
* Creates a new package reference match.
- *
+ *
* @param enclosingElement the inner-most enclosing member that references this package
* @param accuracy one of {@link #A_ACCURATE} or {@link #A_INACCURATE}
* @param offset the offset the match starts at, or -1 if unknown
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/ReferenceMatch.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/ReferenceMatch.java
index 951eba95f..afefd39eb 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/ReferenceMatch.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/ReferenceMatch.java
@@ -18,7 +18,7 @@ import org.eclipse.jdt.core.*;
/**
* An abstract Java search match that represents a reference.
- *
+ *
* @since 3.4
*/
public abstract class ReferenceMatch extends SearchMatch {
@@ -27,7 +27,7 @@ public abstract class ReferenceMatch extends SearchMatch {
/**
* Creates a new reference match.
- *
+ *
* @param enclosingElement the inner-most enclosing member that references this java element
* @param accuracy one of {@link #A_ACCURATE} or {@link #A_INACCURATE}
* @param offset the offset the match starts at, or -1 if unknown
@@ -45,10 +45,10 @@ public ReferenceMatch(IJavaElement enclosingElement, int accuracy, int offset, i
/**
* Returns the local element of this search match, or <code>null</code> if none.
* A local element is the inner-most element that contains the reference and that is
- * not reachable by navigating from the root of the {@link IJavaModel} using
+ * not reachable by navigating from the root of the {@link IJavaModel} using
* {@link IParent#getChildren()}.
* <p>
- * Known element types for local elements are {@link IJavaElement#ANNOTATION},
+ * Known element types for local elements are {@link IJavaElement#ANNOTATION},
* {@link IJavaElement#LOCAL_VARIABLE} and {@link IJavaElement#TYPE_PARAMETER}.<br>
* However clients should not assume that this set of element types is closed as
* other types of elements may be returned in the future, e.g. if new types
@@ -105,14 +105,14 @@ public ReferenceMatch(IJavaElement enclosingElement, int accuracy, int offset, i
* Or a local element may be an {@link ITypeParameter} that extends the referenced
* type. For example,
* <ul>
- * <li>searching for the references to the type <code>Test</code> in
+ * <li>searching for the references to the type <code>Test</code> in
* <pre>
* public class X&lt; T extends Test&gt; {
* }</pre>
* will return one {@link TypeReferenceMatch} match whose local element
* is the {@link ITypeParameter} '<code>T</code>'.<br><br>
* </ul>
- *
+ *
* @return the local element of this search match, or <code>null</code> if none.
*
* @since 3.4
@@ -125,7 +125,7 @@ final public IJavaElement getLocalElement() {
* Store the local element in the match.
*
* @param element The local element to be stored
- *
+ *
* @since 3.5
*/
final public void setLocalElement(IJavaElement element) {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchDocument.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchDocument.java
index a3796e0e1..730db1546 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchDocument.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchDocument.java
@@ -22,7 +22,7 @@ import org.eclipse.jdt.internal.core.index.Index;
* <p>
* This class is intended to be subclassed by clients.
* </p>
- *
+ *
* @since 3.0
*/
public abstract class SearchDocument {
@@ -32,11 +32,11 @@ public abstract class SearchDocument {
private String documentPath;
private SearchParticipant participant;
private boolean shouldIndexResolvedDocument = false;
-
+
/**
* Creates a new search document. The given document path is a string that uniquely identifies the document.
* Most of the time it is a workspace-relative path, but it can also be a file system path, or a path inside a zip file.
- *
+ *
* @param documentPath the path to the document,
* or <code>null</code> if none
* @param participant the participant that creates the search document
@@ -50,7 +50,7 @@ public abstract class SearchDocument {
* Adds the given index entry (category and key) coming from this
* document to the index. This method must be called from
* {@link SearchParticipant#indexDocument(SearchDocument document, org.eclipse.core.runtime.IPath indexPath)}.
- *
+ *
* @param category the category of the index entry
* @param key the key of the index entry
*/
@@ -58,7 +58,7 @@ public abstract class SearchDocument {
if (this.index != null)
this.index.addIndexEntry(category, key, getContainerRelativePath());
}
-
+
/**
* Returns the contents of this document.
* Contents may be different from actual resource at corresponding document path,
@@ -69,10 +69,10 @@ public abstract class SearchDocument {
* Note: some implementation may choose to cache the contents directly on the
* document for performance reason. However, this could induce scalability issues due
* to the fact that collections of documents are manipulated throughout the search
- * operation, and cached contents would then consume lots of memory until they are
+ * operation, and cached contents would then consume lots of memory until they are
* all released at once in the end.
* </p>
- *
+ *
* @return the contents of this document,
* or <code>null</code> if none
*/
@@ -88,10 +88,10 @@ public abstract class SearchDocument {
* Note: some implementation may choose to cache the contents directly on the
* document for performance reason. However, this could induce scalability issues due
* to the fact that collections of documents are manipulated throughout the search
- * operation, and cached contents would then consume lots of memory until they are
+ * operation, and cached contents would then consume lots of memory until they are
* all released at once in the end.
* </p>
- *
+ *
* @return the contents of this document,
* or <code>null</code> if none
*/
@@ -108,7 +108,7 @@ public abstract class SearchDocument {
* <p>
* This method must be implemented in subclasses.
* </p>
- *
+ *
* @return the encoding for this document,
* or <code>null</code> if none
*/
@@ -121,37 +121,37 @@ public abstract class SearchDocument {
public SourceElementParser getParser() {
return this.parser;
}
-
+
/**
* Returns the participant that created this document.
- *
+ *
* @return the participant that created this document
*/
public final SearchParticipant getParticipant() {
return this.participant;
}
-
+
/**
* Returns the path to the original document to publicly mention in index
* or search results. This path is a string that uniquely identifies the document.
- * Most of the time it is a workspace-relative path, but it can also be a file system path,
+ * Most of the time it is a workspace-relative path, but it can also be a file system path,
* or a path inside a zip file.
- *
+ *
* @return the path to the document
- */
+ */
public final String getPath() {
return this.documentPath;
}
/**
* Removes all index entries from the index for the given document.
- * This method must be called from
+ * This method must be called from
* {@link SearchParticipant#indexDocument(SearchDocument document, org.eclipse.core.runtime.IPath indexPath)}.
*/
public void removeAllIndexEntries() {
if (this.index != null)
this.index.remove(getContainerRelativePath());
}
-
+
/**
* @nooverride This method is not intended to be re-implemented or extended by clients.
* @noreference This method is not intended to be referenced by clients.
@@ -159,7 +159,7 @@ public abstract class SearchDocument {
public void setIndex(Index indexToSet) {
this.index = indexToSet;
}
-
+
/**
* @nooverride This method is not intended to be re-implemented or extended by clients.
* @noreference This method is not intended to be referenced by clients.
@@ -168,16 +168,16 @@ public abstract class SearchDocument {
this.parser = sourceElementParser;
}
- /** Flags the document as requiring indexing after symbol and type resolution. A participant would be asked
- * to resolve the document via {@link SearchParticipant#resolveDocument} and to index the document adding
- * additional entries via {@link SearchParticipant#indexResolvedDocument}
- *
- * @since 3.10
+ /** Flags the document as requiring indexing after symbol and type resolution. A participant would be asked
+ * to resolve the document via {@link SearchParticipant#resolveDocument} and to index the document adding
+ * additional entries via {@link SearchParticipant#indexResolvedDocument}
+ *
+ * @since 3.10
*/
public void requireIndexingResolvedDocument() {
this.shouldIndexResolvedDocument = true;
}
-
+
/**
* @nooverride This method is not intended to be re-implemented or extended by clients.
* @noreference This method is not intended to be referenced by clients.
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchEngine.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchEngine.java
index 19d37e3bd..e845aeb66 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchEngine.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchEngine.java
@@ -206,16 +206,16 @@ public class SearchEngine {
* <p>
* By default, hierarchy scopes include all direct and indirect supertypes and subtypes of the
* focus type. This method, however, allows to restrict the hierarchy to true subtypes,
- * and exclude supertypes. Also, inclusion of the focus type itself is controlled by a parameter.
+ * and exclude supertypes. Also, inclusion of the focus type itself is controlled by a parameter.
* </p>
- *
+ *
* @param project the project to which to constrain the search, or <code>null</code> if
- * search should consider all types in the workspace
+ * search should consider all types in the workspace
* @param type the focus of the hierarchy scope
* @param onlySubtypes if <code>true</code> only subtypes of <code>type</code> are considered
- * @param includeFocusType if true the focus type <code>type</code> is included in the resulting scope,
+ * @param includeFocusType if true the focus type <code>type</code> is included in the resulting scope,
* otherwise it is excluded
- * @param owner the owner of working copies that take precedence over original compilation units,
+ * @param owner the owner of working copies that take precedence over original compilation units,
* or <code>null</code> if the primary working copy owner should be used
* @return a new hierarchy scope
* @exception JavaModelException if the hierarchy could not be computed on the given type
@@ -507,8 +507,8 @@ public class SearchEngine {
/**
* Create a method name match on a given method with specific modifiers.
* <p>
- * NOTE: this is a first-cut version and might have noticeable delay times in some cases.
- * Targeted for optimization during 4.7. It is recommended to contact JDT Team if
+ * NOTE: this is a first-cut version and might have noticeable delay times in some cases.
+ * Targeted for optimization during 4.7. It is recommended to contact JDT Team if
* anyone plans to use this.
* </p>
* @param method The Java model handle of the method
@@ -674,11 +674,11 @@ public class SearchEngine {
* Searches for all method declarations in the given scope. Accepted matches will be returned by
* {@link MethodNameRequestor#acceptMethod}.
* <p>
- * NOTE: this is a first-cut version and might have noticeable delay times in some cases.
- * Targeted for optimization during 4.7. It is recommended to contact JDT Team if
+ * NOTE: this is a first-cut version and might have noticeable delay times in some cases.
+ * Targeted for optimization during 4.7. It is recommended to contact JDT Team if
* anyone plans to use this.
* </p>
- *
+ *
* @param packageName the full name of the package of the searched types, or a prefix for this
* package, or a wild-carded string for this package.
* May be <code>null</code>, then any package name is accepted.
@@ -702,7 +702,7 @@ public class SearchEngine {
* @param progressMonitor the progress monitor to report progress to, or <code>null</code> if no progress
* monitor is provided
* @exception JavaModelException if the search failed.
- *
+ *
* @since 3.12
*/
public void searchAllMethodNames(
@@ -720,27 +720,27 @@ public class SearchEngine {
IProgressMonitor progressMonitor) throws JavaModelException {
MethodNameRequestorWrapper requestorWrapper = new MethodNameRequestorWrapper(nameRequestor);
this.basicEngine.searchAllMethodNames(
- packageName, pkgMatchRule,
- declaringQualification, declQualificationMatchRule,
- declaringSimpleName, declSimpleNameMatchRule,
- methodName, methodMatchRule,
- scope, requestorWrapper,
+ packageName, pkgMatchRule,
+ declaringQualification, declQualificationMatchRule,
+ declaringSimpleName, declSimpleNameMatchRule,
+ methodName, methodMatchRule,
+ scope, requestorWrapper,
waitingPolicy, progressMonitor);
}
/**
- * Searches for all method declarations in the given scope.
+ * Searches for all method declarations in the given scope.
* <p>
* Provided {@link MethodNameMatchRequestor} requestor will collect the {@link MethodNameMatch}
* matches found during the search.
* </p>
* <p>
- * NOTE: this is a first-cut version and might have noticeable delay times in some cases.
- * Targeted for optimization during 4.7. It is recommended to contact JDT Team if
+ * NOTE: this is a first-cut version and might have noticeable delay times in some cases.
+ * Targeted for optimization during 4.7. It is recommended to contact JDT Team if
* anyone plans to use this.
* </p>
- *
+ *
* @param packageName the full name of the package of the searched types, or a prefix for this
* package, or a wild-carded string for this package.
* May be <code>null</code>, then any package name is accepted.
@@ -764,7 +764,7 @@ public class SearchEngine {
* @param progressMonitor the progress monitor to report progress to, or <code>null</code> if no progress
* monitor is provided
* @exception JavaModelException if the search failed.
- *
+ *
* @since 3.12
*/
public void searchAllMethodNames(
@@ -786,7 +786,7 @@ public class SearchEngine {
declaringQualification, declQualificationMatchRule,
declaringSimpleName, declSimpleNameMatchRule,
methodName, methodMatchRule,
- scope, requestorWrapper,
+ scope, requestorWrapper,
waitingPolicy, progressMonitor);
}
@@ -794,11 +794,11 @@ public class SearchEngine {
* Searches for all method declarations in the given scope. Accepted matches will be returned by
* {@link MethodNameRequestor#acceptMethod}.
* <p>
- * NOTE: this is a first-cut version and might have noticeable delay times in some cases.
- * Targeted for optimization during 4.7. It is recommended to contact JDT Team if
+ * NOTE: this is a first-cut version and might have noticeable delay times in some cases.
+ * Targeted for optimization during 4.7. It is recommended to contact JDT Team if
* anyone plans to use this.
* </p>
- *
+ *
* @param qualifier qualifier including package name and qualified type name
* May be <code>null</code>, then any qualifier name is accepted.
* @param qualifierMatchRule match rule for the qualifier and can be one of
@@ -812,7 +812,7 @@ public class SearchEngine {
* <li>{@link SearchPattern#R_CAMELCASE_MATCH} if the package name and types are
* camel case of the package and type of searched methods.</li>
* <li>{@link SearchPattern#R_CAMELCASE_SAME_PART_COUNT_MATCH}
- * if the package name and type names are camel case with same part count of the
+ * if the package name and type names are camel case with same part count of the
* package and types of searched methods.</li>
* </ul>
* @param methodName the method name searched for.
@@ -822,7 +822,7 @@ public class SearchEngine {
* is exact.</li>
* <li>{@link SearchPattern#R_PREFIX_MATCH} if method
* name is prefix of the names of the searched methods.</li>
- * <li>{@link SearchPattern#R_PATTERN_MATCH} if the method name
+ * <li>{@link SearchPattern#R_PATTERN_MATCH} if the method name
* contains wild-cards.</li>
* <li>{@link SearchPattern#R_CAMELCASE_MATCH} if the method name is a
* camel case of the searched method name.</li>
@@ -843,7 +843,7 @@ public class SearchEngine {
* @param progressMonitor the progress monitor to report progress to, or <code>null</code> if no progress
* monitor is provided
* @exception JavaModelException if the search failed.
- *
+ *
* @since 3.12
*/
public void searchAllMethodNames(
@@ -857,24 +857,24 @@ public class SearchEngine {
IProgressMonitor progressMonitor) throws JavaModelException {
MethodNameRequestorWrapper requestorWrapper = new MethodNameRequestorWrapper(nameRequestor);
this.basicEngine.searchAllMethodNames(
- qualifier, qualifierMatchRule,
- methodName, methodMatchRule,
- scope, requestorWrapper,
+ qualifier, qualifierMatchRule,
+ methodName, methodMatchRule,
+ scope, requestorWrapper,
waitingPolicy, progressMonitor);
}
/**
- * Searches for all method declarations in the given scope.
+ * Searches for all method declarations in the given scope.
* <p>
* Provided {@link MethodNameMatchRequestor} requestor will collect the {@link MethodNameMatch}
* matches found during the search.
* </p>
* <p>
- * NOTE: this is a first-cut version and might have noticeable delay times in some cases.
- * Targeted for optimization during 4.7. It is recommended to contact JDT Team if
+ * NOTE: this is a first-cut version and might have noticeable delay times in some cases.
+ * Targeted for optimization during 4.7. It is recommended to contact JDT Team if
* anyone plans to use this.
* </p>
- *
+ *
* @param qualifier qualifier including package name and qualified type name
* May be <code>null</code>, then any qualifier name is accepted.
* @param qualifierMatchRule match rule for the qualifier and can be one of
@@ -888,7 +888,7 @@ public class SearchEngine {
* <li>{@link SearchPattern#R_CAMELCASE_MATCH} if the package name and types are
* camel case of the package and type of searched methods.</li>
* <li>{@link SearchPattern#R_CAMELCASE_SAME_PART_COUNT_MATCH}
- * if the package name and type names are camel case with same part count of the
+ * if the package name and type names are camel case with same part count of the
* package and types of searched methods.</li>
* </ul>
* @param methodName the method name searched for.
@@ -898,7 +898,7 @@ public class SearchEngine {
* is exact.</li>
* <li>{@link SearchPattern#R_PREFIX_MATCH} if method
* name is prefix of the names of the searched methods.</li>
- * <li>{@link SearchPattern#R_PATTERN_MATCH} if the method name
+ * <li>{@link SearchPattern#R_PATTERN_MATCH} if the method name
* contains wild-cards.</li>
* <li>{@link SearchPattern#R_CAMELCASE_MATCH} if the method name is a
* camel case of the searched method name.</li>
@@ -919,7 +919,7 @@ public class SearchEngine {
* @param progressMonitor the progress monitor to report progress to, or <code>null</code> if no progress
* monitor is provided
* @exception JavaModelException if the search failed.
- *
+ *
* @since 3.12
*/
public void searchAllMethodNames(
@@ -935,7 +935,7 @@ public class SearchEngine {
this.basicEngine.searchAllMethodNames(
qualifier, qualifierMatchRule,
methodName, methodMatchRule,
- scope, requestorWrapper,
+ scope, requestorWrapper,
waitingPolicy, progressMonitor);
}
/**
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchMatch.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchMatch.java
index 4af7455ed..45b54d262 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchMatch.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchMatch.java
@@ -20,7 +20,7 @@ import org.eclipse.jdt.internal.core.JavaElement;
/**
* A search match represents the result of a search query.
- *
+ *
* Search matches may be accurate (<code>A_ACCURATE</code>) or they might be
* merely potential matches (<code>A_INACCURATE</code>). The latter occurs when
* a compile-time problem prevents the search engine from completely resolving
@@ -28,15 +28,15 @@ import org.eclipse.jdt.internal.core.JavaElement;
* <p>
* This class is intended to be instantiated and subclassed by clients.
* </p>
- *
+ *
* @see SearchEngine#search(SearchPattern, SearchParticipant[], IJavaSearchScope, SearchRequestor, org.eclipse.core.runtime.IProgressMonitor)
* @since 3.0
*/
public class SearchMatch {
-
+
/**
* The search result corresponds an exact match of the search pattern.
- *
+ *
* @see #getAccuracy()
*/
public static final int A_ACCURATE = 0;
@@ -45,7 +45,7 @@ public class SearchMatch {
* The search result is potentially a match for the search pattern,
* but the search engine is unable to fully check it (for example, because
* there are errors in the code or the classpath are not correctly set).
- *
+ *
* @see #getAccuracy()
*/
public static final int A_INACCURATE = 1;
@@ -56,23 +56,23 @@ public class SearchMatch {
*/
public static final int A_CHECKED = 4;
// SH}
-
+
private Object element;
private int length;
private int offset;
private int accuracy;
- private SearchParticipant participant;
+ private SearchParticipant participant;
private IResource resource;
private boolean insideDocComment = false;
-
+
// store the rule used while reporting the match
private final static int ALL_GENERIC_FLAVORS = SearchPattern.R_FULL_MATCH |
SearchPattern.R_EQUIVALENT_MATCH |
SearchPattern.R_ERASURE_MATCH;
private int rule = ALL_GENERIC_FLAVORS;
-
+
// store other necessary information
private boolean raw = false;
private boolean implicit = false;
@@ -82,7 +82,7 @@ public class SearchMatch {
* <p>
* Note that <code>isInsideDocComment()</code> defaults to false.
* </p>
- *
+ *
* @param element the element that encloses or corresponds to the match,
* or <code>null</code> if none
* @param accuracy one of {@link #A_ACCURATE} or {@link #A_INACCURATE}
@@ -94,9 +94,9 @@ public class SearchMatch {
public SearchMatch(
IJavaElement element,
int accuracy,
- int offset,
+ int offset,
int length,
- SearchParticipant participant,
+ SearchParticipant participant,
IResource resource) {
this.element = element;
this.offset = offset;
@@ -115,7 +115,7 @@ public class SearchMatch {
/**
* Returns the accuracy of this search match.
- *
+ *
* @return one of {@link #A_ACCURATE} or {@link #A_INACCURATE}
*/
public final int getAccuracy() {
@@ -126,7 +126,7 @@ public class SearchMatch {
* Returns the element of this search match.
* In case of a reference match, this is the inner-most enclosing element of the reference.
* In case of a declaration match, this is the declaration.
- *
+ *
* @return the element of the search match, or <code>null</code> if none
*/
public final Object getElement() {
@@ -135,34 +135,34 @@ public class SearchMatch {
/**
* Returns the length of this search match.
- *
+ *
* @return the length of this search match, or -1 if unknown
*/
public final int getLength() {
return this.length;
}
-
+
/**
* Returns the offset of this search match.
- *
+ *
* @return the offset of this search match, or -1 if unknown
*/
public final int getOffset() {
return this.offset;
}
-
+
/**
* Returns the search participant which issued this search match.
- *
+ *
* @return the participant which issued this search match
*/
public final SearchParticipant getParticipant() {
return this.participant;
}
-
+
/**
* Returns the resource containing this search match.
- *
+ *
* @return the resource of the match, or <code>null</code> if none
*/
public final IResource getResource() {
@@ -171,7 +171,7 @@ public class SearchMatch {
/**
* Returns the rule used while creating the match.
- *
+ *
* @return one of {@link SearchPattern#R_FULL_MATCH}, {@link SearchPattern#R_EQUIVALENT_MATCH}
* or {@link SearchPattern#R_ERASURE_MATCH}
* @since 3.1
@@ -183,8 +183,8 @@ public class SearchMatch {
/**
* Returns whether match element is compatible with searched pattern or not.
* Note that equivalent matches are also erasure ones.
- *
- * @return <code>true</code> if match element is compatible
+ *
+ * @return <code>true</code> if match element is compatible
* <code>false</code> otherwise
* @since 3.1
*/
@@ -196,7 +196,7 @@ public class SearchMatch {
* Returns whether match element only has same erasure than searched pattern or not.
* Note that this is always true for both generic and non-generic element as soon
* as the accuracy is accurate.
- *
+ *
* @return <code>true</code> if match element has same erasure
* <code>false</code> otherwise
* @since 3.1
@@ -208,7 +208,7 @@ public class SearchMatch {
/**
* Returns whether element matches exactly searched pattern or not.
* Note that exact matches are also erasure and equivalent ones.
- *
+ *
* @return <code>true</code> if match is exact
* <code>false</code> otherwise
* @since 3.1
@@ -219,10 +219,10 @@ public class SearchMatch {
/**
* Returns whether the associated element is implicit or not.
- *
+ *
* Note that this piece of information is currently only implemented
* for implicit member pair value in annotation.
- *
+ *
* @return <code>true</code> if this match is associated to an implicit
* element and <code>false</code> otherwise
* @since 3.1
@@ -233,7 +233,7 @@ public class SearchMatch {
/**
* Returns whether the associated element is a raw type/method or not.
- *
+ *
* @return <code>true</code> if this match is associated to a raw
* type or method and <code>false</code> otherwise
* @since 3.1
@@ -245,7 +245,7 @@ public class SearchMatch {
/**
* Returns whether this search match is inside a doc comment of a Java
* source file.
- *
+ *
* @return <code>true</code> if this search match is inside a doc
* comment, and <code>false</code> otherwise
*/
@@ -256,7 +256,7 @@ public class SearchMatch {
/**
* Sets the accuracy of this match.
- *
+ *
* @param accuracy one of {@link #A_ACCURATE} or {@link #A_INACCURATE}
*/
public final void setAccuracy (int accuracy) {
@@ -265,7 +265,7 @@ public class SearchMatch {
/**
* Sets the element of this search match.
- *
+ *
* @param element the element that encloses or corresponds to the match,
* or <code>null</code> if none
*/
@@ -276,7 +276,7 @@ public class SearchMatch {
/**
* Sets whether this search match is inside a doc comment of a Java
* source file.
- *
+ *
* @param insideDoc <code>true</code> if this search match is inside a doc
* comment, and <code>false</code> otherwise
*/
@@ -288,7 +288,7 @@ public class SearchMatch {
* Sets whether the associated element is implicit or not.
* Typically, this is the case when match is on an implicit constructor
* or an implicit member pair value in annotation.
- *
+ *
* @param implicit <code>true</code> if this match is associated to an implicit
* element and <code>false</code> otherwise
* @since 3.1
@@ -299,16 +299,16 @@ public class SearchMatch {
/**
* Sets the length of this search match.
- *
+ *
* @param length the length of the match, or -1 if unknown
*/
public final void setLength(int length) {
this.length = length;
}
-
+
/**
* Sets the offset of this search match.
- *
+ *
* @param offset the offset the match starts at, or -1 if unknown
*/
public final void setOffset(int offset) {
@@ -317,7 +317,7 @@ public class SearchMatch {
/**
* Sets the participant of this match.
- *
+ *
* @param participant the search participant that created this match
*/
public final void setParticipant (SearchParticipant participant) {
@@ -326,7 +326,7 @@ public class SearchMatch {
/**
* Sets the resource of this match.
- *
+ *
* @param resource the resource of the match, or <code>null</code> if none
*/
public final void setResource (IResource resource) {
@@ -335,7 +335,7 @@ public class SearchMatch {
/**
* Set the rule used while reporting the match.
- *
+ *
* @param rule one of {@link SearchPattern#R_FULL_MATCH}, {@link SearchPattern#R_EQUIVALENT_MATCH}
* or {@link SearchPattern#R_ERASURE_MATCH}
* @since 3.1
@@ -346,7 +346,7 @@ public class SearchMatch {
/**
* Set whether the associated element is a raw type/method or not.
- *
+ *
* @param raw <code>true</code> if this search match is associated to a raw
* type or method and <code>false</code> otherwise
* @since 3.1
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchParticipant.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchParticipant.java
index 3a94c4e4b..9c9996717 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchParticipant.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchParticipant.java
@@ -26,7 +26,7 @@ import org.eclipse.jdt.internal.core.search.indexing.IndexManager;
* mechanism, permitting combined search actions which will involve all required
* participants.
* <p>
- * A search participant is involved in the indexing phase and in the search phase.
+ * A search participant is involved in the indexing phase and in the search phase.
* The indexing phase consists in taking one or more search documents, parse them, and
* add index entries in an index chosen by the participant. An index is identified by a
* path on disk.
@@ -36,7 +36,7 @@ import org.eclipse.jdt.internal.core.search.indexing.IndexManager;
* finally the search participant is asked to locate the matches precisely in these search documents.
* </p>
* <p>
- * This class is intended to be subclassed by clients. During the indexing phase,
+ * This class is intended to be subclassed by clients. During the indexing phase,
* a subclass will be called with the following requests in order:
* <ul>
* <li>{@link #scheduleDocumentIndexing(SearchDocument, IPath)}</li>
@@ -62,7 +62,7 @@ public abstract class SearchParticipant {
protected SearchParticipant() {
// do nothing
}
-
+
/**
* Notification that this participant's help is needed in a search.
* <p>
@@ -103,10 +103,10 @@ public abstract class SearchParticipant {
* The given document path is a string that uniquely identifies the document.
* Most of the time it is a workspace-relative path, but it can also be a file system path, or a path inside a zip file.
* <p>
- * Implementors of this method can either create an instance of their own subclass of
+ * Implementors of this method can either create an instance of their own subclass of
* {@link SearchDocument} or return an existing instance of such a subclass.
* </p>
- *
+ *
* @param documentPath the path of the document.
* @return a search document
*/
@@ -114,14 +114,14 @@ public abstract class SearchParticipant {
/**
* Indexes the given document in the given index. A search participant
- * asked to index a document should parse it and call
+ * asked to index a document should parse it and call
* {@link SearchDocument#addIndexEntry(char[], char[])} as many times as
* needed to add index entries to the index. If delegating to another
* participant, it should use the original index location (and not the
* delegatee's one). In the particular case of delegating to the default
* search participant (see {@link SearchEngine#getDefaultSearchParticipant()}),
- * the provided document's path must be a path ending with one of the
- * {@link org.eclipse.jdt.core.JavaCore#getJavaLikeExtensions() Java-like extensions}
+ * the provided document's path must be a path ending with one of the
+ * {@link org.eclipse.jdt.core.JavaCore#getJavaLikeExtensions() Java-like extensions}
* or with '.class'.
* <p>
* The given index location must represent a path in the file system to a file that
@@ -130,7 +130,7 @@ public abstract class SearchParticipant {
* </p><p>
* Clients are not expected to call this method.
* </p>
- *
+ *
* @param document the document to index
* @param indexLocation the location in the file system to the index
*/
@@ -158,7 +158,7 @@ public abstract class SearchParticipant {
*
* @param document the document to index
* @param indexLocation the location in the file system to the index
- *
+ *
* @since 3.10
*/
public void indexResolvedDocument(SearchDocument document, IPath indexLocation) {
@@ -179,10 +179,10 @@ public abstract class SearchParticipant {
* </p><p>
* Implementors of this method should check the progress monitor
* for cancelation when it is safe and appropriate to do so. The cancelation
- * request should be propagated to the caller by throwing
+ * request should be propagated to the caller by throwing
* <code>OperationCanceledException</code>.
* </p>
- *
+ *
* @param documents the documents to locate matches in
* @param pattern the search pattern to use when locating matches
* @param scope the scope to limit the search to
@@ -194,7 +194,7 @@ public abstract class SearchParticipant {
public abstract void locateMatches(SearchDocument[] documents, SearchPattern pattern, IJavaSearchScope scope, SearchRequestor requestor, IProgressMonitor monitor) throws CoreException;
/**
- * Removes the index for a given path.
+ * Removes the index for a given path.
* <p>
* The given index location must represent a path in the file system to a file that
* already exists and must be an index file, otherwise nothing will be done.
@@ -202,7 +202,7 @@ public abstract class SearchParticipant {
* It is strongly recommended to use this method instead of deleting file directly
* otherwise cached index will not be removed.
* </p>
- *
+ *
* @param indexLocation the location in the file system to the index
* @since 3.2
*/
@@ -212,7 +212,7 @@ public abstract class SearchParticipant {
}
/**
- * Resolves the given document. A search participant asked to resolve a document should parse it and
+ * Resolves the given document. A search participant asked to resolve a document should parse it and
* resolve the types and preserve enough state to be able to tend to a indexResolvedDocument call
* subsequently. This API is invoked without holding any index related locks or monitors.
* <p>
@@ -227,10 +227,10 @@ public abstract class SearchParticipant {
public void resolveDocument(SearchDocument document) {
// do nothing, subtypes should do the "appropriate thing"
}
-
+
/**
* Schedules the indexing of the given document.
- * Once the document is ready to be indexed,
+ * Once the document is ready to be indexed,
* {@link #indexDocument(SearchDocument, IPath) indexDocument(document, indexPath)}
* will be called in a different thread than the caller's thread.
* <p>
@@ -241,7 +241,7 @@ public abstract class SearchParticipant {
* When the index is no longer needed, clients should use {@link #removeIndex(IPath) }
* to discard it.
* </p>
- *
+ *
* @param document the document to index
* @param indexPath the location on the file system of the index
*/
@@ -271,11 +271,11 @@ public abstract class SearchParticipant {
* given search query in the given scope. The search engine calls this
* method before locating matches.
* <p>
- * An index location represents a path in the file system to a file that holds index information.
+ * An index location represents a path in the file system to a file that holds index information.
* </p><p>
* Clients are not expected to call this method.
* </p>
- *
+ *
* @param query the search pattern to consider
* @param scope the given search scope
* @return the collection of index paths to consider
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchPattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchPattern.java
index 955050962..5fc4abb32 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchPattern.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchPattern.java
@@ -222,7 +222,7 @@ public abstract class SearchPattern {
* of other match rule flags are combined with this one, then match rule validation
* will return a modified rule in order to perform a better appropriate search request
* (see {@link #validateMatchRule(String, int)} for more details).
- *
+ *
* <p>
* This is implemented only for code assist and not available for normal search.
*
@@ -243,7 +243,7 @@ public abstract class SearchPattern {
* of other match rule flags are combined with this one, then match rule validation
* will return a modified rule in order to perform a better appropriate search request
* (see {@link #validateMatchRule(String, int)} for more details).
- *
+ *
* <p>
* This is implemented only for code assist and not available for normal search.
*
@@ -263,7 +263,7 @@ public abstract class SearchPattern {
/**
* The focus element (used for reference patterns)
- * @noreference This field is not intended to be referenced by clients.
+ * @noreference This field is not intended to be referenced by clients.
*/
public IJavaElement focus;
@@ -271,12 +271,12 @@ public abstract class SearchPattern {
* @noreference This field is not intended to be referenced by clients.
*/
public int kind;
-
+
/**
* @noreference This field is not intended to be referenced by clients.
*/
public boolean mustResolve = true;
-
+
/**
* Creates a search pattern with the rule to apply for matching index keys.
* It can be exact match, prefix match, pattern match or regexp match.
@@ -358,14 +358,14 @@ public void acceptMatch(String relativePath, String containerPath, char separato
String documentPath = buffer.toString();
boolean encloses = (scope instanceof HierarchyScope) ? ((HierarchyScope)scope).encloses(documentPath, monitor)
: scope.encloses(documentPath);
- if (encloses)
+ if (encloses)
if (!requestor.acceptIndexMatch(documentPath, pattern, participant, null))
throw new OperationCanceledException();
}
}
/**
- * @noreference This method is not intended to be referenced by clients.
+ * @noreference This method is not intended to be referenced by clients.
* @nooverride This method is not intended to be re-implemented or extended by clients.
*/
public SearchPattern currentPattern() {
@@ -836,7 +836,7 @@ public static final boolean camelCaseMatch(String pattern, int patternStart, int
* <code>'?*'</code>, <code>'???'</code>, etc.) when using a pattern
* match rule.
* </p>
- *
+ *
* @since 3.5
*/
public static final int[] getMatchingRegions(String pattern, String name, int matchRule) {
@@ -1478,7 +1478,7 @@ private static SearchPattern createPackagePattern(String patternString, int limi
* Unnamed modules can also be included and are represented either by an absence of module name implicitly
* or explicitly by specifying ALL-UNNAMED for module name.
* Module graph search is also supported with the limitTo option set to <code>IJavaSearchConstants.MODULE_GRAPH</code>.
- * In the module graph case, the given type is searched in all the modules required directly as well
+ * In the module graph case, the given type is searched in all the modules required directly as well
* as indirectly by the given module(s).
* </p>
* <p>
@@ -1490,7 +1490,7 @@ private static SearchPattern createPackagePattern(String patternString, int limi
* <li><code>java.base/java.lang.Object</code></li>
* <li><code>mod.one, mod.two/pack.X</code> find declaration in the list of given modules.</li>
* <li><code>/pack.X</code> find in the unnamed module.</li>
- * <li><code>ALL-UNNAMED/pack.X</code> find in the unnamed module.</li>
+ * <li><code>ALL-UNNAMED/pack.X</code> find in the unnamed module.</li>
* </ul>
* <p>
* </li>
@@ -1566,12 +1566,12 @@ private static SearchPattern createPackagePattern(String patternString, int limi
* Note that types may be only classes or only interfaces if {@link IJavaSearchConstants#CLASS CLASS} or
* {@link IJavaSearchConstants#INTERFACE INTERFACE} is respectively used instead of {@link IJavaSearchConstants#TYPE TYPE}.
* </li>
- * <li>{@link IJavaSearchConstants#MODULE_GRAPH MODULE_GRAPH}: for types with a module prefix,
+ * <li>{@link IJavaSearchConstants#MODULE_GRAPH MODULE_GRAPH}: for types with a module prefix,
* will find all types present in required modules (directly or indirectly required) ie
* in any module present in the module graph of the given module.
* </li>
* <li>All other fine grain constants defined in the <b>limitTo</b> category
- * of the {@link IJavaSearchConstants} are also accepted nature:
+ * of the {@link IJavaSearchConstants} are also accepted nature:
* <table>
* <tr>
* <th>Fine grain constant
@@ -1665,7 +1665,7 @@ private static SearchPattern createPackagePattern(String patternString, int limi
* on non-generic types/methods search.</p>
*
* <p>Note that {@link #R_REGEXP_MATCH} is supported since 3.14 for the special case of
- * {@link IJavaSearchConstants#DECLARATIONS DECLARATIONS} search of
+ * {@link IJavaSearchConstants#DECLARATIONS DECLARATIONS} search of
* {@link IJavaSearchConstants#MODULE MODULE}</p>
* <p>
* Note also that the default behavior for generic types/methods search is to find exact matches.</p>
@@ -1757,7 +1757,7 @@ public static SearchPattern createPattern(String stringPattern, int searchFor, i
* references as specified above.
* </li>
* <li>All other fine grain constants defined in the <b>limitTo</b> category
- * of the {@link IJavaSearchConstants} are also accepted nature:
+ * of the {@link IJavaSearchConstants} are also accepted nature:
* <table>
* <tr>
* <th>Fine grain constant
@@ -1869,7 +1869,7 @@ public static SearchPattern createPattern(IJavaElement element, int limitTo) {
* references as specified above.
* </li>
* <li>All other fine grain constants defined in the <b>limitTo</b> category
- * of the {@link IJavaSearchConstants} are also accepted nature:
+ * of the {@link IJavaSearchConstants} are also accepted nature:
* <table>
* <tr>
* <th>Fine grain constant
@@ -2074,18 +2074,18 @@ public static SearchPattern createPattern(IJavaElement element, int limitTo, int
typeParam,
matchRule);
break;
-//{ObjectTeams: patterns for method mappings:
+//{ObjectTeams: patterns for method mappings:
case IOTJavaElement.CALLOUT_MAPPING:
case IOTJavaElement.CALLOUT_TO_FIELD_MAPPING:
// treat as a method declaration:
method = (IMethod)((AbstractCalloutMapping)element).getCorrespondingJavaElement();
ignoreReturnType = true; // return type is not resolved
-// orig:
+// orig:
//$FALL-THROUGH$
- case IJavaElement.METHOD :
+ case IJavaElement.METHOD :
/*
IMethod method = (IMethod) element;
- :giro */
+ :giro */
if (method == null)
method = (IMethod) element;
IType declaringRoleClass= null;
@@ -2253,7 +2253,7 @@ private static SearchPattern createTypePattern(char[] simpleName, char[] package
//{ObjectTeams: search base class references:
case IJavaSearchConstants.PLAYEDBY_REFERENCES :
return new SuperTypeReferencePattern(
- CharOperation.concatWith(packageName, enclosingTypeNames, '.'),
+ CharOperation.concatWith(packageName, enclosingTypeNames, '.'),
simpleName,
SuperTypeReferencePattern.ONLY_BASE_CLASSES,
matchRule);
@@ -2390,7 +2390,7 @@ private static SearchPattern createTypePattern(String patternString, int limitTo
case IJavaSearchConstants.IMPLEMENTORS :
return new SuperTypeReferencePattern(qualificationChars, typeChars, SuperTypeReferencePattern.ONLY_SUPER_INTERFACES, indexSuffix, matchRule);
//{ObjectTeams: search base class references:
- case IJavaSearchConstants.PLAYEDBY_REFERENCES :
+ case IJavaSearchConstants.PLAYEDBY_REFERENCES :
return new SuperTypeReferencePattern(qualificationChars, typeChars, SuperTypeReferencePattern.ONLY_BASE_CLASSES, indexSuffix, matchRule);
// SH}
case IJavaSearchConstants.ALL_OCCURRENCES :
@@ -2450,8 +2450,8 @@ public void decodeIndexKey(char[] key) {
}
/**
* Query a given index for matching entries. Assumes the sender has opened the index and will close when finished.
- *
- * @noreference This method is not intended to be referenced by clients.
+ *
+ * @noreference This method is not intended to be referenced by clients.
* @nooverride This method is not intended to be re-implemented or extended by clients.
*/
public void findIndexMatches(Index index, IndexQueryRequestor requestor, SearchParticipant participant, IJavaSearchScope scope, IProgressMonitor monitor) throws IOException {
@@ -2534,7 +2534,7 @@ public final int getMatchRule() {
return this.matchRule;
}
/**
- * @noreference This method is not intended to be referenced by clients.
+ * @noreference This method is not intended to be referenced by clients.
* @nooverride This method is not intended to be re-implemented or extended by clients.
*/
public boolean isPolymorphicSearch() {
@@ -2722,7 +2722,7 @@ public static int validateMatchRule(String stringPattern, int matchRule) {
// enabling special cases (read regular expressions) based on searchFor and limitTo
private static int validateMatchRule(String stringPattern, int searchFor, int limitTo, int matchRule) {
- if (searchFor == IJavaSearchConstants.MODULE &&
+ if (searchFor == IJavaSearchConstants.MODULE &&
limitTo == IJavaSearchConstants.DECLARATIONS &&
matchRule == SearchPattern.R_REGEXP_MATCH)
return matchRule;
@@ -2755,7 +2755,7 @@ private static boolean validateCamelCasePattern(String stringPattern) {
}
/**
- * @noreference This method is not intended to be referenced by clients.
+ * @noreference This method is not intended to be referenced by clients.
* @nooverride This method is not intended to be re-implemented or extended by clients.
*/
public EntryResult[] queryIn(Index index) throws IOException {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchRequestor.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchRequestor.java
index 442edeab1..e7819fa37 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchRequestor.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchRequestor.java
@@ -16,7 +16,7 @@ package org.eclipse.jdt.core.search;
import org.eclipse.core.runtime.CoreException;
/**
- * Collects the results from a search engine query.
+ * Collects the results from a search engine query.
* Clients implement a subclass to pass to <code>SearchEngine.search</code>
* and implement the {@link #acceptSearchMatch(SearchMatch)} method, and
* possibly override other life cycle methods.
@@ -75,7 +75,7 @@ public abstract class SearchRequestor {
* The default implementation of this method does nothing. Subclasses
* may override.
* </p>
- *
+ *
* @param participant the participant that is starting to contribute
*/
public void enterParticipant(SearchParticipant participant) {
@@ -89,7 +89,7 @@ public abstract class SearchRequestor {
* The default implementation of this method does nothing. Subclasses
* may override.
* </p>
- *
+ *
* @param participant the participant that finished contributing
*/
public void exitParticipant(SearchParticipant participant) {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeDeclarationMatch.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeDeclarationMatch.java
index 858b9f666..5c5a892e3 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeDeclarationMatch.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeDeclarationMatch.java
@@ -22,14 +22,14 @@ import org.eclipse.jdt.core.IJavaElement;
* <p>
* This class is intended to be instantiated and subclassed by clients.
* </p>
- *
+ *
* @since 3.0
*/
public class TypeDeclarationMatch extends SearchMatch {
/**
* Creates a new type declaration match.
- *
+ *
* @param element the type declaration
* @param accuracy one of A_ACCURATE or A_INACCURATE
* @param offset the offset the match starts at, or -1 if unknown
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeNameMatch.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeNameMatch.java
index e1786bbe0..0b1b770f4 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeNameMatch.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeNameMatch.java
@@ -16,12 +16,12 @@ package org.eclipse.jdt.core.search;
import org.eclipse.jdt.core.*;
/**
- * A match collected while {@link SearchEngine searching} for
+ * A match collected while {@link SearchEngine searching} for
* all type names methods using a {@link TypeNameRequestor requestor}.
* <p>
* The type of this match is available from {@link #getType()}.
* </p>
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
*
* @see TypeNameMatchRequestor
@@ -48,10 +48,10 @@ public abstract int getAccessibility();
/**
* Returns the matched type's fully qualified name using '.' character
* as separator (e.g. package name + '.' enclosing type names + '.' simple name).
- *
+ *
* @see #getType()
* @see IType#getFullyQualifiedName(char)
- *
+ *
* @throws NullPointerException if matched type is <code> null</code>
* @return Fully qualified type name of the type
*/
@@ -64,7 +64,7 @@ public String getFullyQualifiedName() {
* <p>
* This is a handle-only method as neither Java Model nor classpath
* initialization is done while calling this method.
- *
+ *
* @return the type modifiers
*/
public abstract int getModifiers();
@@ -72,10 +72,10 @@ public abstract int getModifiers();
/**
* Returns the package fragment root of the stored type.
* Package fragment root cannot be null and <strong>does</strong> exist.
- *
+ *
* @see #getType()
* @see IJavaElement#getAncestor(int)
- *
+ *
* @throws NullPointerException if matched type is <code> null</code>
* @return the existing java model package fragment root (i.e. cannot be <code>null</code>
* and will return <code>true</code> to <code>exists()</code> message).
@@ -86,10 +86,10 @@ public IPackageFragmentRoot getPackageFragmentRoot() {
/**
* Returns the package name of the stored type.
- *
+ *
* @see #getType()
* @see IType#getPackageFragment()
- *
+ *
* @throws NullPointerException if matched type is <code> null</code>
* @return the package name
*/
@@ -99,10 +99,10 @@ public String getPackageName() {
/**
* Returns the name of the stored type.
- *
+ *
* @see #getType()
* @see IJavaElement#getElementName()
- *
+ *
* @throws NullPointerException if matched type is <code> null</code>
* @return the type name
*/
@@ -116,7 +116,7 @@ public String getSimpleTypeName() {
* <p>
* This is a handle-only method as neither Java Model nor classpath
* initializations are done while calling this method.
- *
+ *
* @see IType
* @return the non-null handle on matched java model type.
*/
@@ -125,10 +125,10 @@ public abstract IType getType();
/**
* Name of the type container using '.' character
* as separator (e.g. package name + '.' + enclosing type names).
- *
+ *
* @see #getType()
* @see IMember#getDeclaringType()
- *
+ *
* @throws NullPointerException if matched type is <code> null</code>
* @return name of the type container
*/
@@ -144,10 +144,10 @@ public String getTypeContainerName() {
/**
* Returns the matched type's type qualified name using '.' character
* as separator (e.g. enclosing type names + '.' + simple name).
- *
+ *
* @see #getType()
* @see IType#getTypeQualifiedName(char)
- *
+ *
* @throws NullPointerException if matched type is <code> null</code>
* @return fully qualified type name of the type
*/
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeNameMatchRequestor.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeNameMatchRequestor.java
index 6f92fc0e0..ac2b53438 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeNameMatchRequestor.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeNameMatchRequestor.java
@@ -17,12 +17,12 @@ package org.eclipse.jdt.core.search;
* A <code>TypeNameMatchRequestor</code> collects matches from a <code>searchAllTypeNames</code>
* query to a <code>SearchEngine</code>. Clients must subclass this abstract class and pass an instance to the
* {@link SearchEngine#searchAllTypeNames(
- * char[] packageName,
- * int packageMatchRule,
+ * char[] packageName,
+ * int packageMatchRule,
* char[] typeName,
- * int typeMatchRule,
- * int searchFor,
- * IJavaSearchScope scope,
+ * int typeMatchRule,
+ * int searchFor,
+ * IJavaSearchScope scope,
* TypeNameMatchRequestor nameMatchRequestor,
* int waitingPolicy,
* org.eclipse.core.runtime.IProgressMonitor monitor)} method.
@@ -37,7 +37,7 @@ package org.eclipse.jdt.core.search;
* </p>
* @see TypeNameMatch
* @see TypeNameRequestor
- *
+ *
* @since 3.3
*/
public abstract class TypeNameMatchRequestor {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeNameRequestor.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeNameRequestor.java
index 19c6cca42..7cc9b5974 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeNameRequestor.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeNameRequestor.java
@@ -47,9 +47,9 @@ public abstract class TypeNameRequestor {
* @param path the full path to the resource containing the type. If the resource is a .class file
* or a source file, this is the full path in the workspace to this resource. If the
* resource is an archive (that is, a .zip or .jar file), the path is composed of 2 paths separated
- * by <code>IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR</code>:
- * the first path is the full OS path to the archive (if it is an external archive),
- * or the workspace relative <code>IPath</code> to the archive (if it is an internal archive),
+ * by <code>IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR</code>:
+ * the first path is the full OS path to the archive (if it is an external archive),
+ * or the workspace relative <code>IPath</code> to the archive (if it is an internal archive),
* the second path is the path to the resource inside the archive.
*/
public void acceptType(int modifiers, char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, String path) {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeParameterDeclarationMatch.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeParameterDeclarationMatch.java
index 214632684..19a14ab7a 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeParameterDeclarationMatch.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeParameterDeclarationMatch.java
@@ -22,14 +22,14 @@ import org.eclipse.jdt.core.IJavaElement;
* <p>
* This class is intended to be instantiated and subclassed by clients.
* </p>
- *
+ *
* @since 3.1
*/
public class TypeParameterDeclarationMatch extends SearchMatch {
/**
* Creates a new type parameter match.
- *
+ *
* @param element the type parameter
* @param accuracy one of A_ACCURATE or A_INACCURATE
* @param offset the offset the match starts at, or -1 if unknown
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeParameterReferenceMatch.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeParameterReferenceMatch.java
index 1eaf47a5b..85917d1d4 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeParameterReferenceMatch.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeParameterReferenceMatch.java
@@ -22,14 +22,14 @@ import org.eclipse.jdt.core.IJavaElement;
* <p>
* This class is intended to be instantiated and subclassed by clients.
* </p>
- *
+ *
* @since 3.1
*/
public class TypeParameterReferenceMatch extends SearchMatch {
/**
* Creates a new field reference match.
- *
+ *
* @param enclosingElement the inner-most enclosing member that references this field
* @param accuracy one of {@link #A_ACCURATE} or {@link #A_INACCURATE}
* @param offset the offset the match starts at, or -1 if unknown
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeReferenceMatch.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeReferenceMatch.java
index 3b45b077f..76c067e6b 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeReferenceMatch.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeReferenceMatch.java
@@ -22,7 +22,7 @@ import org.eclipse.jdt.core.*;
* <p>
* This class is intended to be instantiated and subclassed by clients.
* </p>
- *
+ *
* @since 3.0
*/
public class TypeReferenceMatch extends ReferenceMatch {
@@ -31,7 +31,7 @@ public class TypeReferenceMatch extends ReferenceMatch {
/**
* Creates a new type reference match.
- *
+ *
* @param enclosingElement the inner-most enclosing member that references this type
* @param accuracy one of {@link #A_ACCURATE} or {@link #A_INACCURATE}
* @param offset the offset the match starts at, or -1 if unknown
@@ -58,7 +58,7 @@ public TypeReferenceMatch(IJavaElement enclosingElement, int accuracy, int offse
* void method() {}
* }
* </pre>
- * will return one match whose other elements is an array of two fields:
+ * will return one match whose other elements is an array of two fields:
* {@link IField test2} and {@link IField test3}.
* <br><br>
* </li>
@@ -71,7 +71,7 @@ public TypeReferenceMatch(IJavaElement enclosingElement, int accuracy, int offse
* }
* }
* </pre>
- * will return one match whose other elements is an array of two local
+ * will return one match whose other elements is an array of two local
* variables: {@link ILocalVariable local2} and {@link ILocalVariable local3}.
* <br><br>
* </li>
@@ -90,7 +90,7 @@ public TypeReferenceMatch(IJavaElement enclosingElement, int accuracy, int offse
* {@link ILocalVariable test2}.
* </li>
* </ul>
- *
+ *
* @return the other elements of the search match, or <code>null</code> if none
* @since 3.2
*/
@@ -100,9 +100,9 @@ public final IJavaElement[] getOtherElements() {
/**
* Sets the other elements of this search match.
- *
+ *
* @see #getOtherElements()
- *
+ *
* @param otherElements the other elements of the match,
* or <code>null</code> if none
* @since 3.2
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/DiskIndex.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/DiskIndex.java
index 4c9c865b1..2f8fca18b 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/DiskIndex.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/DiskIndex.java
@@ -89,7 +89,7 @@ int[] asArray() {
int[] result = new int[this.size];
System.arraycopy(this.elements, 0, result, 0, this.size);
return result;
-}
+}
}
@@ -174,7 +174,7 @@ HashtableOfObject addQueryResults(char[][] categories, char[] key, int matchRule
if (this.categoryOffsets == null) return null; // file is empty
HashtableOfObject results = null; // initialized if needed
-
+
// No need to check the results table for duplicates while processing the
// first category table or if the first category tables doesn't have any results.
boolean prevResults = false;
@@ -914,17 +914,17 @@ private void readStreamBuffer(InputStream stream) throws IOException {
this.bufferIndex = 0;
}
/**
- * Reads in a string from the specified data input stream. The
- * string has been encoded using a modified UTF-8 format.
+ * Reads in a string from the specified data input stream. The
+ * string has been encoded using a modified UTF-8 format.
* <p>
* The first two bytes are read as an unsigned short.
* This value gives the number of following bytes that are in the encoded string,
- * not the length of the resulting string. The following bytes are then
- * interpreted as bytes encoding characters in the UTF-8 format
- * and are converted into characters.
+ * not the length of the resulting string. The following bytes are then
+ * interpreted as bytes encoding characters in the UTF-8 format
+ * and are converted into characters.
* <p>
- * This method blocks until all the bytes are read, the end of the
- * stream is detected, or an exception is thrown.
+ * This method blocks until all the bytes are read, the end of the
+ * stream is detected, or an exception is thrown.
*
* @param stream a data input stream.
* @return UTF decoded string as a char array
@@ -1254,12 +1254,12 @@ private void writeOffsetToHeader(int offsetToHeader) throws IOException {
}
}
/**
- * Writes a string to the given output stream using UTF-8
- * encoding in a machine-independent manner.
+ * Writes a string to the given output stream using UTF-8
+ * encoding in a machine-independent manner.
* <p>
- * First, two bytes of the array are giving the number of bytes to
- * follow. This value is the number of bytes actually written out,
- * not the length of the string. Following the length, each character
+ * First, two bytes of the array are giving the number of bytes to
+ * follow. This value is the number of bytes actually written out,
+ * not the length of the string. Following the length, each character
* of the string is put in the bytes array, in sequence, using the UTF-8
* encoding for the character.
* </p>
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/FileIndexLocation.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/FileIndexLocation.java
index 60cecd5f5..726b881d8 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/FileIndexLocation.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/FileIndexLocation.java
@@ -70,7 +70,7 @@ public class FileIndexLocation extends IndexLocation {
public String fileName() {
return this.indexFile.getName();
}
-
+
@Override
public File getIndexFile() {
return this.indexFile;
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/Index.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/Index.java
index bddc8e580..7a333cb35 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/Index.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/Index.java
@@ -187,7 +187,7 @@ public void remove(String containerRelativePath) {
}
/**
* Reset memory and disk indexes.
- *
+ *
* @throws IOException
*/
public void reset() throws IOException {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/IndexLocation.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/IndexLocation.java
index b913ec1bc..bcac15132 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/IndexLocation.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/IndexLocation.java
@@ -26,13 +26,13 @@ import org.eclipse.core.runtime.IPath;
/**
* The location of the index files are represented as {@link IndexLocation}
- *
+ *
* This is an abstract class to allow different implementation for a jar entry and a file
* on the disk. Some of these functions could mean different for a jar entry or a file
- *
+ *
*/
public abstract class IndexLocation {
-
+
public static IndexLocation createIndexLocation(URL url) {
URL localUrl;
try {
@@ -53,16 +53,16 @@ public abstract class IndexLocation {
}
return new JarIndexLocation(url, localUrl);
}
-
+
private final URL url; // url of the given index location
/**
* Set to true if this index location is of an index file specified
- * by a participant through
+ * by a participant through
* {@link org.eclipse.jdt.core.search.SearchParticipant#scheduleDocumentIndexing}
*/
protected boolean participantIndex;
-
+
protected IndexLocation(File file) {
URL tempUrl = null;
try {
@@ -72,7 +72,7 @@ public abstract class IndexLocation {
}
this.url = tempUrl;
}
-
+
public IndexLocation(URL url) {
this.url = url;
}
@@ -94,7 +94,7 @@ public abstract class IndexLocation {
public abstract boolean delete();
public abstract boolean exists();
-
+
public abstract String fileName();
/**
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/IndexExceptionBuilder.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/IndexExceptionBuilder.java
index 785f59f02..ed2b90e51 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/IndexExceptionBuilder.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/IndexExceptionBuilder.java
@@ -50,7 +50,7 @@ public final class IndexExceptionBuilder {
/**
* Adds an address range to this problem description, given a field that may be corrupt, the base
* address for its struct, and a custom description for the field.
- *
+ *
* @return this
*/
public IndexExceptionBuilder addProblemAddress(String description, IField field, long address) {
@@ -62,7 +62,7 @@ public final class IndexExceptionBuilder {
/**
* Adds an address range to this problem description, given the field that may be corrupt
* and the base address for its struct.
- *
+ *
* @return this
*/
public IndexExceptionBuilder addProblemAddress(IField field, long address) {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/Nd.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/Nd.java
index 44d48f721..13f027630 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/Nd.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/Nd.java
@@ -171,7 +171,7 @@ public final class Nd {
}
/**
- * Inserts a cookie that can be later retrieved via getData(String).
+ * Inserts a cookie that can be later retrieved via getData(String).
*/
public <T> void setData(Class<T> key, T value) {
synchronized (this.cookies) {
@@ -711,7 +711,7 @@ public final class Nd {
}
/**
- * Creates a {@link IndexExceptionBuilder} object that collects information about database corruption after it is
+ * Creates a {@link IndexExceptionBuilder} object that collects information about database corruption after it is
* detected.
*/
public IndexExceptionBuilder describeProblem() {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/RawGrowableArray.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/RawGrowableArray.java
index 7279420b3..e3ed5c94c 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/RawGrowableArray.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/RawGrowableArray.java
@@ -28,7 +28,7 @@ import org.eclipse.jdt.internal.core.nd.util.MathUtils;
* <p>
* The memory format contains a header is as follows:
* <p>
- *
+ *
* <pre>
* Byte Meaning
* --------------------------------------------
@@ -38,7 +38,7 @@ import org.eclipse.jdt.internal.core.nd.util.MathUtils;
* ...
* k...k+4 Record [inlineRecordCount-1]
* </pre>
- *
+ *
* As shown above, the first few records are stored inline with the array. inlineRecordCount is a tunable parameter
* which may be 0. If there are fewer than inlineRecordCount records, there is no growable block and all records are
* stored in the header. Storing the first few records in the header is intended as an optimization for very small
@@ -49,7 +49,7 @@ import org.eclipse.jdt.internal.core.nd.util.MathUtils;
* <p>
* The memory format for a growable block is as follows:
* <p>
- *
+ *
* <pre>
* Byte Meaning
* --------------------------------------------
@@ -61,7 +61,7 @@ import org.eclipse.jdt.internal.core.nd.util.MathUtils;
* ...
* k...k+4 Record [blockSize-1]
* </pre>
- *
+ *
* <p>
* The growable block itself begins with a 4-byte int holding the size of the array, followed by a 4-byte int holding
* the capacity of the growable block. In the event that the array is larger than
@@ -103,7 +103,7 @@ public final class RawGrowableArray {
private static final FieldPointer GROWABLE_BLOCK_ADDRESS;
private static final int ARRAY_HEADER_BYTES;
- private static final StructDef<RawGrowableArray> type;
+ private static final StructDef<RawGrowableArray> type;
static {
type = StructDef.createAbstract(RawGrowableArray.class);
@@ -141,7 +141,7 @@ public final class RawGrowableArray {
/**
* Holds the number of pages used for the metablock. Note that the start of the metablock array needs to be
* 4-byte aligned. Since all malloc calls are always 2 bytes away from 4-byte alignment, we need to use at
- * least one short in this struct. */
+ * least one short in this struct. */
public static final FieldShort METABLOCK_NUM_PAGES;
public static final int META_BLOCK_HEADER_BYTES;
@@ -157,7 +157,7 @@ public final class RawGrowableArray {
META_BLOCK_HEADER_BYTES = type.size();
}
}
-
+
private final int inlineSize;
public RawGrowableArray(int inlineRecords) {
@@ -170,7 +170,7 @@ public final class RawGrowableArray {
/**
* Returns the size of the array.
- *
+ *
* @param address address of the array
* @return the array size, in number elements
*/
@@ -246,7 +246,7 @@ public final class RawGrowableArray {
Database db = nd.getDB();
- int neededBlockSize = getGrowableRegionSizeFor(desiredSize);
+ int neededBlockSize = getGrowableRegionSizeFor(desiredSize);
if (neededBlockSize > GrowableBlockHeader.MAX_GROWABLE_SIZE) {
// We need a metablock.
long metablockAddress = growableBlockAddress;
@@ -482,7 +482,7 @@ public final class RawGrowableArray {
/**
* Checks if we should reduce the amount of allocated in the growable region, such that the array can hold the given
* number of elements.
- *
+ *
* @param desiredSize
* the new current size of the array or 0 to free up all memory
*/
@@ -632,10 +632,10 @@ public final class RawGrowableArray {
repackIfNecessary(nd, address, 0);
}
-
+
/**
* Returns true iff the size of the array is 0
- *
+ *
* @param address address of the array
* @return the array size, in number elements
*/
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/Chunk.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/Chunk.java
index 1f4841b8a..e389c7c21 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/Chunk.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/Chunk.java
@@ -28,7 +28,7 @@ final class Chunk {
final Database fDatabase;
/**
* Holds the database-specific chunk number. This is the index into the database's chunk array and indicates the
- * start of the range of addresses held by this chunk. Non-negative.
+ * start of the range of addresses held by this chunk. Non-negative.
*/
final int fSequenceNumber;
/**
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/ChunkWriter.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/ChunkWriter.java
index bc3723cb6..d4049ee6b 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/ChunkWriter.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/ChunkWriter.java
@@ -34,11 +34,11 @@ public class ChunkWriter {
/**
* Interface used to perform the uninterruptable writes when the buffer fills up.
*/
- @FunctionalInterface
+ @FunctionalInterface
public interface WriteCallback {
/**
* Performs an uninterruptable write of the given bytes to the given file position.
- *
+ *
* @param buffer
* the bytes to write
* @param position
@@ -54,14 +54,14 @@ public class ChunkWriter {
@FunctionalInterface
public interface SleepCallback {
/**
- * Sleeps the caller for the given time (in milliseconds)
+ * Sleeps the caller for the given time (in milliseconds)
*/
void sleep(long millisecond) throws InterruptedException;
}
/**
* Constructs a new {@link ChunkWriter}
- *
+ *
* @param bufferSize
* size of the write buffer (the maximum number of bytes that will be written in a single write).
* @param maxBytesPerMillisecond
@@ -80,7 +80,7 @@ public class ChunkWriter {
/**
* Writes the given bytes to the given file position.
- *
+ *
* @return true iff any attempt was made to interrupt the thread using {@link Thread#interrupt()}. The write
* succeeds regardless of the return value.
* @throws IOException if unable to perform the write
@@ -104,7 +104,7 @@ public class ChunkWriter {
/**
* Flushes any outstanding writes to disk immediately.
- *
+ *
* @return true iff any attempt was made to interrupt the thread using {@link Thread#interrupt()}. The write
* succeeds regardless of the return value.
* @throws IOException if unable to perform the write
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/Database.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/Database.java
index 01b8e97d3..a831e9a53 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/Database.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/Database.java
@@ -65,7 +65,7 @@ import org.eclipse.osgi.util.NLS;
* INT_SIZE * (M + 1) | pointer to head of linked list of blocks of size (M + MIN_BLOCK_DELTAS) * BLOCK_SIZE_DELTA
* FREE_BLOCK_OFFSET | chunk number for the root of the large block free space trie
* WRITE_NUMBER_OFFSET | long integer which is incremented on every write
- * MALLOC_STATS_OFFSET | memory usage statistics
+ * MALLOC_STATS_OFFSET | memory usage statistics
* DATA_AREA | The database singletons are stored here and use the remainder of chunk 0
*
* M = CHUNK_SIZE / BLOCK_SIZE_DELTA - MIN_BLOCK_DELTAS
@@ -84,7 +84,7 @@ import org.eclipse.osgi.util.NLS;
* offset content
* _____________________________
* 0 | size of block (negative indicates the block is in use) (2 bytes)
- * 2 | content of the struct
+ * 2 | content of the struct
*
*/
public class Database {
@@ -99,7 +99,7 @@ public class Database {
public static final int BLOCK_SIZE_DELTA_BITS = 3;
public static final int BLOCK_SIZE_DELTA= 1 << BLOCK_SIZE_DELTA_BITS;
-
+
// Fields that are only used by free blocks
private static final int BLOCK_PREV_OFFSET = BLOCK_HEADER_SIZE;
private static final int BLOCK_NEXT_OFFSET = BLOCK_HEADER_SIZE + INT_SIZE;
@@ -309,8 +309,8 @@ public class Database {
/**
* Attempts to perform an uninterruptable write operation on the database. Returns true if an attempt was made
- * to interrupt it.
- *
+ * to interrupt it.
+ *
* @throws IOException
*/
private boolean performUninterruptableWrite(IORunnable runnable) throws IOException {
@@ -334,7 +334,7 @@ public class Database {
}
}
}
-
+
public void transferTo(FileChannel target) throws IOException {
assert this.fLocked;
final FileChannel from= this.fFile.getChannel();
@@ -365,7 +365,7 @@ public class Database {
* Empty the contents of the Database, make it ready to start again. Interrupting the thread with
* {@link Thread#interrupt()} won't interrupt the write. Returns true iff the thread was interrupted
* with {@link Thread#interrupt()}.
- *
+ *
* @throws IndexException
*/
public boolean clear(int version) throws IndexException {
@@ -434,7 +434,7 @@ public class Database {
/**
* Return the Chunk that contains the given offset.
- *
+ *
* @throws IndexException
*/
public Chunk getChunk(long offset) throws IndexException {
@@ -531,7 +531,7 @@ public class Database {
assert this.fExclusiveLock;
assert datasize >= 0;
assert datasize <= MAX_MALLOC_SIZE;
-
+
long result;
int usedSize;
this.log.start(this.mallocTag);
@@ -549,7 +549,7 @@ public class Database {
if (needDeltas < MIN_BLOCK_DELTAS) {
needDeltas = MIN_BLOCK_DELTAS;
}
-
+
// Which block size.
int useDeltas;
for (useDeltas = needDeltas; useDeltas <= MAX_BLOCK_DELTAS; useDeltas++) {
@@ -557,7 +557,7 @@ public class Database {
if (freeBlock != 0)
break;
}
-
+
// Get the block.
Chunk chunk;
if (freeBlock == 0) {
@@ -579,18 +579,18 @@ public class Database {
}
removeBlock(chunk, useDeltas * BLOCK_SIZE_DELTA, freeBlock);
}
-
+
final int unusedDeltas = useDeltas - needDeltas;
if (unusedDeltas >= MIN_BLOCK_DELTAS) {
// Add in the unused part of our block.
addBlock(chunk, unusedDeltas * BLOCK_SIZE_DELTA, freeBlock + needDeltas * BLOCK_SIZE_DELTA);
useDeltas = needDeltas;
}
-
+
// Make our size negative to show in use.
usedSize = useDeltas * BLOCK_SIZE_DELTA;
chunk.putShort(freeBlock, (short) -usedSize);
-
+
// Clear out the block, lots of people are expecting this.
chunk.clear(freeBlock + BLOCK_HEADER_SIZE, usedSize - BLOCK_HEADER_SIZE);
result = freeBlock + BLOCK_HEADER_SIZE;
@@ -616,7 +616,7 @@ public class Database {
/**
* Clears all the bytes in the given range by setting them to zero.
- *
+ *
* @param startAddress first address to clear
* @param bytesToClear number of addresses to clear
*/
@@ -649,7 +649,7 @@ public class Database {
/**
* Obtains a new block that can fit the given number of bytes (at minimum). Returns the
* chunk number.
- *
+ *
* @param datasize minimum number of bytes needed
* @return the chunk number
*/
@@ -733,7 +733,7 @@ public class Database {
/**
* Unlinks a free block (which currently belongs to the free block trie) so that it may
* be reused.
- *
+ *
* @param freeBlockChunkNum chunk number of the block to be unlinked
*/
private void unlinkFreeBlock(int freeBlockChunkNum) {
@@ -809,7 +809,7 @@ public class Database {
/**
* Returns the chunk number of a free block that contains at least the given number of chunks, or
* 0 if there is no existing contiguous free block containing at least the given number of chunks.
- *
+ *
* @param numChunks minumum number of chunks desired
* @return the chunk number of a free block containing at least the given number of chunks or 0
* if there is no existing free block containing that many chunks.
@@ -834,7 +834,7 @@ public class Database {
/**
* Given the chunk number of a block somewhere in the free space trie, this returns the smallest
* child in the subtree that is no smaller than the given number of chunks.
- *
+ *
* @param trieNodeChunkNum chunk number of a block in the free space trie
* @param numChunks desired number of chunks
* @return the chunk number of the first chunk in a contiguous free block containing at least the
@@ -876,7 +876,7 @@ public class Database {
/**
* Link the given unused block into the free block tries. The block does not need to have
* its header filled in already.
- *
+ *
* @param freeBlockChunkNum chunk number of the start of the block
* @param numChunks number of chunks in the block
*/
@@ -1056,11 +1056,11 @@ public class Database {
}
}
}
-
+
/**
* Adds the given child block to the given parent subtree of the free space trie. Any existing
* subtree under the given child block will be retained.
- *
+ *
* @param parentChunkNum root of the existing tree, or 0 if the child is going to be the new root
* @param newChildChunkNum the new child to insert
*/
@@ -1097,7 +1097,7 @@ public class Database {
* Adds the given block to the linked list of equally-sized free chunks in the free space trie.
* Both chunks must be unused, must be the same size, and the previous chunk must already
* be linked into the free space trie. The newly-added chunk must not have any children.
- *
+ *
* @param prevChunkNum chunk number of previous block in the existing list
* @param newChunkNum new chunk to be added to the list
*/
@@ -1118,7 +1118,7 @@ public class Database {
/**
* Returns the chunk number of the chunk at the start of a block, given the
* chunk number of the chunk at the start of the following block.
- *
+ *
* @param chunkNum the chunk number of the chunk immediately following the
* chunk being queried
* @return the chunk number of the chunk at the start of the previous block
@@ -1131,7 +1131,7 @@ public class Database {
/**
* Sets the block header and footer for the given range of chunks which make
* up a contiguous block.
- *
+ *
* @param firstChunkNum chunk number of the first chunk in the block
* @param headerContent the content of the header. Its magnitude is the number of
* chunks in the block. It is positive if the chunk is free and negative if
@@ -1325,11 +1325,11 @@ public class Database {
}
addBlock(chunk, (int) blockSize, block);
}
-
+
if (DEBUG_FREE_SPACE) {
periodicValidateFreeSpace();
}
-
+
this.freed += blockSize;
this.memoryUsage.recordFree(poolId, blockSize);
} finally {
@@ -1668,7 +1668,7 @@ public class Database {
/**
* Interrupting the thread with {@link Thread#interrupt()} won't interrupt the write. Returns true iff an attempt
* was made to interrupt the thread with {@link Thread#interrupt()}.
- *
+ *
* @throws IndexException
*/
private boolean flushAndUnlockChunks(final ArrayList<Chunk> dirtyChunks, boolean isComplete) throws IndexException {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/IBTreeVisitor.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/IBTreeVisitor.java
index f3c57272e..fd15faf5a 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/IBTreeVisitor.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/IBTreeVisitor.java
@@ -14,7 +14,7 @@
*******************************************************************************/
package org.eclipse.jdt.internal.core.nd.db;
-/**
+/**
* The visitor visits all records where compare returns 0.
*/
public interface IBTreeVisitor {
@@ -22,7 +22,7 @@ public interface IBTreeVisitor {
* Compare the record against an internally held key. The comparison must be
* compatible with the one used for the btree.
* Used for visiting.
- *
+ *
* @param record
* @return -1 if record < key, 0 if record == key, 1 if record > key
* @throws IndexException
@@ -35,5 +35,5 @@ public interface IBTreeVisitor {
* @return <code>true</code> to continue the visit, <code>false</code> to abort it.
* @throws IndexException
*/
- public abstract boolean visit(long record) throws IndexException;
+ public abstract boolean visit(long record) throws IndexException;
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/IString.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/IString.java
index 749343000..610e39a5b 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/IString.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/IString.java
@@ -17,8 +17,8 @@ package org.eclipse.jdt.internal.core.nd.db;
/**
* Interface for strings stored in the database. There is more than one string
- * format. This interface hides that fact.
- *
+ * format. This interface hides that fact.
+ *
* @author Doug Schaefer
*/
public interface IString {
@@ -26,7 +26,7 @@ public interface IString {
* Get the offset of this IString record in the Nd
*/
public long getRecord();
-
+
// strcmp equivalents
/**
* Compare this IString record and the specified IString record
@@ -39,7 +39,7 @@ public interface IString {
* @throws IndexException
*/
public int compare(IString string, boolean caseSensitive) throws IndexException;
-
+
/**
* Compare this IString record and the specified String object
* @param string
@@ -51,7 +51,7 @@ public interface IString {
* @throws IndexException
*/
public int compare(String string, boolean caseSensitive) throws IndexException;
-
+
/**
* Compare this IString record and the specified character array
* @param chars
@@ -87,7 +87,7 @@ public interface IString {
* @throws IndexException
*/
public int compareCompatibleWithIgnoreCase(char[] chars) throws IndexException;
-
+
/**
* Compare this IString record and the specified character array
* @param name the name to compare to
@@ -108,7 +108,7 @@ public interface IString {
* @throws IndexException
*/
public char[] getChars() throws IndexException;
-
+
/**
* Get an equivalent String object to this IString record<p>
* <b>N.B. This method can be expensive: compare and equals can be used for
@@ -117,7 +117,7 @@ public interface IString {
* @throws IndexException
*/
public String getString() throws IndexException;
-
+
/**
* Free the associated record in the Nd
* @throws IndexException
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/IndexException.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/IndexException.java
index 5de64a632..440422250 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/IndexException.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/IndexException.java
@@ -39,8 +39,8 @@ public class IndexException extends RuntimeException {
/**
* Sets the time that the exception occurred at (in terms of the write number
* from the modification log)
- *
- * @param writeNumber
+ *
+ * @param writeNumber
*/
public void setTime(long writeNumber) {
this.time = writeNumber;
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/MemoryStats.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/MemoryStats.java
index 5e8139a5f..b672e997d 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/MemoryStats.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/MemoryStats.java
@@ -206,7 +206,7 @@ public class MemoryStats {
if (idx > 0 && next.poolId == 0) {
break;
}
-
+
result.add(next);
}
return result;
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/ModificationLog.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/ModificationLog.java
index 2dd0ebee8..94e90fa6e 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/ModificationLog.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/db/ModificationLog.java
@@ -183,7 +183,7 @@ public class ModificationLog {
/**
* Search for anomalies in the log and produce a reduced report
- *
+ *
* @return a log containing the most interesting results
*/
public MemoryAccessLog reduce(int maxWrites) {
@@ -256,7 +256,7 @@ public class ModificationLog {
}
private static int getBufferEntriesFor(int sizeInMegs) {
- long sizeOfABufferEntry = 8 + 4 + 1; // size, in bytes, of one long, one int, and one byte
+ long sizeOfABufferEntry = 8 + 4 + 1; // size, in bytes, of one long, one int, and one byte
return (int) (sizeInMegs * 1024L * 1024L / sizeOfABufferEntry);
}
@@ -422,7 +422,7 @@ public class ModificationLog {
long nextAddress = this.buffer0[currentPosition];
int nextArgument = this.buffer1[currentPosition];
byte nextOp = this.operation[currentPosition];
-
+
switch (nextOp) {
case POP_OPERATION: {
tags.add(getTagForId(nextArgument));
@@ -445,7 +445,7 @@ public class ModificationLog {
isMatch = true;
}
}
-
+
if (isMatch) {
List<Tag> stack = new ArrayList<>();
stack.addAll(tags);
@@ -453,7 +453,7 @@ public class ModificationLog {
nextArgument, stack);
operations.add(nextOperation);
}
-
+
currentWrite--;
}
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/Field.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/Field.java
index 17017ab29..d41a590de 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/Field.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/Field.java
@@ -18,7 +18,7 @@ import org.eclipse.jdt.internal.core.nd.Nd;
import org.eclipse.jdt.internal.core.nd.db.Database;
/**
- * Used to represent a single field of an object stored in the database. Objects
+ * Used to represent a single field of an object stored in the database. Objects
* which store themselves in the database should store a set of static final
* FieldDefinitions at the top of their class definition to indicate their memory map.
* This serves as a standard way to document the memory map for such structs, provides
@@ -29,7 +29,7 @@ import org.eclipse.jdt.internal.core.nd.db.Database;
* manually. The get function is more convenient but allocates objects and so should
* probably not be used for frequently-accessed fields or primitive types that would
* end up being autoboxed unnecessarily.
- *
+ *
* @param <T>
*/
public final class Field<T> extends BaseField implements IDestructableField {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/FieldList.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/FieldList.java
index 18248c898..92009a49f 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/FieldList.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/FieldList.java
@@ -98,7 +98,7 @@ public class FieldList<T> extends BaseField implements IDestructableField {
/**
* Creates a new {@link FieldList} in the given struct which contains elements of the given type. The resulting list
* will grow by 1 element each time it overflows.
- *
+ *
* @param ownerStruct
* the struct to which the new list field will be added. Must not have had {@link StructDef#done()}
* invoked on it yet.
@@ -113,7 +113,7 @@ public class FieldList<T> extends BaseField implements IDestructableField {
/**
* Creates a new {@link FieldList} in the given struct which contains elements of the given type. The resulting list
* will grow by the given number of elements each time it overflows.
- *
+ *
* @param ownerStruct
* the struct to which the new list field will be added. Must not have had {@link StructDef#done()}
* invoked on it yet.
@@ -142,7 +142,7 @@ public class FieldList<T> extends BaseField implements IDestructableField {
/**
* Returns the contents of the receiver as a {@link List}.
- *
+ *
* @param nd the database to be queried.
* @param address the address of the parent struct
*/
@@ -181,7 +181,7 @@ public class FieldList<T> extends BaseField implements IDestructableField {
try {
long headerStartAddress = address + this.offset;
long nextBlockAddress = LAST_BLOCK_WITH_ELEMENTS.get(nd, headerStartAddress);
-
+
// Ensure that there's at least one block
long insertionBlockAddress = nextBlockAddress;
if (nextBlockAddress == 0) {
@@ -190,11 +190,11 @@ public class FieldList<T> extends BaseField implements IDestructableField {
FIRST_BLOCK.put(nd, headerStartAddress, newBlockAddress);
insertionBlockAddress = newBlockAddress;
}
-
+
// Check if there's any free space in this block
int elementsInBlock = BlockHeader.ELEMENTS_IN_USE.get(nd, insertionBlockAddress);
int blockSize = BlockHeader.BLOCK_SIZE.get(nd, insertionBlockAddress);
-
+
if (elementsInBlock >= blockSize) {
long nextBlock = BlockHeader.NEXT_BLOCK.get(nd, insertionBlockAddress);
if (nextBlock == 0) {
@@ -203,12 +203,12 @@ public class FieldList<T> extends BaseField implements IDestructableField {
}
LAST_BLOCK_WITH_ELEMENTS.put(nd, headerStartAddress, nextBlock);
insertionBlockAddress = nextBlock;
- elementsInBlock = BlockHeader.ELEMENTS_IN_USE.get(nd, insertionBlockAddress);
+ elementsInBlock = BlockHeader.ELEMENTS_IN_USE.get(nd, insertionBlockAddress);
}
-
+
BlockHeader.ELEMENTS_IN_USE.put(nd, insertionBlockAddress, (short) (elementsInBlock + 1));
int elementSize = getElementSize();
-
+
long resultAddress = insertionBlockAddress + BlockHeader.BLOCK_HEADER_BYTES + elementsInBlock * elementSize;
assert ((resultAddress - Database.BLOCK_HEADER_SIZE) & (Database.BLOCK_SIZE_DELTA - 1)) == 0;
return this.elementType.getFactory().create(nd, resultAddress);
@@ -233,7 +233,7 @@ public class FieldList<T> extends BaseField implements IDestructableField {
}
long headerStartAddress = address + this.offset;
long nextBlockAddress = LAST_BLOCK_WITH_ELEMENTS.get(nd, headerStartAddress);
-
+
int maxBlockSizeThatFitsInAChunk = (int) ((MAX_BYTES_IN_A_CHUNK - BlockHeader.BLOCK_HEADER_BYTES)
/ getElementSize());
@@ -244,7 +244,7 @@ public class FieldList<T> extends BaseField implements IDestructableField {
LAST_BLOCK_WITH_ELEMENTS.put(nd, headerStartAddress, nextBlockAddress);
FIRST_BLOCK.put(nd, headerStartAddress, nextBlockAddress);
}
-
+
// Check if there's any free space in this block
int remainingToAllocate = numElements;
while (true) {
@@ -252,12 +252,12 @@ public class FieldList<T> extends BaseField implements IDestructableField {
nextBlockAddress = BlockHeader.NEXT_BLOCK.get(nd, currentBlockAddress);
int elementsInUse = BlockHeader.ELEMENTS_IN_USE.get(nd, currentBlockAddress);
int blockSize = BlockHeader.BLOCK_SIZE.get(nd, currentBlockAddress);
-
+
remainingToAllocate -= (blockSize - elementsInUse);
if (remainingToAllocate <= 0) {
break;
}
-
+
if (nextBlockAddress == 0) {
nextBlockAddress = allocateNewBlock(nd, Math.min(maxBlockSizeThatFitsInAChunk, numElements));
BlockHeader.NEXT_BLOCK.put(nd, currentBlockAddress, nextBlockAddress);
@@ -302,7 +302,7 @@ public class FieldList<T> extends BaseField implements IDestructableField {
short poolId = getMemoryPoolId(nd);
long headerStartAddress = address + this.offset;
long firstBlockAddress = FIRST_BLOCK.get(nd, headerStartAddress);
-
+
long nextBlockAddress = firstBlockAddress;
while (nextBlockAddress != 0) {
long currentBlockAddress = nextBlockAddress;
@@ -311,11 +311,11 @@ public class FieldList<T> extends BaseField implements IDestructableField {
destructElements(nd, currentBlockAddress + BlockHeader.BLOCK_HEADER_BYTES, elementsInBlock);
db.free(currentBlockAddress, poolId);
}
-
+
db.clearRange(headerStartAddress, getRecordSize());
} finally {
db.getLog().end(this.destructTag);
- }
+ }
}
private void destructElements(Nd nd, long nextElementAddress, int count) {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/FieldManyToOne.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/FieldManyToOne.java
index 329183370..ad10962b5 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/FieldManyToOne.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/FieldManyToOne.java
@@ -91,7 +91,7 @@ public class FieldManyToOne<T extends INdStruct> extends BaseField implements ID
/**
* Creates a many-to-one pointer which points to this object's owner. If the pointer is non-null when the owner is
* deleted, this object will be deleted too.
- *
+ *
* @param builder the struct to which the field will be added
* @param forwardPointer the field which holds the pointer in the other direction
* @return a newly constructed field
@@ -105,7 +105,7 @@ public class FieldManyToOne<T extends INdStruct> extends BaseField implements ID
if (!NdNode.class.isAssignableFrom(builder.getStructClass())) {
throw new IllegalArgumentException(FieldManyToOne.class.getSimpleName() + " can't be the owner of " //$NON-NLS-1$
+ builder.getStructClass().getSimpleName() + " because the latter isn't a subclass of " //$NON-NLS-1$
- + NdNode.class.getSimpleName());
+ + NdNode.class.getSimpleName());
}
FieldManyToOne<T> result = new FieldManyToOne<T>(builder, forwardPointer, true);
@@ -117,7 +117,7 @@ public class FieldManyToOne<T extends INdStruct> extends BaseField implements ID
/**
* Sets whether or not this field permits nulls to be assigned.
- *
+ *
* @param permitted true iff the field permits nulls
* @return this
*/
@@ -163,14 +163,14 @@ public class FieldManyToOne<T extends INdStruct> extends BaseField implements ID
throw new IllegalStateException(
getClass().getSimpleName() + " must be associated with a " + FieldOneToMany.class.getSimpleName()); //$NON-NLS-1$
}
-
+
long oldTargetAddress = TARGET.get(nd, fieldStart);
if (oldTargetAddress == newTargetAddress) {
return;
}
-
+
detachFromOldTarget(nd, address, oldTargetAddress);
-
+
TARGET.put(nd, fieldStart, newTargetAddress);
if (newTargetAddress != 0) {
// Note that newValue is the address of the backpointer list and record (the address of the struct
@@ -197,7 +197,7 @@ public class FieldManyToOne<T extends INdStruct> extends BaseField implements ID
short targetTypeId = NdNode.NODE_TYPE.get(nd, oldTargetAddress);
ITypeFactory<? extends NdNode> typeFactory = nd.getTypeFactory(targetTypeId);
- if (typeFactory.getDeletionSemantics() == StructDef.DeletionSemantics.REFCOUNTED
+ if (typeFactory.getDeletionSemantics() == StructDef.DeletionSemantics.REFCOUNTED
&& typeFactory.isReadyForDeletion(nd, oldTargetAddress)) {
nd.scheduleDeletion(oldTargetAddress);
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/FieldOneToMany.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/FieldOneToMany.java
index 6b1a860c1..919cb0be8 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/FieldOneToMany.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/FieldOneToMany.java
@@ -58,8 +58,8 @@ public class FieldOneToMany<T extends INdStruct> extends BaseField implements ID
/**
* Creates a {@link FieldOneToMany} using the given builder. It will hold the many side of a one-to-many
- * relationship with nodeType.
- *
+ * relationship with nodeType.
+ *
* @param builder builder that is being used to construct the struct containing this field
* @param forwardPointer field of the model object which holds the one side of this one-to-many relationship
* @param inlineElementCount number of inline elements. If this is nonzero, space for this number elements is
@@ -68,7 +68,7 @@ public class FieldOneToMany<T extends INdStruct> extends BaseField implements ID
* offer a performance improvement. For relationships that will normally be empty, this should be 0.
* @return the newly constructed backpointer field
*/
- public static <T extends INdStruct, B extends INdStruct> FieldOneToMany<T> create(StructDef<B> builder,
+ public static <T extends INdStruct, B extends INdStruct> FieldOneToMany<T> create(StructDef<B> builder,
FieldManyToOne<B> forwardPointer, int inlineElementCount) {
FieldOneToMany<T> result = new FieldOneToMany<T>(builder, forwardPointer, inlineElementCount);
builder.add(result);
@@ -77,7 +77,7 @@ public class FieldOneToMany<T extends INdStruct> extends BaseField implements ID
return result;
}
- public static <T extends INdStruct, B extends INdStruct> FieldOneToMany<T> create(StructDef<B> builder,
+ public static <T extends INdStruct, B extends INdStruct> FieldOneToMany<T> create(StructDef<B> builder,
FieldManyToOne<B> forwardPointer) {
return create(builder, forwardPointer, 0);
}
@@ -106,7 +106,7 @@ public class FieldOneToMany<T extends INdStruct> extends BaseField implements ID
public boolean isEmpty(Nd nd, long address) {
return this.backPointerArray.isEmpty(nd, address + this.offset);
}
-
+
public int size(Nd nd, long address) {
return this.backPointerArray.size(nd, address + this.offset);
}
@@ -146,7 +146,7 @@ public class FieldOneToMany<T extends INdStruct> extends BaseField implements ID
}
/**
- * Returns the record size of the back pointer list
+ * Returns the record size of the back pointer list
*/
@Override
public int getRecordSize() {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/FieldOneToOne.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/FieldOneToOne.java
index 20313f159..6695fcd2f 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/FieldOneToOne.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/FieldOneToOne.java
@@ -24,7 +24,7 @@ import org.eclipse.jdt.internal.core.nd.db.Database;
* Represents a 1-to-0..1 relationship in a Nd database.
*/
public class FieldOneToOne<T extends INdStruct> extends BaseField implements IDestructableField, IRefCountedField {
- public final StructDef<T> nodeType;
+ public final StructDef<T> nodeType;
FieldOneToOne<?> backPointer;
private boolean pointsToOwner;
private final Tag putTag;
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/FieldSearchIndex.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/FieldSearchIndex.java
index 2b6aaeb5f..1fd37f805 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/FieldSearchIndex.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/FieldSearchIndex.java
@@ -41,7 +41,7 @@ public class FieldSearchIndex<T extends NdNode> extends BaseField implements IDe
return 1;
}
};
-
+
public static final class SearchCriteria {
private boolean matchCase = true;
private boolean isPrefix = false;
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/IRefCountedField.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/IRefCountedField.java
index 8abca7f28..fbe8afb9b 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/IRefCountedField.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/IRefCountedField.java
@@ -23,6 +23,6 @@ public interface IRefCountedField {
* <p>
* Implementations should return false if the refcount is 0 or true if the refcount
* is nonzero.
- */
+ */
public boolean hasReferences(Nd nd, long address);
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/StructDef.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/StructDef.java
index 5e5b658f2..ec9ebf6ed 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/StructDef.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/field/StructDef.java
@@ -137,7 +137,7 @@ public final class StructDef<T> {
@Override
public boolean hasDestructor() {
- return StructDef.this.hasUserDestructor || hasDestructableFields();
+ return StructDef.this.hasUserDestructor || hasDestructableFields();
}
@Override
@@ -170,7 +170,7 @@ public final class StructDef<T> {
public boolean isReadyForDeletion(Nd dom, long address) {
return StructDef.this.isReadyForDeletion(dom, address);
}
-
+
@Override
public DeletionSemantics getDeletionSemantics() {
return StructDef.this.getDeletionSemantics();
@@ -251,7 +251,7 @@ public final class StructDef<T> {
}
protected boolean hasDestructableFields() {
- return (!StructDef.this.destructableFields.isEmpty() ||
+ return (!StructDef.this.destructableFields.isEmpty() ||
(StructDef.this.superClass != null && StructDef.this.superClass.hasDestructableFields()));
}
@@ -369,7 +369,7 @@ public final class StructDef<T> {
+ "that uses " + this.superClass.deletionSemantics.toString() + " semantics"); //$NON-NLS-1$//$NON-NLS-2$
}
}
-
+
this.offsetsComputed = true;
for (StructDef<? extends T> next : this.dependents) {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/indexer/ClassFileToIndexConverter.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/indexer/ClassFileToIndexConverter.java
index c57f39917..3271fdc0f 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/indexer/ClassFileToIndexConverter.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/indexer/ClassFileToIndexConverter.java
@@ -107,8 +107,8 @@ public final class ClassFileToIndexConverter {
}
/**
- * Adds a type to the index, given an input class file and a binary name. Note that the given binary name is
- *
+ * Adds a type to the index, given an input class file and a binary name. Note that the given binary name is
+ *
* @param binaryType an object used for parsing the .class file itself
* @param fieldDescriptor the name that is used to locate the class, computed from the .class file's name and location.
* In the event that the .class file has been moved, this may differ from the binary name stored in the .class file
@@ -350,15 +350,15 @@ public final class ClassFileToIndexConverter {
int numArgumentsInGenericSignature = countMethodArguments(signature);
int numCompilerDefinedParameters = Math.max(0,
parameterFieldDescriptors.size() - numArgumentsInGenericSignature);
-
+
boolean compilerDefinedParametersAreIncludedInSignature = (next.getGenericSignature() == null);
// If there is no generic signature, then fall back to heuristics based on what we know about
// where the java compiler likes to create compiler-defined arguments
if (compilerDefinedParametersAreIncludedInSignature) {
// Constructors for non-static member types get a compiler-defined first argument
- if (binaryType.isMember()
- && next.isConstructor()
+ if (binaryType.isMember()
+ && next.isConstructor()
&& ((binaryType.getModifiers() & Modifier.STATIC) == 0)
&& parameterFieldDescriptors.size() > 0) {
@@ -483,7 +483,7 @@ public final class ClassFileToIndexConverter {
variable.allocateTypeAnnotations(typeAnnotations.length);
for (IBinaryTypeAnnotation next : typeAnnotations) {
NdTypeAnnotation annotation = variable.createTypeAnnotation();
-
+
initTypeAnnotation(annotation, next);
}
}
@@ -844,7 +844,7 @@ public final class ClassFileToIndexConverter {
case AnnotationTargetTypeConstants.METHOD_TYPE_PARAMETER:
case AnnotationTargetTypeConstants.CLASS_TYPE_PARAMETER:
annotation.setTargetInfo(next.getTypeParameterIndex());
- break;
+ break;
case AnnotationTargetTypeConstants.CLASS_EXTENDS:
annotation.setTargetInfo(next.getSupertypeIndex());
break;
@@ -870,7 +870,7 @@ public final class ClassFileToIndexConverter {
}
private void initAnnotation(NdAnnotation annotation, IBinaryAnnotation next) {
- annotation.setType(createTypeIdFromBinaryName(next.getTypeName()));
+ annotation.setType(createTypeIdFromBinaryName(next.getTypeName()));
IBinaryElementValuePair[] pairs = next.getElementValuePairs();
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/indexer/FileStateCache.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/indexer/FileStateCache.java
index 0bfae703b..30228d5cf 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/indexer/FileStateCache.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/indexer/FileStateCache.java
@@ -57,7 +57,7 @@ public class FileStateCache {
/**
* Inserts a new entry into the cache.
- *
+ *
* @param location absolute filesystem path to the file
* @param result true if the file is definitely in sync with the index, false if there is any possibility of it
* being out of sync.
@@ -79,7 +79,7 @@ public class FileStateCache {
/**
* Removes a single entry from the cache.
- *
+ *
* @param location absolute filesystem path to the file.
*/
public void remove(String location) {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/indexer/Indexer.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/indexer/Indexer.java
index 621e104c3..fd5c1ff46 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/indexer/Indexer.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/indexer/Indexer.java
@@ -97,7 +97,7 @@ public final class Indexer {
public static boolean DEBUG_INSERTIONS;
public static boolean DEBUG_SELFTEST;
public static int DEBUG_LOG_SIZE_MB;
-
+
// New index is disabled, see bug 544898
// private static final String ENABLE_NEW_JAVA_INDEX = "enableNewJavaIndex"; //$NON-NLS-1$
// private static IPreferenceChangeListener listener = new IPreferenceChangeListener() {
@@ -181,7 +181,7 @@ public final class Indexer {
* when running the unit tests, since indexing will not occur unless it is triggered
* explicitly.
* <p>
- * Synchronize on {@link #automaticIndexingMutex} before accessing.
+ * Synchronize on {@link #automaticIndexingMutex} before accessing.
*/
public void enableAutomaticIndexing(boolean enabled) {
boolean runRescan = false;
@@ -200,7 +200,7 @@ public final class Indexer {
// Force a rescan when re-enabling automatic indexing since we may have missed an update
this.rescanJob.schedule();
}
-
+
if (!enabled) {
// Wait for any existing indexing operations to finish when disabling automatic indexing since
// we only want explicitly-triggered indexing operations to run after the method returns
@@ -471,7 +471,7 @@ public final class Indexer {
private int cleanGarbage(long currentTimeMillis, Collection<IPath> allIndexables, IProgressMonitor monitor) {
JavaIndex index = JavaIndex.getIndex(this.nd);
- int result = 0;
+ int result = 0;
HashSet<IPath> paths = new HashSet<>();
paths.addAll(allIndexables);
SubMonitor subMonitor = SubMonitor.convert(monitor, 3);
@@ -555,7 +555,7 @@ public final class Indexer {
if (!toDelete.isInIndex()) {
break;
}
-
+
int numChildren = toDelete.getTypeCount();
deletionMonitor.setWorkRemaining(numChildren + 1);
if (numChildren == 0) {
@@ -1080,7 +1080,7 @@ public final class Indexer {
/**
* Dirties the given filesystem location. This must point to a single file (not a folder) that needs to be
* rescanned. The file may have been added, removed, or changed.
- *
+ *
* @param location an absolute filesystem location
*/
public void makeDirty(IPath location) {
@@ -1100,7 +1100,7 @@ public final class Indexer {
* Schedules a rescan of the given path (which may be either a workspace path or an absolute path on the local
* filesystem). This may point to either a single file or a folder that needs to be rescanned. Any resource that
* has this path as a prefix will be rescanned.
- *
+ *
* @param pathToRescan
*/
public void makeWorkspacePathDirty(IPath pathToRescan) {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/indexer/WorkspaceSnapshot.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/indexer/WorkspaceSnapshot.java
index 5b0400502..69cf4f71f 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/indexer/WorkspaceSnapshot.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/indexer/WorkspaceSnapshot.java
@@ -154,11 +154,11 @@ public final class WorkspaceSnapshot {
IPath defaultOutputLocation = javaProject.getOutputLocation();
for (IClasspathEntry next : entries) {
IPath nextOutputLocation = next.getOutputLocation();
-
+
if (nextOutputLocation == null) {
nextOutputLocation = defaultOutputLocation;
}
-
+
IResource resource = root.findMember(nextOutputLocation);
if (resource != null) {
resourcesToScan.add(resource);
@@ -198,7 +198,7 @@ public final class WorkspaceSnapshot {
return allIndexables;
}
- private static void collectAllClassFiles(IWorkspaceRoot root, List<? super IClassFile> result,
+ private static void collectAllClassFiles(IWorkspaceRoot root, List<? super IClassFile> result,
Collection<? extends IResource> toScan, IProgressMonitor monitor) {
SubMonitor subMonitor = SubMonitor.convert(monitor);
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/FileFingerprint.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/FileFingerprint.java
index 1f5f3dd34..5ce5c1cf3 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/FileFingerprint.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/FileFingerprint.java
@@ -143,7 +143,7 @@ public class FileFingerprint {
/**
* Returns true iff the file existed at the time the fingerprint was computed.
- *
+ *
* @return true iff the file existed at the time the fingerprint was computed.
*/
public boolean fileExists() {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/JavaIndex.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/JavaIndex.java
index afef5b891..e0445146a 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/JavaIndex.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/JavaIndex.java
@@ -99,9 +99,9 @@ public class JavaIndex {
/**
* Returns true iff the given resource file is up-to-date with the filesystem. Returns false
* if the argument is null or there is a possibility it being out-of-date with the file system.
- *
+ *
* @param file the index file to look up or null
- * @throws CoreException
+ * @throws CoreException
*/
public boolean isUpToDate(NdResourceFile file) throws CoreException {
if (file != null && file.isDoneIndexing()) {
@@ -219,7 +219,7 @@ public class JavaIndex {
}
/**
- * @return always return {@code false} see bug 544898. New index is disabled now.
+ * @return always return {@code false} see bug 544898. New index is disabled now.
*/
public static boolean isEnabled() {
return false;
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/JavaNames.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/JavaNames.java
index 391982512..ffc81c1af 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/JavaNames.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/JavaNames.java
@@ -105,7 +105,7 @@ public class JavaNames {
char[] className = CharArrayUtils.subarray(fieldDescriptor, separatorPosition + 1, fieldDescriptor.length - 1);
return className;
}
-
+
/**
* Converts a field descriptor to a java name. If fullyQualified is true, it returns a fully qualified class name.
* If it is false, it returns a source name.
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/NdMethod.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/NdMethod.java
index 055386f51..90dc09720 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/NdMethod.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/NdMethod.java
@@ -235,7 +235,7 @@ public class NdMethod extends NdBinding {
/**
* Creates the {@link NdMethodAnnotationData} struct for this method if it does not already exist. Returns
- * the existing or newly-created struct.
+ * the existing or newly-created struct.
*/
public NdMethodAnnotationData createAnnotationData() {
NdMethodAnnotationData result = getAnnotationData();
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/NdResourceFile.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/NdResourceFile.java
index 7dbac48b6..7accb29db 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/NdResourceFile.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/NdResourceFile.java
@@ -79,7 +79,7 @@ public class NdResourceFile extends NdNode {
type.done();
}
- private long jdkLevel;
+ private long jdkLevel;
public NdResourceFile(Nd dom, long address) {
super(dom, address);
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/NdTypeInterface.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/NdTypeInterface.java
index 25aefe094..e1df69ea0 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/NdTypeInterface.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/NdTypeInterface.java
@@ -36,7 +36,7 @@ public class NdTypeInterface extends NdNode {
IMPLEMENTS = FieldManyToOne.create(type, NdTypeSignature.IMPLEMENTATIONS);
type.done();
}
-
+
public NdTypeInterface(Nd nd, long address) {
super(nd, address);
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/model/BinaryModuleDescriptor.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/model/BinaryModuleDescriptor.java
index de74b4afe..03a6e63af 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/model/BinaryModuleDescriptor.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/model/BinaryModuleDescriptor.java
@@ -28,7 +28,7 @@ public class BinaryModuleDescriptor {
/**
* Constructs a new descriptor
- *
+ *
* @param location
* location where the archive (.jar or .class) can be found in the local filesystem
* @param moduleName
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/model/BinaryModuleFactory.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/model/BinaryModuleFactory.java
index 95342d8fd..0733edb72 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/model/BinaryModuleFactory.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/model/BinaryModuleFactory.java
@@ -86,8 +86,8 @@ public class BinaryModuleFactory {
* the file on disk, the type is read from the index. Otherwise the type is read from disk. Returns null if
* no such type exists.
* <strong>caveat</strong> modules are not yet supported in the index.
- *
- * @throws ClassFormatException
+ *
+ * @throws ClassFormatException
*/
public static IBinaryModule readModule(BinaryModuleDescriptor descriptor, IProgressMonitor monitor) throws JavaModelException, ClassFormatException {
// FIXME: support module in the new index
@@ -100,7 +100,7 @@ public class BinaryModuleFactory {
// }
return rawReadModule(descriptor, true);
}
-
+
public static IBinaryModule rawReadModule(BinaryModuleDescriptor descriptor, boolean fullyInitialize) throws JavaModelException, ClassFormatException {
try {
return rawReadModuleTestForExists(descriptor, fullyInitialize, true);
@@ -112,7 +112,7 @@ public class BinaryModuleFactory {
/**
* Read the class file from disk, circumventing the index's cache. This should only be used by callers
* that need to read information from the class file which aren't present in the index (such as method bodies).
- *
+ *
* @return the newly-created IBinaryModule or null if the given class file does not exist.
* @throws ClassFormatException if the class file existed but was corrupt
* @throws JavaModelException if unable to read the class file due to a transient failure
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/model/BinaryTypeDescriptor.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/model/BinaryTypeDescriptor.java
index 1b1ae6a58..737ef1ce9 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/model/BinaryTypeDescriptor.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/model/BinaryTypeDescriptor.java
@@ -28,7 +28,7 @@ public final class BinaryTypeDescriptor {
/**
* Constructs a new descriptor
- *
+ *
* @param location
* location where the archive (.jar or .class) can be found in the local filesystem
* @param fieldDescriptor
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/model/BinaryTypeFactory.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/model/BinaryTypeFactory.java
index 2f31849f5..f046d3e0d 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/model/BinaryTypeFactory.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/model/BinaryTypeFactory.java
@@ -121,7 +121,7 @@ public class BinaryTypeFactory {
* Reads the given binary type. If the type can be found in the index with a fingerprint that exactly matches
* the file on disk, the type is read from the index. Otherwise the type is read from disk. Returns null if
* no such type exists.
- * @throws ClassFormatException
+ * @throws ClassFormatException
*/
public static IBinaryType readType(BinaryTypeDescriptor descriptor, IProgressMonitor monitor) throws JavaModelException, ClassFormatException {
@@ -147,7 +147,7 @@ public class BinaryTypeFactory {
/**
* Read the class file from disk, circumventing the index's cache. This should only be used by callers
* that need to read information from the class file which aren't present in the index (such as method bodies).
- *
+ *
* @return the newly-created ClassFileReader or null if the given class file does not exist.
* @throws ClassFormatException if the class file existed but was corrupt
* @throws JavaModelException if unable to read the class file due to a transient failure
@@ -210,7 +210,7 @@ public class BinaryTypeFactory {
* able to determine that the requested class does not exist in that file.
*/
public static IBinaryType readFromIndex(JavaIndex index, BinaryTypeDescriptor descriptor, IProgressMonitor monitor) throws JavaModelException, NotInIndexException {
- // If the new index is enabled, check if we have this class file cached in the index already
+ // If the new index is enabled, check if we have this class file cached in the index already
char[] fieldDescriptor = descriptor.fieldDescriptor;
Nd nd = index.getNd();
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/model/IndexBinaryType.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/model/IndexBinaryType.java
index 37a158415..1f36ec219 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/model/IndexBinaryType.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/model/IndexBinaryType.java
@@ -466,7 +466,7 @@ public class IndexBinaryType implements IBinaryType {
method.getGenericSignature(result, method.hasAllFlags(NdMethod.FLG_THROWS_SIGNATURE_PRESENT));
return result.getContents();
}
-
+
private char[][] getArgumentNames(NdMethod ndMethod) {
// Unlike what its JavaDoc says, IBinaryType returns an empty array if no argument names are available, so
// we replicate this weird undocumented corner case here.
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/util/CharArrayUtils.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/util/CharArrayUtils.java
index f84f0ea34..e36093ec6 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/util/CharArrayUtils.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/util/CharArrayUtils.java
@@ -97,7 +97,7 @@ public class CharArrayUtils {
/**
* Returns {@code true} if the contents of a section of a character array are the same as contents of a string.
- *
+ *
* @since 5.5
*/
public static final boolean equals(char[] str1, int start1, int length1, String str2) {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/util/PathMap.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/util/PathMap.java
index b5c57115c..e1ecc4dcc 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/util/PathMap.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/util/PathMap.java
@@ -100,7 +100,7 @@ public class PathMap<T> {
if (this.children == null) {
return;
}
-
+
for (Entry<String, Node<T>> next : this.children.entrySet()) {
String key = next.getKey();
IPath nextPath = buildChildPath(parent, key);
@@ -112,7 +112,7 @@ public class PathMap<T> {
IPath nextPath = parent.append(key);
return nextPath;
}
-
+
public void toString(StringBuilder builder, IPath parentPath) {
if (this.exists) {
builder.append("["); //$NON-NLS-1$
@@ -121,7 +121,7 @@ public class PathMap<T> {
builder.append(this.value);
builder.append("\n"); //$NON-NLS-1$
}
- if (this.children != null) {
+ if (this.children != null) {
for (Entry<String, Node<T>> next : this.children.entrySet()) {
String key = next.getKey();
IPath nextPath = buildChildPath(parentPath, key);
@@ -165,7 +165,7 @@ public class PathMap<T> {
nextPath.setDevice(key);
return nextPath;
}
-
+
@Override
public void toString(StringBuilder builder, IPath parentPath) {
this.noDevice.toString(builder, parentPath);
@@ -226,7 +226,7 @@ public class PathMap<T> {
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
-
+
this.root.toString(builder, Path.EMPTY);
return builder.toString();
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/AbstractJavaSearchScope.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/AbstractJavaSearchScope.java
index 888fe83a9..4c46d8c55 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/AbstractJavaSearchScope.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/AbstractJavaSearchScope.java
@@ -29,7 +29,7 @@ abstract public AccessRuleSet getAccessRuleSet(String relativePath, String conta
/**
* Returns the package fragment root corresponding to a given resource path.
- *
+ *
* @param resourcePathString path of expected package fragment root.
* @param jarSeparatorIndex the index of the jar separator in the resource path, or -1 if none
* @param jarPath the already extracted jar path, or null if none
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/BasicSearchEngine.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/BasicSearchEngine.java
index 50e94c77e..5515ce636 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/BasicSearchEngine.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/BasicSearchEngine.java
@@ -146,7 +146,7 @@ public class BasicSearchEngine {
}
return createJavaSearchScope(excludeTestCode, elements, includeMask);
}
-
+
public static IJavaSearchScope createJavaSearchScope(IJavaElement[] elements, int includeMask) {
return createJavaSearchScope(false, elements, includeMask);
}
@@ -490,7 +490,7 @@ public class BasicSearchEngine {
boolean isPkgCaseSensitive = (matchRulePkg & SearchPattern.R_CASE_SENSITIVE) != 0;
if (patternPkg != null && !CharOperation.equals(patternPkg, pkg, isPkgCaseSensitive))
return false;
-
+
boolean isCaseSensitive = (matchRuleType & SearchPattern.R_CASE_SENSITIVE) != 0;
if (patternTypeName != null) {
boolean isCamelCase = (matchRuleType & (SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH)) != 0;
@@ -548,28 +548,28 @@ public class BasicSearchEngine {
return matchFirstChar && CharOperation.camelCaseMatch(patternName, name, true);
}
}
- return true;
+ return true;
}
- boolean match(char[] patternPkg, int matchRulePkg,
+ boolean match(char[] patternPkg, int matchRulePkg,
char[] patternDeclaringQualifier, int matchRuleDeclaringQualifier,
char[] patternDeclaringSimpleName, int matchRuleDeclaringSimpleName,
- char[] patternMethodName, int methodMatchRule,
+ char[] patternMethodName, int methodMatchRule,
char[] packageName, char[] declaringQualifier, char[] declaringSimpleName, char[] methodName) {
-
+
if (patternPkg != null && !CharOperation.equals(patternPkg, packageName, (matchRulePkg & SearchPattern.R_CASE_SENSITIVE) != 0))
return false;
-
+
return match(patternDeclaringQualifier, matchRuleDeclaringQualifier, declaringQualifier) &&
match(patternDeclaringSimpleName, matchRuleDeclaringSimpleName, declaringSimpleName) &&
match(patternMethodName, methodMatchRule, methodName);
-
+
}
-
- boolean match(char[] patternFusedQualifier, int matchRuleFusedQualifier,
- char[] patternMethodName, int methodMatchRule,
+
+ boolean match(char[] patternFusedQualifier, int matchRuleFusedQualifier,
+ char[] patternMethodName, int methodMatchRule,
char[] packageName, char[] declaringQualifier, char[] declaringSimpleName, char[] methodName) {
-
+
char[] q = packageName != null ? packageName : CharOperation.NO_CHAR;
if (declaringQualifier != null && declaringQualifier.length > 0) {
q = q.length > 0 ? CharOperation.concat(q, declaringQualifier, '.') : declaringQualifier;
@@ -577,10 +577,10 @@ public class BasicSearchEngine {
if (declaringSimpleName != null && declaringSimpleName.length > 0) {
q = q.length > 0 ? CharOperation.concat(q, declaringSimpleName, '.') : declaringSimpleName;
}
-
+
return match(patternFusedQualifier, matchRuleFusedQualifier, q) &&
match(patternMethodName, methodMatchRule, methodName);
-
+
}
/**
* Searches for matches of a given search pattern. Search patterns can be created using helper
@@ -596,7 +596,7 @@ public class BasicSearchEngine {
}
findMatches(pattern, participants, scope, requestor, monitor);
}
-
+
public void searchAllConstructorDeclarations(
final char[] packageName,
final char[] typeName,
@@ -609,10 +609,10 @@ public class BasicSearchEngine {
try {
// Validate match rule first
final int validatedTypeMatchRule = SearchPattern.validateMatchRule(typeName == null ? null : new String (typeName), typeMatchRule);
-
+
final int pkgMatchRule = SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE;
final char NoSuffix = IIndexConstants.TYPE_SUFFIX; // Used as TYPE_SUFFIX has no effect in method #match(char, char[] , int, char[], int , int, char[], char[])
-
+
// Debug
if (VERBOSE) {
Util.verbose("BasicSearchEngine.searchAllConstructorDeclarations(char[], char[], int, IJavaSearchScope, IRestrictedAccessConstructorRequestor, int, IProgressMonitor)"); //$NON-NLS-1$
@@ -625,14 +625,14 @@ public class BasicSearchEngine {
Util.verbose(" - scope: "+scope); //$NON-NLS-1$
}
if (validatedTypeMatchRule == -1) return; // invalid match rule => return no results
-
+
// Create pattern
IndexManager indexManager = JavaModelManager.getIndexManager();
final ConstructorDeclarationPattern pattern = new ConstructorDeclarationPattern(
packageName,
typeName,
validatedTypeMatchRule);
-
+
// Get working copy path(s). Store in a single string in case of only one to optimize comparison in requestor
final HashSet workingCopyPaths = new HashSet();
String workingCopyPath = null;
@@ -649,14 +649,14 @@ public class BasicSearchEngine {
}
}
final String singleWkcpPath = workingCopyPath;
-
+
// Index requestor
IndexQueryRequestor searchRequestor = new IndexQueryRequestor(){
@Override
public boolean acceptIndexMatch(String documentPath, SearchPattern indexRecord, SearchParticipant participant, AccessRuleSet access) {
// Filter unexpected types
ConstructorDeclarationPattern record = (ConstructorDeclarationPattern)indexRecord;
-
+
if ((record.extraFlags & ExtraFlags.IsMemberType) != 0) {
return true; // filter out member classes
}
@@ -677,7 +677,7 @@ public class BasicSearchEngine {
}
break;
}
-
+
// Accept document path
AccessRestriction accessRestriction = null;
if (access != null) {
@@ -716,7 +716,7 @@ public class BasicSearchEngine {
return true;
}
};
-
+
SubMonitor subMonitor = SubMonitor.convert(progressMonitor, Messages.engine_searching, 1000);
// add type names from indexes
indexManager.performConcurrentJob(
@@ -727,7 +727,7 @@ public class BasicSearchEngine {
searchRequestor),
waitingPolicy,
subMonitor.split(Math.max(1000-copiesLength, 0)));
-
+
// add type names from working copies
if (copies != null) {
for (int i = 0; i < copiesLength; i++) {
@@ -738,7 +738,7 @@ public class BasicSearchEngine {
} else {
if (!scope.encloses(workingCopy)) continue;
}
-
+
final String path = workingCopy.getPath().toString();
if (workingCopy.isConsistent()) {
IPackageDeclaration[] packageDeclarations = workingCopy.getPackageDeclarations();
@@ -748,17 +748,17 @@ public class BasicSearchEngine {
IType type = allTypes[j];
char[] simpleName = type.getElementName().toCharArray();
if (match(NoSuffix, packageName, pkgMatchRule, typeName, validatedTypeMatchRule, 0/*no kind*/, packageDeclaration, simpleName) && !type.isMember()) {
-
+
int extraFlags = ExtraFlags.getExtraFlags(type);
-
+
boolean hasConstructor = false;
-
+
IMethod[] methods = type.getMethods();
for (int k = 0; k < methods.length; k++) {
IMethod method = methods[k];
if (method.isConstructor()) {
hasConstructor = true;
-
+
String[] stringParameterNames = method.getParameterNames();
String[] stringParameterTypes = method.getParameterTypes();
int length = stringParameterNames.length;
@@ -768,13 +768,13 @@ public class BasicSearchEngine {
parameterNames[l] = stringParameterNames[l].toCharArray();
parameterTypes[l] = Signature.toCharArray(Signature.getTypeErasure(stringParameterTypes[l]).toCharArray());
}
-
+
nameRequestor.acceptConstructor(
method.getFlags(),
simpleName,
parameterNames.length,
null,// signature is not used for source type
- parameterTypes,
+ parameterTypes,
parameterNames,
type.getFlags(),
packageDeclaration,
@@ -783,7 +783,7 @@ public class BasicSearchEngine {
null);
}
}
-
+
if (!hasConstructor) {
nameRequestor.acceptConstructor(
Flags.AccPublic,
@@ -810,10 +810,10 @@ public class BasicSearchEngine {
class AllConstructorDeclarationsVisitor extends ASTVisitor {
private TypeDeclaration[] declaringTypes = new TypeDeclaration[0];
private int declaringTypesPtr = -1;
-
+
private void endVisit(TypeDeclaration typeDeclaration) {
if (!hasConstructor(typeDeclaration) && typeDeclaration.enclosingType == null) {
-
+
if (match(NoSuffix, packageName, pkgMatchRule, typeName, validatedTypeMatchRule, 0/*no kind*/, packageDeclaration, typeDeclaration.name)) {
nameRequestor.acceptConstructor(
Flags.AccPublic,
@@ -829,21 +829,21 @@ public class BasicSearchEngine {
null);
}
}
-
+
this.declaringTypes[this.declaringTypesPtr] = null;
this.declaringTypesPtr--;
}
-
+
@Override
public void endVisit(TypeDeclaration typeDeclaration, CompilationUnitScope s) {
endVisit(typeDeclaration);
}
-
+
@Override
public void endVisit(TypeDeclaration memberTypeDeclaration, ClassScope s) {
endVisit(memberTypeDeclaration);
}
-
+
private boolean hasConstructor(TypeDeclaration typeDeclaration) {
AbstractMethodDeclaration[] methods = typeDeclaration.methods;
int length = methods == null ? 0 : methods.length;
@@ -852,7 +852,7 @@ public class BasicSearchEngine {
return true;
}
}
-
+
return false;
}
@Override
@@ -876,7 +876,7 @@ public class BasicSearchEngine {
parameterTypes[l] = CharOperation.concatWith(((QualifiedTypeReference)argument.type).tokens, '.');
}
}
-
+
TypeDeclaration enclosing = typeDeclaration.enclosingType;
char[][] enclosingTypeNames = CharOperation.NO_CHAR_CHAR;
while (enclosing != null) {
@@ -887,7 +887,7 @@ public class BasicSearchEngine {
enclosing = null;
}
}
-
+
nameRequestor.acceptConstructor(
constructorDeclaration.modifiers,
typeName,
@@ -905,9 +905,9 @@ public class BasicSearchEngine {
}
@Override
public boolean visit(TypeDeclaration typeDeclaration, BlockScope blockScope) {
- return false;
+ return false;
}
-
+
private boolean visit(TypeDeclaration typeDeclaration) {
if(this.declaringTypes.length <= ++this.declaringTypesPtr) {
int length = this.declaringTypesPtr;
@@ -916,12 +916,12 @@ public class BasicSearchEngine {
this.declaringTypes[this.declaringTypesPtr] = typeDeclaration;
return true;
}
-
+
@Override
public boolean visit(TypeDeclaration typeDeclaration, CompilationUnitScope s) {
return visit(typeDeclaration);
}
-
+
@Override
public boolean visit(TypeDeclaration memberTypeDeclaration, ClassScope s) {
return visit(memberTypeDeclaration);
@@ -940,12 +940,12 @@ public class BasicSearchEngine {
}
/**
- * Searches for all method declarations in the given scope.
+ * Searches for all method declarations in the given scope.
* * <p>
* Warning: This API is in experimental phase and may be modified/removed. Do not use this until this
* comment is removed.
* </p>
- *
+ *
* @see SearchEngine#searchAllMethodNames(char[], int, char[], int, IJavaSearchScope, MethodNameMatchRequestor, int, IProgressMonitor)
* for detailed comments
*/
@@ -1001,7 +1001,7 @@ public class BasicSearchEngine {
@Override
public boolean acceptIndexMatch(String documentPath, SearchPattern indexRecord, SearchParticipant participant, AccessRuleSet access) {
MethodDeclarationPattern record = (MethodDeclarationPattern)indexRecord;
-
+
if ((record.extraFlags & ExtraFlags.IsLocalType) != 0) {
return true; // filter out local and anonymous classes
}
@@ -1047,21 +1047,21 @@ public class BasicSearchEngine {
accessRestriction = access.getViolatedRestriction(path);
}
}
- if (match(qualifier, qualifierMatchRule, methodName, methodMatchRule,
+ if (match(qualifier, qualifierMatchRule, methodName, methodMatchRule,
record.declaringPackageName, record.declaringQualification, record.declaringSimpleName, record.selector)) {
nameRequestor.acceptMethod(
- record.selector,
+ record.selector,
record.parameterCount,
record.declaringQualification,
- record.declaringSimpleName,
- record.declaringTypeModifiers,
+ record.declaringSimpleName,
+ record.declaringTypeModifiers,
record.declaringPackageName,
- record.signature,
- record.parameterTypes,
+ record.signature,
+ record.parameterTypes,
record.parameterNames,
record.returnSimpleName,
- record.modifiers,
- documentPath,
+ record.modifiers,
+ documentPath,
accessRestriction,
-1 /* method index not applicable as there is no IType here */);
}
@@ -1095,7 +1095,7 @@ public class BasicSearchEngine {
if (workingCopy.isConsistent()) {
IPackageDeclaration[] packageDeclarations = workingCopy.getPackageDeclarations();
char[] packageDeclaration = packageDeclarations.length == 0 ? CharOperation.NO_CHAR : packageDeclarations[0].getElementName().toCharArray();
-
+
IType[] allTypes = workingCopy.getAllTypes();
for (int j = 0, allTypesLength = allTypes.length; j < allTypesLength; j++) {
IType type = allTypes[j];
@@ -1106,7 +1106,7 @@ public class BasicSearchEngine {
if (!match(qualifier, qualifierMatchRule, q))
continue;
reportMatchingMethods(methodName, methodMatchRule, nameRequestor, path,
- packageDeclaration, type, rDeclaringQualification, rSimpleName);
+ packageDeclaration, type, rDeclaringQualification, rSimpleName);
}
} else {
Parser basicParser = getParser();
@@ -1122,7 +1122,7 @@ public class BasicSearchEngine {
public IType type;
public boolean visitMethods;
public char[] enclosingTypeName;
-
+
TypeInfo(TypeDeclaration typeDecl, boolean visitMethods, char[] enclosingTypeName) {
this.typeDecl = typeDecl;
this.type = workingCopy.getType(new String(typeDecl.name));
@@ -1170,13 +1170,13 @@ public class BasicSearchEngine {
if (typeInfo.visitMethods &&
match(methodName, methodMatchRule, methodDeclaration.selector)) {
reportMatchingMethod(path, packageDeclaration,
- typeInfo.enclosingTypeName,
- typeInfo.typeDecl,
+ typeInfo.enclosingTypeName,
+ typeInfo.typeDecl,
methodDeclaration,
getCurrentType(),
nameRequestor);
}
-
+
return false; // no need to find methods from local/anonymous type
}
@Override
@@ -1204,12 +1204,12 @@ public class BasicSearchEngine {
}
/**
- * Searches for all method declarations in the given scope.
+ * Searches for all method declarations in the given scope.
* * <p>
* Warning: This API is in experimental phase and may be modified/removed. Do not use this until this
* comment is removed.
* </p>
- *
+ *
* @see SearchEngine#searchAllMethodNames(char[], int, char[], int, char[], int, char[], int, IJavaSearchScope, MethodNameMatchRequestor, int, IProgressMonitor)
* for detailed comments
*/
@@ -1271,7 +1271,7 @@ public class BasicSearchEngine {
@Override
public boolean acceptIndexMatch(String documentPath, SearchPattern indexRecord, SearchParticipant participant, AccessRuleSet access) {
MethodDeclarationPattern record = (MethodDeclarationPattern)indexRecord;
-
+
if ((record.extraFlags & ExtraFlags.IsLocalType) != 0) {
return true; // filter out local and anonymous classes
}
@@ -1317,21 +1317,21 @@ public class BasicSearchEngine {
accessRestriction = access.getViolatedRestriction(path);
}
}
- if (match(packageName, pkgMatchRule, declaringQualification, declQualificationMatchRule, declaringSimpleName, declSimpleNameMatchRule, methodName, methodMatchRule,
+ if (match(packageName, pkgMatchRule, declaringQualification, declQualificationMatchRule, declaringSimpleName, declSimpleNameMatchRule, methodName, methodMatchRule,
record.declaringPackageName, record.declaringQualification, record.declaringSimpleName, record.selector)) {
nameRequestor.acceptMethod(
- record.selector,
+ record.selector,
record.parameterCount,
record.declaringQualification,
- record.declaringSimpleName,
- record.declaringTypeModifiers,
+ record.declaringSimpleName,
+ record.declaringTypeModifiers,
record.declaringPackageName,
- record.signature,
- record.parameterTypes,
+ record.signature,
+ record.parameterTypes,
record.parameterNames,
record.returnSimpleName,
- record.modifiers,
- documentPath,
+ record.modifiers,
+ documentPath,
accessRestriction,
-1 /* method index not applicable as there is no IType here */);
}
@@ -1352,7 +1352,7 @@ public class BasicSearchEngine {
// add type names from working copies
if (copies != null) {
- boolean isPkgCaseSensitive = (pkgMatchRule & SearchPattern.R_CASE_SENSITIVE) != 0;
+ boolean isPkgCaseSensitive = (pkgMatchRule & SearchPattern.R_CASE_SENSITIVE) != 0;
for (int i = 0; i < copiesLength; i++) {
SubMonitor iterationMonitor = subMonitor.split(1);
final ICompilationUnit workingCopy = copies[i];
@@ -1368,7 +1368,7 @@ public class BasicSearchEngine {
char[] packageDeclaration = packageDeclarations.length == 0 ? CharOperation.NO_CHAR : packageDeclarations[0].getElementName().toCharArray();
if (packageName != null && !CharOperation.equals(packageName, packageDeclaration, isPkgCaseSensitive))
continue;
-
+
IType[] allTypes = workingCopy.getAllTypes();
for (int j = 0, allTypesLength = allTypes.length; j < allTypesLength; j++) {
IType type = allTypes[j];
@@ -1379,7 +1379,7 @@ public class BasicSearchEngine {
!match(declaringSimpleName, declSimpleNameMatchRule, rSimpleName))
continue;
reportMatchingMethods(methodName, methodMatchRule, nameRequestor, path,
- packageDeclaration, type, rDeclaringQualification, rSimpleName);
+ packageDeclaration, type, rDeclaringQualification, rSimpleName);
}
} else {
Parser basicParser = getParser();
@@ -1395,7 +1395,7 @@ public class BasicSearchEngine {
public IType type;
public boolean visitMethods;
public char[] enclosingTypeName;
-
+
TypeInfo(TypeDeclaration typeDecl, boolean visitMethods, char[] enclosingTypeName) {
this.typeDecl = typeDecl;
this.type = workingCopy.getType(new String(typeDecl.name));
@@ -1443,13 +1443,13 @@ public class BasicSearchEngine {
if (typeInfo.visitMethods &&
match(methodName, methodMatchRule, methodDeclaration.selector)) {
reportMatchingMethod(path, packageDeclaration,
- typeInfo.enclosingTypeName,
- typeInfo.typeDecl,
+ typeInfo.enclosingTypeName,
+ typeInfo.typeDecl,
methodDeclaration,
getCurrentType(),
nameRequestor);
}
-
+
return false; // no need to find methods from local/anonymous type
}
@Override
@@ -1481,7 +1481,7 @@ public class BasicSearchEngine {
final String path,
final char[] packageDeclaration,
final char[] declaringQualifier,
- final TypeDeclaration typeDeclaration,
+ final TypeDeclaration typeDeclaration,
final MethodDeclaration methodDeclaration,
final IType type,
final IRestrictedAccessMethodRequestor nameRequestor) {
@@ -1506,19 +1506,19 @@ public class BasicSearchEngine {
} else {
char[] returnType = CharOperation.toString(methodDeclaration.returnType.getTypeName()).toCharArray();
nameRequestor.acceptMethod(
- methodDeclaration.selector,
- argsLength,
- declaringQualifier,
- typeDeclaration.name,
- typeDeclaration.modifiers,
- packageDeclaration,
- null,
- parameterTypes,
- parameterNames,
- returnType,
- methodDeclaration.modifiers,
- path,
- null,
+ methodDeclaration.selector,
+ argsLength,
+ declaringQualifier,
+ typeDeclaration.name,
+ typeDeclaration.modifiers,
+ packageDeclaration,
+ null,
+ parameterTypes,
+ parameterNames,
+ returnType,
+ methodDeclaration.modifiers,
+ path,
+ null,
-1 /* method index */);
}
}
@@ -1527,11 +1527,11 @@ public class BasicSearchEngine {
IType type, char[] rDeclaringQualification, char[] rSimpleName)
throws JavaModelException {
IMethod[] methods = type.getMethods();
-
+
for (int k = 0; k < methods.length; k++) {
IMethod method = methods[k];
if (method.isConstructor()) continue;
-
+
char[] rMethodName = method.getElementName().toCharArray();
if (match(methodName, methodMatchRule, rMethodName)) {
if (nameRequestor instanceof MethodNameMatchRequestorWrapper) {
@@ -1552,20 +1552,20 @@ public class BasicSearchEngine {
char[] returnErasure = Signature.toCharArray(Signature.getTypeErasure(signature));
CharOperation.replace(returnErasure, '$', '.');
char[] returnTypeName = returnErasure;
-
+
nameRequestor.acceptMethod(
- rMethodName,
- parameterNames.length,
- rDeclaringQualification,
- rSimpleName,
+ rMethodName,
+ parameterNames.length,
+ rDeclaringQualification,
+ rSimpleName,
type.getFlags(),
- packageDeclaration,
- null, // signature not used for source
- parameterTypes,
- parameterNames,
- returnTypeName,
- method.getFlags(),
- path,
+ packageDeclaration,
+ null, // signature not used for source
+ parameterTypes,
+ parameterNames,
+ returnTypeName,
+ method.getFlags(),
+ path,
null,
k);
}
@@ -1601,10 +1601,10 @@ public class BasicSearchEngine {
buffer.append(waitForIndexes);
Util.verbose(buffer.toString());
}
-
+
IndexManager indexManager = JavaModelManager.getIndexManager();
final TypeDeclarationPattern pattern = new SecondaryTypeDeclarationPattern();
-
+
// Get working copy path(s). Store in a single string in case of only one to optimize comparison in requestor
final HashSet workingCopyPaths = new HashSet();
String workingCopyPath = null;
@@ -1621,7 +1621,7 @@ public class BasicSearchEngine {
}
}
final String singleWkcpPath = workingCopyPath;
-
+
// Index requestor
IndexQueryRequestor searchRequestor = new IndexQueryRequestor(){
@Override
@@ -1648,7 +1648,7 @@ public class BasicSearchEngine {
}
break;
}
-
+
// Accept document path
AccessRestriction accessRestriction = null;
if (access != null) {
@@ -1676,7 +1676,7 @@ public class BasicSearchEngine {
return true;
}
};
-
+
// add type names from indexes
try {
SubMonitor subMonitor = SubMonitor.convert(progressMonitor, Messages.engine_searching, 100);
@@ -1722,7 +1722,7 @@ public class BasicSearchEngine {
try {
// Validate match rule first
final int validatedTypeMatchRule = SearchPattern.validateMatchRule(typeName == null ? null : new String (typeName), typeMatchRule);
-
+
// Debug
if (VERBOSE) {
Util.verbose("BasicSearchEngine.searchAllTypeNames(char[], char[], int, int, IJavaSearchScope, IRestrictedAccessTypeRequestor, int, IProgressMonitor)"); //$NON-NLS-1$
@@ -1737,7 +1737,7 @@ public class BasicSearchEngine {
Util.verbose(" - scope: "+scope); //$NON-NLS-1$
}
if (validatedTypeMatchRule == -1) return; // invalid match rule => return no results
-
+
// Create pattern
IndexManager indexManager = JavaModelManager.getIndexManager();
final char typeSuffix;
@@ -1780,7 +1780,7 @@ public class BasicSearchEngine {
typeName,
typeSuffix,
validatedTypeMatchRule);
-
+
// Get working copy path(s). Store in a single string in case of only one to optimize comparison in requestor
final HashSet workingCopyPaths = new HashSet();
String workingCopyPath = null;
@@ -1797,7 +1797,7 @@ public class BasicSearchEngine {
}
}
final String singleWkcpPath = workingCopyPath;
-
+
// Index requestor
IndexQueryRequestor searchRequestor = new IndexQueryRequestor(){
@Override
@@ -1821,7 +1821,7 @@ public class BasicSearchEngine {
}
break;
}
-
+
// Accept document path
AccessRestriction accessRestriction = null;
if (access != null) {
@@ -1851,7 +1851,7 @@ public class BasicSearchEngine {
return true;
}
};
-
+
SubMonitor subMonitor = SubMonitor.convert(progressMonitor, Messages.engine_searching, 1000);
// add type names from indexes
indexManager.performConcurrentJob(
@@ -1862,7 +1862,7 @@ public class BasicSearchEngine {
searchRequestor),
waitingPolicy,
subMonitor.split(Math.max(1000-copiesLength, 0)));
-
+
// add type names from working copies
if (copies != null) {
for (int i = 0; i < copiesLength; i++) {
@@ -1999,7 +1999,7 @@ public class BasicSearchEngine {
Util.verbose(" - scope: "+scope); //$NON-NLS-1$
}
IndexManager indexManager = JavaModelManager.getIndexManager();
-
+
// Create pattern
final char typeSuffix;
switch(searchFor){
@@ -2029,7 +2029,7 @@ public class BasicSearchEngine {
break;
}
final MultiTypeDeclarationPattern pattern = new MultiTypeDeclarationPattern(qualifications, typeNames, typeSuffix, matchRule);
-
+
// Get working copy path(s). Store in a single string in case of only one to optimize comparison in requestor
final HashSet workingCopyPaths = new HashSet();
String workingCopyPath = null;
@@ -2046,7 +2046,7 @@ public class BasicSearchEngine {
}
}
final String singleWkcpPath = workingCopyPath;
-
+
// Index requestor
IndexQueryRequestor searchRequestor = new IndexQueryRequestor(){
@Override
@@ -2070,7 +2070,7 @@ public class BasicSearchEngine {
}
break;
}
-
+
// Accept document path
AccessRestriction accessRestriction = null;
if (access != null) {
@@ -2082,7 +2082,7 @@ public class BasicSearchEngine {
if (qualificationLength > 0) {
System.arraycopy(record.qualification, 0, path, pos, qualificationLength - 1);
CharOperation.replace(path, '.', '/');
-
+
// Access rules work on package level and should not discriminate on enclosing types.
boolean isNestedType = record.enclosingTypeNames != null && record.enclosingTypeNames.length > 0;
path[qualificationLength-1] = isNestedType ? '$' : '/';
@@ -2101,7 +2101,7 @@ public class BasicSearchEngine {
return true;
}
};
-
+
SubMonitor subMonitor = SubMonitor.convert(progressMonitor, Messages.engine_searching, 100);
// add type names from indexes
indexManager.performConcurrentJob(
@@ -2112,7 +2112,7 @@ public class BasicSearchEngine {
searchRequestor),
waitingPolicy,
subMonitor.split(100));
-
+
// add type names from working copies
if (copies != null) {
for (int i = 0, length = copies.length; i < length; i++) {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/HierarchyScope.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/HierarchyScope.java
index 304653223..118374923 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/HierarchyScope.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/HierarchyScope.java
@@ -68,13 +68,13 @@ public class HierarchyScope extends AbstractSearchScope implements SuffixConstan
/**
* Creates a new hierarchy scope for the given type with the given configuration options.
- * @param project constrain the search result to this project,
- * or <code>null</code> if search should consider all types in the workspace
+ * @param project constrain the search result to this project,
+ * or <code>null</code> if search should consider all types in the workspace
* @param type the focus type of the hierarchy
- * @param owner the owner of working copies that take precedence over original compilation units,
+ * @param owner the owner of working copies that take precedence over original compilation units,
* or <code>null</code> if the primary working copy owner should be used
* @param onlySubtypes if true search only subtypes of 'type'
- * @param noMembersOrEnclosingTypes if true the hierarchy is strict,
+ * @param noMembersOrEnclosingTypes if true the hierarchy is strict,
* i.e., no additional member types or enclosing types of types spanning the hierarchy are included,
* otherwise all member and enclosing types of types in the hierarchy are included.
* @param includeFocusType if true the focus type <code>type</code> is included in the resulting scope, otherwise it is excluded
@@ -331,15 +331,15 @@ public class HierarchyScope extends AbstractSearchScope implements SuffixConstan
}
return false;
}
- /**
+ /**
* Optionally perform additional checks after element has already passed matching based on index/documents.
- *
+ *
* @param element the given element
- * @return <code>true</code> if the element is enclosed or if no fine grained checking
+ * @return <code>true</code> if the element is enclosed or if no fine grained checking
* (regarding subtypes and members) is requested
*/
public boolean enclosesFineGrained(IJavaElement element) {
- if ((this.subTypes == null) && this.allowMemberAndEnclosingTypes)
+ if ((this.subTypes == null) && this.allowMemberAndEnclosingTypes)
return true; // no fine grained checking requested
return encloses(element, null);
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/IRestrictedAccessTypeRequestor.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/IRestrictedAccessTypeRequestor.java
index bebfd1027..6ce7315dc 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/IRestrictedAccessTypeRequestor.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/IRestrictedAccessTypeRequestor.java
@@ -21,7 +21,7 @@ import org.eclipse.jdt.internal.compiler.env.AccessRestriction;
* @see org.eclipse.jdt.core.search.TypeNameRequestor
*/
public interface IRestrictedAccessTypeRequestor {
-
+
public void acceptType(int modifiers, char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, String path, AccessRestriction access);
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/IndexQueryRequestor.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/IndexQueryRequestor.java
index 9a8d80d07..171ad7a45 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/IndexQueryRequestor.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/IndexQueryRequestor.java
@@ -21,8 +21,8 @@ import org.eclipse.jdt.internal.compiler.env.AccessRuleSet;
* TODO add spec
*/
public abstract class IndexQueryRequestor {
-
+
// answer false if requesting cancel
public abstract boolean acceptIndexMatch(String documentPath, SearchPattern indexRecord, SearchParticipant participant, AccessRuleSet access);
-
+
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/IndexSelector.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/IndexSelector.java
index 092f4b6cb..fdf45f82a 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/IndexSelector.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/IndexSelector.java
@@ -42,12 +42,12 @@ import org.eclipse.jdt.internal.core.search.matching.ModulePattern;
*/
@SuppressWarnings({"rawtypes", "unchecked"})
public class IndexSelector {
-
+
//TODO: Bug 386113: "Search references" and "Type hierarchy" show inconsistent results with "External Plug-in Libraries" project
public static final int PROJECT_CAN_SEE_FOCUS= 0;
public static final int PROJECT_SOURCE_CAN_NOT_SEE_FOCUS= 1;
public static final int PROJECT_CAN_NOT_SEE_FOCUS= 2;
-
+
IJavaSearchScope searchScope;
SearchPattern pattern;
IndexLocation[] indexLocations; // cache of the keys for looking index up
@@ -216,7 +216,7 @@ private void initializeIndexLocations() {
} else {
try {
// See whether the state builder might be used to reduce the number of index locations
-
+
// find the projects from projectsAndJars that see the focus then walk those projects looking for the jars from projectsAndJars
int length = projectsAndJars.length;
JavaProject[] projectsCanSeeFocus = new JavaProject[length];
@@ -329,7 +329,7 @@ private char[][][] getQualifiedNames(ObjectVector types) {
if (primaryType != null) {
focusQualifiedNames = new char[size+1][][];
focusQualifiedNames[index++] = CharOperation.splitOn('.', primaryType.getFullyQualifiedName().toCharArray());
- }
+ }
}
if (focusQualifiedNames == null) {
focusQualifiedNames = new char[size][][];
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/JavaSearchDocument.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/JavaSearchDocument.java
index 491b1393b..d3a30d679 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/JavaSearchDocument.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/JavaSearchDocument.java
@@ -26,11 +26,11 @@ import org.eclipse.jdt.internal.core.search.processing.JobManager;
import org.eclipse.jdt.internal.core.util.Util;
public class JavaSearchDocument extends SearchDocument {
-
+
private IFile file;
protected byte[] byteContents;
protected char[] charContents;
-
+
public JavaSearchDocument(String documentPath, SearchParticipant participant) {
super(documentPath, participant);
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/JavaSearchMethodNameMatch.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/JavaSearchMethodNameMatch.java
index 895bce557..ac0c164b4 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/JavaSearchMethodNameMatch.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/JavaSearchMethodNameMatch.java
@@ -22,10 +22,10 @@ import org.eclipse.jdt.core.search.MethodNameMatch;
*
*/
public class JavaSearchMethodNameMatch extends MethodNameMatch {
-
+
IMethod method = null;
int modifiers = -1;
-
+
private int accessibility = IAccessRule.K_ACCESSIBLE; // TODO: this pertains to class/type - need to revisit whether this is required in method name match
public JavaSearchMethodNameMatch(IMethod method, int modifiers) {
this.method = method;
@@ -46,11 +46,11 @@ public class JavaSearchMethodNameMatch extends MethodNameMatch {
public IMethod getMethod() {
return this.method;
}
-
+
public void setAccessibility(int accessibility) {
this.accessibility = accessibility;
}
-
+
@Override
public String toString() {
return this.method == null ? super.toString() : this.method.toString();
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/JavaSearchScope.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/JavaSearchScope.java
index eec557caf..125859b21 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/JavaSearchScope.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/JavaSearchScope.java
@@ -49,13 +49,13 @@ import org.eclipse.jdt.internal.core.util.Util;
*/
@SuppressWarnings({"rawtypes", "unchecked"})
public class JavaSearchScope extends AbstractJavaSearchScope {
-
+
private ArrayList elements;
- /* The paths of the resources in this search scope
- (or the classpath entries' paths if the resources are projects)
+ /* The paths of the resources in this search scope
+ (or the classpath entries' paths if the resources are projects)
*/
- private ArrayList projectPaths = new ArrayList(); // container paths projects
+ private ArrayList projectPaths = new ArrayList(); // container paths projects
private int[] projectIndexes; // Indexes of projects in list
private String[] containerPaths; // path to the container (e.g. /P/src, /P/lib.jar, c:\temp\mylib.jar)
private String[] relativePaths; // path relative to the container (e.g. x/y/Z.class, x/y, (empty))
@@ -63,7 +63,7 @@ public class JavaSearchScope extends AbstractJavaSearchScope {
protected AccessRuleSet[] pathRestrictions;
private int pathsCount;
private int threshold;
-
+
private IPath[] enclosingProjectsAndJars;
public final static AccessRuleSet NOT_ENCLOSED = new AccessRuleSet(null, (byte) 0, null);
@@ -76,11 +76,11 @@ public JavaSearchScope(boolean excludeTestCode) {
private JavaSearchScope(int size, boolean excludeTestCode) {
this.excludeTestCode = excludeTestCode;
initialize(size);
-
+
//disabled for now as this could be expensive
//JavaModelManager.getJavaModelManager().rememberScope(this);
}
-
+
private void addEnclosingProjectOrJar(IPath path) {
int length = this.enclosingProjectsAndJars.length;
for (int i = 0; i < length; i++) {
@@ -112,7 +112,7 @@ public void add(JavaProject project, int includeMask, HashSet projectsToBeAdded)
* @param projectsToBeAdded Set to avoid infinite recursion
* @param visitedProjects Set to avoid adding twice the same project
* @param referringEntry Project raw entry in referring project classpath
- * @throws JavaModelException May happen while getting java model info
+ * @throws JavaModelException May happen while getting java model info
*/
void add(JavaProject javaProject, IPath pathToAdd, int includeMask, HashSet projectsToBeAdded, HashSet visitedProjects, IClasspathEntry referringEntry) throws JavaModelException {
IProject project = javaProject.getProject();
@@ -226,7 +226,7 @@ public void add(IJavaElement element) throws JavaModelException {
switch (element.getElementType()) {
case IJavaElement.JAVA_MODEL:
// a workspace sope should be used
- break;
+ break;
case IJavaElement.JAVA_PROJECT:
add((JavaProject)element, null, includeMask, new HashSet(2), new HashSet(2), null);
break;
@@ -288,7 +288,7 @@ public void add(IJavaElement element) throws JavaModelException {
containerPathToString = containerPath.getDevice() == null ? containerPath.toString() : containerPath.toOSString();
add(projectPath, relativePath, containerPathToString, false/*not a package*/, null);
}
-
+
if (root != null)
addEnclosingProjectOrJar(root.getKind() == IPackageFragmentRoot.K_SOURCE ? root.getParent().getPath() : root.getPath());
}
@@ -333,15 +333,15 @@ private void add(String projectPath, String relativePath, String containerPath,
rehash();
}
-/*
+/*
* E.g.
- *
+ *
* 1. /P/src/pkg/X.java
* 2. /P/src/pkg
* 3. /P/lib.jar|org/eclipse/jdt/core/IJavaElement.class
* 4. /home/mylib.jar|x/y/z/X.class
* 5. c:\temp\mylib.jar|x/y/Y.class
- *
+ *
* @see IJavaSearchScope#encloses(String)
*/
@Override
@@ -360,7 +360,7 @@ public boolean encloses(String resourcePathString) {
/**
* Returns paths list index of given path or -1 if not found.
* NOTE: Use indexOf(String, String) for path inside jars
- *
+ *
* @param fullPath the full path of the resource, e.g.
* 1. /P/src/pkg/X.java
* 2. /P/src/pkg
@@ -417,7 +417,7 @@ private int indexOf(String containerPath, String relativePath) {
private boolean encloses(String enclosingPath, String path, int index) {
// normalize given path as it can come from outside
path = normalize(path);
-
+
int pathLength = path.length();
int enclosingLength = enclosingPath.length();
if (pathLength < enclosingLength) {
@@ -433,10 +433,10 @@ private boolean encloses(String enclosingPath, String path, int index) {
return path.startsWith(enclosingPath)
&& path.charAt(enclosingLength) == '/';
} else {
- // if looking at a package, this scope encloses the given path
+ // if looking at a package, this scope encloses the given path
// if the given path is a direct child of the folder
// or if the given path path is the folder path (see bug 13919 Declaration for package not found if scope is not project)
- if (path.startsWith(enclosingPath)
+ if (path.startsWith(enclosingPath)
&& ((enclosingPath.length() == path.lastIndexOf('/'))
|| (enclosingPath.length() == path.length()))) {
return true;
@@ -553,7 +553,7 @@ public void processDelta(IJavaElementDelta delta, int eventType) {
if (this.encloses(element)) {
if (this.elements != null) {
this.elements.remove(element);
- }
+ }
String path = null;
switch (element.getElementType()) {
case IJavaElement.JAVA_PROJECT:
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/JavaSearchTypeNameMatch.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/JavaSearchTypeNameMatch.java
index 2f00a705d..fd001f9c3 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/JavaSearchTypeNameMatch.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/JavaSearchTypeNameMatch.java
@@ -18,7 +18,7 @@ import org.eclipse.jdt.core.search.*;
/**
* Java Search concrete class for a type name match.
- *
+ *
* @since 3.3
*/
public class JavaSearchTypeNameMatch extends TypeNameMatch {
@@ -85,7 +85,7 @@ public int hashCode() {
/**
* Sets the accessibility of the accepted match.
- *
+ *
* @param accessibility the accessibility of the current match
*/
public void setAccessibility(int accessibility) {
@@ -94,7 +94,7 @@ public void setAccessibility(int accessibility) {
/**
* Set modifiers of the matched type.
- *
+ *
* @param modifiers the modifiers of the matched type.
*/
public void setModifiers(int modifiers) {
@@ -103,7 +103,7 @@ public void setModifiers(int modifiers) {
/**
* Set matched type.
- *
+ *
* @param type the matched type.
*/
public void setType(IType type) {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/MethodNameMatchRequestorWrapper.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/MethodNameMatchRequestorWrapper.java
index 75cb2d086..b393cc5f5 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/MethodNameMatchRequestorWrapper.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/MethodNameMatchRequestorWrapper.java
@@ -36,7 +36,7 @@ import org.eclipse.jdt.internal.compiler.env.AccessRestriction;
* IJavaSearchScope scope,
* IRestrictedAccessMethodRequestor methodRequestor,
* int waitingPolicy,
- * IProgressMonitor progressMonitor)} from API method
+ * IProgressMonitor progressMonitor)} from API method
* {@link org.eclipse.jdt.core.search.SearchEngine#searchAllMethodNames(
* char[] packageName,
* int pkgMatchRule,
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/MethodNameRequestorWrapper.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/MethodNameRequestorWrapper.java
index d8b4a788b..51dfb4a18 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/MethodNameRequestorWrapper.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/MethodNameRequestorWrapper.java
@@ -45,13 +45,13 @@ import org.eclipse.jdt.internal.compiler.env.AccessRestriction;
* IJavaSearchScope scope,
* MethodNameRequestor methodRequestor,
* int waitingPolicy,
- * IProgressMonitor progressMonitor)}.
+ * IProgressMonitor progressMonitor)}.
*
*/
public class MethodNameRequestorWrapper implements IRestrictedAccessMethodRequestor {
-
+
MethodNameRequestor requestor;
-
+
public MethodNameRequestorWrapper(MethodNameRequestor requestor) {
this.requestor = requestor;
}
@@ -61,7 +61,7 @@ public class MethodNameRequestorWrapper implements IRestrictedAccessMethodReques
char[] simpleTypeName, int typeModifiers, char[] packageName, char[] signature, char[][] parameterTypes,
char[][] parameterNames, char[] returnType, int modifiers, String path,
AccessRestriction access, int methodIndex) {
- this.requestor.acceptMethod(methodName, parameterCount, declaringQualification, simpleTypeName, typeModifiers,
+ this.requestor.acceptMethod(methodName, parameterCount, declaringQualification, simpleTypeName, typeModifiers,
packageName, signature, parameterTypes, parameterNames, returnType, modifiers, path, methodIndex);
}
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/NameMatchRequestorWrapper.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/NameMatchRequestorWrapper.java
index 923e42556..2480f99a8 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/NameMatchRequestorWrapper.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/NameMatchRequestorWrapper.java
@@ -125,7 +125,7 @@ private IType createTypeFromJar(String resourcePath, int separatorIndex) throws
IPackageFragment pkgFragment= (IPackageFragment) this.packageHandles.get(pkgName);
if (pkgFragment == null) {
pkgFragment= ((PackageFragmentRoot) this.lastPkgFragmentRoot).getPackageFragment(pkgName, moduleName); //BUG 478143
- // filter org.apache.commons.lang.enum package for projects above 1.5
+ // filter org.apache.commons.lang.enum package for projects above 1.5
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=317264
if (length == 5 && pkgName[4].equals("enum")) { //$NON-NLS-1$
IJavaProject proj = (IJavaProject)pkgFragment.getAncestor(IJavaElement.JAVA_PROJECT);
@@ -136,7 +136,7 @@ private IType createTypeFromJar(String resourcePath, int separatorIndex) throws
}
if (this.complianceValue >= ClassFileConstants.JDK1_5)
return null;
- }
+ }
this.packageHandles.put(pkgName, pkgFragment);
}
return pkgFragment.getOrdinaryClassFile(simpleNames[length]).getType();
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/PathCollector.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/PathCollector.java
index 0ffc5fb35..a381f58a9 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/PathCollector.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/PathCollector.java
@@ -24,7 +24,7 @@ import org.eclipse.jdt.internal.compiler.env.AccessRuleSet;
*/
@SuppressWarnings({"rawtypes", "unchecked"})
public class PathCollector extends IndexQueryRequestor {
-
+
/* a set of resource paths */
public HashSet paths = new HashSet(5);
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/PatternSearchJob.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/PatternSearchJob.java
index ab1f94f83..6af6d897b 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/PatternSearchJob.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/PatternSearchJob.java
@@ -51,7 +51,7 @@ public boolean belongsTo(String jobFamily) {
}
@Override
public void cancel() {
- // search job is cancelled through progress
+ // search job is cancelled through progress
}
@Override
public void ensureReadyToRun() {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/SubTypeSearchJob.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/SubTypeSearchJob.java
index 00679f38b..42b5656d5 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/SubTypeSearchJob.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/SubTypeSearchJob.java
@@ -40,7 +40,7 @@ public Index[] getIndexes(IProgressMonitor progressMonitor) {
Index[] values = new Index[this.indexes.elementSize];
this.indexes.asArray(values);
return values;
-}
+}
@Override
public boolean search(Index index, IProgressMonitor progressMonitor) {
if (index == null) return COMPLETE;
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/TypeNameRequestorWrapper.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/TypeNameRequestorWrapper.java
index 55dfb89fd..214710794 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/TypeNameRequestorWrapper.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/TypeNameRequestorWrapper.java
@@ -19,22 +19,22 @@ import org.eclipse.jdt.internal.compiler.env.AccessRestriction;
/**
* Wrapper used to link {@link IRestrictedAccessTypeRequestor} with {@link TypeNameRequestor}.
* This wrapper specifically allows usage of internal method {@link BasicSearchEngine#searchAllTypeNames(
- * char[] packageName,
- * int packageMatchRule,
+ * char[] packageName,
+ * int packageMatchRule,
* char[] typeName,
- * int typeMatchRule,
- * int searchFor,
- * org.eclipse.jdt.core.search.IJavaSearchScope scope,
+ * int typeMatchRule,
+ * int searchFor,
+ * org.eclipse.jdt.core.search.IJavaSearchScope scope,
* IRestrictedAccessTypeRequestor nameRequestor,
* int waitingPolicy,
* org.eclipse.core.runtime.IProgressMonitor monitor) }.
* from API method {@link org.eclipse.jdt.core.search.SearchEngine#searchAllTypeNames(
- * char[] packageName,
- * int packageMatchRule,
+ * char[] packageName,
+ * int packageMatchRule,
* char[] typeName,
- * int matchRule,
- * int searchFor,
- * org.eclipse.jdt.core.search.IJavaSearchScope scope,
+ * int matchRule,
+ * int searchFor,
+ * org.eclipse.jdt.core.search.IJavaSearchScope scope,
* TypeNameRequestor nameRequestor,
* int waitingPolicy,
* org.eclipse.core.runtime.IProgressMonitor monitor) }.
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/UnindexedSearchScope.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/UnindexedSearchScope.java
index 1b6135bac..5fdc740c0 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/UnindexedSearchScope.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/UnindexedSearchScope.java
@@ -26,7 +26,7 @@ import org.eclipse.jdt.core.search.IJavaSearchScope;
public class UnindexedSearchScope extends AbstractSearchScope {
private IJavaSearchScope searchScope;
-
+
private UnindexedSearchScope(IJavaSearchScope scope) {
this.searchScope = scope;
}
@@ -34,7 +34,7 @@ public class UnindexedSearchScope extends AbstractSearchScope {
public static IJavaSearchScope filterEntriesCoveredByTheNewIndex(IJavaSearchScope scope) {
return new UnindexedSearchScope(scope);
}
-
+
@Override
public boolean encloses(String resourcePathString) {
int separatorIndex = resourcePathString.indexOf(JAR_FILE_ENTRY_SEPARATOR);
@@ -76,9 +76,9 @@ public class UnindexedSearchScope extends AbstractSearchScope {
@Override
public IPath[] enclosingProjectsAndJars() {
IPath[] unfiltered = this.searchScope.enclosingProjectsAndJars();
-
+
List<IPath> result = new ArrayList<>();
-
+
for (IPath next : unfiltered) {
if (isJarFile(next.lastSegment())) {
continue;
@@ -92,7 +92,7 @@ public class UnindexedSearchScope extends AbstractSearchScope {
public void processDelta(IJavaElementDelta delta, int eventType) {
if (this.searchScope instanceof AbstractSearchScope) {
AbstractSearchScope inner = (AbstractSearchScope) this.searchScope;
-
+
inner.processDelta(delta, eventType);
}
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AbstractIndexer.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AbstractIndexer.java
index ec01ab497..ce1c3b51f 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AbstractIndexer.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AbstractIndexer.java
@@ -35,7 +35,7 @@ public abstract class AbstractIndexer implements IIndexConstants {
addTypeDeclaration(modifiers, packageName, name, enclosingTypeNames, secondary);
addIndexEntry(
- SUPER_REF,
+ SUPER_REF,
SuperTypeReferencePattern.createIndexKey(
modifiers, packageName, name, enclosingTypeNames, null, ANNOTATION_TYPE_SUFFIX, CharOperation.concatWith(TypeConstants.JAVA_LANG_ANNOTATION_ANNOTATION, '.'), ANNOTATION_TYPE_SUFFIX));
}
@@ -43,11 +43,11 @@ public abstract class AbstractIndexer implements IIndexConstants {
addIndexEntry(ANNOTATION_REF, CharOperation.lastSegment(typeName, '.'));
}
public void addClassDeclaration(
- int modifiers,
+ int modifiers,
char[] packageName,
- char[] name,
- char[][] enclosingTypeNames,
- char[] superclass,
+ char[] name,
+ char[][] enclosingTypeNames,
+ char[] superclass,
char[][] superinterfaces,
//{ObjectTeams: baseclass
char[] baseclass,
@@ -69,13 +69,13 @@ public abstract class AbstractIndexer implements IIndexConstants {
{
//addIndexEntry(TYPE_DECL, TypeDeclarationPattern.createIndexKey(name, packageName, enclosingTypeNames, ROLE_SUFFIX));
addIndexEntry(ROLE_DECL, otCreateTypeIndexKey(modifiers, name, packageName, enclosingTypeNames, secondary));
-
+
}
if (baseclass != null) {
// baseclass cannot be generic, but FIXME(SH): requires anchor translation!
addTypeReference(baseclass);
addIndexEntry(
- SUPER_REF,
+ SUPER_REF,
SuperTypeReferencePattern.createIndexKey(
modifiers, packageName, name, enclosingTypeNames, typeParameterSignatures, CLASS_SUFFIX, baseclass, BASECLASS_SUFFIX));
}
@@ -86,7 +86,7 @@ public abstract class AbstractIndexer implements IIndexConstants {
addTypeReference(superclass);
}
addIndexEntry(
- SUPER_REF,
+ SUPER_REF,
SuperTypeReferencePattern.createIndexKey(
modifiers, packageName, name, enclosingTypeNames, typeParameterSignatures, CLASS_SUFFIX, superclass, CLASS_SUFFIX));
//{ObjectTeams: handle team inheriting from possibly non-team:
@@ -94,7 +94,7 @@ public abstract class AbstractIndexer implements IIndexConstants {
addIndexEntry(
SUPER_REF,
SuperTypeReferencePattern.createIndexKey(
- modifiers, packageName, name, enclosingTypeNames, typeParameterSignatures, CLASS_SUFFIX, ITEAM, INTERFACE_SUFFIX));
+ modifiers, packageName, name, enclosingTypeNames, typeParameterSignatures, CLASS_SUFFIX, ITEAM, INTERFACE_SUFFIX));
// SH}
if (superinterfaces != null) {
for (int i = 0, max = superinterfaces.length; i < max; i++) {
@@ -109,7 +109,7 @@ public abstract class AbstractIndexer implements IIndexConstants {
}
private char[] erasure(char[] typeName) {
int genericStart = CharOperation.indexOf(Signature.C_GENERIC_START, typeName);
- if (genericStart > -1)
+ if (genericStart > -1)
typeName = CharOperation.subarray(typeName, 0, genericStart);
return typeName;
}
@@ -136,7 +136,7 @@ public abstract class AbstractIndexer implements IIndexConstants {
packageName,
typeModifiers,
extraFlags));
-
+
if (parameterTypes != null) {
for (int i = 0; i < argCount; i++)
addTypeReference(parameterTypes[i]);
@@ -164,7 +164,7 @@ public abstract class AbstractIndexer implements IIndexConstants {
addTypeDeclaration(modifiers, packageName, name, enclosingTypeNames, secondary);
addIndexEntry(
- SUPER_REF,
+ SUPER_REF,
SuperTypeReferencePattern.createIndexKey(
modifiers, packageName, name, enclosingTypeNames, null, ENUM_SUFFIX, superclass, CLASS_SUFFIX));
if (superinterfaces != null) {
@@ -177,7 +177,7 @@ public abstract class AbstractIndexer implements IIndexConstants {
modifiers, packageName, name, enclosingTypeNames, null, ENUM_SUFFIX, superinterface, INTERFACE_SUFFIX));
}
}
- }
+ }
public void addFieldDeclaration(char[] typeName, char[] fieldName) {
addIndexEntry(FIELD_DECL, FieldPattern.createIndexKey(fieldName));
addTypeReference(typeName);
@@ -240,7 +240,7 @@ public abstract class AbstractIndexer implements IIndexConstants {
public void addMethodDeclaration(char[] methodName, char[][] parameterTypes, char[] returnType, char[][] exceptionTypes) {
int argCount = parameterTypes == null ? 0 : parameterTypes.length;
addIndexEntry(METHOD_DECL, MethodPattern.createIndexKey(methodName, argCount));
-
+
if (parameterTypes != null) {
for (int i = 0; i < argCount; i++)
addTypeReference(parameterTypes[i]);
@@ -281,13 +281,13 @@ public abstract class AbstractIndexer implements IIndexConstants {
public void addTypeReference(char[] typeName) {
addNameReference(CharOperation.lastSegment(typeName, '.'));
}
-
+
//{OTDTUI:
public void addBaseReference(char[] baseName)
{
addIndexEntry(BASE_REF, baseName);
}
-
+
public void addReferenceToTeamPackage(char[] teamName, char[] roleName)
{
// add two index entries (one with role name, one without). See ReferenceToTeamPackagePattern.getIndexKey()
@@ -303,14 +303,14 @@ public abstract class AbstractIndexer implements IIndexConstants {
* i.e. instead of "type/enclosingTypes/package/C" create a key
* "type/enclosingTypes/package/C/123549"
* 123549 would be the type's modifiers, including AccTeam and AccRole.
- */
+ */
private static char[] otCreateTypeIndexKey(int modifiers, char[] name, char[] packageName, char[][] enclosingTypeNames, boolean secondary)
// int modifiers, char[] typeName, char[] packageName, char[][] enclosingTypeNames, boolean secondary) { //, char typeSuffix) {
{
// km: merge: modified signature
// orig: char[] indexKey = TypeDeclarationPattern.createIndexKey(name, packageName, enclosingTypeNames, class_suffix);
char[] indexKey = TypeDeclarationPattern.createIndexKey(modifiers, name, packageName, enclosingTypeNames, secondary);
-
+
String modifierString = String.valueOf(modifiers);
char [] otIndexKey = new char[indexKey.length + 1 + modifierString.length()];
System.arraycopy(indexKey, 0, otIndexKey, 0, indexKey.length);
@@ -320,7 +320,7 @@ public abstract class AbstractIndexer implements IIndexConstants {
return otIndexKey;
}
//carp}
-
+
public abstract void indexDocument();
public void indexResolvedDocument() {
// subtypes should implement where it makes sense.
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AddJarFileToIndex.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AddJarFileToIndex.java
index aa6f0e53d..ea722725c 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AddJarFileToIndex.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AddJarFileToIndex.java
@@ -92,7 +92,7 @@ class AddJarFileToIndex extends BinaryContainer {
if (hasPreBuiltIndex()) {
boolean added = this.manager.addIndex(this.containerPath, this.indexFileURL);
- if (added) return true;
+ if (added) return true;
this.indexFileURL = null;
}
@@ -235,7 +235,7 @@ class AddJarFileToIndex extends BinaryContainer {
// iterate each entry to index it
ZipEntry ze = (ZipEntry) e.nextElement();
String zipEntryName = ze.getName();
- if (Util.isClassFileName(zipEntryName) &&
+ if (Util.isClassFileName(zipEntryName) &&
isValidPackageNameForClassOrisModule(zipEntryName)) {
hasModuleInfoClass |= zipEntryName.contains(TypeConstants.MODULE_INFO_NAME_STRING);
// index only classes coming from valid packages - https://bugs.eclipse.org/bugs/show_bug.cgi?id=293861
@@ -293,7 +293,7 @@ class AddJarFileToIndex extends BinaryContainer {
if (this.resource != null)
return super.getJobFamily();
return this.containerPath.toOSString(); // external jar
- }
+ }
@Override
protected Integer updatedIndexState() {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AddJrtToIndex.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AddJrtToIndex.java
index baa8c67cc..6401cbc20 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AddJrtToIndex.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AddJrtToIndex.java
@@ -43,7 +43,7 @@ public class AddJrtToIndex extends BinaryContainer {
private IndexLocation indexFileURL;
private final boolean forceIndexUpdate;
static final char JAR_SEPARATOR = IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR.charAt(0);
-
+
enum FILE_INDEX_STATE {
EXISTS,
DELETED
@@ -79,9 +79,9 @@ public class AddJrtToIndex extends BinaryContainer {
return this.containerPath.hashCode();
return -1;
}
-
+
private class JrtTraverser implements org.eclipse.jdt.internal.compiler.util.JRTUtil.JrtFileVisitor<java.nio.file.Path> {
-
+
SimpleLookupTable indexedFileNames;
public JrtTraverser() {
}
@@ -99,7 +99,7 @@ public class AddJrtToIndex extends BinaryContainer {
public FileVisitResult visitFile(java.nio.file.Path path, java.nio.file.Path mod, BasicFileAttributes attrs)
throws IOException {
String name = JRTUtil.sanitizedFileName(path);
- if (Util.isClassFileName(name) &&
+ if (Util.isClassFileName(name) &&
isValidPackageNameForClassOrisModule(name)) {
this.indexedFileNames.put(name, FILE_INDEX_STATE.EXISTS);
}
@@ -110,7 +110,7 @@ public class AddJrtToIndex extends BinaryContainer {
return FileVisitResult.CONTINUE;
}
}
-
+
private class JrtIndexer extends JrtTraverser {
final SearchParticipant participant;
final IPath indexPath;
@@ -133,7 +133,7 @@ public class AddJrtToIndex extends BinaryContainer {
public FileVisitResult visitFile(java.nio.file.Path path, java.nio.file.Path mod, BasicFileAttributes attrs)
throws IOException {
String name = JRTUtil.sanitizedFileName(path);
- if (Util.isClassFileName(name) &&
+ if (Util.isClassFileName(name) &&
isValidPackageNameForClassOrisModule(name)) {
try {
String fullPath = path.toString();
@@ -157,7 +157,7 @@ public class AddJrtToIndex extends BinaryContainer {
if (hasPreBuiltIndex()) {
boolean added = this.manager.addIndex(this.containerPath, this.indexFileURL);
- if (added) return true;
+ if (added) return true;
this.indexFileURL = null;
}
@@ -211,7 +211,7 @@ public class AddJrtToIndex extends BinaryContainer {
container = this.resource.getFullPath().makeRelative();
// absolute path relative to the workspace
} else {
-
+
fileName = this.containerPath.toOSString();
container = this.containerPath;
}
@@ -228,12 +228,12 @@ public class AddJrtToIndex extends BinaryContainer {
* If not, then we want to check that there is no missing entry, if
* one entry is missing then we recreate the index
*/
-
+
final SimpleLookupTable indexedFileNames = new SimpleLookupTable(max == 0 ? 33 : max + 11);
for (int i = 0; i < max; i++)
indexedFileNames.put(paths[i], FILE_INDEX_STATE.DELETED);
-
- org.eclipse.jdt.internal.compiler.util.JRTUtil.walkModuleImage(new File(fileName),
+
+ org.eclipse.jdt.internal.compiler.util.JRTUtil.walkModuleImage(new File(fileName),
new JrtTraverser(indexedFileNames), JRTUtil.NOTIFY_FILES);
boolean needToReindex = indexedFileNames.elementSize != max; // a new file was added
@@ -263,9 +263,9 @@ public class AddJrtToIndex extends BinaryContainer {
this.manager.removeIndex(this.containerPath);
return false;
}
-
+
File jrt = new File(fileName);
- org.eclipse.jdt.internal.compiler.util.JRTUtil.walkModuleImage(jrt,
+ org.eclipse.jdt.internal.compiler.util.JRTUtil.walkModuleImage(jrt,
new JrtIndexer(jrt, SearchEngine.getDefaultSearchParticipant(), index, container, this.manager), JRTUtil.NOTIFY_FILES);
if(this.forceIndexUpdate) {
@@ -296,7 +296,7 @@ public class AddJrtToIndex extends BinaryContainer {
if (this.resource != null)
return super.getJobFamily();
return this.containerPath.toOSString(); // external jar
- }
+ }
@Override
protected Integer updatedIndexState() {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/BinaryContainer.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/BinaryContainer.java
index 44ccb0b0b..882f87980 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/BinaryContainer.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/BinaryContainer.java
@@ -29,7 +29,7 @@ public abstract class BinaryContainer extends IndexRequest {
private boolean isIdentifier() throws InvalidInputException {
switch(this.scanner.scanIdentifier()) {
- // assert and enum will not be recognized as java identifiers
+ // assert and enum will not be recognized as java identifiers
// in 1.7 mode, which are in 1.3.
case TerminalTokens.TokenNameIdentifier:
case TerminalTokens.TokenNameassert:
@@ -40,7 +40,7 @@ public abstract class BinaryContainer extends IndexRequest {
}
}
protected boolean isValidPackageNameForClassOrisModule(String className) {
- if (className.substring(0, className.length() - (SuffixConstants.SUFFIX_CLASS.length)).equals(new String(IIndexConstants.MODULE_INFO)))
+ if (className.substring(0, className.length() - (SuffixConstants.SUFFIX_CLASS.length)).equals(new String(IIndexConstants.MODULE_INFO)))
return true;
char[] classNameArray = className.toCharArray();
// use 1.7 as the source level as there are more valid identifiers in 1.7 mode
@@ -48,8 +48,8 @@ public abstract class BinaryContainer extends IndexRequest {
if (this.scanner == null)
this.scanner = new Scanner(false /* comment */, true /* whitespace */, false /* nls */,
ClassFileConstants.JDK1_7/* sourceLevel */, null/* taskTag */, null/* taskPriorities */, true /* taskCaseSensitive */);
-
- this.scanner.setSource(classNameArray);
+
+ this.scanner.setSource(classNameArray);
this.scanner.eofPosition = classNameArray.length - SuffixConstants.SUFFIX_CLASS.length;
try {
if (isIdentifier()) {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/BinaryIndexer.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/BinaryIndexer.java
index 2ef37cd6d..dc7bc9c0f 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/BinaryIndexer.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/BinaryIndexer.java
@@ -274,32 +274,32 @@ public class BinaryIndexer extends AbstractIndexer implements SuffixConstants {
if (arrayDim > 0)
return convertToArrayType(BYTE, arrayDim);
return BYTE;
-
+
case 'C':
if (arrayDim > 0)
return convertToArrayType(CHAR, arrayDim);
return CHAR;
-
+
case 'D':
if (arrayDim > 0)
return convertToArrayType(DOUBLE, arrayDim);
return DOUBLE;
-
+
case 'F':
if (arrayDim > 0)
return convertToArrayType(FLOAT, arrayDim);
return FLOAT;
-
+
case 'I':
if (arrayDim > 0)
return convertToArrayType(INT, arrayDim);
return INT;
-
+
case 'J':
if (arrayDim > 0)
return convertToArrayType(LONG, arrayDim);
return LONG;
-
+
case 'L':
int indexOfSemiColon = CharOperation.indexOf(';', signature, i+1);
if (indexOfSemiColon == -1) throw new ClassFormatException(ClassFormatException.ErrInvalidMethodSignature);
@@ -307,24 +307,24 @@ public class BinaryIndexer extends AbstractIndexer implements SuffixConstants {
return convertToArrayType(replace('/','.',CharOperation.subarray(signature, i + 1, indexOfSemiColon)), arrayDim);
}
return replace('/','.',CharOperation.subarray(signature, i + 1, indexOfSemiColon));
-
+
case 'S':
if (arrayDim > 0)
return convertToArrayType(SHORT, arrayDim);
return SHORT;
-
+
case 'Z':
if (arrayDim > 0)
return convertToArrayType(BOOLEAN, arrayDim);
return BOOLEAN;
-
+
case 'V':
return VOID;
-
+
case '[':
arrayDim++;
break;
-
+
default:
throw new ClassFormatException(ClassFormatException.ErrInvalidMethodSignature);
}
@@ -361,7 +361,7 @@ public class BinaryIndexer extends AbstractIndexer implements SuffixConstants {
convertToArrayType(parameterTypes, parameterTypesCounter-1, arrayDim);
arrayDim = 0;
break;
-
+
case 'C':
parameterTypes[parameterTypesCounter++] = CHAR;
if (arrayDim > 0)
@@ -382,14 +382,14 @@ public class BinaryIndexer extends AbstractIndexer implements SuffixConstants {
convertToArrayType(parameterTypes, parameterTypesCounter-1, arrayDim);
arrayDim = 0;
break;
-
+
case 'I':
parameterTypes[parameterTypesCounter++] = INT;
if (arrayDim > 0)
convertToArrayType(parameterTypes, parameterTypesCounter-1, arrayDim);
arrayDim = 0;
break;
-
+
case 'J':
parameterTypes[parameterTypesCounter++] = LONG;
if (arrayDim > 0)
@@ -429,7 +429,7 @@ public class BinaryIndexer extends AbstractIndexer implements SuffixConstants {
case '[':
arrayDim++;
break;
-
+
default:
throw new ClassFormatException(ClassFormatException.ErrInvalidMethodSignature);
}
@@ -450,12 +450,12 @@ public class BinaryIndexer extends AbstractIndexer implements SuffixConstants {
if (arrayDim > 0)
return convertToArrayType(BYTE, arrayDim);
return BYTE;
-
+
case 'C':
if (arrayDim > 0)
return convertToArrayType(CHAR, arrayDim);
return CHAR;
-
+
case 'D':
if (arrayDim > 0)
return convertToArrayType(DOUBLE, arrayDim);
@@ -500,7 +500,7 @@ public class BinaryIndexer extends AbstractIndexer implements SuffixConstants {
case '[':
arrayDim++;
break;
-
+
default:
throw new ClassFormatException(ClassFormatException.ErrInvalidMethodSignature);
}
@@ -634,7 +634,7 @@ public class BinaryIndexer extends AbstractIndexer implements SuffixConstants {
break; // skip over array references
name = replace('/', '.', name); // so that it looks like java.lang.String
addTypeReference(name);
-
+
// also add a simple reference on each segment of the qualification (see http://bugs.eclipse.org/bugs/show_bug.cgi?id=24741)
char[][] qualification = CharOperation.splitOn('.', name);
for (int j = 0, length = qualification.length; j < length; j++) {
@@ -658,13 +658,13 @@ public class BinaryIndexer extends AbstractIndexer implements SuffixConstants {
if (contents == null) return;
final String path = this.document.getPath();
ClassFileReader reader = new ClassFileReader(contents, path == null ? null : path.toCharArray());
-
+
IModule module = reader.getModuleDeclaration();
if (module != null) {
indexModule(module);
return;
}
-
+
// first add type references
char[] className = replace('/', '.', reader.getName()); // looks like java/lang/String
// need to extract the package name and the simple name
@@ -696,7 +696,7 @@ public class BinaryIndexer extends AbstractIndexer implements SuffixConstants {
// See PR 1GIR345: ITPJCORE:ALL - Indexer: NegativeArraySizeException
return;
}
- enclosingTypeName = new char[nameLength];
+ enclosingTypeName = new char[nameLength];
System.arraycopy(fullEnclosingName, packageNameIndex + 1, enclosingTypeName, 0, nameLength);
}
}
@@ -707,10 +707,10 @@ public class BinaryIndexer extends AbstractIndexer implements SuffixConstants {
CharOperation.replace(genericSignature, '/', '.');
typeParameterSignatures = Signature.getTypeParameters(genericSignature);
}
-
+
// eliminate invalid innerclasses (1G4KCF7)
if (name == null) return;
-
+
char[][] superinterfaces = replace('/', '.', reader.getInterfaceNames());
char[][] enclosingTypeNames = enclosingTypeName == null ? null : new char[][] {enclosingTypeName};
int modifiers = reader.getModifiers();
@@ -746,7 +746,7 @@ public class BinaryIndexer extends AbstractIndexer implements SuffixConstants {
addClassDeclaration(modifiers, packageName, name, enclosingTypeNames, superclass, superinterfaces, null, typeParameterSignatures, false);
// SH}
break;
- }
+ }
// Look for references in class annotations
IBinaryAnnotation[] annotations = reader.getAnnotations();
@@ -787,7 +787,7 @@ public class BinaryIndexer extends AbstractIndexer implements SuffixConstants {
addConstructorDeclaration(
name,
parameterTypes == null ? 0 : parameterTypes.length,
- signature,
+ signature,
parameterTypes,
method.getArgumentNames(),
method.getModifiers(),
@@ -809,7 +809,7 @@ public class BinaryIndexer extends AbstractIndexer implements SuffixConstants {
null,
selector,
parameterTypes == null ? 0 : parameterTypes.length,
- signature,
+ signature,
parameterTypes,
method.getArgumentNames(),
returnType,
@@ -872,7 +872,7 @@ public class BinaryIndexer extends AbstractIndexer implements SuffixConstants {
e));
}
}
-
+
private void indexModule(IModule module) {
addModuleDeclaration(module.name());
IModuleReference[] requiredModules = module.requires();
@@ -922,7 +922,7 @@ public class BinaryIndexer extends AbstractIndexer implements SuffixConstants {
return;
addTypeReference(ref);
}
-
+
private char[] removeFirstSyntheticParameter(char[] descriptor) {
if (descriptor == null) return null;
if (descriptor.length < 3) return descriptor;
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/DefaultJavaIndexer.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/DefaultJavaIndexer.java
index 8fdf25416..f298e3083 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/DefaultJavaIndexer.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/DefaultJavaIndexer.java
@@ -33,7 +33,7 @@ import org.eclipse.jdt.internal.core.search.JavaSearchDocument;
@SuppressWarnings("rawtypes")
public class DefaultJavaIndexer {
private static final char JAR_SEPARATOR = IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR.charAt(0);
-
+
public void generateIndexForJar(String pathToJar, String pathToIndexFile) throws IOException {
File f = new File(pathToJar);
if (!f.exists()) {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IIndexConstants.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IIndexConstants.java
index cb8a8b08d..f5a9e30b5 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IIndexConstants.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IIndexConstants.java
@@ -46,7 +46,7 @@ public interface IIndexConstants {
char[] ITEAM = "org.objectteams.ITeam".toCharArray(); //$NON-NLS-1$
//Andreas Kaiser}
- char[][] COUNTS=
+ char[][] COUNTS=
new char[][] { new char[] {'/', '0'}, new char[] {'/', '1'}, new char[] {'/', '2'}, new char[] {'/', '3'}, new char[] {'/', '4'},
new char[] {'/', '5'}, new char[] {'/', '6'}, new char[] {'/', '7'}, new char[] {'/', '8'}, new char[] {'/', '9'}
};
@@ -75,8 +75,8 @@ public interface IIndexConstants {
char[][] ONE_STAR_CHAR = new char[][] {ONE_STAR};
// used as special marker for enclosing type name of local and anonymous classes
- char ZERO_CHAR = '0';
- char[] ONE_ZERO = new char[] { ZERO_CHAR };
+ char ZERO_CHAR = '0';
+ char[] ONE_ZERO = new char[] { ZERO_CHAR };
char[][] ONE_ZERO_CHAR = new char[][] {ONE_ZERO};
int PKG_REF_PATTERN = 0x0001;
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexAllProject.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexAllProject.java
index ffa90a9c7..a9417fdcb 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexAllProject.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexAllProject.java
@@ -61,7 +61,7 @@ public class IndexAllProject extends IndexRequest {
if (this.isCancelled || progressMonitor != null && progressMonitor.isCanceled()) return true;
if (!this.project.isAccessible()) return true; // nothing to do
-
+
ReadWriteMonitor monitor = null;
try {
// Get source folder entries. Libraries are done as a separate job
@@ -96,12 +96,12 @@ public class IndexAllProject extends IndexRequest {
}
if (sourceEntriesNumber != length)
System.arraycopy(sourceEntries, 0, sourceEntries = new IClasspathEntry[sourceEntriesNumber], 0, sourceEntriesNumber);
-
+
Index index = this.manager.getIndexForUpdate(this.containerPath, true, /*reuse index file*/ true /*create if none*/);
if (index == null) return true;
monitor = index.monitor;
if (monitor == null) return true; // index got deleted since acquired
-
+
monitor.enterRead(); // ask permission to read
String[] paths = index.queryDocumentNames(""); // all file names //$NON-NLS-1$
@@ -122,7 +122,7 @@ public class IndexAllProject extends IndexRequest {
IClasspathEntry entry = sourceEntries[i];
IResource sourceFolder = root.findMember(entry.getPath());
if (sourceFolder != null) {
-
+
// collect output locations if source is project (see http://bugs.eclipse.org/bugs/show_bug.cgi?id=32041)
final HashSet outputs = new HashSet();
if (sourceFolder.getType() == IResource.PROJECT) {
@@ -136,7 +136,7 @@ public class IndexAllProject extends IndexRequest {
}
}
final boolean hasOutputs = !outputs.isEmpty();
-
+
final char[][] inclusionPatterns = ((ClasspathEntry) entry).fullInclusionPatternChars();
final char[][] exclusionPatterns = ((ClasspathEntry) entry).fullExclusionPatternChars();
if (max == 0) {
@@ -158,7 +158,7 @@ public class IndexAllProject extends IndexRequest {
case IResource.FOLDER :
if (exclusionPatterns != null && inclusionPatterns == null) {
// if there are inclusion patterns then we must walk the children
- if (Util.isExcluded(proxy.requestFullPath(), inclusionPatterns, exclusionPatterns, true))
+ if (Util.isExcluded(proxy.requestFullPath(), inclusionPatterns, exclusionPatterns, true))
return false;
}
if (hasOutputs && outputs.contains(proxy.requestFullPath()))
@@ -186,7 +186,7 @@ public class IndexAllProject extends IndexRequest {
return false;
String relativePathString = Util.relativePath(file.getFullPath(), 1/*remove project segment*/);
indexedFileNames.put(relativePathString,
- indexedFileNames.get(relativePathString) == null
+ indexedFileNames.get(relativePathString) == null
|| indexLastModified < EFS.getStore(location).fetchInfo().getLastModified()
? (Object) file
: (Object) OK);
@@ -207,7 +207,7 @@ public class IndexAllProject extends IndexRequest {
}
}
}
-
+
SourceElementParser parser = this.manager.getSourceElementParser(javaProject, null/*requestor will be set by indexer*/);
Object[] names = indexedFileNames.keyTable;
Object[] values = indexedFileNames.valueTable;
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexBinaryFolder.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexBinaryFolder.java
index 88b80cd13..7e5633a0e 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexBinaryFolder.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexBinaryFolder.java
@@ -99,8 +99,8 @@ public class IndexBinaryFolder extends IndexRequest {
if (location != null) {
String containerRelativePath = Util.relativePath(file.getFullPath(), IndexBinaryFolder.this.containerPath.segmentCount());
indexedFileNames.put(containerRelativePath,
- indexedFileNames.get(containerRelativePath) == null
- || indexLastModified <
+ indexedFileNames.get(containerRelativePath) == null
+ || indexLastModified <
EFS.getStore(location).fetchInfo().getLastModified()
? (Object) file
: (Object) OK);
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexManager.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexManager.java
index 8d61692cb..41efb7e1e 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexManager.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexManager.java
@@ -93,7 +93,7 @@ public class IndexManager extends JobManager implements IIndexConstants {
public static final Integer REBUILDING_STATE = 3;
public static final Integer REUSE_STATE = 4;
- private final IndexNamesRegistry nameRegistry = new IndexNamesRegistry(new File(getSavedIndexesDirectory(),
+ private final IndexNamesRegistry nameRegistry = new IndexNamesRegistry(new File(getSavedIndexesDirectory(),
"savedIndexNames.txt"), getJavaPluginWorkingLocation()); //$NON-NLS-1$
// search participants who register indexes with the index manager
private SimpleLookupTable participantsContainers = null;
@@ -472,8 +472,8 @@ private SimpleLookupTable getIndexStates() {
}
}
} else {
- // All the index files are getting deleted and hence there is no need to
- // further check for change in javaLikeNames.
+ // All the index files are getting deleted and hence there is no need to
+ // further check for change in javaLikeNames.
writeJavaLikeNamesFile();
this.javaLikeNamesChanged = false;
deleteIndexFiles();
@@ -499,12 +499,12 @@ private File getSavedIndexesDirectory() {
/*
* see https://bugs.eclipse.org/bugs/show_bug.cgi?id=286379
* Returns true if there is a change in javaLikeNames since it
- * has been last stored.
- * The javaLikeNames stored in the file javaLikeNames.txt
- * is compared with the current javaLikeNames and if there is a change, this
- * function returns true. If the file javaLikeNames.txt doesn't exist and there
- * is only one javaLikeName (.java), then this returns false so that no-reindexing
- * happens.
+ * has been last stored.
+ * The javaLikeNames stored in the file javaLikeNames.txt
+ * is compared with the current javaLikeNames and if there is a change, this
+ * function returns true. If the file javaLikeNames.txt doesn't exist and there
+ * is only one javaLikeName (.java), then this returns false so that no-reindexing
+ * happens.
*/
private boolean hasJavaLikeNamesChanged() {
char[][] currentNames = Util.getJavaLikeExtensions();
@@ -522,12 +522,12 @@ private boolean hasJavaLikeNamesChanged() {
return true;
}
if (current > 1) {
- // Sort the current java like names.
+ // Sort the current java like names.
// Copy the array to avoid modifying the Util static variable
System.arraycopy(currentNames, 0, currentNames = new char[current][], 0, current);
Util.sort(currentNames);
}
-
+
// The JavaLikeNames would have been sorted before getting stored in the file,
// hence just do a direct compare.
for (int i = 0; i < current; i++) {
@@ -550,12 +550,12 @@ public void indexDocument(SearchDocument searchDocument, SearchParticipant searc
public void indexResolvedDocument(SearchDocument searchDocument, SearchParticipant searchParticipant, Index index, IPath indexLocation) {
searchParticipant.resolveDocument(searchDocument);
ReadWriteMonitor monitor = index.monitor;
- if (monitor == null)
+ if (monitor == null)
return; // index got deleted since acquired
try {
monitor.enterWrite(); // ask permission to write
searchDocument.setIndex(index);
- searchParticipant.indexResolvedDocument(searchDocument, indexLocation);
+ searchParticipant.indexResolvedDocument(searchDocument, indexLocation);
} finally {
searchDocument.setIndex(null);
monitor.exitWrite();
@@ -640,7 +640,7 @@ public void indexLibrary(IPath path, IProject requestingProject, URL indexURL, f
IndexRequest request = null;
Object target = JavaModel.getTarget(path, true);
if (target instanceof IFile) {
- request = isJrt(((IFile) target).getFullPath().toOSString()) ?
+ request = isJrt(((IFile) target).getFullPath().toOSString()) ?
new AddJrtToIndex((IFile) target, indexFile, this, forceIndexUpdate) :
new AddJarFileToIndex((IFile) target, indexFile, this, forceIndexUpdate);
} else if (target instanceof File) {
@@ -719,7 +719,7 @@ public String processName(){
}
private char[][] readJavaLikeNamesFile() {
try {
- String pathName = getJavaPluginWorkingLocation().toOSString();
+ String pathName = getJavaPluginWorkingLocation().toOSString();
File javaLikeNamesFile = new File(pathName, "javaLikeNames.txt"); //$NON-NLS-1$
if (!javaLikeNamesFile.exists())
return null;
@@ -755,7 +755,7 @@ private void rebuildIndex(IndexLocation indexLocation, IPath containerPath, fina
} else if (target instanceof IFolder) {
request = new IndexBinaryFolder((IFolder) target, this);
} else if (target instanceof IFile) {
- request = isJrt(((IFile) target).getFullPath().toOSString()) ?
+ request = isJrt(((IFile) target).getFullPath().toOSString()) ?
new AddJrtToIndex((IFile) target, null, this, updateIndex) :
new AddJarFileToIndex((IFile) target, null, this, updateIndex);
} else if (target instanceof File) {
@@ -1121,7 +1121,7 @@ private void readIndexMap() {
this.indexLocations.put(new Path(new String(names[i+1])), indexPath );
this.indexStates.put(indexPath, REUSE_STATE);
}
- }
+ }
}
} catch (IOException ignored) {
if (VERBOSE)
@@ -1137,14 +1137,14 @@ private void readParticipantsIndexNamesFile() {
char[][] names = CharOperation.splitOn('\n', participantIndexNames);
if (names.length >= 3) {
// First line is DiskIndex signature (see writeParticipantsIndexNamesFile())
- if (DiskIndex.SIGNATURE.equals(new String(names[0]))) {
+ if (DiskIndex.SIGNATURE.equals(new String(names[0]))) {
for (int i = 1, l = names.length-1 ; i < l ; i+=2) {
IndexLocation indexLocation = new FileIndexLocation(new File(new String(names[i])), true);
containers.put(indexLocation, new Path(new String(names[i+1])));
}
- }
+ }
}
- }
+ }
} catch (IOException ignored) {
if (VERBOSE)
Util.verbose("Failed to read participant index file names"); //$NON-NLS-1$
@@ -1213,11 +1213,11 @@ public void updateParticipant(IPath indexPath, IPath containerPath) {
private void writeJavaLikeNamesFile() {
BufferedWriter writer = null;
String pathName = getJavaPluginWorkingLocation().toOSString();
- try {
+ try {
char[][] currentNames = Util.getJavaLikeExtensions();
int length = currentNames.length;
if (length > 1) {
- // Sort the current java like names.
+ // Sort the current java like names.
// Copy the array to avoid modifying the Util static variable
System.arraycopy(currentNames, 0, currentNames=new char[length][], 0, length);
Util.sort(currentNames);
@@ -1228,9 +1228,9 @@ private void writeJavaLikeNamesFile() {
writer.write(currentNames[i]);
writer.write('\n');
}
- if (length > 0)
+ if (length > 0)
writer.write(currentNames[length-1]);
-
+
} catch (IOException ignored) {
if (VERBOSE)
Util.verbose("Failed to write javaLikeNames file", System.err); //$NON-NLS-1$
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexNamesRegistry.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexNamesRegistry.java
index e9ec3562d..69eced365 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexNamesRegistry.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexNamesRegistry.java
@@ -100,7 +100,7 @@ public class IndexNamesRegistry {
}
subMonitor.setWorkRemaining(newContents.length);
-
+
try (BufferedWriter writer = new BufferedWriter(new FileWriter(this.savedIndexNamesFile))) {
writer.write(DiskIndex.SIGNATURE);
writer.write('+');
@@ -136,6 +136,6 @@ public class IndexNamesRegistry {
synchronized (this.queueMutex) {
this.pendingWrite = null;
}
- this.savedIndexNamesFile.delete();
+ this.savedIndexNamesFile.delete();
}
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexingParser.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexingParser.java
index be326c20b..46f5f2228 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexingParser.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexingParser.java
@@ -35,7 +35,7 @@ public class IndexingParser extends SourceElementParser {
super(requestor, problemFactory, options, reportLocalDeclarations,
optimizeStringLiterals, useSourceJavadocParser);
}
-
+
@Override
protected ImportReference newImportReference(char[][] tokens, long[] sourcePositions, boolean onDemand, int mod) {
ImportReference ref = this.importReference;
@@ -58,7 +58,7 @@ public class IndexingParser extends SourceElementParser {
ref.sourceEnd = (int) positions;
return ref;
}
-
+
@Override
protected QualifiedNameReference newQualifiedNameReference(char[][] tokens, long[] positions, int sourceStart, int sourceEnd) {
QualifiedNameReference ref = this.qualifiedNameReference;
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/SourceIndexer.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/SourceIndexer.java
index d9d68c071..cc7141a44 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/SourceIndexer.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/SourceIndexer.java
@@ -84,7 +84,7 @@ public class SourceIndexer extends AbstractIndexer implements ITypeRequestor, Su
private CompilationUnit compilationUnit;
private CompilationUnitDeclaration cud;
private static final boolean DEBUG = false;
-
+
public SourceIndexer(SearchDocument document) {
super(document);
this.requestor = new SourceIndexerRequestor(this);
@@ -109,7 +109,7 @@ public class SourceIndexer extends AbstractIndexer implements ITypeRequestor, Su
} else {
parser.setRequestor(this.requestor);
}
-
+
// Launch the parser
char[] source = null;
char[] name = null;
@@ -130,7 +130,7 @@ public class SourceIndexer extends AbstractIndexer implements ITypeRequestor, Su
}
}
}
-
+
@Override
public void accept(IBinaryType binaryType, PackageBinding packageBinding, AccessRestriction accessRestriction) {
this.lookupEnvironment.createBinaryTypeFrom(binaryType, packageBinding, accessRestriction);
@@ -152,9 +152,9 @@ public class SourceIndexer extends AbstractIndexer implements ITypeRequestor, Su
SourceTypeElementInfo elementInfo = (SourceTypeElementInfo) sourceType;
IType type = elementInfo.getHandle();
ICompilationUnit sourceUnit = (ICompilationUnit) type.getCompilationUnit();
- accept(sourceUnit, accessRestriction);
+ accept(sourceUnit, accessRestriction);
}
-
+
public void resolveDocument() {
try {
IPath path = new Path(this.document.getPath());
@@ -236,11 +236,11 @@ public class SourceIndexer extends AbstractIndexer implements ITypeRequestor, Su
if (lambdaExpression.binding != null && lambdaExpression.binding.isValidBinding()) {
final char[] superinterface = lambdaExpression.resolvedType.sourceName();
if (DEBUG) {
- System.out.println('\t' + new String(superinterface) + '.' +
+ System.out.println('\t' + new String(superinterface) + '.' +
new String(lambdaExpression.descriptor.selector) + "-> {}"); //$NON-NLS-1$
}
SourceIndexer.this.addIndexEntry(IIndexConstants.METHOD_DECL, MethodPattern.createIndexKey(lambdaExpression.descriptor.selector, lambdaExpression.descriptor.parameters.length));
-
+
addClassDeclaration(0, // most entries are blank, that is fine, since lambda type/method cannot be searched.
CharOperation.NO_CHAR, // package name
ONE_ZERO,
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/SourceIndexerRequestor.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/SourceIndexerRequestor.java
index 3cb86c1b3..da3cb4a44 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/SourceIndexerRequestor.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/SourceIndexerRequestor.java
@@ -41,7 +41,7 @@ public class SourceIndexerRequestor implements ISourceElementRequestor, IIndexCo
char[][] enclosingTypeNames = new char[5][];
int depth = 0;
int methodDepth = 0;
-
+
public SourceIndexerRequestor(SourceIndexer indexer) {
this.indexer = indexer;
}
@@ -165,7 +165,7 @@ public void acceptUnknownReference(char[] name, int sourcePosition) {
private void addDefaultConstructorIfNecessary(TypeInfo typeInfo) {
boolean hasConstructor = false;
-
+
TypeDeclaration typeDeclaration = typeInfo.node;
AbstractMethodDeclaration[] methods = typeDeclaration.methods;
int methodCounter = methods == null ? 0 : methods.length;
@@ -176,7 +176,7 @@ private void addDefaultConstructorIfNecessary(TypeInfo typeInfo) {
break done;
}
}
-
+
if (!hasConstructor) {
this.indexer.addDefaultConstructorDeclaration(
typeInfo.name,
@@ -222,7 +222,7 @@ private void enterClass(TypeInfo typeInfo) {
// eliminate possible qualifications, given they need to be fully resolved again
if (typeInfo.superclass != null) {
typeInfo.superclass = getSimpleName(typeInfo.superclass);
-
+
// add implicit constructor reference to default constructor
this.indexer.addConstructorReference(typeInfo.superclass, 0);
}
@@ -292,7 +292,7 @@ private void enterEnum(TypeInfo typeInfo) {
for (int i = 0, length = typeInfo.superinterfaces.length; i < length; i++){
typeInfo.superinterfaces[i] = getSimpleName(typeInfo.superinterfaces[i]);
}
- }
+ }
char[][] typeNames;
if (this.methodDepth > 0) {
typeNames = ONE_ZERO_CHAR;
@@ -325,7 +325,7 @@ private void enterInterface(TypeInfo typeInfo) {
for (int i = 0, length = typeInfo.superinterfaces.length; i < length; i++){
typeInfo.superinterfaces[i] = getSimpleName(typeInfo.superinterfaces[i]);
}
- }
+ }
char[][] typeNames;
if (this.methodDepth > 0) {
typeNames = ONE_ZERO_CHAR;
@@ -356,7 +356,7 @@ public void enterModule(ModuleInfo moduleInfo) {
}
}
enterPackageVisibilityInfo(moduleInfo.exports);
- enterPackageVisibilityInfo(moduleInfo.opens);
+ enterPackageVisibilityInfo(moduleInfo.opens);
/* note: provides and uses directives processed automatically on IParser (SEParser) */
}
private void enterPackageVisibilityInfo(ISourceElementRequestor.PackageExportInfo[] packInfos) {
@@ -418,7 +418,7 @@ private static char[] getDeclaringQualification(TypeDeclaration typeDecl) {
int l = nlist.size();
if (l == 1) return name;
-
+
name = new char[size];
int index = 0;
for (int i = 0; i < l - 1; ++i) {
@@ -441,13 +441,13 @@ public void enterType(TypeInfo typeInfo) {
case TypeDeclaration.CLASS_DECL:
enterClass(typeInfo);
break;
- case TypeDeclaration.ANNOTATION_TYPE_DECL:
+ case TypeDeclaration.ANNOTATION_TYPE_DECL:
enterAnnotationType(typeInfo);
break;
case TypeDeclaration.INTERFACE_DECL:
enterInterface(typeInfo);
break;
- case TypeDeclaration.ENUM_DECL:
+ case TypeDeclaration.ENUM_DECL:
enterEnum(typeInfo);
break;
case TypeDeclaration.RECORD_DECL:
@@ -571,18 +571,18 @@ private void enterOTTypeInfo(char[] name, boolean isRoleFile) {
public void enterCalloutMapping(CalloutInfo calloutInfo)
{
// TODO(SH): try to use new flag isDeclaration to decide what to do.
-
+
// NOTE(jsv): if method specs without signature are used, we use Integer.MAX_VALUE to mark these methodSpecs
- // NOTE(jsv): left methodSpec in a calloutMapping semantically represents a method declaration.
+ // NOTE(jsv): left methodSpec in a calloutMapping semantically represents a method declaration.
// To guarantee consistency with MatchLocator we use methodRef category for all methodSpecs
// TODO(jsv): use methodDecl category for role methodSpec in a callout mapping -> also change MathchLocator (method declaration should be reported (implementation for TPX-260 is needed!!))
// orig
//this.indexer.addMethodDeclaration(leftSelector, leftParameterTypes, leftReturnType, null);
-
- int argCount= calloutInfo.left.parameterNames != null ? calloutInfo.left.parameterNames.length : Integer.MAX_VALUE;
+
+ int argCount= calloutInfo.left.parameterNames != null ? calloutInfo.left.parameterNames.length : Integer.MAX_VALUE;
this.indexer.addMethodReference(calloutInfo.left.selector, argCount);
-
- argCount = calloutInfo.right.parameterNames != null ? calloutInfo.right.parameterNames.length : Integer.MAX_VALUE;
+
+ argCount = calloutInfo.right.parameterNames != null ? calloutInfo.right.parameterNames.length : Integer.MAX_VALUE;
this.indexer.addMethodReference(calloutInfo.right.selector, argCount);
}
//must add right selector as field reference to indexer in case of callout to field
@@ -591,7 +591,7 @@ public void enterCalloutToFieldMapping(CalloutToFieldInfo calloutInfo)
{
// TODO(SH): use new argument isDeclaration to decide what to do with left hand side.
// TODO(SH): should new argument isSetter be evaluated?
- int argCount = calloutInfo.left.parameterNames != null ? calloutInfo.left.parameterNames.length : Integer.MAX_VALUE;
+ int argCount = calloutInfo.left.parameterNames != null ? calloutInfo.left.parameterNames.length : Integer.MAX_VALUE;
this.indexer.addMethodReference(calloutInfo.left.selector, argCount);
this.indexer.addFieldReference(calloutInfo.rightSelector);
}
@@ -600,10 +600,10 @@ public void enterCalloutToFieldMapping(CalloutToFieldInfo calloutInfo)
public void enterCallinMapping(CallinInfo callinInfo)
{
// TODO(SH): should new argument callinName be evaluated?
-
- int argCount = callinInfo.left.parameterNames != null ? callinInfo.left.parameterNames.length : Integer.MAX_VALUE;
+
+ int argCount = callinInfo.left.parameterNames != null ? callinInfo.left.parameterNames.length : Integer.MAX_VALUE;
this.indexer.addMethodReference(callinInfo.left.selector, argCount);
-
+
for (int i = 0; i < callinInfo.right.length; i++) {
MethodSpecInfo baseInfo= callinInfo.right[i];
argCount = baseInfo.parameterNames != null ? baseInfo.parameterNames.length : Integer.MAX_VALUE;
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ClassFileMatchLocator.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ClassFileMatchLocator.java
index 85d2a798b..d77415c89 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ClassFileMatchLocator.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ClassFileMatchLocator.java
@@ -28,7 +28,7 @@ import org.eclipse.jdt.internal.core.search.indexing.IIndexConstants;
public class ClassFileMatchLocator implements IIndexConstants {
-private static final long TARGET_ANNOTATION_BITS =
+private static final long TARGET_ANNOTATION_BITS =
TagBits.AnnotationForType |
TagBits.AnnotationForParameter |
TagBits.AnnotationForPackage |
@@ -192,7 +192,7 @@ public void locateMatches(MatchLocator locator, ClassFile classFile, IBinaryType
int bFieldsLength = binaryFields == null ? 0 : binaryFields.length;
IBinaryField[] unresolvedFields = null;
boolean hasUnresolvedFields = false;
-
+
// Report as many accurate matches as possible
int accuracy = SearchMatch.A_ACCURATE;
boolean mustResolve = pattern.mustResolve;
@@ -371,7 +371,7 @@ private void matchAnnotations(SearchPattern pattern, MatchLocator locator, Class
}
}
}
-
+
// Look for references in fields annotations
IBinaryField[] fields = binaryType.getFields();
if (fields != null) {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ClasspathSourceDirectory.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ClasspathSourceDirectory.java
index 8c84c06d5..ddc923041 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ClasspathSourceDirectory.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ClasspathSourceDirectory.java
@@ -110,7 +110,7 @@ public boolean equals(Object o) {
if (!(o instanceof ClasspathSourceDirectory)) return false;
return this.sourceFolder.equals(((ClasspathSourceDirectory) o).sourceFolder);
-}
+}
@Override
public NameEnvironmentAnswer findClass(String typeName, String qualifiedPackageName, String moduleName, String qualifiedBinaryFileName, boolean asBinaryOnly, Predicate<String> moduleNameFilter) {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ConstructorDeclarationPattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ConstructorDeclarationPattern.java
index ce2c02a39..6ef6c6e55 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ConstructorDeclarationPattern.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ConstructorDeclarationPattern.java
@@ -20,10 +20,10 @@ import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
public class ConstructorDeclarationPattern extends ConstructorPattern {
public int extraFlags;
-
+
public int declaringTypeModifiers;
public char[] declaringPackageName;
-
+
public int modifiers;
public char[] signature;
public char[][] parameterTypes;
@@ -47,11 +47,11 @@ public void decodeIndexKey(char[] key) {
int last = key.length - 1;
int slash = CharOperation.indexOf(SEPARATOR, key, 0);
this.declaringSimpleName = CharOperation.subarray(key, 0, slash);
-
+
int start = slash + 1;
slash = CharOperation.indexOf(SEPARATOR, key, start);
last = slash - 1;
-
+
boolean isDefaultConstructor = key[last] == '#';
if (isDefaultConstructor) {
this.parameterCount = -1;
@@ -67,23 +67,23 @@ public void decodeIndexKey(char[] key) {
}
}
}
-
+
slash = slash + 3;
last = slash - 1;
-
+
int typeModifiersWithExtraFlags = key[last-1] + (key[last]<<16);
this.declaringTypeModifiers = decodeModifers(typeModifiersWithExtraFlags);
this.extraFlags = decodeExtraFlags(typeModifiersWithExtraFlags);
-
+
// initialize optional fields
this.declaringPackageName = null;
this.modifiers = 0;
this.signature = null;
this.parameterTypes = null;
this.parameterNames = null;
-
+
boolean isMemberType = (this.extraFlags & ExtraFlags.IsMemberType) != 0;
-
+
if (!isMemberType) {
start = slash + 1;
if (this.parameterCount == -1) {
@@ -93,19 +93,19 @@ public void decodeIndexKey(char[] key) {
slash = CharOperation.indexOf(SEPARATOR, key, start);
}
last = slash - 1;
-
+
this.declaringPackageName = CharOperation.subarray(key, start, slash);
-
+
start = slash + 1;
if (this.parameterCount == 0) {
slash = slash + 3;
last = slash - 1;
-
+
this.modifiers = key[last-1] + (key[last]<<16);
} else if (this.parameterCount > 0){
slash = CharOperation.indexOf(SEPARATOR, key, start);
last = slash - 1;
-
+
boolean hasParameterStoredAsSignature = (this.extraFlags & ExtraFlags.ParameterTypesStoredAsSignature) != 0;
if (hasParameterStoredAsSignature) {
this.signature = CharOperation.subarray(key, start, slash);
@@ -116,20 +116,20 @@ public void decodeIndexKey(char[] key) {
start = slash + 1;
slash = CharOperation.indexOf(SEPARATOR, key, start);
last = slash - 1;
-
+
if (slash != start) {
this.parameterNames = CharOperation.splitOn(PARAMETER_SEPARATOR, key, start, slash);
}
-
+
slash = slash + 3;
last = slash - 1;
-
+
this.modifiers = key[last-1] + (key[last]<<16);
} else {
this.modifiers = ClassFileConstants.AccPublic;
}
}
-
+
removeInternalFlags(); // remove internal flags
}
@@ -144,10 +144,10 @@ public char[][] getIndexCategories() {
@Override
public boolean matchesDecodedKey(SearchPattern decodedPattern) {
ConstructorDeclarationPattern pattern = (ConstructorDeclarationPattern) decodedPattern;
-
+
// only top level types
if ((pattern.extraFlags & ExtraFlags.IsMemberType) != 0) return false;
-
+
// check package - exact match only
if (this.declaringPackageName != null && !CharOperation.equals(this.declaringPackageName, pattern.declaringPackageName, true))
return false;
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ConstructorLocator.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ConstructorLocator.java
index 54f0444e3..a196f3d0f 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ConstructorLocator.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ConstructorLocator.java
@@ -113,7 +113,7 @@ public int match(ReferenceExpression node, MatchingNodeSet nodeSet) {
public int match(TypeDeclaration node, MatchingNodeSet nodeSet) {
if (!this.pattern.findReferences) return IMPOSSIBLE_MATCH;
- if (this.pattern.fineGrain != 0 &&
+ if (this.pattern.fineGrain != 0 &&
(this.pattern.fineGrain & ~IJavaSearchConstants.METHOD_REFERENCE_EXPRESSION) == 0 )
return IMPOSSIBLE_MATCH;
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ConstructorPattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ConstructorPattern.java
index ffb36264b..f577af1e9 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ConstructorPattern.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ConstructorPattern.java
@@ -61,7 +61,7 @@ public final static int FINE_GRAIN_MASK =
/**
* Constructor entries are encoded as described
- *
+ *
* Binary constructor for class
* TypeName '/' Arity '/' TypeModifers '/' PackageName '/' Signature '/' ParameterNamesopt '/' Modifiers
* Source constructor for class
@@ -72,7 +72,7 @@ public final static int FINE_GRAIN_MASK =
* TypeName '/' # '/' TypeModifers '/' PackageName
* Constructor for member type
* TypeName '/' Arity '/' TypeModifers
- *
+ *
* TypeModifiers contains some encoded extra information
* {@link ExtraFlags#IsMemberType}
* {@link ExtraFlags#HasNonPrivateStaticMemberTypes}
@@ -88,18 +88,18 @@ public static char[] createDeclarationIndexKey(
char[] packageName,
int typeModifiers,
int extraFlags) {
-
+
char[] countChars;
char[] parameterTypesChars = null;
char[] parameterNamesChars = null;
-
+
if (argCount < 0) {
countChars = DEFAULT_CONSTRUCTOR;
} else {
countChars = argCount < 10
? COUNTS[argCount]
: ("/" + String.valueOf(argCount)).toCharArray(); //$NON-NLS-1$
-
+
if (argCount > 0) {
if (signature == null) {
if (parameterTypes != null && parameterTypes.length == argCount) {
@@ -112,58 +112,58 @@ public static char[] createDeclarationIndexKey(
} else {
extraFlags |= ExtraFlags.ParameterTypesStoredAsSignature;
}
-
+
if (parameterNames != null && parameterNames.length == argCount) {
parameterNamesChars = CharOperation.concatWith(parameterNames, PARAMETER_SEPARATOR);
}
}
}
-
+
boolean isMemberType = (extraFlags & ExtraFlags.IsMemberType) != 0;
-
+
int typeNameLength = typeName == null ? 0 : typeName.length;
int packageNameLength = packageName == null ? 0 : packageName.length;
int countCharsLength = countChars.length;
int parameterTypesLength = signature == null ? (parameterTypesChars == null ? 0 : parameterTypesChars.length): signature.length;
int parameterNamesLength = parameterNamesChars == null ? 0 : parameterNamesChars.length;
-
+
int resultLength = typeNameLength + countCharsLength + 3; // SEPARATOR=1 + TypeModifers=2
if (!isMemberType) {
resultLength += packageNameLength + 1; // SEPARATOR=1
if (argCount >= 0) {
resultLength += 3; // SEPARATOR=1 + Modifiers=2
}
-
+
if (argCount > 0) {
resultLength += parameterTypesLength + parameterNamesLength + 2; //SEPARATOR=1 + SEPARATOR=1
}
}
-
+
char[] result = new char[resultLength];
-
+
int pos = 0;
if (typeNameLength > 0) {
System.arraycopy(typeName, 0, result, pos, typeNameLength);
pos += typeNameLength;
}
-
+
if (countCharsLength > 0) {
System.arraycopy(countChars, 0, result, pos, countCharsLength);
pos += countCharsLength;
}
-
+
int typeModifiersWithExtraFlags = typeModifiers | encodeExtraFlags(extraFlags);
result[pos++] = SEPARATOR;
result[pos++] = (char) typeModifiersWithExtraFlags;
result[pos++] = (char) (typeModifiersWithExtraFlags>>16);
-
+
if (!isMemberType) {
result[pos++] = SEPARATOR;
if (packageNameLength > 0) {
System.arraycopy(packageName, 0, result, pos, packageNameLength);
pos += packageNameLength;
}
-
+
if (argCount == 0) {
result[pos++] = SEPARATOR;
result[pos++] = (char) modifiers;
@@ -178,20 +178,20 @@ public static char[] createDeclarationIndexKey(
}
pos += parameterTypesLength;
}
-
+
result[pos++] = SEPARATOR;
if (parameterNamesLength > 0) {
System.arraycopy(parameterNamesChars, 0, result, pos, parameterNamesLength);
pos += parameterNamesLength;
}
-
+
result[pos++] = SEPARATOR;
result[pos++] = (char) modifiers;
result[pos++] = (char) (modifiers>>16);
}
-
+
}
-
+
return result;
}
public static char[] createDefaultDeclarationIndexKey(
@@ -223,23 +223,23 @@ public static char[] createIndexKey(char[] typeName, int argCount) {
}
static int decodeExtraFlags(int modifiersWithExtraFlags) {
int extraFlags = 0;
-
+
if ((modifiersWithExtraFlags & ASTNode.Bit28) != 0) {
extraFlags |= ExtraFlags.ParameterTypesStoredAsSignature;
}
-
+
if ((modifiersWithExtraFlags & ASTNode.Bit29) != 0) {
extraFlags |= ExtraFlags.IsLocalType;
}
-
+
if ((modifiersWithExtraFlags & ASTNode.Bit30) != 0) {
extraFlags |= ExtraFlags.IsMemberType;
}
-
+
if ((modifiersWithExtraFlags & ASTNode.Bit31) != 0) {
extraFlags |= ExtraFlags.HasNonPrivateStaticMemberTypes;
}
-
+
return extraFlags;
}
static int decodeModifers(int modifiersWithExtraFlags) {
@@ -247,33 +247,33 @@ static int decodeModifers(int modifiersWithExtraFlags) {
}
private static int encodeExtraFlags(int extraFlags) {
int encodedExtraFlags = 0;
-
+
if ((extraFlags & ExtraFlags.ParameterTypesStoredAsSignature) != 0) {
encodedExtraFlags |= ASTNode.Bit28;
}
-
+
if ((extraFlags & ExtraFlags.IsLocalType) != 0) {
encodedExtraFlags |= ASTNode.Bit29;
}
-
+
if ((extraFlags & ExtraFlags.IsMemberType) != 0) {
encodedExtraFlags |= ASTNode.Bit30;
}
if ((extraFlags & ExtraFlags.HasNonPrivateStaticMemberTypes) != 0) {
encodedExtraFlags |= ASTNode.Bit31;
}
-
+
return encodedExtraFlags;
}
private static char[] getTypeErasure(char[] typeName) {
int index;
if ((index = CharOperation.indexOf('<', typeName)) == -1) return typeName;
-
+
int length = typeName.length;
char[] typeErasurename = new char[length - 2];
System.arraycopy(typeName, 0, typeErasurename, 0, index);
-
+
int depth = 1;
for (int i = index + 1; i < length; i++) {
switch (typeName[i]) {
@@ -290,7 +290,7 @@ private static char[] getTypeErasure(char[] typeName) {
break;
}
}
-
+
System.arraycopy(typeErasurename, 0, typeErasurename = new char[index], 0, index);
return typeErasurename;
}
@@ -349,18 +349,18 @@ public ConstructorPattern(
* Instantiate a method pattern with signatures for generics search
*/
public ConstructorPattern(
- char[] declaringSimpleName,
+ char[] declaringSimpleName,
char[] declaringQualification,
- char[][] parameterQualifications,
+ char[][] parameterQualifications,
char[][] parameterSimpleNames,
String[] parameterSignatures,
IMethod method,
int limitTo,
int matchRule) {
- this(declaringSimpleName,
+ this(declaringSimpleName,
declaringQualification,
- parameterQualifications,
+ parameterQualifications,
parameterSimpleNames,
limitTo,
matchRule);
@@ -411,19 +411,19 @@ public ConstructorPattern(
* Instantiate a method pattern with signatures for generics search
*/
public ConstructorPattern(
- char[] declaringSimpleName,
+ char[] declaringSimpleName,
char[] declaringQualification,
String declaringSignature,
- char[][] parameterQualifications,
+ char[][] parameterQualifications,
char[][] parameterSimpleNames,
String[] parameterSignatures,
char[][] arguments,
int limitTo,
int matchRule) {
- this(declaringSimpleName,
+ this(declaringSimpleName,
declaringQualification,
- parameterQualifications,
+ parameterQualifications,
parameterSimpleNames,
limitTo,
matchRule);
@@ -462,13 +462,13 @@ public void decodeIndexKey(char[] key) {
int last = key.length - 1;
int slash = CharOperation.indexOf(SEPARATOR, key, 0);
this.declaringSimpleName = CharOperation.subarray(key, 0, slash);
-
+
int start = slash + 1;
slash = CharOperation.indexOf(SEPARATOR, key, start);
if (slash != -1) {
last = slash - 1;
}
-
+
boolean isDefaultConstructor = key[last] == '#';
if (isDefaultConstructor) {
this.parameterCount = -1;
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/FieldLocator.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/FieldLocator.java
index 28862ae9c..a6811b913 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/FieldLocator.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/FieldLocator.java
@@ -96,7 +96,7 @@ public int match(FieldDeclaration node, MatchingNodeSet nodeSet) {
public int match(MethodSpec node, MatchingNodeSet nodeSet)
{
int level = IMPOSSIBLE_MATCH;
-
+
if (node instanceof FieldAccessSpec)
{
FieldAccessSpec fieldSpec = (FieldAccessSpec)node;
@@ -187,7 +187,7 @@ protected void matchReportReference(ASTNode reference, IJavaElement element, IJa
if (accuracy != SearchMatch.A_ACCURATE) return;
// element that references the field must be included in the enclosing element
- DeclarationOfAccessedFieldsPattern declPattern = (DeclarationOfAccessedFieldsPattern) this.pattern;
+ DeclarationOfAccessedFieldsPattern declPattern = (DeclarationOfAccessedFieldsPattern) this.pattern;
while (element != null && !declPattern.enclosingElement.equals(element))
element = element.getParent();
if (element != null) {
@@ -306,7 +306,7 @@ protected void updateMatch(ParameterizedTypeBinding parameterizedBinding, char[]
protected void reportDeclaration(FieldBinding fieldBinding, MatchLocator locator, SimpleSet knownFields) throws CoreException {
// ignore length field
if (fieldBinding == ArrayBinding.ArrayLength) return;
-
+
ReferenceBinding declaringClass = fieldBinding.declaringClass;
IType type = locator.lookupType(declaringClass);
if (type == null) return; // case of a secondary type
@@ -337,7 +337,7 @@ protected void reportDeclaration(FieldBinding fieldBinding, MatchLocator locator
fieldDecl = fieldDecls[i];
break;
}
- }
+ }
if (fieldDecl != null) {
int offset = fieldDecl.sourceStart;
this.match = new FieldDeclarationMatch(((JavaElement) field).resolved(fieldBinding), SearchMatch.A_ACCURATE, offset, fieldDecl.sourceEnd-offset+1, locator.getParticipant(), resource);
@@ -362,7 +362,7 @@ public int resolveLevel(ASTNode possiblelMatchingNode) {
{
return resolveLevel(((FieldAccessSpec)possiblelMatchingNode).resolvedField);
}
-//gbr}
+//gbr}
}
if (possiblelMatchingNode instanceof FieldDeclaration)
return matchField(((FieldDeclaration) possiblelMatchingNode).binding, true);
@@ -375,7 +375,7 @@ public int resolveLevel(Binding binding) {
// for matching the component in constructor of a record
if ( ((LocalVariableBinding)binding).declaringScope.referenceContext() instanceof CompactConstructorDeclaration) {
return matchLocal((LocalVariableBinding) binding, true);
- }
+ }
}
if (!(binding instanceof FieldBinding)) return IMPOSSIBLE_MATCH;
@@ -398,7 +398,7 @@ protected int resolveLevel(NameReference nameRef) {
int level = matchField(fieldBinding, false);
if (level != IMPOSSIBLE_MATCH) return level;
}
- }
+ }
int otherMax = qNameRef.otherBindings == null ? 0 : qNameRef.otherBindings.length;
for (int i = 0; i < otherMax; i++) {
char[] token = qNameRef.tokens[i + qNameRef.indexOfFirstFieldBinding];
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/FieldPattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/FieldPattern.java
index 00bb4a11c..d7bdb9492 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/FieldPattern.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/FieldPattern.java
@@ -37,10 +37,10 @@ public static char[] createIndexKey(char[] fieldName) {
}
public FieldPattern(
- char[] name,
+ char[] name,
char[] declaringQualification,
- char[] declaringSimpleName,
- char[] typeQualification,
+ char[] declaringSimpleName,
+ char[] typeQualification,
char[] typeSimpleName,
int limitTo,
int matchRule) {
@@ -58,10 +58,10 @@ public FieldPattern(
* Instantiate a field pattern with additional information for generic search
*/
public FieldPattern(
- char[] name,
+ char[] name,
char[] declaringQualification,
- char[] declaringSimpleName,
- char[] typeQualification,
+ char[] declaringSimpleName,
+ char[] typeQualification,
char[] typeSimpleName,
String typeSignature,
int limitTo,
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/IndexBasedJavaSearchEnvironment.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/IndexBasedJavaSearchEnvironment.java
index 7daca0c9a..1a6b369c7 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/IndexBasedJavaSearchEnvironment.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/IndexBasedJavaSearchEnvironment.java
@@ -148,7 +148,7 @@ public class IndexBasedJavaSearchEnvironment implements INameEnvironment, Suffix
AccessRestriction accessRestriction = ruleSet == null? null : ruleSet.getViolatedRestriction(binaryName);
TypeRef typeRef = TypeRef.create(next);
String fileName = new String(binaryName) + ".class"; //$NON-NLS-1$
- IBinaryType binaryType = new IndexBinaryType(typeRef, fileName.toCharArray());
+ IBinaryType binaryType = new IndexBinaryType(typeRef, fileName.toCharArray());
NameEnvironmentAnswer nextAnswer = new NameEnvironmentAnswer(binaryType, accessRestriction);
boolean useNewAnswer = isBetter(result, bestEntryPosition, nextAnswer, nextRoot);
@@ -271,9 +271,9 @@ public class IndexBasedJavaSearchEnvironment implements INameEnvironment, Suffix
public boolean isPackage(char[][] parentPackageName, char[] packageName) {
char[] binaryPackageName = CharOperation.concatWith(parentPackageName, '/');
final char[] fieldDescriptorPrefix;
-
+
if (parentPackageName == null || parentPackageName.length == 0) {
- fieldDescriptorPrefix = CharArrayUtils.concat(JavaNames.FIELD_DESCRIPTOR_PREFIX, packageName,
+ fieldDescriptorPrefix = CharArrayUtils.concat(JavaNames.FIELD_DESCRIPTOR_PREFIX, packageName,
new char[] { '/' });
} else {
fieldDescriptorPrefix = CharArrayUtils.concat(JavaNames.FIELD_DESCRIPTOR_PREFIX, binaryPackageName,
@@ -325,7 +325,7 @@ public class IndexBasedJavaSearchEnvironment implements INameEnvironment, Suffix
public void cleanup() {
// No explicit cleanup required for this class
}
-
+
public static INameEnvironment create(List<IJavaProject> javaProjects, org.eclipse.jdt.core.ICompilationUnit[] copies) {
if (JavaIndex.isEnabled() && isEnabled()) {
return new IndexBasedJavaSearchEnvironment(javaProjects, copies);
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/JavaSearchNameEnvironment.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/JavaSearchNameEnvironment.java
index 083fbc04f..751efcdd8 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/JavaSearchNameEnvironment.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/JavaSearchNameEnvironment.java
@@ -160,8 +160,8 @@ private ClasspathLocation mapToClassPathLocation(JavaModelManager manager, Packa
ClasspathEntry rawClasspathEntry = (ClasspathEntry) root.getRawClasspathEntry();
IJavaProject project = (IJavaProject) root.getParent();
String compliance = project.getOption(JavaCore.COMPILER_COMPLIANCE, true);
- cp = (root instanceof JrtPackageFragmentRoot) ?
- ClasspathLocation.forJrtSystem(path.toOSString(), rawClasspathEntry.getAccessRuleSet(),
+ cp = (root instanceof JrtPackageFragmentRoot) ?
+ ClasspathLocation.forJrtSystem(path.toOSString(), rawClasspathEntry.getAccessRuleSet(),
ClasspathEntry.getExternalAnnotationPath(rawClasspathEntry, project.getProject(), true), compliance) :
ClasspathLocation.forLibrary(manager.getZipFile(path), rawClasspathEntry.getAccessRuleSet(),
ClasspathEntry.getExternalAnnotationPath(rawClasspathEntry,
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/JavaSearchPattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/JavaSearchPattern.java
index e213bf4d9..ba8650820 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/JavaSearchPattern.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/JavaSearchPattern.java
@@ -28,7 +28,7 @@ import org.eclipse.jdt.internal.core.util.Util;
public class JavaSearchPattern extends SearchPattern implements IIndexConstants {
-
+
/*
* Whether this pattern is case sensitive.
*/
@@ -60,14 +60,14 @@ public class JavaSearchPattern extends SearchPattern implements IIndexConstants
* Fine grain limitation
*/
public int fineGrain = 0;
-
+
/**
* Mask used on match rule for match mode.
*/
public static final int MATCH_MODE_MASK = R_EXACT_MATCH
- | R_PREFIX_MATCH
- | R_PATTERN_MATCH
- | R_REGEXP_MATCH
+ | R_PREFIX_MATCH
+ | R_PATTERN_MATCH
+ | R_REGEXP_MATCH
| R_CAMELCASE_MATCH
| R_CAMELCASE_SAME_PART_COUNT_MATCH;
@@ -216,7 +216,7 @@ public class JavaSearchPattern extends SearchPattern implements IIndexConstants
}
return null;
}
-
+
// Try to get the argument using the JavaModel info
try {
ITypeParameter[] parameters = method.getTypeParameters();
@@ -270,13 +270,13 @@ public class JavaSearchPattern extends SearchPattern implements IIndexConstants
public final boolean hasTypeParameters() {
return !hasSignatures() && hasTypeArguments();
}
-
+
/**
* Return whether two suffixes are compatible.
- *
+ *
* Note that obvious compatibility values as equals and {@link IIndexConstants#TYPE_SUFFIX}
* has to be tested by caller to avoid unnecessary method call...
- *
+ *
* @param typeSuffix
* @param patternSuffix
* @return true if suffixes are compatible, false otherwise
@@ -329,7 +329,7 @@ public class JavaSearchPattern extends SearchPattern implements IIndexConstants
}
return false;
}
-
+
// Default behavior is to match suffixes
return true;
}
@@ -342,7 +342,7 @@ public class JavaSearchPattern extends SearchPattern implements IIndexConstants
output.append("\", "); //$NON-NLS-1$
}
switch(getMatchMode()) {
- case R_EXACT_MATCH :
+ case R_EXACT_MATCH :
output.append("exact match, "); //$NON-NLS-1$
break;
case R_PREFIX_MATCH :
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/LocalVariablePattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/LocalVariablePattern.java
index 49b343c4c..7bd60b0f5 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/LocalVariablePattern.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/LocalVariablePattern.java
@@ -27,7 +27,7 @@ import org.eclipse.jdt.internal.core.search.JavaSearchScope;
import org.eclipse.jdt.internal.core.util.Util;
public class LocalVariablePattern extends VariablePattern {
-
+
LocalVariable localVariable;
public LocalVariablePattern(LocalVariable localVariable, int limitTo, int matchRule) {
@@ -45,7 +45,7 @@ public void findIndexMatches(Index index, IndexQueryRequestor requestor, SearchP
IModuleDescription md = root.getModuleDescription();
if(md != null) {
String module = md.getElementName();
- documentPath = root.getPath() + IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR
+ documentPath = root.getPath() + IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR
+ module + IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR + relativePath;
} else {
documentPath = root.getPath() + IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR + relativePath;
@@ -62,11 +62,11 @@ public void findIndexMatches(Index index, IndexQueryRequestor requestor, SearchP
// Note that requestor has to verify if needed whether the document violates the access restriction or not
AccessRuleSet access = javaSearchScope.getAccessRuleSet(relativePath, index.containerPath);
if (access != JavaSearchScope.NOT_ENCLOSED) { // scope encloses the path
- if (!requestor.acceptIndexMatch(documentPath, this, participant, access))
+ if (!requestor.acceptIndexMatch(documentPath, this, participant, access))
throw new OperationCanceledException();
}
} else if (scope.encloses(documentPath)) {
- if (!requestor.acceptIndexMatch(documentPath, this, participant, null))
+ if (!requestor.acceptIndexMatch(documentPath, this, participant, null))
throw new OperationCanceledException();
}
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java
index 3269223e2..053d15c3b 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java
@@ -117,37 +117,37 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.statemachine.transfor
/**
* OTDT changes:
- *
+ *
* What: Harnessing of all compiler calls with Dependencies (throughout)
*
* Retrenching several mangled names/signatures:
* ---------------------------------------------
* What: retrench signature of callin method
* How: use MethodSignatureEnhancer.getSourceArguments(method);
- *
+ *
* What: Strip leading __OT__
- * Where:
+ * Where:
* - createHandle(AbstractMethodDeclaration method, ...) if method is a ctor
* - reportMatching(TypeDeclaration type, ...)
*
* What: when matching methods:
* - filter generated methods
* - look in interface part, too
- *
+ *
* Handle new elements:
* --------------------
* What: account for a new kind of variable: TYPE_VALUE_PARAMETER.
- *
+ *
* What: Support matching "team package" decl as a type reference
- *
+ *
* What: report matching of new node kinds:
* - base class
* - method mappings
- *
+ *
* What: Acount for OTJavaElement
* How: Before casting to JavaElement check whether we should actually use OTJavaElement
- *
- *
+ *
+ *
* ROFI:
* -----
* What: Account for role files when traversing type declarations
@@ -393,7 +393,7 @@ public MatchLocator(
this.sourceStartOfMethodToRetain = range.getOffset();
this.sourceEndOfMethodToRetain = this.sourceStartOfMethodToRetain + range.getLength() - 1; // offset is 0 based.
} catch (JavaModelException e) {
- // drop silently.
+ // drop silently.
}
}
}
@@ -425,7 +425,7 @@ public void accept(ICompilationUnit sourceUnit, AccessRestriction accessRestrict
CompilationUnitDeclaration parsedUnit = basicParser().dietParse(sourceUnit, unitResult);
//{ObjectTeams: never try to get this unit's method bodies:
parsedUnit.parseMethodBodies = false;
-// SH}
+// SH}
this.lookupEnvironment.buildTypeBindings(parsedUnit, accessRestriction);
this.lookupEnvironment.completeTypeBindings(parsedUnit, true);
} catch (AbortCompilationUnit e) {
@@ -562,7 +562,7 @@ protected IJavaElement createHandle(AbstractMethodDeclaration method, IJavaEleme
//{ObjectTeams: retrench signature of callin method:
/* orig:
Argument[] arguments = method.arguments;
- :giro */
+ :giro */
Argument[] arguments = MethodSignatureEnhancer.getSourceArguments(method, this.options.weavingScheme);
// SH}
int argCount = arguments == null ? 0 : arguments.length;
@@ -625,12 +625,12 @@ protected IJavaElement createHandle(AbstractMethodDeclaration method, IJavaEleme
parameterTypeSignatures[i] = Signature.createTypeSignature(typeName, false);
}
}
-//{ObjectTeams: be sure to use correct selectors even for role constructors (with __OT__)
+//{ObjectTeams: be sure to use correct selectors even for role constructors (with __OT__)
String selector = new String(method.selector);
- if (method.isConstructor())
+ if (method.isConstructor())
selector = parent.getElementName();
return createMethodHandle(type, selector, parameterTypeSignatures);
-/* orig:
+/* orig:
return createMethodHandle(type, new String(method.selector), parameterTypeSignatures);
:giro */
//jsv,gbr+SH}
@@ -741,7 +741,7 @@ protected IJavaElement createHandle(AbstractVariableDeclaration variableDeclarat
case AbstractVariableDeclaration.TYPE_VALUE_PARAMETER:
if (!(parent instanceof IType)) return parent;
return ((IType) parent).getField(new String(variableDeclaration.name));
-// SH}
+// SH}
}
return null;
}
@@ -890,15 +890,15 @@ public boolean encloses(IJavaElement element) {
if (element != null) {
if (this.scope instanceof HierarchyScope)
return ((HierarchyScope)this.scope).encloses(element, this.progressMonitor);
- else
+ else
return this.scope.encloses(element);
}
return false;
}
private boolean filterEnum(SearchMatch match) {
-
- // filter org.apache.commons.lang.enum package for projects above 1.5
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=317264
+
+ // filter org.apache.commons.lang.enum package for projects above 1.5
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=317264
IJavaElement element = (IJavaElement)match.getElement();
PackageFragment pkg = (PackageFragment)element.getAncestor(IJavaElement.PACKAGE_FRAGMENT);
if (pkg != null) {
@@ -1120,7 +1120,7 @@ private int getMaxResult(int[][] resultsMap) {
for (int i = 1; i < rows; ++i) {
int tmp = resultsMap[i][j];
if (tmp < current) continue;
- if (tmp > current) {
+ if (tmp > current) {
current = tmp;
candidates.clear();
}
@@ -1131,7 +1131,7 @@ private int getMaxResult(int[][] resultsMap) {
return candidates.get(0);
}
-/** apply the function to map the parameter full name to an index
+/** apply the function to map the parameter full name to an index
*/
private int mapParameter(List <String> patternParameterFullName, List <String> methodParameterFullName) {
int patternLen = patternParameterFullName.size();
@@ -1625,7 +1625,7 @@ public void locateMatches(SearchDocument[] searchDocuments) throws CoreException
JavaModelManager.getLocalFile(path).toPath().toAbsolutePath().toString() :
pathString.split(Pattern.quote("|"))[0]; //$NON-NLS-1$
possibleMatch.autoModuleName = new String(AutomaticModuleNaming.determineAutomaticModuleName(s));
- }
+ }
}
// last project
@@ -1679,7 +1679,7 @@ private Openable getCloserOpenable(Openable openable, String pathString) {
if (jpkf.getModuleDescription() != null &&
CompilerOptions.versionToJdkLevel(javaProject.getOption(JavaCore.COMPILER_COMPLIANCE, true)) <
ClassFileConstants.JDK9) {
- openable = this.handleFactory.createOpenable(pathString,
+ openable = this.handleFactory.createOpenable(pathString,
getSubScope(JavaCore.COMPILER_COMPLIANCE, ClassFileConstants.JDK9, false));
}
}
@@ -2030,13 +2030,13 @@ protected boolean parseAndBuildBindings(PossibleMatch possibleMatch, boolean mus
/* orig:
try {
:giro */
- try (Config config = ( mustResolve
+ try (Config config = ( mustResolve
|| (this.patternLocator.mayBeGeneric && possibleMatch.nodeSet.mustResolve))
? Dependencies.setup(this, this.parser, this.lookupEnvironment, true, true)
- : null)
+ : null)
{
//SH}
-
+
if (BasicSearchEngine.VERBOSE)
System.out.println("Parsing " + possibleMatch.openable.toStringWithAncestors()); //$NON-NLS-1$
@@ -2047,7 +2047,7 @@ protected boolean parseAndBuildBindings(PossibleMatch possibleMatch, boolean mus
if (parsedUnit.isModuleInfo()) {
if (mustResolve) {
this.lookupEnvironment.buildTypeBindings(parsedUnit, null /*no access restriction*/);
- }
+ }
} else if (!parsedUnit.isEmpty()) {
if (mustResolve) {
this.lookupEnvironment.buildTypeBindings(parsedUnit, null /*no access restriction*/);
@@ -2056,8 +2056,8 @@ protected boolean parseAndBuildBindings(PossibleMatch possibleMatch, boolean mus
//{ObjectTeams: Note(SH):
// Do not use Dependencies here as not to trigger completeTypeBindings.
// This way we avoid triggering accept which in turn processed the CU to the point that
-// we found "duplicate type" which then caused hasAlreadyDefinedType() above to bail out.
-// SH}
+// we found "duplicate type" which then caused hasAlreadyDefinedType() above to bail out.
+// SH}
getMethodBodies(parsedUnit, possibleMatch.nodeSet);
if (this.patternLocator.mayBeGeneric && !mustResolve && possibleMatch.nodeSet.mustResolve) {
// special case: possible match node set force resolution although pattern does not
@@ -2151,7 +2151,7 @@ protected void process(PossibleMatch possibleMatch, boolean bindingsWereCreated)
unit.resolve();
:giro */
Dependencies.ensureState(unit, ITranslationStates.STATE_LATE_ELEMENTS_COPIED);
-// SH,carp}
+// SH,carp}
} else if (unit.isPackageInfo()) {
if (BasicSearchEngine.VERBOSE)
System.out.println("Resolving " + this.currentPossibleMatch.openable.toStringWithAncestors()); //$NON-NLS-1$
@@ -2216,7 +2216,7 @@ protected void purgeMethodStatements(TypeDeclaration type, boolean checkEachMeth
TypeDeclaration[] memberTypes = type.memberTypes;
if (memberTypes != null)
for (int i = 0, l = memberTypes.length; i < l; i++)
-//{ObjectTeams: don't purge role files via their containing team
+//{ObjectTeams: don't purge role files via their containing team
// (need to traverse them via their own CompilationUnitDeclaration).
if (!memberTypes[i].isRoleFile())
// SH}
@@ -2655,7 +2655,7 @@ protected void reportMatching(LambdaExpression lambdaExpression, IJavaElement p
ASTNode[] nodes = typeInHierarchy ? nodeSet.matchingNodes(lambdaExpression.sourceStart, lambdaExpression.sourceEnd) : null;
boolean report = (this.matchContainer & PatternLocator.METHOD_CONTAINER) != 0 && encloses(enclosingElement);
MemberDeclarationVisitor declarationVisitor = new MemberDeclarationVisitor(enclosingElement, report ? nodes : null, nodeSet, this, typeInHierarchy);
-
+
if (lambdaExpression.arguments != null) {
int argumentsLength = lambdaExpression.arguments.length;
for (int i = 0; i < argumentsLength; i++)
@@ -2665,7 +2665,7 @@ protected void reportMatching(LambdaExpression lambdaExpression, IJavaElement p
if (lambdaExpression.body != null) {
lambdaExpression.body.traverse(declarationVisitor, (BlockScope) null);
}
-
+
// Report all nodes and remove them
if (nodes != null) {
int length = nodes.length;
@@ -2889,8 +2889,8 @@ private void reportMatching(Annotation[][] annotationsList, IJavaElement enclosi
if (annotationsList != null) {
for (int i = 0, length = annotationsList.length; i < length; ++i) {
Annotation[] annotations = annotationsList[i];
- if (annotations != null)
- reportMatching(annotations, enclosingElement, null, binding, nodeSet, matchedClassContainer, encloses(enclosingElement));
+ if (annotations != null)
+ reportMatching(annotations, enclosingElement, null, binding, nodeSet, matchedClassContainer, encloses(enclosingElement));
}
}
}
@@ -2994,13 +2994,13 @@ protected void reportMatching(CompilationUnitDeclaration unit, boolean mustResol
}
}
}
-//{ObjectTeams: ROFI: special node: the package declaration interpreted as a type reference
+//{ObjectTeams: ROFI: special node: the package declaration interpreted as a type reference
if (pkg != null && (pkg.modifiers & ExtraCompilerModifiers.AccTeam) != 0) {
Integer level = (Integer) nodeSet.matchingNodes.removeKey(pkg);
if (level != null)
this.patternLocator.matchReportImportRef(pkg, null/*no binding*/, createImportHandle(pkg), level.intValue(), this);
}
-// SH}
+// SH}
}
TypeDeclaration[] types = unit.types;
@@ -3279,8 +3279,8 @@ protected void reportMatching(TypeDeclaration type, IJavaElement parent, int acc
// in case, role splitting had not taken place:
String typeName = new String(type.name);
boolean isRole = false;
- if ( type.isRole()
- && !type.isInterface()
+ if ( type.isRole()
+ && !type.isInterface()
&& typeName.startsWith(IOTConstants.OT_DELIM))
{
typeName = typeName.substring(IOTConstants.OT_DELIM_LEN);
@@ -3291,13 +3291,13 @@ protected void reportMatching(TypeDeclaration type, IJavaElement parent, int acc
enclosingElement = createTypeHandle(new String(type.name));
} else if (enclosingElement instanceof IType) {
enclosingElement = ((IType) parent).getType(new String(type.name));
- :giro */
+ :giro */
if (enclosingElement == null) {
enclosingElement = createTypeHandle(typeName);
} else if (enclosingElement instanceof IType) {
- if (isRole)
+ if (isRole)
enclosingElement = TypeHelper.findRoleType((IType)parent, typeName); // FIXME(SH): avoid heavy weight operation here!
- else
+ else
enclosingElement = ((IType) parent).getType(new String(type.name));
// jsv,gbr,SH}
} else if (enclosingElement instanceof IMember) {
@@ -3311,7 +3311,7 @@ protected void reportMatching(TypeDeclaration type, IJavaElement parent, int acc
if ((type.bits & ASTNode.IsAnonymousType) != 0) {
if (fileName != null) {
if (fileName.endsWith("jar") || fileName.endsWith(SuffixConstants.SUFFIX_STRING_class)) { //$NON-NLS-1$
- IOrdinaryClassFile classFile= binaryType.getPackageFragment().getOrdinaryClassFile(binaryType.getTypeQualifiedName() +
+ IOrdinaryClassFile classFile= binaryType.getPackageFragment().getOrdinaryClassFile(binaryType.getTypeQualifiedName() +
"$" + Integer.toString(occurrenceCount) + SuffixConstants.SUFFIX_STRING_class);//$NON-NLS-1$
anonType = classFile.getType();
}
@@ -3381,7 +3381,7 @@ protected void reportMatching(TypeDeclaration type, IJavaElement parent, int acc
for (int i = 0, length = superClass.annotations == null ? 0 : superClass.annotations.length; i < length; i++) {
Annotation[] annotations = superClass.annotations[i];
if (annotations == null) continue;
- reportMatching(annotations, enclosingElement, null, type.binding, nodeSet, matchedClassContainer, enclosesElement);
+ reportMatching(annotations, enclosingElement, null, type.binding, nodeSet, matchedClassContainer, enclosesElement);
}
}
TypeReference[] superInterfaces = type.superInterfaces;
@@ -3393,9 +3393,9 @@ protected void reportMatching(TypeDeclaration type, IJavaElement parent, int acc
if (annotations != null) {
for (int j = 0, length = annotations.length; j < length; j++) {
if (annotations[j] == null) continue;
- reportMatching(annotations[j], enclosingElement, null, type.binding, nodeSet, matchedClassContainer, enclosesElement);
+ reportMatching(annotations[j], enclosingElement, null, type.binding, nodeSet, matchedClassContainer, enclosesElement);
}
- }
+ }
}
}
}
@@ -3416,12 +3416,12 @@ protected void reportMatching(TypeDeclaration type, IJavaElement parent, int acc
if (nameRef == null) continue;
Integer level = (Integer) nodeSet.matchingNodes.removeKey(nameRef);
if (level != null && matchedClassContainer)
- this.patternLocator.matchReportReference(nameRef, enclosingElement, type.binding, level.intValue(), this);
+ this.patternLocator.matchReportReference(nameRef, enclosingElement, type.binding, level.intValue(), this);
}
}
}
-//jsv,gbr}
-
+//jsv,gbr}
+
// filter out element not in hierarchy scope
boolean typeInHierarchy = type.binding == null || typeInHierarchy(type.binding);
matchedClassContainer = matchedClassContainer && typeInHierarchy;
@@ -3436,12 +3436,12 @@ protected void reportMatching(TypeDeclaration type, IJavaElement parent, int acc
for (int i = 0; i < length; i++) {
FieldDeclaration field = fields[i];
//{ObjectTeams: filter all generated fields
- if (field.copyInheritanceSrc != null ||
+ if (field.copyInheritanceSrc != null ||
Flags.isSynthetic(field.modifiers))
{
continue;
}
-//jsv,gbr}
+//jsv,gbr}
boolean last = field.endPart2Position == 0 || field.declarationEnd == field.endPart2Position;
// Store first index of multiple field declaration
if (!last) {
@@ -3482,14 +3482,14 @@ protected void reportMatching(TypeDeclaration type, IJavaElement parent, int acc
if (nodeSet.matchingNodes.elementSize == 0) return; // end as all matching nodes were reported
for (int i = 0, l = methods.length; i < l; i++) {
AbstractMethodDeclaration method = methods[i];
-//{ObjectTeams: filter generated methods:
+//{ObjectTeams: filter generated methods:
if (isRelevantMethod(method)) {
// orig:
Integer level = (Integer) nodeSet.matchingNodes.removeKey(method);
-// :giro
+// :giro
// if method was not found in nodeSet also check its interface part
// (yet reporting the class part method):
- if (level == null && method.interfacePartMethod != null)
+ if (level == null && method.interfacePartMethod != null)
level = (Integer) nodeSet.matchingNodes.removeKey(method.interfacePartMethod);
// orig:
int value = (level != null && matchedClassContainer) ? level.intValue() : -1;
@@ -3513,11 +3513,11 @@ protected void reportMatching(TypeDeclaration type, IJavaElement parent, int acc
AbstractMethodMappingDeclaration mapping = mappings[idx];
Integer level = (Integer) nodeSet.matchingNodes.removeKey(mapping);
int value = (level != null && matchedClassContainer) ? level.intValue() : -1;
- reportMatching(mappings[idx], enclosingElement, mapping.binding, value, typeInHierarchy, nodeSet);
+ reportMatching(mappings[idx], enclosingElement, mapping.binding, value, typeInHierarchy, nodeSet);
}
}
//gbr}
-
+
// Visit types
TypeDeclaration[] memberTypes = type.memberTypes;
if (memberTypes != null) {
@@ -3533,7 +3533,7 @@ protected void reportMatching(TypeDeclaration type, IJavaElement parent, int acc
}
if (memberType.isRoleFile())
continue; // role files are traversed from their CUD, not as member of the team
-//jsv,gbr}
+//jsv,gbr}
Integer level = (Integer) nodeSet.matchingNodes.removeKey(memberType);
int value = (level != null && matchedClassContainer) ? level.intValue() : -1;
reportMatching(memberType, enclosingElement, value, nodeSet, 1);
@@ -3541,7 +3541,7 @@ protected void reportMatching(TypeDeclaration type, IJavaElement parent, int acc
}
}
-//{ObjectTeams: report method mapping declaration or references in this method mapping declaration
+//{ObjectTeams: report method mapping declaration or references in this method mapping declaration
/**
* Visit the given method mapping declaration and report the nodes in its range that match exactly the
* search pattern (i.e. the ones in the matching nodes set)
@@ -3552,31 +3552,31 @@ protected void reportMatching(
Binding binding,
int accuracy,
boolean typeInHierarchy,
- MatchingNodeSet nodeSet) throws CoreException
+ MatchingNodeSet nodeSet) throws CoreException
{
IJavaElement enclosingElement = createHandle(methodMapping, parent);
if (accuracy > -1)
{
System.out.println("FIXME: MatchLocator.reportMatching(): accuracy: " + accuracy);
- //TODO(gbr,jsv) handle declaration of method mapping if it is searched
+ //TODO(gbr,jsv) handle declaration of method mapping if it is searched
}
-
+
// boolean matchedMethodContainer = (this.matchContainer & PatternLocator.METHOD_CONTAINER) != 0;
// //TODO(gbr) The role method spec in a callout binding is always a declaration.
// //The following code always returns a reference match for a method spec, even if
// //declarations of a method are searched. The reason is that a "MethodSpec" doesn' t contain
// //the information, if it is a reference (message send) or a (method) declaration.
// if (methodMapping instanceof CalloutMappingDeclaration)
-// {
+// {
// MethodSpec roleMethodSpec = methodMapping.roleMethodSpec;
// Integer level = (Integer) nodeSet.matchingNodes.removeKey(roleMethodSpec);
// int value = (level != null && matchedMethodContainer) ? level.intValue() : -1;
-//
+//
// if (value > -1) {
// enclosingElement = createHandle(roleMethodSpec, parent);
// if (enclosingElement != null) { // skip if unable to find method
-// // compute source positions of the selector
+// // compute source positions of the selector
// Scanner scanner = parser.scanner;
// int nameSourceStart = roleMethodSpec.sourceStart;
// scanner.setSource(this.currentPossibleMatch.getContents());
@@ -3591,10 +3591,10 @@ protected void reportMatching(
// SearchMatch match = newDeclarationMatch(enclosingElement, accuracy, nameSourceStart, length);
// report(match);
// }
-// }
+// }
// }
// }
-
+
if (typeInHierarchy) {
int start = methodMapping.declarationSourceStart;
int end = methodMapping.declarationSourceEnd;
@@ -3608,8 +3608,8 @@ protected void reportMatching(
for (int i=0; i<roleArgs.length; i++) {
TypeReference argType = roleArgs[i].type;
if ( argType.resolvedType != null
- && argType.resolvedType.isRole()
- && methodMapping.roleMethodSpec.argNeedsTranslation(i))
+ && argType.resolvedType.isRole()
+ && methodMapping.roleMethodSpec.argNeedsTranslation(i))
{
Integer level = (Integer) nodeSet.matchingNodes.removeKey(argType);
if (level != null)
@@ -3628,7 +3628,7 @@ protected void reportMatching(
{
Integer level = (Integer) nodeSet.matchingNodes.removeKey(returnType);
if (level != null)
- this.patternLocator.matchReportReference(returnType, enclosingElement, binding, level.intValue()|SearchMatch.A_CHECKED, this);
+ this.patternLocator.matchReportReference(returnType, enclosingElement, binding, level.intValue()|SearchMatch.A_CHECKED, this);
}
}
}
@@ -3660,36 +3660,36 @@ protected void reportMatching(
//{ObjectTeams: filter all generated methods
private boolean isRelevantMethod(AbstractMethodDeclaration method) {
- if ( method.isCopied
+ if ( method.isCopied
|| Flags.isSynthetic(method.modifiers))
{
return false;
}
- if (method.isGenerated)
+ if (method.isGenerated)
return method.isReusingSourceMethod; // callout or guard: generated but declaration is present in src
return true;
}
-//jsv,gbr moved by SH}
+//jsv,gbr moved by SH}
//{ObjectTeams: new method
/**
- * Creates an IJavaElement from the given method mapping declaration and type.
+ * Creates an IJavaElement from the given method mapping declaration and type.
*/
protected IJavaElement createHandle(
AbstractMethodMappingDeclaration mappingDecl,
IJavaElement parent) throws JavaModelException
-{
+{
if (!(parent instanceof IType))
{
return parent;
}
-
+
IType parentType = (IType) parent;
// if (!parentType.exists()) // if necessary, create elementInfo FIXME (carp)
// return null;
-
+
RoleType roleType = (RoleType)OTModelManager.getOTElement(parentType);
-
+
if (roleType != null)
{
if (mappingDecl instanceof CalloutMappingDeclaration)
@@ -3747,7 +3747,7 @@ protected void reportMatching(TypeParameter[] typeParameters, IJavaElement enclo
}
boolean matchedClassContainer = (this.matchContainer & PatternLocator.ALL_CONTAINER) != 0;
if (typeParameter.annotations != null) {
- reportMatching(typeParameter.annotations, enclosingElement, null, typeParameter.binding, nodeSet, matchedClassContainer, encloses(enclosingElement));
+ reportMatching(typeParameter.annotations, enclosingElement, null, typeParameter.binding, nodeSet, matchedClassContainer, encloses(enclosingElement));
}
if (typeParameter.type != null) {
reportMatching(typeParameter.type.annotations, enclosingElement, typeParameter.binding, nodeSet, matchedClassContainer);
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser.java
index acedabcdf..6eafca71d 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser.java
@@ -128,7 +128,7 @@ public class ClassButNoMethodDeclarationVisitor extends ASTVisitor {
MatchLocatorParser.this.patternLocator.match(paramMapping, MatchLocatorParser.this.nodeSet);
return true;
}
-
+
@Override
public boolean visit(MethodSpec methodSpec, BlockScope scope)
{
@@ -681,7 +681,7 @@ protected void consumeParameterMappingOut()
protected void consumeCallinBindingLeft(boolean hasSignature) {
super.consumeCallinBindingLeft(hasSignature);
// role args can cause lifting -> interpret as class instance creation:
- if (hasSignature && (this.patternFineGrain & IJavaSearchConstants.CLASS_INSTANCE_CREATION_TYPE_REFERENCE) != 0)
+ if (hasSignature && (this.patternFineGrain & IJavaSearchConstants.CLASS_INSTANCE_CREATION_TYPE_REFERENCE) != 0)
{
CallinMappingDeclaration callinDecl = (CallinMappingDeclaration) this.astStack[this.astPtr];
Argument[] roleArgs = callinDecl.roleMethodSpec.arguments;
@@ -694,7 +694,7 @@ protected void consumeCallinBindingLeft(boolean hasSignature) {
protected void consumeCalloutBindingLeft(boolean hasSignature) {
super.consumeCalloutBindingLeft(hasSignature);
// role return can cause lifting -> interpret as class instance creation:
- if (hasSignature && (this.patternFineGrain & IJavaSearchConstants.CLASS_INSTANCE_CREATION_TYPE_REFERENCE) != 0)
+ if (hasSignature && (this.patternFineGrain & IJavaSearchConstants.CLASS_INSTANCE_CREATION_TYPE_REFERENCE) != 0)
{
CalloutMappingDeclaration callinDecl = (CalloutMappingDeclaration) this.astStack[this.astPtr];
this.patternLocator.match(callinDecl.roleMethodSpec.returnType, this.nodeSet);
@@ -793,7 +793,7 @@ protected void consumeReferenceExpression(ReferenceExpression referenceExpressio
} else if (referenceExpression.lhs instanceof QualifiedNameReference || referenceExpression.lhs instanceof QualifiedTypeReference) {
if ((this.patternFineGrain & IJavaSearchConstants.QUALIFIED_REFERENCE) != 0) {
this.patternLocator.match(referenceExpression, this.nodeSet);
- }
+ }
}
}
@@ -1083,7 +1083,7 @@ protected TypeReference augmentTypeWithAdditionalDimensions(TypeReference typeRe
@Override
protected TypeReference getTypeReference(int dim) {
//{ObjectTeams: wrap to introduce 2nd parameter
- return getTypeReference(dim, false);
+ return getTypeReference(dim, false);
}
@Override
protected TypeReference getTypeReference(int dim, boolean liftingTypeAllowed) {
@@ -1155,9 +1155,9 @@ public void parseBodies(CompilationUnitDeclaration unit) {
this.patternLocator.match(type, this.nodeSet);
this.parseBodies(type, unit);
}
-//{ObjectTeams: prevent duplicate parsing:
+//{ObjectTeams: prevent duplicate parsing:
unit.bits |= ASTNode.HasAllMethodBodies;
-// SH}
+// SH}
}
/**
* Parses the member bodies in the given type.
@@ -1182,7 +1182,7 @@ protected void parseBodies(TypeDeclaration type, CompilationUnitDeclaration unit
AbstractMethodMappingDeclaration mapping = mappings[i];
mapping.parseParamMappings(this, unit);
mapping.traverse(this.localDeclarationVisitor, (ClassScope) null);
- }
+ }
}
//carp}
@@ -1213,15 +1213,15 @@ protected void parseBodies(TypeDeclaration type, CompilationUnitDeclaration unit
}
}
- //TODO(jwl): Do we need to support anonymous inner types in method mapping, i.e. actually
+ //TODO(jwl): Do we need to support anonymous inner types in method mapping, i.e. actually
// contained within a block of the parameter mapping?
-
+
TypeDeclaration[] memberTypes = type.memberTypes;
if (memberTypes != null) {
for (int i = 0; i < memberTypes.length; i++) {
TypeDeclaration memberType = memberTypes[i];
//{ObjectTeams: don't consider role files:
-// MatchLocator.getMethodBodies() calls scanner.setSource() with the original,
+// MatchLocator.getMethodBodies() calls scanner.setSource() with the original,
// untransformed source of the Compilation_Unit_, which contains no RoleFiles anyway.
// Skipping them prevents an ArrayIndexOutOfBoundsException in the Scanner, later.
// Role files are handled through their own CompilationUnit.
@@ -1233,7 +1233,7 @@ protected void parseBodies(TypeDeclaration type, CompilationUnitDeclaration unit
// and right after that, traversing it a second time through memberType.traverse().
// Some hints(SH):
// + parseBodies is needed to do the parsing ;-)
- // + memberType.traverse(..) is needed to visit the memberType itself
+ // + memberType.traverse(..) is needed to visit the memberType itself
// which is not part of the recursive parseBodies.
// Also the localDeclarationVisitor might only process a very limited set of ast nodes.
// So, the calls do have different effect, how much redundancy remains, I can't definitely say.
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchingNodeSet.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchingNodeSet.java
index d6a3d86a9..b6b199b16 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchingNodeSet.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchingNodeSet.java
@@ -93,7 +93,7 @@ public void addPossibleMatch(ASTNode node) {
// see http://bugs.eclipse.org/bugs/show_bug.cgi?id=29366)
long key = (((long) node.sourceStart) << 32) + node.sourceEnd;
ASTNode existing = (ASTNode) this.possibleMatchingNodesKeys.get(key);
-//{ObjectTeams: also expect a type reference to replace a name reference when a type anchor
+//{ObjectTeams: also expect a type reference to replace a name reference when a type anchor
// is converted to a type annotation (see Parser#convertTypeAnchor()):
/* orig:
if (existing != null && existing.getClass().equals(node.getClass()))
@@ -108,7 +108,7 @@ public void addPossibleMatch(ASTNode node) {
}
public void addTrustedMatch(ASTNode node, boolean isExact) {
addTrustedMatch(node, isExact ? EXACT_MATCH : POTENTIAL_MATCH);
-
+
}
void addTrustedMatch(ASTNode node, Integer level) {
// remove existing node at same position from set
@@ -118,7 +118,7 @@ void addTrustedMatch(ASTNode node, Integer level) {
ASTNode existing = (ASTNode) this.matchingNodesKeys.get(key);
if (existing != null && existing.getClass().equals(node.getClass()))
this.matchingNodes.removeKey(existing);
-
+
// map node to its accuracy level
this.matchingNodes.put(node, level);
this.matchingNodesKeys.put(key, node);
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MemberDeclarationVisitor.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MemberDeclarationVisitor.java
index 90dcfd98f..adca9369a 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MemberDeclarationVisitor.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MemberDeclarationVisitor.java
@@ -226,7 +226,7 @@ public boolean visit(LambdaExpression lambdaExpression, BlockScope scope) {
if (lambdaExpression.resolvedType != null && lambdaExpression.resolvedType.isValidBinding() &&
!(lambdaExpression.descriptor instanceof ProblemMethodBinding))
this.locator.reportMatching(lambdaExpression, this.enclosingElement, level != null ? level.intValue() : -1, this.nodeSet, this.typeInHierarchy);
- else
+ else
return true;
} catch (CoreException e) {
throw new WrappedCoreException(e);
@@ -311,7 +311,7 @@ int getInTypeOccurrenceCountForBinaryAnonymousType(TypeDeclaration typeDeclarati
public boolean visit(TypeDeclaration typeDeclaration, BlockScope unused) {
try {
char[] simpleName;
- if ((typeDeclaration.bits & ASTNode.IsAnonymousType) != 0) {
+ if ((typeDeclaration.bits & ASTNode.IsAnonymousType) != 0) {
simpleName = CharOperation.NO_CHAR;
} else {
simpleName = typeDeclaration.name;
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodDeclarationPattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodDeclarationPattern.java
index 8387333b1..05f8d172c 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodDeclarationPattern.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodDeclarationPattern.java
@@ -24,7 +24,7 @@ public class MethodDeclarationPattern extends MethodPattern {
public int extraFlags;
public int declaringTypeModifiers;
-
+
public int modifiers;
public char[] signature;
public char[][] parameterTypes;
@@ -32,7 +32,7 @@ public class MethodDeclarationPattern extends MethodPattern {
public char[] fusedDeclaringQualifier = null; // TODO: do we need this; cleanup?
/**
* Method Declaration entries are encoded as described
- *
+ *
* Binary Method Declaration for class
* MethodName '/' Arity '/' DeclaringQualifier '/' TypeName '/' TypeModifers '/' PackageName '/' Signature '/' ParameterNamesopt '/' Modifiers '/' returnType
* Source method for class
@@ -55,13 +55,13 @@ public class MethodDeclarationPattern extends MethodPattern {
char[] packageName,
int typeModifiers,
int extraFlags) {
-
+
char[] countChars;
char[] parameterTypesChars = null;
char[] parameterNamesChars = null;
-
-
- countChars = argCount < 10 ? new char[] {COUNTS[argCount][1]}: String.valueOf(argCount).toCharArray();
+
+
+ countChars = argCount < 10 ? new char[] {COUNTS[argCount][1]}: String.valueOf(argCount).toCharArray();
if (argCount > 0) {
if (signature == null) {
if (parameterTypes != null && parameterTypes.length == argCount) {
@@ -74,20 +74,20 @@ public class MethodDeclarationPattern extends MethodPattern {
parameterNamesChars = CharOperation.concatWith(parameterNames, PARAMETER_SEPARATOR);
}
}
-
- char[] returnTypeChars = returnType == null ? CharOperation.NO_CHAR : getTypeErasure(returnType);
+
+ char[] returnTypeChars = returnType == null ? CharOperation.NO_CHAR : getTypeErasure(returnType);
int typeModifiersWithExtraFlags = typeModifiers | encodeExtraFlags(extraFlags);
int entryIndex = 0;
int numEntries = 10;
char [][] tmp = new char[numEntries][];
-
+
tmp[entryIndex++] = methodName != null ? methodName : CharOperation.NO_CHAR;
tmp[entryIndex++] = countChars;
tmp[entryIndex++] = declaringQualification != null ? declaringQualification : CharOperation.NO_CHAR;
tmp[entryIndex++] = typeName != null ? typeName : CharOperation.NO_CHAR;
tmp[entryIndex++] = new char[] {(char) typeModifiersWithExtraFlags, (char) (typeModifiersWithExtraFlags>>16)};
tmp[entryIndex++] = packageName != null ? packageName : CharOperation.NO_CHAR;
-
+
if (argCount == 0) {
tmp[entryIndex++] = CharOperation.NO_CHAR;
tmp[entryIndex++] = CharOperation.NO_CHAR;
@@ -99,36 +99,36 @@ public class MethodDeclarationPattern extends MethodPattern {
tmp[entryIndex] = returnTypeChars;
return CharOperation.concatWithAll(tmp, '/');
}
-
+
private static int encodeExtraFlags(int extraFlags) {
int encodedExtraFlags = 0;
-
+
if ((extraFlags & ExtraFlags.ParameterTypesStoredAsSignature) != 0) {
encodedExtraFlags |= ASTNode.Bit28;
}
-
+
if ((extraFlags & ExtraFlags.IsLocalType) != 0) {
encodedExtraFlags |= ASTNode.Bit29;
}
-
+
if ((extraFlags & ExtraFlags.IsMemberType) != 0) {
encodedExtraFlags |= ASTNode.Bit30;
}
if ((extraFlags & ExtraFlags.HasNonPrivateStaticMemberTypes) != 0) {
encodedExtraFlags |= ASTNode.Bit31;
}
-
+
return encodedExtraFlags;
}
private static char[] getTypeErasure(char[] typeName) {
int index;
if ((index = CharOperation.indexOf('<', typeName)) == -1) return typeName;
-
+
int length = typeName.length;
char[] typeErasurename = new char[length - 2];
-
+
System.arraycopy(typeName, 0, typeErasurename, 0, index);
-
+
int depth = 1;
for (int i = index + 1; i < length; i++) {
switch (typeName[i]) {
@@ -145,29 +145,29 @@ public class MethodDeclarationPattern extends MethodPattern {
break;
}
}
-
+
System.arraycopy(typeErasurename, 0, typeErasurename = new char[index], 0, index);
return typeErasurename;
}
public MethodDeclarationPattern(
- char[] declaringPackageName,
- char[] declaringQualification,
+ char[] declaringPackageName,
+ char[] declaringQualification,
char[] declaringSimpleName,
char[] methodName,
int matchRule) {
- super(methodName, declaringQualification, declaringSimpleName,
- null, null, null, null, null,
+ super(methodName, declaringQualification, declaringSimpleName,
+ null, null, null, null, null,
IJavaSearchConstants.DECLARATIONS, matchRule);
this.declaringPackageName = declaringPackageName;
}
public MethodDeclarationPattern(
- char[] declaringQualifier,
+ char[] declaringQualifier,
char[] methodName,
int matchRule) {
- super(methodName, CharOperation.NO_CHAR, CharOperation.NO_CHAR,
- null, null, null, null, null,
+ super(methodName, CharOperation.NO_CHAR, CharOperation.NO_CHAR,
+ null, null, null, null, null,
IJavaSearchConstants.DECLARATIONS, matchRule);
this.fusedDeclaringQualifier = declaringQualifier;
}
@@ -178,7 +178,7 @@ public MethodDeclarationPattern(int matchRule) {
@Override
public void decodeIndexKey(char[] key) {
-
+
int start = 0;
int slash = CharOperation.indexOf(SEPARATOR, key, start);
this.selector = CharOperation.subarray(key, start, slash);
@@ -186,7 +186,7 @@ public void decodeIndexKey(char[] key) {
start = slash + 1;
slash = CharOperation.indexOf(SEPARATOR, key, start);
int last = slash - 1;
-
+
this.parameterCount = 0;
int power = 1;
for (int i = last; i >= start; i--) {
@@ -201,29 +201,29 @@ public void decodeIndexKey(char[] key) {
start = slash + 1;
slash = CharOperation.indexOf(SEPARATOR, key, start);
this.declaringQualification = CharOperation.subarray(key, start, slash);
-
+
start = slash + 1;
slash = CharOperation.indexOf(SEPARATOR, key, start);
this.declaringSimpleName = CharOperation.subarray(key, start, slash);
-
+
start = slash + 1;
slash = CharOperation.indexOf(SEPARATOR, key, start);
last = slash - 1;
int typeModifiersWithExtraFlags = key[last-1] + (key[last]<<16);
this.declaringTypeModifiers = ConstructorPattern.decodeModifers(typeModifiersWithExtraFlags);
this.extraFlags = ConstructorPattern.decodeExtraFlags(typeModifiersWithExtraFlags);
-
+
// initialize optional fields
this.declaringPackageName = null;
this.modifiers = 0;
this.signature = null;
this.parameterTypes = null;
this.parameterNames = null;
-
+
start = slash + 1;
slash = CharOperation.indexOf(SEPARATOR, key, start);
this.declaringPackageName = CharOperation.subarray(key, start, slash);
-
+
start = slash + 1;
slash = CharOperation.indexOf(SEPARATOR, key, start);
if (this.parameterCount == 0) {
@@ -245,15 +245,15 @@ public void decodeIndexKey(char[] key) {
}
start = slash + 1;
slash = CharOperation.indexOf(SEPARATOR, key, start);
-
+
if (slash != start) {
this.parameterNames = CharOperation.splitOn(PARAMETER_SEPARATOR, key, start, slash);
}
-
+
start = slash + 1;
slash = CharOperation.indexOf(SEPARATOR, key, start);
last = slash - 1;
-
+
this.modifiers = key[last-1] + (key[last]<<16);
} else {
this.modifiers = ClassFileConstants.AccPublic;
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java
index 86e499da8..06ea73868 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java
@@ -13,7 +13,7 @@
* Fraunhofer FIRST - extended API and implementation
* Technical University Berlin - extended API and implementation
* Samrat Dhillon samrat.dhillon@gmail.com - Search for method references is
- * returning methods as overriden even if the superclass's method is
+ * returning methods as overriden even if the superclass's method is
* only package-visible - https://bugs.eclipse.org/357547
*******************************************************************************/
package org.eclipse.jdt.internal.core.search.matching;
@@ -68,15 +68,15 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.statemachine.transfor
* <dl>
* <dt>What:<dd> Consider private role methods as virtual, too.
* <dt>Why:<dd> Implicit inheritance causes dynamic dispatch for private methods.
- *
+ *
* <dt>What:<dd> retrench callin method signatures.
- *
+ *
* <dt>What:<dd> add matching for MethodSpec and tsuper calls.
- *
+ *
* <dt>What:<dd> beautify type name with <code>sourceName()</code>
- *
+ *
* <dt>What:<dd> resilience if encountering a <code>ProblemMethodBinding</code>
- *
+ *
* <dt>What:<dd> for role methods use <code>copyInheritanceSrc</code> for precise information.
* </dl>
*/
@@ -91,7 +91,7 @@ public char[][][] allSuperDeclaringTypeNames;
// This is set only if focus is null. In these cases
// it will be hard to determine if the super class is of the same package
-// at a latter point. Hence, this array is created with all the super class
+// at a latter point. Hence, this array is created with all the super class
// names of the same package name as of the matching class name.
// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=357547
private char[][][] samePkgSuperDeclaringTypeNames;
@@ -166,7 +166,7 @@ public void initializePolymorphicSearch(MatchLocator locator) {
start = System.currentTimeMillis();
}
try {
- SuperTypeNamesCollector namesCollector =
+ SuperTypeNamesCollector namesCollector =
new SuperTypeNamesCollector(
this.pattern,
this.pattern.declaringSimpleName,
@@ -176,7 +176,7 @@ public void initializePolymorphicSearch(MatchLocator locator) {
locator.progressMonitor);
this.allSuperDeclaringTypeNames = namesCollector.collect();
this.samePkgSuperDeclaringTypeNames = namesCollector.getSamePackageSuperTypeNames();
- this.matchLocator = locator;
+ this.matchLocator = locator;
} catch (JavaModelException e) {
// inaccurate matches will be found
}
@@ -202,26 +202,26 @@ private boolean isTypeInSuperDeclaringTypeNames(char[][] typeName) {
* this message send or not.
* {ObjectTeams:
* Also private methods in roles invoked via 'this' are virtual message sends in a sense.
- * SH}
+ * SH}
*/
protected boolean isVirtualInvoke(MethodBinding method, MessageSend messageSend) {
- return !method.isStatic() &&
+ return !method.isStatic() &&
//{ObjectTeams: private role methods are visible in the implicit sub roles (OTJLD 1.2.1. (e))
(
// orig:
!method.isPrivate()
-// :giro
+// :giro
|| (method.declaringClass.isRole() && messageSend.receiver.isImplicitThis()))
&& !(messageSend instanceof TSuperMessageSend) // similar to "super" but for codegen it's a "this"
//jsv}
&& !messageSend.isSuperAccess()
- && !(method.isDefault() && this.pattern.focus != null
+ && !(method.isDefault() && this.pattern.focus != null
&& !CharOperation.equals(this.pattern.declaringPackageName, method.declaringClass.qualifiedPackageName()));
}
protected ReferenceBinding checkMethodRef(MethodBinding method, ReferenceExpression referenceExpression) {
boolean result = (!method.isStatic() && !method.isPrivate()
- && referenceExpression.isMethodReference()
- && !(method.isDefault() && this.pattern.focus != null
+ && referenceExpression.isMethodReference()
+ && !(method.isDefault() && this.pattern.focus != null
&& !CharOperation.equals(this.pattern.declaringPackageName, method.declaringClass.qualifiedPackageName())));
if (result) {
Expression lhs = referenceExpression.lhs;
@@ -231,7 +231,7 @@ protected ReferenceBinding checkMethodRef(MethodBinding method, ReferenceExpress
return (ReferenceBinding) binding;
}
}
-
+
return null;
}
@Override
@@ -283,7 +283,7 @@ public int match(MethodDeclaration node, MatchingNodeSet nodeSet) {
ASTNode[] args = node.arguments;
:giro */
ASTNode[] args = MethodSignatureEnhancer.getSourceArguments(node);
-// SH}
+// SH}
int argsLength = args == null ? 0 : args.length;
if (length != argsLength) return IMPOSSIBLE_MATCH;
for (int i = 0; i < argsLength; i++) {
@@ -324,14 +324,14 @@ public int match(MemberValuePair node, MatchingNodeSet nodeSet) {
// public int match(CalloutMappingDeclaration node, MatchingNodeSet nodeSet) - SKIP IT
// public int match(CallinMappingDeclaration node, MatchingNodeSet nodeSet) - SKIP IT
@Override
-public int match(MethodSpec methodSpec, MatchingNodeSet nodeSet)
+public int match(MethodSpec methodSpec, MatchingNodeSet nodeSet)
{
if (!matchesName(this.pattern.selector, methodSpec.selector)) return IMPOSSIBLE_MATCH;
-
+
// a signature-less methodSpec is a possible match -- parameters won't match in any case
if (!methodSpec.hasSignature)
return nodeSet.addMatch(methodSpec, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH);
-
+
if (this.pattern.parameterSimpleNames != null)
{
int length = this.pattern.parameterSimpleNames.length;
@@ -346,11 +346,11 @@ public int match(MethodSpec methodSpec, MatchingNodeSet nodeSet)
{
if (!matchesTypeReference(this.pattern.parameterSimpleNames[i], args[i].type))
{
- return IMPOSSIBLE_MATCH;
+ return IMPOSSIBLE_MATCH;
}
}
}
-
+
return nodeSet.addMatch(methodSpec, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH);
}
@Override
@@ -453,12 +453,12 @@ protected int matchMethod(MethodBinding method, boolean skipImpossibleArg) {
// global verification
if (method.parameters == null) return INACCURATE_MATCH;
//{ObjectTeams: for callin methods use retrenched parameters
-/* orig:
+/* orig:
if (parameterCount != method.parameters.length) return IMPOSSIBLE_MATCH;
:giro */
if (parameterCount != method.getSourceParamLength()) return IMPOSSIBLE_MATCH;
- TypeBinding[] methodParamters = method.getSourceParameters();
-// SH}
+ TypeBinding[] methodParamters = method.getSourceParameters();
+// SH}
if (!method.isValidBinding() && ((ProblemMethodBinding)method).problemId() == ProblemReasons.Ambiguous) {
// return inaccurate match for ambiguous call (bug 80890)
return INACCURATE_MATCH;
@@ -470,9 +470,9 @@ protected int matchMethod(MethodBinding method, boolean skipImpossibleArg) {
// verify each parameter
for (int i = 0; i < parameterCount; i++) {
//{ObjectTeams: callin method?
-/* orig:
+/* orig:
TypeBinding argType = method.parameters[i];
- :giro */
+ :giro */
TypeBinding argType = methodParamters[i];
// SH}
int newLevel = IMPOSSIBLE_MATCH;
@@ -485,7 +485,7 @@ protected int matchMethod(MethodBinding method, boolean skipImpossibleArg) {
if (focusMethodBinding != null) {// textual comparison insufficient
TypeBinding[] parameters = focusMethodBinding.parameters;
if (parameters.length >= parameterCount) {
- newLevel = (isBinary ? argType.erasure().isEquivalentTo((parameters[i].erasure())) :argType.isEquivalentTo((parameters[i]))) ?
+ newLevel = (isBinary ? argType.erasure().isEquivalentTo((parameters[i].erasure())) :argType.isEquivalentTo((parameters[i]))) ?
ACCURATE_MATCH : IMPOSSIBLE_MATCH;
foundLevel = true;
}
@@ -515,7 +515,7 @@ protected int matchMethod(MethodBinding method, boolean skipImpossibleArg) {
}
if (foundTypeVariable) {
if (!method.isStatic() && !method.isPrivate()) {
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=123836, No point in textually comparing type variables, captures etc with concrete types.
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=123836, No point in textually comparing type variables, captures etc with concrete types.
if (!checkedFocus)
focusMethodBinding = this.matchLocator.getMethodBinding(this.pattern);
if (focusMethodBinding != null) {
@@ -523,7 +523,7 @@ protected int matchMethod(MethodBinding method, boolean skipImpossibleArg) {
return ACCURATE_MATCH;
}
}
- }
+ }
return IMPOSSIBLE_MATCH;
}
}
@@ -621,26 +621,26 @@ protected void matchReportReference(ASTNode reference, IJavaElement element, IJa
//{ObjectTeams: use method sourceName() instead of field sourceName:
/* orig:
if (isPrivate && !CharOperation.equals(methodBinding.declaringClass.sourceName, focus.getParent().getElementName().toCharArray())) {
- :giro */
+ :giro */
ReferenceBinding mDeclaringClass = methodBinding.declaringClass;
// for anon classes sourceName() is not usable here:
- char[] declaringClassName = mDeclaringClass.isAnonymousType() ? mDeclaringClass.sourceName : mDeclaringClass.sourceName();
+ char[] declaringClassName = mDeclaringClass.isAnonymousType() ? mDeclaringClass.sourceName : mDeclaringClass.sourceName();
if (isPrivate && !CharOperation.equals(declaringClassName, focus.getParent().getElementName().toCharArray())) {
-// SH}
+// SH}
return; // finally the match was not possible
}
}
}
matchReportReference((MessageSend)reference, locator, accuracy, ((MessageSend)reference).binding);
//ObjectTeams: calculate source range for selection of method spec (method reference)
- } else if (this.pattern.findReferences && reference instanceof MethodSpec)
+ } else if (this.pattern.findReferences && reference instanceof MethodSpec)
{
MethodSpec methodSpec= (MethodSpec)reference;
int offset = methodSpec.sourceStart ;
- SearchMatch newMatch = locator.newMethodReferenceMatch(element, elementBinding, accuracy, offset,
+ SearchMatch newMatch = locator.newMethodReferenceMatch(element, elementBinding, accuracy, offset,
methodSpec.declarationSourceEnd - offset + 1, false/*not constructor*/, false/*not synthetic*/, reference);
locator.report(newMatch);
-//jsv}
+//jsv}
} else {
if (reference instanceof SingleMemberAnnotation) {
reference = ((SingleMemberAnnotation)reference).memberValuePairs()[0];
@@ -755,7 +755,7 @@ private boolean methodParametersEqualsPattern(MethodBinding method) {
TypeBinding[] methodParameters = method.parameters;
:giro */
TypeBinding[] methodParameters = method.getSourceParameters();
-// SH}
+// SH}
int length = methodParameters.length;
if (length != this.pattern.parameterSimpleNames.length) return false;
@@ -816,11 +816,11 @@ protected void reportDeclaration(MethodBinding methodBinding, MatchLocator locat
if (type.isBinary()) {
IMethod method = null;
//{ObjectTeams: for callin methods use the retrenched parameters:
-/* orig:
+/* orig:
TypeBinding[] parameters = methodBinding.original().parameters;
:giro */
TypeBinding[] parameters = methodBinding.original().getSourceParameters();
-// SH}
+// SH}
int parameterLength = parameters.length;
char[][] parameterTypes = new char[parameterLength][];
for (int i = 0; i<parameterLength; i++) {
@@ -832,7 +832,7 @@ protected void reportDeclaration(MethodBinding methodBinding, MatchLocator locat
}
method = locator.createBinaryMethodHandle(type, methodBinding.selector, parameterTypes);
if (method == null || knownMethods.addIfNotIncluded(method) == null) return;
-
+
IResource resource = type.getResource();
if (resource == null)
resource = type.getJavaProject().getProject();
@@ -930,7 +930,7 @@ public int resolveLevel(Binding binding) {
// used. Otherwise an exact match will not be found, because the
// parameter count of the search pattern will differ from the
// parameter count in the method binding (see also method
-// matchMethod(MethodBinding) in this class).
+// matchMethod(MethodBinding) in this class).
if (method.parameters != null)
{
TypeBinding[] paramTypes = method.parameters;
@@ -949,7 +949,7 @@ public int resolveLevel(Binding binding) {
}
}
}
-//gbr}
+//gbr}
boolean skipVerif = this.pattern.findDeclarations && this.mayBeGeneric;
int methodLevel = matchMethod(method, skipVerif);
if (methodLevel == IMPOSSIBLE_MATCH) {
@@ -1094,7 +1094,7 @@ protected int resolveLevelAsSubtype(char[] simplePattern, char[] qualifiedPatter
if (type == null) return INACCURATE_MATCH;
int level = resolveLevelForType(simplePattern, qualifiedPattern, type);
-//{ObjectTeams: perform deferred checking of tsub/tsuper:
+//{ObjectTeams: perform deferred checking of tsub/tsuper:
if (level != IMPOSSIBLE_MATCH) {
char[] typeName= type.getRealType().readableName();
level= this.pattern.resolveLevelForType(new String(typeName), level);
@@ -1134,19 +1134,19 @@ protected int resolveLevelAsSubtype(char[] simplePattern, char[] qualifiedPatter
}
//{ObjectTeams: matches implicit supertypes:
- RoleModel roleModel = type.roleModel;
+ RoleModel roleModel = type.roleModel;
if (type.roleModel != null) {
ReferenceBinding[] tsuperTypes = roleModel.getTSuperRoleBindings();
for (int t = tsuperTypes.length-1; t>=0; t--) { // check highest prio first (which comes last in the array)
level = resolveLevelAsSubtype(simplePattern, qualifiedPattern, tsuperTypes[t], methodName, argumentTypes, packageName, isDefault);
- // OT_COPY_PASTE from above "matches superclass":
+ // OT_COPY_PASTE from above "matches superclass":
if (level != IMPOSSIBLE_MATCH) {
if (argumentTypes != null) {
// need to verify if method may be overridden
MethodBinding[] methods = type.getMethods(this.pattern.selector);
for (int i=0, length=methods.length; i<length; i++) {
MethodBinding method = methods[i];
- //{OT: if method is copied don't consider it as overriding:
+ //{OT: if method is copied don't consider it as overriding:
if (method.copyInheritanceSrc != null)
continue;
// SH}
@@ -1177,8 +1177,8 @@ protected int resolveLevelAsSubtype(char[] simplePattern, char[] qualifiedPatter
//
}
}
-// SH}
-
+// SH}
+
// matches interfaces
ReferenceBinding[] interfaces = type.superInterfaces();
if (interfaces == null) return INACCURATE_MATCH;
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodPattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodPattern.java
index 3ca298f06..abe284202 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodPattern.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodPattern.java
@@ -100,12 +100,12 @@ MethodPattern(int matchRule) {
super(METHOD_PATTERN, matchRule);
}
public MethodPattern(
- char[] selector,
+ char[] selector,
char[] declaringQualification,
- char[] declaringSimpleName,
- char[] returnQualification,
+ char[] declaringSimpleName,
+ char[] returnQualification,
char[] returnSimpleName,
- char[][] parameterQualifications,
+ char[][] parameterQualifications,
char[][] parameterSimpleNames,
IType declaringType,
int limitTo,
@@ -155,30 +155,30 @@ public MethodPattern(
* Instanciate a method pattern with signatures for generics search
*/
public MethodPattern(
- char[] selector,
+ char[] selector,
char[] declaringQualification,
- char[] declaringSimpleName,
- char[] returnQualification,
+ char[] declaringSimpleName,
+ char[] returnQualification,
char[] returnSimpleName,
String returnSignature,
- char[][] parameterQualifications,
+ char[][] parameterQualifications,
char[][] parameterSimpleNames,
String[] parameterSignatures,
IMethod method,
int limitTo,
int matchRule) {
- this(selector,
+ this(selector,
declaringQualification,
- declaringSimpleName,
- returnQualification,
+ declaringSimpleName,
+ returnQualification,
returnSimpleName,
- parameterQualifications,
+ parameterQualifications,
parameterSimpleNames,
method.getDeclaringType(),
limitTo,
matchRule);
-
+
// Set flags
try {
this.varargs = (method.getFlags() & Flags.AccVarargs) != 0;
@@ -226,35 +226,35 @@ public MethodPattern(
this.methodArguments = extractMethodArguments(method);
if (hasMethodArguments()) this.mustResolve = true;
//{ObjectTeams: constrain the direction of this pattern?
- if (findingCallers.get() != null)
+ if (findingCallers.get() != null)
this.constrainToCallerDirection = true;
//SH}
-
+
}
/*
* Instanciate a method pattern with signatures for generics search
*/
public MethodPattern(
- char[] selector,
+ char[] selector,
char[] declaringQualification,
- char[] declaringSimpleName,
+ char[] declaringSimpleName,
String declaringSignature,
- char[] returnQualification,
+ char[] returnQualification,
char[] returnSimpleName,
String returnSignature,
- char[][] parameterQualifications,
+ char[][] parameterQualifications,
char[][] parameterSimpleNames,
String[] parameterSignatures,
char[][] arguments,
int limitTo,
int matchRule) {
- this(selector,
+ this(selector,
declaringQualification,
- declaringSimpleName,
- returnQualification,
+ declaringSimpleName,
+ returnQualification,
returnSimpleName,
- parameterQualifications,
+ parameterQualifications,
parameterSimpleNames,
null,
limitTo,
@@ -333,15 +333,15 @@ public boolean isPolymorphicSearch() {
public boolean matchesDecodedKey(SearchPattern decodedPattern) {
MethodPattern pattern = (MethodPattern) decodedPattern;
- return (this.parameterCount == pattern.parameterCount || this.parameterCount == -1
-//{ObjectTeams: return true even if paramCount = Integer.MAX_VALUE
+ return (this.parameterCount == pattern.parameterCount || this.parameterCount == -1
+//{ObjectTeams: return true even if paramCount = Integer.MAX_VALUE
|| pattern.parameterCount == Integer.MAX_VALUE
-//jsv}
+//jsv}
|| this.varargs)
&& matchesName(this.selector, pattern.selector);
}
/**
- * Returns whether a method declaration or message send must be resolved to
+ * Returns whether a method declaration or message send must be resolved to
* find out if this method pattern matches it.
*/
protected boolean mustResolve() {
@@ -365,7 +365,7 @@ public EntryResult[] queryIn(Index index) throws IOException {
//{ObjectTeams: we may need a second key to query methodspecs without signature (param count unknown)
char[] key2 = null;
//jsv}
-
+
int matchRule = getMatchRule();
switch(getMatchMode()) {
@@ -393,7 +393,7 @@ public EntryResult[] queryIn(Index index) throws IOException {
//{ObjectTeam: generate second key
key2 = createIndexKey(this.selector == null ? ONE_STAR : this.selector, Integer.MAX_VALUE);
//jsv}
- }
+ }
else if (this.selector != null && this.selector[this.selector.length - 1] != '*')
key = CharOperation.concat(this.selector, ONE_STAR, SEPARATOR);
// else do a pattern query with just the selector
@@ -409,18 +409,18 @@ public EntryResult[] queryIn(Index index) throws IOException {
//{ObjectTeams: combine results for both queries
EntryResult[] key1Result = index.query(getIndexCategories(), key, matchRule); // match rule is irrelevant when the key is null
EntryResult[] key2Result = key2 == null ? null : index.query(getIndexCategories(), key2, matchRule);
-
+
// no merging if one or both are null:
if (key1Result == null)
return key2Result;
if (key2Result == null)
return key1Result;
// beyond this point: both results are non-null, merge them:
-
+
EntryResult[] result = new EntryResult[key1Result.length + key2Result.length];
System.arraycopy(key1Result, 0,result, 0, key1Result.length);
System.arraycopy(key2Result, 0, result, key1Result.length, key2Result.length);
-
+
return result;
// orig
// return index.query(getIndexCategories(), key, matchRule); // match rule is irrelevant when the key is null
@@ -481,7 +481,7 @@ public void setDeclaringRoleClass(IType declaringClass) {
public int resolveLevelForType(String typeName, int declaringLevel) {
if (this.declaringRoleClass == null || typeName.equals(this.declaringRoleClass.getFullyQualifiedName('.')))
return declaringLevel;
-
+
if (this.cachedRoleHierarchy != null) {
IType superType = this.cachedRoleHierarchy.getSuperclass(this.declaringRoleClass); // OTTypeHierarchies will ensure that tsupers are traversed, too.
while (superType != null && OTModelManager.isRole(superType)) {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ModuleLocator.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ModuleLocator.java
index 3e20b13cc..3e4388da4 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ModuleLocator.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ModuleLocator.java
@@ -18,10 +18,10 @@ import org.eclipse.jdt.internal.compiler.lookup.ModuleBinding;
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
public class ModuleLocator extends PatternLocator {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MultiTypeDeclarationPattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MultiTypeDeclarationPattern.java
index fffa82620..0a8e246dd 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MultiTypeDeclarationPattern.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MultiTypeDeclarationPattern.java
@@ -24,7 +24,7 @@ public class MultiTypeDeclarationPattern extends JavaSearchPattern {
public char[][] simpleNames;
public char[][] qualifications;
-// set to CLASS_SUFFIX for only matching classes
+// set to CLASS_SUFFIX for only matching classes
// set to INTERFACE_SUFFIX for only matching interfaces
// set to ENUM_SUFFIX for only matching enums
// set to ANNOTATION_TYPE_SUFFIX for only matching annotation types
@@ -78,7 +78,7 @@ public char[][] getIndexCategories() {
@Override
public boolean matchesDecodedKey(SearchPattern decodedPattern) {
QualifiedTypeDeclarationPattern pattern = (QualifiedTypeDeclarationPattern) decodedPattern;
-
+
// check type suffix
if (this.typeSuffix != pattern.typeSuffix && this.typeSuffix != TYPE_SUFFIX) {
if (!matchDifferentTypeSuffixes(this.typeSuffix, pattern.typeSuffix)) {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/OrLocator.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/OrLocator.java
index e4cf898c8..065ce69cd 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/OrLocator.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/OrLocator.java
@@ -188,7 +188,7 @@ public int match(CalloutMappingDeclaration node, MatchingNodeSet nodeSet)
{
return ACCURATE_MATCH;
}
- level = newLevel;
+ level = newLevel;
}
}
return level;
@@ -227,7 +227,7 @@ public int match(ParameterMapping node, MatchingNodeSet nodeSet)
level = newLevel;
}
}
- return level;
+ return level;
}
@Override
public int match(MethodSpec node, MatchingNodeSet nodeSet)
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/OrPattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/OrPattern.java
index e7ca15558..9bec6f4d2 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/OrPattern.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/OrPattern.java
@@ -34,13 +34,13 @@ public class OrPattern extends SearchPattern implements IIndexConstants {
super(Math.max(leftPattern.getMatchRule(), rightPattern.getMatchRule()));
this.kind = OR_PATTERN;
this.mustResolve = leftPattern.mustResolve || rightPattern.mustResolve;
-
+
SearchPattern[] leftPatterns = leftPattern instanceof OrPattern ? ((OrPattern) leftPattern).patterns : null;
SearchPattern[] rightPatterns = rightPattern instanceof OrPattern ? ((OrPattern) rightPattern).patterns : null;
int leftSize = leftPatterns == null ? 1 : leftPatterns.length;
int rightSize = rightPatterns == null ? 1 : rightPatterns.length;
this.patterns = new SearchPattern[leftSize + rightSize];
-
+
if (leftPatterns == null)
this.patterns[0] = leftPattern;
else
@@ -86,7 +86,7 @@ public class OrPattern extends SearchPattern implements IIndexConstants {
/**
* Returns whether the pattern has one or several package declaration or not.
- *
+ *
* @return <code>true</code> if one at least of the stored pattern is a package declaration
* pattern ({@link PackageDeclarationPattern}), <code>false</code> otherwise.
*/
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageDeclarationPattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageDeclarationPattern.java
index f5fa34485..64d495d80 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageDeclarationPattern.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageDeclarationPattern.java
@@ -31,7 +31,7 @@ public EntryResult[] queryIn(Index index) {
@Override
protected StringBuffer print(StringBuffer output) {
output.append("PackageDeclarationPattern: <"); //$NON-NLS-1$
- if (this.pkgName != null)
+ if (this.pkgName != null)
output.append(this.pkgName);
else
output.append("*"); //$NON-NLS-1$
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.java
index 543facd42..64f146e61 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.java
@@ -37,8 +37,8 @@ public static boolean isDeclaringPackageFragment(IPackageFragment packageFragmen
// retrieve the actual file name from the full path (sources are generally only containing it already)
fileName = CharOperation.replaceOnCopy(fileName, '/', '\\'); // ensure to not do any side effect on file name (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=136016)
fileName = CharOperation.lastSegment(fileName, '\\');
-
- try {
+
+ try {
switch (packageFragment.getKind()) {
case IPackageFragmentRoot.K_SOURCE :
if (!org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(fileName) || !packageFragment.getCompilationUnit(new String(fileName)).exists()) {
@@ -60,7 +60,7 @@ public static boolean isDeclaringPackageFragment(IPackageFragment packageFragmen
// unable to determine kind; tolerate this match
}
}
- return true; // by default, do not eliminate
+ return true; // by default, do not eliminate
}
public PackageReferenceLocator(PackageReferencePattern pattern) {
@@ -220,7 +220,7 @@ protected void matchReportReference(ASTNode reference, IJavaElement element, IJa
break;
case Binding.VARIABLE : //============unbound cases===========
case Binding.TYPE | Binding.VARIABLE :
- Binding binding = qNameRef.binding;
+ Binding binding = qNameRef.binding;
if (binding instanceof TypeBinding) {
typeBinding = (TypeBinding) binding;
} else if (binding instanceof ProblemFieldBinding) {
@@ -231,7 +231,7 @@ protected void matchReportReference(ASTNode reference, IJavaElement element, IJa
typeBinding = pbBinding.searchType;
last = CharOperation.occurencesOf('.', pbBinding.name);
}
- break;
+ break;
}
} else if (reference instanceof QualifiedTypeReference) {
QualifiedTypeReference qTypeRef = (QualifiedTypeReference) reference;
@@ -329,7 +329,7 @@ public int resolveLevel(Binding binding) {
// check that type is located inside this instance of a package fragment
if (!isDeclaringPackageFragment((IPackageFragment) this.pattern.focus, (ReferenceBinding)binding))
return IMPOSSIBLE_MATCH;
- }
+ }
return ACCURATE_MATCH;
}
return IMPOSSIBLE_MATCH;
@@ -354,7 +354,7 @@ protected int resolveLevel(QualifiedNameReference qNameRef) {
*/
case Binding.VARIABLE : //============unbound cases===========
case Binding.TYPE | Binding.VARIABLE :
- Binding binding = qNameRef.binding;
+ Binding binding = qNameRef.binding;
if (binding instanceof ProblemReferenceBinding) {
typeBinding = (TypeBinding) binding;
} else if (binding instanceof ProblemFieldBinding) {
@@ -367,7 +367,7 @@ protected int resolveLevel(QualifiedNameReference qNameRef) {
return INACCURATE_MATCH;
typeBinding = pbBinding.searchType;
}
- break;
+ break;
}
return resolveLevel(typeBinding);
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageReferencePattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageReferencePattern.java
index 68bd4bf6e..bb42f3bf8 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageReferencePattern.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageReferencePattern.java
@@ -53,7 +53,7 @@ public SearchPattern getBlankPattern() {
@Override
public char[] getIndexKey() {
// Package reference keys are encoded as 'name' (where 'name' is the last segment of the package name)
- if (this.currentSegment >= 0)
+ if (this.currentSegment >= 0)
return this.segments[this.currentSegment];
return null;
}
@@ -79,7 +79,7 @@ protected void resetQuery() {
@Override
protected StringBuffer print(StringBuffer output) {
output.append("PackageReferencePattern: <"); //$NON-NLS-1$
- if (this.pkgName != null)
+ if (this.pkgName != null)
output.append(this.pkgName);
else
output.append("*"); //$NON-NLS-1$
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PatternLocator.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PatternLocator.java
index 099d4d34e..46a132276 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PatternLocator.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PatternLocator.java
@@ -83,16 +83,16 @@ public static final int CLASS_CONTAINER = 2;
public static final int METHOD_CONTAINER = 4;
public static final int FIELD_CONTAINER = 8;
//ObjectTeams: to increase the search performance we need an own match container for method mappings
-// - contains method specs and parameter mappings
-//TODO(jsv): do we need a separate container for methodSpecs and parameter mappings?
+// - contains method specs and parameter mappings
+//TODO(jsv): do we need a separate container for methodSpecs and parameter mappings?
public static final int METHOD_MAPPING_CONTAINER = 16;
//jsv}
public static final int ALL_CONTAINER =
COMPILATION_UNIT_CONTAINER | CLASS_CONTAINER | METHOD_CONTAINER | FIELD_CONTAINER
//ObjectTeams: add method mapping container to "ALL_CONTAINER"
- | METHOD_MAPPING_CONTAINER ;
-//jsv}
-
+ | METHOD_MAPPING_CONTAINER ;
+//jsv}
+
/* match rule */
public static final int RAW_MASK = SearchPattern.R_EQUIVALENT_MATCH | SearchPattern.R_ERASURE_MATCH;
@@ -129,7 +129,7 @@ public static PatternLocator patternLocator(SearchPattern pattern) {
return new TeamDeclarationLocator((TeamTypePattern) pattern);
case IIndexConstants.ROLE_DECL_PATTERN :
return new RoleDeclarationLocator((RoleTypePattern) pattern);
- case IIndexConstants.REF_TO_TEAMPACKAGE_PATTERN :
+ case IIndexConstants.REF_TO_TEAMPACKAGE_PATTERN :
return new ReferenceToTeamLocator((ReferenceToTeamPackagePattern) pattern);
//carp}
case IIndexConstants.MODULE_PATTERN:
@@ -214,7 +214,7 @@ protected TypeBinding getTypeNameBinding(int index) {
}
/**
* Initializes this search pattern so that polymorphic search can be performed.
- */
+ */
public void initializePolymorphicSearch(MatchLocator locator) {
// default is to do nothing
}
@@ -271,7 +271,7 @@ public int match(CallinMappingDeclaration callinMappingDeclaration, MatchingNode
public int match(ParameterMapping paramMapping, MatchingNodeSet nodeSet)
{
// each subtype should override if needed
- return IMPOSSIBLE_MATCH;
+ return IMPOSSIBLE_MATCH;
}
public int match(MethodSpec methodSpec, MatchingNodeSet nodeSet)
{
@@ -344,7 +344,7 @@ protected boolean matchesName(char[] pattern, char[] name) {
/**
* Return how the given name matches the given pattern.
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=79866"
- *
+ *
* @param pattern
* @param name
* @return Possible values are:
@@ -459,9 +459,9 @@ protected void matchLevelAndReportImportRef(ImportReference importRef, Binding b
int level = resolveLevel(binding);
if (level >= INACCURATE_MATCH) {
matchReportImportRef(
- importRef,
- binding,
- locator.createImportHandle(importRef),
+ importRef,
+ binding,
+ locator.createImportHandle(importRef),
level == ACCURATE_MATCH
? SearchMatch.A_ACCURATE
: SearchMatch.A_INACCURATE,
@@ -543,7 +543,7 @@ public int resolveLevel(ASTNode possibleMatchingNode) {
* Set the flavors for which the locator has to be focused on.
* If not set, the locator will accept all matches with or without flavors.
* When set, the locator will only accept match having the corresponding flavors.
- *
+ *
* @param flavors Bits mask specifying the flavors to be accepted or
* <code>0</code> to ignore the flavors while accepting matches.
*/
@@ -571,7 +571,7 @@ protected void updateMatch(ParameterizedTypeBinding parameterizedBinding, char[]
if (isRaw && !this.match.isRaw()) {
this.match.setRaw(isRaw);
}
-
+
// Update match
if (!endPattern && patternTypeArguments != null) {
// verify if this is a reference to the generic type itself
@@ -589,7 +589,7 @@ protected void updateMatch(ParameterizedTypeBinding parameterizedBinding, char[]
}
if (needUpdate) {
char[][] patternArguments = patternTypeArguments[depth];
- updateMatch(argumentsBindings, locator, patternArguments, patternHasTypeParameters);
+ updateMatch(argumentsBindings, locator, patternArguments, patternHasTypeParameters);
}
} else {
char[][] patternArguments = patternTypeArguments[depth];
@@ -626,7 +626,7 @@ protected void updateMatch(TypeBinding[] argumentsBinding, MatchLocator locator,
if (hasTypeParameters) {
matchRule = SearchPattern.R_ERASURE_MATCH;
}
-
+
// Compare arguments lengthes
if (patternTypeArgsLength == typeArgumentsLength) {
if (!this.match.isRaw() && hasTypeParameters) {
@@ -687,7 +687,7 @@ protected void updateMatch(TypeBinding[] argumentsBinding, MatchLocator locator,
}
patternTypeName = Signature.toCharArray(patternTypeName);
TypeBinding patternBinding = locator.getType(patternTypeArgument, patternTypeName);
-
+
// If have no binding for pattern arg, then we won't be able to refine accuracy
if (patternBinding == null) {
if (argumentBinding.isWildcard()) {
@@ -731,7 +731,7 @@ protected void updateMatch(TypeBinding[] argumentsBinding, MatchLocator locator,
continue;
}
} else if (argumentBinding.isCompatibleWith(patternBinding)) {
- // valid when arg is a subclass of pattern
+ // valid when arg is a subclass of pattern
matchRule &= ~SearchPattern.R_FULL_MATCH;
continue;
}
@@ -791,7 +791,7 @@ protected void updateMatch(TypeBinding[] argumentsBinding, MatchLocator locator,
continue;
break;
}
-
+
// Argument does not match => erasure match will be the only possible one
this.match.setRule(SearchPattern.R_ERASURE_MATCH);
return;
@@ -813,7 +813,7 @@ public int resolveLevel(Binding binding) {
return INACCURATE_MATCH;
}
/**
- * Returns whether the given type binding matches the given simple name pattern
+ * Returns whether the given type binding matches the given simple name pattern
* and qualification pattern.
* Note that from since 3.1, this method resolve to accurate member or local types
* even if they are not fully qualified (i.e. X.Member instead of p.X.Member).
@@ -887,7 +887,7 @@ protected int resolveLevelForType(char[] qualifiedPattern, TypeBinding type) {
IntersectionTypeBinding18 i18 = (IntersectionTypeBinding18) type;
for (ReferenceBinding ref : i18.intersectingTypes) {
result = resolveLevelForType(qualifiedPattern, ref);
- if (result == ACCURATE_MATCH) return result;
+ if (result == ACCURATE_MATCH) return result;
if (result == IMPOSSIBLE_MATCH) continue;
if (prev == IMPOSSIBLE_MATCH) prev = result;
}
@@ -918,7 +918,7 @@ protected int resolveLevelForType (char[] simpleNamePattern,
if (type == null || patternTypeArguments == null || patternTypeArguments.length == 0 || depth >= patternTypeArguments.length) {
return level;
}
-
+
// if pattern is erasure match (see bug 79790), commute impossible to erasure
int impossible = this.isErasureMatch ? ERASURE_MATCH : IMPOSSIBLE_MATCH;
@@ -945,7 +945,7 @@ protected int resolveLevelForType (char[] simpleNamePattern,
// raw type always match
if (type.isRawType()) {
return level;
- }
+ }
// Standard types (i.e. neither generic nor parameterized nor raw types)
// cannot match pattern with type parameters or arguments
@@ -1015,7 +1015,7 @@ protected int resolveLevelForType (char[] simpleNamePattern,
// If pattern is not exact then match fails
if (patternTypeArgHasAnyChars) return impossible;
-
+
// Look for bound name in type argument superclasses
boundBinding = boundBinding.superclass();
while (boundBinding != null) {
@@ -1032,7 +1032,7 @@ protected int resolveLevelForType (char[] simpleNamePattern,
}
return impossible;
}
-
+
// See if names match
if (CharOperation.match(patternTypeArgument, argTypeBinding.shortReadableName(), this.isCaseSensitive) ||
CharOperation.match(patternTypeArgument, argTypeBinding.readableName(), this.isCaseSensitive)) {
@@ -1065,7 +1065,7 @@ protected int resolveLevelForType (char[] simpleNamePattern,
return impossible;
}
}
-
+
// Recurse on enclosing type
TypeBinding enclosingType = paramTypeBinding.enclosingType();
if (enclosingType != null && enclosingType.isParameterizedType() && depth < patternTypeArguments.length && qualificationPattern != null) {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PossibleMatch.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PossibleMatch.java
index 696c085df..b704eeffc 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PossibleMatch.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PossibleMatch.java
@@ -160,7 +160,7 @@ PossibleMatch getSimilarMatch() {
private String getSourceFileName() {
if (this.sourceFileName != null) return this.sourceFileName;
- this.sourceFileName = NO_SOURCE_FILE_NAME;
+ this.sourceFileName = NO_SOURCE_FILE_NAME;
if (this.openable.getSourceMapper() != null) {
if (this.openable instanceof ClassFile) {
BinaryType type = (BinaryType) ((ClassFile) this.openable).getType();
@@ -175,7 +175,7 @@ private String getSourceFileName() {
}
}
return this.sourceFileName;
-}
+}
boolean hasSimilarMatch() {
return this.similarMatch != null && (this.source == NO_SOURCE_FILE || isModuleInfo(this));
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/QualifiedTypeDeclarationPattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/QualifiedTypeDeclarationPattern.java
index 157f1cbb6..830319467 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/QualifiedTypeDeclarationPattern.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/QualifiedTypeDeclarationPattern.java
@@ -90,7 +90,7 @@ public SearchPattern getBlankPattern() {
@Override
public boolean matchesDecodedKey(SearchPattern decodedPattern) {
QualifiedTypeDeclarationPattern pattern = (QualifiedTypeDeclarationPattern) decodedPattern;
-
+
// check type suffix
if (this.typeSuffix != pattern.typeSuffix && this.typeSuffix != TYPE_SUFFIX) {
if (!matchDifferentTypeSuffixes(this.typeSuffix, pattern.typeSuffix)) {
@@ -130,7 +130,7 @@ protected StringBuffer print(StringBuffer output) {
output.append("TypeDeclarationPattern: qualification<"); //$NON-NLS-1$
break;
}
- if (this.qualification != null)
+ if (this.qualification != null)
output.append(this.qualification);
else
output.append("*"); //$NON-NLS-1$
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/SecondaryTypeDeclarationPattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/SecondaryTypeDeclarationPattern.java
index fbe539c30..f1e553d5f 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/SecondaryTypeDeclarationPattern.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/SecondaryTypeDeclarationPattern.java
@@ -21,7 +21,7 @@ import org.eclipse.jdt.internal.core.index.Index;
import org.eclipse.jdt.internal.core.search.indexing.IIndexConstants;
public class SecondaryTypeDeclarationPattern extends TypeDeclarationPattern {
-
+
private final static char[] SECONDARY_PATTERN_KEY = "*/S".toCharArray(); //$NON-NLS-1$
public SecondaryTypeDeclarationPattern() {
@@ -46,5 +46,5 @@ protected StringBuffer print(StringBuffer output) {
public EntryResult[] queryIn(Index index) throws IOException {
return index.query(CATEGORIES, SECONDARY_PATTERN_KEY, R_PATTERN_MATCH | R_CASE_SENSITIVE);
}
-
+
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/SuperTypeNamesCollector.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/SuperTypeNamesCollector.java
index 9990d6a26..389e99b04 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/SuperTypeNamesCollector.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/SuperTypeNamesCollector.java
@@ -120,7 +120,7 @@ private boolean addIfSamePackage(char[][] compoundName, char[][] path) {
int resultLength = this.samePackageSuperTypeName.length;
for (int i = 0; i < resultLength; i++)
if (CharOperation.equals(this.samePackageSuperTypeName[i], compoundName)) return false; // already known
-
+
for (int i = 0, length = compoundName.length - 1; i < length; i ++) {
if (!CharOperation.equals(compoundName[i], path[i])) return false;
}
@@ -164,11 +164,11 @@ protected CompilationUnitDeclaration buildBindings(ICompilationUnit compilationU
// if (unit.scope != null)
// unit.scope.faultInTypes(); // fault in fields & methods
// unit.resolve();
-// :giro
+// :giro
Dependencies.ensureState(unit, ITranslationStates.STATE_RESOLVED);
}
}
-// SH}
+// SH}
}
return unit;
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferenceLocator.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferenceLocator.java
index 824a5c146..e0609bc5b 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferenceLocator.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferenceLocator.java
@@ -65,7 +65,7 @@ public int match(TypeReference node, MatchingNodeSet nodeSet) {
} else { // QualifiedTypeReference
char[][] tokens = ((QualifiedTypeReference) node).tokens;
typeRefSimpleName = tokens[tokens.length-1];
- }
+ }
if (matchesName(this.pattern.superSimpleName, typeRefSimpleName))
return nodeSet.addMatch(node, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH);
@@ -139,7 +139,7 @@ public int resolveLevel(Binding binding) {
case SuperTypeReferencePattern.ALL_SUPER_TYPES:
case SuperTypeReferencePattern.ONLY_BASE_CLASSES:
level = resolveLevelForType(this.pattern.superSimpleName, this.pattern.superQualification, type.baseclass());
- if (level == ACCURATE_MATCH) return ACCURATE_MATCH;
+ if (level == ACCURATE_MATCH) return ACCURATE_MATCH;
}
// SH}
if (this.pattern.superRefKind != SuperTypeReferencePattern.ONLY_SUPER_INTERFACES) {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferencePattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferencePattern.java
index c41517b36..fff8cfdf8 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferencePattern.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferencePattern.java
@@ -28,10 +28,10 @@ public char[] superQualification;
public char[] superSimpleName;
public char superClassOrInterface;
-// set to CLASS_SUFFIX for only matching classes
+// set to CLASS_SUFFIX for only matching classes
// set to INTERFACE_SUFFIX for only matching interfaces
// set to TYPE_SUFFIX for matching both classes and interfaces
-public char typeSuffix;
+public char typeSuffix;
public char[] pkgName;
public char[] simpleName;
public char[] enclosingTypeName;
@@ -64,7 +64,7 @@ public static char[] createIndexKey(
if (Flags.isTeam(modifiers))
superTypeName = TEAM;
else
-//MW + AK}
+//MW + AK}
superTypeName = OBJECT;
char[] superSimpleName = CharOperation.lastSegment(superTypeName, '.');
char[] superQualification = null;
@@ -94,7 +94,7 @@ public static char[] createIndexKey(
char[] enclosingTypeName = CharOperation.concatWith(enclosingTypeNames, '$');
if (superQualification != null && CharOperation.equals(superQualification, packageName))
packageName = ONE_ZERO; // save some space
-
+
char[] typeParameters = CharOperation.NO_CHAR;
int typeParametersLength = 0;
if (typeParameterSignatures != null) {
@@ -264,16 +264,16 @@ public char[][] getIndexCategories() {
@Override
public boolean matchesDecodedKey(SearchPattern decodedPattern) {
SuperTypeReferencePattern pattern = (SuperTypeReferencePattern) decodedPattern;
- if (this.superRefKind == ONLY_SUPER_CLASSES && pattern.enclosingTypeName != ONE_ZERO/*not an anonymous*/)
+ if (this.superRefKind == ONLY_SUPER_CLASSES && pattern.enclosingTypeName != ONE_ZERO/*not an anonymous*/)
// consider enumerations as classes, reject interfaces and annotations
- if (pattern.superClassOrInterface == INTERFACE_SUFFIX
- || pattern.superClassOrInterface == ANNOTATION_TYPE_SUFFIX)
+ if (pattern.superClassOrInterface == INTERFACE_SUFFIX
+ || pattern.superClassOrInterface == ANNOTATION_TYPE_SUFFIX)
return false;
//{ObjectTeams: don't mix baseclass and super references
if ((this.superRefKind == ONLY_BASE_CLASSES) != (pattern.superClassOrInterface == BASECLASS_SUFFIX))
return false;
// SH}
-
+
if (pattern.superQualification != null)
if (!matchesName(this.superQualification, pattern.superQualification)) return false;
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationLocator.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationLocator.java
index 3e878c2ed..04a4c5c85 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationLocator.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationLocator.java
@@ -115,7 +115,7 @@ public int resolveLevel(Binding binding) {
}
}
/**
- * Returns whether the given type binding matches the given simple name pattern
+ * Returns whether the given type binding matches the given simple name pattern
* qualification pattern and enclosing type name pattern.
*/
protected int resolveLevelForType(char[] simpleNamePattern, char[] qualificationPattern, char[] enclosingNamePattern, TypeBinding type) {
@@ -131,7 +131,7 @@ protected int resolveLevelForType(char[] simpleNamePattern, char[] qualification
char[] fullQualificationPattern = CharOperation.concat(qualificationPattern, enclosingNamePattern, '.');
if (CharOperation.equals(this.pattern.pkg, CharOperation.concatWith(type.getPackage().compoundName, '.')))
return resolveLevelForType(simpleNamePattern, fullQualificationPattern, type);
-//{ObjectTeams: must use compound name of enclosing type (declaring team) in case of role declarations in role files
+//{ObjectTeams: must use compound name of enclosing type (declaring team) in case of role declarations in role files
if (type instanceof MemberTypeBinding)
{
MemberTypeBinding roleType = (MemberTypeBinding)type;
@@ -174,7 +174,7 @@ private HashSet<String> getModuleGraph(String mName, TypeDeclarationPattern type
}
}
};
- final SearchRequestor requestor = new SearchRequestor() {
+ final SearchRequestor requestor = new SearchRequestor() {
@Override
public void acceptSearchMatch(SearchMatch searchMatch) throws CoreException {
System.out.println(searchMatch.toString());
@@ -210,13 +210,13 @@ private char[][] getModuleList(TypeDeclarationPattern typePattern) {
char[][] tmp = new char[sz][];
for (int i = 0; i < sz; ++i) {
tmp[i] = ar[i].toCharArray();
- }
+ }
typePattern.moduleGraphElements = tmp;
}
return typePattern.moduleGraphElements;
}
private int matchModule(TypeDeclarationPattern typePattern, TypeBinding type) {
- if (!(type instanceof ReferenceBinding))
+ if (!(type instanceof ReferenceBinding))
return INACCURATE_MATCH; // a safety net, should not come here for error free code.
ReferenceBinding reference = (ReferenceBinding) type;
ModuleBinding module = reference.module();
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern.java
index b27fda3da..dff4bdbd9 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern.java
@@ -34,12 +34,12 @@ private boolean allowModuleRegex = false; // enable to try experimental Module R
public boolean moduleGraph = false;
/* package */ char[][] moduleGraphElements = null;
-// set to CLASS_SUFFIX for only matching classes
+// set to CLASS_SUFFIX for only matching classes
// set to INTERFACE_SUFFIX for only matching interfaces
// set to ENUM_SUFFIX for only matching enums
// set to ANNOTATION_TYPE_SUFFIX for only matching annotation types
// set to TYPE_SUFFIX for matching both classes and interfaces
-public char typeSuffix;
+public char typeSuffix;
public int modifiers;
public boolean secondary = false;
@@ -186,7 +186,7 @@ protected void addModuleNames(char[] modNames) {
final String explicit_unnamed = new String(IJavaSearchConstants.ALL_UNNAMED);
String[] names = new String(modNames).split(String.valueOf(CharOperation.COMMA_SEPARATOR));
int len = names.length;
- if (this.allowModuleRegex && len > 0 && names[0] != null && names[0].length() > 0
+ if (this.allowModuleRegex && len > 0 && names[0] != null && names[0].length() > 0
&& names[0].charAt(0) == IIndexConstants.ZERO_CHAR) { //pattern
names[0] = names[0].substring(1);
this.modulePatterns = new Pattern[len];
@@ -280,7 +280,7 @@ public char[][] getIndexCategories() {
@Override
public boolean matchesDecodedKey(SearchPattern decodedPattern) {
TypeDeclarationPattern pattern = (TypeDeclarationPattern) decodedPattern;
-
+
// check type suffix
if (this.typeSuffix != pattern.typeSuffix && this.typeSuffix != TYPE_SUFFIX) {
if (!matchDifferentTypeSuffixes(this.typeSuffix, pattern.typeSuffix)) {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeParameterLocator.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeParameterLocator.java
index e3c06dcbb..d107e1cb3 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeParameterLocator.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeParameterLocator.java
@@ -141,7 +141,7 @@ public class TypeParameterLocator extends PatternLocator {
public int resolveLevel(Binding binding) {
if (binding == null) return INACCURATE_MATCH;
if (!(binding instanceof TypeVariableBinding)) return IMPOSSIBLE_MATCH;
-
+
return matchTypeParameter((TypeVariableBinding) binding, true);
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeParameterPattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeParameterPattern.java
index e72e51220..e3d2083f7 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeParameterPattern.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeParameterPattern.java
@@ -63,7 +63,7 @@ public class TypeParameterPattern extends JavaSearchPattern {
this.name = typeParameter.getElementName().toCharArray(); // store type parameter name
IMember member = typeParameter.getDeclaringMember();
this.declaringMemberName = member.getElementName().toCharArray(); // store type parameter declaring member name
-
+
// For method type parameter, store also declaring class name and parameters type names
if (member instanceof IMethod) {
IMethod method = (IMethod) member;
@@ -91,7 +91,7 @@ public class TypeParameterPattern extends JavaSearchPattern {
IModuleDescription md = root.getModuleDescription();
if(md != null) {
String module = md.getElementName();
- documentPath = root.getPath() + IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR
+ documentPath = root.getPath() + IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR
+ module + IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR + relativePath;
} else {
documentPath = root.getPath() + IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR + relativePath;
@@ -101,18 +101,18 @@ public class TypeParameterPattern extends JavaSearchPattern {
documentPath = path.toString();
relativePath = Util.relativePath(path, 1/*remove project segment*/);
}
-
+
if (scope instanceof JavaSearchScope) {
JavaSearchScope javaSearchScope = (JavaSearchScope) scope;
// Get document path access restriction from java search scope
// Note that requestor has to verify if needed whether the document violates the access restriction or not
AccessRuleSet access = javaSearchScope.getAccessRuleSet(relativePath, index.containerPath);
if (access != JavaSearchScope.NOT_ENCLOSED) { // scope encloses the path
- if (!requestor.acceptIndexMatch(documentPath, this, participant, access))
+ if (!requestor.acceptIndexMatch(documentPath, this, participant, access))
throw new OperationCanceledException();
}
} else if (scope.encloses(documentPath)) {
- if (!requestor.acceptIndexMatch(documentPath, this, participant, null))
+ if (!requestor.acceptIndexMatch(documentPath, this, participant, null))
throw new OperationCanceledException();
}
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java
index 2fb0e7c7b..db9dab7b9 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java
@@ -54,7 +54,7 @@ protected IJavaElement findElement(IJavaElement element, int accuracy) {
if (accuracy != SearchMatch.A_ACCURATE) return null;
// element that references the type must be included in the enclosing element
- DeclarationOfReferencedTypesPattern declPattern = (DeclarationOfReferencedTypesPattern) this.pattern;
+ DeclarationOfReferencedTypesPattern declPattern = (DeclarationOfReferencedTypesPattern) this.pattern;
while (element != null && !declPattern.enclosingElement.equals(element))
element = element.getParent();
return element;
@@ -87,7 +87,7 @@ public int match(Reference node, MatchingNodeSet nodeSet) { // interested in Nam
if (node instanceof SingleNameReference) {
if (matchesName(this.pattern.simpleName, ((SingleNameReference) node).token))
- return nodeSet.addMatch(node, POSSIBLE_MATCH); // resolution is needed to find out if it is a type ref
+ return nodeSet.addMatch(node, POSSIBLE_MATCH); // resolution is needed to find out if it is a type ref
} else {
char[][] tokens = ((QualifiedNameReference) node).tokens;
for (int i = 0, max = tokens.length; i < max; i++)
@@ -215,9 +215,9 @@ protected void matchLevelAndReportImportRef(ImportReference importRef, Binding b
int level = resolveLevel(refBinding);
if (level >= INACCURATE_MATCH) {
matchReportImportRef(
- importRef,
- binding,
- locator.createImportHandle(importRef),
+ importRef,
+ binding,
+ locator.createImportHandle(importRef),
level == ACCURATE_MATCH
? SearchMatch.A_ACCURATE
: SearchMatch.A_INACCURATE,
@@ -231,7 +231,7 @@ protected void matchLevelAndReportImportRef(ImportReference importRef, Binding b
protected void matchReportImportRef(ImportReference importRef, Binding binding, IJavaElement element, int accuracy, MatchLocator locator) throws CoreException {
if (this.isDeclarationOfReferencedTypesPattern) {
if ((element = findElement(element, accuracy)) != null) {
- SimpleSet knownTypes = ((DeclarationOfReferencedTypesPattern) this.pattern).knownTypes;
+ SimpleSet knownTypes = ((DeclarationOfReferencedTypesPattern) this.pattern).knownTypes;
while (binding instanceof ReferenceBinding) {
ReferenceBinding typeBinding = (ReferenceBinding) binding;
reportDeclaration(typeBinding, 1, locator, knownTypes);
@@ -245,7 +245,7 @@ protected void matchReportImportRef(ImportReference importRef, Binding binding,
if (this.pattern.hasTypeArguments() && !this.isEquivalentMatch &&!this.isErasureMatch) {
return;
}
-
+
// Return if fine grain is on and does not concern import reference
if ((this.pattern.fineGrain != 0 && (this.pattern.fineGrain & IJavaSearchConstants.IMPORT_DECLARATION_TYPE_REFERENCE) == 0)) {
return;
@@ -260,7 +260,7 @@ protected void matchReportImportRef(ImportReference importRef, Binding binding,
// binding is raw => only compatible erasure if pattern has type arguments
this.match.setRule(this.match.getRule() & (~SearchPattern.R_FULL_MATCH));
}
-
+
// Try to find best selection for match
TypeBinding typeBinding = null;
boolean lastButOne = false;
@@ -363,7 +363,7 @@ protected void matchReportReference(ASTNode reference, IJavaElement element, IJa
} else {
accuracy ^= SearchMatch.A_CHECKED;
}
-// SH}
+// SH}
// Create search match
TypeReferenceMatch refMatch = locator.newTypeReferenceMatch(element, elementBinding, accuracy, reference);
refMatch.setLocalElement(localElement);
@@ -411,7 +411,7 @@ protected void matchReportReference(QualifiedNameReference qNameRef, IJavaElemen
} else if (binding instanceof ProblemBinding) {
typeBinding = ((ProblemBinding) binding).searchType;
}
- break;
+ break;
}
if (typeBinding instanceof ProblemReferenceBinding) {
ProblemReferenceBinding pbBinding = (ProblemReferenceBinding) typeBinding;
@@ -426,7 +426,7 @@ protected void matchReportReference(QualifiedNameReference qNameRef, IJavaElemen
// try to match all enclosing types for which the token matches as well.
if (typeBinding instanceof ReferenceBinding) {
- ReferenceBinding refBinding = (ReferenceBinding) typeBinding;
+ ReferenceBinding refBinding = (ReferenceBinding) typeBinding;
while (refBinding != null && lastIndex >= 0) {
if (resolveLevelForType(refBinding) == ACCURATE_MATCH) {
if (locator.encloses(element)) {
@@ -471,7 +471,7 @@ protected void matchReportReference(QualifiedTypeReference qTypeRef, IJavaElemen
// try to match all enclosing types for which the token matches as well
if (typeBinding instanceof ReferenceBinding) {
- ReferenceBinding refBinding = (ReferenceBinding) typeBinding;
+ ReferenceBinding refBinding = (ReferenceBinding) typeBinding;
while (refBinding != null && lastIndex >= 0) {
if (resolveLevelForType(refBinding) != IMPOSSIBLE_MATCH) {
if (locator.encloses(element)) {
@@ -506,7 +506,7 @@ void matchReportReference(Expression expr, int lastIndex, TypeBinding refBinding
// Try to refine accuracy
ParameterizedTypeBinding parameterizedBinding = (ParameterizedTypeBinding)refBinding;
updateMatch(parameterizedBinding, this.pattern.getTypeArguments(), this.pattern.hasTypeParameters(), 0, locator);
-
+
// See whether it is necessary to report or not
if (this.match.getRule() == 0) return; // impossible match
boolean report = (this.isErasureMatch && this.match.isErasure()) || (this.isEquivalentMatch && this.match.isEquivalent()) || this.match.isExact();
@@ -596,7 +596,7 @@ protected void reportDeclaration(ASTNode reference, IJavaElement element, MatchL
typeBinding = (TypeBinding) ((SingleNameReference) reference).binding;
maxType = 1;
}
-
+
if (typeBinding instanceof ArrayBinding)
typeBinding = ((ArrayBinding) typeBinding).leafComponentType;
if (typeBinding == null || typeBinding instanceof BaseTypeBinding) return;
@@ -679,7 +679,7 @@ protected int resolveLevel(NameReference nameRef) {
return resolveLevelForType((ReferenceBinding) binding);
if (((SingleNameReference) nameRef).isLabel)
return IMPOSSIBLE_MATCH;
-
+
return binding == null || binding instanceof ProblemBinding ? INACCURATE_MATCH : IMPOSSIBLE_MATCH;
}
@@ -785,7 +785,7 @@ protected int resolveLevelForTypeOrEnclosingTypes(char[] simpleNamePattern, char
while (type != null) {
int level = resolveLevelForType(type);
if (level != IMPOSSIBLE_MATCH) return level;
-
+
type = type.enclosingType();
}
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeReferencePattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeReferencePattern.java
index 1b401775f..8022c6ba0 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeReferencePattern.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeReferencePattern.java
@@ -20,17 +20,17 @@ import org.eclipse.jdt.core.search.SearchPattern;
import org.eclipse.jdt.internal.core.util.Util;
public class TypeReferencePattern extends IntersectingPattern {
-
+
protected char[] qualification;
protected char[] simpleName;
-
+
protected char[] currentCategory;
-
+
/* Optimization: case where simpleName == null */
public int segmentsSize;
protected char[][] segments;
protected int currentSegment;
-
+
private final static char[][]
CATEGORIES = { REF, ANNOTATION_REF },
CATEGORIES_ANNOT_REF = { ANNOTATION_REF };
@@ -39,15 +39,15 @@ public class TypeReferencePattern extends IntersectingPattern {
public TypeReferencePattern(char[] qualification, char[] simpleName, int matchRule) {
this(matchRule);
-
+
this.qualification = this.isCaseSensitive ? qualification : CharOperation.toLowerCase(qualification);
this.simpleName = (this.isCaseSensitive || this.isCamelCase) ? simpleName : CharOperation.toLowerCase(simpleName);
-
+
if (simpleName == null)
this.segments = this.qualification == null ? ONE_STAR_CHAR : CharOperation.splitOn('.', this.qualification);
else
this.segments = null;
-
+
if (this.segments == null)
if (this.qualification == null)
this.segmentsSize = 0;
@@ -55,7 +55,7 @@ public class TypeReferencePattern extends IntersectingPattern {
this.segmentsSize = CharOperation.occurencesOf('.', this.qualification) + 1;
else
this.segmentsSize = this.segments.length;
-
+
this.mustResolve = true; // always resolve (in case of a simple name reference being a potential match)
}
/*
@@ -123,9 +123,9 @@ public class TypeReferencePattern extends IntersectingPattern {
public char[] getIndexKey() {
if (this.simpleName != null)
return this.simpleName;
-
+
// Optimization, e.g. type reference is 'org.eclipse.jdt.core.*'
- if (this.currentSegment >= 0)
+ if (this.currentSegment >= 0)
return this.segments[this.currentSegment];
return null;
}
@@ -136,7 +136,7 @@ public class TypeReferencePattern extends IntersectingPattern {
@Override
protected boolean hasNextQuery() {
if (this.segments == null) return false;
-
+
// Optimization, e.g. type reference is 'org.eclipse.jdt.core.*'
// if package has at least 4 segments, don't look at the first 2 since they are mostly
// redundant (e.g. in 'org.eclipse.jdt.core.*' 'org.eclipse' is used all the time)
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/VariablePattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/VariablePattern.java
index 449a1844f..8b55205fd 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/VariablePattern.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/VariablePattern.java
@@ -62,11 +62,11 @@ public VariablePattern(int patternKind, char[] name, int limitTo, int matchRule)
this.name = (this.isCaseSensitive || this.isCamelCase) ? name : CharOperation.toLowerCase(name);
}
/*
- * Returns whether a method declaration or message send will need to be resolved to
+ * Returns whether a method declaration or message send will need to be resolved to
* find out if this method pattern matches it.
*/
protected boolean mustResolve() {
// would like to change this so that we only do it if generic references are found
return this.findReferences || this.fineGrain != 0; // always resolve (in case of a simple name reference being a potential match)
-}
+}
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/processing/IJob.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/processing/IJob.java
index 263825ca4..158a30e9f 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/processing/IJob.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/processing/IJob.java
@@ -43,7 +43,7 @@ public interface IJob {
* Execute the current job, answer whether it was successful.
*/
public boolean execute(IProgressMonitor progress);
-
+
/**
* Returns this job's family
*/
diff --git a/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/core/search/Messages.java b/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/core/search/Messages.java
index 96f62f571..4c3708d52 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/core/search/Messages.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/core/search/Messages.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2013 GK Software AG, Germany,
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -23,11 +23,11 @@ import org.eclipse.osgi.util.NLS;
* @since 3.10 (OT 2.3)
*/
public class Messages extends NLS {
-
+
private static final String BUNDLE_NAME = "org.eclipse.objectteams.otdt.core.search.messages"; //$NON-NLS-1$
-
+
public static String OTSearchHelper_progress_searchRoleTypes;
-
+
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
diff --git a/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/core/search/OTSearchEngine.java b/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/core/search/OTSearchEngine.java
index d13c67bb2..72f3e2d87 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/core/search/OTSearchEngine.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/core/search/OTSearchEngine.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: OTSearchEngine.java 23417 2010-02-03 20:13:55Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -38,7 +38,7 @@ import org.eclipse.objectteams.otdt.internal.core.search.matching.TeamTypePatter
/**
* This class allows for searching all kinds of ObjectTeams specific elements.
- * Note that you can combine the patterns with other patterns, e.g. via
+ * Note that you can combine the patterns with other patterns, e.g. via
* SearchPattern.createAndPattern(SearchPattern left, SearchPattern right).
*
* @author gis
@@ -46,7 +46,7 @@ import org.eclipse.objectteams.otdt.internal.core.search.matching.TeamTypePatter
public class OTSearchEngine
{
private SearchEngine m_searchEngine = new SearchEngine();
-
+
//TODO: check whether this will be synchronous or asynchronous and whether we will keep a cache like AllTypesCache
// Note that the pattern's limitTo rule does not work in Eclipse 3.0 (see #73696)
// Work around this by using an appropriate SearchRequestor.
@@ -59,7 +59,7 @@ public class OTSearchEngine
requestor,
monitor);
}
-
+
/**
* Optimized search scope for OT elements (not including system libraries, which can't contain OT elements)
* @param elements pure IJavaElements or IOTJavaElements
@@ -67,19 +67,19 @@ public class OTSearchEngine
public static IJavaSearchScope createOTSearchScope(IJavaElement[] elements, boolean includeReferencedProjects)
{
IJavaElement[] javaElements = convertOTToJavaElements(elements);
-
+
int includeMask = IJavaSearchScope.SOURCES | IJavaSearchScope.APPLICATION_LIBRARIES;
if (includeReferencedProjects) {
includeMask |= IJavaSearchScope.REFERENCED_PROJECTS;
}
return SearchEngine.createJavaSearchScope(javaElements, includeMask);
}
-
- private static IJavaElement[] convertOTToJavaElements(IJavaElement[] elements)
+
+ private static IJavaElement[] convertOTToJavaElements(IJavaElement[] elements)
{
IJavaElement[] javaElements = new IJavaElement[elements.length];
System.arraycopy(elements, 0, javaElements, 0, elements.length);
-
+
for (int i = 0; i < javaElements.length; i++) {
IJavaElement element = javaElements[i];
if (element instanceof IOTJavaElement)
@@ -101,7 +101,7 @@ public class OTSearchEngine
}
public static SearchPattern createTeamTypePattern(
- char[] pkg,
+ char[] pkg,
char[][] enclosingTypeNames,
char[] simpleName,
int limitTo,
@@ -123,7 +123,7 @@ public class OTSearchEngine
}
public static SearchPattern createRoleTypePattern(
- char[] pkg,
+ char[] pkg,
char[][] enclosingTypeNames,
char[] simpleName,
int limitTo,
diff --git a/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/core/search/OTSearchHelper.java b/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/core/search/OTSearchHelper.java
index c7116ae5d..95beb47e6 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/core/search/OTSearchHelper.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/core/search/OTSearchHelper.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2013 GK Software AG, Germany,
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -49,7 +49,7 @@ public class OTSearchHelper {
* @param key
* @param value
*/
- public static <M extends IMember> void addToMapOfSets(final Map<IMember, Set<M>> mapOfSets, IMember key, M value)
+ public static <M extends IMember> void addToMapOfSets(final Map<IMember, Set<M>> mapOfSets, IMember key, M value)
{
Set<M> setForType = mapOfSets.get(key);
if (setForType == null)
@@ -59,8 +59,8 @@ public class OTSearchHelper {
/**
* Find all playedBy bindings within a given set of projects refering to one of baseTypes as its baseclass.
- *
- * @param baseTypes
+ *
+ * @param baseTypes
* @param projects
* @param monitor
* @return a map indexed by base types containing sets of role types bound to the given base type.
@@ -72,14 +72,14 @@ public class OTSearchHelper {
monitor.done();
return null;
}
-
+
OTSearchEngine engine = new OTSearchEngine();
IJavaSearchScope searchScope = OTSearchEngine.createOTSearchScope(projects, false);
final Map<IMember, Set<IType>> resultMap = new HashMap<IMember, Set<IType>>();
-
+
try {
monitor.beginTask(Messages.OTSearchHelper_progress_searchRoleTypes, baseTypes.size());
-
+
for (final IType baseType : baseTypes)
{
if (monitor.isCanceled()) return null;
@@ -89,14 +89,14 @@ public class OTSearchHelper {
if (!baseType.exists()) // ensure it's 'open'
continue;
if (baseType.isEnum() || baseType.isAnnotation())
- continue; // no callin-to-enum/annot
+ continue; // no callin-to-enum/annot
SearchPattern pattern = SearchPattern.createPattern(baseType, IJavaSearchConstants.PLAYEDBY_REFERENCES);
if (pattern == null)
JavaCore.getJavaCore().getLog().log(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, "Error creating pattern")); //$NON-NLS-1$
else
engine.search(
- pattern,
- searchScope,
+ pattern,
+ searchScope,
new SearchRequestor() {
@Override
public void acceptSearchMatch(SearchMatch match)
@@ -118,7 +118,7 @@ public class OTSearchHelper {
finally {
monitor.done();
}
-
+
return resultMap;
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/core/search/OTSearchRequestor.java b/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/core/search/OTSearchRequestor.java
index fc21890c7..6a1d94511 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/core/search/OTSearchRequestor.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/core/search/OTSearchRequestor.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: OTSearchRequestor.java 23416 2010-02-03 19:59:31Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -42,7 +42,7 @@ import org.eclipse.objectteams.otdt.core.OTModelManager;
public class OTSearchRequestor extends SearchRequestor
{
private ArrayList<IOTType> otTypes = null;
-
+
public OTSearchRequestor()
{
this.otTypes = new ArrayList<IOTType>();
@@ -53,10 +53,10 @@ public class OTSearchRequestor extends SearchRequestor
{
IType javaType = null;
Object element = match.getElement();
-
+
if (element instanceof IType)
javaType = (IType) element;
-
+
else if (match.getResource() != null)
{
IJavaElement jel = JavaCore.create(match.getResource());
@@ -69,7 +69,7 @@ public class OTSearchRequestor extends SearchRequestor
IOTType otType = OTModelManager.getOTElement(javaType);
if (otType == null)
{
- try
+ try
{
int modifiers = javaType.getFlags();
if (Flags.isTeam(modifiers) || Flags.isRole(modifiers)) {
@@ -81,12 +81,12 @@ public class OTSearchRequestor extends SearchRequestor
// ignore -- element probably not present (e.g. because of __OT__RoleClass looking for its source)
}
}
-
+
if (otType != null)
this.otTypes.add(otType);
}
}
-
+
public IOTType[] getOTTypes()
{
return this.otTypes.toArray(new IOTType[(this.otTypes.size())]);
diff --git a/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/internal/core/search/matching/ReferenceToTeamLocator.java b/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/internal/core/search/matching/ReferenceToTeamLocator.java
index 60b5d0625..b815574a7 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/internal/core/search/matching/ReferenceToTeamLocator.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/internal/core/search/matching/ReferenceToTeamLocator.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2005, 2009 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: ReferenceToTeamLocator.java 23417 2010-02-03 20:13:55Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -35,7 +35,7 @@ import org.eclipse.jdt.internal.core.search.matching.PatternLocator;
* NEW for OTDT
* <br>
* This locator performs the final matching for {@link ReferenceToTeamPackagePattern}s.
- *
+ *
* @author haebor
*
* 14.06.2005
@@ -43,7 +43,7 @@ import org.eclipse.jdt.internal.core.search.matching.PatternLocator;
public class ReferenceToTeamLocator extends PatternLocator
{
ReferenceToTeamPackagePattern pattern;
-
+
/**
* @param pattern
*/
@@ -53,7 +53,7 @@ public class ReferenceToTeamLocator extends PatternLocator
this.pattern = pattern;
}
- /**
+ /**
* An import reference was found, is it a team package declaration
* that matches the pattern?
*/
@@ -63,15 +63,15 @@ public class ReferenceToTeamLocator extends PatternLocator
return IMPOSSIBLE_MATCH;
return this.pattern.matches(importRef);
}
-
+
/**
* A match was found, perform final check:
* if a role was specified check the current compilation unit's first type against the role name.
* If successful report as a type reference match regarding this first type.
*/
@Override
- protected void matchReportImportRef(ImportReference importRef, Binding binding, IJavaElement element, int accuracy, MatchLocator locator)
- throws CoreException
+ protected void matchReportImportRef(ImportReference importRef, Binding binding, IJavaElement element, int accuracy, MatchLocator locator)
+ throws CoreException
{
if (locator.encloses(element)) {
ICompilationUnit cu = (ICompilationUnit) element.getAncestor(IJavaElement.COMPILATION_UNIT);
@@ -82,7 +82,7 @@ public class ReferenceToTeamLocator extends PatternLocator
if ( this.pattern.roleName != null
&& !new String(this.pattern.roleName).equals(types[0].getElementName()))
return;
-
+
int offset = importRef.sourceStart;
int length = importRef.sourceEnd-offset+1;
this.match = locator.newTypeReferenceMatch(types[0], null/*binding*/, accuracy, offset, length, importRef);
@@ -92,9 +92,9 @@ public class ReferenceToTeamLocator extends PatternLocator
}
}
}
-
+
@Override
- protected int matchContainer()
+ protected int matchContainer()
{
return COMPILATION_UNIT_CONTAINER;
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/internal/core/search/matching/ReferenceToTeamPackagePattern.java b/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/internal/core/search/matching/ReferenceToTeamPackagePattern.java
index 4d2bf6cc3..d1e8e5e34 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/internal/core/search/matching/ReferenceToTeamPackagePattern.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/internal/core/search/matching/ReferenceToTeamPackagePattern.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2005, 2009 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: ReferenceToTeamPackagePattern.java 23417 2010-02-03 20:13:55Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -33,15 +33,15 @@ import org.eclipse.jdt.internal.core.search.matching.PatternLocator;
* NEW for OTDT.
* <br>
* This pattern is used to find role files of a given team.
- *
+ *
* Searching uses the team package declaration of the role files.
* These declarations are indexed as {@link IIndexConstants#REF_TO_TEAMPACKAGE}.
- * The match locator calls {@link ReferenceToTeamPackagePattern#matches(ImportReference)} for stage 1 matching,
+ * The match locator calls {@link ReferenceToTeamPackagePattern#matches(ImportReference)} for stage 1 matching,
* conclusive matching is performed by the {@link ReferenceToTeamLocator}.
* <br>
* This pattern can be used to either search all role files of a given team or only
* one specific role given by it's name.
- *
+ *
* @author haebor
*
* 14.06.2005
@@ -52,7 +52,7 @@ public class ReferenceToTeamPackagePattern extends JavaSearchPattern
protected char[] teamQualifiedName;
protected char[] roleName;
protected char[] _indexKey;
-
+
/**
* qualifiedTeamName/roleSimpleName
*/
@@ -61,8 +61,8 @@ public class ReferenceToTeamPackagePattern extends JavaSearchPattern
char[] result = CharOperation.concat(teamName, roleName, '/');
assert(result != null);
return result;
- }
-
+ }
+
/**
* Create a pattern for finding all role files of a given team.
* @param teamName the name of the team to start at
@@ -72,11 +72,11 @@ public class ReferenceToTeamPackagePattern extends JavaSearchPattern
{
this(teamName, null, matchRule);
}
-
+
/**
* Create a pattern for finding a specific role file of a given team.
* @param teamQualifiedName the name of the team to start at
- * @param roleName name of the role in the role file to search,
+ * @param roleName name of the role in the role file to search,
* if null is passed all role files of the given team will be found.
* @param matchRule bitset of constants defined in {@link SearchPattern}
*/
@@ -84,16 +84,16 @@ public class ReferenceToTeamPackagePattern extends JavaSearchPattern
{
super(IIndexConstants.REF_TO_TEAMPACKAGE_PATTERN, matchRule | R_EXACT_MATCH | R_CASE_SENSITIVE);
this.mustResolve = false;
-
+
if (teamQualifiedName == null)
throw new NullPointerException("teamQualifiedName must not be null"); //$NON-NLS-1$
- this.teamQualifiedName = teamQualifiedName;
+ this.teamQualifiedName = teamQualifiedName;
this.roleName = roleName;
-
+
createIndexKey();
}
-
+
/**
* @param patternKind
* @param matchRule
@@ -105,7 +105,7 @@ public class ReferenceToTeamPackagePattern extends JavaSearchPattern
}
@Override
- public SearchPattern getBlankPattern()
+ public SearchPattern getBlankPattern()
{
return new ReferenceToTeamPackagePattern(IIndexConstants.REF_TO_TEAMPACKAGE_PATTERN, R_EXACT_MATCH | R_CASE_SENSITIVE);
}
@@ -115,7 +115,7 @@ public class ReferenceToTeamPackagePattern extends JavaSearchPattern
{
return CATEGORIES;
}
-
+
@Override
public boolean matchesDecodedKey(SearchPattern decodedPattern)
{
@@ -123,10 +123,10 @@ public class ReferenceToTeamPackagePattern extends JavaSearchPattern
boolean teamMatches = matchesName(this.teamQualifiedName, pattern.teamQualifiedName);
if (!teamMatches)
return false;
-
+
return matchesName(this.roleName, pattern.roleName);
}
-
+
public int matches(ImportReference importRef) {
// note: _roleName is not compared at this stage, deferred to handling by the ReferenceToTeamLocator
if (matchesName(this.teamQualifiedName, CharOperation.concatWith(importRef.tokens, '.')))
@@ -147,10 +147,10 @@ public class ReferenceToTeamPackagePattern extends JavaSearchPattern
{
// If this assertion ever fails, then decodeIndexKey() probably needs to call createIndexKey().
assert(this._indexKey != null);
-
+
return this._indexKey;
}
-
+
@Override
public void decodeIndexKey(char[] key)
{
diff --git a/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/internal/core/search/matching/RoleDeclarationLocator.java b/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/internal/core/search/matching/RoleDeclarationLocator.java
index ff99688c0..ccb95904f 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/internal/core/search/matching/RoleDeclarationLocator.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/internal/core/search/matching/RoleDeclarationLocator.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: RoleDeclarationLocator.java 23417 2010-02-03 20:13:55Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -31,8 +31,8 @@ import org.eclipse.jdt.internal.core.search.matching.TypeDeclarationLocator;
/**
* NEW for OTDT
- *
- * A Locator for Roles (all non-teams are IMPOSSIBLE_MATCHes)
+ *
+ * A Locator for Roles (all non-teams are IMPOSSIBLE_MATCHes)
* @author gis
*/
public class RoleDeclarationLocator extends TypeDeclarationLocator
@@ -47,7 +47,7 @@ public class RoleDeclarationLocator extends TypeDeclarationLocator
{
if (!Flags.isRole(type.modifiers))
return IMPOSSIBLE_MATCH;
-
+
return super.match(type, nodeSet);
}
@@ -60,7 +60,7 @@ public class RoleDeclarationLocator extends TypeDeclarationLocator
// leaf must be a reference binding then
if (!((ReferenceBinding) type.leafComponentType()).isRole())
return IMPOSSIBLE_MATCH;
-
+
return super.resolveLevelForType(qualifiedPattern, type);
}
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/internal/core/search/matching/RoleTypePattern.java b/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/internal/core/search/matching/RoleTypePattern.java
index 482b2a859..bc5ebc29e 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/internal/core/search/matching/RoleTypePattern.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/internal/core/search/matching/RoleTypePattern.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: RoleTypePattern.java 23417 2010-02-03 20:13:55Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -30,7 +30,7 @@ import org.eclipse.jdt.internal.core.search.matching.TypeDeclarationPattern;
/**
* NEW for OTDT
- *
+ *
* A SearchPattern for locating Role types.
* @author gis
*/
@@ -43,22 +43,22 @@ public class RoleTypePattern extends TypeDeclarationPattern
* @param matchRule SearchPattern.R_EXACT_MATCH et al.
*/
public RoleTypePattern(
- char[] pkg,
- char[][] enclosingTypeNames,
- char[] simpleName,
- char classOrInterface,
+ char[] pkg,
+ char[][] enclosingTypeNames,
+ char[] simpleName,
+ char classOrInterface,
int matchRule)
{
super(pkg, enclosingTypeNames, simpleName, classOrInterface, matchRule);
this.kind = ROLE_DECL_PATTERN;
}
-
+
@Override
- public SearchPattern getBlankPattern()
+ public SearchPattern getBlankPattern()
{
return new RoleTypePattern(null, null, null, TYPE_SUFFIX, R_EXACT_MATCH | R_CASE_SENSITIVE);
}
-
+
// Reimplement those when we need special index handling apart from the category
@Override
public void decodeIndexKey(char[] key)
@@ -70,7 +70,7 @@ public class RoleTypePattern extends TypeDeclarationPattern
{
String mods = String.valueOf(CharOperation.subarray(key, slash +1, key.length));
try {
- this.modifiers = Integer.parseInt(mods);
+ this.modifiers = Integer.parseInt(mods);
}
catch(NumberFormatException ex)
{
@@ -81,23 +81,23 @@ public class RoleTypePattern extends TypeDeclarationPattern
super.decodeIndexKey(CharOperation.subarray(key, 0, slash));
}
-
+
// public char[] getIndexKey()
// {
// return super.getIndexKey();
// }
-
+
@Override
public boolean matchesDecodedKey(SearchPattern decodedPattern)
{
RoleTypePattern pattern = (RoleTypePattern) decodedPattern;
return Flags.isRole(pattern.modifiers) && super.matchesDecodedKey(decodedPattern);
}
-
+
@Override
public char[][] getIndexCategories()
{
return ROLE_CATEGORIES;
- //return CATEGORIES;
+ //return CATEGORIES;
}
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/internal/core/search/matching/TeamDeclarationLocator.java b/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/internal/core/search/matching/TeamDeclarationLocator.java
index 4168c8cb0..6e8a6206e 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/internal/core/search/matching/TeamDeclarationLocator.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/internal/core/search/matching/TeamDeclarationLocator.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: TeamDeclarationLocator.java 23417 2010-02-03 20:13:55Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -31,8 +31,8 @@ import org.eclipse.jdt.internal.core.search.matching.TypeDeclarationLocator;
/**
* NEW for OTDT
- *
- * A Locator for Teams (all non-teams are IMPOSSIBLE_MATCHes)
+ *
+ * A Locator for Teams (all non-teams are IMPOSSIBLE_MATCHes)
* @author gis
*/
public class TeamDeclarationLocator extends TypeDeclarationLocator
@@ -47,7 +47,7 @@ public class TeamDeclarationLocator extends TypeDeclarationLocator
{
if (!Flags.isTeam(type.modifiers))
return IMPOSSIBLE_MATCH;
-
+
return super.match(type, nodeSet);
}
@@ -60,7 +60,7 @@ public class TeamDeclarationLocator extends TypeDeclarationLocator
// leaf must be a reference binding then
if (!((ReferenceBinding) type.leafComponentType()).isTeam())
return IMPOSSIBLE_MATCH;
-
+
return super.resolveLevelForType(qualifiedPattern, type);
}
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/internal/core/search/matching/TeamTypePattern.java b/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/internal/core/search/matching/TeamTypePattern.java
index 7db7643b4..30ef1767e 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/internal/core/search/matching/TeamTypePattern.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/internal/core/search/matching/TeamTypePattern.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id: TeamTypePattern.java 23417 2010-02-03 20:13:55Z stephan $
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -28,35 +28,35 @@ import org.eclipse.jdt.internal.core.search.matching.TypeDeclarationPattern;
/**
* NEW for OTDT
- *
+ *
* A SearchPattern for locating Team types.
* @author gis
*/
public class TeamTypePattern extends TypeDeclarationPattern
{
protected static char[][] TEAM_CATEGORIES = new char[][] { IIndexConstants.TEAM_DECL };
-
+
/**
* @param classOrInterface TYPE_SUFFIX, CLASS_SUFFIX or INTERFACE_SUFFIX
* @param matchRule SearchPattern.R_EXACT_MATCH et al.
*/
public TeamTypePattern(
- char[] pkg,
- char[][] enclosingTypeNames,
- char[] simpleName,
- char classOrInterface,
+ char[] pkg,
+ char[][] enclosingTypeNames,
+ char[] simpleName,
+ char classOrInterface,
int matchRule)
{
super(pkg, enclosingTypeNames, simpleName, classOrInterface, matchRule);
this.kind = TEAM_DECL_PATTERN;
}
-
+
@Override
- public SearchPattern getBlankPattern()
+ public SearchPattern getBlankPattern()
{
return new TeamTypePattern(null, null, null, TYPE_SUFFIX, R_EXACT_MATCH | R_CASE_SENSITIVE);
}
-
+
// Reimplement those when we need special index handling apart from the category
// public void decodeIndexKey(char[] key)
// {
@@ -70,11 +70,11 @@ public class TeamTypePattern extends TypeDeclarationPattern
// {
// return super.matchesDecodedKey(decodedPattern);
// }
-
+
@Override
public char[][] getIndexCategories()
{
return TEAM_CATEGORIES;
- //return CATEGORIES;
+ //return CATEGORIES;
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/AbstractOTDTDebugTest.java b/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/AbstractOTDTDebugTest.java
index 184213612..b0b527ea9 100644
--- a/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/AbstractOTDTDebugTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/AbstractOTDTDebugTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -112,38 +112,38 @@ import org.eclipse.ui.console.TextConsole;
import org.eclipse.ui.internal.console.ConsoleHyperlinkPosition;
-
+
/**
* Tests for launch configurations
*/
public abstract class AbstractOTDTDebugTest extends TestCase implements IEvaluationListener {
-
+
public static final int DEFAULT_TIMEOUT = 30000;
-
+
public IEvaluationResult fEvaluationResult;
-
+
public static IJavaProject fJavaProject;
-
+
/**
* The last relevent event set - for example, that caused
* a thread to suspend
*/
protected DebugEvent[] fEventSet;
-
+
public AbstractOTDTDebugTest(String name) {
super(name);
// set error dialog to non-blocking to avoid hanging the UI during test
ErrorDialog.AUTOMATED_MODE = true;
SafeRunnable.setIgnoreErrors(true);
}
-
+
protected void setUp() throws Exception {
super.setUp();
//{ObjectTeams replace ProjectCreationDecorator with own
/* orig:
if (!ProjectCreationDecorator.isReady()) {
new TestSuite(ProjectCreationDecorator.class).run(new TestResult());
- }
+ }
:giro */
if (!OTProjectCreationDecorator.isReady()) {
new TestSuite(OTProjectCreationDecorator.class).run(new TestResult());
@@ -155,18 +155,18 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
protected IPath getAbsoluteOSClassFilePath(String typeName) throws Exception {
IResource project = getJavaProject().getResource();
IPath projectPath = project.getLocation();
-
+
IFile classfile = ((IProject) project).getFile(typeName+".class");
if (classfile!= null)
{
// TODO(ike): Workaround, cause file.getAbsolutePath() return path without "src"
return new Path(projectPath.toOSString(),java.io.File.separator + "src" + java.io.File.separator + typeName + ".class");
}
-
+
return null;
- }
-//ike}
-
+ }
+//ike}
+
/**
* Sets the last relevant event set
*
@@ -175,46 +175,46 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
protected void setEventSet(DebugEvent[] set) {
fEventSet = set;
}
-
+
/**
* Returns the last relevant event set
- *
+ *
* @return event set
*/
protected DebugEvent[] getEventSet() {
return fEventSet;
}
-
+
/**
* Returns the launch manager
- *
+ *
* @return launch manager
*/
protected ILaunchManager getLaunchManager() {
return DebugPlugin.getDefault().getLaunchManager();
}
-
+
/**
* Returns the breakpoint manager
- *
+ *
* @return breakpoint manager
*/
protected IBreakpointManager getBreakpointManager() {
return DebugPlugin.getDefault().getBreakpointManager();
- }
-
+ }
+
/**
* Returns the 'DebugTests' project.
- *
+ *
* @return the test project
*/
protected IJavaProject getJavaProject() {
return getJavaProject("DebugTests");
}
-
+
/**
* Returns the Java project with the given name.
- *
+ *
* @param name project name
* @return the Java project with the given name
*/
@@ -222,10 +222,10 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
return JavaCore.create(project);
}
-
+
/**
* Returns the source folder with the given name in the given project.
- *
+ *
* @param project
* @param name source folder name
* @return package fragment root
@@ -234,7 +234,7 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
IProject p = project.getProject();
return project.getPackageFragmentRoot(p.getFolder(name));
}
-
+
protected IHyperlink getHyperlink(int offset, IDocument doc) {
if (offset >= 0 && doc != null) {
Position[] positions = null;
@@ -253,12 +253,12 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
}
return null;
}
-
+
/**
* Launches the given configuration and waits for an event. Returns the
* source of the event. If the event is not received, the launch is
* terminated and an exception is thrown.
- *
+ *
* @param configuration the configuration to launch
* @param waiter the event waiter to use
* @return Object the source of the event
@@ -267,12 +267,12 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
protected Object launchAndWait(ILaunchConfiguration configuration, DebugEventWaiter waiter) throws CoreException {
return launchAndWait(configuration, waiter, true);
}
-
+
/**
* Launches the given configuration and waits for an event. Returns the
* source of the event. If the event is not received, the launch is
* terminated and an exception is thrown.
- *
+ *
* @param configuration the configuration to launch
* @param waiter the event waiter to use
* @param register whether to register the launch
@@ -306,14 +306,14 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
}
setEventSet(waiter.getEventSet());
assertNotNull("Program did not suspend, launch terminated.", suspendee);
- return suspendee;
- }
-
+ return suspendee;
+ }
+
/**
* Launches the type with the given name, and waits for a
* suspend event in that program. Returns the thread in which the suspend
* event occurred.
- *
+ *
* @param mainTypeName the program to launch
* @return thread in which the first suspend event occurred
*/
@@ -324,37 +324,37 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
}
/**
- * Launches the given configuration in debug mode, and waits for a
+ * Launches the given configuration in debug mode, and waits for a
* suspend event in that program. Returns the thread in which the suspend
* event occurred.
- *
+ *
* @param config the configuration to launch
* @return thread in which the first suspend event occurred
- */
+ */
protected IJavaThread launchAndSuspend(ILaunchConfiguration config) throws Exception {
DebugEventWaiter waiter= new DebugElementKindEventWaiter(DebugEvent.SUSPEND, IJavaThread.class);
waiter.setTimeout(DEFAULT_TIMEOUT);
Object suspendee = launchAndWait(config, waiter);
- return (IJavaThread)suspendee;
+ return (IJavaThread)suspendee;
}
-
+
/**
- * Launches the type with the given name, and waits for a breakpoint-caused
+ * Launches the type with the given name, and waits for a breakpoint-caused
* suspend event in that program. Returns the thread in which the suspend
* event occurred.
- *
+ *
* @param mainTypeName the program to launch
* @return thread in which the first suspend event occurred
*/
protected IJavaThread launchToBreakpoint(String mainTypeName) throws Exception {
return launchToBreakpoint(mainTypeName, true);
}
-
+
/**
- * Launches the type with the given name, and waits for a breakpoint-caused
+ * Launches the type with the given name, and waits for a breakpoint-caused
* suspend event in that program. Returns the thread in which the suspend
* event occurred.
- *
+ *
* @param mainTypeName the program to launch
* @param register whether to register the launch
* @return thread in which the first suspend event occurred
@@ -363,43 +363,43 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
ILaunchConfiguration config = getLaunchConfiguration(mainTypeName);
assertNotNull("Could not locate launch configuration for " + mainTypeName, config);
return launchToBreakpoint(config, register);
- }
+ }
/**
- * Launches the given configuration in debug mode, and waits for a breakpoint-caused
+ * Launches the given configuration in debug mode, and waits for a breakpoint-caused
* suspend event in that program. Returns the thread in which the suspend
* event occurred.
- *
+ *
* @param config the configuration to launch
* @return thread in which the first suspend event occurred
- */
+ */
protected IJavaThread launchToBreakpoint(ILaunchConfiguration config) throws CoreException {
return launchToBreakpoint(config, true);
}
-
+
/**
- * Launches the given configuration in debug mode, and waits for a breakpoint-caused
+ * Launches the given configuration in debug mode, and waits for a breakpoint-caused
* suspend event in that program. Returns the thread in which the suspend
* event occurred.
- *
+ *
* @param config the configuration to launch
* @param whether to register the launch
* @return thread in which the first suspend event occurred
- */
+ */
protected IJavaThread launchToBreakpoint(ILaunchConfiguration config, boolean register) throws CoreException {
DebugEventWaiter waiter= new DebugElementKindEventDetailWaiter(DebugEvent.SUSPEND, IJavaThread.class, DebugEvent.BREAKPOINT);
waiter.setTimeout(DEFAULT_TIMEOUT);
Object suspendee= launchAndWait(config, waiter, register);
assertTrue("suspendee was not an IJavaThread", suspendee instanceof IJavaThread);
- return (IJavaThread)suspendee;
- }
-
+ return (IJavaThread)suspendee;
+ }
+
/**
* Launches the type with the given name, and waits for a terminate
* event in that program. Returns the debug target in which the suspend
* event occurred.
- *
+ *
* @param mainTypeName the program to launch
* @param timeout the number of milliseconds to wait for a terminate event
* @return debug target in which the terminate event occurred
@@ -414,28 +414,28 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
* Launches the given configuration in debug mode, and waits for a terminate
* event in that program. Returns the debug target in which the terminate
* event occurred.
- *
+ *
* @param config the configuration to launch
* @param timeout the number of milliseconds to wait for a terminate event
* @return thread in which the first suspend event occurred
- */
+ */
protected IJavaDebugTarget launchAndTerminate(ILaunchConfiguration config, int timeout) throws Exception {
DebugEventWaiter waiter= new DebugElementKindEventWaiter(DebugEvent.TERMINATE, IJavaDebugTarget.class);
waiter.setTimeout(timeout);
- Object terminatee = launchAndWait(config, waiter);
+ Object terminatee = launchAndWait(config, waiter);
assertNotNull("Program did not terminate.", terminatee);
assertTrue("terminatee is not an IJavaDebugTarget", terminatee instanceof IJavaDebugTarget);
IJavaDebugTarget debugTarget = (IJavaDebugTarget) terminatee;
assertTrue("debug target is not terminated", debugTarget.isTerminated() || debugTarget.isDisconnected());
- return debugTarget;
+ return debugTarget;
}
-
+
/**
* Launches the type with the given name, and waits for a line breakpoint suspend
* event in that program. Returns the thread in which the suspend
* event occurred.
- *
+ *
* @param mainTypeName the program to launch
* @param bp the breakpoint that should cause a suspend event
* @return thread in which the first suspend event occurred
@@ -447,14 +447,14 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
}
/**
- * Launches the given configuration in debug mode, and waits for a line breakpoint
+ * Launches the given configuration in debug mode, and waits for a line breakpoint
* suspend event in that program. Returns the thread in which the suspend
* event occurred.
- *
+ *
* @param config the configuration to launch
* @param bp the breakpoint that should cause a suspend event
* @return thread in which the first suspend event occurred
- */
+ */
protected IJavaThread launchToLineBreakpoint(ILaunchConfiguration config, ILineBreakpoint bp) throws Exception {
DebugEventWaiter waiter= new DebugElementKindEventDetailWaiter(DebugEvent.SUSPEND, IJavaThread.class, DebugEvent.BREAKPOINT);
waiter.setTimeout(DEFAULT_TIMEOUT);
@@ -470,25 +470,25 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
int lineNumber = breakpoint.getLineNumber();
int stackLine = thread.getTopStackFrame().getLineNumber();
assertTrue("line numbers of breakpoint and stack frame do not match", lineNumber == stackLine);
-
- return thread;
+
+ return thread;
}
-
+
/**
* Resumes the given thread, and waits for another breakpoint-caused suspend event.
* Returns the thread in which the suspend event occurs.
- *
+ *
* @param thread thread to resume
* @return thread in which the first suspend event occurs
*/
protected IJavaThread resume(IJavaThread thread) throws Exception {
return resume(thread, DEFAULT_TIMEOUT);
- }
-
+ }
+
/**
* Resumes the given thread, and waits for another breakpoint-caused suspend event.
* Returns the thread in which the suspend event occurs.
- *
+ *
* @param thread thread to resume
* @param timeout timeout in ms
* @return thread in which the first suspend event occurs
@@ -496,26 +496,26 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
protected IJavaThread resume(IJavaThread thread, int timeout) throws Exception {
DebugEventWaiter waiter= new DebugElementKindEventDetailWaiter(DebugEvent.SUSPEND, IJavaThread.class, DebugEvent.BREAKPOINT);
waiter.setTimeout(timeout);
-
+
thread.resume();
Object suspendee= waiter.waitForEvent();
setEventSet(waiter.getEventSet());
assertNotNull("Program did not suspend.", suspendee);
return (IJavaThread)suspendee;
- }
-
+ }
+
/**
* Resumes the given thread, and waits for a suspend event caused by the specified
* line breakpoint. Returns the thread in which the suspend event occurs.
- *
+ *
* @param thread thread to resume
* @return thread in which the first suspend event occurs
*/
protected IJavaThread resumeToLineBreakpoint(IJavaThread resumeThread, ILineBreakpoint bp) throws Exception {
DebugEventWaiter waiter= new DebugElementKindEventDetailWaiter(DebugEvent.SUSPEND, IJavaThread.class, DebugEvent.BREAKPOINT);
waiter.setTimeout(DEFAULT_TIMEOUT);
-
+
resumeThread.resume();
Object suspendee= waiter.waitForEvent();
@@ -531,38 +531,38 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
int lineNumber = breakpoint.getLineNumber();
int stackLine = thread.getTopStackFrame().getLineNumber();
assertTrue("line numbers of breakpoint and stack frame do not match", lineNumber == stackLine);
-
+
return (IJavaThread)suspendee;
- }
-
+ }
+
/**
* Resumes the given thread, and waits for the debug target
* to terminate (i.e. finish/exit the program).
- *
+ *
* @param thread thread to resume
*/
protected void exit(IJavaThread thread) throws Exception {
DebugEventWaiter waiter= new DebugElementKindEventWaiter(DebugEvent.TERMINATE, IProcess.class);
waiter.setTimeout(DEFAULT_TIMEOUT);
-
+
thread.resume();
Object suspendee= waiter.waitForEvent();
setEventSet(waiter.getEventSet());
assertNotNull("Program did not terminate.", suspendee);
- }
-
+ }
+
/**
* Resumes the given thread, and waits the associated debug
* target to terminate.
- *
+ *
* @param thread thread to resume
* @return the terminated debug target
*/
protected IJavaDebugTarget resumeAndExit(IJavaThread thread) throws Exception {
DebugEventWaiter waiter= new DebugElementEventWaiter(DebugEvent.TERMINATE, thread.getDebugTarget());
waiter.setTimeout(DEFAULT_TIMEOUT);
-
+
thread.resume();
Object suspendee= waiter.waitForEvent();
@@ -571,11 +571,11 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
IJavaDebugTarget target = (IJavaDebugTarget)suspendee;
assertTrue("program should have exited", target.isTerminated() || target.isDisconnected());
return target;
- }
-
+ }
+
/**
* Returns the launch configuration for the given main type
- *
+ *
* @param mainTypeName program to launch
* @see OTProjectCreationDecorator
*/
@@ -585,16 +585,16 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
assertTrue("Could not find launch configuration for " + mainTypeName, config.exists());
return config;
}
-
+
protected IResource getBreakpointResource(String typeName) throws Exception {
IJavaElement element = getJavaProject().findElement(new Path(typeName + ".java"));
IResource resource = element.getCorrespondingResource();
if (resource == null) {
resource = getJavaProject().getProject();
- }
+ }
return resource;
}
-
+
protected IResource getBreakpointResource(IType type) throws Exception {
if (type == null) {
return getJavaProject().getProject();
@@ -602,14 +602,14 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
IResource resource = type.getResource();
if (resource == null) {
resource = getJavaProject().getProject();
- }
+ }
return resource;
- }
-
+ }
+
/**
* Creates and returns a line breakpoint at the given line number in the type with the
* given name.
- *
+ *
* @param lineNumber line number
* @param typeName type name
*/
@@ -617,9 +617,9 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
IType type = getType(typeName);
return createLineBreakpoint(type, lineNumber);
}
-
+
/**
- *
+ *
* @param lineNumber
* @param root
* @param packageName
@@ -627,7 +627,7 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
* @param fullTargetName
* @return
*/
- protected IJavaLineBreakpoint createLineBreakpoint(int lineNumber, String root, String packageName, String cuName,
+ protected IJavaLineBreakpoint createLineBreakpoint(int lineNumber, String root, String packageName, String cuName,
String fullTargetName) throws Exception{
IJavaProject javaProject = getJavaProject();
ICompilationUnit cunit = getCompilationUnit(javaProject, root, packageName, cuName);
@@ -635,14 +635,14 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
IType targetType = (IType)(new MemberParser()).getDeepest(cunit,fullTargetName);
assertNotNull("did not find requested type", targetType);
assertTrue("did not find type to install breakpoint in", targetType.exists());
-
+
return createLineBreakpoint(targetType, lineNumber);
}
-
+
/**
* Creates a line breakpoint in the given type (may be a top level non public type)
- *
+ *
* @param lineNumber line number to create the breakpoint at
* @param packageName fully qualified package name containing the type, example "a.b.c"
* @param cuName simple name of compilation unit containing the type, example "Something.java"
@@ -654,10 +654,10 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
IType type = getType(packageName, cuName, typeName);
return createLineBreakpoint(type, lineNumber);
}
-
+
/**
* Creates a line breakpoint in the given type at the given line number.
- *
+ *
* @param type type in which to install the breakpoint
* @param lineNumber line number to install the breakpoint at
* @return line breakpoint
@@ -692,16 +692,16 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
//{ObjectTeams: special treatment for roles:
String typeName = OTToggleBreakpointAdapter.createQualifiedTypeName(type);
/* orig:
- return JDIDebugModel.createLineBreakpoint(getBreakpointResource(type), type.getFullyQualifiedName(), lineNumber, -1, -1, 0, true, map);
+ return JDIDebugModel.createLineBreakpoint(getBreakpointResource(type), type.getFullyQualifiedName(), lineNumber, -1, -1, 0, true, map);
:giro */
return JDIDebugModel.createLineBreakpoint(getBreakpointResource(type), typeName, lineNumber, -1, -1, 0, true, map);
// SH}
}
-
+
/**
- * Returns the type in the test project based on the given name. The type name may refer to a
+ * Returns the type in the test project based on the given name. The type name may refer to a
* top level non public type.
- *
+ *
* @param packageName package name, example "a.b.c"
* @param cuName simple compilation unit name within the package, example "Something.java"
* @param typeName simple dot qualified type name, example "Something" or "NonPublic" or "Something.Inner"
@@ -726,11 +726,11 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
}
return null;
}
-
+
/**
* Creates and returns a map of java element breakpoint attributes for a breakpoint on the
* given java element, or <code>null</code> if none
- *
+ *
* @param element java element the breakpoint is associated with
* @return map of breakpoint attributes or <code>null</code>
* @throws Exception
@@ -751,12 +751,12 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
return map;
}
return null;
- }
-
+ }
+
/**
* Creates and returns a line breakpoint at the given line number in the type with the
* given name and sets the specified condition on the breakpoint.
- *
+ *
* @param lineNumber line number
* @param typeName type name
* @param condition condition
@@ -768,11 +768,11 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
bp.setConditionSuspendOnTrue(suspendOnTrue);
return bp;
}
-
+
/**
* Creates and returns a pattern breakpoint at the given line number in the
* source file with the given name.
- *
+ *
* @param lineNumber line number
* @param sourceName name of source file
* @param pattern the pattern of the class file name
@@ -780,22 +780,22 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
protected IJavaPatternBreakpoint createPatternBreakpoint(int lineNumber, String sourceName, String pattern) throws Exception {
return JDIDebugModel.createPatternBreakpoint(getJavaProject().getProject(), sourceName, pattern, lineNumber, -1, -1, 0, true, null);
}
-
+
/**
* Creates and returns a target pattern breakpoint at the given line number in the
* source file with the given name.
- *
+ *
* @param lineNumber line number
* @param sourceName name of source file
*/
protected IJavaTargetPatternBreakpoint createTargetPatternBreakpoint(int lineNumber, String sourceName) throws Exception {
return JDIDebugModel.createTargetPatternBreakpoint(getJavaProject().getProject(), sourceName, lineNumber, -1, -1, 0, true, null);
- }
-
+ }
+
/**
* Creates and returns a stratum breakpoint at the given line number in the
* source file with the given name.
- *
+ *
* @param lineNumber line number
* @param sourceName name of source file
* @param stratum the stratum of the source file
@@ -803,10 +803,10 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
protected IJavaStratumLineBreakpoint createStratumBreakpoint(int lineNumber, String sourceName, String stratum) throws Exception {
return JDIDebugModel.createStratumBreakpoint(getJavaProject().getProject(), stratum, sourceName, null, null, lineNumber, -1, -1, 0, true, null);
}
-
+
/**
* Creates and returns a method breakpoint
- *
+ *
* @param typeNamePattern type name pattern
* @param methodName method name
* @param methodSignature method signature or <code>null</code>
@@ -825,11 +825,11 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
}
Map map = getExtraBreakpointAttributes(method);
return JDIDebugModel.createMethodBreakpoint(resource, typeNamePattern, methodName, methodSignature, entry, exit,false, -1, -1, -1, 0, true, map);
- }
-
+ }
+
/**
* Creates a method breakpoint in a fully specified type (potentially non public).
- *
+ *
* @param packageName package name containing type to install breakpoint in, example "a.b.c"
* @param cuName simple compilation unit name within package, example "Something.java"
* @param typeName $ qualified type name within compilation unit, example "Something" or
@@ -853,10 +853,10 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
Map map = getExtraBreakpointAttributes(method);
return JDIDebugModel.createMethodBreakpoint(getBreakpointResource(type), type.getFullyQualifiedName(), methodName, methodSignature, entry, exit,false, -1, -1, -1, 0, true, map);
}
-
+
/**
- * Creates a MethodBreakPoint on the method specified at the given path.
+ * Creates a MethodBreakPoint on the method specified at the given path.
* Syntax:
* Type$InnerType$MethodNameAndSignature$AnonymousTypeDeclarationNumber$FieldName
* eg:<code>
@@ -867,7 +867,7 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
* {
* Object anon = new Object(){
* int anIntField;
- * String anonTypeMethod() {return "an Example";}
+ * String anonTypeMethod() {return "an Example";}
* }
* }
* }
@@ -875,9 +875,9 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
* Syntax to get the anonymous toString would be: Foo$Inner$aMethod()V$1$anonTypeMethod()QString
* so, createMethodBreakpoint(packageName, cuName, "Foo$Inner$aMethod()V$1$anonTypeMethod()QString",true,false);
*/
- protected IJavaMethodBreakpoint createMethodBreakpoint(String root, String packageName, String cuName,
+ protected IJavaMethodBreakpoint createMethodBreakpoint(String root, String packageName, String cuName,
String fullTargetName, boolean entry, boolean exit) throws Exception {
-
+
IJavaProject javaProject = getJavaProject();
ICompilationUnit cunit = getCompilationUnit(javaProject, root, packageName, cuName);
assertNotNull("did not find requested Compilation Unit", cunit);
@@ -886,11 +886,11 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
assertTrue("Given method does not exist", targetMethod.exists());
IType methodParent = (IType)targetMethod.getParent();//safe - method's only parent = Type
assertNotNull("did not find type to install breakpoint in", methodParent);
-
+
Map map = getExtraBreakpointAttributes(targetMethod);
return JDIDebugModel.createMethodBreakpoint(getBreakpointResource(methodParent), methodParent.getFullyQualifiedName(),targetMethod.getElementName(), targetMethod.getSignature(), entry, exit,false, -1, -1, -1, 0, true, map);
- }
-
+ }
+
/**
* @param cu the Compilation where the target resides
* @param target the fullname of the target, as per MemberParser syntax
@@ -903,7 +903,7 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
}
/**
* Creates and returns a class prepare breakpoint on the type with the given fully qualified name.
- *
+ *
* @param typeName type on which to create the breakpoint
* @return breakpoint
* @throws Exception
@@ -911,10 +911,10 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
protected IJavaClassPrepareBreakpoint createClassPrepareBreakpoint(String typeName) throws Exception {
return createClassPrepareBreakpoint(getType(typeName));
}
-
+
/**
* Creates and returns a class prepare breakpoint on the type with the given fully qualified name.
- *
+ *
* @param typeName type on which to create the breakpoint
* @return breakpoint
* @throws Exception
@@ -925,23 +925,23 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
IType type = (IType)getMember(cunit,fullTargetName);
assertTrue("Target type not found", type.exists());
return createClassPrepareBreakpoint(type);
- }
-
+ }
+
/**
* Creates a class prepare breakpoint in a fully specified type (potentially non public).
- *
+ *
* @param packageName package name containing type to install breakpoint in, example "a.b.c"
* @param cuName simple compilation unit name within package, example "Something.java"
* @param typeName $ qualified type name within compilation unit, example "Something" or
* "NonPublic" or "Something$Inner"
- */
+ */
protected IJavaClassPrepareBreakpoint createClassPrepareBreakpoint(String packageName, String cuName, String typeName) throws Exception {
return createClassPrepareBreakpoint(getType(packageName, cuName, typeName));
}
-
+
/**
* Creates a class prepare breakpoint for the given type
- *
+ *
* @param type type
* @return class prepare breakpoint
* @throws Exception
@@ -953,13 +953,13 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
kind = IJavaClassPrepareBreakpoint.TYPE_INTERFACE;
}
Map map = getExtraBreakpointAttributes(type);
- return JDIDebugModel.createClassPrepareBreakpoint(getBreakpointResource(type), type.getFullyQualifiedName(), kind, -1, -1, true, map);
+ return JDIDebugModel.createClassPrepareBreakpoint(getBreakpointResource(type), type.getFullyQualifiedName(), kind, -1, -1, true, map);
}
-
+
/**
* Returns the Java model type from the test project with the given name or <code>null</code>
* if none.
- *
+ *
* @param typeName
* @return type or <code>null</code>
* @throws Exception
@@ -967,41 +967,41 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
protected IType getType(String typeName) throws Exception {
return getJavaProject().findType(typeName);
}
-
+
/**
* Creates and returns a watchpoint
- *
+ *
* @param typeNmae type name
* @param fieldName field name
* @param access whether to suspend on field access
* @param modification whether to suspend on field modification
- */
+ */
protected IJavaWatchpoint createWatchpoint(String typeName, String fieldName, boolean access, boolean modification) throws Exception {
IType type = getType(typeName);
return createWatchpoint(type, fieldName, access, modification);
}
-
+
/**
* Creates and returns an exception breakpoint
- *
+ *
* @param exName exception name
* @param caught whether to suspend in caught locations
* @param uncaught whether to suspend in uncaught locations
- */
+ */
protected IJavaExceptionBreakpoint createExceptionBreakpoint(String exName, boolean caught, boolean uncaught) throws Exception {
IType type = getType(exName);
Map map = getExtraBreakpointAttributes(type);
return JDIDebugModel.createExceptionBreakpoint(getBreakpointResource(type),exName, caught, uncaught, false, true, map);
}
-
+
/**
* Creates and returns a watchpoint
- *
+ *
* @param typeNmae type name
* @param fieldName field name
* @param access whether to suspend on field access
* @param modification whether to suspend on field modification
- */
+ */
/* protected IJavaWatchpoint createWatchpoint(String typeName, String fieldName, boolean access, boolean modification) throws Exception {
IType type = getType(typeName);
return createWatchpoint(type, fieldName, access, modification);
@@ -1011,17 +1011,17 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
/**
* Creates a WatchPoint on the field specified at the given path.
* Will create watchpoints on fields within anonymous types, inner types,
- * local (non-public) types, and public types.
+ * local (non-public) types, and public types.
* @param root
* @param packageName package name containing type to install breakpoint in, example "a.b.c"
* @param cuName simple compilation unit name within package, example "Something.java"
* @param fullTargetName - see below
- * @param access whether to suspend on access
+ * @param access whether to suspend on access
* @param modification whether to suspend on modification
* @return a watchpoint
* @throws Exception
* @throws CoreException
- *
+ *
* @see
* </code>
* Syntax example:
@@ -1034,16 +1034,16 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
* {
* Object anon = new Object(){
* int anIntField;
- * String anonTypeMethod() {return "an Example";}
+ * String anonTypeMethod() {return "an Example";}
* }
* }
* }
* }</code>
- * To get the anonymous toString, syntax of fullTargetName would be: <code>Foo$Inner$aMethod()V$1$anIntField</code>
+ * To get the anonymous toString, syntax of fullTargetName would be: <code>Foo$Inner$aMethod()V$1$anIntField</code>
*/
- protected IJavaWatchpoint createNestedTypeWatchPoint(String root, String packageName, String cuName,
+ protected IJavaWatchpoint createNestedTypeWatchPoint(String root, String packageName, String cuName,
String fullTargetName, boolean access, boolean modification) throws Exception, CoreException {
-
+
ICompilationUnit cunit = getCompilationUnit(getJavaProject(), root, packageName, cuName);
IField field = (IField)getMember(cunit,fullTargetName);
assertNotNull("Path to field is not valid", field);
@@ -1051,27 +1051,27 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
IType type = (IType)field.getParent();
return createWatchpoint(type, field.getElementName(), access, modification);
}
-
+
/**
* Creates a watchpoint in a fully specified type (potentially non public).
- *
+ *
* @param packageName package name containing type to install breakpoint in, example "a.b.c"
* @param cuName simple compilation unit name within package, example "Something.java"
* @param typeName $ qualified type name within compilation unit, example "Something" or
* "NonPublic" or "Something$Inner"
* @param fieldName name of the field
- * @param access whether to suspend on access
+ * @param access whether to suspend on access
* @param modification whether to suspend on modification
- */
+ */
protected IJavaWatchpoint createWatchpoint(String packageName, String cuName, String typeName, String fieldName, boolean access, boolean modification) throws Exception {
IType type = getType(packageName, cuName, typeName);
return createWatchpoint(type, fieldName, access, modification);
}
-
+
/**
* Creates a watchpoint on the specified field.
- *
+ *
* @param type type containing the field
* @param fieldName name of the field
* @param access whether to suspend on access
@@ -1087,8 +1087,8 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
wp.setAccess(access);
wp.setModification(modification);
return wp;
- }
-
+ }
+
/**
* Terminates the given thread and removes its launch
*/
@@ -1097,10 +1097,10 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
terminateAndRemove((IJavaDebugTarget)thread.getDebugTarget());
}
}
-
+
/**
* Terminates the given debug target and removes its launch.
- *
+ *
* NOTE: all breakpoints are removed, all threads are resumed, and then
* the target is terminated. This avoids defunct processes on linux.
*/
@@ -1109,7 +1109,7 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
if (debugTarget != null && !(debugTarget.isTerminated() || debugTarget.isDisconnected())) {
IPreferenceStore jdiUIPreferences = JDIDebugUIPlugin.getDefault().getPreferenceStore();
jdiUIPreferences.setValue(IJDIPreferencesConstants.PREF_SUSPEND_ON_UNCAUGHT_EXCEPTIONS, false);
-
+
DebugEventWaiter waiter = new DebugElementEventWaiter(DebugEvent.TERMINATE, debugTarget);
try {
removeAllBreakpoints();
@@ -1134,7 +1134,7 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[]{new DebugEvent(this, DebugEvent.MODEL_SPECIFIC)});
waiter.waitForEvent();
}
-
+
/**
* Deletes all existing breakpoints
*/
@@ -1145,11 +1145,11 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
} catch (CoreException e) {
}
}
-
+
/**
* Returns the first breakpoint the given thread is suspended
* at, or <code>null</code> if none.
- *
+ *
* @return the first breakpoint the given thread is suspended
* at, or <code>null</code> if none
*/
@@ -1160,11 +1160,11 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
}
return null;
}
-
+
/**
* Evaluates the given snippet in the context of the given stack frame and returns
* the result.
- *
+ *
* @param snippet code snippet
* @param frame stack frame context
* @return evaluation result
@@ -1172,7 +1172,7 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
protected IEvaluationResult evaluate(String snippet, IJavaStackFrame frame) throws Exception {
DebugEventWaiter waiter= new DebugElementKindEventWaiter(DebugEvent.SUSPEND, IJavaThread.class);
waiter.setTimeout(DEFAULT_TIMEOUT);
-
+
IAstEvaluationEngine engine = EvaluationManager.newAstEvaluationEngine(getJavaProject(), (IJavaDebugTarget)frame.getDebugTarget());
engine.evaluate(snippet, frame, this, DebugEvent.EVALUATION, true);
@@ -1181,26 +1181,26 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
assertNotNull("Program did not suspend.", suspendee);
engine.dispose();
return fEvaluationResult;
- }
-
+ }
+
/**
* @see IEvaluationListener#evaluationComplete(IEvaluationResult)
*/
public void evaluationComplete(IEvaluationResult result) {
fEvaluationResult = result;
}
-
+
/**
* Performs a step over in the given stack frame and returns when complete.
- *
+ *
* @param frame stack frame to step in
*/
protected IJavaThread stepOver(IJavaStackFrame frame) throws Exception {
DebugEventWaiter waiter= new DebugElementKindEventDetailWaiter(DebugEvent.SUSPEND, IJavaThread.class, DebugEvent.STEP_END);
waiter.setTimeout(DEFAULT_TIMEOUT);
-
+
frame.stepOver();
-
+
Object suspendee= waiter.waitForEvent();
setEventSet(waiter.getEventSet());
assertNotNull("Program did not suspend.", suspendee);
@@ -1209,48 +1209,48 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
/**
* Performs a step into in the given stack frame and returns when complete.
- *
+ *
* @param frame stack frame to step in
*/
protected IJavaThread stepInto(IJavaStackFrame frame) throws Exception {
DebugEventWaiter waiter= new DebugElementKindEventDetailWaiter(DebugEvent.SUSPEND, IJavaThread.class, DebugEvent.STEP_END);
waiter.setTimeout(DEFAULT_TIMEOUT);
-
+
frame.stepInto();
-
+
Object suspendee= waiter.waitForEvent();
setEventSet(waiter.getEventSet());
assertNotNull("Program did not suspend.", suspendee);
- return (IJavaThread) suspendee;
+ return (IJavaThread) suspendee;
}
-
+
/**
* Performs a step return in the given stack frame and returns when complete.
- *
+ *
* @param frame stack frame to step return from
*/
protected IJavaThread stepReturn(IJavaStackFrame frame) throws Exception {
DebugEventWaiter waiter= new DebugElementKindEventDetailWaiter(DebugEvent.SUSPEND, IJavaThread.class, DebugEvent.STEP_END);
waiter.setTimeout(DEFAULT_TIMEOUT);
-
+
frame.stepReturn();
-
+
Object suspendee= waiter.waitForEvent();
setEventSet(waiter.getEventSet());
assertNotNull("Program did not suspend.", suspendee);
return (IJavaThread) suspendee;
- }
-
+ }
+
/**
* Performs a step into with filters in the given stack frame and returns when
* complete.
- *
+ *
* @param frame stack frame to step in
*/
protected IJavaThread stepIntoWithFilters(IJavaStackFrame frame) throws Exception {
DebugEventWaiter waiter= new DebugElementKindEventWaiter(DebugEvent.SUSPEND, IJavaThread.class);
waiter.setTimeout(DEFAULT_TIMEOUT);
-
+
// turn filters on
try {
DebugUITools.setUseStepFilters(true);
@@ -1259,24 +1259,24 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
// turn filters off
DebugUITools.setUseStepFilters(false);
}
-
-
+
+
Object suspendee= waiter.waitForEvent();
setEventSet(waiter.getEventSet());
assertNotNull("Program did not suspend.", suspendee);
- return (IJavaThread) suspendee;
- }
+ return (IJavaThread) suspendee;
+ }
/**
* Performs a step return with filters in the given stack frame and returns when
* complete.
- *
+ *
* @param frame stack frame to step in
*/
protected IJavaThread stepReturnWithFilters(IJavaStackFrame frame) throws Exception {
DebugEventWaiter waiter= new DebugElementKindEventWaiter(DebugEvent.SUSPEND, IJavaThread.class);
waiter.setTimeout(DEFAULT_TIMEOUT);
-
+
// turn filters on
try {
DebugUITools.setUseStepFilters(true);
@@ -1285,24 +1285,24 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
// turn filters off
DebugUITools.setUseStepFilters(false);
}
-
-
+
+
Object suspendee= waiter.waitForEvent();
setEventSet(waiter.getEventSet());
assertNotNull("Program did not suspend.", suspendee);
- return (IJavaThread) suspendee;
- }
-
+ return (IJavaThread) suspendee;
+ }
+
/**
* Performs a step over with filters in the given stack frame and returns when
* complete.
- *
+ *
* @param frame stack frame to step in
*/
protected IJavaThread stepOverWithFilters(IJavaStackFrame frame) throws Exception {
DebugEventWaiter waiter= new DebugElementKindEventWaiter(DebugEvent.SUSPEND, IJavaThread.class);
waiter.setTimeout(DEFAULT_TIMEOUT);
-
+
// turn filters on
try {
DebugUITools.setUseStepFilters(true);
@@ -1311,17 +1311,17 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
// turn filters off
DebugUITools.setUseStepFilters(false);
}
-
-
+
+
Object suspendee= waiter.waitForEvent();
setEventSet(waiter.getEventSet());
assertNotNull("Program did not suspend.", suspendee);
- return (IJavaThread) suspendee;
+ return (IJavaThread) suspendee;
}
/**
* Returns the compilation unit with the given name.
- *
+ *
* @param project the project containing the CU
* @param root the name of the source folder in the project
* @param pkg the name of the package (empty string for default package)
@@ -1333,7 +1333,7 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
IResource r = p.getFolder(root);
return project.getPackageFragmentRoot(r).getPackageFragment(pkg).getCompilationUnit(name);
}
-
+
/**
* Wait for builds to complete
*/
@@ -1350,9 +1350,9 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
wasInterrupted = true;
}
} while (wasInterrupted);
- }
-
-
+ }
+
+
protected IJavaVariable findVariable(IJavaStackFrame frame, String name) throws DebugException {
IJavaVariable variable = frame.findVariable(name);
if (variable == null) {
@@ -1375,16 +1375,16 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
}
return variable;
}
-
+
protected boolean isFileSystemCaseSensitive() {
return Platform.OS_MACOSX.equals(Platform.getOS()) ? false : new File("a").compareTo(new File("A")) != 0; //$NON-NLS-1$ //$NON-NLS-2$
}
-
+
/**
* Creates a shared launch configuration for the type with the given name.
*/
protected void createLaunchConfiguration(String mainTypeName) throws Exception {
- ILaunchConfigurationType type = getLaunchManager().getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
+ ILaunchConfigurationType type = getLaunchManager().getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
ILaunchConfigurationWorkingCopy config = type.newInstance(getJavaProject().getProject().getFolder("launchConfigurations"), mainTypeName);
config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, mainTypeName);
config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, getJavaProject().getElementName());
@@ -1394,8 +1394,8 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
map.put(IJavaLaunchConfigurationConstants.ATTR_JAVA_COMMAND, "java");
config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_INSTALL_TYPE_SPECIFIC_ATTRS_MAP, map);
config.doSave();
- }
-
+ }
+
/**
* Return all problems with the specified element.
* From jdt.core.tests.builder.TestingEnvironment
diff --git a/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/AllTests.java
index c27d2e412..55206b8ce 100644
--- a/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/AllTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -57,11 +57,11 @@ public class AllTests extends TestSuite
public AllTests()
{
addTest(new TestSuite(OTProjectCreationDecorator.class));
-
+
addTest(new TestSuite(StratumTests.class));
-
+
addTest(new TestSuite(SourceDebugExtensionTest.class));
-
+
}
/**
diff --git a/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/ClassAttributeReader.java b/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/ClassAttributeReader.java
index 177ddf610..9c6372b35 100644
--- a/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/ClassAttributeReader.java
+++ b/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/ClassAttributeReader.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -40,10 +40,10 @@ import org.eclipse.core.runtime.IPath;
/**
* @author ike
- *
+ *
* Read class file(s) and display its Attributes. Copied and modified from
* otlistclass.
- *
+ *
* $Id: ClassAttributeReader.java 23492 2010-02-05 22:57:56Z stephan $
*/
public class ClassAttributeReader
@@ -56,7 +56,7 @@ public class ClassAttributeReader
private Hashtable _classAttributes = new Hashtable();
private Hashtable _methodAttributes = new Hashtable();
private String _error;
-
+
public ClassAttributeReader(IPath classFilePath)
{
try {
@@ -77,7 +77,7 @@ public class ClassAttributeReader
e.printStackTrace();
}
}
-
+
public String getError()
{
return _error;
@@ -98,26 +98,26 @@ public class ClassAttributeReader
return null;
}
-
+
public boolean isClassAttributeAvailable(String attributeName)
{
return _classAttributes.containsKey(attributeName);
}
-
+
public String[] getClassAttributeValues(String attributeName)
{
if (isClassAttributeAvailable(attributeName))
return (String[])_classAttributes.get(attributeName);
return null;
}
-
+
public void readAndStoreAttributes()
{
Attribute[] attributesAsArray = _javaclass.getAttributes();
ConstantPool cp = _javaclass.getConstantPool();
String class_name = _javaclass.getClassName();
Vector values;
-
+
for (int k = 0; k < attributesAsArray.length; k++)
{
Attribute actAttr = attributesAsArray[k];
@@ -239,7 +239,7 @@ public class ClassAttributeReader
String referenced_team = names[0];
values.add(new String[]{referenced_team});
}
-
+
}
else if (attrName.equals("BaseClassTags"))
{
@@ -339,7 +339,7 @@ public class ClassAttributeReader
}
values.add(new String[]{smap});
}
-
+
_classAttributes.put(attrName, values);
}
@@ -399,7 +399,7 @@ public class ClassAttributeReader
/**
* combines two int's representing the higher and the lower part of a two
* byte number.
- *
+ *
* @param first
* the first (higer?) byte
* @param second
@@ -420,7 +420,7 @@ public class ClassAttributeReader
/**
* Read some strings from a byte array.
- *
+ *
* @param entries
* Result array to be provided by caller.
* @param indizes
diff --git a/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/DebugTestsPlugin.java b/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/DebugTestsPlugin.java
index 375da00fa..4f6976240 100644
--- a/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/DebugTestsPlugin.java
+++ b/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/DebugTestsPlugin.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -37,7 +37,7 @@ import java.net.URL;
public class DebugTestsPlugin extends AbstractUIPlugin {
//The shared instance.
private static DebugTestsPlugin plugin;
-
+
/**
* The constructor.
*/
@@ -71,10 +71,10 @@ public class DebugTestsPlugin extends AbstractUIPlugin {
{
return "org.eclipse.objectteams.otdt.debug.tests";
}
-
+
/**
* Returns the OS path to the directory that contains this plugin and adds a subpath if wanted.
- *
+ *
*/
protected File getPluginDirectoryPath(IPath test_src_dir)
{
@@ -85,7 +85,7 @@ public class DebugTestsPlugin extends AbstractUIPlugin {
.getEntry("/");
if (test_src_dir != null)
platformURL = new URL(platformURL, test_src_dir.toString());
-
+
return new File(FileLocator.toFileURL(platformURL).getFile());
}
catch (IOException ex)
diff --git a/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/ManualDebugTestSuite.java b/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/ManualDebugTestSuite.java
index ccd455ba6..0d8794557 100644
--- a/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/ManualDebugTestSuite.java
+++ b/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/ManualDebugTestSuite.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -35,7 +35,7 @@ import org.eclipse.swt.widgets.Display;
* automated tests.
*/
public class ManualDebugTestSuite extends TestSuite {
-
+
/**
* Flag that indicates test are in progress
*/
@@ -54,11 +54,11 @@ public class ManualDebugTestSuite extends TestSuite {
*/
public ManualDebugTestSuite() {
addTest(new TestSuite(OTProjectCreationDecorator.class));
-
+
addTest(new TestSuite(StratumTests.class));
}
-
+
/**
* Runs the tests and collects their result in a TestResult.
* The debug tests cannot be run in the UI thread or the event
@@ -75,7 +75,7 @@ public class ManualDebugTestSuite extends TestSuite {
break;
Test test= (Test)e.nextElement();
runTest(test, result);
- }
+ }
fTesting = false;
display.wake();
}
@@ -85,15 +85,15 @@ public class ManualDebugTestSuite extends TestSuite {
} catch (Exception e) {
e.printStackTrace();
}
-
+
while (fTesting) {
try {
if (!display.readAndDispatch())
display.sleep();
} catch (Throwable e) {
e.printStackTrace();
- }
- }
+ }
+ }
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/OTProjectCreationDecorator.java b/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/OTProjectCreationDecorator.java
index 4e90698df..ab2b8c7f4 100644
--- a/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/OTProjectCreationDecorator.java
+++ b/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/OTProjectCreationDecorator.java
@@ -6,7 +6,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Fraunhofer FIRST - Initial API and implementation
@@ -57,7 +57,7 @@ import org.eclipse.ui.PlatformUI;
public class OTProjectCreationDecorator extends AbstractOTDTDebugTest {
public static boolean fgReady = false;
-
+
/**
* Constructor
* @param name
@@ -66,7 +66,7 @@ public class OTProjectCreationDecorator extends AbstractOTDTDebugTest {
super(name);
fgReady = true;
}
-
+
public static boolean isReady() {
return fgReady;
}
@@ -105,7 +105,7 @@ public class OTProjectCreationDecorator extends AbstractOTDTDebugTest {
IWorkspaceDescription wsDescription = ResourcesPlugin.getWorkspace().getDescription();
wsDescription.setAutoBuilding(false);
ResourcesPlugin.getWorkspace().setDescription(wsDescription);
-
+
// create & configure project and import source
fJavaProject = org.eclipse.objectteams.otdt.ui.tests.util.JavaProjectHelper.createOTJavaProject("DebugTests", "bin");
fJavaProject.setOption(CompilerOptions.OPTION_ReportUncheckedTypeOperation, CompilerOptions.IGNORE);
@@ -113,16 +113,16 @@ public class OTProjectCreationDecorator extends AbstractOTDTDebugTest {
fJavaProject.setOption(CompilerOptions.OPTION_ReportDeadCode, CompilerOptions.IGNORE);
fJavaProject.setOption(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
IPackageFragmentRoot src = JavaProjectHelper.addSourceContainer(fJavaProject, "src");
-
-//{ObjectTeams: rootfile-path is now org.eclipse.objectteams.otdt.debug.tests + "testprograms"
+
+//{ObjectTeams: rootfile-path is now org.eclipse.objectteams.otdt.debug.tests + "testprograms"
File root = DebugTestsPlugin.getDefault().getPluginDirectoryPath(JavaProjectHelper.TEST_SRC_DIR);
//ike}
JavaProjectHelper.importFilesFromDirectory(root, src.getPath(), null);
-
+
// import classfiles
root = DebugTestsPlugin.getDefault().getPluginDirectoryPath(new Path("classfiles"));
JavaProjectHelper.importFilesFromDirectory(root, src.getPath(), null);
-
+
// add rt.jar
IVMInstall vm = JavaRuntime.getDefaultVMInstall();
assertNotNull("No default JRE", vm);
@@ -135,7 +135,7 @@ public class OTProjectCreationDecorator extends AbstractOTDTDebugTest {
// all set up, can start auto-building now:
wsDescription.setAutoBuilding(true);
ResourcesPlugin.getWorkspace().setDescription(wsDescription);
-
+
// create launch configuration folder
IFolder folder = pro.getFolder("launchConfigurations");
@@ -152,7 +152,7 @@ public class OTProjectCreationDecorator extends AbstractOTDTDebugTest {
// this one used by StratumTests:
createLaunchConfiguration("Breakpoints");
-//{ObjectTeams: own tests:
+//{ObjectTeams: own tests:
createLaunchConfiguration("rofitests.RoFiTeam");
createLaunchConfiguration("copyinheritancetests.SubTeam");
createLaunchConfiguration("copyinheritancetests.SubTeam2");
@@ -179,7 +179,7 @@ public class OTProjectCreationDecorator extends AbstractOTDTDebugTest {
/**
* Create a project with non-default, mulitple output locations.
- *
+ *
* @throws Exception
*/
public void _testMultipleOutputProjectCreation() throws Exception {
@@ -278,9 +278,9 @@ public class OTProjectCreationDecorator extends AbstractOTDTDebugTest {
// IMarker marker = markers[i];
// Integer severity = (Integer) marker.getAttribute(IMarker.SEVERITY);
// IResource resource = marker.getResource();
-//
+//
// System.out.println(resource.getName());
-//
+//
// if (severity != null && severity.intValue() >= IMarker.SEVERITY_ERROR) {
// errors++;
// }
diff --git a/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/core/CopyInheritanceBreakpointTest.java b/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/core/CopyInheritanceBreakpointTest.java
index d22aae7a0..f21b53b8c 100644
--- a/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/core/CopyInheritanceBreakpointTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/core/CopyInheritanceBreakpointTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -39,7 +39,7 @@ public class CopyInheritanceBreakpointTest extends AbstractOTDTDebugTest {
public CopyInheritanceBreakpointTest(String name) {
super(name);
}
-
+
public void testBreakInPhantomRoleMethod() throws Exception {
// set breakpoint in this type:
String breakTeamName = "copyinheritancetests.SuperTeam";
@@ -49,9 +49,9 @@ public class CopyInheritanceBreakpointTest extends AbstractOTDTDebugTest {
String breakTypeName = "copyinheritancetests.SubTeam$__OT__R";
// expect this source file to be found via SMAP:
String sourceFile = "SuperTeam.java";
-
+
createLineBreakpoint(6, breakTeamName); // sysout within roleMethod1
-
+
IJavaThread thread= null;
try {
waitForBuild();
@@ -59,16 +59,16 @@ public class CopyInheritanceBreakpointTest extends AbstractOTDTDebugTest {
thread= launchToBreakpoint(launchTypeName);
assertNotNull("Breakpoint not hit within timeout period", thread);
-
+
IJavaReferenceType type = ((IJavaStackFrame)thread.getTopStackFrame()).getReferenceType();
assertEquals("Stopped in wrong type", breakTypeName, type.getName());
-
+
String methodName = ((IJavaStackFrame)thread.getTopStackFrame()).getMethodName();
assertEquals("Stopped in wrong method", "roleMethod1", methodName);
-
+
String sourceName = ((IJavaStackFrame)thread.getTopStackFrame()).getSourceName(ISMAPConstants.OTJ_STRATUM_NAME);
assertEquals("Lookup gave wrong source name", sourceFile, sourceName);
-
+
} catch (AssertionFailedError fail) {
if (thread != null) {
IConsole console = DebugUITools.getConsole(thread.getLaunch().getProcesses()[0]);
@@ -84,9 +84,9 @@ public class CopyInheritanceBreakpointTest extends AbstractOTDTDebugTest {
} finally {
terminateAndRemove(thread);
removeAllBreakpoints();
- }
+ }
}
-
+
public void testBreakInRoleMethod() throws Exception {
// set breakpoint in this type:
String breakTeamName = "copyinheritancetests.SuperTeam";
@@ -96,26 +96,26 @@ public class CopyInheritanceBreakpointTest extends AbstractOTDTDebugTest {
String breakTypeName = "copyinheritancetests.SubTeam2$__OT__R";
// expect this source file to be found via SMAP:
String sourceFile = "SuperTeam.java";
-
+
createLineBreakpoint(6, breakTeamName); // sysout with roleMethod1
-
+
IJavaThread thread= null;
try {
waitForBuild();
expectNoErrors("DebugTests");
-
+
thread= launchToBreakpoint(launchTypeName);
assertNotNull("Breakpoint not hit within timeout period", thread);
-
+
IJavaReferenceType type = ((IJavaStackFrame)thread.getTopStackFrame()).getReferenceType();
assertEquals("Stopped in wrong type", breakTypeName, type.getName());
-
+
String methodName = ((IJavaStackFrame)thread.getTopStackFrame()).getMethodName();
assertEquals("Stopped in wrong method", "roleMethod1", methodName);
-
+
String sourceName = ((IJavaStackFrame)thread.getTopStackFrame()).getSourceName(ISMAPConstants.OTJ_STRATUM_NAME);
assertEquals("Lookup gave wrong source name", sourceFile, sourceName);
-
+
} catch (AssertionFailedError fail) {
if (thread != null) {
IConsole console = DebugUITools.getConsole(thread.getLaunch().getProcesses()[0]);
@@ -131,7 +131,7 @@ public class CopyInheritanceBreakpointTest extends AbstractOTDTDebugTest {
} finally {
terminateAndRemove(thread);
removeAllBreakpoints();
- }
+ }
}
public void testBreakInRoleFileMethod() throws Exception {
@@ -143,9 +143,9 @@ public class CopyInheritanceBreakpointTest extends AbstractOTDTDebugTest {
String breakTypeName = "copyinheritancetests.SubTeam3$__OT__R";
// expect this source file to be found via SMAP:
String sourceFile = "R.java";
-
+
createLineBreakpoint(4, breakRoleName); // sysout within roleMethod1
-
+
IJavaThread thread= null;
try {
waitForBuild();
@@ -153,16 +153,16 @@ public class CopyInheritanceBreakpointTest extends AbstractOTDTDebugTest {
thread= launchToBreakpoint(launchTypeName);
assertNotNull("Breakpoint not hit within timeout period", thread);
-
+
IJavaReferenceType type = ((IJavaStackFrame)thread.getTopStackFrame()).getReferenceType();
assertEquals("Stopped in wrong type", breakTypeName, type.getName());
-
+
String methodName = ((IJavaStackFrame)thread.getTopStackFrame()).getMethodName();
assertEquals("Stopped in wrong method", "roleMethod1", methodName);
-
+
String sourceName = ((IJavaStackFrame)thread.getTopStackFrame()).getSourceName(ISMAPConstants.OTJ_STRATUM_NAME);
assertEquals("Lookup gave wrong source name", sourceFile, sourceName);
-
+
} catch (AssertionFailedError fail) {
if (thread != null) {
IConsole console = DebugUITools.getConsole(thread.getLaunch().getProcesses()[0]);
@@ -178,7 +178,7 @@ public class CopyInheritanceBreakpointTest extends AbstractOTDTDebugTest {
} finally {
terminateAndRemove(thread);
removeAllBreakpoints();
- }
+ }
}
void expectNoErrors(String projectName) {
diff --git a/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/core/RoFiBreakpointTests.java b/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/core/RoFiBreakpointTests.java
index b3d8ec6a0..b05a3fb22 100644
--- a/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/core/RoFiBreakpointTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/core/RoFiBreakpointTests.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2008 Technical University Berlin, Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Technical University Berlin - Initial API and implementation
**********************************************************************/
@@ -29,17 +29,17 @@ public class RoFiBreakpointTests extends AbstractOTDTDebugTest {
super(name);
}
-
-
+
+
/**
* Test breaking in a team method
- *
+ *
* @throws Exception
*/
public void testBreakInTeamMethod1() throws Exception {
String typeName = "rofitests.RoFiTeam";
- createLineBreakpoint(6, typeName);
-
+ createLineBreakpoint(6, typeName);
+
IJavaThread thread= null;
try {
thread= launchToBreakpoint(typeName);
@@ -53,21 +53,21 @@ public class RoFiBreakpointTests extends AbstractOTDTDebugTest {
} finally {
terminateAndRemove(thread);
removeAllBreakpoints();
- }
+ }
}
-
-
+
+
/**
* Test breaking in a method of a role file.
- *
+ *
* @throws Exception
*/
public void testBreakInRoFiMethod1() throws Exception {
String typeName = "rofitests.RoFiTeam";
String roleName = "rofitests.RoFiTeam.RoFiRole";
String roleBinaryName = "rofitests.RoFiTeam$__OT__RoFiRole";
- createLineBreakpoint(5, roleName);
-
+ createLineBreakpoint(5, roleName);
+
IJavaThread thread= null;
try {
thread= launchToBreakpoint(typeName);
@@ -76,22 +76,22 @@ public class RoFiBreakpointTests extends AbstractOTDTDebugTest {
assertEquals("Stopped in wrong type", roleBinaryName, type.getName());
String methodName = ((IJavaStackFrame)thread.getTopStackFrame()).getMethodName();
assertEquals("Stopped in wrong method", "doRolish", methodName);
-
-
+
+
assertEquals("Wrong source name", "RoFiRole.java", ((IJavaStackFrame)thread.getTopStackFrame()).getSourceName(ISMAPConstants.OTJ_STRATUM_NAME));
// IPackageFragmentRoot root = getPackageFragmentRoot(getJavaProject(), "src");
// IJavaSourceLocation location = new PackageFragmentRootSourceLocation(root);
// String[] javaSourcePaths = type.getSourcePaths("java");
// String[] otjSourcePaths = type.getSourcePaths(ISMAPConstants.OTJ_STRATUM_NAME);
// System.out.println("j:"+javaSourcePaths.length+", otj:"+otjSourcePaths.length);
-//
+//
// ICompilationUnit cu = (ICompilationUnit) location.findSourceElement(otjSourcePaths[0]);
// assertNotNull("CU should not be null", cu);
// assertTrue("CU should exist", cu.exists());
} finally {
terminateAndRemove(thread);
removeAllBreakpoints();
- }
+ }
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/core/SourceDebugExtensionTest.java b/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/core/SourceDebugExtensionTest.java
index 8ba762eac..514ef027c 100644
--- a/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/core/SourceDebugExtensionTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/core/SourceDebugExtensionTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -52,28 +52,28 @@ public class SourceDebugExtensionTest extends AbstractOTDTDebugTest
assertNotNull("An error occurs while creating ClassAttributeReader", reader);
assertFalse("SDE should be absent.", reader.isSDEAvailable());
}
-
+
public void testSDEAbsenceForSimpleTeam2() throws Exception
{
ClassAttributeReader reader = getAttributeReader("SimpleTeam2");
assertNotNull("An error occurs while creating ClassAttributeReader", reader);
assertFalse("SDE should be absent.", reader.isSDEAvailable());
}
-
+
public void testSDEExistenceForSimpleSDEClass() throws Exception
{
ClassAttributeReader reader = getAttributeReader("SimpleSDEClass");
assertNotNull("An error occurs while creating ClassAttributeReader", reader);
assertTrue("SDE should exist.", reader.isSDEAvailable());
}
-
+
private ClassAttributeReader getAttributeReader(String classname) throws Exception
{
IPath classFilePath = getAbsoluteOSClassFilePath(classname);
ClassAttributeReader classReader = new ClassAttributeReader(classFilePath);
if (classReader.getError() != null)
return null;
-
+
return classReader;
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/core/StratumTests.java b/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/core/StratumTests.java
index b2dc7a3cd..a49fa4046 100644
--- a/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/core/StratumTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/core/StratumTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -31,20 +31,20 @@ import org.eclipse.objectteams.otdt.debug.tests.AbstractOTDTDebugTest;
* Tests strata.
*/
public class StratumTests extends AbstractOTDTDebugTest {
-
+
public StratumTests(String name) {
super(name);
}
/**
* Test available strata on a type.
- *
+ *
* @throws Exception
*/
public void testAvailableStrata() throws Exception {
String typeName = "Breakpoints";
- createLineBreakpoint(81, typeName);
-
+ createLineBreakpoint(81, typeName);
+
IJavaThread thread= null;
try {
thread= launchToBreakpoint(typeName);
@@ -57,18 +57,18 @@ public class StratumTests extends AbstractOTDTDebugTest {
} finally {
terminateAndRemove(thread);
removeAllBreakpoints();
- }
+ }
}
-
+
/**
* Test default stratum on a type.
- *
+ *
* @throws Exception
*/
public void testDefaultStratum() throws Exception {
String typeName = "Breakpoints";
- createLineBreakpoint(81, typeName);
-
+ createLineBreakpoint(81, typeName);
+
IJavaThread thread= null;
try {
thread= launchToBreakpoint(typeName);
@@ -79,18 +79,18 @@ public class StratumTests extends AbstractOTDTDebugTest {
} finally {
terminateAndRemove(thread);
removeAllBreakpoints();
- }
- }
+ }
+ }
/**
* Test set / get default stratum on a java debug target.
- *
+ *
* @throws Exception
*/
public void testSetGetDefaultStratum() throws Exception {
String typeName = "Breakpoints";
- createLineBreakpoint(81, typeName);
-
+ createLineBreakpoint(81, typeName);
+
IJavaThread thread= null;
try {
thread= launchToBreakpoint(typeName);
@@ -104,7 +104,7 @@ public class StratumTests extends AbstractOTDTDebugTest {
} finally {
terminateAndRemove(thread);
removeAllBreakpoints();
- }
+ }
}
public void testGetLineInStratum() throws Exception {
diff --git a/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/AllTests.java
index 4c0a0cd57..d4b8574e9 100644
--- a/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/AllTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
diff --git a/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/BuilderTestPlugin.java b/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/BuilderTestPlugin.java
index 88d82b53c..006fd23c0 100644
--- a/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/BuilderTestPlugin.java
+++ b/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/BuilderTestPlugin.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -35,7 +35,7 @@ public class BuilderTestPlugin extends Plugin {
// The shared instance
private static BuilderTestPlugin plugin;
-
+
/**
* The constructor
*/
diff --git a/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/CompilationOrderTests.java b/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/CompilationOrderTests.java
index e9c94dad5..6334a54a2 100644
--- a/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/CompilationOrderTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/CompilationOrderTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2014 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -42,8 +42,8 @@ public class CompilationOrderTests extends OTBuilderTests {
public CompilationOrderTests(String name) {
super(name);
}
-
- /* In batch-mode this causes a problem,
+
+ /* In batch-mode this causes a problem,
* compilation order is different in workbench mode, though
* (depends on class names?!).
* Original jacks test is removed.
@@ -51,7 +51,7 @@ public class CompilationOrderTests extends OTBuilderTests {
@SuppressWarnings("nls")
public void test177otjd5f() throws JavaModelException {
System.out.println("***** test177otjd5f() *****");
- IPath projectPath = env.addProject("Project", "1.5");
+ IPath projectPath = env.addProject("Project", "1.5");
env.addExternalJars(projectPath, Util.getJavaClassLibs());
env.addExternalJar(projectPath, ClasspathUtil.getOTREPath(this.weavingScheme));
@@ -62,11 +62,11 @@ public class CompilationOrderTests extends OTBuilderTests {
env.setOutputFolder(projectPath, "bin");
env.addClass(root, "p", "ATeam",
- "package p; \n"+
+ "package p; \n"+
"public team class ATeam { protected class R implements IConfined {} public IConfined getR() { return new R(); } }");
- env.addClass(root, "p", "M",
- "package p; \n"+
+ env.addClass(root, "p", "M",
+ "package p; \n"+
"public class M {\n"+
" @SuppressWarnings(\"unused\")\n"+
" void foo() {\n"+
@@ -86,7 +86,7 @@ public class CompilationOrderTests extends OTBuilderTests {
@SuppressWarnings("nls")
public void testMissingOTRE() throws JavaModelException {
System.out.println("***** testMissingOTRE() *****");
- IPath projectPath = env.addProject("Project", "1.5");
+ IPath projectPath = env.addProject("Project", "1.5");
// don't abort when detecting the build path error
// (otherwise other errors would be expunged).
env.getJavaProject(projectPath).setOption(JavaCore.CORE_JAVA_BUILD_INVALID_CLASSPATH, JavaCore.ERROR);
@@ -100,13 +100,13 @@ public class CompilationOrderTests extends OTBuilderTests {
env.setOutputFolder(projectPath, "bin");
IPath ateam = env.addClass(root, "p", "ATeam",
- "package p; \n"+
+ "package p; \n"+
"public team class ATeam { ATeam() { super(); } }");
fullBuild(projectPath);
-
+
expectingProblemsFor(ateam);
- expectingOnlySpecificProblemsFor(ateam,
+ expectingOnlySpecificProblemsFor(ateam,
new Problem[] {
new Problem("", "The type org.objectteams.Team cannot be resolved. It is indirectly referenced from required .class files", ateam, 30, 35, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR),
new Problem("", "The constructor Team() is undefined", ateam, 48,56, CategorizedProblem.CAT_MEMBER, IMarker.SEVERITY_ERROR)
diff --git a/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/IncrementalTests.java b/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/IncrementalTests.java
index ab516eedc..74d5b5d05 100644
--- a/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/IncrementalTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/IncrementalTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2014 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -37,10 +37,10 @@ import static org.eclipse.objectteams.otdt.tests.ClasspathUtil.getOTREPath;
/**
* This test class tests incremental compilation of teams and roles.
*/
-@SuppressWarnings("nls")
+@SuppressWarnings("nls")
public class IncrementalTests extends OTBuilderTests {
-
-
+
+
public IncrementalTests(String name) {
super(name);
}
@@ -48,12 +48,12 @@ public class IncrementalTests extends OTBuilderTests {
public static Test suite() {
return buildTestSuite(IncrementalTests.class);
}
-
+
/*
*/
public void testRemoveTeamType() throws JavaModelException {
System.out.println("***** testRemoveTeamType() *****");
- IPath projectPath = env.addProject("Project", "1.5");
+ IPath projectPath = env.addProject("Project", "1.5");
env.addExternalJars(projectPath, Util.getJavaClassLibs());
env.addExternalJar(projectPath, getOTREPath(this.weavingScheme));
@@ -64,12 +64,12 @@ public class IncrementalTests extends OTBuilderTests {
env.setOutputFolder(projectPath, "bin");
env.addClass(root, "p", "AA",
- "package p; \n"+
+ "package p; \n"+
"public team class AA { }");
-
- IPath pathToAB = env.addClass(root, "p.AA", "R",
- "team package p.AA; \n"+
+
+ IPath pathToAB = env.addClass(root, "p.AA", "R",
+ "team package p.AA; \n"+
" protected class R {}");
@@ -82,11 +82,11 @@ public class IncrementalTests extends OTBuilderTests {
/* build must detect, that R - although unchanged - becomes invalid. */
incrementalBuild(projectPath);
expectingProblemsFor(pathToAB);
- expectingSpecificProblemFor(pathToAB, new Problem("", "Enclosing team p.AA not found for role file R (OTJLD 1.2.5(c)).", pathToAB, 13, 17, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR));
-
+ expectingSpecificProblemFor(pathToAB, new Problem("", "Enclosing team p.AA not found for role file R (OTJLD 1.2.5(c)).", pathToAB, 13, 17, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR));
+
/* Restore team AA */
env.addClass(root, "p", "AA",
- "package p; \n"+
+ "package p; \n"+
"public team class AA {}");
incrementalBuild(projectPath);
@@ -96,7 +96,7 @@ public class IncrementalTests extends OTBuilderTests {
*/
public void testRemoveRoleType() throws JavaModelException {
System.out.println("***** testRemoveRoleType() *****");
- IPath projectPath = env.addProject("Project", "1.5");
+ IPath projectPath = env.addProject("Project", "1.5");
env.addExternalJars(projectPath, Util.getJavaClassLibs());
env.addExternalJar(projectPath, getOTREPath(this.weavingScheme));
@@ -128,8 +128,8 @@ public class IncrementalTests extends OTBuilderTests {
/* build must detect, that AB - although unchanged - becomes invalid. */
incrementalBuild(projectPath);
expectingProblemsFor(pathToAB);
- expectingSpecificProblemFor(pathToAB, new Problem("", "RA cannot be resolved to a type", pathToAB, 75, 77, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR));
-
+ expectingSpecificProblemFor(pathToAB, new Problem("", "RA cannot be resolved to a type", pathToAB, 75, 77, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR));
+
/* Restore role AA.RA */
env.addClass(root, "p", "AA",
"package p; \n"+
@@ -141,7 +141,7 @@ public class IncrementalTests extends OTBuilderTests {
}
public void testRemoveRoleFile() throws JavaModelException {
System.out.println("***** testRemoveRoleFile() *****");
- IPath projectPath = env.addProject("Project", "1.5");
+ IPath projectPath = env.addProject("Project", "1.5");
env.addExternalJars(projectPath, Util.getJavaClassLibs());
env.addExternalJar(projectPath, getOTREPath(this.weavingScheme));
@@ -173,8 +173,8 @@ public class IncrementalTests extends OTBuilderTests {
/* build must detect, that AB - although unchanged - becomes invalid -- but no further errors/exceptions */
incrementalBuild(projectPath);
expectingProblemsFor(pathToOuterSub);
- expectingSpecificProblemFor(pathToOuterSub, new Problem("", "Nested cannot be resolved to a type", pathToOuterSub, 58, 64, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR));
-
+ expectingSpecificProblemFor(pathToOuterSub, new Problem("", "Nested cannot be resolved to a type", pathToOuterSub, 58, 64, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR));
+
}
/*
*/
@@ -223,11 +223,11 @@ public class IncrementalTests extends OTBuilderTests {
/* build must detect, that the use of AB - although AB is unchanged - becomes invalid. */
incrementalBuild(projectPath);
expectingProblemsFor(pathToM);
- expectingSpecificProblemFor(pathToM, new Problem("", "The method foo() is undefined for the type RA<@tthis[AB]>", pathToM, 68, 71, CategorizedProblem.CAT_MEMBER, IMarker.SEVERITY_ERROR));
+ expectingSpecificProblemFor(pathToM, new Problem("", "The method foo() is undefined for the type RA<@tthis[AB]>", pathToM, 68, 71, CategorizedProblem.CAT_MEMBER, IMarker.SEVERITY_ERROR));
/* Restore method AA.RA.foo */
env.addClass(root, "p", "AA",
- "package p; \n"+
+ "package p; \n"+
"public team class AA { \n"+
" public class RA { \n"+
" public void foo() {}\n"+
@@ -236,19 +236,19 @@ public class IncrementalTests extends OTBuilderTests {
incrementalBuild(projectPath);
expectingNoProblems();
}
-
+
/*
*/
public void testModifyTSuperRole1() throws JavaModelException {
System.out.println("***** testModifyTSuperRole1() *****");
- IPath projectPath = env.addProject("Project", "1.5");
+ IPath projectPath = env.addProject("Project", "1.5");
env.addExternalJars(projectPath, Util.getJavaClassLibs());
env.addExternalJar(projectPath, getOTREPath(this.weavingScheme));
// remove old package fragment root so that names don't collide
- env.removePackageFragmentRoot(projectPath, "");
+ env.removePackageFragmentRoot(projectPath, "");
- IPath root = env.addPackageFragmentRoot(projectPath, "src");
+ IPath root = env.addPackageFragmentRoot(projectPath, "src");
env.setOutputFolder(projectPath, "bin");
env.addClass(root, "p", "AA",
@@ -279,7 +279,7 @@ public class IncrementalTests extends OTBuilderTests {
/* build must detect, that AB - although unchanged - becomes invalid through a self-call. */
incrementalBuild(projectPath);
expectingProblemsFor(pathToAB);
- expectingSpecificProblemFor(pathToAB, new Problem("", "The method bar() is undefined for the type AB.R", pathToAB, 94, 97, CategorizedProblem.CAT_MEMBER, IMarker.SEVERITY_ERROR));
+ expectingSpecificProblemFor(pathToAB, new Problem("", "The method bar() is undefined for the type AB.R", pathToAB, 94, 97, CategorizedProblem.CAT_MEMBER, IMarker.SEVERITY_ERROR));
/* Restore method AA.R.bar */
env.addClass(root, "p", "AA",
@@ -292,36 +292,36 @@ public class IncrementalTests extends OTBuilderTests {
incrementalBuild(projectPath);
expectingNoProblems();
}
-
+
/*
* The body of a tsuper role is modified.
*/
public void testModifyTSuperRole2() throws Exception {
System.out.println("***** testModifyTSuperRole2() *****");
- IPath projectPath = env.addProject("Project", "1.5");
+ IPath projectPath = env.addProject("Project", "1.5");
env.addExternalJars(projectPath, Util.getJavaClassLibs());
env.addExternalJar(projectPath, getOTREPath(this.weavingScheme));
// remove old package fragment root so that names don't collide
- env.removePackageFragmentRoot(projectPath, "");
+ env.removePackageFragmentRoot(projectPath, "");
- IPath root = env.addPackageFragmentRoot(projectPath, "src");
+ IPath root = env.addPackageFragmentRoot(projectPath, "src");
env.setOutputFolder(projectPath, "bin");
- env.addClass(root, "p", "AA",
- "package p; \n"+
- "public team class AA { \n"+
+ env.addClass(root, "p", "AA",
+ "package p; \n"+
+ "public team class AA { \n"+
" protected class R {\n" +
" String bar() { return \"NOK\"; }\n"+
"}}");
env.addClass(root, "p", "AB",
- "package p; \n"+
+ "package p; \n"+
"public team class AB extends AA {\n"+
" protected class R {\n"+
- " protected String foo() { return this.bar(); }\n"+
- " }\n"+
- " public static String test() {\n"+
+ " protected String foo() { return this.bar(); }\n"+
+ " }\n"+
+ " public static String test() {\n"+
" return new AB().new R().foo();\n"+
" }\n"+
"}");
@@ -332,16 +332,16 @@ public class IncrementalTests extends OTBuilderTests {
/* Change method R.bar() */
env.addClass(root, "p", "AA",
- "package p; \n"+
- "public team class AA {\n" +
- " protected class R {\n" +
+ "package p; \n"+
+ "public team class AA {\n" +
+ " protected class R {\n" +
" String bar() { return \"OK\"; }\n"+
"}}");
/* build must achieve that AB - although unchanged - behaves differently. */
incrementalBuild(projectPath);
expectingNoProblems();
-
+
IJavaProject project = JavaCore.create(env.getProject("Project"));
try (OTLaunchEnvironment launcher = new OTLaunchEnvironment(
env.getWorkspaceRootPath(),
@@ -352,7 +352,7 @@ public class IncrementalTests extends OTBuilderTests {
// cleanup:
System.gc();
}
-
+
/*
* The body of a tsuper role is modified -- three levels.
*/
@@ -362,7 +362,7 @@ public class IncrementalTests extends OTBuilderTests {
env.addExternalJars(projectPath, Util.getJavaClassLibs());
env.addExternalJar(projectPath, getOTREPath(this.weavingScheme));
- // remove old package fragment root so that names don't collide
+ // remove old package fragment root so that names don't collide
env.removePackageFragmentRoot(projectPath, "");
IPath root = env.addPackageFragmentRoot(projectPath, "src");
@@ -377,10 +377,10 @@ public class IncrementalTests extends OTBuilderTests {
" }\n"+
"}}");
- env.addClass(root, "p", "AB",
+ env.addClass(root, "p", "AB",
"package p; \n"+
"public team class AB extends AA {}");
-
+
env.addClass(root, "p", "AC",
"package p; \n"+
"public team class AC extends AB {\n"+
@@ -407,7 +407,7 @@ public class IncrementalTests extends OTBuilderTests {
/* build must achieve that AB - although unchanged - behaves differently. */
incrementalBuild(projectPath);
expectingNoProblems();
-
+
IJavaProject project = JavaCore.create(env.getProject("Project"));
try (OTLaunchEnvironment launcher = new OTLaunchEnvironment(
env.getWorkspaceRootPath(),
@@ -420,18 +420,18 @@ public class IncrementalTests extends OTBuilderTests {
}
/** A playedBy declaration is added to a super role file.
- * Witness for NPE in RoleModel.getBaseclassAttributename.
+ * Witness for NPE in RoleModel.getBaseclassAttributename.
*/
public void testModifySuperRole1() throws JavaModelException {
System.out.println("***** testModifySuperRole1() *****");
- IPath projectPath = env.addProject("Project", "1.5");
+ IPath projectPath = env.addProject("Project", "1.5");
env.addExternalJars(projectPath, Util.getJavaClassLibs());
env.addExternalJar(projectPath, getOTREPath(this.weavingScheme));
// remove old package fragment root so that names don't collide
- env.removePackageFragmentRoot(projectPath, "");
+ env.removePackageFragmentRoot(projectPath, "");
- IPath root = env.addPackageFragmentRoot(projectPath, "src");
+ IPath root = env.addPackageFragmentRoot(projectPath, "src");
env.setOutputFolder(projectPath, "bin");
env.addClass(root, "p", "AA",
@@ -471,20 +471,20 @@ public class IncrementalTests extends OTBuilderTests {
incrementalBuild(projectPath);
expectingNoProblems();
}
-
- /**
- * A sibling role is modified causing a binary role to fail generating callins.
+
+ /**
+ * A sibling role is modified causing a binary role to fail generating callins.
*/
public void testModifySiblingRole1() throws JavaModelException {
System.out.println("***** testModifySiblingRole1() *****");
- IPath projectPath = env.addProject("Project", "1.5");
+ IPath projectPath = env.addProject("Project", "1.5");
env.addExternalJars(projectPath, Util.getJavaClassLibs());
env.addExternalJar(projectPath, getOTREPath(this.weavingScheme));
// remove old package fragment root so that names don't collide
- env.removePackageFragmentRoot(projectPath, "");
+ env.removePackageFragmentRoot(projectPath, "");
- IPath root = env.addPackageFragmentRoot(projectPath, "src");
+ IPath root = env.addPackageFragmentRoot(projectPath, "src");
env.setOutputFolder(projectPath, "bin");
env.addClass(root, "p", "B",
@@ -526,7 +526,7 @@ public class IncrementalTests extends OTBuilderTests {
incrementalBuild(projectPath);
expectingNoProblems();
}
-
+
/*
* The team with a role file is modified
*/
@@ -537,20 +537,20 @@ public class IncrementalTests extends OTBuilderTests {
env.addExternalJar(projectPath, getOTREPath(this.weavingScheme));
// remove old package fragment root so that names don't collide
- env.removePackageFragmentRoot(projectPath, "");
+ env.removePackageFragmentRoot(projectPath, "");
IPath root = env.addPackageFragmentRoot(projectPath, "src");
env.setOutputFolder(projectPath, "bin");
- env.addClass(root, "p", "B",
- "package p; \n"+
- "public class B { \n"+
+ env.addClass(root, "p", "B",
+ "package p; \n"+
+ "public class B { \n"+
" String bar() { return \"NOK\"; }\n"+
"}");
- env.addClass(root, "p", "AA",
- "package p; \n"+
- "public team class AA { \n"+
+ env.addClass(root, "p", "AA",
+ "package p; \n"+
+ "public team class AA { \n"+
" public static String test() {\n"+
" new AA();\n"+
" return new B().bar();\n"+
@@ -562,8 +562,8 @@ public class IncrementalTests extends OTBuilderTests {
"protected class R playedBy B {\n"+
" @SuppressWarnings(\"basecall\")\n"+
" callin String foo() { return \"OK\"; }\n"+
- " foo <- replace bar;\n"+
- "}");
+ " foo <- replace bar;\n"+
+ "}");
fullBuild(projectPath);
@@ -571,9 +571,9 @@ public class IncrementalTests extends OTBuilderTests {
/* add constructor */
- env.addClass(root, "p", "AA",
- "package p; \n"+
- "public team class AA { \n"+
+ env.addClass(root, "p", "AA",
+ "package p; \n"+
+ "public team class AA { \n"+
" public AA() { this.activate(); }\n"+
" public static String test() {\n"+
" new AA();\n"+
@@ -584,7 +584,7 @@ public class IncrementalTests extends OTBuilderTests {
/* build must achieve that R - although unchanged - is compiled into AA. */
incrementalBuild(projectPath);
expectingNoProblems();
-
+
IJavaProject project = JavaCore.create(env.getProject("Project"));
try (OTLaunchEnvironment launcher = new OTLaunchEnvironment(
env.getWorkspaceRootPath(),
@@ -596,7 +596,7 @@ public class IncrementalTests extends OTBuilderTests {
// cleanup:
System.gc();
}
-
+
public void testAddRoFiToCompiledTeam()
throws JavaModelException
{
@@ -605,7 +605,7 @@ public class IncrementalTests extends OTBuilderTests {
env.addExternalJars(projectPath, Util.getJavaClassLibs());
env.addExternalJar(projectPath, getOTREPath(this.weavingScheme));
- // remove old package fragment root so that names don't collide
+ // remove old package fragment root so that names don't collide
env.removePackageFragmentRoot(projectPath, "");
IPath root = env.addPackageFragmentRoot(projectPath, "src");
@@ -619,7 +619,7 @@ public class IncrementalTests extends OTBuilderTests {
" return \"NOK\";\n"+
" }\n"+
"}}");
-
+
fullBuild(projectPath);
expectingNoProblems();
@@ -630,7 +630,7 @@ public class IncrementalTests extends OTBuilderTests {
" return \"NOK\";\n"+
" }\n"+
"}");
-
+
/* build must achieve that AA - although unchanged - is recompiled. */
incrementalBuild(projectPath);
expectingNoProblems();
@@ -644,12 +644,12 @@ public class IncrementalTests extends OTBuilderTests {
" return \"OK\";\n"+
" }\n"+
"}");
-
+
/* build must(?) achieve that AA - although unchanged - is recompiled. */
incrementalBuild(projectPath);
expectingNoProblems();
}
-
+
public void testAddRoFiToBrokenTeam()
throws JavaModelException
{
@@ -657,23 +657,23 @@ public class IncrementalTests extends OTBuilderTests {
IPath projectPath = env.addProject("Project", "1.5");
env.addExternalJars(projectPath, Util.getJavaClassLibs());
env.addExternalJar(projectPath, getOTREPath(this.weavingScheme));
-
- // remove old package fragment root so that names don't collide
+
+ // remove old package fragment root so that names don't collide
env.removePackageFragmentRoot(projectPath, "");
-
+
IPath root = env.addPackageFragmentRoot(projectPath, "src");
env.setOutputFolder(projectPath, "bin");
-
+
// a broken team:
env.addClass(root, "p", "AA",
"package p; \n"+
"public team class AA { \n"+
" int abstract foo;// syntax error\n"+
"}");
-
+
fullBuild(projectPath);
expectingProblemsFor(root);
-
+
// add a role file:
env.addClass(root, "p/AA", "ExtRole",
"team package p.AA; \n"+
@@ -682,11 +682,11 @@ public class IncrementalTests extends OTBuilderTests {
" return \"NOK\";\n"+
" }\n"+
"}");
-
+
/* build must achieve that errors in AA are detected again. */
incrementalBuild(projectPath);
expectingProblemsFor(root);
-
+
/* also break role file: */
IPath rofi = env.addClass(root, "p/AA", "ExtRole",
"team package p.AA; \n"+
@@ -699,7 +699,7 @@ public class IncrementalTests extends OTBuilderTests {
/* now everything is broken. */
incrementalBuild(projectPath);
expectingProblemsFor(root);
-
+
// correct the syntax error:
env.addClass(root, "p", "AA",
"package p; \n"+
@@ -711,7 +711,7 @@ public class IncrementalTests extends OTBuilderTests {
incrementalBuild(projectPath);
expectingProblemsFor(rofi);
}
-
+
public void testBreakTeamWithRoFi()
throws JavaModelException
{
@@ -719,13 +719,13 @@ public class IncrementalTests extends OTBuilderTests {
IPath projectPath = env.addProject("Project", "1.5");
env.addExternalJars(projectPath, Util.getJavaClassLibs());
env.addExternalJar(projectPath, getOTREPath(this.weavingScheme));
-
- // remove old package fragment root so that names don't collide
+
+ // remove old package fragment root so that names don't collide
env.removePackageFragmentRoot(projectPath, "");
-
+
IPath root = env.addPackageFragmentRoot(projectPath, "src");
env.setOutputFolder(projectPath, "bin");
-
+
// team and role w/o errors:
env.addClass(root, "p", "AA",
"package p; \n"+
@@ -740,10 +740,10 @@ public class IncrementalTests extends OTBuilderTests {
" return \"OK\";\n"+
" }\n"+
"}");
-
+
fullBuild(projectPath);
expectingNoProblems();
-
+
// introduce an error to the team:
env.addClass(root, "p", "AA",
"package p; \n"+
@@ -754,7 +754,7 @@ public class IncrementalTests extends OTBuilderTests {
/* build must achieve that AA - although unchanged - is recompiled. */
incrementalBuild(projectPath);
expectingProblemsFor(root);
-
+
}
public void testRoFiExtendsInline()
@@ -765,7 +765,7 @@ public class IncrementalTests extends OTBuilderTests {
env.addExternalJars(projectPath, Util.getJavaClassLibs());
env.addExternalJar(projectPath, getOTREPath(this.weavingScheme));
- // remove old package fragment root so that names don't collide
+ // remove old package fragment root so that names don't collide
env.removePackageFragmentRoot(projectPath, "");
IPath root = env.addPackageFragmentRoot(projectPath, "src");
@@ -781,7 +781,7 @@ public class IncrementalTests extends OTBuilderTests {
"}}");
// Note: declaring R as a nested team requires to process the predifined roles,
// which caused a StackOverflowError previously.
-
+
fullBuild(projectPath);
expectingNoProblems();
@@ -792,7 +792,7 @@ public class IncrementalTests extends OTBuilderTests {
" return bar();\n"+
" }\n"+
"}");
-
+
// still OK.
incrementalBuild(projectPath);
expectingNoProblems();
@@ -806,13 +806,13 @@ public class IncrementalTests extends OTBuilderTests {
" return \"OK\";\n"+
" }\n"+
"}}");
-
+
// no reason why this should find problems.
incrementalBuild(projectPath);
expectingNoProblems();
}
// see http://trac.objectteams.org/ot/ticket/89
- public void testRemoveBoundBaseMethod()
+ public void testRemoveBoundBaseMethod()
throws JavaModelException
{
System.out.println("***** testRemoveBoundBaseMethod() *****");
@@ -820,7 +820,7 @@ public class IncrementalTests extends OTBuilderTests {
env.addExternalJars(projectPath, Util.getJavaClassLibs());
env.addExternalJar(projectPath, getOTREPath(this.weavingScheme));
- // remove old package fragment root so that names don't collide
+ // remove old package fragment root so that names don't collide
env.removePackageFragmentRoot(projectPath, "");
IPath root = env.addPackageFragmentRoot(projectPath, "src");
@@ -840,7 +840,7 @@ public class IncrementalTests extends OTBuilderTests {
" bar <- after foo;\n"+
" }\n"+
"}");
-
+
fullBuild(projectPath);
expectingNoProblems();
@@ -853,11 +853,11 @@ public class IncrementalTests extends OTBuilderTests {
env.addClass(root, "p", "T2",
"package p; \n"+
"public team class T2 extends T1 {}");
-
+
// must detect, that callin binding in T1 is now invalid
incrementalBuild(projectPath);
expectingProblemsFor(pathToT1);
- expectingSpecificProblemFor(pathToT1, new Problem("", "No method foo found in type p0.Base to resolve method designator (OTJLD 4.1(c)).", pathToT1, 137, 140, CategorizedProblem.CAT_MEMBER, IMarker.SEVERITY_ERROR));
+ expectingSpecificProblemFor(pathToT1, new Problem("", "No method foo found in type p0.Base to resolve method designator (OTJLD 4.1(c)).", pathToT1, 137, 140, CategorizedProblem.CAT_MEMBER, IMarker.SEVERITY_ERROR));
// restore:
env.addClass(root, "p0", "Base",
@@ -869,7 +869,7 @@ public class IncrementalTests extends OTBuilderTests {
expectingNoProblems();
}
// This scenario was observed to throw a CCE, see https://bugs.eclipse.org/311885
- public void testPhantomRole()
+ public void testPhantomRole()
throws JavaModelException
{
System.out.println("***** testPhantomRole() *****");
@@ -877,7 +877,7 @@ public class IncrementalTests extends OTBuilderTests {
env.addExternalJars(projectPath, Util.getJavaClassLibs());
env.addExternalJar(projectPath, getOTREPath(this.weavingScheme));
- // remove old package fragment root so that names don't collide
+ // remove old package fragment root so that names don't collide
env.removePackageFragmentRoot(projectPath, "");
IPath root = env.addPackageFragmentRoot(projectPath, "src");
@@ -901,11 +901,11 @@ public class IncrementalTests extends OTBuilderTests {
"public team class TeamBug311885_2 extends TeamBug311885_1 {\n" +
" public team class T12 {\n" +
" protected class R3 {\n" +
- " void m() {}\n" +
+ " void m() {}\n" +
" }\n" +
" }\n" +
"}\n");
-
+
fullBuild(projectPath);
expectingNoProblems();
@@ -915,7 +915,7 @@ public class IncrementalTests extends OTBuilderTests {
"public team class TeamBug311885_2 extends TeamBug311885_1 {\n" +
" public team class T12 {\n" +
" protected class R3 {\n" +
- " void m() { }\n" +
+ " void m() { }\n" +
" }\n" +
" }\n" +
"}\n");
diff --git a/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/MultipleCallinsWarningTest.java b/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/MultipleCallinsWarningTest.java
index 6bd460c01..fff449a98 100644
--- a/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/MultipleCallinsWarningTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/MultipleCallinsWarningTest.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2011, 2014 GK Software AG
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -46,11 +46,11 @@ public class MultipleCallinsWarningTest extends OTBuilderTests {
private char NL = '\n';
private IPath root;
private IPath projectPath;
-
+
public MultipleCallinsWarningTest(String testName) {
super(testName);
}
-
+
public static Test suite() {
return buildTestSuite(MultipleCallinsWarningTest.class);
@@ -59,24 +59,24 @@ public class MultipleCallinsWarningTest extends OTBuilderTests {
@Override
protected void setUp() throws Exception {
super.setUp();
- this.projectPath = env.addProject("MultipleCallinsProject", "1.5");
+ this.projectPath = env.addProject("MultipleCallinsProject", "1.5");
env.addExternalJars(projectPath, Util.getJavaClassLibs());
env.addExternalJar(projectPath, ClasspathUtil.getOTREPath(this.weavingScheme));
-
+
// remove old package fragment root so that names don't collide
env.removePackageFragmentRoot(projectPath, "");
-
+
this.root = env.addPackageFragmentRoot(projectPath, "src");
env.setOutputFolder(projectPath, "bin");
}
-
+
@Override
protected void tearDown() throws Exception {
super.tearDown();
this.root = null;
this.projectPath = null;
}
-
+
public Problem[] getProblemsFor(IJavaElement element, String additionalMarkerType){
IResource resource= env.getWorkspace().getRoot();
try {
@@ -117,7 +117,7 @@ public class MultipleCallinsWarningTest extends OTBuilderTests {
return new Problem[0];
}
- public void testMultipleCallinsDifferentTeams1() throws JavaModelException
+ public void testMultipleCallinsDifferentTeams1() throws JavaModelException
{
System.out.println("***** testMultipleCallinsDifferentTeams1() *****");
@@ -127,43 +127,43 @@ public class MultipleCallinsWarningTest extends OTBuilderTests {
NL + "{ " +
NL + " public void baseMethod(){}" +
NL + "} ");
-
+
env.addClass(this.root, "p1", "MyTeam1",
"package p1;" +
NL + "import base p.MyBase;\n" +
NL + "public team class MyTeam1 " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class MyRole playedBy MyBase " +
- NL + " { " +
+ NL + " { " +
NL + " public void role1Method() {}" +
NL + " role1Method <- after baseMethod; " +
NL + " } "+
NL + "}");
-
+
env.addClass(this.root, "p2", "MyTeam2",
"package p2;" +
NL + "import base p.MyBase;\n" +
NL + "public team class MyTeam2 " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class MyRole playedBy MyBase " +
- NL + " { " +
+ NL + " { " +
NL + " public void role2Method() {}" +
NL + " role2Method <- after baseMethod; " +
NL + " } "+
NL + "}");
-
+
fullBuild(projectPath);
-
+
expectingProblemsFor(pathToBase);
- Problem expectedProblem = new Problem("",
- "Multiple callin bindings are affecting method baseMethod() (perform full build to recompute).",
+ Problem expectedProblem = new Problem("",
+ "Multiple callin bindings are affecting method baseMethod() (perform full build to recompute).",
pathToBase, 51, 61, -1/*category*/, IMarker.SEVERITY_WARNING);
- expectingSpecificProblemFor(pathToBase,
+ expectingSpecificProblemFor(pathToBase,
expectedProblem);
}
-
+
// Bug 355321 - Avoid warning for multiple callins from the same team
- public void testMultipleCallinsDifferentTeams2() throws JavaModelException
+ public void testMultipleCallinsDifferentTeams2() throws JavaModelException
{
System.out.println("***** testMultipleCallinsDifferentTeams2() *****");
@@ -171,40 +171,40 @@ public class MultipleCallinsWarningTest extends OTBuilderTests {
"package p1;" +
NL + "import base java.util.ArrayList;\n" +
NL + "public team class MyTeam1 " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class MyRole playedBy ArrayList " +
- NL + " { " +
+ NL + " { " +
NL + " public void role1Method() {}" +
NL + " role1Method <- after size; " +
NL + " } "+
NL + "}");
-
+
env.addClass(this.root, "p2", "MyTeam2",
"package p2;" +
NL + "import base java.util.ArrayList;\n" +
NL + "public team class MyTeam2 " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class MyRole playedBy ArrayList " +
- NL + " { " +
+ NL + " { " +
NL + " public void role2Method() {}" +
NL + " role2Method <- after size; " +
NL + " } "+
NL + "}");
-
+
fullBuild(projectPath);
String expectedWarningMessage = "Multiple callin bindings are affecting method size() (perform full build to recompute).";
- IJavaElement baseElement = env.getJavaProject("MultipleCallinsProject").findElement(new Path("java/util/ArrayList.class"));
+ IJavaElement baseElement = env.getJavaProject("MultipleCallinsProject").findElement(new Path("java/util/ArrayList.class"));
Problem[] problems = getProblemsFor(baseElement, null); // IMarkableJavaElement.GLOBAL_PROBLEM_ID is subtype of JAVA_MODEL_PROBLEM_MARKER
-
+
assertEquals("unexpected number of problems", 1, problems.length);
assertEquals("wrong problem message", expectedWarningMessage, problems[0].getMessage());
assertEquals("wrong problem severity", IMarker.SEVERITY_WARNING, problems[0].getSeverity());
}
- public void testMultipleCallinsSameTeam() throws JavaModelException
+ public void testMultipleCallinsSameTeam() throws JavaModelException
{
System.out.println("***** testMultipleCallinsSameTeam() *****");
@@ -214,7 +214,7 @@ public class MultipleCallinsWarningTest extends OTBuilderTests {
NL + "{ " +
NL + " public void baseMethod(){}" +
NL + "} ");
-
+
env.addClass(root, "p1", "MyTeam1",
"package p1;" +
NL + "import base p.MyBase;\n" +
@@ -222,19 +222,19 @@ public class MultipleCallinsWarningTest extends OTBuilderTests {
NL + "{ " +
NL + " precedence MyRole1, MyRole2;" +
NL + " protected class MyRole1 playedBy MyBase " +
- NL + " { " +
+ NL + " { " +
NL + " public void role1Method() {}" +
NL + " role1Method <- after baseMethod; " +
NL + " } "+
NL + " protected class MyRole2 playedBy MyBase " +
- NL + " { " +
+ NL + " { " +
NL + " public void role2Method() {}" +
NL + " role2Method <- after baseMethod; " +
NL + " } "+
NL + "}");
-
+
fullBuild(projectPath);
-
+
expectingNoProblemsFor(pathToBase);
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/OTBuilderTests.java b/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/OTBuilderTests.java
index 7755b6390..4831d651a 100644
--- a/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/OTBuilderTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/OTBuilderTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2014 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -45,7 +45,7 @@ public class OTBuilderTests extends BuilderTests {
@Override
protected void setUp() throws Exception {
super.setUp();
-
+
this.otenv = new OTTestingEnvironment();
this.otenv.activate();
env = new TestingEnvironment() {
@@ -59,7 +59,7 @@ public class OTBuilderTests extends BuilderTests {
// don't know why this warning is getting reported against perfectly valid files, ignore it for now:
if (allProblems[i].getMessage().equals(PDECoreMessages.Builders_Manifest_useless_file))
continue;
- // some plugin.xml have a deprecated 'action' extension, just ignore those:
+ // some plugin.xml have a deprecated 'action' extension, just ignore those:
if (allProblems[i].getMessage().contains("deprecated"))
continue;
if (allProblems[i].getMessage().startsWith("The compiler compliance specified is")) // new warning from bug 533880
@@ -73,7 +73,7 @@ public class OTBuilderTests extends BuilderTests {
};
env.openEmptyWorkspace();
env.resetWorkspace();
-
+
BuildManager.DEBUG = 2;
}
@@ -89,7 +89,7 @@ public class OTBuilderTests extends BuilderTests {
protected void expectingProblemsFor(IPath expected) {
if (DEBUG)
printProblemsFor(expected);
-
+
/* get the leaf problems for this type */
Problem[] problems = env.getProblemsFor(expected);
assertTrue("missing expected problem with " + expected.toString(), problems.length > 0); //$NON-NLS-1$
diff --git a/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/OTEquinoxBuilderTests.java b/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/OTEquinoxBuilderTests.java
index b69a3eec1..f9b4e5ad7 100644
--- a/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/OTEquinoxBuilderTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/OTEquinoxBuilderTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2019 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -61,10 +61,10 @@ public class OTEquinoxBuilderTests extends OTBuilderTests {
}
@Override
protected String getPluginID() {
- return "org.eclipse.objectteams.otdt.test.builder";
+ return "org.eclipse.objectteams.otdt.test.builder";
}
@Override // make available locally:
- protected IJavaProject setUpJavaProject(String projectName) throws CoreException, IOException
+ protected IJavaProject setUpJavaProject(String projectName) throws CoreException, IOException
{
IJavaProject jProject = super.setUpJavaProject(projectName);
@@ -83,7 +83,7 @@ public class OTEquinoxBuilderTests extends OTBuilderTests {
return jProject;
}
protected void replaceWorkspaceFile(String src, IJavaProject project, String dest)
- throws IOException, CoreException
+ throws IOException, CoreException
{
File srcFile = new File(getPluginDirectoryPath()+File.separator+"workspace"+File.separator+src);
IFile destFile= project.getProject().getFile(dest);
@@ -102,16 +102,16 @@ public class OTEquinoxBuilderTests extends OTBuilderTests {
return new OTEquinoxBuilderTests("testBaseImportTwoAspectBindings");
//*/
}
-
+
@Override
protected void setUp() throws Exception {
super.setUp();
env.setAutoBuilding(false);
-
+
DEBUG = true;
}
-
+
IProject reopenProject(String projectName) throws CoreException {
final IProject project = fileManager.getWorkspaceRoot().getProject(projectName);
IWorkspaceRunnable populate = new IWorkspaceRunnable() {
@@ -126,9 +126,9 @@ public class OTEquinoxBuilderTests extends OTBuilderTests {
}
public void testForcedExports() throws CoreException, IOException {
- IJavaProject trac18b= fileManager.setUpJavaProject("Trac18b");
+ IJavaProject trac18b= fileManager.setUpJavaProject("Trac18b");
env.addProject(trac18b.getProject());
- IJavaProject trac18a= fileManager.setUpJavaProject("Trac18a");
+ IJavaProject trac18a= fileManager.setUpJavaProject("Trac18a");
env.addProject(trac18a.getProject());
fullBuild();
expectingNoProblemsFor(trac18b.getPath());
@@ -144,9 +144,9 @@ public class OTEquinoxBuilderTests extends OTBuilderTests {
}
public void testForcedExportsMissing() throws CoreException, IOException {
- IJavaProject trac18b= fileManager.setUpJavaProject("Trac18b");
+ IJavaProject trac18b= fileManager.setUpJavaProject("Trac18b");
env.addProject(trac18b.getProject());
- IJavaProject trac18a2= fileManager.setUpJavaProject("Trac18a2");
+ IJavaProject trac18a2= fileManager.setUpJavaProject("Trac18a2");
env.addProject(trac18a2.getProject());
fullBuild();
expectingNoProblemsFor(trac18b.getPath());
@@ -160,13 +160,13 @@ public class OTEquinoxBuilderTests extends OTBuilderTests {
getDecapsulationProblem(trac18a2, "trac18b.actions.SampleAction", "trac18a/Team18.java", 163, 175),
});
}
-
+
/* project Trac18a3 contains a base-ctor call and a callout binding,
* both referring to the force-exported base class.*/
public void testForcedExportsGeneratedMethodRefs() throws CoreException, IOException {
- IJavaProject trac18b= fileManager.setUpJavaProject("Trac18b");
+ IJavaProject trac18b= fileManager.setUpJavaProject("Trac18b");
env.addProject(trac18b.getProject());
- IJavaProject trac18a3= fileManager.setUpJavaProject("Trac18a3");
+ IJavaProject trac18a3= fileManager.setUpJavaProject("Trac18a3");
env.addProject(trac18a3.getProject());
fullBuild();
expectingNoProblemsFor(trac18b.getPath());
@@ -178,11 +178,11 @@ public class OTEquinoxBuilderTests extends OTBuilderTests {
}
/* trying to produce a broken and bogus error message a la Trac #154 (no success yet). */
public void testForcedExportTrac154() throws CoreException, IOException {
- IJavaProject trac154b1= fileManager.setUpJavaProject("Trac154b1");
+ IJavaProject trac154b1= fileManager.setUpJavaProject("Trac154b1");
env.addProject(trac154b1.getProject());
- IJavaProject trac154b2= fileManager.setUpJavaProject("Trac154b2");
+ IJavaProject trac154b2= fileManager.setUpJavaProject("Trac154b2");
env.addProject(trac154b2.getProject());
- IJavaProject trac154a= fileManager.setUpJavaProject("Trac154a");
+ IJavaProject trac154a= fileManager.setUpJavaProject("Trac154a");
env.addProject(trac154a.getProject());
fullBuild();
expectingNoProblemsFor(trac154b1.getPath());
@@ -194,9 +194,9 @@ public class OTEquinoxBuilderTests extends OTBuilderTests {
}
public void testBaseImportNoAspectBinding () throws CoreException, IOException {
- IJavaProject trac18b= fileManager.setUpJavaProject("Trac18b");
+ IJavaProject trac18b= fileManager.setUpJavaProject("Trac18b");
env.addProject(trac18b.getProject());
- IJavaProject aspectPlugin= fileManager.setUpJavaProject("MissingAspectBinding");
+ IJavaProject aspectPlugin= fileManager.setUpJavaProject("MissingAspectBinding");
aspectPlugin.setOption("org.eclipse.objectteams.otdt.compiler.problem.binding_conventions", "error");
env.addProject(aspectPlugin.getProject());
fullBuild();
@@ -213,24 +213,24 @@ public class OTEquinoxBuilderTests extends OTBuilderTests {
expectingNoProblemsFor(trac18b.getPath());
expectingNoProblemsFor(aspectPlugin.getPath());
}
-
+
/* Two aspect bindings refer to the same team, which has base imports referring to two different base bundles. */
public void testBaseImportTwoAspectBindings () throws CoreException, IOException {
- IJavaProject trac213b1= fileManager.setUpJavaProject("Trac213b1");
+ IJavaProject trac213b1= fileManager.setUpJavaProject("Trac213b1");
env.addProject(trac213b1.getProject());
- IJavaProject trac213b2= fileManager.setUpJavaProject("Trac213b2");
+ IJavaProject trac213b2= fileManager.setUpJavaProject("Trac213b2");
env.addProject(trac213b2.getProject());
fullBuild();
-
+
// initially only an empty team
- IJavaProject aspectPlugin= fileManager.setUpJavaProject("Trac213a");
+ IJavaProject aspectPlugin= fileManager.setUpJavaProject("Trac213a");
aspectPlugin.setOption("org.eclipse.objectteams.otdt.compiler.problem.binding_conventions", "error");
env.addProject(aspectPlugin.getProject());
fullBuild();
-
+
// now add content to the team, binding to Trac213b1:
fileManager.replaceWorkspaceFile("Trac213a/auxil/TheTeam_step1.java", aspectPlugin, "src/trac213a/TheTeam.java");
-
+
incrementalBuild();
expectingNoProblemsFor(trac213b1.getPath());
expectingNoProblemsFor(trac213b2.getPath());
@@ -239,17 +239,17 @@ public class OTEquinoxBuilderTests extends OTBuilderTests {
// now add content to the team, binding to Trac213b2:
fileManager.replaceWorkspaceFile("Trac213a/auxil/plugin_step2.xml", aspectPlugin, "plugin.xml");
fileManager.replaceWorkspaceFile("Trac213a/auxil/TheTeam_step2.java", aspectPlugin, "src/trac213a/TheTeam.java");
-
+
incrementalBuild();
expectingNoProblemsFor(trac213b1.getPath());
expectingNoProblemsFor(trac213b2.getPath());
expectingNoProblemsFor(aspectPlugin.getPath());
}
-
+
public void testWrongBaseImport1() throws CoreException, IOException {
- IJavaProject trac18b= fileManager.setUpJavaProject("Trac18b");
+ IJavaProject trac18b= fileManager.setUpJavaProject("Trac18b");
env.addProject(trac18b.getProject());
- IJavaProject aspectPlugin= fileManager.setUpJavaProject("WrongBaseImport1");
+ IJavaProject aspectPlugin= fileManager.setUpJavaProject("WrongBaseImport1");
aspectPlugin.setOption("org.eclipse.objectteams.otdt.compiler.problem.binding_conventions", "error");
env.addProject(aspectPlugin.getProject());
fullBuild();
@@ -259,13 +259,13 @@ public class OTEquinoxBuilderTests extends OTBuilderTests {
aspectPlugin.getPath().append(new Path("src/WrongBaseImportTeam1.java")),
12, 63,
CategorizedProblem.CAT_CODE_STYLE, IMarker.SEVERITY_ERROR)
- });
+ });
}
public void testWrongBaseImport2() throws CoreException, IOException {
- IJavaProject trac18b= fileManager.setUpJavaProject("Trac18b");
+ IJavaProject trac18b= fileManager.setUpJavaProject("Trac18b");
env.addProject(trac18b.getProject());
- IJavaProject aspectPlugin= fileManager.setUpJavaProject("WrongBaseImport2");
+ IJavaProject aspectPlugin= fileManager.setUpJavaProject("WrongBaseImport2");
aspectPlugin.setOption("org.eclipse.objectteams.otdt.compiler.problem.binding_conventions", "error");
env.addProject(aspectPlugin.getProject());
fullBuild();
@@ -275,16 +275,16 @@ public class OTEquinoxBuilderTests extends OTBuilderTests {
aspectPlugin.getPath().append(new Path("src/WrongBaseImportTeam2.java")),
12, 34,
CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR)
- });
+ });
}
public void testBaseImportTrac132 () throws CoreException, IOException {
- IJavaProject trac132b= fileManager.setUpJavaProject("Trac132b");
+ IJavaProject trac132b= fileManager.setUpJavaProject("Trac132b");
env.addProject(trac132b.getProject());
- IJavaProject aspectPlugin1= fileManager.setUpJavaProject("Trac132a1");
+ IJavaProject aspectPlugin1= fileManager.setUpJavaProject("Trac132a1");
aspectPlugin1.setOption("org.eclipse.objectteams.otdt.compiler.problem.binding_conventions", "error");
env.addProject(aspectPlugin1.getProject());
- IJavaProject aspectPlugin2= fileManager.setUpJavaProject("Trac132a2");
+ IJavaProject aspectPlugin2= fileManager.setUpJavaProject("Trac132a2");
aspectPlugin2.setOption("org.eclipse.objectteams.otdt.compiler.problem.binding_conventions", "error");
env.addProject(aspectPlugin2.getProject());
fullBuild();
@@ -294,12 +294,12 @@ public class OTEquinoxBuilderTests extends OTBuilderTests {
}
public void testBaseImportTrac304 () throws CoreException, IOException {
- IJavaProject trac304b= fileManager.setUpJavaProject("Trac304b");
+ IJavaProject trac304b= fileManager.setUpJavaProject("Trac304b");
env.addProject(trac304b.getProject());
// the fragment:
- IJavaProject trac304f= fileManager.setUpJavaProject("Trac304f");
+ IJavaProject trac304f= fileManager.setUpJavaProject("Trac304f");
env.addProject(trac304f.getProject());
- IJavaProject trac304ot= fileManager.setUpJavaProject("Trac304ot");
+ IJavaProject trac304ot= fileManager.setUpJavaProject("Trac304ot");
trac304ot.setOption("org.eclipse.objectteams.otdt.compiler.problem.binding_conventions", "error");
env.addProject(trac304ot.getProject());
fullBuild();
@@ -308,21 +308,21 @@ public class OTEquinoxBuilderTests extends OTBuilderTests {
}
public void testIllegalUseOfForcedExport() throws CoreException, IOException {
- IJavaProject trac18b= fileManager.setUpJavaProject("Trac18b");
+ IJavaProject trac18b= fileManager.setUpJavaProject("Trac18b");
env.addProject(trac18b.getProject());
- IJavaProject aspectPlugin= fileManager.setUpJavaProject("IllegalUseOfForcedExport");
+ IJavaProject aspectPlugin= fileManager.setUpJavaProject("IllegalUseOfForcedExport");
aspectPlugin.setOption("org.eclipse.objectteams.otdt.compiler.problem.binding_conventions", "error");
env.addProject(aspectPlugin.getProject());
fullBuild();
expectingNoProblemsFor(trac18b.getPath());
- expectingOnlySpecificProblemsFor(aspectPlugin.getPath(),
+ expectingOnlySpecificProblemsFor(aspectPlugin.getPath(),
new Problem[] {
getIllegalUseOfForcedExportProblem(aspectPlugin, "trac18b.actions.SampleAction", 88, 100),
getIllegalUseOfForcedExportProblem(aspectPlugin, "trac18b.actions.SampleAction", 7, 35)});
}
public void testAccumulatedBases1() throws CoreException, IOException {
- IJavaProject project= fileManager.setUpJavaProject("AccumulatedBases");
+ IJavaProject project= fileManager.setUpJavaProject("AccumulatedBases");
project.setOption("org.eclipse.objectteams.otdt.compiler.problem.binding_conventions", "error");
env.addProject(project.getProject());
fullBuild();
@@ -331,21 +331,21 @@ public class OTEquinoxBuilderTests extends OTBuilderTests {
incrementalBuild();
expectingNoProblemsFor(project.getPath());
}
-
+
public void testBaseImportTrac132_2 () throws CoreException, IOException {
- IJavaProject trac132b= fileManager.setUpJavaProject("Trac132b");
+ IJavaProject trac132b= fileManager.setUpJavaProject("Trac132b");
env.addProject(trac132b.getProject());
- IJavaProject aspectPlugin1= fileManager.setUpJavaProject("Trac132a1");
+ IJavaProject aspectPlugin1= fileManager.setUpJavaProject("Trac132a1");
aspectPlugin1.setOption("org.eclipse.objectteams.otdt.compiler.problem.binding_conventions", "error");
env.addProject(aspectPlugin1.getProject());
- IJavaProject aspectPlugin2= fileManager.setUpJavaProject("Trac132a2");
+ IJavaProject aspectPlugin2= fileManager.setUpJavaProject("Trac132a2");
aspectPlugin2.setOption("org.eclipse.objectteams.otdt.compiler.problem.binding_conventions", "error");
env.addProject(aspectPlugin2.getProject());
fullBuild();
expectingNoProblemsFor(trac132b.getPath());
expectingNoProblemsFor(aspectPlugin1.getPath());
expectingNoProblemsFor(aspectPlugin2.getPath());
-
+
// not needed.
// JavaModelManager.getJavaModelManager().removePerProjectInfo((JavaProject) trac132b);
// JavaModelManager.getJavaModelManager().removePerProjectInfo((JavaProject) aspectPlugin1);
@@ -354,7 +354,7 @@ public class OTEquinoxBuilderTests extends OTBuilderTests {
// doesn't work see :
//ResourcesPlugin.getPlugin().getBundle().stop();
//ResourcesPlugin.getPlugin().getBundle().start();
-
+
// simulate shutdown (from AbstractJavaModelTests.simulateExitRestart:
env.getWorkspace().save(true, null);
JavaModelManager.getJavaModelManager().shutdown();
@@ -363,11 +363,11 @@ public class OTEquinoxBuilderTests extends OTBuilderTests {
OTTestingEnvironment.restart();
JavaModelManager.getJavaModelManager().startup();
new JavaCorePreferenceInitializer().initializeDefaultPreferences();
-
+
env.openEmptyWorkspace();
env.setAutoBuilding(true);
-
+
trac132b= JavaCore.create(reopenProject("Trac132b"));
aspectPlugin1= JavaCore.create(reopenProject("Trac132a1"));
aspectPlugin2= JavaCore.create(reopenProject("Trac132a2"));
@@ -379,10 +379,10 @@ public class OTEquinoxBuilderTests extends OTBuilderTests {
}
public void testBug374833() throws CoreException, IOException {
- IJavaProject pluginPrj= fileManager.setUpJavaProject("UnresolvedBasePlugin");
+ IJavaProject pluginPrj= fileManager.setUpJavaProject("UnresolvedBasePlugin");
env.addProject(pluginPrj.getProject());
fullBuild();
- expectingOnlySpecificProblemsFor(pluginPrj.getPath(),
+ expectingOnlySpecificProblemsFor(pluginPrj.getPath(),
new Problem[] {
new Problem("", "Base plug-in Missing.Plugin cannot be resolved",
pluginPrj.getPath().append("plugin.xml"),
@@ -391,32 +391,32 @@ public class OTEquinoxBuilderTests extends OTBuilderTests {
}
public void testAspectExport () throws CoreException, IOException {
- IJavaProject aeb= fileManager.setUpJavaProject("AspectExportBase");
+ IJavaProject aeb= fileManager.setUpJavaProject("AspectExportBase");
env.addProject(aeb.getProject());
- IJavaProject aea= fileManager.setUpJavaProject("AspectExportAspect");
+ IJavaProject aea= fileManager.setUpJavaProject("AspectExportAspect");
aea.setOption("org.eclipse.objectteams.otdt.compiler.problem.binding_conventions", "error");
env.addProject(aea.getProject());
fullBuild();
expectingNoProblemsFor(aeb.getPath());
- expectingOnlySpecificProblemsFor(aea.getPath(),
+ expectingOnlySpecificProblemsFor(aea.getPath(),
new Problem[] {
getMissingAspectExportProblem(aea, "aea")});
}
-
+
public void testBug419987() throws CoreException, IOException {
- IJavaProject aeb= fileManager.setUpJavaProject("Base419987");
+ IJavaProject aeb= fileManager.setUpJavaProject("Base419987");
env.addProject(aeb.getProject());
- IJavaProject aea= fileManager.setUpJavaProject("Bug419987");
+ IJavaProject aea= fileManager.setUpJavaProject("Bug419987");
env.addProject(aea.getProject());
fullBuild();
expectingNoProblemsFor(aeb.getPath());
- expectingNoProblemsFor(aea.getPath());
+ expectingNoProblemsFor(aea.getPath());
}
public void testBug484275() throws CoreException, IOException {
- IJavaProject basePrj= fileManager.setUpJavaProject("Base484275");
+ IJavaProject basePrj= fileManager.setUpJavaProject("Base484275");
env.addProject(basePrj.getProject());
- IJavaProject aspPrj= fileManager.setUpJavaProject("Bug484275");
+ IJavaProject aspPrj= fileManager.setUpJavaProject("Bug484275");
env.addProject(aspPrj.getProject());
fullBuild();
expectingNoProblemsFor(basePrj.getPath());
@@ -424,22 +424,22 @@ public class OTEquinoxBuilderTests extends OTBuilderTests {
new Problem("", "Team 'teams.MyTeam$Middle' lacks a binding for base package 'internal'",
aspPrj.getPath().append(new Path("plugin.xml")),
-1, -1, -1, IMarker.SEVERITY_ERROR)
- });
+ });
}
public void testBug495489() throws CoreException, IOException {
- IJavaProject aspPrj= fileManager.setUpJavaProject("Bug495489");
+ IJavaProject aspPrj= fileManager.setUpJavaProject("Bug495489");
env.addProject(aspPrj.getProject());
fullBuild();
expectingNoProblemsFor(aspPrj.getPath());
}
public void testBug494254() throws CoreException, IOException {
- IJavaProject basePrj0= fileManager.setUpJavaProject("Bug494254base0");
+ IJavaProject basePrj0= fileManager.setUpJavaProject("Bug494254base0");
env.addProject(basePrj0.getProject());
- IJavaProject basePrj1= fileManager.setUpJavaProject("Bug494254base1");
+ IJavaProject basePrj1= fileManager.setUpJavaProject("Bug494254base1");
env.addProject(basePrj1.getProject());
- IJavaProject aspPrj= fileManager.setUpJavaProject("Bug494254aspect");
+ IJavaProject aspPrj= fileManager.setUpJavaProject("Bug494254aspect");
env.addProject(aspPrj.getProject());
fullBuild();
expectingNoProblemsFor(basePrj0.getPath());
@@ -469,27 +469,27 @@ public class OTEquinoxBuilderTests extends OTBuilderTests {
// ---------------- HELPERS: ---------------------------
private Problem getDecapsulationProblem(IJavaProject project, String baseclassName, String teamPath, int start, int end) {
return new Problem("", "Decapsulating base class "+baseclassName+" by means of a forced export. Note, that additionally a corresponing declaration is needed in config.ini (OTJLD 2.1.2(c) + OT/Equinox).",
- project.getPath().append(new Path("src/"+teamPath)),
+ project.getPath().append(new Path("src/"+teamPath)),
start, end,
CategorizedProblem.CAT_RESTRICTION, IMarker.SEVERITY_WARNING);
}
private Problem getIllegalUseOfForcedExportProblem(IJavaProject project, String className, int start, int end) {
return new Problem("", "The forced-exported type "+className+" cannot be accessed other than as a role's base class (OT/Equinox).",
- project.getPath().append(new Path("src/IllegalUseOfForcedExportTeam.java")),
+ project.getPath().append(new Path("src/IllegalUseOfForcedExportTeam.java")),
start, end,
CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR);
}
private void expectAccessRestriction(IJavaProject project, String fileName, int start, int end) {
- expectingSpecificProblemFor(project.getPath(),
+ expectingSpecificProblemFor(project.getPath(),
new Problem("", "Access restriction: The type 'SampleAction' is not API (restriction on required project 'Trac18b')",
- project.getPath().append(new Path(fileName)),
- start, end,
+ project.getPath().append(new Path(fileName)),
+ start, end,
CategorizedProblem.CAT_RESTRICTION, IMarker.SEVERITY_ERROR)
);
}
private Problem getMissingAspectExportProblem(IJavaProject project, String packageName) {
return new Problem("", "Package "+packageName+" containing one or more bound teams must be exported.",
- project.getPath().append(new Path("META-INF/MANIFEST.MF")),
+ project.getPath().append(new Path("META-INF/MANIFEST.MF")),
-1, -1,
-1, IMarker.SEVERITY_ERROR);
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/OTLaunchEnvironment.java b/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/OTLaunchEnvironment.java
index cd1e23efb..1a86fc14c 100644
--- a/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/OTLaunchEnvironment.java
+++ b/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/OTLaunchEnvironment.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -40,17 +40,17 @@ import org.eclipse.objectteams.otre.jplis.ObjectTeamsTransformer;
* Utility class for launching a program in a controlled environment.
* Disposing the application's object and the OTLaunchEnvironment
* should enable the JVM to also dispose all classes loaded in the process.
- *
+ *
* @author stephan
* @version $Id: OTLaunchEnvironment.java 14220 2006-09-04 22:13:40Z stephan $
*/
-public class OTLaunchEnvironment extends URLClassLoader
+public class OTLaunchEnvironment extends URLClassLoader
{
ObjectTeamsTransformer transformer = null;
/** Where to look for class files. */
IPath bindir;
/**
- * Setup a launch environment for the given paths.
+ * Setup a launch environment for the given paths.
* @param workspaceRoot path to the workspace root
* @param bindir absolute workspace path to the output location holding class files.
* @throws MalformedURLException if the OTRE_JAR_PATH is not a valid path.
@@ -60,16 +60,16 @@ public class OTLaunchEnvironment extends URLClassLoader
this.bindir = workspaceRoot.append(bindir);
}
/**
- * Same as above but supports the use of OTRE transformers, if `useTransformer == true'
+ * Same as above but supports the use of OTRE transformers, if `useTransformer == true'
*/
- OTLaunchEnvironment(IPath workspaceRoot, IPath bindir, boolean useTransformer)
- throws MalformedURLException
+ OTLaunchEnvironment(IPath workspaceRoot, IPath bindir, boolean useTransformer)
+ throws MalformedURLException
{
this(workspaceRoot, bindir);
if (useTransformer)
this.transformer = new ObjectTeamsTransformer();
}
-
+
static URL getOTREURL() throws MalformedURLException {
IClasspathEntry[] entries = new OTREContainer().getClasspathEntries();
String url = "file:"+entries[0].getPath(); //$NON-NLS-1$
@@ -92,7 +92,7 @@ public class OTLaunchEnvironment extends URLClassLoader
// this will use the URL pointing to the OTRE:
return super.findClass(name);
}
-
+
@Override
public InputStream getResourceAsStream(String name) {
File file = new File(bindir.append(name).toOSString());
@@ -101,38 +101,38 @@ public class OTLaunchEnvironment extends URLClassLoader
return new FileInputStream(file);
} catch (FileNotFoundException e) {
e.printStackTrace();
- }
+ }
return super.getResourceAsStream(name);
}
-
+
/* We found an existing file, load its bytes and define the class. */
- private Class<?> defineClassFromFile(String name, File file)
- throws Exception
+ private Class<?> defineClassFromFile(String name, File file)
+ throws Exception
{
try (FileInputStream fis = new FileInputStream(file)) {
byte[] bytes = new byte[(int) file.length()];
fis.read(bytes);
- if (transformer != null)
+ if (transformer != null)
bytes = transformer.transform(this, name, null, null, bytes);
return defineClass(name, bytes, 0, bytes.length);
}
}
-
+
/**
* Load class `className' and invoke its method `methodName'.
* The method must be static and without arguments.
- *
+ *
* @param className
* @param methodName
* @return the methods return (possibly boxed).
- *
+ *
* @throws Exception too many to list explicitly ;-)
*/
- public Object launch(String className, String methodName)
- throws Exception
+ public Object launch(String className, String methodName)
+ throws Exception
{
Class<?> clazz = this.loadClass(className);
- Method method = clazz.getMethod(methodName, new Class[0]);
+ Method method = clazz.getMethod(methodName, new Class[0]);
return method.invoke(null, new Object[0]);
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/OTTestingEnvironment.java b/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/OTTestingEnvironment.java
index ffa253b99..ba7508f55 100644
--- a/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/OTTestingEnvironment.java
+++ b/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/OTTestingEnvironment.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -38,12 +38,12 @@ public team class OTTestingEnvironment {
/** Better shutdown to allow reinitialization */
protected class ModelManager playedBy PluginModelManager {
-
+
ModelManager getInstance() -> PluginModelManager getInstance();
-
+
@SuppressWarnings("decapsulation")
void setFModelManager(ModelManager fModelManager) -> set PluginModelManager fModelManager;
-
+
@SuppressWarnings("decapsulation")
void shutdown() -> void shutdown();
@@ -52,7 +52,7 @@ public team class OTTestingEnvironment {
setFModelManager(null);
getInstance();
}
-
+
protected static void restart() {
getInstance().internalRestart();
}
@@ -80,16 +80,16 @@ public team class OTTestingEnvironment {
@SuppressWarnings("decapsulation")
addBuilderSpecs <- replace addBuilderSpecs;
-
+
}
-
+
/** Restart PDE's PluginModelManager. */
public static void restart() {
instance.internalRestart();
}
-
+
// need a team instance to invoke a role method:
private void internalRestart() {
- ModelManager.restart();
+ ModelManager.restart();
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/AttributesTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/AttributesTest.java
index 9f94f7926..474a008bd 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/AttributesTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/AttributesTest.java
@@ -79,13 +79,13 @@ public class AttributesTest extends AbstractOTJLDTest {
assertEquals("Wrong contents", expectedOutput, actualOutput);
}
}
-
+
@Override
protected void compileTestFiles(Compiler batchCompiler, String[] testFiles) {
super.compileTestFiles(batchCompiler, testFiles);
throw new OperationCanceledException("skip running");
}
-
+
// https://bugs.eclipse.org/537772 - Attribute OTCompilerVersion should not be set for o.o.Team
public void testAttributesInOOTeam() throws Exception {
Map<String,String> customOptions = getCompilerOptions();
@@ -102,7 +102,7 @@ public class AttributesTest extends AbstractOTJLDTest {
} catch (OperationCanceledException e) {
// expected
}
-
+
ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
String path = OUTPUT_DIR + File.separator + "org/objectteams/Team.class";
byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(new File(path));
@@ -113,38 +113,38 @@ public class AttributesTest extends AbstractOTJLDTest {
ClassFileBytesDisassembler.SYSTEM);
String expectedOutput =
- "// Compiled from Team.java ("+versionString+", super bit)\n" +
- "public class org.objectteams.Team {\n" +
- " Constant pool:\n" +
- " constant #1 class: #2 org/objectteams/Team\n" +
- " constant #2 utf8: \"org/objectteams/Team\"\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: \"Lorg/objectteams/Team;\"\n" +
- " constant #14 utf8: \"SourceFile\"\n" +
- " constant #15 utf8: \"Team.java\"\n" +
- " constant #16 utf8: \"OTClassFlags\"\n" +
- " \n" +
- " // Method descriptor #6 ()V\n" +
- " // Stack: 1, Locals: 1\n" +
- " public Team();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.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: org.objectteams.Team\n" +
- "\n" +
- " Attribute: OTClassFlags Length: 2\n" +
+ "// Compiled from Team.java ("+versionString+", super bit)\n" +
+ "public class org.objectteams.Team {\n" +
+ " Constant pool:\n" +
+ " constant #1 class: #2 org/objectteams/Team\n" +
+ " constant #2 utf8: \"org/objectteams/Team\"\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: \"Lorg/objectteams/Team;\"\n" +
+ " constant #14 utf8: \"SourceFile\"\n" +
+ " constant #15 utf8: \"Team.java\"\n" +
+ " constant #16 utf8: \"OTClassFlags\"\n" +
+ " \n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " public Team();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.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: org.objectteams.Team\n" +
+ "\n" +
+ " Attribute: OTClassFlags Length: 2\n" +
"}";
assertSubstring(actualOutput, expectedOutput);
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/CustomizedCompiler.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/CustomizedCompiler.java
index 64b59b1d8..ff1c29220 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/CustomizedCompiler.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/CustomizedCompiler.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -38,7 +38,7 @@ import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
public class CustomizedCompiler extends Compiler
{
private Vector<ICallbackClient> _callBacks;
-
+
/**
* @param environment
* @param policy
@@ -50,7 +50,7 @@ public class CustomizedCompiler extends Compiler
{
super(environment, policy, settings, requestor, problemFactory);
}
-
+
public void addCallBack(ICallbackClient c)
{
if (_callBacks == null)
@@ -58,13 +58,13 @@ public class CustomizedCompiler extends Compiler
_callBacks.add(c);
}
-
+
@Override
public void process(CompilationUnitDeclaration unit, int i) {
super.process(unit, i);
//{ObjectTeams: callback all waiting tests
for (ICallbackClient cbc : this._callBacks)
cbc.callback(unit);
-//ike}
+//ike}
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/ICallbackClient.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/ICallbackClient.java
index 9060d847d..be126c45a 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/ICallbackClient.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/ICallbackClient.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/SourceElementRequestorTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/SourceElementRequestorTest.java
index eb328018a..d209e1550 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/SourceElementRequestorTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/SourceElementRequestorTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -42,12 +42,12 @@ public class SourceElementRequestorTest extends FileBasedModelTest implements IS
{
private char[] source;
protected String PROJECT_DIR;
-
+
public SourceElementRequestorTest(String testName)
{
super(testName);
}
-
+
public static Test suite()
{
if (true)
@@ -58,13 +58,13 @@ public class SourceElementRequestorTest extends FileBasedModelTest implements IS
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir(PROJECT_DIR);
super.setUpSuite();
}
-
+
protected void setUp() throws Exception
{
super.setUp();
@@ -73,16 +73,16 @@ public class SourceElementRequestorTest extends FileBasedModelTest implements IS
public void fullParse(String src, String fileName)
{
this.source = src.toCharArray();
-
+
// km: ctor with new parameter "reportLocalDeclarations", "optimizeStringLiterals" assuming both to be true
- SourceElementParser parser =
- new SourceElementParser(this, new DefaultProblemFactory(Locale.getDefault()), new CompilerOptions(), true, true);
-
+ SourceElementParser parser =
+ new SourceElementParser(this, new DefaultProblemFactory(Locale.getDefault()), new CompilerOptions(), true, true);
+
ICompilationUnit sourceUnit = new CompilationUnit(source, fileName, null);
-
+
parser.parseCompilationUnit(sourceUnit, true, null);
}
-
+
public void acceptConstructorReference(char[] typeName, int argCount, int sourcePosition)
{
}
@@ -150,7 +150,7 @@ public class SourceElementRequestorTest extends FileBasedModelTest implements IS
public void enterCallinMapping(CallinInfo callinInfo)
{
}
-
+
public void exitCallinMapping(int sourceEnd, int declarationSourceEnd)
{
}
@@ -167,47 +167,47 @@ public class SourceElementRequestorTest extends FileBasedModelTest implements IS
public void enterConstructor(MethodInfo methodInfo) {
// TODO Auto-generated method stub
-
+
}
public void enterField(FieldInfo fieldInfo) {
// TODO Auto-generated method stub
-
+
}
public void enterMethod(MethodInfo methodInfo) {
// TODO Auto-generated method stub
-
+
}
public void enterType(TypeInfo typeInfo) {
// TODO Auto-generated method stub
-
+
}
public void exitType(int declarationEnd) {
// TODO Auto-generated method stub
-
+
}
public void acceptProblem(CategorizedProblem problem) {
// TODO Auto-generated method stub
-
+
}
public void acceptImport(int declarationStart, int declarationEnd, char[][] tokens, boolean onDemand, int modifiers) {
// TODO Auto-generated method stub
-
+
}
- public void acceptImport(int declarationStart, int declarationEnd, int nameStart, int nameEnd,
+ public void acceptImport(int declarationStart, int declarationEnd, int nameStart, int nameEnd,
char[][] tokens, boolean onDemand, int modifiers) {
// TODO Auto-generated method stub
-
+
}
public void acceptAnnotationTypeReference(char[][] annotation, int sourceStart, int sourceEnd) {
- // TODO Auto-generated method stub
+ // TODO Auto-generated method stub
}
public void acceptAnnotationTypeReference(char[] annotation, int sourcePosition) {
@@ -219,7 +219,7 @@ public class SourceElementRequestorTest extends FileBasedModelTest implements IS
}
public void exitMethod(int declarationEnd, Expression defaultValue) {
- // TODO Auto-generated method stub
+ // TODO Auto-generated method stub
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/TestBase.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/TestBase.java
index 7b296fd8d..cd6d1bd0d 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/TestBase.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/TestBase.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2014 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -54,16 +54,16 @@ import org.eclipse.objectteams.otdt.tests.ClasspathUtil;
*/
public class TestBase extends TestCase
{
-
+
public static final String NL = "\r\n";
-
+
public static final String CLASS_FILE_EXTENSION = ".class";
public static final String JAVA_FILE_EXTENSION = ".java";
public static final String LOG_FILE_EXTENSION = ".log";
-
+
public static final String WORKSPACE_NAME = "testing-workspace";
public static final String PROJECT_NAME = "TestProject";
-
+
public static final String JAVA_HOME = System.getProperty("java.home");
public static final String USER_HOME = System.getProperty("user.home");
@@ -90,22 +90,22 @@ public class TestBase extends TestCase
}
}
- public static final String PROJECT_PATH = USER_HOME
- + File.separator
- + WORKSPACE_NAME
+ public static final String PROJECT_PATH = USER_HOME
+ + File.separator
+ + WORKSPACE_NAME
+ File.separator
+ PROJECT_NAME;
-
+
private Main _compiler;
private String _logFileName;
private File _workingDir;
-
+
public TestBase(String testName)
{
super(testName);
}
-
+
private void cleanWorkingDirectory()
{
if (!_workingDir.isDirectory())
@@ -114,12 +114,12 @@ public class TestBase extends TestCase
}
cleanRecursively(_workingDir);
// File[] containedFiles = _workingDir.listFiles();
-//
+//
// for (int idx = 0; idx < containedFiles.length; idx++)
// {
-// containedFiles[idx].delete();
+// containedFiles[idx].delete();
// }
-//
+//
// _workingDir.delete();
}
private void cleanRecursively(File file) {
@@ -156,7 +156,7 @@ public class TestBase extends TestCase
+ this.getName()
+ " ***************************");
_logFileName = fname;
-
+
try
{
String missing;
@@ -164,37 +164,37 @@ public class TestBase extends TestCase
{
throw new FileNotFoundException("Missing library "+missing);
}
-
- String[] args = (classpath == null)
+
+ String[] args = (classpath == null)
? createClassPath(fname)
: classpath;
-
- File javaFile = new File(_workingDir.getAbsolutePath()
- + File.separator
- + fname
+
+ File javaFile = new File(_workingDir.getAbsolutePath()
+ + File.separator
+ + fname
+ JAVA_FILE_EXTENSION);
-
+
if(!javaFile.exists())
{
throw new FileNotFoundException("File to compile was not found!: " + _logFileName);
}
-
+
_compiler =
new Main(
new PrintWriter(
- new FileOutputStream(PROJECT_PATH
+ new FileOutputStream(PROJECT_PATH
+ File.separator
- + _logFileName
+ + _logFileName
+ LOG_FILE_EXTENSION)),
new PrintWriter(
- new FileOutputStream(PROJECT_PATH
+ new FileOutputStream(PROJECT_PATH
+ File.separator
+ _logFileName
+ LOG_FILE_EXTENSION)),
false,
options,
null);
-
+
_compiler.compile(args);
}
catch (FileNotFoundException ex)
@@ -208,7 +208,7 @@ public class TestBase extends TestCase
String otrePath = ClasspathUtil.getOTREPath(this.weavingScheme);
File otreJar = new File(otrePath);
File jreJar = new File(JRE_JAR_PATH);
-
+
if (!otreJar.exists())
return otrePath;
if (!jreJar.exists())
@@ -222,11 +222,11 @@ public class TestBase extends TestCase
{
File pkgDir = createPackageDirectory(content);
File file = new File(pkgDir.getAbsolutePath()
- + File.separator
- + fname
+ + File.separator
+ + fname
+ JAVA_FILE_EXTENSION);
file.deleteOnExit();
-
+
FileWriter writer = new FileWriter(file);
writer.write(content);
writer.close();
@@ -238,7 +238,7 @@ public class TestBase extends TestCase
}
/**
- * Creates a file at given relative position and all necessary directories
+ * Creates a file at given relative position and all necessary directories
* The content of package is not evaluatet for saving location
* @param fname the name of the new file to create
* @param relPath the relative path where to store the file
@@ -249,7 +249,7 @@ public class TestBase extends TestCase
try
{
String curPath = _workingDir.getAbsolutePath();
-
+
if(relPath.trim().length() > 0)
{
curPath+= File.separator + relPath;
@@ -257,13 +257,13 @@ public class TestBase extends TestCase
File pkgDir = new File(curPath);
pkgDir.mkdirs();
-
+
File file = new File(pkgDir.getAbsolutePath()
- + File.separator
- + fname
+ + File.separator
+ + fname
+ JAVA_FILE_EXTENSION);
file.deleteOnExit();
-
+
FileWriter writer = new FileWriter(file);
writer.write(content);
writer.close();
@@ -278,7 +278,7 @@ public class TestBase extends TestCase
{
String qualPkgName = getQualifiedPackageName(fileContent);
String dirPath = getDirectoryPath(qualPkgName);
-
+
String curPath = _workingDir.getAbsolutePath() + File.separator + dirPath;
File result = new File(curPath);
result.mkdirs();
@@ -292,7 +292,7 @@ public class TestBase extends TestCase
{
return "";
}
-
+
if (qualPkgName.indexOf('.') == -1)
{
return qualPkgName;
@@ -306,20 +306,20 @@ public class TestBase extends TestCase
private String getQualifiedPackageName(String fileContent)
{
String packageKeyword = "package ";
-
+
int pos1 = fileContent.indexOf(packageKeyword);
if (pos1 == -1)
{
return "";
}
-
+
int pos2 = fileContent.indexOf(';', pos1);
if (pos2 == -1)
{
return "";
- }
-
-
+ }
+
+
return fileContent.substring(pos1 + packageKeyword.length(), pos2);
}
@@ -331,7 +331,7 @@ public class TestBase extends TestCase
/**
- * checks whether the compiler has proceeded without errors or warnings
+ * checks whether the compiler has proceeded without errors or warnings
*/
public boolean isCompilationSuccessful()
{
@@ -342,11 +342,11 @@ public class TestBase extends TestCase
}
else
{
- File file = new File(_workingDir.getAbsolutePath()
- + File.separator
- + _logFileName
+ File file = new File(_workingDir.getAbsolutePath()
+ + File.separator
+ + _logFileName
+ LOG_FILE_EXTENSION);
- file.delete();
+ file.delete();
return true;
}
}
@@ -354,7 +354,7 @@ public class TestBase extends TestCase
/**
* checks whether the compiler has generated the expected errors and warnings,
* if it created more problems than specified this is OK for this method.
- * @param problemIDs IDs of the expected errors and warnings as specified in
+ * @param problemIDs IDs of the expected errors and warnings as specified in
* org.eclipse.jdt.core.compiler.IProblem
*/
public boolean hasAtLeastExpectedProblems(int[] problemIDs)
@@ -367,9 +367,9 @@ public class TestBase extends TestCase
printAllProblems();
return false;
}
- File file = new File(_workingDir.getAbsolutePath()
- + File.separator
- + _logFileName
+ File file = new File(_workingDir.getAbsolutePath()
+ + File.separator
+ + _logFileName
+ LOG_FILE_EXTENSION);
file.delete();
return true;
@@ -377,19 +377,19 @@ public class TestBase extends TestCase
/**
* checks whether the compiler has generated the expected errors and warnings
- * @param problemIDs IDs of the expected errors and warnings as specified in
+ * @param problemIDs IDs of the expected errors and warnings as specified in
* org.eclipse.jdt.core.compiler.IProblem
*/
public boolean hasExpectedProblems(int[] problemIDs)
{
if ( areProblemsEqual(_compiler.logger.globalProblems, problemIDs) )
- {
- File file = new File(_workingDir.getAbsolutePath()
- + File.separator
- + _logFileName
+ {
+ File file = new File(_workingDir.getAbsolutePath()
+ + File.separator
+ + _logFileName
+ LOG_FILE_EXTENSION);
file.delete();
-
+
return true;
}
else
@@ -398,7 +398,7 @@ public class TestBase extends TestCase
return false;
}
}
-
+
private void printAllProblems()
{
for (Iterator iter = _compiler.logger.globalProblems.iterator(); iter.hasNext();)
@@ -406,28 +406,28 @@ public class TestBase extends TestCase
IProblem prob = (IProblem)iter.next();
System.err.println(prob.toString());
if (prob.getID() == IProblem.Unclassified) // it was an exception.
- throw new InternalError(prob.toString());
+ throw new InternalError(prob.toString());
}
}
-
+
/**
* checks whether the compiler has generated the expected errors and warnings
- * @param errorIDs IDs of the expected errors as specified in
+ * @param errorIDs IDs of the expected errors as specified in
* org.eclipse.jdt.core.compiler.IProblem
- * @param warningIDs analogous
+ * @param warningIDs analogous
*/
public boolean hasExpectedProblems(int[] errorIDs, int[] warningIDs)
{
if ( areProblemsEqual(_compiler.logger.globalErrors, errorIDs)
&& areProblemsEqual(_compiler.logger.globalWarnings, warningIDs) )
{
-
- File file = new File(_workingDir.getAbsolutePath()
- + File.separator
- + _logFileName
+
+ File file = new File(_workingDir.getAbsolutePath()
+ + File.separator
+ + _logFileName
+ LOG_FILE_EXTENSION);
file.delete();
-
+
return true;
}
else
@@ -435,8 +435,8 @@ public class TestBase extends TestCase
return false;
}
}
-
-
+
+
/**
* @param problems Vector elements of type IProblem
*/
@@ -476,7 +476,7 @@ public class TestBase extends TestCase
}
return result;
}
-
+
// public boolean isCompilationSuccessful(int errors, int warnings)
// {
// if (_compiler.globalErrorsCount != errors
@@ -488,24 +488,24 @@ public class TestBase extends TestCase
// else
// {
// // TODO (SH): check whether we have the expected problems.
-// File file = new File(_workingDir.getAbsolutePath()
-// + File.separator
-// + _logFileName
+// File file = new File(_workingDir.getAbsolutePath()
+// + File.separator
+// + _logFileName
// + LOG_FILE_EXTENSION);
// file.delete();
-//
+//
// return true;
// }
-// }
-
-
+// }
+
+
private String[] createClassPath(String fname)
{
- File javaFile = new File(_workingDir.getAbsolutePath()
- + File.separator
- + fname
+ File javaFile = new File(_workingDir.getAbsolutePath()
+ + File.separator
+ + fname
+ JAVA_FILE_EXTENSION);
-
+
String[] args =
{
"-classpath",
@@ -513,54 +513,54 @@ public class TestBase extends TestCase
+ File.pathSeparator
+ new Path(JRE_JAR_PATH).toString()
+ File.pathSeparator
- + new Path(_workingDir.getAbsolutePath()
+ + new Path(_workingDir.getAbsolutePath()
+ File.separator).toString(),
javaFile.getAbsolutePath()
};
-
+
return args;
}
-
+
protected String[] createClassPathNoOTRE(String fname)
{
- File javaFile = new File(_workingDir.getAbsolutePath()
- + File.separator
- + fname
+ File javaFile = new File(_workingDir.getAbsolutePath()
+ + File.separator
+ + fname
+ JAVA_FILE_EXTENSION);
-
+
String[] args =
{
"-classpath",
new Path(JRE_JAR_PATH).toString()
+ File.pathSeparator
- + new Path(_workingDir.getAbsolutePath()
+ + new Path(_workingDir.getAbsolutePath()
+ File.separator).toString(),
javaFile.getAbsolutePath()
};
-
+
return args;
}
-
-
+
+
protected void setUp() throws Exception
{
_workingDir = new File(PROJECT_PATH);
cleanWorkingDirectory();
_workingDir.mkdirs();
}
-
+
protected void tearDown() throws Exception
{
}
-
+
/**
* This method was added for convenient testing of single testmethods in testclasses.
- * The first commandline argument is expected to be the class where the
+ * The first commandline argument is expected to be the class where the
* testmethod can be found. The following arguments are the testmethodnames
- * that should run.
- * example:
- * java Testbase org.eclipse.objectteams.otdt.tests.compiler.errorreporting.compiler.CalloutBindingTest testMultipleCalloutBinding1
+ * that should run.
+ * example:
+ * java Testbase org.eclipse.objectteams.otdt.tests.compiler.errorreporting.compiler.CalloutBindingTest testMultipleCalloutBinding1
* @param args
* @throws ClassNotFoundException
* @throws SecurityException
@@ -570,12 +570,12 @@ public class TestBase extends TestCase
* @throws IllegalAccessException
* @throws InvocationTargetException
*/
-
+
public static void main(String[] args) throws ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException
{
TestSuite selected = null;
Constructor clsConst =null;
-
+
switch (args.length)
{
case 0:
@@ -584,27 +584,27 @@ public class TestBase extends TestCase
System.exit(1);
break; // duh
}
-
+
case 1: // take all methods
{
Class testClass = Class.forName(args[0]);
selected = new TestSuite(testClass);
break;
}
-
+
default: // single methods to execute given
{
Class<?> testClass = Class.forName(args[0]);
clsConst = testClass.getConstructor( new Class<?>[] { String.class } );
selected = new TestSuite();
-
+
for (int idx = 1; idx < args.length; idx++)
{
selected.addTest((Test)clsConst.newInstance( new Object[] { args[idx] } ));
}
}
}
-
- TestRunner.run(selected);
+
+ TestRunner.run(selected);
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/ast/TypeDeclarationTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/ast/TypeDeclarationTest.java
index c1e572f8c..c902725fa 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/ast/TypeDeclarationTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/ast/TypeDeclarationTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -33,7 +33,7 @@ import org.eclipse.objectteams.otdt.tests.compiler.SourceElementRequestorTest;
*/
public class TypeDeclarationTest extends SourceElementRequestorTest
{
-
+
private boolean _testFlag;
public TypeDeclarationTest(String testName)
@@ -51,7 +51,7 @@ public class TypeDeclarationTest extends SourceElementRequestorTest
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
this.PROJECT_DIR = "ExternalDefinedRole";
@@ -62,11 +62,11 @@ public class TypeDeclarationTest extends SourceElementRequestorTest
{
super.setUp();
}
-
+
public void enterType(TypeInfo typeInfo) {
_testFlag = typeInfo.isRoleFile;
}
-
+
public void testRoleInterface_RolefileFlag() throws JavaModelException
{
org.eclipse.jdt.core.ICompilationUnit unit = getCompilationUnit(
@@ -74,13 +74,13 @@ public class TypeDeclarationTest extends SourceElementRequestorTest
"unbound",
"unbound.teampkg.Team_5a",
"SampleRole.java");
-
+
String src = unit.getSource();
-
+
String fileName = unit.getCorrespondingResource().toString();
fullParse(src, fileName);
-
+
assertTrue(_testFlag);
}
@@ -91,15 +91,15 @@ public class TypeDeclarationTest extends SourceElementRequestorTest
"unbound",
"unbound.teampkg.Team_5b",
"SampleRole.java");
-
+
String src = unit.getSource();
- IResource res = unit.getCorrespondingResource();
-
+ IResource res = unit.getCorrespondingResource();
+
String fileName = res.toString();
fullParse(src, fileName);
-
+
assertTrue(_testFlag);
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/CallinBindingTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/CallinBindingTest.java
index 28229fe8e..876685df0 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/CallinBindingTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/CallinBindingTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -27,7 +27,7 @@ import org.eclipse.objectteams.otdt.tests.compiler.TestBase;
/**
* This class contains tests concerning callin bindings.
- *
+ *
* @author kaschja
* @version $Id: CallinBindingTest.java 23494 2010-02-05 23:06:44Z stephan $
*/
@@ -42,17 +42,17 @@ public class CallinBindingTest extends TestBase
* A "replace-callin binding" is used with a base call.
* Bound role method is declared as callin method.
*/
- public void testCallinInMethodDeclaration()
+ public void testCallinInMethodDeclaration()
{
createFile("MyBase","public class MyBase " +
NL + "{ " +
NL + " public int baseMethod(int i) {return 1;}" +
NL + "} ");
-
+
createFile("MyTeam","public team class MyTeam " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class MyRole playedBy MyBase " +
- NL + " { " +
+ NL + " { " +
NL + " callin int roleMethod(int i)" +
NL + " {" +
NL + " return base.roleMethod(i); " +
@@ -60,26 +60,26 @@ public class CallinBindingTest extends TestBase
NL + " roleMethod <- replace baseMethod; " +
NL + " } "+
NL + "}");
-
+
compileFile("MyTeam");
-
+
assertTrue(isCompilationSuccessful());
}
-
+
/**
* A base-call must have arguments matching the role-method's signature.
*/
- public void testBrokenBaseCall()
+ public void testBrokenBaseCall()
{
createFile("MyBase","public class MyBase " +
NL + "{ " +
NL + " public void baseMethod(int i) {}" +
NL + "} ");
-
+
createFile("MyTeam","public team class MyTeam " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class MyRole playedBy MyBase " +
- NL + " { " +
+ NL + " { " +
NL + " callin void roleMethod(int i)" +
NL + " {" +
NL + " base.roleMethod(); " +
@@ -87,61 +87,61 @@ public class CallinBindingTest extends TestBase
NL + " roleMethod <- replace baseMethod; " +
NL + " } "+
NL + "}");
-
+
compileFile("MyTeam");
-
+
assertTrue(hasExpectedProblems(new int[] { IProblem.BaseCallDoesntMatchRoleMethodSignature }));
}
-
+
/**
* A base call in a role method.
* Bound role method must be declared as callin method.
*/
- public void testMissingCallinModifierInMethodDeclaration1()
+ public void testMissingCallinModifierInMethodDeclaration1()
{
createFile("MyBase","public class MyBase " +
NL + "{ " +
NL + " public void baseMethod() {}" +
NL + "} ");
-
+
createFile("MyTeam","public team class MyTeam " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class MyRole playedBy MyBase " +
- NL + " { " +
+ NL + " { " +
NL + " public void roleMethod()" +
NL + " {" +
NL + " base.roleMethod(); " +
NL + " }" +
NL + " } "+
NL + "}");
-
+
compileFile("MyTeam");
-
+
assertTrue(hasExpectedProblems(new int[] {IProblem.BasecallInRegularMethod }));
}
-
+
/**
- * A callin binding declaration must include a modifier
+ * A callin binding declaration must include a modifier
* (before/replace/after).
*/
- public void testCallinBindingDeclarationWithoutModifier1()
+ public void testCallinBindingDeclarationWithoutModifier1()
{
createFile("MyBase","public class MyBase " +
NL + "{ " +
NL + " public void baseMethod() {}" +
NL + "} ");
-
+
createFile("MyTeam","public team class MyTeam " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class MyRole playedBy MyBase " +
- NL + " { " +
+ NL + " { " +
NL + " public void roleMethod() {}" +
NL + " roleMethod <- baseMethod;" +
NL + " } "+
NL + "}");
-
+
compileFile("MyTeam");
-
+
assertTrue(hasExpectedProblems(new int[] { IProblem.CallinReplaceKeyWordNotOptional }));
}
@@ -154,19 +154,19 @@ public class CallinBindingTest extends TestBase
NL + "{" +
NL + " callin void classMethod() {}" +
NL + "}");
-
+
compileFile("MyClass");
-
+
assertTrue(hasExpectedProblems(new int[] {IProblem.OTKeywordInRegularClass}));
}
-
+
/**
* A callin method must not be called by the role itself
*/
public void testCallinMethodCalledInOtherMethodOfSameRole1()
{
createFile("MyBase","public class MyBase {}");
-
+
createFile("MyTeam","public team class MyTeam" +
NL + "{" +
NL + " protected class MyRole playedBy MyBase" +
@@ -174,45 +174,45 @@ public class CallinBindingTest extends TestBase
NL + " callin void callinMethod() {}" +
NL + " void roleMethod()" +
NL + " {" +
- NL + " callinMethod();" +
+ NL + " callinMethod();" +
NL + " }" +
NL + " }" +
NL + "}");
-
+
compileFile("MyTeam");
-
+
assertTrue(hasExpectedProblems(new int[] {IProblem.CallToCallin, IProblem.DefinitelyMissingBaseCall}));
}
-
+
/**
- * It is an allowed alternative to declare a callin-binding
+ * It is an allowed alternative to declare a callin-binding
* with full method signature
*/
public void testMethodsWithSignaturesInCallinBindings1()
{
createFile("MyBase","public class MyBase" +
NL + "{" +
- NL + " public void baseMethodA() {}" +
- NL + " public void baseMethodB() {}" +
- NL + " public void baseMethodC() {}" +
- NL + "}");
-
+ NL + " public void baseMethodA() {}" +
+ NL + " public void baseMethodB() {}" +
+ NL + " public void baseMethodC() {}" +
+ NL + "}");
+
createFile("MyTeam","public team class MyTeam " +
- NL + "{" +
- NL + " protected class MyRole playedBy MyBase" +
- NL + " {" +
- NL + " void callinMethodA() {}" +
- NL + " callin void callinMethodB() {}" +
- NL + " void callinMethodA() <- after void baseMethodA();" +
- NL + " void callinMethodB() <- replace void baseMethodB(), void baseMethodC();" +
+ NL + "{" +
+ NL + " protected class MyRole playedBy MyBase" +
+ NL + " {" +
+ NL + " void callinMethodA() {}" +
+ NL + " callin void callinMethodB() {}" +
+ NL + " void callinMethodA() <- after void baseMethodA();" +
+ NL + " void callinMethodB() <- replace void baseMethodB(), void baseMethodC();" +
NL + " }" +
NL + "}");
-
+
compileFile("MyTeam");
- assertTrue(isCompilationSuccessful());
+ assertTrue(isCompilationSuccessful());
}
-
+
/**
* It is an allowed alternative to declare a callin-binding
* without method signature
@@ -221,24 +221,24 @@ public class CallinBindingTest extends TestBase
{
createFile("MyBase","public class MyBase" +
NL + "{" +
- NL + " public void baseMethodA() {}" +
- NL + " public void baseMethodB() {}" +
- NL + " public void baseMethodC() {}" +
- NL + "}");
-
+ NL + " public void baseMethodA() {}" +
+ NL + " public void baseMethodB() {}" +
+ NL + " public void baseMethodC() {}" +
+ NL + "}");
+
createFile("MyTeam","public team class MyTeam " +
- NL + "{" +
- NL + " protected class MyRole playedBy MyBase" +
- NL + " {" +
- NL + " void callinMethodA() {}" +
- NL + " callin void callinMethodB() {}" +
- NL + " callinMethodA <- before baseMethodA;" +
- NL + " callinMethodB <- replace baseMethodB, baseMethodC;" +
+ NL + "{" +
+ NL + " protected class MyRole playedBy MyBase" +
+ NL + " {" +
+ NL + " void callinMethodA() {}" +
+ NL + " callin void callinMethodB() {}" +
+ NL + " callinMethodA <- before baseMethodA;" +
+ NL + " callinMethodB <- replace baseMethodB, baseMethodC;" +
NL + " }" +
NL + "}");
-
+
compileFile("MyTeam");
- assertTrue(isCompilationSuccessful());
+ assertTrue(isCompilationSuccessful());
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/CalloutBindingTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/CalloutBindingTest.java
index 1374de5db..81aeacaaa 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/CalloutBindingTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/CalloutBindingTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -26,7 +26,7 @@ import org.eclipse.objectteams.otdt.tests.compiler.TestBase;
/**
* This class contains tests concerning callout bindings.
- *
+ *
* @author kaschja
* @version $Id: CalloutBindingTest.java 23494 2010-02-05 23:06:44Z stephan $
*/
@@ -37,13 +37,13 @@ public class CalloutBindingTest extends TestBase
super(testName);
}
-// There are no ambiguous base-method matches (there's always a best match
+// There are no ambiguous base-method matches (there's always a best match
// (one to one))
-//
+//
// /**
-// * A callout binding with ambiguous Base-Method Signature
+// * A callout binding with ambiguous Base-Method Signature
// */
-// public void testCalloutBindingAmbiguousBaseMethod1()
+// public void testCalloutBindingAmbiguousBaseMethod1()
// {
//
// createFile("MyBase","public class MyBase " +
@@ -51,33 +51,33 @@ public class CalloutBindingTest extends TestBase
// NL + " protected void baseMethod(short arg){}" +
// NL + " public void baseMethod(int arg){}" +
// NL + "} ");
-//
+//
// createFile("MySuperTeam","public team class MySuperTeam " +
-// NL + "{ " +
+// NL + "{ " +
// NL + " public class MyRole playedBy MyBase " +
-// NL + " { " +
+// NL + " { " +
// NL + " public void roleMethod(long arg){};" +
// NL + " } " +
// NL + "}");
//
// createFile("MyTeam","public team class MyTeam extends MySuperTeam" +
-// NL + "{ " +
+// NL + "{ " +
// NL + " public class MyRole" +
-// NL + " { " +
+// NL + " { " +
// NL + " roleMethod => baseMethod; " +
// NL + " } " +
// NL + "}");
-//
+//
// compileFile("MyTeam");
-//
+//
// //should throw warning about ambiguous base-method
// assertTrue(hasExpectedProblems(new int[] { IProblem.CalloutBindingTooManyBaseMatches }));
// }
//
// /**
-// * A callout binding with ambiguous Base-Method Signature
+// * A callout binding with ambiguous Base-Method Signature
// */
-// public void testCalloutBindingAmbiguousBaseMethod2()
+// public void testCalloutBindingAmbiguousBaseMethod2()
// {
//
// createFile("MyBase","public class MyBase " +
@@ -85,33 +85,33 @@ public class CalloutBindingTest extends TestBase
// NL + " public void baseMethod(long arg){}" +
// NL + " public void baseMethod(int arg){}" +
// NL + "} ");
-//
+//
// createFile("MySuperTeam","public team class MySuperTeam " +
-// NL + "{ " +
+// NL + "{ " +
// NL + " public class MyRole playedBy MyBase " +
-// NL + " { " +
+// NL + " { " +
// NL + " public void roleMethod(short arg){};" +
// NL + " } " +
// NL + "}");
//
// createFile("MyTeam","public team class MyTeam extends MySuperTeam" +
-// NL + "{ " +
+// NL + "{ " +
// NL + " public class MyRole" +
-// NL + " { " +
+// NL + " { " +
// NL + " roleMethod => baseMethod; " +
// NL + " } " +
// NL + "}");
-//
+//
// compileFile("MyTeam");
-//
+//
// //should throw warning about ambiguous base-method
// assertTrue(hasExpectedProblems(new int[] { IProblem.CalloutBindingTooManyBaseMatches }));
// }
//
// /**
-// * A callout binding with ambiguous Base-Method Signature
+// * A callout binding with ambiguous Base-Method Signature
// */
-// public void testCalloutBindingAmbiguousBaseMethod3()
+// public void testCalloutBindingAmbiguousBaseMethod3()
// {
//
// createFile("MyBase","public class MyBase " +
@@ -119,82 +119,82 @@ public class CalloutBindingTest extends TestBase
// NL + " public void baseMethod(String arg){}" +
// NL + " public void baseMethod(Integer arg){}" +
// NL + "} ");
-//
+//
// createFile("MySuperTeam","public team class MySuperTeam " +
-// NL + "{ " +
+// NL + "{ " +
// NL + " public class MyRole playedBy MyBase " +
-// NL + " { " +
+// NL + " { " +
// NL + " public void roleMethod(String arg){};" +
// NL + " public void roleMethod(Integer arg){};" +
// NL + " } " +
// NL + "}");
//
// createFile("MyTeam","public team class MyTeam extends MySuperTeam" +
-// NL + "{ " +
+// NL + "{ " +
// NL + " public class MyRole" +
-// NL + " { " +
+// NL + " { " +
// NL + " roleMethod => baseMethod; " +
// NL + " } " +
// NL + "}");
-//
+//
// compileFile("MyTeam");
-//
+//
// //should throw warning about ambiguous base-method
// assertTrue(hasExpectedProblems(new int[] { IProblem.CalloutBindingTooManyBaseMatches }));
// }
/**
- * A callout binding declaration must not include a modifier
+ * A callout binding declaration must not include a modifier
* (before/replace/after).
*/
- public void testCalloutBindingDeclarationWithModifier1()
+ public void testCalloutBindingDeclarationWithModifier1()
{
createFile("MyBase","public class MyBase " +
NL + "{ " +
NL + " public void baseMethod(){}" +
NL + "} ");
-
+
createFile("MyTeam","public team class MyTeam " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class MyRole playedBy MyBase " +
- NL + " { " +
+ NL + " { " +
NL + " public abstract void roleMethod();" +
NL + " roleMethod -> after baseMethod; " +
NL + " } "+
NL + "}");
-
+
compileFile("MyTeam");
-
+
assertTrue(hasExpectedProblems(new int[] { IProblem.UnresolvedCalloutMethodSpec, IProblem.ParsingErrorDeleteToken}));
}
-
+
/**
- * A callout binding declaration must not include a modifier
+ * A callout binding declaration must not include a modifier
* (before/replace/after).
*/
- public void testCalloutBindingMethodArgumentWithModifier1()
+ public void testCalloutBindingMethodArgumentWithModifier1()
{
createFile("MyBase","public class MyBase " +
NL + "{ " +
NL + " public void baseMethod(final String str){}" +
NL + "} ");
-
+
createFile("MyTeam","public team class MyTeam " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class MyRole playedBy MyBase " +
- NL + " { " +
+ NL + " { " +
NL + " public abstract void roleMethod(final String str);" +
NL + " roleMethod -> after baseMethod; " +
NL + " } "+
NL + "}");
-
+
compileFile("MyTeam");
assertTrue(hasExpectedProblems(new int[] { IProblem.UnresolvedCalloutMethodSpec, IProblem.ParsingErrorDeleteToken}));
}
-
+
/**
* A role method must not be bound to a non-existing base method.
*/
@@ -203,20 +203,20 @@ public class CalloutBindingTest extends TestBase
createFile("MyBase","public class MyBase " +
NL + "{ " +
NL + "} ");
-
+
createFile("MyTeam","public team class MyTeam " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class MyRole playedBy MyBase " +
- NL + " { " +
+ NL + " { " +
NL + " public abstract void roleMethod();" +
NL + " roleMethod -> baseMethod; " +
NL + " } "+
NL + "}");
-
+
compileFile("MyTeam");
- //TODO(SH): this is what I expect in 3.2, but other non-resolve error msg would be acceptable, too
- assertTrue(hasAtLeastExpectedProblems(new int[]{ IProblem.UnresolvedCalloutMethodSpec}));
+ //TODO(SH): this is what I expect in 3.2, but other non-resolve error msg would be acceptable, too
+ assertTrue(hasAtLeastExpectedProblems(new int[]{ IProblem.UnresolvedCalloutMethodSpec}));
}
/**
@@ -228,23 +228,23 @@ public class CalloutBindingTest extends TestBase
NL + "{ " +
NL + " public void baseMethod(){} " +
NL + "} ");
-
+
createFile("MyTeam","public team class MyTeam " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class MyRole playedBy MyBase " +
- NL + " { " +
+ NL + " { " +
NL + " roleMethod -> baseMethod; " +
NL + " } "+
NL + "}");
-
+
compileFile("MyTeam");
-
- //TODO(SH): this is what I expect in 3.2, but other non-resolve error msg would be acceptable, too
- assertTrue(hasExpectedProblems(new int[]{ IProblem.UnresolvedCalloutMethodSpec}, null ));
- }
-
+
+ //TODO(SH): this is what I expect in 3.2, but other non-resolve error msg would be acceptable, too
+ assertTrue(hasExpectedProblems(new int[]{ IProblem.UnresolvedCalloutMethodSpec}, null ));
+ }
+
/**
- * An abstract role method must not be bound with the "=>"-operator.
+ * An abstract role method must not be bound with the "=>"-operator.
*/
public void testBindingWithWrongOperator1()
{
@@ -252,23 +252,23 @@ public class CalloutBindingTest extends TestBase
NL + "{ " +
NL + " public void baseMethod(){} " +
NL + "} ");
-
+
createFile("MyTeam","public team class MyTeam " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class MyRole playedBy MyBase " +
- NL + " { " +
+ NL + " { " +
NL + " public abstract void roleMethod();" +
NL + " roleMethod => baseMethod; " +
NL + " } "+
NL + "}");
-
+
compileFile("MyTeam");
-
- assertTrue(hasExpectedProblems(new int[]{ IProblem.AbstractMethodBoundAsOverride }, null ));
+
+ assertTrue(hasExpectedProblems(new int[]{ IProblem.AbstractMethodBoundAsOverride }, null ));
}
-
+
/**
- * A non-abstract role method must not be bound with the "->"-operator.
+ * A non-abstract role method must not be bound with the "->"-operator.
*/
public void testBindingWithWrongOperator2()
{
@@ -276,20 +276,20 @@ public class CalloutBindingTest extends TestBase
NL + "{ " +
NL + " public void baseMethod(){} " +
NL + "} ");
-
+
createFile("MyTeam","public team class MyTeam " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class MyRole playedBy MyBase " +
- NL + " { " +
+ NL + " { " +
NL + " public void roleMethod(){}" +
NL + " roleMethod -> baseMethod; " +
NL + " } "+
NL + "}");
-
+
compileFile("MyTeam");
assertFalse(isCompilationSuccessful());
- assertTrue(hasExpectedProblems(new int[]{ IProblem.RegularCalloutOverrides, IProblem.CalloutOverridesLocal } ));
+ assertTrue(hasExpectedProblems(new int[]{ IProblem.RegularCalloutOverrides, IProblem.CalloutOverridesLocal } ));
}
/**
@@ -297,30 +297,30 @@ public class CalloutBindingTest extends TestBase
*/
public void testMultipleCalloutBinding1()
{
- createFile("MyBase","public class MyBase"
+ createFile("MyBase","public class MyBase"
+ NL + "{"
- + NL + " public void baseMethodA(){}"
- + NL + " public void baseMethodB(){}"
+ + NL + " public void baseMethodA(){}"
+ + NL + " public void baseMethodB(){}"
+ NL + "}");
-
+
createFile("MyTeam",
"public team class MyTeam"
- + NL + "{ "
- + NL + " protected class MyRole playedBy MyBase"
+ + NL + "{ "
+ + NL + " protected class MyRole playedBy MyBase"
+ NL + " { "
- + NL + " public abstract void roleMethod();"
- + NL + " void roleMethod() -> void baseMethodA();"
+ + NL + " public abstract void roleMethod();"
+ + NL + " void roleMethod() -> void baseMethodA();"
+ NL + " void roleMethod() -> void baseMethodB();"
+ NL + " } "
+ NL + "}");
-
+
compileFile("MyTeam");
-
+
assertTrue( hasExpectedProblems(new int[] { IProblem.DuplicateCalloutBinding, IProblem.DuplicateCalloutBinding} ));
- }
-
+ }
+
/**
- * A role method must not be bound to various base methods by callout.
+ * A role method must not be bound to various base methods by callout.
*/
public void testMultipleCalloutBinding2()
{
@@ -329,22 +329,22 @@ public class CalloutBindingTest extends TestBase
NL + " public void baseMethodA(){} " +
NL + " public void baseMethodB(){} " +
NL + "} ");
-
+
createFile("MyTeam","public team class MyTeam " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class MyRole playedBy MyBase " +
- NL + " { " +
+ NL + " { " +
NL + " public abstract void roleMethod();" +
NL + " roleMethod -> baseMethodA; " +
NL + " roleMethod -> baseMethodB; " +
NL + " } "+
NL + "}");
-
+
compileFile("MyTeam");
-
+
assertTrue( hasExpectedProblems(new int[] { IProblem.DuplicateCalloutBinding, IProblem.DuplicateCalloutBinding} ));
}
-
+
/**
* A role method must not be bound to various base methods by callout,
* no matter where the binding is implemented.
@@ -352,36 +352,36 @@ public class CalloutBindingTest extends TestBase
public void testMultipleCalloutBinding3()
{
createFile("MyBase",
- "public class MyBase "
- + NL + "{"
- + NL + " public void baseMethodA(){}"
- + NL + " public void baseMethodB(){}"
+ "public class MyBase "
+ + NL + "{"
+ + NL + " public void baseMethodA(){}"
+ + NL + " public void baseMethodB(){}"
+ NL + "}");
createFile("MySuperTeam",
- "public team class MySuperTeam "
- + NL + "{ "
- + NL + " protected class MyRole playedBy MyBase "
- + NL + " {"
- + NL + " public abstract void roleMethod();"
- + NL + " roleMethod -> baseMethodA;"
+ "public team class MySuperTeam "
+ + NL + "{ "
+ + NL + " protected class MyRole playedBy MyBase "
+ + NL + " {"
+ + NL + " public abstract void roleMethod();"
+ + NL + " roleMethod -> baseMethodA;"
+ NL + " }"
+ NL + "}");
-
+
createFile("MyTeam",
- "public team class MyTeam extends MySuperTeam"
+ "public team class MyTeam extends MySuperTeam"
+ NL + "{ "
- + NL + " protected class MyRole playedBy MyBase"
- + NL + " {"
-// + NL + " public abstract void roleMethod();"
- + NL + " roleMethod -> baseMethodB;"
+ + NL + " protected class MyRole playedBy MyBase"
+ + NL + " {"
+// + NL + " public abstract void roleMethod();"
+ + NL + " roleMethod -> baseMethodB;"
+ NL + " }"
+ NL + "}");
-
+
compileFile("MyTeam");
-
+
assertTrue( hasExpectedProblems(new int[] { IProblem.RegularCalloutOverridesCallout} ));
- }
+ }
/**
* A role method must not be bound to the same base method multiple times.
@@ -392,91 +392,91 @@ public class CalloutBindingTest extends TestBase
NL + "{ " +
NL + " public void baseMethod(){} " +
NL + "} ");
-
+
createFile("MyTeam","public team class MyTeam " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class MyRole playedBy MyBase " +
- NL + " { " +
+ NL + " { " +
NL + " public abstract void roleMethod();" +
NL + " roleMethod -> baseMethod; " +
NL + " roleMethod -> baseMethod; " +
NL + " } "+
NL + "}");
-
+
compileFile("MyTeam");
-
+
assertTrue( hasExpectedProblems( new int[] { IProblem.DuplicateCalloutBinding, IProblem.DuplicateCalloutBinding } ));
- }
+ }
public void testBindingMatchingRoleBaseMethod()
{
createFile("MyException", "public class MyException extends Exception{}");
-
+
createFile("AClass",
"public class AClass {}"
+ NL);
-
+
createFile("BClass",
"public class BClass extends AClass{}"
+ NL);
-
+
createFile("MyBase",
- "public class MyBase "
+ "public class MyBase "
+ NL + "{ "
+ NL + " public void baseMethodAClass(AClass o){}"
+ NL + "}"
+ NL);
-
+
createFile("MyTeam",
"public team class MyTeam "
- + NL + "{ "
+ + NL + "{ "
+ NL + " protected class MyRole playedBy MyBase "
- + NL + " { "
+ + NL + " { "
+ NL + " public abstract void roleMethodBClass(BClass o);"
+ NL + " roleMethodBClass -> baseMethodAClass;"
+ NL + " } "
+ NL + "}"
+ NL);
-
-
+
+
compileFile("MyTeam");
-
+
assertTrue( isCompilationSuccessful() );
}
public void testBindingMatchingRoleBaseMethod2()
{
createFile("MyException", "public class MyException extends Exception{}");
-
+
createFile("AClass",
"public class AClass {}"
+ NL);
-
+
createFile("BClass",
"public class BClass extends AClass{}"
+ NL);
-
+
createFile("MyBase",
- "public class MyBase "
+ "public class MyBase "
+ NL + "{ "
+ NL + " public BClass baseMethodBClassReturn(){ return null; }"
+ NL + "}"
+ NL);
-
+
createFile("MyTeam",
"public team class MyTeam "
- + NL + "{ "
+ + NL + "{ "
+ NL + " protected class MyRole playedBy MyBase "
- + NL + " { "
+ + NL + " { "
+ NL + " public abstract AClass roleMethodAClassReturn2();"
+ NL + " roleMethodAClassReturn2 -> baseMethodBClassReturn;"
+ NL + " } "
+ NL + "}"
+ NL);
-
-
+
+
compileFile("MyTeam");
-
+
assertTrue( isCompilationSuccessful());
}
@@ -487,24 +487,24 @@ public class CalloutBindingTest extends TestBase
public void testBindingMismatchingRoleBaseMethod1()
{
createFile("MyBase",
- "public class MyBase "
+ "public class MyBase "
+ NL + "{ "
+ NL + " public void baseMethod(int i){}"
+ NL + "}"
+ NL);
-
+
createFile("MyTeam",
"public team class MyTeam "
- + NL + "{ "
+ + NL + "{ "
+ NL + " protected class MyRole playedBy MyBase "
- + NL + " { "
+ + NL + " { "
+ NL + " public abstract void roleMethod();"
+ NL + " roleMethod -> baseMethod; "
+ NL + " } "
+ NL + "}"
+ NL);
-
-
+
+
compileFile("MyTeam");
assertTrue( hasExpectedProblems(new int[] { IProblem.TooFewArgumentsInCallout } ));
@@ -517,34 +517,34 @@ public class CalloutBindingTest extends TestBase
public void testBindingMismatchingRoleBaseMethod2()
{
createFile("MyException", "public class MyException extends Exception{static final long serialVersionUID=1234;}");
-
+
createFile("AClass",
"public class AClass {}"
+ NL);
-
+
createFile("BClass",
"public class BClass extends AClass{}"
+ NL);
-
+
createFile("MyBase",
- "public class MyBase "
+ "public class MyBase "
+ NL + "{ "
+ NL + " public void baseMethodBClass(BClass o) throws MyException{}"
+ NL + "}"
+ NL);
-
+
createFile("MyTeam",
"public team class MyTeam "
- + NL + "{ "
+ + NL + "{ "
+ NL + " protected class MyRole playedBy MyBase "
- + NL + " { "
+ + NL + " { "
+ NL + " public abstract void roleMethodAClass(AClass o);"
+ NL + " roleMethodAClass -> baseMethodBClass;"
+ NL + " } "
+ NL + "}"
+ NL);
-
-
+
+
compileFile("MyTeam");
assertTrue( hasExpectedProblems(new int[] { IProblem.IncompatibleMappedCalloutArgument, IProblem.CalloutUndeclaredException} ));
}
@@ -553,84 +553,84 @@ public class CalloutBindingTest extends TestBase
public void testBindingMismatchingRoleBaseMethod3()
{
createFile("MyException", "public class MyException extends Exception{static final long serialVersionUID=1234;}");
-
+
createFile("AClass",
"public class AClass {}"
+ NL);
-
+
createFile("BClass",
"public class BClass extends AClass{}"
+ NL);
-
+
createFile("MyBase",
- "public class MyBase "
+ "public class MyBase "
+ NL + "{ "
+ NL + " public void baseMethodAClass(AClass o){}"
+ NL + "}"
+ NL);
-
+
createFile("MyTeam",
"public team class MyTeam "
- + NL + "{ "
+ + NL + "{ "
+ NL + " protected class MyRole playedBy MyBase "
- + NL + " { "
+ + NL + " { "
+ NL + " public abstract AClass roleMethodAClassReturn1();"
+ NL + " roleMethodAClassReturn1 -> baseMethodAClass;"
+ NL + " } "
+ NL + "}"
+ NL);
-
-
+
+
compileFile("MyTeam");
-
+
assertFalse( isCompilationSuccessful() );
}
/**
* The signatures of role method and bound base method
* must have conform exception declarations (throw-clauses)
- *
+ *
* The role method must not declare throwing an exception
* while the base method does not
- *
+ *
* Actually, why shouldn't you be able to add a throws-clause in the role-method?
- * IMHO, this shouldn't be an error. (carp)
+ * IMHO, this shouldn't be an error. (carp)
*/
public void testBindingWithDifferentExceptionDeclarations1()
{
createFile("MyException", "public class MyException extends Exception{static final long serialVersionUID=1234;}");
-
+
createFile("MyBase","public class MyBase " +
NL + "{ " +
NL + " public void baseMethod(){}" +
NL + "} ");
-
+
createFile("MyTeam","public team class MyTeam " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class MyRole playedBy MyBase " +
- NL + " { " +
+ NL + " { " +
NL + " public abstract void roleMethod() throws MyException;" +
NL + " roleMethod -> baseMethod; " +
NL + " } "+
NL + "}");
-
-
+
+
compileFile("MyTeam");
-
+
assertTrue(isCompilationSuccessful());
}
/**
* The signatures of role method and bound base method
* must have conform exception declarations (throw-clauses)
- *
+ *
* The role method must declare throwing an exception
* if the base method does
*/
public void testBindingWithDifferentExceptionDeclarations2()
{
createFile("MyException", "public class MyException extends Exception{static final long serialVersionUID=1234;}");
-
+
createFile("MyBase","public class MyBase " +
NL + "{ " +
NL + " public void baseMethod() throws MyException " +
@@ -638,68 +638,68 @@ public class CalloutBindingTest extends TestBase
NL + " throw new MyException();" +
NL + " }" +
NL + "} ");
-
+
createFile("MyTeam","public team class MyTeam " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class MyRole playedBy MyBase " +
- NL + " { " +
+ NL + " { " +
NL + " public abstract void roleMethod();" +
NL + " roleMethod -> baseMethod; " +
NL + " } "+
NL + "}");
-
+
compileFile("MyTeam");
-
- assertTrue(hasExpectedProblems(new int[] {IProblem.CalloutUndeclaredException}));
+
+ assertTrue(hasExpectedProblems(new int[] {IProblem.CalloutUndeclaredException}));
}
-
+
/**
* The signatures of role method and bound base method
* must have conform exception declarations (throw-clauses)
- *
+ *
* The declared exceptions must not be of different types.
*/
public void testBindingWithDifferentExceptionDeclarations3()
- {
+ {
createFile("MyException", "public class MyException extends Exception{static final long serialVersionUID=1234;}");
createFile("YourException", "public class YourException extends Exception{static final long serialVersionUID=1234;}");
-
+
createFile("MyBase","public class MyBase " +
NL + "{ " +
NL + " public void baseMethod() throws MyException " +
NL + " {" +
NL + " throw new MyException();" +
- NL + " }" +
+ NL + " }" +
NL + "}");
-
+
createFile("MyTeam","public team class MyTeam " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class MyRole playedBy MyBase " +
- NL + " { " +
+ NL + " { " +
NL + " public abstract void roleMethod() throws YourException;" +
NL + " roleMethod -> baseMethod; " +
NL + " } "+
NL + "}");
-
+
compileFile("MyTeam");
-
- assertTrue(hasExpectedProblems(new int[] {IProblem.CalloutUndeclaredException}));
- }
-
+
+ assertTrue(hasExpectedProblems(new int[] {IProblem.CalloutUndeclaredException}));
+ }
+
public void testBrokenBindingDeclaration1()
{
createFile("MyBase","public class MyBase " +
NL + "{ " +
NL + " public void baseMethod()" +
NL + " {" +
- NL + " }" +
+ NL + " }" +
NL + "}");
createFile("MyTeam",
"public team class MyTeam" +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class MyRole playedBy MyBase " +
- NL + " { " +
+ NL + " { " +
NL + " public void roleMethod1() {}" +
NL + " public void roleMethod2() {}" +
NL + " public void roleMethod3() {}" +
@@ -731,7 +731,7 @@ public class CalloutBindingTest extends TestBase
NL + "}");
compileFile("MyTeam");
-
+
//TODO: km: SH, please check
// assertTrue( hasExpectedProblems(new int[] { IProblem.SyntaxErrorInCallout} ));
}
@@ -742,14 +742,14 @@ public class CalloutBindingTest extends TestBase
NL + "{ " +
NL + " public void baseMethod()" +
NL + " {" +
- NL + " }" +
+ NL + " }" +
NL + "}");
createFile("MyTeam",
"public team class MyTeam" +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class MyRole playedBy MyBase " +
- NL + " { " +
+ NL + " { " +
NL + " public abstract void abstractRoleMethod();" +
NL + "" +
NL + " public abstract void roleMethod();" +
@@ -759,7 +759,7 @@ public class CalloutBindingTest extends TestBase
NL + "}");
compileFile("MyTeam");
-
+
assertTrue( hasExpectedProblems(new int[] { IProblem.AbstractMethodsInConcreteClass, IProblem.AbstractMethodInAbstractClass } ));
}
@@ -769,14 +769,14 @@ public class CalloutBindingTest extends TestBase
NL + "{ " +
NL + " public void baseMethod(int[] baseArray)" +
NL + " {" +
- NL + " }" +
+ NL + " }" +
NL + "}");
createFile("MyTeam",
"public team class MyTeam" +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class MyRole playedBy MyBase " +
- NL + " { " +
+ NL + " { " +
NL + " public abstract void abstractRoleMethod(int[] roleArray);" +
NL + "" +
NL + " void abstractRoleMethod(int[] r) -> void baseMethod(int[] b);" +
@@ -784,8 +784,8 @@ public class CalloutBindingTest extends TestBase
NL + "}");
compileFile("MyTeam");
-
- assertTrue(isCompilationSuccessful());
+
+ assertTrue(isCompilationSuccessful());
}
@@ -795,14 +795,14 @@ public class CalloutBindingTest extends TestBase
NL + "{ " +
NL + " public void baseMethod(Object[] baseArray)" +
NL + " {" +
- NL + " }" +
+ NL + " }" +
NL + "}");
createFile("MyTeam",
"public team class MyTeam" +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class MyRole playedBy MyBase " +
- NL + " { " +
+ NL + " { " +
NL + " public abstract void abstractRoleMethod(Object[] roleArray);" +
NL + "" +
NL + " void abstractRoleMethod(Object[] r) -> void baseMethod(Object[] b);" +
@@ -810,26 +810,26 @@ public class CalloutBindingTest extends TestBase
NL + "}");
compileFile("MyTeam");
-
- assertTrue(isCompilationSuccessful());
+
+ assertTrue(isCompilationSuccessful());
}
-
+
public void testArrayLowering1()
{
createFile("MyBase","public class MyBase " +
NL + "{ " +
NL + " public void baseMethod(MyBase[] baseArray)" +
NL + " {" +
- NL + " }" +
+ NL + " }" +
NL + "}");
createFile("MyTeam",
"public team class MyTeam" +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class MyRole playedBy MyBase " +
- NL + " { " +
+ NL + " { " +
NL + " public abstract void abstractRoleMethod(MyRole[] roleArray);" +
NL + "" +
NL + " void abstractRoleMethod(MyRole[] r) -> void baseMethod(MyBase[] b);" +
@@ -837,11 +837,11 @@ public class CalloutBindingTest extends TestBase
NL + "}");
compileFile("MyTeam");
-
- assertTrue(isCompilationSuccessful());
+
+ assertTrue(isCompilationSuccessful());
}
-
+
/**
* Simple test that should work.
*
@@ -852,14 +852,14 @@ public class CalloutBindingTest extends TestBase
NL + "{ " +
NL + " public void baseMethod(Object obj)" +
NL + " {" +
- NL + " }" +
+ NL + " }" +
NL + "}");
createFile("MyTeam",
"public team class MyTeam" +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class MyRole playedBy MyBase " +
- NL + " { " +
+ NL + " { " +
NL + " public abstract void abstractRoleMethod(Object obj);" +
NL + "" +
NL + " void abstractRoleMethod(Object obj) -> void baseMethod(Object obj);" +
@@ -867,8 +867,8 @@ public class CalloutBindingTest extends TestBase
NL + "}");
compileFile("MyTeam");
-
- assertTrue(isCompilationSuccessful());
+
+ assertTrue(isCompilationSuccessful());
}
@@ -881,14 +881,14 @@ public class CalloutBindingTest extends TestBase
NL + "{ " +
NL + " public static void baseMethod(Object obj)" +
NL + " {" +
- NL + " }" +
+ NL + " }" +
NL + "}");
createFile("MyTeam",
"public team class MyTeam" +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class MyRole playedBy MyBase " +
- NL + " { " +
+ NL + " { " +
NL + " public abstract void abstractRoleMethod(Object obj);" +
NL + "" +
NL + " void abstractRoleMethod(Object obj) -> void baseMethod(Object obj);" +
@@ -896,95 +896,95 @@ public class CalloutBindingTest extends TestBase
NL + "}");
compileFile("MyTeam");
-
- assertTrue(isCompilationSuccessful());
+
+ assertTrue(isCompilationSuccessful());
}
-
+
/**
* A common callout binding scenario consisting of a base class, a team
* with a default constructor, an abstract role class, a role class with
* multiple callout bindings and a main method for team instantiation.
*/
- public void testCalloutBinding1()
+ public void testCalloutBinding1()
{
createFile("MyBase",
- "public class MyBase"
- + NL + "{"
- + NL + " public void myBaseMethod(int a)"
- + NL + " {"
- + NL + " System.out.println(\"laber\");"
- + NL + " }"
- + NL + " public void myVoidBaseMethod()"
- + NL + " {"
- + NL + " System.out.println(\"blubber\");"
- + NL + " }"
- + NL + "}"
+ "public class MyBase"
+ + NL + "{"
+ + NL + " public void myBaseMethod(int a)"
+ + NL + " {"
+ + NL + " System.out.println(\"laber\");"
+ + NL + " }"
+ + NL + " public void myVoidBaseMethod()"
+ + NL + " {"
+ + NL + " System.out.println(\"blubber\");"
+ + NL + " }"
+ + NL + "}"
+ NL);
-
+
createFile("MyTeam",
- "public team class MyTeam"
- + NL + "{"
- + NL + " public MyTeam()"
- + NL + " {"
- + NL + " super();"
+ "public team class MyTeam"
+ + NL + "{"
+ + NL + " public MyTeam()"
+ + NL + " {"
+ + NL + " super();"
+ NL + " Role r = new Role(new MyBase());"
+ NL + " r.myCallout(3);"
+ NL + " r.myAbstractCallout(4);"
+ NL + " r.myAbstractInheritedVoidCallout();"
- + NL + " }"
+ + NL + " }"
+ NL + ""
- + NL + " public abstract class SuperRole"
+ + NL + " public abstract class SuperRole"
+ NL + " {"
- + NL + ""
+ + NL + ""
+ NL + " void myCallout(int a)"
- + NL + " {"
- + NL + " System.out.println(\"Hallo\");"
+ + NL + " {"
+ + NL + " System.out.println(\"Hallo\");"
+ NL + " }"
- + NL + ""
+ + NL + ""
+ NL + " abstract void myAbstractInheritedVoidCallout();"
+ NL + " }"
+ NL + ""
- + NL + " public class Role extends SuperRole playedBy MyBase"
+ + NL + " public class Role extends SuperRole playedBy MyBase"
+ NL + " {"
+ NL + " protected abstract void myAbstractCallout(int a);"
- + NL + ""
+ + NL + ""
+ NL + " public void method()"
+ NL + " {"
+ NL + " System.out.println(\"normal method\"); "
+ NL + " }"
+ NL + ""
- + NL + " protected void myCallout(int a) => void myBaseMethod(int a);"
- + NL + " void myAbstractCallout(int a) -> void myBaseMethod(int a);"
- + NL + " protected void myAbstractInheritedVoidCallout() -> void myVoidBaseMethod();"
+ + NL + " protected void myCallout(int a) => void myBaseMethod(int a);"
+ + NL + " void myAbstractCallout(int a) -> void myBaseMethod(int a);"
+ + NL + " protected void myAbstractInheritedVoidCallout() -> void myVoidBaseMethod();"
+ NL + " }"
- + NL + " public static void main(String[] args){"
- + NL + " new MyTeam();"
+ + NL + " public static void main(String[] args){"
+ + NL + " new MyTeam();"
+ NL + " };"
+ NL + "}"
+ NL);
-
+
compileFile("MyTeam");
-
+
assertTrue(isCompilationSuccessful());
}
-
+
public void testResultLifting1()
{
-
+
createFile("MyBase",
- "public class MyBase"
- + NL + "{"
- + NL + " public MyBase foo()"
- + NL + " {"
- + NL + " return this;"
+ "public class MyBase"
+ + NL + "{"
+ + NL + " public MyBase foo()"
+ + NL + " {"
+ + NL + " return this;"
+ NL + " }"
+ NL + "}"
- + NL);
-
+ + NL);
+
createFile("MyTeam",
"public team class MyTeam"
- + NL + "{"
+ + NL + "{"
+ NL + " protected class MyRole playedBy MyBase"
+ NL + " {"
+ NL + " public void print() {System.out.println(\"OK\");}"
@@ -1010,25 +1010,25 @@ public class CalloutBindingTest extends TestBase
assertTrue(isCompilationSuccessful());
}
-
+
public void testResultLifting2()
{
-
+
createFile("MyBase",
- "public class MyBase"
- + NL + "{"
- + NL + " public MyBase foo()"
- + NL + " {"
- + NL + " return this;"
+ "public class MyBase"
+ + NL + "{"
+ + NL + " public MyBase foo()"
+ + NL + " {"
+ + NL + " return this;"
+ NL + " }"
+ NL + "}"
- + NL);
-
+ + NL);
+
createFile("MyTeamInterface",
"public team class MyTeamInterface"
- + NL + "{"
+ + NL + "{"
+ NL + " public interface MyInterface playedBy MyBase"
- + NL + " {"
+ + NL + " {"
+ NL + " MyInterface bar();"
+ NL + " void print();"
+ NL + " }"
@@ -1057,35 +1057,35 @@ public class CalloutBindingTest extends TestBase
assertTrue(isCompilationSuccessful());
}
-
+
public void testResultLifting3()
{
-
+
createFile("MyBase",
- "public class MyBase"
- + NL + "{"
- + NL + " public MyBase foo()"
- + NL + " {"
- + NL + " return this;"
+ "public class MyBase"
+ + NL + "{"
+ + NL + " public MyBase foo()"
+ + NL + " {"
+ + NL + " return this;"
+ NL + " }"
+ NL + "}"
- + NL);
-
+ + NL);
+
createFile("MyBase2",
- "public class MyBase2"
- + NL + "{"
- + NL + " public MyBase2 foo()"
- + NL + " {"
- + NL + " return this;"
+ "public class MyBase2"
+ + NL + "{"
+ + NL + " public MyBase2 foo()"
+ + NL + " {"
+ + NL + " return this;"
+ NL + " }"
+ NL + "}"
- + NL);
+ + NL);
createFile("MyTeam",
"public team class MyTeam"
- + NL + "{"
+ + NL + "{"
+ NL + " abstract protected class MyInnerClass"// playedBy MyBase2"
- + NL + " {"
+ + NL + " {"
+ NL + " protected abstract MyRole bar();"
+ NL + " public abstract void print();"
+ NL + " }"
@@ -1117,20 +1117,20 @@ public class CalloutBindingTest extends TestBase
public void testSimpleSample()
{
-
+
createFile("MyBase",
- "public class MyBase"
- + NL + "{"
- + NL + " public String getValue(int i)"
- + NL + " {"
- + NL + " return \"Hallo\";"
+ "public class MyBase"
+ + NL + "{"
+ + NL + " public String getValue(int i)"
+ + NL + " {"
+ + NL + " return \"Hallo\";"
+ NL + " }"
+ NL + "}"
- + NL);
+ + NL);
createFile("MyTeam",
"public team class MyTeam"
- + NL + "{"
+ + NL + "{"
+ NL + " protected class MyRole playedBy MyBase"
+ NL + " {"
+ NL + " public abstract String getValue(int i);"
@@ -1140,14 +1140,14 @@ public class CalloutBindingTest extends TestBase
+ NL);
createFile("Main",
- "public class Main"
- + NL + "{"
- + NL + " public static void main(String[] args)"
- + NL + " {"
- + NL + " MyTeam teem = new MyTeam();"
+ "public class Main"
+ + NL + "{"
+ + NL + " public static void main(String[] args)"
+ + NL + " {"
+ + NL + " MyTeam teem = new MyTeam();"
+ NL + " }"
+ NL + "}"
- + NL);
+ + NL);
compileFile("Main");
@@ -1157,20 +1157,20 @@ public class CalloutBindingTest extends TestBase
public void testIncompatibleReturnTypes()
{
-
+
createFile("MyBase",
- "public class MyBase"
- + NL + "{"
- + NL + " public long getValue()"
- + NL + " {"
- + NL + " return 1L;"
+ "public class MyBase"
+ + NL + "{"
+ + NL + " public long getValue()"
+ + NL + " {"
+ + NL + " return 1L;"
+ NL + " }"
+ NL + "}"
- + NL);
+ + NL);
createFile("MyTeam",
"public team class MyTeam"
- + NL + "{"
+ + NL + "{"
+ NL + " protected class MyRole playedBy MyBase"
+ NL + " {"
+ NL + " public abstract int getValue();"
@@ -1180,14 +1180,14 @@ public class CalloutBindingTest extends TestBase
+ NL);
createFile("Main",
- "public class Main"
- + NL + "{"
- + NL + " public static void main(String[] args)"
- + NL + " {"
- + NL + " MyTeam teem = new MyTeam();"
+ "public class Main"
+ + NL + "{"
+ + NL + " public static void main(String[] args)"
+ + NL + " {"
+ + NL + " MyTeam teem = new MyTeam();"
+ NL + " }"
+ NL + "}"
- + NL);
+ + NL);
compileFile("Main");
@@ -1197,24 +1197,24 @@ public class CalloutBindingTest extends TestBase
public void testCalloutOverrideWithCallout()
{
-
+
createFile("MyBase",
- "public class MyBase"
- + NL + "{"
- + NL + " public int getValue()"
- + NL + " {"
- + NL + " return 1;"
+ "public class MyBase"
+ + NL + "{"
+ + NL + " public int getValue()"
+ + NL + " {"
+ + NL + " return 1;"
+ NL + " }"
- + NL + " public int getValueBad()"
- + NL + " {"
- + NL + " return 666;"
+ + NL + " public int getValueBad()"
+ + NL + " {"
+ + NL + " return 666;"
+ NL + " }"
+ NL + "}"
- + NL);
+ + NL);
createFile("MyTeam",
"public team class MyTeam"
- + NL + "{"
+ + NL + "{"
+ NL + " public class MyRole playedBy MyBase"
+ NL + " {"
+ NL + " protected abstract int getValue();"
@@ -1225,7 +1225,7 @@ public class CalloutBindingTest extends TestBase
createFile("MySubTeam",
"public team class MySubTeam extends MyTeam "
- + NL + "{"
+ + NL + "{"
+ NL + " public class MyRole"
+ NL + " {"
+ NL + " int getValue() => int getValue();"
@@ -1235,15 +1235,15 @@ public class CalloutBindingTest extends TestBase
+ NL);
createFile("Main",
- "public class Main"
- + NL + "{"
- + NL + " public static void main(String[] args)"
- + NL + " {"
- + NL + " MySubTeam teem = new MySubTeam();"
- + NL + " System.out.println(teem.getValue(new MyBase()));"
+ "public class Main"
+ + NL + "{"
+ + NL + " public static void main(String[] args)"
+ + NL + " {"
+ + NL + " MySubTeam teem = new MySubTeam();"
+ + NL + " System.out.println(teem.getValue(new MyBase()));"
+ NL + " }"
+ NL + "}"
- + NL);
+ + NL);
compileFile("Main");
@@ -1260,20 +1260,20 @@ public class CalloutBindingTest extends TestBase
NL + " public void baseMethod(){} " +
NL + " protected void baseMethod(String arg){} " +
NL + "} ");
-
+
createFile("MyTeam","public team class MyTeam " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class MyRole playedBy MyBase " +
- NL + " { " +
+ NL + " { " +
NL + " public abstract void roleMethod();" +
NL + " roleMethod -> baseMethod; " +
NL + " } "+
NL + "}");
-
+
compileFile("MyTeam");
-
+
assertFalse(isCompilationSuccessful());
- }
+ }
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/CompilationUnitContainmentTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/CompilationUnitContainmentTest.java
index 1d311a051..1353c595e 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/CompilationUnitContainmentTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/CompilationUnitContainmentTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -30,7 +30,7 @@ import org.eclipse.objectteams.otdt.tests.compiler.TestBase;
* @author brcan
* @version $Id: CompilationUnitContainmentTest.java 23494 2010-02-05 23:06:44Z stephan $
*/
-public class CompilationUnitContainmentTest extends TestBase
+public class CompilationUnitContainmentTest extends TestBase
{
public CompilationUnitContainmentTest(String testName)
{
@@ -41,14 +41,14 @@ public class CompilationUnitContainmentTest extends TestBase
* The compilation unit's name doesn't match with the type declaration's name.
* Comment:
* Just like classes in Java, the name of the team has to be identical to
- * the file name.
+ * the file name.
*/
- public void testInvalidCompilationUnitName1()
+ public void testInvalidCompilationUnitName1()
{
createFile("MyTeam","public team class MyTeamWrongName {}");
-
+
compileFile("MyTeam");
-
+
assertFalse(isCompilationSuccessful());
}
} \ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/CopyInheritanceTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/CopyInheritanceTest.java
index c1f58be4b..8118d9f35 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/CopyInheritanceTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/CopyInheritanceTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -36,16 +36,16 @@ public class CopyInheritanceTest extends TestBase {
}
/**
- * Test copy inheritance for string-array-references
+ * Test copy inheritance for string-array-references
*/
- public void testCopyStringArrayReferences()
+ public void testCopyStringArrayReferences()
{
-
+
createFile("MySuperTeam","public team class MySuperTeam " +
- NL + "{ " +
+ NL + "{ " +
NL + " public class MyRole" +
- NL + " { " +
+ NL + " { " +
NL + " String[] strArray;" +
NL + " public void roleMethod()" +
NL + " {" +
@@ -56,25 +56,25 @@ public class CopyInheritanceTest extends TestBase {
NL + "}");
createFile("MyTeam","public team class MyTeam extends MySuperTeam" +
- NL + "{ " +
+ NL + "{ " +
NL + "}");
-
+
compileFile("MyTeam");
-
+
assertTrue(isCompilationSuccessful());
}
-
+
/**
- * Test copy inheritance for role-array-references
+ * Test copy inheritance for role-array-references
*/
- public void testCopyRoleArrayReferences()
+ public void testCopyRoleArrayReferences()
{
-
+
createFile("MySuperTeam","public team class MySuperTeam " +
- NL + "{ " +
+ NL + "{ " +
NL + " public class MyRole" +
- NL + " { " +
+ NL + " { " +
NL + " MyRole[] roleArray;" +
NL + " public void roleMethod()" +
NL + " {" +
@@ -85,25 +85,25 @@ public class CopyInheritanceTest extends TestBase {
NL + "}");
createFile("MyTeam","public team class MyTeam extends MySuperTeam" +
- NL + "{ " +
+ NL + "{ " +
NL + "}");
-
+
compileFile("MyTeam");
-
+
assertTrue(isCompilationSuccessful());
}
-
+
/**
- * Test copy inheritance for int-array-references
+ * Test copy inheritance for int-array-references
*/
- public void testCopyIntArrayReferences()
+ public void testCopyIntArrayReferences()
{
-
+
createFile("MySuperTeam","public team class MySuperTeam " +
- NL + "{ " +
+ NL + "{ " +
NL + " public class MyRole" +
- NL + " { " +
+ NL + " { " +
NL + " int[] intArray;" +
NL + " public void roleMethod()" +
NL + " {" +
@@ -114,24 +114,24 @@ public class CopyInheritanceTest extends TestBase {
NL + "}");
createFile("MyTeam","public team class MyTeam extends MySuperTeam" +
- NL + "{ " +
+ NL + "{ " +
NL + "}");
-
+
compileFile("MyTeam");
-
+
assertTrue(isCompilationSuccessful());
- }
+ }
/**
- * Test copy inheritance for array-length-field access
+ * Test copy inheritance for array-length-field access
*/
- public void testCopyIntArrayLengthFieldAccess()
+ public void testCopyIntArrayLengthFieldAccess()
{
createFile("MySuperTeam","public team class MySuperTeam " +
- NL + "{ " +
+ NL + "{ " +
NL + " public class MyRole" +
- NL + " { " +
+ NL + " { " +
NL + " int[] intArray;" +
NL + " public void roleMethod()" +
NL + " {" +
@@ -142,51 +142,51 @@ public class CopyInheritanceTest extends TestBase {
NL + "}");
createFile("MyTeam","public team class MyTeam extends MySuperTeam" +
- NL + "{ " +
+ NL + "{ " +
NL + "}");
-
+
compileFile("MyTeam");
-
+
assertTrue(isCompilationSuccessful());
- }
+ }
/**
- * Test copy inheritance with missing import in subclass
+ * Test copy inheritance with missing import in subclass
*/
- public void testMissingImport1()
+ public void testMissingImport1()
{
createFile("MySuperTeam","" +
NL + "public team class MySuperTeam " +
- NL + "{ " +
+ NL + "{ " +
NL + " public class MyRole {}" +
NL + "}");
createFile("MyTeam","" +
NL + "public team class MyTeam extends MySuperTeam" +
- NL + "{ " +
+ NL + "{ " +
NL + " public class MyRole" +
- NL + " { " +
+ NL + " { " +
NL + " BigDecimal roleMethod()" +
NL + " {" +
NL + " return null;" +
NL + " }" +
- NL + " } " +
+ NL + " } " +
NL + "}");
-
+
compileFile("MyTeam");
-
+
assertFalse(isCompilationSuccessful());
- }
+ }
/**
- * Test copy inheritance with missing import in subclass
+ * Test copy inheritance with missing import in subclass
*/
- public void testMissingImport2()
+ public void testMissingImport2()
{
createFile("MySuperTeam","" +
NL + "public team class MySuperTeam " +
- NL + "{ " +
+ NL + "{ " +
NL + " public class MyRole {" +
//NL + " public void method(){}" +
NL + " }" +
@@ -194,9 +194,9 @@ public class CopyInheritanceTest extends TestBase {
createFile("MyTeam","" +
NL + "public team class MyTeam extends MySuperTeam" +
- NL + "{ " +
+ NL + "{ " +
NL + " public class MyRole" +
- NL + " { " +
+ NL + " { " +
NL + " BigDecimal roleMethod()" +
NL + " {" +
NL + " return null;" +
@@ -206,12 +206,12 @@ public class CopyInheritanceTest extends TestBase {
NL + " return null;" +
NL + " }" +
- NL + " } " +
+ NL + " } " +
NL + "}");
-
+
compileFile("MyTeam");
-
+
assertFalse(isCompilationSuccessful());
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/ExternalRoleTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/ExternalRoleTest.java
index 038422a63..40bf84e0c 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/ExternalRoleTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/ExternalRoleTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -41,18 +41,18 @@ public class ExternalRoleTest extends TestBase implements IOTConstants{
*/
public void testExternalRoleWithCompiledTeam()
{
- createFile("MyRole","team package MyTeam;" +
+ createFile("MyRole","team package MyTeam;" +
NL + "public class MyRole {" +
NL + "}");
-
+
createFile("MyTeam","public team class MyTeam { " +
NL + " private MyRole r = null;" +
NL + "}");
-
+
compileFile("MyTeam");
assertTrue(isCompilationSuccessful());
- compileFile("MyTeam"+File.separator+"MyRole");
+ compileFile("MyTeam"+File.separator+"MyRole");
assertTrue(isCompilationSuccessful());
}
@@ -61,15 +61,15 @@ public class ExternalRoleTest extends TestBase implements IOTConstants{
*/
public void testExternalRoleWithUncompiledTeam()
{
- createFile("MyRole","team package MyTeam;" +
+ createFile("MyRole","team package MyTeam;" +
NL + "public class MyRole {" +
NL + " void foo() { System.out.println(MyTeam.this); }" +
NL + "}");
-
+
createFile("MyTeam","public team class MyTeam { " +
NL + " private MyRole r = null;" +
NL + "}");
-
+
compileFile("MyTeam"+File.separator+"MyRole");
assertTrue(isCompilationSuccessful());
}
@@ -79,15 +79,15 @@ public class ExternalRoleTest extends TestBase implements IOTConstants{
*/
public void testExternalRoleWithQualifiedPackageName()
{
- createFile("MyRole","team package org.eclipse.objectteams.MyTeam;" +
+ createFile("MyRole","team package org.eclipse.objectteams.MyTeam;" +
NL + "public class MyRole {" +
NL + "}");
-
+
createFile("MyTeam","package org.eclipse.objectteams;" +
NL + "public team class MyTeam { " +
NL + " private MyRole r = null;" +
NL + "}");
-
+
compileFile("org"+File.separator+"eclipse"+File.separator+"objectteams"+File.separator+"MyTeam"+File.separator+"MyRole");
assertTrue(isCompilationSuccessful());
@@ -101,32 +101,32 @@ public class ExternalRoleTest extends TestBase implements IOTConstants{
*/
public void testExternalRoleWithMissingTeamModifier()
{
- createFile("MyRole","team package MyTeam;" +
+ createFile("MyRole","team package MyTeam;" +
NL + "public class MyRole {" +
NL + "}");
-
+
createFile("MyTeam","public class MyTeam { " +
NL + " private MyRole r = null;" +
NL + "}");
-
+
compileFile("MyTeam"+File.separator+"MyRole");
assertFalse(isCompilationSuccessful());
}
-
+
/**
* Test for external defined role with special team-package declaration
* Expected Team does not exist
*/
public void testExternalRoleWithMissingTeam()
{
- createFile("MyRole","team package MyTeam;" +
+ createFile("MyRole","team package MyTeam;" +
NL + "public class MyRole {" +
NL + "}");
-
+
compileFile("MyTeam"+File.separator+"MyRole");
assertFalse(isCompilationSuccessful());
- }
-
+ }
+
//http://nevermind.cs.tu-berlin.de/~gis/ot/2.4.2-otjld-inaccessible-base-class-9.html
public void inaccessiblebaseclass()
{
@@ -134,20 +134,20 @@ public class ExternalRoleTest extends TestBase implements IOTConstants{
NL + "public class MyClass {"+
NL + " class InnerClass {}"+
NL + "}");
-
+
createFile("MyTeam","package p2;"+
NL + "public team class MyTeam {"+
NL + "public class MyRole extends p1.MyClass playedBy InnerClass {}"+
NL + "}");
-
+
compileFile("p1"+File.separator+"MyClass");
assertTrue(isCompilationSuccessful());
- compileFile("p2"+File.separator+"MyTeam");
+ compileFile("p2"+File.separator+"MyTeam");
assertFalse(isCompilationSuccessful());
-
+
}
-
-
+
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/LiftingTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/LiftingTest.java
index 6d65afa1b..dfc448aad 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/LiftingTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/LiftingTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -43,7 +43,7 @@ public class LiftingTest extends TestBase implements IOTConstants
public void testDeclaredLifting1()
{
createFile("MyBase","public class MyBase {}");
-
+
createFile("MyTeam","public team class MyTeam { " +
NL + " protected class MyRole playedBy MyBase {" +
NL + " }" +
@@ -54,21 +54,21 @@ public class LiftingTest extends TestBase implements IOTConstants
NL + " (new MyTeam()).method(new MyBase());" +
NL + " }"+
NL + "}");
-
+
compileFile("MyTeam");
-
+
assertTrue(isCompilationSuccessful());
}
-
+
/**
* A test for smart lifting.
*/
public void testSmartLifting1()
{
createFile("Base2", "public class Base2 {}");
-
+
createFile("Base3", "public class Base3 extends Base2{}");
-
+
createFile("MyTeam","public team class MyTeam extends org.objectteams.Team {" +
NL + " public static void main(String[] args){" +
NL + " System.out.println(\"MyTeam\");" +
@@ -78,18 +78,18 @@ public class LiftingTest extends TestBase implements IOTConstants
NL + " super();" +
NL + " System.out.println(\"MyTeam.MyTeam()\");" +
NL + " System.out.println("+new String(_OT_LIFT_TO)+OT_DELIM+"Role2(this, new Base2(), 0));" +
- NL + " }" +
- NL + " public class Role1 {}" +
+ NL + " }" +
+ NL + " public class Role1 {}" +
NL + " public class Role2 extends Role1 playedBy Base2{}" +
NL + " public class Role3 extends Role2 playedBy Base3{}" +
NL + " public class Role4 extends Role3 playedBy Base3{}" +
- NL + " public class Role6 extends Role4 playedBy Base3{}" +
+ NL + " public class Role6 extends Role4 playedBy Base3{}" +
NL + " public class Role5 extends Role4 playedBy Base3{}" +
NL + "}");
-
+
compileFile("MyTeam");
-
- // TODO (SH): what problem expected? definite ambiguity 7.3(b)?
+
+ // TODO (SH): what problem expected? definite ambiguity 7.3(b)?
// need to replace explicit lift-invocation with some legal syntax.
assertFalse(isCompilationSuccessful());
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/LoweringTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/LoweringTest.java
index 633866738..d08b3f940 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/LoweringTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/LoweringTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -37,117 +37,117 @@ public class LoweringTest extends TestBase
}
/**
- * Testing arraylowering; simple structure of classes,
+ * Testing arraylowering; simple structure of classes,
* complex lowering.
*/
- public void testArrayLowering1()
+ public void testArrayLowering1()
{
- createFile("MyBase","public class MyBase"
- + NL + "{"
- + NL + ""
- + NL + " public void myBaseLowerMethod(MyBase[][] b1, MyBase[][] b2)"
- + NL + " {"
- + NL + " }"
- + NL + "}"
+ createFile("MyBase","public class MyBase"
+ + NL + "{"
+ + NL + ""
+ + NL + " public void myBaseLowerMethod(MyBase[][] b1, MyBase[][] b2)"
+ + NL + " {"
+ + NL + " }"
+ + NL + "}"
+ NL);
createFile("MyTeam",
- "public team class MyTeam"
- + NL + "{"
- + NL + ""
- + NL + " public class Role playedBy MyBase"
+ "public team class MyTeam"
+ + NL + "{"
+ + NL + ""
+ + NL + " public class Role playedBy MyBase"
+ NL + " {"
- + NL + ""
+ + NL + ""
+ NL + " abstract void myLoweringCallout(Role[][] r1, Role[][] r2);"
- + NL + ""
+ + NL + ""
+ NL + " void myLoweringCallout(Role[][] r1, Role[][] r2) -> void myBaseLowerMethod(MyBase[][] r1, MyBase[][] r2);"
+ NL + " }"
+ NL + ""
+ NL + " public static void main(String[] args){"
+ NL + " new MyTeam();"
- + NL + " }"
+ + NL + " }"
+ NL + "}"
+ NL);
-
+
compileFile("MyTeam");
-
+
assertTrue(isCompilationSuccessful());
}
-
+
/**
* A test for lowering.
*/
- public void testLowering1()
+ public void testLowering1()
{
- createFile("MyBase","public class MyBase"
- + NL + "{"
- + NL + " public void myBaseMethod(int a)"
- + NL + " {"
- + NL + " System.out.println(\"normal\");"
+ createFile("MyBase","public class MyBase"
+ + NL + "{"
+ + NL + " public void myBaseMethod(int a)"
+ + NL + " {"
+ + NL + " System.out.println(\"normal\");"
+ NL + " }"
- + NL + ""
- + NL + " public int myBaseLowerMethod(MyBase b)"
- + NL + " {"
- + NL + " System.out.println(\"lowered\");"
+ + NL + ""
+ + NL + " public int myBaseLowerMethod(MyBase b)"
+ + NL + " {"
+ + NL + " System.out.println(\"lowered\");"
+ NL + " return 5;"
- + NL + " }"
- + NL + "}"
+ + NL + " }"
+ + NL + "}"
+ NL);
- createFile("MyBase2","public class MyBase2 extends MyBase"
- + NL + "{"
- + NL + " public void myBaseMethod(int a)"
- + NL + " {"
- + NL + " System.out.println(\"normal\");"
+ createFile("MyBase2","public class MyBase2 extends MyBase"
+ + NL + "{"
+ + NL + " public void myBaseMethod(int a)"
+ + NL + " {"
+ + NL + " System.out.println(\"normal\");"
+ NL + " }"
- + NL + ""
- + NL + " public int myBaseLowerMethod(MyBase b)"
- + NL + " {"
+ + NL + ""
+ + NL + " public int myBaseLowerMethod(MyBase b)"
+ + NL + " {"
+ NL + " System.out.println(\"lowered\");"
- + NL + " return 5;"
- + NL + " }"
- + NL + "}"
+ + NL + " return 5;"
+ + NL + " }"
+ + NL + "}"
+ NL);
-
+
createFile("MyTeam",
- "public team class MyTeam extends org.objectteams.Team"
- + NL + "{"
- + NL + " public MyTeam()"
- + NL + " {"
+ "public team class MyTeam extends org.objectteams.Team"
+ + NL + "{"
+ + NL + " public MyTeam()"
+ + NL + " {"
+ NL + " Role r = new Role(new MyBase());"
+ NL + " r.myCallout(4);"
+ NL + " }"
- + NL + ""
- + NL + " public class Role0"
+ + NL + ""
+ + NL + " public class Role0"
+ NL + " {"
- + NL + ""
+ + NL + ""
+ NL + " void myCallout(int a)"
- + NL + " {"
- + NL + " System.out.println(\"Hallo\");"
+ + NL + " {"
+ + NL + " System.out.println(\"Hallo\");"
+ NL + " }"
+ NL + " }"
- + NL + ""
- + NL + " public class Role extends Role0 playedBy MyBase"
+ + NL + ""
+ + NL + " public class Role extends Role0 playedBy MyBase"
+ NL + " {"
- + NL + ""
+ + NL + ""
+ NL + " abstract int myLoweringCallout(Role r);"
- + NL + ""
- + NL + " void myCallout(int a) => void myBaseMethod(int a);"
+ + NL + ""
+ + NL + " void myCallout(int a) => void myBaseMethod(int a);"
+ NL + " int myLoweringCallout(Role r) -> int myBaseLowerMethod(MyBase r);"
+ NL + " }"
+ NL + ""
- + NL + " public class Role2 playedBy MyBase2"
+ + NL + " public class Role2 playedBy MyBase2"
+ NL + " {"
+ NL + " }"
+ NL + ""
+ NL + " public static void main(String[] args){"
+ NL + " new MyTeam();"
- + NL + " }"
+ + NL + " }"
+ NL + "}"
+ NL);
-
+
compileFile("MyTeam");
-
+
assertTrue(isCompilationSuccessful());
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/ParameterMappingsTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/ParameterMappingsTest.java
index af9d8177e..d19b6995d 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/ParameterMappingsTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/ParameterMappingsTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -25,7 +25,7 @@ import org.eclipse.objectteams.otdt.tests.compiler.TestBase;
/**
* This class contains tests concerning the parameter mappings in callin and
- * callout bindings.
+ * callout bindings.
*
* @author brcan
* @version $Id: ParameterMappingsTest.java 23494 2010-02-05 23:06:44Z stephan $
@@ -47,13 +47,13 @@ public class ParameterMappingsTest extends TestBase
" public int baseMethod() { return 2; } \r\n"+
"} \r\n"
);
-
+
createFile("SuperRoleClass",
"public class SuperRoleClass { \r\n"+
" public int roleMethod() { return 1000; } \r\n"+
"} \r\n"
);
-
+
createFile("MyTeam",
"public team class MyTeam { \r\n"+
" protected class MyRole extends SuperRoleClass playedBy MyBase { \r\n"+
@@ -63,10 +63,10 @@ public class ParameterMappingsTest extends TestBase
" } \r\n"+
"} \r\n"
);
-
+
compileFile("MyTeam");
-
- assertTrue(isCompilationSuccessful());
+
+ assertTrue(isCompilationSuccessful());
}
/**
@@ -79,7 +79,7 @@ public class ParameterMappingsTest extends TestBase
" public void baseMethod(boolean valueB) {} \r\n"+
"} \r\n"
);
-
+
createFile("MyTeam",
"public team class MyTeam { \r\n"+
" protected class MyRole playedBy MyBase { \r\n"+
@@ -90,10 +90,10 @@ public class ParameterMappingsTest extends TestBase
" } \r\n"+
"} \r\n"
);
-
+
compileFile("MyTeam");
-
- assertTrue(isCompilationSuccessful());
+
+ assertTrue(isCompilationSuccessful());
}
/**
@@ -106,7 +106,7 @@ public class ParameterMappingsTest extends TestBase
" public void baseMethod(float valueB) {} \r\n"+
"} \r\n"
);
-
+
createFile("MyTeam",
"public team class MyTeam { \r\n"+
" protected class MyRole playedBy MyBase { \r\n"+
@@ -118,12 +118,12 @@ public class ParameterMappingsTest extends TestBase
" } \r\n"+
"} \r\n"
);
-
+
compileFile("MyTeam");
-
- assertTrue(isCompilationSuccessful());
+
+ assertTrue(isCompilationSuccessful());
}
-
+
/**
* A base method with a parameter list is used in a callout binding.
*/
@@ -135,7 +135,7 @@ public class ParameterMappingsTest extends TestBase
" } \r\n"+
"} \r\n"
);
-
+
createFile("MyTeam",
"public team class MyTeam{ \r\n"+
" protected class MyRole playedBy MyBase { \r\n"+
@@ -147,10 +147,10 @@ public class ParameterMappingsTest extends TestBase
" } \r\n"+
"} \r\n"
);
-
+
compileFile("MyTeam");
-
- assertTrue(isCompilationSuccessful());
+
+ assertTrue(isCompilationSuccessful());
}
/**
@@ -164,7 +164,7 @@ public class ParameterMappingsTest extends TestBase
" } \r\n"+
"} \r\n"
);
-
+
createFile("MyTeam",
"public team class MyTeam{ \r\n"+
" protected class MyRole playedBy MyBase { \r\n"+
@@ -176,16 +176,16 @@ public class ParameterMappingsTest extends TestBase
" } \r\n"+
"} \r\n"
);
-
+
compileFile("MyTeam");
-
+
assertTrue(isCompilationSuccessful());
}
/**
* Broken callin-binding:
- * the base-method's argument list is different from the one in the binding declaration.
+ * the base-method's argument list is different from the one in the binding declaration.
*/
public void testCallinParameterMappingList2()
{
@@ -195,7 +195,7 @@ public class ParameterMappingsTest extends TestBase
" } \r\n"+
"} \r\n"
);
-
+
createFile("MyTeam",
"public team class MyTeam{ \r\n"+
" protected class MyRole playedBy MyBase { \r\n"+
@@ -208,9 +208,9 @@ public class ParameterMappingsTest extends TestBase
" } \r\n"+
"} \r\n"
);
-
+
compileFile("MyTeam");
-
+
assertFalse(isCompilationSuccessful());
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/ParserTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/ParserTest.java
index b62c24bc9..beebbf9e4 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/ParserTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/ParserTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -50,7 +50,7 @@ public class ParserTest extends TestBase
+ NL + " public static void main(String[] args)"
+ NL + " {"
+ NL + " MyClass baseObj = new MyClass();"
- + NL + " MyTeam teamInstance = new MyTeam();"
+ + NL + " MyTeam teamInstance = new MyTeam();"
+ NL + " within(teamInstance)"
+ NL + " {"
+ NL + " System.out.println();"
@@ -59,20 +59,20 @@ public class ParserTest extends TestBase
+ NL + " }"
+ NL + " }"
+ NL + "}");
-
+
createFile("MyClass",
"public class MyClass "
+ NL + "{"
+ NL + " public void say(String msg)"
+ NL + " {"
+ NL + " System.out.println(\" MyBase says : \" + msg);"
- + NL + " }"
+ + NL + " }"
+ NL + " public void whisper(String msg)"
+ NL + " {"
+ NL + " System.out.println(\" MyBase whispers : \" + msg);"
+ NL + " }"
- + NL + "}");
-
+ + NL + "}");
+
createFile("MyTeam",
"public team class MyTeam"
+ NL + "{"
@@ -97,12 +97,12 @@ public class ParserTest extends TestBase
+ NL + " role.whisper(msg);"
+ NL + " }"
+ NL + "}");
-
+
compileFile("Main");
assertTrue(isCompilationSuccessful());
}
-
+
public void testScopedKeywordJavadoc()
{
createFile("Main",
@@ -116,9 +116,9 @@ public class ParserTest extends TestBase
+ NL + " System.out.println(base);"
+ NL + " }"
+ NL + "}");
-
-
+
+
compileFile("Main");
assertTrue(isCompilationSuccessful());
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/RoleBaseInheritanceTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/RoleBaseInheritanceTest.java
index 2f4b2ac8e..b4e76e8db 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/RoleBaseInheritanceTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/RoleBaseInheritanceTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -26,7 +26,7 @@ import org.eclipse.objectteams.otdt.tests.compiler.TestBase;
/**
* Tests the relationship between role and base classes.
- *
+ *
* @author kaschja
* @version $Id: RoleBaseInheritanceTest.java 23494 2010-02-05 23:06:44Z stephan $
*/
@@ -40,7 +40,7 @@ public class RoleBaseInheritanceTest extends TestBase
/**
* A role class must not be bound to a non-existing base class.
*/
- public void testBindingOfNonExistingBaseClass1()
+ public void testBindingOfNonExistingBaseClass1()
{
createFile("MyTeam","public team class MyTeam " +
NL + "{ " +
@@ -48,27 +48,27 @@ public class RoleBaseInheritanceTest extends TestBase
NL + " { " +
NL + " } " +
NL + "}");
-
+
compileFile("MyTeam");
-
+
assertFalse(isCompilationSuccessful());
}
-
+
/**
- * A regular class (non-team) must not be bound to a base class.
+ * A regular class (non-team) must not be bound to a base class.
*/
public void testBindingRegularClassWithBaseClass1()
{
createFile("MyBase","public class MyBase {}");
-
+
createFile("MyClass","public class MyClass " +
NL + "{" +
NL + " class MyRole playedBy MyBase {}" +
NL + "}");
-
- compileFile("MyClass");
-
- assertFalse(isCompilationSuccessful());
+
+ compileFile("MyClass");
+
+ assertFalse(isCompilationSuccessful());
}
/**
@@ -83,12 +83,12 @@ public class RoleBaseInheritanceTest extends TestBase
NL + " { " +
NL + " } " +
NL + "}");
-
+
compileFile("MyTeam");
-
- assertFalse(isCompilationSuccessful());
+
+ assertFalse(isCompilationSuccessful());
}
-
+
/**
* A role class must not be bound to an array.
* In this testing sample the array element type is the primitive type int.
@@ -101,12 +101,12 @@ public class RoleBaseInheritanceTest extends TestBase
NL + " { " +
NL + " } " +
NL + "}");
-
+
compileFile("MyTeam");
-
- assertFalse(isCompilationSuccessful());
+
+ assertFalse(isCompilationSuccessful());
}
-
+
/**
* A role class must not be bound to an array.
* In this testing sample the array element type is a class type.
@@ -114,20 +114,20 @@ public class RoleBaseInheritanceTest extends TestBase
public void testBindingOfArrayType2()
{
createFile("MyBase", "public class MyBase{}");
-
+
createFile("MyTeam","public team class MyTeam " +
NL + "{ " +
NL + " class MyRole playedBy MyBase[] " +
NL + " { " +
NL + " } " +
NL + "}");
-
+
compileFile("MyTeam");
-
- assertFalse(isCompilationSuccessful());
+
+ assertFalse(isCompilationSuccessful());
}
-
-
+
+
/**
* A role class must not be bound to a base class
* if both classes have identical names
@@ -136,21 +136,21 @@ public class RoleBaseInheritanceTest extends TestBase
public void testBindingWithNamingClash1()
{
createFile("Role", "public class Role{}");
-
+
createFile("MyTeam","public team class MyTeam " +
NL + "{ " +
NL + " class Role playedBy Role " +
NL + " { " +
NL + " } " +
NL + "}");
-
+
compileFile("MyTeam");
-
- assertFalse(isCompilationSuccessful());
+
+ assertFalse(isCompilationSuccessful());
}
-
-//TODO fix problem with creating packages with method TestBase.createFile
+
+//TODO fix problem with creating packages with method TestBase.createFile
/**
* A role class must not be bound to a base class
* if both classes have identical names
@@ -159,7 +159,7 @@ public class RoleBaseInheritanceTest extends TestBase
// public void testBindingWithNamingClash2()
// {
// createFile("basepackage/Role", "package basepackage;\npublic class Role{}");
-//
+//
// createFile("teampackage/MyTeam",
// "package teampackage;" +
// NL + "public team class MyTeam " +
@@ -168,12 +168,12 @@ public class RoleBaseInheritanceTest extends TestBase
// NL + " { " +
// NL + " } " +
// NL + "}");
-//
+//
// compileFile("MyTeam");
-//
-// assertFalse(isCompilationSuccessful());
-// }
-
+//
+// assertFalse(isCompilationSuccessful());
+// }
+
/**
* A role class must not be bound to a base class
* if there is another role in the same team
@@ -182,7 +182,7 @@ public class RoleBaseInheritanceTest extends TestBase
public void testBindingWithNamingClash3()
{
createFile("RoleB", "public class RoleB{}");
-
+
createFile("MyTeam","public team class MyTeam " +
NL + "{ " +
NL + " class RoleA playedBy RoleB" +
@@ -190,13 +190,13 @@ public class RoleBaseInheritanceTest extends TestBase
NL + " } " +
NL + " class RoleB" +
NL + " { " +
- NL + " } " +
+ NL + " } " +
NL + "}");
-
+
compileFile("MyTeam");
-
- assertFalse(isCompilationSuccessful());
- }
+
+ assertFalse(isCompilationSuccessful());
+ }
/**
* A role class must not be bound to a base class
@@ -211,21 +211,21 @@ public class RoleBaseInheritanceTest extends TestBase
NL + "{ " +
NL + " class RoleB" +
NL + " { " +
- NL + " } " +
+ NL + " } " +
NL + "}");
-
+
createFile("Subteam","public team class Subteam extends Superteam" +
NL + "{ " +
NL + " class RoleA playedBy RoleB" +
NL + " { " +
- NL + " } " +
+ NL + " } " +
NL + "}");
-
+
compileFile("Subteam");
-
- assertFalse(isCompilationSuccessful());
- }
-
+
+ assertFalse(isCompilationSuccessful());
+ }
+
/**
* A role class must not be bound to a base class
* if there is a role in a subteam
@@ -234,23 +234,23 @@ public class RoleBaseInheritanceTest extends TestBase
public void testBindingWithNamingClash5()
{
createFile("RoleB", "public class RoleB{}");
-
+
createFile("Superteam","public team class Superteam " +
NL + "{ " +
NL + " class RoleA playedBy RoleB" +
NL + " { " +
- NL + " } " +
+ NL + " } " +
NL + "}");
-
+
createFile("Subteam","public team class Subteam extends Superteam" +
NL + "{ " +
NL + " class RoleB" +
NL + " { " +
- NL + " } " +
- NL + "}");
+ NL + " } " +
+ NL + "}");
compileFile("Subteam");
-
- assertFalse(isCompilationSuccessful());
- }
+
+ assertFalse(isCompilationSuccessful());
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/RoleContainmentTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/RoleContainmentTest.java
index df391f985..b9f111c01 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/RoleContainmentTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/RoleContainmentTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -26,12 +26,12 @@ import org.eclipse.objectteams.otdt.tests.compiler.TestBase;
/**
* This class contains tests concerning roles.
- *
+ *
* @author kaschja
* @version $Id: RoleContainmentTest.java 23494 2010-02-05 23:06:44Z stephan $
*/
public class RoleContainmentTest extends TestBase
-{
+{
public RoleContainmentTest(String testName)
{
super(testName);
@@ -40,18 +40,18 @@ public class RoleContainmentTest extends TestBase
/**
* A role that is not declared as abstract contains an abstract method.
* Comment:
- * A role has to be declared as abstract if it contains an abstract method.
+ * A role has to be declared as abstract if it contains an abstract method.
*/
- public void testAbstractMethodInNonAbstractRole1()
+ public void testAbstractMethodInNonAbstractRole1()
{
createFile("MyTeam","public team class MyTeam { " +
NL + " protected class MyRole {" +
NL + " public abstract void roleMethod();" +
NL + " }"+
NL + "}");
-
+
compileFile("MyTeam");
-
+
assertTrue(hasExpectedProblems(new int[] { IProblem.AbstractMethodsInConcreteClass, IProblem.AbstractMethodInAbstractClass } ));
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/RoleInheritanceTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/RoleInheritanceTest.java
index 2175df2a9..423e73782 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/RoleInheritanceTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/RoleInheritanceTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -25,7 +25,7 @@ import org.eclipse.objectteams.otdt.tests.compiler.TestBase;
/**
* This class contains tests concerning role inheritance.
- *
+ *
* @author kaschja
* @version $Id: RoleInheritanceTest.java 23494 2010-02-05 23:06:44Z stephan $
*/
@@ -36,98 +36,98 @@ public class RoleInheritanceTest extends TestBase
super(testName);
}
- /**
+ /**
* A role extends explicitly a role of a foreign team (non-superteam).
* Both roles have the same name.
- * Comment:
+ * Comment:
* A role can only extend explicitly another role of the same team.
*/
- public void testRoleExtendsRoleWithSameNameOfForeignTeam1()
+ public void testRoleExtendsRoleWithSameNameOfForeignTeam1()
{
createFile("TeamA","public team class TeamA " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class Role {} " +
NL + "}");
-
+
createFile("TeamB","public team class TeamB " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class Role extends TeamA.Role {} " +
NL + "}");
-
+
compileFile("TeamB");
-
+
assertFalse(isCompilationSuccessful());
}
-
+
/**
* A role extends explicitly a role of a foreign team (non-superteam).
- * Comment:
+ * Comment:
* A role can only extend explicitly another role of the same team.
*/
- public void testRoleExtendsRoleOfForeignTeam1()
+ public void testRoleExtendsRoleOfForeignTeam1()
{
createFile("TeamA","public team class TeamA " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class RoleA {} " +
NL + "}");
-
+
createFile("TeamB","public team class TeamB " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class RoleB extends TeamA.RoleA {} " +
NL + "}");
-
+
compileFile("TeamB");
-
+
assertFalse(isCompilationSuccessful());
}
-
+
/**
* A role inherits implicitly and explicitly a role from the superteam.
* Comment:
* A role may not inherit a role explicitly if it is already inherited
* implicitly from the superteam (by name-matching).
- */
+ */
public void testRoleInheritsRoleImplicitlyAndExplicitlyFromSuperTeam1()
{
createFile("TeamA","public team class TeamA " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class Role {} " +
NL + "}");
-
+
createFile("TeamB","public team class TeamB extends TeamA" +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class Role extends TeamA.Role {} " +
NL + "}");
-
+
compileFile("TeamB");
-
+
assertFalse(isCompilationSuccessful());
}
-
+
/**
* A role inherits from an external class.
- */
+ */
public void testRoleExtendsExternalClass1()
{
createFile("MyClass","public class MyClass " +
- NL + "{ " +
+ NL + "{ " +
NL + "}");
-
+
createFile("Team","public team class Team " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class Role extends MyClass {} " +
NL + "}");
-
+
compileFile("Team");
-
+
assertTrue(isCompilationSuccessful());
}
-
+
/**
* A role inherits explicitly from an abstract role.
* It does not implement the abstract methods.
* Comment:
- * A role has to implement the abstract methods if it extends
+ * A role has to implement the abstract methods if it extends
* an abstract role.
*/
public void testRoleInheritsExplicitlyFromAbstractRole1()
@@ -140,15 +140,15 @@ public class RoleInheritanceTest extends TestBase
NL + "}");
compileFile("MyTeam");
-
+
assertFalse(isCompilationSuccessful());
}
-
+
/**
* A role inherits implicitly from an abstract role.
* It does not implement the abstract methods.
* Comment:
- * A role has to implement the abstract methods of the implicitly
+ * A role has to implement the abstract methods of the implicitly
* inherited abstract role.
*/
public void testRoleInheritsImplicitlyFromAbstractRole1()
@@ -158,17 +158,17 @@ public class RoleInheritanceTest extends TestBase
NL + " public abstract void roleMethod();" +
NL + " }" +
NL + "}");
-
+
createFile("TeamB","public team class TeamB extends TeamA " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class RoleA {} " +
NL + "}");
compileFile("TeamB");
-
+
assertFalse(isCompilationSuccessful());
}
-
+
/**
* An implicitly inherited role inherits explicitly from an external class.
* The super-role does not extend any class.
@@ -176,24 +176,24 @@ public class RoleInheritanceTest extends TestBase
public void testImplicitInheritedRoleExtendsExternalClass1()
{
createFile("ExternalClass","public class ExternalClass " +
- NL + "{ " +
+ NL + "{ " +
NL + "}");
createFile("TeamA","public team class TeamA " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class Role {} " +
NL + "}");
-
+
createFile("TeamB","public team class TeamB extends TeamA" +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class Role extends ExternalClass {} " +
NL + "}");
-
+
compileFile("TeamB");
-
+
assertTrue(isCompilationSuccessful());
}
-
+
/**
* An implicitly inherited role inherits explicitly from an external class.
* The super-role extends a different class than the sub-role.
@@ -204,28 +204,28 @@ public class RoleInheritanceTest extends TestBase
public void testImplicitInheritedRoleExtendsExternalClass2()
{
createFile("ExternalClass","public class ExternalClass " +
- NL + "{ " +
+ NL + "{ " +
NL + "}");
createFile("DifferentClass","public class DifferentClass " +
- NL + "{ " +
+ NL + "{ " +
NL + "}");
-
+
createFile("TeamA","public team class TeamA " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class Role extends DifferentClass {} " +
NL + "}");
-
+
createFile("TeamB","public team class TeamB extends TeamA" +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class Role extends ExternalClass {} " +
NL + "}");
-
+
compileFile("TeamB");
-
+
assertFalse(isCompilationSuccessful());
}
-
+
/**
* A sub-role has a restricted visibility compared to the super-role.
* Comment:
@@ -235,17 +235,17 @@ public class RoleInheritanceTest extends TestBase
public void testRestrictedVisibilityOfSubRole1()
{
createFile("TeamA","public team class TeamA " +
- NL + "{ " +
+ NL + "{ " +
NL + " public class Role {} " +
NL + "}");
-
+
createFile("TeamB","public team class TeamB extends TeamA" +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class Role {} " +
NL + "}");
-
+
compileFile("TeamB");
-
+
assertFalse(isCompilationSuccessful());
}
@@ -259,21 +259,21 @@ public class RoleInheritanceTest extends TestBase
public void testRestrictedVisibilityOfMethodInSubRole1()
{
createFile("TeamA","public team class TeamA " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class Role {" +
NL + " public void roleMethod() {};" +
NL + " }" +
NL + "}");
-
+
createFile("TeamB","public team class TeamB extends TeamA" +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class Role {" +
NL + " private void roleMethod() {};" +
NL + " }" +
NL + "}");
-
+
compileFile("TeamB");
-
+
assertFalse(isCompilationSuccessful());
}
@@ -295,26 +295,26 @@ public class RoleInheritanceTest extends TestBase
NL + "{" +
NL + " public void doTransfer();" +
NL + "}");
-
+
createFile("TeamA","public team class TeamA " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class Role implements IState, ITransfer " +
NL + " {" +
NL + " public IState getState() {}" +
NL + " public void doTransfer() {}" +
NL + " }" +
NL + "}");
-
+
createFile("TeamB","public team class TeamB extends TeamA" +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class Role implements IState " +
NL + " {" +
NL + " public IState getState() {}" +
NL + " }" +
NL + "}");
-
+
compileFile("TeamB");
-
+
assertFalse(isCompilationSuccessful());
}
@@ -333,26 +333,26 @@ public class RoleInheritanceTest extends TestBase
NL + "{" +
NL + " public void doTransfer();" +
NL + "}");
-
+
createFile("TeamA","public team class TeamA " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class Role implements IState" +
NL + " {" +
NL + " public IState getState() { return null; }" +
NL + " }" +
NL + "}");
-
+
createFile("TeamB","public team class TeamB extends TeamA" +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class Role implements IState, ITransfer " +
NL + " {" +
NL + " public IState getState() { return tsuper.getState(); }" +
NL + " public void doTransfer() {}" +
NL + " }" +
NL + "}");
-
+
compileFile("TeamB");
-
+
assertTrue(isCompilationSuccessful());
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/SourceSnippetRecoveryTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/SourceSnippetRecoveryTest.java
index 92f93dea0..ec372deee 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/SourceSnippetRecoveryTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/SourceSnippetRecoveryTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -27,11 +27,11 @@ import org.eclipse.objectteams.otdt.tests.compiler.TestBase;
/**
* This class contains tests concerning source code snippets, or wrong code.
- *
+ *
* @author Markus Witte
*/
public class SourceSnippetRecoveryTest extends TestBase {
-
+
public SourceSnippetRecoveryTest(String testName)
{
super(testName);
@@ -47,10 +47,10 @@ public class SourceSnippetRecoveryTest extends TestBase {
NL + "{ " +
NL + " baseMethod <- met1, met2;" +
NL + "} ");
-
-
+
+
compileFile("MyClass");
-
+
assertTrue(hasExpectedProblems(new int[] {IProblem.ParsingErrorMergeTokens})); // silly but factual
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/TeamActivationTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/TeamActivationTest.java
index 34354e646..5fb6fd31a 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/TeamActivationTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/TeamActivationTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -27,10 +27,10 @@ import org.eclipse.objectteams.otdt.tests.compiler.TestBase;
/**
* This class is for testing team activation.
* Note, test cases which tried to test sequences of activation statements are removed,
- * because
- * (a) this can only be tested when also executing the program, and
- * (b) test goals stated in comments were wrong.
- *
+ * because
+ * (a) this can only be tested when also executing the program, and
+ * (b) test goals stated in comments were wrong.
+ *
* @author kaschja
* @version $Id: TeamActivationTest.java 23494 2010-02-05 23:06:44Z stephan $
*/
@@ -40,13 +40,13 @@ public class TeamActivationTest extends TestBase
{
super(testName);
}
-
+
/**
* team activation with "within" must have team as argument
*/
public void testWithinWithTeamAsArgument() {
createFile("MyTeam","public team class MyTeam {}");
-
+
createFile("MyClient","public class MyClient"+
NL + "{"+
NL + " public static void main(String[] argv) {"+
@@ -58,7 +58,7 @@ public class TeamActivationTest extends TestBase
NL + "}");
compileFile("MyClient");
-
+
assertTrue(isCompilationSuccessful());
}
/**
@@ -66,7 +66,7 @@ public class TeamActivationTest extends TestBase
*/
public void testWithinWithRegularClassAsArgument() {
createFile("MyClass","public class MyClass {}");
-
+
createFile("MyClient","public class MyClient"+
NL + "{"+
NL + " public static void main(String[] argv) {"+
@@ -78,8 +78,8 @@ public class TeamActivationTest extends TestBase
NL + "}");
compileFile("MyClient");
-
+
assertTrue(hasExpectedProblems(new int[] {IProblem.WithinStatementNeedsTeamInstance}));
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/TeamContainmentTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/TeamContainmentTest.java
index a736c0343..4197a871b 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/TeamContainmentTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/TeamContainmentTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -32,7 +32,7 @@ import org.eclipse.objectteams.otdt.tests.compiler.TestBase;
/**
* This class contains tests concerning team inheritance.
- *
+ *
* @author kaschja
* @version $Id: TeamContainmentTest.java 23494 2010-02-05 23:06:44Z stephan $
*/
@@ -43,106 +43,106 @@ public class TeamContainmentTest extends TestBase
super(testName);
}
- /* An empty team with no package statement should compile without
- * problems.
+ /* An empty team with no package statement should compile without
+ * problems.
*/
- public void testEmptyTeam1()
+ public void testEmptyTeam1()
{
createFile("MyTeam","public team class MyTeam " +
- NL + "{ " +
+ NL + "{ " +
NL + "}");
-
+
compileFile("MyTeam");
-
+
assertTrue(isCompilationSuccessful());
}
- /* An empty team with a specific package statement should compile without
- * problems.
+ /* An empty team with a specific package statement should compile without
+ * problems.
*/
- public void testEmptyTeam2()
+ public void testEmptyTeam2()
{
- createFile("MyTeam","package teams;" +
+ createFile("MyTeam","package teams;" +
NL + "public team class MyTeam " +
- NL + "{ " +
+ NL + "{ " +
NL + "}");
-
+
compileFile("teams"+File.separator+"MyTeam");
-
+
assertTrue(isCompilationSuccessful());
}
-
- /* An empty team with a specific package statement should compile without
- * problems.
+
+ /* An empty team with a specific package statement should compile without
+ * problems.
*/
- public void testEmptyTeam3()
+ public void testEmptyTeam3()
{
- createFile("MyTeam","" + "package pkg1.pkg2.pkg3;" +
+ createFile("MyTeam","" + "package pkg1.pkg2.pkg3;" +
NL + "public team class MyTeam " +
- NL + "{ " +
+ NL + "{ " +
NL + "}");
-
+
compileFile("pkg1"+File.separator+"pkg2"+File.separator+"pkg3"+File.separator+"MyTeam");
-
+
assertTrue(isCompilationSuccessful());
}
- /**
+ /**
* A team that is not declared as abstract contains an abstract role.
* Comment:
* A team has to be declared as abstract if it contains an abstract relevant role.
* For the notion of "relevant roles" see OT lang.def. 7.1(c) (SH).
*/
- public void testAbstractRoleInNonAbstractTeam1()
+ public void testAbstractRoleInNonAbstractTeam1()
{
// TODO (SH): differentiate relevant/irrelevant roles (s.above).
createFile("MyTeam","public team class MyTeam " +
- NL + "{ " +
+ NL + "{ " +
NL + " abstract protected class MyRole " +
NL + " {" +
NL + " abstract void roleMethod();" +
- NL + " }" +
+ NL + " }" +
NL + "}");
-
+
compileFile("MyTeam");
-
+
assertTrue(isCompilationSuccessful());
}
-
+
/**
- * A team that is not declared as abstract contains an abstract
+ * A team that is not declared as abstract contains an abstract
* team-level method.
* Comment:
* A team has to be declared as abstract if it contains an abstract
* team-level method.
*/
- public void testAbstractMethodInNonAbstractTeam1()
+ public void testAbstractMethodInNonAbstractTeam1()
{
createFile("MyTeam","public team class MyTeam " +
- NL + "{ " +
- NL + " abstract void teamMethod();" +
+ NL + "{ " +
+ NL + " abstract void teamMethod();" +
NL + "}");
-
+
compileFile("MyTeam");
-
+
assertTrue(hasExpectedProblems(new int[]{ IProblem.AbstractMethodsInConcreteClass, IProblem.AbstractMethodInAbstractClass}));
}
-
- public void testRoleLackingJavadoc1()
+
+ public void testRoleLackingJavadoc1()
{
createFile("MyBase","/** Comment for MyBase. */" +
- NL + "public class MyBase " +
- NL + "{ " +
+ NL + "public class MyBase " +
+ NL + "{ " +
NL + "}");
-
+
createFile("MyTeam","/** Comment for MyTeam. */" +
- NL + "public team class MyTeam " +
- NL + "{ " +
+ NL + "public team class MyTeam " +
+ NL + "{ " +
NL + " public class MyRole playedBy MyBase" +
NL + " {" +
- NL + " }" +
+ NL + " }" +
NL + "}");
-
+
Map<String,String> options= new HashMap<String,String>();
options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
@@ -153,25 +153,25 @@ public class TeamContainmentTest extends TestBase
options.put(CompilerOptions.OPTION_ReportMissingJavadocComments, CompilerOptions.ERROR);
compileFile("MyTeam", null, options);
-
+
assertTrue(hasExpectedProblems(new int[]{ IProblem.JavadocMissing})); // reported only once!
}
-
- public void testRoleLackingJavadoc2()
+
+ public void testRoleLackingJavadoc2()
{
createFile("MyBase","/** Comment for MyBase. */" +
- NL + "public class MyBase " +
- NL + "{ " +
+ NL + "public class MyBase " +
+ NL + "{ " +
NL + "}");
-
+
createFile("MyTeam","/** Comment for MyTeam. */" +
- NL + "public team class MyTeam " +
- NL + "{ " +
+ NL + "public team class MyTeam " +
+ NL + "{ " +
NL + " protected class MyRole playedBy MyBase" +
NL + " {" +
- NL + " }" +
+ NL + " }" +
NL + "}");
-
+
Map<String,String> options= new HashMap<String,String>();
options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
@@ -182,7 +182,7 @@ public class TeamContainmentTest extends TestBase
options.put(CompilerOptions.OPTION_ReportMissingJavadocComments, CompilerOptions.ERROR);
compileFile("MyTeam", null, options);
-
+
assertTrue(isCompilationSuccessful());
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/TeamInheritanceTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/TeamInheritanceTest.java
index 7b9b77b5a..0947db8f3 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/TeamInheritanceTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/TeamInheritanceTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -26,7 +26,7 @@ import org.eclipse.objectteams.otdt.tests.compiler.TestBase;
/**
* This class contains tests concerning team inheritance.
- *
+ *
* @author kaschja
* @version $Id: TeamInheritanceTest.java 23494 2010-02-05 23:06:44Z stephan $
*/
@@ -41,18 +41,18 @@ public class TeamInheritanceTest extends TestBase
* A team class inherits from a non-team class.
* Comment:
* This is legal since Trac #144.
- */
- public void testTeamInheritance1()
+ */
+ public void testTeamInheritance1()
{
createFile("OrdinaryClass","public class OrdinaryClass {}");
-
+
createFile("MyTeam","public team class MyTeam extends OrdinaryClass {}");
-
+
compileFile("MyTeam");
-
+
assertTrue(isCompilationSuccessful());
}
-
+
/**
* A regular class (non-team class) inherits from a team class.
* Comment:
@@ -61,15 +61,15 @@ public class TeamInheritanceTest extends TestBase
public void testInvalidTeamInheritance2()
{
createFile("MyTeam","public team class MyTeam {}");
-
+
createFile("MyClass","public class MyClass extends MyTeam {}");
-
+
compileFile("MyClass");
-
+
assertFalse(isCompilationSuccessful());
}
- /**
+ /**
* A team class inherits from an abstract team class.
* It does not implement the inherited abstract method.
* Comment:
@@ -78,61 +78,61 @@ public class TeamInheritanceTest extends TestBase
public void testNotImplementedAbstractMethod1()
{
createFile("Superteam","public abstract team class Superteam " +
- NL + "{ " +
+ NL + "{ " +
NL + " abstract void teamMethod(); " +
NL + "}");
-
+
createFile("Subteam","public team class Subteam extends Superteam" +
- NL + "{ " +
+ NL + "{ " +
NL + "}");
-
+
compileFile("Subteam");
-
- assertFalse(isCompilationSuccessful());
+
+ assertFalse(isCompilationSuccessful());
}
-
- /**
+
+ /**
* A team class contains a role class.
* Another team class that inherits from this team, does not have to
* contain the inherited role explicitly.
- */
+ */
public void testImplicitInheritance1()
{
createFile("Superteam","public team class Superteam " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class Role {}; " +
NL + "}");
-
+
createFile("Subteam","public team class Subteam extends Superteam" +
- NL + "{ " +
+ NL + "{ " +
NL + "}");
-
+
compileFile("Superteam");
-
- assertTrue(isCompilationSuccessful());
+
+ assertTrue(isCompilationSuccessful());
}
-
- /**
+
+ /**
* @see testImplicitInheritance1
* additional instantiation of inherited role
- */
+ */
public void testImplicitInheritance2()
{
createFile("Superteam","public team class Superteam " +
- NL + "{ " +
+ NL + "{ " +
NL + " protected class Role {}; " +
NL + "}");
-
+
createFile("Subteam","public team class Subteam extends Superteam" +
NL + "{ " +
NL + " Role _myRole = new Role(); " +
NL + "}");
-
+
compileFile("Superteam");
-
- assertTrue(isCompilationSuccessful());
+
+ assertTrue(isCompilationSuccessful());
}
-
+
public void testMissingOTRE1() {
createFile("T",
"import static org.objectteams.Team.ALL_THREADS;\n" +
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/TestAll.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/TestAll.java
index e00fd4b68..ec273804f 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/TestAll.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/errorreporting/TestAll.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -35,7 +35,7 @@ public class TestAll extends TestSuite
{
super();
}
-
+
public static TestSuite suite()
{
TestSuite suite = new TestSuite("All Compiler Tests");
@@ -66,8 +66,8 @@ public class TestAll extends TestSuite
suite.addTestSuite(SourceSnippetRecoveryTest.class);
//External Role tests
suite.addTestSuite(ExternalRoleTest.class);
-
-
+
+
return suite;
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/AbstractSourceMapGeneratorTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/AbstractSourceMapGeneratorTest.java
index df33b9e51..ca78d1260 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/AbstractSourceMapGeneratorTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/AbstractSourceMapGeneratorTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2014 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany, and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -67,15 +67,15 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
*/
public abstract class AbstractSourceMapGeneratorTest extends FileBasedModelTest implements ICallbackClient, ISourceElementRequestor
{
-
+
public static final String COMPLIANCE_1_3 = "1.3";
public static final String COMPLIANCE_1_4 = "1.4";
public static final String COMPLIANCE_1_5 = "1.5";
-
+
private String complianceLevel = COMPLIANCE_1_5;
protected String[] classpaths;
protected Hashtable <String, List<SmapStratum>>expectedStrata;
-
+
protected String TYPENAME;
protected String _enclosingTypename;
@@ -83,12 +83,12 @@ public abstract class AbstractSourceMapGeneratorTest extends FileBasedModelTest
public static long sourceLevel = ClassFileConstants.JDK1_5; //$NON-NLS-1$
public static String OUTPUT_DIR = Util.getOutputDirectory() + File.separator + "smaptest";
-
+
private WeavingScheme weavingScheme = WeavingScheme.OTRE; // FIXME: test OTDRE, too!
-
+
// the source line within method Team.java:__OT__Confined._OT$getTeam().
public static int OT_CONFINED_GET_TEAM_LINE = IOOTBreakPoints.LINE_ConfinedGetTeam;
-
+
public AbstractSourceMapGeneratorTest(String testName)
{
super(testName);
@@ -110,7 +110,7 @@ public abstract class AbstractSourceMapGeneratorTest extends FileBasedModelTest
setTestProjectDir("JSR-045");
super.setUpSuite();
}
-
+
protected void setUp() throws Exception
{
super.setUp();
@@ -169,7 +169,7 @@ public abstract class AbstractSourceMapGeneratorTest extends FileBasedModelTest
options.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.PRESERVE);
options.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.PRESERVE);
options.put(CompilerOptions.OPTION_ReportUnnecessaryElse, CompilerOptions.WARNING);
-
+
return new CompilerOptions(options);
}
@@ -206,7 +206,7 @@ public abstract class AbstractSourceMapGeneratorTest extends FileBasedModelTest
{
return new DefaultProblemFactory(Locale.getDefault());
}
-
+
/**
* @param team
* @param role
@@ -220,10 +220,10 @@ public abstract class AbstractSourceMapGeneratorTest extends FileBasedModelTest
{
return parseAndCompile(units, methodLineNumbers, null, null);
}
- public boolean parseAndCompile(org.eclipse.jdt.core.ICompilationUnit[] units,
+ public boolean parseAndCompile(org.eclipse.jdt.core.ICompilationUnit[] units,
HashMap<String, int[]> methodLineNumbers,
String[] classPaths,
- String outputPath)
+ String outputPath)
throws JavaModelException
{
CompilerOptions options = getCompilerOptions();
@@ -231,21 +231,21 @@ public abstract class AbstractSourceMapGeneratorTest extends FileBasedModelTest
new DefaultProblemFactory(Locale.getDefault()),
options, false, false);
ICompilationUnit [] cUnits = new ICompilationUnit[units.length];
-
+
for (int idx = 0; idx < units.length; idx++)
{
org.eclipse.jdt.core.ICompilationUnit unit = units[idx];
-
+
String unit_src = unit.getSource();
IResource unit_res = unit.getCorrespondingResource();
String unit_fileName = unit_res.toString();
char[] unit_source = unit_src.toCharArray();
ICompilationUnit unit_sourceUnit = new CompilationUnit(unit_source,
unit_fileName, null);
-
+
CompilationUnitDeclaration cuDecl = parser.parseCompilationUnit(
unit_sourceUnit, true, null);
-
+
if (cuDecl.hasErrors()) {
// approximated error reporting:
String expectedErrorlog = "Filename : L/JSR-045/src/"+unit_fileName+"\n" +
@@ -256,10 +256,10 @@ public abstract class AbstractSourceMapGeneratorTest extends FileBasedModelTest
assertEquals("COMPILATION FAILED. Errorlog should be empty.", expectedErrorlog, actualErrorlog);
return false;
}
-
+
cUnits[idx] = unit_sourceUnit;
- }
-
+ }
+
Requestor requestor = new Requestor(
false,
null, /*no custom requestor */
@@ -285,27 +285,27 @@ public abstract class AbstractSourceMapGeneratorTest extends FileBasedModelTest
} catch (IOException ioex) {
throw new JavaModelException(ioex, IJavaModelStatusConstants.INVALID_CLASSPATH);
}
-
+
batchCompiler.addCallBack(this);
-
+
batchCompiler.compile(cUnits); // compile all files together
-
+
boolean hasErrors = requestor.hasErrors;
-
+
//errorlog contains errore and warnings, skip warnings
if (hasErrors)
{
String expectedErrorlog = "";
String actualErrorlog = requestor.problemLog;
assertEquals("COMPILATION FAILED. Errorlog should be empty.", expectedErrorlog, actualErrorlog);
- }
+ }
if (methodLineNumbers != null)
requestor.checkAllLineNumbersSeen();
-
+
return !hasErrors;
}
-
+
public void acceptConstructorReference(char[] typeName, int argCount, int sourcePosition)
{
}
@@ -326,10 +326,10 @@ public abstract class AbstractSourceMapGeneratorTest extends FileBasedModelTest
{
}
- public void acceptPackage(ImportReference importReference)
+ public void acceptPackage(ImportReference importReference)
{
}
-
+
public void acceptProblem(IProblem problem)
{
}
@@ -398,10 +398,10 @@ public abstract class AbstractSourceMapGeneratorTest extends FileBasedModelTest
{
}
- public void exitMethod(int declarationEnd, Expression defaultValue)
+ public void exitMethod(int declarationEnd, Expression defaultValue)
{
}
-
+
public void acceptBaseReference(char[][] typeName, int sourceStart, int sourceEnd)
{
}
@@ -440,87 +440,87 @@ public abstract class AbstractSourceMapGeneratorTest extends FileBasedModelTest
public void acceptProblem(CategorizedProblem problem) {
// TODO Auto-generated method stub
-
+
}
public void enterConstructor(MethodInfo methodInfo) {
// TODO Auto-generated method stub
-
+
}
public void enterField(FieldInfo fieldInfo) {
// TODO Auto-generated method stub
-
+
}
public void enterMethod(MethodInfo methodInfo) {
// TODO Auto-generated method stub
-
+
}
public void enterType(TypeInfo typeInfo) {
// TODO Auto-generated method stub
-
+
}
public void exitMethod(int declarationEnd, int defaultValueStart, int defaultValueEnd) {
// TODO Auto-generated method stub
-
+
}
public void exitType(int declarationEnd) {
// TODO Auto-generated method stub
-
+
}
public void acceptImport(int declarationStart, int declarationEnd, char[][] tokens, boolean onDemand, int modifiers) {
// TODO Auto-generated method stub
-
+
}
-
+
public void acceptAnnotationTypeReference(char[][] annotation,
int sourceStart, int sourceEnd) {
// TODO Auto-generated method stub
-
+
}
public void acceptAnnotationTypeReference(char[] annotation,
int sourcePosition) {
// TODO Auto-generated method stub
-
+
}
-
- public void acceptImport(int declarationStart, int declarationEnd, int nameStart, int nameEnd, char[][] tokens,
+
+ public void acceptImport(int declarationStart, int declarationEnd, int nameStart, int nameEnd, char[][] tokens,
boolean onDemand, int modifiers) {
// TODO Auto-generated method stub
-
+
}
public void callback(CompilationUnitDeclaration cuDecl) {
String cuDeclName = String.valueOf(cuDecl.getMainTypeName());
if (!_enclosingTypename.equals(cuDeclName))
return;
-
-
+
+
TypeDeclaration typeDecl = cuDecl.types[0];
-
+
assertNotNull("TypeDeclaration should not be null.", typeDecl);
-
+
assertTrue("Membertypes of TypeDeclaration should be greater than 0.", typeDecl.memberTypes.length > 0);
-
+
TypeDeclaration [] members = typeDecl.memberTypes;
for (int idx = 0; idx < members.length; idx++)
{
TypeDeclaration decl = members[idx];
String typeName = String.valueOf(decl.name);
-
+
if (decl.isRole() && !decl.isInterface() && typeName.equals(TYPENAME))
{
RoleSmapGenerator rolefileSmapGenerator = new RoleSmapGenerator(decl);
rolefileSmapGenerator.addStratum("OTJ");
rolefileSmapGenerator.generate();
List actualStrata = rolefileSmapGenerator.getStrata();
-
+
assertEquals("Strata of type \"" + typeName + "\" should be equal.\n", expectedStrata.get(typeName).toString(), actualStrata.toString());
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/AllTests.java
index 366bd0862..8eb39345c 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/AllTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/BaseClassSmapGenerationMethodTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/BaseClassSmapGenerationMethodTest.java
index b2341f8c1..70fd1dc96 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/BaseClassSmapGenerationMethodTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/BaseClassSmapGenerationMethodTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -32,22 +32,22 @@ import junit.framework.TestCase;
*/
public class BaseClassSmapGenerationMethodTest extends TestCase
{
-
+
public void testMethod001()
{
String baseClassFileName = "SimpleClass$1" ;
- String baseClassSourceUnit = "path/to/SimpleClass";
+ String baseClassSourceUnit = "path/to/SimpleClass";
int endlineNumber = 3;
Hashtable<String, int[][]> mappings = new Hashtable<String, int[][]>();
int lineMappings[][] = new int[2][3];
lineMappings[0] = new int[]{2,2,7};
lineMappings[1] = new int[]{3,0,8};
-
+
mappings.put("path/to/TeamA.java", lineMappings);
-
+
int baseMapping [][] = null;
-
- String expectedString =
+
+ String expectedString =
"SMAP" + "\n" +
"SimpleClass$1.class" + "\n" +
"OTJ" + "\n" +
@@ -63,28 +63,28 @@ public class BaseClassSmapGenerationMethodTest extends TestCase
"3#1:8" + "\n" +
"*E"
;
-
+
byte actual[] = generateSMAP(baseClassFileName, baseClassSourceUnit, endlineNumber, mappings, baseMapping);
-
+
String actualString = new String(actual);
-
+
assertEquals("SMAP should be equal.", expectedString, actualString);
}
-
+
public void testMethod002()
{
String baseClassFileName = "SimpleClass$1" ;
- String baseClassSourceUnit = "SimpleClass";
+ String baseClassSourceUnit = "SimpleClass";
int endlineNumber = 3;
Hashtable<String, int[][]> mappings = new Hashtable<String, int[][]>();
int lineMappings[][] = new int[2][3];
lineMappings[0] = new int[]{2,2,7};
lineMappings[1] = new int[]{3,0,8};
-
+
mappings.put("TeamA.java", lineMappings);
-
+
int baseMapping [][] = null;
-
+
String expectedString =
"SMAP" + "\n" +
"SimpleClass$1.class" + "\n" +
@@ -98,24 +98,24 @@ public class BaseClassSmapGenerationMethodTest extends TestCase
"2#1,2:7" + "\n" +
"3#1:8" + "\n" +
"*E";
-
+
byte actual[] = generateSMAP(baseClassFileName, baseClassSourceUnit, endlineNumber, mappings, baseMapping);
-
+
String actualString = new String(actual);
-
+
assertEquals("SMAP should be equal.", expectedString, actualString);
-
- }
-
+
+ }
+
public void testMethod003()
{
String baseClassFileName = "SimpleClass$1" ;
- String baseClassSourceUnit = "SimpleClass";
+ String baseClassSourceUnit = "SimpleClass";
int endlineNumber = 3;
Hashtable<String, int[][]> mappings = new Hashtable<String, int[][]>();
-
+
int baseMapping [][] = null;
-
+
String expectedString =
"SMAP" + "\n" +
"SimpleClass$1.class" + "\n" +
@@ -126,19 +126,19 @@ public class BaseClassSmapGenerationMethodTest extends TestCase
"*L" + "\n" +
"1#1,3:1" + "\n" +
"*E";
-
+
byte actual[] = generateSMAP(baseClassFileName, baseClassSourceUnit, endlineNumber, mappings, baseMapping);
-
+
String actualString = new String(actual);
-
+
assertEquals("SMAP should be equal.", expectedString, actualString);
-
+
}
-
+
public void testMethod004()
{
String baseClassFileName = "BaseClass" ;
- String baseClassSourceUnit = "very/very/long/path/to/BaseClass";
+ String baseClassSourceUnit = "very/very/long/path/to/BaseClass";
int endlineNumber = 50;
Hashtable<String, int[][]> mappings = new Hashtable<String, int[][]>();
int lineMappings1[][] = new int[7][3];
@@ -149,19 +149,19 @@ public class BaseClassSmapGenerationMethodTest extends TestCase
lineMappings1[4] = new int[]{35,0,40};
lineMappings1[5] = new int[]{42,3,45};
lineMappings1[6] = new int[]{125,0,250};
-
+
mappings.put("path/to/TeamB.java", lineMappings1);
-
+
int lineMappings2[][] = new int[4][3];
lineMappings2[0] = new int[]{8,0,3};
lineMappings2[1] = new int[]{16,1,9};
lineMappings2[2] = new int[]{24,0,12};
lineMappings2[3] = new int[]{32,5,15};
-
+
mappings.put("very/long/path/to/TeamA.java", lineMappings1);
-
+
int baseMapping [][] = null;
-
+
String expectedString =
"SMAP" + "\n" +
"BaseClass.class" + "\n" +
@@ -189,30 +189,30 @@ public class BaseClassSmapGenerationMethodTest extends TestCase
"42#2,3:45" + "\n" +
"43#3,8:43" + "\n" +
"125#2:250" + "\n" +
- "*E";
-
+ "*E";
+
byte actual[] = generateSMAP(baseClassFileName, baseClassSourceUnit, endlineNumber, mappings, baseMapping);
-
+
String actualString = new String(actual);
-
+
assertEquals("SMAP should be equal.", expectedString, actualString);
-
+
}
-
+
public void testSMAPIsNull001()
{
String baseClassFileName = "SimpleClass$1" ;
String baseClassSourceUnit = "path/to/SimpleClass";
int endlineNumber = 3;
Hashtable<String, int[][]> mappings = null;
-
+
int baseMapping [][] = null;
-
+
byte actual[] = generateSMAP(baseClassFileName, baseClassSourceUnit, endlineNumber, mappings, baseMapping);
-
+
assertNull("No SMAP should be generated.", actual);
- }
-
+ }
+
public void testSMAPIsNull002()
{
String baseClassFileName = null;
@@ -223,14 +223,14 @@ public class BaseClassSmapGenerationMethodTest extends TestCase
lineMappings[0] = new int[]{2,2,7};
lineMappings[1] = new int[]{3,0,8};
mappings.put("path/to/TeamA.java", lineMappings);
-
+
int baseMapping[][] = null;
-
+
byte actual[] = generateSMAP(baseClassFileName, baseClassSourceUnit, endlineNumber, mappings, baseMapping);
-
+
assertNull("No SMAP should be generated.", actual);
- }
-
+ }
+
public void testSMAPIsNotNull001()
{
String baseClassFileName = "SimpleClass$1";
@@ -241,11 +241,11 @@ public class BaseClassSmapGenerationMethodTest extends TestCase
lineMappings[0] = new int[]{2,2,7};
lineMappings[1] = new int[]{3,0,8};
mappings.put("path/to/TeamA.java", lineMappings);
-
+
int baseMapping[][] = null;
-
+
byte actual[] = generateSMAP(baseClassFileName, baseClassSourceUnit, endlineNumber, mappings, baseMapping);
-
+
String expectedString =
"SMAP" + "\n" +
"SimpleClass$1.class" + "\n" +
@@ -260,14 +260,14 @@ public class BaseClassSmapGenerationMethodTest extends TestCase
"2#1,2:7" + "\n" +
"3#1:8" + "\n" +
"*E";
-
-
+
+
String actualString = new String(actual);
-
+
assertEquals("SMAP should be equal.", expectedString, actualString);
-
- }
-
+
+ }
+
public void testSMAPIsNotNull002()
{
String baseClassFileName = "pkg.subpkg.SimpleClass$1";
@@ -278,11 +278,11 @@ public class BaseClassSmapGenerationMethodTest extends TestCase
lineMappings[0] = new int[]{2,2,7};
lineMappings[1] = new int[]{3,0,8};
mappings.put("path/to/TeamA.java", lineMappings);
-
+
int baseMapping [][] = null;
-
+
byte actual[] = generateSMAP(baseClassFileName, baseClassSourceUnit, endlineNumber, mappings, baseMapping);
-
+
String expectedString =
"SMAP" + "\n" +
"SimpleClass$1.class" + "\n" +
@@ -298,15 +298,15 @@ public class BaseClassSmapGenerationMethodTest extends TestCase
"2#1,2:7" + "\n" +
"3#1:8" + "\n" +
"*E";
-
-
+
+
String actualString = new String(actual);
-
+
assertEquals("SMAP should be equal.", expectedString, actualString);
-
+
}
-
-
+
+
public void testSMAPBaseMappings()
{
String baseClassFileName = "path.to.SimpleClass";
@@ -317,14 +317,14 @@ public class BaseClassSmapGenerationMethodTest extends TestCase
lineMappings[0] = new int[]{2,2,7};
lineMappings[1] = new int[]{3,0,8};
mappings.put("path/to/TeamA.java", lineMappings);
-
+
int baseMapping[][] = new int[2][2];
baseMapping[0] = new int[]{10,1};
baseMapping[1] = new int[]{12,6};
byte actual[] = generateSMAP(baseClassFileName, baseClassSourceUnit, endlineNumber, mappings, baseMapping);
String actualString = new String(actual);
-
+
String expectedString =
"SMAP" + "\n" +
"SimpleClass.class" + "\n" +
@@ -345,40 +345,40 @@ public class BaseClassSmapGenerationMethodTest extends TestCase
"12#2:6" + "\n" +
"13#2,3:13" + "\n" +
"*E";
-
+
assertEquals("SMAP should be equal.", expectedString, actualString);
- }
-
+ }
+
///////////////////////////////////////////////////////////////////////////////////////
//// THIS METHOD IS TESTED ////
///////////////////////////////////////////////////////////////////////////////////////
-
+
/** This method generates a SMAP for Baseclasses. This SMAP maps generated code for
- * callin bindings to theirs corresponding sourcecodepresentation.
- *
+ * callin bindings to theirs corresponding sourcecodepresentation.
+ *
* @param baseClassfileName - name of classfile this smap is generated for (e.g. pkg.subpkg.SimpleClass)
- * @param baseSourceunitName - path of sourceunit of corresponding baseclasstype,
- * (e.g path/to/SimpleClass);
+ * @param baseSourceunitName - path of sourceunit of corresponding baseclasstype,
+ * (e.g path/to/SimpleClass);
* if baseSourceunitName is not available name and path are generated from
* baseClassfileName
- *
+ *
* @param endlineNumber - this linenumber is the maximum linenumber of all entries in linenumbertables of all methods;
* it is not the endlinenumber of sourcefile.
- * @param mappings -
+ * @param mappings -
* String -> int[][]<br>
* key: path of Team or RoleFile sourceunit which has callins"<br>
* value: int-array with:<br> int[0][0] - inputstartline of callin<br>
- * int[0][1] - offset, if callin has more as one line(0 means one line, 1 means 2 lines, ...)<br>
- * int[0][2] - written linenumber in baseclasscode (linenumber of _OT$MyRole$roleMethod$baseMethod() call in chainMethod)<br>
+ * int[0][1] - offset, if callin has more as one line(0 means one line, 1 means 2 lines, ...)<br>
+ * int[0][2] - written linenumber in baseclasscode (linenumber of _OT$MyRole$roleMethod$baseMethod() call in chainMethod)<br>
* e.g.<br>
* path/to/Teamname.java -> <br>[9][0][16]<br> [20][2][18]
- *
+ *
* @param baseMappings - contains mappings to itself (int[][]):<br>
* int[0][0] - generated linenumber<br>
* int[0][1] - fixed linenumber (linenumber of e.g. signature of "_OT$xyz$orig(..)")
- *
+ *
* @return smap - the string which should be stored in Classfileattribute SourceDebugExtension
- *
+ *
* @author ike
*/
public byte[] generateSMAP(String baseClassfileName, String baseSourceunitName, int endlineNumber, Hashtable<String, int[][]> mappings, int baseMappings [][])
@@ -387,7 +387,7 @@ public class BaseClassSmapGenerationMethodTest extends TestCase
{
return null;
}
-
+
String OTJ_STRATUM_NAME = "OTJ";
String CLASS_ENDING = ".class";
String JAVA_ENDING = ".java";
@@ -396,7 +396,7 @@ public class BaseClassSmapGenerationMethodTest extends TestCase
String newBaseSourceunitName = null;
String absoluteBaseSourceunitName = null;
boolean baseSourceunitNameAvailable = (baseSourceunitName != null);
-
+
if (components.length > 1)
{
generatedFileName = components[components.length -1] + CLASS_ENDING;
@@ -414,88 +414,88 @@ public class BaseClassSmapGenerationMethodTest extends TestCase
{
String tmp[] = baseSourceunitName.split("/");
int index = tmp.length;
-
+
newBaseSourceunitName = tmp[index-1] + JAVA_ENDING;
-
+
if (tmp.length > 1)
{
- absoluteBaseSourceunitName = baseSourceunitName + JAVA_ENDING;
+ absoluteBaseSourceunitName = baseSourceunitName + JAVA_ENDING;
}
}
-
+
Hashtable<String, Integer> typeNameToFileId = new Hashtable<String, Integer>();
int fileSectionIdCounter = 1;
-
+
StringBuffer out = new StringBuffer();
-
+
// print Header
out.append("SMAP\n");
out.append(generatedFileName + "\n");
-
+
// print strata
out.append(OTJ_STRATUM_NAME+ "\n");
-
+
// begin StratumSection
out.append("*S " + OTJ_STRATUM_NAME + "\n");
-
+
// print FileSection
out.append("*F" + "\n");
-
+
for (Iterator<String> iter = mappings.keySet().iterator(); iter.hasNext();)
{
String fullqualifiedName = iter.next();
typeNameToFileId.put(fullqualifiedName, new Integer(fileSectionIdCounter));
-
+
// extract filename and absoluteFileName from typename
String tmp[] = fullqualifiedName.split("/");
int index = tmp.length;
-
+
String fileName = tmp[index-1];
String absoluteFileName = null;
-
+
typeNameToFileId.put(fileName, new Integer(fileSectionIdCounter));
-
+
if (tmp.length >= 2)
{
absoluteFileName = fullqualifiedName;
}
-
+
if (absoluteFileName != null)
{
out.append("+ " );
}
-
+
out.append(fileSectionIdCounter + " " + fileName + "\n");
-
+
if (absoluteFileName != null)
{
out.append(absoluteFileName + "\n");
}
-
+
fileSectionIdCounter++;
}
-
+
// add basename to smap
int baseClassFileId = -1;
typeNameToFileId.put(newBaseSourceunitName, new Integer(fileSectionIdCounter));
baseClassFileId = typeNameToFileId.get(newBaseSourceunitName).intValue();
-
+
if (absoluteBaseSourceunitName != null)
{
out.append("+ " );
}
-
+
out.append(baseClassFileId + " " + newBaseSourceunitName + "\n");
-
+
if (absoluteBaseSourceunitName != null)
{
out.append(absoluteBaseSourceunitName + "\n");
}
-
-
+
+
// print LineSection
out.append("*L" + "\n");
-
+
TreeMap<Integer, String> lineInfos = new TreeMap<Integer, String>();
StringBuffer lineBuffer = new StringBuffer();
for (Iterator<String> iter = mappings.keySet().iterator(); iter.hasNext();)
@@ -503,15 +503,15 @@ public class BaseClassSmapGenerationMethodTest extends TestCase
String typeName = iter.next();
int[][] linemappings = mappings.get(typeName);
int fileId = typeNameToFileId.get(typeName).intValue();
-
+
for (int idx = 0; idx < linemappings.length; idx++)
{
int[] singleLineMapping = linemappings[idx];
-
+
Integer inputStartLine = new Integer( singleLineMapping[0]);
int inputOffset = singleLineMapping[1];
int outputLine = singleLineMapping[2];
-
+
if (inputOffset == 0)
{
lineBuffer.append(inputStartLine.intValue());
@@ -525,12 +525,12 @@ public class BaseClassSmapGenerationMethodTest extends TestCase
lineBuffer.append("," + inputOffset);
lineBuffer.append(":" + outputLine + "\n");
}
-
+
lineInfos.put(inputStartLine, lineBuffer.toString());
lineBuffer.delete(0, lineBuffer.length());
}
}
-
+
//add given mappings to itself (basemappings)
if (baseMappings != null && baseMappings.length > 0)
{
@@ -542,13 +542,13 @@ public class BaseClassSmapGenerationMethodTest extends TestCase
lineBuffer.append(key);
lineBuffer.append("#" + baseClassFileId);
lineBuffer.append(":" + value + "\n");
-
+
lineInfos.put(new Integer(key), lineBuffer.toString());
lineBuffer.delete(0, lineBuffer.length());
}
}
-
- //add mappings to itself,
+
+ //add mappings to itself,
//endlinenumber is the maximum linenumber of all entries in linenumbertables of all methods;
//endlinenumber is not the endlinenumber of sourcefile, cause it is available at this time
TreeMap<Integer, int[]> baseToBaselineInfos = new TreeMap<Integer, int[]>();
@@ -572,40 +572,40 @@ public class BaseClassSmapGenerationMethodTest extends TestCase
}
}
}
-
- lineBuffer = new StringBuffer();
+
+ lineBuffer = new StringBuffer();
for (Iterator<Integer> iter = baseToBaselineInfos.keySet().iterator(); iter.hasNext();)
{
Integer key= iter.next();
int[] endValues = baseToBaselineInfos.get(key);
int inputStartLine = endValues[0];
int repeatCount = endValues[1];
-
+
lineBuffer.append(inputStartLine);
lineBuffer.append("#" + baseClassFileId);
-
+
if (repeatCount > 1)
lineBuffer.append("," + repeatCount);
-
+
lineBuffer.append(":" + inputStartLine + "\n");
lineInfos.put(new Integer(inputStartLine), lineBuffer.toString());
- lineBuffer.delete(0, lineBuffer.length());
+ lineBuffer.delete(0, lineBuffer.length());
}
-
-
+
+
for (Iterator<Integer> iter = lineInfos.keySet().iterator(); iter.hasNext();)
{
Integer inputStartline= iter.next();
String lineInfo = lineInfos.get(inputStartline);
-
+
out.append(lineInfo);
}
-
+
// print EndStratumSection
out.append("*E");
-
+
return out.toString().getBytes();
}
-
-
+
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumFlightbonusTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumFlightbonusTest.java
index 6541a870d..5e856d1d9 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumFlightbonusTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumFlightbonusTest.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2011 GK Software AG
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -56,7 +56,7 @@ public class OTJStratumFlightbonusTest extends AbstractSourceMapGeneratorTest {
@Override
protected IJavaProject setUpJavaProject(String projectName)
- throws CoreException, IOException
+ throws CoreException, IOException
{
IJavaProject javaProject = super.setUpJavaProject(projectName);
addLibraryEntry(javaProject, getLibPath(), true);
@@ -68,13 +68,13 @@ public class OTJStratumFlightbonusTest extends AbstractSourceMapGeneratorTest {
String absProjectPath = targetWorkspacePath + '/' + getTestProjectDir() ;
return absProjectPath+"/lib/booking.jar";
}
-
+
@Override
protected String[] getDefaultClassPaths() throws IOException {
String[] defaultClassPaths = super.getDefaultClassPaths();
int len = defaultClassPaths.length;
- System.arraycopy(defaultClassPaths, 0,
- defaultClassPaths = new String[len+1], 1,
+ System.arraycopy(defaultClassPaths, 0,
+ defaultClassPaths = new String[len+1], 1,
len);
defaultClassPaths[0] = getLibPath();
return defaultClassPaths;
@@ -117,12 +117,12 @@ public class OTJStratumFlightbonusTest extends AbstractSourceMapGeneratorTest {
lineInfo6.setRepeatCount(5);
LineInfo lineInfo7 = new LineInfo(33, 48); // method "initializeMessage"
lineInfo7.setRepeatCount(2);
-
+
fileInfoTSuper.addLineInfo(lineInfo4);
fileInfoTSuper.addLineInfo(lineInfo5);
fileInfoTSuper.addLineInfo(lineInfo6);
fileInfoTSuper.addLineInfo(lineInfo7);
-
+
LineInfo lineInfo1 = new LineInfo(15,15);
lineInfo1.setRepeatCount(26);
LineInfo lineInfo2 = new LineInfo(ISMAPConstants.STEP_INTO_LINENUMBER,ISMAPConstants.STEP_INTO_LINENUMBER);
@@ -131,13 +131,13 @@ public class OTJStratumFlightbonusTest extends AbstractSourceMapGeneratorTest {
fileInfo.addLineInfo(lineInfo1);
fileInfo.addLineInfo(lineInfo2);
fileInfo.addLineInfo(lineInfo3);
-
-
+
+
stratum_role1.optimize();
-
+
List<SmapStratum> strata_role1 = new ArrayList<SmapStratum>();
strata_role1.add(stratum_role1);
-
+
expectedStrata.put(TYPENAME, strata_role1);
try
@@ -172,12 +172,12 @@ public class OTJStratumFlightbonusTest extends AbstractSourceMapGeneratorTest {
fileInfo1.addLineInfo(lineInfo1);
fileInfo1.addLineInfo(lineInfo2);
fileInfo1.addLineInfo(lineInfo3);
-
+
stratum_role1.optimize();
-
+
List<SmapStratum> strata_role1 = new ArrayList<SmapStratum>();
strata_role1.add(stratum_role1);
-
+
expectedStrata.put(TYPENAME, strata_role1);
try
@@ -205,10 +205,10 @@ public class OTJStratumFlightbonusTest extends AbstractSourceMapGeneratorTest {
FileInfo fileInfo2 = stratum_role1.getOrCreateFileInfo("Subscriber.java", "org/eclipse/objectteams/example/fbapplication/FlightBonus/Subscriber.java");
LineInfo lineInfo4 = new LineInfo(7,75); // class header: position for liftTo method
LineInfo lineInfo5 = new LineInfo(12,76); // callin binding
-
+
fileInfo2.addLineInfo(lineInfo4);
fileInfo2.addLineInfo(lineInfo5);
-
+
FileInfo fileInfo1 = stratum_role1.getOrCreateFileInfo("FlightBonus.java", "org/eclipse/objectteams/example/fbapplication/FlightBonus.java");
LineInfo lineInfo1 = new LineInfo(1,1); // all lines of class FlightBonus
lineInfo1.setRepeatCount(74);
@@ -220,10 +220,10 @@ public class OTJStratumFlightbonusTest extends AbstractSourceMapGeneratorTest {
fileInfo1.addLineInfo(lineInfo3);
stratum_role1.optimize();
-
+
List<SmapStratum> strata_role1 = new ArrayList<SmapStratum>();
strata_role1.add(stratum_role1);
-
+
expectedStrata.put(TYPENAME, strata_role1);
try
@@ -247,12 +247,12 @@ public class OTJStratumFlightbonusTest extends AbstractSourceMapGeneratorTest {
_enclosingTypename = "FlightBonus";
SmapStratum stratum_role1 = new SmapStratum(ISMAPConstants.OTJ_STRATUM_NAME);
-
+
FileInfo fileInfo1 = stratum_role1.getOrCreateFileInfo("Subscriber.java", "org/eclipse/objectteams/example/fbapplication/FlightBonus/Subscriber.java");
// copy-inherited methods
FileInfo fileInfo2 = stratum_role1.getOrCreateFileInfo("Bonus.java", "org/eclipse/objectteams/example/bonussystem/Bonus.java");
-
+
LineInfo lineInfo4 = new LineInfo(39,21); // class header (e.g., _OT$getTeam())
LineInfo lineInfo6 = new LineInfo(44,30); // method getCollectedCredits
LineInfo lineInfo7 = new LineInfo(49,28); // method collectCredits
@@ -274,12 +274,12 @@ public class OTJStratumFlightbonusTest extends AbstractSourceMapGeneratorTest {
fileInfo1.addLineInfo(lineInfo1);
fileInfo1.addLineInfo(lineInfo2);
fileInfo1.addLineInfo(lineInfo3);
-
+
stratum_role1.optimize();
-
+
List<SmapStratum> strata_role1 = new ArrayList<SmapStratum>();
strata_role1.add(stratum_role1);
-
+
expectedStrata.put(TYPENAME, strata_role1);
try
@@ -298,7 +298,7 @@ public class OTJStratumFlightbonusTest extends AbstractSourceMapGeneratorTest {
super.callback(cuDecl);
} else {
TypeDeclaration typeDecl = cuDecl.types[0];
-
+
assertNotNull("TypeDeclaration should not be null.", typeDecl);
String typeName = new String(typeDecl.name);
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest001.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest001.java
index e24667c99..1809a3aaa 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest001.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest001.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -41,9 +41,9 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.smap.SmapStratum;
*/
public class OTJStratumGenerationTest001 extends AbstractSourceMapGeneratorTest
{
- private org.eclipse.jdt.core.ICompilationUnit _role;
+ private org.eclipse.jdt.core.ICompilationUnit _role;
private org.eclipse.jdt.core.ICompilationUnit _team;
-
+
public OTJStratumGenerationTest001(String name)
{
super(name);
@@ -53,7 +53,7 @@ public class OTJStratumGenerationTest001 extends AbstractSourceMapGeneratorTest
{
return buildModelTestSuite(OTJStratumGenerationTest001.class);
}
-
+
protected void setUp() throws Exception
{
super.setUp();
@@ -69,7 +69,7 @@ public class OTJStratumGenerationTest001 extends AbstractSourceMapGeneratorTest
"roleFile",
"TeamA.java");
}
-
+
public void testSimpleRoleSmapGeneration() throws JavaModelException
{
SmapStratum stratum = new SmapStratum(ISMAPConstants.OTJ_STRATUM_NAME);
@@ -81,15 +81,15 @@ public class OTJStratumGenerationTest001 extends AbstractSourceMapGeneratorTest
fileInfo.addLineInfo(lineInfo);
fileInfo.addLineInfo(lineInfo1);
fileInfo.addLineInfo(lineInfo2);
-
+
stratum.optimize();
-
+
TYPENAME = "__OT__RoleA";
List <SmapStratum>strata = new ArrayList<SmapStratum>();
strata.add(stratum);
-
+
expectedStrata.put(TYPENAME, strata);
-
+
try
{
parseAndCompile(new org.eclipse.jdt.core.ICompilationUnit[]{_team, _role});
@@ -99,31 +99,31 @@ public class OTJStratumGenerationTest001 extends AbstractSourceMapGeneratorTest
fail(e.getMessage());
}
}
-
+
public void callback(CompilationUnitDeclaration cuDecl)
{
TypeDeclaration typeDecl = cuDecl.types[0];
-
+
assertNotNull("TypeDeclaration should not be null.", typeDecl);
-
+
if (typeDecl.memberTypes == null)
{
return;
}
-
+
TypeDeclaration [] members = typeDecl.memberTypes;
for (int idx = 0; idx < members.length; idx++)
{
TypeDeclaration decl = members[idx];
String typeName = String.valueOf(decl.name);
-
+
if (decl.isRole() && !decl.isInterface() && typeName.equals(TYPENAME))
{
RoleSmapGenerator rolefileSmapGenerator = new RoleSmapGenerator(decl);
rolefileSmapGenerator.addStratum("OTJ");
rolefileSmapGenerator.generate();
List actualStrata = rolefileSmapGenerator.getStrata();
-
+
assertEquals("Strata of type \"" + typeName + "\" should be equal.\n", expectedStrata.get(typeName), actualStrata);
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest002.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest002.java
index a3ab98e05..8d319e805 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest002.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest002.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -40,10 +40,10 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.smap.SmapStratum;
*/
public class OTJStratumGenerationTest002 extends AbstractSourceMapGeneratorTest
{
- private org.eclipse.jdt.core.ICompilationUnit _subTeam;
+ private org.eclipse.jdt.core.ICompilationUnit _subTeam;
private org.eclipse.jdt.core.ICompilationUnit _superTeam;
private org.eclipse.jdt.core.ICompilationUnit _superSuperTeam;
-
+
public OTJStratumGenerationTest002(String name)
{
super(name);
@@ -53,11 +53,11 @@ public class OTJStratumGenerationTest002 extends AbstractSourceMapGeneratorTest
{
return buildModelTestSuite(OTJStratumGenerationTest002.class);
}
-
+
protected void setUp() throws Exception
{
super.setUp();
-
+
_subTeam = getCompilationUnit(
getTestProjectDir(),
"src",
@@ -82,17 +82,17 @@ public class OTJStratumGenerationTest002 extends AbstractSourceMapGeneratorTest
_enclosingTypename= "SubTeam";
expectedStrata.put(TYPENAME, createExpectedRoleAStratum(true /*fullSource*/));
-
+
HashMap<String, int[]> expectedMethodLineNumbers = createExpectedLines(11);
-
+
try
{
String outputPath = getWorkspaceRoot().getLocationURI().getPath()+"/"+getTestProjectDir()+"/bin";
- parseAndCompile(new org.eclipse.jdt.core.ICompilationUnit[]{_superSuperTeam, _superTeam, _subTeam},
+ parseAndCompile(new org.eclipse.jdt.core.ICompilationUnit[]{_superSuperTeam, _superTeam, _subTeam},
expectedMethodLineNumbers,
null/*classPaths*/,
outputPath); // need this so that class files are actually written for next phase
-
+
expectedStrata.put(TYPENAME, createExpectedRoleAStratum(false /*not fullSource*/));
expectedMethodLineNumbers = createExpectedLines(13);
@@ -101,7 +101,7 @@ public class OTJStratumGenerationTest002 extends AbstractSourceMapGeneratorTest
int oldLen = classPaths.length;
System.arraycopy(classPaths, 0, classPaths=new String[oldLen+1], 1, oldLen);
classPaths[0] = outputPath;
- parseAndCompile(new org.eclipse.jdt.core.ICompilationUnit[]{_subTeam},
+ parseAndCompile(new org.eclipse.jdt.core.ICompilationUnit[]{_subTeam},
expectedMethodLineNumbers,
classPaths, // needed for retrieving class files from previous phase
null/*outputPath*/);
@@ -113,7 +113,7 @@ public class OTJStratumGenerationTest002 extends AbstractSourceMapGeneratorTest
}
private HashMap<String, int[]> createExpectedLines(int l) {
- // consecutive synth lines, different start in source/binary settings
+ // consecutive synth lines, different start in source/binary settings
HashMap<String, int[]> expectedMethodLineNumbers = new HashMap<String, int[]>();
expectedMethodLineNumbers.put("copyInheritance.SubTeam$__OT__RoleA.roleMethod0(LcopyInheritance/SubTeam$TSuper__OT__SuperTeam;)V", new int[]{l++,l++,l++});
expectedMethodLineNumbers.put("copyInheritance.SubTeam$__OT__RoleA.roleMethod0(LcopyInheritance/SuperTeam$TSuper__OT__SuperSuperTeam;)V", new int[]{l++,l++});
@@ -124,9 +124,9 @@ public class OTJStratumGenerationTest002 extends AbstractSourceMapGeneratorTest
}
// helper for testSimpleCopyInheritanceSmapRoleA.
- //
+ //
List<SmapStratum> createExpectedRoleAStratum(boolean fullSource) {
-
+
SmapStratum stratum_role = new SmapStratum(ISMAPConstants.OTJ_STRATUM_NAME);
FileInfo fileInfo2 = stratum_role.getOrCreateFileInfo("SubTeam.java", "copyInheritance/SubTeam.java");
@@ -134,7 +134,7 @@ public class OTJStratumGenerationTest002 extends AbstractSourceMapGeneratorTest
lineInfo1_role2.setRepeatCount(6);
LineInfo lineInfo2_role2 = new LineInfo(ISMAPConstants.STEP_INTO_LINENUMBER,ISMAPConstants.STEP_INTO_LINENUMBER);
LineInfo lineInfo3_role2 = new LineInfo(ISMAPConstants.STEP_OVER_LINENUMBER,ISMAPConstants.STEP_OVER_LINENUMBER);
-
+
fileInfo2.addLineInfo(lineInfo1_role2);
fileInfo2.addLineInfo(lineInfo2_role2);
fileInfo2.addLineInfo(lineInfo3_role2);
@@ -146,10 +146,10 @@ public class OTJStratumGenerationTest002 extends AbstractSourceMapGeneratorTest
// methods declared in SuperSuperTeam.java (fileInfo0):
{4, 1}, // class position (4) (used by ctor and getTeam)
{8, 2}, // method roleMethod0 (8..)
- {12,4}, // method roleMethod1 (12,14,15) (repeat 4 despite the hole)
+ {12,4}, // method roleMethod1 (12,14,15) (repeat 4 despite the hole)
// methods declared in SuperTeam.java (fileInfo1):
{4, 1}, // class position (4) (used by ctor and getTeam)
- {8, 2}, // method roleMethod2 (8..)
+ {8, 2}, // method roleMethod2 (8..)
{11,3} // method roleMethod0 (11..)
};
// depending on the compilation mode, synthetic lines are assigned in different orders:
@@ -158,7 +158,7 @@ public class OTJStratumGenerationTest002 extends AbstractSourceMapGeneratorTest
} : new int[] {
0, 3, 5, 1, 2, 4
};
-
+
int line = 11;
for (int idx : order) {
LineInfo info = new LineInfo(lines[idx][0], line);
@@ -169,39 +169,39 @@ public class OTJStratumGenerationTest002 extends AbstractSourceMapGeneratorTest
else
fileInfo1.addLineInfo(info);
}
-
+
stratum_role.optimize();
List <SmapStratum>strata_role1 = new ArrayList<SmapStratum>();
strata_role1.add(stratum_role);
return strata_role1;
}
-
+
public void testSimpleCopyInheritanceSmapConfined()
{
SmapStratum stratum_role = new SmapStratum(ISMAPConstants.OTJ_STRATUM_NAME);
-
+
FileInfo fileInfo_role0 = stratum_role.getOrCreateFileInfo("Team.java", "org/objectteams/Team.java");
-
+
LineInfo lineInfo1_role0 = new LineInfo(OT_CONFINED_GET_TEAM_LINE, 5); // mapped line of _OT$getTeam() to synthetic line 5
fileInfo_role0.addLineInfo(lineInfo1_role0);
-
+
LineInfo lineInfo1_role1 = new LineInfo(2,4); // default ctor at team position (2) mapped to synthetic line 4
fileInfo_role0.addLineInfo(lineInfo1_role1);
-
+
// no contribution from SuperTeam$__OT__Confined
-
+
LineInfo lineInfo_role2 = new LineInfo(65533,65533);
lineInfo_role2.setRepeatCount(2);
-
+
fileInfo_role0.addLineInfo(lineInfo_role2);;
-
+
TYPENAME = "__OT__Confined";
_enclosingTypename= "SubTeam";
List <SmapStratum>strata_role_confined = new ArrayList<SmapStratum>();
strata_role_confined.add(stratum_role);
-
+
expectedStrata.put(TYPENAME, strata_role_confined);
-
+
HashMap<String, int[]> expectedMethodLineNumbers = new HashMap<String, int[]>();
expectedMethodLineNumbers.put("copyInheritance.SubTeam$__OT__Confined._OT$getTeam()Lorg/objectteams/ITeam;", new int[]{5});
@@ -214,31 +214,31 @@ public class OTJStratumGenerationTest002 extends AbstractSourceMapGeneratorTest
fail(e.getMessage());
}
}
-
+
public void testCopyInheritanceOutOfOrderStatements() {
SmapStratum stratum_role = new SmapStratum(ISMAPConstants.OTJ_STRATUM_NAME);
-
+
FileInfo fileInfo0 = stratum_role.getOrCreateFileInfo("SuperTeam2.java", "copyInheritance/SuperTeam2.java");
LineInfo lineInfo2_role0 = new LineInfo(8,4); // method (8) mapped to synthetic line 4..
lineInfo2_role0.setRepeatCount(5);
fileInfo0.addLineInfo(lineInfo2_role0);
LineInfo lineInfo1_role0 = new LineInfo(6,9); // class position (6) mapped to synthetic line 9
fileInfo0.addLineInfo(lineInfo1_role0);
-
+
LineInfo lineInfo2_role1 = new LineInfo(65533,65533);
lineInfo2_role1.setRepeatCount(2);
-
+
fileInfo0.addLineInfo(lineInfo2_role1);
-
+
TYPENAME = "__OT__R";
_enclosingTypename = "SubTeam2";
-
+
List <SmapStratum>strata_role = new ArrayList<SmapStratum>();
strata_role.add(stratum_role);
-
+
expectedStrata.put(TYPENAME, strata_role);
-
+
HashMap<String, int[]> expectedMethodLineNumbers = new HashMap<String, int[]>();
//expectedMethodLineNumbers.put("copyInheritance.SubTeam$__OT__Confined._OT$getTeam()Lorg/objectteams/Team;", new int[]{25});
@@ -250,7 +250,7 @@ public class OTJStratumGenerationTest002 extends AbstractSourceMapGeneratorTest
"src",
"copyInheritance",
"SuperTeam2.java");
-
+
ICompilationUnit subTeam = getCompilationUnit(
getTestProjectDir(),
"src",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest003.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest003.java
index 01f79b5bf..9d966c8c7 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest003.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest003.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -42,15 +42,15 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.smap.TeamSmapGenerato
*/
public class OTJStratumGenerationTest003 extends AbstractSourceMapGeneratorTest
{
- private org.eclipse.jdt.core.ICompilationUnit _team1;
+ private org.eclipse.jdt.core.ICompilationUnit _team1;
private org.eclipse.jdt.core.ICompilationUnit _team2;
private org.eclipse.jdt.core.ICompilationUnit _role;
private String _packagePath;
-
+
static {
// TESTS_NAMES = new String[] { "testSmapGeneration3" };
}
-
+
public OTJStratumGenerationTest003(String name)
{
super(name);
@@ -60,13 +60,13 @@ public class OTJStratumGenerationTest003 extends AbstractSourceMapGeneratorTest
{
return buildModelTestSuite(OTJStratumGenerationTest003.class);
}
-
+
protected void setUp() throws Exception
{
super.setUp();
-
+
_packagePath = "roleFileAndCopyInh";
-
+
_team1 = getCompilationUnit(
getTestProjectDir(),
"src",
@@ -78,42 +78,42 @@ public class OTJStratumGenerationTest003 extends AbstractSourceMapGeneratorTest
"src",
_packagePath,
"SuperTeam.java");
-
+
_role = getCompilationUnit(
getTestProjectDir(),
"src",
"roleFileAndCopyInh.SuperTeam",
"RoleA.java");
}
-
+
public void testSmapGeneration1() throws JavaModelException
{
-
+
TYPENAME = "__OT__RoleA";
_enclosingTypename = "SubTeam";
-
+
String roleFileSourceName = "RoleA.java";
-
+
SmapStratum stratum_role = new SmapStratum(ISMAPConstants.OTJ_STRATUM_NAME);
FileInfo fileInfo1 = stratum_role.getOrCreateFileInfo(
roleFileSourceName, _packagePath + "/" + "SuperTeam" + "/" + roleFileSourceName);
-
- LineInfo lineInfo2 = new LineInfo(9,1); // method roleMethod (9..) mapped to synthetic line 1.. (no own lines in SubTeam.RoleA).
+
+ LineInfo lineInfo2 = new LineInfo(9,1); // method roleMethod (9..) mapped to synthetic line 1.. (no own lines in SubTeam.RoleA).
lineInfo2.setRepeatCount(2);
- LineInfo lineInfo1 = new LineInfo(5,3); // role (5..) mapped to synthetic line 3
+ LineInfo lineInfo1 = new LineInfo(5,3); // role (5..) mapped to synthetic line 3
LineInfo lineInfo3 = new LineInfo(ISMAPConstants.STEP_INTO_LINENUMBER,ISMAPConstants.STEP_INTO_LINENUMBER);
LineInfo lineInfo4 = new LineInfo(ISMAPConstants.STEP_OVER_LINENUMBER,ISMAPConstants.STEP_OVER_LINENUMBER);
-
+
fileInfo1.addLineInfo(lineInfo1);
fileInfo1.addLineInfo(lineInfo2);
fileInfo1.addLineInfo(lineInfo3);
fileInfo1.addLineInfo(lineInfo4);
stratum_role.optimize();
-
+
List<SmapStratum> strata_role1 = new ArrayList<SmapStratum>();
strata_role1.add(stratum_role);
-
+
expectedStrata.put(TYPENAME, strata_role1);
try
@@ -125,7 +125,7 @@ public class OTJStratumGenerationTest003 extends AbstractSourceMapGeneratorTest
fail(e.getMessage());
}
}
-
+
public void testSmapGeneration2()
{
SmapStratum stratum_role = new SmapStratum(ISMAPConstants.OTJ_STRATUM_NAME);
@@ -133,25 +133,25 @@ public class OTJStratumGenerationTest003 extends AbstractSourceMapGeneratorTest
FileInfo fileInfo = stratum_role.getOrCreateFileInfo("Team.java", "org/objectteams/Team.java");
LineInfo lineInfo1 = new LineInfo(OT_CONFINED_GET_TEAM_LINE,7); // getTeam mapped to synthetic line 7
fileInfo.addLineInfo(lineInfo1);
-
+
LineInfo lineInfo2 = new LineInfo(3,6); // class position to first synthetic line 6
fileInfo.addLineInfo(lineInfo2);
-
+
// SubTeam$RoleA has no code, special line-nos are added to the previous fileInfo:
LineInfo lineInfo3 = new LineInfo(ISMAPConstants.STEP_INTO_LINENUMBER,ISMAPConstants.STEP_INTO_LINENUMBER);
LineInfo lineInfo4 = new LineInfo(ISMAPConstants.STEP_OVER_LINENUMBER,ISMAPConstants.STEP_OVER_LINENUMBER);
fileInfo.addLineInfo(lineInfo3);
fileInfo.addLineInfo(lineInfo4);
-
+
stratum_role.optimize();
-
+
TYPENAME = "__OT__Confined";
_enclosingTypename = "SubTeam";
List<SmapStratum> strata_role2 = new ArrayList<SmapStratum>();
strata_role2.add(stratum_role);
-
+
expectedStrata.put(TYPENAME, strata_role2);
-
+
try
{
parseAndCompile(new org.eclipse.jdt.core.ICompilationUnit[]{_team2, _team1, _role});
@@ -167,35 +167,35 @@ public class OTJStratumGenerationTest003 extends AbstractSourceMapGeneratorTest
TYPENAME = "SubTeam";
String subPackage = "bug316601";
_enclosingTypename = null;
-
+
String teamSourceName = "SubTeam.java";
String role2SourceName = "Role2.java";
-
+
SmapStratum stratum_subteam = new SmapStratum(ISMAPConstants.OTJ_STRATUM_NAME);
-
+
FileInfo fileInfo2 = stratum_subteam.getOrCreateFileInfo(
role2SourceName, _packagePath + '/' + subPackage + '/' + TYPENAME + '/' + role2SourceName);
-
+
LineInfo lineInfo3 = new LineInfo(3,17); // Role2 header (3) mapped to synthetic line 17 (for lifting)
-
+
fileInfo2.addLineInfo(lineInfo3);
-
-
+
+
FileInfo fileInfo1 = stratum_subteam.getOrCreateFileInfo(
teamSourceName, _packagePath + '/' + subPackage + '/' + teamSourceName);
-
+
LineInfo lineInfo1 = new LineInfo(1,1); // 16 lines of subteam verbatim
lineInfo1.setRepeatCount(16);
LineInfo lineInfo2 = new LineInfo(ISMAPConstants.STEP_INTO_LINENUMBER,ISMAPConstants.STEP_INTO_LINENUMBER);
lineInfo2.setRepeatCount(2);
-
+
fileInfo1.addLineInfo(lineInfo1);
fileInfo1.addLineInfo(lineInfo2);
stratum_subteam.optimize();
-
+
List<SmapStratum> strata_role1 = new ArrayList<SmapStratum>();
strata_role1.add(stratum_subteam);
-
+
expectedStrata.put(TYPENAME, strata_role1);
try
@@ -205,19 +205,19 @@ public class OTJStratumGenerationTest003 extends AbstractSourceMapGeneratorTest
"src",
_packagePath+'.'+subPackage,
"SuperTeam.java");
-
+
ICompilationUnit superRole1 = getCompilationUnit(
getTestProjectDir(),
"src",
_packagePath+'.'+subPackage+'.'+"SuperTeam",
"Role1.java");
-
+
ICompilationUnit subTeam = getCompilationUnit(
getTestProjectDir(),
"src",
_packagePath+'.'+subPackage,
"SubTeam.java");
-
+
ICompilationUnit subRole2 = getCompilationUnit(
getTestProjectDir(),
"src",
@@ -231,20 +231,20 @@ public class OTJStratumGenerationTest003 extends AbstractSourceMapGeneratorTest
fail(e.getMessage());
}
}
-
+
public void callback(CompilationUnitDeclaration cuDecl) {
if (_enclosingTypename != null) {
super.callback(cuDecl);
return;
}
- // testing the team itself
+ // testing the team itself
String cuDeclName = String.valueOf(cuDecl.getMainTypeName());
if (!TYPENAME.equals(cuDeclName))
return;
-
-
+
+
TypeDeclaration typeDecl = cuDecl.types[0];
-
+
assertNotNull("TypeDeclaration should not be null.", typeDecl);
assertTrue("TypeDeclaration should be a team.", typeDecl.isTeam());
@@ -253,7 +253,7 @@ public class OTJStratumGenerationTest003 extends AbstractSourceMapGeneratorTest
teamSmapGenerator.addStratum("OTJ");
teamSmapGenerator.generate();
List actualStrata = teamSmapGenerator.getStrata();
-
+
assertEquals("Strata of type \"" + TYPENAME + "\" should be equal.\n", expectedStrata.get(TYPENAME).toString(), actualStrata.toString());
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest004.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest004.java
index 343d1b25f..823fada11 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest004.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest004.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -38,11 +38,11 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.smap.SmapStratum;
*/
public class OTJStratumGenerationTest004 extends AbstractSourceMapGeneratorTest
{
- private org.eclipse.jdt.core.ICompilationUnit _team1;
+ private org.eclipse.jdt.core.ICompilationUnit _team1;
@SuppressWarnings("unused")
private org.eclipse.jdt.core.ICompilationUnit _team2;
private org.eclipse.jdt.core.ICompilationUnit _role;
-
+
public OTJStratumGenerationTest004(String name)
{
super(name);
@@ -52,11 +52,11 @@ public class OTJStratumGenerationTest004 extends AbstractSourceMapGeneratorTest
{
return buildModelTestSuite(OTJStratumGenerationTest004.class);
}
-
+
protected void setUp() throws Exception
{
super.setUp();
-
+
_team1 = getCompilationUnit(
getTestProjectDir(),
"src",
@@ -69,7 +69,7 @@ public class OTJStratumGenerationTest004 extends AbstractSourceMapGeneratorTest
"roleAndTeam.TeamA",
"RoleA.java");
}
-
+
public void testSmapGeneration1() throws JavaModelException
{
TYPENAME = "__OT__RoleA";
@@ -85,12 +85,12 @@ public class OTJStratumGenerationTest004 extends AbstractSourceMapGeneratorTest
fileInfo1.addLineInfo(lineInfo1);
fileInfo1.addLineInfo(lineInfo2);
fileInfo1.addLineInfo(lineInfo3);
-
+
stratum_role1.optimize();
-
+
List<SmapStratum> strata_role1 = new ArrayList<SmapStratum>();
strata_role1.add(stratum_role1);
-
+
expectedStrata.put(TYPENAME, strata_role1);
try
@@ -102,7 +102,7 @@ public class OTJStratumGenerationTest004 extends AbstractSourceMapGeneratorTest
fail(e.getMessage());
}
}
-
+
public void testSmapGeneration2()
{
TYPENAME = "__OT__Confined";
@@ -112,19 +112,19 @@ public class OTJStratumGenerationTest004 extends AbstractSourceMapGeneratorTest
FileInfo fileInfo1 = stratum_role2.getOrCreateFileInfo("Team.java", "org/objectteams/Team.java");
LineInfo lineInfo1 = new LineInfo(OT_CONFINED_GET_TEAM_LINE,4);
fileInfo1.addLineInfo(lineInfo1);
-
+
LineInfo lineInfo2 = new LineInfo(ISMAPConstants.STEP_INTO_LINENUMBER,ISMAPConstants.STEP_INTO_LINENUMBER);
LineInfo lineInfo3 = new LineInfo(ISMAPConstants.STEP_OVER_LINENUMBER,ISMAPConstants.STEP_OVER_LINENUMBER);
fileInfo1.addLineInfo(lineInfo2);
fileInfo1.addLineInfo(lineInfo3);
-
+
stratum_role2.optimize();
-
+
List<SmapStratum> strata_role2 = new ArrayList<SmapStratum>();
strata_role2.add(stratum_role2);
-
+
expectedStrata.put(TYPENAME, strata_role2);
-
+
try
{
parseAndCompile(new org.eclipse.jdt.core.ICompilationUnit[]{_team1, _role});
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest005.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest005.java
index 024eb3788..b1fce1c75 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest005.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest005.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -38,11 +38,11 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.smap.SmapStratum;
*/
public class OTJStratumGenerationTest005 extends AbstractSourceMapGeneratorTest
{
- private org.eclipse.jdt.core.ICompilationUnit _superTeam;
+ private org.eclipse.jdt.core.ICompilationUnit _superTeam;
private org.eclipse.jdt.core.ICompilationUnit _subTeam;
private org.eclipse.jdt.core.ICompilationUnit _baseClass;
-
-
+
+
public OTJStratumGenerationTest005(String name)
{
super(name);
@@ -52,11 +52,11 @@ public class OTJStratumGenerationTest005 extends AbstractSourceMapGeneratorTest
{
return buildModelTestSuite(OTJStratumGenerationTest005.class);
}
-
+
protected void setUp() throws Exception
{
super.setUp();
-
+
_superTeam = getCompilationUnit(
getTestProjectDir(),
"src",
@@ -68,14 +68,14 @@ public class OTJStratumGenerationTest005 extends AbstractSourceMapGeneratorTest
"src",
"callout",
"SubTeam.java");
-
+
_baseClass = getCompilationUnit(
getTestProjectDir(),
"src",
"callout",
"BaseClass.java");
}
-
+
public void testSmapGeneration1() throws JavaModelException
{
SmapStratum stratum_role1 = new SmapStratum(ISMAPConstants.OTJ_STRATUM_NAME);
@@ -88,14 +88,14 @@ public class OTJStratumGenerationTest005 extends AbstractSourceMapGeneratorTest
fileInfo_role1.addLineInfo(lineInfo1_role1);
fileInfo_role1.addLineInfo(lineInfo2);
fileInfo_role1.addLineInfo(lineInfo3);
-
+
stratum_role1.optimize();
-
+
TYPENAME = "__OT__RoleA";
_enclosingTypename = "SuperTeam";
List<SmapStratum> strata_role1 = new ArrayList<SmapStratum>();
strata_role1.add(stratum_role1);
-
+
expectedStrata.put(TYPENAME, strata_role1);
try
@@ -107,30 +107,30 @@ public class OTJStratumGenerationTest005 extends AbstractSourceMapGeneratorTest
fail(e.getMessage());
}
}
-
+
public void testSmapGeneration2()
{
SmapStratum stratum_role2 = new SmapStratum(ISMAPConstants.OTJ_STRATUM_NAME);;
-
+
FileInfo fileInfo = stratum_role2.getOrCreateFileInfo("Team.java", "org/objectteams/Team.java");
LineInfo lineInfo1 = new LineInfo(OT_CONFINED_GET_TEAM_LINE,3);
fileInfo.addLineInfo(lineInfo1);
-
+
// SubTeam$__OT__Confined has no code, special line-nos are added to the previous fileInfo:
LineInfo lineInfo2 = new LineInfo(ISMAPConstants.STEP_INTO_LINENUMBER,ISMAPConstants.STEP_INTO_LINENUMBER);
LineInfo lineInfo3 = new LineInfo(ISMAPConstants.STEP_OVER_LINENUMBER,ISMAPConstants.STEP_OVER_LINENUMBER);
fileInfo.addLineInfo(lineInfo2);
fileInfo.addLineInfo(lineInfo3);
-
+
stratum_role2.optimize();
-
+
TYPENAME = "__OT__Confined";
_enclosingTypename = "SuperTeam";
List<SmapStratum> strata_role2 = new ArrayList<SmapStratum>();
strata_role2.add(stratum_role2);
-
+
expectedStrata.put(TYPENAME, strata_role2);
-
+
try
{
parseAndCompile(new org.eclipse.jdt.core.ICompilationUnit[]{_baseClass, _superTeam, _subTeam});
@@ -140,11 +140,11 @@ public class OTJStratumGenerationTest005 extends AbstractSourceMapGeneratorTest
fail(e.getMessage());
}
}
-
+
public void testSmapGeneration3() throws JavaModelException
{
SmapStratum stratum_role1 = new SmapStratum(ISMAPConstants.OTJ_STRATUM_NAME);
-
+
FileInfo fileInfo1_role1 = stratum_role1.getOrCreateFileInfo("SuperTeam.java", "callout/SuperTeam.java");
LineInfo fileInfo1_lineInfo1 = new LineInfo(4,4);
LineInfo fileInfo1_lineInfo2 = new LineInfo(8,5);
@@ -157,12 +157,12 @@ public class OTJStratumGenerationTest005 extends AbstractSourceMapGeneratorTest
fileInfo1_role1.addLineInfo(fileInfo2_lineInfo4);
stratum_role1.optimize();
-
+
TYPENAME = "__OT__RoleA";
_enclosingTypename = "SubTeam";
List<SmapStratum> strata_role1 = new ArrayList<SmapStratum>();
strata_role1.add(stratum_role1);
-
+
expectedStrata.put(TYPENAME, strata_role1);
try
@@ -174,32 +174,32 @@ public class OTJStratumGenerationTest005 extends AbstractSourceMapGeneratorTest
fail(e.getMessage());
}
}
-
+
public void testSmapGeneration4()
{
SmapStratum stratum_role2 = new SmapStratum(ISMAPConstants.OTJ_STRATUM_NAME);
-
+
FileInfo fileInfo = stratum_role2.getOrCreateFileInfo("Team.java", "org/objectteams/Team.java");
LineInfo lineInfo1 = new LineInfo(OT_CONFINED_GET_TEAM_LINE,5);
fileInfo.addLineInfo(lineInfo1);
-
+
LineInfo lineInfo2 = new LineInfo(2,4);
fileInfo.addLineInfo(lineInfo2);
-
+
LineInfo lineInfo3 = new LineInfo(ISMAPConstants.STEP_INTO_LINENUMBER,ISMAPConstants.STEP_INTO_LINENUMBER);
LineInfo lineInfo4 = new LineInfo(ISMAPConstants.STEP_OVER_LINENUMBER,ISMAPConstants.STEP_OVER_LINENUMBER);
fileInfo.addLineInfo(lineInfo3);
- fileInfo.addLineInfo(lineInfo4);
-
+ fileInfo.addLineInfo(lineInfo4);
+
stratum_role2.optimize();
-
+
TYPENAME = "__OT__Confined";
_enclosingTypename = "SubTeam";
List<SmapStratum> strata_role2 = new ArrayList<SmapStratum>();
strata_role2.add(stratum_role2);
-
+
expectedStrata.put(TYPENAME, strata_role2);
-
+
try
{
parseAndCompile(new org.eclipse.jdt.core.ICompilationUnit[]{_baseClass, _superTeam, _subTeam});
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest006.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest006.java
index 1a0ed3cce..0fcabe402 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest006.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest006.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -38,11 +38,11 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.smap.SmapStratum;
*/
public class OTJStratumGenerationTest006 extends AbstractSourceMapGeneratorTest
{
- private org.eclipse.jdt.core.ICompilationUnit _superTeam;
+ private org.eclipse.jdt.core.ICompilationUnit _superTeam;
private org.eclipse.jdt.core.ICompilationUnit _subTeam;
private org.eclipse.jdt.core.ICompilationUnit _baseClass;
-
-
+
+
public OTJStratumGenerationTest006(String name)
{
super(name);
@@ -52,11 +52,11 @@ public class OTJStratumGenerationTest006 extends AbstractSourceMapGeneratorTest
{
return buildModelTestSuite(OTJStratumGenerationTest006.class);
}
-
+
protected void setUp() throws Exception
{
super.setUp();
-
+
_superTeam = getCompilationUnit(
getTestProjectDir(),
"src",
@@ -68,14 +68,14 @@ public class OTJStratumGenerationTest006 extends AbstractSourceMapGeneratorTest
"src",
"calloutOverride",
"SubTeam.java");
-
+
_baseClass = getCompilationUnit(
getTestProjectDir(),
"src",
"calloutOverride",
"BaseClass.java");
}
-
+
public void testSmapGeneration1() throws JavaModelException
{
TYPENAME = "__OT__RoleA";
@@ -93,9 +93,9 @@ public class OTJStratumGenerationTest006 extends AbstractSourceMapGeneratorTest
fileInfo_role1.addLineInfo(lineInfo1_role3);
List<SmapStratum> strata_role1 = new ArrayList<SmapStratum>();
strata_role1.add(stratum_role1);
-
+
stratum_role1.optimize();
-
+
expectedStrata.put(TYPENAME, strata_role1);
try
@@ -107,29 +107,29 @@ public class OTJStratumGenerationTest006 extends AbstractSourceMapGeneratorTest
fail(e.getMessage());
}
}
-
+
public void testSmapGeneration2()
{
SmapStratum stratum_role2 = new SmapStratum(ISMAPConstants.OTJ_STRATUM_NAME);
-
+
FileInfo fileinfo = stratum_role2.getOrCreateFileInfo("Team.java", "org/objectteams/Team.java");
LineInfo lineInfo1 = new LineInfo(OT_CONFINED_GET_TEAM_LINE,3);
fileinfo.addLineInfo(lineInfo1);
-
+
LineInfo lineInfo2 = new LineInfo(ISMAPConstants.STEP_INTO_LINENUMBER,ISMAPConstants.STEP_INTO_LINENUMBER);
LineInfo lineInfo3 = new LineInfo(ISMAPConstants.STEP_OVER_LINENUMBER,ISMAPConstants.STEP_OVER_LINENUMBER);
fileinfo.addLineInfo(lineInfo2);
fileinfo.addLineInfo(lineInfo3);
-
+
stratum_role2.optimize();
-
+
TYPENAME = "__OT__Confined";
_enclosingTypename = "SuperTeam";
List<SmapStratum> strata_role2 = new ArrayList<SmapStratum>();
strata_role2.add(stratum_role2);
-
+
expectedStrata.put(TYPENAME, strata_role2);
-
+
try
{
parseAndCompile(new org.eclipse.jdt.core.ICompilationUnit[]{_baseClass, _superTeam, _subTeam});
@@ -139,7 +139,7 @@ public class OTJStratumGenerationTest006 extends AbstractSourceMapGeneratorTest
fail(e.getMessage());
}
}
-
+
public void testSmapGeneration3() throws JavaModelException
{
TYPENAME = "__OT__RoleA";
@@ -154,7 +154,7 @@ public class OTJStratumGenerationTest006 extends AbstractSourceMapGeneratorTest
LineInfo lineInfo2 = new LineInfo(8,10); // anotherRoleMethod at synth line 10
lineInfo2.setRepeatCount(2);
LineInfo lineInfo3 = new LineInfo(4,12); // role ctor at synth line 12
-
+
fileInfo1.addLineInfo(lineInfo1);
fileInfo1.addLineInfo(lineInfo2);
fileInfo1.addLineInfo(lineInfo3);
@@ -167,12 +167,12 @@ public class OTJStratumGenerationTest006 extends AbstractSourceMapGeneratorTest
fileInfo2.addLineInfo(lineInfo4);
fileInfo2.addLineInfo(lineInfo7);
fileInfo2.addLineInfo(lineInfo8);
-
+
stratum_role1.optimize();
List<SmapStratum> strata_role1 = new ArrayList<SmapStratum>();
strata_role1.add(stratum_role1);
-
+
expectedStrata.put(TYPENAME, strata_role1);
try
@@ -184,32 +184,32 @@ public class OTJStratumGenerationTest006 extends AbstractSourceMapGeneratorTest
fail(e.getMessage());
}
}
-
+
public void testSmapGeneration4()
{
SmapStratum stratum_role2 = new SmapStratum(ISMAPConstants.OTJ_STRATUM_NAME);
-
+
FileInfo fileInfo = stratum_role2.getOrCreateFileInfo("Team.java", "org/objectteams/Team.java");
LineInfo lineInfo1 = new LineInfo(OT_CONFINED_GET_TEAM_LINE,4);
fileInfo.addLineInfo(lineInfo1);
-
+
LineInfo lineInfo2 = new LineInfo(2,3);
fileInfo.addLineInfo(lineInfo2);
-
+
LineInfo lineInfo3 = new LineInfo(ISMAPConstants.STEP_INTO_LINENUMBER,ISMAPConstants.STEP_INTO_LINENUMBER);
LineInfo lineInfo4 = new LineInfo(ISMAPConstants.STEP_OVER_LINENUMBER,ISMAPConstants.STEP_OVER_LINENUMBER);
fileInfo.addLineInfo(lineInfo3);
fileInfo.addLineInfo(lineInfo4);
-
+
stratum_role2.optimize();
-
+
TYPENAME = "__OT__Confined";
_enclosingTypename = "SubTeam";
List<SmapStratum> strata_role2 = new ArrayList<SmapStratum>();
strata_role2.add(stratum_role2);
-
+
expectedStrata.put(TYPENAME, strata_role2);
-
+
try
{
parseAndCompile(new org.eclipse.jdt.core.ICompilationUnit[]{_baseClass, _superTeam, _subTeam});
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest007.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest007.java
index bc80673f6..3b392eac1 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest007.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/OTJStratumGenerationTest007.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -38,7 +38,7 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.smap.SmapStratum;
/**
* @author ike
- *
+ *
*/
public class OTJStratumGenerationTest007 extends AbstractSourceMapGeneratorTest
{
@@ -74,14 +74,14 @@ public class OTJStratumGenerationTest007 extends AbstractSourceMapGeneratorTest
_packagePath = "callin_after_before";
_teamA = getCompilationUnit(
- getTestProjectDir(),
+ getTestProjectDir(),
"src",
_packagePath,
"TeamA.java");
_teamB = getCompilationUnit(
- getTestProjectDir(),
- "src",
+ getTestProjectDir(),
+ "src",
_packagePath,
"TeamB.java");
@@ -108,7 +108,7 @@ public class OTJStratumGenerationTest007 extends AbstractSourceMapGeneratorTest
LineInfo lineInfo1_role2 = new LineInfo(ISMAPConstants.STEP_INTO_LINENUMBER,ISMAPConstants.STEP_INTO_LINENUMBER);
LineInfo lineInfo1_role3 = new LineInfo(ISMAPConstants.STEP_OVER_LINENUMBER,ISMAPConstants.STEP_OVER_LINENUMBER);
-
+
fileInfo_role1.addLineInfo(lineInfo1_role1);
fileInfo_role1.addLineInfo(lineInfo1_role2);
fileInfo_role1.addLineInfo(lineInfo1_role3);
@@ -117,7 +117,7 @@ public class OTJStratumGenerationTest007 extends AbstractSourceMapGeneratorTest
strata_role1.add(stratum_role1);
stratum_role1.optimize();
-
+
expectedStrata.put(TYPENAME, strata_role1);
try
@@ -159,14 +159,14 @@ public class OTJStratumGenerationTest007 extends AbstractSourceMapGeneratorTest
fail(e.getMessage());
}
}
-
+
public void testSmapGeneration3() throws JavaModelException
{
TYPENAME = "__OT__RoleB";
_enclosingTypename = "TeamB";
String enclTypeSourceName = _enclosingTypename + ".java";
_buildPartially = false;
-
+
SmapStratum stratum_role1 = new SmapStratum(
ISMAPConstants.OTJ_STRATUM_NAME);
FileInfo fileInfo_role1 = stratum_role1.getOrCreateFileInfo(
@@ -181,7 +181,7 @@ public class OTJStratumGenerationTest007 extends AbstractSourceMapGeneratorTest
fileInfo_role1.addLineInfo(lineInfo1_role3);
stratum_role1.optimize();
-
+
List<SmapStratum> strata_role1 = new ArrayList<SmapStratum>();
strata_role1.add(stratum_role1);
@@ -198,14 +198,14 @@ public class OTJStratumGenerationTest007 extends AbstractSourceMapGeneratorTest
}
}
-
+
public void testSmapGeneration4() throws JavaModelException
{
TYPENAME = "__OT__RoleB";
_enclosingTypename = "TeamB";
String enclTypeSourceName = _enclosingTypename + ".java";
_buildPartially = true;
-
+
SmapStratum stratum_role1 = new SmapStratum(
ISMAPConstants.OTJ_STRATUM_NAME);
FileInfo fileInfo_role1 = stratum_role1.getOrCreateFileInfo(
@@ -227,7 +227,7 @@ public class OTJStratumGenerationTest007 extends AbstractSourceMapGeneratorTest
fail(e.getMessage());
}
}
-
+
public void callback(CompilationUnitDeclaration cuDecl)
{
String cuDeclName = String.valueOf(cuDecl.getMainTypeName());
@@ -262,7 +262,7 @@ public class OTJStratumGenerationTest007 extends AbstractSourceMapGeneratorTest
rolefileSmapGenerator.addStratum("OTJ");
rolefileSmapGenerator.generate();
}
-
+
List actualStrata = rolefileSmapGenerator.getStrata();
assertEquals("Strata of type \"" + typeName
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/Requestor.java b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/Requestor.java
index 93d8db8c3..2cc821472 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/Requestor.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/compiler/org/eclipse/objectteams/otdt/tests/compiler/smap/Requestor.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -54,7 +54,7 @@ public class Requestor extends Assert implements ICompilerRequestor {
public boolean showWarningToken = false;
HashMap<String, int[]> lineNumbers = new HashMap<String, int[]>();
-
+
public Requestor(boolean forceOutputGeneration, ICompilerRequestor clientRequestor, boolean showCategory, boolean showWarningToken, HashMap<String, int[]> lineNumbers) {
this.forceOutputGeneration = forceOutputGeneration;
this.clientRequestor = clientRequestor;
@@ -77,7 +77,7 @@ protected void outputClassFiles(CompilationResult unitResult) {
// retrieve the key and the corresponding classfile
ClassFile classFile = classFiles[i];
if (outputPath != null) {
- String relativeName =
+ String relativeName =
new String(classFile.fileName()).replace('/', File.separatorChar) + ".class";
try {
org.eclipse.jdt.internal.compiler.util.Util.writeToDisk(true, outputPath, relativeName, classFile);
@@ -106,7 +106,7 @@ protected void outputClassFiles(CompilationResult unitResult) {
Assert.assertEquals("wrong number of line numbers", expectedNumbers.length, table.length);
for (int n=0; n<expectedNumbers.length; n++)
Assert.assertEquals("wrong line number", expectedNumbers[n], table[n][1]);
- }
+ }
}
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/formatter/org/eclipse/objectteams/otdt/core/tests/formatter/FormatterTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/formatter/org/eclipse/objectteams/otdt/core/tests/formatter/FormatterTests.java
index 6c8f6225d..f6f684cd5 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/formatter/org/eclipse/objectteams/otdt/core/tests/formatter/FormatterTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/formatter/org/eclipse/objectteams/otdt/core/tests/formatter/FormatterTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2015 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany, and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -43,20 +43,20 @@ import org.eclipse.jdt.internal.formatter.DefaultCodeFormatterOptions;
import org.eclipse.objectteams.otdt.tests.AbstractJavaModelTests;
import org.eclipse.text.edits.TextEdit;
-/**
+/**
* Test infra-structure copied from org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests.
- *
+ *
* @author stephan
*/
public class FormatterTests extends AbstractJavaModelTests {
-
+
public static final int UNKNOWN_KIND = 0;
public static final String IN = "_in";
public static final String OUT = "_out";
public static final boolean DEBUG = false;
private static final String LINE_SEPARATOR = System.getProperty("line.separator");
private long time;
-
+
static {
// TESTS_NUMBERS = new int[] { 620 } ;
// TESTS_NAMES = new String{ "test005" };
@@ -68,7 +68,7 @@ public class FormatterTests extends AbstractJavaModelTests {
public FormatterTests(String name) {
super(name);
}
-
+
/**
* Returns the OS path to the directory that contains this plugin.
*/
@@ -85,7 +85,7 @@ public class FormatterTests extends AbstractJavaModelTests {
public String getSourceWorkspacePath() {
return getPluginDirectoryPath() + java.io.File.separator + "workspace";
}
-
+
private String runFormatter(CodeFormatter codeFormatter, String source, int kind, int indentationLevel, int offset, int length, String lineSeparator) {
// long time = System.currentTimeMillis();
TextEdit edit = codeFormatter.format(kind, source, offset, length, indentationLevel, lineSeparator);//$NON-NLS-1$
@@ -122,7 +122,7 @@ public class FormatterTests extends AbstractJavaModelTests {
if (DEBUG) {
this.time = System.currentTimeMillis();
}
- }
+ }
/**
* Reset the jar placeholder and delete project.
@@ -133,7 +133,7 @@ public class FormatterTests extends AbstractJavaModelTests {
System.out.println("Time spent = " + (System.currentTimeMillis() - this.time));//$NON-NLS-1$
}
super.tearDown();
- }
+ }
private String getIn(String compilationUnitName) {
assertNotNull(compilationUnitName);
@@ -141,7 +141,7 @@ public class FormatterTests extends AbstractJavaModelTests {
assertTrue(dotIndex != -1);
return compilationUnitName.substring(0, dotIndex) + IN + compilationUnitName.substring(dotIndex);
}
-
+
private String getOut(String compilationUnitName) {
assertNotNull(compilationUnitName);
int dotIndex = compilationUnitName.indexOf('.');
@@ -207,11 +207,11 @@ public class FormatterTests extends AbstractJavaModelTests {
public void test002() {
runTest("test002", "T1.java");//$NON-NLS-1$ //$NON-NLS-2$
}
-
+
public void test003() {
runTest("test003", "T1.java");//$NON-NLS-1$ //$NON-NLS-2$
}
-
+
public void test004() {
runTest("test004", "T1.java");//$NON-NLS-1$ //$NON-NLS-2$
}
@@ -223,15 +223,15 @@ public class FormatterTests extends AbstractJavaModelTests {
public void test006() {
runTest("test006", "T1.java");//$NON-NLS-1$ //$NON-NLS-2$
}
-
+
public void test007() {
runTest("test007", "Class1.java");//$NON-NLS-1$ //$NON-NLS-2$
}
-
+
public void testFlightBonus() {
runTest("testFlightBonus", "FlightBonusDialog.java");
}
-
+
public void testBaseCall() {
runTest("testBaseCall", "MyTeam.java");
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/AllTests.java
index 3f165c114..92013b798 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/AllTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/CompleteRoleHierarchyWithClasses.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/CompleteRoleHierarchyWithClasses.java
index cc1b7e2ca..1087b8290 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/CompleteRoleHierarchyWithClasses.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/CompleteRoleHierarchyWithClasses.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -39,7 +39,7 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
*/
/*
* The testdata setting looks like this:
- *
+ *
* SuperSuperTeam
* R1 SuperClass
* /\ /\
@@ -54,13 +54,13 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
* |'''''''''''''''''''| |''''''''''''|'''''''''''''| |
* SubTeam1 SubTeam2 | | | |
* R1 R1------------------>SubSubClass11 SubSubClass12 |
- * /\ | |
+ * /\ | |
* |'''''''''''| | |
* SubSubTeam11 SubSubTeam12 | |
* R1 R1-----------------| |
* | |
* |---------------------------------------------------------------------|
- *
+ *
* The focus role is ATeam.R1 .
*/
public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest
@@ -79,15 +79,15 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest
private IType _subSubClass11;
private IType _subSubClass12;
private IType _object;
-
+
private TypeHierarchy _hierarchy;
-
-
+
+
public CompleteRoleHierarchyWithClasses(String name)
{
super(name);
}
-
+
public static Test suite()
{
if (true)
@@ -95,161 +95,161 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest
return new Suite(CompleteRoleHierarchyWithClasses.class);
}
@SuppressWarnings("unused")
- junit.framework.TestSuite suite =
+ junit.framework.TestSuite suite =
new Suite(CompleteRoleHierarchyWithClasses.class.getName());
return suite;
}
-
-
+
+
public void setUpSuite() throws Exception
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
- _focusRole =
+
+ _focusRole =
getRole(getTestProjectDir(),
"complete_rolehierarchy_with_classes",
"test002.inlined",
"ATeam",
"R1");
-
+
_hierarchy = new TypeHierarchy(_focusRole, null, _focusRole.getJavaProject(), true);
- _hierarchy.refresh(new NullProgressMonitor());
-
- _implSuperRole =
+ _hierarchy.refresh(new NullProgressMonitor());
+
+ _implSuperRole =
getRole(getTestProjectDir(),
"complete_rolehierarchy_with_classes",
"test002.inlined",
"SuperTeam",
"R1");
-
- _implSuperSuperRole =
+
+ _implSuperSuperRole =
getRole(getTestProjectDir(),
"complete_rolehierarchy_with_classes",
"test002.inlined",
"SuperSuperTeam",
"R1");
-
- _implSubRole1 =
+
+ _implSubRole1 =
getRole(getTestProjectDir(),
"complete_rolehierarchy_with_classes",
"test002.inlined",
"SubTeam1",
"R1");
-
- _implSubRole2 =
+
+ _implSubRole2 =
getRole(getTestProjectDir(),
"complete_rolehierarchy_with_classes",
"test002.inlined",
"SubTeam2",
"R1");
-
+
_implSubSubRole11 =
getRole(getTestProjectDir(),
"complete_rolehierarchy_with_classes",
"test002.inlined",
"SubSubTeam11",
"R1");
-
+
_implSubSubRole12 =
getRole(getTestProjectDir(),
"complete_rolehierarchy_with_classes",
"test002.inlined",
"SubSubTeam12",
"R1");
-
+
_class =
- getType(getTestProjectDir(),
- "complete_rolehierarchy_with_classes",
- "test002.standard",
+ getType(getTestProjectDir(),
+ "complete_rolehierarchy_with_classes",
+ "test002.standard",
"AClass");
-
+
_superClass =
- getType(getTestProjectDir(),
- "complete_rolehierarchy_with_classes",
- "test002.standard",
+ getType(getTestProjectDir(),
+ "complete_rolehierarchy_with_classes",
+ "test002.standard",
"SuperClass");
-
+
_subClass1 =
- getType(getTestProjectDir(),
- "complete_rolehierarchy_with_classes",
- "test002.standard",
+ getType(getTestProjectDir(),
+ "complete_rolehierarchy_with_classes",
+ "test002.standard",
"SubClass1");
-
+
_subClass2 =
- getType(getTestProjectDir(),
- "complete_rolehierarchy_with_classes",
- "test002.standard",
+ getType(getTestProjectDir(),
+ "complete_rolehierarchy_with_classes",
+ "test002.standard",
"SubClass2");
-
+
_subSubClass11 =
- getType(getTestProjectDir(),
- "complete_rolehierarchy_with_classes",
- "test002.standard",
+ getType(getTestProjectDir(),
+ "complete_rolehierarchy_with_classes",
+ "test002.standard",
"SubSubClass11");
-
+
_subSubClass12 =
- getType(getTestProjectDir(),
- "complete_rolehierarchy_with_classes",
- "test002.standard",
+ getType(getTestProjectDir(),
+ "complete_rolehierarchy_with_classes",
+ "test002.standard",
"SubSubClass12");
-
- _object =
+
+ _object =
getType(getTestProjectDir(),
"rt.jar",
"java.lang",
"Object");
-
+
}
-
+
public void testContainment_implSuperRole()
{
assertTrue(_hierarchy.contains((IType)_implSuperRole.getCorrespondingJavaElement()));
}
-
+
public void testGetExplicitSuperclass_ofFocusRole() throws JavaModelException
{
assertEquals(_class, OTTypeHierarchies.getInstance().getExplicitSuperclass(_hierarchy, (IType)_focusRole.getCorrespondingJavaElement()));
- }
-
-
+ }
+
+
public void testGetExplicitSuperclass_ofImplSuperSuperRole() throws JavaModelException
{
assertEquals(_object, OTTypeHierarchies.getInstance().getExplicitSuperclass(_hierarchy, (IType)_implSuperSuperRole.getCorrespondingJavaElement()));
}
-
-
+
+
public void testGetExplicitSuperclass_ofImplSuperRole() throws JavaModelException
{
assertEquals(_class, OTTypeHierarchies.getInstance().getExplicitSuperclass(_hierarchy, (IType)_implSuperRole.getCorrespondingJavaElement()));
}
-
+
public void testGetExplicitSuperclass_ofImplSubRole1() throws JavaModelException
{
assertEquals(_class, OTTypeHierarchies.getInstance().getExplicitSuperclass(_hierarchy, (IType)_implSubRole1.getCorrespondingJavaElement()));
}
-
-
+
+
public void testGetExplicitSuperclass_ofImplSubRole2() throws JavaModelException
{
assertEquals(_subSubClass11, OTTypeHierarchies.getInstance().getExplicitSuperclass(_hierarchy, (IType)_implSubRole2.getCorrespondingJavaElement()));
}
-
-
+
+
public void testGetExplicitSuperclass_ofImplSubSubRole11() throws JavaModelException
{
assertEquals(_subClass2, OTTypeHierarchies.getInstance().getExplicitSuperclass(_hierarchy, (IType)_implSubSubRole11.getCorrespondingJavaElement()));
}
-
-
+
+
public void testGetExplicitSuperclass_ofImplSubSubRole12() throws JavaModelException
{
assertEquals(_subClass1, OTTypeHierarchies.getInstance().getExplicitSuperclass(_hierarchy, (IType)_implSubSubRole12.getCorrespondingJavaElement()));
}
-
-
+
+
public void testGetAllClasses()
{
ArrayList<IType> expectedList = new ArrayList<IType>();
@@ -263,17 +263,17 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest
expectedList.add(_object);
expectedList.add(_superClass);
expectedList.add(_class);
-// expectedList.add(_subClass1); // not reachable from focusRole
+// expectedList.add(_subClass1); // not reachable from focusRole
// expectedList.add(_subClass2); // not reachable from focusRole
// expectedList.add(_subSubClass11); // not reachable from focusRole
-
+
IType[] expected = expectedList.toArray(new IType[expectedList.size()]);
IType[] actual = _hierarchy.getAllClasses();
-
+
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllTypes()
{
ArrayList<IType> expectedList = new ArrayList<IType>();
@@ -290,10 +290,10 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest
// expectedList.add(_subClass1);
// expectedList.add(_subClass2);
// expectedList.add(_subSubClass11);
-
+
IType[] expected = expectedList.toArray(new IType[expectedList.size()]);
IType[] actual = _hierarchy.getAllTypes();
-
+
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -318,10 +318,10 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest
expectedList.add(_subClass1);
// expectedList.add(_subClass2); // still outside
expectedList.add(_subSubClass11);
-
+
IType[] expected = expectedList.toArray(new IType[expectedList.size()]);
IType[] actual = _hierarchy.getAllTypes();
-
+
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
} finally {
@@ -329,8 +329,8 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest
_hierarchy.refresh(new NullProgressMonitor());
}
}
-
-
+
+
public void testGetAllSuperclasses_ofFocusRole()
{
ArrayList<IType> expectedList = new ArrayList<IType>();
@@ -339,28 +339,28 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest
expectedList.add(_superClass);
expectedList.add(_class);
expectedList.add(_object);
-
- IType[] expected = expectedList.toArray(new IType[expectedList.size()]);
+
+ IType[] expected = expectedList.toArray(new IType[expectedList.size()]);
IType[] actual = _hierarchy.getAllSuperclasses((IType)_focusRole.getCorrespondingJavaElement());
-
+
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclasses_ofImplSuperSuperRole()
{
ArrayList<IType> expectedList = new ArrayList<IType>();
expectedList.add(_object);
expectedList.add(_class); // when seen from focusType ATeam$R1, R1 indeed has this super class
expectedList.add(_superClass);
-
+
IType[] expected = expectedList.toArray(new IType[expectedList.size()]);
IType[] actual = _hierarchy.getAllSuperclasses(_implSuperSuperRole);
-
+
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclasses_ofImplSuperRole()
{
ArrayList<IType> expectedList = new ArrayList<IType>();
@@ -368,14 +368,14 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest
expectedList.add(_superClass);
expectedList.add(_class);
expectedList.add(_object);
-
+
IType[] expected = expectedList.toArray(new IType[expectedList.size()]);
IType[] actual = _hierarchy.getAllSuperclasses((IType)_implSuperRole.getCorrespondingJavaElement());
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclasses_ofImplSubRole1()
{
ArrayList<IType> expectedList = new ArrayList<IType>();
@@ -385,14 +385,14 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest
expectedList.add(_superClass);
expectedList.add(_class);
expectedList.add(_object);
-
+
IType[] expected = expectedList.toArray(new IType[expectedList.size()]);
IType[] actual = _hierarchy.getAllSuperclasses((IType)_implSubRole1.getCorrespondingJavaElement());
-
+
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclasses_ofImplSubRole2()
{
ArrayList<IType> expectedList = new ArrayList<IType>();
@@ -404,10 +404,10 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest
// expectedList.add(_subClass1); // not related to focus type
// expectedList.add(_subSubClass11); // not related to focus type
expectedList.add(_object);
-
+
IType[] expected = expectedList.toArray(new IType[expectedList.size()]);
IType[] actual = _hierarchy.getAllSuperclasses((IType)_implSubRole2.getCorrespondingJavaElement());
-
+
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -426,7 +426,7 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest
expectedList.add(_subClass1);
expectedList.add(_subSubClass11);
expectedList.add(_object);
-
+
IType[] expected = expectedList.toArray(new IType[expectedList.size()]);
IType[] actual = _hierarchy.getAllSuperclasses((IType)_implSubRole2.getCorrespondingJavaElement());
@@ -437,7 +437,7 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest
_hierarchy.refresh(new NullProgressMonitor());
}
}
-
+
public void testGetAllSuperclasses_ofImplSubSubRole11()
{
ArrayList<IType> expectedList = new ArrayList<IType>();
@@ -449,14 +449,14 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest
expectedList.add(_class);
// expectedList.add(_subClass2); // not related to focus type
expectedList.add(_object);
-
+
IType[] expected = expectedList.toArray(new IType[expectedList.size()]);
IType[] actual = _hierarchy.getAllSuperclasses((IType)_implSubSubRole11.getCorrespondingJavaElement());
-
+
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclasses_ofImplSubSubRole12()
{
ArrayList<IType> expectedList = new ArrayList<IType>();
@@ -468,14 +468,14 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest
expectedList.add(_class);
// expectedList.add(_subClass1); // not related to focus
expectedList.add(_object);
-
- IType[] expected = expectedList.toArray(new IType[expectedList.size()]);
+
+ IType[] expected = expectedList.toArray(new IType[expectedList.size()]);
IType[] actual = _hierarchy.getAllSuperclasses((IType)_implSubSubRole12.getCorrespondingJavaElement());
-
+
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclasses_ofImplSubSubRole12_withFocus() throws JavaModelException
{
@@ -492,10 +492,10 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest
expectedList.add(_class);
expectedList.add(_subClass1);
expectedList.add(_object);
-
- IType[] expected = expectedList.toArray(new IType[expectedList.size()]);
+
+ IType[] expected = expectedList.toArray(new IType[expectedList.size()]);
IType[] actual = _hierarchy.getAllSuperclasses((IType)_implSubSubRole12.getCorrespondingJavaElement());
-
+
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
} finally {
@@ -503,7 +503,7 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest
_hierarchy.refresh(new NullProgressMonitor());
}
}
-
+
public void testGetAllSupertypes_ofFocusRole()
{
ArrayList<IType> expectedList = new ArrayList<IType>();
@@ -512,14 +512,14 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest
expectedList.add(_object);
expectedList.add(_superClass);
expectedList.add(_class);
-
- IType[] expected = expectedList.toArray(new IType[expectedList.size()]);
+
+ IType[] expected = expectedList.toArray(new IType[expectedList.size()]);
IType[] actual = _hierarchy.getAllSupertypes((IType)_focusRole.getCorrespondingJavaElement());
-
+
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSupertypes_ofImplSuperSuperRole()
{
ArrayList<IType> expectedList = new ArrayList<IType>();
@@ -527,13 +527,13 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest
expectedList.add(_class); // when seen from focusType ATeam$R1, R1 indeed has this super class
expectedList.add(_superClass);
- IType[] expected = expectedList.toArray(new IType[expectedList.size()]);
+ IType[] expected = expectedList.toArray(new IType[expectedList.size()]);
IType[] actual = _hierarchy.getAllSupertypes((IType)_implSuperSuperRole.getCorrespondingJavaElement());
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSupertypes_ofImplSuperRole()
{
ArrayList<IType> expectedList = new ArrayList<IType>();
@@ -541,14 +541,14 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest
expectedList.add(_superClass);
expectedList.add(_class);
expectedList.add(_object);
-
- IType[] expected = expectedList.toArray(new IType[expectedList.size()]);
+
+ IType[] expected = expectedList.toArray(new IType[expectedList.size()]);
IType[] actual = _hierarchy.getAllSupertypes((IType)_implSuperRole.getCorrespondingJavaElement());
-
+
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSupertypes_ofImplSubRole1()
{
ArrayList<IType> expectedList = new ArrayList<IType>();
@@ -558,14 +558,14 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest
expectedList.add(_superClass);
expectedList.add(_class);
expectedList.add(_object);
-
+
IType[] expected = expectedList.toArray(new IType[expectedList.size()]);
IType[] actual = _hierarchy.getAllSupertypes((IType)_implSubRole1.getCorrespondingJavaElement());
-
+
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSupertypes_ofImplSubRole2()
{
ArrayList<IType> expectedList = new ArrayList<IType>();
@@ -577,14 +577,14 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest
// expectedList.add(_subClass1); // not reachable from focusRole
// expectedList.add(_subSubClass11); // not reachable from focusRole
expectedList.add(_object);
-
+
IType[] expected = expectedList.toArray(new IType[expectedList.size()]);
IType[] actual = _hierarchy.getAllSupertypes((IType)_implSubRole2.getCorrespondingJavaElement());
-
+
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSupertypes_ofImplSubSubRole11()
{
ArrayList<IType> expectedList = new ArrayList<IType>();
@@ -596,14 +596,14 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest
expectedList.add(_class);
// expectedList.add(_subClass2); // not reachable from focusRole
expectedList.add(_object);
-
+
IType[] expected = expectedList.toArray(new IType[expectedList.size()]);
IType[] actual = _hierarchy.getAllSupertypes((IType)_implSubSubRole11.getCorrespondingJavaElement());
-
+
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSupertypes_ofImplSubSubRole12()
{
ArrayList<IType> expectedList = new ArrayList<IType>();
@@ -615,22 +615,22 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest
expectedList.add(_class);
// expectedList.add(_subClass1); // not reachable from focusRole
expectedList.add(_object);
-
+
IType[] expected = expectedList.toArray(new IType[expectedList.size()]);
IType[] actual = _hierarchy.getAllSupertypes((IType)_implSubSubRole12.getCorrespondingJavaElement());
-
+
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
// succeeds although hierarchy was not built for type.
public void testGetAllSubtypes_ofSubClass2()
{
ArrayList<IRoleType> expectedList = new ArrayList<IRoleType>();
expectedList.add(_implSubSubRole11);
IType[] expected = expectedList.toArray(new IType[expectedList.size()]);
-
- assertTrue(compareTypes(expected, _hierarchy.getAllSubtypes(_subClass2)));
+
+ assertTrue(compareTypes(expected, _hierarchy.getAllSubtypes(_subClass2)));
}
// succeeds although hierarchy was not built for type.
@@ -639,17 +639,17 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest
ArrayList<IRoleType> expectedList = new ArrayList<IRoleType>();
expectedList.add(_implSubRole2);
IType[] expected = expectedList.toArray(new IType[expectedList.size()]);
-
- assertTrue(compareTypes(expected, _hierarchy.getAllSubtypes(_subSubClass11)));
+
+ assertTrue(compareTypes(expected, _hierarchy.getAllSubtypes(_subSubClass11)));
}
// succeeds although hierarchy was not built for type.
public void testGetAllSubtypes_ofSubSubClass12()
{
IType[] expected = new IType[0];
- assertTrue(compareTypes(expected, _hierarchy.getAllSubtypes(_subSubClass12)));
+ assertTrue(compareTypes(expected, _hierarchy.getAllSubtypes(_subSubClass12)));
}
-
+
public void testGetAllSubtypes_ofImplSuperSuperRole()
{
ArrayList<IRoleType> expectedList = new ArrayList<IRoleType>();
@@ -660,7 +660,7 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest
expectedList.add(_implSubSubRole11);
expectedList.add(_implSubSubRole12);
IType[] expected = expectedList.toArray(new IType[expectedList.size()]);
-
- assertTrue(compareTypes(expected, _hierarchy.getAllSubtypes((IType)_implSuperSuperRole.getCorrespondingJavaElement())));
+
+ assertTrue(compareTypes(expected, _hierarchy.getAllSubtypes((IType)_implSuperSuperRole.getCorrespondingJavaElement())));
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/FileBasedHierarchyTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/FileBasedHierarchyTest.java
index 5e499e285..17c464151 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/FileBasedHierarchyTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/FileBasedHierarchyTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -37,7 +37,7 @@ public class FileBasedHierarchyTest extends FileBasedModelTest
{
super(name);
}
-
+
private ITypeHierarchy createTypeHierarchy(IType focusType, boolean computeSubtypes) throws JavaModelException
{
ITypeHierarchy hierarchy = new TypeHierarchy(focusType, null, focusType.getJavaProject(), computeSubtypes);
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/ITypeIOTTypeTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/ITypeIOTTypeTest.java
index a93418e98..51ac78f4b 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/ITypeIOTTypeTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/ITypeIOTTypeTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -45,11 +45,11 @@ public class ITypeIOTTypeTest extends FileBasedHierarchyTest
private IType _MyTeam;
private IType _MySubTeam;
private IType _MyOtherSubTeam;
-
+
private IType _MyTeam_MyRole;
private IType _MySubTeam_MyRole; // phantom-type!
private IType _MyOtherSubTeam_MyRole;
-
+
private IOTType _OT_MyTeam;
private IOTType _OT_MySubTeam;
@SuppressWarnings("unused")
@@ -57,12 +57,12 @@ public class ITypeIOTTypeTest extends FileBasedHierarchyTest
private IOTType _OT_MyTeam_MyRole;
private IOTType _OT_MyOtherSubTeam_MyRole;
-
+
public ITypeIOTTypeTest(String name)
{
super(name);
}
-
+
public static Test suite()
{
if (true)
@@ -70,90 +70,90 @@ public class ITypeIOTTypeTest extends FileBasedHierarchyTest
return new Suite(ITypeIOTTypeTest.class);
}
@SuppressWarnings("unused")
- junit.framework.TestSuite suite =
+ junit.framework.TestSuite suite =
new Suite(ITypeIOTTypeTest.class.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
String srcFolder = "src";
String pkg = "simple";
-
+
_objectType =
getType(getTestProjectDir(), "rt.jar", "java.lang", "Object");
-
+
_MyTeam = getType(getTestProjectDir(), srcFolder, pkg, "MyTeam");
_MySubTeam = getType(getTestProjectDir(), srcFolder, pkg, "MySubTeam");
_MyOtherSubTeam = getType(getTestProjectDir(), srcFolder, pkg, "MyOtherSubTeam");
-
+
_MyTeam_MyRole = getRole(_MyTeam, "MyTeam.MyRole");
_MySubTeam_MyRole = new PhantomType(_MySubTeam, _MyTeam_MyRole);
_MyOtherSubTeam_MyRole = getRole(_MyOtherSubTeam, "MyOtherSubTeam.MyRole");
-
+
_OT_MyTeam = OTModelManager.getOTElement(_MyTeam);
_OT_MySubTeam = OTModelManager.getOTElement(_MySubTeam);
_OT_MyOtherSubTeam = OTModelManager.getOTElement(_MyOtherSubTeam);
_OT_MyTeam_MyRole = OTModelManager.getOTElement(_MyTeam_MyRole);
_OT_MyOtherSubTeam_MyRole = OTModelManager.getOTElement(_MyOtherSubTeam_MyRole);
}
-
+
public void testCreation()
{
assertCreation(_MyTeam);
assertCreation(_MySubTeam);
-
+
assertCreation(_MyTeam_MyRole);
assertCreation(_MySubTeam_MyRole);
-
+
assertCreation(_OT_MyTeam);
assertCreation(_OT_MySubTeam);
assertCreation(_OT_MyTeam_MyRole);
}
-
+
public void testHierarchyCreation_equalFocusType() throws JavaModelException
{
ITypeHierarchy first = createTypeHierarchy(_MyTeam);
ITypeHierarchy second = createTypeHierarchy(_OT_MyTeam);
-
- assertEquals(first.getType(), second.getType());
+
+ assertEquals(first.getType(), second.getType());
}
-
+
// disabled, because this test used to challenge caching of hierarchies, which is not implemented for normal TypeHierarchies
public void _testGetOTSuperTypeHierarchy() throws JavaModelException
{
_testObj = createTypeHierarchy(_MyTeam);
-
+
ITypeHierarchy first = new TypeHierarchy(_MyTeam, null, _MyTeam.getJavaProject(), false);
first.refresh(null);
ITypeHierarchy second = new TypeHierarchy(_OT_MyTeam, null, _OT_MyTeam.getJavaProject(), false);
second.refresh(null);
- assertEquals(first, second);
+ assertEquals(first, second);
}
-
+
public void testGetSubtypes() throws JavaModelException
{
_testObj = createTypeHierarchy(_MyTeam);
-
+
IType [] first = _testObj.getSubtypes(_MyTeam);
IType [] second = _testObj.getSubtypes(_OT_MyTeam);
- assertEquals(first.length, second.length);
+ assertEquals(first.length, second.length);
assertTrue(compareTypes(first, second));
}
public void testGetAllSuperclasses() throws JavaModelException
{
_testObj = createTypeHierarchy(_MySubTeam);
-
+
IType [] first = _testObj.getAllSuperclasses(_MySubTeam);
IType [] second = _testObj.getAllSuperclasses(_OT_MySubTeam);
- assertEquals(first.length, second.length);
+ assertEquals(first.length, second.length);
assertTrue(compareTypes(first, second));
}
@@ -161,40 +161,40 @@ public class ITypeIOTTypeTest extends FileBasedHierarchyTest
public void testGetAllSuperInterfaces() throws JavaModelException
{
_testObj = createTypeHierarchy(_MyTeam);
-
+
IType [] first = _testObj.getAllSuperInterfaces(_MyTeam);
IType [] second = _testObj.getAllSuperInterfaces(_OT_MyTeam);
- assertEquals(first.length, second.length);
+ assertEquals(first.length, second.length);
assertTrue(compareTypes(first, second));
}
-
+
public void testGetAllSupertypes() throws JavaModelException
{
_testObj = createTypeHierarchy(_MySubTeam);
-
+
IType [] first = _testObj.getAllSupertypes(_MySubTeam);
IType [] second = _testObj.getAllSupertypes(_OT_MySubTeam);
- assertEquals(first.length, second.length);
+ assertEquals(first.length, second.length);
assertTrue(compareTypes(first, second));
}
public void testGetAllSubtypes() throws JavaModelException
{
_testObj = createTypeHierarchy(_MyTeam);
-
+
IType [] first = _testObj.getAllSubtypes(_MyTeam);
IType [] second = _testObj.getAllSubtypes(_OT_MyTeam);
- assertEquals(first.length, second.length);
+ assertEquals(first.length, second.length);
assertTrue(compareTypes(first, second));
}
-
+
public void testGetCachedFlags() throws JavaModelException
{
_testObj = createTypeHierarchy(_MyTeam);
-
+
int first = _testObj.getCachedFlags(_MyTeam);
int second = _testObj.getCachedFlags(_OT_MyTeam);
@@ -204,18 +204,18 @@ public class ITypeIOTTypeTest extends FileBasedHierarchyTest
public void testGetSubclasses() throws JavaModelException
{
_testObj = createTypeHierarchy(_MyTeam);
-
+
IType [] first = _testObj.getSubclasses(_MyTeam);
IType [] second = _testObj.getSubclasses(_OT_MyTeam);
- assertEquals(first.length, second.length);
+ assertEquals(first.length, second.length);
assertTrue(compareTypes(first, second));
}
public void testGetSuperclass() throws JavaModelException
{
_testObj = createTypeHierarchy(_MySubTeam);
-
+
IType first = _testObj.getSuperclass(_MySubTeam);
IType second = _testObj.getSuperclass(_OT_MySubTeam);
@@ -225,11 +225,11 @@ public class ITypeIOTTypeTest extends FileBasedHierarchyTest
public void testGetSuperclasses() throws JavaModelException
{
_testObj = createTypeHierarchy(_MySubTeam);
-
+
IType [] first = OTTypeHierarchies.getInstance().getSuperclasses(_testObj, _MySubTeam);
IType [] second = OTTypeHierarchies.getInstance().getSuperclasses(_testObj, _OT_MySubTeam);
- assertEquals(first.length, second.length);
+ assertEquals(first.length, second.length);
assertTrue(compareTypes(first, second));
}
@@ -237,51 +237,51 @@ public class ITypeIOTTypeTest extends FileBasedHierarchyTest
public void testGetSuperInterfaces() throws JavaModelException
{
_testObj = createTypeHierarchy(_MyTeam);
-
+
IType [] first = _testObj.getSuperInterfaces(_MyTeam);
IType [] second = _testObj.getSuperInterfaces(_OT_MyTeam);
- assertEquals(first.length, second.length);
+ assertEquals(first.length, second.length);
assertTrue(compareTypes(first, second));
}
public void testGetSupertypes() throws JavaModelException
{
_testObj = createTypeHierarchy(_MySubTeam);
-
+
IType [] first = _testObj.getSupertypes(_MySubTeam);
IType [] second = _testObj.getSupertypes(_OT_MySubTeam);
- assertEquals(first.length, second.length);
+ assertEquals(first.length, second.length);
assertTrue(compareTypes(first, second));
}
public void testGetTSuperTypes() throws JavaModelException
{
_testObj = createTypeHierarchy(_MyOtherSubTeam_MyRole);
-
+
IType [] first = OTTypeHierarchies.getInstance().getTSuperTypes(_testObj, _MyOtherSubTeam_MyRole);
IType [] second = OTTypeHierarchies.getInstance().getTSuperTypes(_testObj, _OT_MyOtherSubTeam_MyRole);
- assertEquals(first.length, second.length);
+ assertEquals(first.length, second.length);
assertTrue(compareTypes(first, second));
}
public void testGetAllTSuperTypes() throws JavaModelException
{
_testObj = createTypeHierarchy(_MyOtherSubTeam_MyRole);
-
+
IType [] first = OTTypeHierarchies.getInstance().getAllTSuperTypes(_testObj, _MyOtherSubTeam_MyRole);
IType [] second = OTTypeHierarchies.getInstance().getAllTSuperTypes(_testObj, _OT_MyOtherSubTeam_MyRole);
- assertEquals(first.length, second.length);
+ assertEquals(first.length, second.length);
assertTrue(compareTypes(first, second));
}
public void testGetExplicitSuperclass() throws JavaModelException
{
_testObj = createTypeHierarchy(_MySubTeam);
-
+
IType first = OTTypeHierarchies.getInstance().getExplicitSuperclass(_testObj, _MySubTeam);
IType second = OTTypeHierarchies.getInstance().getExplicitSuperclass(_testObj, _OT_MySubTeam);
@@ -292,11 +292,11 @@ public class ITypeIOTTypeTest extends FileBasedHierarchyTest
public void testGetExtendingInterfaces() throws JavaModelException
{
_testObj = createTypeHierarchy(_MyTeam);
-
+
IType [] first = _testObj.getExtendingInterfaces(_MyTeam);
IType [] second = _testObj.getExtendingInterfaces(_OT_MyTeam);
- assertEquals(first.length, second.length);
+ assertEquals(first.length, second.length);
assertTrue(compareTypes(first, second));
}
@@ -304,11 +304,11 @@ public class ITypeIOTTypeTest extends FileBasedHierarchyTest
public void testGetImplementingClasses() throws JavaModelException
{
_testObj = createTypeHierarchy(_MyTeam);
-
+
IType [] first = _testObj.getImplementingClasses(_MyTeam);
IType [] second = _testObj.getImplementingClasses(_OT_MyTeam);
- assertEquals(first.length, second.length);
+ assertEquals(first.length, second.length);
assertTrue(compareTypes(first, second));
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/OTTypeHierarchyTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/OTTypeHierarchyTests.java
index bc2a2fb86..5f5f65674 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/OTTypeHierarchyTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/OTTypeHierarchyTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -25,10 +25,10 @@ import junit.framework.Test;
import junit.framework.TestSuite;
/**
- *
+ *
* @author Michael Krueger (mkr)
* @version $Id: OTTypeHierarchyTests.java 23494 2010-02-05 23:06:44Z stephan $
- *
+ *
*/
public class OTTypeHierarchyTests
{
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/AllTests.java
index d219246a0..b53202c75 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/AllTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest001.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest001.java
index 413da0cee..8b110b85a 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest001.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest001.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -37,7 +37,7 @@ import org.eclipse.objectteams.otdt.tests.hierarchy.FileBasedHierarchyTest;
*/
public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest
{
-
+
private IType _T1;
private IType _T2;
private IType _T3;
@@ -46,41 +46,41 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest
private IType _T6;
private IType _T7;
private IType _T8;
-
+
private IType _T1_R1;
- private IType _T1_R2;
+ private IType _T1_R2;
private IType _T2_R1;
private IType _T2_R2;
-
+
private IType _T3_R1;
private IType _T3_R2;
-
+
private IType _phantom_T4_R1;
private IType _T4_R2;
-
+
private IType _T5_R1;
private IType _T5_R2;
private IType _T5_R3;
-
+
private IType _T6_R1;
private IType _phantom_T6_R2;
-
+
private IType _phantom_T7_R1;
private IType _T7_R2;
- private IType _T7_R3;
-
+ private IType _T7_R3;
+
private IType _phantom_T8_R1;
private IType _T8_R2;
-
+
@SuppressWarnings("unused")
private IType _objectType;
-
+
public OTSubTypeHierarchyTest001(String name)
{
super(name);
}
-
+
public static Test suite()
{
if (true)
@@ -88,19 +88,19 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest
return new Suite(OTSubTypeHierarchyTest001.class);
}
@SuppressWarnings("unused")
- junit.framework.TestSuite suite =
+ junit.framework.TestSuite suite =
new Suite(OTSubTypeHierarchyTest001.class.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
String srcFolder = "src";
String pkg = "test001";
-
+
_T1 = getType(getTestProjectDir(), srcFolder, pkg, "T1");
_T2 = getType(getTestProjectDir(), srcFolder, pkg, "T2");
_T3 = getType(getTestProjectDir(), srcFolder, pkg, "T3");
@@ -128,17 +128,17 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest
_T6_R1 = getRole(_T6, "T6.R1");
_phantom_T6_R2 = new PhantomType(_T6, _T2_R2);
-
+
_phantom_T7_R1 = new PhantomType(_T7, _T5_R1);
_T7_R2 = getRole(_T7, "T7.R2");
_T7_R3 = getRole(_T7, "T7.R3");
_phantom_T8_R1 = new PhantomType(_T8, _T6_R1);
_T8_R2 = getRole(_T8, "T8.R2");
-
+
_objectType = getType(getTestProjectDir(), "rt.jar", "java.lang", "Object");
}
-
+
public void testCreation()
{
assertCreation(_T1);
@@ -168,7 +168,7 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest
assertCreation(_T6_R1);
assertCreation(_phantom_T6_R2);
-
+
assertCreation(_phantom_T7_R1);
assertCreation(_T7_R2);
assertCreation(_T7_R3);
@@ -176,12 +176,12 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest
assertCreation(_phantom_T8_R1);
assertCreation(_T8_R2);
}
-
+
public void testGetAllSubtypes_T1_R1() throws JavaModelException
{
_focusType = _T1_R1;
_testObj = createTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] {
_T2_R1, _T2_R2,
_T3_R1, _T3_R2,
@@ -191,14 +191,14 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest
_T7_R2, _T7_R3,
_T8_R2
};
-
+
IType [] actual = _testObj.getAllSubtypes(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
-
+
+
public void testGetAllSubtypes_T1_R1_phantomMode() throws JavaModelException
{
_focusType = _T1_R1;
@@ -214,18 +214,18 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest
_T7_R2, _T7_R3, _phantom_T7_R1,
_T8_R2, _phantom_T8_R1
};
-
+
IType [] actual = _testObj.getAllSubtypes(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSubtypes_T1_R2() throws JavaModelException
{
_focusType = _T1_R2;
_testObj = createTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] {
_T2_R2,
_T3_R2,
@@ -234,18 +234,18 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest
_T7_R2,
_T8_R2
};
-
+
IType [] actual = _testObj.getAllSubtypes(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetSubtypes_T2_R1() throws JavaModelException
{
_focusType = _T2_R1;
_testObj = createTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] {
// _T4_R2, // indirect: explicit subclass of phantom
_T2_R2,
@@ -253,19 +253,19 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest
_T5_R1,
_T6_R1
};
-
+
IType [] actual = _testObj.getSubtypes(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
-
+
+
public void testGetSubclasses_T2_R1() throws JavaModelException
{
_focusType = _T2_R1;
_testObj = createTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] {
// _T4_R2, // indirect: explicit subclass of phantom
_T2_R2,
@@ -273,27 +273,27 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest
_T5_R1,
_T6_R1
};
-
+
IType [] actual = _testObj.getSubclasses(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetSubclasses_T5_R1() throws JavaModelException
{
_focusType = _T5_R1;
_testObj = createTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] {
- _T5_R3,
+ _T5_R3,
// _T7_R3 // indirect: explicit subclass of phantom
};
-
+
IType [] actual = _testObj.getSubclasses(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -301,32 +301,32 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest
{
_focusType = _T5_R1;
_testObj = createTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] {
_T5_R2, _T5_R3,
- _T7_R2, _T7_R3 // indirect via phantom
+ _T7_R2, _T7_R3 // indirect via phantom
};
-
+
IType [] actual = _testObj.getAllSubtypes(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
-
+
+
public void testGetSubclasses_T6_R1() throws JavaModelException
{
_focusType = _T6_R1;
_testObj = createTypeHierarchy(_focusType);
-
- IType[] expected = new IType[] {
+
+ IType[] expected = new IType[] {
_T8_R2, // indirect: tsub of phantom explicit subclass (T6$R2)
-// _T2_R2 // not a subclass of T6$R1
+// _T2_R2 // not a subclass of T6$R1
};
-
+
IType [] actual = _testObj.getSubclasses(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -335,16 +335,16 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest
_focusType = _T6_R1;
_testObj = createTypeHierarchy(_focusType);
OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true);
-
- IType[] expected = new IType[] {
+
+ IType[] expected = new IType[] {
_phantom_T8_R1,
_phantom_T6_R2,
// _T8_R2 // indirect: explicit subclass of phantom
};
-
+
IType [] actual = _testObj.getSubclasses(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -352,31 +352,31 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest
{
_focusType = _T2_R2;
_testObj = createTypeHierarchy(_focusType);
-
- IType[] expected = new IType[] {
+
+ IType[] expected = new IType[] {
_T8_R2, // indirect
-// _T2_R2 // not a subclass of T6$R1
+// _T2_R2 // not a subclass of T6$R1
};
-
+
IType [] actual = _testObj.getSubclasses(_T6_R1);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetSubtypes_T6_R1() throws JavaModelException
{
_focusType = _T6_R1;
_testObj = createTypeHierarchy(_focusType);
-
- IType[] expected = new IType[] {
+
+ IType[] expected = new IType[] {
_T8_R2, // indirect
-// _T2_R2 // not a sub type of T6$R1
+// _T2_R2 // not a sub type of T6$R1
};
-
+
IType [] actual = _testObj.getSubtypes(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -385,14 +385,14 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest
_focusType = _T6_R1;
_testObj = createTypeHierarchy(_focusType);
OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true);
-
+
IType[] expected = new IType[] { _phantom_T6_R2,
_phantom_T8_R1,
// _T8_R2 // indirect: tsub of phantom explicit subclass (T6$R2), but in phantom mode we stop at that phantom
- };
+ };
IType [] actual = _testObj.getSubtypes(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -400,8 +400,8 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest
{
_focusType = (_T2_R1);
_testObj = createTypeHierarchy(_focusType);
-
- IType[] expected = new IType[] { _T8_R2,
+
+ IType[] expected = new IType[] { _T8_R2,
// _T2_R2 // not a subtype of T6$R1
};
IType [] actual = _testObj.getAllSubtypes(_T6_R1);
@@ -414,7 +414,7 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest
{
PhantomType phantom1 = new PhantomType(_T6, _T2_R2);
PhantomType phantom2 = new PhantomType(_T6, _T2_R2);
-
+
assertEquals(phantom1.hashCode(), phantom2.hashCode());
assertTrue(phantom1.equals(phantom2));
}
@@ -423,25 +423,25 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest
{
PhantomType phantom1 = new PhantomType(_T6, _T2_R2);
PhantomType phantom2 = new PhantomType(_T6, _T2_R2);
-
+
HashMap<PhantomType, Double> map = new HashMap<PhantomType, Double>();
Double dummy = new Double(0.0);
map.put(phantom1, dummy);
-
+
Double expected = dummy;
Double actual = map.get(phantom2);
assertEquals(expected, actual);
}
-
+
public void testPhantomTypeEquality2() throws JavaModelException
{
PhantomType phantom1 = new PhantomType(_T6, _T2_R2);
PhantomType phantom2 = new PhantomType(_T6, _T2_R2);
-
+
PhantomType phantom11 = new PhantomType(phantom1, _T1_R1);
PhantomType phantom12 = new PhantomType(phantom2, _T1_R1);
-
+
assertEquals(phantom11.hashCode(), phantom12.hashCode());
assertTrue(phantom11.equals(phantom12));
}
@@ -450,14 +450,14 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest
{
PhantomType phantom1 = new PhantomType(_T6, _T2_R2);
PhantomType phantom2 = new PhantomType(_T6, _T2_R2);
-
+
PhantomType phantom11 = new PhantomType(phantom1, _T1_R1);
PhantomType phantom12 = new PhantomType(phantom2, _T1_R1);
-
+
HashMap<PhantomType, Double> map = new HashMap<PhantomType, Double>();
Double dummy = new Double(0.0);
map.put(phantom11, dummy);
-
+
Double expected = dummy;
Double actual = map.get(phantom12);
assertEquals(expected, actual);
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest002.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest002.java
index 498405e63..763e66929 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest002.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest002.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -34,19 +34,19 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
*
*/
public class OTSubTypeHierarchyTest002 extends FileBasedModelTest {
-
+
private TypeHierarchy _testObj;
private IType _focusType;
-
+
private IType _T1_R1;
-
+
private IType _T2_R1;
-
+
private IType _T3_R1;
private IType _classA;
-
+
@SuppressWarnings("unused")
private IType _objectType;
@@ -60,7 +60,7 @@ public class OTSubTypeHierarchyTest002 extends FileBasedModelTest {
{
super(name);
}
-
+
public static Test suite()
{
if (true)
@@ -68,23 +68,23 @@ public class OTSubTypeHierarchyTest002 extends FileBasedModelTest {
return new Suite(OTSubTypeHierarchyTest002.class);
}
@SuppressWarnings("unused")
- junit.framework.TestSuite suite =
+ junit.framework.TestSuite suite =
new Suite(OTSubTypeHierarchyTest002.class.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
String srcFolder = "src";
String pkg = "test002";
_T1 = getType(getTestProjectDir(),
srcFolder,
pkg,
"T1");
-
+
_T2 = getType(getTestProjectDir(),
srcFolder,
pkg,
@@ -96,50 +96,50 @@ public class OTSubTypeHierarchyTest002 extends FileBasedModelTest {
"T3");
_T1_R1 = getRole(_T1, "T1.R1");
-
+
_T2_R1 = getRole(_T2, "T2.R1");
-
+
_T3_R1 = getRole(_T3, "T3.R1");
-
+
_classA = getType(getTestProjectDir(),
srcFolder,
pkg,
"ClassA");
-
- _objectType =
+
+ _objectType =
getType(getTestProjectDir(),
"rt.jar",
"java.lang",
"Object");
}
-
+
public void testGetAllSubtypes_T1_R1() throws JavaModelException
{
_focusType = _T1_R1;
_testObj = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
_testObj.refresh(new NullProgressMonitor());
-
+
IType[] expected = new IType[] { _T2_R1, _T3_R1};
-
+
IType [] actual = _testObj.getAllSubtypes(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSubtypes_ClassA() throws JavaModelException
{
_focusType = _classA;
_testObj = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
_testObj.refresh(new NullProgressMonitor());
-
+
IType[] expected = new IType[] { _T2_R1, _T3_R1};
-
+
IType [] actual = _testObj.getAllSubtypes(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest004.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest004.java
index 2c88ccb31..a66e58bda 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest004.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest004.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -34,19 +34,19 @@ import org.eclipse.objectteams.otdt.tests.hierarchy.FileBasedHierarchyTest;
/**
* @author Michael Krueger (mkr)
- * @version $Id: OTSubTypeHierarchyTest004.java 23494 2010-02-05 23:06:44Z stephan $
- *
+ * @version $Id: OTSubTypeHierarchyTest004.java 23494 2010-02-05 23:06:44Z stephan $
+ *
*/
-public class OTSubTypeHierarchyTest004 extends FileBasedHierarchyTest
+public class OTSubTypeHierarchyTest004 extends FileBasedHierarchyTest
{
-
+
private ITypeHierarchy _testObj;
private IType _focusType;
@SuppressWarnings("unused")
private IType _objectType;
private IType _T20;
private IType _T21;
-
+
private IType _T20T10T00R0;
private IType _T20T10T00R1;
private IType _T21T10T00R1;
@@ -54,13 +54,13 @@ public class OTSubTypeHierarchyTest004 extends FileBasedHierarchyTest
private IType _T21T11T00R0;
private IType _T21T11T00R1;
private IType _T21T11T00R2;
-
-
+
+
public OTSubTypeHierarchyTest004(String name)
{
super(name);
}
-
+
public static Test suite()
{
if (true)
@@ -68,33 +68,33 @@ public class OTSubTypeHierarchyTest004 extends FileBasedHierarchyTest
return new Suite(OTSubTypeHierarchyTest004.class);
}
@SuppressWarnings("unused")
- junit.framework.TestSuite suite =
+ junit.framework.TestSuite suite =
new Suite(OTSubTypeHierarchyTest004.class.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
String srcFolder = "src";
String pkg = "test004";
-
- _T20 =
+
+ _T20 =
getType(getTestProjectDir(),
srcFolder,
pkg,
"T20");
- _T21 =
+ _T21 =
getType(getTestProjectDir(),
srcFolder,
pkg,
"T21");
-
-
- _objectType =
+
+
+ _objectType =
getType(getTestProjectDir(),
"rt.jar",
"java.lang",
@@ -105,29 +105,29 @@ public class OTSubTypeHierarchyTest004 extends FileBasedHierarchyTest
_T21T10T00R1 = TypeHelper.findNestedRoleType(_T21, "T21.T10.T00.R1");
_T21T10T00R2 = TypeHelper.findNestedRoleType(_T21, "T21.T10.T00.R2");
-
+
_T21T11T00R0 = TypeHelper.findNestedRoleType(_T21, "T21.T11.T00.R0");
_T21T11T00R1 = TypeHelper.findNestedRoleType(_T21, "T21.T11.T00.R1");
_T21T11T00R2 = TypeHelper.findNestedRoleType(_T21, "T21.T11.T00.R2");
}
-
+
public void testCreation()
{
assertCreation(_T20);
assertCreation(_T21);
-
+
assertCreation(_T20T10T00R0);
assertCreation(_T20T10T00R1);
assertCreation(_T21T10T00R1);
assertCreation(_T21T10T00R2);
-
+
assertCreation(_T21T11T00R0);
assertCreation(_T21T11T00R1);
assertCreation(_T21T11T00R2);
}
-
+
public void testGetAllSubtypes_T20T10T00R0() throws JavaModelException
{
_focusType = _T20T10T00R0;
@@ -135,7 +135,7 @@ public class OTSubTypeHierarchyTest004 extends FileBasedHierarchyTest
IType[] expected = { _T21T11T00R0, _T21T11T00R1, _T21T11T00R2 };
IType[] actual = _testObj.getAllSubtypes(_focusType);
-
+
assertTrue(compareTypes(expected, actual));
}
@@ -147,24 +147,24 @@ public class OTSubTypeHierarchyTest004 extends FileBasedHierarchyTest
IType[] expected = { _T21T10T00R1, _T21T10T00R2, _T21T11T00R1, _T21T11T00R2 };
IType[] actual = hierarchy.getAllSubtypes(_focusType);
-
+
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetSubtypes_T20T10T00R0() throws JavaModelException
{
_focusType = _T20T10T00R0;
_testObj = createTypeHierarchy(_focusType);
IType[] expected = {
- _T21T11T00R0 // indirect sub
+ _T21T11T00R0 // indirect sub
};
IType[] actual = _testObj.getSubtypes(_focusType);
-
+
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetTSuperTypes_T21T11T00R0() throws JavaModelException
{
_focusType = _T21T11T00R0;
@@ -173,7 +173,7 @@ public class OTSubTypeHierarchyTest004 extends FileBasedHierarchyTest
IType[] expected = { _T20T10T00R0 };
IType[] actual = OTTypeHierarchies.getInstance().getTSuperTypes(hierarchy, _focusType);
-
+
assertTrue(compareTypes(expected, actual));
}
@@ -185,10 +185,10 @@ public class OTSubTypeHierarchyTest004 extends FileBasedHierarchyTest
IType[] expected = { _T21T10T00R1 };
IType[] actual = OTTypeHierarchies.getInstance().getTSuperTypes(hierarchy, _focusType);
-
+
assertTrue(compareTypes(expected, actual));
}
-
-
+
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest006.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest006.java
index c593cd438..a0b258ef6 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest006.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest006.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -38,17 +38,17 @@ public class OTSubTypeHierarchyTest006 extends FileBasedHierarchyTest
private IType _T1;
private IType _T2;
private IType _T3;
-
+
private IType _T1_R1;
private IType _T1_R2;
-
+
private IType _T2_R1;
private IType _phantom_T2_R2;
private IType _phantom_T3_R1;
private IType _T3_R2;
-
- private IType _classA;
+
+ private IType _classA;
@SuppressWarnings("unused")
private IType _objectType;
private IType _MyTeam_MyRole;
@@ -58,12 +58,12 @@ public class OTSubTypeHierarchyTest006 extends FileBasedHierarchyTest
private IType _MyTeam;
private IType _MySubTeam;
private IType _MyOtherSubTeam;
-
+
public OTSubTypeHierarchyTest006(String name)
{
super(name);
}
-
+
public static Test suite()
{
if (true)
@@ -71,50 +71,50 @@ public class OTSubTypeHierarchyTest006 extends FileBasedHierarchyTest
return new Suite(OTSubTypeHierarchyTest006.class);
}
@SuppressWarnings("unused")
- junit.framework.TestSuite suite =
+ junit.framework.TestSuite suite =
new Suite(OTSubTypeHierarchyTest006.class.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
String srcFolder = "src";
String pkg = "test006";
-
+
_T1 = getType(getTestProjectDir(), srcFolder, pkg, "T1");
_T2 = getType(getTestProjectDir(), srcFolder, pkg, "T2");
_T3 = getType(getTestProjectDir(), srcFolder, pkg, "T3");
-
+
_T1_R1 = getRole(_T1, "T1.R1");
_T1_R2 = getRole(_T1, "T1.R2");
-
+
_T2_R1 = getRole(_T2, "T2.R1");
_phantom_T2_R2 = new PhantomType(_T2, _T1_R2);
-
+
_phantom_T3_R1 = new PhantomType(_T3, _T2_R1);
_T3_R2 = getRole(_T3, "T3.R2");
-
+
_classA =
- getType(getTestProjectDir(), srcFolder, pkg, "ClassA");
-
+ getType(getTestProjectDir(), srcFolder, pkg, "ClassA");
+
_objectType =
getType(getTestProjectDir(), "rt.jar", "java.lang", "Object");
-
+
setupExtraStuff();
}
-
+
private void setupExtraStuff() throws JavaModelException
{
String srcFolder = "src";
String pkg = "simple";
-
+
_MyTeam = getType(getTestProjectDir(), srcFolder, pkg, "MyTeam");
_MySubTeam = getType(getTestProjectDir(), srcFolder, pkg, "MySubTeam");
_MyOtherSubTeam = getType(getTestProjectDir(), srcFolder, pkg, "MyOtherSubTeam");
-
+
_MyTeam_MyRole = getRole(_MyTeam, "MyTeam.MyRole");
_MySubTeam_MyRole = new PhantomType(_MySubTeam, _MyTeam_MyRole);
_MyOtherSubTeam_MyRole = getRole(_MyOtherSubTeam, "MyOtherSubTeam.MyRole");
@@ -125,33 +125,33 @@ public class OTSubTypeHierarchyTest006 extends FileBasedHierarchyTest
assertCreation(_T1);
assertCreation(_T2);
assertCreation(_T3);
-
+
assertCreation(_T1_R1);
assertCreation(_T1_R2);
-
+
assertCreation(_T2_R1);
assertCreation(_phantom_T2_R2);
-
+
assertCreation(_phantom_T3_R1);
assertCreation(_T3_R2);
-
+
assertCreation(_MyTeam);
assertCreation(_MySubTeam);
-
+
assertCreation(_MyTeam_MyRole);
assertCreation(_MySubTeam_MyRole);
}
-
-
+
+
public void testGetAllSubtypes_ClassA() throws JavaModelException
{
_focusType = _classA;
_testObj = createTypeHierarchy(_focusType);
-
- IType[] expected = new IType[] { _T1_R1, _T2_R1, _T3_R2 };
+
+ IType[] expected = new IType[] { _T1_R1, _T2_R1, _T3_R2 };
IType [] actual = _testObj.getAllSubtypes(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -160,42 +160,42 @@ public class OTSubTypeHierarchyTest006 extends FileBasedHierarchyTest
_focusType = _MyTeam_MyRole;
_testObj = createTypeHierarchy(_focusType);
OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true);
-
+
IType[] expected = new IType[] {
_MySubTeam_MyRole,
_MyOtherSubTeam_MyRole
};
IType [] actual = _testObj.getAllSubtypes(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSubtypes_ClassA_phantomMode() throws JavaModelException
{
_focusType = _classA;
_testObj = createTypeHierarchy(_focusType);
OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true);
-
+
IType[] expected = new IType[] { _T1_R1,
_T2_R1,
_T3_R2,
- _phantom_T3_R1 };
+ _phantom_T3_R1 };
IType [] actual = _testObj.getAllSubtypes(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetSubtypes_ClassA() throws JavaModelException
{
_focusType = _classA;
_testObj = createTypeHierarchy(_focusType);
-
- IType[] expected = new IType[] { _T1_R1, _T2_R1 };
+
+ IType[] expected = new IType[] { _T1_R1, _T2_R1 };
IType [] actual = _testObj.getSubtypes(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -203,13 +203,13 @@ public class OTSubTypeHierarchyTest006 extends FileBasedHierarchyTest
{
_focusType = _classA;
_testObj = createTypeHierarchy(_focusType);
-
- IType[] expected = new IType[] {
+
+ IType[] expected = new IType[] {
// _T3_R2 // indirect sub (picture is wrong, T3$R2 extends T3$R1)
- };
+ };
IType [] actual = _testObj.getSubtypes(_T2_R1);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -217,11 +217,11 @@ public class OTSubTypeHierarchyTest006 extends FileBasedHierarchyTest
{
_focusType = _classA;
_testObj = createTypeHierarchy(_focusType);
-
- IType[] expected = new IType[] { _T3_R2 };
+
+ IType[] expected = new IType[] { _T3_R2 };
IType [] actual = _testObj.getAllSubtypes(_T2_R1);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -230,14 +230,14 @@ public class OTSubTypeHierarchyTest006 extends FileBasedHierarchyTest
_focusType = _classA;
_testObj = createTypeHierarchy(_focusType);
OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true);
-
- IType[] expected = new IType[] {
+
+ IType[] expected = new IType[] {
// _T3_R2, // indirect sub (picture is wrong, T3$R2 extends T3$R1)
- _phantom_T3_R1
- };
+ _phantom_T3_R1
+ };
IType [] actual = _testObj.getSubtypes(_T2_R1);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -246,12 +246,12 @@ public class OTSubTypeHierarchyTest006 extends FileBasedHierarchyTest
_focusType = _classA;
_testObj = createTypeHierarchy(_focusType);
OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true);
-
- IType[] expected = new IType[] { _T3_R2, _phantom_T3_R1 };
+
+ IType[] expected = new IType[] { _T3_R2, _phantom_T3_R1 };
IType [] actual = _testObj.getAllSubtypes(_T2_R1);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest010.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest010.java
index fd5d3c0ed..b3029c4c0 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest010.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest010.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -37,7 +37,7 @@ import org.eclipse.objectteams.otdt.core.hierarchy.OTTypeHierarchies;
*/
public class OTSubTypeHierarchyTest010 extends FileBasedModelTest
{
-
+
private IType _focusType;
private IType _T1;
private IType _T2;
@@ -47,13 +47,13 @@ public class OTSubTypeHierarchyTest010 extends FileBasedModelTest
private IType _T3R1;
private IType _interfaceA;
private IType _objectType;
-
-
+
+
public OTSubTypeHierarchyTest010(String name)
{
super(name);
}
-
+
public static Test suite()
{
if (true)
@@ -61,44 +61,44 @@ public class OTSubTypeHierarchyTest010 extends FileBasedModelTest
return new Suite(OTSubTypeHierarchyTest010.class);
}
@SuppressWarnings("unused")
- junit.framework.TestSuite suite =
+ junit.framework.TestSuite suite =
new Suite(OTSubTypeHierarchyTest010.class.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
String srcFolder = "src";
String pkg = "test010";
-
- _T1 =
+
+ _T1 =
getType(getTestProjectDir(),
srcFolder,
pkg,
"T1");
- _T2 =
+ _T2 =
getType(getTestProjectDir(),
srcFolder,
pkg,
"T2");
-
- _T3 =
+
+ _T3 =
getType(getTestProjectDir(),
srcFolder,
pkg,
"T3");
- _interfaceA =
+ _interfaceA =
getType(getTestProjectDir(),
srcFolder,
pkg,
"InterfaceA");
-
- _objectType =
+
+ _objectType =
getType(getTestProjectDir(),
"rt.jar",
"java.lang",
@@ -110,7 +110,7 @@ public class OTSubTypeHierarchyTest010 extends FileBasedModelTest
}
-
+
public void testCreation()
{
assertCreation(_T1R1);
@@ -118,57 +118,57 @@ public class OTSubTypeHierarchyTest010 extends FileBasedModelTest
assertCreation(_T3R1);
assertCreation(_interfaceA);
}
-
-
+
+
public void testGetSubtypes_T1R1() throws JavaModelException
{
_focusType = _T1R1;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
IType[] actual = hierarchy.getSubtypes(_focusType);
IType[] expected = new IType[] { _T2R1 };
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
public void testGetSubtypes_T2R1() throws JavaModelException
{
_focusType = _T2R1;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
IType[] actual = hierarchy.getSubtypes(_focusType);
IType[] expected = new IType[] { _T3R1 };
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
public void testGetSubtypes_interfaceA() throws JavaModelException
{
_focusType = _interfaceA;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
IType[] actual = hierarchy.getSubtypes(_focusType);
IType[] expected = new IType[] { _T2R1 };
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSubtypes_T1R1() throws JavaModelException
{
_focusType = _T1R1;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
@@ -178,31 +178,31 @@ public class OTSubTypeHierarchyTest010 extends FileBasedModelTest
_T2R1,
_T3R1
};
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSubtypes_T2R1() throws JavaModelException
{
_focusType = _T2R1;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
IType[] actual = hierarchy.getAllSubtypes(_focusType);
IType[] expected = new IType[] { _T3R1 };
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSubtypes_interfaceA() throws JavaModelException
{
_focusType = _interfaceA;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
@@ -212,75 +212,75 @@ public class OTSubTypeHierarchyTest010 extends FileBasedModelTest
_T2R1,
_T3R1
};
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetRootClasses_T1R1() throws JavaModelException
{
_focusType = _T1R1;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
IType[] actual = hierarchy.getRootClasses();
IType[] expected = new IType[] { _objectType };
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetRootClasses_interfaceA() throws JavaModelException
{
_focusType = _interfaceA;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
IType[] actual = hierarchy.getRootClasses();
IType[] expected = new IType[] { _objectType };
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetRootInterfaces_interfaceA() throws JavaModelException
{
_focusType = _interfaceA;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
IType[] actual = hierarchy.getRootInterfaces();
IType[] expected = new IType[] { _focusType };
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
-
-
+
+
public void testGetType_T1R1() throws JavaModelException
{
_focusType = _T1R1;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
IType actual = hierarchy.getType();
IType expected = _focusType;
-
- assertTrue(compareTypes(expected, actual));
+
+ assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetImplementingClasses_interfaceA() throws JavaModelException
{
_focusType = _interfaceA;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
@@ -290,16 +290,16 @@ public class OTSubTypeHierarchyTest010 extends FileBasedModelTest
_T2R1,
// _T3R1 // indirect
};
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllInterfaces_interfaceA() throws JavaModelException
{
_focusType = _interfaceA;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
@@ -307,15 +307,15 @@ public class OTSubTypeHierarchyTest010 extends FileBasedModelTest
IType[] actual = hierarchy.getAllInterfaces();
IType[] expected = new IType[] { _interfaceA };
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
public void testGetAllClasses_T1R1() throws JavaModelException
{
_focusType = _T1R1;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
@@ -327,83 +327,83 @@ public class OTSubTypeHierarchyTest010 extends FileBasedModelTest
_T3R1,
_objectType
};
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
public void testGetTSuperTypes_T1R1() throws JavaModelException
{
_focusType = _T1R1;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
IType[] actual = OTTypeHierarchies.getInstance().getTSuperTypes(hierarchy, _T3R1);
IType[] expected = new IType[] { _T2R1 };
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
public void testGetAllTSuperTypes_T1R1() throws JavaModelException
{
_focusType = _T1R1;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
IType[] actual = OTTypeHierarchies.getInstance().getAllTSuperTypes(hierarchy, _T3R1);
IType[] expected = new IType[] { _T2R1, _T1R1 };
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetExplicitSuperclass_T2R1_in_T2R1() throws JavaModelException
{
_focusType = _T2R1;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(hierarchy, _T2R1);
IType expected = _objectType;
-
- assertTrue(compareTypes(expected, actual));
+
+ assertTrue(compareTypes(expected, actual));
}
public void testGetExplicitSuperclass_T3R1_in_T2R1() throws JavaModelException
{
_focusType = _T2R1;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(hierarchy, _T3R1);
IType expected = _objectType;
-
- assertTrue(compareTypes(expected, actual));
+
+ assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetExplicitSuperclass_T1R1_in_T2R1() throws JavaModelException
{
_focusType = _T2R1;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(hierarchy, _T1R1);
IType expected = _objectType;
-
- assertTrue(compareTypes(expected, actual));
+
+ assertTrue(compareTypes(expected, actual));
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest011.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest011.java
index 45e2a5287..8cf94ca6f 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest011.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest011.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -32,30 +32,30 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
import org.eclipse.objectteams.otdt.core.TypeHelper;
/**
- *
+ *
* @author Michael Krueger (mkr)
- * @version $Id: OTSubTypeHierarchyTest011.java 23494 2010-02-05 23:06:44Z stephan $
- *
+ * @version $Id: OTSubTypeHierarchyTest011.java 23494 2010-02-05 23:06:44Z stephan $
+ *
*/
public class OTSubTypeHierarchyTest011 extends FileBasedModelTest {
-
+
@SuppressWarnings("unused")
private ITypeHierarchy _testObj;
private IType _focusType;
private IType _T10;
- private IType _T21;
+ private IType _T21;
@SuppressWarnings("unused")
private IType _objectType;
private IType _T21T11T0R1;
private IType _T10T0R1;
private IType _T10T0R2;
-
-
+
+
public OTSubTypeHierarchyTest011(String name)
{
super(name);
}
-
+
public static Test suite()
{
if (true)
@@ -63,33 +63,33 @@ public class OTSubTypeHierarchyTest011 extends FileBasedModelTest {
return new Suite(OTSubTypeHierarchyTest011.class);
}
@SuppressWarnings("unused")
- junit.framework.TestSuite suite =
+ junit.framework.TestSuite suite =
new Suite(OTSubTypeHierarchyTest011.class.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
String srcFolder = "src";
String pkg = "test011";
-
- _T10 =
+
+ _T10 =
getType(getTestProjectDir(),
srcFolder,
pkg,
"T10");
- _T21 =
+ _T21 =
getType(getTestProjectDir(),
srcFolder,
pkg,
"T21");
-
-
- _objectType =
+
+
+ _objectType =
getType(getTestProjectDir(),
"rt.jar",
"java.lang",
@@ -101,7 +101,7 @@ public class OTSubTypeHierarchyTest011 extends FileBasedModelTest {
}
-
+
public void testCreation()
{
assertCreation(_T10);
@@ -110,27 +110,27 @@ public class OTSubTypeHierarchyTest011 extends FileBasedModelTest {
assertCreation(_T10T0R1);
assertCreation(_T10T0R2);
}
-
-
+
+
public void testGetSubtypes_T10T0R1() throws JavaModelException
{
_focusType = _T10T0R1;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
IType[] actual = hierarchy.getSubtypes(_focusType);
IType[] expected = new IType[] { _T21T11T0R1 };
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
public void testGetSubtypes_T10T0R2() throws JavaModelException
{
_focusType = _T10T0R2;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
@@ -140,40 +140,40 @@ public class OTSubTypeHierarchyTest011 extends FileBasedModelTest {
// _T21T11T0R1, // indirect sub
_T10T0R1
};
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
public void testGetAllSubtypes_T10T0R1() throws JavaModelException
{
_focusType = _T10T0R1;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
IType[] actual = hierarchy.getAllSubtypes(_focusType);
IType[] expected = new IType[] { _T21T11T0R1 };
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSubtypes_T10T0R2() throws JavaModelException
{
_focusType = _T10T0R2;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
IType[] actual = hierarchy.getAllSubtypes(_focusType);
IType[] expected = new IType[] { _T10T0R1, _T21T11T0R1 };
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest016.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest016.java
index f672f7d75..2eef5780a 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest016.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest016.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -33,13 +33,13 @@ import org.eclipse.objectteams.otdt.core.TypeHelper;
import org.eclipse.objectteams.otdt.core.hierarchy.OTTypeHierarchies;
/**
- *
+ *
* @author Michael Krueger (mkr)
- * @version $Id: OTSubTypeHierarchyTest016.java 23494 2010-02-05 23:06:44Z stephan $
- *
+ * @version $Id: OTSubTypeHierarchyTest016.java 23494 2010-02-05 23:06:44Z stephan $
+ *
*/
public class OTSubTypeHierarchyTest016 extends FileBasedModelTest {
-
+
@SuppressWarnings("unused")
private ITypeHierarchy _testObj;
private IType _focusType;
@@ -56,16 +56,16 @@ public class OTSubTypeHierarchyTest016 extends FileBasedModelTest {
private IType _T2R2;
private IType _T2R3;
private IType _T2R4;
-
+
@SuppressWarnings("unused")
private IType _objectType;
-
-
+
+
public OTSubTypeHierarchyTest016(String name)
{
super(name);
}
-
+
public static Test suite()
{
if (true)
@@ -73,44 +73,44 @@ public class OTSubTypeHierarchyTest016 extends FileBasedModelTest {
return new Suite(OTSubTypeHierarchyTest016.class);
}
@SuppressWarnings("unused")
- junit.framework.TestSuite suite =
+ junit.framework.TestSuite suite =
new Suite(OTSubTypeHierarchyTest016.class.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
String srcFolder = "src";
String pkg = "test016";
- _C1 =
+ _C1 =
getType(getTestProjectDir(),
srcFolder,
pkg,
"C1");
- _I1 =
+ _I1 =
getType(getTestProjectDir(),
srcFolder,
pkg,
"I1");
- _T1 =
+ _T1 =
getType(getTestProjectDir(),
srcFolder,
pkg,
"T1");
- _T2 =
+ _T2 =
getType(getTestProjectDir(),
srcFolder,
pkg,
"T2");
- _objectType =
+ _objectType =
getType(getTestProjectDir(),
"rt.jar",
"java.lang",
@@ -128,7 +128,7 @@ public class OTSubTypeHierarchyTest016 extends FileBasedModelTest {
}
-
+
public void testCreation()
{
assertCreation(_C1);
@@ -143,131 +143,131 @@ public class OTSubTypeHierarchyTest016 extends FileBasedModelTest {
assertCreation(_T2R3);
assertCreation(_T2R4);
}
-
+
public void testGetSubtypes_C1() throws JavaModelException
{
_focusType = _C1;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
IType[] actual = hierarchy.getSubtypes(_focusType);
IType[] expected = new IType[] { _T1R5 };
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetSubtypes_T1R1() throws JavaModelException
{
_focusType = _T1R1;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
IType[] actual = hierarchy.getSubtypes(_focusType);
IType[] expected = new IType[] { _T1R2, _T2R1 };
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
public void testGetSubtypes_T1R2() throws JavaModelException
{
_focusType = _T1R2;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
IType[] actual = hierarchy.getSubtypes(_focusType);
IType[] expected = new IType[] { _T1R3, _T2R2 };
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
public void testGetSubtypes_T1R3() throws JavaModelException
{
_focusType = _T1R3;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
IType[] actual = hierarchy.getSubtypes(_focusType);
IType[] expected = new IType[] { _T1R4, _T2R3 };
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetSubtypes_T1R4() throws JavaModelException
{
_focusType = _T1R4;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
IType[] actual = hierarchy.getSubtypes(_focusType);
IType[] expected = new IType[] { _T2R4 };
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetExplicitSuperclass_T1R2() throws JavaModelException
{
_focusType = _T1R2;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false);
hierarchy.refresh(new NullProgressMonitor());
IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(hierarchy, _focusType);
IType expected = _T1R1;
-
- assertTrue(compareTypes(expected, actual));
+
+ assertTrue(compareTypes(expected, actual));
}
public void testGetExplicitSuperclass_T1R3() throws JavaModelException
{
_focusType = _T1R3;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(hierarchy, _focusType);
IType expected = _T1R2;
-
- assertTrue(compareTypes(expected, actual));
+
+ assertTrue(compareTypes(expected, actual));
}
public void testGetExplicitSuperclass_T1R4() throws JavaModelException
{
_focusType = _T1R4;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(hierarchy, _focusType);
IType expected = _T1R3;
-
- assertTrue(compareTypes(expected, actual));
+
+ assertTrue(compareTypes(expected, actual));
}
public void testGetExplicitSuperclass_T1R5() throws JavaModelException
{
_focusType = _T1R5;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
@@ -279,98 +279,98 @@ public class OTSubTypeHierarchyTest016 extends FileBasedModelTest {
+ " extends "
+ expected.getElementName()
+ " not in TypeHierarchy!";
-
- assertTrue(errorMsg, compareTypes(expected, actual));
+
+ assertTrue(errorMsg, compareTypes(expected, actual));
}
public void testTypeHierarchy_GetSuperclass_T1R5() throws JavaModelException
{
_focusType = _T1R5;
-
-
+
+
ITypeHierarchy hierarchy = _focusType.newSupertypeHierarchy(new NullProgressMonitor());
IType actual = hierarchy.getSuperclass(_focusType);
IType expected = _C1;
-
+
String errorMsg = _focusType.getElementName()
+ " extends "
+ expected.getElementName()
+ " not in TypeHierarchy!";
- assertTrue(errorMsg, compareTypes(expected, actual));
+ assertTrue(errorMsg, compareTypes(expected, actual));
}
-
-
+
+
public void testGetSuperInterfaces_T1R5() throws JavaModelException
{
_focusType = _T1R5;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
IType[] actual = hierarchy.getSuperInterfaces(_focusType);
IType[] expected = new IType[] { _I1 };
-
- assertTrue(compareTypes(expected, actual));
+
+ assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetTSuperTypes_T2R1() throws JavaModelException
{
_focusType = _T2R1;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
IType[] actual = OTTypeHierarchies.getInstance().getTSuperTypes(hierarchy, _focusType);
IType[] expected = new IType[] {_T1R1 };
-
- assertTrue(compareTypes(expected, actual));
+
+ assertTrue(compareTypes(expected, actual));
}
public void testGetTSuperTypes_T2R2() throws JavaModelException
{
_focusType = _T2R2;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
IType[] actual = OTTypeHierarchies.getInstance().getTSuperTypes(hierarchy, _focusType);
IType[] expected = new IType[] {_T1R2 };
-
- assertTrue(compareTypes(expected, actual));
+
+ assertTrue(compareTypes(expected, actual));
}
public void testGetTSuperTypes_T2R3() throws JavaModelException
{
_focusType = _T2R3;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
IType[] actual = OTTypeHierarchies.getInstance().getTSuperTypes(hierarchy, _focusType);
IType[] expected = new IType[] {_T1R3 };
-
- assertTrue(compareTypes(expected, actual));
+
+ assertTrue(compareTypes(expected, actual));
}
public void testGetTSuperTypes_T2R4() throws JavaModelException
{
_focusType = _T2R4;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
hierarchy.refresh(new NullProgressMonitor());
IType[] actual = OTTypeHierarchies.getInstance().getTSuperTypes(hierarchy, _focusType);
IType[] expected = new IType[] {_T1R4 };
-
- assertTrue(compareTypes(expected, actual));
+
+ assertTrue(compareTypes(expected, actual));
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest017.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest017.java
index 96675ee7d..180d06d97 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest017.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest017.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -33,13 +33,13 @@ import org.eclipse.objectteams.otdt.internal.core.PhantomType;
import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
/**
- *
+ *
* @author Michael Krueger (mkr)
- * @version $Id: OTSubTypeHierarchyTest017.java 23494 2010-02-05 23:06:44Z stephan $
- *
+ * @version $Id: OTSubTypeHierarchyTest017.java 23494 2010-02-05 23:06:44Z stephan $
+ *
*/
public class OTSubTypeHierarchyTest017 extends FileBasedModelTest {
-
+
private TypeHierarchy _testObj;
@SuppressWarnings("unused")
private IType _focusType;
@@ -63,17 +63,17 @@ public class OTSubTypeHierarchyTest017 extends FileBasedModelTest {
private IType _phantom_TE_R1;
private IType _phantom_TD_R2;
-
-
+
+
@SuppressWarnings("unused")
private IType _objectType;
-
-
+
+
public OTSubTypeHierarchyTest017(String name)
{
super(name);
}
-
+
public static Test suite()
{
if (true)
@@ -81,16 +81,16 @@ public class OTSubTypeHierarchyTest017 extends FileBasedModelTest {
return new Suite(OTSubTypeHierarchyTest017.class);
}
@SuppressWarnings("unused")
- junit.framework.TestSuite suite =
+ junit.framework.TestSuite suite =
new Suite(OTSubTypeHierarchyTest017.class.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
String srcFolder = "src";
String pkg = "test017";
@@ -100,7 +100,7 @@ public class OTSubTypeHierarchyTest017 extends FileBasedModelTest {
_TD = getType(getTestProjectDir(), srcFolder, pkg, "TD");
_TE = getType(getTestProjectDir(), srcFolder, pkg, "TE");
- _objectType =
+ _objectType =
getType(getTestProjectDir(),
"rt.jar",
"java.lang",
@@ -116,7 +116,7 @@ public class OTSubTypeHierarchyTest017 extends FileBasedModelTest {
_TD_R1 = TypeHelper.findNestedRoleType(_TD, "TD.R1");
_TE_R2 = TypeHelper.findNestedRoleType(_TE, "TE.R2");
_TE_R3 = TypeHelper.findNestedRoleType(_TE, "TE.R3");
-
+
_phantom_TB_R3 = new PhantomType(_TB, _TA_R3);
_phantom_TD_R2 = new PhantomType(_TD, _TB_R2);
_phantom_TE_R1 = new PhantomType(_TE, _TD_R1);
@@ -125,12 +125,12 @@ public class OTSubTypeHierarchyTest017 extends FileBasedModelTest {
private void initHierarchy(IType focus, boolean computeSubtypes)
throws JavaModelException
- {
+ {
_testObj = new TypeHierarchy(focus, null, focus.getJavaProject(), computeSubtypes);
_testObj.refresh(new NullProgressMonitor());
_focusType = focus;
}
-
+
public void testCreation()
{
assertCreation(_TA);
@@ -149,21 +149,21 @@ public class OTSubTypeHierarchyTest017 extends FileBasedModelTest {
assertCreation(_TC_R3);
assertCreation(_TD_R1);
-
+
assertCreation(_TE_R2);
- assertCreation(_TE_R3);
+ assertCreation(_TE_R3);
}
public void testGetSubtypes_TD_R1() throws JavaModelException
{
initHierarchy(_TA_R1, true);
-
- IType[] expected = new IType[] {
-// _TB_R2, // not sub of TD$R1
+
+ IType[] expected = new IType[] {
+// _TB_R2, // not sub of TD$R1
_TE_R2 // indirect
};
IType[] actual = _testObj.getSubtypes(_TD_R1);
-
+
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -172,13 +172,13 @@ public class OTSubTypeHierarchyTest017 extends FileBasedModelTest {
{
initHierarchy(_TA_R1, true);
OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true);
-
- IType[] expected = new IType[] {
+
+ IType[] expected = new IType[] {
_phantom_TE_R1,
_phantom_TD_R2
};
IType[] actual = _testObj.getSubtypes(_TD_R1);
-
+
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -186,15 +186,15 @@ public class OTSubTypeHierarchyTest017 extends FileBasedModelTest {
public void testGetAllSubtypes_TD_R1() throws JavaModelException
{
initHierarchy(_TA_R1, true);
-
- IType[] expected = new IType[] {
-// _TA_R3, // not sub of TD$R1
-// _TB_R2, // not sub of TD$R1
- _TE_R2,
- _TE_R3
+
+ IType[] expected = new IType[] {
+// _TA_R3, // not sub of TD$R1
+// _TB_R2, // not sub of TD$R1
+ _TE_R2,
+ _TE_R3
};
IType[] actual = _testObj.getAllSubtypes(_TD_R1);
-
+
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -202,16 +202,16 @@ public class OTSubTypeHierarchyTest017 extends FileBasedModelTest {
public void testGetSubtypes_TB_R2() throws JavaModelException
{
initHierarchy(_TA_R1, true);
-
- IType[] expected = new IType[] {
-// _TA_R3, // not sub of TB$R2
- _TC_R2,
+
+ IType[] expected = new IType[] {
+// _TA_R3, // not sub of TB$R2
+ _TC_R2,
_TC_R3, // indirect
_TE_R2, // indirect
_TE_R3 // indirect
};
IType[] actual = _testObj.getSubtypes(_TB_R2);
-
+
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -221,13 +221,13 @@ public class OTSubTypeHierarchyTest017 extends FileBasedModelTest {
initHierarchy(_TA_R1, true);
OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true);
- IType[] expected = new IType[] {
- _TC_R2,
+ IType[] expected = new IType[] {
+ _TC_R2,
_phantom_TD_R2,
_phantom_TB_R3,
};
IType[] actual = _testObj.getSubtypes(_TB_R2);
-
+
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -235,15 +235,15 @@ public class OTSubTypeHierarchyTest017 extends FileBasedModelTest {
public void testGetAllSubtypes_TB_R2() throws JavaModelException
{
initHierarchy(_TA_R1, true);
-
- IType[] expected = new IType[] {
-// _TA_R3, // not sub of TB$R2
+
+ IType[] expected = new IType[] {
+// _TA_R3, // not sub of TB$R2
_TC_R2, _TC_R3, _TE_R2, _TE_R3 };
IType[] actual = _testObj.getAllSubtypes(_TB_R2);
-
+
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest018.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest018.java
index 4e14e7e02..f5ff8546b 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest018.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest018.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -32,13 +32,13 @@ import org.eclipse.objectteams.otdt.core.TypeHelper;
import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
/**
- *
+ *
* @author Michael Krueger (mkr)
- * @version $Id: OTSubTypeHierarchyTest018.java 23494 2010-02-05 23:06:44Z stephan $
- *
+ * @version $Id: OTSubTypeHierarchyTest018.java 23494 2010-02-05 23:06:44Z stephan $
+ *
*/
public class OTSubTypeHierarchyTest018 extends FileBasedModelTest {
-
+
private ITypeHierarchy _testObj;
@SuppressWarnings("unused")
private IType _focusType;
@@ -54,22 +54,22 @@ public class OTSubTypeHierarchyTest018 extends FileBasedModelTest {
private IType _TA2_TB2_R2;
private IType _TA3_TB2_R2;
- private IType _TZ1_TX1;
+ private IType _TZ1_TX1;
+
+ private IType _TZ1_TX1_TB2_R2;
+ private IType _TZ1_TX2_TB2_R2;
+ private IType _TZ2_TX2_TB2_R1;
- private IType _TZ1_TX1_TB2_R2;
- private IType _TZ1_TX2_TB2_R2;
- private IType _TZ2_TX2_TB2_R1;
-
@SuppressWarnings("unused")
private IType _objectType;
-
-
+
+
public OTSubTypeHierarchyTest018(String name)
{
super(name);
}
-
+
public static Test suite()
{
if (true)
@@ -77,16 +77,16 @@ public class OTSubTypeHierarchyTest018 extends FileBasedModelTest {
return new Suite(OTSubTypeHierarchyTest018.class);
}
@SuppressWarnings("unused")
- junit.framework.TestSuite suite =
+ junit.framework.TestSuite suite =
new Suite(OTSubTypeHierarchyTest018.class.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
String srcFolder = "src";
String pkg = "test018";
@@ -96,7 +96,7 @@ public class OTSubTypeHierarchyTest018 extends FileBasedModelTest {
_TZ1 = getType(getTestProjectDir(), srcFolder, pkg, "TZ1");
_TZ2 = getType(getTestProjectDir(), srcFolder, pkg, "TZ2");
- _objectType =
+ _objectType =
getType(getTestProjectDir(),
"rt.jar",
"java.lang",
@@ -117,12 +117,12 @@ public class OTSubTypeHierarchyTest018 extends FileBasedModelTest {
private void initHierarchy(IType focus, boolean computeSubtypes)
throws JavaModelException
- {
+ {
_testObj = new TypeHierarchy(focus, null, focus.getJavaProject(), computeSubtypes);
_testObj.refresh(new NullProgressMonitor());
_focusType = focus;
}
-
+
public void testCreation()
{
assertCreation(_TA1);
@@ -147,7 +147,7 @@ public class OTSubTypeHierarchyTest018 extends FileBasedModelTest {
public void testGetAllSubtypes_TA1_TB1_R1() throws JavaModelException
{
initHierarchy(_TA1_TB1_R1, true);
-
+
IType[] expected = new IType[] { _TA2_TB1_R1,
_TA2_TB2_R1,
_TA2_TB2_R2,
@@ -155,14 +155,14 @@ public class OTSubTypeHierarchyTest018 extends FileBasedModelTest {
_TZ1_TX1_TB2_R2,
_TZ1_TX2_TB2_R2,
_TZ2_TX2_TB2_R1
- };
-
-
+ };
+
+
IType[] actual = _testObj.getAllSubtypes(_TA1_TB1_R1);
-
+
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest019.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest019.java
index beafda53d..2ca013b8e 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest019.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest019.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -35,11 +35,11 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
*/
public class OTSubTypeHierarchyTest019 extends FileBasedModelTest
{
-
+
private TypeHierarchy _testObj;
private IType _focusType;
-
+
private IType _TA;
private IType _TB;
private IType _TC;
@@ -60,12 +60,12 @@ public class OTSubTypeHierarchyTest019 extends FileBasedModelTest
private IType _TB_R14;
private IType _TB_R15;
-
+
public OTSubTypeHierarchyTest019(String name)
{
super(name);
}
-
+
public static Test suite()
{
if (true)
@@ -73,16 +73,16 @@ public class OTSubTypeHierarchyTest019 extends FileBasedModelTest
return new Suite(OTSubTypeHierarchyTest019.class);
}
@SuppressWarnings("unused")
- junit.framework.TestSuite suite =
+ junit.framework.TestSuite suite =
new Suite(OTSubTypeHierarchyTest019.class.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
String srcFolder = "src";
String pkg = "test019";
@@ -90,7 +90,7 @@ public class OTSubTypeHierarchyTest019 extends FileBasedModelTest
srcFolder,
pkg,
"TA");
-
+
_TB = getType(getTestProjectDir(),
srcFolder,
pkg,
@@ -116,9 +116,9 @@ public class OTSubTypeHierarchyTest019 extends FileBasedModelTest
_TB_R13 = getRole(_TB, "TB.R13");
_TB_R14 = getRole(_TB, "TB.R14");
_TB_R15 = getRole(_TB, "TB.R15");
-
+
}
-
+
public void testCreation()
{
assertCreation(_TA);
@@ -139,17 +139,17 @@ public class OTSubTypeHierarchyTest019 extends FileBasedModelTest
assertCreation(_TB_R12);
assertCreation(_TB_R13);
assertCreation(_TB_R14);
- assertCreation(_TB_R15);
+ assertCreation(_TB_R15);
}
-
+
public void testOTTypeHiearchyCreation() throws JavaModelException
{
_focusType = _TB_R1;
_testObj = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true);
_testObj.refresh(new NullProgressMonitor());
-
+
assertTrue(true);
}
}
-
+
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTTypeHierarchyBuilderTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTTypeHierarchyBuilderTest.java
index 6d6ebba80..ac7f9d5dd 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTTypeHierarchyBuilderTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTTypeHierarchyBuilderTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -35,13 +35,13 @@ import org.eclipse.objectteams.otdt.core.TypeHelper;
import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
/**
- *
+ *
* @author Michael Krueger (mkr)
- *
+ *
*/
-public class OTTypeHierarchyBuilderTest extends FileBasedModelTest
+public class OTTypeHierarchyBuilderTest extends FileBasedModelTest
{
-
+
@SuppressWarnings("unused")
private ITypeHierarchy _testObj;
private IType _focusType;
@@ -49,7 +49,7 @@ public class OTTypeHierarchyBuilderTest extends FileBasedModelTest
private IType _objectType;
private IType _T20;
private IType _T21;
-
+
private IType _T20T10T00R0;
private IType _T20T10T00R1;
private IType _T21T10T00R1;
@@ -57,45 +57,45 @@ public class OTTypeHierarchyBuilderTest extends FileBasedModelTest
private IType _T21T11T00R0;
private IType _T21T11T00R1;
private IType _T21T11T00R2;
-
-
+
+
public OTTypeHierarchyBuilderTest(String name)
{
super(name);
}
-
+
public static Test suite()
{
if (true)
return new Suite(OTTypeHierarchyBuilderTest.class);
@SuppressWarnings("unused")
- junit.framework.TestSuite suite =
+ junit.framework.TestSuite suite =
new Suite(OTTypeHierarchyBuilderTest.class.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
String srcFolder = "src";
String pkg = "test004";
-
- _T20 =
+
+ _T20 =
getType(getTestProjectDir(),
srcFolder,
pkg,
"T20");
- _T21 =
+ _T21 =
getType(getTestProjectDir(),
srcFolder,
pkg,
"T21");
-
-
- _objectType =
+
+
+ _objectType =
getType(getTestProjectDir(),
"rt.jar",
"java.lang",
@@ -106,29 +106,29 @@ public class OTTypeHierarchyBuilderTest extends FileBasedModelTest
_T21T10T00R1 = TypeHelper.findNestedRoleType(_T21, "T21.T10.T00.R1");
_T21T10T00R2 = TypeHelper.findNestedRoleType(_T21, "T21.T10.T00.R2");
-
+
_T21T11T00R0 = TypeHelper.findNestedRoleType(_T21, "T21.T11.T00.R0");
_T21T11T00R1 = TypeHelper.findNestedRoleType(_T21, "T21.T11.T00.R1");
_T21T11T00R2 = TypeHelper.findNestedRoleType(_T21, "T21.T11.T00.R2");
}
-
+
public void testCreation()
{
assertCreation(_T20);
assertCreation(_T21);
-
+
assertCreation(_T20T10T00R0);
assertCreation(_T20T10T00R1);
assertCreation(_T21T10T00R1);
assertCreation(_T21T10T00R2);
-
+
assertCreation(_T21T11T00R0);
assertCreation(_T21T11T00R1);
assertCreation(_T21T11T00R2);
}
-
+
public void testGetResult_T20T10T00R0() throws CoreException
{
_focusType = _T20T10T00R0;
@@ -136,10 +136,10 @@ public class OTTypeHierarchyBuilderTest extends FileBasedModelTest
HierarchyBuilder builder = new IndexBasedHierarchyBuilder(hierarchy, SearchEngine.createJavaSearchScope(new IJavaElement[] {_focusType.getJavaProject()} ));
IType[] expected = { _T21T11T00R0, _T21T11T00R1, _T21T11T00R2 };
-
+
builder.build(true);
IType[] actual = hierarchy.getAllSubtypes(_focusType);
-
+
assertTrue(compareTypes(expected, actual));
}
@@ -148,12 +148,12 @@ public class OTTypeHierarchyBuilderTest extends FileBasedModelTest
_focusType = _T20T10T00R1;
TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false);
HierarchyBuilder builder = new IndexBasedHierarchyBuilder(hierarchy, SearchEngine.createJavaSearchScope(new IJavaElement[] {_focusType.getJavaProject()} ));
-
+
IType[] expected = { _T21T10T00R1, _T21T10T00R2, _T21T11T00R1, _T21T11T00R2 };
builder.build(true);
IType[] actual = hierarchy.getAllSubtypes(_focusType);
-
+
assertTrue(compareTypes(expected, actual));
}
@@ -162,12 +162,12 @@ public class OTTypeHierarchyBuilderTest extends FileBasedModelTest
_focusType = javaProject.findType("java.lang.Object");
TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false);
HierarchyBuilder builder = new IndexBasedHierarchyBuilder(hierarchy, SearchEngine.createJavaSearchScope(new IJavaElement[] {_focusType.getJavaProject()} ));
-
+
builder.build(true);
IType[] actual = hierarchy.getAllSubtypes(_focusType);
assertNotNull(actual);
-
+
// no real assert not throwing NPE is all we need to check
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/AllTests.java
index bfb1910b3..53e429851 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/AllTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/HierarchyResolverTestWithSrc003.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/HierarchyResolverTestWithSrc003.java
index 4e7f0933b..1e71664f8 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/HierarchyResolverTestWithSrc003.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/HierarchyResolverTestWithSrc003.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -38,17 +38,17 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
*/
@SuppressWarnings("unused")
public class HierarchyResolverTestWithSrc003 extends FileBasedModelTest {
-
+
private ITypeHierarchy _testObj;
private NullProgressMonitor _monitor;
-
+
private IType _focusType;
-
+
private IRoleType _T1_R1;
private IRoleType _T1_R2;
-
+
private IRoleType _T2_R2;
-
+
private IRoleType _T3_R1;
private IRoleType _T3_R2;
@@ -57,120 +57,120 @@ public class HierarchyResolverTestWithSrc003 extends FileBasedModelTest {
private IRoleType _T4_R3;
private IType _interfaceA;
-
+
private IType _objectType;
-
+
public HierarchyResolverTestWithSrc003(String name)
{
super(name);
}
-
+
public static Test suite()
{
if (true)
{
return new Suite(HierarchyResolverTestWithSrc003.class);
}
- junit.framework.TestSuite suite =
+ junit.framework.TestSuite suite =
new Suite(HierarchyResolverTestWithSrc003.class.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
_monitor = new NullProgressMonitor();
-
+
String srcFolder = "src";
String pkg = "test003";
-
- _T1_R1 =
+
+ _T1_R1 =
getRole(getTestProjectDir(),
srcFolder,
pkg,
"T1",
"R1");
-
- _T1_R2 =
+
+ _T1_R2 =
getRole(getTestProjectDir(),
srcFolder,
pkg,
"T1",
"R2");
-
- _T2_R2 =
+
+ _T2_R2 =
getRole(getTestProjectDir(),
srcFolder,
pkg,
"T2",
"R2");
-
-
- _T3_R1 =
+
+
+ _T3_R1 =
getRole(getTestProjectDir(),
srcFolder,
pkg,
"T3",
"R1");
-
- _T3_R2 =
+
+ _T3_R2 =
getRole(getTestProjectDir(),
srcFolder,
pkg,
"T3",
"R2");
-
-
- _T4_R1 =
+
+
+ _T4_R1 =
getRole(getTestProjectDir(),
srcFolder,
pkg,
"T4",
"R1");
-
- _T4_R2 =
+
+ _T4_R2 =
getRole(getTestProjectDir(),
srcFolder,
pkg,
"T4",
"R2");
-
- _T4_R3 =
+
+ _T4_R3 =
getRole(getTestProjectDir(),
srcFolder,
pkg,
"T4",
"R3");
- _interfaceA =
+ _interfaceA =
getType(getTestProjectDir(),
srcFolder,
pkg,
"InterfaceA");
-
- _objectType =
+
+ _objectType =
getType(getTestProjectDir(),
"rt.jar",
"java.lang",
"Object");
}
-
-
- public void testGetSuperInterfacesFor_T2R2()
+
+
+ public void testGetSuperInterfacesFor_T2R2()
throws JavaModelException
{
_focusType = (IType)_T2_R2.getCorrespondingJavaElement();
-
-
+
+
ITypeHierarchy hierarchy = _focusType.newTypeHierarchy(_monitor);
IType[] expected = new IType[] { _interfaceA };
-
+
IType [] actual = ((TypeHierarchy)hierarchy).getSuperInterfaces(_focusType);
assertEquals(expected.length, actual.length);
-
+
assertTrue("Wrong Types", compareTypes(expected, actual));
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest001.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest001.java
index 0bd6a8125..6bbbf4a75 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest001.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest001.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -44,42 +44,42 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest
private IType _T6;
private IType _T7;
private IType _T8;
-
+
private IType _T1_R1;
- private IType _T1_R2;
+ private IType _T1_R2;
private IType _T2_R1;
private IType _T2_R2;
-
+
private IType _T3_R1;
private IType _T3_R2;
-
+
private IType _phantom_T4_R1;
private IType _T4_R2;
-
+
private IType _T5_R1;
private IType _T5_R2;
private IType _T5_R3;
-
+
private IType _T6_R1;
private IType _phantom_T6_R2;
-
+
private IType _phantom_T7_R1;
private IType _T7_R2;
- private IType _T7_R3;
-
+ private IType _T7_R3;
+
private IType _phantom_T8_R1;
private IType _T8_R2;
-
+
private IType _objectType;
-
-
+
+
public OTSuperTypeHierarchyTest001(String name)
{
super(name);
}
-
-
+
+
public static Test suite()
{
if (true)
@@ -87,20 +87,20 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest
return new Suite(OTSuperTypeHierarchyTest001.class);
}
@SuppressWarnings("unused")
- junit.framework.TestSuite suite =
+ junit.framework.TestSuite suite =
new Suite(OTSuperTypeHierarchyTest001.class.getName());
return suite;
}
-
-
+
+
public void setUpSuite() throws Exception
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
String srcFolder = "src";
String pkg = "test001";
-
+
_T1 = getType(getTestProjectDir(), srcFolder, pkg, "T1");
_T2 = getType(getTestProjectDir(), srcFolder, pkg, "T2");
_T3 = getType(getTestProjectDir(), srcFolder, pkg, "T3");
@@ -128,18 +128,18 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest
_T6_R1 = getRole(_T6, "T6.R1");
_phantom_T6_R2 = new PhantomType(_T6, _T2_R2);
-
+
_phantom_T7_R1 = new PhantomType(_T7, _T5_R1);
_T7_R2 = getRole(_T7, "T7.R2");
_T7_R3 = getRole(_T7, "T7.R3");
_phantom_T8_R1 = new PhantomType(_T8, _T6_R1);
_T8_R2 = getRole(_T8, "T8.R2");
-
+
_objectType = getType(getTestProjectDir(), "rt.jar", "java.lang", "Object");
}
-
-
+
+
public void testCreation()
{
assertCreation(_T1);
@@ -169,7 +169,7 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest
assertCreation(_T6_R1);
assertCreation(_phantom_T6_R2);
-
+
assertCreation(_phantom_T7_R1);
assertCreation(_T7_R2);
assertCreation(_T7_R3);
@@ -182,34 +182,34 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest
{
_focusType = _T8_R2;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType expected = _T6_R1;
IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(_testObj, _focusType);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetExplicitSuperclass_T8R2_phantomMode() throws JavaModelException
{
_focusType = _T8_R2;
_testObj = createSuperTypeHierarchy(_focusType);
OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true);
-
+
IType expected = _phantom_T8_R1;
IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(_testObj, _focusType);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetTSuperTypes_T8R2() throws JavaModelException
{
_focusType = _T8_R2;
_testObj = createSuperTypeHierarchy(_focusType);
-
- IType[] expected = new IType[] { _T2_R2 };
+
+ IType[] expected = new IType[] { _T2_R2 };
IType[] actual = OTTypeHierarchies.getInstance().getTSuperTypes(_testObj, _focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -218,26 +218,26 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest
_focusType = _T8_R2;
_testObj = createSuperTypeHierarchy(_focusType);
OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true);
-
- IType[] expected = new IType[] { _phantom_T6_R2 };
+
+ IType[] expected = new IType[] { _phantom_T6_R2 };
IType[] actual = OTTypeHierarchies.getInstance().getTSuperTypes(_testObj, _focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllTSuperTypes_T8R2() throws JavaModelException
{
_focusType = _T8_R2;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _T2_R2,
_T1_R2
};
-
+
IType[] actual = OTTypeHierarchies.getInstance().getAllTSuperTypes(_testObj, _focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -246,30 +246,30 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest
_focusType = _T8_R2;
_testObj = createSuperTypeHierarchy(_focusType);
OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true);
-
+
IType[] expected = new IType[] { _phantom_T6_R2,
_T2_R2,
_T1_R2
};
-
+
IType[] actual = OTTypeHierarchies.getInstance().getAllTSuperTypes(_testObj, _focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetSuperclasses_T8R2() throws JavaModelException
{
_focusType = _T8_R2;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _T6_R1,
_T2_R2,
};
-
+
IType[] actual = OTTypeHierarchies.getInstance().getSuperclasses(_testObj, _focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -278,23 +278,23 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest
_focusType = _T8_R2;
_testObj = createSuperTypeHierarchy(_focusType);
OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true);
-
+
IType[] expected = new IType[] { _phantom_T8_R1,
_phantom_T6_R2
};
-
+
IType[] actual = OTTypeHierarchies.getInstance().getSuperclasses(_testObj, _focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
-
+
+
public void testGetAllSuperclasses_T8R2() throws JavaModelException
{
_focusType = _T8_R2;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _objectType,
_T6_R1,
_T2_R2,
@@ -302,10 +302,10 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest
_T1_R2,
_T1_R1
};
-
+
IType[] actual = _testObj.getAllSuperclasses(_focusType);
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -324,7 +324,7 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest
_T1_R2,
_T1_R1
};
-
+
IType[] actual = _testObj.getAllSuperclasses(_focusType);
assertEquals(expected.length, actual.length);
@@ -336,48 +336,48 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest
{
_focusType = _T6_R1;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _objectType,
_T2_R1,
};
-
+
IType[] actual = OTTypeHierarchies.getInstance().getSuperclasses(_testObj, _focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetSuperclasses_T6R1_phantomMode() throws JavaModelException
{
_focusType = _T6_R1;
_testObj = createSuperTypeHierarchy(_focusType);
OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true);
-
+
IType[] expected = new IType[] { _objectType,
_T2_R1,
};
-
+
IType[] actual = OTTypeHierarchies.getInstance().getSuperclasses(_testObj, _focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclasses_T6R1() throws JavaModelException
{
_focusType = _T6_R1;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _objectType,
_T2_R1,
_T1_R1
};
-
+
IType[] actual = _testObj.getAllSuperclasses(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -386,92 +386,92 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest
{
_focusType = _T2_R2;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _T2_R1,
_T1_R2
};
-
+
IType[] actual = OTTypeHierarchies.getInstance().getSuperclasses(_testObj, _focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclasses_T2R2() throws JavaModelException
{
_focusType = _T2_R2;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _objectType,
_T2_R1,
_T1_R1,
_T1_R2
};
-
+
IType[] actual = _testObj.getAllSuperclasses(_focusType);
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
-
+
+
public void testGetAllSuperclasses_T2R1() throws JavaModelException
{
_focusType = _T2_R1;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _objectType,
_T1_R1
};
-
+
IType[] actual = _testObj.getAllSuperclasses(_focusType);
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
-
+
+
public void testGetAllSuperclasses_T1R1() throws JavaModelException
{
_focusType = _T1_R1;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _objectType };
-
+
IType[] actual = _testObj.getAllSuperclasses(_focusType);
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
-
+
+
public void testGetAllSuperclasses_T1R2() throws JavaModelException
{
_focusType = _T1_R2;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _objectType };
-
+
IType[] actual = _testObj.getAllSuperclasses(_focusType);
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetSuperclasses_T7R3() throws JavaModelException
{
_focusType = _T7_R3;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _T5_R1,
_T5_R3
};
-
+
IType[] actual = OTTypeHierarchies.getInstance().getSuperclasses(_testObj, _focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -481,43 +481,43 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest
_focusType = _T7_R3;
_testObj = createSuperTypeHierarchy(_focusType);
OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true);
-
+
IType[] expected = new IType[] { _phantom_T7_R1,
_T5_R3
};
-
+
IType[] actual = OTTypeHierarchies.getInstance().getSuperclasses(_testObj, _focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclasses_T7R3() throws JavaModelException
{
_focusType = _T7_R3;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _objectType,
_T5_R1,
_T2_R1,
_T1_R1,
_T5_R3
};
-
+
IType[] actual = _testObj.getAllSuperclasses(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclasses_T7R3_phantomMode() throws JavaModelException
{
_focusType = _T7_R3;
_testObj = createSuperTypeHierarchy(_focusType);
OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true);
-
+
IType[] expected = new IType[] { _objectType,
_phantom_T7_R1,
_T5_R1,
@@ -525,19 +525,19 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest
_T1_R1,
_T5_R3
};
-
+
IType[] actual = _testObj.getAllSuperclasses(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclasses_T7R2() throws JavaModelException
{
_focusType = _T7_R2;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _objectType,
_T7_R3,
_T5_R1,
@@ -548,20 +548,20 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest
_T1_R2,
_T1_R1
};
-
+
IType[] actual = _testObj.getAllSuperclasses(_T7_R2);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
-
+
+
public void testGetAllSuperclasses_T7R2_phantomMode() throws JavaModelException
{
_focusType = _T7_R2;
_testObj = createSuperTypeHierarchy(_focusType);
OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true);
-
+
IType[] expected = new IType[] { _objectType,
_T7_R3,
_phantom_T7_R1,
@@ -573,54 +573,54 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest
_T1_R2,
_T1_R1
};
-
+
IType[] actual = _testObj.getAllSuperclasses(_T7_R2);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclasses_T7R3inT7R2() throws JavaModelException
{
_focusType = _T7_R2;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _objectType,
_T5_R1,
_T5_R3,
_T2_R1,
_T1_R1
};
-
+
IType[] actual = _testObj.getAllSuperclasses(_T7_R3);
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclasses_T2R1inT7R2() throws JavaModelException
{
_focusType = _T7_R2;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _objectType,
_T1_R1
};
-
+
IType[] actual = _testObj.getAllSuperclasses(_T2_R1);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclasses_T5R2() throws JavaModelException
{
_focusType = _T5_R2;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _objectType,
_T5_R3,
_T5_R1,
@@ -629,108 +629,108 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest
_T1_R1,
_T1_R2
};
-
+
IType[] actual = _testObj.getAllSuperclasses(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
-
+
+
public void testGetAllSuperclasses_T5R3() throws JavaModelException
{
_focusType = _T5_R3;
_testObj = createSuperTypeHierarchy(_focusType);
-
-
+
+
IType[] expected = new IType[] { _objectType,
_T5_R1,
_T2_R1,
_T1_R1
};
-
+
IType[] actual = _testObj.getAllSuperclasses(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
-
+
+
public void testGetAllSuperclasses_T5R1() throws JavaModelException
{
_focusType = _T5_R1;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _objectType,
_T2_R1,
_T1_R1
};
-
+
IType[] actual = _testObj.getAllSuperclasses(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetSuperclasses_T4R2() throws JavaModelException
{
_focusType = _T4_R2;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _T2_R2,
_T2_R1
};
-
+
IType[] actual = OTTypeHierarchies.getInstance().getSuperclasses(_testObj, _focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetSuperclasses_T4R2_phantomMode() throws JavaModelException
{
_focusType = _T4_R2;
_testObj = createSuperTypeHierarchy(_focusType);
OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true);
-
+
IType[] expected = new IType[] { _T2_R2,
_phantom_T4_R1
};
-
+
IType[] actual = OTTypeHierarchies.getInstance().getSuperclasses(_testObj, _focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclasses_T4R2() throws JavaModelException
{
_focusType = _T4_R2;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _objectType,
_T2_R2,
_T2_R1,
_T1_R1,
_T1_R2
};
-
+
IType[] actual = _testObj.getAllSuperclasses(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclasses_T4R2_phantomMode() throws JavaModelException
{
_focusType = _T4_R2;
_testObj = createSuperTypeHierarchy(_focusType);
OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true);
-
+
IType[] expected = new IType[] { _objectType,
_phantom_T4_R1,
_T2_R2,
@@ -738,20 +738,20 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest
_T1_R1,
_T1_R2
};
-
+
IType[] actual = _testObj.getAllSuperclasses(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
-
+
+
public void testGetAllSuperclasses_T3R2() throws JavaModelException
{
_focusType = _T3_R2;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _objectType,
_T3_R1,
_T2_R2,
@@ -759,46 +759,46 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest
_T1_R1,
_T1_R2
};
-
+
IType[] actual = _testObj.getAllSuperclasses(_focusType);
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclasses_T3R1() throws JavaModelException
{
_focusType = _T3_R1;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _objectType,
_T2_R1,
_T1_R1,
};
-
+
IType[] actual = _testObj.getAllSuperclasses(_focusType);
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
-
+
+
public void testGetAllTSuperTypes_T5R1inT7R2() throws JavaModelException
{
_focusType = _T7_R2;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _T2_R1,
_T1_R1,
};
-
+
IType[] actual = OTTypeHierarchies.getInstance().getAllTSuperTypes(_testObj, _T5_R1);
assertEquals(expected.length, actual.length);
-
+
assertTrue(compareTypes(expected, actual));
}
-
-
+
+
public void testToString_forNoException() throws JavaModelException
{
_focusType = _T5_R1;
@@ -806,26 +806,26 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest
try
{
- _testObj.toString();
+ _testObj.toString();
}
catch (Exception ex)
{
assertTrue(ex.getClass().toString() + " in OTTypeHierarchy.toString()", false);
}
-
+
assertTrue(true);
}
-
+
public void testLinearizationR2() throws JavaModelException {
_focusType = _T7_R2;
_testObj = createSuperTypeHierarchy(_focusType);
OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true);
IType superType = _testObj.getSuperclass(_focusType);
- IType[] expected = new IType[] {_T5_R2, _T2_R2, _T1_R2, _T7_R3, _T5_R3, _phantom_T7_R1, _T5_R1, _T2_R1, _T1_R1};
+ IType[] expected = new IType[] {_T5_R2, _T2_R2, _T1_R2, _T7_R3, _T5_R3, _phantom_T7_R1, _T5_R1, _T2_R1, _T1_R1};
for (int i=0; i<expected.length; i++) {
assertTrue(compareTypes(expected[i], superType));
superType = _testObj.getSuperclass(superType);
}
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest002.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest002.java
index 11bd81994..8e63decab 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest002.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest002.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -34,7 +34,7 @@ import org.eclipse.objectteams.otdt.tests.hierarchy.FileBasedHierarchyTest;
*/
public class OTSuperTypeHierarchyTest002 extends FileBasedHierarchyTest
{
-
+
private IType _T1;
private IType _T2;
private IType _T3;
@@ -43,12 +43,12 @@ public class OTSuperTypeHierarchyTest002 extends FileBasedHierarchyTest
private IType _T3_R1;
private IType _classA;
private IType _objectType;
-
+
public OTSuperTypeHierarchyTest002(String name)
{
super(name);
}
-
+
public static Test suite()
{
if (true)
@@ -56,23 +56,23 @@ public class OTSuperTypeHierarchyTest002 extends FileBasedHierarchyTest
return new Suite(OTSuperTypeHierarchyTest002.class);
}
@SuppressWarnings("unused")
- junit.framework.TestSuite suite =
+ junit.framework.TestSuite suite =
new Suite(OTSuperTypeHierarchyTest002.class.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
String srcFolder = "src";
String pkg = "test002";
-
+
_T1 = getType(getTestProjectDir(), srcFolder, pkg, "T1");
_T2 = getType(getTestProjectDir(), srcFolder, pkg, "T2");
_T3 = getType(getTestProjectDir(), srcFolder, pkg, "T3");
-
+
_T1_R1 = getRole(_T1, "T1.R1");
_T2_R1 = getRole(_T2, "T2.R1");
_T3_R1 = getRole(_T3, "T3.R1");
@@ -81,7 +81,7 @@ public class OTSuperTypeHierarchyTest002 extends FileBasedHierarchyTest
_objectType = getType(getTestProjectDir(), "rt.jar", "java.lang", "Object");
}
-
+
public void testCreation()
{
assertCreation(_T1);
@@ -92,20 +92,20 @@ public class OTSuperTypeHierarchyTest002 extends FileBasedHierarchyTest
assertCreation(_T3_R1);
assertCreation(_classA);
}
-
+
public void testGetAllSuperclasses_T3R1() throws JavaModelException
{
_focusType = _T3_R1;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _objectType,
_T2_R1,
_T1_R1,
_classA };
-
+
IType [] actual = _testObj.getAllSuperclasses(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -117,26 +117,26 @@ public class OTSuperTypeHierarchyTest002 extends FileBasedHierarchyTest
IType[] expected = new IType[] { _objectType,
_T1_R1,
_classA };
-
+
IType [] actual = _testObj.getAllSuperclasses(_focusType);
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllClasses_T2R1() throws JavaModelException
{
_focusType = _T2_R1;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _objectType,
_T1_R1,
_T2_R1,
_classA };
-
+
IType [] actual = _testObj.getAllClasses();
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -144,13 +144,13 @@ public class OTSuperTypeHierarchyTest002 extends FileBasedHierarchyTest
{
_focusType = _T2_R1;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _T1_R1,
_classA };
-
+
IType [] actual = OTTypeHierarchies.getInstance().getSuperclasses(_testObj, _focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -158,9 +158,9 @@ public class OTSuperTypeHierarchyTest002 extends FileBasedHierarchyTest
{
_focusType = _T2_R1;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType expected = _classA;
-
+
IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(_testObj, _focusType);
assertTrue(compareTypes(expected, actual));
@@ -170,9 +170,9 @@ public class OTSuperTypeHierarchyTest002 extends FileBasedHierarchyTest
{
_focusType = _T3_R1;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType expected = _classA;
-
+
IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(_testObj, _focusType);
assertTrue(compareTypes(expected, actual));
@@ -182,11 +182,11 @@ public class OTSuperTypeHierarchyTest002 extends FileBasedHierarchyTest
{
_focusType = _T1_R1;
_testObj = createSuperTypeHierarchy(_focusType);
-
- IType[] expected = new IType[] { _objectType };
+
+ IType[] expected = new IType[] { _objectType };
IType [] actual = _testObj.getAllSuperclasses(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -194,13 +194,13 @@ public class OTSuperTypeHierarchyTest002 extends FileBasedHierarchyTest
{
_focusType = _T3_R1;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _T2_R1,
_T1_R1 };
IType [] actual = OTTypeHierarchies.getInstance().getAllTSuperTypes(_testObj, _focusType);
assertEquals(expected.length, actual.length);
-
+
assertTrue(compareTypes(expected, actual));
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest003.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest003.java
index 0ef3bdb1d..e0a33b6c5 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest003.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest003.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -52,12 +52,12 @@ public class OTSuperTypeHierarchyTest003 extends FileBasedHierarchyTest
private IType _interfaceA;
private IType _objectType;
-
+
public OTSuperTypeHierarchyTest003(String name)
{
super(name);
}
-
+
public static Test suite()
{
if (true)
@@ -65,16 +65,16 @@ public class OTSuperTypeHierarchyTest003 extends FileBasedHierarchyTest
return new Suite(OTSuperTypeHierarchyTest003.class);
}
@SuppressWarnings("unused")
- junit.framework.TestSuite suite =
+ junit.framework.TestSuite suite =
new Suite(OTSuperTypeHierarchyTest003.class.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
String srcFolder = "src";
String pkg = "test003";
@@ -82,7 +82,7 @@ public class OTSuperTypeHierarchyTest003 extends FileBasedHierarchyTest
_T2 = getType(getTestProjectDir(), srcFolder, pkg, "T2");
_T3 = getType(getTestProjectDir(), srcFolder, pkg, "T3");
_T4 = getType(getTestProjectDir(), srcFolder, pkg, "T4");
-
+
_T1_R1 = getRole(_T1, "T1.R1");
_T1_R2 = getRole(_T1, "T1.R2");
@@ -98,11 +98,11 @@ public class OTSuperTypeHierarchyTest003 extends FileBasedHierarchyTest
_interfaceA =
getType(getTestProjectDir(), srcFolder, pkg, "InterfaceA");
-
+
_objectType =
getType(getTestProjectDir(), "rt.jar", "java.lang", "Object");
}
-
+
public void testCreation()
{
assertCreation(_T1);
@@ -129,10 +129,10 @@ public class OTSuperTypeHierarchyTest003 extends FileBasedHierarchyTest
_focusType = _T4_R1;
_testObj = createSuperTypeHierarchy(_focusType);
- IType[] expected = new IType[] { _T1_R1 };
+ IType[] expected = new IType[] { _T1_R1 };
IType [] actual = OTTypeHierarchies.getInstance().getSuperInterfaces(_testObj, _focusType);
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue("Wrong Types", compareTypes(expected, actual));
}
@@ -141,11 +141,11 @@ public class OTSuperTypeHierarchyTest003 extends FileBasedHierarchyTest
_focusType = _T4_R1;
_testObj = createSuperTypeHierarchy(_focusType);
OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true);
-
- IType[] expected = new IType[] { _phantom_T2_R1 };
+
+ IType[] expected = new IType[] { _phantom_T2_R1 };
IType [] actual = OTTypeHierarchies.getInstance().getSuperInterfaces(_testObj, _focusType);
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue("Wrong Types", compareTypes(expected, actual));
}
@@ -154,10 +154,10 @@ public class OTSuperTypeHierarchyTest003 extends FileBasedHierarchyTest
_focusType = _T4_R2;
_testObj = createSuperTypeHierarchy(_focusType);
- IType[] expected = new IType[] { _T2_R2, _interfaceA };
+ IType[] expected = new IType[] { _T2_R2, _interfaceA };
IType [] actual = OTTypeHierarchies.getInstance().getSuperInterfaces(_testObj, _focusType); // expl.&impl.
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue("Wrong Types", compareTypes(expected, actual));
}
@@ -166,37 +166,37 @@ public class OTSuperTypeHierarchyTest003 extends FileBasedHierarchyTest
_focusType = _T4_R3;
_testObj = createSuperTypeHierarchy(_focusType);
- IType[] expected = new IType[] { _T4_R2 };
+ IType[] expected = new IType[] { _T4_R2 };
IType [] actual = OTTypeHierarchies.getInstance().getSuperInterfaces(_testObj, _focusType); // expl.&impl.
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue("Wrong Types", compareTypes(expected, actual));
}
-
+
public void testGetSuperInterfaces_T2R2() throws JavaModelException
{
_focusType = _T2_R2;
_testObj = createSuperTypeHierarchy(_focusType);
- IType[] expected = new IType[] { _T1_R2, _interfaceA };
+ IType[] expected = new IType[] { _T1_R2, _interfaceA };
IType [] actual = OTTypeHierarchies.getInstance().getSuperInterfaces(_testObj, _focusType); // expl.&impl.
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue("Wrong Types", compareTypes(expected, actual));
}
-
+
public void testGetAllSuperInterfaces_T4R1() throws JavaModelException
{
_focusType = _T4_R1;
_testObj = createSuperTypeHierarchy(_focusType);
- IType[] expected = new IType[] { _T1_R1 };
+ IType[] expected = new IType[] { _T1_R1 };
IType [] actual = OTTypeHierarchies.getInstance().getAllSuperInterfaces(_testObj, _focusType); // expl.&impl.
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue("Wrong Types", compareTypes(expected, actual));
}
-
+
public void testGetAllSuperInterfaces_T4R2() throws JavaModelException
{
_focusType = _T4_R2;
@@ -204,25 +204,25 @@ public class OTSuperTypeHierarchyTest003 extends FileBasedHierarchyTest
IType[] expected = new IType[] { _interfaceA,
_T1_R2,
- _T2_R2 };
+ _T2_R2 };
IType [] actual = OTTypeHierarchies.getInstance().getAllSuperInterfaces(_testObj, _focusType); // expl.&impl.
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue("Wrong Types", compareTypes(expected, actual));
}
-
+
public void testGetAllSuperInterfaces_T3R1() throws JavaModelException
{
_focusType = _T3_R1;
_testObj = createSuperTypeHierarchy(_focusType);
- IType[] expected = new IType[] { _T1_R1 };
+ IType[] expected = new IType[] { _T1_R1 };
IType [] actual = OTTypeHierarchies.getInstance().getAllSuperInterfaces(_testObj, _focusType); // expl.&impl.
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue("Wrong Types", compareTypes(expected, actual));
}
-
+
public void testGetAllSuperInterfaces_T3R2() throws JavaModelException
{
_focusType = _T3_R2;
@@ -230,23 +230,23 @@ public class OTSuperTypeHierarchyTest003 extends FileBasedHierarchyTest
IType[] expected = new IType[] { _interfaceA,
_T1_R2,
- _T2_R2 };
+ _T2_R2 };
IType [] actual = OTTypeHierarchies.getInstance().getAllSuperInterfaces(_testObj, _focusType); // expl.&impl.
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue("Wrong Types", compareTypes(expected, actual));
}
-
+
public void testGetAllSuperInterfaces_T2R2() throws JavaModelException
{
_focusType = _T2_R2;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _T1_R2,
- _interfaceA };
+ _interfaceA };
IType [] actual = OTTypeHierarchies.getInstance().getAllSuperInterfaces(_testObj, _focusType); // expl.&impl.
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue("Wrong Types", compareTypes(expected, actual));
}
@@ -257,23 +257,23 @@ public class OTSuperTypeHierarchyTest003 extends FileBasedHierarchyTest
IType[] expected = new IType[] {};
IType [] actual = OTTypeHierarchies.getInstance().getAllSuperInterfaces(_testObj, _focusType); // expl.&impl.
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue("Wrong Types", compareTypes(expected, actual));
}
-
+
public void testGetAllSuperInterfaces_T1R1() throws JavaModelException
{
_focusType = _T1_R1;
_testObj = createSuperTypeHierarchy(_focusType);
- IType[] expected = new IType[] {};
+ IType[] expected = new IType[] {};
IType [] actual = OTTypeHierarchies.getInstance().getAllSuperInterfaces(_testObj, _focusType); // expl.&impl.
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue("Wrong Types", compareTypes(expected, actual));
}
-
+
public void testGetAllSuperInterfaces_interfaceA() throws JavaModelException
{
_focusType = _interfaceA;
@@ -281,11 +281,11 @@ public class OTSuperTypeHierarchyTest003 extends FileBasedHierarchyTest
IType[] expected = new IType[] {};
IType [] actual = OTTypeHierarchies.getInstance().getAllSuperInterfaces(_testObj, _focusType); // expl.&impl.
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue("Wrong Types", compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclasses_T4R1() throws JavaModelException
{
_focusType = _T4_R1;
@@ -293,68 +293,68 @@ public class OTSuperTypeHierarchyTest003 extends FileBasedHierarchyTest
IType[] expected = new IType[] {};
IType [] actual = _testObj.getAllSuperclasses(_focusType);
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclasses_T4R2() throws JavaModelException
{
_focusType = _T4_R2;
_testObj = createSuperTypeHierarchy(_focusType);
- IType[] expected = new IType[] {};
+ IType[] expected = new IType[] {};
IType [] actual = _testObj.getAllSuperclasses(_focusType);
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclasses_T3R1() throws JavaModelException
{
_focusType = _T3_R1;
_testObj = createSuperTypeHierarchy(_focusType);
- IType[] expected = new IType[] {};
+ IType[] expected = new IType[] {};
IType [] actual = _testObj.getAllSuperclasses(_focusType);
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclasses_T3R2() throws JavaModelException
{
_focusType = _T3_R2;
_testObj = createSuperTypeHierarchy(_focusType);
- IType[] expected = new IType[] {};
+ IType[] expected = new IType[] {};
IType [] actual = _testObj.getAllSuperclasses(_focusType);
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclasses_T2R2() throws JavaModelException
{
_focusType = _T2_R2;
_testObj = createSuperTypeHierarchy(_focusType);
- IType[] expected = new IType[] {};
+ IType[] expected = new IType[] {};
IType [] actual = _testObj.getAllSuperclasses(_focusType);
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclasses_T1R1() throws JavaModelException
{
_focusType = _T1_R1;
_testObj = createSuperTypeHierarchy(_focusType);
- IType[] expected = new IType[] {};
+ IType[] expected = new IType[] {};
IType [] actual = _testObj.getAllSuperclasses(_focusType);
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -363,25 +363,25 @@ public class OTSuperTypeHierarchyTest003 extends FileBasedHierarchyTest
_focusType = _T1_R2;
_testObj = createSuperTypeHierarchy(_focusType);
- IType[] expected = new IType[] {};
+ IType[] expected = new IType[] {};
IType [] actual = _testObj.getAllSuperclasses(_focusType);
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclasses_interfaceA() throws JavaModelException
{
_focusType = _interfaceA;
_testObj = createSuperTypeHierarchy(_focusType);
- IType[] expected = new IType[] {};
+ IType[] expected = new IType[] {};
IType [] actual = _testObj.getAllSuperclasses(_focusType);
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperInterfaces_T4R3() throws JavaModelException
{
_focusType = _T4_R3;
@@ -390,23 +390,23 @@ public class OTSuperTypeHierarchyTest003 extends FileBasedHierarchyTest
IType[] expected = new IType[] { _T4_R2,
_T2_R2,
_T1_R2,
- _interfaceA };
+ _interfaceA };
IType [] actual = OTTypeHierarchies.getInstance().getAllSuperInterfaces(_testObj, _focusType); // expl.&impl.
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue("Wrong Types", compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclasses_T4R3() throws JavaModelException
{
_focusType = _T4_R3;
_testObj = createSuperTypeHierarchy(_focusType);
- IType[] expected = new IType[] { _objectType };
+ IType[] expected = new IType[] { _objectType };
IType [] actual = _testObj.getAllSuperclasses(_focusType);
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue("Wrong Types", compareTypes(expected, actual));
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest004.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest004.java
index be8870be4..152c12b18 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest004.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest004.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -31,18 +31,18 @@ import org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy;
import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
/**
- *
+ *
* @author michael
- * @version $Id: OTSuperTypeHierarchyTest004.java 23494 2010-02-05 23:06:44Z stephan $
- *
+ * @version $Id: OTSuperTypeHierarchyTest004.java 23494 2010-02-05 23:06:44Z stephan $
+ *
*/
public class OTSuperTypeHierarchyTest004 extends FileBasedModelTest {
-
+
@SuppressWarnings("unused")
private ITypeHierarchy _testObj;
private IType _focusType;
private IType _T20;
- private IType _T21;
+ private IType _T21;
private IType _objectType;
private IType _T20T10T00R0;
private IType _T20T10T00R1;
@@ -51,14 +51,14 @@ public class OTSuperTypeHierarchyTest004 extends FileBasedModelTest {
private IType _T21T11T00R0;
private IType _T21T11T00R1;
private IType _T21T11T00R2;
-
-
-
+
+
+
public OTSuperTypeHierarchyTest004(String name)
{
super(name);
}
-
+
public static Test suite()
{
if (true)
@@ -66,33 +66,33 @@ public class OTSuperTypeHierarchyTest004 extends FileBasedModelTest {
return new Suite(OTSuperTypeHierarchyTest004.class);
}
@SuppressWarnings("unused")
- junit.framework.TestSuite suite =
+ junit.framework.TestSuite suite =
new Suite(OTSuperTypeHierarchyTest004.class.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
String srcFolder = "src";
String pkg = "test004";
-
- _T20 =
+
+ _T20 =
getType(getTestProjectDir(),
srcFolder,
pkg,
"T20");
- _T21 =
+ _T21 =
getType(getTestProjectDir(),
srcFolder,
pkg,
"T21");
-
-
- _objectType =
+
+
+ _objectType =
getType(getTestProjectDir(),
"rt.jar",
"java.lang",
@@ -106,7 +106,7 @@ public class OTSuperTypeHierarchyTest004 extends FileBasedModelTest {
_T21T11T00R1 = getRole(_T21, "T21.T11.T00.R1");
_T21T11T00R2 = getRole(_T21, "T21.T11.T00.R2");
}
-
+
public void testCreation()
{
assertCreation(_T20);
@@ -123,7 +123,7 @@ public class OTSuperTypeHierarchyTest004 extends FileBasedModelTest {
public void testGetAllSuperclasses_T21T11T00R2() throws JavaModelException
{
_focusType = _T21T11T00R2;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false);
hierarchy.refresh(new NullProgressMonitor());
@@ -137,9 +137,9 @@ public class OTSuperTypeHierarchyTest004 extends FileBasedModelTest {
_T21T11T00R0,
_T21T11T00R1,
};
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest006.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest006.java
index de3478601..5d10572e0 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest006.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest006.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -38,24 +38,24 @@ public class OTSuperTypeHierarchyTest006 extends FileBasedHierarchyTest
private IType _T1;
private IType _T2;
private IType _T3;
-
+
private IType _T1_R1;
private IType _T1_R2;
-
+
private IType _T2_R1;
private IType _phantom_T2_R2;
private IType _phantom_T3_R1;
private IType _T3_R2;
-
- private IType _classA;
+
+ private IType _classA;
private IType _objectType;
-
+
public OTSuperTypeHierarchyTest006(String name)
{
super(name);
}
-
+
public static Test suite()
{
if (true)
@@ -63,38 +63,38 @@ public class OTSuperTypeHierarchyTest006 extends FileBasedHierarchyTest
return new Suite(OTSuperTypeHierarchyTest006.class);
}
@SuppressWarnings("unused")
- junit.framework.TestSuite suite =
+ junit.framework.TestSuite suite =
new Suite(OTSuperTypeHierarchyTest006.class.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
String srcFolder = "src";
String pkg = "test006";
_T1 = getType(getTestProjectDir(), srcFolder, pkg, "T1");
_T2 = getType(getTestProjectDir(), srcFolder, pkg, "T2");
_T3 = getType(getTestProjectDir(), srcFolder, pkg, "T3");
-
+
_T1_R1 = getRole(_T1, "T1.R1");
_T1_R2 = getRole(_T1, "T1.R2");
-
+
_T2_R1 = getRole(_T2, "T2.R1");
_phantom_T2_R2 = new PhantomType(_T2, _T1_R2);
-
+
_phantom_T3_R1 = new PhantomType(_T3, _T2_R1);
_T3_R2 = getRole(_T3, "T3.R2");
-
+
_classA =
- getType(getTestProjectDir(), srcFolder, pkg, "ClassA");
-
+ getType(getTestProjectDir(), srcFolder, pkg, "ClassA");
+
_objectType =
getType(getTestProjectDir(), "rt.jar", "java.lang", "Object");
}
-
+
public void testCreation()
{
assertCreation(_T1);
@@ -110,46 +110,46 @@ public class OTSuperTypeHierarchyTest006 extends FileBasedHierarchyTest
assertCreation(_phantom_T3_R1);
assertCreation(_T3_R2);
}
-
+
public void testGetAllSuperclasses_T1R1() throws JavaModelException
{
_focusType = _T1_R1;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _objectType,
_classA };
-
+
IType [] actual = _testObj.getAllSuperclasses(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclasses_T2R2() throws JavaModelException
{
_focusType = _T1_R2;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _objectType };
-
+
IType [] actual = _testObj.getAllSuperclasses(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclasses_T2R1() throws JavaModelException
{
_focusType = _T2_R1;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _objectType,
_T1_R1,
_classA };
-
+
IType [] actual = _testObj.getAllSuperclasses(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -157,25 +157,25 @@ public class OTSuperTypeHierarchyTest006 extends FileBasedHierarchyTest
{
_focusType = _T3_R2;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _objectType,
_T2_R1,
_T1_R1,
_T1_R2,
_classA };
-
+
IType [] actual = _testObj.getAllSuperclasses(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclasses_T3R2_phantomMode() throws JavaModelException
{
_focusType = _T3_R2;
_testObj = createSuperTypeHierarchy(_focusType);
OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true);
-
+
IType[] expected = new IType[] { _objectType,
_T2_R1,
_T1_R1,
@@ -183,19 +183,19 @@ public class OTSuperTypeHierarchyTest006 extends FileBasedHierarchyTest
_phantom_T2_R2,
_phantom_T3_R1,
_classA };
-
+
IType [] actual = _testObj.getAllSuperclasses(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetExplicitSuperclass_T3R2() throws JavaModelException
{
_focusType = _T3_R2;
_testObj = createSuperTypeHierarchy(_focusType);
-
- IType expected = _T2_R1;
+
+ IType expected = _T2_R1;
IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(_testObj, _focusType);
assertTrue(compareTypes(expected, actual));
@@ -206,24 +206,24 @@ public class OTSuperTypeHierarchyTest006 extends FileBasedHierarchyTest
_focusType = _T3_R2;
_testObj = createSuperTypeHierarchy(_focusType);
OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true);
-
+
IType expected = _phantom_T3_R1;
IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(_testObj, _focusType);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllTSuperTypes_T3R2() throws JavaModelException
{
_focusType = _T3_R2;
_testObj = createSuperTypeHierarchy(_focusType);
IType[] expected = new IType[] { _T1_R2 };
-
+
IType [] actual = OTTypeHierarchies.getInstance().getAllTSuperTypes(_testObj, _focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -231,12 +231,12 @@ public class OTSuperTypeHierarchyTest006 extends FileBasedHierarchyTest
{
_focusType = _T2_R1;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _T1_R1 };
IType [] actual = OTTypeHierarchies.getInstance().getAllTSuperTypes(_testObj, _focusType);
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest007.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest007.java
index 01be3efc1..ab068ef31 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest007.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest007.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -36,27 +36,27 @@ public class OTSuperTypeHierarchyTest007 extends FileBasedHierarchyTest
{
private IType _T1;
private IType _T2;
-
+
private IType _T1_R1;
private IType _T1_R2;
-
+
private IType _T2_R1;
private IType _T2_R2;
-
+
private IType _classA;
private IType _classB;
-
+
private IType _interfaceA;
private IType _interfaceB;
private IType _interfaceC;
-
+
private IType _objectType;
-
+
public OTSuperTypeHierarchyTest007(String name)
{
super(name);
}
-
+
public static Test suite()
{
if (true)
@@ -64,28 +64,28 @@ public class OTSuperTypeHierarchyTest007 extends FileBasedHierarchyTest
return new Suite(OTSuperTypeHierarchyTest007.class);
}
@SuppressWarnings("unused")
- junit.framework.TestSuite suite =
+ junit.framework.TestSuite suite =
new Suite(OTSuperTypeHierarchyTest007.class.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
String srcFolder = "src";
String pkg = "test007";
-
+
_T1 = getType(getTestProjectDir(), srcFolder, pkg, "T1");
_T2 = getType(getTestProjectDir(), srcFolder, pkg, "T2");
-
+
_T1_R1 = getRole(_T1, "T1.R1");
_T1_R2 = getRole(_T1, "T1.R2");
-
+
_T2_R1 = getRole(_T2, "T2.R1");
_T2_R2 = getRole(_T2, "T2.R2");
-
+
_classA =
getType(getTestProjectDir(), srcFolder, pkg, "ClassA");
_classB =
@@ -99,8 +99,8 @@ public class OTSuperTypeHierarchyTest007 extends FileBasedHierarchyTest
_objectType =
getType(getTestProjectDir(), "rt.jar", "java.lang", "Object");
}
-
-
+
+
public void testCreation()
{
assertCreation(_T1);
@@ -112,7 +112,7 @@ public class OTSuperTypeHierarchyTest007 extends FileBasedHierarchyTest
assertCreation(_T2_R1);
assertCreation(_T2_R2);
}
-
+
public void testGetAllSuperclassesFor_T2R1() throws JavaModelException
{
_focusType = _T2_R1;
@@ -123,8 +123,8 @@ public class OTSuperTypeHierarchyTest007 extends FileBasedHierarchyTest
_classA,
_T1_R1 };
IType [] actual = _testObj.getAllSuperclasses(_focusType);
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -132,63 +132,63 @@ public class OTSuperTypeHierarchyTest007 extends FileBasedHierarchyTest
{
_focusType = _T2_R2;
_testObj = createSuperTypeHierarchy(_focusType);
-
- IType[] expected = new IType[] { _objectType, _T1_R2 };
+
+ IType[] expected = new IType[] { _objectType, _T1_R2 };
IType [] actual = _testObj.getAllSuperclasses(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
-
+
+
public void testGetAllSuperInterfacesFor_T2R2() throws JavaModelException
{
_focusType = _T2_R2;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] {
_interfaceA,
_interfaceB,
- _interfaceC };
+ _interfaceC };
IType [] actual = _testObj.getAllSuperInterfaces(_focusType);
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetSuperInterfaces_T1R2() throws JavaModelException
{
_focusType = _T1_R2;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _interfaceA };
IType [] actual = _testObj.getSuperInterfaces(_focusType);
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclassesFor_interfaceB() throws JavaModelException
{
_focusType = _interfaceB;
_testObj = createSuperTypeHierarchy(_focusType);
-
- IType[] expected = new IType[0];
+
+ IType[] expected = new IType[0];
IType [] actual = _testObj.getAllSuperclasses(_focusType);
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperInterfacesFor_interfaceB() throws JavaModelException
{
_focusType = _interfaceB;
- _testObj = createSuperTypeHierarchy(_focusType);
+ _testObj = createSuperTypeHierarchy(_focusType);
- IType[] expected = new IType[] { _interfaceA };
+ IType[] expected = new IType[] { _interfaceA };
IType [] actual = _testObj.getAllSuperInterfaces(_focusType);
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -196,50 +196,50 @@ public class OTSuperTypeHierarchyTest007 extends FileBasedHierarchyTest
{
_focusType = _classA;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[0];
IType [] actual = _testObj.getAllSuperInterfaces(_focusType);
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetSuperInterfaces_interfaceB_In_T2R2() throws JavaModelException
{
_focusType = _T2_R2;
_testObj = createSuperTypeHierarchy(_focusType);
-
- IType[] expected = new IType[] { _interfaceA };
+
+ IType[] expected = new IType[] { _interfaceA };
IType [] actual = _testObj.getSuperInterfaces(_interfaceB);
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclassesFor_classB() throws JavaModelException
{
_focusType = _classB;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _objectType,
- _classA };
+ _classA };
IType [] actual = _testObj.getAllSuperclasses(_focusType);
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetExplicitSuperclassFor_classB() throws JavaModelException
{
_focusType = _classB;
- _testObj = createSuperTypeHierarchy(_focusType);
+ _testObj = createSuperTypeHierarchy(_focusType);
- IType expected = _classA;
+ IType expected = _classA;
IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(_testObj, _focusType);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllInterfaces_T2R2() throws JavaModelException
{
_focusType = _T2_R2;
@@ -250,24 +250,24 @@ public class OTSuperTypeHierarchyTest007 extends FileBasedHierarchyTest
_interfaceB,
_interfaceC };
IType [] actual = _testObj.getAllInterfaces();
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
public void testGetImplementingClasses_interfaceA_in_T2R2() throws JavaModelException
{
_focusType = _T2_R2;
- _testObj = createSuperTypeHierarchy(_focusType);
+ _testObj = createSuperTypeHierarchy(_focusType);
IType[] expected = new IType[] {
_T1_R2,
// _T2_R2 // not a direct implementor
- };
+ };
IType [] actual = _testObj.getImplementingClasses(_interfaceA);
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest007_Stress.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest007_Stress.java
index cfc89fbbd..7d4e14b18 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest007_Stress.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest007_Stress.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -37,55 +37,55 @@ public class OTSuperTypeHierarchyTest007_Stress extends FileBasedHierarchyTest
{
private IType _T1;
private IType _T2;
-
+
private IType _T1_R1;
private IType _T1_R2;
-
+
private IType _T2_R1;
private IType _T2_R2;
-
+
private IType _classA;
private IType _classB;
-
+
private IType _interfaceA;
private IType _interfaceB;
private IType _interfaceC;
-
+
private IType _objectType;
-
+
public OTSuperTypeHierarchyTest007_Stress(String name)
{
super(name);
}
-
+
public static Test suite()
{
if (true)
{
return new Suite(OTSuperTypeHierarchyTest007_Stress.class);
}
- junit.framework.TestSuite suite =
+ junit.framework.TestSuite suite =
new Suite(OTSuperTypeHierarchyTest007_Stress.class.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
String srcFolder = "src";
String pkg = "test007";
-
+
_T1 = getType(getTestProjectDir(), srcFolder, pkg, "T1");
_T2 = getType(getTestProjectDir(), srcFolder, pkg, "T2");
-
+
_T1_R1 = getRole(_T1, "T1.R1");
_T1_R2 = getRole(_T1, "T1.R2");
-
+
_T2_R1 = getRole(_T2, "T2.R1");
_T2_R2 = getRole(_T2, "T2.R2");
-
+
_classA =
getType(getTestProjectDir(), srcFolder, pkg, "ClassA");
_classB =
@@ -98,9 +98,9 @@ public class OTSuperTypeHierarchyTest007_Stress extends FileBasedHierarchyTest
getType(getTestProjectDir(), srcFolder, pkg, "InterfaceC");
_objectType =
getType(getTestProjectDir(), "rt.jar", "java.lang", "Object");
-
+
}
-
+
public void testGetAllSuperInterfacesFor_T2R2_Run001()
throws JavaModelException
{
@@ -112,66 +112,66 @@ public class OTSuperTypeHierarchyTest007_Stress extends FileBasedHierarchyTest
{
runActualTestCase();
}
-
+
public void testGetAllSuperInterfacesFor_T2R2_Run003()
throws JavaModelException
{
runActualTestCase();
}
-
+
public void testGetAllSuperInterfacesFor_T2R2_Run004()
throws JavaModelException
{
runActualTestCase();
}
-
+
public void testGetAllSuperInterfacesFor_T2R2_Run005()
throws JavaModelException
{
runActualTestCase();
}
-
+
public void testGetAllSuperInterfacesFor_T2R2_Run006()
throws JavaModelException
{
runActualTestCase();
}
-
+
public void testGetAllSuperInterfacesFor_T2R2_Run007()
throws JavaModelException
{
runActualTestCase();
}
-
+
public void testGetAllSuperInterfacesFor_T2R2_Run008()
throws JavaModelException
{
runActualTestCase();
}
-
+
public void testGetAllSuperInterfacesFor_T2R2_Run009()
throws JavaModelException
{
runActualTestCase();
}
-
+
public void testGetAllSuperInterfacesFor_T2R2_Run010()
throws JavaModelException
{
runActualTestCase();
- }
+ }
private void runActualTestCase() throws JavaModelException
{
_focusType = _T2_R2;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _interfaceA,
_interfaceB,
- _interfaceC };
+ _interfaceC };
IType [] actual = OTTypeHierarchies.getInstance().getAllSuperInterfaces(_testObj, _focusType);
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest008.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest008.java
index 6910a6255..fabd78da6 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest008.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest008.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -33,16 +33,16 @@ import org.eclipse.objectteams.otdt.tests.hierarchy.FileBasedHierarchyTest;
import org.eclipse.objectteams.otdt.core.hierarchy.OTTypeHierarchies;
/**
- *
+ *
* @author Michael Krueger (michael)
- * @version $Id: OTSuperTypeHierarchyTest008.java 23494 2010-02-05 23:06:44Z stephan $
- *
+ * @version $Id: OTSuperTypeHierarchyTest008.java 23494 2010-02-05 23:06:44Z stephan $
+ *
*/
public class OTSuperTypeHierarchyTest008 extends FileBasedHierarchyTest
{
-
+
private IType _T21;
- private IType _T22;
+ private IType _T22;
private IType _objectType;
private IType _T21T12R1;
private IType _T21T12R2;
@@ -56,12 +56,12 @@ public class OTSuperTypeHierarchyTest008 extends FileBasedHierarchyTest
private IType _T22T11R1;
private IType _T22T11R2;
private IType _T22T11R3;
-
+
public OTSuperTypeHierarchyTest008(String name)
{
super(name);
}
-
+
public static Test suite()
{
if (true)
@@ -69,21 +69,21 @@ public class OTSuperTypeHierarchyTest008 extends FileBasedHierarchyTest
return new Suite(OTSuperTypeHierarchyTest008.class);
}
@SuppressWarnings("unused")
- junit.framework.TestSuite suite =
+ junit.framework.TestSuite suite =
new Suite(OTSuperTypeHierarchyTest008.class.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
String srcFolder = "src";
String pkg = "test008";
-
+
_T22 = getType(getTestProjectDir(), srcFolder, pkg, "T22");
- _T21 = getType(getTestProjectDir(), srcFolder, pkg, "T21");
+ _T21 = getType(getTestProjectDir(), srcFolder, pkg, "T21");
_objectType =
getType(getTestProjectDir(), "rt.jar", "java.lang", "Object");
@@ -100,7 +100,7 @@ public class OTSuperTypeHierarchyTest008 extends FileBasedHierarchyTest
_T22T11R2 = getRole(_T22, "T22.T11.R2");
_T22T11R3 = getRole(_T22, "T22.T11.R3");
}
-
+
public void testCreation()
{
assertCreation(_T21);
@@ -123,7 +123,7 @@ public class OTSuperTypeHierarchyTest008 extends FileBasedHierarchyTest
public void testGetAllSuperclasses_T22T11R2() throws JavaModelException
{
_focusType = _T22T11R2;
-
+
ITypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false);
hierarchy.refresh(new NullProgressMonitor());
@@ -134,15 +134,15 @@ public class OTSuperTypeHierarchyTest008 extends FileBasedHierarchyTest
_T21T11R1,
_T21T11R2,
};
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
public void testGetAllSuperclasses_T22T12R3() throws JavaModelException
{
_focusType = _T22T12R3;
-
+
ITypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false);
hierarchy.refresh(new NullProgressMonitor());
@@ -161,8 +161,8 @@ public class OTSuperTypeHierarchyTest008 extends FileBasedHierarchyTest
_T22T12R1,
_T22T12R2,
};
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -170,26 +170,26 @@ public class OTSuperTypeHierarchyTest008 extends FileBasedHierarchyTest
{
_focusType = _T22T12R3;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] actual = OTTypeHierarchies.getInstance().getTSuperTypes(_testObj, _focusType);
IType[] expected = new IType[] { _T21T12R3,
_T22T11R3 };
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllTSuperTypes_T22T12R3() throws JavaModelException
{
_focusType = _T22T12R3;
ITypeHierarchy hier = createSuperTypeHierarchy(_focusType);
-
+
IType[] actual = OTTypeHierarchies.getInstance().getAllTSuperTypes(hier, _focusType);
IType[] expected = new IType[] { _T21T12R3,
_T22T11R3,
_T21T11R3 };
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -197,7 +197,7 @@ public class OTSuperTypeHierarchyTest008 extends FileBasedHierarchyTest
{
_focusType = _T22T12R3;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
boolean result = false;
try
{
@@ -209,15 +209,15 @@ public class OTSuperTypeHierarchyTest008 extends FileBasedHierarchyTest
}
assertFalse(result);
}
-
+
public void testGetExplicitSuperclass_T22T12R3() throws JavaModelException
{
_focusType = _T22T12R3;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(_testObj, _focusType);
IType expected = _T22T12R2;
-
+
assertTrue(compareTypes(expected, actual));
}
@@ -225,14 +225,14 @@ public class OTSuperTypeHierarchyTest008 extends FileBasedHierarchyTest
{
_focusType = _T22T12R3;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] actual = OTTypeHierarchies.getInstance().getSuperclasses(_testObj, _focusType);
IType[] expected = new IType[] { _T22T12R2,
_T21T12R3,
_T22T11R3 };
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
public void testGetSuperclasses_T22T12R2inT22T12R3() throws JavaModelException
@@ -244,9 +244,9 @@ public class OTSuperTypeHierarchyTest008 extends FileBasedHierarchyTest
IType[] expected = new IType[] { _T22T12R1,
_T21T12R2,
_T22T11R2 };
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
public void testGetSuperclasses_T22T12R1inT21T12R1() throws JavaModelException
@@ -258,9 +258,9 @@ public class OTSuperTypeHierarchyTest008 extends FileBasedHierarchyTest
IType[] expected = new IType[] { _T21T12R1, // direct tsuper
_T22T11R1, // direct tsuper
_objectType };
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
public void testGetAllSuperclasses_T22T12R1inT21T12R1() throws JavaModelException
@@ -273,9 +273,9 @@ public class OTSuperTypeHierarchyTest008 extends FileBasedHierarchyTest
// _T22T11R1, // not related to focusType
_T21T11R1,
_objectType };
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest009.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest009.java
index 5a737df57..efc25d6e1 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest009.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest009.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -33,31 +33,31 @@ import org.eclipse.objectteams.otdt.core.TypeHelper;
import org.eclipse.objectteams.otdt.core.hierarchy.OTTypeHierarchies;
/**
- *
+ *
* @author michael
- * @version $Id: OTSuperTypeHierarchyTest009.java 23494 2010-02-05 23:06:44Z stephan $
- *
+ * @version $Id: OTSuperTypeHierarchyTest009.java 23494 2010-02-05 23:06:44Z stephan $
+ *
*/
public class OTSuperTypeHierarchyTest009 extends FileBasedModelTest {
-
+
@SuppressWarnings("unused")
private ITypeHierarchy _testObj;
private IType _focusType;
private IType _T10;
- private IType _T11;
+ private IType _T11;
private IType _objectType;
private IType _T10T00;
private IType _T11T00;
private IType _T10T00R0;
private IType _T11T00R0;
-
-
-
+
+
+
public OTSuperTypeHierarchyTest009(String name)
{
super(name);
}
-
+
public static Test suite()
{
if (true)
@@ -65,33 +65,33 @@ public class OTSuperTypeHierarchyTest009 extends FileBasedModelTest {
return new Suite(OTSuperTypeHierarchyTest009.class);
}
@SuppressWarnings("unused")
- junit.framework.TestSuite suite =
+ junit.framework.TestSuite suite =
new Suite(OTSuperTypeHierarchyTest009.class.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
String srcFolder = "src";
String pkg = "test009";
-
- _T10 =
+
+ _T10 =
getType(getTestProjectDir(),
srcFolder,
pkg,
"T10");
- _T11 =
+ _T11 =
getType(getTestProjectDir(),
srcFolder,
pkg,
"T11");
-
-
- _objectType =
+
+
+ _objectType =
getType(getTestProjectDir(),
"rt.jar",
"java.lang",
@@ -104,7 +104,7 @@ public class OTSuperTypeHierarchyTest009 extends FileBasedModelTest {
}
-
+
public void testCreation()
{
assertCreation(_T10);
@@ -114,46 +114,46 @@ public class OTSuperTypeHierarchyTest009 extends FileBasedModelTest {
assertCreation(_T10T00R0);
assertCreation(_T11T00R0);
-
+
}
-
+
public void testGetTSuperTypes_T11T00R0() throws JavaModelException
{
_focusType = _T11T00R0;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false);
hierarchy.refresh(new NullProgressMonitor());
IType[] actual = OTTypeHierarchies.getInstance().getTSuperTypes(hierarchy, _focusType);
IType[] expected = new IType[] { _T10T00R0 };
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
-
-
+
+
public void testGetSuperclass_T11T00R0() throws JavaModelException
{
_focusType = _T11T00R0;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false);
hierarchy.refresh(new NullProgressMonitor());
IType actual = hierarchy.getSuperclass(_focusType);
IType expected = _T10T00R0;
-
+
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclasses_T11T00R0() throws JavaModelException
{
_focusType = _T11T00R0;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false);
hierarchy.refresh(new NullProgressMonitor());
@@ -162,31 +162,31 @@ public class OTSuperTypeHierarchyTest009 extends FileBasedModelTest {
IType[] expected = new IType[] { _objectType,
_T10T00R0,
};
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetSuperInterfaces_T11T00R0() throws JavaModelException
{
_focusType = _T11T00R0;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false);
hierarchy.refresh(new NullProgressMonitor());
IType[] actual = OTTypeHierarchies.getInstance().getSuperInterfaces(hierarchy, _focusType);
IType[] expected = new IType[0];
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
-
-
-
-
-
-
+
+
+
+
+
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest010.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest010.java
index 4c33c3d6e..7ee0fade6 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest010.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest010.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -37,19 +37,19 @@ public class OTSuperTypeHierarchyTest010 extends FileBasedHierarchyTest
private IType _T1;
private IType _T2;
private IType _T3;
-
+
private IType _T1_R1;
private IType _T2_R1;
private IType _T3_R1;
- private IType _interfaceA;
+ private IType _interfaceA;
private IType _objectType;
-
+
public OTSuperTypeHierarchyTest010(String name)
{
super(name);
}
-
+
public static Test suite()
{
if (true)
@@ -57,19 +57,19 @@ public class OTSuperTypeHierarchyTest010 extends FileBasedHierarchyTest
return new Suite(OTSuperTypeHierarchyTest010.class);
}
@SuppressWarnings("unused")
- junit.framework.TestSuite suite =
+ junit.framework.TestSuite suite =
new Suite(OTSuperTypeHierarchyTest010.class.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
String srcFolder = "src";
String pkg = "test010";
-
+
_T1 = getType(getTestProjectDir(), srcFolder, pkg, "T1");
_T2 = getType(getTestProjectDir(), srcFolder, pkg, "T2");
_T3 = getType(getTestProjectDir(), srcFolder, pkg, "T3");
@@ -81,7 +81,7 @@ public class OTSuperTypeHierarchyTest010 extends FileBasedHierarchyTest
_interfaceA = getType(getTestProjectDir(), srcFolder, pkg, "InterfaceA");
_objectType = getType(getTestProjectDir(), "rt.jar", "java.lang", "Object");
}
-
+
public void testCreation()
{
assertCreation(_T1);
@@ -101,8 +101,8 @@ public class OTSuperTypeHierarchyTest010 extends FileBasedHierarchyTest
_T2_R1,
_T1_R1 };
IType [] actual = _testObj.getAllSuperclasses(_focusType);
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -112,22 +112,22 @@ public class OTSuperTypeHierarchyTest010 extends FileBasedHierarchyTest
_testObj = createSuperTypeHierarchy(_focusType);
IType[] expected = new IType[] { _objectType,
- _T1_R1 };
+ _T1_R1 };
IType [] actual = _testObj.getAllSuperclasses(_focusType);
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclasses_T1R1() throws JavaModelException
{
_focusType = _T1_R1;
_testObj = createSuperTypeHierarchy(_focusType);
-
- IType[] expected = new IType[] { _objectType };
+
+ IType[] expected = new IType[] { _objectType };
IType [] actual = _testObj.getAllSuperclasses(_focusType);
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -135,24 +135,24 @@ public class OTSuperTypeHierarchyTest010 extends FileBasedHierarchyTest
{
_focusType = _T3_R1;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _T2_R1,
- _T1_R1 };
+ _T1_R1 };
IType [] actual = OTTypeHierarchies.getInstance().getAllTSuperTypes(_testObj, _focusType);
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperinterfacesFor_T2_R1() throws JavaModelException
{
_focusType = _T2_R1;
_testObj = createSuperTypeHierarchy(_focusType);
-
- IType[] expected = new IType[] { _interfaceA };
+
+ IType[] expected = new IType[] { _interfaceA };
IType [] actual = _testObj.getAllSuperInterfaces(_focusType);
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -160,11 +160,11 @@ public class OTSuperTypeHierarchyTest010 extends FileBasedHierarchyTest
{
_focusType = _T2_R1;
_testObj = createSuperTypeHierarchy(_focusType);
-
- IType[] expected = new IType[] { _interfaceA };
+
+ IType[] expected = new IType[] { _interfaceA };
IType [] actual = _testObj.getSuperInterfaces(_focusType);
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -172,13 +172,13 @@ public class OTSuperTypeHierarchyTest010 extends FileBasedHierarchyTest
{
_focusType = _T2_R1;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] expected = new IType[] { _objectType,
_T1_R1,
- _interfaceA };
+ _interfaceA };
IType [] actual = _testObj.getAllSupertypes(_focusType);
- assertEquals(expected.length, actual.length);
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
@@ -186,12 +186,12 @@ public class OTSuperTypeHierarchyTest010 extends FileBasedHierarchyTest
{
_focusType = _T3_R1;
_testObj = createSuperTypeHierarchy(_focusType);
-
- IType[] expected = new IType[] { _interfaceA };
+
+ IType[] expected = new IType[] { _interfaceA };
IType [] actual = OTTypeHierarchies.getInstance().getSuperInterfaces(_testObj, _focusType);
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest011.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest011.java
index ac9c6d7a8..29c679995 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest011.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest011.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -30,30 +30,30 @@ import org.eclipse.objectteams.otdt.internal.core.PhantomType;
import org.eclipse.objectteams.otdt.tests.hierarchy.FileBasedHierarchyTest;
/**
- *
+ *
* @author Michael Krueger (mkr)
- * @version $Id: OTSuperTypeHierarchyTest011.java 23494 2010-02-05 23:06:44Z stephan $
- *
+ * @version $Id: OTSuperTypeHierarchyTest011.java 23494 2010-02-05 23:06:44Z stephan $
+ *
*/
public class OTSuperTypeHierarchyTest011 extends FileBasedHierarchyTest
{
-
+
private IType _T10;
- private IType _T21;
+ private IType _T21;
private IType _T21T11T0R1;
private IType _phantom_T21T11T0R2;
private IType _T10T0R1;
private IType _T10T0R2;
-
+
private IType _objectType;
public OTSuperTypeHierarchyTest011(String name)
{
super(name);
}
-
+
public static Test suite()
{
if (true)
@@ -61,23 +61,23 @@ public class OTSuperTypeHierarchyTest011 extends FileBasedHierarchyTest
return new Suite(OTSuperTypeHierarchyTest011.class);
}
@SuppressWarnings("unused")
- junit.framework.TestSuite suite =
+ junit.framework.TestSuite suite =
new Suite(OTSuperTypeHierarchyTest011.class.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
String srcFolder = "src";
String pkg = "test011";
-
+
_T10 = getType(getTestProjectDir(), srcFolder, pkg, "T10");
_T21 = getType(getTestProjectDir(), srcFolder, pkg, "T21");
-
+
_objectType =
getType(getTestProjectDir(), "rt.jar", "java.lang", "Object");
@@ -86,13 +86,13 @@ public class OTSuperTypeHierarchyTest011 extends FileBasedHierarchyTest
_T10T0R2 = getRole(_T10, "T10.T0.R2");
_phantom_T21T11T0R2 = new PhantomType(getRole(_T21, "T21.T11.T0"), _T10T0R2);
}
-
+
public void testCreation()
{
assertCreation(_T10);
assertCreation(_T21);
assertCreation(_T21T11T0R1);
- assertCreation(_phantom_T21T11T0R2);
+ assertCreation(_phantom_T21T11T0R2);
assertCreation(_T10T0R1);
assertCreation(_T10T0R2);
}
@@ -101,41 +101,41 @@ public class OTSuperTypeHierarchyTest011 extends FileBasedHierarchyTest
{
_focusType = _T21T11T0R1;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] actual = OTTypeHierarchies.getInstance().getTSuperTypes(_testObj, _focusType);
IType[] expected = new IType[] { _T10T0R1 };
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetSuperclasses_T21T11T0R1() throws JavaModelException
{
_focusType = _T21T11T0R1;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] actual = OTTypeHierarchies.getInstance().getSuperclasses(_testObj, _focusType);
IType[] expected = new IType[] { _T10T0R1,
_T10T0R2 };
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
public void testGetAllClasses_T21T11T0R1() throws JavaModelException
{
_focusType = _T21T11T0R1;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] actual = _testObj.getAllClasses();
IType[] expected = new IType[] { _T21T11T0R1,
_T10T0R1,
_T10T0R2,
_objectType };
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
public void testGetAllClasses_T21T11T0R1_phantom() throws JavaModelException
@@ -143,29 +143,29 @@ public class OTSuperTypeHierarchyTest011 extends FileBasedHierarchyTest
_focusType = _T21T11T0R1;
_testObj = createSuperTypeHierarchy(_focusType);
OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true);
-
+
IType[] actual = _testObj.getAllClasses();
IType[] expected = new IType[] { _T21T11T0R1,
_phantom_T21T11T0R2,
_T10T0R1,
_T10T0R2,
_objectType };
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllClasses_T10T0R1() throws JavaModelException
{
_focusType = _T10T0R1;
_testObj = createSuperTypeHierarchy(_focusType);
-
+
IType[] actual = _testObj.getAllClasses();
IType[] expected = new IType[] { _T10T0R1,
_T10T0R2,
_objectType };
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest013.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest013.java
index 81335d8f9..ddd16aa24 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest013.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest013.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -32,18 +32,18 @@ import org.eclipse.objectteams.otdt.core.TypeHelper;
import org.eclipse.objectteams.otdt.core.hierarchy.OTTypeHierarchies;
/**
- *
+ *
* @author Michael Krueger (mkr)
- * @version $Id: OTSuperTypeHierarchyTest013.java 23494 2010-02-05 23:06:44Z stephan $
- *
+ * @version $Id: OTSuperTypeHierarchyTest013.java 23494 2010-02-05 23:06:44Z stephan $
+ *
*/
public class OTSuperTypeHierarchyTest013 extends FileBasedModelTest
{
-
+
private IType _focusType;
private IType _objectType;
private IType _TA1;
- private IType _TA2;
+ private IType _TA2;
private IType _TA1TB2TC2R1;
private IType _TA1TB2TC1R1;
private IType _TA1TB1TC2R1;
@@ -56,12 +56,12 @@ public class OTSuperTypeHierarchyTest013 extends FileBasedModelTest
private IType _C1;
private IType _C2;
private IType _C3;
-
+
public OTSuperTypeHierarchyTest013(String name)
{
super(name);
}
-
+
public static Test suite()
{
if (true)
@@ -69,56 +69,56 @@ public class OTSuperTypeHierarchyTest013 extends FileBasedModelTest
return new Suite(OTSuperTypeHierarchyTest013.class);
}
@SuppressWarnings("unused")
- junit.framework.TestSuite suite =
+ junit.framework.TestSuite suite =
new Suite(OTSuperTypeHierarchyTest013.class.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
String srcFolder = "src";
String pkg = "test013";
-
- _TA1 =
+
+ _TA1 =
getType(getTestProjectDir(),
srcFolder,
pkg,
"TA1");
- _TA2 =
+ _TA2 =
getType(getTestProjectDir(),
srcFolder,
pkg,
"TA2");
- _C0 =
+ _C0 =
getType(getTestProjectDir(),
srcFolder,
pkg,
"C0");
-
- _C1 =
+
+ _C1 =
getType(getTestProjectDir(),
srcFolder,
pkg,
"C1");
- _C2 =
+ _C2 =
getType(getTestProjectDir(),
srcFolder,
pkg,
"C2");
-
- _C3 =
+
+ _C3 =
getType(getTestProjectDir(),
srcFolder,
pkg,
"C3");
- _objectType =
+ _objectType =
getType(getTestProjectDir(),
"rt.jar",
"java.lang",
@@ -136,7 +136,7 @@ public class OTSuperTypeHierarchyTest013 extends FileBasedModelTest
}
-
+
public void testCreation()
{
assertCreation(_TA1);
@@ -145,7 +145,7 @@ public class OTSuperTypeHierarchyTest013 extends FileBasedModelTest
assertCreation(_C1);
assertCreation(_C2);
assertCreation(_C3);
-
+
assertCreation(_TA2TB2TC2R1);
assertCreation(_TA2TB2TC1R1);
assertCreation(_TA2TB1TC2R1);
@@ -155,12 +155,12 @@ public class OTSuperTypeHierarchyTest013 extends FileBasedModelTest
assertCreation(_TA1TB1TC2R1);
assertCreation(_TA1TB1TC1R1);
}
-
-
+
+
public void testGetTSuperTypes_TA2TB2TC2R1() throws JavaModelException
{
_focusType = _TA2TB2TC2R1;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false);
hierarchy.refresh(new NullProgressMonitor());
@@ -171,16 +171,16 @@ public class OTSuperTypeHierarchyTest013 extends FileBasedModelTest
_TA2TB1TC2R1,
_TA1TB2TC2R1
};
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
public void testGetSuperclasses_TA2TB2TC2R1() throws JavaModelException
{
_focusType = _TA2TB2TC2R1;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false);
hierarchy.refresh(new NullProgressMonitor());
@@ -192,15 +192,15 @@ public class OTSuperTypeHierarchyTest013 extends FileBasedModelTest
_TA1TB2TC2R1,
_C1
};
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
public void testGetAllSuperclasses_TA2TB2TC2R1() throws JavaModelException
{
_focusType = _TA2TB2TC2R1;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false);
hierarchy.refresh(new NullProgressMonitor());
@@ -210,7 +210,7 @@ public class OTSuperTypeHierarchyTest013 extends FileBasedModelTest
_TA1TB2TC2R1,
_TA1TB2TC1R1,
_TA1TB1TC2R1,
- _TA1TB1TC1R1,
+ _TA1TB1TC1R1,
_TA2TB2TC1R1,
_TA2TB1TC2R1,
_TA2TB1TC1R1,
@@ -220,44 +220,44 @@ public class OTSuperTypeHierarchyTest013 extends FileBasedModelTest
// _C3, // illegal inheritance, causes incompatible supers
_objectType
};
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetExplicitSuperclass_TA2TB2TC2R1() throws JavaModelException
{
_focusType = _TA2TB2TC2R1;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false);
hierarchy.refresh(new NullProgressMonitor());
IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(hierarchy, _focusType);
IType expected = _C1;
-
- assertTrue(compareTypes(expected, actual));
+
+ assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetImplicitSuperclass_TA2TB2TC2R1() throws JavaModelException
{
_focusType = _TA2TB2TC2R1;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false);
hierarchy.refresh(new NullProgressMonitor());
IType actual = hierarchy.getSuperclass(_focusType);
IType expected = _TA1TB2TC2R1;
-
- assertTrue(compareTypes(expected, actual));
+
+ assertTrue(compareTypes(expected, actual));
}
public void testGetAllClasses_TA2TB2TC2R1() throws JavaModelException
{
_focusType = _TA2TB2TC2R1;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false);
hierarchy.refresh(new NullProgressMonitor());
@@ -278,9 +278,9 @@ public class OTSuperTypeHierarchyTest013 extends FileBasedModelTest
_C3, // illegal inheritance, causes incompatible supers
_objectType
};
-
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest014.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest014.java
index 4b31dbd27..f51487524 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest014.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest014.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -31,29 +31,29 @@ import org.eclipse.objectteams.otdt.core.hierarchy.OTTypeHierarchies;
import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
/**
- *
+ *
* @author michael
- * @version $Id: OTSuperTypeHierarchyTest014.java 23494 2010-02-05 23:06:44Z stephan $
- *
+ * @version $Id: OTSuperTypeHierarchyTest014.java 23494 2010-02-05 23:06:44Z stephan $
+ *
*/
public class OTSuperTypeHierarchyTest014 extends FileBasedModelTest {
-
+
private TypeHierarchy _testObj;
private IType _focusType;
private IType _T1;
private IType _T1R1;
- private IType _C1;
+ private IType _C1;
@SuppressWarnings("unused")
private IType _javaLangObject;
private IType _I1;
private IType _I2;
-
-
+
+
public OTSuperTypeHierarchyTest014(String name)
{
super(name);
}
-
+
public static Test suite()
{
if (true)
@@ -61,45 +61,45 @@ public class OTSuperTypeHierarchyTest014 extends FileBasedModelTest {
return new Suite(OTSuperTypeHierarchyTest014.class);
}
@SuppressWarnings("unused")
- junit.framework.TestSuite suite =
+ junit.framework.TestSuite suite =
new Suite(OTSuperTypeHierarchyTest014.class.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
String srcFolder = "src";
String pkg = "test014";
-
- _T1 =
+
+ _T1 =
getType(getTestProjectDir(),
srcFolder,
pkg,
"T1");
- _C1 =
+ _C1 =
getType(getTestProjectDir(),
srcFolder,
pkg,
"C1");
-
- _I1 =
+
+ _I1 =
getType(getTestProjectDir(),
srcFolder,
pkg,
"I1");
- _I2 =
+ _I2 =
getType(getTestProjectDir(),
srcFolder,
pkg,
"I2");
-
- _javaLangObject =
+
+ _javaLangObject =
getType(getTestProjectDir(),
"rt.jar",
"java.lang",
@@ -107,7 +107,7 @@ public class OTSuperTypeHierarchyTest014 extends FileBasedModelTest {
_T1R1 = getRole(_T1, "T1.R1");
}
-
+
public void testCreation()
{
assertCreation(_T1);
@@ -117,48 +117,48 @@ public class OTSuperTypeHierarchyTest014 extends FileBasedModelTest {
assertCreation(_I2);
}
-
+
public void testGetAllSuperInterfaces_C1() throws JavaModelException
{
_focusType = _C1;
-
- _testObj = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false);
+
+ _testObj = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false);
_testObj.refresh(new NullProgressMonitor());
IType[] actual = OTTypeHierarchies.getInstance().getAllSuperInterfaces(_testObj, _focusType);
IType[] expected = new IType[] { _I1, _I2 };
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperInterfaces_T1R1() throws JavaModelException
{
_focusType = _T1R1;
-
+
_testObj = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false);
_testObj.refresh(new NullProgressMonitor());
IType[] actual = OTTypeHierarchies.getInstance().getAllSuperInterfaces(_testObj, _focusType);
IType[] expected = new IType[] { _I1, _I2 };
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperInterfaces_I1() throws JavaModelException
{
_focusType = _I1;
-
+
_testObj = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false);
_testObj.refresh(new NullProgressMonitor());
IType[] actual = OTTypeHierarchies.getInstance().getAllSuperInterfaces(_testObj, _focusType);
IType[] expected = new IType[] { _I2 };
-
- assertEquals(expected.length, actual.length);
+
+ assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest015.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest015.java
index b040ce2ee..3c383e5d8 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest015.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest015.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -32,13 +32,13 @@ import org.eclipse.objectteams.otdt.core.hierarchy.OTTypeHierarchies;
import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
/**
- *
+ *
* @author michael
- * @version $Id: OTSuperTypeHierarchyTest015.java 23494 2010-02-05 23:06:44Z stephan $
- *
+ * @version $Id: OTSuperTypeHierarchyTest015.java 23494 2010-02-05 23:06:44Z stephan $
+ *
*/
public class OTSuperTypeHierarchyTest015 extends FileBasedModelTest {
-
+
@SuppressWarnings("unused")
private ITypeHierarchy _testObj;
private IType _focusType;
@@ -47,14 +47,14 @@ public class OTSuperTypeHierarchyTest015 extends FileBasedModelTest {
private IType _A;
private IType _B;
private IType _C;
-
-
-
+
+
+
public OTSuperTypeHierarchyTest015(String name)
{
super(name);
}
-
+
public static Test suite()
{
if (true)
@@ -62,40 +62,40 @@ public class OTSuperTypeHierarchyTest015 extends FileBasedModelTest {
return new Suite(OTSuperTypeHierarchyTest015.class);
}
@SuppressWarnings("unused")
- junit.framework.TestSuite suite =
+ junit.framework.TestSuite suite =
new Suite(OTSuperTypeHierarchyTest015.class.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
String srcFolder = "src";
String pkg = "test015";
-
- _A =
+
+ _A =
getType(getTestProjectDir(),
srcFolder,
pkg,
"A");
- _B =
+ _B =
getType(getTestProjectDir(),
srcFolder,
pkg,
"B");
-
- _C =
+
+ _C =
getType(getTestProjectDir(),
srcFolder,
pkg,
"C");
-
- _objectType =
+
+ _objectType =
getType(getTestProjectDir(),
"rt.jar",
"java.lang",
@@ -103,7 +103,7 @@ public class OTSuperTypeHierarchyTest015 extends FileBasedModelTest {
}
-
+
public void testCreation()
{
assertCreation(_A);
@@ -111,40 +111,40 @@ public class OTSuperTypeHierarchyTest015 extends FileBasedModelTest {
assertCreation(_C);
}
-
+
public void testGetExplicitSuperclass_B() throws JavaModelException
{
_focusType = _B;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false);
hierarchy.refresh(new NullProgressMonitor());
IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(hierarchy, _focusType);
IType expected = _A;
-
- assertTrue(compareTypes(expected, actual));
+
+ assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetExplicitSuperclass_C() throws JavaModelException
{
_focusType = _C;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false);
hierarchy.refresh(new NullProgressMonitor());
IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(hierarchy, _focusType);
IType expected = _B;
-
- assertTrue(compareTypes(expected, actual));
+
+ assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperclasses_C() throws JavaModelException
{
_focusType = _C;
-
+
TypeHierarchy hierarchy =
new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false);
hierarchy.refresh(new NullProgressMonitor());
@@ -152,15 +152,15 @@ public class OTSuperTypeHierarchyTest015 extends FileBasedModelTest {
IType[] actual = hierarchy.getAllSuperclasses(_focusType);
IType[] expected = new IType[] { _A, _B, _objectType };
- assertEquals(expected.length, actual.length);
- assertTrue(compareTypes(expected, actual));
+ assertEquals(expected.length, actual.length);
+ assertTrue(compareTypes(expected, actual));
}
-
-
-
-
-
-
-
+
+
+
+
+
+
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest016_Regression.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest016_Regression.java
index 43eadd0d7..12c751bae 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest016_Regression.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest016_Regression.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -30,14 +30,14 @@ import org.eclipse.objectteams.otdt.tests.hierarchy.FileBasedHierarchyTest;
public class OTSuperTypeHierarchyTest016_Regression extends FileBasedHierarchyTest
{
- private IType _T1;
+ private IType _T1;
private IType _T1_IR;
public OTSuperTypeHierarchyTest016_Regression(String name)
{
super(name);
}
-
+
@SuppressWarnings("unused") // variants to statically choose from
public static Test suite()
{
@@ -45,24 +45,24 @@ public class OTSuperTypeHierarchyTest016_Regression extends FileBasedHierarchyTe
{
return new Suite(OTSuperTypeHierarchyTest016_Regression.class);
}
- junit.framework.TestSuite suite =
+ junit.framework.TestSuite suite =
new Suite(OTSuperTypeHierarchyTest016_Regression.class.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("HierarchyRegression");
super.setUpSuite();
-
+
String srcFolder = "src";
String pkg = "t";
-
+
_T1 = getType(getTestProjectDir(), srcFolder, pkg, "T1");
-
+
_T1_IR = getRole(_T1, "T1.IR");
}
-
+
// see http://bugs.eclipse.org/366976
public void testInterfaceAtSyntaxError()
throws JavaModelException
@@ -73,8 +73,8 @@ public class OTSuperTypeHierarchyTest016_Regression extends FileBasedHierarchyTe
// due to severe syntax errors, T1.IR is not connected:
IType [] actual = OTTypeHierarchies.getInstance().getAllSuperInterfaces(_testObj, _focusType);
assertEquals(0, actual.length);
-
+
actual = OTTypeHierarchies.getInstance().getSuperclasses(_testObj, _focusType);
- assertEquals(0, actual.length);
+ assertEquals(0, actual.length);
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OrdinaryClassesHierarchyWithSubRolesTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OrdinaryClassesHierarchyWithSubRolesTest.java
index 9d82388ac..e2ebcd159 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OrdinaryClassesHierarchyWithSubRolesTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OrdinaryClassesHierarchyWithSubRolesTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -39,7 +39,7 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
*/
/*
* The testdata setting looks like this:
- *
+ *
* SuperSuperTeam
* R1 SuperClass
* /\ /\
@@ -54,19 +54,19 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
* |'''''''''''''''''''| |''''''''''''|'''''''''''''| |
* SubTeam1 SubTeam2 | | | |
* R1 R1------------------>SubSubClass11 SubSubClass12 |
- * /\ | |
+ * /\ | |
* |'''''''''''| | |
* SubSubTeam11 SubSubTeam12 | |
* R1 R1-----------------| |
* | |
* |---------------------------------------------------------------------|
- *
+ *
* The focus type is SuperClass .
*/
public class OrdinaryClassesHierarchyWithSubRolesTest extends FileBasedModelTest
{
private ITypeHierarchy _testObj;
-
+
private IRoleType _aRole;
private IRoleType _implSuperRole;
@SuppressWarnings("unused")
@@ -81,13 +81,13 @@ public class OrdinaryClassesHierarchyWithSubRolesTest extends FileBasedModelTest
private IType _subClass2;
private IType _subSubClass11;
private IType _subSubClass12;
-
-
+
+
public OrdinaryClassesHierarchyWithSubRolesTest(String name)
{
super(name);
}
-
+
public static Test suite()
{
if (true)
@@ -95,127 +95,127 @@ public class OrdinaryClassesHierarchyWithSubRolesTest extends FileBasedModelTest
return new Suite(OrdinaryClassesHierarchyWithSubRolesTest.class);
}
@SuppressWarnings("unused")
- junit.framework.TestSuite suite =
+ junit.framework.TestSuite suite =
new Suite(OrdinaryClassesHierarchyWithSubRolesTest.class.getName());
return suite;
}
-
-
+
+
public void setUpSuite() throws Exception
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
- _aRole =
+
+ _aRole =
getRole(getTestProjectDir(),
"complete_rolehierarchy_with_classes",
"test002.inlined",
"ATeam",
"R1");
-
- _implSuperRole =
+
+ _implSuperRole =
getRole(getTestProjectDir(),
"complete_rolehierarchy_with_classes",
"test002.inlined",
"SuperTeam",
"R1");
-
- _implSuperSuperRole =
+
+ _implSuperSuperRole =
getRole(getTestProjectDir(),
"complete_rolehierarchy_with_classes",
"test002.inlined",
"SuperTeam",
"R1");
-
- _implSubRole1 =
+
+ _implSubRole1 =
getRole(getTestProjectDir(),
"complete_rolehierarchy_with_classes",
"test002.inlined",
"SubTeam1",
"R1");
-
- _implSubRole2 =
+
+ _implSubRole2 =
getRole(getTestProjectDir(),
"complete_rolehierarchy_with_classes",
"test002.inlined",
"SubTeam2",
"R1");
-
+
_implSubSubRole11 =
getRole(getTestProjectDir(),
"complete_rolehierarchy_with_classes",
"test002.inlined",
"SubSubTeam11",
"R1");
-
+
_implSubSubRole12 =
getRole(getTestProjectDir(),
"complete_rolehierarchy_with_classes",
"test002.inlined",
"SubSubTeam12",
"R1");
-
+
_aClass =
- getType(getTestProjectDir(),
- "complete_rolehierarchy_with_classes",
- "test002.standard",
+ getType(getTestProjectDir(),
+ "complete_rolehierarchy_with_classes",
+ "test002.standard",
"AClass");
-
+
_superClass =
- getType(getTestProjectDir(),
- "complete_rolehierarchy_with_classes",
- "test002.standard",
+ getType(getTestProjectDir(),
+ "complete_rolehierarchy_with_classes",
+ "test002.standard",
"SuperClass");
-
+
_subClass1 =
- getType(getTestProjectDir(),
- "complete_rolehierarchy_with_classes",
- "test002.standard",
+ getType(getTestProjectDir(),
+ "complete_rolehierarchy_with_classes",
+ "test002.standard",
"SubClass1");
-
+
_subClass2 =
- getType(getTestProjectDir(),
- "complete_rolehierarchy_with_classes",
- "test002.standard",
+ getType(getTestProjectDir(),
+ "complete_rolehierarchy_with_classes",
+ "test002.standard",
"SubClass2");
-
+
_subSubClass11 =
- getType(getTestProjectDir(),
- "complete_rolehierarchy_with_classes",
- "test002.standard",
+ getType(getTestProjectDir(),
+ "complete_rolehierarchy_with_classes",
+ "test002.standard",
"SubSubClass11");
-
+
_subSubClass12 =
- getType(getTestProjectDir(),
- "complete_rolehierarchy_with_classes",
- "test002.standard",
+ getType(getTestProjectDir(),
+ "complete_rolehierarchy_with_classes",
+ "test002.standard",
"SubSubClass12");
-
+
}
-
+
public void testGetAllSubtypes_ofSuperClass() throws JavaModelException
{
assertNotNull(_superClass);
assertTrue(_superClass.exists());
_testObj = new TypeHierarchy(_superClass, null, _superClass.getJavaProject(), true);
_testObj.refresh(new NullProgressMonitor());
-
+
ArrayList<IType> expectedList = new ArrayList<IType>();
expectedList.add(_aClass);
expectedList.add(_subClass1);
expectedList.add(_subClass2);
expectedList.add(_subSubClass11);
expectedList.add(_subSubClass12);
-
+
expectedList.add(_implSuperRole);
expectedList.add(_aRole);
- expectedList.add(_implSubRole1);
+ expectedList.add(_implSubRole1);
expectedList.add(_implSubRole2);
expectedList.add(_implSubSubRole11);
expectedList.add(_implSubSubRole12);
IType[] expected = expectedList.toArray(new IType[expectedList.size()]);
IType[] actual = _testObj.getAllSubtypes(_superClass);
-
+
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OrdinaryInterfaceHierarchyTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OrdinaryInterfaceHierarchyTests.java
index 3f0d5dedd..84a40d0b9 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OrdinaryInterfaceHierarchyTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OrdinaryInterfaceHierarchyTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -37,7 +37,7 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
public class OrdinaryInterfaceHierarchyTests extends FileBasedModelTest
{
private ITypeHierarchy _testObject;
-
+
private IType _superSuperInterface;
private IType _superInterface1;
private IType _superInterface2;
@@ -47,8 +47,8 @@ public class OrdinaryInterfaceHierarchyTests extends FileBasedModelTest
private IType _subSubInterface2;
private IType _javaLangObject;
-
-
+
+
public OrdinaryInterfaceHierarchyTests(String name)
{
super(name);
@@ -64,27 +64,27 @@ public class OrdinaryInterfaceHierarchyTests extends FileBasedModelTest
junit.framework.TestSuite suite = new Suite(OrdinaryInterfaceHierarchyTests.class.getName());
return suite;
}
-
+
protected void setUp() throws Exception
{
super.setUp();
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
- _focusInterface =
+ _focusInterface =
getType(getTestProjectDir(),
"src",
"standard.interface_hierarchy",
"AnInterface");
-
+
_testObject = new TypeHierarchy(_focusInterface, null, _focusInterface.getJavaProject(), true);
_testObject.refresh(new NullProgressMonitor());
-
+
_javaLangObject = getJavaLangObject(_focusInterface.getJavaProject());
-
+
_superSuperInterface =
getType(getTestProjectDir(),
"src",
@@ -115,9 +115,9 @@ public class OrdinaryInterfaceHierarchyTests extends FileBasedModelTest
"src",
"standard.interface_hierarchy",
"SubSubInterface2");
-
+
}
-
+
public void testExistence_SuperSuperInterface()
throws JavaModelException
{
@@ -166,8 +166,8 @@ public class OrdinaryInterfaceHierarchyTests extends FileBasedModelTest
assertNotNull(_subSubInterface2);
assertTrue(_subSubInterface2.exists());
}
-
-
+
+
public void testGetAllTypes()
throws JavaModelException
{
@@ -181,51 +181,51 @@ public class OrdinaryInterfaceHierarchyTests extends FileBasedModelTest
_subSubInterface1,
_subSubInterface2};
IType[] actual = _testObject.getAllTypes();
-
+
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllClasses()
throws JavaModelException
{
IType[] expected = new IType[] { _javaLangObject };
IType[] actual = _testObject.getAllClasses();
-
+
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetSuperclass_ofFocusInterface()
{
assertNull("Interfaces have no superclass", _testObject.getSuperclass(_focusInterface));
}
-
+
public void testGetSubclass_ofFocusInterface()
{
IType[] actual = _testObject.getSubclasses(_focusInterface);
IType[] expected = new IType[] {};
- assertTrue(compareTypes(expected, actual));
+ assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetSubtypes_ofFocusInterface()
{
IType[] expected = new IType[]{_subInterface};
IType[] actual = _testObject.getSubtypes(_focusInterface);
-
+
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetRootInterfaces()
{
IType[] actual = _testObject.getRootInterfaces();
IType[] expected = new IType[] { _superInterface2, _superSuperInterface } ;
-
- assertTrue(compareTypes(expected, actual));
+
+ assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllInterfaces_SevenInterfaces()
throws JavaModelException
{
@@ -238,11 +238,11 @@ public class OrdinaryInterfaceHierarchyTests extends FileBasedModelTest
_subSubInterface1,
_subSubInterface2};
IType[] actual = _testObject.getAllInterfaces();
-
+
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetAllSuperInterfaces_FiveParents()
throws JavaModelException
{
@@ -253,18 +253,18 @@ public class OrdinaryInterfaceHierarchyTests extends FileBasedModelTest
_focusInterface,
_subInterface };
IType[] actual = _testObject.getAllSuperInterfaces(_subSubInterface1);
-
+
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
}
-
+
public void testGetExtendingInterfaces_OneChild()
throws JavaModelException
{
IType[] expected = new IType[]{ _superInterface1 };
IType[] actual = _testObject.getExtendingInterfaces(_superSuperInterface);
-
+
assertEquals(expected.length, actual.length);
assertTrue(compareTypes(expected, actual));
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/model/AbstractJavaModelCompletionTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/model/AbstractJavaModelCompletionTests.java
index 548f6e666..ed649b866 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/model/AbstractJavaModelCompletionTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/model/AbstractJavaModelCompletionTests.java
@@ -6,7 +6,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Fraunhofer FIRST - extended API and implementation
@@ -48,7 +48,7 @@ protected void addLibrary(String projectName, String jarName, String sourceZipNa
IJavaProject javaProject = getJavaProject(projectName);
IProject project = javaProject.getProject();
String projectPath = '/' + project.getName() + '/';
-
+
IClasspathAttribute[] extraAttributes;
if(docZipName == null) {
extraAttributes = new IClasspathAttribute[0];
@@ -59,7 +59,7 @@ protected void addLibrary(String projectName, String jarName, String sourceZipNa
IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME,
"jar:platform:/resource"+projectPath+docZipName+"!/")};
}
-
+
addLibraryEntry(
javaProject,
new Path(projectPath + jarName),
@@ -69,9 +69,9 @@ protected void addLibrary(String projectName, String jarName, String sourceZipNa
null,
extraAttributes,
exported);
-}
+}
protected void removeLibrary(String projectName, String jarName) throws CoreException, IOException {
- IJavaProject javaProject = getJavaProject(projectName);
+ IJavaProject javaProject = getJavaProject(projectName);
IProject project = javaProject.getProject();
String projectPath = '/' + project.getName() + '/';
removeClasspathEntry(javaProject, new Path(projectPath + jarName));
@@ -98,7 +98,7 @@ protected CompletionResult complete(String path, String source, boolean showPosi
tokenEnd = tokenStart + token.length() - 1;
}
this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
CompletionResult result = new CompletionResult();
result.proposals = requestor.getResults();
result.context = requestor.getContext();
@@ -137,9 +137,9 @@ protected CompletionResult contextComplete0(
requestor.setComputeEnclosingElement(computeEnclosingElement);
requestor.setComputeVisibleElements(computeVisibleElements);
requestor.setAssignableType(typeSignature);
-
+
cu.codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
CompletionResult result = new CompletionResult();
result.proposals = requestor.getResults();
result.context = requestor.getContext();
@@ -154,7 +154,7 @@ protected CompletionResult snippetContextComplete(
boolean isStatic) throws JavaModelException {
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, false);
type.codeComplete(snippet.toCharArray(), insertion, cursorLocation, null, null, null, isStatic, requestor, this.wcOwner);
-
+
CompletionResult result = new CompletionResult();
result.proposals = requestor.getResults();
result.context = requestor.getContext();
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/model/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/model/AllTests.java
index 0910e6a8e..bbcfb5c69 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/model/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/model/AllTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -32,13 +32,13 @@ import junit.framework.TestSuite;
/**
* Test-suite for OT-adaptations/extensions of org.eclipse.jdt.core.tests.model
- *
+ *
* @author stephan
* @version $Id: AllTests.java 23494 2010-02-05 23:06:44Z stephan $
*/
public class AllTests extends TestCase
{
- public AllTests(String name)
+ public AllTests(String name)
{
super(name);
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/model/CompletionTestsRequestor2.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/model/CompletionTestsRequestor2.java
index 7bb08808f..ec9bc7c3e 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/model/CompletionTestsRequestor2.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/model/CompletionTestsRequestor2.java
@@ -645,60 +645,60 @@ public class CompletionTestsRequestor2 extends CompletionRequestor {
public void setComputeEnclosingElement(boolean computeEnclosingElement) {
this.computeEnclosingElement = computeEnclosingElement;
}
-
+
public boolean canUseDiamond(int proposalNo) {
if (proposalNo < this.proposals.length && this.proposals[proposalNo] != null) {
return this.proposals[proposalNo].canUseDiamond(this.context);
}
return false;
}
-
+
public String getCompletionNode() {
if (this.context instanceof InternalCompletionContext) {
InternalCompletionContext internalCompletionContext = (InternalCompletionContext) this.context;
ASTNode astNode = internalCompletionContext.getCompletionNode();
if (astNode != null) return astNode.toString();
-
+
}
return null;
}
-
+
public String getCompletionNodeParent() {
if (this.context instanceof InternalCompletionContext) {
InternalCompletionContext internalCompletionContext = (InternalCompletionContext) this.context;
ASTNode astNode = internalCompletionContext.getCompletionNodeParent();
if (astNode != null) return astNode.toString();
-
+
}
return null;
}
-
+
public String getVisibleLocalVariables() {
if (this.context instanceof InternalCompletionContext) {
InternalCompletionContext internalCompletionContext = (InternalCompletionContext) this.context;
ObjectVector locals = internalCompletionContext.getVisibleLocalVariables();
if (locals != null) return locals.toString();
-
+
}
return null;
}
-
+
public String getVisibleFields() {
if (this.context instanceof InternalCompletionContext) {
InternalCompletionContext internalCompletionContext = (InternalCompletionContext) this.context;
ObjectVector fields = internalCompletionContext.getVisibleFields();
if (fields != null) return fields.toString();
-
+
}
return null;
}
-
+
public String getVisibleMethods() {
if (this.context instanceof InternalCompletionContext) {
InternalCompletionContext internalCompletionContext = (InternalCompletionContext) this.context;
ObjectVector methods = internalCompletionContext.getVisibleMethods();
if (methods != null) return methods.toString();
-
+
}
return null;
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/model/MiscRegressionTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/model/MiscRegressionTests.java
index 21ee4397a..773464ab7 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/model/MiscRegressionTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/model/MiscRegressionTests.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010 GK Software AG
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -55,9 +55,9 @@ public class MiscRegressionTests extends AbstractJavaModelTests {
if (true) {
return buildModelTestSuite(MiscRegressionTests.class);
}
- TestSuite suite = new Suite(MiscRegressionTests.class.getName());
+ TestSuite suite = new Suite(MiscRegressionTests.class.getName());
- suite.addTest(new MiscRegressionTests("testFoo"));
+ suite.addTest(new MiscRegressionTests("testFoo"));
return suite;
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/model/OTCompletionTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/model/OTCompletionTests.java
index c7efded2d..fc536569f 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/model/OTCompletionTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/model/OTCompletionTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -56,8 +56,8 @@ public void testCompletionBaseclass1() throws JavaModelException {
"/Completion/src/CompletionTeam1.java",
"public team class CompletionTeam1 {\n" +
"public class CompletionRole playedBy CompletionB");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "CompletionB";
@@ -78,8 +78,8 @@ public void testCompletionBaseclass2() throws JavaModelException {
" String toString() => String toString();\n" +
"}\n" +
"public class CompletionRoleB playedBy CompletionB");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "CompletionB";
@@ -99,10 +99,10 @@ public void testCompletionSuperRole() throws JavaModelException {
" public class ASuperRole playedBy CompletionBaseclass {\n" +
" String toString() => String toString();\n" +
" }\n" +
- " public interface ASuperRoleIfc {}\n" + // don't match this
+ " public interface ASuperRoleIfc {}\n" + // don't match this
" public class CompletionRoleB extends ASuperR {}");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "ASuperR";
@@ -124,8 +124,8 @@ public void testCompletionSuperRoleInterface() throws JavaModelException {
" }\n" +
" public class ISuperRoleClass {}\n" + // don't match this
" public class CompletionRoleB implements ISuperR {}");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "ISuperR";
@@ -147,8 +147,8 @@ public void testCompletionSuperRoles() throws JavaModelException {
" }\n" +
" public class XRoleClass {}\n" +
" public class XSubRole extends {}");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "extends ";
@@ -170,14 +170,14 @@ public void testCompletionBaseclass_Trac56() throws JavaModelException {
"public team class Trac56_SubTeam extends Trac56_SuperTeam {\n" +
" public class SubRole playedBy SuperR" +
"}\n");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "SuperR";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
// ensure that no illegal playedBy to role of the same (or super) team is proposed:
assertResults("", requestor.getResults());
}
@@ -192,15 +192,15 @@ public void testCompletionBaseGuard1() throws JavaModelException {
" void nothing() {}\n" +
" }\n" +
"}\n");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "base.ch";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
-
+
+
assertResults(
"check[METHOD_REF]{check(), LCompletionBaseclass;, ()Z, check, null, "+
(R_DEFAULT+R_RESOLVED+R_INTERESTING+R_CASE+R_EXACT_EXPECTED_TYPE+R_NON_STATIC+R_NON_RESTRICTED)+"}",
@@ -218,15 +218,15 @@ public void testCompletionBaseGuard2() throws JavaModelException {
" {\n" +
" }\n" +
"}\n");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "base.ch";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
-
+
+
assertResults(
"check[METHOD_REF]{check(), LCompletionBaseclass;, ()Z, check, null, "+
(R_DEFAULT+R_RESOLVED+R_INTERESTING+R_CASE+R_NON_STATIC+R_NON_RESTRICTED)+"}",
@@ -242,7 +242,7 @@ public void testCompletionBaseclassDecapsulation() throws JavaModelException {
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
this.wc = getWorkingCopy(
"/Completion/src/CompletionTeam3.java",
"public team class CompletionTeam3 {\n" +
@@ -250,14 +250,14 @@ public void testCompletionBaseclassDecapsulation() throws JavaModelException {
" String toString() => String toString();\n" +
"}\n" +
"public class CompletionRoleB playedBy CompletionI");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "CompletionI";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
assertResults(
"CompletionInvisibleBaseclass[TYPE_REF]{p.CompletionInvisibleBaseclass, p, Lp.CompletionInvisibleBaseclass;, null, null, "+
(R_DEFAULT+R_RESOLVED+R_INTERESTING+R_CASE+R_UNQUALIFIED)+"}",
@@ -276,7 +276,7 @@ public void testCompletionBaseclassDecapsulation2() throws JavaModelException {
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED);
JavaCore.setOptions(options);
-
+
this.wc = getWorkingCopy(
"/Completion/src/CompletionTeam3.java",
"public team class CompletionTeam3 {\n" +
@@ -284,14 +284,14 @@ public void testCompletionBaseclassDecapsulation2() throws JavaModelException {
" String toString() => String toString();\n" +
" }\n" +
" public class CompletionInvisibleBaseclass playedBy CompletionI");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "CompletionI";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
assertResults(
"CompletionInvisibleBaseclass[TYPE_REF]{p.CompletionInvisibleBaseclass, p, Lp.CompletionInvisibleBaseclass;, null, null, "+
(R_DEFAULT+R_RESOLVED+R_INTERESTING+R_CASE+R_UNQUALIFIED)+"}",
@@ -309,8 +309,8 @@ public void testCompletionKeywordPlayedBy1() throws JavaModelException {
" String toString() => String toString();\n" +
" }\n" +
" public class CompletionRoleB pla");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "pla";
@@ -329,8 +329,8 @@ public void testCompletionKeywordPlayedBy2() throws JavaModelException {
"/Completion/src/CompletionSuperTeam/ExternalRole.java",
"team package CompletionSuperTeam;\n"+
"public class ExternalRole pla");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "pla";
@@ -347,8 +347,8 @@ public void testCompletionKeywordPlayedBy3() throws JavaModelException {
this.wc = getWorkingCopy(
"/Completion/src/CompletionClassKW3.java",
"public class CompletionClassKW3 pla");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "pla";
@@ -364,8 +364,8 @@ public void testCompletionKeywordPlayedBy4() throws JavaModelException {
this.wc = getWorkingCopy(
"/Completion/src/CompletionTeamKW4.java",
"public team class CompletionTeamKW4 pla");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "pla";
@@ -386,8 +386,8 @@ public void testCompletionTypeReference1() throws JavaModelException {
" public class CompletionTRoleA playedBy CompletionTBaseclass {\n" +
" String toString() => String toString();\n" +
" protected CompletionT");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "CompletionT";
@@ -412,8 +412,8 @@ public void testCompletionTypeReference2() throws JavaModelException {
" public class CompletionRoleA playedBy CompletionBaseclass {\n" +
" String toString() => ;\n"+
" protected Seriali");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "Seriali";
@@ -427,14 +427,14 @@ public void testCompletionTypeReference2() throws JavaModelException {
}
/** A base method spec with return type and beginning of the selector is searched. */
-public void testCompletionMethodSpecLong1() throws JavaModelException {
+public void testCompletionMethodSpecLong1() throws JavaModelException {
this.wc = getWorkingCopy(
"/Completion/src/CompletionTeam1.java",
"public team class CompletionTeam1 {\n" +
"public class CompletionRole playedBy CompletionBaseclass {\n" +
" String toString() => String toStr");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "toStr";
@@ -448,15 +448,15 @@ public void testCompletionMethodSpecLong1() throws JavaModelException {
}
/** A base method spec with return type and beginning of the selector is searched - CALLIN. */
-public void testCompletionMethodSpecLong2() throws JavaModelException {
+public void testCompletionMethodSpecLong2() throws JavaModelException {
this.wc = getWorkingCopy(
"/Completion/src/CompletionTeam1.java",
"public team class CompletionTeam1 {\n" +
"public class CompletionRole playedBy CompletionBaseclass {\n" +
" void foo() {}\n "+
" void foo() <- after String toStr ");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "toStr";
@@ -470,15 +470,15 @@ public void testCompletionMethodSpecLong2() throws JavaModelException {
}
/** A base method spec with the beginning of the selector is searched. */
-public void testCompletionMethodSpecLong3() throws JavaModelException {
+public void testCompletionMethodSpecLong3() throws JavaModelException {
this.wc = getWorkingCopy(
"/Completion/src/CompletionTeam1.java",
"public team class CompletionTeam1 {\n" +
"public class CompletionRole playedBy CompletionBaseclass {\n" +
" int myHashCode() -> hash\n"+
"}}");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "hash";
@@ -492,14 +492,14 @@ public void testCompletionMethodSpecLong3() throws JavaModelException {
}
/** A base method spec with the beginning of the selector is searched - callin. */
-public void testCompletionMethodSpecLong4() throws JavaModelException {
+public void testCompletionMethodSpecLong4() throws JavaModelException {
this.wc = getWorkingCopy(
"/Completion/src/CompletionTeam1.java",
"public team class CompletionTeam1 {\n" +
"public class CompletionRole playedBy CompletionBaseclass {\n" +
" int myHashCode() <- after hash");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "hash";
@@ -512,7 +512,7 @@ public void testCompletionMethodSpecLong4() throws JavaModelException {
requestor.getResults());
}
/** A type in a RHS method spec signature is completed. */
-public void testCompletionMethodSpecLong5() throws JavaModelException {
+public void testCompletionMethodSpecLong5() throws JavaModelException {
this.wc = getWorkingCopy(
"/Completion/src/CompletionTeam1.java",
"public team class CompletionTeam1 {\n" +
@@ -520,8 +520,8 @@ public void testCompletionMethodSpecLong5() throws JavaModelException {
" int myHashCode() <- after void foo(CompletionB\n" +
" }\n"+
"}\n");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "CompletionB";
@@ -534,7 +534,7 @@ public void testCompletionMethodSpecLong5() throws JavaModelException {
requestor.getResults());
}
/** A callin binding guard is completed. */
-public void testCompletionBindingGuard() throws JavaModelException {
+public void testCompletionBindingGuard() throws JavaModelException {
this.wc = getWorkingCopy(
"/Completion/src/CompletionTeam1.java",
"public team class CompletionTeam1 {\n" +
@@ -543,8 +543,8 @@ public void testCompletionBindingGuard() throws JavaModelException {
" when (CompletionB"+
" }\n"+
"}\n");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "(CompletionB";
@@ -557,14 +557,14 @@ public void testCompletionBindingGuard() throws JavaModelException {
requestor.getResults());
}
-public void testCompletionMethodSpecShort1() throws JavaModelException {
+public void testCompletionMethodSpecShort1() throws JavaModelException {
this.wc = getWorkingCopy(
"/Completion/src/CompletionTeam1.java",
"public team class CompletionTeam1 {\n" +
"public class CompletionRole playedBy CompletionBaseclass {\n" +
" toString => toStri");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "toStri";
@@ -578,7 +578,7 @@ public void testCompletionMethodSpecShort1() throws JavaModelException {
}
/* prefix of base method spec typed. */
-public void testCompletionMethodSpecShort2() throws JavaModelException {
+public void testCompletionMethodSpecShort2() throws JavaModelException {
this.wc = getWorkingCopy(
"/Completion/src/CompletionTeam1.java",
"public team class CompletionTeam1 {\n" +
@@ -586,8 +586,8 @@ public void testCompletionMethodSpecShort2() throws JavaModelException {
" void bar() {};\n" +
" bar <- after fub\n"+
"}}");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "fub";
@@ -601,15 +601,15 @@ public void testCompletionMethodSpecShort2() throws JavaModelException {
}
-public void testCompletionCalloutDeclaration1() throws JavaModelException {
+public void testCompletionCalloutDeclaration1() throws JavaModelException {
this.wc = getWorkingCopy(
"/Completion/src/CompletionTeam1.java",
"public team class CompletionTeam1 {\n" +
"public class CompletionRole playedBy CompletionBaseclass {\n" +
"fub \n"+
"}");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "fub";
@@ -624,15 +624,15 @@ public void testCompletionCalloutDeclaration1() throws JavaModelException {
requestor.getResults());
}
// same as above but without a typed prefix
-public void testCompletionCalloutDeclaration1a() throws JavaModelException {
+public void testCompletionCalloutDeclaration1a() throws JavaModelException {
this.wc = getWorkingCopy(
"/Completion/src/CompletionTeam1.java",
"public team class CompletionTeam1 {\n" +
"public class CompletionRole playedBy CompletionBaseclass {\n" +
"/*here*/ \n"+
"}");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "/*here*/ ";
@@ -643,7 +643,7 @@ public void testCompletionCalloutDeclaration1a() throws JavaModelException {
assertTrue("Expect more than one proposal", results.length > 1);
for (int i = 0; i < results.length; i++) {
if (results[i].startsWith("fubar")) {
- assertEquals("Expected proposal",
+ assertEquals("Expected proposal",
"fubar[CALLOUT_DECLARATION]{long fubar(int fred, String zork) -> long fubar(int fred, String zork);, LCompletionBaseclass;, (ILjava.lang.String;)J, fubar, (fred, zork), " +
(R_DEFAULT+R_RESOLVED+R_INTERESTING+R_CASE+R_UNQUALIFIED+R_NON_RESTRICTED)+"}",
results[i]);
@@ -653,7 +653,7 @@ public void testCompletionCalloutDeclaration1a() throws JavaModelException {
fail("Expected proposal not found");
}
// callout-override
-public void testCompletionCalloutDeclaration2() throws JavaModelException {
+public void testCompletionCalloutDeclaration2() throws JavaModelException {
this.wc = getWorkingCopy(
"/Completion/src/CompletionTeam1.java",
"public team class CompletionTeam1 {\n" +
@@ -662,8 +662,8 @@ public void testCompletionCalloutDeclaration2() throws JavaModelException {
" fub \n"+
" }\n"+
"}");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "fub";
@@ -680,7 +680,7 @@ public void testCompletionCalloutDeclaration2() throws JavaModelException {
requestor.getResults());
}
//callout-non-override (implicitly inherited abstract method)
-public void testCompletionCalloutDeclaration3() throws JavaModelException {
+public void testCompletionCalloutDeclaration3() throws JavaModelException {
this.wc = getWorkingCopy(
"/Completion/src/CompletionTeam1.java",
"public team class CompletionTeam1 extends CompletionSuperTeam {\n" +
@@ -688,8 +688,8 @@ public void testCompletionCalloutDeclaration3() throws JavaModelException {
" fub \n"+
" }\n"+
"}");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "fub";
@@ -706,15 +706,15 @@ public void testCompletionCalloutDeclaration3() throws JavaModelException {
requestor.getResults());
}
// static methods
-public void testCompletionCalloutDeclaration4() throws JavaModelException {
+public void testCompletionCalloutDeclaration4() throws JavaModelException {
this.wc = getWorkingCopy(
"/Completion/src/CompletionTeam1.java",
"public team class CompletionTeam1 {\n" +
"public class CompletionRole playedBy CompletionBaseclass {\n" +
"mySt \n"+
"}");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "mySt";
@@ -729,15 +729,15 @@ public void testCompletionCalloutDeclaration4() throws JavaModelException {
requestor.getResults());
}
-public void testCompletionCalloutDeclarationTrac138() throws JavaModelException {
+public void testCompletionCalloutDeclarationTrac138() throws JavaModelException {
this.wc = getWorkingCopy(
"/Completion/src/CompletionTeam1.java",
"public team class CompletionTeam1 {\n" +
"public class CompletionRole playedBy BaseTrac138 {\n" +
"foo \n"+
"}");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "foo";
@@ -759,8 +759,8 @@ public void testCompletionCalloutToFieldDeclaration() throws JavaModelException
" getS \n"+
" }\n"+
"}");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(false, false, true);
String str = this.wc.getSource();
String completeBehind = "getS";
@@ -774,7 +774,7 @@ public void testCompletionCalloutToFieldDeclaration() throws JavaModelException
+(R_DEFAULT+R_RESOLVED+R_INTERESTING+R_METHOD_OVERIDE)+"}\n"+
"getStr[CALLOUT_GET]{String getStr() -> get String str;, LBaseTrac38;, ()Ljava.lang.String;, getStr, [129, 133], " +
(R_DEFAULT+R_RESOLVED+R_INTERESTING+R_CASE+R_UNQUALIFIED+R_NON_RESTRICTED)+"}",
- requestor.getResults());
+ requestor.getResults());
}
public void testCompletionCalloutToFieldDeclarationTrac138() throws JavaModelException {
@@ -786,8 +786,8 @@ public void testCompletionCalloutToFieldDeclarationTrac138() throws JavaModelExc
" getBar \n"+
" }\n"+
"}");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(false, false, true);
String str = this.wc.getSource();
String completeBehind = "getBar";
@@ -797,7 +797,7 @@ public void testCompletionCalloutToFieldDeclarationTrac138() throws JavaModelExc
assertResults(
"getBar[POTENTIAL_METHOD_DECLARATION]{getBar, LCompletionTeamCalloutToField$CompletionRole;, ()V, getBar, [130, 136], "+
+(R_DEFAULT+R_RESOLVED+R_INTERESTING+R_METHOD_OVERIDE)+"}",
- requestor.getResults());
+ requestor.getResults());
}
public void testCompletionParamMapping1() throws JavaModelException {
@@ -811,8 +811,8 @@ public void testCompletionParamMapping1() throws JavaModelException {
" }\n"+
" }\n"+
"}");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(false, false, true);
String str = this.wc.getSource();
String completeBehind = "str.le";
@@ -822,7 +822,7 @@ public void testCompletionParamMapping1() throws JavaModelException {
assertResults(
"length[METHOD_REF]{length(), Ljava.lang.String;, ()I, length, [187, 189], "+
(R_DEFAULT+R_RESOLVED+R_INTERESTING+R_CASE+R_NON_STATIC+R_NON_RESTRICTED)+"}",
- requestor.getResults());
+ requestor.getResults());
}
public void testCompletionTrac38_1() throws JavaModelException {
this.wc = getWorkingCopy(
@@ -836,8 +836,8 @@ public void testCompletionTrac38_1() throws JavaModelException {
" String str() -> get \n"+
" }\n"+
"}");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(false, false, true);
String str = this.wc.getSource();
String completeBehind = "get ";
@@ -849,7 +849,7 @@ public void testCompletionTrac38_1() throws JavaModelException {
(R_DEFAULT+R_RESOLVED+R_INTERESTING+R_CASE+R_EXACT_EXPECTED_TYPE+R_UNQUALIFIED+R_NON_RESTRICTED)+"}\n"+
"str[FIELD_SPEC]{String str;, LBaseTrac38;, Ljava.lang.String;, str, [222, 222], " +
(R_DEFAULT+R_RESOLVED+R_INTERESTING+R_CASE+R_EXACT_EXPECTED_TYPE+R_UNQUALIFIED+R_NON_RESTRICTED)+"}",
- requestor.getResults());
+ requestor.getResults());
}
// same as above but without the space after "get" but still expect the same c-t-f proposals
public void testCompletionTrac38_2() throws JavaModelException {
@@ -864,8 +864,8 @@ public void testCompletionTrac38_2() throws JavaModelException {
" String str() -> get\n"+
" }\n"+
"}");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(false, false, true);
String str = this.wc.getSource();
String completeBehind = "get";
@@ -879,7 +879,7 @@ public void testCompletionTrac38_2() throws JavaModelException {
(R_DEFAULT+R_RESOLVED+R_INTERESTING+R_CASE+R_EXACT_EXPECTED_TYPE+R_UNQUALIFIED+R_NON_RESTRICTED)+"}\n"+
"str[FIELD_SPEC]{ String str;, LBaseTrac38;, Ljava.lang.String;, str, [221, 221], " + // yes, proposal starts with blank
(R_DEFAULT+R_RESOLVED+R_INTERESTING+R_CASE+R_EXACT_EXPECTED_TYPE+R_UNQUALIFIED+R_NON_RESTRICTED)+"}",
- requestor.getResults());
+ requestor.getResults());
}
// indicate field name by role method spec naming convention:
public void testCompletionTrac38_3() throws JavaModelException {
@@ -894,8 +894,8 @@ public void testCompletionTrac38_3() throws JavaModelException {
" String getStr() -> get \n"+
" }\n"+
"}");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(false, false, true);
String str = this.wc.getSource();
String completeBehind = "get ";
@@ -907,7 +907,7 @@ public void testCompletionTrac38_3() throws JavaModelException {
(R_DEFAULT+R_RESOLVED+R_INTERESTING+R_SUBSTRING+R_EXACT_EXPECTED_TYPE+R_UNQUALIFIED+R_NON_RESTRICTED)+"}\n"+ // no R_CASE, R_EXACT_NAME !
"str[FIELD_SPEC]{String str;, LBaseTrac38;, Ljava.lang.String;, str, [225, 225], " +
(R_DEFAULT+R_RESOLVED+R_INTERESTING+R_CASE+R_EXACT_NAME+R_EXACT_EXPECTED_TYPE+R_UNQUALIFIED+R_NON_RESTRICTED)+"}",
- requestor.getResults());
+ requestor.getResults());
}
public void testCompletionCallToCallout1() throws JavaModelException {
this.wc = getWorkingCopy(
@@ -920,8 +920,8 @@ public void testCompletionCallToCallout1() throws JavaModelException {
" r.fub\n"+
" }\n"+
"}");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "fub";
@@ -931,7 +931,7 @@ public void testCompletionCallToCallout1() throws JavaModelException {
assertResults(
"fubar[METHOD_REF]{fubar(), LCompletionTeam1$CompletionRole;, (ILjava.lang.String;)J, fubar, (fred, zork), " +
(R_DEFAULT+R_RESOLVED+R_INTERESTING+R_CASE+R_NON_STATIC+R_NON_RESTRICTED)+"}",
- requestor.getResults());
+ requestor.getResults());
}
// witness for https://svn.objectteams.org/trac/ot/ticket/22
public void testCompletionCallToCallout2() throws JavaModelException {
@@ -943,8 +943,8 @@ public void testCompletionCallToCallout2() throws JavaModelException {
" r.fub\n"+
" }\n"+
"}");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "fub";
@@ -954,7 +954,7 @@ public void testCompletionCallToCallout2() throws JavaModelException {
assertResults(
"fubar[METHOD_REF]{fubar(), LCompletionCalloutTeam$CompletionRole;, (ILjava.lang.String;)J, fubar, (fred, zork), " +
(R_DEFAULT+R_RESOLVED+R_INTERESTING+R_CASE+R_NON_STATIC+R_NON_RESTRICTED)+"}",
- requestor.getResults());
+ requestor.getResults());
}
public void testCompletionCallToCallout3() throws JavaModelException {
// call to inferred callout?
@@ -967,17 +967,17 @@ public void testCompletionCallToCallout3() throws JavaModelException {
" }\n"+
" }\n"+
"}");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "fre";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
assertResults(
"fred[FIELD_REF]{fred, LCompletionBaseclass;, I, fred, null, " +
(R_DEFAULT+R_RESOLVED+R_INTERESTING+R_CASE+R_UNQUALIFIED+R_NON_RESTRICTED)+"}",
- requestor.getResults());
+ requestor.getResults());
}
public void testCompletionCallToCallout3this() throws JavaModelException {
// call to inferred callout?
@@ -990,8 +990,8 @@ public void testCompletionCallToCallout3this() throws JavaModelException {
" }\n"+
" }\n"+
"}");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "fre";
@@ -1001,7 +1001,7 @@ public void testCompletionCallToCallout3this() throws JavaModelException {
assertResults(
"fred[FIELD_REF]{fred, LCompletionBaseclass;, I, fred, null, " +
(R_DEFAULT+R_RESOLVED+R_INTERESTING+R_CASE+R_NON_STATIC+R_NON_RESTRICTED)+"}",
- requestor.getResults());
+ requestor.getResults());
}
public void testCompletionCallToCallout3qualified() throws JavaModelException {
// call to inferred callout? Not allowed on other role
@@ -1014,7 +1014,7 @@ public void testCompletionCallToCallout3qualified() throws JavaModelException {
" }\n"+
" }\n"+
"}");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "fre";
@@ -1023,7 +1023,7 @@ public void testCompletionCallToCallout3qualified() throws JavaModelException {
assertResults(
"",
- requestor.getResults());
+ requestor.getResults());
}
public void testCompletionCallToCallout4() throws JavaModelException {
// call to inferred callout?
@@ -1036,7 +1036,7 @@ public void testCompletionCallToCallout4() throws JavaModelException {
" }\n"+
" }\n"+
"}");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "fub";
@@ -1046,7 +1046,7 @@ public void testCompletionCallToCallout4() throws JavaModelException {
assertResults(
"fubar[METHOD_REF]{fubar(), LCompletionBaseclass;, (ILjava.lang.String;)J, fubar, (fred, zork), " +
(R_DEFAULT+R_RESOLVED+R_INTERESTING+R_CASE+R_UNQUALIFIED+R_NON_RESTRICTED)+"}",
- requestor.getResults());
+ requestor.getResults());
}
public void testCompletionCallToCallout5() throws JavaModelException {
// indirect call via inferred callout
@@ -1059,19 +1059,19 @@ public void testCompletionCallToCallout5() throws JavaModelException {
" }\n"+
" }\n"+
"}");
-
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "endsW";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
assertResults(
"endsWith[METHOD_REF]{endsWith(), Ljava.lang.String;, (Ljava.lang.String;)Z, endsWith, (postfix), " +
(R_DEFAULT+R_RESOLVED+R_INTERESTING+R_CASE+R_NON_STATIC+R_NON_RESTRICTED)+"}",
- requestor.getResults());
+ requestor.getResults());
}
-public void testCompletionOverrideTSuper() throws JavaModelException {
+public void testCompletionOverrideTSuper() throws JavaModelException {
this.wc = getWorkingCopy(
"/Completion/src/CompletionTeam1.java",
"public team class CompletionTeam1 extends CompletionSuperTeam {\n" +
@@ -1079,8 +1079,8 @@ public void testCompletionOverrideTSuper() throws JavaModelException {
" noth \n"+
" }\n"+
"}");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "noth";
@@ -1094,7 +1094,7 @@ public void testCompletionOverrideTSuper() throws JavaModelException {
(R_DEFAULT+R_RESOLVED+R_INTERESTING+R_CASE+R_METHOD_OVERIDE+R_NON_RESTRICTED)+"}",
requestor.getResults());
}
-public void testCompletionOverrideAbstractTSuper() throws JavaModelException {
+public void testCompletionOverrideAbstractTSuper() throws JavaModelException {
this.wc = getWorkingCopy(
"/Completion/src/CompletionTeam1.java",
"public team class CompletionTeam1 extends CompletionSuperTeam {\n" +
@@ -1102,8 +1102,8 @@ public void testCompletionOverrideAbstractTSuper() throws JavaModelException {
" fub \n"+
" }\n"+
"}");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "fub";
@@ -1117,7 +1117,7 @@ public void testCompletionOverrideAbstractTSuper() throws JavaModelException {
(R_DEFAULT+R_RESOLVED+R_INTERESTING+R_CASE+R_METHOD_OVERIDE+R_ABSTRACT_METHOD+R_NON_RESTRICTED)+"}",
requestor.getResults());
}
-public void testCompletionDontOverrideLocal() throws JavaModelException {
+public void testCompletionDontOverrideLocal() throws JavaModelException {
this.wc = getWorkingCopy(
"/Completion/src/CompletionTeam1.java",
"public team class CompletionTeam1 extends CompletionSuperTeam {\n" +
@@ -1126,8 +1126,8 @@ public void testCompletionDontOverrideLocal() throws JavaModelException {
" fub \n"+
" }\n"+
"}");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "fub";
@@ -1139,7 +1139,7 @@ public void testCompletionDontOverrideLocal() throws JavaModelException {
(R_DEFAULT+R_RESOLVED+R_INTERESTING+R_NON_RESTRICTED)+"}",
requestor.getResults());
}
-public void testCompletionCallAbstractTSuper() throws JavaModelException {
+public void testCompletionCallAbstractTSuper() throws JavaModelException {
this.wc = getWorkingCopy(
"/Completion/src/CompletionTeam1.java",
"public team class CompletionTeam1 extends CompletionSuperTeam {\n" +
@@ -1149,8 +1149,8 @@ public void testCompletionCallAbstractTSuper() throws JavaModelException {
" }\n"+
" }\n"+
"}");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "fub";
@@ -1162,7 +1162,7 @@ public void testCompletionCallAbstractTSuper() throws JavaModelException {
(R_DEFAULT+R_RESOLVED+R_INTERESTING+R_CASE+R_UNQUALIFIED+R_NON_RESTRICTED)+"}",
requestor.getResults());
}
-public void testCompletionCallTSuper() throws JavaModelException {
+public void testCompletionCallTSuper() throws JavaModelException {
this.wc = getWorkingCopy(
"/Completion/src/CompletionTeam1.java",
"public team class CompletionTeam1 extends CompletionSuperTeam {\n" +
@@ -1172,8 +1172,8 @@ public void testCompletionCallTSuper() throws JavaModelException {
" }\n"+
" }\n"+
"}");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "noth";
@@ -1190,11 +1190,11 @@ public void testCompletionOnConfined() throws JavaModelException {
"/Completion/src/CompletionTeam1.java",
"public team class CompletionTeam1 {\n" +
" void m(IConfined r) { \n"+
- " r.\n" +
+ " r.\n" +
" }\n"+
"}");
-
-
+
+
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
String str = this.wc.getSource();
String completeBehind = "r.";
@@ -1203,7 +1203,7 @@ public void testCompletionOnConfined() throws JavaModelException {
assertResults(
"",
- requestor.getResults());
+ requestor.getResults());
}
} \ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/AllTests.java
index 5e991388e..a4542286c 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/AllTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -31,13 +31,13 @@ import junit.framework.TestSuite;
/**
* Description of the class.
- *
+ *
* @author jwloka
* @version $Id: AllTests.java 23494 2010-02-05 23:06:44Z stephan $
*/
public class AllTests extends TestCase
{
- public AllTests(String name)
+ public AllTests(String name)
{
super(name);
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/AllTests_.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/AllTests_.java
index 6fd0f5100..8604c59e9 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/AllTests_.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/AllTests_.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -26,7 +26,7 @@ import junit.framework.TestSuite;
/**
* Enter a class description here!
- *
+ *
* @author jwloka
* @version $Id: AllTests_.java 23494 2010-02-05 23:06:44Z stephan $
*/
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/CallinMappingTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/CallinMappingTest.java
index f8ed0fd8f..6a86c4cbc 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/CallinMappingTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/CallinMappingTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -48,15 +48,15 @@ import org.eclipse.objectteams.otdt.core.OTModelManager;
* - neither role method nor base method exist
* - multiple (three) base methods are mapped to the same role method
* whereas two of those base methods exist and one of those does not exist
- * - one base method is mapped to multiple (2) role methods
+ * - one base method is mapped to multiple (2) role methods
*/
public class CallinMappingTest extends FileBasedModelTest
{
-
+
private IType _teamJavaElem;
private IType _roleJavaElem;
private IType _baseJavaElem;
-
+
public CallinMappingTest(String name)
{
super(name);
@@ -72,49 +72,49 @@ public class CallinMappingTest extends FileBasedModelTest
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("CallinMapping");
super.setUpSuite();
}
-
+
public void setUp() throws Exception
{
super.setUp();
-
+
try
{
ICompilationUnit teamUnit = getCompilationUnit(
- "CallinMapping",
+ "CallinMapping",
"src",
- "teampkg",
+ "teampkg",
"SampleTeam" + ".java");
_teamJavaElem = teamUnit.getType("SampleTeam");
_roleJavaElem = _teamJavaElem.getType("SampleRole");
-
+
ICompilationUnit baseUnit = getCompilationUnit(
- "CallinMapping",
+ "CallinMapping",
"src",
- "basepkg",
+ "basepkg",
"SampleBase" + ".java");
- _baseJavaElem = baseUnit.getType("SampleBase");
+ _baseJavaElem = baseUnit.getType("SampleBase");
}
catch (JavaModelException ex)
{
ex.printStackTrace();
}
- }
-
+ }
+
private IRoleType getRoleOTElem()
{
if ((_roleJavaElem != null) && (_roleJavaElem.exists()))
{
IOTType roleOTElem = OTModelManager.getOTElement(_roleJavaElem);
-
+
if ((roleOTElem != null) && (roleOTElem instanceof IRoleType))
{
return ((IRoleType) roleOTElem);
@@ -127,66 +127,66 @@ public class CallinMappingTest extends FileBasedModelTest
{
assertNotNull(_baseJavaElem);
assertTrue(_baseJavaElem.exists());
-
+
IMethod[] baseMethods = _baseJavaElem.getMethods();
assertNotNull(baseMethods);
assertEquals(6, baseMethods.length);
-
- assertTrue((_baseJavaElem.getMethod("baseMethod1", new String[0])).exists());
+
+ assertTrue((_baseJavaElem.getMethod("baseMethod1", new String[0])).exists());
assertTrue((_baseJavaElem.getMethod("baseMethod2", new String[0])).exists());
assertTrue((_baseJavaElem.getMethod("baseMethod3", new String[0])).exists());
assertTrue((_baseJavaElem.getMethod("baseMethod4", new String[0])).exists());
-
- assertFalse((_baseJavaElem.getMethod("baseMethodA", new String[0])).exists());
+
+ assertFalse((_baseJavaElem.getMethod("baseMethodA", new String[0])).exists());
assertFalse((_baseJavaElem.getMethod("baseMethodB", new String[0])).exists());
assertFalse((_baseJavaElem.getMethod("baseMethodC", new String[0])).exists());
-
+
IMethod[] roleMethods = _roleJavaElem.getMethods();
assertNotNull(roleMethods);
assertEquals(6, roleMethods.length);
-
+
assertTrue((_roleJavaElem.getMethod("roleMethod1", new String[0])).exists());
assertTrue((_roleJavaElem.getMethod("roleMethod2", new String[0])).exists());
assertTrue((_roleJavaElem.getMethod("roleMethod3", new String[0])).exists());
assertTrue((_roleJavaElem.getMethod("roleMethod4", new String[0])).exists());
-
+
assertFalse((_roleJavaElem.getMethod("roleMethodA", new String[0])).exists());
- assertFalse((_roleJavaElem.getMethod("roleMethodB", new String[0])).exists());
+ assertFalse((_roleJavaElem.getMethod("roleMethodB", new String[0])).exists());
}
-
-
+
+
public void testExistenceOfMappings() throws JavaModelException
{
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
-
+
IMethodMapping[] allMethodMappings = roleOTElem.getMethodMappings();
assertEquals(8, allMethodMappings.length);
-
+
IMethodMapping[] calloutMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLOUTS);
assertEquals(0, calloutMethodMappings.length);
-
+
IMethodMapping[] callinMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLINS);
assertEquals(8, callinMethodMappings.length);
}
-
+
public void testMapping1() throws JavaModelException
{
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
IMethodMapping[] callinMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLINS);
-
+
IMethodMapping mapping = callinMethodMappings[0];
assertNotNull(mapping);
-
+
assertEquals("roleMethod1 <- baseMethod1", mapping.getElementName());
assertEquals(IOTJavaElement.CALLIN_MAPPING, mapping.getMappingKind());
-
+
IMethod roleMethod = mapping.getRoleMethod();
assertNotNull(roleMethod);
assertEquals("roleMethod1", roleMethod.getElementName());
-
+
ICallinMapping callinMapping = (ICallinMapping) mapping;
IMethod[] boundBaseMethods = callinMapping.getBoundBaseMethods();
assertNotNull(boundBaseMethods);
@@ -199,101 +199,101 @@ public class CallinMappingTest extends FileBasedModelTest
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
IMethodMapping[] callinMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLINS);
-
+
IMethodMapping mapping = callinMethodMappings[0];
assertNotNull(mapping);
-
+
String token = mapping.getHandleIdentifier();
-
+
SourceType sourceType = (SourceType)roleOTElem.getCorrespondingJavaElement();
IJavaElement fromMemento = JavaCore.create(token, sourceType.getCompilationUnit().getOwner());
-
+
assertEquals("Elements should be equal", mapping, fromMemento);
-
+
assertTrue("Element should exist", fromMemento.exists());
-
+
assertFalse("Mapping should not have signature", ((IMethodMapping)fromMemento).hasSignature());
}
-
+
public void testMapping2() throws JavaModelException
{
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
IMethodMapping[] callinMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLINS);
-
+
IMethodMapping mapping = callinMethodMappings[1];
assertNotNull(mapping);
-
+
assertEquals("roleMethodA <- baseMethod2", mapping.getElementName());
assertEquals(IOTJavaElement.CALLIN_MAPPING, mapping.getMappingKind());
-
+
IMethod roleMethod = mapping.getRoleMethod();
assertNull(roleMethod);
-
+
ICallinMapping callinMapping = (ICallinMapping) mapping;
IMethod[] boundBaseMethods = callinMapping.getBoundBaseMethods();
assertNotNull(boundBaseMethods);
assertEquals(1, boundBaseMethods.length);
assertEquals("baseMethod2", boundBaseMethods[0].getElementName());
}
-
+
public void testMapping3() throws JavaModelException
{
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
IMethodMapping[] callinMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLINS);
-
+
IMethodMapping mapping = callinMethodMappings[2];
assertNotNull(mapping);
-
+
assertEquals("roleMethod2 <- baseMethodA", mapping.getElementName());
assertEquals(IOTJavaElement.CALLIN_MAPPING, mapping.getMappingKind());
-
+
IMethod roleMethod = mapping.getRoleMethod();
assertNotNull(roleMethod);
assertEquals("roleMethod2", roleMethod.getElementName());
-
+
ICallinMapping callinMapping = (ICallinMapping) mapping;
IMethod[] boundBaseMethods = callinMapping.getBoundBaseMethods();
assertEquals(0, boundBaseMethods.length);
}
-
+
public void testMapping4() throws JavaModelException
{
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
IMethodMapping[] callinMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLINS);
-
+
IMethodMapping mapping = callinMethodMappings[3];
assertNotNull(mapping);
-
+
assertEquals("roleMethodB <- baseMethodB", mapping.getElementName());
assertEquals(IOTJavaElement.CALLIN_MAPPING, mapping.getMappingKind());
-
+
IMethod roleMethod = mapping.getRoleMethod();
assertNull(roleMethod);
-
+
ICallinMapping callinMapping = (ICallinMapping) mapping;
IMethod[] boundBaseMethods = callinMapping.getBoundBaseMethods();
assertEquals(0, boundBaseMethods.length);
}
-
+
public void testMapping5() throws JavaModelException
{
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
IMethodMapping[] callinMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLINS);
-
+
IMethodMapping mapping = callinMethodMappings[4];
assertNotNull(mapping);
-
+
assertEquals("roleMethod3 <- {baseMethod3,baseMethod4,baseMethodC}", mapping.getElementName());
assertEquals(IOTJavaElement.CALLIN_MAPPING, mapping.getMappingKind());
-
+
IMethod roleMethod = mapping.getRoleMethod();
assertNotNull(roleMethod);
assertEquals("roleMethod3", roleMethod.getElementName());
-
+
ICallinMapping callinMapping = (ICallinMapping) mapping;
IMethod[] boundBaseMethods = callinMapping.getBoundBaseMethods();
assertNotNull(boundBaseMethods);
@@ -301,25 +301,25 @@ public class CallinMappingTest extends FileBasedModelTest
assertEquals("baseMethod3", boundBaseMethods[0].getElementName());
assertEquals("baseMethod4", boundBaseMethods[1].getElementName());
}
-
+
public void testMapping5FromMemento() throws JavaModelException
{
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
IMethodMapping[] callinMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLINS);
-
+
IMethodMapping mapping = callinMethodMappings[4];
assertNotNull(mapping);
-
+
assertNotNull(mapping);
-
+
String token = mapping.getHandleIdentifier();
-
+
SourceType sourceType = (SourceType)roleOTElem.getCorrespondingJavaElement();
IJavaElement fromMemento = JavaCore.create(token, sourceType.getCompilationUnit().getOwner());
-
+
assertEquals("Elements should be equal", mapping, fromMemento);
-
+
assertTrue("Element should exist", fromMemento.exists());
ICallinMapping callinMapping = (ICallinMapping) fromMemento;
@@ -329,89 +329,89 @@ public class CallinMappingTest extends FileBasedModelTest
assertEquals("baseMethod3", boundBaseMethods[0].getElementName());
assertEquals("baseMethod4", boundBaseMethods[1].getElementName());
}
-
+
public void testMapping6() throws JavaModelException
{
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
IMethodMapping[] callinMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLINS);
-
+
IMethodMapping mapping = callinMethodMappings[5];
assertNotNull(mapping);
-
+
assertEquals("roleMethod4 <- baseMethod4", mapping.getElementName());
assertEquals(IOTJavaElement.CALLIN_MAPPING, mapping.getMappingKind());
-
+
IMethod roleMethod = mapping.getRoleMethod();
assertNotNull(roleMethod);
assertEquals("roleMethod4", roleMethod.getElementName());
-
+
ICallinMapping callinMapping = (ICallinMapping) mapping;
IMethod[] boundBaseMethods = callinMapping.getBoundBaseMethods();
assertNotNull(boundBaseMethods);
assertEquals(1, boundBaseMethods.length);
assertEquals("baseMethod4", boundBaseMethods[0].getElementName());
}
-
+
public void testMapping7() throws JavaModelException
{
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
IMethodMapping[] callinMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLINS);
-
+
IMethodMapping mapping = callinMethodMappings[6];
assertNotNull(mapping);
-
+
assertEquals("roleMethod5(int) <- baseMethod5(int)", mapping.getElementName());
assertEquals(IOTJavaElement.CALLIN_MAPPING, mapping.getMappingKind());
-
+
IMethod roleMethod = mapping.getRoleMethod();
assertNotNull(roleMethod);
assertEquals("roleMethod5", roleMethod.getElementName());
-
+
ICallinMapping callinMapping = (ICallinMapping) mapping;
IMethod[] boundBaseMethods = callinMapping.getBoundBaseMethods();
assertNotNull(boundBaseMethods);
assertEquals(1, boundBaseMethods.length);
assertEquals("baseMethod5", boundBaseMethods[0].getElementName());
}
-
+
public void testMapping7FromMemento() throws JavaModelException
{
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
IMethodMapping[] callinMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLINS);
-
+
IMethodMapping mapping = callinMethodMappings[6];
assertNotNull(mapping);
-
+
String token = mapping.getHandleIdentifier();
-
+
SourceType sourceType = (SourceType)roleOTElem.getCorrespondingJavaElement();
IJavaElement fromMemento = JavaCore.create(token, sourceType.getCompilationUnit().getOwner());
-
+
assertEquals("Elements should be equal", mapping, fromMemento);
-
+
assertTrue("Element should exist", fromMemento.exists());
-
+
assertTrue("Mapping should have signature", ((IMethodMapping)fromMemento).hasSignature());
}
-
- public void testMapping8() throws JavaModelException
+
+ public void testMapping8() throws JavaModelException
{
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
IMethodMapping[] callinMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLINS);
-
+
IMethodMapping mapping = callinMethodMappings[7];
assertNotNull(mapping);
-
+
assertEquals("roleMethod6() <- baseMethod6() <T>", mapping.getElementName());
assertEquals(IOTJavaElement.CALLIN_MAPPING, mapping.getMappingKind());
assertTrue(mapping.getRoleMethod().getTypeParameters().length == 1);
assertEquals(mapping.getRoleMethodHandle().getTypeParameters()[0].getElementName(), "T");
assertEquals(mapping.getRoleMethodHandle().getTypeParameters()[0].getBounds()[0], "Object");
-
+
ICallinMapping callinMapping = (ICallinMapping) mapping;
IMethod[] boundBaseMethods = callinMapping.getBoundBaseMethods();
assertNotNull(boundBaseMethods);
@@ -419,129 +419,129 @@ public class CallinMappingTest extends FileBasedModelTest
assertEquals("baseMethod6", boundBaseMethods[0].getElementName());
assertTrue(callinMapping.hasCovariantReturn());
}
-
+
public void testMappingModifier1() throws JavaModelException
{
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
IMethodMapping[] callinMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLINS);
-
- ICallinMapping callinMapping = (ICallinMapping) callinMethodMappings[0];
+
+ ICallinMapping callinMapping = (ICallinMapping) callinMethodMappings[0];
assertEquals(ICallinMapping.KIND_AFTER, callinMapping.getCallinKind());
}
-
+
public void testMappingModifier2() throws JavaModelException
{
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
IMethodMapping[] callinMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLINS);
-
- ICallinMapping callinMapping = (ICallinMapping) callinMethodMappings[1];
+
+ ICallinMapping callinMapping = (ICallinMapping) callinMethodMappings[1];
assertEquals(ICallinMapping.KIND_BEFORE, callinMapping.getCallinKind());
}
-
+
public void testMappingModifier3() throws JavaModelException
{
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
IMethodMapping[] callinMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLINS);
-
- ICallinMapping callinMapping = (ICallinMapping) callinMethodMappings[2];
+
+ ICallinMapping callinMapping = (ICallinMapping) callinMethodMappings[2];
assertEquals(ICallinMapping.KIND_REPLACE, callinMapping.getCallinKind());
- }
-
+ }
+
public void testMappingModifier4() throws JavaModelException
{
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
IMethodMapping[] callinMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLINS);
-
- ICallinMapping callinMapping = (ICallinMapping) callinMethodMappings[3];
+
+ ICallinMapping callinMapping = (ICallinMapping) callinMethodMappings[3];
assertEquals(ICallinMapping.KIND_AFTER, callinMapping.getCallinKind());
}
-
+
public void testMappingModifier5() throws JavaModelException
{
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
IMethodMapping[] callinMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLINS);
-
- ICallinMapping callinMapping = (ICallinMapping) callinMethodMappings[4];
+
+ ICallinMapping callinMapping = (ICallinMapping) callinMethodMappings[4];
assertEquals(ICallinMapping.KIND_BEFORE, callinMapping.getCallinKind());
}
-
+
public void testMappingModifier6() throws JavaModelException
{
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
IMethodMapping[] callinMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLINS);
-
- ICallinMapping callinMapping = (ICallinMapping) callinMethodMappings[5];
+
+ ICallinMapping callinMapping = (ICallinMapping) callinMethodMappings[5];
assertEquals(ICallinMapping.KIND_REPLACE, callinMapping.getCallinKind());
}
-
+
public void testMappingModifier7() throws JavaModelException
{
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
IMethodMapping[] callinMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLINS);
-
- ICallinMapping callinMapping = (ICallinMapping) callinMethodMappings[6];
+
+ ICallinMapping callinMapping = (ICallinMapping) callinMethodMappings[6];
assertEquals(ICallinMapping.KIND_AFTER, callinMapping.getCallinKind());
}
-
+
public void testSource1() throws JavaModelException
{
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
IMethodMapping[] callinMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLINS);
-
+
ICallinMapping callinMapping = (ICallinMapping) callinMethodMappings[0];
-
+
assertEquals("roleMethod1 <- after baseMethod1;", callinMapping.getSource());
}
-
+
public void testSource2() throws JavaModelException
{
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
IMethodMapping[] callinMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLINS);
-
+
ICallinMapping callinMapping = (ICallinMapping) callinMethodMappings[1];
-
+
assertEquals("roleMethodA <- before baseMethod2;", callinMapping.getSource());
}
-
+
public void testSource3() throws JavaModelException
{
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
IMethodMapping[] callinMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLINS);
-
+
ICallinMapping callinMapping = (ICallinMapping) callinMethodMappings[2];
-
+
assertEquals("roleMethod2 <- replace baseMethodA;", callinMapping.getSource());
}
-
+
public void testSource4() throws JavaModelException
{
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
IMethodMapping[] callinMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLINS);
-
+
ICallinMapping callinMapping = (ICallinMapping) callinMethodMappings[3];
-
+
assertEquals("roleMethodB <- after baseMethodB;", callinMapping.getSource());
}
-
+
public void testSource5() throws JavaModelException
{
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
IMethodMapping[] callinMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLINS);
-
+
ICallinMapping callinMapping = (ICallinMapping) callinMethodMappings[4];
-
+
assertEquals("roleMethod3 <- before baseMethod3, baseMethod4, baseMethodC;", callinMapping.getSource());
}
@@ -550,20 +550,20 @@ public class CallinMappingTest extends FileBasedModelTest
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
IMethodMapping[] callinMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLINS);
-
+
ICallinMapping callinMapping = (ICallinMapping) callinMethodMappings[5];
-
+
assertEquals("roleMethod4 <- replace baseMethod4;", callinMapping.getSource());
}
-
+
public void testSource7() throws JavaModelException
{
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
IMethodMapping[] callinMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLINS);
-
+
ICallinMapping callinMapping = (ICallinMapping) callinMethodMappings[6];
-
+
assertEquals("void roleMethod5(int ir) <- after void baseMethod5(int ib) with { ir <- ib }", callinMapping.getSource());
}
-}
+}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/CalloutMappingTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/CalloutMappingTest.java
index d1000ef3a..57b001184 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/CalloutMappingTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/CalloutMappingTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -46,10 +46,10 @@ import org.eclipse.objectteams.otdt.core.OTModelManager;
*/
public class CalloutMappingTest extends FileBasedModelTest
{
-
+
private IType _teamJavaElem;
private IType _roleJavaElem;
-
+
public CalloutMappingTest(String name)
{
super(name);
@@ -61,23 +61,23 @@ public class CalloutMappingTest extends FileBasedModelTest
junit.framework.TestSuite suite = new Suite(CalloutMappingTest.class.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("CalloutMapping");
super.setUpSuite();
}
-
+
public void setUp() throws Exception
{
super.setUp();
-
+
try
{
ICompilationUnit teamUnit = getCompilationUnit(
- "CalloutMapping",
+ "CalloutMapping",
"src",
- "teampkg",
+ "teampkg",
"SampleTeam" + ".java");
_teamJavaElem = teamUnit.getType("SampleTeam");
@@ -89,14 +89,14 @@ public class CalloutMappingTest extends FileBasedModelTest
{
ex.printStackTrace();
}
- }
-
+ }
+
private IRoleType getRoleOTElem()
{
if ((_roleJavaElem != null) && (_roleJavaElem.exists()))
{
IOTType roleOTElem = OTModelManager.getOTElement(_roleJavaElem);
-
+
if ((roleOTElem != null) && (roleOTElem instanceof IRoleType))
{
return ((IRoleType) roleOTElem);
@@ -104,18 +104,18 @@ public class CalloutMappingTest extends FileBasedModelTest
}
return null;
}
-
+
public void testExistenceOfMappings() throws JavaModelException
{
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
-
+
IMethodMapping[] allMethodMappings = roleOTElem.getMethodMappings();
assertEquals(4, allMethodMappings.length);
-
+
IMethodMapping[] calloutMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLOUTS);
assertEquals(4, calloutMethodMappings.length);
-
+
IMethodMapping[] callinMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLINS);
assertEquals(0, callinMethodMappings.length);
}
@@ -125,19 +125,19 @@ public class CalloutMappingTest extends FileBasedModelTest
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
IMethodMapping[] calloutMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLOUTS);
-
+
IMethodMapping mapping = calloutMethodMappings[0];
assertNotNull(mapping);
-
+
String token = mapping.getHandleIdentifier();
-
+
SourceType sourceType = (SourceType)roleOTElem.getCorrespondingJavaElement();
IJavaElement fromMemento = JavaCore.create(token, sourceType.getCompilationUnit().getOwner());
-
+
assertEquals("Elements should be equal", mapping, fromMemento);
-
+
assertTrue("Element should exist", fromMemento.exists());
-
+
assertTrue("Mapping should have signature", ((IMethodMapping)fromMemento).hasSignature());
}
@@ -146,19 +146,19 @@ public class CalloutMappingTest extends FileBasedModelTest
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
IMethodMapping[] calloutMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLOUTS);
-
+
IMethodMapping mapping = calloutMethodMappings[1];
assertNotNull(mapping);
-
+
String token = mapping.getHandleIdentifier();
-
+
SourceType sourceType = (SourceType)roleOTElem.getCorrespondingJavaElement();
IJavaElement fromMemento = JavaCore.create(token, sourceType.getCompilationUnit().getOwner());
-
+
assertEquals("Elements should be equal", mapping, fromMemento);
-
+
assertTrue("Element should exist", fromMemento.exists());
-
+
assertFalse("Mapping should not have signature", ((IMethodMapping)fromMemento).hasSignature());
}
@@ -167,22 +167,22 @@ public class CalloutMappingTest extends FileBasedModelTest
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
IMethodMapping[] calloutMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLOUTS);
-
+
IMethodMapping mapping = calloutMethodMappings[2];
assertNotNull(mapping);
-
+
String token = mapping.getHandleIdentifier();
-
+
SourceType sourceType = (SourceType)roleOTElem.getCorrespondingJavaElement();
IJavaElement fromMemento = JavaCore.create(token, sourceType.getCompilationUnit().getOwner());
-
+
assertEquals("Elements should be equal", mapping, fromMemento);
-
+
assertTrue("Element should exist", fromMemento.exists());
-
+
ICalloutMapping mappingFromMemento = (ICalloutMapping)fromMemento;
assertTrue("Mapping should have signature", mappingFromMemento.hasSignature());
-
+
assertTrue("Expecting 1 role parameter", mappingFromMemento.getRoleMethodHandle().getArgumentTypes().length == 1);
assertTrue("Expecting 2 base parameters", mappingFromMemento.getBaseMethodHandle().getArgumentTypes().length == 2);
}
@@ -192,23 +192,23 @@ public class CalloutMappingTest extends FileBasedModelTest
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
IMethodMapping[] calloutMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLOUTS);
-
+
IMethodMapping mapping = calloutMethodMappings[3];
assertNotNull(mapping);
-
+
String token = mapping.getHandleIdentifier();
-
+
SourceType sourceType = (SourceType)roleOTElem.getCorrespondingJavaElement();
IJavaElement fromMemento = JavaCore.create(token, sourceType.getCompilationUnit().getOwner());
-
+
assertEquals("Elements should be equal", mapping, fromMemento);
-
+
assertTrue("Element should exist", fromMemento.exists());
-
+
assertTrue("Expecting callout to field", fromMemento instanceof ICalloutToFieldMapping);
ICalloutToFieldMapping mappingFromMemento = (ICalloutToFieldMapping)fromMemento;
assertTrue("Mapping should have signature", mappingFromMemento.hasSignature());
-
+
assertFalse("Expecting no setter", mappingFromMemento.getBaseFieldHandle().isSetter());
}
@@ -217,10 +217,10 @@ public class CalloutMappingTest extends FileBasedModelTest
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
IMethodMapping[] calloutMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLOUTS);
-
+
IMethodMapping mapping = calloutMethodMappings[3];
assertNotNull(mapping);
-
+
IAnnotation[] annotations = mapping.getAnnotations();
assertTrue("Annotations should not be null", annotations != null);
assertEquals("Wrong number of annotations", 1, annotations.length);
@@ -237,11 +237,11 @@ public class CalloutMappingTest extends FileBasedModelTest
IRoleType roleOTElem = getRoleOTElem();
assertNotNull(roleOTElem);
IMethodMapping[] calloutMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLOUTS);
-
+
IMethodMapping mapping = calloutMethodMappings[3];
assertNotNull(mapping);
-
- assertEquals("Wrong number of declared exceptions", 0, ((IMethod)mapping).getExceptionTypes().length); // and don't NPE
+
+ assertEquals("Wrong number of declared exceptions", 0, ((IMethod)mapping).getExceptionTypes().length); // and don't NPE
}
-}
+}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/DeclaredLiftingTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/DeclaredLiftingTest.java
index 6ae504ddf..3ab8543ca 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/DeclaredLiftingTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/DeclaredLiftingTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -31,28 +31,28 @@ import org.eclipse.objectteams.otdt.tests.StringBasedTest;
/**
* @author kaschja
*/
-//TODO (kaschja) create tests by the time declared lifting has been made visible to the OT-Model
+//TODO (kaschja) create tests by the time declared lifting has been made visible to the OT-Model
public class DeclaredLiftingTest extends StringBasedTest
{
public DeclaredLiftingTest()
{
super("Declared Lifting Tests");
}
-
+
public static Test suite()
{
return new Suite(DeclaredLiftingTest.class);
}
-
+
/**
- * a team class with
+ * a team class with
* a bound role class and
* a teamlevel-method with declared lifting
*/
protected void setUp() throws Exception
{
super.setUp();
-
+
createProjectFolder("basepkg");
createProjectFile(
"/basepkg/SampleBase.java",
@@ -72,65 +72,65 @@ public class DeclaredLiftingTest extends StringBasedTest
+ " public class SampleRole playedBy SampleBase{}\n"
+ "}\n");
}
-
+
public void test1() throws JavaModelException
- {
+ {
IType baseJavaElem = getTestProject().findType("basepkg.SampleBase");
-
+
IMethod[] baseMethods = baseJavaElem.getMethods();
assertTrue(baseMethods.length == 1);
-
+
IMethod method = baseMethods[0];
assertNotNull(method);
-
+
System.out.println("Base-Methode");
- System.out.println("number of parameters: " + method.getNumberOfParameters());
-
- System.out.println("parameter names:");
+ System.out.println("number of parameters: " + method.getNumberOfParameters());
+
+ System.out.println("parameter names:");
String[] paraNames = method.getParameterNames();
for (int idx = 0; idx < paraNames.length; idx++)
{
System.out.println(paraNames[idx]);
}
-
- System.out.println("parameter types:");
+
+ System.out.println("parameter types:");
String[] paraTypes = method.getParameterTypes();
for (int idx = 0; idx < paraTypes.length; idx++)
{
System.out.println(paraTypes[idx]);
}
-
+
System.out.println("signature: " + method.getSignature() + "\n");
-
+
//*********************************************
-
+
IType teamJavaElem = getTestProject().findType("teampkg.SampleTeam");
-
+
IMethod[] teamLevelMethods = teamJavaElem.getMethods();
assertTrue(teamLevelMethods.length == 1);
-
+
method = teamLevelMethods[0];
assertNotNull(method);
-
+
System.out.println("Teamlevel-Methode");
- System.out.println("number of parameters: " + method.getNumberOfParameters());
-
- System.out.println("parameter names:");
+ System.out.println("number of parameters: " + method.getNumberOfParameters());
+
+ System.out.println("parameter names:");
paraNames = method.getParameterNames();
for (int idx = 0; idx < paraNames.length; idx++)
{
System.out.println(paraNames[idx]);
}
-
- System.out.println("parameter types:");
+
+ System.out.println("parameter types:");
paraTypes = method.getParameterTypes();
for (int idx = 0; idx < paraTypes.length; idx++)
{
System.out.println(paraTypes[idx]);
}
-
+
System.out.println("signature: " + method.getSignature() + "\n");
-
+
System.out.println("toString: " + method.toString());
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/FileBasedModelTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/FileBasedModelTest.java
index 2d6e7fae3..d68005af2 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/FileBasedModelTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/FileBasedModelTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/JavaElementDeltaTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/JavaElementDeltaTests.java
index 472e13534..fb4146c20 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/JavaElementDeltaTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/JavaElementDeltaTests.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010 Stephan Herrmann
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -58,7 +58,7 @@ public void testAddOTJavaNature() throws CoreException {
addOTJavaNature("P");
assertDeltas(
"Unexpected delta",
- "P[*]: {CONTENT}\n" +
+ "P[*]: {CONTENT}\n" +
" ResourceDelta(/P/.project)[*]"
);
} finally {
@@ -77,7 +77,7 @@ public void testAddRoleToTeam() throws CoreException {
createJavaProject("P", new String[] {"src"}, "bin");
addOTJavaNature("P");
createFolder("P/src/p1");
- createFile("/P/src/p1/MyTeam.java",
+ createFile("/P/src/p1/MyTeam.java",
"package p1;\n" +
"public team class MyTeam {\n" +
" void foo() {}\n"+
@@ -128,7 +128,7 @@ public void testAddCallinToRole1() throws CoreException {
"public class Base {\n" +
" void bar() {}" +
"}\n");
- createFile("/P/src/p1/MyTeam.java",
+ createFile("/P/src/p1/MyTeam.java",
"package p1;\n" +
"public team class MyTeam {\n" +
" protected class Role {\n" +
@@ -184,7 +184,7 @@ public void testAddCallinToRole1r() throws CoreException {
"public class Base {\n" +
" void bar() {}" +
"}\n");
- createFile("/P/src/p1/MyTeam.java",
+ createFile("/P/src/p1/MyTeam.java",
"package p1;\n" +
"public team class MyTeam {\n" +
" protected class Role {\n" +
@@ -223,7 +223,7 @@ public void testAddCallinToRole1r() throws CoreException {
/*
* add a callin binding to a role class that already has another callin binding.
- * Witness for bogus add+remove deltas for unchanged callin binding.
+ * Witness for bogus add+remove deltas for unchanged callin binding.
*/
public void testAddCallinToRole2() throws CoreException {
ICompilationUnit copy = null;
@@ -237,7 +237,7 @@ public void testAddCallinToRole2() throws CoreException {
"public class Base {\n" +
" void bar() {}" +
"}\n");
- createFile("/P/src/p1/MyTeam.java",
+ createFile("/P/src/p1/MyTeam.java",
"package p1;\n" +
"public team class MyTeam {\n" +
" protected class Role {\n" +
@@ -297,14 +297,14 @@ public void testModifyCallin1() throws CoreException {
"public class Base {\n" +
" void bar() {}" +
"}\n");
- createFile("/P/src/p1/MyTeam.java",
+ createFile("/P/src/p1/MyTeam.java",
"package p1;\n" +
"public team class MyTeam {\n" +
" protected class Role {\n" +
" void foo() {}\n" +
" void foo2() {}\n" +
" foo <- after bar;\n" +
- " foo2 <- after bar;\n" +
+ " foo2 <- after bar;\n" +
" }\n"+
"}\n");
@@ -319,7 +319,7 @@ public void testModifyCallin1() throws CoreException {
" void foo() {}\n" +
" void foo2() {}\n" +
" foo <- before bar;\n" + // <= changed
- " foo2 <- after bar;\n" +
+ " foo2 <- after bar;\n" +
" }\n"+
"}\n");
@@ -358,14 +358,14 @@ public void testModifyCallin2() throws CoreException {
"public class Base {\n" +
" void bar() {}" +
"}\n");
- createFile("/P/src/p1/MyTeam.java",
+ createFile("/P/src/p1/MyTeam.java",
"package p1;\n" +
"public team class MyTeam {\n" +
" protected class Role {\n" +
" void foo() {}\n" +
" void foo2() {}\n" +
" foo <- after bar;\n" +
- " foo2 <- after bar;\n" +
+ " foo2 <- after bar;\n" +
" }\n"+
"}\n");
@@ -380,7 +380,7 @@ public void testModifyCallin2() throws CoreException {
" void foo() {}\n" +
" void foo2() {}\n" +
" this_one: foo <- after bar;\n" + // <= changed
- " foo2 <- after bar;\n" +
+ " foo2 <- after bar;\n" +
" }\n"+
"}\n");
@@ -419,14 +419,14 @@ public void testModifyCallout1() throws CoreException {
"public class Base {\n" +
" void bar() {}" +
"}\n");
- createFile("/P/src/p1/MyTeam.java",
+ createFile("/P/src/p1/MyTeam.java",
"package p1;\n" +
"public team class MyTeam {\n" +
" protected class Role {\n" +
" abstract void foo() {}\n" +
" void foo2() {}\n" +
" foo => bar;\n" +
- " foo2 <- after bar;\n" +
+ " foo2 <- after bar;\n" +
" }\n"+
"}\n");
@@ -441,7 +441,7 @@ public void testModifyCallout1() throws CoreException {
" abstract void foo() {}\n" +
" void foo2() {}\n" +
" foo -> bar;\n" + // <= changed
- " foo2 <- after bar;\n" +
+ " foo2 <- after bar;\n" +
" }\n"+
"}\n");
@@ -480,13 +480,13 @@ public void testModifyCallout2() throws CoreException {
"public class Base {\n" +
" void bar(int i) {}" +
"}\n");
- createFile("/P/src/p1/MyTeam.java",
+ createFile("/P/src/p1/MyTeam.java",
"package p1;\n" +
"public team class MyTeam {\n" +
" protected class Role {\n" +
" void foo2() {}\n" +
" void foo(int j) => void bar(int i);\n" +
- " foo2 <- after bar;\n" +
+ " foo2 <- after bar;\n" +
" }\n"+
"}\n");
@@ -500,7 +500,7 @@ public void testModifyCallout2() throws CoreException {
" protected class Role {\n" +
" void foo2() {}\n" +
" void foo(int k) => void bar(int i);\n" +
- " foo2 <- after bar;\n" +
+ " foo2 <- after bar;\n" +
" }\n"+
"}\n");
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/OTReconcilerTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/OTReconcilerTests.java
index 5a0eaaefb..3ca177a22 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/OTReconcilerTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/OTReconcilerTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2016 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -83,7 +83,7 @@ import junit.framework.Test;
/**
* Tests for errors shown only in the gutter (CompilationUnitProblemFinder),
* but not reported by the ImageBuilder.
- *
+ *
* @author stephan
* @since 1.2.1
*/
@@ -92,15 +92,15 @@ public class OTReconcilerTests extends ReconcilerTests {
public static Test suite() {
return buildModelTestSuite(OTReconcilerTests.class);
}
-
+
public OTReconcilerTests(String name) {
super(name);
}
-
+
static {
// TESTS_NAMES = new String[] { "testDecodeTeamAnchor" };
}
-// ===== Copied all our modifications from AbstractJavaModelTests =====
+// ===== Copied all our modifications from AbstractJavaModelTests =====
/*
* Returns the OS path to the external directory that contains external jar files.
* This path ends with a File.separatorChar.
@@ -125,7 +125,7 @@ public class OTReconcilerTests extends ReconcilerTests {
*/
protected String getPluginDirectoryPath() {
try {
-//{ObjectTeams: adjust plugin id from org.eclipse.jdt.core.tests.model to org.eclipse.objectteams.otdt.tests
+//{ObjectTeams: adjust plugin id from org.eclipse.jdt.core.tests.model to org.eclipse.objectteams.otdt.tests
URL platformURL = Platform.getBundle("org.eclipse.objectteams.otdt.tests").getEntry("/");
//carp}
return new File(FileLocator.toFileURL(platformURL).getFile()).getAbsolutePath();
@@ -141,7 +141,7 @@ public class OTReconcilerTests extends ReconcilerTests {
// SH}
}
//{ObjectTeams: copy jcl at least once per test run:
- private static boolean forceCopyJCL= true;
+ private static boolean forceCopyJCL= true;
// SH}
/**
* Check locally for the required JCL files, <jclName>.jar and <jclName>src.zip.
@@ -191,7 +191,7 @@ public class OTReconcilerTests extends ReconcilerTests {
// SH}
}
}
-
+
// ===== End COPY_AND_PASTE
// --- support OT libraries: ---
boolean addOTtoLibrary = false;
@@ -225,7 +225,7 @@ public class OTReconcilerTests extends ReconcilerTests {
return null;
}
// ---
-
+
protected IJavaProject createOTJavaProject(String projectName, String[] sourceFolders, String[] libraries, String output) throws CoreException {
return createOTJavaProject(projectName, sourceFolders, libraries, "1.5", output);
}
@@ -285,10 +285,10 @@ public class OTReconcilerTests extends ReconcilerTests {
char[] sourceChars = sourceFoo.toCharArray();
this.problemRequestor.initialize(sourceChars);
-
-
+
+
getCompilationUnit("/P/Foo.java").getWorkingCopy(this.wcOwner, null);
-
+
assertProblems(
"Unexpected problems",
"----------\n" +
@@ -298,7 +298,7 @@ public class OTReconcilerTests extends ReconcilerTests {
deleteProject("P");
}
}
-
+
// http://trac.objectteams.org/ot/ticket/143 (comment1)
public void testTrac143b() throws CoreException, InterruptedException {
try {
@@ -341,10 +341,10 @@ public class OTReconcilerTests extends ReconcilerTests {
char[] sourceChars = sourceSubFoo.toCharArray();
this.problemRequestor.initialize(sourceChars);
-
-
+
+
getCompilationUnit("/P/SubFoo.java").getWorkingCopy(this.wcOwner, null);
-
+
assertProblems(
"Unexpected problems",
"----------\n" +
@@ -354,7 +354,7 @@ public class OTReconcilerTests extends ReconcilerTests {
deleteProject("P");
}
}
-
+
// http://trac.objectteams.org/ot/ticket/248
public void testTrac248() throws CoreException, InterruptedException {
@@ -375,15 +375,15 @@ public class OTReconcilerTests extends ReconcilerTests {
"/P/src/FooTeam/R.java",
"team package FooTeam;\n" +
"protected class R {\n" +
- " private static int getI() {\n" +
- " return 3;\n" +
- " }\n" +
- " protected int test() {\n" +
- " return getI();\n" +
+ " private static int getI() {\n" +
+ " return 3;\n" +
+ " }\n" +
+ " protected int test() {\n" +
+ " return getI();\n" +
" }\n" +
"}\n");
-
- String sourceTeam =
+
+ String sourceTeam =
"public team class FooTeam {\n" +
" R r;\n" +
"}\n";
@@ -394,10 +394,10 @@ public class OTReconcilerTests extends ReconcilerTests {
char[] sourceChars = sourceTeam.toCharArray();
this.problemRequestor.initialize(sourceChars);
-
-
+
+
getCompilationUnit("/P/src/FooTeam.java").getWorkingCopy(this.wcOwner, null);
-
+
assertProblems(
"Unexpected problems",
"----------\n" +
@@ -406,7 +406,7 @@ public class OTReconcilerTests extends ReconcilerTests {
} finally {
deleteProject("P");
}
- }
+ }
// http://trac.objectteams.org/ot/ticket/259
public void testTrac259() throws CoreException, InterruptedException {
@@ -429,7 +429,7 @@ public class OTReconcilerTests extends ReconcilerTests {
"}\n"
);
this.createFolder("/P/Foo");
- this.createFile("/P/Foo/Role.java",
+ this.createFile("/P/Foo/Role.java",
"team package Foo;\n" +
"protected class Role playedBy MyBase {\n" +
" protected void doit() -> void secretDo();\n" +
@@ -446,10 +446,10 @@ public class OTReconcilerTests extends ReconcilerTests {
char[] sourceChars = sourceFoo.toCharArray();
this.problemRequestor.initialize(sourceChars);
-
-
+
+
getCompilationUnit("/P/Foo.java").getWorkingCopy(this.wcOwner, null);
-
+
assertProblems(
"Unexpected problems",
"----------\n" +
@@ -459,7 +459,7 @@ public class OTReconcilerTests extends ReconcilerTests {
deleteProject("P");
}
}
-
+
// previously a syntax error could cause an IllegalArgumentException, see r19238 ff.
public void testSyntaxError() throws CoreException, InterruptedException {
try {
@@ -503,10 +503,10 @@ public class OTReconcilerTests extends ReconcilerTests {
char[] sourceChars = sourceMain.toCharArray();
this.problemRequestor.initialize(sourceChars);
-
-
+
+
getCompilationUnit("/P/Main.java").getWorkingCopy(this.wcOwner, null);
-
+
assertProblems(
"Unexpected problems",
"----------\n" +
@@ -516,7 +516,7 @@ public class OTReconcilerTests extends ReconcilerTests {
deleteProject("P");
}
}
-
+
@SuppressWarnings("unchecked") // options in a raw map
public void testLocalInRoFi() throws CoreException, InterruptedException {
try {
@@ -539,15 +539,15 @@ public class OTReconcilerTests extends ReconcilerTests {
this.createFile(
"/P/Plain.java",
"public class Plain {\n" +
- " public Object getVal() {\n" +
- " return \"Plain\";\n" +
+ " public Object getVal() {\n" +
+ " return \"Plain\";\n" +
" }\n" +
"}\n"
);
String sourceTeam = "public team class Foo {\n" +
- " String foo, blub, bar, dings, wurgs, zork;\n" +
- " public static void main(String[] args) {\n" +
- " new Foo().new Role().test();\n" +
+ " String foo, blub, bar, dings, wurgs, zork;\n" +
+ " public static void main(String[] args) {\n" +
+ " new Foo().new Role().test();\n" +
" }\n" +
"}\n";
this.createFile(
@@ -555,7 +555,7 @@ public class OTReconcilerTests extends ReconcilerTests {
sourceTeam
);
this.createFolder("/P/Foo");
-
+
String sourceRole1= "team package Foo;\n" +
"public class Role1 {\n" +
" String s1, s2, s3, s4, s5, s6;\n" +
@@ -566,20 +566,20 @@ public class OTReconcilerTests extends ReconcilerTests {
String sourceRole2 = "team package Foo;\n" +
"public class Role2 extends Role1 {\n" +
- " protected void test() {\n" +
- " Plain isub = new Plain() {\n" +
- " public Object getVal() {\n" +
- " Object edits = super.getVal();\n" +
- " if (edits instanceof String) {\n" +
- " String string = (String)edits;\n" +
- " @SuppressWarnings(\"unused\")\n" +
- " int l = string.length();\n" +
- " }\n" +
- " return edits;\n" +
- " }\n" +
+ " protected void test() {\n" +
+ " Plain isub = new Plain() {\n" +
+ " public Object getVal() {\n" +
+ " Object edits = super.getVal();\n" +
+ " if (edits instanceof String) {\n" +
+ " String string = (String)edits;\n" +
+ " @SuppressWarnings(\"unused\")\n" +
+ " int l = string.length();\n" +
+ " }\n" +
+ " return edits;\n" +
+ " }\n" +
" };\n" +
- " @SuppressWarnings(\"unused\")\n" +
- " Object v = isub.getVal();\n" +
+ " @SuppressWarnings(\"unused\")\n" +
+ " Object v = isub.getVal();\n" +
" }\n" +
"}\n";
this.createFile(
@@ -589,13 +589,13 @@ public class OTReconcilerTests extends ReconcilerTests {
char[] sourceChars = sourceRole2.toCharArray();
this.problemRequestor.initialize(sourceChars);
-
-
+
+
ICompilationUnit wc = getCompilationUnit("/P/Foo/Role2.java").getWorkingCopy(this.wcOwner, null);
- wc.reconcile(AST.JLS12,
+ wc.reconcile(AST.JLS12,
ICompilationUnit.FORCE_PROBLEM_DETECTION|ICompilationUnit.ENABLE_STATEMENTS_RECOVERY|ICompilationUnit.ENABLE_BINDINGS_RECOVERY,
wc.getOwner(), null);
-
+
assertProblems(
"Unexpected problems",
"----------\n" +
@@ -607,7 +607,7 @@ public class OTReconcilerTests extends ReconcilerTests {
deleteProject("P");
}
}
-
+
@SuppressWarnings("unchecked") // options in a raw map
public void testRemoveRole() throws CoreException, InterruptedException, UnsupportedEncodingException {
@@ -633,18 +633,18 @@ public class OTReconcilerTests extends ReconcilerTests {
" public class Role1 {\n" +
" String s1, s2, s3, s4, s5, s6;\n" +
" }\n" +
- " String foo, blub, bar, dings, wurgs, zork;\n" +
- " public static void main(String[] args) {\n" +
- " new Foo().new Role1().test();\n" +
+ " String foo, blub, bar, dings, wurgs, zork;\n" +
+ " public static void main(String[] args) {\n" +
+ " new Foo().new Role1().test();\n" +
" }\n" +
"}\n";
this.createFile(
"/P/Foo.java",
sourceTeam
);
-
+
this.problemRequestor.initialize(sourceTeam.toCharArray());
-
+
ICompilationUnit wc = getCompilationUnit("/P/Foo.java").getWorkingCopy(this.wcOwner, null);
IType itype = wc.getType("Foo");
IOTType ottype = OTModelManager.getOTElement(itype);
@@ -652,18 +652,18 @@ public class OTReconcilerTests extends ReconcilerTests {
IOTType roleType = OTModelManager.getOTElement(rt); // this caches the role type
assertTrue ("Role should initially exist", rt.exists());
assertTrue ("RoleType should initially exist", roleType.exists());
-
+
// delete Role1
wc.applyTextEdit(new DeleteEdit(
- ("public team class Foo {\n").length(),
+ ("public team class Foo {\n").length(),
(" public class Role1 {\n" +
" String s1, s2, s3, s4, s5, s6;\n" +
- " }\n").length()),
+ " }\n").length()),
null);
wc.reconcile(AST.JLS12,
ICompilationUnit.FORCE_PROBLEM_DETECTION|ICompilationUnit.ENABLE_STATEMENTS_RECOVERY|ICompilationUnit.ENABLE_BINDINGS_RECOVERY,
wc.getOwner(), null);
-
+
// watch that
// ... the JavaElement no longer exists:
rt = itype.getType("Role1");
@@ -671,7 +671,7 @@ public class OTReconcilerTests extends ReconcilerTests {
// ... and OTModel no longer has a RoleType:
ottype = OTModelManager.getOTElement(itype);
rt = ottype.getRoleType("Role1");
- assertNull("Role should be null", rt);
+ assertNull("Role should be null", rt);
} finally {
deleteProject("P");
}
@@ -695,7 +695,7 @@ public class OTReconcilerTests extends ReconcilerTests {
" public class Role {}\n" +
"}\n"
);
-
+
String sourceFoo = "public team class Foo {\n" +
" protected team class Mid playedBy BaseTeam {\n" +
" public class Inner1 playedBy Role<@Mid.base> {}\n" +
@@ -711,16 +711,16 @@ public class OTReconcilerTests extends ReconcilerTests {
char[] sourceChars = sourceFoo.toCharArray();
this.problemRequestor.initialize(sourceChars);
-
+
ICompilationUnit fooWC = getCompilationUnit("/P/Foo.java").getWorkingCopy(this.wcOwner, null);
IType foo = fooWC.getType("Foo");
-
+
CompilerOptions compilerOptions = new CompilerOptions(p.getOptions(true));
ProblemReporter problemReporter = new ProblemReporter(
DefaultErrorHandlingPolicies.proceedWithAllProblems(),
compilerOptions,
new DefaultProblemFactory());
-
+
// force usage of type converter:
CompilationUnitDeclaration parsedUnit =
SourceTypeConverter.buildCompilationUnit(
@@ -728,10 +728,10 @@ public class OTReconcilerTests extends ReconcilerTests {
SourceTypeConverter.FIELD_AND_METHOD | SourceTypeConverter.MEMBER_TYPE,
problemReporter,
new CompilationResult("Foo.java".toCharArray(), 1, 1, 90));
-
+
// force resolving:
process(parsedUnit, p, compilerOptions, problemReporter, ITranslationStates.STATE_RESOLVED);
-
+
// evaluate result:
String result = "";
CategorizedProblem[] problems = parsedUnit.compilationResult().problems;
@@ -744,7 +744,7 @@ public class OTReconcilerTests extends ReconcilerTests {
deleteProject("P");
}
}
-
+
public void testAnchoredType02() throws CoreException, InterruptedException {
try {
// Resources creation
@@ -764,7 +764,7 @@ public class OTReconcilerTests extends ReconcilerTests {
" Role baseField;" +
"}\n"
);
-
+
String sourceFoo = "public team class Foo {\n" +
" protected team class Mid playedBy BaseTeam {\n" +
" public class Inner playedBy Role<@Mid.base> {}\n" +
@@ -781,16 +781,16 @@ public class OTReconcilerTests extends ReconcilerTests {
char[] sourceChars = sourceFoo.toCharArray();
this.problemRequestor.initialize(sourceChars);
-
+
ICompilationUnit fooWC = getCompilationUnit("/P/Foo.java").getWorkingCopy(this.wcOwner, null);
IType foo = fooWC.getType("Foo");
-
+
CompilerOptions compilerOptions = new CompilerOptions(p.getOptions(true));
ProblemReporter problemReporter = new ProblemReporter(
DefaultErrorHandlingPolicies.proceedWithAllProblems(),
compilerOptions,
new DefaultProblemFactory());
-
+
// force usage of type converter:
CompilationUnitDeclaration parsedUnit =
SourceTypeConverter.buildCompilationUnit(
@@ -798,10 +798,10 @@ public class OTReconcilerTests extends ReconcilerTests {
SourceTypeConverter.FIELD_AND_METHOD | SourceTypeConverter.MEMBER_TYPE,
problemReporter,
new CompilationResult("Foo.java".toCharArray(), 1, 1, 90));
-
+
// force resolving:
process(parsedUnit, p, compilerOptions, problemReporter, ITranslationStates.STATE_RESOLVED);
-
+
// evaluate result:
String result = "";
CategorizedProblem[] problems = parsedUnit.compilationResult().problems;
@@ -819,9 +819,9 @@ public class OTReconcilerTests extends ReconcilerTests {
public SourceTypeCompiler(INameEnvironment nameEnvironment,
IErrorHandlingPolicy policy,
CompilerOptions compilerOptions,
- IProblemFactory problemFactory)
+ IProblemFactory problemFactory)
{
- super(nameEnvironment, policy, compilerOptions,
+ super(nameEnvironment, policy, compilerOptions,
new ICompilerRequestor() { public void acceptResult(CompilationResult result) { } },
problemFactory);
}
@@ -835,15 +835,15 @@ public class OTReconcilerTests extends ReconcilerTests {
CompilationResult result =
new CompilationResult(sourceTypes[0].getFileName(), 1, 1, this.options.maxProblemsPerUnit);
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=305259, build the compilation unit in its own sand box.
final long savedComplianceLevel = this.options.complianceLevel;
final long savedSourceLevel = this.options.sourceLevel;
-
+
LookupEnvironment environment = packageBinding.environment;
if (environment == null)
environment = this.lookupEnvironment;
-
+
try {
IJavaProject project = ((SourceTypeElementInfo) sourceTypes[0]).getHandle().getJavaProject();
this.options.complianceLevel = CompilerOptions.versionToJdkLevel(project.getOption(JavaCore.COMPILER_COMPLIANCE, true));
@@ -882,17 +882,17 @@ public class OTReconcilerTests extends ReconcilerTests {
Parser parser = new Parser(problemReporter, false);
INameEnvironment nameEnvironment = new SearchableEnvironment((JavaProject)p, this.wcOwner, false);
Compiler compiler = new SourceTypeCompiler(
- nameEnvironment,
- DefaultErrorHandlingPolicies.proceedWithAllProblems(),
- compilerOptions,
+ nameEnvironment,
+ DefaultErrorHandlingPolicies.proceedWithAllProblems(),
+ compilerOptions,
problemReporter.problemFactory);
-
+
try (Config config = Dependencies.setup(this, parser, compiler.lookupEnvironment, true, false))
{
Dependencies.ensureState(parsedUnit, state);
}
}
-
+
public void testAnchoredType03() throws CoreException, InterruptedException {
try {
// Resources creation
@@ -926,7 +926,7 @@ public class OTReconcilerTests extends ReconcilerTests {
char[] sourceChars = sourceFoo.toCharArray();
this.problemRequestor.initialize(sourceChars);
-
+
this.createFile(
"/P/Main.java",
"public team class Main extends Foo {\n" +
@@ -937,9 +937,9 @@ public class OTReconcilerTests extends ReconcilerTests {
" }\n" +
"}\n"
);
-
+
getCompilationUnit("/P/Main.java").getWorkingCopy(this.wcOwner, null);
-
+
assertProblems(
"Unexpected problems",
"----------\n" +
@@ -949,7 +949,7 @@ public class OTReconcilerTests extends ReconcilerTests {
deleteProject("P");
}
}
-
+
// Bug 316658 - [reconciler] implicitly inherited field reports "illegal modifier"
public void testImplicitlyInheritedInitializedField1() throws CoreException {
try {
@@ -960,7 +960,7 @@ public class OTReconcilerTests extends ReconcilerTests {
//prjDesc.setNatureIds(OTDTPlugin.createProjectNatures(prjDesc));
prjDesc.setBuildSpec(OTDTPlugin.createProjectBuildCommands(prjDesc));
project.setDescription(prjDesc, null);
-
+
OTREContainer.initializeOTJProject(project);
this.createFile(
"/P/MyTeam.java",
@@ -969,7 +969,7 @@ public class OTReconcilerTests extends ReconcilerTests {
" final String val= new String(\"OK\");\n" +
" }\n" +
"}\n");
-
+
String sourceString = "public team class MySubTeam extends MyTeam {\n" +
" protected class R {\n" +
" protected R() { super(); }\n" +
@@ -990,9 +990,9 @@ public class OTReconcilerTests extends ReconcilerTests {
char[] sourceChars = sourceString.toCharArray();
this.problemRequestor.initialize(sourceChars);
-
+
getCompilationUnit("/P/MySubTeam.java").getWorkingCopy(this.wcOwner, null);
-
+
assertProblems(
"Unexpected problems",
"----------\n" +
@@ -1002,7 +1002,7 @@ public class OTReconcilerTests extends ReconcilerTests {
deleteProject("P");
}
}
-
+
// Bug 321352 - [compiler][reconciler] reporting of non-externalized string constants in role files
// should report as error
public void testNLSinRoFi1() throws CoreException {
@@ -1015,10 +1015,10 @@ public class OTReconcilerTests extends ReconcilerTests {
project.setDescription(prjDesc, null);
p.setOption(JavaCore.COMPILER_PB_NON_NLS_STRING_LITERAL, JavaCore.ERROR);
p.setOption(JavaCore.COMPILER_PB_UNUSED_LOCAL, JavaCore.IGNORE);
-
+
OTREContainer.initializeOTJProject(project);
this.createFolder("/P/MyTeam");
- String roleSourceString =
+ String roleSourceString =
"team package MyTeam;\n" +
"public class Role {\n" +
" void foo() {\n" +
@@ -1028,7 +1028,7 @@ public class OTReconcilerTests extends ReconcilerTests {
this.createFile(
"/P/MyTeam/Role.java",
roleSourceString);
-
+
String teamSourceString =
"public team class MyTeam {\n" +
" Role r;\n" +
@@ -1039,23 +1039,23 @@ public class OTReconcilerTests extends ReconcilerTests {
char[] roleSourceChars = roleSourceString.toCharArray();
this.problemRequestor.initialize(roleSourceChars);
-
+
getCompilationUnit("/P/MyTeam/Role.java").getWorkingCopy(this.wcOwner, null);
-
+
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. ERROR in /P/MyTeam/Role.java (at line 4)\n" +
- " String val= \"OK\";\n" +
- " ^^^^\n" +
- "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
+ "----------\n" +
+ "1. ERROR in /P/MyTeam/Role.java (at line 4)\n" +
+ " String val= \"OK\";\n" +
+ " ^^^^\n" +
+ "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
"----------\n");
} finally {
deleteProject("P");
}
}
-
+
// Bug 321352 - [compiler][reconciler] reporting of non-externalized string constants in role files
// using $NON-NLS-<n>$
public void testNLSinRoFi2() throws CoreException {
@@ -1068,10 +1068,10 @@ public class OTReconcilerTests extends ReconcilerTests {
project.setDescription(prjDesc, null);
p.setOption(JavaCore.COMPILER_PB_NON_NLS_STRING_LITERAL, JavaCore.ERROR);
p.setOption(JavaCore.COMPILER_PB_UNUSED_LOCAL, JavaCore.IGNORE);
-
+
OTREContainer.initializeOTJProject(project);
this.createFolder("/P/MyTeam");
- String roleSourceString =
+ String roleSourceString =
"team package MyTeam;\n" +
"public class Role {\n" +
" void foo() {\n" +
@@ -1081,7 +1081,7 @@ public class OTReconcilerTests extends ReconcilerTests {
this.createFile(
"/P/MyTeam/Role.java",
roleSourceString);
-
+
String teamSourceString =
"public team class MyTeam {\n" +
" Role r;\n" +
@@ -1092,9 +1092,9 @@ public class OTReconcilerTests extends ReconcilerTests {
char[] roleSourceChars = roleSourceString.toCharArray();
this.problemRequestor.initialize(roleSourceChars);
-
+
getCompilationUnit("/P/MyTeam/Role.java").getWorkingCopy(this.wcOwner, null);
-
+
assertProblems(
"Unexpected problems",
"----------\n" +
@@ -1104,7 +1104,7 @@ public class OTReconcilerTests extends ReconcilerTests {
deleteProject("P");
}
}
-
+
// a role file holds a nested team which extends a non-team role file
// Bug 324526 - [reconciler] NPE during AST creation, team in role file subclassing non-team role
public void testRoFiNestedTeam() throws CoreException {
@@ -1117,24 +1117,24 @@ public class OTReconcilerTests extends ReconcilerTests {
project.setDescription(prjDesc, null);
p.setOption(JavaCore.COMPILER_PB_NON_NLS_STRING_LITERAL, JavaCore.ERROR);
p.setOption(JavaCore.COMPILER_PB_UNUSED_LOCAL, JavaCore.IGNORE);
-
+
OTREContainer.initializeOTJProject(project);
this.createFolder("/P/MyTeam");
- String role1SourceString =
+ String role1SourceString =
"team package MyTeam;\n" +
"public class Role1 {\n" +
"}\n";
this.createFile(
"/P/MyTeam/Role1.java",
role1SourceString);
- String role2SourceString =
+ String role2SourceString =
"team package MyTeam;\n" +
"public team class Role2 extends Role1 {\n" +
"}\n";
this.createFile(
"/P/MyTeam/Role2.java",
role2SourceString);
-
+
String teamSourceString =
"public team class MyTeam {\n" +
" Role1 r;\n" +
@@ -1145,9 +1145,9 @@ public class OTReconcilerTests extends ReconcilerTests {
char[] role2SourceChars = role2SourceString.toCharArray();
this.problemRequestor.initialize(role2SourceChars);
-
+
getCompilationUnit("/P/MyTeam/Role2.java").getWorkingCopy(this.wcOwner, null);
-
+
assertProblems(
"Unexpected problems",
"----------\n" +
@@ -1169,7 +1169,7 @@ public class OTReconcilerTests extends ReconcilerTests {
project.setDescription(prjDesc, null);
p.setOption(JavaCore.COMPILER_PB_NON_NLS_STRING_LITERAL, JavaCore.ERROR);
p.setOption(JavaCore.COMPILER_PB_UNUSED_LOCAL, JavaCore.IGNORE);
-
+
OTREContainer.initializeOTJProject(project);
this.createFile(
"/P/JavaLinkedModeProposal.java",
@@ -1177,254 +1177,254 @@ public class OTReconcilerTests extends ReconcilerTests {
" String baseMethod() { return null; }\n" +
"}\n");
this.createFolder("/P/MyTeam");
- String role1SourceString =
+ String role1SourceString =
"team package MyTeam;\n" +
"public class Role1 {\n" +
"}\n";
this.createFile(
"/P/MyTeam/Role1.java",
role1SourceString);
- String role2SourceString =
-
- "team package MyTeam;\n" +
- "\n" +
- "import static org.eclipse.objectteams.otdt.ui.ImageConstants.CALLINBINDING_AFTER_IMG;\n" +
- "import static org.eclipse.objectteams.otdt.ui.ImageConstants.CALLINBINDING_BEFORE_IMG;\n" +
- "import static org.eclipse.objectteams.otdt.ui.ImageConstants.CALLINBINDING_REPLACE_IMG;\n" +
- "import static org.eclipse.objectteams.otdt.ui.ImageConstants.CALLOUTBINDING_IMG;\n" +
- "\n" +
- "import java.util.List;\n" +
- "\n" +
- "import org.eclipse.core.runtime.CoreException;\n" +
- "import org.eclipse.jdt.core.CompletionProposal;\n" +
- "import org.eclipse.jdt.core.ICompilationUnit;\n" +
- "import org.eclipse.jdt.core.IJavaProject;\n" +
- "import org.eclipse.jdt.core.JavaModelException;\n" +
- "import org.eclipse.jdt.core.dom.AST;\n" +
- "import org.eclipse.jdt.core.dom.ASTNode;\n" +
- "import org.eclipse.jdt.core.dom.AbstractMethodMappingDeclaration;\n" +
- "import org.eclipse.jdt.core.dom.ChildListPropertyDescriptor;\n" +
- "import org.eclipse.jdt.core.dom.IMethodBinding;\n" +
- "import org.eclipse.jdt.core.dom.ITypeBinding;\n" +
- "import org.eclipse.jdt.core.dom.MethodBindingOperator;\n" +
- "import org.eclipse.jdt.core.dom.MethodSpec;\n" +
- "import org.eclipse.jdt.core.dom.Modifier.ModifierKeyword;\n" +
- "import org.eclipse.jdt.core.dom.SingleVariableDeclaration;\n" +
- "import org.eclipse.jdt.core.dom.Type;\n" +
- "import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;\n" +
- "import org.eclipse.jdt.core.dom.rewrite.ITrackedNodePosition;\n" +
- "import org.eclipse.jdt.core.dom.rewrite.ImportRewrite;\n" +
- "import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings;\n" +
- "import org.eclipse.jdt.internal.corext.fix.LinkedProposalPositionGroup;\n" +
- "import org.eclipse.jdt.internal.corext.fix.LinkedProposalPositionGroup.Proposal;\n" +
- "import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;\n" +
- "import org.eclipse.jface.text.link.LinkedModeModel;\n" +
- "import org.eclipse.jface.text.link.LinkedPosition;\n" +
- "import org.eclipse.objectteams.otdt.internal.ui.util.Images;\n" +
- "import org.eclipse.objectteams.otdt.internal.ui.util.OTStubUtility;\n" +
- "import org.eclipse.swt.graphics.Image;\n" +
- "import org.eclipse.text.edits.DeleteEdit;\n" +
- "import org.eclipse.text.edits.MultiTextEdit;\n" +
- "import org.eclipse.text.edits.ReplaceEdit;\n" +
- "import org.eclipse.text.edits.TextEdit;\n" +
- "\n" +
- "/** \n" +
- " */ \n" +
- "@SuppressWarnings(\"restriction\")\n" +
- "protected team class CreateMethodMappingCompletionProposal extends MethodMappingCompletionProposal \n" +
- "{\n" +
- "\n" +
- " /* gateway to private final base class. */\n" +
- " @SuppressWarnings(\"decapsulation\")\n" +
- " protected class MyJavaLinkedModeProposal playedBy JavaLinkedModeProposal {\n" +
- "\n" +
- " public MyJavaLinkedModeProposal(ICompilationUnit unit, ITypeBinding typeProposal, int relevance) {\n" +
- " base(unit, typeProposal, relevance);\n" +
- " }\n" +
- " TextEdit computeEdits(int offset, LinkedPosition position, char trigger, int stateMask, LinkedModeModel model) \n" +
- " -> TextEdit computeEdits(int offset, LinkedPosition position, char trigger, int stateMask, LinkedModeModel model);\n" +
- " }\n" +
- "\n" +
- "\n" +
- "\n" +
- " boolean fIsOverride = false;\n" +
- " boolean fIsOnlyCallin = false; \n" +
- " \n" +
- " protected CreateMethodMappingCompletionProposal(IJavaProject jProject, \n" +
- " ICompilationUnit cu,\n" +
- " CompletionProposal proposal,\n" +
- " String[] paramTypes,\n" +
- " boolean isOverride,\n" +
- " boolean isOnlyCallin,\n" +
- " int length,\n" +
- " String displayName, \n" +
- " Image image)\n" +
- " {\n" +
- " super(jProject, cu, proposal, paramTypes, length, displayName, image);\n" +
- " this.fIsOverride= isOverride;\n" +
- " this.fIsOnlyCallin = isOnlyCallin;\n" +
- " }\n" +
- " protected CreateMethodMappingCompletionProposal(IJavaProject jProject, \n" +
- " ICompilationUnit cu, \n" +
- " CompletionProposal proposal,\n" +
- " int length,\n" +
- " String displayName,\n" +
- " Image image) \n" +
- " {\n" +
- " super(jProject, cu, proposal, length, displayName, image);\n" +
- " }\n" +
- " \n" +
- " /** Create a rewrite that additionally removes typed fragment if needed. \n" +
- " * That fragment will not be represented by an AST-node, that could be removed.\n" +
- " */\n" +
- " ASTRewrite createRewrite(AST ast) \n" +
- " {\n" +
- " if (fLength == 0)\n" +
- " return ASTRewrite.create(ast);\n" +
- " \n" +
- " // the typed prefix will have to be deleted:\n" +
- " final TextEdit delete= new DeleteEdit(fReplaceStart, fLength);\n" +
- " \n" +
- " // return a custom rewrite that additionally deletes typed fragment\n" +
- " return new ASTRewrite(ast) {\n" +
- " @Override\n" +
- " public TextEdit rewriteAST() \n" +
- " throws JavaModelException, IllegalArgumentException \n" +
- " {\n" +
- " TextEdit edits = super.rewriteAST();\n" +
- " if (edits instanceof MultiTextEdit) {\n" +
- " MultiTextEdit multi = (MultiTextEdit) edits;\n" +
- " multi.addChild(delete);\n" +
- " }\n" +
- " return edits;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " \n" +
- " /** Overridable, see CalloutToFieldCompletionProposal.\n" +
- " * At least baseBinding must be set, roleBinding is optional.\n" +
- " */\n" +
- " boolean setupRewrite(ICompilationUnit iCU, \n" +
- " ASTRewrite rewrite, \n" +
- " ImportRewrite importRewrite,\n" +
- " ITypeBinding roleBinding,\n" +
- " ITypeBinding baseBinding,\n" +
- " ASTNode type,\n" +
- " AbstractMethodMappingDeclaration partialMapping,\n" +
- " ChildListPropertyDescriptor bodyProperty) \n" +
- " throws CoreException\n" +
- " {\n" +
- " // find base method:\n" +
- " IMethodBinding method= findMethod(baseBinding, fMethodName, fParamTypes);\n" +
- " if (method == null)\n" +
- " return false;\n" +
- " \n" +
- " CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings(fJavaProject);\n" +
- " // create callout:\n" +
- " AbstractMethodMappingDeclaration stub= this.fIsOnlyCallin \n" +
- " ? OTStubUtility.createCallin(iCU, rewrite, importRewrite,\n" +
- " method, baseBinding.getName(), ModifierKeyword.BEFORE_KEYWORD, settings)\n" +
- " : OTStubUtility.createCallout(iCU, rewrite, importRewrite,\n" +
- " method, baseBinding.getName(), settings);\n" +
- " if (stub != null) {\n" +
- " insertStub(rewrite, type, bodyProperty, fReplaceStart, stub);\n" +
- " \n" +
- " MethodSpec roleMethodSpec = (MethodSpec)stub.getRoleMappingElement();\n" +
- " \n" +
- " // return type:\n" +
- " ITrackedNodePosition returnTypePosition = null;\n" +
- " ITypeBinding returnType = method.getReturnType();\n" +
- " if (!(returnType.isPrimitive() && \"void\".equals(returnType.getName()))) {\n" +
- " returnTypePosition = rewrite.track(roleMethodSpec.getReturnType2());\n" +
- " addLinkedPosition(returnTypePosition, true, ROLEMETHODRETURN_KEY);\n" +
- " LinkedProposalPositionGroup group1 = getLinkedProposalModel().getPositionGroup(ROLEMETHODRETURN_KEY, true);\n" +
- " group1.addProposal(new MyJavaLinkedModeProposal(iCU, method.getReturnType(), 13)); //$NON-NLS-1$\n" +
- " group1.addProposal(\"void\", null, 13); //$NON-NLS-1$\n" +
- " }\n" +
- " \n" +
- " // role method name:\n" +
- " addLinkedPosition(rewrite.track(roleMethodSpec.getName()), false, ROLEMETHODNAME_KEY);\n" +
- " \n" +
- " // argument lifting?\n" +
- " if (roleBinding != null)\n" +
- " addLiftingProposals(roleBinding, method, stub, rewrite);\n" +
- " \n" +
- " // binding operator:\n" +
- " addLinkedPosition(rewrite.track(stub.bindingOperator()), false, BINDINGKIND_KEY);\n" +
- " LinkedProposalPositionGroup group2= getLinkedProposalModel().getPositionGroup(BINDINGKIND_KEY, true);\n" +
- " if (!this.fIsOnlyCallin) {\n" +
- " String calloutToken = \"->\";\n" +
- " if (this.fIsOverride) {\n" +
- " calloutToken = \"=>\";\n" +
- " stub.bindingOperator().setBindingKind(MethodBindingOperator.KIND_CALLOUT_OVERRIDE);\n" +
- " }\n" +
- " group2.addProposal(calloutToken, Images.getImage(CALLOUTBINDING_IMG), 13); //$NON-NLS-1$\n" +
- " }\n" +
- " group2.addProposal(makeBeforeAfterBindingProposal(\"<- before\", Images.getImage(CALLINBINDING_BEFORE_IMG), returnTypePosition)); //$NON-NLS-1$\n" +
- " group2.addProposal(\"<- replace\", Images.getImage(CALLINBINDING_REPLACE_IMG), 13); //$NON-NLS-1$\n" +
- " group2.addProposal(makeBeforeAfterBindingProposal(\"<- after\", Images.getImage(CALLINBINDING_AFTER_IMG), returnTypePosition)); //$NON-NLS-1$\n" +
- " }\n" +
- " return true; \n" +
- " }\n" +
- " /** Create a method-binding proposal that, when applied, will change the role-returntype to \"void\": */\n" +
- " Proposal makeBeforeAfterBindingProposal(String displayString, Image image, final ITrackedNodePosition returnTypePosition) {\n" +
- " return new Proposal(displayString, image, 13) {\n" +
- " @Override\n" +
- " public TextEdit computeEdits(int offset, LinkedPosition position, char trigger, int stateMask, LinkedModeModel model)\n" +
- " throws CoreException \n" +
- " {\n" +
- " MultiTextEdit edits = new MultiTextEdit();\n" +
- " if (returnTypePosition != null)\n" +
- " edits.addChild(new ReplaceEdit(returnTypePosition.getStartPosition(), returnTypePosition.getLength(), \"void\"));\n" +
- " edits.addChild(super.computeEdits(offset, position, trigger, stateMask, model));\n" +
- " return edits;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " \n" +
- " /** Check if any parameters or the return type are candidates for lifting/lowering. */\n" +
- " @SuppressWarnings(\"rawtypes\")\n" +
- " private void addLiftingProposals(ITypeBinding roleTypeBinding, IMethodBinding methodBinding,\n" +
- " AbstractMethodMappingDeclaration stub, ASTRewrite rewrite) \n" +
- " {\n" +
- " ITypeBinding[] roles= roleTypeBinding.getDeclaringClass().getDeclaredTypes();\n" +
- " MethodSpec roleSpec= (MethodSpec)stub.getRoleMappingElement();\n" +
- " List params= roleSpec.parameters();\n" +
- " ITypeBinding[] paramTypes = methodBinding.getParameterTypes();\n" +
- " for (int i= 0; i<params.size(); i++)\n" +
- " addLiftingProposalGroup(rewrite, ROLEPARAM_KEY+i, roles, \n" +
- " ((SingleVariableDeclaration)params.get(i)).getType(), paramTypes[i]);\n" +
- " addLiftingProposalGroup(rewrite, ROLEPARAM_KEY+\"return\", roles, //$NON-NLS-1$\n" +
- " roleSpec.getReturnType2(), methodBinding.getReturnType());\n" +
- " }\n" +
- " /**\n" +
- " * check whether a given type is played by a role from a given array and create a proposal group containing base and role type. \n" +
- " * @param rewrite\n" +
- " * @param positionGroupID \n" +
- " * @param roles available roles in the enclosing team\n" +
- " * @param type AST node to investigate\n" +
- " * @param typeBinding type binding of AST node to investigate\n" +
- " */\n" +
- " void addLiftingProposalGroup(ASTRewrite rewrite, String positionGroupID, ITypeBinding[] roles, Type type, ITypeBinding typeBinding)\n" +
- " {\n" +
- " for (ITypeBinding roleBinding : roles) {\n" +
- " if (roleBinding.isSynthRoleIfc()) continue; // synth ifcs would otherwise cause dupes\n" +
- " if (typeBinding.equals(roleBinding.getBaseClass())) {\n" +
- " ITrackedNodePosition argTypePos= rewrite.track(type);\n" +
- " addLinkedPosition(argTypePos, true, positionGroupID);\n" +
- " LinkedProposalPositionGroup group=\n" +
- " getLinkedProposalModel().getPositionGroup(positionGroupID, true);\n" +
- " group.addProposal(type.toString(), null, 13);\n" +
- " group.addProposal(roleBinding.getName(), null, 13);\n" +
- " break;\n" +
- " }\n" +
- " } \n" +
- " }\n" +
+ String role2SourceString =
+
+ "team package MyTeam;\n" +
+ "\n" +
+ "import static org.eclipse.objectteams.otdt.ui.ImageConstants.CALLINBINDING_AFTER_IMG;\n" +
+ "import static org.eclipse.objectteams.otdt.ui.ImageConstants.CALLINBINDING_BEFORE_IMG;\n" +
+ "import static org.eclipse.objectteams.otdt.ui.ImageConstants.CALLINBINDING_REPLACE_IMG;\n" +
+ "import static org.eclipse.objectteams.otdt.ui.ImageConstants.CALLOUTBINDING_IMG;\n" +
+ "\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "import org.eclipse.core.runtime.CoreException;\n" +
+ "import org.eclipse.jdt.core.CompletionProposal;\n" +
+ "import org.eclipse.jdt.core.ICompilationUnit;\n" +
+ "import org.eclipse.jdt.core.IJavaProject;\n" +
+ "import org.eclipse.jdt.core.JavaModelException;\n" +
+ "import org.eclipse.jdt.core.dom.AST;\n" +
+ "import org.eclipse.jdt.core.dom.ASTNode;\n" +
+ "import org.eclipse.jdt.core.dom.AbstractMethodMappingDeclaration;\n" +
+ "import org.eclipse.jdt.core.dom.ChildListPropertyDescriptor;\n" +
+ "import org.eclipse.jdt.core.dom.IMethodBinding;\n" +
+ "import org.eclipse.jdt.core.dom.ITypeBinding;\n" +
+ "import org.eclipse.jdt.core.dom.MethodBindingOperator;\n" +
+ "import org.eclipse.jdt.core.dom.MethodSpec;\n" +
+ "import org.eclipse.jdt.core.dom.Modifier.ModifierKeyword;\n" +
+ "import org.eclipse.jdt.core.dom.SingleVariableDeclaration;\n" +
+ "import org.eclipse.jdt.core.dom.Type;\n" +
+ "import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;\n" +
+ "import org.eclipse.jdt.core.dom.rewrite.ITrackedNodePosition;\n" +
+ "import org.eclipse.jdt.core.dom.rewrite.ImportRewrite;\n" +
+ "import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings;\n" +
+ "import org.eclipse.jdt.internal.corext.fix.LinkedProposalPositionGroup;\n" +
+ "import org.eclipse.jdt.internal.corext.fix.LinkedProposalPositionGroup.Proposal;\n" +
+ "import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;\n" +
+ "import org.eclipse.jface.text.link.LinkedModeModel;\n" +
+ "import org.eclipse.jface.text.link.LinkedPosition;\n" +
+ "import org.eclipse.objectteams.otdt.internal.ui.util.Images;\n" +
+ "import org.eclipse.objectteams.otdt.internal.ui.util.OTStubUtility;\n" +
+ "import org.eclipse.swt.graphics.Image;\n" +
+ "import org.eclipse.text.edits.DeleteEdit;\n" +
+ "import org.eclipse.text.edits.MultiTextEdit;\n" +
+ "import org.eclipse.text.edits.ReplaceEdit;\n" +
+ "import org.eclipse.text.edits.TextEdit;\n" +
+ "\n" +
+ "/** \n" +
+ " */ \n" +
+ "@SuppressWarnings(\"restriction\")\n" +
+ "protected team class CreateMethodMappingCompletionProposal extends MethodMappingCompletionProposal \n" +
+ "{\n" +
+ "\n" +
+ " /* gateway to private final base class. */\n" +
+ " @SuppressWarnings(\"decapsulation\")\n" +
+ " protected class MyJavaLinkedModeProposal playedBy JavaLinkedModeProposal {\n" +
+ "\n" +
+ " public MyJavaLinkedModeProposal(ICompilationUnit unit, ITypeBinding typeProposal, int relevance) {\n" +
+ " base(unit, typeProposal, relevance);\n" +
+ " }\n" +
+ " TextEdit computeEdits(int offset, LinkedPosition position, char trigger, int stateMask, LinkedModeModel model) \n" +
+ " -> TextEdit computeEdits(int offset, LinkedPosition position, char trigger, int stateMask, LinkedModeModel model);\n" +
+ " }\n" +
+ "\n" +
+ "\n" +
+ "\n" +
+ " boolean fIsOverride = false;\n" +
+ " boolean fIsOnlyCallin = false; \n" +
+ " \n" +
+ " protected CreateMethodMappingCompletionProposal(IJavaProject jProject, \n" +
+ " ICompilationUnit cu,\n" +
+ " CompletionProposal proposal,\n" +
+ " String[] paramTypes,\n" +
+ " boolean isOverride,\n" +
+ " boolean isOnlyCallin,\n" +
+ " int length,\n" +
+ " String displayName, \n" +
+ " Image image)\n" +
+ " {\n" +
+ " super(jProject, cu, proposal, paramTypes, length, displayName, image);\n" +
+ " this.fIsOverride= isOverride;\n" +
+ " this.fIsOnlyCallin = isOnlyCallin;\n" +
+ " }\n" +
+ " protected CreateMethodMappingCompletionProposal(IJavaProject jProject, \n" +
+ " ICompilationUnit cu, \n" +
+ " CompletionProposal proposal,\n" +
+ " int length,\n" +
+ " String displayName,\n" +
+ " Image image) \n" +
+ " {\n" +
+ " super(jProject, cu, proposal, length, displayName, image);\n" +
+ " }\n" +
+ " \n" +
+ " /** Create a rewrite that additionally removes typed fragment if needed. \n" +
+ " * That fragment will not be represented by an AST-node, that could be removed.\n" +
+ " */\n" +
+ " ASTRewrite createRewrite(AST ast) \n" +
+ " {\n" +
+ " if (fLength == 0)\n" +
+ " return ASTRewrite.create(ast);\n" +
+ " \n" +
+ " // the typed prefix will have to be deleted:\n" +
+ " final TextEdit delete= new DeleteEdit(fReplaceStart, fLength);\n" +
+ " \n" +
+ " // return a custom rewrite that additionally deletes typed fragment\n" +
+ " return new ASTRewrite(ast) {\n" +
+ " @Override\n" +
+ " public TextEdit rewriteAST() \n" +
+ " throws JavaModelException, IllegalArgumentException \n" +
+ " {\n" +
+ " TextEdit edits = super.rewriteAST();\n" +
+ " if (edits instanceof MultiTextEdit) {\n" +
+ " MultiTextEdit multi = (MultiTextEdit) edits;\n" +
+ " multi.addChild(delete);\n" +
+ " }\n" +
+ " return edits;\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
+ " \n" +
+ " /** Overridable, see CalloutToFieldCompletionProposal.\n" +
+ " * At least baseBinding must be set, roleBinding is optional.\n" +
+ " */\n" +
+ " boolean setupRewrite(ICompilationUnit iCU, \n" +
+ " ASTRewrite rewrite, \n" +
+ " ImportRewrite importRewrite,\n" +
+ " ITypeBinding roleBinding,\n" +
+ " ITypeBinding baseBinding,\n" +
+ " ASTNode type,\n" +
+ " AbstractMethodMappingDeclaration partialMapping,\n" +
+ " ChildListPropertyDescriptor bodyProperty) \n" +
+ " throws CoreException\n" +
+ " {\n" +
+ " // find base method:\n" +
+ " IMethodBinding method= findMethod(baseBinding, fMethodName, fParamTypes);\n" +
+ " if (method == null)\n" +
+ " return false;\n" +
+ " \n" +
+ " CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings(fJavaProject);\n" +
+ " // create callout:\n" +
+ " AbstractMethodMappingDeclaration stub= this.fIsOnlyCallin \n" +
+ " ? OTStubUtility.createCallin(iCU, rewrite, importRewrite,\n" +
+ " method, baseBinding.getName(), ModifierKeyword.BEFORE_KEYWORD, settings)\n" +
+ " : OTStubUtility.createCallout(iCU, rewrite, importRewrite,\n" +
+ " method, baseBinding.getName(), settings);\n" +
+ " if (stub != null) {\n" +
+ " insertStub(rewrite, type, bodyProperty, fReplaceStart, stub);\n" +
+ " \n" +
+ " MethodSpec roleMethodSpec = (MethodSpec)stub.getRoleMappingElement();\n" +
+ " \n" +
+ " // return type:\n" +
+ " ITrackedNodePosition returnTypePosition = null;\n" +
+ " ITypeBinding returnType = method.getReturnType();\n" +
+ " if (!(returnType.isPrimitive() && \"void\".equals(returnType.getName()))) {\n" +
+ " returnTypePosition = rewrite.track(roleMethodSpec.getReturnType2());\n" +
+ " addLinkedPosition(returnTypePosition, true, ROLEMETHODRETURN_KEY);\n" +
+ " LinkedProposalPositionGroup group1 = getLinkedProposalModel().getPositionGroup(ROLEMETHODRETURN_KEY, true);\n" +
+ " group1.addProposal(new MyJavaLinkedModeProposal(iCU, method.getReturnType(), 13)); //$NON-NLS-1$\n" +
+ " group1.addProposal(\"void\", null, 13); //$NON-NLS-1$\n" +
+ " }\n" +
+ " \n" +
+ " // role method name:\n" +
+ " addLinkedPosition(rewrite.track(roleMethodSpec.getName()), false, ROLEMETHODNAME_KEY);\n" +
+ " \n" +
+ " // argument lifting?\n" +
+ " if (roleBinding != null)\n" +
+ " addLiftingProposals(roleBinding, method, stub, rewrite);\n" +
+ " \n" +
+ " // binding operator:\n" +
+ " addLinkedPosition(rewrite.track(stub.bindingOperator()), false, BINDINGKIND_KEY);\n" +
+ " LinkedProposalPositionGroup group2= getLinkedProposalModel().getPositionGroup(BINDINGKIND_KEY, true);\n" +
+ " if (!this.fIsOnlyCallin) {\n" +
+ " String calloutToken = \"->\";\n" +
+ " if (this.fIsOverride) {\n" +
+ " calloutToken = \"=>\";\n" +
+ " stub.bindingOperator().setBindingKind(MethodBindingOperator.KIND_CALLOUT_OVERRIDE);\n" +
+ " }\n" +
+ " group2.addProposal(calloutToken, Images.getImage(CALLOUTBINDING_IMG), 13); //$NON-NLS-1$\n" +
+ " }\n" +
+ " group2.addProposal(makeBeforeAfterBindingProposal(\"<- before\", Images.getImage(CALLINBINDING_BEFORE_IMG), returnTypePosition)); //$NON-NLS-1$\n" +
+ " group2.addProposal(\"<- replace\", Images.getImage(CALLINBINDING_REPLACE_IMG), 13); //$NON-NLS-1$\n" +
+ " group2.addProposal(makeBeforeAfterBindingProposal(\"<- after\", Images.getImage(CALLINBINDING_AFTER_IMG), returnTypePosition)); //$NON-NLS-1$\n" +
+ " }\n" +
+ " return true; \n" +
+ " }\n" +
+ " /** Create a method-binding proposal that, when applied, will change the role-returntype to \"void\": */\n" +
+ " Proposal makeBeforeAfterBindingProposal(String displayString, Image image, final ITrackedNodePosition returnTypePosition) {\n" +
+ " return new Proposal(displayString, image, 13) {\n" +
+ " @Override\n" +
+ " public TextEdit computeEdits(int offset, LinkedPosition position, char trigger, int stateMask, LinkedModeModel model)\n" +
+ " throws CoreException \n" +
+ " {\n" +
+ " MultiTextEdit edits = new MultiTextEdit();\n" +
+ " if (returnTypePosition != null)\n" +
+ " edits.addChild(new ReplaceEdit(returnTypePosition.getStartPosition(), returnTypePosition.getLength(), \"void\"));\n" +
+ " edits.addChild(super.computeEdits(offset, position, trigger, stateMask, model));\n" +
+ " return edits;\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
+ " \n" +
+ " /** Check if any parameters or the return type are candidates for lifting/lowering. */\n" +
+ " @SuppressWarnings(\"rawtypes\")\n" +
+ " private void addLiftingProposals(ITypeBinding roleTypeBinding, IMethodBinding methodBinding,\n" +
+ " AbstractMethodMappingDeclaration stub, ASTRewrite rewrite) \n" +
+ " {\n" +
+ " ITypeBinding[] roles= roleTypeBinding.getDeclaringClass().getDeclaredTypes();\n" +
+ " MethodSpec roleSpec= (MethodSpec)stub.getRoleMappingElement();\n" +
+ " List params= roleSpec.parameters();\n" +
+ " ITypeBinding[] paramTypes = methodBinding.getParameterTypes();\n" +
+ " for (int i= 0; i<params.size(); i++)\n" +
+ " addLiftingProposalGroup(rewrite, ROLEPARAM_KEY+i, roles, \n" +
+ " ((SingleVariableDeclaration)params.get(i)).getType(), paramTypes[i]);\n" +
+ " addLiftingProposalGroup(rewrite, ROLEPARAM_KEY+\"return\", roles, //$NON-NLS-1$\n" +
+ " roleSpec.getReturnType2(), methodBinding.getReturnType());\n" +
+ " }\n" +
+ " /**\n" +
+ " * check whether a given type is played by a role from a given array and create a proposal group containing base and role type. \n" +
+ " * @param rewrite\n" +
+ " * @param positionGroupID \n" +
+ " * @param roles available roles in the enclosing team\n" +
+ " * @param type AST node to investigate\n" +
+ " * @param typeBinding type binding of AST node to investigate\n" +
+ " */\n" +
+ " void addLiftingProposalGroup(ASTRewrite rewrite, String positionGroupID, ITypeBinding[] roles, Type type, ITypeBinding typeBinding)\n" +
+ " {\n" +
+ " for (ITypeBinding roleBinding : roles) {\n" +
+ " if (roleBinding.isSynthRoleIfc()) continue; // synth ifcs would otherwise cause dupes\n" +
+ " if (typeBinding.equals(roleBinding.getBaseClass())) {\n" +
+ " ITrackedNodePosition argTypePos= rewrite.track(type);\n" +
+ " addLinkedPosition(argTypePos, true, positionGroupID);\n" +
+ " LinkedProposalPositionGroup group=\n" +
+ " getLinkedProposalModel().getPositionGroup(positionGroupID, true);\n" +
+ " group.addProposal(type.toString(), null, 13);\n" +
+ " group.addProposal(roleBinding.getName(), null, 13);\n" +
+ " break;\n" +
+ " }\n" +
+ " } \n" +
+ " }\n" +
"}";
this.createFile(
"/P/MyTeam/CreateMethodMappingCompletionProposal.java",
role2SourceString);
-
+
String teamSourceString =
"public team class MyTeam {\n" +
" CreateMethodMappingCompletionProposal r;\n" +
@@ -1435,7 +1435,7 @@ public class OTReconcilerTests extends ReconcilerTests {
char[] role2SourceChars = role2SourceString.toCharArray();
this.problemRequestor.initialize(role2SourceChars);
-
+
ICompilationUnit cu = getCompilationUnit("/P/MyTeam/CreateMethodMappingCompletionProposal.java").getWorkingCopy(this.wcOwner, null);
// inject an error at 'random' location
cu.applyTextEdit(new InsertEdit(1000, "\t\t@"), null);
@@ -1450,7 +1450,7 @@ public class OTReconcilerTests extends ReconcilerTests {
}
}
-
+
// Bug 351520 - Undefined getClass() for role in seperate role file
public void testClassLiteralForRoFi() throws CoreException {
try {
@@ -1462,10 +1462,10 @@ public class OTReconcilerTests extends ReconcilerTests {
project.setDescription(prjDesc, null);
p.setOption(JavaCore.COMPILER_PB_NON_NLS_STRING_LITERAL, JavaCore.ERROR);
p.setOption(JavaCore.COMPILER_PB_UNUSED_LOCAL, JavaCore.IGNORE);
-
+
OTREContainer.initializeOTJProject(project);
this.createFolder("/P/MyTeam");
- String roleSourceString =
+ String roleSourceString =
"team package MyTeam;\n" +
"public class Role {\n" +
" void foo() {\n" +
@@ -1475,7 +1475,7 @@ public class OTReconcilerTests extends ReconcilerTests {
this.createFile(
"/P/MyTeam/Role.java",
roleSourceString);
-
+
String teamSourceString =
"public team class MyTeam {\n" +
" final MyTeam other = new MyTeam();\n" +
@@ -1487,16 +1487,16 @@ public class OTReconcilerTests extends ReconcilerTests {
char[] teamSourceChars = teamSourceString.toCharArray();
this.problemRequestor.initialize(teamSourceChars);
-
+
getCompilationUnit("/P/MyTeam.java").getWorkingCopy(this.wcOwner, null);
-
+
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. WARNING in /P/MyTeam.java (at line 3)\n" +
- " Class c = Role<@other>.class;\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in /P/MyTeam.java (at line 3)\n" +
+ " Class c = Role<@other>.class;\n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
"----------\n");
} finally {
@@ -1516,60 +1516,60 @@ public class OTReconcilerTests extends ReconcilerTests {
project.setDescription(prjDesc, null);
p.setOption(JavaCore.COMPILER_PB_NON_NLS_STRING_LITERAL, JavaCore.ERROR);
p.setOption(JavaCore.COMPILER_PB_UNUSED_LOCAL, JavaCore.IGNORE);
-
+
OTREContainer.initializeOTJProject(project);
- String baseSourceString =
+ String baseSourceString =
"public class Base {\n" +
"}\n";
this.createFile(
"/P/Base.java",
baseSourceString);
- String superTeamSourceString =
+ String superTeamSourceString =
"public team class SuperTeam {\n" +
- " protected class R0 playedBy Base {}\n" +
- " protected class R1 extends R0 {}\n" +
+ " protected class R0 playedBy Base {}\n" +
+ " protected class R1 extends R0 {}\n" +
" public void foo(Base as R0 bar) {}\n" +
"}\n";
this.createFile(
"/P/SuperTeam.java",
superTeamSourceString);
- String subTeamSourceString =
+ String subTeamSourceString =
"public team class SubTeam extends SuperTeam {\n" +
" protected class R2 extends R0 {}\n" +
"}\n";
this.createFile(
"/P/SubTeam.java",
subTeamSourceString);
-
+
char[] subTeamSourceChars = subTeamSourceString.toCharArray();
this.problemRequestor.initialize(subTeamSourceChars);
-
+
getCompilationUnit("/P/SubTeam.java").getWorkingCopy(this.wcOwner, null);
-
+
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. WARNING in /P/SubTeam.java (at line 1)\n" +
- " public team class SubTeam extends SuperTeam {\n" +
- " ^^^^^^^\n" +
- "Potential ambiguity in role binding. The base \'Base\' is bound to the following roles: SubTeam.R1,SubTeam.R2 (OTJLD 2.3.4(a)).\n" +
- "----------\n" +
- "2. ERROR in /P/SubTeam.java (at line 1)\n" +
- " public team class SubTeam extends SuperTeam {\n" +
- " ^^^^^^^\n" +
- "Team introduces binding ambiguity for role R1<@tthis[SubTeam]>, which may break clients of the super team (OTJLD 2.3.5(d)).\n" +
- "----------\n" +
- "3. ERROR in /P/SubTeam.java (at line 1)\n" +
- " public team class SubTeam extends SuperTeam {\n" +
- " ^^^^^^^\n" +
- "Team introduces binding ambiguity for role R0<@tthis[SubTeam]>, which may break clients of the super team (OTJLD 2.3.5(d)).\n" +
+ "----------\n" +
+ "1. WARNING in /P/SubTeam.java (at line 1)\n" +
+ " public team class SubTeam extends SuperTeam {\n" +
+ " ^^^^^^^\n" +
+ "Potential ambiguity in role binding. The base \'Base\' is bound to the following roles: SubTeam.R1,SubTeam.R2 (OTJLD 2.3.4(a)).\n" +
+ "----------\n" +
+ "2. ERROR in /P/SubTeam.java (at line 1)\n" +
+ " public team class SubTeam extends SuperTeam {\n" +
+ " ^^^^^^^\n" +
+ "Team introduces binding ambiguity for role R1<@tthis[SubTeam]>, which may break clients of the super team (OTJLD 2.3.5(d)).\n" +
+ "----------\n" +
+ "3. ERROR in /P/SubTeam.java (at line 1)\n" +
+ " public team class SubTeam extends SuperTeam {\n" +
+ " ^^^^^^^\n" +
+ "Team introduces binding ambiguity for role R0<@tthis[SubTeam]>, which may break clients of the super team (OTJLD 2.3.5(d)).\n" +
"----------\n");
} finally {
deleteProject("P");
}
}
-
+
public void testBug348574a() throws CoreException {
try {
// Resources creation
@@ -1579,60 +1579,60 @@ public class OTReconcilerTests extends ReconcilerTests {
prjDesc.setBuildSpec(OTDTPlugin.createProjectBuildCommands(prjDesc));
project.setDescription(prjDesc, null);
p.setOption(JavaCore.COMPILER_PB_UNUSED_LOCAL, JavaCore.IGNORE);
-
+
OTREContainer.initializeOTJProject(project);
- String superTeamSourceString =
+ String superTeamSourceString =
"public team class SuperTeam {\n" +
" protected abstract class R0 {\n" +
" abstract void foo();" +
" abstract static void fooStatic();" +
- " }\n" +
+ " }\n" +
"}\n";
this.createFile(
"/P/SuperTeam.java",
superTeamSourceString);
-
- String subTeamSourceString =
+
+ String subTeamSourceString =
"public team class SubTeam extends SuperTeam {\n" +
" protected class R0 {}\n" +
"}\n";
this.createFile(
"/P/SubTeam.java",
subTeamSourceString);
-
+
char[] subTeamSourceChars = subTeamSourceString.toCharArray();
this.problemRequestor.initialize(subTeamSourceChars);
-
+
getCompilationUnit("/P/SubTeam.java").getWorkingCopy(this.wcOwner, null);
-
+
assertProblems(
"Unexpected problems",
- "----------\n" +
- "1. ERROR in /P/SubTeam.java (at line 2)\n" +
- " protected class R0 {}\n" +
- " ^^\n" +
- "The abstract method foo in type R0 can only be defined by an abstract class\n" +
- "----------\n" +
- "2. ERROR in /P/SubTeam.java (at line 2)\n" +
- " protected class R0 {}\n" +
- " ^^\n" +
- "The type SubTeam.R0 must implement the inherited abstract method SubTeam.R0.foo()\n" +
- "----------\n" +
- "3. ERROR in /P/SubTeam.java (at line 2)\n" +
- " protected class R0 {}\n" +
- " ^^\n" +
- "The abstract method fooStatic in type R0 can only be defined by an abstract class\n" +
- "----------\n" +
- "4. ERROR in /P/SubTeam.java (at line 2)\n" +
- " protected class R0 {}\n" +
- " ^^\n" +
- "The type SubTeam.R0 must implement the inherited abstract method SubTeam.R0.fooStatic()\n" +
+ "----------\n" +
+ "1. ERROR in /P/SubTeam.java (at line 2)\n" +
+ " protected class R0 {}\n" +
+ " ^^\n" +
+ "The abstract method foo in type R0 can only be defined by an abstract class\n" +
+ "----------\n" +
+ "2. ERROR in /P/SubTeam.java (at line 2)\n" +
+ " protected class R0 {}\n" +
+ " ^^\n" +
+ "The type SubTeam.R0 must implement the inherited abstract method SubTeam.R0.foo()\n" +
+ "----------\n" +
+ "3. ERROR in /P/SubTeam.java (at line 2)\n" +
+ " protected class R0 {}\n" +
+ " ^^\n" +
+ "The abstract method fooStatic in type R0 can only be defined by an abstract class\n" +
+ "----------\n" +
+ "4. ERROR in /P/SubTeam.java (at line 2)\n" +
+ " protected class R0 {}\n" +
+ " ^^\n" +
+ "The type SubTeam.R0 must implement the inherited abstract method SubTeam.R0.fooStatic()\n" +
"----------\n");
} finally {
deleteProject("P");
- }
+ }
}
// Bug 382188 - NPE in copyRole() when commenting out roles in a nested
@@ -1645,12 +1645,12 @@ public class OTReconcilerTests extends ReconcilerTests {
prjDesc.setBuildSpec(OTDTPlugin.createProjectBuildCommands(prjDesc));
project.setDescription(prjDesc, null);
p.setOption(JavaCore.COMPILER_PB_UNUSED_LOCAL, JavaCore.IGNORE);
-
+
OTREContainer.initializeOTJProject(project);
this.createFolder("/P/p");
-
- String superTeamSourceString =
+
+ String superTeamSourceString =
"package p;\n" +
"public team class SuperTeam {\n" +
"}\n";
@@ -1658,7 +1658,7 @@ public class OTReconcilerTests extends ReconcilerTests {
"/P/p/SuperTeam.java",
superTeamSourceString);
- String superMidString =
+ String superMidString =
"team package p.SuperTeam;\n" +
"protected team class Mid {\n" +
" protected class Inner {}\n" +
@@ -1668,8 +1668,8 @@ public class OTReconcilerTests extends ReconcilerTests {
this.createFile(
"/P/p/SuperTeam/Mid.java",
superMidString);
-
- String subTeamSourceString =
+
+ String subTeamSourceString =
"package p;\n" +
"public team class SubTeam extends SuperTeam {\n" +
" protected class Mid2 {}\n" +
@@ -1677,26 +1677,26 @@ public class OTReconcilerTests extends ReconcilerTests {
this.createFile(
"/P/p/SubTeam.java",
subTeamSourceString);
-
+
this.createFolder(
"/P/p/SubTeam");
- String subMidCompleteSourceString =
+ String subMidCompleteSourceString =
"team package p/SubTeam;\n" +
"protected team class Mid {\n" +
" protected class Inner {}\n" +
"}\n";
this.createFile("/P/p/SubTeam/Mid.java", subMidCompleteSourceString);
-
+
project.build(IncrementalProjectBuilder.FULL_BUILD, null);
- String subMidSourceString =
+ String subMidSourceString =
"team package p.SubTeam;\n" +
"protected team class Mid {\n" +
"}\n";
char[] subMidSourceChars = subMidSourceString.toCharArray();
this.problemRequestor.initialize(subMidSourceChars);
-
+
ICompilationUnit icu = getCompilationUnit("/P/p/SubTeam/Mid.java").getWorkingCopy(this.wcOwner, null);
assertNoProblem(subMidSourceChars, icu);
} finally {
@@ -1714,45 +1714,45 @@ public class OTReconcilerTests extends ReconcilerTests {
prjDesc.setBuildSpec(OTDTPlugin.createProjectBuildCommands(prjDesc));
project.setDescription(prjDesc, null);
p.setOption(JavaCore.COMPILER_PB_UNUSED_LOCAL, JavaCore.IGNORE);
-
+
OTREContainer.initializeOTJProject(project);
- String allShapesSourceString =
- "public team class AllShapes {\n" +
- "\n" +
- " public abstract class Connector { }\n" +
- " public abstract class RectangularConnector extends Connector { }\n" +
+ String allShapesSourceString =
+ "public team class AllShapes {\n" +
+ "\n" +
+ " public abstract class Connector { }\n" +
+ " public abstract class RectangularConnector extends Connector { }\n" +
"}\n";
this.createFile(
"/P/AllShapes.java",
allShapesSourceString);
-
- String chdSourceString =
- "public team class CompanyHierarchyDisplay {\n" +
- " \n" +
- " public final AllShapes _shapes = new AllShapes();\n" +
- " \n" +
- " public class Connection {\n" +
- " Connector<@_shapes> connShape;\n" +
- " }\n" +
+
+ String chdSourceString =
+ "public team class CompanyHierarchyDisplay {\n" +
+ " \n" +
+ " public final AllShapes _shapes = new AllShapes();\n" +
+ " \n" +
+ " public class Connection {\n" +
+ " Connector<@_shapes> connShape;\n" +
+ " }\n" +
"}\n";
this.createFile(
"/P/CompanyHierarchyDisplay.java",
chdSourceString);
-
- String versionASourceString =
- "public team class VersionA {\n" +
- " private final CompanyHierarchyDisplay _chd;\n" +
- " \n" +
- " public VersionA(CompanyHierarchyDisplay chd) {\n" +
- " _chd = chd;\n" +
- " }\n" +
- " \n" +
- " public class RectangularConnections playedBy Connection<@_chd> {\n" +
+
+ String versionASourceString =
+ "public team class VersionA {\n" +
+ " private final CompanyHierarchyDisplay _chd;\n" +
+ " \n" +
+ " public VersionA(CompanyHierarchyDisplay chd) {\n" +
+ " _chd = chd;\n" +
+ " }\n" +
+ " \n" +
+ " public class RectangularConnections playedBy Connection<@_chd> {\n" +
" final AllShapes _shapesX = _chd._shapes;\n" +
- " @SuppressWarnings(\"decapsulation\")\n" +
- " void setShape(RectangularConnector<@_shapesX> shape) -> set Connector<@_chd._shapes> connShape;\n" +
- " }\n" +
+ " @SuppressWarnings(\"decapsulation\")\n" +
+ " void setShape(RectangularConnector<@_shapesX> shape) -> set Connector<@_chd._shapes> connShape;\n" +
+ " }\n" +
"}\n";
this.createFile(
"/P/VersionA.java",
@@ -1760,13 +1760,13 @@ public class OTReconcilerTests extends ReconcilerTests {
char[] versionASourceChars = versionASourceString.toCharArray();
this.problemRequestor.initialize(versionASourceChars);
-
+
ICompilationUnit unit = getCompilationUnit("/P/VersionA.java").getWorkingCopy(this.wcOwner, null);
-
+
assertNoProblem(versionASourceChars, unit);
} finally {
deleteProject("P");
- }
+ }
}
// Bug 406603 - [reconciler] fails to decode team anchor reference if name contains a 'D'
@@ -1780,9 +1780,9 @@ public class OTReconcilerTests extends ReconcilerTests {
project.setDescription(prjDesc, null);
p.setOption(JavaCore.COMPILER_PB_NON_NLS_STRING_LITERAL, JavaCore.ERROR);
p.setOption(JavaCore.COMPILER_PB_UNUSED_LOCAL, JavaCore.IGNORE);
-
+
OTREContainer.initializeOTJProject(project);
-
+
String teamSourceString =
"public team class DomainObject {\n" +
" public class Item{}\n" +
@@ -1791,21 +1791,21 @@ public class OTReconcilerTests extends ReconcilerTests {
this.createFile(
"/P/DomainObject.java",
teamSourceString);
-
+
this.createFile(
"/P/ItemService.java",
- "public class ItemService<DomainObject theDO> {\n" +
- " public void processItem(Item<@theDO> item) { }\n" +
+ "public class ItemService<DomainObject theDO> {\n" +
+ " public void processItem(Item<@theDO> item) { }\n" +
"}\n");
-
+
project.build(IncrementalProjectBuilder.FULL_BUILD, null);
- String clientSourceString =
+ String clientSourceString =
"public class Client {\n" +
" void foo(final DomainObject theDO) {\n" +
" ItemService<@theDO> service = new ItemService<@theDO>();" +
" Item<@theDO> myItem = new Item<@theDO>();\n" +
- " service.processItem(myItem);\n" +
+ " service.processItem(myItem);\n" +
" }\n" +
"}\n";
this.createFile(
@@ -1814,16 +1814,16 @@ public class OTReconcilerTests extends ReconcilerTests {
char[] clientSourceChars = clientSourceString.toCharArray();
this.problemRequestor.initialize(clientSourceChars);
-
+
ICompilationUnit unit = getCompilationUnit("/P/Client.java").getWorkingCopy(this.wcOwner, null);
-
+
assertNoProblem(clientSourceChars, unit);
} finally {
deleteProject("P");
}
}
-
+
// static role method accesses enclosing team instance
public void testStaticRoleMethod() throws CoreException, InterruptedException {
@@ -1835,11 +1835,11 @@ public class OTReconcilerTests extends ReconcilerTests {
prjDesc.setBuildSpec(OTDTPlugin.createProjectBuildCommands(prjDesc));
project.setDescription(prjDesc, null);
p.setOption(JavaCore.COMPILER_PB_UNUSED_LOCAL, JavaCore.IGNORE);
-
+
OTREContainer.initializeOTJProject(project);
this.createFolder("/P/src/p");
- String teamSourceString =
+ String teamSourceString =
"package p;\n" +
"public team class MyTeam {\n" +
" String val;" +
@@ -1848,17 +1848,17 @@ public class OTReconcilerTests extends ReconcilerTests {
project.build(IncrementalProjectBuilder.FULL_BUILD, null);
this.createFolder("/P/src/p/MyTeam");
- String roleSourceString =
+ String roleSourceString =
"team package p.MyTeam;\n" +
"protected class R {\n" +
" static String test() { /* missing return */ }\n" +
"}\n";
this.createFile("/P/src/p/MyTeam/R.java", roleSourceString);
project.build(IncrementalProjectBuilder.FULL_BUILD, null);
-
+
this.workingCopy = getCompilationUnit("/P/src/p/MyTeam/R.java").getWorkingCopy(this.wcOwner, null);
- roleSourceString =
+ roleSourceString =
"team package p.MyTeam;\n" +
"protected class R {\n" +
" static String test(boolean b) {\n" +
@@ -1887,36 +1887,36 @@ public class OTReconcilerTests extends ReconcilerTests {
prjDesc.setBuildSpec(OTDTPlugin.createProjectBuildCommands(prjDesc));
project.setDescription(prjDesc, null);
p.setOption(JavaCore.COMPILER_PB_UNUSED_LOCAL, JavaCore.IGNORE);
-
+
OTREContainer.initializeOTJProject(project);
-
+
this.createFolder("/P/src/org/objectteams");
- this.createFile("P/src/org/objectteams/Team.java",
+ this.createFile("P/src/org/objectteams/Team.java",
"package org.objectteams;\n" +
"public class Team implements ITeam {\n" +
- " public boolean _OT$setExecutingCallin(boolean newFlag) {\n" +
- " boolean oldVal = _OT$isExecutingCallin;\n" +
- " _OT$isExecutingCallin = newFlag;\n" +
- " return oldVal;\n" +
- " }\n" +
+ " public boolean _OT$setExecutingCallin(boolean newFlag) {\n" +
+ " boolean oldVal = _OT$isExecutingCallin;\n" +
+ " _OT$isExecutingCallin = newFlag;\n" +
+ " return oldVal;\n" +
+ " }\n" +
"}\n");
this.createFolder("/P/src/b");
- String b1SourceString =
+ String b1SourceString =
"package b;\n" +
"public class B1 {\n" +
" void bm1() {};\n" +
"}\n";
this.createFile("P/src/b/B1.java", b1SourceString);
- String b2SourceString =
+ String b2SourceString =
"package b;\n" +
"public class B2 {\n" +
" public void bm2() {};\n" +
"}\n";
this.createFile("P/src/b/B2.java", b2SourceString);
-
+
this.createFolder("/P/src/p");
- String team1SourceString =
+ String team1SourceString =
"package p;\n" +
"import base b.B1;\n" +
"public team class MyTeam1 {\n" +
@@ -1930,7 +1930,7 @@ public class OTReconcilerTests extends ReconcilerTests {
p.close();
p.open(null);
- String team2SourceString =
+ String team2SourceString =
"package p;\n" +
"import base b.B2;\n" +
"public team class MyTeam2 extends MyTeam1 {\n" +
@@ -1940,7 +1940,7 @@ public class OTReconcilerTests extends ReconcilerTests {
" }\n" +
"}\n";
this.createFile("/P/src/p/MyTeam2.java", team2SourceString);
-
+
this.problemRequestor.initialize(team2SourceString.toCharArray());
ICompilationUnit unit = getCompilationUnit("/P/src/p/MyTeam2.java").getWorkingCopy(this.wcOwner, null);
assertNoProblem((team2SourceString).toCharArray(), unit);
@@ -1965,7 +1965,7 @@ public class OTReconcilerTests extends ReconcilerTests {
project.build(IncrementalProjectBuilder.FULL_BUILD, null);
this.createFolder("/P/src/p2");
- String team2SourceString =
+ String team2SourceString =
"package p2;\n" +
"public team class MyTeam2 extends MyTeam1 {\n" +
" protected class R2 extends R1 {\n" +
@@ -1978,27 +1978,27 @@ public class OTReconcilerTests extends ReconcilerTests {
this.problemRequestor.initialize(team2SourceString.toCharArray());
getCompilationUnit("/P/src/p2/MyTeam2.java").getWorkingCopy(this.wcOwner, null);
- assertProblems("Expecting problems",
- "----------\n" +
- "1. ERROR in /P/src/p2/MyTeam2.java (at line 2)\n" +
- " public team class MyTeam2 extends MyTeam1 {\n" +
- " ^^^^^^^\n" +
- "MyTeam1 cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in /P/src/p2/MyTeam2.java (at line 3)\n" +
- " protected class R2 extends R1 {\n" +
- " ^^\n" +
- "The hierarchy of the type R2 is inconsistent\n" +
- "----------\n" +
- "3. ERROR in /P/src/p2/MyTeam2.java (at line 3)\n" +
- " protected class R2 extends R1 {\n" +
- " ^^\n" +
- "R1 cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in /P/src/p2/MyTeam2.java (at line 5)\n" +
- " return getFlag();\n" +
- " ^^^^^^^\n" +
- "The method getFlag() is undefined for the type MyTeam2.R2\n" +
+ assertProblems("Expecting problems",
+ "----------\n" +
+ "1. ERROR in /P/src/p2/MyTeam2.java (at line 2)\n" +
+ " public team class MyTeam2 extends MyTeam1 {\n" +
+ " ^^^^^^^\n" +
+ "MyTeam1 cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in /P/src/p2/MyTeam2.java (at line 3)\n" +
+ " protected class R2 extends R1 {\n" +
+ " ^^\n" +
+ "The hierarchy of the type R2 is inconsistent\n" +
+ "----------\n" +
+ "3. ERROR in /P/src/p2/MyTeam2.java (at line 3)\n" +
+ " protected class R2 extends R1 {\n" +
+ " ^^\n" +
+ "R1 cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in /P/src/p2/MyTeam2.java (at line 5)\n" +
+ " return getFlag();\n" +
+ " ^^^^^^^\n" +
+ "The method getFlag() is undefined for the type MyTeam2.R2\n" +
"----------\n",
this.problemRequestor);
@@ -2016,11 +2016,11 @@ public class OTReconcilerTests extends ReconcilerTests {
prjDesc.setBuildSpec(OTDTPlugin.createProjectBuildCommands(prjDesc));
project.setDescription(prjDesc, null);
p.setOption(JavaCore.COMPILER_PB_UNUSED_LOCAL, JavaCore.IGNORE);
-
+
OTREContainer.initializeOTJProject(project);
-
+
this.createFolder("/P/src/b");
- String b1SourceString =
+ String b1SourceString =
"package b;\n" +
"public class B1 {\n" +
" int f0;\n" +
@@ -2031,7 +2031,7 @@ public class OTReconcilerTests extends ReconcilerTests {
this.createFile("P/src/b/B1.java", b1SourceString);
this.createFolder("/P/src/p");
- String team1SourceString =
+ String team1SourceString =
"package p;\n" +
"import base b.B1;\n" +
"@SuppressWarnings(\"decapsulation\")\n" +
@@ -2053,7 +2053,7 @@ public class OTReconcilerTests extends ReconcilerTests {
p.open(null);
this.createFolder("/P/src/p2");
- String team2SourceString =
+ String team2SourceString =
"package p;\n" +
"import p.MyTeam1;\n" +
"public team class MyTeam2 extends MyTeam1 {\n" +
@@ -2086,26 +2086,26 @@ public class OTReconcilerTests extends ReconcilerTests {
"}\n";
String teamFilename = "/P/src/p/MyTeam2.java";
this.createFile(teamFilename, team2SourceString);
-
+
this.problemRequestor.initialize(team2SourceString.toCharArray());
getCompilationUnit(teamFilename).getWorkingCopy(this.wcOwner, null);
assertProblems("Expecting problems",
- "----------\n" +
- "1. ERROR in /P/src/p/MyTeam2.java (at line 20)\n" +
- " return getF1() +\n" +
- " ^^^^^\n" +
- "The method getF1() from the role type MyTeam2.R is not visible (OTJLD 1.2.1(e)).\n" +
- "----------\n" +
- "2. ERROR in /P/src/p/MyTeam2.java (at line 21)\n" +
- " getF2() +\n" +
- " ^^^^^\n" +
- "The method getF2() from the role type MyTeam2.R is not visible (OTJLD 1.2.1(e)).\n" +
- "----------\n" +
- "3. ERROR in /P/src/p/MyTeam2.java (at line 26)\n" +
- " m2() +\n" +
- " ^^\n" +
- "The method m2() from the role type MyTeam2.R is not visible (OTJLD 1.2.1(e)).\n" +
+ "----------\n" +
+ "1. ERROR in /P/src/p/MyTeam2.java (at line 20)\n" +
+ " return getF1() +\n" +
+ " ^^^^^\n" +
+ "The method getF1() from the role type MyTeam2.R is not visible (OTJLD 1.2.1(e)).\n" +
+ "----------\n" +
+ "2. ERROR in /P/src/p/MyTeam2.java (at line 21)\n" +
+ " getF2() +\n" +
+ " ^^^^^\n" +
+ "The method getF2() from the role type MyTeam2.R is not visible (OTJLD 1.2.1(e)).\n" +
+ "----------\n" +
+ "3. ERROR in /P/src/p/MyTeam2.java (at line 26)\n" +
+ " m2() +\n" +
+ " ^^\n" +
+ "The method m2() from the role type MyTeam2.R is not visible (OTJLD 1.2.1(e)).\n" +
"----------\n",
this.problemRequestor);
} finally {
@@ -2116,8 +2116,8 @@ public class OTReconcilerTests extends ReconcilerTests {
public void testTeamInJar1() throws CoreException, InterruptedException, IOException {
try {
// Resources creation
- IJavaProject p = createOTJavaProject("P", new String[] {"src"},
- new String[] {"JCL18_FULL"}, "1.8", "bin", true/*fullJCL*/,
+ IJavaProject p = createOTJavaProject("P", new String[] {"src"},
+ new String[] {"JCL18_FULL"}, "1.8", "bin", true/*fullJCL*/,
CompilerOptions.WeavingScheme.OTRE.toString());
IProject project = p.getProject();
IProjectDescription prjDesc = project.getDescription();
@@ -2137,7 +2137,7 @@ public class OTReconcilerTests extends ReconcilerTests {
}, "1.8");
this.createFolder("/P/src/p2");
- String subTeamSourceString =
+ String subTeamSourceString =
"package p2;\n" +
"public team class SubTeam extends p.MyTeam {\n" +
" @Override\n" +
@@ -2183,7 +2183,7 @@ public class OTReconcilerTests extends ReconcilerTests {
" void m(Object o, String[] vals) throws Exception {}\n" +
"}\n");
createFolder("/P/MyTeam");
- String roleSourceString =
+ String roleSourceString =
"team package MyTeam;\n" +
"public class Role playedBy MyBase {\n" +
" @SuppressWarnings(\"decapsulation\")\n" +
@@ -2196,7 +2196,7 @@ public class OTReconcilerTests extends ReconcilerTests {
createFile(
"/P/MyTeam/Role.java",
roleSourceString);
-
+
String teamSourceString =
"import base b.MyBase;\n" +
"public team class MyTeam {\n" +
@@ -2208,12 +2208,12 @@ public class OTReconcilerTests extends ReconcilerTests {
char[] roleSourceChars = roleSourceString.toCharArray();
this.problemRequestor.initialize(roleSourceChars);
-
+
getCompilationUnit("/P/MyTeam/Role.java").getWorkingCopy(this.wcOwner, null);
-
+
assertProblems(
"Unexpected problems",
- "----------\n" +
+ "----------\n" +
"----------\n");
} finally {
@@ -2241,8 +2241,8 @@ public class OTReconcilerTests extends ReconcilerTests {
" public void baseMethod(int flag, String name) {}\n" +
"}\n"
);
-
- String sourceFoo =
+
+ String sourceFoo =
"import base pbase.Base;\n" +
"public team class Foo {\n" +
" @SuppressWarnings(\"unused\") private String v1;\n" +
@@ -2269,16 +2269,16 @@ public class OTReconcilerTests extends ReconcilerTests {
char[] sourceChars = sourceFoo.toCharArray();
this.problemRequestor.initialize(sourceChars);
-
+
ICompilationUnit fooWC = getCompilationUnit("/P/src/Foo.java").getWorkingCopy(this.wcOwner, null);
IType foo = fooWC.getType("Foo");
-
+
CompilerOptions compilerOptions = new CompilerOptions(p.getOptions(true));
ProblemReporter problemReporter = new ProblemReporter(
DefaultErrorHandlingPolicies.proceedWithAllProblems(),
compilerOptions,
new DefaultProblemFactory());
-
+
// force usage of type converter:
CompilationUnitDeclaration parsedUnit =
SourceTypeConverter.buildCompilationUnit(
@@ -2286,10 +2286,10 @@ public class OTReconcilerTests extends ReconcilerTests {
SourceTypeConverter.FIELD_AND_METHOD | SourceTypeConverter.MEMBER_TYPE | SourceTypeConverter.LOCAL_TYPE,
problemReporter,
new CompilationResult("Foo.java".toCharArray(), 1, 1, 90));
-
+
// force resolving:
process(parsedUnit, p, compilerOptions, problemReporter, ITranslationStates.STATE_RESOLVED);
-
+
// evaluate result:
CategorizedProblem[] problems = parsedUnit.compilationResult().problems;
assertNull(problems);
@@ -2318,8 +2318,8 @@ public class OTReconcilerTests extends ReconcilerTests {
" public void baseMethod(int flag, String name) {}\n" +
"}\n"
);
-
- String sourceFoo =
+
+ String sourceFoo =
"import base pbase.Base;\n" +
"public team class Foo {\n" +
" @SuppressWarnings(\"unused\") private String v1;\n" +
@@ -2349,16 +2349,16 @@ public class OTReconcilerTests extends ReconcilerTests {
char[] sourceChars = sourceFoo.toCharArray();
this.problemRequestor.initialize(sourceChars);
-
+
ICompilationUnit fooWC = getCompilationUnit("/P/src/Foo.java").getWorkingCopy(this.wcOwner, null);
IType foo = fooWC.getType("Foo");
-
+
CompilerOptions compilerOptions = new CompilerOptions(p.getOptions(true));
ProblemReporter problemReporter = new ProblemReporter(
DefaultErrorHandlingPolicies.proceedWithAllProblems(),
compilerOptions,
new DefaultProblemFactory());
-
+
// force usage of type converter:
CompilationUnitDeclaration parsedUnit =
SourceTypeConverter.buildCompilationUnit(
@@ -2366,10 +2366,10 @@ public class OTReconcilerTests extends ReconcilerTests {
SourceTypeConverter.FIELD_AND_METHOD | SourceTypeConverter.MEMBER_TYPE | SourceTypeConverter.LOCAL_TYPE,
problemReporter,
new CompilationResult("Foo.java".toCharArray(), 1, 1, 90));
-
+
// force resolving:
process(parsedUnit, p, compilerOptions, problemReporter, ITranslationStates.STATE_RESOLVED);
-
+
// evaluate result:
CategorizedProblem[] problems = parsedUnit.compilationResult().problems;
assertNull(problems);
@@ -2400,8 +2400,8 @@ public class OTReconcilerTests extends ReconcilerTests {
" public String f;\n" +
"}\n"
);
-
- String sourceFoo =
+
+ String sourceFoo =
"import base pbase.Base;\n" +
"public team class Foo {\n" +
" @SuppressWarnings(\"unused\") private String v1;\n" +
@@ -2437,16 +2437,16 @@ public class OTReconcilerTests extends ReconcilerTests {
Indexer.getInstance().waitForIndex(null);
char[] sourceChars = sourceFoo.toCharArray();
this.problemRequestor.initialize(sourceChars);
-
+
ICompilationUnit fooWC = getCompilationUnit("/P/src/Foo.java").getWorkingCopy(this.wcOwner, null);
IType foo = fooWC.getType("Foo");
-
+
CompilerOptions compilerOptions = new CompilerOptions(p.getOptions(true));
ProblemReporter problemReporter = new ProblemReporter(
DefaultErrorHandlingPolicies.proceedWithAllProblems(),
compilerOptions,
new DefaultProblemFactory());
-
+
// force usage of type converter:
CompilationUnitDeclaration parsedUnit =
SourceTypeConverter.buildCompilationUnit(
@@ -2454,10 +2454,10 @@ public class OTReconcilerTests extends ReconcilerTests {
SourceTypeConverter.FIELD_AND_METHOD | SourceTypeConverter.MEMBER_TYPE | SourceTypeConverter.LOCAL_TYPE,
problemReporter,
new CompilationResult("Foo.java".toCharArray(), 1, 1, 90));
-
+
// force resolving:
process(parsedUnit, p, compilerOptions, problemReporter, ITranslationStates.STATE_RESOLVED);
-
+
// evaluate result:
CategorizedProblem[] problems = parsedUnit.compilationResult().problems;
assertNull(problems);
@@ -2491,8 +2491,8 @@ public class OTReconcilerTests extends ReconcilerTests {
StringBuilder attributes = new StringBuilder();
for (int i=0; i<110; i++)
attributes.append("@SuppressWarnings(\"unused\") private int i"+i+";\n");
-
- String sourceFoo =
+
+ String sourceFoo =
"public team class Foo extends Foo0 {\n" +
attributes.toString() +
" protected class R {\n" +
@@ -2522,7 +2522,7 @@ public class OTReconcilerTests extends ReconcilerTests {
"----------\n");
this.problemRequestor.initialize(sourceChars);
- fooWC.reconcile(AST.JLS12,
+ fooWC.reconcile(AST.JLS12,
ICompilationUnit.FORCE_PROBLEM_DETECTION|ICompilationUnit.ENABLE_STATEMENTS_RECOVERY|ICompilationUnit.ENABLE_BINDINGS_RECOVERY,
fooWC.getOwner(), null);
@@ -2539,31 +2539,31 @@ public class OTReconcilerTests extends ReconcilerTests {
private void createRuntimeStubs() throws CoreException {
createFolder("/P/org/objectteams");
createFile("/P/org/objectteams/ITeam.java",
- "package org.objectteams;\n" +
+ "package org.objectteams;\n" +
"public interface ITeam {\n" +
"}\n");
createFile("/P/org/objectteams/Team.java",
- "package org.objectteams;\n" +
+ "package org.objectteams;\n" +
"public class Team implements ITeam {\n" +
- " public Object _OT$callNext(IBoundBase2 baze, ITeam[] teams, int idx, int[] callinIds, int boundMethodId, Object[] args, Object[] baseCallArgs, int baseCallFlags)\n" +
+ " public Object _OT$callNext(IBoundBase2 baze, ITeam[] teams, int idx, int[] callinIds, int boundMethodId, Object[] args, Object[] baseCallArgs, int baseCallFlags)\n" +
" return null;\n" +
" }\n" +
"}\n");
createFile("/P/org/objectteams/ITeamMigratable.java",
- "package org.objectteams;\n" +
- "\n" +
- "public interface ITeamMigratable {\n" +
- " <R> R migrateToTeam(final ITeam otherTeam);\n" +
+ "package org.objectteams;\n" +
+ "\n" +
+ "public interface ITeamMigratable {\n" +
+ " <R> R migrateToTeam(final ITeam otherTeam);\n" +
"}"
);
createFile("/P/org/objectteams/IBaseMigratable.java",
- "package org.objectteams;\n" +
- "public interface IBaseMigratable {\n" +
- " <B> void migrateToBase(B otherBase);\n" +
- "}\n" +
+ "package org.objectteams;\n" +
+ "public interface IBaseMigratable {\n" +
+ " <B> void migrateToBase(B otherBase);\n" +
+ "}\n" +
"");
createFile("/P/org/objectteams/IBoundBase2.java",
- "package org.objectteams;\n" +
+ "package org.objectteams;\n" +
"public interface IBoundBase2 {}\n");
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/RetargetableFileBasedModelTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/RetargetableFileBasedModelTest.java
index 059a08546..49decc3af 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/RetargetableFileBasedModelTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/RetargetableFileBasedModelTest.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010 GK Software AG, Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/TestDataHandler.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/TestDataHandler.java
index 9e2c5f5e0..2c20f10c0 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/TestDataHandler.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/TestDataHandler.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -32,12 +32,12 @@ public class TestDataHandler
{
private static TestDataHandler _singleton;
private Map<String, TestSetting> _mapping = new HashMap<String, TestSetting>(); // test case::test setting
-
+
private TestDataHandler()
{
_singleton = this;
}
-
+
/**
* Assigns a <code>FileBasedTest</code>-test case to a specific <code>TestSetting</code>.
*/
@@ -48,12 +48,12 @@ public class TestDataHandler
getMapping().put(testCase.getName(), ts);
}
}
-
+
public static TestSetting getTestSetting(Class testClass)
{
return (TestSetting)getMapping().get(testClass.getName());
}
-
+
private static Map<String,TestSetting> getMapping()
{
if (_singleton == null)
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/TestSetting.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/TestSetting.java
index 763f1e9ca..ecac2deda 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/TestSetting.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/TestSetting.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -46,30 +46,30 @@ public class TestSetting extends FileBasedModelTest
private String _srcDir;
private String _teamPkg;
private String _teamClass;
-
+
private IType _teamJavaElem;
-
+
public TestSetting(String testPrj, String srcDir, String teamPkg)
{
super(createName(testPrj, srcDir, teamPkg));
-
+
_testProject = testPrj;
_srcDir = srcDir;
_teamPkg = teamPkg;
-
+
setUsePerformanceMeter(false);
}
-
+
public static String createName(String testPrj, String srcDir, String teamPkg)
{
StringBuffer buffer = new StringBuffer("TestSetting");
buffer.append("/").append(testPrj);
buffer.append("/").append(srcDir);
buffer.append("/").append(teamPkg);
-
+
return buffer.toString();
}
-
+
public void resetProjectDirectory(String directory) {
this._testProject = directory;
}
@@ -82,7 +82,7 @@ public class TestSetting extends FileBasedModelTest
ICompilationUnit teamUnit = getCompilationUnit(
_testProject,
_srcDir,
- _teamPkg,
+ _teamPkg,
_teamClass + ".java");
_teamJavaElem = teamUnit.getType(_teamClass);
@@ -92,12 +92,12 @@ public class TestSetting extends FileBasedModelTest
ex.printStackTrace();
}
}
-
- protected void tearDown() throws Exception
+
+ protected void tearDown() throws Exception
{
super.tearDown();
}
-
+
public IType getTeamJavaElement()
{
return _teamJavaElem;
@@ -107,26 +107,26 @@ public class TestSetting extends FileBasedModelTest
{
//TODO(jwl): Fix to parse the Team file for an external role!
_teamJavaElem.exists();
-
+
IOTType teamOTElem = OTModelManager.getOTElement(_teamJavaElem);
assertNotNull("The team type you're trying to test, seems not to exist for the OTModel!", teamOTElem);
-
+
return teamOTElem.getRoleType(getRoleName());
}
-
+
public IType[] getRoleJavaElements()
- {
+ {
if (_roleNames == null)
{
return new IType[] { getRoleJavaElement() };
}
-
+
//TODO(jwl): Fix to parse the Team file for an external role!
_teamJavaElem.exists();
-
+
IOTType teamOTElem = OTModelManager.getOTElement(_teamJavaElem);
assertNotNull("The team type you're trying to test, seems not to exist for the OTModel!", teamOTElem);
-
+
List<IType> roles = new LinkedList<IType>();
for (Iterator<String> roleIter = _roleNames.iterator(); roleIter.hasNext();)
{
@@ -138,20 +138,20 @@ public class TestSetting extends FileBasedModelTest
roles.add(role);
}
}
-
+
return roles.toArray(new IType[roles.size()]);
}
-
+
public String getTeamClass()
{
return _teamClass;
}
-
+
public String getRoleName()
{
return SAMPLE_ROLE_NAME;
- }
-
+ }
+
public String getTestProject()
{
return _testProject;
@@ -161,7 +161,7 @@ public class TestSetting extends FileBasedModelTest
{
_teamClass = teamName;
}
-
+
public void setRoleNames(String[] names)
{
_roleNames = new ArrayList<String>(names.length);
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/AllTests.java
index 477cbe076..6ae33d760 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/AllTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -32,7 +32,7 @@ import junit.framework.TestSuite;
*/
public class AllTests extends TestCase
{
- public AllTests(String name)
+ public AllTests(String name)
{
super(name);
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/AttributeAssignmentTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/AttributeAssignmentTest.java
index f9d839e5e..2770d3ee1 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/AttributeAssignmentTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/AttributeAssignmentTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -26,32 +26,32 @@ import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
/**
- *
+ *
* superclass for all testcases
* in which an instance of an anonymous class is assigned to an attribut
*/
public abstract class AttributeAssignmentTest extends GeneralTest
{
-
+
private final String ATTR_NAME = "rolelevelAttr";
-
+
public AttributeAssignmentTest(String name)
{
super(name);
}
-
+
protected IType getAnonymousType() throws JavaModelException
{
IType fieldOwner = _roleJavaElem;
-
+
if ((fieldOwner != null) && (fieldOwner.exists()))
{
IField enclosingField = fieldOwner.getField(ATTR_NAME);
-
+
if ((enclosingField != null) && (enclosingField.exists()))
{
IType anonymousType = enclosingField.getType("",1);
-
+
if ((anonymousType != null) && (anonymousType.exists()))
{
return anonymousType;
@@ -59,19 +59,19 @@ public abstract class AttributeAssignmentTest extends GeneralTest
}
}
return null;
- }
-
+ }
+
public void testExistenceOfAnonymousType() throws JavaModelException
{
assertNotNull(_roleJavaElem);
assertTrue(_roleJavaElem.exists());
-
+
IField rolelevelAttr = _roleJavaElem.getField(ATTR_NAME);
assertNotNull(rolelevelAttr);
assertTrue(rolelevelAttr.exists());
-
+
IType anonymousType = rolelevelAttr.getType("",1);
assertNotNull(anonymousType);
assertTrue(anonymousType.exists());
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/GeneralTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/GeneralTest.java
index 9b45132c3..52703ec63 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/GeneralTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/GeneralTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -27,35 +27,35 @@ import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
/**
- *
+ *
* superclass for all testcases
* in which an anonymous class is instantiated insight a role class
*/
public abstract class GeneralTest extends FileBasedModelTest
{
-
+
protected final String PROJECT = "AnonymousInnerclass";
protected final String SRC_FOLDER = "rolelevelinternal";
protected final String TEAM_PKG = "rolelevelinternal.teampkg";
-
+
protected IType _roleJavaElem = null;
-
-
+
+
public GeneralTest(String name)
{
super(name);
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir(PROJECT);
super.setUpSuite();
}
-
+
protected void setUp() throws Exception
{
super.setUp();
-
+
try
{
ICompilationUnit teamUnit = getCompilationUnit(
@@ -64,12 +64,12 @@ public abstract class GeneralTest extends FileBasedModelTest
TEAM_PKG,
getTeamName() +".java");
IType teamJavaElem = teamUnit.getType(getTeamName());
-
+
System.out.println(getClass().getName());
System.out.println("Teamklasse: \n" +teamJavaElem);
-
+
_roleJavaElem = teamJavaElem.getType(getRoleName());
-
+
System.out.println("Rollenklasse\n" +_roleJavaElem);
}
catch (JavaModelException ex)
@@ -77,8 +77,8 @@ public abstract class GeneralTest extends FileBasedModelTest
ex.printStackTrace();
}
}
-
+
protected abstract String getTeamName();
-
+
protected abstract String getRoleName();
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/LocalClassTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/LocalClassTest.java
index da2bee1ae..4c416d22e 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/LocalClassTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/LocalClassTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -26,48 +26,48 @@ import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
/**
- *
+ *
* superclass for all testcases
* in which the anonymous class is declared as a local class insight a method
*/
public abstract class LocalClassTest extends GeneralTest
-{
-
+{
+
private final String METHOD_NAME = "rolelevelMethod";
-
-
+
+
public LocalClassTest(String name)
{
super(name);
}
-
+
public void testExistenceOfAnonymousType() throws JavaModelException
{
assertNotNull(_roleJavaElem);
assertTrue(_roleJavaElem.exists());
-
+
IMethod rolelevelMethod = _roleJavaElem.getMethod(METHOD_NAME, new String[0]);
assertNotNull(rolelevelMethod);
assertTrue(rolelevelMethod.exists());
-
+
IType anonymousType = rolelevelMethod.getType("",1);
assertNotNull(anonymousType);
assertTrue(anonymousType.exists());
- }
-
-
+ }
+
+
protected IType getAnonymousType() throws JavaModelException
{
IType methodOwner = _roleJavaElem;
-
+
if ((methodOwner != null) && (methodOwner.exists()))
{
IMethod enclosingMethod = methodOwner.getMethod(METHOD_NAME, new String[0]);
-
+
if ((enclosingMethod != null) && (enclosingMethod.exists()))
{
IType anonymousType = enclosingMethod.getType("",1);
-
+
if ((anonymousType != null) && (anonymousType.exists()))
{
return anonymousType;
@@ -75,5 +75,5 @@ public abstract class LocalClassTest extends GeneralTest
}
}
return null;
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test1.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test1.java
index 5b04dabc2..9885dd6b4 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test1.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test1.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -28,7 +28,7 @@ import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
/**
- *
+ *
* testcase:
* a role class (defined insight the file of its team class) with an attribut
* attribut assignment with instantiation of an anonymous class
@@ -38,7 +38,7 @@ public class Test1 extends AttributeAssignmentTest
{
private final String ANONYMOUS_METHOD_NAME = "additionalMethod";
-
+
public static Test suite()
{
if (true)
@@ -48,30 +48,30 @@ public class Test1 extends AttributeAssignmentTest
junit.framework.TestSuite suite = new Suite(Test1.class
.getName());
return suite;
- }
-
+ }
+
public Test1(String name)
{
super(name);
- }
-
+ }
+
protected String getTeamName()
{
return "Test1_SampleTeam";
- }
-
+ }
+
protected String getRoleName()
{
return "SampleRole";
}
-
+
public void testContainmentOfMethodInAnonymousType() throws JavaModelException
{
IType anonymousType = getAnonymousType();
assertNotNull(anonymousType);
-
+
IMethod methodOfAnonymousType = anonymousType.getMethod(ANONYMOUS_METHOD_NAME, new String[0]);
assertNotNull(methodOfAnonymousType);
assertTrue(methodOfAnonymousType.exists());
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test2.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test2.java
index 2e7e3153e..6f4f82458 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test2.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test2.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -28,7 +28,7 @@ import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
/**
- *
+ *
* testcase:
* a role class (defined insight the file of its team class) with a method
* instantiation of an anonymous class inside the method
@@ -37,9 +37,9 @@ import org.eclipse.jdt.core.JavaModelException;
public class Test2 extends LocalClassTest
{
- private final String ANONYMOUS_METHOD_NAME = "additionalMethod";
-
-
+ private final String ANONYMOUS_METHOD_NAME = "additionalMethod";
+
+
public static Test suite()
{
if (true)
@@ -50,7 +50,7 @@ public class Test2 extends LocalClassTest
.getName());
return suite;
}
-
+
public Test2(String name)
{
super(name);
@@ -60,19 +60,19 @@ public class Test2 extends LocalClassTest
{
return "Test2_SampleTeam";
}
-
+
protected String getRoleName()
{
- return "SampleRole";
+ return "SampleRole";
}
-
+
public void testContainmentOfMethodInAnonymousType() throws JavaModelException
{
IType anonymousType = getAnonymousType();
assertNotNull(anonymousType);
-
+
IMethod method = anonymousType.getMethod(ANONYMOUS_METHOD_NAME, new String[0]);
assertNotNull(method);
assertTrue(method.exists());
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test3a.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test3a.java
index 34971fe40..d9915151f 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test3a.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test3a.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -35,23 +35,23 @@ import org.eclipse.objectteams.otdt.core.IRoleType;
import org.eclipse.objectteams.otdt.core.OTModelManager;
/**
- *
+ *
* testcase:
* a role class (defined insight the file of its team class) with an attribut
* attribut assignment with instantiation of an anonymous class
- * the anonymous class is a role class with an after-callin method mapping
+ * the anonymous class is a role class with an after-callin method mapping
*/
public class Test3a extends AttributeAssignmentTest
{
private final String ANONYMOUS_MAPPING_NAME = "roleMethod <- baseMethod";
- private final String SUPERROLE_NAME = "Role1";
+ private final String SUPERROLE_NAME = "Role1";
private final String MAPPED_ROLEMETHOD_NAME = "roleMethod";
private final String BASE_PKG = SRC_FOLDER + "." + "basepkg";
private final String BASE_NAME = "SampleBase";
private final String MAPPED_BASEMETHOD_NAME = "baseMethod";
-
-
+
+
public static Test suite()
{
if (true)
@@ -61,56 +61,56 @@ public class Test3a extends AttributeAssignmentTest
junit.framework.TestSuite suite = new Suite(Test3a.class
.getName());
return suite;
- }
+ }
public Test3a(String name)
{
super(name);
- }
-
+ }
+
protected String getTeamName()
{
return "Test3a_SampleTeam";
}
-
+
protected String getRoleName()
{
return "Role2";
}
-
+
public void testExistenceOfAnonymousTypeInOTModel() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
}
-
+
public void testRolePropertyOfAnonymousType() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
-
+
assertTrue(anonymousTypeOTElem.isRole());
assertTrue(anonymousTypeOTElem instanceof IRoleType);
}
-
+
public void testContainmentOfMethodMappingInAnonymousType() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
-
+
assertTrue(anonymousTypeOTElem instanceof IRoleType);
IRoleType role = (IRoleType) anonymousTypeOTElem;
assertNotNull(role);
-
+
IMethodMapping[] mappings = role.getMethodMappings();
assertNotNull(mappings);
assertTrue(mappings.length == 1);
@@ -121,20 +121,20 @@ public class Test3a extends AttributeAssignmentTest
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
-
+
assertTrue(anonymousTypeOTElem instanceof IRoleType);
IRoleType role = (IRoleType) anonymousTypeOTElem;
assertNotNull(role);
-
+
IMethodMapping[] mappings = role.getMethodMappings();
assertNotNull(mappings);
assertTrue(mappings.length == 1);
assertEquals(mappings[0].getElementName(), ANONYMOUS_MAPPING_NAME);
-
+
ICompilationUnit teamUnit = getCompilationUnit(
PROJECT,
SRC_FOLDER,
@@ -145,97 +145,97 @@ public class Test3a extends AttributeAssignmentTest
IType superRoleJavaElem = teamJavaElem.getType(SUPERROLE_NAME);
assertNotNull(superRoleJavaElem);
assertTrue(superRoleJavaElem.exists());
-
+
IMethod superRoleMethod = superRoleJavaElem.getMethod(MAPPED_ROLEMETHOD_NAME, new String[0]);
assertNotNull(superRoleMethod);
-
+
assertEquals(mappings[0].getRoleMethod(), superRoleMethod);
}
-
+
public void testCallinPropertyOfMethodMapping() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
-
+
assertTrue(anonymousTypeOTElem instanceof IRoleType);
IRoleType role = (IRoleType) anonymousTypeOTElem;
assertNotNull(role);
-
+
IMethodMapping[] mappings = role.getMethodMappings();
assertNotNull(mappings);
assertTrue(mappings.length == 1);
assertEquals(mappings[0].getElementName(), ANONYMOUS_MAPPING_NAME);
-
+
assertTrue(mappings[0].getMappingKind() == IOTJavaElement.CALLIN_MAPPING);
assertTrue(mappings[0] instanceof ICallinMapping);
}
-
+
public void testAfterPropertyOfCallinMethodMapping() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
-
+
assertTrue(anonymousTypeOTElem instanceof IRoleType);
IRoleType role = (IRoleType) anonymousTypeOTElem;
assertNotNull(role);
-
+
IMethodMapping[] mappings = role.getMethodMappings();
assertNotNull(mappings);
assertTrue(mappings.length == 1);
assertEquals(ANONYMOUS_MAPPING_NAME, mappings[0].getElementName());
-
+
assertTrue(mappings[0] instanceof ICallinMapping);
ICallinMapping callinMapping = (ICallinMapping) mappings[0];
assertNotNull(callinMapping);
-
+
assertTrue(callinMapping.getCallinKind() == ICallinMapping.KIND_AFTER);
}
-
+
public void testMappingPropertyBoundBaseMethod() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
-
+
assertTrue(anonymousTypeOTElem instanceof IRoleType);
IRoleType role = (IRoleType) anonymousTypeOTElem;
assertNotNull(role);
-
+
IMethodMapping[] mappings = role.getMethodMappings();
assertNotNull(mappings);
assertTrue(mappings.length == 1);
assertEquals(mappings[0].getElementName(), ANONYMOUS_MAPPING_NAME);
-
+
assertTrue(mappings[0] instanceof ICallinMapping);
ICallinMapping callinMapping = (ICallinMapping) mappings[0];
IMethod[] boundBaseMethods = callinMapping.getBoundBaseMethods();
assertNotNull(boundBaseMethods);
- assertTrue(boundBaseMethods.length == 1);
-
+ assertTrue(boundBaseMethods.length == 1);
+
//-------------------
-
+
ICompilationUnit baseUnit = getCompilationUnit(
PROJECT,
SRC_FOLDER,
BASE_PKG,
BASE_NAME +".java");
- IType baseJavaElem = baseUnit.getType(BASE_NAME);
+ IType baseJavaElem = baseUnit.getType(BASE_NAME);
assertNotNull(baseJavaElem);
assertTrue(baseJavaElem.exists());
-
+
IMethod baseMethod = baseJavaElem.getMethod(MAPPED_BASEMETHOD_NAME, new String[0]);
assertNotNull(baseMethod);
assertTrue(baseMethod.exists());
-
+
//-------------------
assertEquals(boundBaseMethods[0], baseMethod);
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test3b.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test3b.java
index 75479fa61..d97496b8f 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test3b.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test3b.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -35,17 +35,17 @@ import org.eclipse.objectteams.otdt.core.IRoleType;
import org.eclipse.objectteams.otdt.core.OTModelManager;
/**
- *
+ *
* testcase:
* a role class (defined insight the file of its team class) with an attribut
* attribut assignment with instantiation of an anonymous class
- * the anonymous class is a role class with a callout method mapping
+ * the anonymous class is a role class with a callout method mapping
*/
public class Test3b extends AttributeAssignmentTest
{
- private final String ANONYMOUS_MAPPING_NAME = "roleMethod() -> baseMethod()";
- private final String SUPERROLE_NAME = "Role1";
+ private final String ANONYMOUS_MAPPING_NAME = "roleMethod() -> baseMethod()";
+ private final String SUPERROLE_NAME = "Role1";
private final String MAPPED_ROLEMETHOD_NAME = "roleMethod";
private final String BASE_PKG = SRC_FOLDER + "." + "basepkg";
private final String BASE_NAME = "SampleBase";
@@ -60,56 +60,56 @@ public class Test3b extends AttributeAssignmentTest
junit.framework.TestSuite suite = new Suite(Test3b.class
.getName());
return suite;
- }
-
+ }
+
public Test3b(String name)
{
super(name);
}
-
+
protected String getTeamName()
{
- return "Test3b_SampleTeam";
+ return "Test3b_SampleTeam";
}
-
+
protected String getRoleName()
{
return "Role2";
}
-
+
public void testExistenceOfAnonymousTypeInOTModel() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
}
-
+
public void testRolePropertyOfAnonymousType() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
-
+
assertTrue(anonymousTypeOTElem.isRole());
assertTrue(anonymousTypeOTElem instanceof IRoleType);
}
-
+
public void testContainmentOfMethodMappingInAnonymousType() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
-
+
assertTrue(anonymousTypeOTElem instanceof IRoleType);
IRoleType role = (IRoleType) anonymousTypeOTElem;
assertNotNull(role);
-
+
IMethodMapping[] mappings = role.getMethodMappings();
assertNotNull(mappings);
assertTrue(mappings.length == 1);
@@ -121,20 +121,20 @@ public class Test3b extends AttributeAssignmentTest
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
-
+
assertTrue(anonymousTypeOTElem instanceof IRoleType);
IRoleType role = (IRoleType) anonymousTypeOTElem;
assertNotNull(role);
-
+
IMethodMapping[] mappings = role.getMethodMappings();
assertNotNull(mappings);
assertTrue(mappings.length == 1);
assertEquals(mappings[0].getElementName(), ANONYMOUS_MAPPING_NAME);
-
-
+
+
ICompilationUnit teamUnit = getCompilationUnit(
PROJECT,
SRC_FOLDER,
@@ -145,74 +145,74 @@ public class Test3b extends AttributeAssignmentTest
IType superRoleJavaElem = teamJavaElem.getType(SUPERROLE_NAME);
assertNotNull(superRoleJavaElem);
assertTrue(superRoleJavaElem.exists());
-
+
IMethod superRoleMethod = superRoleJavaElem.getMethod(MAPPED_ROLEMETHOD_NAME, new String[0]);
assertNotNull(superRoleMethod);
-
+
assertEquals(mappings[0].getRoleMethod(), superRoleMethod);
}
-
-
+
+
public void testCalloutPropertyOfMethodMapping() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
-
+
assertTrue(anonymousTypeOTElem instanceof IRoleType);
IRoleType role = (IRoleType) anonymousTypeOTElem;
assertNotNull(role);
-
+
IMethodMapping[] mappings = role.getMethodMappings();
assertNotNull(mappings);
assertTrue(mappings.length == 1);
assertEquals(mappings[0].getElementName(), ANONYMOUS_MAPPING_NAME);
-
+
assertTrue(mappings[0].getMappingKind() == IOTJavaElement.CALLOUT_MAPPING);
assertTrue(mappings[0] instanceof ICalloutMapping);
}
-
+
public void testMappingPropertyBoundBaseMethod() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
-
+
assertTrue(anonymousTypeOTElem instanceof IRoleType);
IRoleType role = (IRoleType) anonymousTypeOTElem;
assertNotNull(role);
-
+
IMethodMapping[] mappings = role.getMethodMappings();
assertNotNull(mappings);
assertTrue(mappings.length == 1);
assertEquals(mappings[0].getElementName(), ANONYMOUS_MAPPING_NAME);
-
+
assertTrue(mappings[0] instanceof ICalloutMapping);
ICalloutMapping calloutMapping = (ICalloutMapping) mappings[0];
IMethod boundBaseMethod = calloutMapping.getBoundBaseMethod();
assertNotNull(boundBaseMethod);
-
+
//-------------------
-
+
ICompilationUnit baseUnit = getCompilationUnit(
PROJECT,
SRC_FOLDER,
BASE_PKG,
BASE_NAME +".java");
- IType baseJavaElem = baseUnit.getType(BASE_NAME);
+ IType baseJavaElem = baseUnit.getType(BASE_NAME);
assertNotNull(baseJavaElem);
assertTrue(baseJavaElem.exists());
-
+
IMethod baseMethod = baseJavaElem.getMethod(MAPPED_BASEMETHOD_NAME, new String[0]);
assertNotNull(baseMethod);
assertTrue(baseMethod.exists());
-
+
//-------------------
assertEquals(boundBaseMethod, baseMethod);
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test4.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test4.java
index 42416381a..871502886 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test4.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test4.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -31,18 +31,18 @@ import org.eclipse.objectteams.otdt.core.IRoleType;
import org.eclipse.objectteams.otdt.core.OTModelManager;
/**
- *
+ *
* testcase:
* a role class (defined insight the file of its team class) with a method
* instantiation of an anonymous class inside the method
- * the anonymous class is a role class with a method mapping
+ * the anonymous class is a role class with a method mapping
*/
public class Test4 extends LocalClassTest
{
- private final String ANONYMOUS_MAPPING_NAME = "roleMethod() <- baseMethod()";
+ private final String ANONYMOUS_MAPPING_NAME = "roleMethod() <- baseMethod()";
+
-
public static Test suite()
{
if (true)
@@ -53,7 +53,7 @@ public class Test4 extends LocalClassTest
.getName());
return suite;
}
-
+
public Test4(String name)
{
super(name);
@@ -63,7 +63,7 @@ public class Test4 extends LocalClassTest
{
return "Test4_SampleTeam";
}
-
+
protected String getRoleName()
{
return "Role2";
@@ -73,38 +73,38 @@ public class Test4 extends LocalClassTest
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
}
-
+
public void testRolePropertyOfAnonymousType() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
-
+
assertTrue(anonymousTypeOTElem.isRole());
assertTrue(anonymousTypeOTElem instanceof IRoleType);
}
-
+
public void testContainmentOfMethodMappingInAnonymousType() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
-
+
assertTrue(anonymousTypeOTElem instanceof IRoleType);
IRoleType role = (IRoleType) anonymousTypeOTElem;
assertNotNull(role);
-
+
IMethodMapping[] mappings = role.getMethodMappings();
assertNotNull(mappings);
assertTrue(mappings.length == 1);
assertEquals(mappings[0].getElementName(), ANONYMOUS_MAPPING_NAME);
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test5.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test5.java
index ceb93a554..b55c008ef 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test5.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test5.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -29,7 +29,7 @@ import org.eclipse.objectteams.otdt.core.IOTType;
import org.eclipse.objectteams.otdt.core.OTModelManager;
/**
- *
+ *
* testcase:
* a role class (defined insight the file of its team class) with an attribut
* attribut assignment with instantiation of an anonymous class
@@ -40,7 +40,7 @@ public class Test5 extends AttributeAssignmentTest
private final String ANONYMOUS_INNERROLE_NAME = "RoleClass";
-
+
public static Test suite()
{
if (true)
@@ -51,7 +51,7 @@ public class Test5 extends AttributeAssignmentTest
.getName());
return suite;
}
-
+
public Test5(String name)
{
super(name);
@@ -61,47 +61,47 @@ public class Test5 extends AttributeAssignmentTest
{
return "Test5_TeamB";
}
-
+
protected String getRoleName()
{
return "SampleRole";
}
-
+
public void testExistenceOfAnonymousTypeInOTModel() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
}
-
+
public void testTeamPropertyOfAnonymousType() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
-
+
assertTrue(anonymousTypeOTElem.isTeam());
}
-
+
public void testContainmentOfRoleInAnonymousType() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
assertTrue(anonymousTypeOTElem.isTeam());
-
-//{OTModelUpdate
+
+//{OTModelUpdate
IOTType[] innerTypes = (IOTType[]) anonymousTypeOTElem.getInnerTypes();
-//haebor}
+//haebor}
assertNotNull(innerTypes);
assertTrue(innerTypes.length == 1);
assertTrue(innerTypes[0].isRole());
assertEquals(innerTypes[0].getElementName(), ANONYMOUS_INNERROLE_NAME);
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test6.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test6.java
index 864b12673..6244bed80 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test6.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test6.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -29,7 +29,7 @@ import org.eclipse.objectteams.otdt.core.IOTType;
import org.eclipse.objectteams.otdt.core.OTModelManager;
/**
- *
+ *
* testcase:
* a role class (defined insight the file of its team class) with a method
* instantiation of an anonymous class inside the method
@@ -39,7 +39,7 @@ public class Test6 extends LocalClassTest
{
private final String ANONYMOUS_INNERROLE_NAME = "RoleClass";
-
+
public static Test suite()
{
@@ -51,7 +51,7 @@ public class Test6 extends LocalClassTest
.getName());
return suite;
}
-
+
public Test6(String name)
{
super(name);
@@ -61,7 +61,7 @@ public class Test6 extends LocalClassTest
{
return "Test6_TeamB";
}
-
+
protected String getRoleName()
{
return "SampleRole";
@@ -71,37 +71,37 @@ public class Test6 extends LocalClassTest
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
}
-
+
public void testTeamPropertyOfAnonymousType() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
-
+
assertTrue(anonymousTypeOTElem.isTeam());
}
-
+
public void testContainmentOfRoleInAnonymousType() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
assertTrue(anonymousTypeOTElem.isTeam());
-
-//{OTModelUpdate
+
+//{OTModelUpdate
IOTType[] innerTypes = (IOTType[]) anonymousTypeOTElem.getInnerTypes();
//haebor}
assertNotNull(innerTypes);
assertTrue(innerTypes.length == 1);
assertTrue(innerTypes[0].isRole());
assertEquals(innerTypes[0].getElementName(), ANONYMOUS_INNERROLE_NAME);
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test7.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test7.java
index 41f48fd03..d1921f917 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test7.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test7.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -30,7 +30,7 @@ import org.eclipse.objectteams.otdt.core.IOTType;
import org.eclipse.objectteams.otdt.core.OTModelManager;
/**
- *
+ *
* testcase:
* a role class (defined insight the file of its team class) with an attribut
* attribut assignment with instantiation of an anonymous class
@@ -41,8 +41,8 @@ public class Test7 extends AttributeAssignmentTest
private String ANONYMOUS_METHOD_NAME = "method";
//semicolon at the end of the typestring is there on purpose
- private String ANONYMOUS_INPUTPARA_BASETYPE = "QSampleBase;";
-
+ private String ANONYMOUS_INPUTPARA_BASETYPE = "QSampleBase;";
+
public static Test suite()
{
if (true)
@@ -53,7 +53,7 @@ public class Test7 extends AttributeAssignmentTest
.getName());
return suite;
}
-
+
public Test7(String name)
{
super(name);
@@ -63,41 +63,41 @@ public class Test7 extends AttributeAssignmentTest
{
return "Test7_TeamB";
}
-
+
protected String getRoleName()
{
- return "SampleRole";
+ return "SampleRole";
}
-
+
public void testExistenceOfAnonymousTypeInOTModel() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
}
-
+
public void testTeamPropertyOfAnonymousType() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
-
+
assertTrue(anonymousTypeOTElem.isTeam());
}
-
+
public void testContainmentOfMethodInAnonymousType() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IMethod method = anonymousTypeJavaElem.getMethod(ANONYMOUS_METHOD_NAME, new String[]{ANONYMOUS_INPUTPARA_BASETYPE});
assertNotNull(method);
assertTrue(method.exists());
}
-
+
//TODO (kaschja) create test for declared lifting by the time declared lifting is integrated into the OT-model
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test8.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test8.java
index 0d30ecef1..82be013b8 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test8.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/rolelevel/internal/Test8.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -30,7 +30,7 @@ import org.eclipse.objectteams.otdt.core.IOTType;
import org.eclipse.objectteams.otdt.core.OTModelManager;
/**
- *
+ *
* testcase:
* a role class (defined insight the file of its team class) with a method
* instantiation of an anonymous class inside the method
@@ -41,8 +41,8 @@ public class Test8 extends LocalClassTest
private String ANONYMOUS_METHOD_NAME = "method";
//semicolon at the end of the typestring is there on purpose
- private String ANONYMOUS_INPUTPARA_BASETYPE = "QSampleBase;";
-
+ private String ANONYMOUS_INPUTPARA_BASETYPE = "QSampleBase;";
+
public static Test suite()
{
if (true)
@@ -52,13 +52,13 @@ public class Test8 extends LocalClassTest
junit.framework.TestSuite suite = new Suite(Test8.class
.getName());
return suite;
- }
-
+ }
+
public Test8(String name)
{
super(name);
}
-
+
protected String getTeamName()
{
return "Test8_TeamB";
@@ -69,37 +69,37 @@ public class Test8 extends LocalClassTest
return "SampleRole";
}
-
+
public void testExistenceOfAnonymousTypeInOTModel() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
}
-
+
public void testTeamPropertyOfAnonymousType() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
-
+
assertTrue(anonymousTypeOTElem.isTeam());
}
-
+
public void testContainmentOfMethodInAnonymousType() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IMethod method = anonymousTypeJavaElem.getMethod(ANONYMOUS_METHOD_NAME, new String[]{ANONYMOUS_INPUTPARA_BASETYPE});
assertNotNull(method);
assertTrue(method.exists());
}
-
- //TODO (kaschja) create test for declared lifting by the time declared lifting is integrated into the OT-model
+
+ //TODO (kaschja) create test for declared lifting by the time declared lifting is integrated into the OT-model
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/AllTests.java
index c889e217b..be233eacc 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/AllTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -32,7 +32,7 @@ import junit.framework.TestSuite;
*/
public class AllTests extends TestCase
{
- public AllTests(String name)
+ public AllTests(String name)
{
super(name);
}
@@ -49,7 +49,7 @@ public class AllTests extends TestCase
org.eclipse.objectteams.otdt.tests.otmodel.anonymousinnerclass.teamlevel.Test6.class,
org.eclipse.objectteams.otdt.tests.otmodel.anonymousinnerclass.teamlevel.Test7.class,
org.eclipse.objectteams.otdt.tests.otmodel.anonymousinnerclass.teamlevel.Test8.class
-
+
};
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test1.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test1.java
index d23f90cd8..6365338a0 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test1.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test1.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -31,7 +31,7 @@ import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
/**
- *
+ *
* testcase:
* a team class with an attribut
* attribut assignment with instantiation of an anonymous class
@@ -39,9 +39,9 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
*/
public class Test1 extends FileBasedModelTest
{
-
+
private IType _teamJavaElem = null;
-
+
public Test1(String name)
{
super(name);
@@ -57,17 +57,17 @@ public class Test1 extends FileBasedModelTest
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("AnonymousInnerclass");
super.setUpSuite();
}
-
+
protected void setUp() throws Exception
{
super.setUp();
-
+
try
{
ICompilationUnit teamUnit = getCompilationUnit(
@@ -76,7 +76,7 @@ public class Test1 extends FileBasedModelTest
"teamlevel.teampkg",
"Test1_SampleTeam.java");
_teamJavaElem = teamUnit.getType("Test1_SampleTeam");
-
+
System.out.println("\nAnonymousInnerclassTeamLevelTest1:");
System.out.println("Teamklasse: " +_teamJavaElem);
}
@@ -84,32 +84,32 @@ public class Test1 extends FileBasedModelTest
{
ex.printStackTrace();
}
- }
-
+ }
+
public void testExistenceOfAnonymousType() throws JavaModelException
{
assertNotNull(_teamJavaElem);
assertTrue(_teamJavaElem.exists());
-
+
IField teamlevelAttr = _teamJavaElem.getField("teamlevelAttr");
assertNotNull(teamlevelAttr);
assertTrue(teamlevelAttr.exists());
-
+
IType anonymousType = teamlevelAttr.getType("",1);
assertNotNull(anonymousType);
assertTrue(anonymousType.exists());
}
-
+
private IType getAnonymousType() throws JavaModelException
{
if ((_teamJavaElem != null) && (_teamJavaElem.exists()))
{
IField teamlevelAttr = _teamJavaElem.getField("teamlevelAttr");
-
+
if ((teamlevelAttr != null) && (teamlevelAttr.exists()))
{
IType anonymousType = teamlevelAttr.getType("",1);
-
+
if ((anonymousType != null) && (anonymousType.exists()))
{
return anonymousType;
@@ -117,15 +117,15 @@ public class Test1 extends FileBasedModelTest
}
}
return null;
- }
-
+ }
+
public void testContainmentOfMethodInAnonymousType() throws JavaModelException
{
IType anonymousType = getAnonymousType();
assertNotNull(anonymousType);
-
+
IMethod methodOfAnonymousType = anonymousType.getMethod("additionalMethod", new String[0]);
assertNotNull(methodOfAnonymousType);
assertTrue(methodOfAnonymousType.exists());
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test2.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test2.java
index d947edbd0..c4fc66e30 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test2.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test2.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -39,7 +39,7 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
public class Test2 extends FileBasedModelTest
{
private IType _teamJavaElem = null;
-
+
public Test2(String name)
{
super(name);
@@ -55,13 +55,13 @@ public class Test2 extends FileBasedModelTest
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("AnonymousInnerclass");
super.setUpSuite();
}
-
+
protected void setUp() throws Exception
{
super.setUp();
@@ -73,7 +73,7 @@ public class Test2 extends FileBasedModelTest
"teamlevel.teampkg",
"Test2_SampleTeam.java");
_teamJavaElem = teamUnit.getType("Test2_SampleTeam");
-
+
System.out.println("\nAnonymousInnerclassTeamLevelTest2:");
System.out.println("Teamklasse: " +_teamJavaElem);
}
@@ -81,33 +81,33 @@ public class Test2 extends FileBasedModelTest
{
ex.printStackTrace();
}
- }
-
+ }
+
public void testExistenceOfAnonymousType() throws JavaModelException
{
assertNotNull(_teamJavaElem);
assertTrue(_teamJavaElem.exists());
-
+
IMethod teamlevelMethod = _teamJavaElem.getMethod("teamlevelMethod", new String[0]);
assertNotNull(teamlevelMethod);
assertTrue(teamlevelMethod.exists());
-
+
IType anonymousType = teamlevelMethod.getType("",1);
assertNotNull(anonymousType);
assertTrue(anonymousType.exists());
- }
-
-
+ }
+
+
private IType getAnonymousType() throws JavaModelException
{
if ((_teamJavaElem != null) && (_teamJavaElem.exists()))
{
IMethod teamlevelMethod = _teamJavaElem.getMethod("teamlevelMethod", new String[0]);
-
+
if ((teamlevelMethod != null) && (teamlevelMethod.exists()))
{
IType anonymousType = teamlevelMethod.getType("",1);
-
+
if ((anonymousType != null) && (anonymousType.exists()))
{
return anonymousType;
@@ -115,13 +115,13 @@ public class Test2 extends FileBasedModelTest
}
}
return null;
- }
-
+ }
+
public void testContainmentOfMethodInAnonymousType() throws JavaModelException
{
IType anonymousType = getAnonymousType();
assertNotNull(anonymousType);
-
+
IMethod method = anonymousType.getMethod("additionalMethod", new String[0]);
assertNotNull(method);
assertTrue(method.exists());
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test3.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test3.java
index 6c3a56f24..28c8048d1 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test3.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test3.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -34,7 +34,7 @@ import org.eclipse.objectteams.otdt.core.OTModelManager;
import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
/**
- *
+ *
* testcase:
* a team class with an attribut
* attribut assignment with instantiation of an anonymous class
@@ -42,9 +42,9 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
*/
public class Test3 extends FileBasedModelTest
{
-
+
private IType _teamJavaElem = null;
-
+
public Test3(String name)
{
super(name);
@@ -60,13 +60,13 @@ public class Test3 extends FileBasedModelTest
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("AnonymousInnerclass");
super.setUpSuite();
}
-
+
protected void setUp() throws Exception
{
super.setUp();
@@ -78,7 +78,7 @@ public class Test3 extends FileBasedModelTest
"teamlevel.teampkg",
"Test3_SampleTeam.java");
_teamJavaElem = teamUnit.getType("Test3_SampleTeam");
-
+
System.out.println("\nAnonymousInnerclassTeamLevelTest3:");
System.out.println("Teamklasse: " +_teamJavaElem);
}
@@ -86,33 +86,33 @@ public class Test3 extends FileBasedModelTest
{
ex.printStackTrace();
}
- }
-
-
+ }
+
+
public void testExistenceOfAnonymousType() throws JavaModelException
{
assertNotNull(_teamJavaElem);
assertTrue(_teamJavaElem.exists());
-
+
IField teamlevelAttr = _teamJavaElem.getField("teamlevelAttr");
assertNotNull(teamlevelAttr);
assertTrue(teamlevelAttr.exists());
-
+
IType anonymousType = teamlevelAttr.getType("",1);
assertNotNull(anonymousType);
assertTrue(anonymousType.exists());
}
-
+
private IType getAnonymousType() throws JavaModelException
{
if ((_teamJavaElem != null) && (_teamJavaElem.exists()))
{
IField teamlevelAttr = _teamJavaElem.getField("teamlevelAttr");
-
+
if ((teamlevelAttr != null) && (teamlevelAttr.exists()))
{
IType anonymousType = teamlevelAttr.getType("",1);
-
+
if ((anonymousType != null) && (anonymousType.exists()))
{
return anonymousType;
@@ -121,42 +121,42 @@ public class Test3 extends FileBasedModelTest
}
return null;
}
-
+
public void testExistenceOfAnonymousTypeInOTModel() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
}
-
+
public void testRolePropertyOfAnonymousType() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
-
+
assertTrue(anonymousTypeOTElem.isRole());
assertTrue(anonymousTypeOTElem instanceof IRoleType);
}
-
+
public void testContainmentOfMethodMappingInAnonymousType() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
-
+
assertTrue(anonymousTypeOTElem.isRole());
assertTrue(anonymousTypeOTElem instanceof IRoleType);
-
+
IRoleType role = (IRoleType) anonymousTypeOTElem;
assertNotNull(role);
-
+
IMethodMapping[] mappings = role.getMethodMappings();
assertNotNull(mappings);
assertTrue(mappings.length == 1);
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test4.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test4.java
index f87bf97e9..0d23ccf8d 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test4.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test4.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -34,7 +34,7 @@ import org.eclipse.objectteams.otdt.core.OTModelManager;
import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
/**
- *
+ *
* testcase:
* a team class with a method
* instantiation of an anonymous class inside the method
@@ -42,9 +42,9 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
*/
public class Test4 extends FileBasedModelTest
{
-
+
private IType _teamJavaElem = null;
-
+
public Test4(String name)
{
super(name);
@@ -60,13 +60,13 @@ public class Test4 extends FileBasedModelTest
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("AnonymousInnerclass");
super.setUpSuite();
}
-
+
protected void setUp() throws Exception
{
super.setUp();
@@ -78,7 +78,7 @@ public class Test4 extends FileBasedModelTest
"teamlevel.teampkg",
"Test4_SampleTeam.java");
_teamJavaElem = teamUnit.getType("Test4_SampleTeam");
-
+
System.out.println("\nAnonymousInnerclassTeamLevelTest4:");
System.out.println("Teamklasse:\n" +_teamJavaElem);
}
@@ -86,18 +86,18 @@ public class Test4 extends FileBasedModelTest
{
ex.printStackTrace();
}
- }
-
-
+ }
+
+
public void testExistenceOfAnonymousType() throws JavaModelException
{
assertNotNull(_teamJavaElem);
assertTrue(_teamJavaElem.exists());
-
+
IMethod teamlevelMethod = _teamJavaElem.getMethod("teamlevelMethod", new String[0]);
assertNotNull(teamlevelMethod);
assertTrue(teamlevelMethod.exists());
-
+
IType anonymousType = teamlevelMethod.getType("",1);
assertNotNull(anonymousType);
assertTrue(anonymousType.exists());
@@ -108,11 +108,11 @@ public class Test4 extends FileBasedModelTest
if ((_teamJavaElem != null) && (_teamJavaElem.exists()))
{
IMethod teamlevelMethod = _teamJavaElem.getMethod("teamlevelMethod", new String[0]);
-
+
if ((teamlevelMethod != null) && (teamlevelMethod.exists()))
{
IType anonymousType = teamlevelMethod.getType("",1);
-
+
if ((anonymousType != null) && (anonymousType.exists()))
{
return anonymousType;
@@ -120,46 +120,46 @@ public class Test4 extends FileBasedModelTest
}
}
return null;
- }
-
+ }
+
public void testExistenceOfAnonymousTypeInOTModel() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
}
-
+
public void testRolePropertyOfAnonymousType() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
-
+
assertTrue(anonymousTypeOTElem.isRole());
assertTrue(anonymousTypeOTElem instanceof IRoleType);
}
-
+
public void testContainmentOfMethodMappingInAnonymousType() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
-
+
assertTrue(anonymousTypeOTElem.isRole());
assertTrue(anonymousTypeOTElem instanceof IRoleType);
-
+
IRoleType role = (IRoleType) anonymousTypeOTElem;
assertNotNull(role);
-
+
IMethodMapping[] mappings = role.getMethodMappings();
assertNotNull(mappings);
assertTrue(mappings.length == 1);
assertEquals(mappings[0].getElementName(), "roleMethod() <- baseMethod()");
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test5.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test5.java
index 8871fc441..1c06aee25 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test5.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test5.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -32,7 +32,7 @@ import org.eclipse.objectteams.otdt.core.OTModelManager;
import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
/**
- *
+ *
* testcase:
* a team class with an attribut
* attribut assignment with instantiation of an anonymous class
@@ -40,9 +40,9 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
*/
public class Test5 extends FileBasedModelTest
{
-
+
private IType _teamJavaElem = null;
-
+
public Test5(String name)
{
super(name);
@@ -58,13 +58,13 @@ public class Test5 extends FileBasedModelTest
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("AnonymousInnerclass");
super.setUpSuite();
}
-
+
protected void setUp() throws Exception
{
super.setUp();
@@ -76,7 +76,7 @@ public class Test5 extends FileBasedModelTest
"teamlevel.teampkg",
"Test5_TeamB.java");
_teamJavaElem = teamUnit.getType("Test5_TeamB");
-
+
System.out.println("\nAnonymousInnerclassTeamLevelTest5:");
System.out.println("Teamklasse: " +_teamJavaElem);
}
@@ -84,33 +84,33 @@ public class Test5 extends FileBasedModelTest
{
ex.printStackTrace();
}
- }
-
+ }
+
public void testExistenceOfAnonymousType() throws JavaModelException
{
assertNotNull(_teamJavaElem);
assertTrue(_teamJavaElem.exists());
-
+
IField teamlevelAttr = _teamJavaElem.getField("teamlevelAttr");
assertNotNull(teamlevelAttr);
assertTrue(teamlevelAttr.exists());
-
+
IType anonymousType = teamlevelAttr.getType("",1);
assertNotNull(anonymousType);
assertTrue(anonymousType.exists());
}
-
-
+
+
private IType getAnonymousType() throws JavaModelException
{
if ((_teamJavaElem != null) && (_teamJavaElem.exists()))
{
IField teamlevelAttr = _teamJavaElem.getField("teamlevelAttr");
-
+
if ((teamlevelAttr != null) && (teamlevelAttr.exists()))
{
IType anonymousType = teamlevelAttr.getType("",1);
-
+
if ((anonymousType != null) && (anonymousType.exists()))
{
return anonymousType;
@@ -119,42 +119,42 @@ public class Test5 extends FileBasedModelTest
}
return null;
}
-
+
public void testExistenceOfAnonymousTypeInOTModel() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
}
-
+
public void testTeamPropertyOfAnonymousType() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
-
+
assertTrue(anonymousTypeOTElem.isTeam());
}
-
+
public void testContainmentOfRoleInAnonymousType() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
assertTrue(anonymousTypeOTElem.isTeam());
-//{OTModelUpdate
+//{OTModelUpdate
IOTType[] innerTypes = (IOTType[]) anonymousTypeOTElem.getInnerTypes();
-//haebor}
+//haebor}
assertNotNull(innerTypes);
assertTrue(innerTypes.length == 1);
assertTrue(innerTypes[0].isRole());
assertEquals(innerTypes[0].getElementName(), "RoleClass");
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test6.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test6.java
index 773c6e141..88c4cf208 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test6.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test6.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -32,7 +32,7 @@ import org.eclipse.objectteams.otdt.core.OTModelManager;
import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
/**
- *
+ *
* testcase:
* a team class with a method
* instantiation of an anonymous class inside the method
@@ -40,9 +40,9 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
*/
public class Test6 extends FileBasedModelTest
{
-
+
private IType _teamJavaElem = null;
-
+
public Test6(String name)
{
super(name);
@@ -58,13 +58,13 @@ public class Test6 extends FileBasedModelTest
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("AnonymousInnerclass");
super.setUpSuite();
}
-
+
protected void setUp() throws Exception
{
super.setUp();
@@ -76,7 +76,7 @@ public class Test6 extends FileBasedModelTest
"teamlevel.teampkg",
"Test6_TeamB.java");
_teamJavaElem = teamUnit.getType("Test6_TeamB");
-
+
System.out.println("\nAnonymousInnerclassTeamLevelTest6:");
System.out.println("Teamklasse:\n" +_teamJavaElem);
}
@@ -84,33 +84,33 @@ public class Test6 extends FileBasedModelTest
{
ex.printStackTrace();
}
- }
-
-
+ }
+
+
public void testExistenceOfAnonymousType() throws JavaModelException
{
assertNotNull(_teamJavaElem);
assertTrue(_teamJavaElem.exists());
-
+
IMethod teamlevelMethod = _teamJavaElem.getMethod("teamlevelMethod", new String[0]);
assertNotNull(teamlevelMethod);
assertTrue(teamlevelMethod.exists());
-
+
IType anonymousType = teamlevelMethod.getType("",1);
assertNotNull(anonymousType);
assertTrue(anonymousType.exists());
}
-
+
private IType getAnonymousType() throws JavaModelException
{
if ((_teamJavaElem != null) && (_teamJavaElem.exists()))
{
IMethod teamlevelMethod = _teamJavaElem.getMethod("teamlevelMethod", new String[0]);
-
+
if ((teamlevelMethod != null) && (teamlevelMethod.exists()))
{
IType anonymousType = teamlevelMethod.getType("",1);
-
+
if ((anonymousType != null) && (anonymousType.exists()))
{
return anonymousType;
@@ -118,38 +118,38 @@ public class Test6 extends FileBasedModelTest
}
}
return null;
- }
+ }
public void testExistenceOfAnonymousTypeInOTModel() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
}
-
+
public void testTeamPropertyOfAnonymousType() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
-
+
assertTrue(anonymousTypeOTElem.isTeam());
}
-
+
public void testContainmentOfRoleInAnonymousType() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
assertTrue(anonymousTypeOTElem.isTeam());
-//{OTModelUpdate
+//{OTModelUpdate
IOTType[] innerTypes = (IOTType[]) anonymousTypeOTElem.getInnerTypes();
//haebor}
@@ -157,5 +157,5 @@ public class Test6 extends FileBasedModelTest
assertTrue(innerTypes.length == 1);
assertTrue(innerTypes[0].isRole());
assertEquals(innerTypes[0].getElementName(), "RoleClass");
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test7.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test7.java
index 023ca3a69..b17bc8279 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test7.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test7.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -33,7 +33,7 @@ import org.eclipse.objectteams.otdt.core.OTModelManager;
import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
/**
- *
+ *
* testcase:
* a team class with an attribut
* attribut assignment with instantiation of an anonymous class
@@ -41,9 +41,9 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
*/
public class Test7 extends FileBasedModelTest
{
-
+
private IType _teamJavaElem = null;
-
+
public Test7(String name)
{
super(name);
@@ -59,13 +59,13 @@ public class Test7 extends FileBasedModelTest
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("AnonymousInnerclass");
super.setUpSuite();
}
-
+
protected void setUp() throws Exception
{
super.setUp();
@@ -77,7 +77,7 @@ public class Test7 extends FileBasedModelTest
"teamlevel.teampkg",
"Test7_TeamB.java");
_teamJavaElem = teamUnit.getType("Test7_TeamB");
-
+
System.out.println("\nAnonymousInnerclassTeamLevelTest7:");
System.out.println("Teamklasse: \n" +_teamJavaElem);
}
@@ -85,33 +85,33 @@ public class Test7 extends FileBasedModelTest
{
ex.printStackTrace();
}
- }
-
+ }
+
public void testExistenceOfAnonymousType() throws JavaModelException
{
assertNotNull(_teamJavaElem);
assertTrue(_teamJavaElem.exists());
-
+
IField teamlevelAttr = _teamJavaElem.getField("teamlevelAttr");
assertNotNull(teamlevelAttr);
assertTrue(teamlevelAttr.exists());
-
+
IType anonymousType = teamlevelAttr.getType("",1);
assertNotNull(anonymousType);
assertTrue(anonymousType.exists());
}
-
-
+
+
private IType getAnonymousType() throws JavaModelException
{
if ((_teamJavaElem != null) && (_teamJavaElem.exists()))
{
IField teamlevelAttr = _teamJavaElem.getField("teamlevelAttr");
-
+
if ((teamlevelAttr != null) && (teamlevelAttr.exists()))
{
IType anonymousType = teamlevelAttr.getType("",1);
-
+
if ((anonymousType != null) && (anonymousType.exists()))
{
return anonymousType;
@@ -120,36 +120,36 @@ public class Test7 extends FileBasedModelTest
}
return null;
}
-
+
public void testExistenceOfAnonymousTypeInOTModel() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
}
-
+
public void testTeamPropertyOfAnonymousType() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
-
+
assertTrue(anonymousTypeOTElem.isTeam());
}
-
+
public void testContainmentOfMethodInAnonymousType() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IMethod method = anonymousTypeJavaElem.getMethod("method", new String[]{"QSampleBase;"});
assertNotNull(method);
assertTrue(method.exists());
}
-
+
//TODO (kaschja) create test for declared lifting by the time declared lifting is integrated into the OT-model
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test8.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test8.java
index f6dee20fb..1fee1f695 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test8.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test8.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -32,7 +32,7 @@ import org.eclipse.objectteams.otdt.core.OTModelManager;
import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
/**
- *
+ *
* testcase:
* a team class with a method
* instantiation of an anonymous class inside the method
@@ -40,9 +40,9 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
*/
public class Test8 extends FileBasedModelTest
{
-
+
private IType _teamJavaElem = null;
-
+
public Test8(String name)
{
super(name);
@@ -58,13 +58,13 @@ public class Test8 extends FileBasedModelTest
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("AnonymousInnerclass");
super.setUpSuite();
}
-
+
protected void setUp() throws Exception
{
super.setUp();
@@ -76,7 +76,7 @@ public class Test8 extends FileBasedModelTest
"teamlevel.teampkg",
"Test8_TeamB.java");
_teamJavaElem = teamUnit.getType("Test8_TeamB");
-
+
System.out.println("\nAnonymousInnerclassTeamLevelTest8:");
System.out.println("Teamklasse:\n" +_teamJavaElem);
}
@@ -84,31 +84,31 @@ public class Test8 extends FileBasedModelTest
{
ex.printStackTrace();
}
- }
+ }
public void testExistenceOfAnonymousType() throws JavaModelException
{
assertNotNull(_teamJavaElem);
assertTrue(_teamJavaElem.exists());
-
+
IMethod teamlevelMethod = _teamJavaElem.getMethod("teamlevelMethod", new String[0]);
assertNotNull(teamlevelMethod);
assertTrue(teamlevelMethod.exists());
-
+
IType anonymousType = teamlevelMethod.getType("",1);
assertNotNull(anonymousType);
assertTrue(anonymousType.exists());
}
-
+
private IType getAnonymousType() throws JavaModelException
{
if ((_teamJavaElem != null) && (_teamJavaElem.exists()))
{
IMethod teamlevelMethod = _teamJavaElem.getMethod("teamlevelMethod", new String[0]);
-
+
if ((teamlevelMethod != null) && (teamlevelMethod.exists()))
{
IType anonymousType = teamlevelMethod.getType("",1);
-
+
if ((anonymousType != null) && (anonymousType.exists()))
{
return anonymousType;
@@ -117,36 +117,36 @@ public class Test8 extends FileBasedModelTest
}
return null;
}
-
+
public void testExistenceOfAnonymousTypeInOTModel() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
}
-
+
public void testTeamPropertyOfAnonymousType() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem);
assertNotNull(anonymousTypeOTElem);
-
+
assertTrue(anonymousTypeOTElem.isTeam());
}
-
+
public void testContainmentOfMethodInAnonymousType() throws JavaModelException
{
IType anonymousTypeJavaElem = getAnonymousType();
assertNotNull(anonymousTypeJavaElem);
-
+
IMethod method = anonymousTypeJavaElem.getMethod("method", new String[]{"QSampleBase;"});
assertNotNull(method);
assertTrue(method.exists());
}
-
- //TODO (kaschja) create test for declared lifting by the time declared lifting is integrated into the OT-model
+
+ //TODO (kaschja) create test for declared lifting by the time declared lifting is integrated into the OT-model
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/equals/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/equals/AllTests.java
index dc7b541f3..b23552bf3 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/equals/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/equals/AllTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -26,7 +26,7 @@ import junit.framework.TestSuite;
/**
* Enter a class description here!
- *
+ *
* @author jwloka
* @version $Id: AllTests.java 23494 2010-02-05 23:06:44Z stephan $
*/
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/equals/EqualsTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/equals/EqualsTest.java
index 5b1751554..6bee91ff6 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/equals/EqualsTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/equals/EqualsTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -37,7 +37,7 @@ import org.eclipse.objectteams.otdt.tests.otmodel.TestSetting;
*/
public class EqualsTest extends TestCase
{
- public EqualsTest(String name)
+ public EqualsTest(String name)
{
super(name);
}
@@ -46,10 +46,10 @@ public class EqualsTest extends TestCase
{
return new Class[]
{
- org.eclipse.objectteams.otdt.tests.otmodel.equals.Test1.class
+ org.eclipse.objectteams.otdt.tests.otmodel.equals.Test1.class
};
}
-
+
public static TestSetting getActualTestSetting()
{
return new TestSetting("TeamProject", "src", "teampkg");
@@ -73,7 +73,7 @@ public class EqualsTest extends TestCase
try
{
TestDataHandler.addTestSetting(testClass, getActualTestSetting());
-
+
Method suiteMethod = testClass.getDeclaredMethod(
"suite", new Class[0]); //$NON-NLS-1$
Test suite = (Test) suiteMethod.invoke(null, new Object[0]);
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/equals/Test1.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/equals/Test1.java
index e85bb605d..806db5e4a 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/equals/Test1.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/equals/Test1.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -43,7 +43,7 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
public class Test1 extends FileBasedModelTest
{
private static final int OTELEMENT_TYPE = IOTType.TEAM;
-
+
public Test1(String name)
{
super(name);
@@ -59,14 +59,14 @@ public class Test1 extends FileBasedModelTest
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir(getTestSetting().getTestProject());
getTestSetting().setTeamClass("EmptyTeam");
super.setUpSuite();
}
-
+
protected void setUp() throws Exception
{
super.setUp();
@@ -75,7 +75,7 @@ public class Test1 extends FileBasedModelTest
public void testEquals_emptyTeam() throws JavaModelException
{
- IOTType otType1 = createTeamClass("teampkg.EmptyTeam");
+ IOTType otType1 = createTeamClass("teampkg.EmptyTeam");
IOTType otType2 = getOTInstanceViaModelManager("teampkg", "EmptyTeam");
assertFalse(otType1 == otType2);
@@ -84,40 +84,40 @@ public class Test1 extends FileBasedModelTest
public void testEquals_teamWithEmptyRoleClass() throws JavaModelException
{
- IRoleType roleType1 = createRoleClass("teampkg.TeamWithRoleClass.RoleClass", "teampkg", "TeamWithRoleClass");
+ IRoleType roleType1 = createRoleClass("teampkg.TeamWithRoleClass.RoleClass", "teampkg", "TeamWithRoleClass");
IRoleType roleType2 = getRoleClass("teampkg", "TeamWithRoleClass", "RoleClass");
-
+
assertFalse(roleType1 == roleType2);
assertTrue(roleType1.equals(roleType2));
}
-
+
public void testEquals_teamWithRoleClassContainingCalloutMapping()
{
}
-
+
public void testEquals_teamWithRoleClassContainingCallinMapping()
{
-
+
}
-
+
private IOTType createTeamClass(String qualName) throws JavaModelException
{
IType type1 = findType(qualName);
-
+
return new OTType(
- OTELEMENT_TYPE,
- type1,
+ OTELEMENT_TYPE,
+ type1,
null, // root element in OTModel
ClassFileConstants.AccPublic | ExtraCompilerModifiers.AccTeam);
}
-
+
private IRoleType createRoleClass(String qualName,
String pkgName,
String typeName ) throws JavaModelException
{
IType type1 = findType(qualName);
IType parent = getTeamClass(pkgName, typeName);
-
+
return new RoleType(type1,
OTModelManager.getOTElement(parent),
ClassFileConstants.AccPublic | ExtraCompilerModifiers.AccRole,
@@ -127,7 +127,7 @@ public class Test1 extends FileBasedModelTest
private IOTType getOTInstanceViaModelManager(String pkgName, String typeName) throws JavaModelException
{
IType type2 = getTeamClass(pkgName, typeName);
-
+
assertNotNull(type2);
assertTrue(type2.exists());
return OTModelManager.getOTElement(type2);
@@ -140,7 +140,7 @@ public class Test1 extends FileBasedModelTest
"src",
pkgName,
typeName + ".java");
-
+
IType type2 = unit.getType(typeName);
return type2;
}
@@ -150,14 +150,14 @@ public class Test1 extends FileBasedModelTest
IType teamClass = getTeamClass(pkgName, typeName);
return (IRoleType)OTModelManager.getOTElement(teamClass.getType(roleName));
}
-
+
private IType findType(String qualName) throws JavaModelException
{
IJavaProject project = getJavaProject(getTestProjectDir());
IType type1 = project.findType(qualName);
assertNotNull(type1);
assertTrue(type1.exists());
-
+
return type1;
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/externalrole/AllExternalBoundToOrdinaryRoleTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/externalrole/AllExternalBoundToOrdinaryRoleTests.java
index 0152a1a2a..9f551705f 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/externalrole/AllExternalBoundToOrdinaryRoleTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/externalrole/AllExternalBoundToOrdinaryRoleTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -34,12 +34,12 @@ import org.eclipse.objectteams.otdt.tests.otmodel.TestDataHandler;
import org.eclipse.objectteams.otdt.tests.otmodel.TestSetting;
/**
- * @author jwloka
+ * @author jwloka
* @version $Id: AllExternalBoundToOrdinaryRoleTests.java 23494 2010-02-05 23:06:44Z stephan $
*/
public class AllExternalBoundToOrdinaryRoleTests extends TestCase
{
- public AllExternalBoundToOrdinaryRoleTests(String name)
+ public AllExternalBoundToOrdinaryRoleTests(String name)
{
super(name);
}
@@ -63,7 +63,7 @@ public class AllExternalBoundToOrdinaryRoleTests extends TestCase
org.eclipse.objectteams.otdt.tests.otmodel.role.bound.toordinary.Test5e.class
};
}
-
+
public static TestSetting getActualTestSetting()
{
return new TestSetting(
@@ -71,8 +71,8 @@ public class AllExternalBoundToOrdinaryRoleTests extends TestCase
"boundtoordinary",
"boundtoordinary.teampkg");
}
-
-
+
+
public static Test suite()
{
TestSuite ts = new TestSuite(AllExternalBoundToOrdinaryRoleTests.class.getName()) {
@@ -98,7 +98,7 @@ public class AllExternalBoundToOrdinaryRoleTests extends TestCase
try
{
TestDataHandler.addTestSetting(curTestClass, getActualTestSetting());
-
+
Method suiteMethod = curTestClass.getDeclaredMethod(
"suite", new Class[0]); //$NON-NLS-1$
Test suite = (Test) suiteMethod.invoke(null, new Object[0]);
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/externalrole/AllExternalBoundToTeamRoleTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/externalrole/AllExternalBoundToTeamRoleTests.java
index 7259dd96b..0cbab1c4e 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/externalrole/AllExternalBoundToTeamRoleTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/externalrole/AllExternalBoundToTeamRoleTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -34,12 +34,12 @@ import org.eclipse.objectteams.otdt.tests.otmodel.TestDataHandler;
import org.eclipse.objectteams.otdt.tests.otmodel.TestSetting;
/**
- * @author jwloka
+ * @author jwloka
* @version $Id: AllExternalBoundToTeamRoleTests.java 23494 2010-02-05 23:06:44Z stephan $
*/
public class AllExternalBoundToTeamRoleTests extends TestCase
{
- public AllExternalBoundToTeamRoleTests(String name)
+ public AllExternalBoundToTeamRoleTests(String name)
{
super(name);
}
@@ -63,7 +63,7 @@ public class AllExternalBoundToTeamRoleTests extends TestCase
org.eclipse.objectteams.otdt.tests.otmodel.role.bound.toteam.Test5e.class
};
}
-
+
public static TestSetting getActualTestSetting()
{
return new TestSetting(
@@ -71,8 +71,8 @@ public class AllExternalBoundToTeamRoleTests extends TestCase
"boundtoteam",
"boundtoteam.teampkg");
}
-
-
+
+
public static Test suite()
{
TestSuite ts = new TestSuite(AllExternalBoundToTeamRoleTests.class.getName()) {
@@ -98,7 +98,7 @@ public class AllExternalBoundToTeamRoleTests extends TestCase
try
{
TestDataHandler.addTestSetting(curTestClass, getActualTestSetting());
-
+
Method suiteMethod = curTestClass.getDeclaredMethod(
"suite", new Class[0]); //$NON-NLS-1$
Test suite = (Test) suiteMethod.invoke(null, new Object[0]);
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/externalrole/AllExternalUnboundRoleTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/externalrole/AllExternalUnboundRoleTests.java
index ccb9be0eb..65488d0f7 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/externalrole/AllExternalUnboundRoleTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/externalrole/AllExternalUnboundRoleTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -34,16 +34,16 @@ import org.eclipse.objectteams.otdt.tests.otmodel.TestDataHandler;
import org.eclipse.objectteams.otdt.tests.otmodel.TestSetting;
/**
- * @author jwloka
+ * @author jwloka
* @version $Id: AllExternalUnboundRoleTests.java 23494 2010-02-05 23:06:44Z stephan $
*/
public class AllExternalUnboundRoleTests extends TestCase
{
- public AllExternalUnboundRoleTests(String name)
+ public AllExternalUnboundRoleTests(String name)
{
super(name);
}
-
+
public static Class[] getAllTestClasses()
{
return new Class[]
@@ -70,8 +70,8 @@ public class AllExternalUnboundRoleTests extends TestCase
"unbound",
"unbound.teampkg");
}
-
-
+
+
public static Test suite()
{
TestSuite ts = new TestSuite(AllExternalUnboundRoleTests.class.getName()) {
@@ -97,7 +97,7 @@ public class AllExternalUnboundRoleTests extends TestCase
try
{
TestDataHandler.addTestSetting(curTestClass, getActualTestSetting());
-
+
Method suiteMethod = curTestClass.getDeclaredMethod(
"suite", new Class[0]); //$NON-NLS-1$
Test suite = (Test) suiteMethod.invoke(null, new Object[0]);
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/externalrole/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/externalrole/AllTests.java
index c3f04f29a..7e064189f 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/externalrole/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/externalrole/AllTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -28,13 +28,13 @@ import junit.textui.TestRunner;
/**
* Enter a class description here!
- *
+ *
* @author jwloka
* @version $Id: AllTests.java 23494 2010-02-05 23:06:44Z stephan $
*/
public class AllTests
{
-
+
public static void main(String[] args)
{
TestRunner.run(AllTests.suite());
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internal/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internal/AllTests.java
index 891abbaf3..5973db6e3 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internal/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internal/AllTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internal/OTModelManagerTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internal/OTModelManagerTest.java
index 80b3f3329..2b0c4bdac 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internal/OTModelManagerTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internal/OTModelManagerTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -32,63 +32,63 @@ import org.eclipse.objectteams.otdt.core.TypeHelper;
import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
/**
- *
+ *
* @author michael
- * @version $Id: OTModelManagerTest.java 23494 2010-02-05 23:06:44Z stephan $
- *
+ * @version $Id: OTModelManagerTest.java 23494 2010-02-05 23:06:44Z stephan $
+ *
*/
public class OTModelManagerTest extends FileBasedModelTest {
-
+
@SuppressWarnings("unused")
private ITypeHierarchy _testObj;
private IType _focusType;
private IType _T20;
- private IType _T21;
+ private IType _T21;
@SuppressWarnings("unused")
private IType _objectType;
private IType _T21T10T00;
private IType _T21T11T00;
-
-
-
+
+
+
public OTModelManagerTest(String name)
{
super(name);
}
-
+
public static Test suite()
{
if (true)
{
return new Suite(OTModelManagerTest.class);
}
- junit.framework.TestSuite suite =
+ junit.framework.TestSuite suite =
new Suite(OTModelManagerTest.class.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
String srcFolder = "src";
String pkg = "test004";
-
- _T20 =
+
+ _T20 =
getType(getTestProjectDir(),
srcFolder,
pkg,
"T20");
- _T21 =
+ _T21 =
getType(getTestProjectDir(),
srcFolder,
pkg,
"T21");
-
-
- _objectType =
+
+
+ _objectType =
getType(getTestProjectDir(),
"rt.jar",
"java.lang",
@@ -97,7 +97,7 @@ public class OTModelManagerTest extends FileBasedModelTest {
_T21T10T00 = TypeHelper.findNestedRoleType(_T21, "T21.T10.T00");
_T21T11T00 = TypeHelper.findNestedRoleType(_T21, "T21.T11.T00");
}
-
+
public void testCreation()
{
assertCreation(_T20);
@@ -112,27 +112,27 @@ public class OTModelManagerTest extends FileBasedModelTest {
IOTType iotFocusType = OTModelManager.getOTElement(_focusType);
IType actual = (IType)iotFocusType.getCorrespondingJavaElement();
IType expected = _focusType;
-
- assertEquals(expected, actual);
+
+ assertEquals(expected, actual);
}
-
+
public void testOTModelManager_getOTElement() throws JavaModelException
{
_focusType = _T21T10T00;
IOTType iot = OTModelManager.getOTElement(_focusType);
String actual = iot.getFullyQualifiedName();
String expected = _focusType.getFullyQualifiedName();
-
- assertEquals(expected, actual);
+
+ assertEquals(expected, actual);
}
-
+
public void testOTModelManager_getOTElement_Failed()
{
_focusType = _T21T10T00;
IOTType iotFocusType = OTModelManager.getOTElement(_focusType);
IType actual = (IType)iotFocusType.getCorrespondingJavaElement();
IType expected = _T21T11T00;
-
- assertNotSame(expected, actual);
+
+ assertNotSame(expected, actual);
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internal/TypeHelperTest001.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internal/TypeHelperTest001.java
index 23a9b1dc8..6d1ad821d 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internal/TypeHelperTest001.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internal/TypeHelperTest001.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -48,10 +48,10 @@ public class TypeHelperTest001 extends FileBasedModelTest
private IMethod _m1;
private IMethod _m2;
private IMethod _m3;
-
+
private IMethodMapping _mm1;
private IMethodMapping _mm2;
-
+
public TypeHelperTest001(String name)
{
super(name);
@@ -61,7 +61,7 @@ public class TypeHelperTest001 extends FileBasedModelTest
{
return new Suite(TypeHelperTest001.class);
}
-
+
/**
* Creates a team hierarchy with implicit role type inheritance.
*/
@@ -69,13 +69,13 @@ public class TypeHelperTest001 extends FileBasedModelTest
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
_t4 =
getType(getTestProjectDir(),
"analysis",
"rolehierarchy2",
"Team4");
-
+
_t4r1 =
getRole(getTestProjectDir(),
"analysis",
@@ -111,9 +111,9 @@ public class TypeHelperTest001 extends FileBasedModelTest
_mm1 = _t2r1.getMethodMappings()[0];
_mm2 = _t3r1.getMethodMappings()[0];
-
+
}
-
+
protected void setUp() throws Exception
{
super.setUp();
@@ -128,26 +128,26 @@ public class TypeHelperTest001 extends FileBasedModelTest
public void testGetMethodMapping1() throws JavaModelException
{
- IMethodMapping expected = _mm1;
+ IMethodMapping expected = _mm1;
IMethodMapping actual = TypeHelper.getMethodMapping(_m1, _t4);
-
+
assertEquals(expected, actual);
}
-
+
public void testGetMethodMapping2() throws JavaModelException
{
- IMethodMapping expected = _mm2;
+ IMethodMapping expected = _mm2;
IMethodMapping actual = TypeHelper.getMethodMapping(_m2, _t4);
-
+
assertEquals(expected, actual);
}
-
+
public void testGetMethodMapping3() throws JavaModelException
{
- IMethodMapping expected = null;
+ IMethodMapping expected = null;
IMethodMapping actual = TypeHelper.getMethodMapping(_m3, _t4);
-
+
assertEquals(expected, actual);
}
-
+
} \ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internal/TypeHelperTest002.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internal/TypeHelperTest002.java
index 1d4b58093..2f4d799fc 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internal/TypeHelperTest002.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internal/TypeHelperTest002.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -43,7 +43,7 @@ public class TypeHelperTest002 extends FileBasedModelTest
private IRoleType _t4r2;
private IRoleType _t3r3;
private IRoleType _t5r1;
-
+
public TypeHelperTest002(String name)
{
super(name);
@@ -53,7 +53,7 @@ public class TypeHelperTest002 extends FileBasedModelTest
{
return new Suite(TypeHelperTest002.class);
}
-
+
/**
* Creates a team hierarchy with implicit role type inheritance.
*/
@@ -61,14 +61,14 @@ public class TypeHelperTest002 extends FileBasedModelTest
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
IType teamIType =
getType(getTestProjectDir(),
"analysis",
"teamhierarchy",
"Team5");
_testObject = OTModelManager.getOTElement(teamIType);
-
+
_t4r1 =
getRole(getTestProjectDir(),
"analysis",
@@ -89,7 +89,7 @@ public class TypeHelperTest002 extends FileBasedModelTest
"teamhierarchy",
"Team3",
"R3");
-
+
_t5r1 =
getRole(getTestProjectDir(),
"analysis",
@@ -97,7 +97,7 @@ public class TypeHelperTest002 extends FileBasedModelTest
"Team5",
"R1");
}
-
+
protected void setUp() throws Exception
{
super.setUp();
@@ -118,7 +118,7 @@ public class TypeHelperTest002 extends FileBasedModelTest
assertTrue( compareTypes(expected, actual) );
}
-
+
public void testGetAllRoleTypes() throws JavaModelException
{
IType[] expected = new IType[] { _t5r1, _t4r2, _t3r3 };
@@ -126,9 +126,9 @@ public class TypeHelperTest002 extends FileBasedModelTest
assertTrue( compareTypes(expected, actual) );
}
-
+
// test hierarchy of team extending non-team
- public void testGetAllRoleTypes2() throws JavaModelException
+ public void testGetAllRoleTypes2() throws JavaModelException
{
IType teamIType =
getType(getTestProjectDir(),
@@ -136,7 +136,7 @@ public class TypeHelperTest002 extends FileBasedModelTest
"teamhierarchy",
"Team6");
IOTType team6 = OTModelManager.getOTElement(teamIType);
-
+
IType[] expected = new IType[] {
getRole(getTestProjectDir(),
"analysis",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internal/TypeHelperTest003.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internal/TypeHelperTest003.java
index 7a6b3734f..a914ee275 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internal/TypeHelperTest003.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internal/TypeHelperTest003.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -38,9 +38,9 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
*/
public class TypeHelperTest003 extends FileBasedModelTest
{
-
+
private IOTType _testObject;
-
+
private IRoleType _t1r1;
private IRoleType _t3r1;
private IRoleType _t4r1;
@@ -53,7 +53,7 @@ public class TypeHelperTest003 extends FileBasedModelTest
private IMethod _t3r1m2;
private IMethod _t3r1m3;
private IMethod _t1r1m2;
-
+
public TypeHelperTest003(String name)
{
super(name);
@@ -63,7 +63,7 @@ public class TypeHelperTest003 extends FileBasedModelTest
{
return new Suite(TypeHelperTest003.class);
}
-
+
/**
* Creates a team hierarchy with implicit role type inheritance.
*/
@@ -71,14 +71,14 @@ public class TypeHelperTest003 extends FileBasedModelTest
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
IType teamIType =
getType(getTestProjectDir(),
"analysis",
"rolehierarchy",
"Team5");
_testObject = OTModelManager.getOTElement(teamIType);
-
+
_t5r1 =
getRole(getTestProjectDir(),
"analysis",
@@ -86,8 +86,8 @@ public class TypeHelperTest003 extends FileBasedModelTest
"Team5",
"R1");
-
-
+
+
_t4r1 =
getRole(getTestProjectDir(),
"analysis",
@@ -110,16 +110,16 @@ public class TypeHelperTest003 extends FileBasedModelTest
"rolehierarchy",
"Team1",
"R1");
-
+
_t5r1m1 = _t5r1.getMethods()[0];
_t4r1m1 = _t4r1.getMethods()[0];
_t4r1m2 = _t4r1.getMethods()[1];
_t3r1m2 = _t3r1.getMethods()[0];
_t3r1m3 = _t3r1.getMethods()[1];
_t1r1m2 = _t1r1.getMethods()[1];
-
+
}
-
+
protected void setUp() throws Exception
{
super.setUp();
@@ -137,16 +137,16 @@ public class TypeHelperTest003 extends FileBasedModelTest
{
IMethod[] expected = new IMethod[] { _t4r1m1, _t4r1m2, _t3r1m3, _t1r1m2 };
IMethod[] actual = TypeHelper.getInheritedRoleMethods(_testObject, "R1");
-
+
assertTrue( compareMethods(expected, actual) );
}
-
+
public void testGetAllRoleMethods() throws JavaModelException
{
IMethod[] expected = new IMethod[] { _t5r1m1, _t4r1m2, _t3r1m3, _t1r1m2 };
IMethod[] actual = TypeHelper.getAllRoleMethods(_testObject, "R1");
-
+
assertTrue( compareMethods(expected, actual) );
}
-
+
} \ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internal/TypeHelperTest004.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internal/TypeHelperTest004.java
index 754a1ce33..9af6ac267 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internal/TypeHelperTest004.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internal/TypeHelperTest004.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -59,7 +59,7 @@ public class TypeHelperTest004 extends FileBasedModelTest
{
return new Suite(TypeHelperTest004.class);
}
-
+
/**
* Creates a team hierarchy with implicit role type inheritance.
*/
@@ -67,14 +67,14 @@ public class TypeHelperTest004 extends FileBasedModelTest
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
_t1r1 =
getRole(getTestProjectDir(),
"analysis",
"rolehierarchy3",
"T1",
"R1");
-
+
_t2r1 =
getRole(getTestProjectDir(),
"analysis",
@@ -88,14 +88,14 @@ public class TypeHelperTest004 extends FileBasedModelTest
"rolehierarchy3",
"T2",
"R2");
-
+
_t3r1 =
getRole(getTestProjectDir(),
"analysis",
"rolehierarchy3",
"T3",
"R1");
-
+
_t3r2 =
getRole(getTestProjectDir(),
"analysis",
@@ -108,19 +108,19 @@ public class TypeHelperTest004 extends FileBasedModelTest
"analysis",
"rolehierarchy3",
"C1");
-
+
_c1m1 = _c1.getMethods()[0];
_c1m2 = _c1.getMethods()[1];
_t1r1m3 = _t1r1.getMethods()[0];
_t2r1m1 = _t2r1.getMethods()[0];
_t2r2m3 = _t2r2.getMethods()[0];
}
-
+
protected void setUp() throws Exception
{
super.setUp();
}
-
+
public void testExists_T3R2()
throws JavaModelException
{
@@ -141,17 +141,17 @@ public class TypeHelperTest004 extends FileBasedModelTest
{
IMethod[] expected = new IMethod[] {_t2r1m1, _t1r1m3, _c1m2 };
IMethod[] actual = TypeHelper.getRoleMethodsComplete(_t3r1);
-
+
assertTrue( compareMethods(expected, actual) );
}
-
+
public void testGetInheritedRoleMethods_MixedHierarchy2() throws JavaModelException
{
IMethod[] expected = new IMethod[] {_t2r1m1, _t2r2m3, _c1m2};
IMethod[] actual = TypeHelper.getRoleMethodsComplete(_t3r2);
-
+
assertTrue( compareMethods(expected, actual) );
}
-
-
+
+
} \ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internalrole/AllInternalBoundToOrdinaryRoleTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internalrole/AllInternalBoundToOrdinaryRoleTests.java
index cc545ffaa..8f1539233 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internalrole/AllInternalBoundToOrdinaryRoleTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internalrole/AllInternalBoundToOrdinaryRoleTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -34,12 +34,12 @@ import org.eclipse.objectteams.otdt.tests.otmodel.TestDataHandler;
import org.eclipse.objectteams.otdt.tests.otmodel.TestSetting;
/**
- * @author jwloka
+ * @author jwloka
* @version $Id: AllInternalBoundToOrdinaryRoleTests.java 23494 2010-02-05 23:06:44Z stephan $
*/
public class AllInternalBoundToOrdinaryRoleTests extends TestCase
{
- public AllInternalBoundToOrdinaryRoleTests(String name)
+ public AllInternalBoundToOrdinaryRoleTests(String name)
{
super(name);
}
@@ -63,7 +63,7 @@ public class AllInternalBoundToOrdinaryRoleTests extends TestCase
org.eclipse.objectteams.otdt.tests.otmodel.role.bound.toordinary.Test5e.class
};
}
-
+
public static TestSetting getActualTestSetting()
{
return new TestSetting(
@@ -71,8 +71,8 @@ public class AllInternalBoundToOrdinaryRoleTests extends TestCase
"boundtoordinary",
"boundtoordinary.teampkg");
}
-
-
+
+
public static Test suite()
{
TestSuite ts = new TestSuite(AllInternalBoundToOrdinaryRoleTests.class.getName()) {
@@ -98,7 +98,7 @@ public class AllInternalBoundToOrdinaryRoleTests extends TestCase
try
{
TestDataHandler.addTestSetting(curTestClass, getActualTestSetting());
-
+
Method suiteMethod = curTestClass.getDeclaredMethod(
"suite", new Class[0]); //$NON-NLS-1$
Test suite = (Test) suiteMethod.invoke(null, new Object[0]);
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internalrole/AllInternalBoundToRoleRoleTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internalrole/AllInternalBoundToRoleRoleTests.java
index 1f9121930..243ec1f01 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internalrole/AllInternalBoundToRoleRoleTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internalrole/AllInternalBoundToRoleRoleTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -39,7 +39,7 @@ import org.eclipse.objectteams.otdt.tests.otmodel.TestSetting;
*/
public class AllInternalBoundToRoleRoleTests extends TestCase
{
- public AllInternalBoundToRoleRoleTests(String name)
+ public AllInternalBoundToRoleRoleTests(String name)
{
super(name);
}
@@ -51,7 +51,7 @@ public class AllInternalBoundToRoleRoleTests extends TestCase
org.eclipse.objectteams.otdt.tests.otmodel.role.bound.torole.LayeredTeamsTests.class,
};
}
-
+
public static TestSetting getActualTestSetting()
{
return new TestSetting(
@@ -59,8 +59,8 @@ public class AllInternalBoundToRoleRoleTests extends TestCase
"boundtorole",
"boundtorole.teampkg");
}
-
-
+
+
public static Test suite()
{
TestSuite ts = new TestSuite(AllInternalBoundToRoleRoleTests.class.getName()){
@@ -86,7 +86,7 @@ public class AllInternalBoundToRoleRoleTests extends TestCase
try
{
TestDataHandler.addTestSetting(curTestClass, getActualTestSetting());
-
+
Method suiteMethod = curTestClass.getDeclaredMethod(
"suite", new Class[0]); //$NON-NLS-1$
Test suite = (Test) suiteMethod.invoke(null, new Object[0]);
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internalrole/AllInternalBoundToTeamRoleTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internalrole/AllInternalBoundToTeamRoleTests.java
index 31852c015..64a9215d3 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internalrole/AllInternalBoundToTeamRoleTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internalrole/AllInternalBoundToTeamRoleTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -34,12 +34,12 @@ import org.eclipse.objectteams.otdt.tests.otmodel.TestDataHandler;
import org.eclipse.objectteams.otdt.tests.otmodel.TestSetting;
/**
- * @author jwloka
+ * @author jwloka
* @version $Id: AllInternalBoundToTeamRoleTests.java 23494 2010-02-05 23:06:44Z stephan $
*/
public class AllInternalBoundToTeamRoleTests extends TestCase
{
- public AllInternalBoundToTeamRoleTests(String name)
+ public AllInternalBoundToTeamRoleTests(String name)
{
super(name);
}
@@ -63,7 +63,7 @@ public class AllInternalBoundToTeamRoleTests extends TestCase
org.eclipse.objectteams.otdt.tests.otmodel.role.bound.toteam.Test5e.class
};
}
-
+
public static TestSetting getActualTestSetting()
{
return new TestSetting(
@@ -71,8 +71,8 @@ public class AllInternalBoundToTeamRoleTests extends TestCase
"boundtoteam",
"boundtoteam.teampkg");
}
-
-
+
+
public static Test suite()
{
TestSuite ts = new TestSuite(AllInternalBoundToTeamRoleTests.class.getName()){
@@ -98,7 +98,7 @@ public class AllInternalBoundToTeamRoleTests extends TestCase
try
{
TestDataHandler.addTestSetting(curTestClass, getActualTestSetting());
-
+
Method suiteMethod = curTestClass.getDeclaredMethod(
"suite", new Class[0]); //$NON-NLS-1$
Test suite = (Test) suiteMethod.invoke(null, new Object[0]);
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internalrole/AllInternalUnboundRoleTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internalrole/AllInternalUnboundRoleTests.java
index 72db6aec4..9ee92ade9 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internalrole/AllInternalUnboundRoleTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internalrole/AllInternalUnboundRoleTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -34,16 +34,16 @@ import org.eclipse.objectteams.otdt.tests.otmodel.TestDataHandler;
import org.eclipse.objectteams.otdt.tests.otmodel.TestSetting;
/**
- * @author jwloka
+ * @author jwloka
* @version $Id: AllInternalUnboundRoleTests.java 23494 2010-02-05 23:06:44Z stephan $
*/
public class AllInternalUnboundRoleTests extends TestCase
{
- public AllInternalUnboundRoleTests(String name)
+ public AllInternalUnboundRoleTests(String name)
{
super(name);
}
-
+
public static Class[] getAllTestClasses()
{
return new Class[]
@@ -66,8 +66,8 @@ public class AllInternalUnboundRoleTests extends TestCase
"unbound",
"unbound.teampkg");
}
-
-
+
+
public static Test suite()
{
TestSuite ts = new TestSuite(AllInternalUnboundRoleTests.class.getName()) {
@@ -93,7 +93,7 @@ public class AllInternalUnboundRoleTests extends TestCase
try
{
TestDataHandler.addTestSetting(curTestClass, getActualTestSetting());
-
+
Method suiteMethod = curTestClass.getDeclaredMethod(
"suite", new Class[0]); //$NON-NLS-1$
Test suite = (Test) suiteMethod.invoke(null, new Object[0]);
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internalrole/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internalrole/AllTests.java
index 1025465f5..fb84b9d63 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internalrole/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/internalrole/AllTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -27,7 +27,7 @@ import junit.framework.TestSuite;
/**
* Enter a class description here!
- *
+ *
* @author jwloka
* @version $Id: AllTests.java 23494 2010-02-05 23:06:44Z stephan $
*/
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test1.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test1.java
index 851da3466..f30784e9c 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test1.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test1.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -56,65 +56,65 @@ public class Test1 extends RetargetableFileBasedModelTest
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
super.setUpSuite();
getTestSetting().setTeamClass("Team_1");
}
-
+
protected void setUp() throws Exception
{
super.setUp();
getTestSetting().setUp();
}
-
+
public void testExistenceOfTypesInJavaModel() throws JavaModelException
{
assertNotNull(getTestSetting().getTeamJavaElement());
assertTrue(getTestSetting().getTeamJavaElement().exists());
-
+
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
}
-
+
public void testExistenceofTypeInOTModel() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(getTestSetting().getRoleJavaElement());
assertNotNull(roleOTElem);
}
-
+
public void testRoleProperty() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(getTestSetting().getRoleJavaElement());
assertNotNull(roleOTElem);
-
+
assertTrue(roleOTElem.isRole());
assertTrue(roleOTElem instanceof IRoleType);
}
-
+
public void testRelationTeamToRole() throws JavaModelException
{
assertNotNull(getTestSetting().getTeamJavaElement());
assertTrue(getTestSetting().getTeamJavaElement().exists());
-
+
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IOTType teamOTElem = OTModelManager.getOTElement(getTestSetting().getTeamJavaElement());
assertNotNull(teamOTElem);
-
+
IOTType roleOTElem = OTModelManager.getOTElement(getTestSetting().getRoleJavaElement());
assertNotNull(roleOTElem);
//{OTModelUpdate
IJavaElement[] childrenOfTeam = teamOTElem.getRoleTypes();
-//haebor}
+//haebor}
assertNotNull(childrenOfTeam);
assertEquals(1, childrenOfTeam.length);
assertEquals(childrenOfTeam[0].getElementName(), roleOTElem.getElementName());
@@ -122,33 +122,33 @@ public class Test1 extends RetargetableFileBasedModelTest
// FIXME(SH): check whether there is any use in supporting getInnerTypes()
////{OTModelUpdate
// IType[] innerTypesOfTeam = teamOTElem.getInnerTypes();
-////haebor}
+////haebor}
// assertNotNull(innerTypesOfTeam);
// assertTrue(innerTypesOfTeam.length == 1);
// assertEquals(innerTypesOfTeam[0].getElementName(), roleOTElem.getElementName());
}
-
+
public void testRelationRoleToTeam() throws JavaModelException
{
assertNotNull(getTestSetting().getTeamJavaElement());
assertTrue(getTestSetting().getTeamJavaElement().exists());
-
+
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IOTType teamOTElem = OTModelManager.getOTElement(getTestSetting().getTeamJavaElement());
assertNotNull(teamOTElem);
-
+
IOTType roleOTElem = OTModelManager.getOTElement(getTestSetting().getRoleJavaElement());
assertNotNull(roleOTElem);
assertTrue(roleOTElem instanceof IRoleType);
IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
-
+
assertEquals(roleRoleOTElem.getTeamJavaType(), teamOTElem.getCorrespondingJavaElement());
assertEquals(roleRoleOTElem.getTeam(), teamOTElem);
}
-
+
public void testRelationRoleToBase() throws JavaModelException
{
// TODO(jwl): Resource access hardcoded here!
@@ -157,13 +157,13 @@ public class Test1 extends RetargetableFileBasedModelTest
"boundtoordinary",
"boundtoordinary.basepkg",
"SampleBase.java");
-
+
IType baseJavaElem = baseUnit.getType("SampleBase");
assertNotNull(baseJavaElem);
- assertTrue(baseJavaElem.exists());
-
+ assertTrue(baseJavaElem.exists());
+
IType curRole = getTestSetting().getRoleJavaElement();
-
+
assertNotNull(curRole);
assertTrue(curRole.exists());
@@ -173,5 +173,5 @@ public class Test1 extends RetargetableFileBasedModelTest
IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
assertEquals(baseJavaElem, roleRoleOTElem.getBaseClass());
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test2.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test2.java
index 8309dc009..ca4ab0186 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test2.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test2.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -36,7 +36,7 @@ import org.eclipse.jdt.core.JavaModelException;
public class Test2 extends Test1
{
private final String FIELD_NAME = "roleAttr";
-
+
public Test2(String name)
{
super(name);
@@ -52,13 +52,13 @@ public class Test2 extends Test1
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
super.setUpSuite();
getTestSetting().setTeamClass("Team_2");
}
-
+
public void testContainmentOfAttributInRoleClass() throws JavaModelException
{
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test3a.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test3a.java
index 7c3e7081f..b8cd14d7d 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test3a.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test3a.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -36,8 +36,8 @@ import org.eclipse.jdt.core.JavaModelException;
*/
public class Test3a extends Test1
{
- protected final String METHOD_NAME = "roleMethod";
-
+ protected final String METHOD_NAME = "roleMethod";
+
public Test3a(String name)
{
super(name);
@@ -53,13 +53,13 @@ public class Test3a extends Test1
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
super.setUpSuite();
getTestSetting().setTeamClass("Team_3a");
}
-
+
public void testContainmentOfMethodInRoleClass() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
@@ -67,6 +67,6 @@ public class Test3a extends Test1
IMethod method = getTestSetting().getRoleJavaElement().getMethod(METHOD_NAME, new String[0]);
assertNotNull(method);
- assertTrue(method.exists());
+ assertTrue(method.exists());
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test3b.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test3b.java
index 323b419c8..7709d26bc 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test3b.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test3b.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -37,8 +37,8 @@ import org.eclipse.jdt.core.JavaModelException;
public class Test3b extends Test3a
{
private final String PARA_NAME = "paraObj";
- private final String PARA_TYPE = "QString;";
-
+ private final String PARA_TYPE = "QString;";
+
public Test3b(String name)
{
super(name);
@@ -59,7 +59,7 @@ public class Test3b extends Test3a
super.setUpSuite();
getTestSetting().setTeamClass("Team_3b");
}
-
+
public void testInputParameterOfMethodInRoleClass() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
@@ -68,19 +68,19 @@ public class Test3b extends Test3a
IMethod method = getTestSetting().getRoleJavaElement().getMethod(METHOD_NAME, new String[] { PARA_TYPE });
assertNotNull(method);
assertTrue(method.exists());
-
+
int numOfParas = method.getNumberOfParameters();
assertTrue(numOfParas == 1);
-
+
String[] paraNames = method.getParameterNames();
assertTrue(paraNames.length == 1);
assertEquals(paraNames[0], PARA_NAME);
-
+
String[] paraTypes = method.getParameterTypes();
assertTrue(paraTypes.length == 1);
assertEquals(paraTypes[0], PARA_TYPE);
}
-
+
public void testContainmentOfMethodInRoleClass() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
@@ -88,6 +88,6 @@ public class Test3b extends Test3a
IMethod method = getTestSetting().getRoleJavaElement().getMethod(METHOD_NAME, new String[] { PARA_TYPE });
assertNotNull(method);
- assertTrue(method.exists());
+ assertTrue(method.exists());
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test3c.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test3c.java
index 83f302e31..96049401d 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test3c.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test3c.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -36,7 +36,7 @@ import org.eclipse.jdt.core.JavaModelException;
*/
public class Test3c extends Test3a
{
- private final String RETURN_TYPE = "QString;";
+ private final String RETURN_TYPE = "QString;";
public Test3c(String name)
{
@@ -53,13 +53,13 @@ public class Test3c extends Test3a
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
super.setUpSuite();
getTestSetting().setTeamClass("Team_3c");
}
-
+
public void testOutputParameterOfMethod() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
@@ -68,7 +68,7 @@ public class Test3c extends Test3a
IMethod method = getTestSetting().getRoleJavaElement().getMethod(METHOD_NAME, new String[0]);
assertNotNull(method);
assertTrue(method.exists());
-
+
String returnType = method.getReturnType();
assertEquals(returnType, RETURN_TYPE);
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test3d.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test3d.java
index 1252d852b..5b8ab2d63 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test3d.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test3d.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -37,8 +37,8 @@ import org.eclipse.jdt.core.JavaModelException;
public class Test3d extends Test3a
{
private final String METHOD_NAME = "roleMethod";
- private final String EXC_TYPE = "QException;";
-
+ private final String EXC_TYPE = "QException;";
+
public Test3d(String name)
{
super(name);
@@ -54,7 +54,7 @@ public class Test3d extends Test3a
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
super.setUpSuite();
@@ -69,7 +69,7 @@ public class Test3d extends Test3a
IMethod method = getTestSetting().getRoleJavaElement().getMethod(METHOD_NAME, new String[0]);
assertNotNull(method);
assertTrue(method.exists());
-
+
String[] exceptionTypes = method.getExceptionTypes();
assertTrue(exceptionTypes.length == 1);
assertEquals(exceptionTypes[0], EXC_TYPE);
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test4a.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test4a.java
index 138c56da3..2adb06217 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test4a.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test4a.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -40,7 +40,7 @@ public class Test4a extends Test1
{
return "AnInnerClass";
}
-
+
public Test4a(String name)
{
super(name);
@@ -56,7 +56,7 @@ public class Test4a extends Test1
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
super.setUpSuite();
@@ -67,9 +67,9 @@ public class Test4a extends Test1
{
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IType innerclass = getTestSetting().getRoleJavaElement().getType(getInnerclassName());
assertNotNull(innerclass);
assertTrue(innerclass.exists());
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test4b.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test4b.java
index d7295b51b..2b738423f 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test4b.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test4b.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -58,38 +58,38 @@ public class Test4b extends Test4a
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
super.setUpSuite();
getTestSetting().setTeamClass("Team_4b");
}
-
+
public void testExistenceOfInnerclassInOTModel() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IType innerclass = getTestSetting().getRoleJavaElement().getType(getInnerclassName());
assertNotNull(innerclass);
assertTrue(innerclass.exists());
-
+
IOTType innerclassOTElem = OTModelManager.getOTElement(innerclass);
- assertNotNull(innerclassOTElem);
+ assertNotNull(innerclassOTElem);
}
-
+
public void testTeamPropertyOfInnerclass() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IType innerclass = getTestSetting().getRoleJavaElement().getType(getInnerclassName());
assertNotNull(innerclass);
assertTrue(innerclass.exists());
-
+
IOTType innerclassOTElem = OTModelManager.getOTElement(innerclass);
assertNotNull(innerclassOTElem);
-
+
assertTrue(innerclassOTElem.isTeam());
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test5_MethodMappingGeneral.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test5_MethodMappingGeneral.java
index 28b6d92b2..af440f8da 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test5_MethodMappingGeneral.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test5_MethodMappingGeneral.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -40,35 +40,35 @@ import org.eclipse.objectteams.otdt.core.OTModelManager;
public abstract class Test5_MethodMappingGeneral extends Test1
{
private String _roleMethodName = "roleMethod";
- private String _baseMethodName = "baseMethod";
+ private String _baseMethodName = "baseMethod";
private String _mappingName;
-
+
public Test5_MethodMappingGeneral(String name)
{
super(name);
}
-
+
protected String getMappingName()
{
return _mappingName;
}
-
+
protected String getRoleMethodName()
{
return _roleMethodName;
}
-
+
protected String getBaseMethodName()
{
return _baseMethodName;
}
-
+
protected void setMappingName(String mappingName)
{
_mappingName = mappingName;
}
-
-
+
+
public void testContainmentOfMethodInRoleClass() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
@@ -76,46 +76,46 @@ public abstract class Test5_MethodMappingGeneral extends Test1
IMethod method = getTestSetting().getRoleJavaElement().getMethod(getRoleMethodName(), new String[0]);
assertNotNull(method);
- assertTrue(method.exists());
+ assertTrue(method.exists());
}
-
-
+
+
public void testExistenceOfMethodMapping() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(getTestSetting().getRoleJavaElement());
assertNotNull(roleOTElem);
assertTrue(roleOTElem instanceof IRoleType);
- IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
+ IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
IMethodMapping[] mappings = roleRoleOTElem.getMethodMappings();
assertTrue(mappings.length == 1);
assertEquals(mappings[0].getElementName(), getMappingName());
}
-
+
public void testMappingPropertyBoundRoleMethod() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(getTestSetting().getRoleJavaElement());
assertNotNull(roleOTElem);
assertTrue(roleOTElem instanceof IRoleType);
- IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
+ IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
IMethodMapping[] mappings = roleRoleOTElem.getMethodMappings();
assertTrue(mappings.length == 1);
-
+
IMethod roleMethod = getTestSetting().getRoleJavaElement().getMethod(getRoleMethodName(), new String[0]);
assertNotNull(roleMethod);
assertTrue(roleMethod.exists());
-
+
IMethod boundRoleMethod = mappings[0].getRoleMethod();
assertNotNull(boundRoleMethod);
assertTrue(roleMethod.exists());
-
+
assertEquals(boundRoleMethod, roleMethod);
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test5a.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test5a.java
index 9a659e272..bec741d81 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test5a.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test5a.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -66,25 +66,25 @@ public class Test5a extends Test5_MethodMappingGeneral
super.setUpSuite();
getTestSetting().setTeamClass("Team_5a");
}
-
+
public void testMappingCalloutProperty() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(getTestSetting().getRoleJavaElement());
assertNotNull(roleOTElem);
assertTrue(roleOTElem instanceof IRoleType);
- IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
+ IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
IMethodMapping[] mappings = roleRoleOTElem.getMethodMappings();
assertTrue(mappings.length == 1);
-
+
assertTrue(mappings[0].getMappingKind() == IOTJavaElement.CALLOUT_MAPPING);
assertTrue(mappings[0] instanceof ICalloutMapping);
}
-
-
+
+
public void testMappingPropertyBoundBaseMethod() throws JavaModelException
{
// TODO(jwl): Resource access hardcoded here!
@@ -93,31 +93,31 @@ public class Test5a extends Test5_MethodMappingGeneral
"boundtoordinary",
"boundtoordinary.basepkg",
"SampleBase.java");
-
+
IType baseJavaElem = baseUnit.getType("SampleBase");
assertNotNull(baseJavaElem);
assertTrue(baseJavaElem.exists());
-
+
IMethod baseMethod = baseJavaElem.getMethod(getBaseMethodName(), new String[0]);
assertNotNull(baseMethod);
assertTrue(baseMethod.exists());
-
+
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(getTestSetting().getRoleJavaElement());
assertNotNull(roleOTElem);
assertTrue(roleOTElem instanceof IRoleType);
IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
-
+
IMethodMapping[] mappings = roleRoleOTElem.getMethodMappings();
assertTrue(mappings.length == 1);
assertTrue(mappings[0] instanceof ICalloutMapping);
-
+
ICalloutMapping calloutMapping = (ICalloutMapping) mappings[0];
assertNotNull(calloutMapping);
IMethod boundBaseMethod = calloutMapping.getBoundBaseMethod();
-
+
assertEquals(boundBaseMethod, baseMethod);
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test5b.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test5b.java
index 01a74e750..bd371f675 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test5b.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test5b.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -32,13 +32,13 @@ import junit.framework.Test;
* and the role class is bound to a baseclass
*/
-//TODO (kaschja) test special properties of "=>"-MethodMappings by the time there is a distinction between "->" and "=>" in the OT-model
+//TODO (kaschja) test special properties of "=>"-MethodMappings by the time there is a distinction between "->" and "=>" in the OT-model
public class Test5b extends Test5a
{
public Test5b(String name)
{
super(name);
-//TODO (kaschja) replace "->" by "=>" by the time there is a distinction between them in the OT-model
+//TODO (kaschja) replace "->" by "=>" by the time there is a distinction between them in the OT-model
setMappingName("roleMethod -> baseMethod");
}
@@ -52,13 +52,13 @@ public class Test5b extends Test5a
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
super.setUpSuite();
getTestSetting().setTeamClass("Team_5b");
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test5c.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test5c.java
index f20cc2158..c55416f13 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test5c.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test5c.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -45,7 +45,7 @@ import org.eclipse.objectteams.otdt.core.OTModelManager;
public class Test5c extends Test5_MethodMappingGeneral
{
private int _expectedCallinKind;
-
+
public Test5c(String name)
{
super(name);
@@ -69,38 +69,38 @@ public class Test5c extends Test5_MethodMappingGeneral
super.setUpSuite();
getTestSetting().setTeamClass("Team_5c");
}
-
-
+
+
protected int getExpectedCallinKind()
{
return _expectedCallinKind;
}
-
+
protected void setExpectedCallinKind(int kind)
{
_expectedCallinKind = kind;
}
-
+
public void testMappingCallinProperty() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(getTestSetting().getRoleJavaElement());
assertNotNull(roleOTElem);
assertTrue(roleOTElem instanceof IRoleType);
- IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
+ IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
IMethodMapping[] mappings = roleRoleOTElem.getMethodMappings();
assertTrue(mappings.length == 1);
assertEquals(mappings[0].getElementName(), getMappingName());
-
+
assertTrue(mappings[0].getMappingKind() == IOTJavaElement.CALLIN_MAPPING);
assertTrue(mappings[0] instanceof ICallinMapping);
}
-
-
+
+
public void testMappingPropertyBoundBaseMethod() throws JavaModelException
{
// TODO(jwl): Resource access hardcoded here!
@@ -109,53 +109,53 @@ public class Test5c extends Test5_MethodMappingGeneral
"boundtoordinary",
"boundtoordinary.basepkg",
"SampleBase.java");
-
+
IType baseJavaElem = baseUnit.getType("SampleBase");
assertNotNull(baseJavaElem);
assertTrue(baseJavaElem.exists());
-
+
IMethod baseMethod = baseJavaElem.getMethod(getBaseMethodName(), new String[0]);
assertNotNull(baseMethod);
assertTrue(baseMethod.exists());
-
+
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(getTestSetting().getRoleJavaElement());
assertNotNull(roleOTElem);
assertTrue(roleOTElem instanceof IRoleType);
IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
-
+
IMethodMapping[] mappings = roleRoleOTElem.getMethodMappings();
assertTrue(mappings.length == 1);
assertTrue(mappings[0] instanceof ICallinMapping);
-
+
ICallinMapping callinMapping = (ICallinMapping) mappings[0];
assertNotNull(callinMapping);
IMethod[] boundBaseMethods = callinMapping.getBoundBaseMethods();
-
+
assertTrue(boundBaseMethods.length == 1);
assertEquals(boundBaseMethods[0], baseMethod);
}
-
+
public void testCallinKind() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(getTestSetting().getRoleJavaElement());
assertNotNull(roleOTElem);
assertTrue(roleOTElem instanceof IRoleType);
- IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
+ IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
IMethodMapping[] mappings = roleRoleOTElem.getMethodMappings();
assertTrue(mappings.length == 1);
assertEquals(mappings[0].getElementName(), getMappingName());
-
+
assertTrue(mappings[0] instanceof ICallinMapping);
ICallinMapping callinMapping = (ICallinMapping) mappings[0];
-
+
assertTrue(callinMapping.getCallinKind() == getExpectedCallinKind());
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test5d.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test5d.java
index 329808f2b..bdea67507 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test5d.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test5d.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -51,7 +51,7 @@ public class Test5d extends Test5c
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
super.setUpSuite();
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test5e.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test5e.java
index 98bfa40c1..68472607a 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test5e.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toordinary/Test5e.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -51,7 +51,7 @@ public class Test5e extends Test5c
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
super.setUpSuite();
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/torole/LayeredTeamsTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/torole/LayeredTeamsTests.java
index 25cd897b4..80aad0b49 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/torole/LayeredTeamsTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/torole/LayeredTeamsTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -59,19 +59,19 @@ public class LayeredTeamsTests extends RetargetableFileBasedModelTest
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
super.setUpSuite();
}
-
+
public void testFieldAnchor() throws Exception
{
getTestSetting().setTeamClass("Team_1");
getTestSetting().setUp();
performTest("TeamB.java", "TeamB", getTestSetting().getRoleJavaElement());
}
-
+
/** Same as above but using old path syntax. */
public void testFieldAnchorPath() throws Exception
{
@@ -79,15 +79,15 @@ public class LayeredTeamsTests extends RetargetableFileBasedModelTest
getTestSetting().setUp();
performTest("TeamB.java", "TeamB", getTestSetting().getRoleJavaElement());
}
-
-
+
+
public void testBaseAnchor() throws Exception
{
getTestSetting().setTeamClass("Team_2");
getTestSetting().setUp();
performTest("TeamB.java", "TeamB", getAndTestInnerRole());
}
-
+
/** Same as above but using old path syntax. */
public void testBaseAnchorPath() throws Exception
{
@@ -95,7 +95,7 @@ public class LayeredTeamsTests extends RetargetableFileBasedModelTest
getTestSetting().setUp();
performTest("TeamB.java", "TeamB", getAndTestInnerRole());
}
-
+
public void testQualifiedBaseAnchor() throws Exception
{
getTestSetting().setTeamClass("Team_3");
@@ -103,7 +103,7 @@ public class LayeredTeamsTests extends RetargetableFileBasedModelTest
performTest("TeamB.java", "TeamB", getAndTestInnerRole());
}
// no path variant of Team_3: path syntax "SampleRole.base.LowerRole" is illegal.
-
+
// witness for IllegalArgumentException in Signature.appendTypeSignature(char[], int, boolean, StringBuffer, boolean)
// requires capability to handle type anchors in char-encoded signatures
public void testAnchoredCalloutSignature() throws Exception
@@ -113,14 +113,14 @@ public class LayeredTeamsTests extends RetargetableFileBasedModelTest
performTest("TeamB.java", "TeamB", getTestSetting().getRoleJavaElement());
for (IJavaElement member : _roleOTElem.getChildren()) {
if (member.getElementType() == IOTJavaElement.CALLOUT_MAPPING) {
- assertEquals("Callout signature not as expected",
+ assertEquals("Callout signature not as expected",
"isEqual(LowerRole<@teamB>) -> isEqual(LowerRole<@teamB>)",
member.getElementName());
}
}
}
-
+
private IType getAndTestInnerRole() throws JavaModelException {
IType roleMid= getTestSetting().getRoleJavaElement();
assertTrue(roleMid.exists());
@@ -131,10 +131,10 @@ public class LayeredTeamsTests extends RetargetableFileBasedModelTest
assertEquals(type.getElementName(), "InnerRole");
return type;
}
-
-
-
- void performTest(String baseCU, String baseTeam, IType roleJavaElement)
+
+
+
+ void performTest(String baseCU, String baseTeam, IType roleJavaElement)
throws JavaModelException
{
ICompilationUnit baseUnit = getCompilationUnit(
@@ -149,9 +149,9 @@ public class LayeredTeamsTests extends RetargetableFileBasedModelTest
assertTrue("first child should be the role (IType)", baseChildren[0] instanceof IType);
IType baseJavaElem= (IType) baseChildren[0];
assertNotNull(baseJavaElem);
- assertTrue(baseJavaElem.exists());
+ assertTrue(baseJavaElem.exists());
assertEquals(baseJavaElem.getElementName(), "LowerRole");
-
+
assertNotNull(roleJavaElement);
assertTrue(roleJavaElement.exists());
@@ -164,9 +164,9 @@ public class LayeredTeamsTests extends RetargetableFileBasedModelTest
assertNotNull(baseClassJavaElem);
assertEquals("base class should be expected lower role", baseJavaElem, baseClassJavaElem);
-
+
IOTType baseClassOTElem = OTModelManager.getOTElement(baseClassJavaElem);
assertNotNull(baseClassOTElem);
assertTrue("base class should be role", baseClassOTElem.isRole());
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test1.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test1.java
index 0bf12daa9..de6cef869 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test1.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test1.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -56,66 +56,66 @@ public class Test1 extends RetargetableFileBasedModelTest
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
getTestSetting().setTeamClass("Team_1");
super.setUpSuite();
}
-
+
protected void setUp() throws Exception
{
super.setUp();
getTestSetting().setUp();
}
-
+
public void testExistenceOfTypesInJavaModel() throws JavaModelException
{
assertNotNull(getTestSetting().getTeamJavaElement());
assertTrue(getTestSetting().getTeamJavaElement().exists());
-
+
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
}
-
+
public void testExistenceofTypeInOTModel() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(getTestSetting().getRoleJavaElement());
assertNotNull(roleOTElem);
}
-
+
public void testRoleProperty() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(getTestSetting().getRoleJavaElement());
assertNotNull(roleOTElem);
-
+
assertTrue(roleOTElem.isRole());
assertTrue(roleOTElem instanceof IRoleType);
}
-
+
public void testRelationTeamToRole() throws JavaModelException
{
assertNotNull(getTestSetting().getTeamJavaElement());
assertTrue(getTestSetting().getTeamJavaElement().exists());
-
+
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IOTType teamOTElem = OTModelManager.getOTElement(getTestSetting().getTeamJavaElement());
assertNotNull(teamOTElem);
-
+
IOTType roleOTElem = OTModelManager.getOTElement(getTestSetting().getRoleJavaElement());
assertNotNull(roleOTElem);
//{OTModelUpdate
IJavaElement[] childrenOfTeam = teamOTElem.getRoleTypes();
-//haebor}
+//haebor}
assertNotNull(childrenOfTeam);
assertEquals(1, childrenOfTeam.length);
@@ -124,33 +124,33 @@ public class Test1 extends RetargetableFileBasedModelTest
// FIXME(SH): check whether there is any use in supporting getInnerTypes()
////{OTModelUpdate
// IType[] innerTypesOfTeam = teamOTElem.getInnerTypes();
-////haebor}
+////haebor}
// assertNotNull(innerTypesOfTeam);
// assertTrue(innerTypesOfTeam.length == 1);
// assertEquals(innerTypesOfTeam[0].getElementName(), roleOTElem.getElementName());
}
-
+
public void testRelationRoleToTeam() throws JavaModelException
{
assertNotNull(getTestSetting().getTeamJavaElement());
assertTrue(getTestSetting().getTeamJavaElement().exists());
-
+
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IOTType teamOTElem = OTModelManager.getOTElement(getTestSetting().getTeamJavaElement());
assertNotNull(teamOTElem);
-
+
IOTType roleOTElem = OTModelManager.getOTElement(getTestSetting().getRoleJavaElement());
assertNotNull(roleOTElem);
assertTrue(roleOTElem instanceof IRoleType);
IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
-
+
assertEquals(roleRoleOTElem.getTeamJavaType(), teamOTElem.getCorrespondingJavaElement());
assertEquals(roleRoleOTElem.getTeam(), teamOTElem);
}
-
+
public void testRelationRoleToBase() throws JavaModelException
{
ICompilationUnit baseUnit = getCompilationUnit(
@@ -160,8 +160,8 @@ public class Test1 extends RetargetableFileBasedModelTest
"TeamB.java");
IType baseJavaElem = baseUnit.getType("TeamB");
assertNotNull(baseJavaElem);
- assertTrue(baseJavaElem.exists());
-
+ assertTrue(baseJavaElem.exists());
+
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
@@ -169,10 +169,10 @@ public class Test1 extends RetargetableFileBasedModelTest
assertNotNull(roleOTElem);
assertTrue(roleOTElem instanceof IRoleType);
IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
-
+
assertEquals(baseJavaElem, roleRoleOTElem.getBaseClass());
- }
-
+ }
+
public void testTeamPropertyOfBaseClass() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
@@ -180,13 +180,13 @@ public class Test1 extends RetargetableFileBasedModelTest
IOTType roleOTElem = OTModelManager.getOTElement(getTestSetting().getRoleJavaElement());
assertNotNull(roleOTElem);
-
+
assertTrue(roleOTElem instanceof IRoleType);
IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
-
+
IType baseClassJavaElem = roleRoleOTElem.getBaseClass();
assertNotNull(baseClassJavaElem);
-
+
IOTType baseClassOTElem = OTModelManager.getOTElement(baseClassJavaElem);
assertNotNull(baseClassOTElem);
assertTrue(baseClassOTElem.isTeam());
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test2.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test2.java
index e8ffb7999..c2221a878 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test2.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test2.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -35,11 +35,11 @@ import org.eclipse.jdt.core.JavaModelException;
*/
public class Test2 extends Test1
{
-
+
private final String FIELD_NAME = "roleAttr";
-
-
-
+
+
+
public Test2(String name)
{
super(name);
@@ -55,13 +55,13 @@ public class Test2 extends Test1
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
super.setUpSuite();
getTestSetting().setTeamClass("Team_2");
}
-
+
public void testContainmentOfAttributInRoleClass() throws JavaModelException
{
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test3a.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test3a.java
index 05c508520..139cef04a 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test3a.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test3a.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -37,8 +37,8 @@ import org.eclipse.jdt.core.JavaModelException;
public class Test3a extends Test1
{
- protected final String METHOD_NAME = "roleMethod";
-
+ protected final String METHOD_NAME = "roleMethod";
+
public Test3a(String name)
{
super(name);
@@ -54,15 +54,15 @@ public class Test3a extends Test1
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
super.setUpSuite();
getTestSetting().setTeamClass("Team_3a");
}
-
-
+
+
public void testContainmentOfMethodInRoleClass() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test3b.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test3b.java
index 794a3e108..406e50dd8 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test3b.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test3b.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -37,9 +37,9 @@ import org.eclipse.jdt.core.JavaModelException;
public class Test3b extends Test3a
{
private final String PARA_NAME = "paraObj";
- private final String PARA_TYPE = "QString;";
-
-
+ private final String PARA_TYPE = "QString;";
+
+
public Test3b(String name)
{
super(name);
@@ -55,13 +55,13 @@ public class Test3b extends Test3a
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
super.setUpSuite();
getTestSetting().setTeamClass("Team_3b");
}
-
+
public void testInputParameterOfMethodInRoleClass() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
@@ -70,19 +70,19 @@ public class Test3b extends Test3a
IMethod method = getTestSetting().getRoleJavaElement().getMethod(METHOD_NAME, new String[] { PARA_TYPE });
assertNotNull(method);
assertTrue(method.exists());
-
+
int numOfParas = method.getNumberOfParameters();
assertTrue(numOfParas == 1);
-
+
String[] paraNames = method.getParameterNames();
assertTrue(paraNames.length == 1);
assertEquals(paraNames[0], PARA_NAME);
-
+
String[] paraTypes = method.getParameterTypes();
assertTrue(paraTypes.length == 1);
assertEquals(paraTypes[0], PARA_TYPE);
}
-
+
public void testContainmentOfMethodInRoleClass() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test3c.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test3c.java
index 747d9c726..93793f17f 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test3c.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test3c.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -36,7 +36,7 @@ import org.eclipse.jdt.core.JavaModelException;
*/
public class Test3c extends Test3a
{
- private final String RETURN_TYPE = "QString;";
+ private final String RETURN_TYPE = "QString;";
public Test3c(String name)
@@ -54,13 +54,13 @@ public class Test3c extends Test3a
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
super.setUpSuite();
getTestSetting().setTeamClass("Team_3c");
}
-
+
public void testOutputParameterOfMethod() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
@@ -69,7 +69,7 @@ public class Test3c extends Test3a
IMethod method = getTestSetting().getRoleJavaElement().getMethod(METHOD_NAME, new String[0]);
assertNotNull(method);
assertTrue(method.exists());
-
+
String returnType = method.getReturnType();
assertEquals(returnType, RETURN_TYPE);
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test3d.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test3d.java
index fe7b8d84b..392c9e2ac 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test3d.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test3d.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -37,9 +37,9 @@ import org.eclipse.jdt.core.JavaModelException;
public class Test3d extends Test3a
{
private final String METHOD_NAME = "roleMethod";
- private final String EXC_TYPE = "QException;";
+ private final String EXC_TYPE = "QException;";
+
-
public Test3d(String name)
{
super(name);
@@ -70,7 +70,7 @@ public class Test3d extends Test3a
IMethod method = getTestSetting().getRoleJavaElement().getMethod(METHOD_NAME, new String[0]);
assertNotNull(method);
assertTrue(method.exists());
-
+
String[] exceptionTypes = method.getExceptionTypes();
assertTrue(exceptionTypes.length == 1);
assertEquals(exceptionTypes[0], EXC_TYPE);
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test4a.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test4a.java
index ef3165709..50e89e62c 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test4a.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test4a.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -36,12 +36,12 @@ import org.eclipse.jdt.core.JavaModelException;
*/
public class Test4a extends Test1
{
-
+
protected String getInnerclassName()
{
return "AnInnerClass";
}
-
+
public Test4a(String name)
{
super(name);
@@ -57,20 +57,20 @@ public class Test4a extends Test1
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
super.setUpSuite();
getTestSetting().setTeamClass("Team_4a");
}
-
+
public void testContainmentOfInnerclassInRoleClass() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IType innerclass = getTestSetting().getRoleJavaElement().getType(getInnerclassName());
assertNotNull(innerclass);
assertTrue(innerclass.exists());
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test4b.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test4b.java
index 15726f796..79aec875e 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test4b.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test4b.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -59,38 +59,38 @@ public class Test4b extends Test4a
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
super.setUpSuite();
getTestSetting().setTeamClass("Team_4b");
}
-
+
public void testExistenceOfInnerClassInOTModel() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IType innerclass = getTestSetting().getRoleJavaElement().getType(getInnerclassName());
assertNotNull(innerclass);
assertTrue(innerclass.exists());
-
+
IOTType innerclassOTElem = OTModelManager.getOTElement(innerclass);
- assertNotNull(innerclassOTElem);
+ assertNotNull(innerclassOTElem);
}
-
+
public void testTeamPropertyOfInnerclass() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IType innerclass = getTestSetting().getRoleJavaElement().getType(getInnerclassName());
assertNotNull(innerclass);
assertTrue(innerclass.exists());
-
+
IOTType innerclassOTElem = OTModelManager.getOTElement(innerclass);
assertNotNull(innerclassOTElem);
-
+
assertTrue(innerclassOTElem.isTeam());
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test5_MethodMappingGeneral.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test5_MethodMappingGeneral.java
index a9329b8dd..b3b45aedf 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test5_MethodMappingGeneral.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test5_MethodMappingGeneral.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -38,32 +38,32 @@ import org.eclipse.objectteams.otdt.core.OTModelManager;
*/
public abstract class Test5_MethodMappingGeneral extends Test1
{
-
+
private String _roleMethodName = "roleMethod";
- private String _baseMethodName = "baseMethod";
+ private String _baseMethodName = "baseMethod";
private String _mappingName;
-
-
+
+
public Test5_MethodMappingGeneral(String name)
{
super(name);
}
-
+
protected String getMappingName()
{
return _mappingName;
}
-
+
protected String getRoleMethodName()
{
return _roleMethodName;
}
-
+
protected String getBaseMethodName()
{
return _baseMethodName;
}
-
+
protected void setMappingName(String mappingName)
{
_mappingName = mappingName;
@@ -76,45 +76,45 @@ public abstract class Test5_MethodMappingGeneral extends Test1
IMethod method = getTestSetting().getRoleJavaElement().getMethod(getRoleMethodName(), new String[0]);
assertNotNull(method);
- assertTrue(method.exists());
+ assertTrue(method.exists());
}
-
+
public void testExistenceOfMethodMapping() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(getTestSetting().getRoleJavaElement());
assertNotNull(roleOTElem);
assertTrue(roleOTElem instanceof IRoleType);
- IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
+ IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
IMethodMapping[] mappings = roleRoleOTElem.getMethodMappings();
assertTrue(mappings.length == 1);
assertEquals(mappings[0].getElementName(), getMappingName());
}
-
+
public void testMappingPropertyBoundRoleMethod() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(getTestSetting().getRoleJavaElement());
assertNotNull(roleOTElem);
assertTrue(roleOTElem instanceof IRoleType);
- IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
+ IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
IMethodMapping[] mappings = roleRoleOTElem.getMethodMappings();
assertTrue(mappings.length == 1);
-
+
IMethod roleMethod = getTestSetting().getRoleJavaElement().getMethod(getRoleMethodName(), new String[0]);
assertNotNull(roleMethod);
assertTrue(roleMethod.exists());
-
+
IMethod boundRoleMethod = mappings[0].getRoleMethod();
assertNotNull(boundRoleMethod);
assertTrue(roleMethod.exists());
-
+
assertEquals(boundRoleMethod, roleMethod);
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test5a.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test5a.java
index 6ddfdb548..9a81ce443 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test5a.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test5a.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -61,7 +61,7 @@ public class Test5a extends Test5_MethodMappingGeneral
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
super.setUpSuite();
@@ -72,20 +72,20 @@ public class Test5a extends Test5_MethodMappingGeneral
{
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(getTestSetting().getRoleJavaElement());
assertNotNull(roleOTElem);
assertTrue(roleOTElem instanceof IRoleType);
- IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
+ IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
IMethodMapping[] mappings = roleRoleOTElem.getMethodMappings();
assertTrue(mappings.length == 1);
-
+
assertTrue(mappings[0].getMappingKind() == IOTJavaElement.CALLOUT_MAPPING);
assertTrue(mappings[0] instanceof ICalloutMapping);
}
-
-
+
+
public void testMappingPropertyBoundBaseMethod() throws JavaModelException
{
ICompilationUnit baseUnit = getCompilationUnit(
@@ -93,34 +93,34 @@ public class Test5a extends Test5_MethodMappingGeneral
"boundtoteam",
"boundtoteam.teampkg",
"TeamC.java");
-
+
IType baseJavaElem = baseUnit.getType("TeamC");
assertNotNull(baseJavaElem);
assertTrue(baseJavaElem.exists());
-
+
IMethod baseMethod = baseJavaElem.getMethod(getBaseMethodName(), new String[0]);
assertNotNull(baseMethod);
assertTrue(baseMethod.exists());
-
+
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(getTestSetting().getRoleJavaElement());
assertNotNull(roleOTElem);
assertTrue(roleOTElem instanceof IRoleType);
IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
-
+
IMethodMapping[] mappings = roleRoleOTElem.getMethodMappings();
assertTrue(mappings.length == 1);
assertTrue(mappings[0] instanceof ICalloutMapping);
-
+
ICalloutMapping calloutMapping = (ICalloutMapping) mappings[0];
assertNotNull(calloutMapping);
IMethod boundBaseMethod = calloutMapping.getBoundBaseMethod();
-
+
assertEquals(boundBaseMethod, baseMethod);
}
-
+
public void testRelationRoleToBase() throws JavaModelException
{
ICompilationUnit baseUnit = getCompilationUnit(
@@ -130,8 +130,8 @@ public class Test5a extends Test5_MethodMappingGeneral
"TeamC.java");
IType baseJavaElem = baseUnit.getType("TeamC");
assertNotNull(baseJavaElem);
- assertTrue(baseJavaElem.exists());
-
+ assertTrue(baseJavaElem.exists());
+
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
@@ -139,7 +139,7 @@ public class Test5a extends Test5_MethodMappingGeneral
assertNotNull(roleOTElem);
assertTrue(roleOTElem instanceof IRoleType);
IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
-
+
assertEquals(baseJavaElem, roleRoleOTElem.getBaseClass());
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test5b.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test5b.java
index 1e147258e..461067db1 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test5b.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test5b.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -32,14 +32,14 @@ import junit.framework.Test;
* and the role class is bound to a baseclass which is a team class
*/
-//TODO (kaschja) test special properties of "=>"-MethodMappings by the time there is a distinction between "->" and "=>" in the OT-model
+//TODO (kaschja) test special properties of "=>"-MethodMappings by the time there is a distinction between "->" and "=>" in the OT-model
public class Test5b extends Test5a
{
public Test5b(String name)
{
super(name);
-//TODO (kaschja) replace "->" by "=>" by the time there is a distinction between them in the OT-model
+//TODO (kaschja) replace "->" by "=>" by the time there is a distinction between them in the OT-model
setMappingName("roleMethod -> baseMethod");
}
@@ -53,7 +53,7 @@ public class Test5b extends Test5a
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
super.setUpSuite();
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test5c.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test5c.java
index 708caa81c..cabfbb35f 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test5c.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test5c.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -46,7 +46,7 @@ public class Test5c extends Test5_MethodMappingGeneral
{
private int _expectedCallinKind;
-
+
public Test5c(String name)
{
super(name);
@@ -64,42 +64,42 @@ public class Test5c extends Test5_MethodMappingGeneral
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
super.setUpSuite();
getTestSetting().setTeamClass("Team_5c");
}
-
+
protected int getExpectedCallinKind()
{
return _expectedCallinKind;
}
-
+
protected void setExpectedCallinKind(int kind)
{
_expectedCallinKind = kind;
}
-
+
public void testMappingCallinProperty() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(getTestSetting().getRoleJavaElement());
assertNotNull(roleOTElem);
assertTrue(roleOTElem instanceof IRoleType);
- IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
+ IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
IMethodMapping[] mappings = roleRoleOTElem.getMethodMappings();
assertTrue(mappings.length == 1);
assertEquals(mappings[0].getElementName(), getMappingName());
-
+
assertTrue(mappings[0].getMappingKind() == IOTJavaElement.CALLIN_MAPPING);
assertTrue(mappings[0] instanceof ICallinMapping);
}
-
-
+
+
public void testMappingPropertyBoundBaseMethod() throws JavaModelException
{
ICompilationUnit baseUnit = getCompilationUnit(
@@ -107,55 +107,55 @@ public class Test5c extends Test5_MethodMappingGeneral
"boundtoteam",
"boundtoteam.teampkg",
"TeamC.java");
-
+
IType baseJavaElem = baseUnit.getType("TeamC");
assertNotNull(baseJavaElem);
assertTrue(baseJavaElem.exists());
-
+
IMethod baseMethod = baseJavaElem.getMethod(getBaseMethodName(), new String[0]);
assertNotNull(baseMethod);
assertTrue(baseMethod.exists());
-
+
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(getTestSetting().getRoleJavaElement());
assertNotNull(roleOTElem);
assertTrue(roleOTElem instanceof IRoleType);
IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
-
+
IMethodMapping[] mappings = roleRoleOTElem.getMethodMappings();
assertTrue(mappings.length == 1);
assertTrue(mappings[0] instanceof ICallinMapping);
-
+
ICallinMapping callinMapping = (ICallinMapping) mappings[0];
assertNotNull(callinMapping);
IMethod[] boundBaseMethods = callinMapping.getBoundBaseMethods();
-
+
assertTrue(boundBaseMethods.length == 1);
assertEquals(boundBaseMethods[0], baseMethod);
}
-
+
public void testCallinKind() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(getTestSetting().getRoleJavaElement());
assertNotNull(roleOTElem);
assertTrue(roleOTElem instanceof IRoleType);
- IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
+ IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
IMethodMapping[] mappings = roleRoleOTElem.getMethodMappings();
assertTrue(mappings.length == 1);
assertEquals(mappings[0].getElementName(), getMappingName());
-
+
assertTrue(mappings[0] instanceof ICallinMapping);
ICallinMapping callinMapping = (ICallinMapping) mappings[0];
-
+
assertTrue(callinMapping.getCallinKind() == getExpectedCallinKind());
}
-
+
public void testRelationRoleToBase() throws JavaModelException
{
ICompilationUnit baseUnit = getCompilationUnit(
@@ -165,8 +165,8 @@ public class Test5c extends Test5_MethodMappingGeneral
"TeamC.java");
IType baseJavaElem = baseUnit.getType("TeamC");
assertNotNull(baseJavaElem);
- assertTrue(baseJavaElem.exists());
-
+ assertTrue(baseJavaElem.exists());
+
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
@@ -174,8 +174,8 @@ public class Test5c extends Test5_MethodMappingGeneral
assertNotNull(roleOTElem);
assertTrue(roleOTElem instanceof IRoleType);
IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
-
+
assertEquals(baseJavaElem, roleRoleOTElem.getBaseClass());
- }
-
+ }
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test5d.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test5d.java
index e90ef3e90..e5926a63e 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test5d.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test5d.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -35,7 +35,7 @@ import org.eclipse.objectteams.otdt.core.ICallinMapping;
*/
public class Test5d extends Test5c
{
-
+
public Test5d(String name)
{
super(name);
@@ -52,7 +52,7 @@ public class Test5d extends Test5c
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
super.setUpSuite();
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test5e.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test5e.java
index 961b62c16..ece52cfd5 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test5e.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/bound/toteam/Test5e.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -52,7 +52,7 @@ public class Test5e extends Test5c
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
super.setUpSuite();
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test1.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test1.java
index d39f3ce29..a59f86bd9 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test1.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test1.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -55,66 +55,66 @@ public class Test1 extends RetargetableFileBasedModelTest
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
super.setUpSuite();
getTestSetting().setTeamClass("Team_1");
}
-
+
protected void setUp() throws Exception
{
super.setUp();
getTestSetting().setUp();
}
-
+
public void testExistenceOfTypesInJavaModel() throws JavaModelException
{
assertNotNull(getTestSetting().getTeamJavaElement());
assertTrue(getTestSetting().getTeamJavaElement().exists());
-
+
assertNotNull(getTestSetting().getRoleJavaElement());
- assertTrue(getTestSetting().getRoleJavaElement().exists());
+ assertTrue(getTestSetting().getRoleJavaElement().exists());
}
-
+
public void testExistenceofTypeInOTModel() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(getTestSetting().getRoleJavaElement());
assertNotNull(roleOTElem);
}
-
+
public void testRoleProperty() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(getTestSetting().getRoleJavaElement());
assertNotNull(roleOTElem);
-
+
assertTrue(roleOTElem.isRole());
assertTrue(roleOTElem instanceof IRoleType);
}
-
+
public void testRelationTeamToRole() throws JavaModelException
{
assertNotNull(getTestSetting().getTeamJavaElement());
assertTrue(getTestSetting().getTeamJavaElement().exists());
-
+
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IOTType teamOTElem = OTModelManager.getOTElement(getTestSetting().getTeamJavaElement());
assertNotNull(teamOTElem);
-
+
IOTType roleOTElem = OTModelManager.getOTElement(getTestSetting().getRoleJavaElement());
assertNotNull(roleOTElem);
//{OTModelUpdate
IJavaElement[] childrenOfTeam = teamOTElem.getChildren();
-//haebor}
+//haebor}
assertNotNull(childrenOfTeam);
if (roleOTElem instanceof IRoleFileType) // role files are not members of the team!
assertTrue(childrenOfTeam.length == 0);
@@ -123,11 +123,11 @@ public class Test1 extends RetargetableFileBasedModelTest
assertEquals(childrenOfTeam[0].getElementName(), roleOTElem.getElementName());
}
-//{OTModelUpdate
+//{OTModelUpdate
IType[] innerTypesOfTeam = teamOTElem.getInnerTypes();
-//haebor}
+//haebor}
assertNotNull(innerTypesOfTeam);
-
+
if (roleOTElem instanceof IRoleFileType) // role files are not members of the team!
assertTrue(innerTypesOfTeam.length == 0);
else {
@@ -135,24 +135,24 @@ public class Test1 extends RetargetableFileBasedModelTest
assertEquals(innerTypesOfTeam[0].getElementName(), roleOTElem.getElementName());
}
}
-
+
public void testRelationRoleToTeam() throws JavaModelException
{
assertNotNull(getTestSetting().getTeamJavaElement());
assertTrue(getTestSetting().getTeamJavaElement().exists());
-
+
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IOTType teamOTElem = OTModelManager.getOTElement(getTestSetting().getTeamJavaElement());
assertNotNull(teamOTElem);
-
+
IOTType roleOTElem = OTModelManager.getOTElement(getTestSetting().getRoleJavaElement());
assertNotNull(roleOTElem);
assertTrue(roleOTElem instanceof IRoleType);
IRoleType roleRoleOTElem = (IRoleType) roleOTElem;
-
+
assertEquals(roleRoleOTElem.getTeam(), teamOTElem);
if (roleRoleOTElem instanceof IRoleFileType) {
assertFalse(roleRoleOTElem.getParent().equals(teamOTElem)); // role file has CU as parent
@@ -161,20 +161,20 @@ public class Test1 extends RetargetableFileBasedModelTest
assertEquals(roleRoleOTElem.getParent(), teamOTElem);
}
}
-
+
public void testGetRoles() throws JavaModelException
{
assertNotNull(getTestSetting().getTeamJavaElement());
assertTrue(getTestSetting().getTeamJavaElement().exists());
-
+
IOTType teamOTElem = OTModelManager.getOTElement(getTestSetting().getTeamJavaElement());
assertNotNull(teamOTElem);
IType[] actual = teamOTElem.getRoleTypes();
IType[] expected = getTestSetting().getRoleJavaElements();
-
+
assertEquals("Different number of roles!", expected.length, actual.length);
assertTrue("Different set of roles!", compareTypes(expected, actual));
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test2.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test2.java
index 0f6642270..47ffc74e5 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test2.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test2.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -57,7 +57,7 @@ public class Test2 extends Test1
super.setUpSuite();
getTestSetting().setTeamClass("Team_2");
}
-
+
public void testContainmentOfAttributInRoleClass() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test3a.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test3a.java
index fa8252b7d..bab099fa7 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test3a.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test3a.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -36,8 +36,8 @@ import org.eclipse.jdt.core.JavaModelException;
public class Test3a extends Test1
{
- protected final String METHOD_NAME = "roleMethod";
-
+ protected final String METHOD_NAME = "roleMethod";
+
public Test3a(String name)
{
super(name);
@@ -53,13 +53,13 @@ public class Test3a extends Test1
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
super.setUpSuite();
getTestSetting().setTeamClass("Team_3a");
}
-
+
public void testContainmentOfMethodInRoleClass() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
@@ -67,6 +67,6 @@ public class Test3a extends Test1
IMethod method = getTestSetting().getRoleJavaElement().getMethod(METHOD_NAME, new String[0]);
assertNotNull(method);
- assertTrue(method.exists());
+ assertTrue(method.exists());
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test3b.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test3b.java
index 3ae13ff48..c5c9d8d9b 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test3b.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test3b.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -36,9 +36,9 @@ import org.eclipse.jdt.core.JavaModelException;
public class Test3b extends Test3a
{
private final String PARA_NAME = "paraObj";
- private final String PARA_TYPE = "QString;";
-
-
+ private final String PARA_TYPE = "QString;";
+
+
public Test3b(String name)
{
super(name);
@@ -54,36 +54,36 @@ public class Test3b extends Test3a
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
super.setUpSuite();
getTestSetting().setTeamClass("Team_3b");
}
-
+
public void testInputParameterOfMethodInRoleClass() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
- IMethod method =
+ IMethod method =
getTestSetting().getRoleJavaElement().
getMethod(METHOD_NAME, new String[] {PARA_TYPE});
assertNotNull(method);
assertTrue(method.exists());
-
+
int numOfParas = method.getNumberOfParameters();
assertTrue(numOfParas == 1);
-
+
String[] paraNames = method.getParameterNames();
assertTrue(paraNames.length == 1);
assertEquals(paraNames[0], PARA_NAME);
-
+
String[] paraTypes = method.getParameterTypes();
assertTrue(paraTypes.length == 1);
assertEquals(paraTypes[0], PARA_TYPE);
}
-
+
public void testContainmentOfMethodInRoleClass() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
@@ -91,7 +91,7 @@ public class Test3b extends Test3a
IMethod method = getTestSetting().getRoleJavaElement().getMethod(METHOD_NAME, new String[] {PARA_TYPE});
assertNotNull(method);
- assertTrue(method.exists());
+ assertTrue(method.exists());
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test3c.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test3c.java
index 1fb3e54f8..e0f1cf629 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test3c.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test3c.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -35,7 +35,7 @@ import org.eclipse.jdt.core.JavaModelException;
*/
public class Test3c extends Test3a
{
- private final String RETURN_TYPE = "QString;";
+ private final String RETURN_TYPE = "QString;";
public Test3c(String name)
@@ -59,7 +59,7 @@ public class Test3c extends Test3a
super.setUpSuite();
getTestSetting().setTeamClass("Team_3c");
}
-
+
public void testOutputParameterOfMethod() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
@@ -68,7 +68,7 @@ public class Test3c extends Test3a
IMethod method = getTestSetting().getRoleJavaElement().getMethod(METHOD_NAME, new String[0]);
assertNotNull(method);
assertTrue(method.exists());
-
+
String returnType = method.getReturnType();
assertEquals(returnType, RETURN_TYPE);
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test3d.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test3d.java
index 88ed456e8..c935d1dd6 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test3d.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test3d.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -36,9 +36,9 @@ import org.eclipse.jdt.core.JavaModelException;
public class Test3d extends Test3a
{
private final String METHOD_NAME = "roleMethod";
- private final String EXC_TYPE = "QException;";
+ private final String EXC_TYPE = "QException;";
+
-
public Test3d(String name)
{
super(name);
@@ -54,7 +54,7 @@ public class Test3d extends Test3a
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
super.setUpSuite();
@@ -69,7 +69,7 @@ public class Test3d extends Test3a
IMethod method = getTestSetting().getRoleJavaElement().getMethod(METHOD_NAME, new String[0]);
assertNotNull(method);
assertTrue(method.exists());
-
+
String[] exceptionTypes = method.getExceptionTypes();
assertTrue(exceptionTypes.length == 1);
assertEquals(exceptionTypes[0], EXC_TYPE);
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test4a.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test4a.java
index 9714437fc..9ea846154 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test4a.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test4a.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -35,12 +35,12 @@ import org.eclipse.jdt.core.JavaModelException;
*/
public class Test4a extends Test1
{
-
+
protected String getInnerclassName()
{
return "AnInnerClass";
}
-
+
public Test4a(String name)
{
super(name);
@@ -56,7 +56,7 @@ public class Test4a extends Test1
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
super.setUpSuite();
@@ -67,9 +67,9 @@ public class Test4a extends Test1
{
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IType innerclass = getTestSetting().getRoleJavaElement().getType(getInnerclassName());
assertNotNull(innerclass);
assertTrue(innerclass.exists());
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test4b.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test4b.java
index 555184996..d2b2d2d49 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test4b.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test4b.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -58,13 +58,13 @@ public class Test4b extends Test4a
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
super.setUpSuite();
getTestSetting().setTeamClass("Team_4b");
}
-
+
/**
* Test existance of inner teams
* @throws JavaModelException
@@ -73,27 +73,27 @@ public class Test4b extends Test4a
{
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IType innerclass = getTestSetting().getRoleJavaElement().getType(getInnerclassName());
assertNotNull(innerclass);
assertTrue(innerclass.exists());
-
+
IOTType innerclassOTElem = OTModelManager.getOTElement(innerclass);
- assertNotNull(innerclassOTElem);
+ assertNotNull(innerclassOTElem);
}
-
+
public void testTeamPropertyOfInnerclass() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
-
+
IType innerclass = getTestSetting().getRoleJavaElement().getType(getInnerclassName());
assertNotNull(innerclass);
assertTrue(innerclass.exists());
-
+
IOTType innerclassOTElem = OTModelManager.getOTElement(innerclass);
assertNotNull(innerclassOTElem);
-
+
assertTrue(innerclassOTElem.isTeam());
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test5a.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test5a.java
index 00e412c7a..262f4fb24 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test5a.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test5a.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -52,21 +52,21 @@ public class Test5a extends Test1
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
super.setUpSuite();
getTestSetting().setTeamClass("Team_5a");
}
-
-
+
+
public void testHasOTModel() throws JavaModelException
{
assertNotNull(getTestSetting().getRoleJavaElement());
assertTrue(getTestSetting().getRoleJavaElement().exists());
IOTType roleOTElem = OTModelManager.getOTElement(getTestSetting().getRoleJavaElement());
- assertNotNull(roleOTElem);
- }
-
+ assertNotNull(roleOTElem);
+ }
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test5b.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test5b.java
index faf90e8ab..3fe1588aa 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test5b.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test5b.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -48,11 +48,11 @@ public class Test5b extends Test5a
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
super.setUpSuite();
getTestSetting().setTeamClass("Team_5b");
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test5c.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test5c.java
index 80b5e7d3a..2865c7087 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test5c.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test5c.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -48,12 +48,12 @@ public class Test5c extends Test5a
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
super.setUpSuite();
getTestSetting().setTeamClass("Team_5c");
getTestSetting().setRoleNames(new String[] {"SampleRole", "SampleRole2", "SampleRole3"});
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test5d.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test5d.java
index 9bbe38e71..e90c52ab3 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test5d.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/role/unbound/Test5d.java
@@ -8,11 +8,11 @@ import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
public class Test5d extends FileBasedModelTest {
-
+
final static String R1 = "SampleRole1";
final static String R2 = "SampleRole2";
final static String INNER = "InnerRole";
-
+
public Test5d(String name)
{
super(name);
@@ -28,25 +28,25 @@ public class Test5d extends FileBasedModelTest {
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir(getTestSetting().getTestProject());
super.setUpSuite();
getTestSetting().setTeamClass("Team_5d");
}
-
+
protected void setUp() throws Exception
{
super.setUp();
getTestSetting().setUp();
}
-
+
public void testFlagsOfRoFi2() throws JavaModelException
{
assertNotNull(getTestSetting().getTeamJavaElement());
assertTrue(getTestSetting().getTeamJavaElement().exists());
-
+
IType r2 = getTestSetting().getTeamJavaElement().getType(R2);
int flags = r2.getFlags();
assertEquals("Unexpected flags", Flags.AccPublic|Flags.AccTeam|Flags.AccRole, flags);
@@ -56,11 +56,11 @@ public class Test5d extends FileBasedModelTest {
{
assertNotNull(getTestSetting().getTeamJavaElement());
assertTrue(getTestSetting().getTeamJavaElement().exists());
-
+
IType r2 = getTestSetting().getTeamJavaElement().getType(R2);
IType inner = r2.getType(INNER);
int flags = inner.getFlags();
assertEquals("Unexpected flags", Flags.AccProtected|Flags.AccRole, flags);
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/sample/AllSampleTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/sample/AllSampleTests.java
index 7b82f55d7..e2aa50c5c 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/sample/AllSampleTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/sample/AllSampleTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -31,13 +31,13 @@ import junit.framework.TestSuite;
/**
* Description of the class.
- *
+ *
* @author jwloka
* @version $Id: AllSampleTests.java 23494 2010-02-05 23:06:44Z stephan $
*/
public class AllSampleTests extends TestCase
{
- public AllSampleTests(String name)
+ public AllSampleTests(String name)
{
super(name);
}
@@ -46,7 +46,7 @@ public class AllSampleTests extends TestCase
{
return new Class[]
{
-// enter your test classes here!
+// enter your test classes here!
};
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/sample/FileBasedTestsSample.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/sample/FileBasedTestsSample.java
index 5e87809de..c2366f54f 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/sample/FileBasedTestsSample.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/sample/FileBasedTestsSample.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -51,19 +51,19 @@ public class FileBasedTestsSample extends FileBasedModelTest
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("TestDataSample");
-
+
super.setUpSuite();
}
-
+
protected void setUp() throws Exception
{
super.setUp();
}
-
+
public void test001() throws JavaModelException
{
ICompilationUnit unit = getCompilationUnit(
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/teams/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/teams/AllTests.java
index f759f73cc..0d73c0e46 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/teams/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/teams/AllTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -37,7 +37,7 @@ import org.eclipse.objectteams.otdt.tests.otmodel.TestSetting;
*/
public class AllTests extends TestCase
{
- public AllTests(String name)
+ public AllTests(String name)
{
super(name);
}
@@ -50,7 +50,7 @@ public class AllTests extends TestCase
org.eclipse.objectteams.otdt.tests.otmodel.teams.Test2.class
};
}
-
+
public static TestSetting getActualTestSetting()
{
return new TestSetting("Team", "src", "teampkg");
@@ -74,7 +74,7 @@ public class AllTests extends TestCase
try
{
TestDataHandler.addTestSetting(testClass, getActualTestSetting());
-
+
Method suiteMethod = testClass.getDeclaredMethod(
"suite", new Class[0]); //$NON-NLS-1$
Test suite = (Test) suiteMethod.invoke(null, new Object[0]);
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/teams/Test1.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/teams/Test1.java
index e5a3a9d53..9a2a5ce30 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/teams/Test1.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/teams/Test1.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -31,7 +31,7 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
/**
* @author kaschja
* @version $Id: Test1.java 23494 2010-02-05 23:06:44Z stephan $
- *
+ *
* This test class contains tests for an empty team class
*/
public class Test1 extends FileBasedModelTest
@@ -51,43 +51,43 @@ public class Test1 extends FileBasedModelTest
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir(getTestSetting().getTestProject());
super.setUpSuite();
getTestSetting().setTeamClass("Team1");
}
-
+
protected void setUp() throws Exception
{
super.setUp();
getTestSetting().setUp();
}
-
+
public void testExistenceOfTypeInJavaModel()
{
assertNotNull(getTestSetting().getTeamJavaElement());
assertTrue(getTestSetting().getTeamJavaElement().exists());
}
-
- public void testExistenceOfTypeInOTModel() throws JavaModelException
+
+ public void testExistenceOfTypeInOTModel() throws JavaModelException
{
assertNotNull(getTestSetting().getTeamJavaElement());
- assertTrue(getTestSetting().getTeamJavaElement().exists());
-
+ assertTrue(getTestSetting().getTeamJavaElement().exists());
+
IOTType teamOTElem = OTModelManager.getOTElement(getTestSetting().getTeamJavaElement());
assertNotNull(teamOTElem);
}
-
+
public void testTeamProperty() throws JavaModelException
{
assertNotNull(getTestSetting().getTeamJavaElement());
- assertTrue(getTestSetting().getTeamJavaElement().exists());
-
+ assertTrue(getTestSetting().getTeamJavaElement().exists());
+
IOTType teamOTElem = OTModelManager.getOTElement(getTestSetting().getTeamJavaElement());
- assertNotNull(teamOTElem);
+ assertNotNull(teamOTElem);
- assertTrue(teamOTElem.isTeam());
+ assertTrue(teamOTElem.isTeam());
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/teams/Test2.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/teams/Test2.java
index 22d305955..6041cc564 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/teams/Test2.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/teams/Test2.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -31,12 +31,12 @@ import org.eclipse.objectteams.otdt.core.OTModelManager;
/**
* @author kaschja
* @version $Id: Test2.java 23494 2010-02-05 23:06:44Z stephan $
- *
+ *
* This test class contains tests for a team class with one method without parameters
*/
public class Test2 extends Test1
{
-
+
public Test2(String name)
{
super(name);
@@ -52,7 +52,7 @@ public class Test2 extends Test1
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir(getTestSetting().getTestProject());
@@ -63,33 +63,33 @@ public class Test2 extends Test1
public void testContainment1() throws JavaModelException
{
assertNotNull(getTestSetting().getTeamJavaElement());
- assertTrue(getTestSetting().getTeamJavaElement().exists());
-
+ assertTrue(getTestSetting().getTeamJavaElement().exists());
+
assertNotNull(getTestSetting().getTeamJavaElement().getMethod("teamlevelMethod", new String[0]));
}
-
+
public void testGetRoleType_internalRole()
{
IType jmElem = getTestSetting().getTeamJavaElement();
IOTType teamType = OTModelManager.getOTElement(jmElem);
-
+
assertNotNull("OTElement doesn't exist!", teamType);
-
+
IType expected = teamType.getRoleType("InternalRole1");
-
+
assertNotNull("Role type not found", expected);
assertTrue("Role type couldn't be created by the parser", expected.exists());
}
-
+
public void testGetRoleType_externalRole()
{
IType jmElem = getTestSetting().getTeamJavaElement();
IOTType teamType = OTModelManager.getOTElement(jmElem);
-
+
assertNotNull("OTElement doesn't exist!", teamType);
-
+
IType expected = teamType.getRoleType("ExternalRole1");
-
+
assertNotNull("Role type not found", expected);
assertTrue("Role type couldn't be created by the parser", expected.exists());
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/AbstractOTJLDNullAnnotationTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/AbstractOTJLDNullAnnotationTest.java
index eedf7a5f7..94327492f 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/AbstractOTJLDNullAnnotationTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/AbstractOTJLDNullAnnotationTest.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2014 Stephan Herrmann
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -51,7 +51,7 @@ public class AbstractOTJLDNullAnnotationTest extends AbstractNullAnnotationTest
this.fVMArguments = getOTVMArgs();
}
@Override
- public boolean verifyClassFiles(String sourceFilePath, String className, String expectedOutputString, String expectedErrorStringStart,
+ public boolean verifyClassFiles(String sourceFilePath, String className, String expectedOutputString, String expectedErrorStringStart,
String[] classpaths, String[] programArguments, String[] vmArguments) {
vmArguments = mergeArgs(vmArguments);
return super.verifyClassFiles(sourceFilePath, className, expectedOutputString, expectedErrorStringStart, classpaths, programArguments, vmArguments);
@@ -74,11 +74,11 @@ public class AbstractOTJLDNullAnnotationTest extends AbstractNullAnnotationTest
}
}
}
-
+
private static String getOTDTJarPath(String jarName) {
return ClasspathUtil.OTDT_PATH + File.separator + "lib" + File.separator + jarName + ".jar";
}
-
+
public String[] getOTVMArgs() {
String OTRE_MIN_JAR_PATH, OTAGENT_JAR_PATH;
OTRE_MIN_JAR_PATH = getOTDTJarPath("otre_min");
@@ -112,19 +112,19 @@ public class AbstractOTJLDNullAnnotationTest extends AbstractNullAnnotationTest
"-Dobjectteams.otdre.verify=1"
};
}
-
+
public static boolean IS_JRE_8;
static {
String javaVersion = System.getProperty("java.specification.version");
IS_JRE_8 = "1.8".equals(javaVersion);
}
protected String foreach(String elemType) {
- return (IS_JRE_8 && this.complianceLevel < ClassFileConstants.JDK1_8)
+ return (IS_JRE_8 && this.complianceLevel < ClassFileConstants.JDK1_8)
? "public void forEach(java.util.function.Consumer<? super "+elemType+"> element) {}\n"
: "";
}
protected String spliterator(String elemType) {
- return (IS_JRE_8 && this.complianceLevel < ClassFileConstants.JDK1_8)
+ return (IS_JRE_8 && this.complianceLevel < ClassFileConstants.JDK1_8)
? "public java.util.Spliterator<"+elemType+"> spliterator() { return null; }\n"
: "";
}
@@ -132,17 +132,17 @@ public class AbstractOTJLDNullAnnotationTest extends AbstractNullAnnotationTest
return (IS_JRE_8 && this.complianceLevel < ClassFileConstants.JDK1_8) ? "spliterator -> spliterator;\n" : "";
}
// ===
-
+
protected static final JavacTestOptions DEFAULT_TEST_OPTIONS = new JavacTestOptions();
// shall compiler output be matched exactly or using some matching?
boolean errorMatching = false;
-
+
// each subarray defines a set of classes to be compiled together:
protected String[][] compileOrder;
-
+
protected WeavingScheme weavingScheme = WeavingScheme.OTDRE;
-
+
public AbstractOTJLDNullAnnotationTest(String name) {
super(name);
}
@@ -180,7 +180,7 @@ public class AbstractOTJLDNullAnnotationTest extends AbstractNullAnnotationTest
protected TestVerifier getTestVerifier(boolean reuseVM) {
return new OTTestVerifier(reuseVM);
}
-
+
@Override
protected void tearDown() throws Exception {
this.compileOrder = null;
@@ -199,7 +199,7 @@ public class AbstractOTJLDNullAnnotationTest extends AbstractNullAnnotationTest
options.put(CompilerOptions.OPTION_ReportOtreWeavingIntoJava8, CompilerOptions.IGNORE);
return options;
}
-
+
protected void runNegativeTestMatching(String[] testFiles, String expectedCompilerLog) {
this.errorMatching = true;
runTest(
@@ -241,7 +241,7 @@ public class AbstractOTJLDNullAnnotationTest extends AbstractNullAnnotationTest
void logTestTitle() {
System.out.println(getClass().getName() + '#' + getName());
}
-
+
// support explicit compile order in several steps:
@Override
protected void compileTestFiles(Compiler batchCompiler, String[] testFiles) {
@@ -267,7 +267,7 @@ public class AbstractOTJLDNullAnnotationTest extends AbstractNullAnnotationTest
}
}
}
-
+
protected INameEnvironment getNameEnvironment(final String[] testFiles, String[] classPaths) {
this.classpaths = classPaths == null ? getDefaultClassPaths() : classPaths;
// make cleanup weaker:
@@ -280,7 +280,7 @@ public class AbstractOTJLDNullAnnotationTest extends AbstractNullAnnotationTest
}
};
}
-
+
/** Additional entry for tests expecting a compiler warning and don't run. */
protected void runTestExpectingWarnings(String[] files, String expectedWarnings) {
Map options = getCompilerOptions();
@@ -297,9 +297,9 @@ public class AbstractOTJLDNullAnnotationTest extends AbstractNullAnnotationTest
null /* do not check output string */,
null /* do not check error string */,
// javac options
- JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings /* javac test options */);
+ JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings /* javac test options */);
}
-
+
/** Additional entry for tests expecting a compiler warning and don't run. */
protected void runTestExpectingWarnings(String[] files, String expectedWarnings, Map options) {
runConformTest(
@@ -315,9 +315,9 @@ public class AbstractOTJLDNullAnnotationTest extends AbstractNullAnnotationTest
null /* do not check output string */,
null /* do not check error string */,
// javac options
- JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings /* javac test options */);
+ JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings /* javac test options */);
}
-
+
/** Additional entry for tests expecting a compiler warning and don't run. */
protected void runTestExpectingWarnings(String[] files, String expectedWarnings, boolean flushOutputDirectory) {
Map options = getCompilerOptions();
@@ -334,7 +334,7 @@ public class AbstractOTJLDNullAnnotationTest extends AbstractNullAnnotationTest
null /* do not check output string */,
null /* do not check error string */,
// javac options
- JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings /* javac test options */);
+ JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings /* javac test options */);
}
/** Additional entry for tests expecting a compiler warning and run. */
protected void runTestExpectingWarnings(String[] files, String expectedWarnings, String expectedOutput) {
@@ -352,7 +352,7 @@ public class AbstractOTJLDNullAnnotationTest extends AbstractNullAnnotationTest
expectedOutput,
null /* do not check error string */,
// javac options
- JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings /* javac test options */);
+ JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings /* javac test options */);
}
protected void myWriteFiles(String[] testFiles) {
@@ -367,7 +367,7 @@ public class AbstractOTJLDNullAnnotationTest extends AbstractNullAnnotationTest
setName(testName);
}
}
-
+
protected String getTestResourcePath(String filename) {
try
{
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/AbstractOTJLDTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/AbstractOTJLDTest.java
index 790d9ffec..faba7da09 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/AbstractOTJLDTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/AbstractOTJLDTest.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010, 2014 Stephan Herrmann
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -56,7 +56,7 @@ public class AbstractOTJLDTest extends AbstractComparableTest {
this.fVMArguments = getOTVMArgs();
}
@Override
- public boolean verifyClassFiles(String sourceFilePath, String className, String expectedOutputString, String expectedErrorStringStart,
+ public boolean verifyClassFiles(String sourceFilePath, String className, String expectedOutputString, String expectedErrorStringStart,
String[] classpaths, String[] programArguments, String[] vmArguments) {
vmArguments = mergeArgs(vmArguments);
return super.verifyClassFiles(sourceFilePath, className, expectedOutputString, expectedErrorStringStart, classpaths, programArguments, vmArguments);
@@ -79,11 +79,11 @@ public class AbstractOTJLDTest extends AbstractComparableTest {
}
}
}
-
+
private static String getOTDTJarPath(String jarName) {
return ClasspathUtil.OTDT_PATH + File.separator + "lib" + File.separator + jarName + ".jar";
}
-
+
public String[] getOTVMArgs() {
String OTRE_MIN_JAR_PATH, OTAGENT_JAR_PATH;
OTRE_MIN_JAR_PATH = getOTDTJarPath("otre_min");
@@ -117,26 +117,26 @@ public class AbstractOTJLDTest extends AbstractComparableTest {
"-Dobjectteams.otdre.verify=1"
};
}
-
+
public static boolean IS_JRE_8;
static {
String javaVersion = System.getProperty("java.specification.version");
IS_JRE_8 = "1.8".equals(javaVersion);
}
protected String foreach(String elemType) {
- return (IS_JRE_8 && this.complianceLevel < ClassFileConstants.JDK1_8)
+ return (IS_JRE_8 && this.complianceLevel < ClassFileConstants.JDK1_8)
? "public void forEach(java.util.function.Consumer<? super "+elemType+"> element) {}\n"
: "";
}
protected String spliterator(String elemType) {
- return (IS_JRE_8 && this.complianceLevel < ClassFileConstants.JDK1_8)
+ return (IS_JRE_8 && this.complianceLevel < ClassFileConstants.JDK1_8)
? "public java.util.Spliterator<"+elemType+"> spliterator() { return null; }\n"
: "";
}
protected String spliteratorCallout() {
return (IS_JRE_8 && this.complianceLevel < ClassFileConstants.JDK1_8) ? "spliterator -> spliterator;\n" : "";
}
-
+
// copy from JDT-orig for visibility's sake
protected class Runner {
public boolean shouldFlushOutputDirectory = true;
@@ -246,17 +246,17 @@ public class AbstractOTJLDTest extends AbstractComparableTest {
}
// ===
-
+
protected static final JavacTestOptions DEFAULT_TEST_OPTIONS = new JavacTestOptions();
// shall compiler output be matched exactly or using some matching?
boolean errorMatching = false;
-
+
// each subarray defines a set of classes to be compiled together:
protected String[][] compileOrder;
-
+
protected WeavingScheme weavingScheme = WeavingScheme.OTDRE;
-
+
public AbstractOTJLDTest(String name) {
super(name);
}
@@ -294,7 +294,7 @@ public class AbstractOTJLDTest extends AbstractComparableTest {
protected TestVerifier getTestVerifier(boolean reuseVM) {
return new OTTestVerifier(reuseVM);
}
-
+
@Override
protected void tearDown() throws Exception {
this.compileOrder = null;
@@ -313,7 +313,7 @@ public class AbstractOTJLDTest extends AbstractComparableTest {
options.put(CompilerOptions.OPTION_ReportOtreWeavingIntoJava8, CompilerOptions.IGNORE);
return options;
}
-
+
protected void runNegativeTestMatching(String[] testFiles, String expectedCompilerLog) {
this.errorMatching = true;
runTest(
@@ -372,7 +372,7 @@ public class AbstractOTJLDTest extends AbstractComparableTest {
void logTestTitle() {
System.out.println(getClass().getName() + '#' + getName());
}
-
+
// support explicit compile order in several steps:
@Override
protected void compileTestFiles(Compiler batchCompiler, String[] testFiles) {
@@ -398,7 +398,7 @@ public class AbstractOTJLDTest extends AbstractComparableTest {
}
}
}
-
+
protected INameEnvironment getNameEnvironment(final String[] testFiles, String[] classPaths) {
this.classpaths = classPaths == null ? getDefaultClassPaths() : classPaths;
// make cleanup weaker:
@@ -411,7 +411,7 @@ public class AbstractOTJLDTest extends AbstractComparableTest {
}
};
}
-
+
/** Additional entry for tests expecting a compiler warning and don't run. */
protected void runTestExpectingWarnings(String[] files, String expectedWarnings) {
Map options = getCompilerOptions();
@@ -428,9 +428,9 @@ public class AbstractOTJLDTest extends AbstractComparableTest {
null /* do not check output string */,
null /* do not check error string */,
// javac options
- JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings /* javac test options */);
+ JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings /* javac test options */);
}
-
+
/** Additional entry for tests expecting a compiler warning and don't run. */
protected void runTestExpectingWarnings(String[] files, String expectedWarnings, Map options) {
runConformTest(
@@ -446,9 +446,9 @@ public class AbstractOTJLDTest extends AbstractComparableTest {
null /* do not check output string */,
null /* do not check error string */,
// javac options
- JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings /* javac test options */);
+ JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings /* javac test options */);
}
-
+
/** Additional entry for tests expecting a compiler warning and don't run. */
protected void runTestExpectingWarnings(String[] files, String expectedWarnings, boolean flushOutputDirectory) {
Map options = getCompilerOptions();
@@ -465,7 +465,7 @@ public class AbstractOTJLDTest extends AbstractComparableTest {
null /* do not check output string */,
null /* do not check error string */,
// javac options
- JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings /* javac test options */);
+ JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings /* javac test options */);
}
/** Additional entry for tests expecting a compiler warning and run. */
protected void runTestExpectingWarnings(String[] files, String expectedWarnings, String expectedOutput) {
@@ -483,7 +483,7 @@ public class AbstractOTJLDTest extends AbstractComparableTest {
expectedOutput,
null /* do not check error string */,
// javac options
- JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings /* javac test options */);
+ JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings /* javac test options */);
}
protected void myWriteFiles(String[] testFiles) {
@@ -498,7 +498,7 @@ public class AbstractOTJLDTest extends AbstractComparableTest {
setName(testName);
}
}
-
+
protected String getTestResourcePath(String filename) {
try
{
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/AllTests.java
index 022b990be..6d509f1db 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/AllTests.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010 Stephan Herrmann
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -76,7 +76,7 @@ public class AllTests {
public static Test suite() {
TestSuite suite = new TestSuite("All OTJLD Tests");
-
+
// 1. rolesandteams
/*1.1*/addComplianceSuite(suite, RoleObjectContainment.testClass());
/*1.1.10-*/addComplianceSuite(suite, TeamNesting.testClass());
@@ -85,53 +85,53 @@ public class AllTests {
/*1.4*/addComplianceSuite(suite, RegularRoleInheritance.testClass());
/*1.5*/addComplianceSuite(suite, FileStructure.testClass());
/*1.6*/addComplianceSuite(suite, ExternalizedRoles.testClass());
-
+
/*6.2*/addComplianceSuite(suite, OldExternalizedRoles.testClass());
-
+
/*1.7*/addComplianceSuite(suite, Confinement.testClass());
/*1.8*/addComplianceSuite(suite, RelevantRole.testClass());
/*1.9*/addComplianceSuite(suite, ValueParameters.testClass());
-
+
/*0.c*/addComplianceSuite(suite, ImplicitInheritance.testClass());
/*6.3*/addComplianceSuite(suite, Covariance.testClass());
-
+
// 2. roleplaying
/*2.1*/addComplianceSuite(suite, PlayedByRelation.testClass());
/*2.2*/addComplianceSuite(suite, LiftingAndLowering.testClass());
/*2.3*/addComplianceSuite(suite, ExplicitRoleCreation.testClass());
/*2.4*/addComplianceSuite(suite, BaseClassVisibility.testClass());
/*2.5*/addComplianceSuite(suite, GC.testClass());
-
+
// 3. calloutbinding
/*3.1*/addComplianceSuite(suite, CalloutMethodBinding.testClass()); // includes a few from 7.2.1
/*3.2*/addComplianceSuite(suite, CalloutParameterBinding_LiftingAndLowering.testClass());
/*3.3*/addComplianceSuite(suite, CalloutToField.testClass());
-
+
/*7.4*/addComplianceSuite(suite, OverridingAccessRestrictions.testClass());
-
+
// 4. callinbinding
/*4.1*/addComplianceSuite(suite, CallinMethodBinding.testClass()); // includes a few from 7.2.[45]
/*4.3*/addComplianceSuite(suite, CallinParameterMapping_LiftingAndLowering.testClass());
/*4.4*/addComplianceSuite(suite, CallinWithTranslation.testClass());
/*4.5*/addComplianceSuite(suite, BaseCalls.testClass());
-
+
// 5. teamactivation
/*5.2*/addComplianceSuite(suite, ExplicitTeamActivation.testClass());
/*5.3*/addComplianceSuite(suite, ImplicitTeamActivation.testClass());
/*5.4*/addComplianceSuite(suite, Predicates.testClass());
-
+
// 6.[14] liftlower
/*6.1*/addComplianceSuite(suite, DeclaredLifting.testClass());
//6.4: see below
-
+
// 7. see below
// 8. syntax
/*8.1*/addComplianceSuite(suite, Syntax.testClass());
-
+
// api:
/*9.2*/addComplianceSuite(suite, Reflection.testClass());
-
+
// other:
/*0.a*/addComplianceSuite(suite, AccessModifiers.testClass());
/*7.1*/addComplianceSuite(suite, Modifiers.testClass());
@@ -141,12 +141,12 @@ public class AllTests {
/*---*/addComplianceSuite(suite, Java8.testClass(), AbstractCompilerTest.F_1_8);
/*---*/addComplianceSuite(suite, OTNullTypeAnnotationTest.testClass(), AbstractCompilerTest.F_1_8);
/*0.m*/addComplianceSuite(suite, Misc.testClass());
-
+
// regression:
/*B.1*/addComplianceSuite(suite, ReportedBugs.testClass());
/*B.2*/addComplianceSuite(suite, CompilationOrder.testClass());
/*X.2*/addComplianceSuite(suite, DevelopmentExamples.testClass());
-
+
addComplianceSuite(suite, ComplexStructures.testClass());
/*7.3*/suite.addTest(AllBindingAmbiguitiesTests.suite());
@@ -164,7 +164,7 @@ public class AllTests {
TestCase.TESTS_NUMBERS= null;
TestCase.TESTS_RANGE = null;
TestCase.RUN_ONLY_ID = null;
-
+
suite.addTest(AbstractCompilerTest.buildMinimalComplianceTestSuite(testClass, compliance));
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/JdtTestAdaptor.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/JdtTestAdaptor.java
index 1678be64f..662b5671b 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/JdtTestAdaptor.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/JdtTestAdaptor.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010 Stephan Herrmann
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -26,12 +26,12 @@ import base org.eclipse.jdt.core.tests.runtime.StandardVMLauncher;
public team class JdtTestAdaptor {
/** Adapt command line computation of a vm launcher. */
- protected class VMLauncher playedBy StandardVMLauncher
+ protected class VMLauncher playedBy StandardVMLauncher
{
void getCommandLine(String[] args) <- after String[] getCommandLine()
with { args <- result }
- /*
+ /*
* load-time transformed code currently has no StackMap, thus the verifier must
* be able to revert to the old behavior without a StackMap.
*/
@@ -42,6 +42,6 @@ public team class JdtTestAdaptor {
break;
}
}
- }
+ }
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/SomeTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/SomeTests.java
index 9b53fa348..4ab64b36d 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/SomeTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/SomeTests.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010 Stephan Herrmann
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -41,7 +41,7 @@ public class SomeTests {
public static Test suite() {
TestSuite suite = new TestSuite("All OTJLD Tests");
-
+
// 1. rolesandteams
// /*1.1*/suite.addTest(RoleObjectContainment.suite());
/*1.1.10-*/suite.addTest(TeamNesting.suite());
@@ -50,59 +50,59 @@ public class SomeTests {
// /*1.4*/suite.addTest(RegularRoleInheritance.suite());
// /*1.5*/suite.addTest(FileStructure.suite());
// /*1.6*/suite.addTest(ExternalizedRoles.suite());
-//
+//
// /*6.2*/suite.addTest(OldExternalizedRoles.suite());
-//
+//
// /*1.7*/suite.addTest(Confinement.suite());
// /*1.8*/suite.addTest(RelevantRole.suite());
// /*1.9*/suite.addTest(ValueParameters.suite());
-//
+//
// /*0.c*/suite.addTest(ImplicitInheritance.suite());
/*6.3*/suite.addTest(Covariance.suite());
-//
+//
// // 2. roleplaying
// /*2.1*/suite.addTest(PlayedByRelation.suite());
/*2.2*/suite.addTest(LiftingAndLowering.suite());
// /*2.3*/suite.addTest(ExplicitRoleCreation.suite());
// /*2.4*/suite.addTest(BaseClassVisibility.suite());
// /*2.5*/suite.addTest(GC.suite());
-//
+//
// /*7.3*/suite.addTest(AllBindingAmbiguitiesTests.suite());
-//
+//
// // 3. calloutbinding
/*3.1*/suite.addTest(CalloutMethodBinding.suite()); // includes a few from 7.2.1
/*3.2*/suite.addTest(CalloutParameterBinding_LiftingAndLowering.suite());
/*3.3*/suite.addTest(CalloutToField.suite());
-
+
// /*7.4*/suite.addTest(OverridingAccessRestrictions.suite());
-//
+//
// // 4. callinbinding
/*4.1*/suite.addTest(CallinMethodBinding.suite()); // includes a few from 7.2.[45]
/*4.3*/suite.addTest(CallinParameterMapping_LiftingAndLowering.suite());
/*4.4*/suite.addTest(CallinWithTranslation.suite());
/*4.5*/suite.addTest(BaseCalls.suite());
-//
+//
// // 5. teamactivation
// /*5.2*/suite.addTest(ExplicitTeamActivation.suite());
// /*5.3*/suite.addTest(ImplicitTeamActivation.suite());
-//
+//
// // 6.[14] liftlower
/*6.1*/suite.addTest(DeclaredLifting.suite());
// /*6.4*/suite.addTest(AllSmartLiftingTests.suite());
-//
+//
// // 8. syntax
// /*8.1*/suite.addTest(Syntax.suite());
-//
+//
// // api:
// /*9.2*/suite.addTest(Reflection.suite());
-//
+//
// // other:
// /*0.a*/suite.addTest(AccessModifiers.suite());
// /*7.1*/suite.addTest(Modifiers.suite());
// /*7.5*/suite.addTest(Exceptions.suite());
// /*A.1*/suite.addTest(Java5.suite());
// /*0.m*/suite.addTest(Misc.suite());
-//
+//
// // regression:
/*B.1*/suite.addTest(ReportedBugs.suite());
// /*B.2*/suite.addTest(CompilationOrder.suite());
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/Stringify.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/Stringify.java
index 92f4409d9..47861d4c4 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/Stringify.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/Stringify.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010 Stephan Herrmann
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/api/Reflection.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/api/Reflection.java
index 6fd95205d..49d392d18 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/api/Reflection.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/api/Reflection.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010 Stephan Herrmann
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -27,11 +27,11 @@ import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
@SuppressWarnings("unchecked")
public class Reflection extends AbstractOTJLDTest {
-
+
public Reflection(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -39,7 +39,7 @@ public class Reflection extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -47,11 +47,11 @@ public class Reflection extends AbstractOTJLDTest {
public static Class testClass() {
return Reflection.class;
}
-
+
// hasRole is called, role exists
// 9.2.1-otjld-has-role-method-1
public void test921_hasRoleMethod1() {
-
+
runConformTest(
new String[] {
"Team921hrm1.java",
@@ -80,7 +80,7 @@ public class Reflection extends AbstractOTJLDTest {
// hasRole is called, role does not exist
// 9.2.1-otjld-has-role-method-2
public void test921_hasRoleMethod2() {
-
+
runConformTest(
new String[] {
"Team921hrm2.java",
@@ -109,7 +109,7 @@ public class Reflection extends AbstractOTJLDTest {
// hasRole is called, no bound role
// 9.2.1-otjld-has-role-method-3
public void test921_hasRoleMethod3() {
-
+
runConformTest(
new String[] {
"Team921hrm3.java",
@@ -134,7 +134,7 @@ public class Reflection extends AbstractOTJLDTest {
// hasRole is called, multiple bound roles
// 9.2.1-otjld-has-role-method-4
public void test921_hasRoleMethod4() {
-
+
runConformTest(
new String[] {
"Team921hrm4.java",
@@ -168,7 +168,7 @@ public class Reflection extends AbstractOTJLDTest {
// hasRole is called, multiple bound roles with common supertype
// 9.2.1-otjld-has-role-method-5
public void test921_hasRoleMethod5() {
-
+
runConformTest(
new String[] {
"Team921hrm5.java",
@@ -203,7 +203,7 @@ public class Reflection extends AbstractOTJLDTest {
// hasRole is called, multiple bound roles with common supertype, class selected
// 9.2.1-otjld-has-role-method-5c
public void test921_hasRoleMethod5c() {
-
+
runConformTest(
new String[] {
"Team921hrm5c.java",
@@ -300,7 +300,7 @@ public class Reflection extends AbstractOTJLDTest {
// hasRole is called, multiple bound roles in one hierarchy
// 9.2.1-otjld-has-role-method-6
public void test921_hasRoleMethod6() {
-
+
runConformTest(
new String[] {
"Team921hrm6.java",
@@ -340,7 +340,7 @@ public class Reflection extends AbstractOTJLDTest {
// hasRole(Object,Class) called, role exists
// 9.2.2-otjld-has-role-method-1
public void test922_hasRoleMethod1() {
-
+
runConformTest(
new String[] {
"Team922hrm1.java",
@@ -372,7 +372,7 @@ public class Reflection extends AbstractOTJLDTest {
// hasRole(Object,Class) called, role exists, but illegal role type
// 9.2.2-otjld-has-role-method-1f
public void test922_hasRoleMethod1f() {
-
+
runConformTest(
new String[] {
"Team922hrm1f.java",
@@ -406,7 +406,7 @@ public class Reflection extends AbstractOTJLDTest {
// hasRole(Object,Class) called, role does not exist
// 9.2.2-otjld-has-role-method-2
public void test922_hasRoleMethod2() {
-
+
runConformTest(
new String[] {
"Team922hrm2.java",
@@ -464,7 +464,7 @@ public class Reflection extends AbstractOTJLDTest {
// hasRole(Object,Class) called, no bound role
// 9.2.2-otjld-has-role-method-3
public void test922_hasRoleMethod3() {
-
+
runConformTest(
new String[] {
"Team922hrm3.java",
@@ -494,7 +494,7 @@ public class Reflection extends AbstractOTJLDTest {
// hasRole(Object,Class) called, multiple bound roles
// 9.2.2-otjld-has-role-method-4
public void test922_hasRoleMethod4() {
-
+
runConformTest(
new String[] {
"Team922hrm4.java",
@@ -535,7 +535,7 @@ public class Reflection extends AbstractOTJLDTest {
// hasRole(Object,Class) called, multiple bound roles with common supertype
// 9.2.2-otjld-has-role-method-5
public void test922_hasRoleMethod5() {
-
+
runConformTest(
new String[] {
"Team922hrm5.java",
@@ -573,7 +573,7 @@ public class Reflection extends AbstractOTJLDTest {
// hasRole(Object,Class) called, multiple bound roles in one hierarchy
// 9.2.2-otjld-has-role-method-6
public void test922_hasRoleMethod6() {
-
+
runConformTest(
new String[] {
"Team922hrm6.java",
@@ -616,7 +616,7 @@ public class Reflection extends AbstractOTJLDTest {
// getRole(Object) called
// 9.2.3-otjld-get-role-method-1
public void test923_getRoleMethod1() {
-
+
runConformTest(
new String[] {
"Team923grm1.java",
@@ -644,7 +644,7 @@ public class Reflection extends AbstractOTJLDTest {
// getRole(Object,Class) called
// 9.2.3-otjld-get-role-method-2
public void test923_getRoleMethod2() {
-
+
runConformTest(
new String[] {
"Team923grm2_2.java",
@@ -682,7 +682,7 @@ public class Reflection extends AbstractOTJLDTest {
// getRole(Object) called - compile in one go
// 9.2.3-otjld-get-role-method-2a
public void test923_getRoleMethod2a() {
-
+
runConformTest(
new String[] {
"Team923grm2a_2.java",
@@ -716,7 +716,7 @@ public class Reflection extends AbstractOTJLDTest {
// getRole(Object,Class) called - old role class literal syntax
// 9.2.3-otjld-get-role-method-2f
public void test923_getRoleMethod2f() {
-
+
runConformTest(
new String[] {
"T923grm2fMain.java",
@@ -757,7 +757,7 @@ public class Reflection extends AbstractOTJLDTest {
// getRole(Object,Class) called - generic singature leveraged
// 9.2.3-otjld-get-role-method-2g
public void test923_getRoleMethod2g() {
-
+
runConformTest(
new String[] {
"T923grm2gMain.java",
@@ -825,21 +825,21 @@ public class Reflection extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team923grm2gp_2.java (at line 7)\n" +
- " R<@t> r = t.getRole(o, R<@t>.class);\n" +
- " ^\n" +
- "Illegal parameterized use of non-public role R (OTJLD 1.2.3(b)).\n" +
- "----------\n" +
- "2. ERROR in Team923grm2gp_2.java (at line 7)\n" +
- " R<@t> r = t.getRole(o, R<@t>.class);\n" +
- " ^\n" +
- "Illegal parameterized use of non-public role R (OTJLD 1.2.3(b)).\n" +
+ "----------\n" +
+ "1. ERROR in Team923grm2gp_2.java (at line 7)\n" +
+ " R<@t> r = t.getRole(o, R<@t>.class);\n" +
+ " ^\n" +
+ "Illegal parameterized use of non-public role R (OTJLD 1.2.3(b)).\n" +
+ "----------\n" +
+ "2. ERROR in Team923grm2gp_2.java (at line 7)\n" +
+ " R<@t> r = t.getRole(o, R<@t>.class);\n" +
+ " ^\n" +
+ "Illegal parameterized use of non-public role R (OTJLD 1.2.3(b)).\n" +
"----------\n" +
- "3. ERROR in Team923grm2gp_2.java (at line 8)\n" +
- " r.print();\n" +
- " ^\n" +
- "The type R is not visible\n" +
+ "3. ERROR in Team923grm2gp_2.java (at line 8)\n" +
+ " r.print();\n" +
+ " ^\n" +
+ "The type R is not visible\n" +
"----------\n");
}
@@ -850,7 +850,7 @@ public class Reflection extends AbstractOTJLDTest {
customOptions.put(CompilerOptions.OPTION_ReportPotentialNullReference, CompilerOptions.WARNING);
customOptions.put(CompilerOptions.OPTION_ReportRedundantNullCheck, CompilerOptions.WARNING);
customOptions.put(CompilerOptions.OPTION_ReportNullReference, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"Team923grm3_2.java",
@@ -902,7 +902,7 @@ public class Reflection extends AbstractOTJLDTest {
customOptions.put(CompilerOptions.OPTION_ReportPotentialNullReference, CompilerOptions.WARNING);
customOptions.put(CompilerOptions.OPTION_ReportRedundantNullCheck, CompilerOptions.WARNING);
customOptions.put(CompilerOptions.OPTION_ReportNullReference, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"Team923grm3n_2.java",
@@ -956,7 +956,7 @@ public class Reflection extends AbstractOTJLDTest {
// getRole(Object) called
// Bug 351317 - Error in (redundant) cast of anchored type
public void test923_getRoleMethod4() {
-
+
runConformTest(
new String[] {
"Team923grm4.java",
@@ -969,7 +969,7 @@ public class Reflection extends AbstractOTJLDTest {
" public static void main (String[] args0) {\n" +
" T923grm4 o = new T923grm4();\n" +
" final Team923grm4 t = new Team923grm4(o);\n" +
- " R<@t> r = (R<@t>) t.getRole(o, R<@t>.class);\n" +
+ " R<@t> r = (R<@t>) t.getRole(o, R<@t>.class);\n" +
" System.out.print(r);\n" +
" }\n" +
"} \n" +
@@ -984,7 +984,7 @@ public class Reflection extends AbstractOTJLDTest {
// a replace callin tests the reflective function isExecutingCallin
// 9.2.4-otjld-is-executing-callin-called-1
public void test924_isExecutingCallinCalled1() {
-
+
runConformTest(
new String[] {
"Team924iscc1.java",
@@ -1021,7 +1021,7 @@ public class Reflection extends AbstractOTJLDTest {
// a replace callin with result tests the reflective function isExecutingCallin
// 9.2.4-otjld-is-executing-callin-called-2
public void test924_isExecutingCallinCalled2() {
-
+
runConformTest(
new String[] {
"Team924iscc2.java",
@@ -1057,7 +1057,7 @@ public class Reflection extends AbstractOTJLDTest {
// an after callin tests the reflective function isExecutingCallin
// 9.2.4-otjld-is-executing-callin-called-3
public void test924_isExecutingCallinCalled3() {
-
+
runConformTest(
new String[] {
"Team924iscc3.java",
@@ -1092,7 +1092,7 @@ public class Reflection extends AbstractOTJLDTest {
// a callin method throws an exception, yet the isExecuting flag is reset
// 9.2.4-otjld-is-executing-callin-called-4
public void test924_isExecutingCallinCalled4() {
-
+
runConformTest(
new String[] {
"Team924iecc4.java",
@@ -1133,7 +1133,7 @@ public class Reflection extends AbstractOTJLDTest {
// a callin to equals() prevents recursion by a guard using isExecutingCallin
// 9.2.4-otjld-is-executing-callin-called-5
public void test924_isExecutingCallinCalled5() {
-
+
runConformTest(
new String[] {
"Team924iecc5.java",
@@ -1180,7 +1180,7 @@ public class Reflection extends AbstractOTJLDTest {
// a role is unregistered between two callins
// 9.2.5-otjld-role-is-unregistered-1
public void test925_roleIsUnregistered1() {
-
+
runConformTest(
new String[] {
"Team925riu1.java",
@@ -1222,7 +1222,7 @@ public class Reflection extends AbstractOTJLDTest {
// a role is unregistered between two callins
// 9.2.5-otjld-role-is-unregistered-2
public void test925_roleIsUnregistered2() {
-
+
runConformTest(
new String[] {
"Team925riu2.java",
@@ -1264,7 +1264,7 @@ public class Reflection extends AbstractOTJLDTest {
// a class literal for a role class is used in a team method across team inheritance
// 9.2.6-otjld-role-class-literal-access-1
public void test926_roleClassLiteralAccess1() {
-
+
runConformTest(
new String[] {
"Team926rcla1_2.java",
@@ -1302,7 +1302,7 @@ public class Reflection extends AbstractOTJLDTest {
// a class literal for a role class is used in a role method across team inheritance
// 9.2.6-otjld-role-class-literal-access-2
public void test926_roleClassLiteralAccess2() {
-
+
runConformTest(
new String[] {
"Team926rcla2_2.java",
@@ -1337,7 +1337,7 @@ public class Reflection extends AbstractOTJLDTest {
},
"OK");
}
-
+
// role class literal in nested team - inconsistent team/role combination
// see Bug 311201 - hasRole(Object, Class) call in inner teams ends up in NoSuchMethodError
public void test926_roleClassLiteralAccess3() {
@@ -1373,12 +1373,12 @@ public class Reflection extends AbstractOTJLDTest {
null /*classLibraries*/,
true /*shouldFlush*/,
null /*customOptions*/,
- "java.lang.IllegalArgumentException: No such bound role type in this team: Team926rcla3$__OT__Inner926rcla3$Role926rcla3\n" +
- " at Team926rcla3.hasRole(Team926rcla3.java:1)\n" +
- " at Team926rcla3$__OT__Inner926rcla3.test(Team926rcla3.java:6)\n" +
+ "java.lang.IllegalArgumentException: No such bound role type in this team: Team926rcla3$__OT__Inner926rcla3$Role926rcla3\n" +
+ " at Team926rcla3.hasRole(Team926rcla3.java:1)\n" +
+ " at Team926rcla3$__OT__Inner926rcla3.test(Team926rcla3.java:6)\n" +
" at T926rcla3Main.main(T926rcla3Main.java:7)");
}
-
+
// role class literal in nested team
// see Bug 311201 - hasRole(Object, Class) call in inner teams ends up in NoSuchMethodError
public void test926_roleClassLiteralAccess4() {
@@ -1415,7 +1415,7 @@ public class Reflection extends AbstractOTJLDTest {
// get roles from one role cache
// 9.2.7-otjld-get-all-roles-1
public void test927_getAllRoles1() {
-
+
runConformTest(
new String[] {
"Team927gar1.java",
@@ -1465,7 +1465,7 @@ public class Reflection extends AbstractOTJLDTest {
// get roles from all (two) role caches
// 9.2.7-otjld-get-all-roles-2
public void test927_getAllRoles2() {
-
+
runConformTest(
new String[] {
"Team927gar2.java",
@@ -1515,7 +1515,7 @@ public class Reflection extends AbstractOTJLDTest {
// selectively get roles of specified type (using super class to actually select all)
// 9.2.7-otjld-get-all-roles-3
public void test927_getAllRoles3() {
-
+
runConformTest(
new String[] {
"Team927gar3.java",
@@ -1567,7 +1567,7 @@ public class Reflection extends AbstractOTJLDTest {
// selectively get roles of specified type (only subclass)
// 9.2.7-otjld-get-all-roles-4
public void test927_getAllRoles4() {
-
+
runConformTest(
new String[] {
"Team927gar4.java",
@@ -1615,7 +1615,7 @@ public class Reflection extends AbstractOTJLDTest {
},
"R2");
}
-
+
// challenge concurrent modification exception (see https://bugs.eclipse.org/308181)
public void test927_getAllRoles5() {
runConformTest(
@@ -1661,35 +1661,35 @@ public class Reflection extends AbstractOTJLDTest {
},
"");
}
- // Bug 336152 - [compiler] incompatible cast error if "Object" is hidden by an import
+ // Bug 336152 - [compiler] incompatible cast error if "Object" is hidden by an import
public void test927_getAllRoles6() {
runConformTest(
new String[] {
"Team927gar6.java",
- "import t927gar6.Object;\n" +
- "\n" +
- "public team class Team927gar6 {\n" +
- " protected class R playedBy Object {\n" +
- " protected R() { base(); }\n" +
- " toString => toString;\n" +
- " \n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " Team927gar6 t = new Team927gar6();\n" +
- " t.test();\n" +
- " }\n" +
- " private void test() {\n" +
- " System.out.println(new R().toString());\n" +
- " }\n" +
+ "import t927gar6.Object;\n" +
+ "\n" +
+ "public team class Team927gar6 {\n" +
+ " protected class R playedBy Object {\n" +
+ " protected R() { base(); }\n" +
+ " toString => toString;\n" +
+ " \n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " Team927gar6 t = new Team927gar6();\n" +
+ " t.test();\n" +
+ " }\n" +
+ " private void test() {\n" +
+ " System.out.println(new R().toString());\n" +
+ " }\n" +
"}\n",
"t927gar6/Object.java",
- "package t927gar6;\n" +
- "\n" +
- "public class Object {\n" +
- " @Override\n" +
- " public String toString() {\n" +
- " return \"OK\";\n" +
- " }\n" +
+ "package t927gar6;\n" +
+ "\n" +
+ "public class Object {\n" +
+ " @Override\n" +
+ " public String toString() {\n" +
+ " return \"OK\";\n" +
+ " }\n" +
"}\n"
},
"OK");
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/callinbinding/BaseCalls.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/callinbinding/BaseCalls.java
index e4d104d07..4e4960ce1 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/callinbinding/BaseCalls.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/callinbinding/BaseCalls.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -31,11 +31,11 @@ import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
@SuppressWarnings("unchecked") // working with raw map
public class BaseCalls extends AbstractOTJLDTest {
-
+
public BaseCalls(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -43,7 +43,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -51,7 +51,7 @@ public class BaseCalls extends AbstractOTJLDTest {
public static Class testClass() {
return BaseCalls.class;
}
-
+
@Override
protected Map getCompilerOptions() {
Map options = super.getCompilerOptions();
@@ -62,7 +62,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// a role method is callin-bound as 'replace' with a single base call
// 4.5.1-otjld-single-base-call-1
public void test451_singleBaseCall1() {
-
+
runConformTest(
new String[] {
"T451sbc1Main.java",
@@ -110,7 +110,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// a role method is callin-bound as 'replace' with a single base call
// 4.5.1-otjld-single-base-call-2
public void test451_singleBaseCall2() {
-
+
runConformTest(
new String[] {
"T451sbc2Main.java",
@@ -278,7 +278,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// a role method is callin-bound as 'replace' with a single base call
// 4.5.1-otjld-single-base-call-5
public void test451_singleBaseCall5() {
-
+
runConformTest(
new String[] {
"T451sbc5Main.java",
@@ -325,7 +325,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// two callin methods have compatible but not identical signatures, each issueing a base call
// 4.5.1-otjld-single-base-call-6
public void test451_singleBaseCall6() {
-
+
runConformTest(
new String[] {
"Team451sbc6.java",
@@ -369,7 +369,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// a base call is unbound at the place of its declaration
// 4.5.2-otjld-unbound-base-call-1
public void test452_unboundBaseCall1() {
-
+
runConformTest(
new String[] {
"Team452ubc1.java",
@@ -402,7 +402,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// a base call is unbound at the place of its declaration - tsub overrides - tsubsub binds
// 4.5.2-otjld-unbound-base-call-2
public void test452_unboundBaseCall2() {
-
+
runConformTest(
new String[] {
"Team452ubc2_3.java",
@@ -578,11 +578,11 @@ public class BaseCalls extends AbstractOTJLDTest {
"} \n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team455ibc3.java (at line 4)\n" +
- " callin foo() {\n" +
- " ^^^^^\n" +
- "Return type for the method is missing\n" +
+ "----------\n" +
+ "1. ERROR in Team455ibc3.java (at line 4)\n" +
+ " callin foo() {\n" +
+ " ^^^^^\n" +
+ "Return type for the method is missing\n" +
"----------\n");
}
@@ -660,11 +660,11 @@ public class BaseCalls extends AbstractOTJLDTest {
"} \n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team455ibc6.java (at line 6)\n" +
- " base.rm2(1);\n" +
- " ^^^^^^^^^^^\n" +
- "Base call \"base.rm2(1)\" does not match the signature of the enclosing callin method (OTJLD 4.3(a)).\n" +
+ "----------\n" +
+ "1. ERROR in Team455ibc6.java (at line 6)\n" +
+ " base.rm2(1);\n" +
+ " ^^^^^^^^^^^\n" +
+ "Base call \"base.rm2(1)\" does not match the signature of the enclosing callin method (OTJLD 4.3(a)).\n" +
"----------\n");
}
@@ -692,11 +692,11 @@ public class BaseCalls extends AbstractOTJLDTest {
"} \n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team455ibc7.java (at line 9)\n" +
- " base.rm2(\"wrong\", true);\n" +
- " ^^^\n" +
- "Base call rm2(Integer, boolean) is not applicable for the arguments (String, boolean)\n" +
+ "----------\n" +
+ "1. ERROR in Team455ibc7.java (at line 9)\n" +
+ " base.rm2(\"wrong\", true);\n" +
+ " ^^^\n" +
+ "Base call rm2(Integer, boolean) is not applicable for the arguments (String, boolean)\n" +
"----------\n");
}
@@ -733,7 +733,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// a role method is callin-bound as 'replace' with multiple base call
// 4.5.6-otjld-multiple-base-calls-2
public void test456_multipleBaseCalls2() {
-
+
runConformTest(
new String[] {
"T456mbc2Main.java",
@@ -779,7 +779,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// a role method is callin-bound as 'replace' with multiple base call, binding in sub role
// 4.5.6-otjld-multiple-base-calls-2a
public void test456_multipleBaseCalls2a() {
-
+
runConformTest(
new String[] {
"T456mbc2aMain.java",
@@ -932,7 +932,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// a callin method has no result, base call is potentially missing, therefor the base client receives no result (base type)
// 4.5.7-otjld-basecall-result-not-provided-3
public void test457_basecallResultNotProvided3() {
-
+
runConformTest(
new String[] {
"T457brnp3Main.java",
@@ -978,7 +978,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// a callin method has no result, base call is potentially missing, therefor the base client receives no result (base type) - potential achieved by return
// 4.5.7-otjld-basecall-result-not-provided-3b
public void test457_basecallResultNotProvided3b() {
-
+
runConformTest(
new String[] {
"T457brnp3bMain.java",
@@ -1064,7 +1064,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// a callin method has no result, base call is potentially missing, therefor the base client receives no result (reference type)
// 4.5.7-otjld-basecall-result-not-provided-4
public void test457_basecallResultNotProvided4() {
-
+
runConformTest(
new String[] {
"T457brnp4Main.java",
@@ -1110,7 +1110,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// a callin method has no result, base call is potentially missing, therefor the base client receives no result (reference type) - via byte code
// 4.5.7-otjld-basecall-result-not-provided-5
public void test457_basecallResultNotProvided5() {
-
+
runConformTest(
new String[] {
"T457brnp5Main.java",
@@ -1163,7 +1163,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// a base call is potentially executed twice
// 4.5.8-otjld-duplicate-base-call-1
public void test458_duplicateBaseCall1() {
-
+
runConformTest(
new String[] {
"T458dbc1Main.java",
@@ -1206,7 +1206,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// a base call is definitely executed twice
// 4.5.8-otjld-duplicate-base-call-2
public void test458_duplicateBaseCall2() {
-
+
runConformTest(
new String[] {
"T458dbc2Main.java",
@@ -1285,7 +1285,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// two methods returning void are bound using replace, no basecall
// 4.5.9-otjld-missing-basecall-in-voidmethod-1
public void test459_missingBasecallInVoidmethod1() {
-
+
runConformTest(
new String[] {
"T459mbiv1Main.java",
@@ -1325,7 +1325,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// a callin method calls its tsuper version which has a base call
// 4.5.10-otjld-tsuper-instead-of-basecall-1
public void test4510_tsuperInsteadOfBasecall1() {
-
+
runConformTest(
new String[] {
"T4510tiob1Main.java",
@@ -1386,7 +1386,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// a callin method potentially calls its tsuper version which has a base call
// 4.5.10-otjld-tsuper-instead-of-basecall-2
public void test4510_tsuperInsteadOfBasecall2() {
-
+
runConformTest(
new String[] {
"T4510tiob2Main.java",
@@ -1448,7 +1448,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// a callin method calls its tsuper version which has no base call
// 4.5.10-otjld-tsuper-instead-of-basecall-3
public void test4510_tsuperInsteadOfBasecall3() {
-
+
runConformTest(
new String[] {
"T4510tiob3Main.java",
@@ -1508,7 +1508,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// a callin method creates an instance of a local class, that instance issues a base call
// 4.5.11-otjld-basecall-in-anonymous-object-1
public void test4511_basecallInAnonymousObject1() {
-
+
runConformTest(
new String[] {
"Team4511biao1.java",
@@ -1555,7 +1555,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// a base call from an anonymous object returns a value
// 4.5.11-otjld-basecall-in-anonymous-object-2
public void test4511_basecallInAnonymousObject2() {
-
+
runConformTest(
new String[] {
"Team4511biao2.java",
@@ -1649,7 +1649,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// a base call from an anonymous object returns a value - with copy inheritance
// 4.5.11-otjld-basecall-in-anonymous-object-4
public void test4511_basecallInAnonymousObject4() {
-
+
runConformTest(
new String[] {
"Team4511biao4_2.java",
@@ -1704,7 +1704,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// a base call from an anonymous object returns a value - with copy inheritance , separate compilation
// 4.5.11-otjld-basecall-in-anonymous-object-4a
public void test4511_basecallInAnonymousObject4a() {
-
+
runConformTest(
new String[] {
"Team4511biao4a_2.java",
@@ -1759,7 +1759,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// a base call from an anonymous object returns a value - with two-level copy inheritance , compile in one go
// 4.5.11-otjld-basecall-in-anonymous-object-5
public void test4511_basecallInAnonymousObject5() {
-
+
runConformTest(
new String[] {
"Team4511biao5_3.java",
@@ -1824,7 +1824,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// a base call from an anonymous object returns a value - with two-level copy inheritance , separate compilation
// 4.5.11-otjld-basecall-in-anonymous-object-5a
public void test4511_basecallInAnonymousObject5a() {
-
+
runConformTest(
new String[] {
"Team4511biao5a_3.java",
@@ -1889,7 +1889,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// a base call in a static callin method lowers its argument
// 4.5.12-otjld-basecall-requires-lowering-1
public void test4512_basecallRequiresLowering1() {
-
+
runConformTest(
new String[] {
"Team4512brl1.java",
@@ -1928,7 +1928,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// a base call invokes the super version
// 4.5.13-otjld-basecall-super-access-1
public void test4513_basecallSuperAccess1() {
-
+
runConformTest(
new String[] {
"Team4513bsa1.java",
@@ -1970,7 +1970,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// a base call invokes the super version
// 4.5.13-otjld-basecall-super-access-2
public void test4513_basecallSuperAccess2() {
-
+
runConformTest(
new String[] {
"Team4513bsa2.java",
@@ -2023,7 +2023,7 @@ public class BaseCalls extends AbstractOTJLDTest {
int l = classPaths.length;
System.arraycopy(classPaths, 0, classPaths=new String[l+1], 0, l);
classPaths[l] = this.outputRootDirectoryPath+"/regression/"+jarFilename;
-
+
runNegativeTest(
new String[] {
"T4513bsa3Main.java",
@@ -2038,32 +2038,32 @@ public class BaseCalls extends AbstractOTJLDTest {
},
(this.weavingScheme == WeavingScheme.OTRE
?
- "----------\n" +
- "1. ERROR in T4513bsa3Main.java (at line 1)\n" +
- " \n" +
- "public class T4513bsa3Main {\n" +
- " ^\n" +
- "Class file Team4513bsa3$__OT__R.class has incompatible OT/J byte code version 1.2.3, please consider a full build of the declaring project.\n" +
- "----------\n" +
- "2. ERROR in T4513bsa3Main.java (at line 0)\n" +
- " \n" +
- "public class T4513bsa3Main {\n" +
- " ^\n" +
- "Class file Team4513bsa3$__OT__Confined.class has incompatible OT/J byte code version 1.2.3, please consider a full build of the declaring project.\n" +
+ "----------\n" +
+ "1. ERROR in T4513bsa3Main.java (at line 1)\n" +
+ " \n" +
+ "public class T4513bsa3Main {\n" +
+ " ^\n" +
+ "Class file Team4513bsa3$__OT__R.class has incompatible OT/J byte code version 1.2.3, please consider a full build of the declaring project.\n" +
+ "----------\n" +
+ "2. ERROR in T4513bsa3Main.java (at line 0)\n" +
+ " \n" +
+ "public class T4513bsa3Main {\n" +
+ " ^\n" +
+ "Class file Team4513bsa3$__OT__Confined.class has incompatible OT/J byte code version 1.2.3, please consider a full build of the declaring project.\n" +
"----------\n"
:
- "----------\n" +
- "1. ERROR in T4513bsa3Main.java (at line 1)\n" +
- " \n" +
- "public class T4513bsa3Main {\n" +
- " ^\n" +
- "Class file Team4513bsa3$__OT__R.class has incompatible OT/J byte code version 1.2.3, please consider a full build of the declaring project.\n" +
- "----------\n" +
- "2. ERROR in T4513bsa3Main.java (at line 0)\n" +
- " \n" +
- "public class T4513bsa3Main {\n" +
- " ^\n" +
- "Class file Team4513bsa3$__OT__R.class has been compiled for incompatible weaving target 'OTRE', please consider a full build of the declaring project.\n" +
+ "----------\n" +
+ "1. ERROR in T4513bsa3Main.java (at line 1)\n" +
+ " \n" +
+ "public class T4513bsa3Main {\n" +
+ " ^\n" +
+ "Class file Team4513bsa3$__OT__R.class has incompatible OT/J byte code version 1.2.3, please consider a full build of the declaring project.\n" +
+ "----------\n" +
+ "2. ERROR in T4513bsa3Main.java (at line 0)\n" +
+ " \n" +
+ "public class T4513bsa3Main {\n" +
+ " ^\n" +
+ "Class file Team4513bsa3$__OT__R.class has been compiled for incompatible weaving target 'OTRE', please consider a full build of the declaring project.\n" +
"----------\n"
),
classPaths,
@@ -2073,7 +2073,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// a callin method has a base super call, same base method is bound by two roles
// 4.5.13-otjld-basecall-super-access-4
public void test4513_basecallSuperAccess4() {
-
+
runConformTest(
new String[] {
"Team4513bsa4_2.java",
@@ -2126,7 +2126,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// a callin method has a base super call, super method is bound by another role
// 4.5.13-otjld-basecall-super-access-5
public void test4513_basecallSuperAccess5() {
-
+
runConformTest(
new String[] {
"Team4513bsa5_2.java",
@@ -2206,7 +2206,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// a role-of-role issues a base call
// 4.5.14-otjld-basecall-to-lower-role-1
public void test4514_basecallToLowerRole1() {
-
+
runConformTest(
new String[] {
"Team4514btlr1_2.java",
@@ -2249,7 +2249,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// a role-of-role issues a base call - base team involves implicit inheritance
// 4.5.14-otjld-basecall-to-lower-role-2
public void test4514_basecallToLowerRole2() {
-
+
runConformTest(
new String[] {
"Team4514btlr2_2.java",
@@ -2297,7 +2297,7 @@ public class BaseCalls extends AbstractOTJLDTest {
// a role-of-role issues a base call - base team involves both kinds of inheritance
// 4.5.14-otjld-basecall-to-lower-role-3
public void test4514_basecallToLowerRole3() {
-
+
runConformTest(
new String[] {
"Team4514btlr3_2.java",
@@ -2343,7 +2343,7 @@ public class BaseCalls extends AbstractOTJLDTest {
},
"R2_1:okR1_1:okK");
}
-
+
// a callin with base call is involved in both explicit and implicit inheritance
// witness for "Cannot generate method ci(), tsuper method has corrupt byte code"
public void test4516_inheritedBaseCall1() {
@@ -2387,7 +2387,7 @@ public class BaseCalls extends AbstractOTJLDTest {
},
"T1.cibm");
}
-
+
// a callin with base call is involved in both explicit and implicit inheritance
// witness for bogus complaint re missing base call
public void test4516_inheritedBaseCall2() {
@@ -2483,25 +2483,25 @@ public class BaseCalls extends AbstractOTJLDTest {
"}\n"
},
true,
- "----------\n" +
- "1. ERROR in Team4516ibc3_1.java (at line 4)\n" +
- " callin void ci(boolean f) {\n" +
- " ^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in Team4516ibc3_1.java (at line 4)\n" +
+ " callin void ci(boolean f) {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Potentially missing base call in callin method (OTJLD 4.3(b)).\n" +
+ "----------\n" +
+ "2. ERROR in Team4516ibc3_1.java (at line 10)\n" +
+ " callin void ci(boolean f) {\n" +
+ " ^^^^^^^^^^^^^\n" +
"Potentially missing base call in callin method (OTJLD 4.3(b)).\n" +
- "----------\n" +
- "2. ERROR in Team4516ibc3_1.java (at line 10)\n" +
- " callin void ci(boolean f) {\n" +
- " ^^^^^^^^^^^^^\n" +
- "Potentially missing base call in callin method (OTJLD 4.3(b)).\n" +
"----------\n",
"R1.ciR0.cibmR1.ciR0.ci",
- null/*expectedErrorString*/,
+ null/*expectedErrorString*/,
true/*forceExecution*/,
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
null/*vmArguments*/,
customOptions/*customOptions*/,
- null/*requestor*/,
+ null/*requestor*/,
true/*skipJava*/);
}
@@ -2551,25 +2551,25 @@ public class BaseCalls extends AbstractOTJLDTest {
"}\n"
},
true,
- "----------\n" +
- "1. ERROR in Team4516ibc4_1.java (at line 4)\n" +
- " callin void ci(int i) {\n" +
- " ^^^^^^^^^\n" +
- "Potentially missing base call in callin method (OTJLD 4.3(b)).\n" +
"----------\n" +
- "2. ERROR in Team4516ibc4_1.java (at line 11)\n" +
- " callin void ci(int i) {\n" +
- " ^^^^^^^^^\n" +
- "Potentially missing base call in callin method (OTJLD 4.3(b)).\n" +
+ "1. ERROR in Team4516ibc4_1.java (at line 4)\n" +
+ " callin void ci(int i) {\n" +
+ " ^^^^^^^^^\n" +
+ "Potentially missing base call in callin method (OTJLD 4.3(b)).\n" +
+ "----------\n" +
+ "2. ERROR in Team4516ibc4_1.java (at line 11)\n" +
+ " callin void ci(int i) {\n" +
+ " ^^^^^^^^^\n" +
+ "Potentially missing base call in callin method (OTJLD 4.3(b)).\n" +
"----------\n",
"R1.ciR1.ciR0.ciR1.ciR0.cibm",
- null/*expectedErrorString*/,
+ null/*expectedErrorString*/,
true/*forceExecution*/,
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
null/*vmArguments*/,
customOptions/*customOptions*/,
- null/*requestor*/,
+ null/*requestor*/,
true/*skipJava*/);
}
@@ -2600,7 +2600,7 @@ public class BaseCalls extends AbstractOTJLDTest {
" @Override\n" +
" callin void ci(int i) {\n" +
" System.out.print(\"R1.ci\");\n" +
- " base.ci(i);\n" + // definite
+ " base.ci(i);\n" + // definite
" if (i > 0)\n" +
" super.ci(i);\n" + // plus potential -> potentially duplicate
" }\n" +
@@ -2622,25 +2622,25 @@ public class BaseCalls extends AbstractOTJLDTest {
"}\n"
},
true,
- "----------\n" +
- "1. ERROR in Team4516ibc5_1.java (at line 8)\n" +
- " super.ci(i);\n" +
- " ^^^^^^^^^^^\n" +
- "Potentially duplicate base call (OTJLD 4.3(c)).\n" +
- "----------\n" +
- "2. ERROR in Team4516ibc5_1.java (at line 12)\n" +
- " callin void ci(int i) {\n" +
- " ^^^^^^^^^\n" +
- "Potentially missing base call in callin method (OTJLD 4.3(b)).\n" +
+ "----------\n" +
+ "1. ERROR in Team4516ibc5_1.java (at line 8)\n" +
+ " super.ci(i);\n" +
+ " ^^^^^^^^^^^\n" +
+ "Potentially duplicate base call (OTJLD 4.3(c)).\n" +
+ "----------\n" +
+ "2. ERROR in Team4516ibc5_1.java (at line 12)\n" +
+ " callin void ci(int i) {\n" +
+ " ^^^^^^^^^\n" +
+ "Potentially missing base call in callin method (OTJLD 4.3(b)).\n" +
"----------\n",
"R1.cibm-R1.cibmR0.ci-R1.cibmR0.cibm",
- null/*expectedErrorString*/,
+ null/*expectedErrorString*/,
true/*forceExecution*/,
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
null/*vmArguments*/,
customOptions/*customOptions*/,
- null/*requestor*/,
+ null/*requestor*/,
true/*skipJava*/);
}
@@ -2656,11 +2656,11 @@ public class BaseCalls extends AbstractOTJLDTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in MyTeam.java (at line 4)\n" +
- " base.foo(missing, false);\n" +
- " ^^^^^^^\n" +
- "missing cannot be resolved to a variable\n" +
+ "----------\n" +
+ "1. ERROR in MyTeam.java (at line 4)\n" +
+ " base.foo(missing, false);\n" +
+ " ^^^^^^^\n" +
+ "missing cannot be resolved to a variable\n" +
"----------\n");
}
@@ -2676,11 +2676,11 @@ public class BaseCalls extends AbstractOTJLDTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in MyTeam.java (at line 4)\n" +
- " base.foo(1, false);\n" +
- " ^^^\n" +
- "Base call foo(int, int) is not applicable for the arguments (int, boolean)\n" +
+ "----------\n" +
+ "1. ERROR in MyTeam.java (at line 4)\n" +
+ " base.foo(1, false);\n" +
+ " ^^^\n" +
+ "Base call foo(int, int) is not applicable for the arguments (int, boolean)\n" +
"----------\n");
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/callinbinding/CallinMethodBinding.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/callinbinding/CallinMethodBinding.java
index 4a23964d8..04f26605e 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/callinbinding/CallinMethodBinding.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/callinbinding/CallinMethodBinding.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2020 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -27,11 +27,11 @@ import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
@SuppressWarnings("unchecked")
public class CallinMethodBinding extends AbstractOTJLDTest {
-
+
public CallinMethodBinding(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -39,7 +39,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -51,7 +51,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a role method is callin-bound as 'before' to a method in the direct base class
// 4.1.1-otjld-before-callin-binding-1
public void test411_beforeCallinBinding1() {
-
+
runConformTest(
new String[] {
"T411bcb1Main.java",
@@ -103,7 +103,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a role method is callin-bound as 'after' to a method in the base class of the implicit superrole
// 4.1.1-otjld-before-callin-binding-2
public void test411_beforeCallinBinding2() {
-
+
runConformTest(
new String[] {
"T411bcb2Main.java",
@@ -163,7 +163,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a role method is callin-bound as 'replace' to a method in the base class of the explicit superrole
// 4.1.1-otjld-before-callin-binding-3
public void test411_beforeCallinBinding3() {
-
+
runConformTest(
new String[] {
"T411bcb3Main.java",
@@ -217,7 +217,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a replace binding mentions a buggy callin method
// 4.1.1-otjld-before-callin-binding-3f
public void test411_beforeCallinBinding3f() {
-
+
runNegativeTest(
new String[] {
"p1/T411bcb3f.java",
@@ -259,26 +259,26 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in p2\\Team411bcb3f_2.java (at line 11)\n" +
- " Team411bcb3f_1.this.r= this;\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "No enclosing instance of the type Team411bcb3f_1 is accessible in scope\n" +
- "----------\n" +
- "2. ERROR in p2\\Team411bcb3f_2.java (at line 11)\n" +
- " Team411bcb3f_1.this.r= this;\n" +
- " ^\n" +
- "The field Team411bcb3f_1.r is not visible\n" +
- "----------\n" +
- "3. ERROR in p2\\Team411bcb3f_2.java (at line 13)\n" +
- " Team411bcb3f_1.this.r= null;\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "No enclosing instance of the type Team411bcb3f_1 is accessible in scope\n" +
- "----------\n" +
- "4. ERROR in p2\\Team411bcb3f_2.java (at line 13)\n" +
- " Team411bcb3f_1.this.r= null;\n" +
- " ^\n" +
- "The field Team411bcb3f_1.r is not visible\n" +
+ "----------\n" +
+ "1. ERROR in p2\\Team411bcb3f_2.java (at line 11)\n" +
+ " Team411bcb3f_1.this.r= this;\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "No enclosing instance of the type Team411bcb3f_1 is accessible in scope\n" +
+ "----------\n" +
+ "2. ERROR in p2\\Team411bcb3f_2.java (at line 11)\n" +
+ " Team411bcb3f_1.this.r= this;\n" +
+ " ^\n" +
+ "The field Team411bcb3f_1.r is not visible\n" +
+ "----------\n" +
+ "3. ERROR in p2\\Team411bcb3f_2.java (at line 13)\n" +
+ " Team411bcb3f_1.this.r= null;\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "No enclosing instance of the type Team411bcb3f_1 is accessible in scope\n" +
+ "----------\n" +
+ "4. ERROR in p2\\Team411bcb3f_2.java (at line 13)\n" +
+ " Team411bcb3f_1.this.r= null;\n" +
+ " ^\n" +
+ "The field Team411bcb3f_1.r is not visible\n" +
"----------\n",
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
@@ -308,7 +308,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a role method is callin-bound as 'replace' to a method in the base class of a remote superrole
// 4.1.1-otjld-before-callin-binding-4
public void test411_beforeCallinBinding4() {
-
+
runConformTest(
new String[] {
"T411bcb4Main.java",
@@ -377,7 +377,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a role method is callin-bound as 'replace' to a method in the base class of a remote superrole
// 4.1.1-otjld-before-callin-binding-5
public void test411_beforeCallinBinding5() {
-
+
runConformTest(
new String[] {
"T411bcb5Main.java",
@@ -520,7 +520,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
" public String getValue(String arg) {\n" +
" return arg;\n" +
" }\n" +
- "}\n"
+ "}\n"
});
runConformTest(
new String[] {
@@ -618,7 +618,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a role method is callin-bound as 'replace' and overwrites a replace callin-binding in the superrole, named callin
// 4.1.3-otjld-overwriting-inherited-callin-binding-1
public void test413_overwritingInheritedCallinBinding1() {
-
+
runConformTest(
new String[] {
"T413oicb1Main.java",
@@ -676,7 +676,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a role method is callin-bound as 'replace' and adds to a replace callin-binding in the superrole, precedence used
// 4.1.3-otjld-overwriting-inherited-callin-binding-1a
public void test413_overwritingInheritedCallinBinding1a() {
-
+
runConformTest(
new String[] {
"T413oicb1aMain.java",
@@ -853,12 +853,12 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
"4.8");
}
- // a role method is callin-bound as 'replace' and overwrites a name replace callin-binding in the superrole,
+ // a role method is callin-bound as 'replace' and overwrites a name replace callin-binding in the superrole,
// NOTE: mapping overriding along 'extends' is not yet defined.
// Is problematic because both bindings will exist within the same team!
// 4.1.3-otjld-overwriting-inherited-callin-binding-2
public void test413_overwritingInheritedCallinBinding2() {
-
+
runConformTest(
new String[] {
"T413oicb2Main.java",
@@ -998,7 +998,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a role method is callin-bound as 'replace' and overwrites a before callin-binding in the remote superrole
// 4.1.3-otjld-overwriting-inherited-callin-binding-3
public void test413_overwritingInheritedCallinBinding3() {
-
+
runConformTest(
new String[] {
"T413oicb3Main.java",
@@ -1170,7 +1170,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a role class callin-binds to a not-accessible base method
// 4.1.5-otjld-nonexisting-base-method-3a
public void test415_nonexistingBaseMethod3a() {
-
+
runConformTest(
new String[] {
"Team415nbm3a.java",
@@ -1255,7 +1255,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a role class callin-binds to a not-accessible base method - with base call - double compile
// 4.1.5-otjld-nonexisting-base-method-3f
public void test415_nonexistingBaseMethod3f() {
-
+
runConformTest(
new String[] {
"T415nbm3fMain.java",
@@ -1427,7 +1427,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a role class callin-binds to a not-accessible base method
// 4.1.5-otjld-nonexisting-base-method-4
public void test415_nonexistingBaseMethod4() {
-
+
runConformTest(
new String[] {
"p2/Team415nbm4.java",
@@ -1496,7 +1496,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a role class callin-binds as 'replace' a role method with no return type whereas the base method has one
// 4.1.5-otjld-nonexisting-base-method-6
public void test415_nonexistingBaseMethod6() {
-
+
runConformTest(
new String[] {
"Team415nbm6.java",
@@ -1773,11 +1773,11 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team415nbm15.java (at line 5)\n" +
- " test <- replace test(String a);\n" +
- " ^^^^^^^\n" +
- "Syntax error on token \"replace\", invalid MethodSpecsShort\n" +
+ "----------\n" +
+ "1. ERROR in Team415nbm15.java (at line 5)\n" +
+ " test <- replace test(String a);\n" +
+ " ^^^^^^^\n" +
+ "Syntax error on token \"replace\", invalid MethodSpecsShort\n" +
"----------\n");
}
@@ -2091,7 +2091,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a role class callin-binds a non-protected role method
// 4.1.9-otjld-nonexisting-role-method-4
public void test419_nonexistingRoleMethod4() {
-
+
runConformTest(
new String[] {
"p2/Team419nrm4_2.java",
@@ -2294,7 +2294,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a role method is callin-bound as 'before' to multiple base methods
// 4.1.12-otjld-callin-binding-multiple-base-methods-1
public void test4112_callinBindingMultipleBaseMethods1() {
-
+
runConformTest(
new String[] {
"T4112cbmbm1Main.java",
@@ -2363,7 +2363,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a role method is callin-bound as 'after' to multiple base methods
// 4.1.12-otjld-callin-binding-multiple-base-methods-2
public void test4112_callinBindingMultipleBaseMethods2() {
-
+
runConformTest(
new String[] {
"T4112cbmbm2Main.java",
@@ -2451,7 +2451,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a role method is callin-bound as 'replace' to multiple base methods
// 4.1.12-otjld-callin-binding-multiple-base-methods-3
public void test4112_callinBindingMultipleBaseMethods3() {
-
+
runConformTest(
new String[] {
"T4112cbmbm3Main.java",
@@ -2520,7 +2520,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a role method is callin-bound as 'replace' to multiple base methods - this requires exact signature matches
// 4.1.12-otjld-callin-binding-multiple-base-methods-5
public void test4112_callinBindingMultipleBaseMethods5() {
-
+
runConformTest(
new String[] {
"T4112cbmbm5Main.java",
@@ -2678,7 +2678,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a role method without a return type is callin-bound as 'before' to a base method with a return type
// 4.1.13-otjld-base-return-value-1
public void test4113_baseReturnValue1() {
-
+
runConformTest(
new String[] {
"T4113brv1Main.java",
@@ -2723,7 +2723,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a role method without a return type is callin-bound as 'after' to a base method with a return type
// 4.1.13-otjld-base-return-value-2
public void test4113_baseReturnValue2() {
-
+
runConformTest(
new String[] {
"T4113brv2Main.java",
@@ -2768,7 +2768,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a role method without a return type is callin-bound as 'replace' to a base method with a return type , "return" must be translated to return null
// 4.1.13-otjld-base-return-value-3
public void test4113_baseReturnValue3() {
-
+
runConformTest(
new String[] {
"T4113brv3Main.java",
@@ -2821,7 +2821,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a role method without a return type is callin-bound as 'replace' to a base method with a base return type
// 4.1.13-otjld-base-return-value-4
public void test4113_baseReturnValue4() {
-
+
runConformTest(
new String[] {
"T4113brv4Main.java",
@@ -2874,7 +2874,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a role method a base return type is callin-bound as 'replace', testing boxing/unboxing in translated code
// 4.1.13-otjld-base-return-value-5
public void test4113_baseReturnValue5() {
-
+
runConformTest(
new String[] {
"T4113brv5Main.java",
@@ -2967,7 +2967,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a role method with a return type is callin-bound as 'before' to a base method without a return type
// 4.1.15-otjld-ignore-role-method-return-value-1
public void test4115_ignoreRoleMethodReturnValue1() {
-
+
runConformTest(
new String[] {
"T4115irmrv1Main.java",
@@ -3013,7 +3013,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a role method with a return type is callin-bound as 'after' to a base method without a return type
// 4.1.15-otjld-ignore-role-method-return-value-2
public void test4115_ignoreRoleMethodReturnValue2() {
-
+
runConformTest(
new String[] {
"T4115irmrv2Main.java",
@@ -3059,7 +3059,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a role method with a return type is callin-bound as 'after' to a base method with a matching return type
// expect warning
public void test4115_ignoreRoleMethodReturnValue3() {
-
+
runTestExpectingWarnings(
new String[] {
"T4115irmrv3.java",
@@ -3085,11 +3085,11 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. WARNING in Team4115irmrv3.java (at line 8)\n" +
- " test <- after test;\n" +
- " ^^^^\n" +
- "Callin after binding cannot return a value to the base caller, role method return value of type int will be ignored (OTJLD 4.4(a)).\n" +
+ "----------\n" +
+ "1. WARNING in Team4115irmrv3.java (at line 8)\n" +
+ " test <- after test;\n" +
+ " ^^^^\n" +
+ "Callin after binding cannot return a value to the base caller, role method return value of type int will be ignored (OTJLD 4.4(a)).\n" +
"----------\n");
}
@@ -3178,11 +3178,11 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team4115irmrv3s.java (at line 8)\n" +
- " int test() <- after int test();\n" +
- " ^^^\n" +
- "Callin after binding cannot return a value to the base caller, role method return value of type int will be ignored (OTJLD 4.4(a)).\n" +
+ "----------\n" +
+ "1. ERROR in Team4115irmrv3s.java (at line 8)\n" +
+ " int test() <- after int test();\n" +
+ " ^^^\n" +
+ "Callin after binding cannot return a value to the base caller, role method return value of type int will be ignored (OTJLD 4.4(a)).\n" +
"----------\n",
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
@@ -3192,7 +3192,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a role method with a return type is callin-bound as 'after' to a base method without a return type
// warning suppressed
public void test4115_ignoreRoleMethodReturnValue4() {
-
+
runConformTest(
new String[] {
"T4115irmrv4Main.java",
@@ -3377,11 +3377,11 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team4117iuocm2.java (at line 8)\n" +
- " void test1() <- after void test();\n" +
- " ^^^^^^^^^^^^\n" +
- "Cannot bind callin method test1() using \"after\" (OTJLD 4.2(d)).\n" +
+ "----------\n" +
+ "1. ERROR in Team4117iuocm2.java (at line 8)\n" +
+ " void test1() <- after void test();\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Cannot bind callin method test1() using \"after\" (OTJLD 4.2(d)).\n" +
"----------\n");
}
@@ -3515,7 +3515,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a callin binding binds an implicitly inherted method which has a role parameter
// 4.1.22-otjld-binding-tsuper-method-with-signature
public void test4122_bindingTsuperMethodWithSignature() {
-
+
runConformTest(
new String[] {
"Team4122btmws_2.java",
@@ -3642,7 +3642,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a after callin binding maps "result" to an argument
// 4.1.25-otjld-result-in-after-binding-1
public void test4125_resultInAfterBinding1() {
-
+
runConformTest(
new String[] {
"Team4125riab1.java",
@@ -3709,43 +3709,43 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
runConformTest(
new String[] {
"Team4125rims3.java",
- "import java.util.ArrayList;\n" +
- "import java.util.List;\n" +
- "\n" +
- "public team class Team4125rims3 {\n" +
- "\n" +
- " protected class R playedBy T4125rims3 {\n" +
- " <T> void safeAppend(T el, List<T> result) <- replace void append(T el, List<T> result);\n" +
- " callin <T> void safeAppend(T el, List<T> result) {\n" +
- " if (el != null)\n" +
- " base.safeAppend(el, result);\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new Team4125rims3().activate();\n" +
- " List<String> strings = new ArrayList<String>();\n" +
- " strings.add(\"O\");\n" +
- " T4125rims3 appender = new T4125rims3();\n" +
- " appender.append(null, strings);\n" +
- " appender.append(\"K\", strings);\n" +
- " for (String string : strings) {\n" +
- " System.out.print(string);\n" +
- " }\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "public team class Team4125rims3 {\n" +
+ "\n" +
+ " protected class R playedBy T4125rims3 {\n" +
+ " <T> void safeAppend(T el, List<T> result) <- replace void append(T el, List<T> result);\n" +
+ " callin <T> void safeAppend(T el, List<T> result) {\n" +
+ " if (el != null)\n" +
+ " base.safeAppend(el, result);\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new Team4125rims3().activate();\n" +
+ " List<String> strings = new ArrayList<String>();\n" +
+ " strings.add(\"O\");\n" +
+ " T4125rims3 appender = new T4125rims3();\n" +
+ " appender.append(null, strings);\n" +
+ " appender.append(\"K\", strings);\n" +
+ " for (String string : strings) {\n" +
+ " System.out.print(string);\n" +
+ " }\n" +
+ " }\n" +
"}\n",
"T4125rims3.java",
- "import java.util.List;\n" +
- "\n" +
- "\n" +
- "public class T4125rims3 {\n" +
- " <T> void append(T el, List<T> result) {\n" +
- " result.add(el);\n" +
- " }\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "\n" +
+ "public class T4125rims3 {\n" +
+ " <T> void append(T el, List<T> result) {\n" +
+ " result.add(el);\n" +
+ " }\n" +
"}\n",
},
"OK");
}
-
+
// a callin binding has a label
// 4.1.26-otjld-name-callin-binding-1
public void test4126_nameCallinBinding1() {
@@ -3886,7 +3886,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a team has a precedence declaration
// 4.1.27-otjld-precedence-declaration-1
public void test4127_precedenceDeclaration1() {
-
+
runConformTest(
new String[] {
"Team4127pd1.java",
@@ -3922,7 +3922,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
}
// a team has a class-level precedence declaration
public void test4127_precedenceDeclaration1c() {
-
+
runConformTest(
new String[] {
"Team4127pd1c.java",
@@ -3962,7 +3962,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a team has two precedence declarations
// 4.1.27-otjld-precedence-declaration-2
public void test4127_precedenceDeclaration2() {
-
+
runConformTest(
new String[] {
"Team4127pd2.java",
@@ -4005,7 +4005,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a role has a precedence declaration
// 4.1.27-otjld-precedence-declaration-3
public void test4127_precedenceDeclaration3() {
-
+
runConformTest(
new String[] {
"Team4127pd3.java",
@@ -4043,7 +4043,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a role has two precedence declarations
// 4.1.27-otjld-precedence-declaration-4
public void test4127_precedenceDeclaration4() {
-
+
runConformTest(
new String[] {
"Team4127pd4.java",
@@ -4086,7 +4086,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a team has a precedence declaration for replace bindings
// 4.1.27-otjld-precedence-declaration-5
public void test4127_precedenceDeclaration5() {
-
+
runConformTest(
new String[] {
"Team4127pd5.java",
@@ -4128,7 +4128,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a team has a precedence declaration for replace bindings - base call omitted
// 4.1.27-otjld-precedence-declaration-6
public void test4127_precedenceDeclaration6() {
-
+
runConformTest(
new String[] {
"T4127pd6Main.java",
@@ -4173,7 +4173,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a team has a precedence declaration for replace bindings - explicitly thrown LiftingVetoException
// 4.1.27-otjld-precedence-declaration-7
public void test4127_precedenceDeclaration7() {
-
+
runConformTest(
new String[] {
"Team4127pd7.java",
@@ -4222,7 +4222,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a team has a precedence declaration for replace bindings - guard forbids lifting
// 4.1.27-otjld-precedence-declaration-8
public void test4127_precedenceDeclaration8() {
-
+
runConformTest(
new String[] {
"Team4127pd8.java",
@@ -4264,7 +4264,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// two teams have precedence declarations for replace bindings - guard forbids lifting
// 4.1.27-otjld-precedence-declaration-9
public void test4127_precedenceDeclaration9() {
-
+
runConformTest(
new String[] {
"Team4127pd9.java",
@@ -4326,7 +4326,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a team has a precedence declaration - subteam adds another one
// 4.1.27-otjld-precedence-declaration-10
public void test4127_precedenceDeclaration10() {
-
+
runConformTest(
new String[] {
"Team4127pd10_2.java",
@@ -4376,7 +4376,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a team has a precedence declaration - subteam adds another one - within packages
// 4.1.27-otjld-precedence-declaration-10p
public void test4127_precedenceDeclaration10p() {
-
+
runConformTest(
new String[] {
"p2/Team4127pd10p_2.java",
@@ -4429,7 +4429,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a nested team has a precedence declaration
// 4.1.27-otjld-precedence-declaration-11
public void test4127_precedenceDeclaration11() {
-
+
runConformTest(
new String[] {
"Team4127pd11_2.java",
@@ -4478,7 +4478,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a nested team has a precedence declaration - in a package
// 4.1.27-otjld-precedence-declaration-11p
public void test4127_precedenceDeclaration11p() {
-
+
runConformTest(
new String[] {
"p2/Team4127pd11p_2.java",
@@ -4531,7 +4531,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a nested team has a precedence declaration - in a package - compile in one go
// 4.1.27-otjld-precedence-declaration-11P
public void test4127_precedenceDeclaration11P() {
-
+
runConformTest(
new String[] {
"p2/Team4127pd11P_2.java",
@@ -4584,7 +4584,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a precedence is not needed because lifting has no overlap (witness for TPX-418 comment 2)
// 4.1.27-otjld-precedence-declaration-12
public void test4127_precedenceDeclaration12() {
-
+
runConformTest(
new String[] {
"Team4127pd12.java",
@@ -4625,7 +4625,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
},
"O?K!");
}
-
+
// precedence for two after callin bindings, missing "after" modifier
public void test4127_precedenceDeclaration13() {
runNegativeTest(
@@ -4644,20 +4644,20 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
"public class T4127pd13 {\n" +
" void test() { System.out.print(\"O\"); }\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in Team4127pd13.java (at line 7)\n" +
- " precedence c2, c1;\n" +
- " ^^\n" +
- "\'precedence\' declaration for \'after\' binding must be specified as \'precedence after\' (OTJLD 4.8(a)).\n" +
- "----------\n" +
- "2. ERROR in Team4127pd13.java (at line 7)\n" +
- " precedence c2, c1;\n" +
- " ^^\n" +
- "\'precedence\' declaration for \'after\' binding must be specified as \'precedence after\' (OTJLD 4.8(a)).\n" +
+ },
+ "----------\n" +
+ "1. ERROR in Team4127pd13.java (at line 7)\n" +
+ " precedence c2, c1;\n" +
+ " ^^\n" +
+ "\'precedence\' declaration for \'after\' binding must be specified as \'precedence after\' (OTJLD 4.8(a)).\n" +
+ "----------\n" +
+ "2. ERROR in Team4127pd13.java (at line 7)\n" +
+ " precedence c2, c1;\n" +
+ " ^^\n" +
+ "\'precedence\' declaration for \'after\' binding must be specified as \'precedence after\' (OTJLD 4.8(a)).\n" +
"----------\n");
}
-
+
// precedence after for two callin bindings, one without the "after" modifier
public void test4127_precedenceDeclaration14() {
runNegativeTest(
@@ -4676,15 +4676,15 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
"public class T4127pd14 {\n" +
" void test() { System.out.print(\"O\"); }\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in Team4127pd14.java (at line 7)\n" +
- " precedence after c2, c1;\n" +
- " ^^\n" +
- "\'precedence after\' declaration cannot refer to \'before\' bindings (OTJLD 4.8(a)).\n" +
+ },
+ "----------\n" +
+ "1. ERROR in Team4127pd14.java (at line 7)\n" +
+ " precedence after c2, c1;\n" +
+ " ^^\n" +
+ "\'precedence after\' declaration cannot refer to \'before\' bindings (OTJLD 4.8(a)).\n" +
"----------\n");
}
-
+
// merging precedence declarations from two nesting levels:
public void test4127_precedenceDeclaration15() {
runConformTest(
@@ -4804,46 +4804,46 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Team4127pd17.java (at line 4)\n" +
- " precedence MyRoleB.bl1, MyRoleB.bl2;\n" +
- " ^^^^^^^^^^^\n" +
- "MyRoleB cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in Team4127pd17.java (at line 4)\n" +
- " precedence MyRoleB.bl1, MyRoleB.bl2;\n" +
- " ^^^^^^^^^^^\n" +
- "MyRoleB cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in Team4127pd17.java (at line 8)\n" +
- " bl1: rm <- before bm;\n" +
- " ^^^\n" +
- "\'before\' callin bindings Team4127pd17.MyRoleB.bl1 and Team4127pd17.MyRoleB.bl2 refer to the same base method; must declare precedence of these bindings (OTJLD 4.8).\n" +
- "----------\n" +
- "4. ERROR in Team4127pd17.java (at line 18)\n" +
- " rm <- before bm;\n" +
- " ^^\n" +
- "\'before\' callin bindings Team4127pd17.MyRoleA.<Team4127pd17:18,2> and Team4127pd17.MyRoleB.bl2 refer to the same base method; must declare precedence of these bindings (OTJLD 4.8).\n" +
+ "----------\n" +
+ "1. ERROR in Team4127pd17.java (at line 4)\n" +
+ " precedence MyRoleB.bl1, MyRoleB.bl2;\n" +
+ " ^^^^^^^^^^^\n" +
+ "MyRoleB cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in Team4127pd17.java (at line 4)\n" +
+ " precedence MyRoleB.bl1, MyRoleB.bl2;\n" +
+ " ^^^^^^^^^^^\n" +
+ "MyRoleB cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in Team4127pd17.java (at line 8)\n" +
+ " bl1: rm <- before bm;\n" +
+ " ^^^\n" +
+ "\'before\' callin bindings Team4127pd17.MyRoleB.bl1 and Team4127pd17.MyRoleB.bl2 refer to the same base method; must declare precedence of these bindings (OTJLD 4.8).\n" +
+ "----------\n" +
+ "4. ERROR in Team4127pd17.java (at line 18)\n" +
+ " rm <- before bm;\n" +
+ " ^^\n" +
+ "\'before\' callin bindings Team4127pd17.MyRoleA.<Team4127pd17:18,2> and Team4127pd17.MyRoleB.bl2 refer to the same base method; must declare precedence of these bindings (OTJLD 4.8).\n" +
"----------\n");
}
-
+
// Bug 332893 - Class Precedence not working between Role callin and SubRole callin
public void test4127_precedenceDeclaration18 () {
runNegativeTest(
new String[] {
"PrecBug.java",
- "public team class PrecBug {\n" +
- " precedence after RA.RB, RA;\n" +
- " protected team class RA playedBy A {\n" +
+ "public team class PrecBug {\n" +
+ " precedence after RA.RB, RA;\n" +
+ " protected team class RA playedBy A {\n" +
" void some(String v) <- after void myMethod2()\n" +
- " with { v <- \"RA\" }\n" +
+ " with { v <- \"RA\" }\n" +
" void some(String v) {\n" +
- " System.out.print(\"some\"+v);\n" +
- " }\n" +
- " protected class RB playedBy B {\n" +
+ " System.out.print(\"some\"+v);\n" +
+ " }\n" +
+ " protected class RB playedBy B {\n" +
" void some(String v) <- after void myMethod2()" +
- " with { v <- \"RB\" }\n" +
- " }\n" +
+ " with { v <- \"RB\" }\n" +
+ " }\n" +
" }\n" +
" public PrecBug(A as RA a) {\n" +
" a.activate();\n" +
@@ -4852,7 +4852,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
" B b = new B();\n" +
" new PrecBug(b).activate();\n" +
" new B().myMethod2();\n" +
- " }\n" +
+ " }\n" +
"}\n",
"A.java",
"public class A {\n" +
@@ -4861,35 +4861,35 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
"B.java",
"public class B extends A {\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in PrecBug.java (at line 2)\n" +
- " precedence after RA.RB, RA;\n" +
- " ^^^^^^^^^^\n" +
- "\'precedence\' declaration can only refer to direct role classes, however PrecBug.RA.RB is a nested role of team PrecBug.RA (OTJLD 4.8).\n" +
+ },
+ "----------\n" +
+ "1. ERROR in PrecBug.java (at line 2)\n" +
+ " precedence after RA.RB, RA;\n" +
+ " ^^^^^^^^^^\n" +
+ "\'precedence\' declaration can only refer to direct role classes, however PrecBug.RA.RB is a nested role of team PrecBug.RA (OTJLD 4.8).\n" +
"----------\n");
}
-
+
// Bug 335777 - [compiler] don't flag missing precedence if different enclosing teams
public void test4127_precedenceDeclaration19 () {
runConformTest(
new String[] {
"PrecBug19.java",
- "public team class PrecBug19 {\n" +
- " protected team class RA playedBy A {\n" +
+ "public team class PrecBug19 {\n" +
+ " protected team class RA playedBy A {\n" +
" void some(String v) <- before void myMethod2()\n" +
- " with { v <- \"RA\" }\n" +
+ " with { v <- \"RA\" }\n" +
" void some(String v) <- after void myMethod2()\n" +
- " with { v <- \"RA\" }\n" +
+ " with { v <- \"RA\" }\n" +
" void some(String v) {\n" +
- " System.out.print(\"some\"+v);\n" +
- " }\n" +
- " protected class RB playedBy B {\n" +
+ " System.out.print(\"some\"+v);\n" +
+ " }\n" +
+ " protected class RB playedBy B {\n" +
" void some(String v) <- before void myMethod2()" +
" with { v <- \"RB\" }\n" +
" void some(String v) <- after void myMethod2()" +
" with { v <- \"RB\" }\n" +
- " }\n" +
+ " }\n" +
" }\n" +
" public PrecBug19(A as RA a) {\n" +
" a.activate();\n" +
@@ -4898,7 +4898,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
" B b = new B();\n" +
" new PrecBug19(b).activate();\n" +
" new B().myMethod2();\n" +
- " }\n" +
+ " }\n" +
"}\n",
"A.java",
"public class A {\n" +
@@ -4907,7 +4907,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
"B.java",
"public class B extends A {\n" +
"}\n"
- },
+ },
"someRAsomeRB-someRBsomeRA");
}
@@ -4997,7 +4997,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a role has a precedence declaration, so has its super role
// 4.1.29-otjld-inheritance-of-precedence-declaration-1
public void test4129_inheritanceOfPrecedenceDeclaration1() {
-
+
runConformTest(
new String[] {
"Team4129iopd1.java",
@@ -5042,7 +5042,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a team has a precedence declaration by role class
// 4.1.30-otjld-class-based-precedence-declaration-1
public void test4130_classBasedPrecedenceDeclaration1() {
-
+
runConformTest(
new String[] {
"Team4130cbpd1.java",
@@ -5106,21 +5106,21 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
"} \n" +
" \n"
},
- "----------\n" +
- "1. WARNING in Team4131ilba1.java (at line 2)\n" +
- " public team class Team4131ilba1 {\n" +
- " ^^^^^^^^^^^^^\n" +
- "Potential ambiguity in role binding. The base \'T4131ilba1\' is bound to the following roles: Team4131ilba1.R1,Team4131ilba1.R2 (OTJLD 2.3.4(a)).\n" +
- "----------\n" +
- "2. ERROR in Team4131ilba1.java (at line 5)\n" +
- " rm <- after test;\n" +
- " ^^\n" +
- "Unsafe callin binding, because lifting to role Team4131ilba1.R0 may fail due to a reported binding ambiguity (OTJLD 2.3.5(c)).\n" +
- "----------\n" +
- "3. ERROR in Team4131ilba1.java (at line 5)\n" +
- " rm <- after test;\n" +
- " ^^\n" +
- "Unsafe callin binding, because lifting to role Team4131ilba1.R0 may fail due to a reported binding ambiguity (OTJLD 2.3.5(c)).\n" +
+ "----------\n" +
+ "1. WARNING in Team4131ilba1.java (at line 2)\n" +
+ " public team class Team4131ilba1 {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Potential ambiguity in role binding. The base \'T4131ilba1\' is bound to the following roles: Team4131ilba1.R1,Team4131ilba1.R2 (OTJLD 2.3.4(a)).\n" +
+ "----------\n" +
+ "2. ERROR in Team4131ilba1.java (at line 5)\n" +
+ " rm <- after test;\n" +
+ " ^^\n" +
+ "Unsafe callin binding, because lifting to role Team4131ilba1.R0 may fail due to a reported binding ambiguity (OTJLD 2.3.5(c)).\n" +
+ "----------\n" +
+ "3. ERROR in Team4131ilba1.java (at line 5)\n" +
+ " rm <- after test;\n" +
+ " ^^\n" +
+ "Unsafe callin binding, because lifting to role Team4131ilba1.R0 may fail due to a reported binding ambiguity (OTJLD 2.3.5(c)).\n" +
"----------\n");
}
@@ -5149,16 +5149,16 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
"} \n" +
" \n"
},
- "----------\n" +
- "1. WARNING in Team4131ilba2d.java (at line 2)\n" +
- " public team class Team4131ilba2d {\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Potential ambiguity in role binding. The base \'T4131ilba2d\' is bound to the following roles: Team4131ilba2d.R1,Team4131ilba2d.R2 (OTJLD 2.3.4(a)).\n" +
- "----------\n" +
- "2. ERROR in Team4131ilba2d.java (at line 7)\n" +
- " Team4131ilba2d (T4131ilba2d as R0 o) {}\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Unhandled exception type LiftingFailedException, caused by an unsafe lifting request (OTJLD 2.3.5).\n" +
+ "----------\n" +
+ "1. WARNING in Team4131ilba2d.java (at line 2)\n" +
+ " public team class Team4131ilba2d {\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Potential ambiguity in role binding. The base \'T4131ilba2d\' is bound to the following roles: Team4131ilba2d.R1,Team4131ilba2d.R2 (OTJLD 2.3.4(a)).\n" +
+ "----------\n" +
+ "2. ERROR in Team4131ilba2d.java (at line 7)\n" +
+ " Team4131ilba2d (T4131ilba2d as R0 o) {}\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Unhandled exception type LiftingFailedException, caused by an unsafe lifting request (OTJLD 2.3.5).\n" +
"----------\n");
}
@@ -5203,7 +5203,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a named callin binding is overridden by an implicit sub role
// 4.1.32-otjld-overriding-of-callin-binding-1
public void test4132_overridingOfCallinBinding1() {
-
+
runConformTest(
new String[] {
"Team4132oocb1_2.java",
@@ -5249,7 +5249,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a named callin binding is overridden by an implicit sub role - inherited precedence declaration
// 4.1.32-otjld-overriding-of-callin-binding-1a
public void test4132_overridingOfCallinBinding1a() {
-
+
runConformTest(
new String[] {
"Team4132oocb1a_2.java",
@@ -5300,7 +5300,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a named callin binding is overridden by an explicit sub role in the same team
// 4.1.32-otjld-overriding-of-callin-binding-2
public void test4132_overridingOfCallinBinding2() {
-
+
runTestExpectingWarnings(
new String[] {
"Team4132oocb2.java",
@@ -5335,11 +5335,11 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
"} \n" +
" \n"
},
- "----------\n" +
- "1. WARNING in Team4132oocb2.java (at line 7)\n" +
- " b1: rm1 <- before bm;\n" +
- " ^^\n" +
- "Callin \'b1\' is overridden in role \'R2\' within the same team, will have no effect (OTJLD 4.1(e)).\n" +
+ "----------\n" +
+ "1. WARNING in Team4132oocb2.java (at line 7)\n" +
+ " b1: rm1 <- before bm;\n" +
+ " ^^\n" +
+ "Callin \'b1\' is overridden in role \'R2\' within the same team, will have no effect (OTJLD 4.1(e)).\n" +
"----------\n",
"OK!");
}
@@ -5393,7 +5393,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a named callin binding is overridden by an explicit sub role in a sub team
// 4.1.32-otjld-overriding-of-callin-binding-3
public void test4132_overridingOfCallinBinding3() {
-
+
runConformTest(
new String[] {
"Team4132oocb3_2.java",
@@ -5439,7 +5439,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a named callin binding is overridden by an explicit sub role in a sub team - inherited precedence declaration
// 4.1.32-otjld-overriding-of-callin-binding-3a
public void test4132_overridingOfCallinBinding3a() {
-
+
runConformTest(
new String[] {
"Team4132oocb3a_2.java",
@@ -5490,7 +5490,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a named callin binding is overridden by an explicit subsub role in a sub team
// 4.1.32-otjld-overriding-of-callin-binding-4
public void test4132_overridingOfCallinBinding4() {
-
+
runConformTest(
new String[] {
"Team4132oocb4_2.java",
@@ -5537,7 +5537,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a named callin binding is overridden by an explicit subsub role in a sub team - inherited precedence declaration
// 4.1.32-otjld-overriding-of-callin-binding-4a
public void test4132_overridingOfCallinBinding4a() {
-
+
runConformTest(
new String[] {
"Team4132oocb4a_2.java",
@@ -5589,7 +5589,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a named callin binding is overridden by an explicit subsub role in the same team
// 4.1.32-otjld-overriding-of-callin-binding-5
public void test4132_overridingOfCallinBinding5() {
-
+
runConformTest(
new String[] {
"Team4132oocb5.java",
@@ -5631,7 +5631,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a callin binding overrides another, but additionally there is a precedence declaration between them
// 4.1.32-otjld-overriding-of-callin-binding-6
public void test4132_overridingOfCallinBinding6() {
-
+
runConformTest(
new String[] {
"Team4132oocb6.java",
@@ -5674,7 +5674,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a callin binding overrides another, but additionally there is a precedence declaration between them - different order
// 4.1.32-otjld-overriding-of-callin-binding-6a
public void test4132_overridingOfCallinBinding6a() {
-
+
runConformTest(
new String[] {
"Team4132oocb6a.java",
@@ -5717,7 +5717,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a callin binding overrides another, but additionally there is a precedence declaration between them
// 4.1.32-otjld-overriding-of-callin-binding-7
public void test4132_overridingOfCallinBinding7() {
-
+
runConformTest(
new String[] {
"Team4132oocb7.java",
@@ -5824,7 +5824,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a named callin binding is overridden by an explicit sub role in a sub team
// - more roles and callins
public void test4132_overridingOfCallinBinding10_source() {
-
+
runConformTest(
new String[] {
"Team4132oocb10_2.java",
@@ -5967,7 +5967,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
public void test4133_callinToPrivate2() {
//FIXME HACK:
//this.verifier = getTestVerifier(true);
-
+
runConformTest(
new String[] {
"Team4133ctp2.java",
@@ -6000,7 +6000,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a private static role method is before bound
// 4.1.33-otjld-callin-to-private-2s
public void test4133_callinToPrivate2s() {
-
+
runConformTest(
new String[] {
"Team4133ctp2s.java",
@@ -6062,7 +6062,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a try-finally block (->'ret' instruction) is used in a callin method
// 4.1.34-otjld-local-variables-in-callin-methods-1
public void test4134_localVariablesInCallinMethods1() {
-
+
runConformTest(
new String[] {
"Team4134lvicm1.java",
@@ -6103,7 +6103,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a local variable in a callin method is incremented
// 4.1.34-otjld-local-variables-in-callin-methods-2
public void test4134_localVariablesInCallinMethods2() {
-
+
runConformTest(
new String[] {
"Team4134lvicm2.java",
@@ -6142,7 +6142,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// an exception handler is used in a callin method
// 4.1.34-otjld-local-variables-in-callin-methods-3
public void test4134_localVariablesInCallinMethods3() {
-
+
runConformTest(
new String[] {
"T4134lvicmMain3.java",
@@ -6188,7 +6188,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// basic type arguments are unused in the role method signaturen
// 4.1.35-otjld-basic-type-unused-args-1
public void test4135_basicTypeUnusedArgs1() {
-
+
runConformTest(
new String[] {
"Team4135btua1.java",
@@ -6224,7 +6224,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a callin method calls its explicit super method
// 4.1.36-otjld-callin-method-with-super-1
public void test4136_callinMethodWithSuper1() {
-
+
runConformTest(
new String[] {
"Team4136cmws1.java",
@@ -6263,7 +6263,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a callin method calls its implicit super method
// 4.1.36-otjld-callin-method-with-super-2
public void test4136_callinMethodWithSuper2() {
-
+
runConformTest(
new String[] {
"Team4136cmws2_2.java",
@@ -6307,7 +6307,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a callin method calls its implicit super method which contains a base-call
// 4.1.36-otjld-callin-method-with-super-3
public void test4136_callinMethodWithSuper3() {
-
+
runConformTest(
new String[] {
"Team4136cmws3_2.java",
@@ -6421,7 +6421,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a callin binding to an inherited final method; correctly adapting the super-base
// 4.1.38-otjld-callin-to-final-2
public void test4138_callinToFinal2() {
-
+
runConformTest(
new String[] {
"Team4138ctf2.java",
@@ -6462,7 +6462,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// multiple different callins from different teams to the same base method
// 4.1.38-otjld-multiple-callin-1
public void test4138_multipleCallin1() {
-
+
runConformTest(
new String[] {
"T4138mc1Main.java",
@@ -6513,7 +6513,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// multiple different callins from different teams to the same base method - base inheritance
// 4.1.38-otjld-multiple-callin-2
public void test4138_multipleCallin2() {
-
+
runConformTest(
new String[] {
"T4138mc2Main.java",
@@ -6568,7 +6568,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// multiple different callins from different teams to the same base method - base inheritance
// simplified load order: load base before teams.
public void test4138_multipleCallin2l() {
-
+
runConformTest(
new String[] {
"T4138mc2lMain.java",
@@ -6624,7 +6624,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// multiple replaces ordered by precedence plus before/after - reported by ofrank
// 4.1.38-otjld-multiple-callin-3
public void test4138_multipleCallin3() {
-
+
runConformTest(
new String[] {
"Team4138mc3.java",
@@ -6706,7 +6706,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a callin binding intercepts a method that has an override with covariant return - static type is super-base
// 4.1.39-otjld-callin-binding-with-plus-1
public void test4139_callinBindingWithPlus1() {
-
+
runConformTest(
new String[] {
"Team4139cbwp1.java",
@@ -6745,7 +6745,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a callin binding intercepts a method that has an override with covariant return - static type is super-base - no plus used
public void test4139_callinBindingWithPlus1a() {
-
+
runConformTest(
new String[] {
"Team4139cbwp1a.java",
@@ -6785,7 +6785,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a callin binding intercepts a method that has an override with covariant return - static type is sub-base
// 4.1.39-otjld-callin-binding-with-plus-2
public void test4139_callinBindingWithPlus2() {
-
+
runConformTest(
new String[] {
"Team4139cbwp2.java",
@@ -6825,7 +6825,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// replace callin to base methods with covariant return types
// 4.1.39-otjld-callin-binding-with-plus-3
public void test4139_callinBindingWithPlus3() {
-
+
runConformTest(
new String[] {
"Team4139cbwp3.java",
@@ -6867,7 +6867,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// replace callin to base methods with covariant return types, invoked on super-base as the static type
// 4.1.39-otjld-callin-binding-with-plus-4
public void test4139_callinBindingWithPlus4() {
-
+
runConformTest(
new String[] {
"Team4139cbwp4.java",
@@ -6992,7 +6992,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// replace callin to base methods with covariant return types, base call result is stored and modified
// 4.1.39-otjld-callin-binding-with-plus-8
public void test4139_callinBindingWithPlus8() {
-
+
runConformTest(
new String[] {
"Team4139cbwp8.java",
@@ -7041,7 +7041,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// replace callin to base methods with covariant return types - unbounded type variable
// 4.1.39-otjld-callin-binding-with-plus-9
public void test4139_callinBindingWithPlus9() {
-
+
runConformTest(
new String[] {
"Team4139cbwp9.java",
@@ -7083,7 +7083,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// base call result is lifting-compatible to type bound
// 4.1.40-otjld-callin-replace-compatibility-5
public void test4140_callinReplaceCompatibility5() {
-
+
runConformTest(
new String[] {
"Team4140crc5.java",
@@ -7123,7 +7123,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// base call result is lifting-compatible to exact type -- reference for previous test
// 4.1.40-otjld-callin-replace-compatibility-6
public void test4140_callinReplaceCompatibility6() {
-
+
runConformTest(
new String[] {
"Team4140crc6.java",
@@ -7163,7 +7163,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a parameter in a replace binding is lifting compatible
// 4.1.40-otjld-callin-replace-compatibility-7
public void test4140_callinReplaceCompatibility7() {
-
+
runConformTest(
new String[] {
"Team4140crc7.java",
@@ -7247,7 +7247,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// two different base methods have return types that are compatible to the bound of a type parameter
// 4.1.40-otjld-callin-replace-compatibility-9
public void test4140_callinReplaceCompatibility9() {
-
+
runConformTest(
new String[] {
"Team4140crc9.java",
@@ -7285,7 +7285,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// two different base methods have return types that are compatible to the bound of a type parameter -- signatureless binding
// 4.1.40-otjld-callin-replace-compatibility-9s
public void test4140_callinReplaceCompatibility9s() {
-
+
runConformTest(
new String[] {
"Team4140crc9s.java",
@@ -7322,7 +7322,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// two different base methods have parameter types that are compatible to the bound of a type parameter
// 4.1.40-otjld-callin-replace-compatibility-10
public void test4140_callinReplaceCompatibility10() {
-
+
runConformTest(
new String[] {
"Team4140crc10.java",
@@ -7362,7 +7362,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// two different base methods have parameter types that are compatible to the bound of a type parameter -- signatureless binding
// 4.1.40-otjld-callin-replace-compatibility-10s
public void test4140_callinReplaceCompatibility10s() {
-
+
runConformTest(
new String[] {
"Team4140crc10s.java",
@@ -7402,7 +7402,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a base method has parameter types that are compatible to the bound of a type parameter, 2 params, with mapping (swap)
// 4.1.40-otjld-callin-replace-compatibility-11
public void test4140_callinReplaceCompatibility11() {
-
+
runConformTest(
new String[] {
"Team4140crc11.java",
@@ -7458,7 +7458,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a base method has parameter types that are compatible to the bound of a type parameter, 2 params, with partial mapping
// 4.1.40-otjld-callin-replace-compatibility-12
public void test4140_callinReplaceCompatibility12() {
-
+
runConformTest(
new String[] {
"Team4140crc12.java",
@@ -7611,7 +7611,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a callin binds to method equals - warning suppressed
// 4.1.41-otjld-dangerous-callin-binding-3
public void test4141_dangerousCallinBinding3() {
-
+
runConformTest(
new String[] {
"Team4141dcb3.java",
@@ -7641,7 +7641,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// a callin binding is inherited, read from binary - witness for NPE in SingleValueAttribute.evaluate reported by Marco
// 4.1.42-otjld-inheritance-of-callin-binding-1
public void test4142_inheritanceOfCallinBinding1() {
-
+
runConformTest(
new String[] {
"T4142iocb1Main.java",
@@ -7707,11 +7707,11 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team4143ctd1.java (at line 5)\n" +
- " rm <- after test;\n" +
- " ^^^^\n" +
- "Bound base method test() is deprecated.\n" +
+ "----------\n" +
+ "1. ERROR in Team4143ctd1.java (at line 5)\n" +
+ " rm <- after test;\n" +
+ " ^^^^\n" +
+ "Bound base method test() is deprecated.\n" +
"----------\n");
}
@@ -7740,11 +7740,11 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. WARNING in Team4143ctd1w.java (at line 5)\n" +
- " rm <- after test;\n" +
- " ^^^^\n" +
- "Bound base method test() is deprecated.\n" +
+ "----------\n" +
+ "1. WARNING in Team4143ctd1w.java (at line 5)\n" +
+ " rm <- after test;\n" +
+ " ^^^^\n" +
+ "Bound base method test() is deprecated.\n" +
"----------\n",
customOptions);
}
@@ -7752,7 +7752,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// an after callin binding refers to a team method instead of a role method
// 4.1.43-otjld-callin-to-team-method-1
public void test4143_callinToTeamMethod1() {
-
+
runConformTest(
new String[] {
"Team4143cttm1.java",
@@ -7786,7 +7786,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// an after callin binding refers to an inherited team method instead of a role method
// 4.1.43-otjld-callin-to-team-method-2
public void test4143_callinToTeamMethod2() {
-
+
runConformTest(
new String[] {
"Team4143cttm2_2.java",
@@ -7828,7 +7828,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_DocCommentSupport, CompilerOptions.ENABLED);
customOptions.put(CompilerOptions.OPTION_ReportInvalidJavadoc, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"Team4143cttm3.java",
@@ -7899,11 +7899,11 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in p2\\Team4143cttm4_2.java (at line 5)\n" +
- " void k(String s) <- after void test()\n" +
- " ^\n" +
- "The method k(String) from the type Team4143cttm4_1 is not visible\n" +
+ "----------\n" +
+ "1. ERROR in p2\\Team4143cttm4_2.java (at line 5)\n" +
+ " void k(String s) <- after void test()\n" +
+ " ^\n" +
+ "The method k(String) from the type Team4143cttm4_1 is not visible\n" +
"----------\n");
}
@@ -7935,11 +7935,11 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in p2\\Team4143cttm5_2.java (at line 5)\n" +
- " k <- before test;\n" +
- " ^\n" +
- "The method k() from the type Team4143cttm5_1 is not visible\n" +
+ "----------\n" +
+ "1. ERROR in p2\\Team4143cttm5_2.java (at line 5)\n" +
+ " k <- before test;\n" +
+ " ^\n" +
+ "The method k() from the type Team4143cttm5_1 is not visible\n" +
"----------\n");
}
@@ -7984,7 +7984,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
},
"OK");
}
-
+
// Bug 318309 - [compiler] warnings re unused exceptions from generated code
// a role method does not declare the expection that it base method may throw
public void test4145_baseMethodWithException1() {
@@ -8065,11 +8065,11 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
" public void test() { System.out.print('!'); }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Team4146ctc1.java (at line 4)\n" +
- " print <- before T4146ctc1;\n" +
- " ^^^^^^^^^\n" +
- "Callin binding to constructor \'T4146ctc1()\' must use the callin modifier \"after\" (OTJLD 4.1(i)). \n" +
+ "----------\n" +
+ "1. ERROR in Team4146ctc1.java (at line 4)\n" +
+ " print <- before T4146ctc1;\n" +
+ " ^^^^^^^^^\n" +
+ "Callin binding to constructor \'T4146ctc1()\' must use the callin modifier \"after\" (OTJLD 4.1(i)). \n" +
"----------\n");
}
@@ -8185,16 +8185,16 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team724cbam2_2.java (at line 4)\n" +
- " public class Role724cbam2 playedBy T724cbam2 {\n" +
- " ^^^^^^^^^^^^\n" +
- "The abstract method test in type Role724cbam2 can only be defined by an abstract class\n" +
+ "----------\n" +
+ "1. ERROR in Team724cbam2_2.java (at line 4)\n" +
+ " public class Role724cbam2 playedBy T724cbam2 {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The abstract method test in type Role724cbam2 can only be defined by an abstract class\n" +
"----------\n" +
"2. ERROR in Team724cbam2_2.java (at line 4)\n" +
" public class Role724cbam2 playedBy T724cbam2 {\n" +
" ^^^^^^^^^^^^\n" +
- "The type Team724cbam2_2.Role724cbam2 must implement the inherited abstract method Team724cbam2_2.Role724cbam2.test()\n" +
+ "The type Team724cbam2_2.Role724cbam2 must implement the inherited abstract method Team724cbam2_2.Role724cbam2.test()\n" +
"----------\n");
}
@@ -8233,16 +8233,16 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team725cbam1_2.java (at line 10)\n" +
- " public class Role725cbam1_2 extends Role725cbam1_1 playedBy T725cbam1 {\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The abstract method test in type Role725cbam1_2 can only be defined by an abstract class\n" +
+ "----------\n" +
+ "1. ERROR in Team725cbam1_2.java (at line 10)\n" +
+ " public class Role725cbam1_2 extends Role725cbam1_1 playedBy T725cbam1 {\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The abstract method test in type Role725cbam1_2 can only be defined by an abstract class\n" +
"----------\n" +
- "2. ERROR in Team725cbam1_2.java (at line 10)\n" +
- " public class Role725cbam1_2 extends Role725cbam1_1 playedBy T725cbam1 {\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The type Team725cbam1_2.Role725cbam1_2 must implement the inherited abstract method Team725cbam1_2.Role725cbam1_2.test()\n" +
+ "2. ERROR in Team725cbam1_2.java (at line 10)\n" +
+ " public class Role725cbam1_2 extends Role725cbam1_1 playedBy T725cbam1 {\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The type Team725cbam1_2.Role725cbam1_2 must implement the inherited abstract method Team725cbam1_2.Role725cbam1_2.test()\n" +
"----------\n");
}
@@ -8316,11 +8316,11 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team725cbam2_2.java (at line 4)\n" +
- " public class Role725cbam2_2 extends Role725cbam2_1 {}\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The abstract method test in type Role725cbam2_2 can only be defined by an abstract class\n" +
+ "----------\n" +
+ "1. ERROR in Team725cbam2_2.java (at line 4)\n" +
+ " public class Role725cbam2_2 extends Role725cbam2_1 {}\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The abstract method test in type Role725cbam2_2 can only be defined by an abstract class\n" +
"----------\n");
}
// Bug 337413 - [otjld][compiler] consider changing LiftingFailedException to a checked exception
@@ -8487,7 +8487,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
options,
null/*requester*/);
}
-
+
// Bug 387996 - "T cannot be resolved or is not a field" error due to field named like package
public void testBug387996a() {
runConformTest(
@@ -8547,22 +8547,22 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
new String[] {
"test495624/MyTeam.java",
"package test495624;\n" +
- "public team class MyTeam {\n" +
- " protected class R {\n" +
- " callin void ci(final boolean b1, final boolean b2) {\n" +
- " base.ci(b1,b2);\n" +
- " new Runnable() {\n" +
- " public void run() {\n" +
- " if (b1) {\n" +
- " if (b2)\n" +
- " return; // (1)\n" +
- " else\n" +
- " return; // (2)\n" +
- " }\n" +
- " }\n" +
- " }.run();\n" +
- " }\n" +
- " }\n" +
+ "public team class MyTeam {\n" +
+ " protected class R {\n" +
+ " callin void ci(final boolean b1, final boolean b2) {\n" +
+ " base.ci(b1,b2);\n" +
+ " new Runnable() {\n" +
+ " public void run() {\n" +
+ " if (b1) {\n" +
+ " if (b2)\n" +
+ " return; // (1)\n" +
+ " else\n" +
+ " return; // (2)\n" +
+ " }\n" +
+ " }\n" +
+ " }.run();\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
"");
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/callinbinding/CallinParameterMapping_LiftingAndLowering.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/callinbinding/CallinParameterMapping_LiftingAndLowering.java
index 140ed5967..c1395d9be 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/callinbinding/CallinParameterMapping_LiftingAndLowering.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/callinbinding/CallinParameterMapping_LiftingAndLowering.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -26,11 +26,11 @@ import junit.framework.Test;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest {
-
+
public CallinParameterMapping_LiftingAndLowering(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -38,7 +38,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -50,7 +50,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// a role method is callin-bound as 'before' with a parameter mapping
// 4.3.1-otjld-parameter-mapping-1
public void test431_parameterMapping1() {
-
+
runConformTest(
new String[] {
"T431pm1Main.java",
@@ -102,7 +102,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// a role method is callin-bound as 'after' with a parameter mapping
// 4.3.1-otjld-parameter-mapping-2
public void test431_parameterMapping2() {
-
+
runConformTest(
new String[] {
"T431pm2Main.java",
@@ -154,7 +154,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// a role method is callin-bound as 'before' with a parameter mapping
// 4.3.1-otjld-parameter-mapping-3
public void test431_parameterMapping3() {
-
+
runConformTest(
new String[] {
"T431pm3Main.java",
@@ -206,7 +206,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// a role method is callin-bound as 'after' with a parameter mapping
// 4.3.1-otjld-parameter-mapping-4
public void test431_parameterMapping4() {
-
+
runConformTest(
new String[] {
"T431pm4Main.java",
@@ -258,7 +258,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// a role method is callin-bound as 'before' with a parameter mapping
// 4.3.1-otjld-parameter-mapping-5
public void test431_parameterMapping5() {
-
+
runConformTest(
new String[] {
"T431pm5Main.java",
@@ -310,7 +310,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// a role method is callin-bound as 'after' with a parameter mapping
// 4.3.1-otjld-parameter-mapping-6
public void test431_parameterMapping6() {
-
+
runConformTest(
new String[] {
"T431pm6Main.java",
@@ -363,7 +363,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// a role method is callin-bound as 'before' with a parameter mapping
// 4.3.1-otjld-parameter-mapping-7
public void test431_parameterMapping7() {
-
+
runConformTest(
new String[] {
"T431pm7Main.java",
@@ -416,7 +416,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// a role method is callin-bound as 'after' with a parameter mapping
// 4.3.1-otjld-parameter-mapping-8
public void test431_parameterMapping8() {
-
+
runConformTest(
new String[] {
"T431pm8Main.java",
@@ -476,7 +476,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// a role method is callin-bound as 'before' with a parameter mapping
// 4.3.1-otjld-parameter-mapping-9
public void test431_parameterMapping9() {
-
+
runConformTest(
new String[] {
"T431pm9Main.java",
@@ -536,7 +536,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// a role method is callin-bound as 'replace' with a parameter mapping
// 4.3.1-otjld-parameter-mapping-10
public void test431_parameterMapping10() {
-
+
runConformTest(
new String[] {
"T431pm10Main.java",
@@ -652,7 +652,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// a role method is callin-bound as 'replace' with a parameter mapping
// 4.3.1-otjld-parameter-mapping-11a
public void test431_parameterMapping11a() {
-
+
runConformTest(
new String[] {
"T431pm11aMain.java",
@@ -719,7 +719,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// a role method is callin-bound as 'replace' with a reordered parameter mapping
// 4.3.1-otjld-parameter-mapping-12
public void test431_parameterMapping12() {
-
+
runConformTest(
new String[] {
"T431pm12Main.java",
@@ -766,7 +766,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// a parameter mapping is declared in a super team - has to be inherited to the subteam!
// 4.3.1-otjld-parameter-mapping-13
public void test431_parameterMapping13() {
-
+
runConformTest(
new String[] {
"T431pm13Main.java",
@@ -817,7 +817,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// witness for Trac #285 - could not resolve role field in parameter mapping (RHS)
// 4.3.1-otjld-parameter-mapping-14
public void test431_parameterMapping14() {
-
+
runConformTest(
new String[] {
"Team431pm14.java",
@@ -854,7 +854,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// witness for Trac #285 - could not resolve role method in parameter mapping (RHS)
// 4.3.1-otjld-parameter-mapping-15
public void test431_parameterMapping15() {
-
+
runConformTest(
new String[] {
"Team431pm15.java",
@@ -891,7 +891,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// scoping of field vs. argument, see Trac #294
// 4.3.1-otjld-parameter-mapping-16
public void test431_parameterMapping16() {
-
+
runConformTest(
new String[] {
"Team431pm16.java",
@@ -952,7 +952,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// a role method callin-bound as 'replace' has a result mapping with an expression
// 4.3.2-otjld-expression-in-replace-parameter-mapping-1
public void test432_expressionInReplaceParameterMapping1() {
-
+
runConformTest(
new String[] {
"Team432eirpm1.java",
@@ -985,7 +985,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// a role method callin-bound as 'replace' tunnels the base result
// 4.3.2-otjld-expression-in-replace-parameter-mapping-1b
public void test432_expressionInReplaceParameterMapping1b() {
-
+
runConformTest(
new String[] {
"Team432eirpm1b.java",
@@ -1016,7 +1016,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// a role method callin-bound as 'replace' has a legal result mapping with an expression (result to provided by role method)
// 4.3.2-otjld-expression-in-replace-parameter-mapping-2
public void test432_expressionInReplaceParameterMapping2() {
-
+
runConformTest(
new String[] {
"Team432eirpm2.java",
@@ -1176,7 +1176,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// a role method callin-bound as 'replace' has a parameter mapping with an expression
// 4.3.2-otjld-expression-in-replace-parameter-mapping-6
public void test432_expressionInReplaceParameterMapping6() {
-
+
runConformTest(
new String[] {
"Team432eirpm6.java",
@@ -1238,7 +1238,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// a role method callin-bound as 'replace' has a result mapping with an expression - legal case
// 4.3.2-otjld-expression-in-replace-parameter-mapping-8
public void test432_expressionInReplaceParameterMapping8() {
-
+
runConformTest(
new String[] {
"Team432eirpm8.java",
@@ -1272,7 +1272,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// a role method callin-bound as 'replace' has no result mapping, value is tunneled from base call
// 4.3.2-otjld-expression-in-replace-parameter-mapping-9
public void test432_expressionInReplaceParameterMapping9() {
-
+
runConformTest(
new String[] {
"Team432eirpm9.java",
@@ -1306,7 +1306,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// a role method callin-bound as 'replace' has a parameter mapping with a cast
// 4.3.2-otjld-expression-in-replace-parameter-mapping-10
public void test432_expressionInReplaceParameterMapping10() {
-
+
runConformTest(
new String[] {
"Team432eirpm10.java",
@@ -1341,7 +1341,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// a role method callin-bound as 'replace' has a parameter mapping with a cast, cast is guarded
// 4.3.2-otjld-expression-in-replace-parameter-mapping-11
public void test432_expressionInReplaceParameterMapping11() {
-
+
runConformTest(
new String[] {
"Team432eirpm11.java",
@@ -1389,7 +1389,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// a role method with return type is callin-bound as 'before' and the return value is calculated
// 4.3.3-otjld-result-of-binding-is-calculated-1
public void test433_resultOfBindingIsCalculated1() {
-
+
runConformTest(
new String[] {
"T433robic1Main.java",
@@ -1440,7 +1440,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// a role method with return type is callin-bound as 'after' and the return value is calculated
// 4.3.3-otjld-result-of-binding-is-calculated-2
public void test433_resultOfBindingIsCalculated2() {
-
+
runConformTest(
new String[] {
"T433robic2Main.java",
@@ -1520,7 +1520,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// a role method is callin-bound as 'after' and the result of the base method is used
// 4.3.5-otjld-result-in-parameter-mapping
public void test435_resultInParameterMapping() {
-
+
runConformTest(
new String[] {
"T435ripmMain.java",
@@ -1630,7 +1630,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// callin parameter mapping uses base to denote the base instance
// 4.3.8-otjld-base-in-parameter-mapping-1
public void test438_baseInParameterMapping1() {
-
+
runConformTest(
new String[] {
"Team438bipm1.java",
@@ -1665,7 +1665,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// a base expression is used to retrieve a sibling role
// 4.3.8-otjld-base-in-parameter-mapping-2
public void test438_baseInParameterMapping2() {
-
+
runConformTest(
new String[] {
"Team438bipm2.java",
@@ -1701,7 +1701,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// a callin binding with multiple base methods defines a parameter mapping
// 4.3.9-otjld-param-map-multiple-basemethods-1
public void test439_paramMapMultipleBasemethods1() {
-
+
runConformTest(
new String[] {
"Team439pmmb1.java",
@@ -1740,7 +1740,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// a callin binding with multiple base methods defines a parameter mapping
// 4.3.9-otjld-param-map-multiple-basemethods-2
public void test439_paramMapMultipleBasemethods2() {
-
+
runConformTest(
new String[] {
"Team439pmmb2.java",
@@ -1780,7 +1780,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// 4.3.10-otjld-maximum-parameter-tweeking-1
public void test4310_maximumParameterTweeking1() {
Map customOptions = getCompilerOptions();
-
+
runConformTest(
new String[] {
"T4310mpt1Main.java",
@@ -1858,7 +1858,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// a callin parameter is mapped and requires lifting (and lowering in base-call)
// 4.3.11-otjld-translating-mapped-parameter-1
public void test4311_translatingMappedParameter1() {
-
+
runConformTest(
new String[] {
"Team4311tmp1.java",
@@ -1896,7 +1896,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// a callin parameter is mapped from a "new" expression and requires lifting (no lowering in base-call)
// 4.3.11-otjld-translating-mapped-parameter-2
public void test4311_translatingMappedParameter2() {
-
+
runConformTest(
new String[] {
"Team4311tmp2.java",
@@ -1938,7 +1938,7 @@ public class CallinParameterMapping_LiftingAndLowering extends AbstractOTJLDTest
// a callin parameter is mapped and requires lifting (and lowering in base-call)
// 4.3.11-otjld-translating-mapped-parameter-3
public void test4311_translatingMappedParameter3() {
-
+
runConformTest(
new String[] {
"Team4311tmp3.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/callinbinding/CallinWithTranslation.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/callinbinding/CallinWithTranslation.java
index 7e7578464..3a83cb2b4 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/callinbinding/CallinWithTranslation.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/callinbinding/CallinWithTranslation.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010 Stephan Herrmann
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -23,11 +23,11 @@ import junit.framework.Test;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class CallinWithTranslation extends AbstractOTJLDTest {
-
+
public CallinWithTranslation(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -35,7 +35,7 @@ public class CallinWithTranslation extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -48,7 +48,7 @@ public class CallinWithTranslation extends AbstractOTJLDTest {
// a callin binding without signatures lifts its parameter
// 4.4.1-otjld-callin-with-parameter-lifting-1
public void test441_callinWithParameterLifting1() {
-
+
runConformTest(
new String[] {
"Team441cwpl1.java",
@@ -87,7 +87,7 @@ public class CallinWithTranslation extends AbstractOTJLDTest {
// a callin binding with array result lifting
// 4.4.1-otjld-callin-with-result-lifting-2
public void test441_callinWithResultLifting2() {
-
+
runConformTest(
new String[] {
"Team441cwrl2.java",
@@ -132,7 +132,7 @@ public class CallinWithTranslation extends AbstractOTJLDTest {
// a callin binding with array result lifting , base is inner class
// 4.4.1-otjld-callin-with-result-lifting-2i
public void test441_callinWithResultLifting2i() {
-
+
runConformTest(
new String[] {
"Team441cwrl2i.java",
@@ -235,7 +235,7 @@ public class CallinWithTranslation extends AbstractOTJLDTest {
// a role method return a result which is lowered for passing back to the base
// 4.4.3-otjld-callin-with-result-lowering-1
public void test443_callinWithResultLowering1() {
-
+
runConformTest(
new String[] {
"T443cwrl1Main.java",
@@ -282,7 +282,7 @@ public class CallinWithTranslation extends AbstractOTJLDTest {
// A callin method lifts its arg and passes it (lowered) back to the base call
// 4.4.4-otjld-callin-replace-lifts-arg-1
public void test444_callinReplaceLiftsArg1() {
-
+
runConformTest(
new String[] {
"Team444crla1_2.java",
@@ -363,7 +363,7 @@ public class CallinWithTranslation extends AbstractOTJLDTest {
// A callin method casts its arg and passes it (downcasted) back to the base call
// 4.4.5-otjld-callin-replace-casts-arg-1
public void test445_callinReplaceCastsArg1() {
-
+
runConformTest(
new String[] {
"Team445crca1.java",
@@ -400,7 +400,7 @@ public class CallinWithTranslation extends AbstractOTJLDTest {
// a callin method lifts an array of bases (inner class)
// 4.4.6-otjld-callin-array-arg-lifting-1
public void test446_callinArrayArgLifting1() {
-
+
runConformTest(
new String[] {
"Team446caal1.java",
@@ -446,49 +446,49 @@ public class CallinWithTranslation extends AbstractOTJLDTest {
runConformTest(
new String[] {
"t1/MyTeam.java",
- "package t1;\n" +
- "\n" +
- "import b1.MyBase;\n" +
- "\n" +
- "public team class MyTeam {\n" +
- " protected team class Mid { \n" +
- " \n" +
- " protected class R playedBy MyBase {\n" +
- " callin void rm1(R r) {\n" +
- " System.out.println(\"rm1 \" + r.getClass().getName());\n" +
- " base.rm1(r);\n" +
- " }\n" +
- " callin1: rm1 <- replace id, process;\n" +
- " callin R rm2(R r) {\n" +
- " System.out.println(\"rm2\");\n" +
- " return this;\n" +
- " }\n" +
- " callin2: rm2 <- replace id\n" +
- " base when (false);\n" +
- "\n" +
- " precedence callin2, callin1;\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " new MyTeam().new Mid().activate();\n" +
- " new MyBase().process(new MyBase());\n" +
- " }\n" +
+ "package t1;\n" +
+ "\n" +
+ "import b1.MyBase;\n" +
+ "\n" +
+ "public team class MyTeam {\n" +
+ " protected team class Mid { \n" +
+ " \n" +
+ " protected class R playedBy MyBase {\n" +
+ " callin void rm1(R r) {\n" +
+ " System.out.println(\"rm1 \" + r.getClass().getName());\n" +
+ " base.rm1(r);\n" +
+ " }\n" +
+ " callin1: rm1 <- replace id, process;\n" +
+ " callin R rm2(R r) {\n" +
+ " System.out.println(\"rm2\");\n" +
+ " return this;\n" +
+ " }\n" +
+ " callin2: rm2 <- replace id\n" +
+ " base when (false);\n" +
+ "\n" +
+ " precedence callin2, callin1;\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " new MyTeam().new Mid().activate();\n" +
+ " new MyBase().process(new MyBase());\n" +
+ " }\n" +
"}\n",
"b1/MyBase.java",
- "package b1;\n" +
- "\n" +
- "public class MyBase {\n" +
- " MyBase id(MyBase other) { return this; }\n" +
- " public MyBase process(MyBase other) {\n" +
- " other = id(other);\n" +
- " System.out.println(other.getClass().getName());\n" +
- " return null;\n" +
- " }\n" +
+ "package b1;\n" +
+ "\n" +
+ "public class MyBase {\n" +
+ " MyBase id(MyBase other) { return this; }\n" +
+ " public MyBase process(MyBase other) {\n" +
+ " other = id(other);\n" +
+ " System.out.println(other.getClass().getName());\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
},
- "rm1 t1.MyTeam$__OT__Mid$__OT__R\n" +
- "rm1 t1.MyTeam$__OT__Mid$__OT__R\n" +
+ "rm1 t1.MyTeam$__OT__Mid$__OT__R\n" +
+ "rm1 t1.MyTeam$__OT__Mid$__OT__R\n" +
"b1.MyBase");
}
@@ -521,16 +521,16 @@ public class CallinWithTranslation extends AbstractOTJLDTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in t\\Team1.java (at line 6)\n" +
- " <T> T rm() <- replace T m()\n" +
- " ^^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in t\\Team1.java (at line 6)\n" +
- " <T> T rm() <- replace T m()\n" +
- " ^^\n" +
- "T cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in t\\Team1.java (at line 6)\n" +
+ " <T> T rm() <- replace T m()\n" +
+ " ^^\n" +
+ "T cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in t\\Team1.java (at line 6)\n" +
+ " <T> T rm() <- replace T m()\n" +
+ " ^^\n" +
+ "T cannot be resolved to a type\n" +
"----------\n");
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutMethodBinding.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutMethodBinding.java
index de92304af..7368e321b 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutMethodBinding.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutMethodBinding.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2016 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -29,11 +29,11 @@ import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
@SuppressWarnings("unchecked")
public class CalloutMethodBinding extends AbstractOTJLDTest {
-
+
public CalloutMethodBinding(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -41,7 +41,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -52,7 +52,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
// an abstract role method is callout-bound via -> to a method in the direct base class
// 3.1.1-otjld-abstract-callout-binding-1
public void test311_abstractCalloutBinding1() {
-
+
runConformTest(
new String[] {
"T311acb1Main.java",
@@ -138,7 +138,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
// an abstract role method is callout-bound via -> to a method in the base class of the implicit superclass
// 3.1.1-otjld-abstract-callout-binding-2
public void test311_abstractCalloutBinding2() {
-
+
runConformTest(
new String[] {
"T311acb2Main.java",
@@ -192,7 +192,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
// an abstract role method is callout-bound via -> to a method in the base class of the explicit superclass
// 3.1.1-otjld-abstract-callout-binding-3
public void test311_abstractCalloutBinding3() {
-
+
runConformTest(
new String[] {
"T311acb3Main.java",
@@ -237,7 +237,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
// an abstract role method is callout-bound via -> to a method in the indirect base class of the explicit superclass
// 3.1.1-otjld-abstract-callout-binding-4
public void test311_abstractCalloutBinding4() {
-
+
runConformTest(
new String[] {
"T311acb4Main.java",
@@ -291,7 +291,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
// an abstract role method is callout-bound (via -> and the name only) to a base method with an assignment-compatible return type
// 3.1.1-otjld-abstract-callout-binding-5
public void test311_abstractCalloutBinding5() {
-
+
runConformTest(
new String[] {
"T311acb5Main.java",
@@ -334,7 +334,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
// an abstract role method is callout-bound (via -> and the name only) to a base method with an assignment-compatible signature
// 3.1.1-otjld-abstract-callout-binding-6
public void test311_abstractCalloutBinding6() {
-
+
runConformTest(
new String[] {
"T311acb6Main.java",
@@ -377,7 +377,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
// a role class callout-binds a role method via -> to a base method that has a signature that is compatible via lowering
// 3.1.1-otjld-abstract-callout-binding-7
public void test311_abstractCalloutBinding7() {
-
+
runConformTest(
new String[] {
"T311acb7Main.java",
@@ -432,7 +432,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
}
// Bug 355314 - abstract method error may be masked by callout binding
public void test311_abstractCalloutBinding8() {
-
+
runNegativeTest(
new String[] {
"T311acb8Main.java",
@@ -480,16 +480,16 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
"\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in Team311acb8_2.java (at line 4)\n" +
- " public class Role311acb8 playedBy T311acb8_1 {\n" +
- " ^^^^^^^^^^^\n" +
- "Inherited abstract method getValueInternal() is implicitly bound as an inferred callout (OTJLD 3.1(j)).\n" +
+ "----------\n" +
+ "1. ERROR in Team311acb8_2.java (at line 4)\n" +
+ " public class Role311acb8 playedBy T311acb8_1 {\n" +
+ " ^^^^^^^^^^^\n" +
+ "Inherited abstract method getValueInternal() is implicitly bound as an inferred callout (OTJLD 3.1(j)).\n" +
"----------\n");
}
// Bug 355314 - abstract method error may be masked by callout binding
public void test311_abstractCalloutBinding8a() {
-
+
runNegativeTest(
new String[] {
"T311acb8aMain.java",
@@ -534,16 +534,16 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
"\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in Team311acb8a_2.java (at line 4)\n" +
- " public class Role311acb8a playedBy T311acb8a_1 {\n" +
- " ^^^^^^^^^^^^\n" +
- "The abstract method getValueInternal in type Role311acb8a can only be defined by an abstract class\n" +
+ "----------\n" +
+ "1. ERROR in Team311acb8a_2.java (at line 4)\n" +
+ " public class Role311acb8a playedBy T311acb8a_1 {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The abstract method getValueInternal in type Role311acb8a can only be defined by an abstract class\n" +
"----------\n" +
- "2. ERROR in Team311acb8a_2.java (at line 4)\n" +
- " public class Role311acb8a playedBy T311acb8a_1 {\n" +
- " ^^^^^^^^^^^^\n" +
- "The type Team311acb8a_2.Role311acb8a must implement the inherited abstract method Team311acb8a_2.Role311acb8a.getValueInternal()\n" +
+ "2. ERROR in Team311acb8a_2.java (at line 4)\n" +
+ " public class Role311acb8a playedBy T311acb8a_1 {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The type Team311acb8a_2.Role311acb8a must implement the inherited abstract method Team311acb8a_2.Role311acb8a.getValueInternal()\n" +
"----------\n");
}
@@ -600,7 +600,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
// a concrete role method is callout-bound via => to a method in the direct base class
// 3.1.3-otjld-concrete-callout-binding-1
public void test313_concreteCalloutBinding1() {
-
+
runConformTest(
new String[] {
"T313ccb1Main.java",
@@ -680,7 +680,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
// a concrete role method is callout-bound via => to a method in the implicit base class
// 3.1.3-otjld-concrete-callout-binding-2
public void test313_concreteCalloutBinding2() {
-
+
runConformTest(
new String[] {
"T313ccb2Main.java",
@@ -737,7 +737,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
// a concrete role method is callout-bound via => to a method in the base class of the explicit superclass
// 3.1.3-otjld-concrete-callout-binding-3
public void test313_concreteCalloutBinding3() {
-
+
runConformTest(
new String[] {
"T313ccb3Main.java",
@@ -795,7 +795,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
// a concrete role method is callout-bound via => to a method in the indirect base class of the explicit superclass
// 3.1.3-otjld-concrete-callout-binding-4
public void test313_concreteCalloutBinding4() {
-
+
runConformTest(
new String[] {
"T313ccb4Main.java",
@@ -852,7 +852,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
// a concrete role method is callout-bound via => to a method in the direct base class - overriding protected native clone
// 3.1.3-otjld-concrete-callout-binding-5
public void test313_concreteCalloutBinding5() {
-
+
runConformTest(
new String[] {
"T313ccb5Main.java",
@@ -953,7 +953,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
// a role class overwrites an inherited callout binding from its implicit superrole via => to a different base method
// 3.1.5-otjld-overwritten-callout-binding-1
public void test315_overwrittenCalloutBinding1() {
-
+
runConformTest(
new String[] {
"T315ocb1Main.java",
@@ -1007,7 +1007,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
// a role class overwrites an inherited callout binding from its explicit superrole via => to the overwritten base method in a subclass
// 3.1.5-otjld-overwritten-callout-binding-2
public void test315_overwrittenCalloutBinding2() {
-
+
runConformTest(
new String[] {
"T315ocb2Main.java",
@@ -1090,11 +1090,11 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team316icrmb_2.java (at line 6)\n" +
- " test -> test;\n" +
- " ^^^^\n" +
- "A non-abstract role method exists for this callout-binding. Use callout-override (\'=>\') if you want to override it (OTJLD 3.1(e)).\n" +
+ "----------\n" +
+ "1. ERROR in Team316icrmb_2.java (at line 6)\n" +
+ " test -> test;\n" +
+ " ^^^^\n" +
+ "A non-abstract role method exists for this callout-binding. Use callout-override (\'=>\') if you want to override it (OTJLD 3.1(e)).\n" +
"----------\n");
}
@@ -1122,11 +1122,11 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team317iarmb.java (at line 8)\n" +
- " test => test;\n" +
- " ^^^^\n" +
- "Trying to bind an abstract method as callout override (OTJLD 3.1(e)).\n" +
+ "----------\n" +
+ "1. ERROR in Team317iarmb.java (at line 8)\n" +
+ " test => test;\n" +
+ " ^^^^\n" +
+ "Trying to bind an abstract method as callout override (OTJLD 3.1(e)).\n" +
"----------\n");
}
@@ -1221,7 +1221,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
// a role class callout-binds a role method via -> to a base method that has a return type (corrected version)
// 3.1.9-otjld-nonexisting-base-method-3
public void test319_nonexistingBaseMethod3() {
-
+
runConformTest(
new String[] {
"T319nbm3Main.java",
@@ -1492,7 +1492,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
// a role class callout-binds a role method via -> to a base method that has a result that is compatible via lifting
// 3.1.9-otjld-nonexisting-base-method-11
public void test319_nonexistingBaseMethod11() {
-
+
runConformTest(
new String[] {
"Team319nbm11.java",
@@ -1595,7 +1595,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
// a role class callout-binds a role method via => to a base method that has an argument that is compatible via lowering
// 3.1.9-otjld-nonexisting-base-method-13
public void test319_nonexistingBaseMethod13() {
-
+
runConformTest(
new String[] {
"T319nbm13Main.java",
@@ -1857,11 +1857,11 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team3111ioib1.java (at line 10)\n" +
- " String getValue() -> String getValue2();\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Callout binding conflicts with inherited callout binding from class Team3111ioib1.Role3111ioib1_1. Use \'=>\' if you want to override it (OTJLD 3.1(f)).\n" +
+ "----------\n" +
+ "1. ERROR in Team3111ioib1.java (at line 10)\n" +
+ " String getValue() -> String getValue2();\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Callout binding conflicts with inherited callout binding from class Team3111ioib1.Role3111ioib1_1. Use \'=>\' if you want to override it (OTJLD 3.1(f)).\n" +
"----------\n");
}
@@ -1895,11 +1895,11 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team3111ioib2_2.java (at line 5)\n" +
- " test1 -> test2;\n" +
- " ^^^^^\n" +
- "Callout binding conflicts with inherited callout binding from class Team3111ioib2_1.Role3111ioib2. Use \'=>\' if you want to override it (OTJLD 3.1(f)).\n" +
+ "----------\n" +
+ "1. ERROR in Team3111ioib2_2.java (at line 5)\n" +
+ " test1 -> test2;\n" +
+ " ^^^^^\n" +
+ "Callout binding conflicts with inherited callout binding from class Team3111ioib2_1.Role3111ioib2. Use \'=>\' if you want to override it (OTJLD 3.1(f)).\n" +
"----------\n");
}
@@ -1931,11 +1931,11 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team3111ioib3_2.java (at line 4)\n" +
- " test -> test;\n" +
- " ^^^^\n" +
- "Callout binding conflicts with inherited callout binding from class Team3111ioib3_1.Role3111ioib3_1. Use \'=>\' if you want to override it (OTJLD 3.1(f)).\n" +
+ "----------\n" +
+ "1. ERROR in Team3111ioib3_2.java (at line 4)\n" +
+ " test -> test;\n" +
+ " ^^^^\n" +
+ "Callout binding conflicts with inherited callout binding from class Team3111ioib3_1.Role3111ioib3_1. Use \'=>\' if you want to override it (OTJLD 3.1(f)).\n" +
"----------\n");
}
@@ -2035,7 +2035,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
// a static base method is bound via callout
// 3.1.13-otjld-callout-to-static-1
public void test3113_calloutToStatic1() {
-
+
runConformTest(
new String[] {
"T3113cts1Main.java",
@@ -2070,7 +2070,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
},
"OK");
}
-
+
// missing abstract modifier for role with abstract static method
public void test3113_calloutToStatic2() {
runNegativeTest(
@@ -2086,21 +2086,21 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Team3113cts2.java (at line 3)\n" +
- " protected class R3113cts2 {\n" +
- " ^^^^^^^^^\n" +
- "The type R3113cts2 must be an abstract class to define abstract methods\n" +
- "----------\n" +
- "2. ERROR in Team3113cts2.java (at line 4)\n" +
- " protected abstract static String getV();\n" +
- " ^^^^^^\n" +
- "The abstract method getV in type R3113cts2 can only be defined by an abstract class\n" +
+ "----------\n" +
+ "1. ERROR in Team3113cts2.java (at line 3)\n" +
+ " protected class R3113cts2 {\n" +
+ " ^^^^^^^^^\n" +
+ "The type R3113cts2 must be an abstract class to define abstract methods\n" +
+ "----------\n" +
+ "2. ERROR in Team3113cts2.java (at line 4)\n" +
+ " protected abstract static String getV();\n" +
+ " ^^^^^^\n" +
+ "The abstract method getV in type R3113cts2 can only be defined by an abstract class\n" +
"----------\n");
}
-
+
// abstract static method bound by callout in implicit sub-role
- // Bug 336394 - [compiler] ClassFormatError caused by abstract static method
+ // Bug 336394 - [compiler] ClassFormatError caused by abstract static method
public void test3113_calloutToStatic3() {
runConformTest(
new String[] {
@@ -2141,9 +2141,9 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
},
"OK");
}
-
+
// abstract static method bound by callout in implicit sub-role
- // Bug 336394 - [compiler] ClassFormatError caused by abstract static method
+ // Bug 336394 - [compiler] ClassFormatError caused by abstract static method
public void test3113_calloutToStatic4() {
runConformTest(
new String[] {
@@ -2234,7 +2234,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
" void test() {\n" +
" R.test();\n" +
" }\n" +
- " public static void main(String[] args) {\n" +
+ " public static void main(String[] args) {\n" +
" Team3113cts6_2 t = new Team3113cts6_2();" +
" t.other.val = \"OK\";\n" +
" t.test();\n" +
@@ -2259,7 +2259,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
// A callout binding creates a role method
// 3.1.14-otjld-callout-without-role-method-1
public void test3114_calloutWithoutRoleMethod1() {
-
+
runConformTest(
new String[] {
"Team3114cwrm1.java",
@@ -2291,7 +2291,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
// public callout method in protected role - should not report warning
// 3.1.14-otjld-callout-without-role-method-2
public void test3114_calloutWithoutRoleMethod2() {
-
+
runConformTest(
new String[] {
"Team3114cwrm2.java",
@@ -2322,7 +2322,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
// a local class calls a callout of the enclosing role
// 3.1.15-otjld-callout-called-within-localtype-1
public void test3115_calloutCalledWithinLocaltype1() {
-
+
runConformTest(
new String[] {
"Team3115ccwl1.java",
@@ -2394,11 +2394,11 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team3115ccwl2.java (at line 8)\n" +
- " void broken() -> void inexistent();\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "No method inexistent() found in type T3115ccwl2 to resolve method designator (OTJLD 3.1(c)).\n" +
+ "----------\n" +
+ "1. ERROR in Team3115ccwl2.java (at line 8)\n" +
+ " void broken() -> void inexistent();\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "No method inexistent() found in type T3115ccwl2 to resolve method designator (OTJLD 3.1(c)).\n" +
"----------\n",
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
@@ -2435,7 +2435,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
public void test3117_inferredCallout1() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"Team3117ic1.java",
@@ -2480,7 +2480,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
public void test3117_inferredCallout2() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"Team3117ic2.java",
@@ -2526,7 +2526,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
public void test3117_inferredCallout3() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"Team3117ic3.java",
@@ -2569,7 +2569,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
public void test3117_inferredCallout4() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.IGNORE);
-
+
runConformTest(
new String[] {
"Team3117ic4.java",
@@ -2617,7 +2617,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
public void test3117_inferredCallout5() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"Team3117ic5.java",
@@ -2743,33 +2743,33 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
" \n"
},
true/*expectingCompilerErrors*/,
- "----------\n" +
- "1. ERROR in Team3117ic7.java (at line 7)\n" +
- " secret();\n" +
- " ^^^^^^^^\n" +
- "The private base feature secret() from type T3117ic7_1 is not available via the base type T3117ic7_2 (OTJLD 3.4(d)). \n" +
- "----------\n" +
- "2. ERROR in Team3117ic7.java (at line 7)\n" +
- " secret();\n" +
- " ^^^^^^\n" +
- "The method secret() is undefined for the type Team3117ic7.R\n" +
+ "----------\n" +
+ "1. ERROR in Team3117ic7.java (at line 7)\n" +
+ " secret();\n" +
+ " ^^^^^^^^\n" +
+ "The private base feature secret() from type T3117ic7_1 is not available via the base type T3117ic7_2 (OTJLD 3.4(d)). \n" +
+ "----------\n" +
+ "2. ERROR in Team3117ic7.java (at line 7)\n" +
+ " secret();\n" +
+ " ^^^^^^\n" +
+ "The method secret() is undefined for the type Team3117ic7.R\n" +
"----------\n",
""/*expectedOutputString*/,
- "java.lang.Error: Unresolved compilation problems: \n" +
- " The private base feature secret() from type T3117ic7_1 is not available via the base type T3117ic7_2 (OTJLD 3.4(d)). \n" +
- " The method secret() is undefined for the type Team3117ic7.R\n" +
- "\n" +
- " at Team3117ic7$__OT__R.thief(Team3117ic7.java:7)\n" +
- " at Team3117ic7.<init>(Team3117ic7.java:12)\n" +
- " at Team3117ic7.main(Team3117ic7.java:15)\n" +
-// " at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n" +
-// " at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n" +
-// " at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n" +
-// " at java.lang.reflect.Method.invoke(Method.java:597)\n" +
+ "java.lang.Error: Unresolved compilation problems: \n" +
+ " The private base feature secret() from type T3117ic7_1 is not available via the base type T3117ic7_2 (OTJLD 3.4(d)). \n" +
+ " The method secret() is undefined for the type Team3117ic7.R\n" +
+ "\n" +
+ " at Team3117ic7$__OT__R.thief(Team3117ic7.java:7)\n" +
+ " at Team3117ic7.<init>(Team3117ic7.java:12)\n" +
+ " at Team3117ic7.main(Team3117ic7.java:15)\n" +
+// " at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n" +
+// " at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n" +
+// " at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n" +
+// " at java.lang.reflect.Method.invoke(Method.java:597)\n" +
" at"/*expectedErrorString*/,
true/*forceExecution*/,
null/*classLibraries*/,
- true/*shouldFlushOutputDirectory*/,
+ true/*shouldFlushOutputDirectory*/,
null/*vmArguments*/,
customOptions,
null/*no custom requestor*/,
@@ -2781,7 +2781,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
public void test3117_inferredCallout8() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.IGNORE);
-
+
runConformTest(
new String[] {
"Team3117ic8.java",
@@ -2843,26 +2843,26 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. WARNING in Team3117ic9.java (at line 5)\n" +
- " System.out.print(aField);\n" +
- " ^^^^^^\n" +
- "Reference double aField implicitly uses callout getter to base field \'double aField\' (OTJLD 3.5(h)).\n" +
- "----------\n" +
- "2. WARNING in Team3117ic9.java (at line 6)\n" +
- " System.out.print(aField);\n" +
- " ^^^^^^\n" +
- "Reference double aField implicitly uses callout getter to base field \'double aField\' (OTJLD 3.5(h)).\n" +
- "----------\n" +
- "3. WARNING in Team3117ic9.java (at line 7)\n" +
- " System.out.print(aMethod(13));\n" +
- " ^^^^^^^^^^^\n" +
- "Unresolved self call aMethod(int) is implicitly bound by an inferred callout (OTJLD 3.1(j)).\n" +
- "----------\n" +
- "4. WARNING in Team3117ic9.java (at line 8)\n" +
- " System.out.print(aMethod(14));\n" +
- " ^^^^^^^^^^^\n" +
- "Unresolved self call aMethod(int) is implicitly bound by an inferred callout (OTJLD 3.1(j)).\n" +
+ "----------\n" +
+ "1. WARNING in Team3117ic9.java (at line 5)\n" +
+ " System.out.print(aField);\n" +
+ " ^^^^^^\n" +
+ "Reference double aField implicitly uses callout getter to base field \'double aField\' (OTJLD 3.5(h)).\n" +
+ "----------\n" +
+ "2. WARNING in Team3117ic9.java (at line 6)\n" +
+ " System.out.print(aField);\n" +
+ " ^^^^^^\n" +
+ "Reference double aField implicitly uses callout getter to base field \'double aField\' (OTJLD 3.5(h)).\n" +
+ "----------\n" +
+ "3. WARNING in Team3117ic9.java (at line 7)\n" +
+ " System.out.print(aMethod(13));\n" +
+ " ^^^^^^^^^^^\n" +
+ "Unresolved self call aMethod(int) is implicitly bound by an inferred callout (OTJLD 3.1(j)).\n" +
+ "----------\n" +
+ "4. WARNING in Team3117ic9.java (at line 8)\n" +
+ " System.out.print(aMethod(14));\n" +
+ " ^^^^^^^^^^^\n" +
+ "Unresolved self call aMethod(int) is implicitly bound by an inferred callout (OTJLD 3.1(j)).\n" +
"----------\n",
customOptions);
}
@@ -2875,30 +2875,30 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
runConformTest(
new String[]{
"Team3117ic10.java",
- "public team class Team3117ic10 {\n" +
- "\n" +
- " protected class R playedBy T3117ic10 {\n" +
- "\n" +
- " String foo(String s, int i) <- replace String foo(String s, int i);\n" +
- "\n" +
- " @SuppressWarnings({ \"inferredcallout\", \"basecall\" })\n" +
- " callin String foo(String s, int i) {\n" +
- " return foo(s+\"(\"+i+\")\");\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new Team3117ic10().activate();\n" +
- " System.out.println(new T3117ic10().foo(\"OK\", 23));\n" +
- " }\n" +
+ "public team class Team3117ic10 {\n" +
+ "\n" +
+ " protected class R playedBy T3117ic10 {\n" +
+ "\n" +
+ " String foo(String s, int i) <- replace String foo(String s, int i);\n" +
+ "\n" +
+ " @SuppressWarnings({ \"inferredcallout\", \"basecall\" })\n" +
+ " callin String foo(String s, int i) {\n" +
+ " return foo(s+\"(\"+i+\")\");\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new Team3117ic10().activate();\n" +
+ " System.out.println(new T3117ic10().foo(\"OK\", 23));\n" +
+ " }\n" +
"}\n",
"T3117ic10.java",
- "public class T3117ic10 {\n" +
- " String foo(String s, int i) {\n" +
- " return s+\":\"+i;\n" +
- " }\n" +
- " String foo(String s) {\n" +
- " return s;\n" +
- " }\n" +
+ "public class T3117ic10 {\n" +
+ " String foo(String s, int i) {\n" +
+ " return s+\":\"+i;\n" +
+ " }\n" +
+ " String foo(String s) {\n" +
+ " return s;\n" +
+ " }\n" +
"}\n",
}, "OK(23)",
null/*classLibraries*/,
@@ -2912,7 +2912,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
public void test3117_inferredCallout11() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"Team3117ic11.java",
@@ -2953,7 +2953,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
public void test3117_inferredCallout12() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"Team3117ic12_2.java",
@@ -3000,35 +3000,35 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
public void test3117_inferredCallout13() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"b/IBase.java",
"\n" +
- "package b;\n" +
- "\n" +
- "public interface IBase {\n" +
- "\n" +
- " void setS(String s);\n" +
+ "package b;\n" +
+ "\n" +
+ "public interface IBase {\n" +
+ "\n" +
+ " void setS(String s);\n" +
"\n" +
- " void setL(java.util.List<String> l);\n" +
+ " void setL(java.util.List<String> l);\n" +
"}\n",
"b/BaseClass.java",
- "package b;\n" +
- "\n" +
- "public class BaseClass implements IBase {\n" +
- "\n" +
- " String s;\n" +
- " java.util.List<String> l;\n" +
- "\n" +
- " public void setS(String s) {\n" +
- " this.s = s;\n" +
- " }\n" +
- "\n" +
- " public void setL(java.util.List<String> l) {\n" +
- " this.l = l;\n" +
- " }\n" +
- "}\n" +
+ "package b;\n" +
+ "\n" +
+ "public class BaseClass implements IBase {\n" +
+ "\n" +
+ " String s;\n" +
+ " java.util.List<String> l;\n" +
+ "\n" +
+ " public void setS(String s) {\n" +
+ " this.s = s;\n" +
+ " }\n" +
+ "\n" +
+ " public void setL(java.util.List<String> l) {\n" +
+ " this.l = l;\n" +
+ " }\n" +
+ "}\n" +
"\n"
},
"",
@@ -3040,22 +3040,22 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
runConformTest(
new String[] {
"t/Team3117ic13.java",
- "package t;\n" +
- "\n" +
- "import b.IBase;\n" +
- "\n" +
- "import base b.BaseClass;\n" +
- "\n" +
- "/**\n" +
- " * @author stephan\n" +
- " *\n" +
- " */\n" +
- "public team class Team3117ic13 {\n" +
- "\n" +
- " @SuppressWarnings(\"inferredcallout\")\n" +
- " protected class Role1 implements IBase playedBy BaseClass {\n" +
- " String extra;\n" +
- " }\n" +
+ "package t;\n" +
+ "\n" +
+ "import b.IBase;\n" +
+ "\n" +
+ "import base b.BaseClass;\n" +
+ "\n" +
+ "/**\n" +
+ " * @author stephan\n" +
+ " *\n" +
+ " */\n" +
+ "public team class Team3117ic13 {\n" +
+ "\n" +
+ " @SuppressWarnings(\"inferredcallout\")\n" +
+ " protected class Role1 implements IBase playedBy BaseClass {\n" +
+ " String extra;\n" +
+ " }\n" +
"}\n"
},
"",
@@ -3071,35 +3071,35 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
public void test3117_inferredCallout14() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"b/IBase.java",
"\n" +
- "package b;\n" +
- "\n" +
- "public interface IBase {\n" +
- "\n" +
- " void setS(String s);\n" +
+ "package b;\n" +
+ "\n" +
+ "public interface IBase {\n" +
+ "\n" +
+ " void setS(String s);\n" +
"\n" +
- " void setL(java.util.List<String> l);\n" +
+ " void setL(java.util.List<String> l);\n" +
"}\n",
"b/BaseClass.java",
- "package b;\n" +
- "\n" +
- "public class BaseClass implements IBase {\n" +
- "\n" +
- " String s;\n" +
- " java.util.List<String> l;\n" +
- "\n" +
- " public void setS(String s) {\n" +
- " this.s = s;\n" +
- " }\n" +
- "\n" +
- " public void setL(java.util.List<String> l) {\n" +
- " this.l = l;\n" +
- " }\n" +
- "}\n" +
+ "package b;\n" +
+ "\n" +
+ "public class BaseClass implements IBase {\n" +
+ "\n" +
+ " String s;\n" +
+ " java.util.List<String> l;\n" +
+ "\n" +
+ " public void setS(String s) {\n" +
+ " this.s = s;\n" +
+ " }\n" +
+ "\n" +
+ " public void setL(java.util.List<String> l) {\n" +
+ " this.l = l;\n" +
+ " }\n" +
+ "}\n" +
"\n"
},
"",
@@ -3111,57 +3111,57 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
runNegativeTest(
new String[] {
"t/Team3117ic14_2.java",
- "package t;\n" +
- "\n" +
- "import b.IBase;\n" +
- "\n" +
- "public team class Team3117ic14_2 extends Team3117ic14_1 {\n" +
- " @Override\n" +
+ "package t;\n" +
+ "\n" +
+ "import b.IBase;\n" +
+ "\n" +
+ "public team class Team3117ic14_2 extends Team3117ic14_1 {\n" +
+ " @Override\n" +
" protected class Role1 {\n" +
- " @Override public String toString() { return \"R\"; }\n" +
- " Zork extra2;\n" +
- " }\n" +
+ " @Override public String toString() { return \"R\"; }\n" +
+ " Zork extra2;\n" +
+ " }\n" +
"}\n",
"t/Team3117ic14_1.java",
- "package t;\n" +
- "\n" +
- "import b.IBase;\n" +
- "\n" +
- "import base b.BaseClass;\n" +
- "\n" +
- "public team class Team3117ic14_1 {\n" +
- "\n" +
- " @SuppressWarnings(\"inferredcallout\")\n" +
+ "package t;\n" +
+ "\n" +
+ "import b.IBase;\n" +
+ "\n" +
+ "import base b.BaseClass;\n" +
+ "\n" +
+ "public team class Team3117ic14_1 {\n" +
+ "\n" +
+ " @SuppressWarnings(\"inferredcallout\")\n" +
" protected class Role1 implements IBase playedBy BaseClass {\n" +
- " String extra;\n" +
- " }\n" +
+ " String extra;\n" +
+ " }\n" +
"}\n",
},
(this.weavingScheme == WeavingScheme.OTDRE || this.complianceLevel < ClassFileConstants.JDK1_8
?
- "----------\n" +
- "1. ERROR in t\\Team3117ic14_2.java (at line 9)\n" +
- " Zork extra2;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in t\\Team3117ic14_2.java (at line 9)\n" +
+ " Zork extra2;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n"
:
- "----------\n" +
- "1. WARNING in t\\Team3117ic14_1.java (at line 10)\n" +
- " protected class Role1 implements IBase playedBy BaseClass {\n" +
- " ^^^^^^^^^\n" +
- "Base class b.BaseClass has class file version 52 which cannot be handled by the traditional OTRE based on BCEL. Please consider using the ASM based OTDRE instead.\n" +
"----------\n" +
- "----------\n" +
- "1. WARNING in t\\Team3117ic14_2.java (at line 7)\n" +
- " protected class Role1 {\n" +
- " ^^^^^\n" +
- "Base class b.BaseClass has class file version 52 which cannot be handled by the traditional OTRE based on BCEL. Please consider using the ASM based OTDRE instead.\n" +
- "----------\n" +
- "2. ERROR in t\\Team3117ic14_2.java (at line 9)\n" +
- " Zork extra2;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "1. WARNING in t\\Team3117ic14_1.java (at line 10)\n" +
+ " protected class Role1 implements IBase playedBy BaseClass {\n" +
+ " ^^^^^^^^^\n" +
+ "Base class b.BaseClass has class file version 52 which cannot be handled by the traditional OTRE based on BCEL. Please consider using the ASM based OTDRE instead.\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in t\\Team3117ic14_2.java (at line 7)\n" +
+ " protected class Role1 {\n" +
+ " ^^^^^\n" +
+ "Base class b.BaseClass has class file version 52 which cannot be handled by the traditional OTRE based on BCEL. Please consider using the ASM based OTDRE instead.\n" +
+ "----------\n" +
+ "2. ERROR in t\\Team3117ic14_2.java (at line 9)\n" +
+ " Zork extra2;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n"
),
null,//libs
@@ -3175,39 +3175,39 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
public void test3117_inferredCallout14b() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"b/IBase.java",
"\n" +
- "package b;\n" +
- "\n" +
- "public interface IBase {\n" +
- "\n" +
- " void setS(String s);\n" +
+ "package b;\n" +
+ "\n" +
+ "public interface IBase {\n" +
"\n" +
- " void setL(java.util.List<String> l);\n" +
+ " void setS(String s);\n" +
+ "\n" +
+ " void setL(java.util.List<String> l);\n" +
"}\n",
"b/BaseClass.java",
- "package b;\n" +
- "\n" +
- "public class BaseClass implements IBase {\n" +
- "\n" +
- " String s = \"OK\";\n" +
- " java.util.List<String> l;\n" +
- "\n" +
- " public void setS(String s) {\n" +
- " this.s = s;\n" +
- " }\n" +
- "\n" +
- " public void setL(java.util.List<String> l) {\n" +
- " this.l = l;\n" +
+ "package b;\n" +
+ "\n" +
+ "public class BaseClass implements IBase {\n" +
+ "\n" +
+ " String s = \"OK\";\n" +
+ " java.util.List<String> l;\n" +
+ "\n" +
+ " public void setS(String s) {\n" +
+ " this.s = s;\n" +
+ " }\n" +
+ "\n" +
+ " public void setL(java.util.List<String> l) {\n" +
+ " this.l = l;\n" +
" }\n" +
" public void print() {\n" +
" System.out.print(s);\n" +
" System.out.print(l.size());\n" +
- " }\n" +
- "}\n" +
+ " }\n" +
+ "}\n" +
"\n"
},
"",
@@ -3227,34 +3227,34 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
" }\n" +
"}\n",
"t/Team3117ic14_2.java",
- "package t;\n" +
- "\n" +
- "import base b.BaseClass;\n" +
- "\n" +
- "public team class Team3117ic14_2 extends Team3117ic14_1 {\n" +
- " @Override\n" +
+ "package t;\n" +
+ "\n" +
+ "import base b.BaseClass;\n" +
+ "\n" +
+ "public team class Team3117ic14_2 extends Team3117ic14_1 {\n" +
+ " @Override\n" +
" protected class Role1 {\n" +
- " @Override public String toString() { return \"R\"; }\n" +
+ " @Override public String toString() { return \"R\"; }\n" +
" }\n" +
" public void test(BaseClass as Role1 r) {\n" +
" r.setS(\"NOK\");\n" +
" r.setL(new java.util.ArrayList<String>());\n" +
- " }\n" +
+ " }\n" +
"}\n",
"t/Team3117ic14_1.java",
- "package t;\n" +
- "\n" +
- "import b.IBase;\n" +
- "\n" +
- "import base b.BaseClass;\n" +
- "\n" +
- "public team class Team3117ic14_1 {\n" +
- "\n" +
- " @SuppressWarnings(\"inferredcallout\")\n" +
+ "package t;\n" +
+ "\n" +
+ "import b.IBase;\n" +
+ "\n" +
+ "import base b.BaseClass;\n" +
+ "\n" +
+ "public team class Team3117ic14_1 {\n" +
+ "\n" +
+ " @SuppressWarnings(\"inferredcallout\")\n" +
" protected class Role1 implements IBase playedBy BaseClass {\n" +
- " public void setS(String s){}\n" +
- " String extra;\n" +
- " }\n" +
+ " public void setS(String s){}\n" +
+ " String extra;\n" +
+ " }\n" +
"}\n",
},
"OK0",
@@ -3284,11 +3284,11 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
"public class T3118icb1 {}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team3118icb1.java (at line 5)\n" +
- " test -> ;\n" +
- " ^^\n" +
- "Syntax error on token \"->\", MethodSpecShort expected after this token\n" +
+ "----------\n" +
+ "1. ERROR in Team3118icb1.java (at line 5)\n" +
+ " test -> ;\n" +
+ " ^^\n" +
+ "Syntax error on token \"->\", MethodSpecShort expected after this token\n" +
"----------\n");
}
@@ -3310,16 +3310,16 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
"public class T3118icb2 {}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team3118icb2.java (at line 4)\n" +
- " void test() -> test();\n" +
- " ^^^^^^\n" +
- "Syntax error: missing return type for method designator (OTJLD A.3.2). \n" +
- "----------\n" +
- "2. ERROR in Team3118icb2.java (at line 4)\n" +
- " void test() -> test();\n" +
- " ^^^^^^\n" +
- "No method test() found in type T3118icb2 to resolve method designator (OTJLD 3.1(c)).\n" +
+ "----------\n" +
+ "1. ERROR in Team3118icb2.java (at line 4)\n" +
+ " void test() -> test();\n" +
+ " ^^^^^^\n" +
+ "Syntax error: missing return type for method designator (OTJLD A.3.2). \n" +
+ "----------\n" +
+ "2. ERROR in Team3118icb2.java (at line 4)\n" +
+ " void test() -> test();\n" +
+ " ^^^^^^\n" +
+ "No method test() found in type T3118icb2 to resolve method designator (OTJLD 3.1(c)).\n" +
"----------\n");
}
@@ -3341,11 +3341,11 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
"public class T3118icb3 {}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team3118icb3.java (at line 4)\n" +
- " void test() -> void t\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error on token(s), misplaced construct(s)\n" +
+ "----------\n" +
+ "1. ERROR in Team3118icb3.java (at line 4)\n" +
+ " void test() -> void t\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error on token(s), misplaced construct(s)\n" +
"----------\n");
}
@@ -3367,23 +3367,23 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
"public class T3118icb4 {}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team3118icb4.java (at line 4)\n" +
- " void test() -> \n" +
- " ^^\n" +
- "Syntax error, insert \"CallloutFieldSpec\" to complete CalloutHeader\n" +
- "----------\n" +
- "2. ERROR in Team3118icb4.java (at line 4)\n" +
- " void test() -> \n" +
- " ^^\n" +
- "Syntax error, insert \"EmptyParameterMappings\" to complete ClassBodyDeclarations\n" +
+ "----------\n" +
+ "1. ERROR in Team3118icb4.java (at line 4)\n" +
+ " void test() -> \n" +
+ " ^^\n" +
+ "Syntax error, insert \"CallloutFieldSpec\" to complete CalloutHeader\n" +
+ "----------\n" +
+ "2. ERROR in Team3118icb4.java (at line 4)\n" +
+ " void test() -> \n" +
+ " ^^\n" +
+ "Syntax error, insert \"EmptyParameterMappings\" to complete ClassBodyDeclarations\n" +
"----------\n");
}
// a callout binding has to select between overloaded base methods
// 3.1.19-otjld-callout-with-overloading-1
public void test3119_calloutWithOverloading1() {
-
+
runConformTest(
new String[] {
"Team3119cwo1.java",
@@ -3421,13 +3421,13 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
},
"42");
}
-
+
// ==== from binding-of-abstract-and-concrete-methods: ====
-
+
// a callout binding to an abstract role method is invoked
// 7.2.1-otjld-callout-bound-abstract-method-invocation-1
public void test721_calloutBoundAbstractMethodInvocation1() {
-
+
runConformTest(
new String[] {
"T721cbami1Main.java",
@@ -3474,7 +3474,7 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
// a callout binding to an abstract role method is invoked
// 7.2.1-otjld-callout-bound-abstract-method-invocation-2
public void test721_calloutBoundAbstractMethodInvocation2() {
-
+
runConformTest(
new String[] {
"T721cbami2Main.java",
@@ -3584,21 +3584,21 @@ public class CalloutMethodBinding extends AbstractOTJLDTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in p2\\Team2.java (at line 19)\n" +
- " return getF1() +\n" +
- " ^^^^^\n" +
- "The method getF1() from the role type Team2.R is not visible (OTJLD 1.2.1(e)).\n" +
- "----------\n" +
- "2. ERROR in p2\\Team2.java (at line 20)\n" +
- " getF2() +\n" +
- " ^^^^^\n" +
- "The method getF2() from the role type Team2.R is not visible (OTJLD 1.2.1(e)).\n" +
- "----------\n" +
- "3. ERROR in p2\\Team2.java (at line 25)\n" +
- " m2() +\n" +
- " ^^\n" +
- "The method m2() from the role type Team2.R is not visible (OTJLD 1.2.1(e)).\n" +
+ "----------\n" +
+ "1. ERROR in p2\\Team2.java (at line 19)\n" +
+ " return getF1() +\n" +
+ " ^^^^^\n" +
+ "The method getF1() from the role type Team2.R is not visible (OTJLD 1.2.1(e)).\n" +
+ "----------\n" +
+ "2. ERROR in p2\\Team2.java (at line 20)\n" +
+ " getF2() +\n" +
+ " ^^^^^\n" +
+ "The method getF2() from the role type Team2.R is not visible (OTJLD 1.2.1(e)).\n" +
+ "----------\n" +
+ "3. ERROR in p2\\Team2.java (at line 25)\n" +
+ " m2() +\n" +
+ " ^^\n" +
+ "The method m2() from the role type Team2.R is not visible (OTJLD 1.2.1(e)).\n" +
"----------\n");
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutParameterBinding_LiftingAndLowering.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutParameterBinding_LiftingAndLowering.java
index 399e432e0..b2408e55e 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutParameterBinding_LiftingAndLowering.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutParameterBinding_LiftingAndLowering.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -29,11 +29,11 @@ import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
@SuppressWarnings("unchecked")
public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTest {
-
+
public CalloutParameterBinding_LiftingAndLowering(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -41,7 +41,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -54,7 +54,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// an invocation of a callout-bound base method from the direct base class that has a parameter mapping
// 3.2.1-otjld-callout-invocation-with-mapped-parameter-1
public void test321_calloutInvocationWithMappedParameter1() {
-
+
runConformTest(
new String[] {
"T321ciwmp1Main.java",
@@ -109,7 +109,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// an invocation of a callout-bound base method from the indirect base class that has a parameter mapping
// 3.2.1-otjld-callout-invocation-with-mapped-parameter-2
public void test321_calloutInvocationWithMappedParameter2() {
-
+
runConformTest(
new String[] {
"T321ciwmp2Main.java",
@@ -168,7 +168,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// an invocation of a callout-bound base method from the indirect base class that has a parameter mapping
// 3.2.1-otjld-callout-invocation-with-mapped-parameter-3
public void test321_calloutInvocationWithMappedParameter3() {
-
+
runConformTest(
new String[] {
"T321ciwmp3Main.java",
@@ -234,7 +234,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// corrected version of buggy reported example (callout version)
// 3.2.1-otjld-callout-invocation-with-mapped-parameter-4
public void test321_calloutInvocationWithMappedParameter4() {
-
+
runConformTest(
new String[] {
"T321ciwmp4Main.java",
@@ -275,7 +275,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// corrected version of buggy reported example (callin version)
// 3.2.1-otjld-callout-invocation-with-mapped-parameter-5
public void test321_calloutInvocationWithMappedParameter5() {
-
+
runConformTest(
new String[] {
"T321ciwmp5Main.java",
@@ -346,152 +346,152 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team321ciwmp6.java (at line 1)\n" +
- " \n" +
- "public team class Team321ciwmp6 {\n" +
- " ^\n" +
- "Syntax error on token \";\", ++ expected before this token\n" +
+ "----------\n" +
+ "1. ERROR in Team321ciwmp6.java (at line 1)\n" +
+ " \n" +
+ "public team class Team321ciwmp6 {\n" +
+ " ^\n" +
+ "Syntax error on token \";\", ++ expected before this token\n" +
"----------\n" +
- ( this.complianceLevel < ClassFileConstants.JDK1_8
+ ( this.complianceLevel < ClassFileConstants.JDK1_8
?
- "2. ERROR in Team321ciwmp6.java (at line 5)\n" +
- " int doSomethingOther(int r1) -> int doSomething(int b1) wrong\n" +
- " with {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error on tokens, EmptyParameterMappings expected instead\n" +
- "----------\n" +
- "3. ERROR in Team321ciwmp6.java (at line 7)\n" +
- " r1 -> b1,\n" +
- " ^\n" +
- "Syntax error on token \",\", ; expected\n"+
- "----------\n" +
- "4. ERROR in Team321ciwmp6.java (at line 9)\n" +
- " };\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete ClassBody\n" +
- "----------\n" +
- "5. ERROR in Team321ciwmp6.java (at line 11)\n" +
- " int doCalloutGetSomeFieldDoubled() -> get int someField\n" +
- " ^^^\n" +
- "Syntax error on token \"int\", @ expected\n" +
- "----------\n" +
- "6. ERROR in Team321ciwmp6.java (at line 11)\n" +
- " int doCalloutGetSomeFieldDoubled() -> get int someField\n" +
- " with {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error on tokens, ClassHeader expected instead\n" +
- "----------\n" +
- "7. ERROR in Team321ciwmp6.java (at line 12)\n" +
- " with {\n" +
- " result <- 2 * base.someField\n" +
- " ^\n" +
- "Syntax error on token \";\", & expected before this token\n" +
- "----------\n" +
- "8. ERROR in Team321ciwmp6.java (at line 13)\n" +
- " result <- 2 * base.someField\n" +
- " ^^^^^^^^^^^^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
- "----------\n" +
- "9. ERROR in Team321ciwmp6.java (at line 13)\n" +
- " result <- 2 * base.someField\n" +
- " ^^^^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
- "----------\n" +
- "10. ERROR in Team321ciwmp6.java (at line 13)\n" +
- " result <- 2 * base.someField\n" +
- " ^\n" +
- "Syntax error, insert \"enum Identifier\" to complete EnumHeaderName\n" +
- "----------\n" +
- "11. ERROR in Team321ciwmp6.java (at line 13)\n" +
- " result <- 2 * base.someField\n" +
- " ^\n" +
- "Syntax error, insert \"EnumBody\" to complete ClassBodyDeclarations\n" +
- "----------\n" +
- "12. ERROR in Team321ciwmp6.java (at line 15)\n" +
- " }\n" +
- "}\n" +
- " ^^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
+ "2. ERROR in Team321ciwmp6.java (at line 5)\n" +
+ " int doSomethingOther(int r1) -> int doSomething(int b1) wrong\n" +
+ " with {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error on tokens, EmptyParameterMappings expected instead\n" +
+ "----------\n" +
+ "3. ERROR in Team321ciwmp6.java (at line 7)\n" +
+ " r1 -> b1,\n" +
+ " ^\n" +
+ "Syntax error on token \",\", ; expected\n"+
+ "----------\n" +
+ "4. ERROR in Team321ciwmp6.java (at line 9)\n" +
+ " };\n" +
+ " ^\n" +
+ "Syntax error, insert \"}\" to complete ClassBody\n" +
+ "----------\n" +
+ "5. ERROR in Team321ciwmp6.java (at line 11)\n" +
+ " int doCalloutGetSomeFieldDoubled() -> get int someField\n" +
+ " ^^^\n" +
+ "Syntax error on token \"int\", @ expected\n" +
+ "----------\n" +
+ "6. ERROR in Team321ciwmp6.java (at line 11)\n" +
+ " int doCalloutGetSomeFieldDoubled() -> get int someField\n" +
+ " with {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error on tokens, ClassHeader expected instead\n" +
+ "----------\n" +
+ "7. ERROR in Team321ciwmp6.java (at line 12)\n" +
+ " with {\n" +
+ " result <- 2 * base.someField\n" +
+ " ^\n" +
+ "Syntax error on token \";\", & expected before this token\n" +
+ "----------\n" +
+ "8. ERROR in Team321ciwmp6.java (at line 13)\n" +
+ " result <- 2 * base.someField\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Syntax error on tokens, delete these tokens\n" +
+ "----------\n" +
+ "9. ERROR in Team321ciwmp6.java (at line 13)\n" +
+ " result <- 2 * base.someField\n" +
+ " ^^^^^\n" +
+ "Syntax error on tokens, delete these tokens\n" +
+ "----------\n" +
+ "10. ERROR in Team321ciwmp6.java (at line 13)\n" +
+ " result <- 2 * base.someField\n" +
+ " ^\n" +
+ "Syntax error, insert \"enum Identifier\" to complete EnumHeaderName\n" +
+ "----------\n" +
+ "11. ERROR in Team321ciwmp6.java (at line 13)\n" +
+ " result <- 2 * base.someField\n" +
+ " ^\n" +
+ "Syntax error, insert \"EnumBody\" to complete ClassBodyDeclarations\n" +
+ "----------\n" +
+ "12. ERROR in Team321ciwmp6.java (at line 15)\n" +
+ " }\n" +
+ "}\n" +
+ " ^^^\n" +
+ "Syntax error on tokens, delete these tokens\n" +
"----------\n"
:
- "2. ERROR in Team321ciwmp6.java (at line 5)\n" +
- " int doSomethingOther(int r1) -> int doSomething(int b1) wrong\n" +
- " ^^^^^\n" +
- "Syntax error on token \"wrong\", delete this token\n" +
- "----------\n" +
- "3. ERROR in Team321ciwmp6.java (at line 7)\n" +
- " r1 -> b1,\n" +
- " ^^\n" +
- "Syntax error, insert \"AssignmentOperator Expression\" to complete Assignment\n" +
- "----------\n" +
- "4. ERROR in Team321ciwmp6.java (at line 7)\n" +
- " r1 -> b1,\n" +
- " ^^\n" +
- "Syntax error, insert \"-> Identifier\" to complete ParameterMapping\n" +
- "----------\n" +
- "5. ERROR in Team321ciwmp6.java (at line 9)\n" +
- " };\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete ClassBody\n" +
- "----------\n" +
- "6. ERROR in Team321ciwmp6.java (at line 9)\n" +
- " };\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete ClassBody\n" +
- "----------\n" +
- "7. ERROR in Team321ciwmp6.java (at line 11)\n" +
- " int doCalloutGetSomeFieldDoubled() -> get int someField\n" +
- " ^^^\n" +
+ "2. ERROR in Team321ciwmp6.java (at line 5)\n" +
+ " int doSomethingOther(int r1) -> int doSomething(int b1) wrong\n" +
+ " ^^^^^\n" +
+ "Syntax error on token \"wrong\", delete this token\n" +
+ "----------\n" +
+ "3. ERROR in Team321ciwmp6.java (at line 7)\n" +
+ " r1 -> b1,\n" +
+ " ^^\n" +
+ "Syntax error, insert \"AssignmentOperator Expression\" to complete Assignment\n" +
+ "----------\n" +
+ "4. ERROR in Team321ciwmp6.java (at line 7)\n" +
+ " r1 -> b1,\n" +
+ " ^^\n" +
+ "Syntax error, insert \"-> Identifier\" to complete ParameterMapping\n" +
+ "----------\n" +
+ "5. ERROR in Team321ciwmp6.java (at line 9)\n" +
+ " };\n" +
+ " ^\n" +
+ "Syntax error, insert \"}\" to complete ClassBody\n" +
+ "----------\n" +
+ "6. ERROR in Team321ciwmp6.java (at line 9)\n" +
+ " };\n" +
+ " ^\n" +
+ "Syntax error, insert \"}\" to complete ClassBody\n" +
+ "----------\n" +
+ "7. ERROR in Team321ciwmp6.java (at line 11)\n" +
+ " int doCalloutGetSomeFieldDoubled() -> get int someField\n" +
+ " ^^^\n" +
(isJ14plus
? "Syntax error on token \"int\", record expected\n"
- : "Syntax error on token \"int\", @ expected\n") +
- "----------\n" +
- "8. ERROR in Team321ciwmp6.java (at line 11)\n" +
- " int doCalloutGetSomeFieldDoubled() -> get int someField\n" +
- " with {\n" +
+ : "Syntax error on token \"int\", @ expected\n") +
+ "----------\n" +
+ "8. ERROR in Team321ciwmp6.java (at line 11)\n" +
+ " int doCalloutGetSomeFieldDoubled() -> get int someField\n" +
+ " with {\n" +
(isJ14plus
? " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Syntax error on tokens, delete these tokens\n"
- : " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error on tokens, ClassHeader expected instead\n") +
- "----------\n" +
- "9. ERROR in Team321ciwmp6.java (at line 12)\n" +
- " with {\n" +
- " result <- 2 * base.someField\n" +
- " ^\n" +
- "Syntax error on token \";\", & expected before this token\n" +
- "----------\n" +
- "10. ERROR in Team321ciwmp6.java (at line 13)\n" +
- " result <- 2 * base.someField\n" +
- " ^^^^^^^^^^^^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
- "----------\n" +
- "11. ERROR in Team321ciwmp6.java (at line 13)\n" +
- " result <- 2 * base.someField\n" +
- " ^^^^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
- "----------\n" +
- "12. ERROR in Team321ciwmp6.java (at line 13)\n" +
- " result <- 2 * base.someField\n" +
- " ^\n" +
- "Syntax error, insert \"enum Identifier\" to complete EnumHeaderName\n" +
- "----------\n" +
- "13. ERROR in Team321ciwmp6.java (at line 13)\n" +
- " result <- 2 * base.someField\n" +
- " ^\n" +
- "Syntax error, insert \"EnumBody\" to complete ClassBodyDeclarations\n" +
+ : " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error on tokens, ClassHeader expected instead\n") +
+ "----------\n" +
+ "9. ERROR in Team321ciwmp6.java (at line 12)\n" +
+ " with {\n" +
+ " result <- 2 * base.someField\n" +
+ " ^\n" +
+ "Syntax error on token \";\", & expected before this token\n" +
+ "----------\n" +
+ "10. ERROR in Team321ciwmp6.java (at line 13)\n" +
+ " result <- 2 * base.someField\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Syntax error on tokens, delete these tokens\n" +
+ "----------\n" +
+ "11. ERROR in Team321ciwmp6.java (at line 13)\n" +
+ " result <- 2 * base.someField\n" +
+ " ^^^^^\n" +
+ "Syntax error on tokens, delete these tokens\n" +
+ "----------\n" +
+ "12. ERROR in Team321ciwmp6.java (at line 13)\n" +
+ " result <- 2 * base.someField\n" +
+ " ^\n" +
+ "Syntax error, insert \"enum Identifier\" to complete EnumHeaderName\n" +
+ "----------\n" +
+ "13. ERROR in Team321ciwmp6.java (at line 13)\n" +
+ " result <- 2 * base.someField\n" +
+ " ^\n" +
+ "Syntax error, insert \"EnumBody\" to complete ClassBodyDeclarations\n" +
"----------\n" +
(isJ14plus
- ? "14. ERROR in Team321ciwmp6.java (at line 14)\n" +
- " };\n" +
- " ^\n" +
+ ? "14. ERROR in Team321ciwmp6.java (at line 14)\n" +
+ " };\n" +
+ " ^\n" +
"Syntax error on token \"}\", { expected\n"
- : "14. ERROR in Team321ciwmp6.java (at line 15)\n" +
- " }\n" +
- "}\n" +
- " ^^^\n" +
- "Syntax error on tokens, delete these tokens\n") +
+ : "14. ERROR in Team321ciwmp6.java (at line 15)\n" +
+ " }\n" +
+ "}\n" +
+ " ^^^\n" +
+ "Syntax error on tokens, delete these tokens\n") +
"----------\n"
));
}
@@ -499,7 +499,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// an invocation of a callout-bound base method from the direct base class that has a implicit result mapping
// 3.2.2-otjld-callout-invocation-with-result-mapping-1
public void test322_calloutInvocationWithResultMapping1() {
-
+
runConformTest(
new String[] {
"T322ciwrm1Main.java",
@@ -546,7 +546,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// an invocation of a callout-bound base method from the indirect base class that has an explicit result mapping
// 3.2.2-otjld-callout-invocation-with-result-mapping-2
public void test322_calloutInvocationWithResultMapping2() {
-
+
runConformTest(
new String[] {
"T322ciwrm2Main.java",
@@ -677,11 +677,11 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
"}\n" +
" \n"
},
- "----------\n" +
- "1. WARNING in Team324mfnp1.java (at line 7)\n" +
- " arg -> arg\n" +
- " ^^^^^^^^^^\n" +
- "Unused mapping for parameter arg is ignored (OTJLD 3.2).\n" +
+ "----------\n" +
+ "1. WARNING in Team324mfnp1.java (at line 7)\n" +
+ " arg -> arg\n" +
+ " ^^^^^^^^^^\n" +
+ "Unused mapping for parameter arg is ignored (OTJLD 3.2).\n" +
"----------\n");
}
@@ -943,11 +943,11 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team3210wpmd1.java (at line 6)\n" +
- " String test(String arg) -> void test(String arg1, String arg2) with {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Incomplete parameter mapping: argument arg2 of base method void test(String arg1, String arg2) is not mapped (OTJLD 3.2(b)).\n" +
+ "----------\n" +
+ "1. ERROR in Team3210wpmd1.java (at line 6)\n" +
+ " String test(String arg) -> void test(String arg1, String arg2) with {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Incomplete parameter mapping: argument arg2 of base method void test(String arg1, String arg2) is not mapped (OTJLD 3.2(b)).\n" +
"----------\n");
}
@@ -976,11 +976,11 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team3210wpmd2.java (at line 8)\n" +
- " resultWrong <- \"OK\"\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Wrong mapping direction for parameter resultWrong, should use -> unless mapping \'result\' (OTJLD 3.2(b)). \n" +
+ "----------\n" +
+ "1. ERROR in Team3210wpmd2.java (at line 8)\n" +
+ " resultWrong <- \"OK\"\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Wrong mapping direction for parameter resultWrong, should use -> unless mapping \'result\' (OTJLD 3.2(b)). \n" +
"----------\n");
}
@@ -1124,7 +1124,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// a field of the role class is used in a parameter mapping
// 3.2.14-otjld-role-feature-access-1
public void test3214_roleFeatureAccess1() {
-
+
runConformTest(
new String[] {
"T3214rfa1Main.java",
@@ -1181,7 +1181,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// a method of the implicit superrole is used in a result mapping
// 3.2.14-otjld-role-feature-access-2
public void test3214_roleFeatureAccess2() {
-
+
runConformTest(
new String[] {
"T3214rfa2Main.java",
@@ -1237,7 +1237,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// a field of the explicit superrole is used in a parameter mapping
// 3.2.14-otjld-role-feature-access-3
public void test3214_roleFeatureAccess3() {
-
+
runConformTest(
new String[] {
"T3214rfa3Main.java",
@@ -1287,7 +1287,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// a method of an indirect superrole is used in a result mapping
// 3.2.14-otjld-role-feature-access-4
public void test3214_roleFeatureAccess4() {
-
+
runConformTest(
new String[] {
"T3214rfa4Main.java",
@@ -1345,7 +1345,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// a method of the explicit superrole is used in a parameter mapping using super
// 3.2.14-otjld-role-feature-access-5
public void test3214_roleFeatureAccess5() {
-
+
runConformTest(
new String[] {
"T3214rfa5Main.java",
@@ -1400,7 +1400,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// a field of the enclosing team is used in a parameter mapping
// 3.2.15-otjld-team-feature-access-1
public void test3215_teamFeatureAccess1() {
-
+
runConformTest(
new String[] {
"T3215tfa1Main.java",
@@ -1447,7 +1447,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// a method of the direct superteam is used in a result mapping
// 3.2.15-otjld-team-feature-access-2
public void test3215_teamFeatureAccess2() {
-
+
runConformTest(
new String[] {
"T3215tfa2Main.java",
@@ -1499,7 +1499,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// a field of an indirect superteam is used in a parameter mapping
// 3.2.15-otjld-team-feature-access-3
public void test3215_teamFeatureAccess3() {
-
+
runConformTest(
new String[] {
"p1/T3215tfa3Main.java",
@@ -1564,7 +1564,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// a field of the direct superteam is used in a result mapping via tsuper
// 3.2.15-otjld-team-feature-access-4
public void test3215_teamFeatureAccess4() {
-
+
runConformTest(
new String[] {
"T3215tfa4Main.java",
@@ -1614,7 +1614,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// a field of the enclosing normal class is used in a result mapping
// 3.2.16-otjld-enclosing-class-feature-access-1
public void test3216_enclosingClassFeatureAccess1() {
-
+
runConformTest(
new String[] {
"T3216ecfa1Main.java",
@@ -1662,7 +1662,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// a method of the superclass of the enclosing normal class is used in a parameter mapping
// 3.2.16-otjld-enclosing-class-feature-access-2
public void test3216_enclosingClassFeatureAccess2() {
-
+
runConformTest(
new String[] {
"T3216ecfa2Main.java",
@@ -1717,7 +1717,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// a field of an indirect superclass of the enclosing normal class is used in a parameter mapping
// 3.2.16-otjld-enclosing-class-feature-access-3
public void test3216_enclosingClassFeatureAccess3() {
-
+
runConformTest(
new String[] {
"T3216ecfa3Main.java",
@@ -1778,7 +1778,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// a method of the superclass of the enclosing normal class is used in a result mapping
// 3.2.16-otjld-enclosing-class-feature-access-4
public void test3216_enclosingClassFeatureAccess4() {
-
+
runConformTest(
new String[] {
"T3216ecfa4Main.java",
@@ -1832,7 +1832,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// a static method of the enclosing normal class is used in a parameter mapping
// 3.2.17-otjld-static-feature-access-1
public void test3217_staticFeatureAccess1() {
-
+
runConformTest(
new String[] {
"T3217sfa1Main.java",
@@ -1883,7 +1883,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// a static method in another class in the same package is used in a result mapping
// 3.2.17-otjld-static-feature-access-2
public void test3217_staticFeatureAccess2() {
-
+
runConformTest(
new String[] {
"T3217sfa2Main.java",
@@ -1935,7 +1935,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// a static field of the another nested class in the enclosing normal class is used in a parameter mapping
// 3.2.17-otjld-static-feature-access-3
public void test3217_staticFeatureAccess3() {
-
+
runConformTest(
new String[] {
"T3217sfa3Main.java",
@@ -1986,7 +1986,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// a static field in another team class in the same package is used in a result mapping
// 3.2.17-otjld-static-feature-access-4
public void test3217_staticFeatureAccess4() {
-
+
runConformTest(
new String[] {
"T3217sfa4Main.java",
@@ -2036,7 +2036,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// a static field in an inner class in another package is used in a parameter mapping
// 3.2.17-otjld-static-feature-access-5
public void test3217_staticFeatureAccess5() {
-
+
runConformTest(
new String[] {
"p1/T3217sfa5Main.java",
@@ -2239,7 +2239,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// in a result mapping, an instance of an anonymous class is created
// 3.2.24-otjld-anonymous-class-instance
public void test3224_anonymousClassInstance() {
-
+
runConformTest(
new String[] {
"T3224aciMain.java",
@@ -2287,7 +2287,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// in a callout binding, an object is lifted to a role class
// 3.2.25-otjld_testbug-lifting-mapping-expression-1
public void _testbug_test3225_liftingMappingExpression1() {
-
+
runConformTest(
new String[] {
"T3225lme1Main.java",
@@ -2338,7 +2338,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// in a callout binding with parameter mapping, an object is lifted to a role class
// 3.2.25-otjld_testbug-lifting-mapping-expression-2
public void _testbug_test3225_liftingMappingExpression2() {
-
+
runConformTest(
new String[] {
"T3225lme2Main.java",
@@ -2506,7 +2506,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// in a callout binding with parameter mapping, an object is lifted to a role class
// 3.2.25-otjld-lifting-mapping-expression-5
public void test3225_liftingMappingExpression5() {
-
+
runConformTest(
new String[] {
"T3225lme5Main.java",
@@ -2574,7 +2574,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// within a callout binding, an object is lowered to a role class
// 3.2.26-otjld-lowering-mapping-expression-1
public void test3226_loweringMappingExpression1() {
-
+
runConformTest(
new String[] {
"T3226lme1Main.java",
@@ -2637,7 +2637,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// within a callout binding, an object is lowered to a role class
// 3.2.26-otjld-lowering-mapping-expression-2
public void test3226_loweringMappingExpression2() {
-
+
runConformTest(
new String[] {
"T3226lme2Main.java",
@@ -2746,7 +2746,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// in a callout binding with parameter mapping, an object is lowered to a base class
// 3.2.26-otjld-lowering-mapping-expression-3
public void test3226_loweringMappingExpression3() {
-
+
runConformTest(
new String[] {
"T3226lme3Main.java",
@@ -3009,7 +3009,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// the callout-bound role method has a return type whereas the base method has none
// 3.2.28-otjld-return-type-addition
public void test3228_returnTypeAddition() {
-
+
runConformTest(
new String[] {
"T3228rtaMain.java",
@@ -3060,7 +3060,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// the callout-bound role method has no return type whereas the base method has one
// 3.2.29-otjld-return-type-removal-1
public void test3229_returnTypeRemoval1() {
-
+
runConformTest(
new String[] {
"T3229rtr1Main.java",
@@ -3151,7 +3151,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// the callout-bound role method has no return type whereas the base method has one
// 3.2.29-otjld-return-type-removal-2
public void test3229_returnTypeRemoval2() {
-
+
runConformTest(
new String[] {
"T3229rtr2Main.java",
@@ -3203,7 +3203,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// the callout-binding uses this to access a role feature
// 3.2.30-otjld-this-access-1
public void test3230_thisAccess1() {
-
+
runConformTest(
new String[] {
"T3230ta1Main.java",
@@ -3249,7 +3249,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// the callout-binding uses this to access a role feature - default visibility
// 3.2.30-otjld-this-access-2a
public void test3230_thisAccess2a() {
-
+
runConformTest(
new String[] {
"T3230ta2aMain.java",
@@ -3296,7 +3296,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// the callout-binding uses this to access a private role feature
// 3.2.30-otjld-this-access-2b
public void test3230_thisAccess2b() {
-
+
runConformTest(
new String[] {
"Team3230ta2b.java",
@@ -3338,7 +3338,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// the callout-binding accesses a role feature unqualified
// 3.2.30-otjld-this-access-2c
public void test3230_thisAccess2c() {
-
+
runConformTest(
new String[] {
"T3230ta2cMain.java",
@@ -3385,7 +3385,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// the callout-bound role method uses this to access a role feature
// 3.2.30-otjld-this-access-3
public void test3230_thisAccess3() {
-
+
runConformTest(
new String[] {
"T3230ta3Main.java",
@@ -3431,7 +3431,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// the callout-binding uses super to access a feature of the superrole
// 3.2.31-otjld-super-access-1
public void test3231_superAccess1() {
-
+
runConformTest(
new String[] {
"T3231sa1Main.java",
@@ -3480,7 +3480,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// the callout-binding uses super to access a feature of the superrole
// 3.2.31-otjld-super-access-2
public void test3231_superAccess2() {
-
+
runConformTest(
new String[] {
"T3231sa2Main.java",
@@ -3533,7 +3533,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// the callout-bound role method uses super to access a feature of the superrole
// 3.2.31-otjld-super-access-3
public void test3231_superAccess3() {
-
+
runConformTest(
new String[] {
"T3231sa3Main.java",
@@ -3588,7 +3588,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// the callout-binding uses tsuper to access a feature of the implicit superrole
// 3.2.32-otjld-tsuper-access-1
public void test3232_tsuperAccess1() {
-
+
runConformTest(
new String[] {
"T3232ta1Main.java",
@@ -3683,7 +3683,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// the callout-binding uses base to access a feature of the base class
// 3.2.33-otjld-base-use-1
public void test3233_baseUse1() {
-
+
runConformTest(
new String[] {
"Team3233bu1.java",
@@ -3720,7 +3720,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// the callout-binding uses base to access a feature of the base class
// 3.2.33-otjld-base-use-2
public void test3233_baseUse2() {
-
+
runConformTest(
new String[] {
"Team3233bu2.java",
@@ -3755,7 +3755,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// a callout-binding without parameter mapping between parameter-conform role and base methods
// 3.2.34-otjld-conform-parameter-mapping-1
public void test3234_conformParameterMapping1() {
-
+
runConformTest(
new String[] {
"T3234cpm1Main.java",
@@ -3826,7 +3826,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// a callout-binding without parameter mapping between parameter-conform role and base methods
// 3.2.34-otjld-conform-parameter-mapping-2
public void test3234_conformParameterMapping2() {
-
+
runConformTest(
new String[] {
"T3234cpm2Main.java",
@@ -3868,7 +3868,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// a callout-binding without parameter mapping between parameter-conform role and base methods
// 3.2.34-otjld-conform-parameter-mapping-3
public void test3234_conformParameterMapping3() {
-
+
runConformTest(
new String[] {
"T3234cpm3Main.java",
@@ -3910,7 +3910,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// a callout-binding without parameter mapping between parameter-conform role and base methods
// 3.2.34-otjld-conform-parameter-mapping-4
public void test3234_conformParameterMapping4() {
-
+
runConformTest(
new String[] {
"T3234cpm4Main.java",
@@ -3968,7 +3968,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// a callout-binding without parameter mapping between parameter-conform role and base methods
// 3.2.34-otjld-conform-parameter-mapping-5
public void test3234_conformParameterMapping5() {
-
+
runConformTest(
new String[] {
"T3234cpm5Main.java",
@@ -4023,7 +4023,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// a callout-binding without parameter mapping between parameter-conform role and base methods
// 3.2.34-otjld-conform-parameter-mapping-6
public void test3234_conformParameterMapping6() {
-
+
runConformTest(
new String[] {
"T3234cpm6Main.java",
@@ -4229,7 +4229,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// a callout-binding where the role method has more parameters than the base method
// 3.2.37-otjld-role-has-more-parameters-1
public void test3237_roleHasMoreParameters1() {
-
+
runConformTest(
new String[] {
"T3237rhmp1Main.java",
@@ -4301,7 +4301,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// a callout-binding where the role method has more parameters than the base method
// 3.2.37-otjld-role-has-more-parameters-2
public void test3237_roleHasMoreParameters2() {
-
+
runConformTest(
new String[] {
"T3237rhmp2Main.java",
@@ -4343,7 +4343,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// a callout-binding where the role method has less parameters than the base method
// 3.2.38-otjld-role-has-less-parameters
public void test3238_roleHasLessParameters() {
-
+
runConformTest(
new String[] {
"T3238rhlpMain.java",
@@ -4390,7 +4390,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// a callout-binding where the role method has a parameter order that differs from the base method
// 3.2.39-otjld-different-parameter-order
public void test3239_differentParameterOrder() {
-
+
runConformTest(
new String[] {
"T3239dpoMain.java",
@@ -4437,7 +4437,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// a base method appears in an after binding which returns an array type (WITNESS for TPX-278)
// 3.2.40-otjld-after-binding-with-array-result-1
public void test3240_afterBindingWithArrayResult1() {
-
+
runConformTest(
new String[] {
"Team3240abwar1.java",
@@ -4472,7 +4472,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
// a base method appears in an after binding with parameter mapping, base method returns an array type
// 3.2.40-otjld-after-binding-with-array-result-2
public void test3240_afterBindingWithArrayResult2() {
-
+
runConformTest(
new String[] {
"Team3240abwar2.java",
@@ -4515,7 +4515,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
customOptions.put(CompilerOptions.OPTION_ReportUnusedLabel, CompilerOptions.WARNING);
customOptions.put(CompilerOptions.OPTION_ReportUnusedImport, CompilerOptions.WARNING);
customOptions.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"T3241iuip1Main.java",
@@ -4569,7 +4569,7 @@ public class CalloutParameterBinding_LiftingAndLowering extends AbstractOTJLDTes
public void test3241_importUsedInParammap2() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"T3241iuip2Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutToField.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutToField.java
index 53d2f3d74..6dbf1b569 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutToField.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutToField.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010, 2016 Stephan Herrmann
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -27,11 +27,11 @@ import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
@SuppressWarnings("unchecked")
public class CalloutToField extends AbstractOTJLDTest {
-
+
public CalloutToField(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -39,7 +39,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -52,7 +52,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a getter callout
// 3.3.1-otjld-callout-get-1
public void test331_calloutGet1() {
-
+
runConformTest(
new String[] {
"Team331cg1.java",
@@ -90,7 +90,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a getter callout to a static field
// 3.3.1-otjld-callout-get-2
public void test331_calloutGet2() {
-
+
runConformTest(
new String[] {
"Team331cg2.java",
@@ -128,7 +128,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a static getter callout to a static field
// 3.3.1-otjld-callout-get-2s
public void test331_calloutGet2s() {
-
+
runConformTest(
new String[] {
"Team331cg2s.java",
@@ -166,7 +166,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a getter callout to an inherited field
// 3.3.1-otjld-callout-get-3
public void test331_calloutGet3() {
-
+
runConformTest(
new String[] {
"Team331cg3.java",
@@ -365,7 +365,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a getter callout with role method return type void
// 3.3.1-otjld-callout-get-6
public void test331_calloutGet6() {
-
+
runConformTest(
new String[] {
"T331cg6Main.java",
@@ -406,7 +406,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a getter callout with parameter mappings
// 3.3.1-otjld-callout-get-7
public void test331_calloutGet7() {
-
+
runConformTest(
new String[] {
"Team331cg7.java",
@@ -443,7 +443,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a getter callout to a basic type field
// 3.3.1-otjld-callout-get-8
public void test331_calloutGet8() {
-
+
runConformTest(
new String[] {
"Team331cg8.java",
@@ -482,7 +482,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a getter callout to a base type with a role in this team (role is NOT public)
// 3.3.1-otjld-callout-get-9
public void test331_calloutGet9() {
-
+
runConformTest(
new String[] {
"Team331cg9.java",
@@ -525,7 +525,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a normal callout to a base type with a role in this team
// 3.3.1-otjld-callout-get-9a
public void test331_calloutGet9a() {
-
+
runConformTest(
new String[] {
"Team331cg9a.java",
@@ -571,7 +571,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a getter callout to a base type with a role in this team (role is public)
// 3.3.1-otjld-callout-get-9b
public void test331_calloutGet9b() {
-
+
runConformTest(
new String[] {
"Team331cg9b.java",
@@ -614,7 +614,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// two getter callouts from one role
// 3.3.1-otjld-callout-get-10
public void test331_calloutGet10() {
-
+
runConformTest(
new String[] {
"Team331cg10.java",
@@ -652,7 +652,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a getter callout with wrong signature
// 3.3.1-otjld-callout-get-11
public void test331_calloutGet11() {
-
+
runConformTest(
new String[] {
"Team331cg11.java",
@@ -714,7 +714,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a getter callout to a static field uses abstract declaration and binding with signatures - witness for bogus ambiguous method message
// 3.3.2-otjld-callout-get-13
public void test332_calloutGet13() {
-
+
runConformTest(
new String[] {
"Team332cg13.java",
@@ -746,7 +746,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a getter callout to a static field uses only a binding with signatures
// 3.3.2-otjld-callout-get-13s
public void test332_calloutGet13s() {
-
+
runConformTest(
new String[] {
"Team332cg13s.java",
@@ -778,7 +778,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a getter callout to a static field uses only a binding with signatures, field is visible, but class is not
public void test332_calloutGet13sc() {
-
+
runConformTest(
new String[] {
"p2/Team332cg13sc.java",
@@ -809,7 +809,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a getter callout to a static field uses only a binding with signatures, field is visible
public void test332_calloutGet13sv() {
-
+
runConformTest(
new String[] {
"Team332cg13sv.java",
@@ -879,7 +879,7 @@ public class CalloutToField extends AbstractOTJLDTest {
"public class T332cg14 {\n" +
" String f;\n" +
"}\n"
- },
+ },
"----------\n" +
"1. ERROR in Team332cg14.java (at line 3)\n" +
" String getF() -> get void f;\n" +
@@ -887,11 +887,11 @@ public class CalloutToField extends AbstractOTJLDTest {
"Field specifier \'f\' resolves to type java.lang.String whereas type void is specified (OTJLD 3.5(a)).\n" +
"----------\n");
}
-
+
// a setter callout
// 3.3.2-otjld-callout-set-1
public void test332_calloutSet1() {
-
+
runConformTest(
new String[] {
"Team332cs1.java",
@@ -930,7 +930,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a setter callout to a static field
// 3.3.2-otjld-callout-set-2
public void test332_calloutSet2() {
-
+
runConformTest(
new String[] {
"Team332cs2.java",
@@ -969,7 +969,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a static setter callout to a static field
// 3.3.2-otjld-callout-set-2s
public void test332_calloutSet2s() {
-
+
runConformTest(
new String[] {
"Team332cs2s.java",
@@ -1008,7 +1008,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a static setter callout to a static field (shorthand)
// 3.3.2-otjld-callout-set-2s2
public void test332_calloutSet2s2() {
-
+
runConformTest(
new String[] {
"Team332cs2s2.java",
@@ -1045,7 +1045,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a setter callout to an inherited field
// 3.3.2-otjld-callout-set-3
public void test332_calloutSet3() {
-
+
runConformTest(
new String[] {
"Team332cs3.java",
@@ -1297,7 +1297,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a setter callout with parameter mappings
// 3.3.2-otjld-callout-set-7
public void test332_calloutSet7() {
-
+
runConformTest(
new String[] {
"Team332cs7.java",
@@ -1338,7 +1338,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a setter callout to a basic type field
// 3.3.2-otjld-callout-set-8
public void test332_calloutSet8() {
-
+
runConformTest(
new String[] {
"Team332cs8.java",
@@ -1377,7 +1377,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a setter callout to a base type with a role in this team
// 3.3.2-otjld-callout-set-9
public void test332_calloutSet9() {
-
+
runConformTest(
new String[] {
"Team332cs9.java",
@@ -1460,7 +1460,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a getter and a setter callout to the same field
// 3.3.12-otjld-callout-get-and-set-1
public void test3312_calloutGetAndSet1() {
-
+
runConformTest(
new String[] {
"Team3312cgs1.java",
@@ -1498,7 +1498,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a getter and a setter callout to different fields
// 3.3.12-otjld-callout-get-and-set-2
public void test3312_calloutGetAndSet2() {
-
+
runConformTest(
new String[] {
"Team3312cgs2.java",
@@ -1540,7 +1540,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a role is played by an anchored type, using callout to field
// 3.3.13-otjld-callout-to-field-of-anchored-1
public void test3313_calloutToFieldOfAnchored1() {
-
+
runConformTest(
new String[] {
"Team3313ctfoa1_2.java",
@@ -1581,7 +1581,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a role is played by an anchored type, using callout to field
// 3.3.13-otjld-callout-to-field-of-anchored-1b
public void test3313_calloutToFieldOfAnchored1b() {
-
+
runConformTest(
new String[] {
"Team3313ctfoa1b_2.java",
@@ -1619,11 +1619,11 @@ public class CalloutToField extends AbstractOTJLDTest {
"OK");
}
- // the anchor used in a callout to field is read from class file
+ // the anchor used in a callout to field is read from class file
// WITNESS for TPX-251 - fixed between 0.8.0 and 0.8.1
// 3.3.13-otjld-callout-to-field-of-anchored-2
public void test3313_calloutToFieldOfAnchored2() {
-
+
runConformTest(
new String[] {
"Team3313ctfoa2_4.java",
@@ -1686,7 +1686,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// the anchor used in a callout to field is read from class file, same as above but new role type syntax
// 3.3.13-otjld-callout-to-field-of-anchored-2s
public void test3313_calloutToFieldOfAnchored2s() {
-
+
runConformTest(
new String[] {
"Team3313ctfoa2s_4.java",
@@ -1746,11 +1746,11 @@ public class CalloutToField extends AbstractOTJLDTest {
"OK");
}
- // the type in a callout to field is an externalized role
+ // the type in a callout to field is an externalized role
// WITNESS for TPX-257
// 3.3.14-otjld-callout-to-field-type-externalized-1
public void test3314_calloutToFieldTypeExternalized1() {
-
+
runConformTest(
new String[] {
"T3314ctfte1Main.java",
@@ -1888,7 +1888,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a callout set to field returns an externalized role (base class decapsulation)
// 3.3.14-otjld-callout-to-field-type-externalized-3
public void test3314_calloutToFieldTypeExternalized3() {
-
+
runConformTest(
new String[] {
"Team3314ctfte3_2.java",
@@ -1945,7 +1945,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a callout set to field returns an externalized role
// 3.3.14-otjld-callout-to-field-type-externalized-4
public void test3314_calloutToFieldTypeExternalized4() {
-
+
runConformTest(
new String[] {
"Team3314ctfte4_2.java",
@@ -2003,7 +2003,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a callout set to field returns an externalized role, field is implicitly inherited - saw compile error in OrderSystem
// 3.3.14-otjld-callout-to-field-type-externalized-5
public void test3314_calloutToFieldTypeExternalized5() {
-
+
runConformTest(
new String[] {
"Team3314ctfte5_3.java",
@@ -2067,7 +2067,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a callout to field overrides an (implicitly) inherited callout to field
// 3.3.15-otjld-callout-to-field-overrides-1
public void test3315_calloutToFieldOverrides1() {
-
+
runConformTest(
new String[] {
"Team3315ctfo1_2.java",
@@ -2108,7 +2108,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// - same team
// 3.3.15-otjld-callout-to-field-overrides-2
public void test3315_calloutToFieldOverrides2() {
-
+
runConformTest(
new String[] {
"Team3315ctfo2.java",
@@ -2144,7 +2144,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// set - same team
// 3.3.15-otjld-callout-to-field-overrides-3
public void test3315_calloutToFieldOverrides3() {
-
+
runConformTest(
new String[] {
"Team3315ctfo3.java",
@@ -2246,7 +2246,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a callout to field is implicitly inherited
// 3.3.16-otjld-implicitly-inheriting-callout-to-field-1
public void test3316_implicitlyInheritingCalloutToField1() {
-
+
runConformTest(
new String[] {
"Team3316iictf1_2.java",
@@ -2283,7 +2283,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// several teams call out to the same field (occurred in DispositionWorkflow.java)
// 3.3.17-otjld-multiple-callout-to-same-field-1
public void test3317_multipleCalloutToSameField1() {
-
+
runConformTest(
new String[] {
"Team3317mctsf1_2.java",
@@ -2352,7 +2352,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// several teams call out to the same field (occurred in DispositionWorkflow.java)
// 3.3.17-otjld-multiple-callout-to-same-field-2
public void test3317_multipleCalloutToSameField2() {
-
+
runConformTest(
new String[] {
"Team3317mctsf2_2.java",
@@ -2425,7 +2425,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a callout to field binds to a field whose type is more specific than the declared role return type
// 3.3.18-otjld-callout-to-field-compatible-type-1
public void test3318_calloutToFieldCompatibleType1() {
-
+
runConformTest(
new String[] {
"Team3318ctfct1.java",
@@ -2458,7 +2458,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// callout set to array field
// 3.3.19-otjld-callout-to-array-field-1
public void test3319_calloutToArrayField1() {
-
+
runConformTest(
new String[] {
"Team3319ctaf1.java",
@@ -2543,7 +2543,7 @@ public class CalloutToField extends AbstractOTJLDTest {
public void test3320_inferredCalloutToField1() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"Team3320ictf1.java",
@@ -2585,7 +2585,7 @@ public class CalloutToField extends AbstractOTJLDTest {
public void test3320_inferredCalloutToField1s() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"Team3320ictf1s.java",
@@ -2627,7 +2627,7 @@ public class CalloutToField extends AbstractOTJLDTest {
public void test3320_inferredCalloutToField1s2() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"Team3320ictf1s2.java",
@@ -2669,7 +2669,7 @@ public class CalloutToField extends AbstractOTJLDTest {
public void test3320_inferredCalloutToField2() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"Team3320ictf2.java",
@@ -2712,7 +2712,7 @@ public class CalloutToField extends AbstractOTJLDTest {
public void test3320_inferredCalloutToField3() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"Team3320ictf3.java",
@@ -2756,7 +2756,7 @@ public class CalloutToField extends AbstractOTJLDTest {
public void test3320_inferredCalloutToField3b() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"Team3320ictf3b.java",
@@ -2801,7 +2801,7 @@ public class CalloutToField extends AbstractOTJLDTest {
public void test3320_inferredCalloutToField4() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"Team3320ictf4.java",
@@ -2844,7 +2844,7 @@ public class CalloutToField extends AbstractOTJLDTest {
public void test3320_inferredCalloutToField5() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"Team3320ictf5.java",
@@ -2885,7 +2885,7 @@ public class CalloutToField extends AbstractOTJLDTest {
public void test3320_inferredCalloutToField6() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"Team3320ictf6.java",
@@ -2927,7 +2927,7 @@ public class CalloutToField extends AbstractOTJLDTest {
public void test3320_inferredCalloutToField7() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"Team3320ictf7.java",
@@ -2978,7 +2978,7 @@ public class CalloutToField extends AbstractOTJLDTest {
public void test3320_inferredCalloutToField7f() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"Team3320ictf7f.java",
@@ -3025,7 +3025,7 @@ public class CalloutToField extends AbstractOTJLDTest {
public void test3320_inferredCalloutToField8() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"Team3320ictf8.java",
@@ -3135,7 +3135,7 @@ public class CalloutToField extends AbstractOTJLDTest {
public void test3320_inferredCalloutToField10() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.IGNORE);
-
+
runConformTest(
new String[] {
"Team3320ictf10.java",
@@ -3177,7 +3177,7 @@ public class CalloutToField extends AbstractOTJLDTest {
public void test3320_inferredCalloutToField11() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.IGNORE);
-
+
runConformTest(
new String[] {
"T3320ictf11.java",
@@ -3186,7 +3186,7 @@ public class CalloutToField extends AbstractOTJLDTest {
" private String val;\n" +
" T3320ictf11 (String v) { this.val = v; }\n" +
"}\n" +
- " \n"
+ " \n"
});
runConformTest(
new String[] {
@@ -3222,7 +3222,7 @@ public class CalloutToField extends AbstractOTJLDTest {
public void test3320_inferredCalloutToField12() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.IGNORE);
-
+
runConformTest(
new String[] {
"Team3320ictf12.java",
@@ -3361,7 +3361,7 @@ public class CalloutToField extends AbstractOTJLDTest {
public void test3320_inferredCalloutToField15() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"Team3320ictf15.java",
@@ -3405,7 +3405,7 @@ public class CalloutToField extends AbstractOTJLDTest {
public void test3320_inferredCalloutToField15f() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"Team3320ictf15f.java",
@@ -3447,7 +3447,7 @@ public class CalloutToField extends AbstractOTJLDTest {
public void test3320_inferredCalloutToField16() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.WARNING);
-
+
runNegativeTest(
new String[] {
"Team3320ictf16.java",
@@ -3496,7 +3496,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a callout accesses a field in a base-anchored base role (using special syntax new R<@base>()]
// 3.3.21-otjld_disabled_callout-to-field-anchored-type-1
public void test3321_calloutToFieldAnchoredType1() {
-
+
runConformTest(
new String[] {
"Team3321ctfat1_2.java",
@@ -3536,7 +3536,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// a callout accesses a field in a base-anchored base role
// 3.3.21-otjld-callout-to-field-anchored-type-2
public void test3321_calloutToFieldAnchoredType2() {
-
+
runConformTest(
new String[] {
"Team3321ctfat2_2.java",
@@ -3580,7 +3580,7 @@ public class CalloutToField extends AbstractOTJLDTest {
// looks similar to above, but base actually refers to a package
// 3.3.21-otjld-callout-to-field-anchored-type-3
public void test3321_calloutToFieldAnchoredType3() {
-
+
runConformTest(
new String[] {
"Team3321ctfat3.java",
@@ -3673,40 +3673,40 @@ public class CalloutToField extends AbstractOTJLDTest {
},
"OK0");
}
-
+
// Bug 387236 - [compiler] type mismatch in signature-less c-t-f with array type causes NPE
public void testBug387236() {
runNegativeTest(new String[] {
"b/Base.java",
- "package b;\n" +
- "\n" +
- "public class Base {\n" +
- " Object[] values;\n" +
+ "package b;\n" +
+ "\n" +
+ "public class Base {\n" +
+ " Object[] values;\n" +
"}",
"t/Team.java",
- "package t;\n" +
- "\n" +
- "import base b.Base;\n" +
- "\n" +
- "public team class Team {\n" +
- " protected abstract class AR {\n" +
- " protected abstract String[] getValues();\n" +
- " }\n" +
- " protected class CR extends AR playedBy Base {\n" +
- " @SuppressWarnings(\"decapsulation\") getValues -> get values;\n" +
- " \n" +
- " }\n" +
+ "package t;\n" +
+ "\n" +
+ "import base b.Base;\n" +
+ "\n" +
+ "public team class Team {\n" +
+ " protected abstract class AR {\n" +
+ " protected abstract String[] getValues();\n" +
+ " }\n" +
+ " protected class CR extends AR playedBy Base {\n" +
+ " @SuppressWarnings(\"decapsulation\") getValues -> get values;\n" +
+ " \n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in t\\Team.java (at line 10)\n" +
- " @SuppressWarnings(\"decapsulation\") getValues -> get values;\n" +
- " ^^^^^^^^^\n" +
- "When binding field values via callout to role method getValues():\n" +
- "Incompatible types: can\'t convert java.lang.Object[] to java.lang.String[] (OTJLD 3.5(b)).\n" +
+ "----------\n" +
+ "1. ERROR in t\\Team.java (at line 10)\n" +
+ " @SuppressWarnings(\"decapsulation\") getValues -> get values;\n" +
+ " ^^^^^^^^^\n" +
+ "When binding field values via callout to role method getValues():\n" +
+ "Incompatible types: can\'t convert java.lang.Object[] to java.lang.String[] (OTJLD 3.5(b)).\n" +
"----------\n");
}
-
+
// Bug 354480 - VerifyError due to bogus lowering in inferred callout-to-field
public void testBug354480() {
Map options = getCompilerOptions();
@@ -3714,49 +3714,49 @@ public class CalloutToField extends AbstractOTJLDTest {
runConformTest(
new String[] {
"Main.java",
- "import b.Return;\n" +
- "import b.Scope;\n" +
- "import t.Team1;\n" +
- "public class Main {\n" +
- " public static void main(String[] args) {\n" +
- " new Team1().activate();\n" +
- " new Return().analyse(new Scope());\n" +
- " }\n" +
+ "import b.Return;\n" +
+ "import b.Scope;\n" +
+ "import t.Team1;\n" +
+ "public class Main {\n" +
+ " public static void main(String[] args) {\n" +
+ " new Team1().activate();\n" +
+ " new Return().analyse(new Scope());\n" +
+ " }\n" +
"}\n",
"b/Expr.java",
"package b;\n" +
- "public class Expr {\n" +
+ "public class Expr {\n" +
" public void analyse(Scope scope) {\n" +
" System.out.print(\"OK\");\n" +
- " }\n" +
+ " }\n" +
"}\n",
"b/Scope.java",
"package b;\n" +
"public class Scope {}\n",
"b/Return.java",
"package b;\n" +
- "public class Return {\n" +
- " public Expr expr = new Expr();\n" +
- " public void analyse(Scope scope) {\n" +
- " }\n" +
+ "public class Return {\n" +
+ " public Expr expr = new Expr();\n" +
+ " public void analyse(Scope scope) {\n" +
+ " }\n" +
"}\n",
"t/Team1.java",
"package t;\n" +
- "import b.Expr;\n" +
- "import base b.Return;\n" +
- "import base b.Scope;\n" +
- "\n" +
- "public team class Team1 {\n" +
- " protected class Scope playedBy Scope {}\n" +
- " protected class Return playedBy Return {\n" +
- " Expr getExpr() -> get Expr expr;\n" +
- " void analyse(Scope scope) <- replace void analyse(Scope scope);\n" +
- " @SuppressWarnings({\"inferredcallout\", \"basecall\"})\n" +
- " callin void analyse(Scope scope) {\n" +
+ "import b.Expr;\n" +
+ "import base b.Return;\n" +
+ "import base b.Scope;\n" +
+ "\n" +
+ "public team class Team1 {\n" +
+ " protected class Scope playedBy Scope {}\n" +
+ " protected class Return playedBy Return {\n" +
+ " Expr getExpr() -> get Expr expr;\n" +
+ " void analyse(Scope scope) <- replace void analyse(Scope scope);\n" +
+ " @SuppressWarnings({\"inferredcallout\", \"basecall\"})\n" +
+ " callin void analyse(Scope scope) {\n" +
" this.expr.analyse(scope);\n" + // expr via c-t-f, scope needs lowering
- " }\n" +
- " }\n" +
- "}\n"
+ " }\n" +
+ " }\n" +
+ "}\n"
},
"OK",
null/*classLibraries*/,
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/OverridingAccessRestrictions.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/OverridingAccessRestrictions.java
index c46ba3da5..9e49d698a 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/OverridingAccessRestrictions.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/OverridingAccessRestrictions.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2016 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -29,11 +29,11 @@ import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
@SuppressWarnings("unchecked")
public class OverridingAccessRestrictions extends AbstractOTJLDTest {
-
+
public OverridingAccessRestrictions(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -41,7 +41,7 @@ public class OverridingAccessRestrictions extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -53,7 +53,7 @@ public class OverridingAccessRestrictions extends AbstractOTJLDTest {
// a callout binding access a hidden base method
// 7.4.1-otjld-callout-access-to-hidden-method-1
public void test741_calloutAccessToHiddenMethod1() {
-
+
runConformTest(
new String[] {
"T741cathm1Main.java",
@@ -105,7 +105,7 @@ public class OverridingAccessRestrictions extends AbstractOTJLDTest {
// 7.4.1-otjld-callout-access-to-hidden-method-2
public void test741_calloutAccessToHiddenMethod2() {
Map customOptions = getCompilerOptions();
-
+
runConformTest(
new String[] {
"T741cathm2Main.java",
@@ -193,7 +193,7 @@ public class OverridingAccessRestrictions extends AbstractOTJLDTest {
// 7.4.1-otjld-callout-access-to-hidden-method-3
public void test741_calloutAccessToHiddenMethod3() {
Map customOptions = getCompilerOptions();
-
+
runConformTest(
new String[] {
"T741cathm3Main.java",
@@ -241,7 +241,7 @@ public class OverridingAccessRestrictions extends AbstractOTJLDTest {
// a callout binding access a hidden static base method
// 7.4.1-otjld-callout-access-to-hidden-method-4
public void test741_calloutAccessToHiddenMethod4() {
-
+
runConformTest(
new String[] {
"T741cathm4Main.java",
@@ -324,7 +324,7 @@ public class OverridingAccessRestrictions extends AbstractOTJLDTest {
// 7.4.2-otjld-callout-access-to-hidden-method-1
public void test742_calloutAccessToHiddenMethod1() {
Map customOptions = getCompilerOptions();
-
+
runConformTest(
new String[] {
"p1/T742cathm1_1.java",
@@ -365,7 +365,7 @@ public class OverridingAccessRestrictions extends AbstractOTJLDTest {
// 7.4.2-otjld-callout-access-to-hidden-method-2
public void test742_calloutAccessToHiddenMethod2() {
Map customOptions = getCompilerOptions();
-
+
runConformTest(
new String[] {
"p1/T742cathm2_1.java",
@@ -405,7 +405,7 @@ public class OverridingAccessRestrictions extends AbstractOTJLDTest {
// a callout binding accesses a private method of a base class that is a role itself
// 7.4.2-otjld-callout-access-to-hidden-method-3
public void test742_calloutAccessToHiddenMethod3() {
-
+
runConformTest(
new String[] {
"Team742cathm3_2.java",
@@ -441,7 +441,7 @@ public class OverridingAccessRestrictions extends AbstractOTJLDTest {
// a callout binding accesses a private method of a base class that is a role itself -- externalized creation uses new syntax
// 7.4.2-otjld-callout-access-to-hidden-method-3f
public void test742_calloutAccessToHiddenMethod3f() {
-
+
runConformTest(
new String[] {
"Team742cathm3f_2.java",
@@ -477,7 +477,7 @@ public class OverridingAccessRestrictions extends AbstractOTJLDTest {
// a callout accesses a protected member which its base inherits, sub-base overrides
// 7.4.2-otjld-callout-access-to-hidden-method-4
public void test742_calloutAccessToHiddenMethod4() {
-
+
runConformTest(
new String[] {
"Team742cathm4.java",
@@ -529,7 +529,7 @@ public class OverridingAccessRestrictions extends AbstractOTJLDTest {
// a callout accesses a private method in its direct base - sub base re-declares
// 7.4.2-otjld-callout-access-to-hidden-method-5
public void test742_calloutAccessToHiddenMethod5() {
-
+
runConformTest(
new String[] {
"Team742cathm5.java",
@@ -575,7 +575,7 @@ public class OverridingAccessRestrictions extends AbstractOTJLDTest {
// a callout accesses a private method in its direct base - sub base re-declares
// 7.4.2-otjld-callout-access-to-hidden-method-6
public void test742_calloutAccessToHiddenMethod6() {
-
+
runConformTest(
new String[] {
"Team742cathm6.java",
@@ -618,7 +618,7 @@ public class OverridingAccessRestrictions extends AbstractOTJLDTest {
// a callin binding access a hidden base method
// 7.4.3-otjld-callin-access-to-hidden-method-1
public void test743_callinAccessToHiddenMethod1() {
-
+
runConformTest(
new String[] {
"T743cathm1Main.java",
@@ -677,7 +677,7 @@ public class OverridingAccessRestrictions extends AbstractOTJLDTest {
// a callin binding access a hidden base method
// 7.4.3-otjld-callin-access-to-hidden-method-2
public void test743_callinAccessToHiddenMethod2() {
-
+
runConformTest(
new String[] {
"T743cathm2Main.java",
@@ -732,7 +732,7 @@ public class OverridingAccessRestrictions extends AbstractOTJLDTest {
// a callin binding access a hidden base method
// 7.4.3-otjld-callin-access-to-hidden-method-3
public void test743_callinAccessToHiddenMethod3() {
-
+
runConformTest(
new String[] {
"T743cathm3Main.java",
@@ -811,7 +811,7 @@ public class OverridingAccessRestrictions extends AbstractOTJLDTest {
// a callin binding access a hidden method in a indirect base class
// 7.4.4-otjld-callin-access-to-hidden-method-1
public void test744_callinAccessToHiddenMethod1() {
-
+
runConformTest(
new String[] {
"p1/T744cathm1_1.java",
@@ -844,7 +844,7 @@ public class OverridingAccessRestrictions extends AbstractOTJLDTest {
// a callin binding access a hidden method in a indirect base class
// 7.4.4-otjld-callin-access-to-hidden-method-2
public void test744_callinAccessToHiddenMethod2() {
-
+
runConformTest(
new String[] {
"p1/T744cathm2_1.java",
@@ -975,7 +975,7 @@ public class OverridingAccessRestrictions extends AbstractOTJLDTest {
// a playedBy declaration overrides access restrictions
// 7.4.6-otjld-baseclass-is-invisible-1
public void test746_baseclassIsInvisible1() {
-
+
runConformTest(
new String[] {
"p1/T746biv1Main.java",
@@ -1020,7 +1020,7 @@ public class OverridingAccessRestrictions extends AbstractOTJLDTest {
// a playedBy declaration overrides access restrictions -- warnings suppressed
// 7.4.6-otjld-baseclass-is-invisible-2
public void test746_baseclassIsInvisible2() {
-
+
runConformTest(
new String[] {
"p1/T746biv2Main.java",
@@ -1066,7 +1066,7 @@ public class OverridingAccessRestrictions extends AbstractOTJLDTest {
// 7.4.6-otjld-baseclass-is-invisible-3
public void test746_baseclassIsInvisible3() {
Map customOptions = getCompilerOptions();
-
+
runConformTest(
new String[] {
"p1/T746biv3Main.java",
@@ -1139,7 +1139,7 @@ public class OverridingAccessRestrictions extends AbstractOTJLDTest {
// using a base constructor
// 7.4.6-otjld-baseclass-is-invisible-5
public void test746_baseclassIsInvisible5() {
-
+
runConformTest(
new String[] {
"p2/Team746biv5.java",
@@ -1182,7 +1182,7 @@ public class OverridingAccessRestrictions extends AbstractOTJLDTest {
// 7.4.6-otjld-baseclass-is-invisible-6
public void test746_baseclassIsInvisible6() {
Map customOptions = getCompilerOptions();
-
+
runConformTest(
new String[] {
"p1/T746biv6Main.java",
@@ -1240,7 +1240,7 @@ public class OverridingAccessRestrictions extends AbstractOTJLDTest {
// a playedBy declaration overrides access restrictions, used in the signature of a callin-bound base method
// 7.4.6-otjld-baseclass-is-invisible-7
public void test746_baseclassIsInvisible7() {
-
+
runConformTest(
new String[] {
"p2/Team746biv7.java",
@@ -1315,11 +1315,11 @@ public class OverridingAccessRestrictions extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team746bii8.java (at line 3)\n" +
- " public class R playedBy T746bii8 {\n" +
- " ^^^^^^^^\n" +
- "PlayedBy binding overrides finalness of base class T746bii8 (OTJLD 2.1.2(c)).\n" +
+ "----------\n" +
+ "1. ERROR in Team746bii8.java (at line 3)\n" +
+ " public class R playedBy T746bii8 {\n" +
+ " ^^^^^^^^\n" +
+ "PlayedBy binding overrides finalness of base class T746bii8 (OTJLD 2.1.2(c)).\n" +
"----------\n",
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
@@ -1329,7 +1329,7 @@ public class OverridingAccessRestrictions extends AbstractOTJLDTest {
// a base imported base class is invisible, suppressing at the role suffices
// 7.4.6-otjld-baseclass-is-invisible-9
public void test746_baseclassIsInvisible9() {
-
+
runConformTest(
new String[] {
"Team746bii9.java",
@@ -1425,7 +1425,7 @@ public class OverridingAccessRestrictions extends AbstractOTJLDTest {
// despite decapsulation a private feature of a super class is not accessible (see TPX-442)
// 7.4.7-otjld-private-feature-is-not-inherited-3
public void test747_privateFeatureIsNotInherited3() {
-
+
runConformTest(
new String[] {
"Team747pfini3.java",
@@ -1510,7 +1510,7 @@ public class OverridingAccessRestrictions extends AbstractOTJLDTest {
// a callout to field causes decapsulation: watch for the effect
// 7.4.8-otjld-field-decapsulation-2
public void test748_fieldDecapsulation2() {
-
+
runConformTest(
new String[] {
"Team748fd2.java",
@@ -1542,7 +1542,7 @@ public class OverridingAccessRestrictions extends AbstractOTJLDTest {
// a callout to field causes decapsulation, multiple declarations in the inheritance hierarchy - see Trac #232
// 7.4.8-otjld-field-decapsulation-3
public void test748_fieldDecapsulation3() {
-
+
runConformTest(
new String[] {
"Team748fd3.java",
@@ -1711,11 +1711,11 @@ public class OverridingAccessRestrictions extends AbstractOTJLDTest {
" void mb(boolean b) {\n" +
" System.out.print(b);\n" +
" }\n" +
- "}\n"
+ "}\n"
},
"42true");
}
-
+
// c-t-f to field of protected static inner
public void testBug461434() throws Exception {
runConformTest(
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/AllSmartLiftingTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/AllSmartLiftingTests.java
index 69d4bd0ce..aadb3d0b8 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/AllSmartLiftingTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/AllSmartLiftingTests.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010, 2014 Stephan Herrmann
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/DeclaredLifting.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/DeclaredLifting.java
index 8073d2919..7dfdc97be 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/DeclaredLifting.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/DeclaredLifting.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -29,11 +29,11 @@ import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
@SuppressWarnings("unchecked")
public class DeclaredLifting extends AbstractOTJLDTest {
-
+
public DeclaredLifting(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -42,7 +42,7 @@ public class DeclaredLifting extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -54,7 +54,7 @@ public class DeclaredLifting extends AbstractOTJLDTest {
// access to a feature of a role object that has been created using declared lifting
// 6.1.1-otjld-lifted-role-feature-access-1
public void test611_liftedRoleFeatureAccess1() {
-
+
runConformTest(
new String[] {
"T611lrfa1Main.java",
@@ -129,7 +129,7 @@ public class DeclaredLifting extends AbstractOTJLDTest {
// access to a feature of a role object that has been created using declared lifting
// 6.1.1-otjld-lifted-role-feature-access-3
public void test611_liftedRoleFeatureAccess3() {
-
+
runConformTest(
new String[] {
"T611lrfa3Main.java",
@@ -176,7 +176,7 @@ public class DeclaredLifting extends AbstractOTJLDTest {
public void test611_liftedRoleFeatureAccess4() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInvalidJavadoc, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"T611lrfa4Main.java",
@@ -285,7 +285,7 @@ public class DeclaredLifting extends AbstractOTJLDTest {
// a team implements a method of an interface using declared lifting for the parameter
// 6.1.3-otjld-interface-implementation-with-declared-lifting
public void test613_interfaceImplementationWithDeclaredLifting() {
-
+
runConformTest(
new String[] {
"T613iiwdlMain.java",
@@ -684,7 +684,7 @@ public class DeclaredLifting extends AbstractOTJLDTest {
// a nested team has a method with declared lifting
// 6.1.7-otjld-declared-lifting-in-nested-team-1
public void test617_declaredLiftingInNestedTeam1() {
-
+
runConformTest(
new String[] {
"Team617dlint1.java",
@@ -727,7 +727,7 @@ public class DeclaredLifting extends AbstractOTJLDTest {
// a nested team has a method with declared lifting -- base type anchored to "base"
// 6.1.7-otjld-declared-lifting-in-nested-team-2
public void test617_declaredLiftingInNestedTeam2() {
-
+
runConformTest(
new String[] {
"Team617dlint2_2.java",
@@ -777,7 +777,7 @@ public class DeclaredLifting extends AbstractOTJLDTest {
// A catch clause uses declared lifting
// 6.1.8-otjld-exception-lifting-1
public void test618_exceptionLifting1() {
-
+
runConformTest(
new String[] {
"Team618el1.java",
@@ -828,7 +828,7 @@ public class DeclaredLifting extends AbstractOTJLDTest {
// A catch clause uses declared lifting, rethrowing
// 6.1.8-otjld-exception-lifting-2
public void test618_exceptionLifting2() {
-
+
runConformTest(
new String[] {
"Team618el2.java",
@@ -886,7 +886,7 @@ public class DeclaredLifting extends AbstractOTJLDTest {
// A catch clause within a role uses declared lifting
// 6.1.8-otjld-exception-lifting-3
public void test618_exceptionLifting3() {
-
+
runConformTest(
new String[] {
"Team618el3.java",
@@ -962,7 +962,7 @@ public class DeclaredLifting extends AbstractOTJLDTest {
// a team ctor used both declared lifting and a role anchored to another argument
// 6.1.9-otjld-declared-lifting-and-externalized-role-1
public void test619_declaredLiftingAndExternalizedRole1() {
-
+
runConformTest(
new String[] {
"Team619dlaer1_2.java",
@@ -1011,7 +1011,7 @@ public class DeclaredLifting extends AbstractOTJLDTest {
// bogus source positions if these coincide: role file, declared lifting, method requires bridge for visibility
// 6.1.10-otjld-declared-lifting-in-nested-1
public void test6110_declaredLiftingInNested1() {
-
+
runConformTest(
new String[] {
"Team6110dlin1.java",
@@ -1056,7 +1056,7 @@ public class DeclaredLifting extends AbstractOTJLDTest {
},
"OK");
}
-
+
// Lifting to an unbound super role
// Bug 339801 - [compiler] declared lifting cannot resolve base imported base type
public void test6111_declaredLiftingToSuper1() {
@@ -1194,16 +1194,16 @@ public class DeclaredLifting extends AbstractOTJLDTest {
"T6112dlic3.java",
"public class T6112dlic3 {}\n",
"Team6112dlic3_0.java",
- "public team class Team6112dlic3_0 {\n" +
- " R[] f;\n" +
- " Team6112dlic3_0(R[] roles){ this.f = roles; }\n" +
- " protected class R {}\n" +
+ "public team class Team6112dlic3_0 {\n" +
+ " R[] f;\n" +
+ " Team6112dlic3_0(R[] roles){ this.f = roles; }\n" +
+ " protected class R {}\n" +
"}\n",
"Team6112dlic3_1.java",
- "public team class Team6112dlic3_1 extends Team6112dlic3_0 {\n" +
- " Team6112dlic3_1(T6112dlic3[] as R[] roles) { super(roles); }\n" +
+ "public team class Team6112dlic3_1 extends Team6112dlic3_0 {\n" +
+ " Team6112dlic3_1(T6112dlic3[] as R[] roles) { super(roles); }\n" +
" @Override\n" +
- " protected class R playedBy T6112dlic3 {}\n" +
+ " protected class R playedBy T6112dlic3 {}\n" +
"}\n"
});
}
@@ -1214,8 +1214,8 @@ public class DeclaredLifting extends AbstractOTJLDTest {
runConformTest(
new String[] {
"Team6112dlic4_1.java",
- "public team class Team6112dlic4_1 extends Team6112dlic4_0 {\n" +
- " Team6112dlic4_1(T6112dlic4[] as R[] roles) { super(roles); }\n" +
+ "public team class Team6112dlic4_1 extends Team6112dlic4_0 {\n" +
+ " Team6112dlic4_1(T6112dlic4[] as R[] roles) { super(roles); }\n" +
" @Override\n" +
" protected class R playedBy T6112dlic4 {\n" +
" test -> OK;\n" +
@@ -1223,21 +1223,21 @@ public class DeclaredLifting extends AbstractOTJLDTest {
" public static void main(String[] args) {\n" +
" T6112dlic4 b = new T6112dlic4();\n" +
" new Team6112dlic4_1(new T6112dlic4[]{b});\n" +
- " }\n" +
+ " }\n" +
"}\n",
"T6112dlic4.java",
"public class T6112dlic4 {\n" +
" void OK() { System.out.print(\"OK\"); }\n" +
"}\n",
"Team6112dlic4_0.java",
- "public abstract team class Team6112dlic4_0 {\n" +
- " R[] f;\n" +
- " Team6112dlic4_0(){ System.out.print(\"wrong\"); }\n" +
+ "public abstract team class Team6112dlic4_0 {\n" +
+ " R[] f;\n" +
+ " Team6112dlic4_0(){ System.out.print(\"wrong\"); }\n" +
" Team6112dlic4_0(R[] roles){\n" +
" this.f = roles;\n" +
" this.f[0].test();" +
- " }\n" +
- " protected abstract class R { protected abstract void test(); }\n" +
+ " }\n" +
+ " protected abstract class R { protected abstract void test(); }\n" +
"}\n",
},
"OK");
@@ -1249,31 +1249,31 @@ public class DeclaredLifting extends AbstractOTJLDTest {
runConformTest(
new String[] {
"Team6112dlic5_1.java",
- "public team class Team6112dlic5_1 extends Team6112dlic5_0 {\n" +
+ "public team class Team6112dlic5_1 extends Team6112dlic5_0 {\n" +
" Team6112dlic5_1() { super(new R[0]); }\n" +
" public void test() {\n" +
" new R().test(this.f.length);\n" +
- " }\n" +
+ " }\n" +
" @Override\n" +
" protected class R playedBy T6112dlic5 {\n" +
" protected R() { base(); }\n" +
" test -> OK;\n" +
- " }\n" +
+ " }\n" +
" public static void main(String[] args) {\n" +
" new Team6112dlic5_1().test();\n" +
- " }\n" +
+ " }\n" +
"}\n",
"T6112dlic5.java",
"public class T6112dlic5 {\n" +
" void OK(int x) { System.out.print(\"OK\"+x); }\n" +
"}\n",
"Team6112dlic5_0.java",
- "public abstract team class Team6112dlic5_0 {\n" +
- " R[] f;\n" +
+ "public abstract team class Team6112dlic5_0 {\n" +
+ " R[] f;\n" +
" Team6112dlic5_0(R[] roles){\n" +
" this.f = roles;\n" +
" }\n" +
- " protected abstract class R { protected abstract void test(int l); }\n" +
+ " protected abstract class R { protected abstract void test(int l); }\n" +
"}\n",
},
"OK0");
@@ -1284,37 +1284,37 @@ public class DeclaredLifting extends AbstractOTJLDTest {
runConformTest(
new String[] {
"Team6112dlic6_2.java",
- "public team class Team6112dlic6_2 extends Team6112dlic6_1 {\n" +
+ "public team class Team6112dlic6_2 extends Team6112dlic6_1 {\n" +
" Team6112dlic6_2(T6112dlic6 as R r) { super(r); }\n" +
" @Override\n" +
" protected class R playedBy T6112dlic6 {\n" +
" test -> OK;\n" +
- " }\n" +
+ " }\n" +
" public static void main(String[] args) {\n" +
" new Team6112dlic6_2(new T6112dlic6()).test();\n" +
- " }\n" +
+ " }\n" +
"}\n",
"Team6112dlic6_1.java",
"public team class Team6112dlic6_1 extends Team6112dlic6_0 {\n" +
- " R r;" +
+ " R r;" +
" protected Team6112dlic6_1(R r) { this.r = r; }\n" +
" public void test() {\n" +
" this.r.test(2);\n" +
- " }\n" +
+ " }\n" +
"}\n",
"T6112dlic6.java",
"public class T6112dlic6 {\n" +
" void OK(int x) { System.out.print(\"OK\"+x); }\n" +
"}\n",
"Team6112dlic6_0.java",
- "public abstract team class Team6112dlic6_0 {\n" +
+ "public abstract team class Team6112dlic6_0 {\n" +
" Team6112dlic6_0(){}\n" +
- " protected abstract class R { protected abstract void test(int l); }\n" +
+ " protected abstract class R { protected abstract void test(int l); }\n" +
"}\n",
},
"OK2");
}
-
+
public void test6113_declaredLiftingOfExternalizedRole1() {
runConformTest(new String[] {
"Team6113dloer1_2.java",
@@ -1400,7 +1400,7 @@ public class DeclaredLifting extends AbstractOTJLDTest {
"@Target(ElementType.TYPE_USE) public @interface NonNullR {}\n"
},
"OK");
-
+
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting1.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting1.java
index d7891f7a3..7f5aece96 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting1.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting1.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -22,11 +22,11 @@ package org.eclipse.objectteams.otdt.tests.otjld.liftlower;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class SmartLifting1 extends AbstractOTJLDTest {
-
+
public SmartLifting1(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -42,7 +42,7 @@ public class SmartLifting1 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.1-otjld-smart-lifting-1
public void test641_smartLifting1() {
-
+
runConformTest(
new String[] {
"T641sl1Main.java",
@@ -190,7 +190,7 @@ public class SmartLifting1 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.1-otjld-smart-lifting-2
public void test641_smartLifting2() {
-
+
runConformTest(
new String[] {
"T641sl2Main.java",
@@ -338,7 +338,7 @@ public class SmartLifting1 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.1-otjld-smart-lifting-3
public void test641_smartLifting3() {
-
+
runConformTest(
new String[] {
"T641sl3Main.java",
@@ -486,7 +486,7 @@ public class SmartLifting1 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.1-otjld-smart-lifting-4
public void test641_smartLifting4() {
-
+
runConformTest(
new String[] {
"T641sl4Main.java",
@@ -634,7 +634,7 @@ public class SmartLifting1 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.1-otjld-smart-lifting-5
public void test641_smartLifting5() {
-
+
runConformTest(
new String[] {
"T641sl5Main.java",
@@ -782,7 +782,7 @@ public class SmartLifting1 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.1-otjld-smart-lifting-6
public void test641_smartLifting6() {
-
+
runConformTest(
new String[] {
"T641sl6Main.java",
@@ -930,7 +930,7 @@ public class SmartLifting1 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.1-otjld-smart-lifting-7
public void test641_smartLifting7() {
-
+
runConformTest(
new String[] {
"T641sl7Main.java",
@@ -1078,7 +1078,7 @@ public class SmartLifting1 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.1-otjld-smart-lifting-8
public void test641_smartLifting8() {
-
+
runConformTest(
new String[] {
"T641sl8Main.java",
@@ -1226,7 +1226,7 @@ public class SmartLifting1 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.1-otjld-smart-lifting-9
public void test641_smartLifting9() {
-
+
runConformTest(
new String[] {
"T641sl9Main.java",
@@ -1374,7 +1374,7 @@ public class SmartLifting1 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.1-otjld-smart-lifting-10
public void test641_smartLifting10() {
-
+
runConformTest(
new String[] {
"T641sl10Main.java",
@@ -1522,7 +1522,7 @@ public class SmartLifting1 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.1-otjld-smart-lifting-11
public void test641_smartLifting11() {
-
+
runConformTest(
new String[] {
"T641sl11Main.java",
@@ -1670,7 +1670,7 @@ public class SmartLifting1 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.1-otjld-smart-lifting-12
public void test641_smartLifting12() {
-
+
runConformTest(
new String[] {
"T641sl12Main.java",
@@ -1818,7 +1818,7 @@ public class SmartLifting1 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.1-otjld-smart-lifting-13
public void test641_smartLifting13() {
-
+
runConformTest(
new String[] {
"T641sl13Main.java",
@@ -1966,7 +1966,7 @@ public class SmartLifting1 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.1-otjld-smart-lifting-14
public void test641_smartLifting14() {
-
+
runConformTest(
new String[] {
"T641sl14Main.java",
@@ -2114,7 +2114,7 @@ public class SmartLifting1 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.1-otjld-smart-lifting-15
public void test641_smartLifting15() {
-
+
runConformTest(
new String[] {
"T641sl15Main.java",
@@ -2262,7 +2262,7 @@ public class SmartLifting1 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.1-otjld-smart-lifting-16
public void test641_smartLifting16() {
-
+
runConformTest(
new String[] {
"T641sl16Main.java",
@@ -2410,7 +2410,7 @@ public class SmartLifting1 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.1-otjld-smart-lifting-17
public void test641_smartLifting17() {
-
+
runConformTest(
new String[] {
"T641sl17Main.java",
@@ -2558,7 +2558,7 @@ public class SmartLifting1 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.1-otjld-smart-lifting-18
public void test641_smartLifting18() {
-
+
runConformTest(
new String[] {
"T641sl18Main.java",
@@ -2706,7 +2706,7 @@ public class SmartLifting1 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.1-otjld-smart-lifting-19
public void test641_smartLifting19() {
-
+
runConformTest(
new String[] {
"T641sl19Main.java",
@@ -2854,7 +2854,7 @@ public class SmartLifting1 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.1-otjld-smart-lifting-20
public void test641_smartLifting20() {
-
+
runConformTest(
new String[] {
"T641sl20Main.java",
@@ -3002,7 +3002,7 @@ public class SmartLifting1 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.1-otjld-smart-lifting-21
public void test641_smartLifting21() {
-
+
runConformTest(
new String[] {
"T641sl21Main.java",
@@ -3151,7 +3151,7 @@ public class SmartLifting1 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.1-otjld-smart-lifting-22
public void test641_smartLifting22() {
-
+
runConformTest(
new String[] {
"T641sl22Main.java",
@@ -3300,7 +3300,7 @@ public class SmartLifting1 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.1-otjld-smart-lifting-23
public void test641_smartLifting23() {
-
+
runConformTest(
new String[] {
"T641sl23Main.java",
@@ -3449,7 +3449,7 @@ public class SmartLifting1 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.1-otjld-smart-lifting-24
public void test641_smartLifting24() {
-
+
runConformTest(
new String[] {
"T641sl24Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting10.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting10.java
index 9bbce6c2f..ced0a2833 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting10.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting10.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -22,11 +22,11 @@ package org.eclipse.objectteams.otdt.tests.otjld.liftlower;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class SmartLifting10 extends AbstractOTJLDTest {
-
+
public SmartLifting10(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -42,7 +42,7 @@ public class SmartLifting10 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.10-otjld-smart-lifting-1
public void test6410_smartLifting1() {
-
+
runConformTest(
new String[] {
"T6410sl1Main.java",
@@ -190,7 +190,7 @@ public class SmartLifting10 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.10-otjld-smart-lifting-2
public void test6410_smartLifting2() {
-
+
runConformTest(
new String[] {
"T6410sl2Main.java",
@@ -338,7 +338,7 @@ public class SmartLifting10 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.10-otjld-smart-lifting-3
public void test6410_smartLifting3() {
-
+
runConformTest(
new String[] {
"T6410sl3Main.java",
@@ -486,7 +486,7 @@ public class SmartLifting10 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.10-otjld-smart-lifting-4
public void test6410_smartLifting4() {
-
+
runConformTest(
new String[] {
"T6410sl4Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting11.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting11.java
index 05c4ede46..595ec5a11 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting11.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting11.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -22,11 +22,11 @@ package org.eclipse.objectteams.otdt.tests.otjld.liftlower;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class SmartLifting11 extends AbstractOTJLDTest {
-
+
public SmartLifting11(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -42,7 +42,7 @@ public class SmartLifting11 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.11-otjld-smart-lifting-1
public void test6411_smartLifting1() {
-
+
runConformTest(
new String[] {
"T6411sl1Main.java",
@@ -190,7 +190,7 @@ public class SmartLifting11 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.11-otjld-smart-lifting-2
public void test6411_smartLifting2() {
-
+
runConformTest(
new String[] {
"T6411sl2Main.java",
@@ -338,7 +338,7 @@ public class SmartLifting11 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.11-otjld-smart-lifting-3
public void test6411_smartLifting3() {
-
+
runConformTest(
new String[] {
"T6411sl3Main.java",
@@ -486,7 +486,7 @@ public class SmartLifting11 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.11-otjld-smart-lifting-4
public void test6411_smartLifting4() {
-
+
runConformTest(
new String[] {
"T6411sl4Main.java",
@@ -634,7 +634,7 @@ public class SmartLifting11 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.11-otjld-smart-lifting-5
public void test6411_smartLifting5() {
-
+
runConformTest(
new String[] {
"T6411sl5Main.java",
@@ -782,7 +782,7 @@ public class SmartLifting11 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.11-otjld-smart-lifting-6
public void test6411_smartLifting6() {
-
+
runConformTest(
new String[] {
"T6411sl6Main.java",
@@ -930,7 +930,7 @@ public class SmartLifting11 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.11-otjld-smart-lifting-7
public void test6411_smartLifting7() {
-
+
runConformTest(
new String[] {
"T6411sl7Main.java",
@@ -1078,7 +1078,7 @@ public class SmartLifting11 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.11-otjld-smart-lifting-8
public void test6411_smartLifting8() {
-
+
runConformTest(
new String[] {
"T6411sl8Main.java",
@@ -1226,7 +1226,7 @@ public class SmartLifting11 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.11-otjld-smart-lifting-9
public void test6411_smartLifting9() {
-
+
runConformTest(
new String[] {
"T6411sl9Main.java",
@@ -1375,7 +1375,7 @@ public class SmartLifting11 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.11-otjld-smart-lifting-10
public void test6411_smartLifting10() {
-
+
runConformTest(
new String[] {
"T6411sl10Main.java",
@@ -1524,7 +1524,7 @@ public class SmartLifting11 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.11-otjld-smart-lifting-11
public void test6411_smartLifting11() {
-
+
runConformTest(
new String[] {
"T6411sl11Main.java",
@@ -1673,7 +1673,7 @@ public class SmartLifting11 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.11-otjld-smart-lifting-12
public void test6411_smartLifting12() {
-
+
runConformTest(
new String[] {
"T6411sl12Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting12.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting12.java
index 9897ed327..271e03d94 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting12.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting12.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -22,11 +22,11 @@ package org.eclipse.objectteams.otdt.tests.otjld.liftlower;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class SmartLifting12 extends AbstractOTJLDTest {
-
+
public SmartLifting12(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -42,7 +42,7 @@ public class SmartLifting12 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.12-otjld-smart-lifting-1
public void test6412_smartLifting1() {
-
+
runConformTest(
new String[] {
"T6412sl1Main.java",
@@ -190,7 +190,7 @@ public class SmartLifting12 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.12-otjld-smart-lifting-2
public void test6412_smartLifting2() {
-
+
runConformTest(
new String[] {
"T6412sl2Main.java",
@@ -338,7 +338,7 @@ public class SmartLifting12 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.12-otjld-smart-lifting-3
public void test6412_smartLifting3() {
-
+
runConformTest(
new String[] {
"T6412sl3Main.java",
@@ -486,7 +486,7 @@ public class SmartLifting12 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.12-otjld-smart-lifting-4
public void test6412_smartLifting4() {
-
+
runConformTest(
new String[] {
"T6412sl4Main.java",
@@ -634,7 +634,7 @@ public class SmartLifting12 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.12-otjld-smart-lifting-5
public void test6412_smartLifting5() {
-
+
runConformTest(
new String[] {
"T6412sl5Main.java",
@@ -783,7 +783,7 @@ public class SmartLifting12 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.12-otjld-smart-lifting-6
public void test6412_smartLifting6() {
-
+
runConformTest(
new String[] {
"T6412sl6Main.java",
@@ -932,7 +932,7 @@ public class SmartLifting12 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.12-otjld-smart-lifting-7
public void test6412_smartLifting7() {
-
+
runConformTest(
new String[] {
"T6412sl7Main.java",
@@ -1081,7 +1081,7 @@ public class SmartLifting12 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.12-otjld-smart-lifting-8
public void test6412_smartLifting8() {
-
+
runConformTest(
new String[] {
"T6412sl8Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting13.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting13.java
index d80645379..47a22e119 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting13.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting13.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -22,11 +22,11 @@ package org.eclipse.objectteams.otdt.tests.otjld.liftlower;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class SmartLifting13 extends AbstractOTJLDTest {
-
+
public SmartLifting13(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -42,7 +42,7 @@ public class SmartLifting13 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.13-otjld-smart-lifting-1
public void test6413_smartLifting1() {
-
+
runConformTest(
new String[] {
"T6413sl1Main.java",
@@ -190,7 +190,7 @@ public class SmartLifting13 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.13-otjld-smart-lifting-2
public void test6413_smartLifting2() {
-
+
runConformTest(
new String[] {
"T6413sl2Main.java",
@@ -338,7 +338,7 @@ public class SmartLifting13 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.13-otjld-smart-lifting-3
public void test6413_smartLifting3() {
-
+
runConformTest(
new String[] {
"T6413sl3Main.java",
@@ -486,7 +486,7 @@ public class SmartLifting13 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.13-otjld-smart-lifting-4
public void test6413_smartLifting4() {
-
+
runConformTest(
new String[] {
"T6413sl4Main.java",
@@ -634,7 +634,7 @@ public class SmartLifting13 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.13-otjld-smart-lifting-5
public void test6413_smartLifting5() {
-
+
runConformTest(
new String[] {
"T6413sl5Main.java",
@@ -782,7 +782,7 @@ public class SmartLifting13 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.13-otjld-smart-lifting-6
public void test6413_smartLifting6() {
-
+
runConformTest(
new String[] {
"T6413sl6Main.java",
@@ -930,7 +930,7 @@ public class SmartLifting13 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.13-otjld-smart-lifting-7
public void test6413_smartLifting7() {
-
+
runConformTest(
new String[] {
"T6413sl7Main.java",
@@ -1078,7 +1078,7 @@ public class SmartLifting13 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.13-otjld-smart-lifting-8
public void test6413_smartLifting8() {
-
+
runConformTest(
new String[] {
"T6413sl8Main.java",
@@ -1226,7 +1226,7 @@ public class SmartLifting13 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.13-otjld-smart-lifting-9
public void test6413_smartLifting9() {
-
+
runConformTest(
new String[] {
"T6413sl9Main.java",
@@ -1374,7 +1374,7 @@ public class SmartLifting13 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.13-otjld-smart-lifting-10
public void test6413_smartLifting10() {
-
+
runConformTest(
new String[] {
"T6413sl10Main.java",
@@ -1522,7 +1522,7 @@ public class SmartLifting13 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.13-otjld-smart-lifting-11
public void test6413_smartLifting11() {
-
+
runConformTest(
new String[] {
"T6413sl11Main.java",
@@ -1670,7 +1670,7 @@ public class SmartLifting13 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.13-otjld-smart-lifting-12
public void test6413_smartLifting12() {
-
+
runConformTest(
new String[] {
"T6413sl12Main.java",
@@ -1818,7 +1818,7 @@ public class SmartLifting13 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.13-otjld-smart-lifting-13
public void test6413_smartLifting13() {
-
+
runConformTest(
new String[] {
"T6413sl13Main.java",
@@ -1966,7 +1966,7 @@ public class SmartLifting13 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.13-otjld-smart-lifting-14
public void test6413_smartLifting14() {
-
+
runConformTest(
new String[] {
"T6413sl14Main.java",
@@ -2114,7 +2114,7 @@ public class SmartLifting13 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.13-otjld-smart-lifting-15
public void test6413_smartLifting15() {
-
+
runConformTest(
new String[] {
"T6413sl15Main.java",
@@ -2262,7 +2262,7 @@ public class SmartLifting13 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.13-otjld-smart-lifting-16
public void test6413_smartLifting16() {
-
+
runConformTest(
new String[] {
"T6413sl16Main.java",
@@ -2410,7 +2410,7 @@ public class SmartLifting13 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.13-otjld-smart-lifting-17
public void test6413_smartLifting17() {
-
+
runConformTest(
new String[] {
"T6413sl17Main.java",
@@ -2558,7 +2558,7 @@ public class SmartLifting13 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.13-otjld-smart-lifting-18
public void test6413_smartLifting18() {
-
+
runConformTest(
new String[] {
"T6413sl18Main.java",
@@ -2706,7 +2706,7 @@ public class SmartLifting13 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.13-otjld-smart-lifting-19
public void test6413_smartLifting19() {
-
+
runConformTest(
new String[] {
"T6413sl19Main.java",
@@ -2854,7 +2854,7 @@ public class SmartLifting13 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.13-otjld-smart-lifting-20
public void test6413_smartLifting20() {
-
+
runConformTest(
new String[] {
"T6413sl20Main.java",
@@ -3002,7 +3002,7 @@ public class SmartLifting13 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.13-otjld-smart-lifting-21
public void test6413_smartLifting21() {
-
+
runConformTest(
new String[] {
"T6413sl21Main.java",
@@ -3151,7 +3151,7 @@ public class SmartLifting13 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.13-otjld-smart-lifting-22
public void test6413_smartLifting22() {
-
+
runConformTest(
new String[] {
"T6413sl22Main.java",
@@ -3300,7 +3300,7 @@ public class SmartLifting13 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.13-otjld-smart-lifting-23
public void test6413_smartLifting23() {
-
+
runConformTest(
new String[] {
"T6413sl23Main.java",
@@ -3449,7 +3449,7 @@ public class SmartLifting13 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.13-otjld-smart-lifting-24
public void test6413_smartLifting24() {
-
+
runConformTest(
new String[] {
"T6413sl24Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting14.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting14.java
index dd4a51ca9..55d10b92b 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting14.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting14.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -22,11 +22,11 @@ package org.eclipse.objectteams.otdt.tests.otjld.liftlower;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class SmartLifting14 extends AbstractOTJLDTest {
-
+
public SmartLifting14(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -41,7 +41,7 @@ public class SmartLifting14 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.14-otjld-smart-lifting-1
public void test6414_smartLifting1() {
-
+
runConformTest(
new String[] {
"T6414sl1Main.java",
@@ -189,7 +189,7 @@ public class SmartLifting14 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.14-otjld-smart-lifting-2
public void test6414_smartLifting2() {
-
+
runConformTest(
new String[] {
"T6414sl2Main.java",
@@ -337,7 +337,7 @@ public class SmartLifting14 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.14-otjld-smart-lifting-3
public void test6414_smartLifting3() {
-
+
runConformTest(
new String[] {
"T6414sl3Main.java",
@@ -485,7 +485,7 @@ public class SmartLifting14 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.14-otjld-smart-lifting-4
public void test6414_smartLifting4() {
-
+
runConformTest(
new String[] {
"T6414sl4Main.java",
@@ -633,7 +633,7 @@ public class SmartLifting14 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.14-otjld-smart-lifting-5
public void test6414_smartLifting5() {
-
+
runConformTest(
new String[] {
"T6414sl5Main.java",
@@ -781,7 +781,7 @@ public class SmartLifting14 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.14-otjld-smart-lifting-6
public void test6414_smartLifting6() {
-
+
runConformTest(
new String[] {
"T6414sl6Main.java",
@@ -929,7 +929,7 @@ public class SmartLifting14 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.14-otjld-smart-lifting-7
public void test6414_smartLifting7() {
-
+
runConformTest(
new String[] {
"T6414sl7Main.java",
@@ -1077,7 +1077,7 @@ public class SmartLifting14 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.14-otjld-smart-lifting-8
public void test6414_smartLifting8() {
-
+
runConformTest(
new String[] {
"T6414sl8Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting15.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting15.java
index 585c64c24..7797dcae0 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting15.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting15.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -22,11 +22,11 @@ package org.eclipse.objectteams.otdt.tests.otjld.liftlower;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class SmartLifting15 extends AbstractOTJLDTest {
-
+
public SmartLifting15(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -42,7 +42,7 @@ public class SmartLifting15 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.15-otjld-smart-lifting-1
public void test6415_smartLifting1() {
-
+
runConformTest(
new String[] {
"T6415sl1Main.java",
@@ -190,7 +190,7 @@ public class SmartLifting15 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.15-otjld-smart-lifting-2
public void test6415_smartLifting2() {
-
+
runConformTest(
new String[] {
"T6415sl2Main.java",
@@ -338,7 +338,7 @@ public class SmartLifting15 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.15-otjld-smart-lifting-3
public void test6415_smartLifting3() {
-
+
runConformTest(
new String[] {
"T6415sl3Main.java",
@@ -486,7 +486,7 @@ public class SmartLifting15 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.15-otjld-smart-lifting-4
public void test6415_smartLifting4() {
-
+
runConformTest(
new String[] {
"T6415sl4Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting16.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting16.java
index 2d15cc06b..39f1eb8ca 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting16.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting16.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -22,11 +22,11 @@ package org.eclipse.objectteams.otdt.tests.otjld.liftlower;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class SmartLifting16 extends AbstractOTJLDTest {
-
+
public SmartLifting16(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -34,7 +34,7 @@ public class SmartLifting16 extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Class testClass() {
return SmartLifting16.class;
}
@@ -42,7 +42,7 @@ public class SmartLifting16 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.16-otjld-smart-lifting-1
public void test6416_smartLifting1() {
-
+
runConformTest(
new String[] {
"T6416sl1Main.java",
@@ -190,7 +190,7 @@ public class SmartLifting16 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.16-otjld-smart-lifting-2
public void test6416_smartLifting2() {
-
+
runConformTest(
new String[] {
"T6416sl2Main.java",
@@ -338,7 +338,7 @@ public class SmartLifting16 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.16-otjld-smart-lifting-3
public void test6416_smartLifting3() {
-
+
runConformTest(
new String[] {
"T6416sl3Main.java",
@@ -486,7 +486,7 @@ public class SmartLifting16 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.16-otjld-smart-lifting-4
public void test6416_smartLifting4() {
-
+
runConformTest(
new String[] {
"T6416sl4Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting17.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting17.java
index ed9232e22..e7b4b2493 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting17.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting17.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -22,11 +22,11 @@ package org.eclipse.objectteams.otdt.tests.otjld.liftlower;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class SmartLifting17 extends AbstractOTJLDTest {
-
+
public SmartLifting17(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -42,7 +42,7 @@ public class SmartLifting17 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.17-otjld-smart-lifting-1
public void test6417_smartLifting1() {
-
+
runConformTest(
new String[] {
"T6417sl1Main.java",
@@ -190,7 +190,7 @@ public class SmartLifting17 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.17-otjld-smart-lifting-2
public void test6417_smartLifting2() {
-
+
runConformTest(
new String[] {
"T6417sl2Main.java",
@@ -338,7 +338,7 @@ public class SmartLifting17 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.17-otjld-smart-lifting-3
public void test6417_smartLifting3() {
-
+
runConformTest(
new String[] {
"T6417sl3Main.java",
@@ -486,7 +486,7 @@ public class SmartLifting17 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.17-otjld-smart-lifting-4
public void test6417_smartLifting4() {
-
+
runConformTest(
new String[] {
"T6417sl4Main.java",
@@ -634,7 +634,7 @@ public class SmartLifting17 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.17-otjld-smart-lifting-5
public void test6417_smartLifting5() {
-
+
runConformTest(
new String[] {
"T6417sl5Main.java",
@@ -782,7 +782,7 @@ public class SmartLifting17 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.17-otjld-smart-lifting-6
public void test6417_smartLifting6() {
-
+
runConformTest(
new String[] {
"T6417sl6Main.java",
@@ -930,7 +930,7 @@ public class SmartLifting17 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.17-otjld-smart-lifting-7
public void test6417_smartLifting7() {
-
+
runConformTest(
new String[] {
"T6417sl7Main.java",
@@ -1078,7 +1078,7 @@ public class SmartLifting17 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.17-otjld-smart-lifting-8
public void test6417_smartLifting8() {
-
+
runConformTest(
new String[] {
"T6417sl8Main.java",
@@ -1226,7 +1226,7 @@ public class SmartLifting17 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.17-otjld-smart-lifting-9
public void test6417_smartLifting9() {
-
+
runConformTest(
new String[] {
"T6417sl9Main.java",
@@ -1375,7 +1375,7 @@ public class SmartLifting17 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.17-otjld-smart-lifting-10
public void test6417_smartLifting10() {
-
+
runConformTest(
new String[] {
"T6417sl10Main.java",
@@ -1524,7 +1524,7 @@ public class SmartLifting17 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.17-otjld-smart-lifting-11
public void test6417_smartLifting11() {
-
+
runConformTest(
new String[] {
"T6417sl11Main.java",
@@ -1673,7 +1673,7 @@ public class SmartLifting17 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.17-otjld-smart-lifting-12
public void test6417_smartLifting12() {
-
+
runConformTest(
new String[] {
"T6417sl12Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting18.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting18.java
index f91e32a22..d35ee896f 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting18.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting18.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -22,11 +22,11 @@ package org.eclipse.objectteams.otdt.tests.otjld.liftlower;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class SmartLifting18 extends AbstractOTJLDTest {
-
+
public SmartLifting18(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -34,7 +34,7 @@ public class SmartLifting18 extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Class testClass() {
return SmartLifting18.class;
}
@@ -42,7 +42,7 @@ public class SmartLifting18 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.18-otjld-smart-lifting-1
public void test6418_smartLifting1() {
-
+
runConformTest(
new String[] {
"T6418sl1Main.java",
@@ -190,7 +190,7 @@ public class SmartLifting18 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.18-otjld-smart-lifting-2
public void test6418_smartLifting2() {
-
+
runConformTest(
new String[] {
"T6418sl2Main.java",
@@ -338,7 +338,7 @@ public class SmartLifting18 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.18-otjld-smart-lifting-3
public void test6418_smartLifting3() {
-
+
runConformTest(
new String[] {
"T6418sl3Main.java",
@@ -486,7 +486,7 @@ public class SmartLifting18 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.18-otjld-smart-lifting-4
public void test6418_smartLifting4() {
-
+
runConformTest(
new String[] {
"T6418sl4Main.java",
@@ -634,7 +634,7 @@ public class SmartLifting18 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.18-otjld-smart-lifting-5
public void test6418_smartLifting5() {
-
+
runConformTest(
new String[] {
"T6418sl5Main.java",
@@ -783,7 +783,7 @@ public class SmartLifting18 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.18-otjld-smart-lifting-6
public void test6418_smartLifting6() {
-
+
runConformTest(
new String[] {
"T6418sl6Main.java",
@@ -932,7 +932,7 @@ public class SmartLifting18 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.18-otjld-smart-lifting-7
public void test6418_smartLifting7() {
-
+
runConformTest(
new String[] {
"T6418sl7Main.java",
@@ -1081,7 +1081,7 @@ public class SmartLifting18 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.18-otjld-smart-lifting-8
public void test6418_smartLifting8() {
-
+
runConformTest(
new String[] {
"T6418sl8Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting19.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting19.java
index 58cae563d..28c2ee852 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting19.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting19.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -22,11 +22,11 @@ package org.eclipse.objectteams.otdt.tests.otjld.liftlower;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class SmartLifting19 extends AbstractOTJLDTest {
-
+
public SmartLifting19(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -34,7 +34,7 @@ public class SmartLifting19 extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Class testClass() {
return SmartLifting19.class;
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting2.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting2.java
index ee241a7f0..98a880df6 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting2.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting2.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -22,11 +22,11 @@ package org.eclipse.objectteams.otdt.tests.otjld.liftlower;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class SmartLifting2 extends AbstractOTJLDTest {
-
+
public SmartLifting2(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -34,7 +34,7 @@ public class SmartLifting2 extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Class testClass() {
return SmartLifting2.class;
}
@@ -42,7 +42,7 @@ public class SmartLifting2 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.2-otjld-smart-lifting-1
public void test642_smartLifting1() {
-
+
runConformTest(
new String[] {
"T642sl1Main.java",
@@ -190,7 +190,7 @@ public class SmartLifting2 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.2-otjld-smart-lifting-2
public void test642_smartLifting2() {
-
+
runConformTest(
new String[] {
"T642sl2Main.java",
@@ -338,7 +338,7 @@ public class SmartLifting2 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.2-otjld-smart-lifting-3
public void test642_smartLifting3() {
-
+
runConformTest(
new String[] {
"T642sl3Main.java",
@@ -486,7 +486,7 @@ public class SmartLifting2 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.2-otjld-smart-lifting-4
public void test642_smartLifting4() {
-
+
runConformTest(
new String[] {
"T642sl4Main.java",
@@ -634,7 +634,7 @@ public class SmartLifting2 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.2-otjld-smart-lifting-5
public void test642_smartLifting5() {
-
+
runConformTest(
new String[] {
"T642sl5Main.java",
@@ -782,7 +782,7 @@ public class SmartLifting2 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.2-otjld-smart-lifting-6
public void test642_smartLifting6() {
-
+
runConformTest(
new String[] {
"T642sl6Main.java",
@@ -930,7 +930,7 @@ public class SmartLifting2 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.2-otjld-smart-lifting-7
public void test642_smartLifting7() {
-
+
runConformTest(
new String[] {
"T642sl7Main.java",
@@ -1078,7 +1078,7 @@ public class SmartLifting2 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.2-otjld-smart-lifting-8
public void test642_smartLifting8() {
-
+
runConformTest(
new String[] {
"T642sl8Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting20.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting20.java
index f3be7897d..b258c5e3f 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting20.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting20.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -22,11 +22,11 @@ package org.eclipse.objectteams.otdt.tests.otjld.liftlower;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class SmartLifting20 extends AbstractOTJLDTest {
-
+
public SmartLifting20(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting21.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting21.java
index 42bcccd21..bc6f9faa1 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting21.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting21.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -24,11 +24,11 @@ import junit.framework.Test;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class SmartLifting21 extends AbstractOTJLDTest {
-
+
public SmartLifting21(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -36,7 +36,7 @@ public class SmartLifting21 extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -48,7 +48,7 @@ public class SmartLifting21 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.21-otjld-smart-lifting-1
public void test6421_smartLifting1() {
-
+
runConformTest(
new String[] {
"T6421sl1Main.java",
@@ -196,7 +196,7 @@ public class SmartLifting21 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.21-otjld-smart-lifting-2
public void test6421_smartLifting2() {
-
+
runConformTest(
new String[] {
"T6421sl2Main.java",
@@ -344,7 +344,7 @@ public class SmartLifting21 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.21-otjld-smart-lifting-3
public void test6421_smartLifting3() {
-
+
runConformTest(
new String[] {
"T6421sl3Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting22.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting22.java
index 955349fe6..3cb01a637 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting22.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting22.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -24,11 +24,11 @@ import junit.framework.Test;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class SmartLifting22 extends AbstractOTJLDTest {
-
+
public SmartLifting22(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -36,7 +36,7 @@ public class SmartLifting22 extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting23.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting23.java
index b2102195c..98a989326 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting23.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting23.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -24,11 +24,11 @@ import junit.framework.Test;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class SmartLifting23 extends AbstractOTJLDTest {
-
+
public SmartLifting23(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting24.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting24.java
index 92af6634d..06ad00e7b 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting24.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting24.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -24,11 +24,11 @@ import junit.framework.Test;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class SmartLifting24 extends AbstractOTJLDTest {
-
+
public SmartLifting24(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -36,7 +36,7 @@ public class SmartLifting24 extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting25.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting25.java
index 65699ed22..435222b8e 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting25.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting25.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -24,11 +24,11 @@ import junit.framework.Test;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class SmartLifting25 extends AbstractOTJLDTest {
-
+
public SmartLifting25(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -36,7 +36,7 @@ public class SmartLifting25 extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting26.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting26.java
index 1032a8466..a8c0e44f6 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting26.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting26.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -24,11 +24,11 @@ import junit.framework.Test;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class SmartLifting26 extends AbstractOTJLDTest {
-
+
public SmartLifting26(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -36,7 +36,7 @@ public class SmartLifting26 extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting27.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting27.java
index 888516c75..861aae5ca 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting27.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting27.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -24,11 +24,11 @@ import junit.framework.Test;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class SmartLifting27 extends AbstractOTJLDTest {
-
+
public SmartLifting27(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -36,7 +36,7 @@ public class SmartLifting27 extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting28.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting28.java
index 2c807d646..b7573fab2 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting28.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting28.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -24,11 +24,11 @@ import junit.framework.Test;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class SmartLifting28 extends AbstractOTJLDTest {
-
+
public SmartLifting28(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting29.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting29.java
index af6987f28..416737676 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting29.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting29.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -24,11 +24,11 @@ import junit.framework.Test;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class SmartLifting29 extends AbstractOTJLDTest {
-
+
public SmartLifting29(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -54,7 +54,7 @@ public class SmartLifting29 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.29-otjld-smart-lifting-1
public void test6429_smartLifting1() {
-
+
runConformTest(
new String[] {
"T6429sl1Main.java",
@@ -202,7 +202,7 @@ public class SmartLifting29 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.29-otjld-smart-lifting-2
public void test6429_smartLifting2() {
-
+
runConformTest(
new String[] {
"T6429sl2Main.java",
@@ -350,7 +350,7 @@ public class SmartLifting29 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.29-otjld-smart-lifting-3
public void test6429_smartLifting3() {
-
+
runConformTest(
new String[] {
"T6429sl3Main.java",
@@ -498,7 +498,7 @@ public class SmartLifting29 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.29-otjld-smart-lifting-4
public void test6429_smartLifting4() {
-
+
runConformTest(
new String[] {
"T6429sl4Main.java",
@@ -646,7 +646,7 @@ public class SmartLifting29 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.29-otjld-smart-lifting-5
public void test6429_smartLifting5() {
-
+
runConformTest(
new String[] {
"T6429sl5Main.java",
@@ -795,7 +795,7 @@ public class SmartLifting29 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.29-otjld-smart-lifting-6
public void test6429_smartLifting6() {
-
+
runConformTest(
new String[] {
"T6429sl6Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting3.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting3.java
index e5274d2fc..4009012f2 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting3.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting3.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -24,11 +24,11 @@ import junit.framework.Test;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class SmartLifting3 extends AbstractOTJLDTest {
-
+
public SmartLifting3(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -54,7 +54,7 @@ public class SmartLifting3 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.3-otjld-smart-lifting-1
public void test643_smartLifting1() {
-
+
runConformTest(
new String[] {
"T643sl1Main.java",
@@ -202,7 +202,7 @@ public class SmartLifting3 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.3-otjld-smart-lifting-2
public void test643_smartLifting2() {
-
+
runConformTest(
new String[] {
"T643sl2Main.java",
@@ -350,7 +350,7 @@ public class SmartLifting3 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.3-otjld-smart-lifting-3
public void test643_smartLifting3() {
-
+
runConformTest(
new String[] {
"T643sl3Main.java",
@@ -498,7 +498,7 @@ public class SmartLifting3 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.3-otjld-smart-lifting-4
public void test643_smartLifting4() {
-
+
runConformTest(
new String[] {
"T643sl4Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting30.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting30.java
index 0e3e5aec1..3cc1bec17 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting30.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting30.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -24,11 +24,11 @@ import junit.framework.Test;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class SmartLifting30 extends AbstractOTJLDTest {
-
+
public SmartLifting30(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -36,7 +36,7 @@ public class SmartLifting30 extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -48,7 +48,7 @@ public class SmartLifting30 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.30-otjld-smart-lifting-1
public void test6430_smartLifting1() {
-
+
runConformTest(
new String[] {
"T6430sl1Main.java",
@@ -196,7 +196,7 @@ public class SmartLifting30 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.30-otjld-smart-lifting-2
public void test6430_smartLifting2() {
-
+
runConformTest(
new String[] {
"T6430sl2Main.java",
@@ -344,7 +344,7 @@ public class SmartLifting30 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.30-otjld-smart-lifting-3
public void test6430_smartLifting3() {
-
+
runConformTest(
new String[] {
"T6430sl3Main.java",
@@ -493,7 +493,7 @@ public class SmartLifting30 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.30-otjld-smart-lifting-4
public void test6430_smartLifting4() {
-
+
runConformTest(
new String[] {
"T6430sl4Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting4.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting4.java
index 0832ef675..40714c079 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting4.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting4.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -24,11 +24,11 @@ import junit.framework.Test;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class SmartLifting4 extends AbstractOTJLDTest {
-
+
public SmartLifting4(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -36,7 +36,7 @@ public class SmartLifting4 extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -48,7 +48,7 @@ public class SmartLifting4 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.4-otjld-smart-lifting-1
public void test644_smartLifting1() {
-
+
runConformTest(
new String[] {
"T644sl1Main.java",
@@ -196,7 +196,7 @@ public class SmartLifting4 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.4-otjld-smart-lifting-2
public void test644_smartLifting2() {
-
+
runConformTest(
new String[] {
"T644sl2Main.java",
@@ -344,7 +344,7 @@ public class SmartLifting4 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.4-otjld-smart-lifting-3
public void test644_smartLifting3() {
-
+
runConformTest(
new String[] {
"T644sl3Main.java",
@@ -492,7 +492,7 @@ public class SmartLifting4 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.4-otjld-smart-lifting-4
public void test644_smartLifting4() {
-
+
runConformTest(
new String[] {
"T644sl4Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting5.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting5.java
index 9132d5061..545b231cd 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting5.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting5.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -24,11 +24,11 @@ import junit.framework.Test;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class SmartLifting5 extends AbstractOTJLDTest {
-
+
public SmartLifting5(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -48,7 +48,7 @@ public class SmartLifting5 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.5-otjld-smart-lifting-1
public void test645_smartLifting1() {
-
+
runConformTest(
new String[] {
"T645sl1Main.java",
@@ -196,7 +196,7 @@ public class SmartLifting5 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.5-otjld-smart-lifting-2
public void test645_smartLifting2() {
-
+
runConformTest(
new String[] {
"T645sl2Main.java",
@@ -344,7 +344,7 @@ public class SmartLifting5 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.5-otjld-smart-lifting-3
public void test645_smartLifting3() {
-
+
runConformTest(
new String[] {
"T645sl3Main.java",
@@ -492,7 +492,7 @@ public class SmartLifting5 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.5-otjld-smart-lifting-4
public void test645_smartLifting4() {
-
+
runConformTest(
new String[] {
"T645sl4Main.java",
@@ -640,7 +640,7 @@ public class SmartLifting5 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.5-otjld-smart-lifting-5
public void test645_smartLifting5() {
-
+
runConformTest(
new String[] {
"T645sl5Main.java",
@@ -788,7 +788,7 @@ public class SmartLifting5 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.5-otjld-smart-lifting-6
public void test645_smartLifting6() {
-
+
runConformTest(
new String[] {
"T645sl6Main.java",
@@ -936,7 +936,7 @@ public class SmartLifting5 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.5-otjld-smart-lifting-7
public void test645_smartLifting7() {
-
+
runConformTest(
new String[] {
"T645sl7Main.java",
@@ -1084,7 +1084,7 @@ public class SmartLifting5 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.5-otjld-smart-lifting-8
public void test645_smartLifting8() {
-
+
runConformTest(
new String[] {
"T645sl8Main.java",
@@ -1232,7 +1232,7 @@ public class SmartLifting5 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.5-otjld-smart-lifting-9
public void test645_smartLifting9() {
-
+
runConformTest(
new String[] {
"T645sl9Main.java",
@@ -1381,7 +1381,7 @@ public class SmartLifting5 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.5-otjld-smart-lifting-10
public void test645_smartLifting10() {
-
+
runConformTest(
new String[] {
"T645sl10Main.java",
@@ -1530,7 +1530,7 @@ public class SmartLifting5 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.5-otjld-smart-lifting-11
public void test645_smartLifting11() {
-
+
runConformTest(
new String[] {
"T645sl11Main.java",
@@ -1679,7 +1679,7 @@ public class SmartLifting5 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.5-otjld-smart-lifting-12
public void test645_smartLifting12() {
-
+
runConformTest(
new String[] {
"T645sl12Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting6.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting6.java
index b19fd9a91..94577d217 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting6.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting6.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -24,11 +24,11 @@ import junit.framework.Test;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class SmartLifting6 extends AbstractOTJLDTest {
-
+
public SmartLifting6(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -54,7 +54,7 @@ public class SmartLifting6 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.6-otjld-smart-lifting-1
public void test646_smartLifting1() {
-
+
runConformTest(
new String[] {
"T646sl1Main.java",
@@ -202,7 +202,7 @@ public class SmartLifting6 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.6-otjld-smart-lifting-2
public void test646_smartLifting2() {
-
+
runConformTest(
new String[] {
"T646sl2Main.java",
@@ -350,7 +350,7 @@ public class SmartLifting6 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.6-otjld-smart-lifting-3
public void test646_smartLifting3() {
-
+
runConformTest(
new String[] {
"T646sl3Main.java",
@@ -498,7 +498,7 @@ public class SmartLifting6 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.6-otjld-smart-lifting-4
public void test646_smartLifting4() {
-
+
runConformTest(
new String[] {
"T646sl4Main.java",
@@ -646,7 +646,7 @@ public class SmartLifting6 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.6-otjld-smart-lifting-5
public void test646_smartLifting5() {
-
+
runConformTest(
new String[] {
"T646sl5Main.java",
@@ -795,7 +795,7 @@ public class SmartLifting6 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.6-otjld-smart-lifting-6
public void test646_smartLifting6() {
-
+
runConformTest(
new String[] {
"T646sl6Main.java",
@@ -944,7 +944,7 @@ public class SmartLifting6 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.6-otjld-smart-lifting-7
public void test646_smartLifting7() {
-
+
runConformTest(
new String[] {
"T646sl7Main.java",
@@ -1093,7 +1093,7 @@ public class SmartLifting6 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.6-otjld-smart-lifting-8
public void test646_smartLifting8() {
-
+
runConformTest(
new String[] {
"T646sl8Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting7.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting7.java
index 57afbd52a..3df5426c5 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting7.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting7.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -24,11 +24,11 @@ import junit.framework.Test;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class SmartLifting7 extends AbstractOTJLDTest {
-
+
public SmartLifting7(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -54,7 +54,7 @@ public class SmartLifting7 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.7-otjld-smart-lifting-1
public void test647_smartLifting1() {
-
+
runConformTest(
new String[] {
"T647sl1Main.java",
@@ -202,7 +202,7 @@ public class SmartLifting7 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.7-otjld-smart-lifting-2
public void test647_smartLifting2() {
-
+
runConformTest(
new String[] {
"T647sl2Main.java",
@@ -350,7 +350,7 @@ public class SmartLifting7 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.7-otjld-smart-lifting-3
public void test647_smartLifting3() {
-
+
runConformTest(
new String[] {
"T647sl3Main.java",
@@ -498,7 +498,7 @@ public class SmartLifting7 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.7-otjld-smart-lifting-4
public void test647_smartLifting4() {
-
+
runConformTest(
new String[] {
"T647sl4Main.java",
@@ -646,7 +646,7 @@ public class SmartLifting7 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.7-otjld-smart-lifting-5
public void test647_smartLifting5() {
-
+
runConformTest(
new String[] {
"T647sl5Main.java",
@@ -794,7 +794,7 @@ public class SmartLifting7 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.7-otjld-smart-lifting-6
public void test647_smartLifting6() {
-
+
runConformTest(
new String[] {
"T647sl6Main.java",
@@ -942,7 +942,7 @@ public class SmartLifting7 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.7-otjld-smart-lifting-7
public void test647_smartLifting7() {
-
+
runConformTest(
new String[] {
"T647sl7Main.java",
@@ -1090,7 +1090,7 @@ public class SmartLifting7 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.7-otjld-smart-lifting-8
public void test647_smartLifting8() {
-
+
runConformTest(
new String[] {
"T647sl8Main.java",
@@ -1238,7 +1238,7 @@ public class SmartLifting7 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.7-otjld-smart-lifting-9
public void test647_smartLifting9() {
-
+
runConformTest(
new String[] {
"T647sl9Main.java",
@@ -1386,7 +1386,7 @@ public class SmartLifting7 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.7-otjld-smart-lifting-10
public void test647_smartLifting10() {
-
+
runConformTest(
new String[] {
"T647sl10Main.java",
@@ -1534,7 +1534,7 @@ public class SmartLifting7 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.7-otjld-smart-lifting-11
public void test647_smartLifting11() {
-
+
runConformTest(
new String[] {
"T647sl11Main.java",
@@ -1682,7 +1682,7 @@ public class SmartLifting7 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.7-otjld-smart-lifting-12
public void test647_smartLifting12() {
-
+
runConformTest(
new String[] {
"T647sl12Main.java",
@@ -1830,7 +1830,7 @@ public class SmartLifting7 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.7-otjld-smart-lifting-13
public void test647_smartLifting13() {
-
+
runConformTest(
new String[] {
"T647sl13Main.java",
@@ -1978,7 +1978,7 @@ public class SmartLifting7 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.7-otjld-smart-lifting-14
public void test647_smartLifting14() {
-
+
runConformTest(
new String[] {
"T647sl14Main.java",
@@ -2126,7 +2126,7 @@ public class SmartLifting7 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.7-otjld-smart-lifting-15
public void test647_smartLifting15() {
-
+
runConformTest(
new String[] {
"T647sl15Main.java",
@@ -2274,7 +2274,7 @@ public class SmartLifting7 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.7-otjld-smart-lifting-16
public void test647_smartLifting16() {
-
+
runConformTest(
new String[] {
"T647sl16Main.java",
@@ -2422,7 +2422,7 @@ public class SmartLifting7 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.7-otjld-smart-lifting-17
public void test647_smartLifting17() {
-
+
runConformTest(
new String[] {
"T647sl17Main.java",
@@ -2570,7 +2570,7 @@ public class SmartLifting7 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.7-otjld-smart-lifting-18
public void test647_smartLifting18() {
-
+
runConformTest(
new String[] {
"T647sl18Main.java",
@@ -2718,7 +2718,7 @@ public class SmartLifting7 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.7-otjld-smart-lifting-19
public void test647_smartLifting19() {
-
+
runConformTest(
new String[] {
"T647sl19Main.java",
@@ -2866,7 +2866,7 @@ public class SmartLifting7 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.7-otjld-smart-lifting-20
public void test647_smartLifting20() {
-
+
runConformTest(
new String[] {
"T647sl20Main.java",
@@ -3014,7 +3014,7 @@ public class SmartLifting7 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.7-otjld-smart-lifting-21
public void test647_smartLifting21() {
-
+
runConformTest(
new String[] {
"T647sl21Main.java",
@@ -3163,7 +3163,7 @@ public class SmartLifting7 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.7-otjld-smart-lifting-22
public void test647_smartLifting22() {
-
+
runConformTest(
new String[] {
"T647sl22Main.java",
@@ -3312,7 +3312,7 @@ public class SmartLifting7 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.7-otjld-smart-lifting-23
public void test647_smartLifting23() {
-
+
runConformTest(
new String[] {
"T647sl23Main.java",
@@ -3461,7 +3461,7 @@ public class SmartLifting7 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.7-otjld-smart-lifting-24
public void test647_smartLifting24() {
-
+
runConformTest(
new String[] {
"T647sl24Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting8.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting8.java
index 44cfed551..5060ad08a 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting8.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting8.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -24,11 +24,11 @@ import junit.framework.Test;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class SmartLifting8 extends AbstractOTJLDTest {
-
+
public SmartLifting8(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -54,7 +54,7 @@ public class SmartLifting8 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.8-otjld-smart-lifting-1
public void test648_smartLifting1() {
-
+
runConformTest(
new String[] {
"T648sl1Main.java",
@@ -202,7 +202,7 @@ public class SmartLifting8 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.8-otjld-smart-lifting-2
public void test648_smartLifting2() {
-
+
runConformTest(
new String[] {
"T648sl2Main.java",
@@ -350,7 +350,7 @@ public class SmartLifting8 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.8-otjld-smart-lifting-3
public void test648_smartLifting3() {
-
+
runConformTest(
new String[] {
"T648sl3Main.java",
@@ -498,7 +498,7 @@ public class SmartLifting8 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.8-otjld-smart-lifting-4
public void test648_smartLifting4() {
-
+
runConformTest(
new String[] {
"T648sl4Main.java",
@@ -646,7 +646,7 @@ public class SmartLifting8 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.8-otjld-smart-lifting-5
public void test648_smartLifting5() {
-
+
runConformTest(
new String[] {
"T648sl5Main.java",
@@ -794,7 +794,7 @@ public class SmartLifting8 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.8-otjld-smart-lifting-6
public void test648_smartLifting6() {
-
+
runConformTest(
new String[] {
"T648sl6Main.java",
@@ -942,7 +942,7 @@ public class SmartLifting8 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.8-otjld-smart-lifting-7
public void test648_smartLifting7() {
-
+
runConformTest(
new String[] {
"T648sl7Main.java",
@@ -1090,7 +1090,7 @@ public class SmartLifting8 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.8-otjld-smart-lifting-8
public void test648_smartLifting8() {
-
+
runConformTest(
new String[] {
"T648sl8Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting9.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting9.java
index 3addc3a19..e04eb6db4 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting9.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/liftlower/SmartLifting9.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -24,11 +24,11 @@ import junit.framework.Test;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class SmartLifting9 extends AbstractOTJLDTest {
-
+
public SmartLifting9(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -54,7 +54,7 @@ public class SmartLifting9 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.9-otjld-smart-lifting-1
public void test649_smartLifting1() {
-
+
runConformTest(
new String[] {
"T649sl1Main.java",
@@ -202,7 +202,7 @@ public class SmartLifting9 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.9-otjld-smart-lifting-2
public void test649_smartLifting2() {
-
+
runConformTest(
new String[] {
"T649sl2Main.java",
@@ -350,7 +350,7 @@ public class SmartLifting9 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.9-otjld-smart-lifting-3
public void test649_smartLifting3() {
-
+
runConformTest(
new String[] {
"T649sl3Main.java",
@@ -498,7 +498,7 @@ public class SmartLifting9 extends AbstractOTJLDTest {
// a base object from a class hierarchy is smart-lifted to a role class from a role class hierarchy
// 6.4.9-otjld-smart-lifting-4
public void test649_smartLifting4() {
-
+
runConformTest(
new String[] {
"T649sl4Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/AccessModifiers.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/AccessModifiers.java
index 4dd2cb74a..4217d7ddf 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/AccessModifiers.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/AccessModifiers.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010 Stephan Herrmann
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -27,11 +27,11 @@ import junit.framework.Test;
@SuppressWarnings("unchecked")
public class AccessModifiers extends AbstractOTJLDTest {
-
+
public AccessModifiers(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -39,7 +39,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -86,16 +86,16 @@ public class AccessModifiers extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team0a1a2.java (at line 4)\n" +
- " private void secret (Missing a) {}\n" +
- " ^^^^^^^\n" +
- "Missing cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in Team0a1a2.java (at line 6)\n" +
- " this.secret(null);\n" +
- " ^^^^^^\n" +
- "The method secret(Missing) from the type Team0a1a2.R1 refers to the missing type Missing\n" +
+ "----------\n" +
+ "1. ERROR in Team0a1a2.java (at line 4)\n" +
+ " private void secret (Missing a) {}\n" +
+ " ^^^^^^^\n" +
+ "Missing cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in Team0a1a2.java (at line 6)\n" +
+ " this.secret(null);\n" +
+ " ^^^^^^\n" +
+ "The method secret(Missing) from the type Team0a1a2.R1 refers to the missing type Missing\n" +
"----------\n");
}
@@ -198,7 +198,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// private role method is callin bound, binding inheritance
// 0.a.1.a-otjld-private-role-method-7
public void test0a1a_privateRoleMethod7() {
-
+
runConformTest(
new String[] {
"Team0a1aprm7_2.java",
@@ -243,7 +243,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
public void test0a1a_privateRoleMethod8() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"Team0a1aprm8_2.java",
@@ -289,7 +289,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
public void test0a1a_privateRoleMethod9() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"Team0a1aprm9_2.java",
@@ -331,42 +331,42 @@ public class AccessModifiers extends AbstractOTJLDTest {
customOptions,
null/*no custom requestor*/);
}
-
+
// private method of nested team accesses protected inner role
// Bug 323327 - [compiler] accessing a protected inner role from a private method of a nested team
public void test0a1a_privateRoleMethod10() {
runConformTest(
new String[] {
"Team0a1aprm10.java",
- "public team class Team0a1aprm10 {\n" +
- " protected team class Mid {\n" +
+ "public team class Team0a1aprm10 {\n" +
+ " protected team class Mid {\n" +
" protected class R {\n" +
- " protected void m() {\n" +
- " System.out.println(\"OK\");\n" +
- " }\n" +
- " }\n" +
- " private void m(R r) {\n" +
- " r.m();\n" +
- " }\n" +
- " protected void test() {\n" +
- " m(new R());\n" +
- " }\n" +
- " }\n" +
- " void test() {\n" +
- " new Mid().test();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new Team0a1aprm10().test();\n" +
- " }\n" +
+ " protected void m() {\n" +
+ " System.out.println(\"OK\");\n" +
+ " }\n" +
+ " }\n" +
+ " private void m(R r) {\n" +
+ " r.m();\n" +
+ " }\n" +
+ " protected void test() {\n" +
+ " m(new R());\n" +
+ " }\n" +
+ " }\n" +
+ " void test() {\n" +
+ " new Mid().test();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new Team0a1aprm10().test();\n" +
+ " }\n" +
"}\n"
},
"OK");
}
-
+
// a private role field has a type of a non-externalizable role (synth accessor despite role being protected - witness for a regression in miniCRM )
// 0.a.1.A-otjld-private-role-field
public void test0a1A_privateRoleField() {
-
+
runConformTest(
new String[] {
"Team0a1A.java",
@@ -402,7 +402,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// a private role field is accessed - multilevel team inheritance - witness for CCE in RoleTypeBinding
// 0.a.1.A-otjld-private-role-field-2
public void test0a1A_privateRoleField2() {
-
+
runConformTest(
new String[] {
"Team0a1A2_3.java",
@@ -449,7 +449,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// a private role method needs a synth accessor, arg has role type of same name as its base (was incorrectly resolved to the base class
// 0.a.1.A-otjld-private-role-method-1
public void test0a1A_privateRoleMethod1() {
-
+
runConformTest(
new String[] {
"T0a1Aprm1Main.java",
@@ -686,7 +686,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// public field accessed within team
// 0.a.5-otjld-public-role-field
public void test0a5_publicRoleField() {
-
+
runConformTest(
new String[] {
"T0a5prf.java",
@@ -735,7 +735,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// protected role field accessed outside role
// 0.a.6-otjld-role-field-access-2
public void test0a6_roleFieldAccess2() {
-
+
runConformTest(
new String[] {
"Team0a6rfa2.java",
@@ -789,7 +789,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// protected role field accessed from other role
// 0.a.7-otjld-role-field-access-other-role-2
public void test0a7_roleFieldAccessOtherRole2() {
-
+
runConformTest(
new String[] {
"Team0a7rfaor2.java",
@@ -819,7 +819,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// protected role field accessed from other role - receiver is a message send
// 0.a.7-otjld-role-field-access-other-role-3
public void test0a7_roleFieldAccessOtherRole3() {
-
+
runConformTest(
new String[] {
"Team0a7rfaor3.java",
@@ -879,7 +879,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// role field accessed from other role
// 0.a.8-otjld-role-field-access-other-role-2
public void test0a8_roleFieldAccessOtherRole2() {
-
+
runConformTest(
new String[] {
"Team0a8rfaor2.java",
@@ -908,7 +908,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// role field accessed across externalized roles
// 0.a.8-otjld-role-field-access-other-role-2e
public void test0a8_roleFieldAccessOtherRole2e() {
-
+
runConformTest(
new String[] {
"T0a8rfaor2eMain.java",
@@ -949,7 +949,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// role field accessed across externalized roles (MOVE to incremental tests and solve using BuildManager)
// 0.a.8-otjld_role-field-access-other-role-2f
public void _role_test0a8_fieldAccessOtherRole2f() {
-
+
runConformTest(
new String[] {
"T0a8rfaor2fMain.java",
@@ -990,7 +990,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// role field accessed from other role - implicitely inherited to other package
// 0.a.8-otjld-role-field-access-other-role-3
public void test0a8_roleFieldAccessOtherRole3() {
-
+
runConformTest(
new String[] {
"p2/Team0a8rfaor3_2.java",
@@ -1026,7 +1026,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// role field accessed from the team - implicitely inherited to other package
// 0.a.8-otjld-role-field-accessed-by-team-4
public void test0a8_roleFieldAccessedByTeam4() {
-
+
runConformTest(
new String[] {
"p2/Team0a8rfabt4_2.java",
@@ -1058,7 +1058,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// role synth field (this$0) used from nested role - implicitely inherited to other package
// 0.a.8-otjld-role-field-accessed-by-team-4t
public void test0a8_roleFieldAccessedByTeam4t() {
-
+
runConformTest(
new String[] {
"p2/Team0a8rfabt4t_2.java",
@@ -1121,7 +1121,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// role field accessed (write) from the team - implicitely inherited to other package
// 0.a.8-otjld-role-field-accessed-by-team-5
public void test0a8_roleFieldAccessedByTeam5() {
-
+
runConformTest(
new String[] {
"p2/Team0a8rfabt5_2.java",
@@ -1156,7 +1156,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// role field accessed (write) from the team - implicitely inherited to other package, using source type (1 compile)
// 0.a.8-otjld-role-field-accessed-by-team-5s
public void test0a8_roleFieldAccessedByTeam5s() {
-
+
runConformTest(
new String[] {
"p2/Team0a8rfabt5s_2.java",
@@ -1191,7 +1191,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// role field accessed from the team - implicitely inherited to other package - write object
// 0.a.8-otjld-role-field-accessed-by-team-6
public void test0a8_roleFieldAccessedByTeam6() {
-
+
runConformTest(
new String[] {
"p2/Team0a8rfabt6_2.java",
@@ -1232,7 +1232,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// role field accessed from the team - implicitely inherited to other package - super access to default-vis role method
// 0.a.8-otjld-role-field-accessed-by-team-6s
public void test0a8_roleFieldAccessedByTeam6s() {
-
+
runConformTest(
new String[] {
"p2/Team0a8rfabt6s_2.java",
@@ -1307,7 +1307,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// role field accessed from the team - implicitely inherited to other package - write long
// 0.a.8-otjld-role-field-accessed-by-team-7
public void test0a8_roleFieldAccessedByTeam7() {
-
+
runConformTest(
new String[] {
"p2/Team0a8rfabt7_2.java",
@@ -1343,7 +1343,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// a field of an externalized role is written and read, team is compatible but not identical
// 0.a.8-otjld-role-field-access-other-role-8
public void test0a8_roleFieldAccessOtherRole8() {
-
+
runConformTest(
new String[] {
"T0a8rfaor8Main.java",
@@ -1482,7 +1482,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// a wide field is accessed via another role instance of the same team
// 0.a.8-otjld-role-field-access-other-role-13
public void test0a8_roleFieldAccessOtherRole13() {
-
+
runConformTest(
new String[] {
"Team0a8rfaor13.java",
@@ -1515,7 +1515,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// a role has a public static final field
// 0.a.9-otjld-static-final-role-field-1
public void test0a9_staticFinalRoleField1() {
-
+
runConformTest(
new String[] {
"T0a9sfrf1Main.java",
@@ -1571,7 +1571,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// a role has a public static non-final field - access via anchored role type: unsupported syntax
// 0.a.9-otjld_static-final-role-field-1b
public void _static_test0a9_finalRoleField1b() {
-
+
runConformTest(
new String[] {
"T0a9sfrf1bMain.java",
@@ -1609,7 +1609,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// a role has a public static non-final field - access via anchored role type
// 0.a.9-otjld_static-final-role-field-1c
public void _static_test0a9_finalRoleField1c() {
-
+
runConformTest(
new String[] {
"T0a9sfrf1cMain.java",
@@ -1702,7 +1702,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// a role has a protected static final field
// 0.a.9-otjld-static-final-role-field-3
public void test0a9_staticFinalRoleField3() {
-
+
runConformTest(
new String[] {
"T0a9sfrf3Main.java",
@@ -1764,7 +1764,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// a team field accessed from its role across packages needs a synthetic accessor - role type
// 0.a.10-otjld-team-field-needs-synthetic-1
public void test0a10_teamFieldNeedsSynthetic1() {
-
+
runConformTest(
new String[] {
"p2/Team0a10tfns1_2.java",
@@ -1802,7 +1802,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// a team field accessed from its role across packages needs a synthetic accessor - basic type
// 0.a.10-otjld-team-field-needs-synthetic-2
public void test0a10_teamFieldNeedsSynthetic2() {
-
+
runConformTest(
new String[] {
"p2/Team0a10tfns2_2.java",
@@ -1841,7 +1841,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// a team field accessed from its role across packages needs a synthetic accessor - qualified outer access
// 0.a.10-otjld-team-field-needs-synthetic-3
public void test0a10_teamFieldNeedsSynthetic3() {
-
+
runConformTest(
new String[] {
"p2/Team0a10tfns3_2.java",
@@ -1880,7 +1880,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// a team field accessed from its role across packages needs a synthetic accessor - qualified field access
// 0.a.10-otjld-team-field-needs-synthetic-4
public void test0a10_teamFieldNeedsSynthetic4() {
-
+
runConformTest(
new String[] {
"p2/Team0a10tfns4_2.java",
@@ -1923,7 +1923,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// a team field accessed from its role across packages needs a synthetic accessor - broken Outer.this in field initializer
// 0.a.10-otjld-team-field-needs-synthetic-5
public void test0a10_teamFieldNeedsSynthetic5() {
-
+
runConformTest(
new String[] {
"p2/Team0a10tfns5_2.java",
@@ -1963,7 +1963,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// a team method accessed from its role across packages needs a synthetic accessor - role type
// 0.a.11-otjld-team-method-needs-synthetic-1
public void test0a11_teamMethodNeedsSynthetic1() {
-
+
runConformTest(
new String[] {
"p2/Team0a11tmns1_2.java",
@@ -2002,7 +2002,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// a role accesses a friendly field of its team, team inheritance crosses packages
// 0.a.12-otjld-role-accessing-team-field-1
public void test0a12_roleAccessingTeamField1() {
-
+
runConformTest(
new String[] {
"p2/Team0a12ratf1_2.java",
@@ -2037,7 +2037,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// a role accesses a protected field of its team, team inheritance crosses packages
// 0.a.12-otjld-role-accessing-team-field-2
public void test0a12_roleAccessingTeamField2() {
-
+
runConformTest(
new String[] {
"p2/Team0a12ratf2_2.java",
@@ -2072,7 +2072,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// a local class accesses a private feature of its enclosing role
// 0.a.13-otjld-private-role-method-accessed-1
public void test0a13_privateRoleMethodAccessed1() {
-
+
runConformTest(
new String[] {
"Team0a13prma1.java",
@@ -2106,7 +2106,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// a private role method is callin bound
// 0.a.13-otjld-private-role-method-accessed-2
public void test0a13_privateRoleMethodAccessed2() {
-
+
runConformTest(
new String[] {
"Team0a13prma2.java",
@@ -2206,7 +2206,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// a public role advertizes a protected role in a public method
// 0.a.15-otjld-advertize-protected-role-1a
public void test0a15_advertizeProtectedRole1a() {
-
+
runConformTest(
new String[] {
"T0a15apr1aMain.java",
@@ -2239,7 +2239,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// a public role advertizes a protected role in a protected method - witness also for bug re non-final anchor
// 0.a.15-otjld-advertize-protected-role-2
public void test0a15_advertizeProtectedRole2() {
-
+
runConformTest(
new String[] {
"Team0a15apr2.java",
@@ -2269,7 +2269,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// a protected role advertizes a protected role in a public method
// 0.a.15-otjld-advertize-protected-role-3
public void test0a15_advertizeProtectedRole3() {
-
+
runConformTest(
new String[] {
"Team0a15apr3.java",
@@ -2299,7 +2299,7 @@ public class AccessModifiers extends AbstractOTJLDTest {
// a role overrides a static method from its tsuper
// 0.a.16-otjld_unsupported_static-role-method-1
public void _unsupported_test0a16_staticRoleMethod1() {
-
+
runConformTest(
new String[] {
"Team0a16srm1_2.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Exceptions.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Exceptions.java
index 0829c6b47..a95c90c04 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Exceptions.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Exceptions.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -28,11 +28,11 @@ import junit.framework.Test;
@SuppressWarnings("unchecked")
public class Exceptions extends AbstractOTJLDTest {
-
+
public Exceptions(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -40,7 +40,7 @@ public class Exceptions extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -111,7 +111,7 @@ public class Exceptions extends AbstractOTJLDTest {
// a callout binding redeclares all exceptions that its base method declares
// 7.5.2-otjld-callout-redeclares-all-base-exceptions-1
public void test752_calloutRedeclaresAllBaseExceptions1() {
-
+
runConformTest(
new String[] {
"T752crabe1Main.java",
@@ -157,7 +157,7 @@ public class Exceptions extends AbstractOTJLDTest {
// a callout binding redeclares all exceptions needing declaration of what its base method declares
// 7.5.2-otjld-callout-redeclares-all-base-exceptions-2
public void test752_calloutRedeclaresAllBaseExceptions2() {
-
+
runConformTest(
new String[] {
"T752crabe2Main.java",
@@ -208,7 +208,7 @@ public class Exceptions extends AbstractOTJLDTest {
// a shorthand callout binding implicitly declares all exceptions needing declaration of what its base method declares
// 7.5.2-otjld-callout-redeclares-all-base-exceptions-3
public void test752_calloutRedeclaresAllBaseExceptions3() {
-
+
runConformTest(
new String[] {
"T752crabe3Main.java",
@@ -286,7 +286,7 @@ public class Exceptions extends AbstractOTJLDTest {
public void test752_calloutRedeclaresAllBaseExceptions5() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportInferredCallout, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"T752crabe5Main.java",
@@ -383,7 +383,7 @@ public class Exceptions extends AbstractOTJLDTest {
// a callout binding redeclares all exceptions that its base method declares, plus additional ones
// 7.5.3-otjld-callout-declares-additional-exceptions-1
public void test753_calloutDeclaresAdditionalExceptions1() {
-
+
runConformTest(
new String[] {
"T753cdae1Main.java",
@@ -434,7 +434,7 @@ public class Exceptions extends AbstractOTJLDTest {
// a callout binding redeclares all exceptions that its base method declares, plus additional ones
// 7.5.3-otjld-callout-declares-additional-exceptions-2
public void test753_calloutDeclaresAdditionalExceptions2() {
-
+
runConformTest(
new String[] {
"T753cdae2Main.java",
@@ -510,7 +510,7 @@ public class Exceptions extends AbstractOTJLDTest {
// a callin binding redeclares some but not all exceptions that its base method declares
// 7.5.5-otjld-callin-redeclares-some-base-exceptions-1
public void test755_callinRedeclaresSomeBaseExceptions1() {
-
+
runConformTest(
new String[] {
"T755crsbe1Main.java",
@@ -559,7 +559,7 @@ public class Exceptions extends AbstractOTJLDTest {
// a callin binding redeclares some but not all exceptions that its base method declares
// 7.5.5-otjld-callin-redeclares-some-base-exceptions-2
public void test755_callinRedeclaresSomeBaseExceptions2() {
-
+
runConformTest(
new String[] {
"T755crsbe2Main.java",
@@ -610,7 +610,7 @@ public class Exceptions extends AbstractOTJLDTest {
// a callin binding redeclares all exceptions that its base method declares
// 7.5.6-otjld-callin-redeclares-all-base-exceptions-1
public void test756_callinRedeclaresAllBaseExceptions1() {
-
+
runConformTest(
new String[] {
"T756crabe1Main.java",
@@ -664,7 +664,7 @@ public class Exceptions extends AbstractOTJLDTest {
// a callin binding redeclares all exceptions that its base method declares
// 7.5.6-otjld-callin-redeclares-all-base-exceptions-2
public void test756_callinRedeclaresAllBaseExceptions2() {
-
+
runConformTest(
new String[] {
"T756crabe2Main.java",
@@ -837,7 +837,7 @@ public class Exceptions extends AbstractOTJLDTest {
// a callin binding catches an exception thrown by its base-call
// 7.5.8-otjld-callin-declares-other-exceptions-3
public void test758_callinDeclaresOtherExceptions3() {
-
+
runConformTest(
new String[] {
"Team758cdoe3.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Java5.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Java5.java
index 36944a43f..5c98b17da 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Java5.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Java5.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010, 2014 Stephan Herrmann
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -29,13 +29,13 @@ import junit.framework.Test;
@SuppressWarnings("unchecked")
public class Java5 extends AbstractOTJLDTest {
-
+
private String VALUE_IS;
public Java5(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -43,7 +43,7 @@ public class Java5 extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -61,7 +61,7 @@ public class Java5 extends AbstractOTJLDTest {
// a base field has a generic type and is bound via callout
// A.1.1-otjld-generic-feature-in-base-1
public void testA11_genericFeatureInBase1() {
-
+
runConformTest(
new String[] {
"TeamA11gfib1.java",
@@ -101,7 +101,7 @@ public class Java5 extends AbstractOTJLDTest {
// a base field has a generic type and is bound via callout
// A.1.1-otjld-generic-feature-in-base-2
public void testA11_genericFeatureInBase2() {
-
+
runConformTest(
new String[] {
"TeamA11gfib2.java",
@@ -145,7 +145,7 @@ public class Java5 extends AbstractOTJLDTest {
// a base has a parameterized method which is bound via callout
// A.1.1-otjld-generic-feature-in-base-3
public void testA11_genericFeatureInBase3() {
-
+
runConformTest(
new String[] {
"TeamA11gfib3.java",
@@ -179,7 +179,7 @@ public class Java5 extends AbstractOTJLDTest {
// a base has a parameterized method which is bound via callout with substitution
// A.1.1-otjld-generic-feature-in-base-3s
public void testA11_genericFeatureInBase3s() {
-
+
runConformTest(
new String[] {
"TeamA11gfib3s.java",
@@ -213,7 +213,7 @@ public class Java5 extends AbstractOTJLDTest {
// a base has a parameterized method which is bound via callin
// A.1.1-otjld-generic-feature-in-base-3ci
public void testA11_genericFeatureInBase3ci() {
-
+
runConformTest(
new String[] {
"TeamA11gfib3ci.java",
@@ -245,7 +245,7 @@ public class Java5 extends AbstractOTJLDTest {
// a base has a parameterized method with type bound which is bound via callin
// A.1.1-otjld-generic-feature-in-base-3cib
public void testA11_genericFeatureInBase3cib() {
-
+
runConformTest(
new String[] {
"TeamA11gfib3cib.java",
@@ -277,7 +277,7 @@ public class Java5 extends AbstractOTJLDTest {
// a base has a parameterized method with type bound which is bound via callin - compatible type variable declaration
// A.1.1-otjld-generic-feature-in-base-3cib2
public void testA11_genericFeatureInBase3cib2() {
-
+
runConformTest(
new String[] {
"TeamA11gfib3cib2.java",
@@ -335,18 +335,18 @@ public class Java5 extends AbstractOTJLDTest {
" \n"
},
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "----------\n" +
- "1. ERROR in TeamA11gfib3cib3.java (at line 4)\n" +
- " <T> T getIt(T it) <- replace T getIt(T it);\n" +
- " ^^^^^\n" +
- "Bound mismatch: The generic method getIt(T) of type TeamA11gfib3cib3.R is not applicable for the arguments (T). The inferred type T is not a valid substitute for the bounded parameter <T extends Number>\n" +
+ "----------\n" +
+ "1. ERROR in TeamA11gfib3cib3.java (at line 4)\n" +
+ " <T> T getIt(T it) <- replace T getIt(T it);\n" +
+ " ^^^^^\n" +
+ "Bound mismatch: The generic method getIt(T) of type TeamA11gfib3cib3.R is not applicable for the arguments (T). The inferred type T is not a valid substitute for the bounded parameter <T extends Number>\n" +
"----------\n"
:
- "----------\n" +
- "1. ERROR in TeamA11gfib3cib3.java (at line 4)\n" +
- " <T> T getIt(T it) <- replace T getIt(T it);\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "No method getIt(T) found in type TeamA11gfib3cib3.R to resolve method designator (OTJLD 4.1(c)).\n" +
+ "----------\n" +
+ "1. ERROR in TeamA11gfib3cib3.java (at line 4)\n" +
+ " <T> T getIt(T it) <- replace T getIt(T it);\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "No method getIt(T) found in type TeamA11gfib3cib3.R to resolve method designator (OTJLD 4.1(c)).\n" +
"----------\n"));
}
@@ -406,7 +406,7 @@ public class Java5 extends AbstractOTJLDTest {
// a base has a parameterized method, type variable used as type argument - which is bound via callin
public void testA11_genericFeatureInBase3cih() {
-
+
runConformTest(
new String[] {
"TeamA11gfib3ci.java",
@@ -438,7 +438,7 @@ public class Java5 extends AbstractOTJLDTest {
// a base has a parameterized method, base's type parameter omitted - which is bound via callin
public void testA11_genericFeatureInBase3cii() {
-
+
runNegativeTest(
new String[] {
"TeamA11gfib3ci.java",
@@ -465,22 +465,22 @@ public class Java5 extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. WARNING in TeamA11gfib3ci.java (at line 4)\n" +
- " <T> T getIt(Object it, Class<T> c) <- replace T getIt(Object it, Class c)\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in TeamA11gfib3ci.java (at line 4)\n" +
- " <T> T getIt(Object it, Class<T> c) <- replace T getIt(Object it, Class c)\n" +
- " ^^^^^\n" +
- "Method specifier finds no direct match, argument of closest match is Class<Object> instead of Class (OTJLD 4.1(c)).\n" +
+ "----------\n" +
+ "1. WARNING in TeamA11gfib3ci.java (at line 4)\n" +
+ " <T> T getIt(Object it, Class<T> c) <- replace T getIt(Object it, Class c)\n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in TeamA11gfib3ci.java (at line 4)\n" +
+ " <T> T getIt(Object it, Class<T> c) <- replace T getIt(Object it, Class c)\n" +
+ " ^^^^^\n" +
+ "Method specifier finds no direct match, argument of closest match is Class<Object> instead of Class (OTJLD 4.1(c)).\n" +
"----------\n");
}
// a base has a parameterized method, base's type parameter erased to Object - which is bound via callin
public void testA11_genericFeatureInBase3cij() {
-
+
runNegativeTest(
new String[] {
"TeamA11gfib3ci.java",
@@ -507,17 +507,17 @@ public class Java5 extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in TeamA11gfib3ci.java (at line 4)\n" +
- " <T> T getIt(Object it, Class<T> c) <- replace T getIt(Object it, Class<Object> c)\n" +
- " ^\n" +
- "When mapping the 2. argument of getIt(Object, Class): cannot convert from java.lang.Class<java.lang.Object> to java.lang.Class<T> (OTJLD 4.5(d)).\n" +
+ "----------\n" +
+ "1. ERROR in TeamA11gfib3ci.java (at line 4)\n" +
+ " <T> T getIt(Object it, Class<T> c) <- replace T getIt(Object it, Class<Object> c)\n" +
+ " ^\n" +
+ "When mapping the 2. argument of getIt(Object, Class): cannot convert from java.lang.Class<java.lang.Object> to java.lang.Class<T> (OTJLD 4.5(d)).\n" +
"----------\n");
}
// a base has a parameterized method, type variable used as type argument - which is bound via callin with parameter mapping
public void _testA11_genericFeatureInBase3cik() {
-
+
runConformTest(
new String[] {
"TeamA11gfib3ci.java",
@@ -555,7 +555,7 @@ public class Java5 extends AbstractOTJLDTest {
// a base has a parameterized method which is bound via callout
// A.1.1-otjld-generic-feature-in-base-4
public void testA11_genericFeatureInBase4() {
-
+
runConformTest(
new String[] {
"TeamA11gfib4.java",
@@ -604,7 +604,7 @@ public class Java5 extends AbstractOTJLDTest {
// mimiced after a variation of the DeclarationImplAdaptor suggested to svenk
// A.1.1-otjld-generic-feature-in-base-5
public void testA11_genericFeatureInBase5() {
-
+
runConformTest(
new String[] {
"TeamA11gfib5.java",
@@ -657,7 +657,7 @@ public class Java5 extends AbstractOTJLDTest {
// a role method has a generic parameter and is bound via callout
// A.1.2-otjld-generic-role-feature-1
public void testA12_genericRoleFeature1() {
-
+
runConformTest(
new String[] {
"TeamA12grf1.java",
@@ -698,7 +698,7 @@ public class Java5 extends AbstractOTJLDTest {
// a role method has a generic parameter and is bound via callout - lowering required
// A.1.2-otjld-generic-role-feature-2
public void testA12_genericRoleFeature2() {
-
+
runConformTest(
new String[] {
"TeamA12grf2.java",
@@ -740,7 +740,7 @@ public class Java5 extends AbstractOTJLDTest {
// a team has a parameterized collection of bases, lowering required
// A.1.2-otjld-generic-role-feature-2a
public void testA12_genericRoleFeature2a() {
-
+
runConformTest(
new String[] {
"TeamA12grf2a.java",
@@ -775,7 +775,7 @@ public class Java5 extends AbstractOTJLDTest {
// a team has a parameterized collection of bases, lowering ambiguous
// A.1.2-otjld-generic-role-feature-2w
public void testA12_genericRoleFeature2w() {
-
+
runConformTest(
new String[] {
"TeamA12grf2w.java",
@@ -809,7 +809,7 @@ public class Java5 extends AbstractOTJLDTest {
// a team has a parameterized collection of bases, lowering ambiguous
// A.1.2-otjld-generic-role-feature-2w2
public void testA12_genericRoleFeature2w2() {
-
+
runConformTest(
new String[] {
"TeamA12grf2w2.java",
@@ -844,7 +844,7 @@ public class Java5 extends AbstractOTJLDTest {
// a base method has a generic parameter and is bound via callin
// A.1.2-otjld-generic-role-feature-3
public void testA12_genericRoleFeature3() {
-
+
runConformTest(
new String[] {
"TeamA12grf3.java",
@@ -886,7 +886,7 @@ public class Java5 extends AbstractOTJLDTest {
// a role method has a generic parameter and is bound via callin - lifting required
// A.1.2-otjld-generic-role-feature-4
public void testA12_genericRoleFeature4() {
-
+
runConformTest(
new String[] {
"TeamA12grf4.java",
@@ -931,7 +931,7 @@ public class Java5 extends AbstractOTJLDTest {
// a role is used as type parameter, implicit inheritance involved
// A.1.2-otjld-generic-role-feature-6
public void testA12_genericRoleFeature6() {
-
+
runConformTest(
new String[] {
"TeamA12grf6_2.java",
@@ -973,7 +973,7 @@ public class Java5 extends AbstractOTJLDTest {
// a role is used as type parameter, implicit inheritance involved - class LinkedList vs. interface List
// A.1.2-otjld-generic-role-feature-7
public void testA12_genericRoleFeature7() {
-
+
runConformTest(
new String[] {
"TeamA12grf7_2.java",
@@ -1015,7 +1015,7 @@ public class Java5 extends AbstractOTJLDTest {
// a role is used as type parameter, implicit inheritance involved - used in return statement
// A.1.2-otjld-generic-role-feature-8
public void testA12_genericRoleFeature8() {
-
+
runConformTest(
new String[] {
"TeamA12grf8_2.java",
@@ -1060,7 +1060,7 @@ public class Java5 extends AbstractOTJLDTest {
// a role is used as type parameter, implicit inheritance involved - used within abstract role
// A.1.2-otjld-generic-role-feature-9
public void testA12_genericRoleFeature9() {
-
+
runConformTest(
new String[] {
"TeamA12grf9_2.java",
@@ -1123,23 +1123,23 @@ public class Java5 extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. WARNING in TeamA12grf10.java (at line 9)\n" +
- " callin List ci() { return base.ci(); }\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in TeamA12grf10.java (at line 9)\n" +
- " callin List ci() { return base.ci(); }\n" +
- " ^^^^\n" +
- "Type safety: The return type List for ci() from the type TeamA12grf10.R2 needs unchecked conversion to conform to List<String> from the type TeamA12grf10.R1\n" +
+ "----------\n" +
+ "1. WARNING in TeamA12grf10.java (at line 9)\n" +
+ " callin List ci() { return base.ci(); }\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in TeamA12grf10.java (at line 9)\n" +
+ " callin List ci() { return base.ci(); }\n" +
+ " ^^^^\n" +
+ "Type safety: The return type List for ci() from the type TeamA12grf10.R2 needs unchecked conversion to conform to List<String> from the type TeamA12grf10.R1\n" +
"----------\n");
}
// a role method has a return type with wildcard - reported by Olaf Otto
// A.1.2-otjld-generic-role-feature-11
public void testA12_genericRoleFeature11() {
-
+
runConformTest(
new String[] {
"TeamA12grf11.java",
@@ -1170,7 +1170,7 @@ public class Java5 extends AbstractOTJLDTest {
// an externalized role is used as a type argument
// A.1.2-otjld-generic-role-feature-12
public void testA12_genericRoleFeature12() {
-
+
runConformTest(
new String[] {
"TA12grf12Main.java",
@@ -1553,10 +1553,10 @@ public class Java5 extends AbstractOTJLDTest {
" protected String test(String u){ return u;}" +
"}\n"
},
- "----------\n" +
- "1. ERROR in TeamA12grf16f_2.java (at line 4)\n" +
- " test <- before test;\n" +
- " ^^^^\n" +
+ "----------\n" +
+ "1. ERROR in TeamA12grf16f_2.java (at line 4)\n" +
+ " test <- before test;\n" +
+ " ^^^^\n" +
(this.weavingScheme == WeavingScheme.OTRE
? "Type mismatch: cannot convert from String to U\n"
: "The method test(U) in the type TeamA12grf16f_2<U>.R is not applicable for the arguments (String)\n"
@@ -1669,7 +1669,7 @@ public class Java5 extends AbstractOTJLDTest {
// a parameter of a callout binding requires autoboxing - explicit mapping
// A.1.3-otjld-autoboxing-in-method-mapping-1
public void testA13_autoboxingInMethodMapping1() {
-
+
runConformTest(
new String[] {
"TeamA13aimm1.java",
@@ -1703,7 +1703,7 @@ public class Java5 extends AbstractOTJLDTest {
// a parameter of a callout binding requires autoboxing - implicit mapping
// A.1.3-otjld-autoboxing-in-method-mapping-2
public void testA13_autoboxingInMethodMapping2() {
-
+
runConformTest(
new String[] {
"TeamA13aimm2.java",
@@ -1736,7 +1736,7 @@ public class Java5 extends AbstractOTJLDTest {
// a parameter of a callout binding requires autounboxing - explicit mapping
// A.1.3-otjld-autoboxing-in-method-mapping-3
public void testA13_autoboxingInMethodMapping3() {
-
+
runConformTest(
new String[] {
"TeamA13aimm3.java",
@@ -1770,7 +1770,7 @@ public class Java5 extends AbstractOTJLDTest {
// a parameter of a callout binding requires autounboxing - implicit mapping
// A.1.3-otjld-autoboxing-in-method-mapping-4
public void testA13_autoboxingInMethodMapping4() {
-
+
runConformTest(
new String[] {
"TeamA13aimm4.java",
@@ -1803,7 +1803,7 @@ public class Java5 extends AbstractOTJLDTest {
// a parameter of a callout binding requires autounboxing - explicit mapping - lifting direction
// A.1.3-otjld-autoboxing-in-method-mapping-5
public void testA13_autoboxingInMethodMapping5() {
-
+
runConformTest(
new String[] {
"TeamA13aimm5.java",
@@ -1837,7 +1837,7 @@ public class Java5 extends AbstractOTJLDTest {
// a parameter of a callout binding requires autounboxing - implicit mapping - lifting direction
// A.1.3-otjld-autoboxing-in-method-mapping-6
public void testA13_autoboxingInMethodMapping6() {
-
+
runConformTest(
new String[] {
"TeamA13aimm6.java",
@@ -1870,7 +1870,7 @@ public class Java5 extends AbstractOTJLDTest {
// the return of a callin binding requires unboxing - implicit mapping
// A.1.3-otjld-autoboxing-in-method-mapping-7
public void testA13_autoboxingInMethodMapping7() {
-
+
runConformTest(
new String[] {
"TeamA13aimm7.java",
@@ -1906,7 +1906,7 @@ public class Java5 extends AbstractOTJLDTest {
// the return of a callin binding requires autounboxing - implicit mapping
// A.1.3-otjld-autoboxing-in-method-mapping-8
public void testA13_autoboxingInMethodMapping8() {
-
+
runConformTest(
new String[] {
"TeamA13aimm8.java",
@@ -1942,7 +1942,7 @@ public class Java5 extends AbstractOTJLDTest {
// the argument of a callin binding requires autoboxing - implicit mapping - signature less binding
// A.1.3-otjld-autoboxing-in-method-mapping-9
public void testA13_autoboxingInMethodMapping9() {
-
+
runConformTest(
new String[] {
"TeamA13aimm9.java",
@@ -1979,7 +1979,7 @@ public class Java5 extends AbstractOTJLDTest {
// the argument of a callin binding requires autoboxing - callin unbound at site of decleration
// A.1.3-otjld-autoboxing-in-method-mapping-10
public void testA13_autoboxingInMethodMapping10() {
-
+
runConformTest(
new String[] {
"TeamA13aimm10.java",
@@ -2018,7 +2018,7 @@ public class Java5 extends AbstractOTJLDTest {
// reported by Dehla, see TPX-468
// A.1.4-otjld-autounboxing-in-method-mapping-1
public void testA14_autounboxingInMethodMapping1() {
-
+
runConformTest(
new String[] {
"TeamA14aimm1.java",
@@ -2077,7 +2077,7 @@ public class Java5 extends AbstractOTJLDTest {
// a role class literal is used in a static role method
// A.1.5-otjld-role-class-literal-2
public void testA15_roleClassLiteral2() {
-
+
runConformTest(
new String[] {
"TeamA15rcl2.java",
@@ -2118,10 +2118,10 @@ public class Java5 extends AbstractOTJLDTest {
"1.2.4(c)");
}
- //
+ //
// A.1.5-otjld-role-class-literal-4
public void testA15_roleClassLiteral4() {
-
+
runConformTest(
new String[] {
"TeamA15rcl4_2.java",
@@ -2157,7 +2157,7 @@ public class Java5 extends AbstractOTJLDTest {
// an invisible type is mentioned as a type parameter in a callout RHS
// A.1.6-otjld-decapsulation-for-type-parameter-1
public void testA16_decapsulationForTypeParameter1() {
-
+
runConformTest(
new String[] {
"TeamA16dftp1.java",
@@ -2203,7 +2203,7 @@ public class Java5 extends AbstractOTJLDTest {
// a role is played by the raw type of a generic base class
// A.1.7-otjld-generic-baseclass-1
public void testA17_genericBaseclass1() {
-
+
runConformTest(
new String[] {
"TeamA17gb1.java",
@@ -2270,7 +2270,7 @@ public class Java5 extends AbstractOTJLDTest {
// a parameterized role is played by a parameterized base class
// A.1.7-otjld-generic-baseclass-3
public void testA17_genericBaseclass3() {
-
+
runConformTest(
new String[] {
"TeamA17gb3.java",
@@ -2308,7 +2308,7 @@ public class Java5 extends AbstractOTJLDTest {
// a generic list is modified from its role
// A.1.7-otjld-generic-baseclass-4
public void testA17_genericBaseclass4() {
-
+
runConformTest(
new String[] {
"TA17gb4Main.java",
@@ -2354,7 +2354,7 @@ public class Java5 extends AbstractOTJLDTest {
// a generic list is modified from its role
// A.1.7-otjld-generic-baseclass-5
public void testA17_genericBaseclass5() {
-
+
runConformTest(
new String[] {
"TA17gb5Main.java",
@@ -2406,7 +2406,7 @@ public class Java5 extends AbstractOTJLDTest {
// a generic list is modified from its role - iterate over role/base as an Iterable
// A.1.7-otjld-generic-baseclass-6
public void testA17_genericBaseclass6() {
-
+
runConformTest(
new String[] {
"TA17gb6Main.java",
@@ -2458,7 +2458,7 @@ public class Java5 extends AbstractOTJLDTest {
// a callout binding has a type parameter whereas its super-role-method uses the raw type
// A.1.8-otjld-callout-redefines-inherited-1
public void testA18_calloutRedefinesInherited1() {
-
+
runConformTest(
new String[] {
"TeamA18cri1.java",
@@ -2500,7 +2500,7 @@ public class Java5 extends AbstractOTJLDTest {
// a callout binding covariantly redefines the return type of the abstract bound role method
// A.1.8-otjld-callout-redefines-inherited-2
public void testA18_calloutRedefinesInherited2() {
-
+
runConformTest(
new String[] {
"TeamA18cri2.java",
@@ -2535,7 +2535,7 @@ public class Java5 extends AbstractOTJLDTest {
// a callin method has a generic argument
// A.1.8-otjld-callin-method-with-generic-1
public void testA18_callinMethodWithGeneric1() {
-
+
runConformTest(
new String[] {
"TA18cmwg1Main.java",
@@ -2580,7 +2580,7 @@ public class Java5 extends AbstractOTJLDTest {
// a method has a type parameter constrained by "base"
// A.1.9-otjld-basetype-parameter-1
public void testA19_basetypeParameter1() {
-
+
runConformTest(
new String[] {
"TeamA19bp1.java",
@@ -2676,11 +2676,11 @@ public class Java5 extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in TeamA19bp3.java (at line 12)\n" +
- " public <B base Role0> void test(B as Role0 o) {\n" +
- " ^^^^^^^^^^\n" +
- "Unhandled exception type LiftingFailedException, caused by an unsafe lifting request (OTJLD 2.3.5).\n" +
+ "----------\n" +
+ "1. ERROR in TeamA19bp3.java (at line 12)\n" +
+ " public <B base Role0> void test(B as Role0 o) {\n" +
+ " ^^^^^^^^^^\n" +
+ "Unhandled exception type LiftingFailedException, caused by an unsafe lifting request (OTJLD 2.3.5).\n" +
"----------\n");
}
@@ -2718,11 +2718,11 @@ public class Java5 extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in TeamA19bp3a.java (at line 16)\n" +
- " test(b);\n" +
- " ^^^^^^^\n" +
- "Unhandled exception type LiftingFailedException\n" +
+ "----------\n" +
+ "1. ERROR in TeamA19bp3a.java (at line 16)\n" +
+ " test(b);\n" +
+ " ^^^^^^^\n" +
+ "Unhandled exception type LiftingFailedException\n" +
"----------\n");
}
@@ -2769,18 +2769,18 @@ public class Java5 extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in TeamA19bp4.java (at line 17)\n" +
- " t.test(new TA19bp4_2());\n" +
- " ^^^^\n" +
- "Bound mismatch: The generic method test(B) of type TeamA19bp4 is not applicable for the arguments (TA19bp4_2). The inferred type TA19bp4_2 is not a valid substitute for the bounded parameter <B base TeamA19bp4.Role0> (OTJLD 2.3.2(e)).\n" +
+ "----------\n" +
+ "1. ERROR in TeamA19bp4.java (at line 17)\n" +
+ " t.test(new TA19bp4_2());\n" +
+ " ^^^^\n" +
+ "Bound mismatch: The generic method test(B) of type TeamA19bp4 is not applicable for the arguments (TA19bp4_2). The inferred type TA19bp4_2 is not a valid substitute for the bounded parameter <B base TeamA19bp4.Role0> (OTJLD 2.3.2(e)).\n" +
"----------\n");
}
// a method has a type parameter constrained by "base" - nested team
// A.1.9-otjld-basetype-parameter-5
public void testA19_basetypeParameter5() {
-
+
runConformTest(
new String[] {
"TeamA19bp5.java",
@@ -2832,7 +2832,7 @@ public class Java5 extends AbstractOTJLDTest {
// a method has a type parameter constrained by "base" - some inheritance used
// A.1.9-otjld-basetype-parameter-6
public void testA19_basetypeParameter6() {
-
+
runConformTest(
new String[] {
"TeamA19bp6.java",
@@ -2893,7 +2893,7 @@ public class Java5 extends AbstractOTJLDTest {
// a method has a type parameter constrained by "base" , using the type variable
// A.1.9-otjld-basetype-parameter-7
public void testA19_basetypeParameter7() {
-
+
runConformTest(
new String[] {
"TeamA19bp7.java",
@@ -2953,7 +2953,7 @@ public class Java5 extends AbstractOTJLDTest {
// a method has a type parameter constrained by "base" - deferred lifting
// A.1.9-otjld-basetype-parameter-8
public void testA19_basetypeParameter8() {
-
+
runConformTest(
new String[] {
"TeamA19bp8.java",
@@ -3006,7 +3006,7 @@ public class Java5 extends AbstractOTJLDTest {
// a method has a type parameter constrained by "base" - team inheritance involved
// A.1.9-otjld-basetype-parameter-9
public void testA19_basetypeParameter9() {
-
+
runConformTest(
new String[] {
"TeamA19bp9_2.java",
@@ -3053,7 +3053,7 @@ public class Java5 extends AbstractOTJLDTest {
// a method has two type parameters constrained by "base"
// A.1.9-otjld-basetype-parameter-10
public void testA19_basetypeParameter10() {
-
+
runConformTest(
new String[] {
"TeamA19bp10.java",
@@ -3134,7 +3134,7 @@ public class Java5 extends AbstractOTJLDTest {
// methods are consistently redefined with covariant return type
// A.1.10-otjld-covariance-and-implicit-inheritance-2
public void testA110_covarianceAndImplicitInheritance2() {
-
+
runConformTest(
new String[] {
"TeamA110caii2_2.java",
@@ -3182,7 +3182,7 @@ public class Java5 extends AbstractOTJLDTest {
// a callin method is covariantly overridden
// A.1.11-otjld-covariance-1
public void testA111_covariance1() {
-
+
runConformTest(
new String[] {
"TeamA111c1.java",
@@ -3218,7 +3218,7 @@ public class Java5 extends AbstractOTJLDTest {
// a team has a type parameter
// A.1.12-otjld-generic-team-1
public void testA112_genericTeam1() {
-
+
runConformTest(
new String[] {
"TeamA112gt1.java",
@@ -3238,7 +3238,7 @@ public class Java5 extends AbstractOTJLDTest {
}
// a team has a type parameter that is used in a static role method
public void testA112_genericTeam2() {
-
+
runConformTest(
new String[] {
"TeamA112gt2.java",
@@ -3261,7 +3261,7 @@ public class Java5 extends AbstractOTJLDTest {
},
"OK");
}
-
+
// Bug 332795 - [compiler][generics] import issues with inherited playedBy binding inside parameterized team
// Bug 335774 - [compiler] don't flag "bindingconventions" against import in superteam
public void testA112_genericTeam3() {
@@ -3289,30 +3289,30 @@ public class Java5 extends AbstractOTJLDTest {
"package mypack;\n" +
"public class B1 {}\n"
},
- "----------\n" +
- "1. WARNING in TeamA112gt3_1.java (at line 3)\n" +
- " protected class R playedBy B1 {\n" +
- " ^^\n" +
- "It is recommended that base class B1 be imported with the modifier \"base\" (OTJLD 2.1.2(d)).\n" +
+ "----------\n" +
+ "1. WARNING in TeamA112gt3_1.java (at line 3)\n" +
+ " protected class R playedBy B1 {\n" +
+ " ^^\n" +
+ "It is recommended that base class B1 be imported with the modifier \"base\" (OTJLD 2.1.2(d)).\n" +
"----------\n",
"OK");
}
-
- // Bug 394263 - Team with generic type parameter causes role inheritance error
+
+ // Bug 394263 - Team with generic type parameter causes role inheritance error
public void testA112_genericTeam4() {
runConformTest(
new String[] {
"MyTeam.java",
- "public team class MyTeam<T> { \n" +
- " protected class MyRole {} \n" +
- " protected class MySubRole extends MyRole {}\n" +
+ "public team class MyTeam<T> { \n" +
+ " protected class MyRole {} \n" +
+ " protected class MySubRole extends MyRole {}\n" +
"}"
}
);
}
// a static method in a role file suppresses an nls warning
- // Bug 321352 - [compiler][reconciler] reporting of non-externalized string constants in role files
+ // Bug 321352 - [compiler][reconciler] reporting of non-externalized string constants in role files
public void testA113_suppressWarnings1() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
@@ -3343,7 +3343,7 @@ public class Java5 extends AbstractOTJLDTest {
}
// a static method in a role file reports an nls warning
- // Bug 321352 - [compiler][reconciler] reporting of non-externalized string constants in role files
+ // Bug 321352 - [compiler][reconciler] reporting of non-externalized string constants in role files
public void testA113_suppressWarnings1w() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
@@ -3407,7 +3407,7 @@ public class Java5 extends AbstractOTJLDTest {
// A role class is generic - ICE reported by Ivica Loncar
// A.1.14-otjld-generic-role-1
public void testA114_genericRole1() {
-
+
runConformTest(
new String[] {
"TeamA114gr1.java",
@@ -3467,7 +3467,7 @@ public class Java5 extends AbstractOTJLDTest {
// A bound role class is generic - created using declared lifting
// A.1.14-otjld_illegal_generic-role-3
public void _illegal_testA114_genericRole3() {
-
+
runConformTest(
new String[] {
"TeamA114gr3.java",
@@ -3499,7 +3499,7 @@ public class Java5 extends AbstractOTJLDTest {
// a generic role is a parameter in a replace callin - modeled after a situation in OrderSystemPersistenceTeam
// A.1.14-otjld-generic-role-4
public void testA114_genericRole4() {
-
+
runConformTest(
new String[] {
"TeamA114gr4.java",
@@ -3542,7 +3542,7 @@ public class Java5 extends AbstractOTJLDTest {
// a generic role is a parameter in a replace callin - modeled after a situation in OrderSystemPersistenceTeam - more difficult type inference
// A.1.14-otjld-generic-role-5
public void testA114_genericRole5() {
-
+
runConformTest(
new String[] {
"TeamA114gr5.java",
@@ -3590,7 +3590,7 @@ public class Java5 extends AbstractOTJLDTest {
// a generic role is a parameter in a replace callin - modeled after a situation in OrderSystemPersistenceTeam - more difficult type inference
// A.1.14-otjld-generic-role-6
public void testA114_genericRole6() {
-
+
runConformTest(
new String[] {
"TeamA114gr6.java",
@@ -3636,23 +3636,23 @@ public class Java5 extends AbstractOTJLDTest {
},
"OK");
}
-
+
// Bug 332801 - [compiler][generics] instantiating a generic role cannot be type-checked
public void testA114_genericRole7() {
runConformTest(
new String[] {
"Canonicalization.java",
- "public team class Canonicalization {\n" +
+ "public team class Canonicalization {\n" +
" protected class Cache<K,V> {\n" +
" protected V getV(K k, V v1, V v2) { return v1; }\n" +
- " }\n" +
+ " }\n" +
" Cache<Integer,String> stringCache = new Cache<Integer, String>();\n" +
" void test() {\n" +
" System.out.print(stringCache.getV(2, \"OK\", \"NOTOK\"));\n" +
- " }\n" +
+ " }\n" +
" public static void main(String... args) {\n" +
" new Canonicalization().test();\n" +
- " }\n" +
+ " }\n" +
"}\n"
},
"OK");
@@ -3661,7 +3661,7 @@ public class Java5 extends AbstractOTJLDTest {
// a decapsulating expression in a base guard requires a generic cast, witness for NPE since 3.4.2
// A.1.15-otjld-generic-cast-in-baseaccess-1
public void testA115_genericCastInBaseaccess1() {
-
+
runConformTest(
new String[] {
"TeamA115gcib1.java",
@@ -3700,7 +3700,7 @@ public class Java5 extends AbstractOTJLDTest {
// a decapsulating expression in a base guard requires a generic cast, witness for NPE since 3.4.2
// A.1.15-otjld-generic-cast-in-baseaccess-2
public void testA115_genericCastInBaseaccess2() {
-
+
runConformTest(
new String[] {
"TeamA115gcib2.java",
@@ -3744,7 +3744,7 @@ public class Java5 extends AbstractOTJLDTest {
// an overriding role has an override annotation
// A.1.16-otjld-override-annotation-1
public void testA116_overrideAnnotation1() {
-
+
runConformTest(
new String[] {
"TeamA116on1_2.java",
@@ -3799,7 +3799,7 @@ public class Java5 extends AbstractOTJLDTest {
public void testA116_overrideAnnotation3() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportMissingOverrideAnnotation, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"TeamA116on3_2.java",
@@ -3839,7 +3839,7 @@ public class Java5 extends AbstractOTJLDTest {
// Bug 381790 - [compiler] support @Override for role method implementing an interface method
// With @Override Annotations
- // R: role class implementing regular interface
+ // R: role class implementing regular interface
// R1: role class extending role class
// R2: role extending regular class
public void testA116_overrideAnnotation4() {
@@ -3868,11 +3868,11 @@ public class Java5 extends AbstractOTJLDTest {
};
if (this.complianceLevel == ClassFileConstants.JDK1_5)
runNegativeTest(sources,
- "----------\n" +
- "1. ERROR in TeamA117oi4.java (at line 3)\n" +
- " @Override public void bar() {}\n" +
- " ^^^^^\n" +
- "The method bar() of type TeamA117oi4.R must override a superclass method\n" +
+ "----------\n" +
+ "1. ERROR in TeamA117oi4.java (at line 3)\n" +
+ " @Override public void bar() {}\n" +
+ " ^^^^^\n" +
+ "The method bar() of type TeamA117oi4.R must override a superclass method\n" +
"----------\n");
else
runConformTest(sources, "");
@@ -3912,16 +3912,16 @@ public class Java5 extends AbstractOTJLDTest {
if (this.complianceLevel == ClassFileConstants.JDK1_5)
runNegativeTest(
sources,
- "----------\n" +
- "1. ERROR in TeamA117oi5.java (at line 6)\n" +
- " public void bar() {}\n" +
- " ^^^^^\n" +
- "The method bar() of type TeamA117oi5.R1 should be tagged with @Override since it actually overrides a superclass method\n" +
- "----------\n" +
- "2. ERROR in TeamA117oi5.java (at line 9)\n" +
- " public void foo() {}\n" +
- " ^^^^^\n" +
- "The method foo() of type TeamA117oi5.R2 should be tagged with @Override since it actually overrides a superclass method\n" +
+ "----------\n" +
+ "1. ERROR in TeamA117oi5.java (at line 6)\n" +
+ " public void bar() {}\n" +
+ " ^^^^^\n" +
+ "The method bar() of type TeamA117oi5.R1 should be tagged with @Override since it actually overrides a superclass method\n" +
+ "----------\n" +
+ "2. ERROR in TeamA117oi5.java (at line 9)\n" +
+ " public void foo() {}\n" +
+ " ^^^^^\n" +
+ "The method foo() of type TeamA117oi5.R2 should be tagged with @Override since it actually overrides a superclass method\n" +
"----------\n",
null,
true,
@@ -3929,21 +3929,21 @@ public class Java5 extends AbstractOTJLDTest {
else
runNegativeTest(
sources,
- "----------\n" +
- "1. ERROR in TeamA117oi5.java (at line 3)\n" +
- " public void bar() {}\n" +
- " ^^^^^\n" +
- "The method bar() of type TeamA117oi5.R should be tagged with @Override since it actually overrides a superinterface method\n" +
- "----------\n" +
- "2. ERROR in TeamA117oi5.java (at line 6)\n" +
- " public void bar() {}\n" +
- " ^^^^^\n" +
- "The method bar() of type TeamA117oi5.R1 should be tagged with @Override since it actually overrides a superclass method\n" +
- "----------\n" +
- "3. ERROR in TeamA117oi5.java (at line 9)\n" +
- " public void foo() {}\n" +
- " ^^^^^\n" +
- "The method foo() of type TeamA117oi5.R2 should be tagged with @Override since it actually overrides a superclass method\n" +
+ "----------\n" +
+ "1. ERROR in TeamA117oi5.java (at line 3)\n" +
+ " public void bar() {}\n" +
+ " ^^^^^\n" +
+ "The method bar() of type TeamA117oi5.R should be tagged with @Override since it actually overrides a superinterface method\n" +
+ "----------\n" +
+ "2. ERROR in TeamA117oi5.java (at line 6)\n" +
+ " public void bar() {}\n" +
+ " ^^^^^\n" +
+ "The method bar() of type TeamA117oi5.R1 should be tagged with @Override since it actually overrides a superclass method\n" +
+ "----------\n" +
+ "3. ERROR in TeamA117oi5.java (at line 9)\n" +
+ " public void foo() {}\n" +
+ " ^^^^^\n" +
+ "The method foo() of type TeamA117oi5.R2 should be tagged with @Override since it actually overrides a superclass method\n" +
"----------\n",
null,
true,
@@ -3975,23 +3975,23 @@ public class Java5 extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. WARNING in TeamA117cfa1_2.java (at line 3)\n" +
- " protected class R {\n" +
- " ^\n" +
- "Role TeamA117cfa1_2.R should be tagged with @Override since it actually overrides a superteam role (OTJLD 1.3.1(c)).\n" +
- "----------\n" +
- "2. WARNING in TeamA117cfa1_2.java (at line 5)\n" +
- " dep();\n" +
- " ^^^^^\n" +
- "The method dep() from the type TeamA117cfa1_1.R is deprecated\n" +
+ "----------\n" +
+ "1. WARNING in TeamA117cfa1_2.java (at line 3)\n" +
+ " protected class R {\n" +
+ " ^\n" +
+ "Role TeamA117cfa1_2.R should be tagged with @Override since it actually overrides a superteam role (OTJLD 1.3.1(c)).\n" +
+ "----------\n" +
+ "2. WARNING in TeamA117cfa1_2.java (at line 5)\n" +
+ " dep();\n" +
+ " ^^^^^\n" +
+ "The method dep() from the type TeamA117cfa1_1.R is deprecated\n" +
"----------\n");
}
// a role method is deprecated, so should be its tsub - testing at runtime via reflection
// A.1.17-otjld-copyinheritance-for-annotation-2
public void _testA117_copyinheritanceForAnnotation2() {
-
+
runConformTest(
new String[] {
"TeamA117cfa2_2.java",
@@ -4032,7 +4032,7 @@ public class Java5 extends AbstractOTJLDTest {
// a role method has a custom annotation, so should its tsub - testing at runtime via reflection
// A.1.17-otjld-copyinheritance-for-annotation-3
public void _testA117_copyinheritanceForAnnotation3() {
-
+
runConformTest(
new String[] {
"TeamA117cfa3_2.java",
@@ -4135,7 +4135,7 @@ public class Java5 extends AbstractOTJLDTest {
// a role method has a nested custom annotation, so should its tsub - testing at runtime via reflection
// A.1.17-otjld-copyinheritance-for-annotation-5
public void testA117_copyinheritanceForAnnotation5() {
-
+
runConformTest(
new String[] {
"TeamA117cfa5_2.java",
@@ -4199,7 +4199,7 @@ public class Java5 extends AbstractOTJLDTest {
// a role method has a custom annotation with enum values, annotation was in conflict with implicit activation annotation
// A.1.17-otjld-copyinheritance-for-annotation-5e
public void testA117_copyinheritanceForAnnotation5e() {
-
+
runConformTest(
new String[] {
"TeamA117cfa5e_2.java",
@@ -4309,7 +4309,7 @@ public class Java5 extends AbstractOTJLDTest {
// a role field has a custom annotation, so should its tsub - testing at runtime via reflection
// A.1.17-otjld-copyinheritance-for-annotation-7
public void testA117_copyinheritanceForAnnotation7() {
-
+
runConformTest(
new String[] {
"TeamA117cfa7_2.java",
@@ -4364,7 +4364,7 @@ public class Java5 extends AbstractOTJLDTest {
// a role field has a custom annotation (scalar arg), so should its tsub - testing at runtime via reflection
// A.1.17-otjld-copyinheritance-for-annotation-8
public void testA117_copyinheritanceForAnnotation8() {
-
+
runConformTest(
new String[] {
"TeamA117cfa8_2.java",
@@ -4419,7 +4419,7 @@ public class Java5 extends AbstractOTJLDTest {
// a role field has a custom annotation (enum typed arg), so should its tsub - testing at runtime via reflection
// A.1.17-otjld-copyinheritance-for-annotation-8e
public void testA117_copyinheritanceForAnnotation8e() {
-
+
runConformTest(
new String[] {
"TeamA117cfa8e_2.java",
@@ -4475,7 +4475,7 @@ public class Java5 extends AbstractOTJLDTest {
// a role field has a custom annotation, so should its tsub - testing at runtime via reflection
// A.1.17-otjld-copyinheritance-for-annotation-9
public void testA117_copyinheritanceForAnnotation9() {
-
+
runConformTest(
new String[] {
"TeamA117cfa9_2.java",
@@ -4530,7 +4530,7 @@ public class Java5 extends AbstractOTJLDTest {
// a role class extends a generic class providing type parameters
// A.1.18-otjld-role-extends-parameterized-1
public void testA118_roleExtendsParameterized1() {
-
+
runConformTest(
new String[] {
"TeamA118rep1.java",
@@ -4560,7 +4560,7 @@ public class Java5 extends AbstractOTJLDTest {
// a role class extends a generic role providing type parameters
// A.1.18-otjld-role-extends-parameterized-2
public void testA118_roleExtendsParameterized2() {
-
+
runConformTest(
new String[] {
"TeamA118rep2.java",
@@ -4590,7 +4590,7 @@ public class Java5 extends AbstractOTJLDTest {
// a role class extends a generic regular class with type bounds
// A.1.18-otjld-role-extends-parameterized-3
public void testA118_roleExtendsParameterized3() {
-
+
runConformTest(
new String[] {
"TeamA118rep3.java",
@@ -4630,7 +4630,7 @@ public class Java5 extends AbstractOTJLDTest {
// a type parameter has a nested value parameter
// A.1.19-otjld-nested-value-parameter-1
public void testA119_nestedValueParameter1() {
-
+
runConformTest(
new String[] {
"TeamA119nvp1.java",
@@ -4698,16 +4698,16 @@ public class Java5 extends AbstractOTJLDTest {
"public class TA119nvp2_2 {}\n" +
" \n"
},
- "----------\n" +
- "1. WARNING in TeamA119nvp2.java (at line 10)\n" +
- " TA119nvp2_1<@t2,Role<@t1>> c = new TA119nvp2_1<@t2,Role<@t1>>();\n" +
- " ^^^^^^^^^^^\n" +
- "Using an experimental feature: Implementation for mixed type and value parameters is experimental..\n" +
- "----------\n" +
- "2. WARNING in TeamA119nvp2.java (at line 10)\n" +
- " TA119nvp2_1<@t2,Role<@t1>> c = new TA119nvp2_1<@t2,Role<@t1>>();\n" +
- " ^^^^^^^^^^^\n" +
- "Using an experimental feature: Implementation for mixed type and value parameters is experimental..\n" +
+ "----------\n" +
+ "1. WARNING in TeamA119nvp2.java (at line 10)\n" +
+ " TA119nvp2_1<@t2,Role<@t1>> c = new TA119nvp2_1<@t2,Role<@t1>>();\n" +
+ " ^^^^^^^^^^^\n" +
+ "Using an experimental feature: Implementation for mixed type and value parameters is experimental..\n" +
+ "----------\n" +
+ "2. WARNING in TeamA119nvp2.java (at line 10)\n" +
+ " TA119nvp2_1<@t2,Role<@t1>> c = new TA119nvp2_1<@t2,Role<@t1>>();\n" +
+ " ^^^^^^^^^^^\n" +
+ "Using an experimental feature: Implementation for mixed type and value parameters is experimental..\n" +
"----------\n");
}
@@ -4826,31 +4826,31 @@ public class Java5 extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. WARNING in pt\\TeamA119nvp4.java (at line 6)\n" +
- " public class Role extends Showable playedBy pb.TA119nvp4_2 {\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Qualified reference to base class pb.TA119nvp4_2 is deprecated, should use a base import instead (OTJLD 2.1.2(d)).\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in pt\\TeamA119nvp4.java (at line 6)\n" +
+ " public class Role extends Showable playedBy pb.TA119nvp4_2 {\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Qualified reference to base class pb.TA119nvp4_2 is deprecated, should use a base import instead (OTJLD 2.1.2(d)).\n" +
+ "----------\n" +
(this.weavingScheme == WeavingScheme.OTRE && this.complianceLevel >= ClassFileConstants.JDK1_8
- ?
- "2. WARNING in pt\\TeamA119nvp4.java (at line 6)\n" +
- " public class Role extends Showable playedBy pb.TA119nvp4_2 {\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Base class pb.TA119nvp4_2 has class file version 52 which cannot be handled by the traditional OTRE based on BCEL. Please consider using the ASM based OTDRE instead.\n" +
+ ?
+ "2. WARNING in pt\\TeamA119nvp4.java (at line 6)\n" +
+ " public class Role extends Showable playedBy pb.TA119nvp4_2 {\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Base class pb.TA119nvp4_2 has class file version 52 which cannot be handled by the traditional OTRE based on BCEL. Please consider using the ASM based OTDRE instead.\n" +
"----------\n"
: ""
) +
- "----------\n" +
- "1. ERROR in TA119nvp4Main.java (at line 6)\n" +
- " pb.TA119nvp4_1<@t1,Role<@t1>> c = new pb.TA119nvp4_1<@t1,Role<@t1>>();\n" +
- " ^^^\n" +
- "Illegal position for value parameter @t1: must be a parameter of a single name type reference(OTJLD A.9(a)).\n" +
- "----------\n" +
- "2. ERROR in TA119nvp4Main.java (at line 6)\n" +
- " pb.TA119nvp4_1<@t1,Role<@t1>> c = new pb.TA119nvp4_1<@t1,Role<@t1>>();\n" +
- " ^^^\n" +
- "Illegal position for value parameter @t1: must be a parameter of a single name type reference(OTJLD A.9(a)).\n" +
+ "----------\n" +
+ "1. ERROR in TA119nvp4Main.java (at line 6)\n" +
+ " pb.TA119nvp4_1<@t1,Role<@t1>> c = new pb.TA119nvp4_1<@t1,Role<@t1>>();\n" +
+ " ^^^\n" +
+ "Illegal position for value parameter @t1: must be a parameter of a single name type reference(OTJLD A.9(a)).\n" +
+ "----------\n" +
+ "2. ERROR in TA119nvp4Main.java (at line 6)\n" +
+ " pb.TA119nvp4_1<@t1,Role<@t1>> c = new pb.TA119nvp4_1<@t1,Role<@t1>>();\n" +
+ " ^^^\n" +
+ "Illegal position for value parameter @t1: must be a parameter of a single name type reference(OTJLD A.9(a)).\n" +
"----------\n");
}
@@ -4950,7 +4950,7 @@ public class Java5 extends AbstractOTJLDTest {
// a type parameter has a nested value parameter with additional type bound (plain class)
// A.1.19-otjld-nested-value-parameter-7
public void testA119_nestedValueParameter7() {
-
+
runConformTest(
new String[] {
"TA119nvp7Main.java",
@@ -5001,7 +5001,7 @@ public class Java5 extends AbstractOTJLDTest {
// a method has a nested value paramter
// A.1.19-otjld-nested-value-parameter-8
public void testA119_nestedValueParameter8() {
-
+
runConformTest(
new String[] {
"TA119nvp8.java",
@@ -5086,18 +5086,18 @@ public class Java5 extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in TA119nvp10.java (at line 13)\n" +
- " unregister(3, r, t1, t2);\n" +
- " ^^^^^^^^^^\n" +
- "The method unregister(int, R<@t1>, Team, Team) in the type TA119nvp10 is not applicable for the arguments (int, Role<@t2>, TeamA119nvp10, TeamA119nvp10)\n" +
+ "----------\n" +
+ "1. ERROR in TA119nvp10.java (at line 13)\n" +
+ " unregister(3, r, t1, t2);\n" +
+ " ^^^^^^^^^^\n" +
+ "The method unregister(int, R<@t1>, Team, Team) in the type TA119nvp10 is not applicable for the arguments (int, Role<@t2>, TeamA119nvp10, TeamA119nvp10)\n" +
"----------\n");
}
// a plain generic type is parameterized by an externalized role - positive case
// A.1.19-otjld-parameterized-by-role-1
public void testA119_parameterizedByRole1() {
-
+
runConformTest(
new String[] {
"TA119pbr1Main.java",
@@ -5172,7 +5172,7 @@ public class Java5 extends AbstractOTJLDTest {
// a plain generic type is parameterized by two externalized roles
// A.1.19-otjld-parameterized-by-role-3
public void testA119_parameterizedByRole3() {
-
+
runConformTest(
new String[] {
"TA119pbr3Main.java",
@@ -5241,7 +5241,7 @@ public class Java5 extends AbstractOTJLDTest {
// a role type is used as a type bound
// A.1.19-otjld-parameterized-by-role-5
public void testA119_parameterizedByRole5() {
-
+
runConformTest(
new String[] {
"TA119pbr5Main.java",
@@ -5274,23 +5274,23 @@ public class Java5 extends AbstractOTJLDTest {
},
"true");
}
-
+
// similar to above but not using OT specifics
public void testA119_plainJava() {
runConformTest(
new String[] {
"GetRole.java",
- "\n" +
- "class R<Z> {}\n" +
- "\n" +
- "public class GetRole {\n" +
- " public <T> T getRole(Object o, Class<T> clazz) {\n" +
- " return null;\n" +
- " }\n" +
- " public Class<? extends R> getRClass() { return R.class; }\n" +
- " static void test(GetRole gr, Object o) {\n" +
- " R<String> rs = gr.getRole(o, gr.getRClass());\n" +
- " }\n" +
+ "\n" +
+ "class R<Z> {}\n" +
+ "\n" +
+ "public class GetRole {\n" +
+ " public <T> T getRole(Object o, Class<T> clazz) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public Class<? extends R> getRClass() { return R.class; }\n" +
+ " static void test(GetRole gr, Object o) {\n" +
+ " R<String> rs = gr.getRole(o, gr.getRClass());\n" +
+ " }\n" +
"}\n"
},
"");
@@ -5299,7 +5299,7 @@ public class Java5 extends AbstractOTJLDTest {
// a collection is parameterized by a role, used in foreach outside the team
// A.1.19-otjld-parameterized-by-role-6
public void testA119_parameterizedByRole6() {
-
+
runConformTest(
new String[] {
"TA119pbr6Main.java",
@@ -5339,7 +5339,7 @@ public class Java5 extends AbstractOTJLDTest {
// method call through an externalized role takes as argument a type parameterized by a role
// A.1.19-otjld-parameterized-by-role-7
public void testA119_parameterizedByRole7() {
-
+
runConformTest(
new String[] {
"TA119pbr7Main.java",
@@ -5408,11 +5408,11 @@ public class Java5 extends AbstractOTJLDTest {
"B.java",
"public class B {}\n"
},
- "----------\n" +
- "1. ERROR in TeamA120eit2.java (at line 3)\n" +
- " protected class R playedBy B base when(unfinished.) {}\n" +
- " ^\n" +
- "Syntax error on token \".\", this expected after this token\n" +
+ "----------\n" +
+ "1. ERROR in TeamA120eit2.java (at line 3)\n" +
+ " protected class R playedBy B base when(unfinished.) {}\n" +
+ " ^\n" +
+ "Syntax error on token \".\", this expected after this token\n" +
"----------\n");
}
@@ -5483,11 +5483,11 @@ public class Java5 extends AbstractOTJLDTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in TeamA120eit5.java (at line 5)\n" +
- " public R r = new R();\n" +
- " ^^^^^^^\n" +
- "No enclosing instance of type TeamA120eit5 is accessible. Must qualify the allocation with an enclosing instance of type TeamA120eit5 (e.g. x.new A() where x is an instance of TeamA120eit5).\n" +
+ "----------\n" +
+ "1. ERROR in TeamA120eit5.java (at line 5)\n" +
+ " public R r = new R();\n" +
+ " ^^^^^^^\n" +
+ "No enclosing instance of type TeamA120eit5 is accessible. Must qualify the allocation with an enclosing instance of type TeamA120eit5 (e.g. x.new A() where x is an instance of TeamA120eit5).\n" +
"----------\n");
}
@@ -5504,7 +5504,7 @@ public class Java5 extends AbstractOTJLDTest {
"}\n"
});
}
-
+
public void testA122_genericsRegression1() {
runConformTest(
new String[] {
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Java7.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Java7.java
index 73a1a5dfe..cc83b8c59 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Java7.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Java7.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2011 Stephan Herrmann
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -27,11 +27,11 @@ import org.eclipse.jdt.core.tests.util.Util;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class Java7 extends AbstractOTJLDTest {
-
+
public Java7(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -49,7 +49,7 @@ public class Java7 extends AbstractOTJLDTest {
public static Class testClass() {
return Java7.class;
}
-
+
// Bug 355007 - Using role as resource in try-with-resources creates bogus byte code
public void testA01_tryWithResources01() {
String fileName = OUTPUT_DIR+"/p1/data.txt";
@@ -61,42 +61,42 @@ public class Java7 extends AbstractOTJLDTest {
"p1/TeamA01twr01.java",
"package p1;\n" +
"import java.io.*;\n" +
- "public team class TeamA01twr01 {\n" +
- " protected class ReaderRole implements AutoCloseable playedBy TA01twr01 {\n" +
- " public char[] content;\n" +
- " protected void read12() throws IOException {\n" +
- " content = new char[12];\n" +
- " read(content);\n" +
- " }\n" +
- " void read(char[] chars) -> int read(char[] chars);\n" +
- " close -> close;\n" +
- " }\n" +
- " void test(TA01twr01 bfr) throws Exception {\n" +
- " try (ReaderRole r = new ReaderRole(bfr)) {\n" +
- " r.read12();\n" +
- " System.out.println(String.valueOf(r.content));\n" +
- " }\n" +
- " } \n" +
- " public static void main(String[] args) throws Exception {\n" +
- " new TeamA01twr01().test(new TA01twr01(\""+fileName+"\"));\n" +
- " }\n" +
+ "public team class TeamA01twr01 {\n" +
+ " protected class ReaderRole implements AutoCloseable playedBy TA01twr01 {\n" +
+ " public char[] content;\n" +
+ " protected void read12() throws IOException {\n" +
+ " content = new char[12];\n" +
+ " read(content);\n" +
+ " }\n" +
+ " void read(char[] chars) -> int read(char[] chars);\n" +
+ " close -> close;\n" +
+ " }\n" +
+ " void test(TA01twr01 bfr) throws Exception {\n" +
+ " try (ReaderRole r = new ReaderRole(bfr)) {\n" +
+ " r.read12();\n" +
+ " System.out.println(String.valueOf(r.content));\n" +
+ " }\n" +
+ " } \n" +
+ " public static void main(String[] args) throws Exception {\n" +
+ " new TeamA01twr01().test(new TA01twr01(\""+fileName+"\"));\n" +
+ " }\n" +
"}",
"p1/TA01twr01.java",
"package p1;\n" +
"import java.io.*;\n" +
- "public class TA01twr01 extends FileReader {\n" +
- " public TA01twr01(String fileName) throws IOException {\n" +
- " super(fileName);\n" +
- " }\n" +
- " @Override\n" +
- " public void close() {\n" +
- " try {\n" +
- " super.close();\n" +
- " System.out.println(\"closed\");\n" +
- " } catch (IOException ioe) {\n" +
- " ioe.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ "public class TA01twr01 extends FileReader {\n" +
+ " public TA01twr01(String fileName) throws IOException {\n" +
+ " super(fileName);\n" +
+ " }\n" +
+ " @Override\n" +
+ " public void close() {\n" +
+ " try {\n" +
+ " super.close();\n" +
+ " System.out.println(\"closed\");\n" +
+ " } catch (IOException ioe) {\n" +
+ " ioe.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}",
},
"----------\n" +
@@ -110,7 +110,7 @@ public class Java7 extends AbstractOTJLDTest {
"",
null);
}
-
+
// Bug 388060 - [compiler] closeable role triggers resource warning from lift method
@SuppressWarnings("unchecked")
public void testA01_tryWithResources02() {
@@ -124,42 +124,42 @@ public class Java7 extends AbstractOTJLDTest {
"p1/TeamA01twr01.java",
"package p1;\n" +
"import java.io.*;\n" +
- "public team class TeamA01twr01 {\n" +
- " protected class ReaderRole implements AutoCloseable playedBy TA01twr01 {\n" +
- " public char[] content;\n" +
- " protected void read12() throws IOException {\n" +
- " content = new char[12];\n" +
- " read(content);\n" +
- " }\n" +
- " void read(char[] chars) -> int read(char[] chars);\n" +
- " close -> close;\n" +
- " }\n" +
- " void test(String filename) throws Exception {\n" +
- " try (ReaderRole r = new ReaderRole(new TA01twr01(filename))) {\n" +
- " r.read12();\n" +
- " System.out.println(String.valueOf(r.content));\n" +
- " }\n" +
- " } \n" +
- " public static void main(String[] args) throws Exception {\n" +
- " new TeamA01twr01().test(\""+fileName+"\");\n" +
- " }\n" +
+ "public team class TeamA01twr01 {\n" +
+ " protected class ReaderRole implements AutoCloseable playedBy TA01twr01 {\n" +
+ " public char[] content;\n" +
+ " protected void read12() throws IOException {\n" +
+ " content = new char[12];\n" +
+ " read(content);\n" +
+ " }\n" +
+ " void read(char[] chars) -> int read(char[] chars);\n" +
+ " close -> close;\n" +
+ " }\n" +
+ " void test(String filename) throws Exception {\n" +
+ " try (ReaderRole r = new ReaderRole(new TA01twr01(filename))) {\n" +
+ " r.read12();\n" +
+ " System.out.println(String.valueOf(r.content));\n" +
+ " }\n" +
+ " } \n" +
+ " public static void main(String[] args) throws Exception {\n" +
+ " new TeamA01twr01().test(\""+fileName+"\");\n" +
+ " }\n" +
"}",
"p1/TA01twr01.java",
"package p1;\n" +
"import java.io.*;\n" +
- "public class TA01twr01 extends FileReader {\n" +
- " public TA01twr01(String fileName) throws IOException {\n" +
- " super(fileName);\n" +
- " }\n" +
- " @Override\n" +
- " public void close() {\n" +
- " try {\n" +
- " super.close();\n" +
- " System.out.println(\"closed\");\n" +
- " } catch (IOException ioe) {\n" +
- " ioe.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ "public class TA01twr01 extends FileReader {\n" +
+ " public TA01twr01(String fileName) throws IOException {\n" +
+ " super(fileName);\n" +
+ " }\n" +
+ " @Override\n" +
+ " public void close() {\n" +
+ " try {\n" +
+ " super.close();\n" +
+ " System.out.println(\"closed\");\n" +
+ " } catch (IOException ioe) {\n" +
+ " ioe.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}",
},
false, // no comp err
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Java8.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Java8.java
index e23c69655..23f27b2aa 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Java8.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Java8.java
@@ -50,7 +50,7 @@ public class Java8 extends AbstractOTJLDTest {
public static Class<Java8> testClass() {
return Java8.class;
}
-
+
@Override
public void initialize(CompilerTestSetup setUp) {
super.initialize(setUp);
@@ -222,15 +222,15 @@ public class Java8 extends AbstractOTJLDTest {
},
"OK");
}
-
+
public void testTypeAnnotationAndTypeAnchor_1() {
if (this.weavingScheme == WeavingScheme.OTRE) return;
runConformTest(
new String[] {
"Marker.java",
"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 Marker {}\n",
"T1.java,",
"public team class T1 {\n" +
@@ -244,7 +244,7 @@ public class Java8 extends AbstractOTJLDTest {
"class C2<T> {}\n"
});
}
-
+
public void testTypeAnnotationAndTypeAnchor_2() {
if (this.weavingScheme == WeavingScheme.OTRE) return;
runConformTest(
@@ -252,14 +252,14 @@ public class Java8 extends AbstractOTJLDTest {
"p1/Marker.java",
"package p1;\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 Marker {}\n",
"p1/Marker2.java",
"package p1;\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 Marker2 {}\n",
"T1.java,",
"public team class T1 {\n" +
@@ -292,11 +292,11 @@ public class Java8 extends AbstractOTJLDTest {
runNegativeTestNoFlush(
teamSource,
compilerOptions,
- "----------\n" +
- "1. WARNING in MyTeam.java (at line 2)\n" +
- " protected class R playedBy B {}\n" +
- " ^\n" +
- "Base class B has class file version 52 which cannot be handled by the traditional OTRE based on BCEL. Please consider using the ASM based OTDRE instead.\n" +
+ "----------\n" +
+ "1. WARNING in MyTeam.java (at line 2)\n" +
+ " protected class R playedBy B {}\n" +
+ " ^\n" +
+ "Base class B has class file version 52 which cannot be handled by the traditional OTRE based on BCEL. Please consider using the ASM based OTDRE instead.\n" +
"----------\n");
else
runConformTestNoFlush(teamSource, compilerOptions);
@@ -309,33 +309,33 @@ public class Java8 extends AbstractOTJLDTest {
new String[]{
"SubTeam.java",
"public team class SubTeam extends SuperTeam {\n" +
- " public interface I2 {\n" +
- " default void bar() { System.out.println(\"subbar\"); }\n" +
- " }\n" +
- " protected class R {\n" +
- " protected void foo() {\n" +
- " System.out.println(\"foosub\");\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new SubTeam().test();\n" +
- " }\n" +
+ " public interface I2 {\n" +
+ " default void bar() { System.out.println(\"subbar\"); }\n" +
+ " }\n" +
+ " protected class R {\n" +
+ " protected void foo() {\n" +
+ " System.out.println(\"foosub\");\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new SubTeam().test();\n" +
+ " }\n" +
"}\n",
"SuperTeam.java",
"public team class SuperTeam {\n" +
- " public interface I2 {\n" +
- " default void bar() { System.out.println(\"bar\"); }\n" +
- " }\n" +
- " protected class R implements I2 {\n" +
- " protected void foo() {\n" +
- " System.out.println(\"foo\");\n" +
- " }\n" +
- " }\n" +
- " protected void test() {\n" +
- " R r = new R();\n" +
- " r.foo();\n" +
- " r.bar();\n" +
- " }\n" +
+ " public interface I2 {\n" +
+ " default void bar() { System.out.println(\"bar\"); }\n" +
+ " }\n" +
+ " protected class R implements I2 {\n" +
+ " protected void foo() {\n" +
+ " System.out.println(\"foo\");\n" +
+ " }\n" +
+ " }\n" +
+ " protected void test() {\n" +
+ " R r = new R();\n" +
+ " r.foo();\n" +
+ " r.bar();\n" +
+ " }\n" +
"}\n"
},
"foosub\n" +
@@ -353,44 +353,44 @@ public class Java8 extends AbstractOTJLDTest {
" public static void main(String... args) {\n" +
" new t.MyT().activate();\n" +
" new Base().bm();\n" +
- " }\n" +
+ " }\n" +
"}\n",
"t/MyT.java",
"package t;\n" +
- "import base b.Base;\n" +
- "\n" +
- "public team class MyT {\n" +
- "\n" +
- " protected class R playedBy Base {\n" +
+ "import base b.Base;\n" +
+ "\n" +
+ "public team class MyT {\n" +
+ "\n" +
+ " protected class R playedBy Base {\n" +
" void perform(Runnable r) { r.run(); }\n" +
- " @SuppressWarnings(\"basecall\")\n" +
- " callin void test() {\n" +
- " perform(() -> {\n" +
- " System.out.print(0);\n" +
+ " @SuppressWarnings(\"basecall\")\n" +
+ " callin void test() {\n" +
+ " perform(() -> {\n" +
+ " System.out.print(0);\n" +
" base.test();\n" +
- " System.out.print(1);\n" +
- " perform(() -> base.test());\n" +
- " });\n" +
- " new Runnable() {\n" +
- " @Override\n" +
- " public void run() {\n" +
+ " System.out.print(1);\n" +
+ " perform(() -> base.test());\n" +
+ " });\n" +
+ " new Runnable() {\n" +
+ " @Override\n" +
+ " public void run() {\n" +
" perform(() -> {\n" +
- " System.out.print(2);\n" +
- " base.test(); \n" +
+ " System.out.print(2);\n" +
+ " base.test(); \n" +
" });\n" +
- " System.out.print(3);\n" +
- " base.test();\n" +
- " System.out.println(4);\n" +
- " }\n" +
- " }.run();\n" +
- " }\n" +
- " test <- replace bm;\n" +
+ " System.out.print(3);\n" +
+ " base.test();\n" +
+ " System.out.println(4);\n" +
+ " }\n" +
+ " }.run();\n" +
+ " }\n" +
+ " test <- replace bm;\n" +
" }\n" +
"}\n"
},
"0b1b2b3b4");
}
-
+
public void testBug506747() {
Map<String,String> options = getCompilerOptions();
options.put(JavaCore.COMPILER_ANNOTATION_NULL_ANALYSIS, JavaCore.ENABLED); // enable AnnotatableTypeSystem
@@ -407,11 +407,11 @@ public class Java8 extends AbstractOTJLDTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in p\\X.java (at line 7)\n" +
- " X.Inner i;\n" +
- " ^^^^^^^\n" +
- "X.Inner cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in p\\X.java (at line 7)\n" +
+ " X.Inner i;\n" +
+ " ^^^^^^^\n" +
+ "X.Inner cannot be resolved to a type\n" +
"----------\n",
null, // libs
true, // flush
@@ -430,11 +430,11 @@ public class Java8 extends AbstractOTJLDTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Bug506749.java (at line 4)\n" +
- " Runnable r = () -> base();\n" +
- " ^^^^\n" +
- "Illegal base constructor call: enclosing '() -> <no expression yet>' is not a constructor of a bound role (OTJLD 2.4.2).\n" +
+ "----------\n" +
+ "1. ERROR in Bug506749.java (at line 4)\n" +
+ " Runnable r = () -> base();\n" +
+ " ^^^^\n" +
+ "Illegal base constructor call: enclosing '() -> <no expression yet>' is not a constructor of a bound role (OTJLD 2.4.2).\n" +
"----------\n");
}
@@ -450,16 +450,16 @@ public class Java8 extends AbstractOTJLDTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Bug506749.java (at line 4)\n" +
- " Runnable r = () -> { base(); };\n" +
- " ^^^^\n" +
- "Illegal base constructor call: enclosing \'() -> {\n" +
- " <no expression yet>;\n" +
- "}\' is not a constructor of a bound role (OTJLD 2.4.2).\n" +
+ "----------\n" +
+ "1. ERROR in Bug506749.java (at line 4)\n" +
+ " Runnable r = () -> { base(); };\n" +
+ " ^^^^\n" +
+ "Illegal base constructor call: enclosing \'() -> {\n" +
+ " <no expression yet>;\n" +
+ "}\' is not a constructor of a bound role (OTJLD 2.4.2).\n" +
"----------\n");
}
-
+
public void testBug541865() {
runConformTest(
new String[] {
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Misc.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Misc.java
index d8a33349a..b05556974 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Misc.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Misc.java
@@ -74,7 +74,7 @@ public class Misc extends AbstractOTJLDTest {
// an abstract team instantiates an abstract role
// 0.m.1-otjld-abstract-relevant-role-instantiated-2
public void test0m1_abstractRelevantRoleInstantiated2() {
-
+
runConformTest(
new String[] {
"Team0m1arri2_2.java",
@@ -106,7 +106,7 @@ public class Misc extends AbstractOTJLDTest {
// an abstract team instantiates an abstract role
// 0.m.1-otjld-abstract-relevant-role-instantiated-3
public void test0m1_abstractRelevantRoleInstantiated3() {
-
+
runConformTest(
new String[] {
"Team0m1arri3_2.java",
@@ -164,10 +164,10 @@ public class Misc extends AbstractOTJLDTest {
"OTJLD 2.5(b)");
}
- //
+ //
// 0.m.2-otjld-string-constant-limit-1
public void test0m2_stringConstantLimit1() {
-
+
runConformTest(
new String[] {
"Team0m2scl1_2.java",
@@ -206,7 +206,7 @@ public class Misc extends AbstractOTJLDTest {
// an integer constant must remain within the range of short constant pool indices - read from bytecode
// 0.m.2-otjld-string-constant-limit-2
public void test0m2_stringConstantLimit2() {
-
+
runConformTest(
new String[] {
"Team0m2scl2_2.java",
@@ -248,7 +248,7 @@ public class Misc extends AbstractOTJLDTest {
// an integer constant must remain within the range of short constant pool indices - compile in one go (RoleModel lost its AST, still enable copying)
// 0.m.2-otjld-string-constant-limit-3
public void test0m2_stringConstantLimit3() {
-
+
runConformTest(
new String[] {
"Team0m2scl3_2.java",
@@ -290,7 +290,7 @@ public class Misc extends AbstractOTJLDTest {
// a long constant must remain within the range of short constant pool indices - read from bytecode
// 0.m.2-otjld-string-constant-limit-4
public void test0m2_stringConstantLimit4() {
-
+
runConformTest(
new String[] {
"Team0m2scl4_2.java",
@@ -332,7 +332,7 @@ public class Misc extends AbstractOTJLDTest {
// a float constant must remain within the range of short constant pool indices - compile in one go
// 0.m.2-otjld-string-constant-limit-5
public void test0m2_stringConstantLimit5() {
-
+
runConformTest(
new String[] {
"Team0m2scl5_2.java",
@@ -371,7 +371,7 @@ public class Misc extends AbstractOTJLDTest {
"OK6.7");
}
- //
+ //
// 0.m.3-otjld-mismatching-filename-1
public void test0m3_mismatchingFilename1() {
runNegativeTestMatching(
@@ -428,7 +428,7 @@ public class Misc extends AbstractOTJLDTest {
customOptions,
null/*requestor*/);
}
-
+
String[] getClassLibraries() {
if (this.verifier != null)
this.verifier.shutDown();
@@ -457,60 +457,60 @@ public class Misc extends AbstractOTJLDTest {
runConformTest(
new String[] {
"potj/Main.java",
- "package potj;\n" +
- "import p4.SubSubBase;\n" +
- "public class Main {\n" +
- " public static void main(String[] args) {\n" +
- " new SubTeam().activate();\n" +
- " new Team3().activate();\n" +
- " new SubSubBase().foo();\n" +
- " }\n" +
+ "package potj;\n" +
+ "import p4.SubSubBase;\n" +
+ "public class Main {\n" +
+ " public static void main(String[] args) {\n" +
+ " new SubTeam().activate();\n" +
+ " new Team3().activate();\n" +
+ " new SubSubBase().foo();\n" +
+ " }\n" +
"}\n",
"potj/SuperTeam.java",
- "package potj;\n" +
- "\n" +
- "import base p1.AbstractSuperBase;\n" +
- "public team class SuperTeam {\n" +
+ "package potj;\n" +
+ "\n" +
+ "import base p1.AbstractSuperBase;\n" +
+ "public team class SuperTeam {\n" +
" protected class R0 playedBy AbstractSuperBase {\n" + // weaving into a 1.5 class file (using ldc for class literal)
- " ci <- replace foo;\n" +
- "\n" +
- " callin void ci() {\n" +
- " System.out.println(\"SuperTeam$R.ci()\");\n" +
- " base.ci();\n" +
- " }\n" +
- " }\n" +
+ " ci <- replace foo;\n" +
+ "\n" +
+ " callin void ci() {\n" +
+ " System.out.println(\"SuperTeam$R.ci()\");\n" +
+ " base.ci();\n" +
+ " }\n" +
+ " }\n" +
"}",
"potj/SubTeam.java",
- "package potj;\n" +
- "\n" +
- "import base p4.SubBase;\n" +
- "public team class SubTeam extends SuperTeam {\n" +
+ "package potj;\n" +
+ "\n" +
+ "import base p4.SubBase;\n" +
+ "public team class SubTeam extends SuperTeam {\n" +
" protected class R1 extends R0 playedBy SubBase {\n" + // weaving into a 1.4 class file (needs manual management using Class.forName())
- " \n" +
- " }\n" +
+ " \n" +
+ " }\n" +
"}\n",
"potj/Team3.java",
- "package potj;\n" +
- "\n" +
- "import base p4.SubSubBase;\n" +
- "public team class Team3 {\n" +
- " protected class R3 playedBy SubSubBase {\n" +
- " rm <-after foo;\n" +
- "\n" +
- " private void rm() {\n" +
- " System.out.println(\"R3.rm\");\n" +
- " }\n" +
- " }\n" +
+ "package potj;\n" +
+ "\n" +
+ "import base p4.SubSubBase;\n" +
+ "public team class Team3 {\n" +
+ " protected class R3 playedBy SubSubBase {\n" +
+ " rm <-after foo;\n" +
+ "\n" +
+ " private void rm() {\n" +
+ " System.out.println(\"R3.rm\");\n" +
+ " }\n" +
+ " }\n" +
"}\n",
},
- "SuperTeam$R.ci()\n" +
- "SuperBase.foo()\n" +
+ "SuperTeam$R.ci()\n" +
+ "SuperBase.foo()\n" +
"R3.rm",
getClassLibraries(),
false/*shouldFlushOutputDirectory*/,
null/*vmArguments*/);
}
-
+
// reading a base class compiled with a different weaving scheme is *no* problem
public void testMixedClassFileFormats2() {
WeavingScheme scheme = this.weavingScheme;
@@ -525,7 +525,7 @@ public class Misc extends AbstractOTJLDTest {
"public class Base {" +
" public static void main(String[] args) {}\n" +
"}\n"
- },
+ },
"", null, false, new String[] {"-Dotre2", "-Dotre.suppress.classformaterror.stderr=true"}, options, null); // force starting a new vm
options.put(JavaCore.COMPILER_OPT_WEAVING_SCHEME, WeavingScheme.OTDRE.name());
this.weavingScheme = WeavingScheme.OTDRE;
@@ -538,13 +538,13 @@ public class Misc extends AbstractOTJLDTest {
" }\n" +
" public static void main(String[] args) {}\n" +
"}\n"
- },
+ },
"", null, false, new String[] {"-Dotdre2"}, options, null);
} finally {
this.weavingScheme = scheme;
}
}
-
+
// reading a team class compiled with a different weaving scheme *is* a problem
public void testMixedClassFileFormats3() {
WeavingScheme scheme = this.weavingScheme;
@@ -559,7 +559,7 @@ public class Misc extends AbstractOTJLDTest {
"public team class Team1 {\n" +
" public static void main(String[] args) {}\n" +
"}\n"
- },
+ },
"", null, false, new String[] {"-Dotre3", "-Dotre.suppress.classformaterror.stderr=true"}, options, null);
options.put(JavaCore.COMPILER_OPT_WEAVING_SCHEME, WeavingScheme.OTDRE.name());
this.weavingScheme = WeavingScheme.OTDRE;
@@ -572,11 +572,11 @@ public class Misc extends AbstractOTJLDTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in mcff3\\Team2.java (at line 1)\n" +
- " package mcff3;\n" +
- " ^\n" +
- "Class file "+OUTPUT_DIR+"/mcff3/Team1.class has been compiled for incompatible weaving target \'OTRE\', please consider a full build of the declaring project.\n" +
+ "----------\n" +
+ "1. ERROR in mcff3\\Team2.java (at line 1)\n" +
+ " package mcff3;\n" +
+ " ^\n" +
+ "Class file "+OUTPUT_DIR+"/mcff3/Team1.class has been compiled for incompatible weaving target \'OTRE\', please consider a full build of the declaring project.\n" +
"----------\n",
null,
false,
@@ -600,7 +600,7 @@ public class Misc extends AbstractOTJLDTest {
"public team class Team1 {\n" +
" public static void main(String[] args) {}\n" +
"}\n"
- },
+ },
"", null, false, new String[] {"-Dotdre4"}, options, null);
options.put(JavaCore.COMPILER_OPT_WEAVING_SCHEME, WeavingScheme.OTRE.name());
this.weavingScheme = WeavingScheme.OTRE;
@@ -612,11 +612,11 @@ public class Misc extends AbstractOTJLDTest {
" protected class R {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in mcff4\\Team2.java (at line 1)\n" +
- " package mcff4;\n" +
- " ^\n" +
- "Class file "+OUTPUT_DIR+"/mcff4/Team1.class has been compiled for incompatible weaving target \'OTDRE\', please consider a full build of the declaring project.\n" +
+ "----------\n" +
+ "1. ERROR in mcff4\\Team2.java (at line 1)\n" +
+ " package mcff4;\n" +
+ " ^\n" +
+ "Class file "+OUTPUT_DIR+"/mcff4/Team1.class has been compiled for incompatible weaving target \'OTDRE\', please consider a full build of the declaring project.\n" +
"----------\n",
null,
false,
@@ -632,120 +632,120 @@ public class Misc extends AbstractOTJLDTest {
runConformTest(
new String[] {
"TeamSerializationMain.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" +
- "\n" +
- "import org.objectteams.Team;\n" +
- "\n" +
- "import teampack.PersistentTeam;\n" +
- "import basepack.PersistentBase;\n" +
- "\n" +
- "\n" +
- "public class TeamSerializationMain {\n" +
- " public static void main(String[] args) throws IOException, ClassNotFoundException {\n" +
- " PersistentTeam t = new PersistentTeam();\n" +
- " t.activate(Team.ALL_THREADS);\n" +
- " PersistentBase basel = new PersistentBase(\"b1\");\n" +
- " t.name(basel, \"R1\");\n" +
- " basel.hello();\n" +
- "\n" +
- " // store, deactivate and forget it:\n" +
- " ByteArrayOutputStream baos = new ByteArrayOutputStream();\n" +
- " ObjectOutputStream oos = new ObjectOutputStream(baos);\n" +
- " oos.writeObject(t);\n" +
- " t.deactivate(Team.ALL_THREADS);\n" +
- " t = null;\n" +
- " basel = null;\n" +
- " \n" +
- " // no team active now:\n" +
- " new PersistentBase(\"interm\").hello();\n" +
- "\n" +
- " // restore:\n" +
- " ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()));\n" +
- " Object o = ois.readObject();\n" +
- " basel = (PersistentBase) ((PersistentTeam)o).getBase();\n" +
- " \n" +
- " // trigger from old and new objects:\n" +
- " basel.hello();\n" +
- " new PersistentBase(\"finale\").hello();\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" +
+ "\n" +
+ "import org.objectteams.Team;\n" +
+ "\n" +
+ "import teampack.PersistentTeam;\n" +
+ "import basepack.PersistentBase;\n" +
+ "\n" +
+ "\n" +
+ "public class TeamSerializationMain {\n" +
+ " public static void main(String[] args) throws IOException, ClassNotFoundException {\n" +
+ " PersistentTeam t = new PersistentTeam();\n" +
+ " t.activate(Team.ALL_THREADS);\n" +
+ " PersistentBase basel = new PersistentBase(\"b1\");\n" +
+ " t.name(basel, \"R1\");\n" +
+ " basel.hello();\n" +
+ "\n" +
+ " // store, deactivate and forget it:\n" +
+ " ByteArrayOutputStream baos = new ByteArrayOutputStream();\n" +
+ " ObjectOutputStream oos = new ObjectOutputStream(baos);\n" +
+ " oos.writeObject(t);\n" +
+ " t.deactivate(Team.ALL_THREADS);\n" +
+ " t = null;\n" +
+ " basel = null;\n" +
+ " \n" +
+ " // no team active now:\n" +
+ " new PersistentBase(\"interm\").hello();\n" +
+ "\n" +
+ " // restore:\n" +
+ " ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()));\n" +
+ " Object o = ois.readObject();\n" +
+ " basel = (PersistentBase) ((PersistentTeam)o).getBase();\n" +
+ " \n" +
+ " // trigger from old and new objects:\n" +
+ " basel.hello();\n" +
+ " new PersistentBase(\"finale\").hello();\n" +
+ " }\n" +
"}\n",
"teampack/PersistentTeam.java",
- "package teampack;\n" +
- "\n" +
- "import java.io.IOException;\n" +
- "import java.io.Serializable;\n" +
- "\n" +
- "import base basepack.PersistentBase;\n" +
- "\n" +
- "public team class PersistentTeam implements Serializable {\n" +
- "\n" +
- " private void writeObject(java.io.ObjectOutputStream out)\n" +
- " throws IOException\n" +
- " {\n" +
- " out.defaultWriteObject();\n" +
- " writeGlobalActivationState(out);\n" +
- " Object[] allRoles = getAllRoles();\n" +
- " out.writeInt(allRoles.length);\n" +
- " for (Object o : allRoles)\n" +
- " out.writeObject(o);\n" +
- " }\n" +
- " private void readObject(java.io.ObjectInputStream in)\n" +
- " throws IOException, ClassNotFoundException\n" +
- " {\n" +
- " in.defaultReadObject();\n" +
- " readGlobalActivationState(in);\n" +
- " restore();\n" +
- " int numRoles = in.readInt();\n" +
- " for (int i = 0; i < numRoles; i++)\n" +
- " restoreRole(R.class, in.readObject());\n" +
- " }\n" +
- " \n" +
- " protected class R implements Serializable, ILowerable playedBy PersistentBase {\n" +
- " protected String roleName;\n" +
- "\n" +
- " void hello() <- after void hello();\n" +
- " \n" +
- " private void hello() {\n" +
- " System.out.println(\"Says \"+this.roleName);\n" +
- " } \n" +
- " }\n" +
- "\n" +
- " public void name(PersistentBase as R r, String name) {\n" +
- " r.roleName = name;\n" +
- " }\n" +
- " \n" +
- " public Object getBase() {\n" +
- " R[] rs = getAllRoles(R.class);\n" +
- " return rs[0].lower();\n" +
- " }\n" +
+ "package teampack;\n" +
+ "\n" +
+ "import java.io.IOException;\n" +
+ "import java.io.Serializable;\n" +
+ "\n" +
+ "import base basepack.PersistentBase;\n" +
+ "\n" +
+ "public team class PersistentTeam implements Serializable {\n" +
+ "\n" +
+ " private void writeObject(java.io.ObjectOutputStream out)\n" +
+ " throws IOException\n" +
+ " {\n" +
+ " out.defaultWriteObject();\n" +
+ " writeGlobalActivationState(out);\n" +
+ " Object[] allRoles = getAllRoles();\n" +
+ " out.writeInt(allRoles.length);\n" +
+ " for (Object o : allRoles)\n" +
+ " out.writeObject(o);\n" +
+ " }\n" +
+ " private void readObject(java.io.ObjectInputStream in)\n" +
+ " throws IOException, ClassNotFoundException\n" +
+ " {\n" +
+ " in.defaultReadObject();\n" +
+ " readGlobalActivationState(in);\n" +
+ " restore();\n" +
+ " int numRoles = in.readInt();\n" +
+ " for (int i = 0; i < numRoles; i++)\n" +
+ " restoreRole(R.class, in.readObject());\n" +
+ " }\n" +
+ " \n" +
+ " protected class R implements Serializable, ILowerable playedBy PersistentBase {\n" +
+ " protected String roleName;\n" +
+ "\n" +
+ " void hello() <- after void hello();\n" +
+ " \n" +
+ " private void hello() {\n" +
+ " System.out.println(\"Says \"+this.roleName);\n" +
+ " } \n" +
+ " }\n" +
+ "\n" +
+ " public void name(PersistentBase as R r, String name) {\n" +
+ " r.roleName = name;\n" +
+ " }\n" +
+ " \n" +
+ " public Object getBase() {\n" +
+ " R[] rs = getAllRoles(R.class);\n" +
+ " return rs[0].lower();\n" +
+ " }\n" +
"}\n",
"packbase/PersistentBase.java",
- "package basepack;\n" +
- "\n" +
- "import java.io.Serializable;\n" +
- "\n" +
- "public class PersistentBase implements Serializable {\n" +
- " String name;\n" +
- "\n" +
- " public PersistentBase(String name) {\n" +
- " this.name = name;\n" +
- " }\n" +
- "\n" +
- " public void hello() {\n" +
- " System.out.println(\"Hello \"+this.name);\n" +
- " }\n" +
+ "package basepack;\n" +
+ "\n" +
+ "import java.io.Serializable;\n" +
+ "\n" +
+ "public class PersistentBase implements Serializable {\n" +
+ " String name;\n" +
+ "\n" +
+ " public PersistentBase(String name) {\n" +
+ " this.name = name;\n" +
+ " }\n" +
+ "\n" +
+ " public void hello() {\n" +
+ " System.out.println(\"Hello \"+this.name);\n" +
+ " }\n" +
"}\n"
- },
- "Hello b1\n" +
- "Says R1\n" +
- "Hello interm\n" +
- "Hello b1\n" +
- "Says R1\n" +
- "Hello finale\n" +
+ },
+ "Hello b1\n" +
+ "Says R1\n" +
+ "Hello interm\n" +
+ "Hello b1\n" +
+ "Says R1\n" +
+ "Hello finale\n" +
"Says null");
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Modifiers.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Modifiers.java
index 401a4c00d..4fa07678d 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Modifiers.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Modifiers.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -27,11 +27,11 @@ import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
import junit.framework.Test;
public class Modifiers extends AbstractOTJLDTest {
-
+
public Modifiers(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -39,7 +39,7 @@ public class Modifiers extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -190,7 +190,7 @@ public class Modifiers extends AbstractOTJLDTest {
// a role implements an inherited abstract method
// 7.1.3-otjld-role-implements-inherited-abstract-method-1
public void test713_roleImplementsInheritedAbstractMethod1() {
-
+
runConformTest(
new String[] {
"T713riiam1Main.java",
@@ -227,7 +227,7 @@ public class Modifiers extends AbstractOTJLDTest {
// a role implements an inherited abstract method
// 7.1.3-otjld-role-implements-inherited-abstract-method-2
public void test713_roleImplementsInheritedAbstractMethod2() {
-
+
runConformTest(
new String[] {
"T713riiam2Main.java",
@@ -265,7 +265,7 @@ public class Modifiers extends AbstractOTJLDTest {
// a role implements an inherited abstract method
// 7.1.3-otjld-role-implements-inherited-abstract-method-3
public void test713_roleImplementsInheritedAbstractMethod3() {
-
+
runConformTest(
new String[] {
"T713riiam3Main.java",
@@ -305,7 +305,7 @@ public class Modifiers extends AbstractOTJLDTest {
// a role implements an inherited abstract method
// 7.1.3-otjld-role-implements-inherited-abstract-method-4
public void test713_roleImplementsInheritedAbstractMethod4() {
-
+
runConformTest(
new String[] {
"T713riiam4Main.java",
@@ -347,7 +347,7 @@ public class Modifiers extends AbstractOTJLDTest {
// a non-abstract team has an abstract role and concrete subrole, and does not instantiate the abstract role
// 7.1.6-otjld-nonabstract-team-with-abstract-role-1
public void test716_nonabstractTeamWithAbstractRole1() {
-
+
runConformTest(
new String[] {
"T716ntwar1Main.java",
@@ -387,7 +387,7 @@ public class Modifiers extends AbstractOTJLDTest {
// a non-abstract team has an abstract role and concrete subrole, and does not instantiate the abstract role
// 7.1.6-otjld-nonabstract-team-with-abstract-role-2
public void test716_nonabstractTeamWithAbstractRole2() {
-
+
runConformTest(
new String[] {
"T716ntwar2Main.java",
@@ -466,11 +466,11 @@ public class Modifiers extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team717twarr1.java (at line 13)\n" +
- " Role717twarr1_1 r = new Role717twarr1_1();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Team Team717twarr1 must be declared abstract, because abstract role Role717twarr1_1 is relevant (OTJLD 2.5(b)).\n" +
+ "----------\n" +
+ "1. ERROR in Team717twarr1.java (at line 13)\n" +
+ " Role717twarr1_1 r = new Role717twarr1_1();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Team Team717twarr1 must be declared abstract, because abstract role Role717twarr1_1 is relevant (OTJLD 2.5(b)).\n" +
"----------\n");
}
@@ -510,7 +510,7 @@ public class Modifiers extends AbstractOTJLDTest {
// an abstract role class is instantiated and the instantiation is performed in a concrete sub-team of the team definining the role
// 7.1.9-otjld-abstract-role-class-instantiation-1
public void test719_abstractRoleClassInstantiation1() {
-
+
runConformTest(
new String[] {
"T719arci1Main.java",
@@ -552,7 +552,7 @@ public class Modifiers extends AbstractOTJLDTest {
// an abstract role class is instantiated and the instantiation is performed in a concrete sub-team of the team definining the role
// 7.1.9-otjld-abstract-role-class-instantiation-2
public void test719_abstractRoleClassInstantiation2() {
-
+
runConformTest(
new String[] {
"T719arci2Main.java",
@@ -752,11 +752,11 @@ public class Modifiers extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team7112cmonm2.java (at line 4)\n" +
- " callin void test() {\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Modifier \"callin\" not allowed here; trying to override a method from T7112cmonm2_1 which is not a callin method (OTJLD 4.2(d)). \n" +
+ "----------\n" +
+ "1. ERROR in Team7112cmonm2.java (at line 4)\n" +
+ " callin void test() {\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Modifier \"callin\" not allowed here; trying to override a method from T7112cmonm2_1 which is not a callin method (OTJLD 4.2(d)). \n" +
"----------\n");
}
@@ -914,18 +914,18 @@ public class Modifiers extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team7113nmocm3_2.java (at line 4)\n" +
- " test => doSomething;\n" +
- " ^^^^\n" +
- "Cannot bind method test() as callout; is a callin method (OTJLD 4.2(d)).\n" +
+ "----------\n" +
+ "1. ERROR in Team7113nmocm3_2.java (at line 4)\n" +
+ " test => doSomething;\n" +
+ " ^^^^\n" +
+ "Cannot bind method test() as callout; is a callin method (OTJLD 4.2(d)).\n" +
"----------\n");
}
// a method with a callin modifier overwrites an inherited callin method
// 7.1.14-otjld-callin-method-overwrites-callin-method-1
public void test7114_callinMethodOverwritesCallinMethod1() {
-
+
runConformTest(
new String[] {
"T7114cmocm1Main.java",
@@ -975,7 +975,7 @@ public class Modifiers extends AbstractOTJLDTest {
// a method with a callin modifier overwrites an inherited callin method
// 7.1.14-otjld-callin-method-overwrites-callin-method-2
public void test7114_callinMethodOverwritesCallinMethod2() {
-
+
runConformTest(
new String[] {
"T7114cmocm2Main.java",
@@ -1029,7 +1029,7 @@ public class Modifiers extends AbstractOTJLDTest {
// a method with a callin modifier redefines an inaccessible non-callin method
// 7.1.15-otjld-callin-method-redefines-noncallin-method
public void test7115_callinMethodRedefinesNoncallinMethod() {
-
+
runConformTest(
new String[] {
"T7115cmrnmMain.java",
@@ -1090,7 +1090,7 @@ public class Modifiers extends AbstractOTJLDTest {
// a static role method calls a non-static team method , qualified this reference passed by parameter mapping
// 7.1.16-otjld-static-role-method-1
public void test7116_staticRoleMethod1() {
-
+
runConformTest(
new String[] {
"Team7116srm1.java",
@@ -1127,7 +1127,7 @@ public class Modifiers extends AbstractOTJLDTest {
// a static role method accesses the enclosing team instance
// 7.1.16-otjld-static-role-method-2
public void test7116_staticRoleMethod2() {
-
+
runConformTest(
new String[] {
"Team7116srm2.java",
@@ -1160,7 +1160,7 @@ public class Modifiers extends AbstractOTJLDTest {
// a static role method accesses the enclosing team instance, invoked via callin
// 7.1.16-otjld-static-role-method-3
public void test7116_staticRoleMethod3() {
-
+
runConformTest(
new String[] {
"Team7116srm3.java",
@@ -1200,7 +1200,7 @@ public class Modifiers extends AbstractOTJLDTest {
// a static callin method accesses the enclosing team instance
// 7.1.16-otjld-static-role-method-4
public void test7116_staticRoleMethod4() {
-
+
runConformTest(
new String[] {
"Team7116srm4.java",
@@ -1246,7 +1246,7 @@ public class Modifiers extends AbstractOTJLDTest {
// a static callin method calls another static role method (regular)
// 7.1.16-otjld-static-role-method-5
public void test7116_staticRoleMethod5() {
-
+
runConformTest(
new String[] {
"Team7116srm5.java",
@@ -1284,7 +1284,7 @@ public class Modifiers extends AbstractOTJLDTest {
// a static callin method accesses an indirect enclosing team instance
// 7.1.16-otjld-static-role-method-6
public void test7116_staticRoleMethod6() {
-
+
runConformTest(
new String[] {
"Team7116srm6.java",
@@ -1328,7 +1328,7 @@ public class Modifiers extends AbstractOTJLDTest {
// a static callin method of a nested role accesses the enclosing team instance
// 7.1.16-otjld-static-role-method-7
public void test7116_staticRoleMethod7() {
-
+
runConformTest(
new String[] {
"Team7116srm7.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/OTNullAnnotationTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/OTNullAnnotationTest.java
index 2c4506059..3180950a3 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/OTNullAnnotationTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/OTNullAnnotationTest.java
@@ -29,7 +29,7 @@ public class OTNullAnnotationTest extends AbstractOTJLDNullAnnotationTest {
public OTNullAnnotationTest(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which do not belong to the class are skipped...
static {
@@ -45,7 +45,7 @@ public class OTNullAnnotationTest extends AbstractOTJLDNullAnnotationTest {
public static Class testClass() {
return OTNullAnnotationTest.class;
}
-
+
public void testNullableBase() {
runNegativeTestWithLibs(
new String[] {
@@ -60,21 +60,21 @@ public class OTNullAnnotationTest extends AbstractOTJLDNullAnnotationTest {
"bug443299a/MyBase.java",
"package bug443299a;\n" +
"public class MyBase {}\n"
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in bug443299a\\MyTeam.java (at line 5)\n" +
- " new MyRole(null);\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Argument to lifting constructor MyRole(MyBase) is not a freshly created base object (of type bug443299a.MyBase); may cause a DuplicateRoleException at runtime (OTJLD 2.4.1(c)).\n" +
- "----------\n" +
- "2. ERROR in bug443299a\\MyTeam.java (at line 5)\n" +
- " new MyRole(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull MyBase\' but the provided value is null\n" +
+ "----------\n" +
+ "1. WARNING in bug443299a\\MyTeam.java (at line 5)\n" +
+ " new MyRole(null);\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Argument to lifting constructor MyRole(MyBase) is not a freshly created base object (of type bug443299a.MyBase); may cause a DuplicateRoleException at runtime (OTJLD 2.4.1(c)).\n" +
+ "----------\n" +
+ "2. ERROR in bug443299a\\MyTeam.java (at line 5)\n" +
+ " new MyRole(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull MyBase\' but the provided value is null\n" +
"----------\n");
}
-
+
public void testBug444231() {
if (this.complianceLevel >= ClassFileConstants.JDK1_8) return; // not ready for type annotations, yet
Map<String,String> options = getCompilerOptions();
@@ -113,14 +113,14 @@ public class OTNullAnnotationTest extends AbstractOTJLDNullAnnotationTest {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in p\\Team444231SubSub.java (at line 6)\n" +
- " new R(val);\n" +
- " ^^^\n" +
- "Null type mismatch: required '@NonNull String' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in p\\Team444231SubSub.java (at line 6)\n" +
+ " new R(val);\n" +
+ " ^^^\n" +
+ "Null type mismatch: required '@NonNull String' but the provided value is null\n" +
"----------\n");
}
-
+
public void testBug444231_ambiguous() {
if (this.complianceLevel >= ClassFileConstants.JDK1_8) return; // not ready for type annotations, yet
runNegativeTestWithLibs(
@@ -146,11 +146,11 @@ public class OTNullAnnotationTest extends AbstractOTJLDNullAnnotationTest {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in p\\Team444231Sub.java (at line 4)\n" +
- " new R(null);\n" +
- " ^^^^^^^^^^^\n" +
- "The constructor Team444231Sub.R(null) is ambiguous\n" +
+ "----------\n" +
+ "1. ERROR in p\\Team444231Sub.java (at line 4)\n" +
+ " new R(null);\n" +
+ " ^^^^^^^^^^^\n" +
+ "The constructor Team444231Sub.R(null) is ambiguous\n" +
"----------\n");
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/OTNullTypeAnnotationTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/OTNullTypeAnnotationTest.java
index 7cb98c49c..199652844 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/OTNullTypeAnnotationTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/OTNullTypeAnnotationTest.java
@@ -28,7 +28,7 @@ import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDNullAnnotationTest;
/** Test combination of OT-types with null type annotations. */
public class OTNullTypeAnnotationTest extends AbstractOTJLDNullAnnotationTest {
-
+
public OTNullTypeAnnotationTest(String name) {
super(name);
}
@@ -48,17 +48,17 @@ public class OTNullTypeAnnotationTest extends AbstractOTJLDNullAnnotationTest {
public static Class testClass() {
return OTNullTypeAnnotationTest.class;
}
-
+
@Override
public void initialize(CompilerTestSetup setUp) {
super.initialize(setUp);
if (this.weavingScheme == WeavingScheme.OTRE)
System.err.println("Running Java8 tests for OTRE weaver will skip most tests");
}
-
+
// test standard generated methods via basic team-role-base setup
- // Bug 443306 - [1.8][null] generated method getAllRoles() triggers null pointer warning / error
+ // Bug 443306 - [1.8][null] generated method getAllRoles() triggers null pointer warning / error
public void testBoundRole() {
if (this.weavingScheme == WeavingScheme.OTRE) return;
runConformTestWithLibs(
@@ -75,8 +75,8 @@ public class OTNullTypeAnnotationTest extends AbstractOTJLDNullAnnotationTest {
" }\n" +
" public static void main(String... args) {\n" +
" System.out.print(\"main\");\n" +
- " new MyTeam().activate();\n" +
- " new bug443306.b.MyBase().bar();\n" +
+ " new MyTeam().activate();\n" +
+ " new bug443306.b.MyBase().bar();\n" +
" }\n" +
"}\n",
"bub443306/b/MyBase.java",
@@ -109,8 +109,8 @@ public class OTNullTypeAnnotationTest extends AbstractOTJLDNullAnnotationTest {
" }\n" +
" public static void main(String... args) {\n" +
" System.out.print(\"main\");\n" +
- " new MyTeam().activate();\n" +
- " new bug443299.b.MyBase().bar();\n" +
+ " new MyTeam().activate();\n" +
+ " new bug443299.b.MyBase().bar();\n" +
" }\n" +
"}\n",
"bug443299/b/MyBase.java",
@@ -126,7 +126,7 @@ public class OTNullTypeAnnotationTest extends AbstractOTJLDNullAnnotationTest {
"mainbarMyBase");
}
- // Bug 437767 - [java8][null] semantically integrate null type annotations with anchored role types
+ // Bug 437767 - [java8][null] semantically integrate null type annotations with anchored role types
// see comment 1
public void testImplicitTeamAnchor1() {
if (this.weavingScheme == WeavingScheme.OTRE) return;
@@ -141,10 +141,10 @@ public class OTNullTypeAnnotationTest extends AbstractOTJLDNullAnnotationTest {
" protected class MyRole {\n" +
" protected void print() {}\n" +
" }\n" +
- " void test() {\n" +
- " List<@NonNull MyRole> someRoles = new ArrayList<>();\n" +
- " @NonNull MyRole role = someRoles.get(0);\n" +
- " role.print();\n" +
+ " void test() {\n" +
+ " List<@NonNull MyRole> someRoles = new ArrayList<>();\n" +
+ " @NonNull MyRole role = someRoles.get(0);\n" +
+ " role.print();\n" +
" }\n" +
"}\n"
},
@@ -163,19 +163,19 @@ public class OTNullTypeAnnotationTest extends AbstractOTJLDNullAnnotationTest {
" protected class MyRole {\n" +
" protected void print() {}\n" +
" }\n" +
- " void test() {\n" +
- " List<@Nullable MyRole> someRoles = new ArrayList<>();\n" +
- " @NonNull MyRole role = someRoles.get(0);\n" +
- " role.print();\n" +
+ " void test() {\n" +
+ " List<@Nullable MyRole> someRoles = new ArrayList<>();\n" +
+ " @NonNull MyRole role = someRoles.get(0);\n" +
+ " role.print();\n" +
" }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in MyTeam.java (at line 9)\n" +
- " @NonNull MyRole role = someRoles.get(0);\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'MyTeam.@NonNull MyRole\' but this expression has type \'MyTeam.@Nullable MyRole\'\n" +
+ "----------\n" +
+ "1. ERROR in MyTeam.java (at line 9)\n" +
+ " @NonNull MyRole role = someRoles.get(0);\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'MyTeam.@NonNull MyRole\' but this expression has type \'MyTeam.@Nullable MyRole\'\n" +
"----------\n");
}
@@ -188,8 +188,8 @@ public class OTNullTypeAnnotationTest extends AbstractOTJLDNullAnnotationTest {
"import java.util.*;\n" +
"public class Main {\n" +
" void test(final MyTeam t, List<@Nullable MyRole<@t>> someRoles) {\n" +
- " @NonNull MyRole<@t> role = someRoles.get(0);\n" +
- " role.print();\n" +
+ " @NonNull MyRole<@t> role = someRoles.get(0);\n" +
+ " role.print();\n" +
" }\n" +
"}\n",
"MyTeam.java",
@@ -200,11 +200,11 @@ public class OTNullTypeAnnotationTest extends AbstractOTJLDNullAnnotationTest {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in Main.java (at line 5)\n" +
- " @NonNull MyRole<@t> role = someRoles.get(0);\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'MyTeam.@NonNull MyRole\' but this expression has type \'MyTeam.@Nullable MyRole\'\n" +
+ "----------\n" +
+ "1. ERROR in Main.java (at line 5)\n" +
+ " @NonNull MyRole<@t> role = someRoles.get(0);\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'MyTeam.@NonNull MyRole\' but this expression has type \'MyTeam.@Nullable MyRole\'\n" +
"----------\n");
}
@@ -224,11 +224,11 @@ public class OTNullTypeAnnotationTest extends AbstractOTJLDNullAnnotationTest {
"public class MyBase {}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in MyTeam.java (at line 6)\n" +
- " void test(@Nullable MyBase as @NonNull MyRole r) {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'MyTeam.@NonNull MyRole\' but this expression has type \'@Nullable MyBase\'\n" +
+ "----------\n" +
+ "1. ERROR in MyTeam.java (at line 6)\n" +
+ " void test(@Nullable MyBase as @NonNull MyRole r) {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'MyTeam.@NonNull MyRole\' but this expression has type \'@Nullable MyBase\'\n" +
"----------\n");
}
@@ -249,16 +249,16 @@ public class OTNullTypeAnnotationTest extends AbstractOTJLDNullAnnotationTest {
"public class MyBase {}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in MyTeam.java (at line 6)\n" +
- " void test1(MyBase @Nullable[] as MyRole @NonNull[] r) {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'MyTeam.MyRole @NonNull[]\' but this expression has type \'MyBase @Nullable[]\'\n" +
- "----------\n" +
- "2. ERROR in MyTeam.java (at line 7)\n" +
- " void test2(@Nullable MyBase @NonNull[] as @NonNull MyRole @NonNull[] r) {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'MyTeam.@NonNull MyRole @NonNull[]\' but this expression has type \'@Nullable MyBase @NonNull[]\'\n" +
+ "----------\n" +
+ "1. ERROR in MyTeam.java (at line 6)\n" +
+ " void test1(MyBase @Nullable[] as MyRole @NonNull[] r) {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'MyTeam.MyRole @NonNull[]\' but this expression has type \'MyBase @Nullable[]\'\n" +
+ "----------\n" +
+ "2. ERROR in MyTeam.java (at line 7)\n" +
+ " void test2(@Nullable MyBase @NonNull[] as @NonNull MyRole @NonNull[] r) {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'MyTeam.@NonNull MyRole @NonNull[]\' but this expression has type \'@Nullable MyBase @NonNull[]\'\n" +
"----------\n");
}
@@ -269,12 +269,12 @@ public class OTNullTypeAnnotationTest extends AbstractOTJLDNullAnnotationTest {
"import java.util.*;\n" +
"import org.eclipse.jdt.annotation.*;\n" +
"public class X {\n" +
- " public static <C extends Collection<?>>@NonNull C requireNonEmpty(@Nullable C value) {\n" +
- " if ((value == null))\n" +
- " throw new NullPointerException();\n" +
- " if (value.isEmpty())\n" +
- " throw new IllegalArgumentException();\n" +
- " return value;\n" +
+ " public static <C extends Collection<?>>@NonNull C requireNonEmpty(@Nullable C value) {\n" +
+ " if ((value == null))\n" +
+ " throw new NullPointerException();\n" +
+ " if (value.isEmpty())\n" +
+ " throw new IllegalArgumentException();\n" +
+ " return value;\n" +
" }\n" +
"}\n"
},
@@ -308,11 +308,11 @@ public class OTNullTypeAnnotationTest extends AbstractOTJLDNullAnnotationTest {
" \n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in TeamIBC.java (at line 9)\n" +
- " base.rm2(\"wrong\", true);\n" +
- " ^^^\n" +
- "Base call rm2(Integer, boolean) is not applicable for the arguments (String, boolean)\n" +
+ "----------\n" +
+ "1. ERROR in TeamIBC.java (at line 9)\n" +
+ " base.rm2(\"wrong\", true);\n" +
+ " ^^^\n" +
+ "Base call rm2(Integer, boolean) is not applicable for the arguments (String, boolean)\n" +
"----------\n");
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/regression/CompilationOrder.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/regression/CompilationOrder.java
index 78204b8b9..f2b839696 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/regression/CompilationOrder.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/regression/CompilationOrder.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010 Stephan Herrmann
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -23,11 +23,11 @@ import junit.framework.Test;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class CompilationOrder extends AbstractOTJLDTest {
-
+
public CompilationOrder(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -35,7 +35,7 @@ public class CompilationOrder extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -50,49 +50,49 @@ public class CompilationOrder extends AbstractOTJLDTest {
runConformTest(
new String[] {
"TheTest.java",
- "public class TheTest {\n" +
- " final B b = new B();\n" +
- " final A a = new A<@b>();\n" +
- "\n" +
- " public void run() {\n" +
- " within(b) {\n" +
- " a.run();\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new TheTest().run();\n" +
- " }\n" +
+ "public class TheTest {\n" +
+ " final B b = new B();\n" +
+ " final A a = new A<@b>();\n" +
+ "\n" +
+ " public void run() {\n" +
+ " within(b) {\n" +
+ " a.run();\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new TheTest().run();\n" +
+ " }\n" +
" }",
"A.java",
- "public team class A<B b> {\n" +
- " public void run() {\n" +
- " System.out.println(\"A.run()\");\n" +
- " }\n" +
- " public class Q playedBy R<@b> {\n" +
+ "public team class A<B b> {\n" +
+ " public void run() {\n" +
+ " System.out.println(\"A.run()\");\n" +
+ " }\n" +
+ " public class Q playedBy R<@b> {\n" +
" @SuppressWarnings(\"decapsulation\")\n" +
- " void run() <- replace void run();\n" +
- " // 1. originally the compiler forced to declare \'Object run()\'\n" +
- " // 2. compile process is fragile with circular references, like in this exercise\n" +
- " callin void run() {\n" +
- " base.run();\n" +
- " System.out.println(\"callin: Q.run()\");\n" +
- " }\n" +
- " } \n" +
+ " void run() <- replace void run();\n" +
+ " // 1. originally the compiler forced to declare \'Object run()\'\n" +
+ " // 2. compile process is fragile with circular references, like in this exercise\n" +
+ " callin void run() {\n" +
+ " base.run();\n" +
+ " System.out.println(\"callin: Q.run()\");\n" +
+ " }\n" +
+ " } \n" +
"}",
"B.java",
- "public team class B {\n" +
- " public class R playedBy A {\n" +
- " void run() <- replace void run();\n" +
- " callin void run() {\n" +
- " base.run();\n" +
- " System.out.println(\"R.run()\");\n" +
- " }\n" +
- " } \n" +
+ "public team class B {\n" +
+ " public class R playedBy A {\n" +
+ " void run() <- replace void run();\n" +
+ " callin void run() {\n" +
+ " base.run();\n" +
+ " System.out.println(\"R.run()\");\n" +
+ " }\n" +
+ " } \n" +
"}"
},
"A.run()\nR.run()");
}
-
+
// basic case, no error observed
public void testB22_twoToplevelTeams1() {
runConformTest(
@@ -118,7 +118,7 @@ public class CompilationOrder extends AbstractOTJLDTest {
},
"OK");
}
-
+
// with two nested role-teams, witness for InternalCompilerError("Class file was not yet written to disk")
public void testB22_twoToplevelTeams2() {
runConformTest(
@@ -217,7 +217,7 @@ public class CompilationOrder extends AbstractOTJLDTest {
" }\n" +
" test2 <- after bm2;\n" +
" }\n" +
- "}\n"
+ "}\n"
};
runner.runConformTest();
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/regression/ComplexStructures.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/regression/ComplexStructures.java
index 84ff320e0..c9a7fe8f0 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/regression/ComplexStructures.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/regression/ComplexStructures.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2013 GK Software AG.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -22,7 +22,7 @@ import junit.framework.Test;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class ComplexStructures extends AbstractOTJLDTest {
-
+
public ComplexStructures(String name) {
super(name);
}
@@ -42,46 +42,46 @@ public class ComplexStructures extends AbstractOTJLDTest {
public static Class testClass() {
return ComplexStructures.class;
}
-
+
public void testRoleCtor01() {
runConformTest(
new String[] {
"SomeTeam.java",
- "public team class SomeTeam {\n" +
- "\n" +
- " public class BGraph {\n" +
- " public BGraph() { }\n" +
- " }\n" +
- "\n" +
- "\n" +
- " public void test() {\n" +
- " final Features f = new Features();\n" +
- " BasicGraph<@f> g3 = f.newBasicGraphException();\n" +
- " g3.print();\n" +
- " }\n" +
- "\n" +
- " public team class Features {\n" +
- " protected BasicGraph newBasicGraphException() {\n" +
- " return new BasicGraph();\n" +
- " }\n" +
- "\n" +
- " public team class BasicGraph playedBy BGraph {\n" +
- " public BasicGraph() { base(); }\n" +
- "\n" +
- " public void print() {\n" +
- " System.out.println(\"I am a basic graph ...\");\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " new SomeTeam().test();\n" +
- " }\n" +
+ "public team class SomeTeam {\n" +
+ "\n" +
+ " public class BGraph {\n" +
+ " public BGraph() { }\n" +
+ " }\n" +
+ "\n" +
+ "\n" +
+ " public void test() {\n" +
+ " final Features f = new Features();\n" +
+ " BasicGraph<@f> g3 = f.newBasicGraphException();\n" +
+ " g3.print();\n" +
+ " }\n" +
+ "\n" +
+ " public team class Features {\n" +
+ " protected BasicGraph newBasicGraphException() {\n" +
+ " return new BasicGraph();\n" +
+ " }\n" +
+ "\n" +
+ " public team class BasicGraph playedBy BGraph {\n" +
+ " public BasicGraph() { base(); }\n" +
+ "\n" +
+ " public void print() {\n" +
+ " System.out.println(\"I am a basic graph ...\");\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " new SomeTeam().test();\n" +
+ " }\n" +
"}\n"
},
"I am a basic graph ...");
}
-
+
public void testMultiLevelSuper1() {
runConformTest(
new String[] {
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/regression/DevelopmentExamples.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/regression/DevelopmentExamples.java
index 35b7903c6..c35f55a6d 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/regression/DevelopmentExamples.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/regression/DevelopmentExamples.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2005-2016 Berlin Institute of Technology, Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Berlin Institute of Technology - Initial API and implementation
**********************************************************************/
@@ -33,11 +33,11 @@ import junit.framework.Test;
*/
@SuppressWarnings("unchecked")
public class DevelopmentExamples extends AbstractOTJLDTest {
-
+
public DevelopmentExamples(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -45,7 +45,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -57,7 +57,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// corner cases for callin with inheritance
// X.1.1-otjld-binding-inheritance-1
public void testX11_bindingInheritance1() {
-
+
runConformTest(
new String[] {
"test1/X11bi1Main.java",
@@ -375,50 +375,50 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "SubSub.Role2.hook()\n" +
- "B1.getInt() called!\n" +
- "3\n" +
- "CallinSub.Role2.check(1)\n" +
- "B1.setInt(1) called!\n" +
- "CallinSuper.Role.check(1)\n" +
- "B1.setInt(1) called!\n" +
- "--------------------------------------\n" +
- "SubSub.Role2.hook()\n" +
- "B1.nop() called!\n" +
- "--------------------------------------\n" +
- "SubSubTeam.RoleNOP.nop() called!\n" +
- "B1.nop(int) called!\n" +
- "--------------------------------------\n" +
- "SubSubTeam.RoleX.format: GXeXsXcXhXeXnXkX\n" +
- "B2.print: von SubSubTeam.RoleX\n" +
- "SubSubTeam.Role3.format: Geschenk\n" +
- "B2.print: von SubSubTeam.Role3\n" +
- "CallinSub.Role3.format: G e s c h e n k \n" +
- "B2.print: von CallinSub.Role3\n" +
- "CallinSuper.Role3.format: GESCHENK\n" +
- "B2.print: von CallinSuper.Role3\n" +
- "-------------------- Test for Base-Subclassing ---------------\n" +
- "Person.goToWork()\n" +
- "---- just one sub base (Man) is effected by a callin ------\n" +
- "---- defined in a sub role (BWLStudent):-----------------------\n" +
- "She (Yukiko) gose to work.\n" +
- "Stundent.enterClassroom()\n" +
- "He (Tanaka) gose to work.\n" +
- "----- callins are effective even for inherited base methods in sub bases: ------\n" +
- "Person.haveFun()\n" +
- "Stundent.enterClassroom()\n" +
- "Person.haveFun()\n" +
- "----- callins are inherited to neither redefinded nor rebound base methods: --\n" +
- "Stundent.doHomework()\n" +
- "Person.performWorkstep()\n" +
- "Stundent.doHomework()\n" +
+ "SubSub.Role2.hook()\n" +
+ "B1.getInt() called!\n" +
+ "3\n" +
+ "CallinSub.Role2.check(1)\n" +
+ "B1.setInt(1) called!\n" +
+ "CallinSuper.Role.check(1)\n" +
+ "B1.setInt(1) called!\n" +
+ "--------------------------------------\n" +
+ "SubSub.Role2.hook()\n" +
+ "B1.nop() called!\n" +
+ "--------------------------------------\n" +
+ "SubSubTeam.RoleNOP.nop() called!\n" +
+ "B1.nop(int) called!\n" +
+ "--------------------------------------\n" +
+ "SubSubTeam.RoleX.format: GXeXsXcXhXeXnXkX\n" +
+ "B2.print: von SubSubTeam.RoleX\n" +
+ "SubSubTeam.Role3.format: Geschenk\n" +
+ "B2.print: von SubSubTeam.Role3\n" +
+ "CallinSub.Role3.format: G e s c h e n k \n" +
+ "B2.print: von CallinSub.Role3\n" +
+ "CallinSuper.Role3.format: GESCHENK\n" +
+ "B2.print: von CallinSuper.Role3\n" +
+ "-------------------- Test for Base-Subclassing ---------------\n" +
+ "Person.goToWork()\n" +
+ "---- just one sub base (Man) is effected by a callin ------\n" +
+ "---- defined in a sub role (BWLStudent):-----------------------\n" +
+ "She (Yukiko) gose to work.\n" +
+ "Stundent.enterClassroom()\n" +
+ "He (Tanaka) gose to work.\n" +
+ "----- callins are effective even for inherited base methods in sub bases: ------\n" +
+ "Person.haveFun()\n" +
+ "Stundent.enterClassroom()\n" +
+ "Person.haveFun()\n" +
+ "----- callins are inherited to neither redefinded nor rebound base methods: --\n" +
+ "Stundent.doHomework()\n" +
+ "Person.performWorkstep()\n" +
+ "Stundent.doHomework()\n" +
"Person.performWorkstep()");
}
// inherit a role method binding declared in the the super-super role of the super-super team
// X.1.1-otjld-binding-inheritance-2
public void testX11_bindingInheritance2() {
-
+
runConformTest(
new String[] {
"test1/MainX112.java",
@@ -487,7 +487,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// redefine a role method in a sub role in a sub team
// X.1.1-otjld-binding-inheritance-3
public void testX11_bindingInheritance3() {
-
+
runConformTest(
new String[] {
"test1/MainX113.java",
@@ -544,7 +544,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// redefine a role method in a sub role in a sub team (start compile at Main)
// X.1.1-otjld-binding-inheritance-3a
public void testX11_bindingInheritance3a() {
-
+
runConformTest(
new String[] {
"test1/MainX113a.java",
@@ -602,7 +602,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// redefine a role method in a sub role in a sub team (default package)
// X.1.1-otjld-binding-inheritance-3b
public void testX11_bindingInheritance3b() {
-
+
runConformTest(
new String[] {
"MainX113b.java",
@@ -655,7 +655,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// super call in base method - super-super method is adapted too
// X.1.1-otjld-binding-inheritance-4
public void testX11_bindingInheritance4() {
-
+
runConformTest(
new String[] {
"MainX114.java",
@@ -721,7 +721,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// super call in base method - only super-super method is adapted
// X.1.1-otjld-binding-inheritance-4a
public void testX11_bindingInheritance4a() {
-
+
runConformTest(
new String[] {
"MainX114a.java",
@@ -782,7 +782,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// super call in base method - only super-super method is adapted, complete explicit super-chain , replace binding
// X.1.1-otjld-binding-inheritance-4b
public void testX11_bindingInheritance4b() {
-
+
runConformTest(
new String[] {
"MainX114b.java",
@@ -850,7 +850,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// wicked super call interferes with callin binding
// X.1.1-otjld-binding-inheritance-4c
public void testX11_bindingInheritance4c() {
-
+
runConformTest(
new String[] {
"TeamX114c.java",
@@ -891,7 +891,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// super call in base method - like 4a but with relevant signature
public void testX11_bindingInheritance4d() {
-
+
runConformTest(
new String[] {
"MainX114d.java",
@@ -1040,7 +1040,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// after callin inherited from super role, before callin to the same base method added
// X.1.1-otjld-binding-inheritance-5
public void testX11_bindingInheritance5() {
-
+
runConformTest(
new String[] {
"MainX115.java",
@@ -1090,7 +1090,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// after callin inherited from super base, before callin added to the same (inherited) base method in sub base
// X.1.1-otjld-binding-inheritance-6
public void testX11_bindingInheritance6() {
-
+
runConformTest(
new String[] {
"MainX116.java",
@@ -1141,7 +1141,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// callin inherited from a super base, another callin to a different team is added to the same base method in the sub base
// X.1.1-otjld-binding-inheritance-7
public void testX11_bindingInheritance7() {
-
+
runConformTest(
new String[] {
"MainX117.java",
@@ -1232,7 +1232,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// overridden callin method with non-void return type calls 'tsuper'
// X.1.1-otjld-binding-inheritance-8
public void testX11_bindingInheritance8() {
-
+
runConformTest(
new String[] {
"MainX118.java",
@@ -1288,7 +1288,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// overridden callin method with non-void basic return type calls 'tsuper'
// X.1.1-otjld-binding-inheritance-8a
public void testX11_bindingInheritance8a() {
-
+
runConformTest(
new String[] {
"MainX118a.java",
@@ -1344,7 +1344,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// a base class which is a role at the same time inherits a binding form its implicit super (role) class
// X.1.1-otjld-binding-inheritance-9
public void testX11_bindingInheritance9() {
-
+
runConformTest(
new String[] {
"TX11bi9Main.java",
@@ -1429,7 +1429,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// a base class which is a role at the same time inherits a binding form its implicit super-super (role) class
// X.1.1-otjld-binding-inheritance-10
public void testX11_bindingInheritance10() {
-
+
runConformTest(
new String[] {
"TX11bi10Main.java",
@@ -1519,7 +1519,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// A role inherits a replace binding, sub-base is bound to an unrelated role (reported by Marco Mosconi)
// X.1.1-otjld-binding-inheritance-11
public void testX11_bindingInheritance11() {
-
+
runConformTest(
new String[] {
"TeamX11bi11.java",
@@ -1578,7 +1578,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// a super-call bypasses a callin binding
// X.1.1-otjld-binding-inheritance-12
public void testX11_bindingInheritance12() {
-
+
runConformTest(
new String[] {
"TeamX11bi12.java",
@@ -1620,7 +1620,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// a super-call bypasses a callin binding - other team binds super version
// X.1.1-otjld-binding-inheritance-13
public void testX11_bindingInheritance13() {
-
+
runConformTest(
new String[] {
"TeamX11bi13_2.java",
@@ -1672,7 +1672,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// a callin to a private base method does not affect the unrelated version in a sub-base (reported by Oliver Frank)
// X.1.1-otjld-binding-inheritance-14
public void testX11_bindingInheritance14() {
-
+
runConformTest(
new String[] {
"TeamX11bi14.java",
@@ -1711,7 +1711,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// modeled after a situation in PullUpAdaptor, that could cause StackOverflowError
// (bug not reproduced, though, due to different loading sequence).
public void testX11_bindingInheritance15() {
-
+
runConformTest(
new String[] {
"TeamX11bi15.java",
@@ -1757,36 +1757,36 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
runConformTest(
new String[] {
"MT.java",
- "public team class MT {\n" +
- " public class R playedBy C1A {\n" +
- " void bm() <- replace void bm();\n" +
- " callin void bm() {\n" +
- " System.out.print(\"R\");\n" +
- " base.bm();\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new MT().activate();\n" +
- " new C1B().bm();\n" +
- " }\n" +
+ "public team class MT {\n" +
+ " public class R playedBy C1A {\n" +
+ " void bm() <- replace void bm();\n" +
+ " callin void bm() {\n" +
+ " System.out.print(\"R\");\n" +
+ " base.bm();\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new MT().activate();\n" +
+ " new C1B().bm();\n" +
+ " }\n" +
"}\n",
"C0.java",
- "public class C0 {\n" +
- " public void bm() {\n" +
- " System.out.print(\"C0\");\n" +
- " }\n" +
+ "public class C0 {\n" +
+ " public void bm() {\n" +
+ " System.out.print(\"C0\");\n" +
+ " }\n" +
"}\n",
"C1A.java",
- "public class C1A extends C0 {\n" +
+ "public class C1A extends C0 {\n" +
"}\n",
"C1B.java",
- "public class C1B extends C0 {\n" +
- " @Override\n" +
- " public void bm() {\n" +
- " System.out.print(\"C1B-\");\n" +
+ "public class C1B extends C0 {\n" +
+ " @Override\n" +
+ " public void bm() {\n" +
+ " System.out.print(\"C1B-\");\n" +
" super.bm();\n" + // this super call was confused by the (unrelated) callin binding
- " System.out.print('!');\n" +
- " }\n" +
+ " System.out.print('!');\n" +
+ " }\n" +
"}\n"
},
"C1B-C0!");
@@ -1795,7 +1795,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// base call requires a result lifting
// X.1.2-otjld-result-lifting-1
public void testX12_resultLifting1() {
-
+
runConformTest(
new String[] {
"test2/X12rl1Main.java",
@@ -1871,11 +1871,11 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
"\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in test2\\MyTeamX121a.java (at line 9)\n" +
- " rm <- bm;\n" +
- " ^^\n" +
- "Callin modifier (before, after or replace) missing for callin-binding rm (OTJLD A.3.3).\n" +
+ "----------\n" +
+ "1. ERROR in test2\\MyTeamX121a.java (at line 9)\n" +
+ " rm <- bm;\n" +
+ " ^^\n" +
+ "Callin modifier (before, after or replace) missing for callin-binding rm (OTJLD A.3.3).\n" +
"----------\n");
}
@@ -1923,18 +1923,18 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
"\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in test2\\MyTeamX121b.java (at line 9)\n" +
- " rm <- bm;\n" +
- " ^^\n" +
- "Callin modifier (before, after or replace) missing for callin-binding rm (OTJLD A.3.3).\n" +
+ "----------\n" +
+ "1. ERROR in test2\\MyTeamX121b.java (at line 9)\n" +
+ " rm <- bm;\n" +
+ " ^^\n" +
+ "Callin modifier (before, after or replace) missing for callin-binding rm (OTJLD A.3.3).\n" +
"----------\n");
}
// base call requires a result lifting
// X.1.2-otjld-result-lifting-1c
public void testX12_resultLifting1c() {
-
+
runConformTest(
new String[] {
"test2/X12rl1cMain.java",
@@ -2015,18 +2015,18 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in test2\\MySuperTeamX122a.java (at line 7)\n" +
- " return base.m1();\n" +
- " ^^^^^^^^^\n" +
- "Illegal method in base call, can only call base version of the enclosing method rm() (OTJLD 4.3(a)).\n" +
+ "----------\n" +
+ "1. ERROR in test2\\MySuperTeamX122a.java (at line 7)\n" +
+ " return base.m1();\n" +
+ " ^^^^^^^^^\n" +
+ "Illegal method in base call, can only call base version of the enclosing method rm() (OTJLD 4.3(a)).\n" +
"----------\n");
}
// base call requires a result lifting - team hierarchy
// X.1.2-otjld-result-lifting-2
public void testX12_resultLifting2() {
-
+
runConformTest(
new String[] {
"test2/MainX122.java",
@@ -2091,7 +2091,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// team hierarchy - creating empty subsub team with empty superteam
// X.1.2-otjld-result-lifting-3
public void testX12_resultLifting3() {
-
+
runConformTest(
new String[] {
"test2/MainX123.java",
@@ -2149,7 +2149,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// team hierarchy - creating empty subsub team with empty superteam (different compiler invocation)
// X.1.2-otjld-result-lifting-3a
public void testX12_resultLifting3a() {
-
+
runConformTest(
new String[] {
"test2/MainX123a.java",
@@ -2207,7 +2207,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// desc???
// X.1.2-otjld-result-lifting-4
public void testX12_resultLifting4() {
-
+
runConformTest(
new String[] {
"test2/Main4.java",
@@ -2291,7 +2291,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// base call result lifting for role in nested team
// X.1.2-otjld-result-lifting-5
public void testX12_resultLifting5() {
-
+
runConformTest(
new String[] {
"test2/MainX125.java",
@@ -2351,7 +2351,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// callin to callin to callin to base method with base calls
// X.1.3-otjld-callin-to-callin-1
public void testX13_callinToCallin1() {
-
+
runConformTest(
new String[] {
"test3/MainX131.java",
@@ -2440,7 +2440,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// X.1.3-otjld-callin-to-callin-2
public void testX13_callinToCallin2() {
Map customOptions = getCompilerOptions();
-
+
runConformTest(
new String[] {
"test3/MainX132.java",
@@ -2545,7 +2545,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// X.1.3-otjld-callin-to-callin-2a
public void testX13_callinToCallin2a() {
Map customOptions = getCompilerOptions();
-
+
runConformTest(
new String[] {
"test3/MainX132a.java",
@@ -2650,7 +2650,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// X.1.3-otjld-callin-to-callin-3
public void testX13_callinToCallin3() {
Map customOptions = getCompilerOptions();
-
+
runConformTest(
new String[] {
"test3/MainX133.java",
@@ -2736,7 +2736,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// X.1.3-otjld-static-callin-to-callin-1
public void testX13_staticCallinToCallin1() {
Map customOptions = getCompilerOptions();
-
+
runConformTest(
new String[] {
"test3/MainX13sctc1.java",
@@ -2829,7 +2829,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// (replace) callin from one role method to two base methods with the same name but different signatures
// X.1.4-otjld-multiple-signatures-1
public void testX14_multipleSignatures1() {
-
+
runConformTest(
new String[] {
"test4/MainX141.java",
@@ -2884,7 +2884,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// after and before callin to a static role method
// X.1.5-otjld-callin-to-static-role-method-1
public void testX15_callinToStaticRoleMethod1() {
-
+
runConformTest(
new String[] {
"test5/MainX151.java",
@@ -2932,7 +2932,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// after and before callin to the same role method
// X.1.5-otjld-after-and-before-callin-1a
public void testX15_afterAndBeforeCallin1a() {
-
+
runConformTest(
new String[] {
"test5/MainX151a.java",
@@ -3012,7 +3012,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// after callin to a static role method
// X.1.5-otjld-callin-to-static-role-method-3
public void testX15_callinToStaticRoleMethod3() {
-
+
runConformTest(
new String[] {
"test5/MainX153.java",
@@ -3097,7 +3097,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// a replace-callin binds a static base method to a static role method without arguments
// X.1.5-otjld-callin-from-static-base-method-5
public void testX15_callinFromStaticBaseMethod5() {
-
+
runConformTest(
new String[] {
"TX15cfsbm5Main.java",
@@ -3135,7 +3135,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// a replace-callin binds a static base method with a declared result to a static role method that does not declare a result
// X.1.5-otjld-callin-from-static-base-method-6
public void testX15_callinFromStaticBaseMethod6() {
-
+
runConformTest(
new String[] {
"TX15cfsbm6Main.java",
@@ -3176,7 +3176,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// replace-callin binding to a static role method with argument mapping
// X.1.5-otjld-callin-from-static-base-method-7
public void testX15_callinFromStaticBaseMethod7() {
-
+
runConformTest(
new String[] {
"TX15cfsbm7Main.java",
@@ -3316,7 +3316,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// a replace-callin binds an inherited static role method to a static base method
// X.1.5-otjld-callin-from-static-base-method-12
public void testX15_callinFromStaticBaseMethod12() {
-
+
runConformTest(
new String[] {
"TX15cfsbm12Main.java",
@@ -3361,7 +3361,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// a replace-callin binds an inherited static role method to a static base method - same team
// X.1.5-otjld-callin-from-static-base-method-12a
public void testX15_callinFromStaticBaseMethod12a() {
-
+
runConformTest(
new String[] {
"TX15cfsbm12aMain.java",
@@ -3401,7 +3401,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// a replace-callin binds an inherited static role method to a static base method - method has a role type parameter
// X.1.5-otjld-callin-from-static-base-method-12b
public void testX15_callinFromStaticBaseMethod12b() {
-
+
runConformTest(
new String[] {
"TX15cfsbm12bMain.java",
@@ -3455,7 +3455,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// a replace-callin binds an inherited static role method to a static base method - method has a role type parameter -- double compile
// X.1.5-otjld-callin-from-static-base-method-12c
public void testX15_callinFromStaticBaseMethod12c() {
-
+
runConformTest(
new String[] {
"TX15cfsbm12cMain.java",
@@ -3509,7 +3509,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// an after-callin binds an inherited static role method to a static base method
// X.1.5-otjld-callin-from-static-base-method-13
public void testX15_callinFromStaticBaseMethod13() {
-
+
runConformTest(
new String[] {
"TX15cfsbm13Main.java",
@@ -3553,7 +3553,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// a before-callin binds an inherited static role method to a static base method
// X.1.5-otjld-callin-from-static-base-method-14
public void testX15_callinFromStaticBaseMethod14() {
-
+
runConformTest(
new String[] {
"TX15cfsbm14Main.java",
@@ -3597,7 +3597,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// a replace-callin binds an inherited method (implemented within the super-super team) to a static base method
// X.1.5-otjld-callin-from-static-base-method-15
public void testX15_callinFromStaticBaseMethod15() {
-
+
runConformTest(
new String[] {
"TX15cfsbm15Main.java",
@@ -3661,7 +3661,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// static base call requires a result lifting
// X.1.5-otjld-callin-from-static-base-method-16
public void testX15_callinFromStaticBaseMethod16() {
-
+
runConformTest(
new String[] {
"TX15cfsbm16Main.java",
@@ -3703,7 +3703,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// static base call requires a result lifting; parameter involved
// X.1.5-otjld-callin-from-static-base-method-16a
public void testX15_callinFromStaticBaseMethod16a() {
-
+
runConformTest(
new String[] {
"TX15cfsbm16aMain.java",
@@ -3745,7 +3745,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// replace-callin-binding with parameter mapping (constant value)
// X.1.5-otjld-callin-from-static-base-method-17
public void testX15_callinFromStaticBaseMethod17() {
-
+
runConformTest(
new String[] {
"TX15cfsbm17Main.java",
@@ -3786,7 +3786,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// an inherited static role method is bound in different roles to different static base methods
// X.1.5-otjld-callin-from-static-base-method-18
public void testX15_callinFromStaticBaseMethod18() {
-
+
runConformTest(
new String[] {
"TX15cfsbm18Main.java",
@@ -3847,7 +3847,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// static role methods are bound to same base method
// X.1.5-otjld-callin-from-static-base-method-19
public void testX15_callinFromStaticBaseMethod19() {
-
+
runConformTest(
new String[] {
"TX15cfsbm19Main.java",
@@ -3894,7 +3894,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// static role methods of different roles are bound to same base method - no precedence needed due to different static base classes
// X.1.5-otjld-callin-from-static-base-method-19r
public void testX15_callinFromStaticBaseMethod19r() {
-
+
runConformTest(
new String[] {
"TX15cfsbm19rMain.java",
@@ -3944,7 +3944,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// static replace binding to a base method, base- and team classes are placed in a package
// X.1.5-otjld-callin-from-static-base-method-20
public void testX15_callinFromStaticBaseMethod20() {
-
+
runConformTest(
new String[] {
"cfsbm20/TX15cfsbm20Main.java",
@@ -3986,7 +3986,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// a static and a non-static role methods are bound to same base method
// X.1.5-otjld-callin-from-static-base-method-21
public void testX15_callinFromStaticBaseMethod21() {
-
+
runConformTest(
new String[] {
"TX15cfsbm21Main.java",
@@ -4030,7 +4030,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// an overridden static base method is bound to methods of different role classes
// X.1.5-otjld-callin-from-static-base-method-22
public void testX15_callinFromStaticBaseMethod22() {
-
+
runConformTest(
new String[] {
"TX15cfsbm22Main.java",
@@ -4087,7 +4087,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// an inherited static base method is bound (after) in a sub base class
// X.1.5-otjld-callin-from-static-base-method-23
public void testX15_callinFromStaticBaseMethod23() {
-
+
runConformTest(
new String[] {
"TX15cfsbm23Main.java",
@@ -4126,7 +4126,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
" }\n" +
" \n"
},
- (this.weavingScheme == WeavingScheme.OTRE
+ (this.weavingScheme == WeavingScheme.OTRE
? "OOK"
: "KK")); // see restriction https://bugs.eclipse.org/435136#c1
}
@@ -4134,7 +4134,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// an inherited static base method is bound (replace) in a sub base class
// X.1.5-otjld-callin-from-static-base-method-23a
public void testX15_callinFromStaticBaseMethod23a() {
-
+
runConformTest(
new String[] {
"TX15cfsbm23aMain.java",
@@ -4174,7 +4174,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
" }\n" +
" \n"
},
- (this.weavingScheme == WeavingScheme.OTRE
+ (this.weavingScheme == WeavingScheme.OTRE
? "OOK"
: "KK")); // see restriction https://bugs.eclipse.org/435136#c1
}
@@ -4182,7 +4182,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// a static base method is redefined and rebound (after) to a static (also redefined) role method
// X.1.5-otjld-callin-from-static-base-method-24
public void testX15_callinFromStaticBaseMethod24() {
-
+
runConformTest(
new String[] {
"TX15cfsbm24Main.java",
@@ -4238,7 +4238,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// a static base method is redefined and rebound (replace) to a static (also redefined) role method
// X.1.5-otjld-callin-from-static-base-method-24a
public void testX15_callinFromStaticBaseMethod24a() {
-
+
runConformTest(
new String[] {
"TX15cfsbm24aMain.java",
@@ -4296,7 +4296,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// if a static base method is bound in a super base class, a call to this (not redefined!) method at the subclass 'inherits' the callin
// X.1.5-otjld-callin-from-static-base-method-25
public void testX15_callinFromStaticBaseMethod25() {
-
+
runConformTest(
new String[] {
"TX15cfsbm25Main.java",
@@ -4341,7 +4341,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// replace binding of static methods - additional binding to the same role method in a sub role
// X.1.5-otjld-callin-from-static-base-method-26
public void testX15_callinFromStaticBaseMethod26() {
-
+
runConformTest(
new String[] {
"TX15cfsbm26Main.java",
@@ -4390,7 +4390,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// replace binding of static methods - additional binding to the same base method in a sub role
// X.1.5-otjld-callin-from-static-base-method-27
public void testX15_callinFromStaticBaseMethod27() {
-
+
runConformTest(
new String[] {
"TX15cfsbm27Main.java",
@@ -4439,7 +4439,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// replace binding of static methods - redefined role method in a sub role
// X.1.5-otjld-callin-from-static-base-method-28
public void testX15_callinFromStaticBaseMethod28() {
-
+
runConformTest(
new String[] {
"TX15cfsbm28Main.java",
@@ -4485,7 +4485,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// a redefined static base method does not inherit a callin binding from its version of the super class
// X.1.5-otjld-callin-from-static-base-method-29
public void testX15_callinFromStaticBaseMethod29() {
-
+
runConformTest(
new String[] {
"TX15cfsbm29Main.java",
@@ -4533,7 +4533,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// we had a problem with signature weakening in team methods across several levels of inheritance, resulting in an "abstract method" error at run-time
// X.1.6-otjld-abstract-team-method-1
public void testX16_abstractTeamMethod1() {
-
+
runConformTest(
new String[] {
"X16atmMain1.java",
@@ -4603,7 +4603,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// if a team is referenced only indirect it has to be loaded before its bases too
// X.1.7-otjld-referenced-teams-1
public void testX17_referencedTeams1() {
-
+
runConformTest(
new String[] {
"X17rtMain1.java",
@@ -4662,7 +4662,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// an after callin passes the base result to the team
// X.1.8-otjld-after-result-passing-1
public void testX18_afterResultPassing1() {
-
+
runConformTest(
new String[] {
"X18arpMain1.java",
@@ -4720,7 +4720,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
new String[] {
"p19/config1.txt",
"\n" +
- "p19.TeamX19tcf1\n"});
+ "p19.TeamX19tcf1\n"});
Map customOptions = getCompilerOptions();
runConformTest(
new String[] {
@@ -4776,7 +4776,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
"p19/config2.txt",
"\n" +
"p19.TeamX19tcf2\n" +
- "\n"
+ "\n"
});
Map customOptions = getCompilerOptions();
runConformTest(
@@ -4821,11 +4821,11 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "MyTeam.MyRole.rm()\n" +
- "MyBase.bm()\n" +
- "MyTeam.MyRole.rm()\n" +
- "MyTeam.MyRole.rm()\n" +
- "MyBase.bm()\n" +
+ "MyTeam.MyRole.rm()\n" +
+ "MyBase.bm()\n" +
+ "MyTeam.MyRole.rm()\n" +
+ "MyTeam.MyRole.rm()\n" +
+ "MyBase.bm()\n" +
"NullPointerException caught!",
null/*classLibraries*/,
false/*shouldFlushOutputDirectory*/,
@@ -5170,7 +5170,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// a sub base is bound to another team
// X.2.1-otjld-callin-with-base-inheritance-1
public void testX21_callinWithBaseInheritance1() {
-
+
runConformTest(
new String[] {
"TX21cwbi1Main.java",
@@ -5229,7 +5229,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// a sub base is bound to another role, the super base should not be affected
// X.2.1-otjld-callin-with-base-inheritance-2
public void testX21_callinWithBaseInheritance2() {
-
+
runConformTest(
new String[] {
"TX21cwbi2Main.java",
@@ -5280,7 +5280,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// object creation (invokespecial != super) in overridden callin bound base method
// X.2.1-otjld-callin-with-base-inheritance-3
public void testX21_callinWithBaseInheritance3() {
-
+
runConformTest(
new String[] {
"TX21cwbi3Main.java",
@@ -5330,7 +5330,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// overridden callin bound base method with arguments
// X.2.1-otjld-callin-with-base-inheritance-4
public void testX21_callinWithBaseInheritance4() {
-
+
runConformTest(
new String[] {
"TX21cwbi4Main.java",
@@ -5382,7 +5382,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// static replace binding with refinement of 'playedBy' in the same team + base method redefinition
// X.2.2-otjld-played-by-refinement-1
public void testX22_playedByRefinement1() {
-
+
runConformTest(
new String[] {
"TX22pbr1Main.java",
@@ -5438,7 +5438,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// static replace binding with refinement of 'playedBy' in a subteam + base method redefinition
// X.2.2-otjld-played-by-refinement-2
public void testX22_playedByRefinement2() {
-
+
runConformTest(
new String[] {
"TX22pbr2Main.java",
@@ -5498,7 +5498,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// replace binding with refinement of 'playedBy' in the same team + base method redefinition
// X.2.2-otjld-played-by-refinement-3
public void testX22_playedByRefinement3() {
-
+
runConformTest(
new String[] {
"TX22pbr3Main.java",
@@ -5553,7 +5553,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// replace binding with refinement of 'playedBy' in a subteam + base method redefinition
// X.2.2-otjld-played-by-refinement-4
public void testX22_playedByRefinement4() {
-
+
runConformTest(
new String[] {
"TX22pbr4Main.java",
@@ -5613,7 +5613,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
// replace binding with refinement of 'playedBy' in a subteam, in an implicit subrole + base method redefinition
// X.2.2-otjld-played-by-refinement-5
public void testX22_playedByRefinement5() {
-
+
runConformTest(
new String[] {
"TX22pbr5Main.java",
@@ -5715,7 +5715,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
"4.8");
}
-
+
String[] getBookingClassLibraries() {
if (this.verifier != null)
this.verifier.shutDown();
@@ -6152,7 +6152,7 @@ public class DevelopmentExamples extends AbstractOTJLDTest {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.GENERATE);
customOptions.put(CompilerOptions.OPTION_LineNumberAttribute, CompilerOptions.GENERATE);
- customOptions.put(CompilerOptions.OPTION_SourceFileAttribute, CompilerOptions.GENERATE);
+ customOptions.put(CompilerOptions.OPTION_SourceFileAttribute, CompilerOptions.GENERATE);
runConformTest(
new String[] {
"TeamX41ter1.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/regression/ReportedBugs.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/regression/ReportedBugs.java
index 5c10070c6..0b146370b 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/regression/ReportedBugs.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/regression/ReportedBugs.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2005, 2014 Berlin Institute of Technology, Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Berlin Institute of Technology - Initial API and implementation
**********************************************************************/
@@ -36,11 +36,11 @@ import junit.framework.Test;
*/
@SuppressWarnings("unchecked")
public class ReportedBugs extends AbstractOTJLDTest {
-
+
public ReportedBugs(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -48,7 +48,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -57,7 +57,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
return ReportedBugs.class;
}
-
+
String[] getClassLibraries(String jarFilename) {
String destPath = this.outputRootDirectoryPath+"/regression";
createOutputTestDirectory("/regression");
@@ -106,31 +106,31 @@ public class ReportedBugs extends AbstractOTJLDTest {
"} \n" +
" \n"
},
- "----------\n" +
- "1. ERROR in TB11sh1fMain.java (at line 5)\n" +
- " final TeamB11sh1f1 theTeam = new TeamB11sh1f();\n" +
- " ^^^^^^^^^^^^\n" +
- "TeamB11sh1f1 cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in TB11sh1fMain.java (at line 6)\n" +
- " theTeam.R1[] r1s = new theTeam.R1[1];\n" +
- " ^^^^^^^\n" +
- "theTeam cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in TB11sh1fMain.java (at line 6)\n" +
- " theTeam.R1[] r1s = new theTeam.R1[1];\n" +
- " ^^^^^^^\n" +
- "theTeam cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in TB11sh1fMain.java (at line 7)\n" +
- " r1s[0] = theTeam.new R1();\n" +
- " ^^\n" +
- "TeamB11sh1f1.R1 cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in TB11sh1fMain.java (at line 8)\n" +
- " theTeam.R3 r3 = r1s[0].getR2().getR3();\n" +
- " ^^^^^^^\n" +
- "theTeam cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in TB11sh1fMain.java (at line 5)\n" +
+ " final TeamB11sh1f1 theTeam = new TeamB11sh1f();\n" +
+ " ^^^^^^^^^^^^\n" +
+ "TeamB11sh1f1 cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in TB11sh1fMain.java (at line 6)\n" +
+ " theTeam.R1[] r1s = new theTeam.R1[1];\n" +
+ " ^^^^^^^\n" +
+ "theTeam cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in TB11sh1fMain.java (at line 6)\n" +
+ " theTeam.R1[] r1s = new theTeam.R1[1];\n" +
+ " ^^^^^^^\n" +
+ "theTeam cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in TB11sh1fMain.java (at line 7)\n" +
+ " r1s[0] = theTeam.new R1();\n" +
+ " ^^\n" +
+ "TeamB11sh1f1.R1 cannot be resolved to a type\n" +
+ "----------\n" +
+ "5. ERROR in TB11sh1fMain.java (at line 8)\n" +
+ " theTeam.R3 r3 = r1s[0].getR2().getR3();\n" +
+ " ^^^^^^^\n" +
+ "theTeam cannot be resolved to a type\n" +
"----------\n"
);
}
@@ -138,7 +138,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// reported by Robert in GebitProposalComputer
// B.1.1-otjld-sh-1
public void testB11_sh1() {
-
+
runConformTest(
new String[] {
"TB11sh1Main.java",
@@ -234,11 +234,11 @@ public class ReportedBugs extends AbstractOTJLDTest {
"} \n" +
" \n"
},
- "----------\n" +
- "1. ERROR in TeamB11sh4_1.java (at line 4)\n" +
- " foo(); \n" +
- " ^^^\n" +
- "The method foo() is undefined for the type TeamB11sh4_1\n" +
+ "----------\n" +
+ "1. ERROR in TeamB11sh4_1.java (at line 4)\n" +
+ " foo(); \n" +
+ " ^^^\n" +
+ "The method foo() is undefined for the type TeamB11sh4_1\n" +
"----------\n",
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
@@ -259,16 +259,16 @@ public class ReportedBugs extends AbstractOTJLDTest {
"} \n" +
" \n"
},
- "----------\n" +
- "1. ERROR in TeamB11sh4_2.java (at line 3)\n" +
- " TeamB11sh4_2(TB11sh4 as Role2 b) { \n" +
- " ^^^^^\n" +
- "Role2 cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in TeamB11sh4_2.java (at line 7)\n" +
- " public class Role1 extends Role2 playedBy TB11sh4 {} \n" +
- " ^^^^^\n" +
- "Role2 cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in TeamB11sh4_2.java (at line 3)\n" +
+ " TeamB11sh4_2(TB11sh4 as Role2 b) { \n" +
+ " ^^^^^\n" +
+ "Role2 cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in TeamB11sh4_2.java (at line 7)\n" +
+ " public class Role1 extends Role2 playedBy TB11sh4 {} \n" +
+ " ^^^^^\n" +
+ "Role2 cannot be resolved to a type\n" +
"----------\n",
null/*classLibraries*/,
false/*shouldFlushOutputDirectory*/,
@@ -311,11 +311,11 @@ public class ReportedBugs extends AbstractOTJLDTest {
"} \n" +
" \n"
},
- "----------\n" +
- "1. ERROR in TB11sh6.java (at line 3)\n" +
- " int team x = 1;\n" +
- " ^^^^\n" +
- "Syntax error on token \"team\", delete this token\n" +
+ "----------\n" +
+ "1. ERROR in TB11sh6.java (at line 3)\n" +
+ " int team x = 1;\n" +
+ " ^^^^\n" +
+ "Syntax error on token \"team\", delete this token\n" +
"----------\n");
}
@@ -341,11 +341,11 @@ public class ReportedBugs extends AbstractOTJLDTest {
" char charAt(int i) { return 'c'; }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in TB11sh7.java (at line 4)\n" +
- " int team x = 1;\n" +
- " ^^^^\n" +
- "Syntax error on token \"team\", delete this token\n" +
+ "----------\n" +
+ "1. ERROR in TB11sh7.java (at line 4)\n" +
+ " int team x = 1;\n" +
+ " ^^^^\n" +
+ "Syntax error on token \"team\", delete this token\n" +
"----------\n");
}
@@ -431,7 +431,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// Bug reported by Karsten Meier (miniCRM): result in after binding may need lifting
// B.1.1-otjld-sh-10
public void testB11_sh10() {
-
+
runConformTest(
new String[] {
"TeamB11sh10.java",
@@ -548,11 +548,11 @@ public class ReportedBugs extends AbstractOTJLDTest {
"} \n" +
" \n"
},
- "----------\n" +
- "1. ERROR in TeamB11sh11b.java (at line 12)\n" +
- " void setOther(R other, boolean flag) <- after void setOther(TB11sh11b other) \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Incomplete parameter mapping: argument flag of role method void setOther(R other, boolean flag) is not mapped (OTJLD 4.4(a)).\n" +
+ "----------\n" +
+ "1. ERROR in TeamB11sh11b.java (at line 12)\n" +
+ " void setOther(R other, boolean flag) <- after void setOther(TB11sh11b other) \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Incomplete parameter mapping: argument flag of role method void setOther(R other, boolean flag) is not mapped (OTJLD 4.4(a)).\n" +
"----------\n");
}
@@ -579,7 +579,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// detected while creating an example for discussion with Erik Ernst
// B.1.1-otjld-sh-13
public void testB11_sh13() {
-
+
runConformTest(
new String[] {
"TeamB11sh13_2.java",
@@ -629,7 +629,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// TPX-320 nested copy of callout
// B.1.1-otjld-sh-14
public void testB11_sh14() {
-
+
runConformTest(
new String[] {
"TeamB11sh14.java",
@@ -693,18 +693,18 @@ public class ReportedBugs extends AbstractOTJLDTest {
"} \n" +
" \n"
},
- "----------\n" +
- "1. ERROR in TeamB11sh15.java (at line 3)\n" +
- " public team class TeamB11sh15 {}\n" +
- " ^^^^^^^^^^^\n" +
- "The nested type TeamB11sh15 cannot hide an enclosing type\n" +
+ "----------\n" +
+ "1. ERROR in TeamB11sh15.java (at line 3)\n" +
+ " public team class TeamB11sh15 {}\n" +
+ " ^^^^^^^^^^^\n" +
+ "The nested type TeamB11sh15 cannot hide an enclosing type\n" +
"----------\n");
}
// white box: breaking MessageSend.resolve by externally invoking a shorthand callout
// B.1.1-otjld-sh-16
public void testB11_sh16() {
-
+
runConformTest(
new String[] {
"TB11sh16Main.java",
@@ -743,7 +743,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// local class in parameter mapping - reported by hsudhof, see SessionDeployment
// B.1.1-otjld-sh-17
public void testB11_sh17() {
-
+
runConformTest(
new String[] {
"TeamB11sh17.java",
@@ -790,7 +790,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// TPX-397: conflict between resolution of anchored types and sorting of field bindings
// B.1.1-otjld-sh-18
public void testB11_sh18() {
-
+
runConformTest(
new String[] {
"p2/C3.java",
@@ -868,7 +868,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// from Dehla's error log: enum fields have no declared type
// B.1.1-otjld-sh-20
public void testB11_sh20() {
-
+
runConformTest(
new String[] {
"TeamB11sh20.java",
@@ -892,7 +892,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// conflict between weakening of a team's field's type and interface implementation - occurred in hierarchy:ColumnTree.<init>(MyTreeNode)
// B.1.1-otjld-sh-21
public void testB11_sh21() {
-
+
runConformTest(
new String[] {
"TeamB11sh21_2.java",
@@ -944,7 +944,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// conflict between weakening of a team's field's type and interface implementation - same as above but method instead of ctor
// B.1.1-otjld-sh-22
public void testB11_sh22() {
-
+
runConformTest(
new String[] {
"TeamB11sh22_2.java",
@@ -1086,11 +1086,11 @@ public class ReportedBugs extends AbstractOTJLDTest {
" String toUpperCase() { return \"\"; }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in TeamB11sh26.java (at line 3)\n" +
- " protected class // unfinished\n" +
- " ^^^^^\n" +
- "Syntax error on token \"class\", callin expected\n" +
+ "----------\n" +
+ "1. ERROR in TeamB11sh26.java (at line 3)\n" +
+ " protected class // unfinished\n" +
+ " ^^^^^\n" +
+ "Syntax error on token \"class\", callin expected\n" +
"----------\n");
}
@@ -1116,11 +1116,11 @@ public class ReportedBugs extends AbstractOTJLDTest {
" String toUpperCase() { return \"\"; }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in TeamB11sh27.java (at line 3)\n" +
- " protected class // unfinished\n" +
- " ^^^^^\n" +
- "Syntax error on token \"class\", callin expected\n" +
+ "----------\n" +
+ "1. ERROR in TeamB11sh27.java (at line 3)\n" +
+ " protected class // unfinished\n" +
+ " ^^^^^\n" +
+ "Syntax error on token \"class\", callin expected\n" +
"----------\n");
}
@@ -1153,7 +1153,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// A callin method has a name that is misinterpreted as a creator method - reported by kmeier on 07/12/06
// B.1.1-otjld-sh-29
public void testB11_sh29() {
-
+
runConformTest(
new String[] {
"TeamB11sh29.java",
@@ -1212,7 +1212,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// TPX-458
// B.1.1-otjld-sh-31
public void testB11_sh31() {
-
+
runConformTest(
new String[] {
"TeamB11sh31_3.java",
@@ -1261,7 +1261,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// The bug leading to the workaround leading to TPX-458
// B.1.1-otjld-sh-32
public void testB11_sh32() {
-
+
runConformTest(
new String[] {
"TeamB11sh32_3.java",
@@ -1311,7 +1311,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// broken control flow in woven base, observed in CompletionAdaptor
// B.1.1-otjld-sh-34
public void testB11_sh34() {
-
+
runConformTest(
new String[] {
"TeamB11sh34.java",
@@ -1387,11 +1387,11 @@ public class ReportedBugs extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in TeamB11sh35.java (at line 5)\n" +
- " Object o = new Missing() {\n" +
- " ^^^^^^^\n" +
- "Missing cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in TeamB11sh35.java (at line 5)\n" +
+ " Object o = new Missing() {\n" +
+ " ^^^^^^^\n" +
+ "Missing cannot be resolved to a type\n" +
"----------\n");
}
@@ -1416,16 +1416,16 @@ public class ReportedBugs extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in TeamB11sh36.java (at line 4)\n" +
- " toString => // incomplete\n" +
- " ^^\n" +
- "Syntax error on token \"=>\", delete this token\n" +
- "----------\n" +
- "2. ERROR in TeamB11sh36.java (at line 5)\n" +
- " R() {}\n" +
- " ^\n" +
- "No method R found in type TB11sh36 to resolve method designator (OTJLD 3.1(c)).\n" +
+ "----------\n" +
+ "1. ERROR in TeamB11sh36.java (at line 4)\n" +
+ " toString => // incomplete\n" +
+ " ^^\n" +
+ "Syntax error on token \"=>\", delete this token\n" +
+ "----------\n" +
+ "2. ERROR in TeamB11sh36.java (at line 5)\n" +
+ " R() {}\n" +
+ " ^\n" +
+ "No method R found in type TB11sh36 to resolve method designator (OTJLD 3.1(c)).\n" +
"----------\n");
}
@@ -1463,7 +1463,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// lowering-confusion reported by mehner in SportCourseManagement: tried to lower an exception, but only its ctor-arg should be lowered
// B.1.1-otjld-sh-38
public void testB11_sh38() {
-
+
runConformTest(
new String[] {
"TeamB11sh38.java",
@@ -1511,7 +1511,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// copy inheritance for subclass of JFrame: couldn't deal with type variables in signatures to copy
// B.1.1-otjld-sh-39
public void testB11_sh39() {
-
+
String[] files = {
"TeamB11sh39_2.java",
"\n" +
@@ -1548,7 +1548,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// multiple anonymous classes, implicitely inherited
// B.1.1-otjld-sh-40
public void testB11_sh40() {
-
+
runConformTest(
new String[] {
"TeamB11sh40_2.java",
@@ -1598,7 +1598,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// multiple anonymous classes, implicitely inherited - reuse binary of local
// B.1.1-otjld-sh-40f
public void testB11_sh40f() {
-
+
runConformTest(
new String[] {
"TeamB11sh40f_2.java",
@@ -1648,7 +1648,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// reported by kmeier
// B.1.1-otjld-sh-41
public void testB11_sh41() {
-
+
runConformTest(
new String[] {
"TeamB11sh41_3.java",
@@ -1698,7 +1698,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// check added by resix
// B.1.1-otjld-sh-41a
public void testB11_sh41a() {
-
+
runConformTest(
new String[] {
"TeamB11sh41a_3.java",
@@ -1753,7 +1753,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// B.1.1-otjld-sh-42
public void testB11_sh42() {
Map customOptions = getCompilerOptions();
-
+
runConformTest(
new String[] {
"TB11sh42Main.java",
@@ -1888,7 +1888,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// conflicting package and field
// B.1.1-otjld-sh-45
public void testB11_sh45() {
-
+
runConformTest(
new String[] {
"p2/TeamB11sh45_2.java",
@@ -2090,58 +2090,58 @@ public class ReportedBugs extends AbstractOTJLDTest {
},
(this.weavingScheme == WeavingScheme.OTRE && IS_JRE_8
?
- "----------\n" +
- "1. WARNING in TeamB11sh47.java (at line 6)\n" +
- " protected class R1 playedBy JFrame {\n" +
- " ^^^^^^\n" +
- "Base class javax.swing.JFrame has class file version 52 which cannot be handled by the traditional OTRE based on BCEL. Please consider using the ASM based OTDRE instead.\n" +
- "----------\n" +
- "2. ERROR in TeamB11sh47.java (at line 11)\n" +
- " correct <- replace show;\n" +
- " ^^^^\n" +
- "Method specifier \"show\" is ambiguous for the type javax.swing.JFrame. Please use the exact method signature to disambiguate (OTJLD 4.1(c)).\n" +
- "----------\n" +
- "3. ERROR in TeamB11sh47.java (at line 14)\n" +
- " protected class Unfinished playedBy\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error on token(s), misplaced construct(s)\n" +
- "----------\n" +
- "4. ERROR in TeamB11sh47.java (at line 15)\n" +
- " protected class R3 playedBy String {\n" +
- " ^^\n" +
- "Member types not allowed in regular roles. Mark class TeamB11sh47.Unfinished as a team if R3 should be its role (OTJLD 1.5(a,b)). \n" +
- "----------\n" +
- "5. WARNING in TeamB11sh47.java (at line 15)\n" +
- " protected class R3 playedBy String {\n" +
- " ^^^^^^\n" +
- "PlayedBy binding overrides finalness of base class java.lang.String (OTJLD 2.1.2(c)).\n" +
- "----------\n" +
- "6. WARNING in TeamB11sh47.java (at line 15)\n" +
- " protected class R3 playedBy String {\n" +
- " ^^^^^^\n" +
- "Base class java.lang.String has class file version 52 which cannot be handled by the traditional OTRE based on BCEL. Please consider using the ASM based OTDRE instead.\n" +
+ "----------\n" +
+ "1. WARNING in TeamB11sh47.java (at line 6)\n" +
+ " protected class R1 playedBy JFrame {\n" +
+ " ^^^^^^\n" +
+ "Base class javax.swing.JFrame has class file version 52 which cannot be handled by the traditional OTRE based on BCEL. Please consider using the ASM based OTDRE instead.\n" +
+ "----------\n" +
+ "2. ERROR in TeamB11sh47.java (at line 11)\n" +
+ " correct <- replace show;\n" +
+ " ^^^^\n" +
+ "Method specifier \"show\" is ambiguous for the type javax.swing.JFrame. Please use the exact method signature to disambiguate (OTJLD 4.1(c)).\n" +
+ "----------\n" +
+ "3. ERROR in TeamB11sh47.java (at line 14)\n" +
+ " protected class Unfinished playedBy\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error on token(s), misplaced construct(s)\n" +
+ "----------\n" +
+ "4. ERROR in TeamB11sh47.java (at line 15)\n" +
+ " protected class R3 playedBy String {\n" +
+ " ^^\n" +
+ "Member types not allowed in regular roles. Mark class TeamB11sh47.Unfinished as a team if R3 should be its role (OTJLD 1.5(a,b)). \n" +
+ "----------\n" +
+ "5. WARNING in TeamB11sh47.java (at line 15)\n" +
+ " protected class R3 playedBy String {\n" +
+ " ^^^^^^\n" +
+ "PlayedBy binding overrides finalness of base class java.lang.String (OTJLD 2.1.2(c)).\n" +
+ "----------\n" +
+ "6. WARNING in TeamB11sh47.java (at line 15)\n" +
+ " protected class R3 playedBy String {\n" +
+ " ^^^^^^\n" +
+ "Base class java.lang.String has class file version 52 which cannot be handled by the traditional OTRE based on BCEL. Please consider using the ASM based OTDRE instead.\n" +
"----------\n"
:
- "----------\n" +
- "1. ERROR in TeamB11sh47.java (at line 11)\n" +
- " correct <- replace show;\n" +
- " ^^^^\n" +
- "Method specifier \"show\" is ambiguous for the type javax.swing.JFrame. Please use the exact method signature to disambiguate (OTJLD 4.1(c)).\n" +
- "----------\n" +
- "2. ERROR in TeamB11sh47.java (at line 14)\n" +
- " protected class Unfinished playedBy\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error on token(s), misplaced construct(s)\n" +
- "----------\n" +
- "3. ERROR in TeamB11sh47.java (at line 15)\n" +
- " protected class R3 playedBy String {\n" +
- " ^^\n" +
- "Member types not allowed in regular roles. Mark class TeamB11sh47.Unfinished as a team if R3 should be its role (OTJLD 1.5(a,b)). \n" +
- "----------\n"+
- "4. WARNING in TeamB11sh47.java (at line 15)\n" +
- " protected class R3 playedBy String {\n" +
- " ^^^^^^\n" +
- "PlayedBy binding overrides finalness of base class java.lang.String (OTJLD 2.1.2(c)).\n" +
+ "----------\n" +
+ "1. ERROR in TeamB11sh47.java (at line 11)\n" +
+ " correct <- replace show;\n" +
+ " ^^^^\n" +
+ "Method specifier \"show\" is ambiguous for the type javax.swing.JFrame. Please use the exact method signature to disambiguate (OTJLD 4.1(c)).\n" +
+ "----------\n" +
+ "2. ERROR in TeamB11sh47.java (at line 14)\n" +
+ " protected class Unfinished playedBy\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error on token(s), misplaced construct(s)\n" +
+ "----------\n" +
+ "3. ERROR in TeamB11sh47.java (at line 15)\n" +
+ " protected class R3 playedBy String {\n" +
+ " ^^\n" +
+ "Member types not allowed in regular roles. Mark class TeamB11sh47.Unfinished as a team if R3 should be its role (OTJLD 1.5(a,b)). \n" +
+ "----------\n"+
+ "4. WARNING in TeamB11sh47.java (at line 15)\n" +
+ " protected class R3 playedBy String {\n" +
+ " ^^^^^^\n" +
+ "PlayedBy binding overrides finalness of base class java.lang.String (OTJLD 2.1.2(c)).\n" +
"----------\n"
),
null/*classLibraries*/,
@@ -2173,28 +2173,28 @@ public class ReportedBugs extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. WARNING in TeamB11sh48_2.java (at line 4)\n" +
- " protected class R2 playedBy R1<@base> {\n" +
- " ^^\n" +
- "Overriding access restriction of base class R1<@base> (OTJLD 2.1.2(c)).\n" +
"----------\n" +
- "----------\n" +
- "1. ERROR in TeamB11sh48_1.java (at line 3)\n" +
- " public team class TeamB11sh48_1 extends MissingTeam {\n" +
- " ^^^^^^^^^^^\n" +
- "MissingTeam cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in TeamB11sh48_1.java (at line 5)\n" +
- " protected class R1 playedBy Arrays {\n" +
- " ^^\n" +
- "The hierarchy of the type R1 is inconsistent\n" +
- "----------\n" +
+ "1. WARNING in TeamB11sh48_2.java (at line 4)\n" +
+ " protected class R2 playedBy R1<@base> {\n" +
+ " ^^\n" +
+ "Overriding access restriction of base class R1<@base> (OTJLD 2.1.2(c)).\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in TeamB11sh48_1.java (at line 3)\n" +
+ " public team class TeamB11sh48_1 extends MissingTeam {\n" +
+ " ^^^^^^^^^^^\n" +
+ "MissingTeam cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in TeamB11sh48_1.java (at line 5)\n" +
+ " protected class R1 playedBy Arrays {\n" +
+ " ^^\n" +
+ "The hierarchy of the type R1 is inconsistent\n" +
+ "----------\n" +
(this.weavingScheme == WeavingScheme.OTRE && IS_JRE_8 ?
- "3. WARNING in TeamB11sh48_1.java (at line 5)\n" +
- " protected class R1 playedBy Arrays {\n" +
- " ^^^^^^\n" +
- "Base class java.util.Arrays has class file version 52 which cannot be handled by the traditional OTRE based on BCEL. Please consider using the ASM based OTDRE instead.\n" +
+ "3. WARNING in TeamB11sh48_1.java (at line 5)\n" +
+ " protected class R1 playedBy Arrays {\n" +
+ " ^^^^^^\n" +
+ "Base class java.util.Arrays has class file version 52 which cannot be handled by the traditional OTRE based on BCEL. Please consider using the ASM based OTDRE instead.\n" +
"----------\n"
: ""
));
@@ -2213,21 +2213,21 @@ public class ReportedBugs extends AbstractOTJLDTest {
" }\n" +
"}\n" +
" \n"},
- "----------\n" +
- "1. ERROR in TeamB11sh49.java (at line 4)\n" +
- " void getString() -> toString;\n" +
- " ^^^^^^^^^\n" +
- "Method binding not allowed here, role R is not played by a base class (OTJLD 3.1(a)).\n" +
- "----------\n" +
- "2. ERROR in TeamB11sh49.java (at line 4)\n" +
- " void getString() -> toString;\n" +
- " ^^^^^^^^\n" +
- "Syntax error, insert \"Identifier (\" to complete MethodHeaderName\n" +
- "----------\n" +
- "3. ERROR in TeamB11sh49.java (at line 4)\n" +
- " void getString() -> toString;\n" +
- " ^^^^^^^^\n" +
- "Syntax error, insert \")\" to complete MethodSpecLong\n" +
+ "----------\n" +
+ "1. ERROR in TeamB11sh49.java (at line 4)\n" +
+ " void getString() -> toString;\n" +
+ " ^^^^^^^^^\n" +
+ "Method binding not allowed here, role R is not played by a base class (OTJLD 3.1(a)).\n" +
+ "----------\n" +
+ "2. ERROR in TeamB11sh49.java (at line 4)\n" +
+ " void getString() -> toString;\n" +
+ " ^^^^^^^^\n" +
+ "Syntax error, insert \"Identifier (\" to complete MethodHeaderName\n" +
+ "----------\n" +
+ "3. ERROR in TeamB11sh49.java (at line 4)\n" +
+ " void getString() -> toString;\n" +
+ " ^^^^^^^^\n" +
+ "Syntax error, insert \")\" to complete MethodSpecLong\n" +
"----------\n",
null/*classLibraries*/,
false/*shouldFlushOutputDirectory*/,
@@ -2273,11 +2273,11 @@ public class ReportedBugs extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in TeamB11sh50.java (at line 3)\n" +
- " protected class R1 playedBy Missing {\n" +
- " ^^^^^^^\n" +
- "Missing cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in TeamB11sh50.java (at line 3)\n" +
+ " protected class R1 playedBy Missing {\n" +
+ " ^^^^^^^\n" +
+ "Missing cannot be resolved to a type\n" +
"----------\n");
}
@@ -2312,7 +2312,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// curiosities if bound base method is covariantly redefined, reported by hsudof, base version: OK
// B.1.1-otjld-sh-51
public void testB11_sh51() {
-
+
runConformTest(
new String[] {
"TB11sh51_1.java",
@@ -2421,7 +2421,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// curiosities if bound base method is covariantly redefined, reported by hsudof, static type changed the behaviour
// B.1.1-otjld-sh-52
public void testB11_sh52() {
-
+
runConformTest(
new String[] {
"TB11sh52_1.java",
@@ -2478,7 +2478,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// curiosities if bound base method is covariantly redefined, reported by hsudof, referencing sub team changed behavior
// B.1.1-otjld-sh-53
public void testB11_sh53() {
-
+
runConformTest(
new String[] {
"TB11sh53_1.java",
@@ -2691,21 +2691,21 @@ public class ReportedBugs extends AbstractOTJLDTest {
"public class TB11sh60 {}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in TeamB11sh60.java (at line 2)\n" +
- " public team class TeamB11sh60 extends MissingTeam {\n" +
- " ^^^^^^^^^^^\n" +
- "MissingTeam cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in TeamB11sh60.java (at line 3)\n" +
- " public class Role extends MissingSuperRole playedBy TB11sh60 { }\n" +
- " ^^^^\n" +
- "The hierarchy of the type Role is inconsistent\n" +
- "----------\n" +
- "3. ERROR in TeamB11sh60.java (at line 3)\n" +
- " public class Role extends MissingSuperRole playedBy TB11sh60 { }\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "MissingSuperRole cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in TeamB11sh60.java (at line 2)\n" +
+ " public team class TeamB11sh60 extends MissingTeam {\n" +
+ " ^^^^^^^^^^^\n" +
+ "MissingTeam cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in TeamB11sh60.java (at line 3)\n" +
+ " public class Role extends MissingSuperRole playedBy TB11sh60 { }\n" +
+ " ^^^^\n" +
+ "The hierarchy of the type Role is inconsistent\n" +
+ "----------\n" +
+ "3. ERROR in TeamB11sh60.java (at line 3)\n" +
+ " public class Role extends MissingSuperRole playedBy TB11sh60 { }\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "MissingSuperRole cannot be resolved to a type\n" +
"----------\n");
}
@@ -2780,18 +2780,18 @@ public class ReportedBugs extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in TeamB11sh61.java (at line 51)\n" +
- " precedence Dirty, ClosePending;\n" +
- " ^^^^^^^^^^^^\n" +
- "Callin binding ClosePending not found in type TeamB11sh61.Level1 (OTJLD 4.8(b)).\n" +
+ "----------\n" +
+ "1. ERROR in TeamB11sh61.java (at line 51)\n" +
+ " precedence Dirty, ClosePending;\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Callin binding ClosePending not found in type TeamB11sh61.Level1 (OTJLD 4.8(b)).\n" +
"----------\n");
}
// witness for NPE in CallinBindingManager
// B.1.1-otjld-sh-62
public void testB11_sh62() {
-
+
runConformTest(
new String[] {
"TeamB11sh62.java",
@@ -2937,7 +2937,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// witness for base method tag overflow, old result was: "0190290390467nullnull"
// B.1.1-otjld-sh-64
public void testB11_sh64() {
-
+
runConformTest(
new String[] {
"TeamB11sh64.java",
@@ -2998,7 +2998,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// anonymous type in callin method - witness for scoping problem
// B.1.1-otjld-sh-65
public void testB11_sh65() {
-
+
runConformTest(
new String[] {
"TeamB11sh65.java",
@@ -3043,7 +3043,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// initializer in a role class
// B.1.1-otjld-sh-66
public void testB11_sh66() {
-
+
runConformTest(
new String[] {
"TeamB11sh66.java",
@@ -3148,21 +3148,21 @@ public class ReportedBugs extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. WARNING in TeamB11sh68.java (at line 2)\n" +
- " @SuppressWarnings({\"unused\",\"basecall\",\"restriction\"}) // last one is unnecessary\n" +
- " ^^^^^^^^^^\n" +
- "Unnecessary @SuppressWarnings(\"basecall\")\n" +
- "----------\n" +
- "2. WARNING in TeamB11sh68.java (at line 2)\n" +
- " @SuppressWarnings({\"unused\",\"basecall\",\"restriction\"}) // last one is unnecessary\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary @SuppressWarnings(\"restriction\")\n" +
- "----------\n" +
- "3. WARNING in TeamB11sh68.java (at line 7)\n" +
- " int getSecret() -> get int secret; // <- decapsulation warning was masked by above @SuppressWarnings\n" +
- " ^^^^^^\n" +
- "Access restriction of private field secret in type TB11sh68 is overridden by this binding (OTJLD 3.5(e)).\n" +
+ "----------\n" +
+ "1. WARNING in TeamB11sh68.java (at line 2)\n" +
+ " @SuppressWarnings({\"unused\",\"basecall\",\"restriction\"}) // last one is unnecessary\n" +
+ " ^^^^^^^^^^\n" +
+ "Unnecessary @SuppressWarnings(\"basecall\")\n" +
+ "----------\n" +
+ "2. WARNING in TeamB11sh68.java (at line 2)\n" +
+ " @SuppressWarnings({\"unused\",\"basecall\",\"restriction\"}) // last one is unnecessary\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Unnecessary @SuppressWarnings(\"restriction\")\n" +
+ "----------\n" +
+ "3. WARNING in TeamB11sh68.java (at line 7)\n" +
+ " int getSecret() -> get int secret; // <- decapsulation warning was masked by above @SuppressWarnings\n" +
+ " ^^^^^^\n" +
+ "Access restriction of private field secret in type TB11sh68 is overridden by this binding (OTJLD 3.5(e)).\n" +
"----------\n",
customOptions);
}
@@ -3170,7 +3170,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// issue with static initialization - user and generated conflicting, reported by Miguel Monteiro
// B.1.1-otjld-sh-69
public void testB11_sh69() {
-
+
runConformTest(
new String[] {
"TB11sh69Main.java",
@@ -3212,7 +3212,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// internal call should use custom ctor
// B.1.1-otjld-sh-70
public void testB11_sh70() {
-
+
runConformTest(
new String[] {
"TeamB11sh70.java",
@@ -3248,7 +3248,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// witness for ArrayStoreException found in the logs - custom ctor is never used
// B.1.1-otjld-sh-70f
public void testB11_sh70f() {
-
+
runConformTest(
new String[] {
"TeamB11sh70f.java",
@@ -3285,7 +3285,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// variant of above, right ctor resolved
// B.1.1-otjld-sh-71
public void testB11_sh71() {
-
+
runConformTest(
new String[] {
"TeamB11sh71.java",
@@ -3317,7 +3317,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// witness for NegativeArraySizeException in StackMapFrame.duplicate (pre r19271
// B.1.1-otjld-sh-72
public void testB11_sh72() {
-
+
runConformTest(
new String[] {
"TeamB11sh72.java",
@@ -3364,11 +3364,11 @@ public class ReportedBugs extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in TeamB11sh73.java (at line 5)\n" +
- " tsuper.doit(); // no tsuper available\n" +
- " ^^^^^^^^^^^^^\n" +
- "Illegal tsuper call: role TeamB11sh73.R has no implicit super class (OTJLD 1.3.1(f)).\n" +
+ "----------\n" +
+ "1. ERROR in TeamB11sh73.java (at line 5)\n" +
+ " tsuper.doit(); // no tsuper available\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Illegal tsuper call: role TeamB11sh73.R has no implicit super class (OTJLD 1.3.1(f)).\n" +
"----------\n");
}
@@ -3397,12 +3397,12 @@ public class ReportedBugs extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in TeamB11sh74_1.java (at line 4)\n" +
- " String getId() -> get int id; // bug\n" +
- " ^^^^^^^^^^^^^^\n" +
- "When binding field id via callout to role method getId():\n" +
- "Incompatible types: can\'t convert int to java.lang.String (OTJLD 3.5(b)).\n" +
+ "----------\n" +
+ "1. ERROR in TeamB11sh74_1.java (at line 4)\n" +
+ " String getId() -> get int id; // bug\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "When binding field id via callout to role method getId():\n" +
+ "Incompatible types: can\'t convert int to java.lang.String (OTJLD 3.5(b)).\n" +
"----------\n");
}
@@ -3410,7 +3410,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// B.1.1-otjld-sh-75
public void testB11_sh75() {
Map customOptions = getCompilerOptions();
-
+
runTest(
new String[] {
"TeamB11sh75_2.java",
@@ -3446,11 +3446,11 @@ public class ReportedBugs extends AbstractOTJLDTest {
" \n"
},
true/*expectingCompilerErrors*/,
- "----------\n" +
- "1. ERROR in TeamB11sh75_1.java (at line 4)\n" +
- " String mismatch() -> get String id;\n" +
- " ^^^^^^\n" +
- "Field specifier \'id\' resolves to type int whereas type java.lang.String is specified (OTJLD 3.5(a)).\n" +
+ "----------\n" +
+ "1. ERROR in TeamB11sh75_1.java (at line 4)\n" +
+ " String mismatch() -> get String id;\n" +
+ " ^^^^^^\n" +
+ "Field specifier \'id\' resolves to type int whereas type java.lang.String is specified (OTJLD 3.5(a)).\n" +
"----------\n",
"OK",
""/*expectedErrorOutput*/,
@@ -3467,7 +3467,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// B.1.1-otjld-sh-75
public void testB11_sh75a() {
Map customOptions = getCompilerOptions();
-
+
runTest(
new String[] {
"TeamB11sh75a_2.java",
@@ -3503,12 +3503,12 @@ public class ReportedBugs extends AbstractOTJLDTest {
" \n"
},
true/*expectingCompilerErrors*/,
- "----------\n" +
- "1. ERROR in TeamB11sh75a_1.java (at line 4)\n" +
- " String mismatch() -> get int id;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "When binding field id via callout to role method mismatch():\n" +
- "Incompatible types: can\'t convert int to java.lang.String (OTJLD 3.5(b)).\n" +
+ "----------\n" +
+ "1. ERROR in TeamB11sh75a_1.java (at line 4)\n" +
+ " String mismatch() -> get int id;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "When binding field id via callout to role method mismatch():\n" +
+ "Incompatible types: can\'t convert int to java.lang.String (OTJLD 3.5(b)).\n" +
"----------\n",
"OK",
""/*expectedErrorOutput*/,
@@ -3535,11 +3535,11 @@ public class ReportedBugs extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in p1\\TeamB11sh76.java (at line 5)\n" +
- " void foo (p1.TeamB11sh76.R[] roles) {}\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Illegal qualified use of non-public role R (OTJLD 1.2.3(b)).\n" +
+ "----------\n" +
+ "1. ERROR in p1\\TeamB11sh76.java (at line 5)\n" +
+ " void foo (p1.TeamB11sh76.R[] roles) {}\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Illegal qualified use of non-public role R (OTJLD 1.2.3(b)).\n" +
"----------\n");
}
@@ -3569,7 +3569,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// NPE was thrown by LiftingEnvironment if late role was unbound after inline roles are bound
// B.1.1-otjld-sh-78
public void testB11_sh78() {
-
+
runConformTest(
new String[] {
"TeamB11sh78.java",
@@ -3639,27 +3639,27 @@ public class ReportedBugs extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in TeamB11sh78f.java (at line 6)\n" +
- " R1 r = new R1();\n" +
- " ^^\n" +
- "R1 cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in TeamB11sh78f.java (at line 6)\n" +
- " R1 r = new R1();\n" +
- " ^^\n" +
- "R1 cannot be resolved to a type\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in TeamB11sh78f\\R1.java (at line 2)\n" +
- " team package Wrong;\n" +
- " ^^^^^\n" +
- "Enclosing team Wrong not found for role file R1 (OTJLD 1.2.5(c)).\n" +
- "----------\n" +
- "2. ERROR in TeamB11sh78f\\R1.java (at line 3)\n" +
- " protected class R1 {\n" +
- " ^^\n" +
- "Illegal modifier for the class R1; only public, abstract & final are permitted\n" +
+ "----------\n" +
+ "1. ERROR in TeamB11sh78f.java (at line 6)\n" +
+ " R1 r = new R1();\n" +
+ " ^^\n" +
+ "R1 cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in TeamB11sh78f.java (at line 6)\n" +
+ " R1 r = new R1();\n" +
+ " ^^\n" +
+ "R1 cannot be resolved to a type\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in TeamB11sh78f\\R1.java (at line 2)\n" +
+ " team package Wrong;\n" +
+ " ^^^^^\n" +
+ "Enclosing team Wrong not found for role file R1 (OTJLD 1.2.5(c)).\n" +
+ "----------\n" +
+ "2. ERROR in TeamB11sh78f\\R1.java (at line 3)\n" +
+ " protected class R1 {\n" +
+ " ^^\n" +
+ "Illegal modifier for the class R1; only public, abstract & final are permitted\n" +
"----------\n");
}
@@ -3712,26 +3712,26 @@ public class ReportedBugs extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in TeamB11sh80_2.java (at line 3)\n" +
- " import p1.TeamB11sh80_1.R_1;\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Illegal import for role type p1.TeamB11sh80_1.R_1: roles cannot be imported (OTJLD 1.2.2(i)).\n" +
- "----------\n" +
- "2. ERROR in TeamB11sh80_2.java (at line 6)\n" +
- " protected class R_2 playedBy R_1 {\n" +
- " ^^^\n" +
- "Missing anchor (team instance) for role type p1.TeamB11sh80_1.R_1 outside its team context (OTJLD 1.2.2(b)).\n" +
- "----------\n" +
- "3. ERROR in TeamB11sh80_2.java (at line 6)\n" +
- " protected class R_2 playedBy R_1 {\n" +
- " ^^^\n" +
- "Missing anchor (team instance) for role type p1.TeamB11sh80_1.R_1 outside its team context (OTJLD 1.2.2(b)).\n" +
- "----------\n" +
- "4. ERROR in TeamB11sh80_2.java (at line 6)\n" +
- " protected class R_2 playedBy R_1 {\n" +
- " ^^^\n" +
- "Missing anchor (team instance) for role type p1.TeamB11sh80_1.R_1 outside its team context (OTJLD 1.2.2(b)).\n" +
+ "----------\n" +
+ "1. ERROR in TeamB11sh80_2.java (at line 3)\n" +
+ " import p1.TeamB11sh80_1.R_1;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Illegal import for role type p1.TeamB11sh80_1.R_1: roles cannot be imported (OTJLD 1.2.2(i)).\n" +
+ "----------\n" +
+ "2. ERROR in TeamB11sh80_2.java (at line 6)\n" +
+ " protected class R_2 playedBy R_1 {\n" +
+ " ^^^\n" +
+ "Missing anchor (team instance) for role type p1.TeamB11sh80_1.R_1 outside its team context (OTJLD 1.2.2(b)).\n" +
+ "----------\n" +
+ "3. ERROR in TeamB11sh80_2.java (at line 6)\n" +
+ " protected class R_2 playedBy R_1 {\n" +
+ " ^^^\n" +
+ "Missing anchor (team instance) for role type p1.TeamB11sh80_1.R_1 outside its team context (OTJLD 1.2.2(b)).\n" +
+ "----------\n" +
+ "4. ERROR in TeamB11sh80_2.java (at line 6)\n" +
+ " protected class R_2 playedBy R_1 {\n" +
+ " ^^^\n" +
+ "Missing anchor (team instance) for role type p1.TeamB11sh80_1.R_1 outside its team context (OTJLD 1.2.2(b)).\n" +
"----------\n");
}
@@ -3762,23 +3762,23 @@ public class ReportedBugs extends AbstractOTJLDTest {
"public class TB11sh81 { public void bm() {} }\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in TeamB11sh81.java (at line 6)\n" +
- " protected class R2 {\n" +
- " ^^\n" +
- "Member types not allowed in regular roles. Mark class TeamB11sh81.R1 as a team if R2 should be its role (OTJLD 1.5(a,b)). \n" +
- "----------\n" +
- "2. ERROR in TeamB11sh81.java (at line 15)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete ClassBody\n" +
+ "----------\n" +
+ "1. ERROR in TeamB11sh81.java (at line 6)\n" +
+ " protected class R2 {\n" +
+ " ^^\n" +
+ "Member types not allowed in regular roles. Mark class TeamB11sh81.R1 as a team if R2 should be its role (OTJLD 1.5(a,b)). \n" +
+ "----------\n" +
+ "2. ERROR in TeamB11sh81.java (at line 15)\n" +
+ " }\n" +
+ " ^\n" +
+ "Syntax error, insert \"}\" to complete ClassBody\n" +
"----------\n");
}
// method in a nested team needs both a private-accessor and type wrapping
// B.1.1-otjld-sh-82
public void testB11_sh82() {
-
+
runConformTest(
new String[] {
"TeamB11sh82.java",
@@ -3817,7 +3817,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// public field caused ctor with declared lifting to produce illegal byte code
// B.1.1-otjld-sh-83
public void testB11_sh83() {
-
+
runConformTest(
new String[] {
"TeamB11sh83_2.java",
@@ -3894,11 +3894,11 @@ public class ReportedBugs extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in TeamB11sh84_1.java (at line 5)\n" +
- " unresolved();\n" +
- " ^^^^^^^^^^\n" +
- "The method unresolved() is undefined for the type TeamB11sh84_1.R\n" +
+ "----------\n" +
+ "1. ERROR in TeamB11sh84_1.java (at line 5)\n" +
+ " unresolved();\n" +
+ " ^^^^^^^^^^\n" +
+ "The method unresolved() is undefined for the type TeamB11sh84_1.R\n" +
"----------\n",
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
@@ -3930,11 +3930,11 @@ public class ReportedBugs extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in TeamB11sh85_1.java (at line 2)\n" +
- " import not.existing.Import;\n" +
- " ^^^\n" +
- "The import not cannot be resolved\n" +
+ "----------\n" +
+ "1. ERROR in TeamB11sh85_1.java (at line 2)\n" +
+ " import not.existing.Import;\n" +
+ " ^^^\n" +
+ "The import not cannot be resolved\n" +
"----------\n",
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
@@ -3988,7 +3988,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
false/*shouldFlushOutputDirectory*/,
null/*vmArguments*/,
customOptions,
- null/*requestor*/);
+ null/*requestor*/);
runNegativeTest(
new String[] {
"TeamB11sh86_1.java",
@@ -4001,11 +4001,11 @@ public class ReportedBugs extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in TeamB11sh86_1.java (at line 5)\n" +
- " public abstract TB11sh86_1 getBase(Object o);\n" +
- " ^^^^^^^^^^\n" +
- "TB11sh86_1 cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in TeamB11sh86_1.java (at line 5)\n" +
+ " public abstract TB11sh86_1 getBase(Object o);\n" +
+ " ^^^^^^^^^^\n" +
+ "TB11sh86_1 cannot be resolved to a type\n" +
"----------\n",
null/*classLibraries*/,
false/*shouldFlushOutputDirectory*/,
@@ -4030,33 +4030,33 @@ public class ReportedBugs extends AbstractOTJLDTest {
// FIXME(SH): why these errors:?
(this.weavingScheme == WeavingScheme.OTRE && this.complianceLevel >= ClassFileConstants.JDK1_8
?
- "----------\n" +
- "1. WARNING in TeamB11sh86_2.java (at line 5)\n" +
- " protected class R playedBy TB11sh86_2 {\n" +
- " ^^^^^^^^^^\n" +
- "Base class TB11sh86_2 has class file version 52 which cannot be handled by the traditional OTRE based on BCEL. Please consider using the ASM based OTDRE instead.\n" +
- "----------\n" +
- "2. ERROR in TeamB11sh86_2.java (at line 6)\n" +
- " getBase -> bm;\n" +
- " ^^^^^^^\n" +
- "A non-abstract role method exists for this callout-binding. Use callout-override (\'=>\') if you want to override it (OTJLD 3.1(e)).\n" +
- "----------\n" +
- "3. ERROR in TeamB11sh86_2.java (at line 6)\n" +
- " getBase -> bm;\n" +
- " ^^^^^^^\n" +
- "The return type is incompatible with TeamB11sh86_1.R.getBase(Object)\n" +
+ "----------\n" +
+ "1. WARNING in TeamB11sh86_2.java (at line 5)\n" +
+ " protected class R playedBy TB11sh86_2 {\n" +
+ " ^^^^^^^^^^\n" +
+ "Base class TB11sh86_2 has class file version 52 which cannot be handled by the traditional OTRE based on BCEL. Please consider using the ASM based OTDRE instead.\n" +
+ "----------\n" +
+ "2. ERROR in TeamB11sh86_2.java (at line 6)\n" +
+ " getBase -> bm;\n" +
+ " ^^^^^^^\n" +
+ "A non-abstract role method exists for this callout-binding. Use callout-override (\'=>\') if you want to override it (OTJLD 3.1(e)).\n" +
+ "----------\n" +
+ "3. ERROR in TeamB11sh86_2.java (at line 6)\n" +
+ " getBase -> bm;\n" +
+ " ^^^^^^^\n" +
+ "The return type is incompatible with TeamB11sh86_1.R.getBase(Object)\n" +
"----------\n"
:
- "----------\n" +
- "1. ERROR in TeamB11sh86_2.java (at line 6)\n" +
- " getBase -> bm;\n" +
- " ^^^^^^^\n" +
- "A non-abstract role method exists for this callout-binding. Use callout-override (\'=>\') if you want to override it (OTJLD 3.1(e)).\n" +
- "----------\n" +
- "2. ERROR in TeamB11sh86_2.java (at line 6)\n" +
- " getBase -> bm;\n" +
- " ^^^^^^^\n" +
- "The return type is incompatible with TeamB11sh86_1.R.getBase(Object)\n" +
+ "----------\n" +
+ "1. ERROR in TeamB11sh86_2.java (at line 6)\n" +
+ " getBase -> bm;\n" +
+ " ^^^^^^^\n" +
+ "A non-abstract role method exists for this callout-binding. Use callout-override (\'=>\') if you want to override it (OTJLD 3.1(e)).\n" +
+ "----------\n" +
+ "2. ERROR in TeamB11sh86_2.java (at line 6)\n" +
+ " getBase -> bm;\n" +
+ " ^^^^^^^\n" +
+ "The return type is incompatible with TeamB11sh86_1.R.getBase(Object)\n" +
"----------\n"
),
null/*classLibraries*/,
@@ -4073,12 +4073,12 @@ public class ReportedBugs extends AbstractOTJLDTest {
"public team class TeamB11sh86_3 extends TeamB11sh86_2 { }\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in TeamB11sh86_3.java (at line 1)\n" +
- " \n" +
- "public team class TeamB11sh86_3 extends TeamB11sh86_2 { }\n" +
- " ^\n" +
- "The type TB11sh86_1 cannot be resolved. It is indirectly referenced from required .class files\n" +
+ "----------\n" +
+ "1. ERROR in TeamB11sh86_3.java (at line 1)\n" +
+ " \n" +
+ "public team class TeamB11sh86_3 extends TeamB11sh86_2 { }\n" +
+ " ^\n" +
+ "The type TB11sh86_1 cannot be resolved. It is indirectly referenced from required .class files\n" +
"----------\n",
null/*classLibraries*/,
false/*shouldFlushOutputDirectory*/,
@@ -4088,7 +4088,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// challenging decapsulation an inherited method - exception reported by Eugene Hutorny
// B.1.1-otjld-sh-87
public void testB11_sh87() {
-
+
runConformTest(
new String[] {
"pb/TB11sh87Main.java",
@@ -4192,7 +4192,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// Callin binding w/ static base method (reported in TPX-318).
// B.1.1-otjld-sh-89
public void testB11_sh89() {
-
+
runConformTest(
new String[] {
"TeamB11sh89Main.java",
@@ -4244,17 +4244,17 @@ public class ReportedBugs extends AbstractOTJLDTest {
"team package TeamB11sh90;\n" +
"public class RB11sh90 playedBy TB11sh90 {}\n"
},
- "----------\n" +
- "1. ERROR in "+convertedOutputPath+"TeamB11sh90.java (at line 3)\n" +
- " public class RB11sh90 {}\n" +
- " ^^^^^^^^\n" +
- "The method put(TB11sh90, TeamB11sh90.RB11sh90) in the type DoublyWeakHashMap<TB11sh90,RB11sh90<@tthis[TeamB11sh90]>> is not applicable for the arguments (TB11sh90, TeamB11sh90.RB11sh90)\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in TeamB11sh90\\RB11sh90.java (at line 3)\n" +
- " public class RB11sh90 playedBy TB11sh90 {}\n" +
- " ^^^^^^^^\n" +
- "Duplicate nested type RB11sh90\n" +
+ "----------\n" +
+ "1. ERROR in "+convertedOutputPath+"TeamB11sh90.java (at line 3)\n" +
+ " public class RB11sh90 {}\n" +
+ " ^^^^^^^^\n" +
+ "The method put(TB11sh90, TeamB11sh90.RB11sh90) in the type DoublyWeakHashMap<TB11sh90,RB11sh90<@tthis[TeamB11sh90]>> is not applicable for the arguments (TB11sh90, TeamB11sh90.RB11sh90)\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in TeamB11sh90\\RB11sh90.java (at line 3)\n" +
+ " public class RB11sh90 playedBy TB11sh90 {}\n" +
+ " ^^^^^^^^\n" +
+ "Duplicate nested type RB11sh90\n" +
"----------\n",
null/*classLibraries*/,
false/*shouldFlushOutputDirectory*/,
@@ -4334,24 +4334,24 @@ public class ReportedBugs extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in TeamB11sh92.java (at line 6)\n" +
- " protected class RBroken implements IB11sh92 playedBy IB11sh92 {\n" +
- " ^^^^^^^^\n" +
- "IB11sh92 cannot be resolved to a type\n" +
- "----------\n" +
- "2. WARNING in TeamB11sh92.java (at line 6)\n" +
- " protected class RBroken implements IB11sh92 playedBy IB11sh92 {\n" +
- " ^^^^^^^^\n" +
- "When binding interface IB11sh92 as base of RBroken:\n" +
- "Note that some features like callin bindings are not yet supported in this situation (OTJLD 2.1.1).\n" +
+ "----------\n" +
+ "1. ERROR in TeamB11sh92.java (at line 6)\n" +
+ " protected class RBroken implements IB11sh92 playedBy IB11sh92 {\n" +
+ " ^^^^^^^^\n" +
+ "IB11sh92 cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. WARNING in TeamB11sh92.java (at line 6)\n" +
+ " protected class RBroken implements IB11sh92 playedBy IB11sh92 {\n" +
+ " ^^^^^^^^\n" +
+ "When binding interface IB11sh92 as base of RBroken:\n" +
+ "Note that some features like callin bindings are not yet supported in this situation (OTJLD 2.1.1).\n" +
"----------\n");
}
// callin w/ one-way parameter mapping
// B.1.1-otjld-sh-93
public void testB11_sh93() {
-
+
runConformTest(
new String[] {
"TeamB11sh93.java",
@@ -4411,14 +4411,14 @@ public class ReportedBugs extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in TeamB11sh94.java (at line 4)\n" +
- " base when activated // bug\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
+ "----------\n" +
+ "1. ERROR in TeamB11sh94.java (at line 4)\n" +
+ " base when activated // bug\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error on tokens, delete these tokens\n" +
"----------\n");
}
-
+
// Bug 350318 - [compiler] Erroneous name clash error in @Override methods
// originally reported by André Lehmann
public void testB11_sh95() {
@@ -4428,74 +4428,74 @@ public class ReportedBugs extends AbstractOTJLDTest {
runTestExpectingWarnings(
new String[] {
"Caller.java",
- "\n" +
- "public class Caller {\n" +
- " private static class VisitorImpl extends VisitorAdapter<Object> {\n" +
- " \n" +
- " @Override\n" +
- " public Parameter1 visit(Long r, Object a) {\n" +
- " return null;\n" +
- " }\n" +
- " \n" +
- " @Override\n" +
- " public Parameter1 visit(Integer r, Object a) {\n" +
- " return null;\n" +
- " }\n" +
- " \n" +
- " @Override\n" +
- " public Parameter1 visit(Number r, Object a) {\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " private void accept(Visitor<Parameter1, Parameter2> v) {\n" +
- " v.visit(1, new Parameter2());\n" +
- " }\n" +
- " \n" +
- " public void start() {\n" +
- " }\n" +
+ "\n" +
+ "public class Caller {\n" +
+ " private static class VisitorImpl extends VisitorAdapter<Object> {\n" +
+ " \n" +
+ " @Override\n" +
+ " public Parameter1 visit(Long r, Object a) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " \n" +
+ " @Override\n" +
+ " public Parameter1 visit(Integer r, Object a) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " \n" +
+ " @Override\n" +
+ " public Parameter1 visit(Number r, Object a) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " private void accept(Visitor<Parameter1, Parameter2> v) {\n" +
+ " v.visit(1, new Parameter2());\n" +
+ " }\n" +
+ " \n" +
+ " public void start() {\n" +
+ " }\n" +
"}\n",
"Visitor.java",
- "public interface Visitor<R, A> {\n" +
- "\n" +
- " R visit(Long r, A a);\n" +
- "\n" +
- " R visit(Integer r, A a);\n" +
- "\n" +
- " R visit(Number r, A a);\n" +
- "}\n" +
- "class Parameter1 {\n" +
- " \n" +
- "}\n" +
- "class Parameter2 {\n" +
- " \n" +
- "}\n" +
- "abstract class VisitorAdapter<A> implements Visitor<Parameter1, A> {\n" +
- "\n" +
- " public Parameter1 visit(Long r, A a) {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " public Parameter1 visit(Integer r, A a) {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " public Parameter1 visit(Number r, A a) {\n" +
- " return null;\n" +
- " }\n" +
- " \n" +
+ "public interface Visitor<R, A> {\n" +
+ "\n" +
+ " R visit(Long r, A a);\n" +
+ "\n" +
+ " R visit(Integer r, A a);\n" +
+ "\n" +
+ " R visit(Number r, A a);\n" +
+ "}\n" +
+ "class Parameter1 {\n" +
+ " \n" +
+ "}\n" +
+ "class Parameter2 {\n" +
+ " \n" +
+ "}\n" +
+ "abstract class VisitorAdapter<A> implements Visitor<Parameter1, A> {\n" +
+ "\n" +
+ " public Parameter1 visit(Long r, A a) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " public Parameter1 visit(Integer r, A a) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " public Parameter1 visit(Number r, A a) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " \n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in Caller.java (at line 3)\n" +
- " private static class VisitorImpl extends VisitorAdapter<Object> {\n" +
- " ^^^^^^^^^^^\n" +
- "The type Caller.VisitorImpl is never used locally\n" +
- "----------\n" +
- "2. WARNING in Caller.java (at line 21)\n" +
- " private void accept(Visitor<Parameter1, Parameter2> v) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The method accept(Visitor<Parameter1,Parameter2>) from the type Caller is never used locally\n" +
+ "----------\n" +
+ "1. WARNING in Caller.java (at line 3)\n" +
+ " private static class VisitorImpl extends VisitorAdapter<Object> {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The type Caller.VisitorImpl is never used locally\n" +
+ "----------\n" +
+ "2. WARNING in Caller.java (at line 21)\n" +
+ " private void accept(Visitor<Parameter1, Parameter2> v) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The method accept(Visitor<Parameter1,Parameter2>) from the type Caller is never used locally\n" +
"----------\n",
options);
}
@@ -4520,25 +4520,25 @@ public class ReportedBugs extends AbstractOTJLDTest {
" public class Role1 playedBy TB11sh4 {} \n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in TeamB11sh4_1.java (at line 2)\n" +
- " public team class TeamB11sh4_1 implements java.io.Serializable {\n" +
- " ^^^^^^^^^^^\n" +
- "Name clash: The method restoreRole(Class<?>, Object) of type TeamB11sh4_1 has the same erasure as restoreRole(Class, Object) of type Team but does not override it\n" +
- "----------\n" +
- "2. WARNING in TeamB11sh4_1.java (at line 2)\n" +
- " public team class TeamB11sh4_1 implements java.io.Serializable {\n" +
- " ^^^^^^^^^^^^\n" +
- "The serializable class TeamB11sh4_1 does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "1. ERROR in TeamB11sh4_1.java (at line 2)\n" +
+ " public team class TeamB11sh4_1 implements java.io.Serializable {\n" +
+ " ^^^^^^^^^^^\n" +
+ "Name clash: The method restoreRole(Class<?>, Object) of type TeamB11sh4_1 has the same erasure as restoreRole(Class, Object) of type Team but does not override it\n" +
+ "----------\n" +
+ "2. WARNING in TeamB11sh4_1.java (at line 2)\n" +
+ " public team class TeamB11sh4_1 implements java.io.Serializable {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The serializable class TeamB11sh4_1 does not declare a static final serialVersionUID field of type long\n" +
"----------\n",
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
customOptions,
true/*generateOutput*/,
false/*showCategory*/,
- false/*showWarningToken*/);
+ false/*showWarningToken*/);
}
-
+
// Bug 366597 - [compiler] NPE with role ifc wrongly interpreted as a team
public void testB11_sh97() {
runNegativeTest(new String[] {
@@ -4556,7 +4556,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
"b/Base.java",
"package b;\n" +
"public class Base { void foo() {} }\n"
- },
+ },
"----------\n" +
"1. ERROR in t\\T1.java (at line 4)\n" +
" protected interface IR\n" +
@@ -4608,29 +4608,29 @@ public class ReportedBugs extends AbstractOTJLDTest {
"b/Base.java",
"package b;\n" +
"public class Base { void foo() {} }\n"
- },
- "----------\n" +
- "1. ERROR in t\\T1.java (at line 4)\n" +
- " protected team interface IR {}\n" +
- " ^^\n" +
- "Illegal modifier for the member interface IR; only public, protected, private, abstract & static are permitted\n" +
- "----------\n" +
- "2. WARNING in t\\T1.java (at line 8)\n" +
- " this.foo();\n" +
- " ^^^^^^^^^^\n" +
- "Access restriction of method foo() in type b.Base is overridden by this method binding (OTJLD 3.4(a)).\n" +
- "----------\n" +
- "3. ERROR in t\\T1.java (at line 8)\n" +
- " this.foo();\n" +
- " ^^^^^^^^^^\n" +
- "Unresolved self call foo() is implicitly bound by an inferred callout (OTJLD 3.1(j)).\n" +
+ },
+ "----------\n" +
+ "1. ERROR in t\\T1.java (at line 4)\n" +
+ " protected team interface IR {}\n" +
+ " ^^\n" +
+ "Illegal modifier for the member interface IR; only public, protected, private, abstract & static are permitted\n" +
+ "----------\n" +
+ "2. WARNING in t\\T1.java (at line 8)\n" +
+ " this.foo();\n" +
+ " ^^^^^^^^^^\n" +
+ "Access restriction of method foo() in type b.Base is overridden by this method binding (OTJLD 3.4(a)).\n" +
+ "----------\n" +
+ "3. ERROR in t\\T1.java (at line 8)\n" +
+ " this.foo();\n" +
+ " ^^^^^^^^^^\n" +
+ "Unresolved self call foo() is implicitly bound by an inferred callout (OTJLD 3.1(j)).\n" +
"----------\n");
}
// reported by Christine Hundt
// B.1.1-otjld-ju-1
public void testB11_ju1() {
-
+
runConformTest(
new String[] {
"TB11ju1Main.java",
@@ -4679,7 +4679,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// TPX-318: Callin binding doesn't work with static base method. Callin-binding (after) w/ static method.
// B.1.1-otjld-ju-2
public void testB11_ju2() {
-
+
runConformTest(
new String[] {
"TB11ju2Main.java",
@@ -4717,7 +4717,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// TPX-318: Callin binding doesn't work with static base method. Callin-binding (before) w/ static method.
// B.1.1-otjld-ju-3
public void testB11_ju3() {
-
+
runConformTest(
new String[] {
"TB11ju3Main.java",
@@ -4755,7 +4755,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// TPX-318: Callin binding doesn't work with static base method. Callin binding w/ static method with an argument.
// B.1.1-otjld-ju-4
public void testB11_ju4() {
-
+
runConformTest(
new String[] {
"TB11ju4Main.java",
@@ -4793,7 +4793,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// TPX-318: Callin binding doesn't work with static base method. Callin binding (replace) w/ static method with an argument.
// B.1.1-otjld-ju-5
public void testB11_ju5() {
-
+
runConformTest(
new String[] {
"TB11ju5Main.java",
@@ -4835,7 +4835,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.GENERATE);
customOptions.put(CompilerOptions.OPTION_LineNumberAttribute, CompilerOptions.GENERATE);
- customOptions.put(CompilerOptions.OPTION_SourceFileAttribute, CompilerOptions.GENERATE);
+ customOptions.put(CompilerOptions.OPTION_SourceFileAttribute, CompilerOptions.GENERATE);
runConformTest(
new String[] {
"TB11ju6Main.java",
@@ -4881,7 +4881,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// Wrong calculation of base field type
// B.1.1-otjld-ch-1
public void testB11_ch1() {
-
+
runConformTest(
new String[] {
"TB11ch1Main.java",
@@ -4934,7 +4934,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// Wrong calculation of base field type
// B.1.1-otjld-ch-2
public void testB11_ch2() {
-
+
runConformTest(
new String[] {
"TB11ch2Main.java",
@@ -5068,7 +5068,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// Problem with a static field in a role an inheritance
// B.1.1-otjld-ch-4
public void testB11_ch4() {
-
+
runConformTest(
new String[] {
"TeamB11ch4_2.java",
@@ -5126,7 +5126,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// Problem with a static field in a role an inheritance - additional static field in the subrole
// B.1.1-otjld-ch-5
public void testB11_ch5() {
-
+
runConformTest(
new String[] {
"TeamB11ch5_2.java",
@@ -5263,7 +5263,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
// variant reported by Andreas Werner, correct by using a team field
// B.1.1-otjld-ch-5d
public void testB11_ch5d() {
-
+
runConformTest(
new String[] {
"TB11ch5dMain.java",
@@ -5340,11 +5340,11 @@ public class ReportedBugs extends AbstractOTJLDTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in TBug372786.java (at line 1)\n" +
- " import jarred.TeamBug372786;\n" +
- " ^\n" +
- "The type notjarred.Missing cannot be resolved. It is indirectly referenced from required .class files\n" +
+ "----------\n" +
+ "1. ERROR in TBug372786.java (at line 1)\n" +
+ " import jarred.TeamBug372786;\n" +
+ " ^\n" +
+ "The type notjarred.Missing cannot be resolved. It is indirectly referenced from required .class files\n" +
"----------\n",
getClassLibraries(jarFilename),
false);
@@ -5369,7 +5369,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
"public interface User extends Entity {}",
"p/UserByCustomerIndex.java",
"package p;\n" +
- "public interface UserByCustomerIndex extends NonUniqueIndex<User, UserByCustomerIndex.UserByCustomerKey> {\n" +
+ "public interface UserByCustomerIndex extends NonUniqueIndex<User, UserByCustomerIndex.UserByCustomerKey> {\n" +
" class UserByCustomerKey {}\n" +
"}",
"p3/NonUniqueIndexImpl.java",
@@ -5390,7 +5390,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
},
"", null, false/*flush*/, null);
}
-
+
public void testBug433146() {
runConformTest(
new String[] {
@@ -5409,51 +5409,51 @@ public class ReportedBugs extends AbstractOTJLDTest {
"}\n"
});
}
-
+
public void testBug448378() {
runNegativeTest(
new String[] {
"C.java",
- "public class C {\n" +
- " \n" +
- " void test() {\n" +
- " try {\n" +
- " final C c = missing().v;\n" +
- " } finally {\n" +
- " System.out.println(0); \n" +
- " }\n" +
- " }\n" +
+ "public class C {\n" +
+ " \n" +
+ " void test() {\n" +
+ " try {\n" +
+ " final C c = missing().v;\n" +
+ " } finally {\n" +
+ " System.out.println(0); \n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in C.java (at line 5)\n" +
- " final C c = missing().v;\n" +
- " ^^^^^^^\n" +
- "The method missing() is undefined for the type C\n" +
+ "----------\n" +
+ "1. ERROR in C.java (at line 5)\n" +
+ " final C c = missing().v;\n" +
+ " ^^^^^^^\n" +
+ "The method missing() is undefined for the type C\n" +
"----------\n");
}
public void testBug448298() {
runNegativeTest(
new String[] {
"Test.java",
- "public class Test {\n" +
- " Test(Test other) {}\n" +
- " \n" +
- " Test(final int arg, Object o) { \n" +
- " this((arg.nothing)o); \n" +
- " }\n" +
+ "public class Test {\n" +
+ " Test(Test other) {}\n" +
+ " \n" +
+ " Test(final int arg, Object o) { \n" +
+ " this((arg.nothing)o); \n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 5)\n" +
- " this((arg.nothing)o); \n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "The constructor Test(nothing) is undefined\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 5)\n" +
- " this((arg.nothing)o); \n" +
- " ^^^\n" +
- "arg cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 5)\n" +
+ " this((arg.nothing)o); \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The constructor Test(nothing) is undefined\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 5)\n" +
+ " this((arg.nothing)o); \n" +
+ " ^^^\n" +
+ "arg cannot be resolved to a type\n" +
"----------\n");
}
public void testBug495462() {
@@ -5479,7 +5479,7 @@ public class ReportedBugs extends AbstractOTJLDTest {
" public static void main(String... args) {\n" +
" System.out.println(pt.MyTeam.val);\n" +
" }\n" +
- "}\n"
+ "}\n"
},
"OK",
null,
@@ -5496,21 +5496,21 @@ public class ReportedBugs extends AbstractOTJLDTest {
"class f {\n" +
" static class b {}\n" +
"}\n" +
- "public class C1 {\n" +
- " void m() {\n" +
- " C1<String> f;\n" +
- " f.b c = new f.b(); \n" +
- " }\n" +
+ "public class C1 {\n" +
+ " void m() {\n" +
+ " C1<String> f;\n" +
+ " f.b c = new f.b(); \n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in C1.java (at line 6)\n" +
- " C1<String> f;\n" +
- " ^^\n" +
- "The type C1 is not generic; it cannot be parameterized with arguments <String>\n" +
+ "----------\n" +
+ "1. ERROR in C1.java (at line 6)\n" +
+ " C1<String> f;\n" +
+ " ^^\n" +
+ "The type C1 is not generic; it cannot be parameterized with arguments <String>\n" +
"----------\n");
}
-
+
// Bug 529685 - ECJ creates class with java.lang.ClassFormatError when overriding method from Generic class
public void testBug529685() {
runConformTest(
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/AllBindingAmbiguitiesTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/AllBindingAmbiguitiesTests.java
index 0d1a9ab07..75442119d 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/AllBindingAmbiguitiesTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/AllBindingAmbiguitiesTests.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010, 2014 Stephan Herrmann
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -44,7 +44,7 @@ public class AllBindingAmbiguitiesTests {
addComplianceSuite(suite, BindingAmbiguities10.testClass());
addComplianceSuite(suite, BindingAmbiguities11.testClass());
addComplianceSuite(suite, BindingAmbiguities12.testClass());
-
+
return suite;
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BaseClassVisibility.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BaseClassVisibility.java
index 3211f6158..8f025e5aa 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BaseClassVisibility.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BaseClassVisibility.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -24,11 +24,11 @@ import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
import junit.framework.Test;
public class BaseClassVisibility extends AbstractOTJLDTest {
-
+
public BaseClassVisibility(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -36,7 +36,7 @@ public class BaseClassVisibility extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -48,7 +48,7 @@ public class BaseClassVisibility extends AbstractOTJLDTest {
// a role class is played by a public top-level class in a different package
// 2.4.1-otjld-visible-base-class-1
public void test241_visibleBaseClass1() {
-
+
runConformTest(
new String[] {
"T241vbc1Main.java",
@@ -95,7 +95,7 @@ public class BaseClassVisibility extends AbstractOTJLDTest {
// a role class is played by a friendly top-level class in the same package
// 2.4.1-otjld-visible-base-class-2
public void test241_visibleBaseClass2() {
-
+
runConformTest(
new String[] {
"T241vbc2Main.java",
@@ -291,7 +291,7 @@ public class BaseClassVisibility extends AbstractOTJLDTest {
// a role class is played by another private inner class in the same enclosing class
// 2.4.1-otjld-visible-base-class-7
public void test241_visibleBaseClass7() {
-
+
runConformTest(
new String[] {
"T241vbc7.java",
@@ -331,7 +331,7 @@ public class BaseClassVisibility extends AbstractOTJLDTest {
// a role class is played by another public nested class in the same enclosing class
// 2.4.1-otjld-visible-base-class-8
public void test241_visibleBaseClass8() {
-
+
runConformTest(
new String[] {
"T241vbc8.java",
@@ -373,7 +373,7 @@ public class BaseClassVisibility extends AbstractOTJLDTest {
// a role class is played by another protected inner class inherited in the same enclosing class
// 2.4.1-otjld-visible-base-class-9
public void test241_visibleBaseClass9() {
-
+
runConformTest(
new String[] {
"T241vbc9_2.java",
@@ -417,7 +417,7 @@ public class BaseClassVisibility extends AbstractOTJLDTest {
// a role class is played by another friendly nested class inherited in the same enclosing class
// 2.4.1-otjld-visible-base-class-10
public void test241_visibleBaseClass10() {
-
+
runConformTest(
new String[] {
"T241vbc10_2.java",
@@ -461,7 +461,7 @@ public class BaseClassVisibility extends AbstractOTJLDTest {
// a role class is played by a protected inner class inherited from the explicit super class
// 2.4.1-otjld-visible-base-class-11
public void test241_visibleBaseClass11() {
-
+
runConformTest(
new String[] {
"T241vbc11Main.java",
@@ -507,7 +507,7 @@ public class BaseClassVisibility extends AbstractOTJLDTest {
// a role class is played by a protected inner class inherited from the explicit super class
// 2.4.1-otjld-visible-base-class-12
public void test241_visibleBaseClass12() {
-
+
runConformTest(
new String[] {
"T241vbc12Main.java",
@@ -574,16 +574,16 @@ public class BaseClassVisibility extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team241vbc12f.java (at line 3)\n" +
- " public class Role241vbc12f playedBy InvalidType {\n" +
- " ^^^^^^^^^^^\n" +
- "InvalidType cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in Team241vbc12f.java (at line 7)\n" +
- " private String getValue(InvalidType as Role241vbc12f obj) {\n" +
- " ^^^^^^^^^^^\n" +
- "InvalidType cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in Team241vbc12f.java (at line 3)\n" +
+ " public class Role241vbc12f playedBy InvalidType {\n" +
+ " ^^^^^^^^^^^\n" +
+ "InvalidType cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in Team241vbc12f.java (at line 7)\n" +
+ " private String getValue(InvalidType as Role241vbc12f obj) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "InvalidType cannot be resolved to a type\n" +
"----------\n");
}
@@ -660,7 +660,7 @@ public class BaseClassVisibility extends AbstractOTJLDTest {
// a role class is played by another team
// 2.4.1-otjld-visible-base-class-15
public void test241_visibleBaseClass15() {
-
+
runConformTest(
new String[] {
"T241vbc15Main.java",
@@ -744,7 +744,7 @@ public class BaseClassVisibility extends AbstractOTJLDTest {
// a role class is played by a public externalized role
// 2.4.1-otjld-visible-base-class-16
public void test241_visibleBaseClass16() {
-
+
runConformTest(
new String[] {
"T241vbc16Main.java",
@@ -796,7 +796,7 @@ public class BaseClassVisibility extends AbstractOTJLDTest {
// base class is non-static inner class - inner role created by lifting
// 2.4.1-otjld-visible-base-class-17
public void test241_visibleBaseClass17() {
-
+
runConformTest(
new String[] {
"Team241vbc17.java",
@@ -844,7 +844,7 @@ public class BaseClassVisibility extends AbstractOTJLDTest {
// base class is non-static inner class - RM calls base constructor - inner role created by lifting
// 2.4.1-otjld-visible-base-class-18
public void test241_visibleBaseClass18() {
-
+
runConformTest(
new String[] {
"Team241vbc18.java",
@@ -938,7 +938,7 @@ public class BaseClassVisibility extends AbstractOTJLDTest {
// base class is non-static inner class - inner base constructor called - inner role instantiated
// 2.4.1-otjld-visible-base-class-19
public void test241_visibleBaseClass19() {
-
+
runConformTest(
new String[] {
"Team241vbc19.java",
@@ -995,7 +995,7 @@ public class BaseClassVisibility extends AbstractOTJLDTest {
// a non-visible base ctor is called using decapsulation
// 2.4.1-otjld-visible-base-class-20
public void test241_visibleBaseClass20() {
-
+
runConformTest(
new String[] {
"Team241vbc20.java",
@@ -1055,11 +1055,11 @@ public class BaseClassVisibility extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. WARNING in p2\\Team242ibc1.java (at line 3)\n" +
- " import base p1.T242ibc1;\n" +
- " ^^^^^^^^^^^\n" +
- "Overriding access restriction of base class p1.T242ibc1 (OTJLD 2.1.2(c)).\n" +
+ "----------\n" +
+ "1. WARNING in p2\\Team242ibc1.java (at line 3)\n" +
+ " import base p1.T242ibc1;\n" +
+ " ^^^^^^^^^^^\n" +
+ "Overriding access restriction of base class p1.T242ibc1 (OTJLD 2.1.2(c)).\n" +
"----------\n");
}
@@ -1384,18 +1384,18 @@ public class BaseClassVisibility extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in p2\\Team242ibc13c_2.java (at line 5)\n" +
- " public class Role242ibc13c_2 playedBy Role242ibc13c_1<@t> {}\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Trying to override access restriction of confined base class Role242ibc13c_1<@t> (OTJLD 2.1.2(c)).\n" +
+ "----------\n" +
+ "1. ERROR in p2\\Team242ibc13c_2.java (at line 5)\n" +
+ " public class Role242ibc13c_2 playedBy Role242ibc13c_1<@t> {}\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Trying to override access restriction of confined base class Role242ibc13c_1<@t> (OTJLD 2.1.2(c)).\n" +
"----------\n");
}
// a role class is played by a protected externalized role in another package
// 2.4.2-otjld-inaccessible-base-class-14
public void test242_inaccessibleBaseClass14() {
-
+
runConformTest(
new String[] {
"p2/Team242ibc14_2.java",
@@ -1435,7 +1435,7 @@ public class BaseClassVisibility extends AbstractOTJLDTest {
// a role class is played by a private inner class, reported by kmeier
// 2.4.2-otjld-inaccessible-base-class-15
public void test242_inaccessibleBaseClass15() {
-
+
runConformTest(
new String[] {
"Team242ibc15.java",
@@ -1478,7 +1478,7 @@ public class BaseClassVisibility extends AbstractOTJLDTest {
// role playedBy public inner, accessing list of role - reported by A.Werner
// 2.4.2-otjld-inaccessible-base-class-16
public void test242_inaccessibleBaseClass16() {
-
+
runConformTest(
new String[] {
"Team242ibc16.java",
@@ -1565,7 +1565,7 @@ public class BaseClassVisibility extends AbstractOTJLDTest {
// role playedBy private inner, accessing list of role - reported by A.Werner
// 2.4.2-otjld-inaccessible-base-class-17
public void test242_inaccessibleBaseClass17() {
-
+
runConformTest(
new String[] {
"Team242ibc17.java",
@@ -1657,7 +1657,7 @@ public class BaseClassVisibility extends AbstractOTJLDTest {
// role playedBy private inner, accessing list of role - workaround using ILowerable - reported by A.Werner
// 2.4.2-otjld-inaccessible-base-class-18
public void test242_inaccessibleBaseClass18() {
-
+
runConformTest(
new String[] {
"Team242ibc18.java",
@@ -1740,111 +1740,111 @@ public class BaseClassVisibility extends AbstractOTJLDTest {
},
"OK");
}
-
+
// a role nested in a role file is bound to a private static inner class
// sub-role reported bogus visibility problem re phantom role
public void test242_inaccessibleBaseClass19() {
runConformTest(
new String[] {
"Team242iabc19.java",
- "import base p242iabc19.T242iabc19.Inner;\n" +
- "\n" +
- "@SuppressWarnings(\"decapsulation\")\n" +
- "public team class Team242iabc19 {\n" +
- " void test() {\n" +
- " new Mid2().test();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new Team242iabc19().test();\n" +
- " }\n" +
+ "import base p242iabc19.T242iabc19.Inner;\n" +
+ "\n" +
+ "@SuppressWarnings(\"decapsulation\")\n" +
+ "public team class Team242iabc19 {\n" +
+ " void test() {\n" +
+ " new Mid2().test();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new Team242iabc19().test();\n" +
+ " }\n" +
"}\n",
"Team242iabc19/Mid1.java",
- "team package Team242iabc19;\n" +
- "\n" +
- "protected team class Mid1 {\n" +
- " protected class Role playedBy Inner {\n" +
- " @SuppressWarnings(\"decapsulation\")\n" +
- " protected Role() { base(); }\n" +
- " @SuppressWarnings(\"decapsulation\")\n" +
- " protected void test() -> void test();\n" +
- " }\n" +
+ "team package Team242iabc19;\n" +
+ "\n" +
+ "protected team class Mid1 {\n" +
+ " protected class Role playedBy Inner {\n" +
+ " @SuppressWarnings(\"decapsulation\")\n" +
+ " protected Role() { base(); }\n" +
+ " @SuppressWarnings(\"decapsulation\")\n" +
+ " protected void test() -> void test();\n" +
+ " }\n" +
"}\n",
"Team242iabc19/Mid2.java",
- "team package Team242iabc19;\n" +
- "\n" +
- "protected team class Mid2 extends Mid1 {\n" +
- " protected void test() {\n" +
- " new Role().test();\n" +
- " }\n" +
+ "team package Team242iabc19;\n" +
+ "\n" +
+ "protected team class Mid2 extends Mid1 {\n" +
+ " protected void test() {\n" +
+ " new Role().test();\n" +
+ " }\n" +
"}\n",
"p242ibc19/T242iabc19.java",
- "package p242iabc19;\n" +
- "\n" +
- "public class T242iabc19 {\n" +
- " @SuppressWarnings(\"unused\")\n" +
- " private static class Inner {\n" +
- " void test() {\n" +
- " System.out.print(\"OK\");\n" +
- " }\n" +
- " }\n" +
+ "package p242iabc19;\n" +
+ "\n" +
+ "public class T242iabc19 {\n" +
+ " @SuppressWarnings(\"unused\")\n" +
+ " private static class Inner {\n" +
+ " void test() {\n" +
+ " System.out.print(\"OK\");\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
"OK");
}
-
+
// a role nested in a role file is bound to a private static inner class
// sub-role reported bogus visibility problem - inner role is materialized
public void test242_inaccessibleBaseClass20() {
runConformTest(
new String[] {
"Team242iabc20.java",
- "import base p242iabc20.T242iabc20.Inner;\n" +
- "\n" +
- "@SuppressWarnings(\"decapsulation\")\n" +
- "public team class Team242iabc20 {\n" +
- " void test() {\n" +
- " new Mid2().test();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new Team242iabc20().test();\n" +
- " }\n" +
+ "import base p242iabc20.T242iabc20.Inner;\n" +
+ "\n" +
+ "@SuppressWarnings(\"decapsulation\")\n" +
+ "public team class Team242iabc20 {\n" +
+ " void test() {\n" +
+ " new Mid2().test();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new Team242iabc20().test();\n" +
+ " }\n" +
"}\n",
"Team242iabc20/Mid1.java",
- "team package Team242iabc20;\n" +
- "\n" +
- "protected team class Mid1 {\n" +
- " protected class Role playedBy Inner {\n" +
- " @SuppressWarnings(\"decapsulation\")\n" +
- " protected Role() { base(); }\n" +
- " @SuppressWarnings(\"decapsulation\")\n" +
- " protected void test() -> void test();\n" +
- " }\n" +
+ "team package Team242iabc20;\n" +
+ "\n" +
+ "protected team class Mid1 {\n" +
+ " protected class Role playedBy Inner {\n" +
+ " @SuppressWarnings(\"decapsulation\")\n" +
+ " protected Role() { base(); }\n" +
+ " @SuppressWarnings(\"decapsulation\")\n" +
+ " protected void test() -> void test();\n" +
+ " }\n" +
"}\n",
"Team242iabc20/Mid2.java",
- "team package Team242iabc20;\n" +
- "\n" +
+ "team package Team242iabc20;\n" +
+ "\n" +
"protected team class Mid2 extends Mid1 {\n" +
- " @Override\n" +
- " protected class Role playedBy Inner {}\n" +
- " protected void test() {\n" +
- " new Role().test();\n" +
- " }\n" +
+ " @Override\n" +
+ " protected class Role playedBy Inner {}\n" +
+ " protected void test() {\n" +
+ " new Role().test();\n" +
+ " }\n" +
"}\n",
"p242ibc19/T242iabc20.java",
- "package p242iabc20;\n" +
- "\n" +
- "public class T242iabc20 {\n" +
- " @SuppressWarnings(\"unused\")\n" +
- " private static class Inner {\n" +
- " void test() {\n" +
- " System.out.print(\"OK\");\n" +
- " }\n" +
- " }\n" +
+ "package p242iabc20;\n" +
+ "\n" +
+ "public class T242iabc20 {\n" +
+ " @SuppressWarnings(\"unused\")\n" +
+ " private static class Inner {\n" +
+ " void test() {\n" +
+ " System.out.print(\"OK\");\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
"OK");
}
-
+
// a role class is played by a base class that has the same short name
// 2.4.3-otjld-baseclass-has-same-shortname-1
public void test243_baseclassHasSameShortname1() {
@@ -1937,7 +1937,7 @@ public class BaseClassVisibility extends AbstractOTJLDTest {
// a role class is played by a public top-level class of the same short name in a different package, and the fully qualified name is used in the playedBy
// 2.4.6-otjld-baseclass-has-same-shortname
public void test246_baseclassHasSameShortname() {
-
+
runConformTest(
new String[] {
"T246bhssMain.java",
@@ -1982,7 +1982,7 @@ public class BaseClassVisibility extends AbstractOTJLDTest {
// a role and its base have the same name, base import used, callin binding declared
// 2.4.6-otjld-baseclass-has-same-shortname-2
public void test246_baseclassHasSameShortname2() {
-
+
runConformTest(
new String[] {
"Team246bhss2.java",
@@ -2024,7 +2024,7 @@ public class BaseClassVisibility extends AbstractOTJLDTest {
// a base guard uses a base imported class
// 2.4.7-otjld-base-import-scope-1
public void test247_baseImportScope1() {
-
+
runConformTest(
new String[] {
"pBase/T247bisMain1.java",
@@ -2067,7 +2067,7 @@ public class BaseClassVisibility extends AbstractOTJLDTest {
// a parameter mapping (callout) uses the base import scope
// 2.4.7-otjld-base-import-scope-2
public void test247_baseImportScope2() {
-
+
runConformTest(
new String[] {
"pTeam/Team247bis2.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities1.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities1.java
index 9e0245c65..54690ddc2 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities1.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities1.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2014 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -883,8 +883,8 @@ public class BindingAmbiguities1 extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "org.objectteams.LiftingFailedException: \n" +
- "Failed to lift \'T731ab7_3\' of class T731ab7_3 to type \'Role731ab7_1\'\n" +
+ "org.objectteams.LiftingFailedException: \n" +
+ "Failed to lift \'T731ab7_3\' of class T731ab7_3 to type \'Role731ab7_1\'\n" +
"(See OT/J definition para. 2.3.4(c)).",
null/*classLibs*/,
true/*shouldFlush*/,
@@ -1009,8 +1009,8 @@ public class BindingAmbiguities1 extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "org.objectteams.LiftingFailedException: \n" +
- "Failed to lift \'T731ab8_3\' of class T731ab8_3 to type \'Role731ab8_1\'\n" +
+ "org.objectteams.LiftingFailedException: \n" +
+ "Failed to lift \'T731ab8_3\' of class T731ab8_3 to type \'Role731ab8_1\'\n" +
"(See OT/J definition para. 2.3.4(c)).",
null/*classLibs*/,
true/*shouldFlush*/,
@@ -1112,46 +1112,46 @@ public class BindingAmbiguities1 extends AbstractOTJLDTest {
},
options,
new String[] { // expect errors on same location in either order
- "----------\n" +
- "1. WARNING in Team731ab8e_3.java (at line 1)\n" +
- " public team class Team731ab8e_3 extends Team731ab8e_2 {\n" +
- " ^^^^^^^^^^^^^\n" +
- "Potential ambiguity in role binding. The base \'T731ab8e_3\' is bound to the following roles: Team731ab8e_3.Role731ab8e_3,Team731ab8e_3.Role731ab8e_4 (OTJLD 2.3.4(a)).\n" +
- "----------\n" +
- "2. ERROR in Team731ab8e_3.java (at line 1)\n" +
- " public team class Team731ab8e_3 extends Team731ab8e_2 {\n" +
- " ^^^^^^^^^^^^^\n" +
- "Team introduces binding ambiguity for role Role731ab8e_3<@tthis[Team731ab8e_3]>, which may break clients of the super team (OTJLD 2.3.5(d)).\n" +
- "----------\n" +
- "3. ERROR in Team731ab8e_3.java (at line 1)\n" +
- " public team class Team731ab8e_3 extends Team731ab8e_2 {\n" +
- " ^^^^^^^^^^^^^\n" +
- "Team introduces binding ambiguity for role Role731ab8e_2<@tthis[Team731ab8e_3]>, which may break clients of the super team (OTJLD 2.3.5(d)).\n" +
- "----------\n" +
- "4. ERROR in Team731ab8e_3.java (at line 1)\n" +
- " public team class Team731ab8e_3 extends Team731ab8e_2 {\n" +
- " ^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in Team731ab8e_3.java (at line 1)\n" +
+ " public team class Team731ab8e_3 extends Team731ab8e_2 {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Potential ambiguity in role binding. The base \'T731ab8e_3\' is bound to the following roles: Team731ab8e_3.Role731ab8e_3,Team731ab8e_3.Role731ab8e_4 (OTJLD 2.3.4(a)).\n" +
+ "----------\n" +
+ "2. ERROR in Team731ab8e_3.java (at line 1)\n" +
+ " public team class Team731ab8e_3 extends Team731ab8e_2 {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Team introduces binding ambiguity for role Role731ab8e_3<@tthis[Team731ab8e_3]>, which may break clients of the super team (OTJLD 2.3.5(d)).\n" +
+ "----------\n" +
+ "3. ERROR in Team731ab8e_3.java (at line 1)\n" +
+ " public team class Team731ab8e_3 extends Team731ab8e_2 {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Team introduces binding ambiguity for role Role731ab8e_2<@tthis[Team731ab8e_3]>, which may break clients of the super team (OTJLD 2.3.5(d)).\n" +
+ "----------\n" +
+ "4. ERROR in Team731ab8e_3.java (at line 1)\n" +
+ " public team class Team731ab8e_3 extends Team731ab8e_2 {\n" +
+ " ^^^^^^^^^^^^^\n" +
"Team introduces binding ambiguity for role Role731ab8e_1<@tthis[Team731ab8e_3]>, which may break clients of the super team (OTJLD 2.3.5(d)).\n" +
"----------\n",
- "----------\n" +
- "1. WARNING in Team731ab8e_3.java (at line 1)\n" +
- " public team class Team731ab8e_3 extends Team731ab8e_2 {\n" +
- " ^^^^^^^^^^^^^\n" +
- "Potential ambiguity in role binding. The base \'T731ab8e_3\' is bound to the following roles: Team731ab8e_3.Role731ab8e_3,Team731ab8e_3.Role731ab8e_4 (OTJLD 2.3.4(a)).\n" +
- "----------\n" +
- "2. ERROR in Team731ab8e_3.java (at line 1)\n" +
- " public team class Team731ab8e_3 extends Team731ab8e_2 {\n" +
- " ^^^^^^^^^^^^^\n" +
- "Team introduces binding ambiguity for role Role731ab8e_1<@tthis[Team731ab8e_3]>, which may break clients of the super team (OTJLD 2.3.5(d)).\n" +
- "----------\n" +
- "3. ERROR in Team731ab8e_3.java (at line 1)\n" +
- " public team class Team731ab8e_3 extends Team731ab8e_2 {\n" +
- " ^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in Team731ab8e_3.java (at line 1)\n" +
+ " public team class Team731ab8e_3 extends Team731ab8e_2 {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Potential ambiguity in role binding. The base \'T731ab8e_3\' is bound to the following roles: Team731ab8e_3.Role731ab8e_3,Team731ab8e_3.Role731ab8e_4 (OTJLD 2.3.4(a)).\n" +
+ "----------\n" +
+ "2. ERROR in Team731ab8e_3.java (at line 1)\n" +
+ " public team class Team731ab8e_3 extends Team731ab8e_2 {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Team introduces binding ambiguity for role Role731ab8e_1<@tthis[Team731ab8e_3]>, which may break clients of the super team (OTJLD 2.3.5(d)).\n" +
+ "----------\n" +
+ "3. ERROR in Team731ab8e_3.java (at line 1)\n" +
+ " public team class Team731ab8e_3 extends Team731ab8e_2 {\n" +
+ " ^^^^^^^^^^^^^\n" +
"Team introduces binding ambiguity for role Role731ab8e_3<@tthis[Team731ab8e_3]>, which may break clients of the super team (OTJLD 2.3.5(d)).\n" +
- "----------\n" +
- "4. ERROR in Team731ab8e_3.java (at line 1)\n" +
- " public team class Team731ab8e_3 extends Team731ab8e_2 {\n" +
- " ^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "4. ERROR in Team731ab8e_3.java (at line 1)\n" +
+ " public team class Team731ab8e_3 extends Team731ab8e_2 {\n" +
+ " ^^^^^^^^^^^^^\n" +
"Team introduces binding ambiguity for role Role731ab8e_2<@tthis[Team731ab8e_3]>, which may break clients of the super team (OTJLD 2.3.5(d)).\n" +
"----------\n"
} );
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities10.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities10.java
index a5844a572..17950d2d9 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities10.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities10.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -48,7 +48,7 @@ public class BindingAmbiguities10 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.10-otjld_g-ambiguous-binding-1
public void _g_test7310_ambiguousBinding1() {
-
+
runConformTest(
new String[] {
"T7310ab1Main.java",
@@ -160,7 +160,7 @@ public class BindingAmbiguities10 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.10-otjld_g-ambiguous-binding-2
public void _g_test7310_ambiguousBinding2() {
-
+
runConformTest(
new String[] {
"T7310ab2Main.java",
@@ -272,7 +272,7 @@ public class BindingAmbiguities10 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.10-otjld_g-ambiguous-binding-3
public void _g_test7310_ambiguousBinding3() {
-
+
runConformTest(
new String[] {
"T7310ab3Main.java",
@@ -384,7 +384,7 @@ public class BindingAmbiguities10 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.10-otjld_g-ambiguous-binding-4
public void _g_test7310_ambiguousBinding4() {
-
+
runConformTest(
new String[] {
"T7310ab4Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities11.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities11.java
index 880192e18..15228e360 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities11.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities11.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -49,7 +49,7 @@ public class BindingAmbiguities11 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.11-otjld_g-ambiguous-binding-1
public void _g_test7311_ambiguousBinding1() {
-
+
runConformTest(
new String[] {
"T7311ab1Main.java",
@@ -161,7 +161,7 @@ public class BindingAmbiguities11 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.11-otjld_g-ambiguous-binding-2
public void _g_test7311_ambiguousBinding2() {
-
+
runConformTest(
new String[] {
"T7311ab2Main.java",
@@ -273,7 +273,7 @@ public class BindingAmbiguities11 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.11-otjld_g-ambiguous-binding-3
public void _g_test7311_ambiguousBinding3() {
-
+
runConformTest(
new String[] {
"T7311ab3Main.java",
@@ -385,7 +385,7 @@ public class BindingAmbiguities11 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.11-otjld_g-ambiguous-binding-4
public void _g_test7311_ambiguousBinding4() {
-
+
runConformTest(
new String[] {
"T7311ab4Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities12.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities12.java
index 9d6e77a49..a5e258ed7 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities12.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities12.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -48,7 +48,7 @@ public class BindingAmbiguities12 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.12-otjld_g-ambiguous-binding-1
public void _g_test7312_ambiguousBinding1() {
-
+
runConformTest(
new String[] {
"T7312ab1Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities2.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities2.java
index 13eefce93..34e5e1772 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities2.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities2.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -47,7 +47,7 @@ public class BindingAmbiguities2 extends AbstractOTJLDTest {
public static Class testClass() {
return BindingAmbiguities2.class;
}
-
+
@SuppressWarnings("unchecked")
@Override
protected Map getCompilerOptions() {
@@ -60,7 +60,7 @@ public class BindingAmbiguities2 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.2-otjld_g-ambiguous-binding-1
public void test732_ambiguousBinding1() {
-
+
runConformTest(
new String[] {
"T732ab1Main.java",
@@ -172,7 +172,7 @@ public class BindingAmbiguities2 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.2-otjld_g-ambiguous-binding-2
public void test732_ambiguousBinding2() {
-
+
runConformTest(
new String[] {
"T732ab2Main.java",
@@ -284,7 +284,7 @@ public class BindingAmbiguities2 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.2-otjld_g-ambiguous-binding-3
public void test732_ambiguousBinding3() {
-
+
runConformTest(
new String[] {
"T732ab3Main.java",
@@ -396,7 +396,7 @@ public class BindingAmbiguities2 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.2-otjld_g-ambiguous-binding-4
public void test732_ambiguousBinding4() {
-
+
runConformTest(
new String[] {
"T732ab4Main.java",
@@ -508,7 +508,7 @@ public class BindingAmbiguities2 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.2-otjld_g-ambiguous-binding-5
public void test732_ambiguousBinding5() {
-
+
runConformTest(
new String[] {
"T732ab5Main.java",
@@ -620,7 +620,7 @@ public class BindingAmbiguities2 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.2-otjld_g-ambiguous-binding-6
public void test732_ambiguousBinding6() {
-
+
runConformTest(
new String[] {
"T732ab6Main.java",
@@ -732,7 +732,7 @@ public class BindingAmbiguities2 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.2-otjld_g-ambiguous-binding-7
public void test732_ambiguousBinding7() {
-
+
runConformTest(
new String[] {
"T732ab7Main.java",
@@ -842,7 +842,7 @@ public class BindingAmbiguities2 extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "org.objectteams.LiftingFailedException: \n" +
+ "org.objectteams.LiftingFailedException: \n" +
"Failed to lift 'T732ab7_3' of class T732ab7_3 to type 'Role732ab7_1'\n" +
"(See OT/J definition para. 2.3.4(c)).");
}
@@ -850,7 +850,7 @@ public class BindingAmbiguities2 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.2-otjld_g-ambiguous-binding-8
public void test732_ambiguousBinding8() {
-
+
runConformTest(
new String[] {
"T732ab8Main.java",
@@ -960,7 +960,7 @@ public class BindingAmbiguities2 extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "org.objectteams.LiftingFailedException: \n" +
+ "org.objectteams.LiftingFailedException: \n" +
"Failed to lift 'T732ab8_3' of class T732ab8_3 to type 'Role732ab8_1'\n" +
"(See OT/J definition para. 2.3.4(c)).");
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities3.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities3.java
index 0f2d97715..ed0885b39 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities3.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities3.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -48,7 +48,7 @@ public class BindingAmbiguities3 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.3-otjld_g-ambiguous-binding-1
public void _g_test733_ambiguousBinding1() {
-
+
runConformTest(
new String[] {
"T733ab1Main.java",
@@ -160,7 +160,7 @@ public class BindingAmbiguities3 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.3-otjld_g-ambiguous-binding-2
public void _g_test733_ambiguousBinding2() {
-
+
runConformTest(
new String[] {
"T733ab2Main.java",
@@ -272,7 +272,7 @@ public class BindingAmbiguities3 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.3-otjld_g-ambiguous-binding-3
public void _g_test733_ambiguousBinding3() {
-
+
runConformTest(
new String[] {
"T733ab3Main.java",
@@ -389,7 +389,7 @@ public class BindingAmbiguities3 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.3-otjld_g-ambiguous-binding-4
public void _g_test733_ambiguousBinding4() {
-
+
runConformTest(
new String[] {
"T733ab4Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities4.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities4.java
index 2c1b56dfd..de74a95ed 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities4.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities4.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -48,7 +48,7 @@ public class BindingAmbiguities4 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.4-otjld_g-ambiguous-binding-1
public void _g_test734_ambiguousBinding1() {
-
+
runConformTest(
new String[] {
"T734ab1Main.java",
@@ -160,7 +160,7 @@ public class BindingAmbiguities4 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.4-otjld_g-ambiguous-binding-2
public void _g_test734_ambiguousBinding2() {
-
+
runConformTest(
new String[] {
"T734ab2Main.java",
@@ -272,7 +272,7 @@ public class BindingAmbiguities4 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.4-otjld_g-ambiguous-binding-3
public void _g_test734_ambiguousBinding3() {
-
+
runConformTest(
new String[] {
"T734ab3Main.java",
@@ -384,7 +384,7 @@ public class BindingAmbiguities4 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.4-otjld_g-ambiguous-binding-4
public void _g_test734_ambiguousBinding4() {
-
+
runConformTest(
new String[] {
"T734ab4Main.java",
@@ -496,7 +496,7 @@ public class BindingAmbiguities4 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.4-otjld_g-ambiguous-binding-5
public void _g_test734_ambiguousBinding5() {
-
+
runConformTest(
new String[] {
"T734ab5Main.java",
@@ -608,7 +608,7 @@ public class BindingAmbiguities4 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.4-otjld_g-ambiguous-binding-6
public void _g_test734_ambiguousBinding6() {
-
+
runConformTest(
new String[] {
"T734ab6Main.java",
@@ -720,7 +720,7 @@ public class BindingAmbiguities4 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.4-otjld_g-ambiguous-binding-7
public void _g_test734_ambiguousBinding7() {
-
+
runConformTest(
new String[] {
"T734ab7Main.java",
@@ -837,7 +837,7 @@ public class BindingAmbiguities4 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.4-otjld_g-ambiguous-binding-8
public void _g_test734_ambiguousBinding8() {
-
+
runConformTest(
new String[] {
"T734ab8Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities5.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities5.java
index f6175c14c..92307f110 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities5.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities5.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -48,7 +48,7 @@ public class BindingAmbiguities5 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.5-otjld_g-ambiguous-binding-1
public void _g_test735_ambiguousBinding1() {
-
+
runConformTest(
new String[] {
"T735ab1Main.java",
@@ -160,7 +160,7 @@ public class BindingAmbiguities5 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.5-otjld_g-ambiguous-binding-2
public void _g_test735_ambiguousBinding2() {
-
+
runConformTest(
new String[] {
"T735ab2Main.java",
@@ -272,7 +272,7 @@ public class BindingAmbiguities5 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.5-otjld_g-ambiguous-binding-3
public void _g_test735_ambiguousBinding3() {
-
+
runConformTest(
new String[] {
"T735ab3Main.java",
@@ -384,7 +384,7 @@ public class BindingAmbiguities5 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.5-otjld_g-ambiguous-binding-4
public void _g_test735_ambiguousBinding4() {
-
+
runConformTest(
new String[] {
"T735ab4Main.java",
@@ -496,7 +496,7 @@ public class BindingAmbiguities5 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.5-otjld_g-ambiguous-binding-5
public void _g_test735_ambiguousBinding5() {
-
+
runConformTest(
new String[] {
"T735ab5Main.java",
@@ -608,7 +608,7 @@ public class BindingAmbiguities5 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.5-otjld_g-ambiguous-binding-6
public void _g_test735_ambiguousBinding6() {
-
+
runConformTest(
new String[] {
"T735ab6Main.java",
@@ -720,7 +720,7 @@ public class BindingAmbiguities5 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.5-otjld_g-ambiguous-binding-7
public void _g_test735_ambiguousBinding7() {
-
+
runConformTest(
new String[] {
"T735ab7Main.java",
@@ -837,7 +837,7 @@ public class BindingAmbiguities5 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.5-otjld_g-ambiguous-binding-8
public void _g_test735_ambiguousBinding8() {
-
+
runConformTest(
new String[] {
"T735ab8Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities6.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities6.java
index b0d271ec8..69ac2e8f7 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities6.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities6.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -48,7 +48,7 @@ public class BindingAmbiguities6 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.6-otjld_g-ambiguous-binding-1
public void _g_test736_ambiguousBinding1() {
-
+
runConformTest(
new String[] {
"T736ab1Main.java",
@@ -160,7 +160,7 @@ public class BindingAmbiguities6 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.6-otjld_g-ambiguous-binding-2
public void _g_test736_ambiguousBinding2() {
-
+
runConformTest(
new String[] {
"T736ab2Main.java",
@@ -272,7 +272,7 @@ public class BindingAmbiguities6 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.6-otjld_g-ambiguous-binding-3
public void _g_test736_ambiguousBinding3() {
-
+
runConformTest(
new String[] {
"T736ab3Main.java",
@@ -389,7 +389,7 @@ public class BindingAmbiguities6 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.6-otjld_g-ambiguous-binding-4
public void _g_test736_ambiguousBinding4() {
-
+
runConformTest(
new String[] {
"T736ab4Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities7.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities7.java
index c707e1ce0..722bad6af 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities7.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities7.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -48,7 +48,7 @@ public class BindingAmbiguities7 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.7-otjld_g-ambiguous-binding-1
public void _g_test737_ambiguousBinding1() {
-
+
runConformTest(
new String[] {
"T737ab1Main.java",
@@ -160,7 +160,7 @@ public class BindingAmbiguities7 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.7-otjld_g-ambiguous-binding-2
public void _g_test737_ambiguousBinding2() {
-
+
runConformTest(
new String[] {
"T737ab2Main.java",
@@ -272,7 +272,7 @@ public class BindingAmbiguities7 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.7-otjld_g-ambiguous-binding-3
public void _g_test737_ambiguousBinding3() {
-
+
runConformTest(
new String[] {
"T737ab3Main.java",
@@ -384,7 +384,7 @@ public class BindingAmbiguities7 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.7-otjld_g-ambiguous-binding-4
public void _g_test737_ambiguousBinding4() {
-
+
runConformTest(
new String[] {
"T737ab4Main.java",
@@ -496,7 +496,7 @@ public class BindingAmbiguities7 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.7-otjld_g-ambiguous-binding-5
public void _g_test737_ambiguousBinding5() {
-
+
runConformTest(
new String[] {
"T737ab5Main.java",
@@ -608,7 +608,7 @@ public class BindingAmbiguities7 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.7-otjld_g-ambiguous-binding-6
public void _g_test737_ambiguousBinding6() {
-
+
runConformTest(
new String[] {
"T737ab6Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities8.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities8.java
index 99b19bbe9..ed564ceac 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities8.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities8.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -48,7 +48,7 @@ public class BindingAmbiguities8 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.8-otjld_g-ambiguous-binding-1
public void _g_test738_ambiguousBinding1() {
-
+
runConformTest(
new String[] {
"T738ab1Main.java",
@@ -160,7 +160,7 @@ public class BindingAmbiguities8 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.8-otjld_g-ambiguous-binding-2
public void _g_test738_ambiguousBinding2() {
-
+
runConformTest(
new String[] {
"T738ab2Main.java",
@@ -272,7 +272,7 @@ public class BindingAmbiguities8 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.8-otjld_g-ambiguous-binding-3
public void _g_test738_ambiguousBinding3() {
-
+
runConformTest(
new String[] {
"T738ab3Main.java",
@@ -384,7 +384,7 @@ public class BindingAmbiguities8 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.8-otjld_g-ambiguous-binding-4
public void _g_test738_ambiguousBinding4() {
-
+
runConformTest(
new String[] {
"T738ab4Main.java",
@@ -496,7 +496,7 @@ public class BindingAmbiguities8 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.8-otjld_g-ambiguous-binding-5
public void _g_test738_ambiguousBinding5() {
-
+
runConformTest(
new String[] {
"T738ab5Main.java",
@@ -608,7 +608,7 @@ public class BindingAmbiguities8 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.8-otjld_g-ambiguous-binding-6
public void _g_test738_ambiguousBinding6() {
-
+
runConformTest(
new String[] {
"T738ab6Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities9.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities9.java
index 7c498024d..c971f7b2f 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities9.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguities9.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -48,7 +48,7 @@ public class BindingAmbiguities9 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.9-otjld_g-ambiguous-binding-1
public void _g_test739_ambiguousBinding1() {
-
+
runConformTest(
new String[] {
"T739ab1Main.java",
@@ -160,7 +160,7 @@ public class BindingAmbiguities9 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.9-otjld_g-ambiguous-binding-2
public void _g_test739_ambiguousBinding2() {
-
+
runConformTest(
new String[] {
"T739ab2Main.java",
@@ -272,7 +272,7 @@ public class BindingAmbiguities9 extends AbstractOTJLDTest {
// smart-lifting of a base object to a role object results in an ambiguous binding
// 7.3.9-otjld_g-ambiguous-binding-3
public void _g_test739_ambiguousBinding3() {
-
+
runConformTest(
new String[] {
"T739ab3Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguitiesM.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguitiesM.java
index 3eb223a94..78f34c2cc 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguitiesM.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/BindingAmbiguitiesM.java
@@ -98,7 +98,7 @@ public class BindingAmbiguitiesM extends AbstractOTJLDTest {
true/*shouldFlush*/,
null/*vmArguments*/,
options,
- null/*requester*/);
+ null/*requester*/);
}
// callin binding despite binding ambiguity regarding super base and intermediate roles,
@@ -146,7 +146,7 @@ public class BindingAmbiguitiesM extends AbstractOTJLDTest {
true/*shouldFlush*/,
null/*vmArguments*/,
options,
- null/*requester*/);
+ null/*requester*/);
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/ExplicitRoleCreation.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/ExplicitRoleCreation.java
index 326b9d17d..59cce89db 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/ExplicitRoleCreation.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/ExplicitRoleCreation.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -25,11 +25,11 @@ import org.eclipse.jdt.core.tests.junit.extension.TestCase;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class ExplicitRoleCreation extends AbstractOTJLDTest {
-
+
public ExplicitRoleCreation(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -37,7 +37,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -49,7 +49,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// an unbound role without a superroles or -class is created using the default constructor
// 2.3.1-otjld-creation-of-unbound-role-1
public void test231_creationOfUnboundRole1() {
-
+
runConformTest(
new String[] {
"T231cour1Main.java",
@@ -83,7 +83,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// an unbound role without a superroles or -class is created using a no-arg constructor
// 2.3.1-otjld-creation-of-unbound-role-2
public void test231_creationOfUnboundRole2() {
-
+
runConformTest(
new String[] {
"T231cour2Main.java",
@@ -122,7 +122,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// an unbound role with a superclass is created
// 2.3.1-otjld-creation-of-unbound-role-3
public void test231_creationOfUnboundRole3() {
-
+
runConformTest(
new String[] {
"T231cour3Main.java",
@@ -168,7 +168,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// an unbound role with an implicit superrole is created with constructors using this and tsuper
// 2.3.1-otjld-creation-of-unbound-role-4
public void test231_creationOfUnboundRole4() {
-
+
runConformTest(
new String[] {
"T231cour4Main.java",
@@ -219,7 +219,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// an unbound role with an explicit superrole is created with constructors using this and ssuper
// 2.3.1-otjld-creation-of-unbound-role-5
public void test231_creationOfUnboundRole5() {
-
+
runConformTest(
new String[] {
"T231cour5Main.java",
@@ -266,7 +266,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a role is created externalized with parameterized syntax
// 2.3.1-otjld-creation-of-unbound-role-6
public void test231_creationOfUnboundRole6() {
-
+
runConformTest(
new String[] {
"T231cour6Main.java",
@@ -294,7 +294,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a role directly bound to a baseclass and without a constructor is created
// 2.3.2-otjld-bound-role-without-constructor-1
public void test232_boundRoleWithoutConstructor1() {
-
+
runConformTest(
new String[] {
"T232brwc1Main.java",
@@ -339,7 +339,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a role indirectly bound to a baseclass via its explicit superrole, and without a constructor is created
// 2.3.2-otjld-bound-role-without-constructor-2
public void test232_boundRoleWithoutConstructor2() {
-
+
runConformTest(
new String[] {
"T232brwc2Main.java",
@@ -386,7 +386,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a role indirectly bound to a baseclass via its implicit superrole, and without a constructor is created
// 2.3.2-otjld-bound-role-without-constructor-3
public void test232_boundRoleWithoutConstructor3() {
-
+
runConformTest(
new String[] {
"T232brwc3Main.java",
@@ -436,7 +436,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a role indirectly bound to a baseclass via its indirect superrole, and without a constructor is created
// 2.3.2-otjld-bound-role-without-constructor-4
public void test232_boundRoleWithoutConstructor4() {
-
+
runConformTest(
new String[] {
"T232brwc4Main.java",
@@ -621,7 +621,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a role directly bound to a baseclass has a constructor with a base constructor call
// 2.3.4-otjld-bound-role-with-noarg-constructor-3
public void test234_boundRoleWithNoargConstructor3() {
-
+
runConformTest(
new String[] {
"Team234brwnc3.java",
@@ -660,7 +660,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a role indirectly bound to a baseclass has a no-arg constructor
// 2.3.4-otjld-bound-role-with-noarg-constructor-4
public void test234_boundRoleWithNoargConstructor4() {
-
+
runConformTest(
new String[] {
"Team234brwnc4_2.java",
@@ -746,7 +746,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a role directly bound to a baseclass has a constructor with a base constructor call
// 2.3.5-otjld-constructor-with-basecall-1
public void test235_constructorWithBasecall1() {
-
+
runConformTest(
new String[] {
"T235cwb1Main.java",
@@ -796,7 +796,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a role indirectly bound to a baseclass has a constructor with a base constructor call; base() implicitly includes calling the lift-ctor
// 2.3.5-otjld-constructor-with-basecall-2
public void test235_constructorWithBasecall2() {
-
+
runConformTest(
new String[] {
"T235cwb2Main.java",
@@ -857,7 +857,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a role indirectly bound to a baseclass invokes a base constructor using method invocation conversion
// 2.3.5-otjld-constructor-with-basecall-3
public void test235_constructorWithBasecall3() {
-
+
runConformTest(
new String[] {
"T235cwb3Main.java",
@@ -906,7 +906,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// constructors declare an exception
// Bug 322723 - [compiler] a role constructor with declared exceptions causes bogus compile error
public void test235_constructorWithBasecall4() {
-
+
runConformTest(
new String[] {
"T235cwb4Main.java",
@@ -1013,15 +1013,15 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
" T236cwb6(String v) { this.val = v; }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Team236cwb6.java (at line 8)\n" +
- " Object b = base(v);\n" +
- " ^^^^\n" +
- "Base constructor call not allowed in this position, must be first statement or argument to another constructor call (OTJLD 2.4.2(c)).\n" +
+ "----------\n" +
+ "1. ERROR in Team236cwb6.java (at line 8)\n" +
+ " Object b = base(v);\n" +
+ " ^^^^\n" +
+ "Base constructor call not allowed in this position, must be first statement or argument to another constructor call (OTJLD 2.4.2(c)).\n" +
"----------\n");
}
- //
+ //
public void test236_constructorWithBasecall7() {
runConformTest(
new String[]{
@@ -1147,7 +1147,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a role directly bound to a baseclass has a constructor with a this call refering to another constructor with a base constructor call
// 2.3.7-otjld-self-and-base-calls-1
public void test237_selfAndBaseCalls1() {
-
+
runConformTest(
new String[] {
"T237sabc1Main.java",
@@ -1200,7 +1200,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a role with an explicit bound superrole class has a constructor with a super call refering to a super constructor with a base constructor call
// 2.3.7-otjld-self-and-base-calls-2
public void test237_selfAndBaseCalls2() {
-
+
runConformTest(
new String[] {
"T237sabc2Main.java",
@@ -1255,7 +1255,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a role with an explicit non-role super class has a constructor with a super call followed by a base call
// 2.3.7-otjld-self-and-base-calls-3
public void test237_selfAndBaseCalls3() {
-
+
runConformTest(
new String[] {
"T237sabc3Main.java",
@@ -1322,7 +1322,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a role with an explicit superrole class bound to a different baseclass, has a constructor with a base call
// 2.3.7-otjld-self-and-base-calls-4
public void test237_selfAndBaseCalls4() {
-
+
runConformTest(
new String[] {
"T237sabc4Main.java",
@@ -1455,7 +1455,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a role with an implicit super role class, has a constructor with a super call to a private tsuper constructor
// 2.3.10-otjld-inaccessible-super-constructor-1t
public void test2310_inaccessibleSuperConstructor1t() {
-
+
runConformTest(
new String[] {
"Team2310isc1t_2.java",
@@ -1664,7 +1664,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a role with an explicit non-role super class has a constructor that refers via this to another constructor that has a super call
// 2.3.12-otjld-indirect-super-call-1
public void test2312_indirectSuperCall1() {
-
+
runConformTest(
new String[] {
"T2312isc1Main.java",
@@ -1734,7 +1734,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a role with an explicit super role class has a constructor that refers via this to another constructor that has a super call
// 2.3.12-otjld-indirect-super-call-2
public void test2312_indirectSuperCall2() {
-
+
runConformTest(
new String[] {
"T2312isc2Main.java",
@@ -1933,7 +1933,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a role with an implicit super role class has a constructor that references a private (accessible!) super constructor via tsuper
// 2.3.14-otjld-inaccessible-tsuper-constructor-2
public void test2314_inaccessibleTsuperConstructor2() {
-
+
runConformTest(
new String[] {
"Team2314itc2_2.java",
@@ -2096,7 +2096,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a role with an implicit super role class has a constructor that refers via tsuper to a super constructor that in turn uses a base call
// 2.3.15-otjld-tsuper-call-1
public void test2315_tsuperCall1() {
-
+
runConformTest(
new String[] {
"T2315tc1Main.java",
@@ -2156,7 +2156,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a role with implicit and explicit super role classes using constructors with this, tsuper, super, and base
// 2.3.15-otjld-tsuper-call-2
public void test2315_tsuperCall2() {
-
+
runConformTest(
new String[] {
"T2315tc2Main.java",
@@ -3047,7 +3047,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a role object is created in a field initializer of a sibling role
// 2.3.25-otjld-field-initializer-creates-role-1
public void test2325_fieldInitializerCreatesRole1() {
-
+
runConformTest(
new String[] {
"Team2325ficr1.java",
@@ -3103,7 +3103,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a lifting constructor is used with a new expression as argument
// 2.3.27-otjld-explicit-use-of-lifting-constructor-1
public void test2327_explicitUseOfLiftingConstructor1() {
-
+
runConformTest(
new String[] {
"Team2327euolc1.java",
@@ -3137,7 +3137,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a lifting constructor is used - giving a warning
// 2.3.27-otjld-explicit-use-of-lifting-constructor-2
public void test2327_explicitUseOfLiftingConstructor2() {
-
+
runConformTest(
new String[] {
"T2327euolc2Main.java",
@@ -3176,7 +3176,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a lifting constructor is used - role already exists
// 2.3.27-otjld-explicit-use-of-lifting-constructor-3
public void test2327_explicitUseOfLiftingConstructor3() {
-
+
runConformTest(
new String[] {
"T2327euolc3Main.java",
@@ -3221,10 +3221,10 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
"CAUGHT");
}
- //
+ //
// 2.3.28-otjld-creating-array-of-externalized-role-1
public void test2328_creatingArrayOfExternalizedRole1() {
-
+
runConformTest(
new String[] {
"T2328caoer1Main.java",
@@ -3263,7 +3263,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a role creation triggers lifting but the result is discarded (white-box witness for TPX-401)
// 2.3.29-otjld-creation-as-statement-1
public void test2329_creationAsStatement1() {
-
+
runConformTest(
new String[] {
"Team2329cas1.java",
@@ -3306,7 +3306,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a role creation triggers lifting but the result is discarded (white-box witness for TPX-401) -- qualified creation
// 2.3.29-otjld-creation-as-statement-2
public void test2329_creationAsStatement2() {
-
+
runConformTest(
new String[] {
"Team2329cas2.java",
@@ -3348,7 +3348,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a role with base-ctor-call is retrieved from the cache via getAllRoles()
// 2.3.29-otjld-creation-as-statement-3
public void test2329_creationAsStatement3() {
-
+
runConformTest(
new String[] {
"Team2329cas3.java",
@@ -3446,7 +3446,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a team super-call tries to create a role before the team is initialized - invoked with casted null argument - reported by kmeier
// 2.3.30-otjld-role-creation-in-supercall-1g
public void test2330_roleCreationInSupercall1g() {
-
+
runConformTest(
new String[] {
"Team2320rcis1g_2.java",
@@ -3477,7 +3477,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a team super-call tries to create a role before the team is initialized - create by declared lifting
// 2.3.30-otjld-role-creation-in-supercall-2
public void test2330_roleCreationInSupercall2() {
-
+
runConformTest(
new String[] {
"Team2320rcis2_2.java",
@@ -3521,7 +3521,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a team super-call tries to create a role before the team is initialized - abstract role instantiated in super-team
// 2.3.30-otjld-role-creation-in-supercall-3
public void test2330_roleCreationInSupercall3() {
-
+
runConformTest(
new String[] {
"Team2320rcis3_2.java",
@@ -3559,7 +3559,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a team super-call tries to create a role before the team is initialized - abstract role instantiated in super-team via template method
// 2.3.30-otjld-role-creation-in-supercall-3f
public void test2330_roleCreationInSupercall3f() {
-
+
runConformTest(
new String[] {
"Team2320rcis3f_2.java",
@@ -3601,7 +3601,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// an unbound role is specialized to a bound role, default constructor becomes invalid
// 2.3.31-otjld-role-creation-invalidated-by-specialization-1
public void test2331_roleCreationInvalidatedBySpecialization1() {
-
+
runConformTest(
new String[] {
"Team2331rcibs1_2.java",
@@ -3637,7 +3637,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// A static role method creates a role instance
// 2.3.32-otjld-role-creation-from-static-context-1
public void test2332_roleCreationFromStaticContext1() {
-
+
runConformTest(
new String[] {
"Team2332rcfsc1.java",
@@ -3692,7 +3692,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// the anchor in an explicit role creation has the type of a nested team
// 2.3.34-otjld-creating-role-of-nested-team-1
public void test2334_creatingRoleOfNestedTeam1() {
-
+
runConformTest(
new String[] {
"Team2334cront1.java",
@@ -3720,7 +3720,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// creating nested team and its role in one step
// 2.3.34-otjld-creating-role-of-nested-team-2
public void test2334_creatingRoleOfNestedTeam2() {
-
+
runConformTest(
new String[] {
"Team2334cront2.java",
@@ -3746,7 +3746,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a role is bound to a regular inner with a non-visible constructor invoked via base()
// 2.3.35-otjld-creating-role-of-regular-inner-1
public void test2335_creatingRoleOfRegularInner1() {
-
+
runConformTest(
new String[] {
"Team2335crori1.java",
@@ -3791,7 +3791,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a role is bound to a lower role with a non-visible constructor invoked via base()
// 2.3.35-otjld-creating-role-of-regular-inner-2
public void test2335_creatingRoleOfRegularInner2() {
-
+
runConformTest(
new String[] {
"Team2335crori2_2.java",
@@ -3836,7 +3836,7 @@ public class ExplicitRoleCreation extends AbstractOTJLDTest {
// a role is bound to a lower role with a non-visible constructor invoked via base()
// addition: one more arg (2byte)
public void test2335_creatingRoleOfRegularInner2b() {
-
+
runConformTest(
new String[] {
"Team2335crori2b_2.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/GC.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/GC.java
index 071bcfd82..8b192ef0c 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/GC.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/GC.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010 Stephan Herrmann
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -25,11 +25,11 @@ import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
import junit.framework.Test;
public class GC extends AbstractOTJLDTest {
-
+
public GC(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -37,7 +37,7 @@ public class GC extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -48,7 +48,7 @@ public class GC extends AbstractOTJLDTest {
// neither base nor role are ever referenced
// 2.5.1-otjld-garbage-collecting-unreferenced-1
public void test251_garbageCollectingUnreferenced1() {
-
+
runConformTest(
new String[] {
"Team251gcu1.java",
@@ -84,7 +84,7 @@ public class GC extends AbstractOTJLDTest {
// neither base nor role are ever referenced - role method is static, lifting never takes place
// 2.5.1-otjld-garbage-collecting-unreferenced-2
public void test251_garbageCollectingUnreferenced2() {
-
+
runConformTest(
new String[] {
"Team251gcu2.java",
@@ -121,7 +121,7 @@ public class GC extends AbstractOTJLDTest {
// 2.5.2-otjld-garbage-collecting-referenced-1
public void test252_garbageCollectingReferenced1() {
Map customOptions = getCompilerOptions();
-
+
runConformTest(
new String[] {
"Team252gcr1.java",
@@ -202,7 +202,7 @@ public class GC extends AbstractOTJLDTest {
// role are first stored then discarded
// 2.5.2-otjld-garbage-collecting-referenced-2
public void test252_garbageCollectingReferenced2() {
-
+
runConformTest(
new String[] {
"Team252gcr2.java",
@@ -253,7 +253,7 @@ public class GC extends AbstractOTJLDTest {
// a role is unregistered, after it can be gargabe collected
// 2.5.3-otjld-garbage-collecting-unregistered-1
public void test253_garbageCollectingUnregistered1() throws InterruptedException {
-
+
runConformTest(
new String[] {
"Team253gcu1.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/LiftingAndLowering.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/LiftingAndLowering.java
index e5383069e..974b90370 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/LiftingAndLowering.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/LiftingAndLowering.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2020 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -30,11 +30,11 @@ import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
@SuppressWarnings("unchecked")
public class LiftingAndLowering extends AbstractOTJLDTest {
-
+
public LiftingAndLowering(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -42,7 +42,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -54,7 +54,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a role is lowered to the base class that it is played by
// 2.2.1-otjld-lowering-to-baseclass-1
public void test221_loweringToBaseclass1() {
-
+
runConformTest(
new String[] {
"T221ltb1Main.java",
@@ -101,7 +101,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a role is lowered to the base class that it is played by
// 2.2.1-otjld-lowering-to-baseclass-2
public void test221_loweringToBaseclass2() {
-
+
runConformTest(
new String[] {
"T221ltb2Main.java",
@@ -148,7 +148,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a role is lowered to the base class that it is played by
// 2.2.1-otjld-lowering-to-baseclass-3
public void test221_loweringToBaseclass3() {
-
+
runConformTest(
new String[] {
"T221ltb3Main.java",
@@ -197,7 +197,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a role is lowered to the base class that it is played by
// 2.2.1-otjld-lowering-to-baseclass-4
public void test221_loweringToBaseclass4() {
-
+
runConformTest(
new String[] {
"T221ltb4Main.java",
@@ -253,7 +253,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a role is lowered via a field to the base class of its explicit superrole
// 2.2.1-otjld-lowering-to-baseclass-5
public void test221_loweringToBaseclass5() {
-
+
runConformTest(
new String[] {
"T221ltb5Main.java",
@@ -306,7 +306,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a role is lowered in a return statement to the base class that it is played by
// 2.2.1-otjld-lowering-to-baseclass-6
public void test221_loweringToBaseclass6() {
-
+
runConformTest(
new String[] {
"T221ltb6Main.java",
@@ -358,7 +358,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a role is lowered in a return statement to the base class that it is played by - call returns null!
// 2.2.1-otjld-lowering-to-baseclass-7
public void test221_loweringToBaseclass7() {
-
+
runConformTest(
new String[] {
"T221ltb7Main.java",
@@ -395,7 +395,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a role is lowered in a return statement to the base class that it is played by - call returns null!
// 2.2.1-otjld-lowering-to-baseclass-8
public void test221_loweringToBaseclass8() {
-
+
runConformTest(
new String[] {
"T221ltb8Main.java",
@@ -435,7 +435,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a role is lowered in a return statement to the base class that it is played by - call returns null!
// 2.2.1-otjld-lowering-to-baseclass-9
public void test221_loweringToBaseclass9() {
-
+
runConformTest(
new String[] {
"T221ltb9Main.java",
@@ -475,7 +475,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a role is lowered in a return statement to the base class that it is played by - call returns null!
// 2.2.1-otjld-lowering-to-baseclass-10
public void test221_loweringToBaseclass10() {
-
+
runConformTest(
new String[] {
"T221ltb10Main.java",
@@ -515,7 +515,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a role is lowered in a return statement to the base class that it is played by - bound super-role exists
// 2.2.1-otjld-lowering-to-baseclass-11
public void test221_loweringToBaseclass11() {
-
+
runConformTest(
new String[] {
"T221ltb11Main.java",
@@ -575,7 +575,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// the enclosing nested team is lowered
// 2.2.1-otjld-lowering-to-baseclass-12
public void test221_loweringToBaseclass12() {
-
+
runConformTest(
new String[] {
"Team221ltb12.java",
@@ -615,7 +615,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// the enclosing nested team is lowered - via assignment
// 2.2.1-otjld-lowering-to-baseclass-13
public void test221_loweringToBaseclass13() {
-
+
runConformTest(
new String[] {
"Team221ltb13.java",
@@ -652,7 +652,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
},
"OK");
}
-
+
// a foreach loop over an iterable needs to lower elements
public void test221_loweringToBaseclass14() {
runConformTest(
@@ -682,7 +682,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
},
"OK");
}
-
+
// a foreach loop over an array needs to lower elements
public void test221_loweringToBaseclass15() {
runConformTest(
@@ -711,7 +711,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
},
"OK");
}
-
+
// a foreach loop over an iterable needs to lower elements (role-of-role)
public void test221_loweringToBaseclass16() {
runConformTest(
@@ -745,61 +745,61 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
},
"OK");
}
-
+
// Bug 335628 - [compiler] lowering in array initializer
public void test221_loweringToBaseclass17 () {
runConformTest(
new String[] {
"Team221ltb17.java",
- "public team class Team221ltb17 {\n" +
- " protected class R playedBy T221ltb17 {\n" +
- " protected R() { base(); }\n" +
- " }\n" +
- " void test() {\n" +
- " R r = new R();\n" +
- " T221ltb17[] bases = new T221ltb17[] { r };\n" +
- " for (int i = 0; i < bases.length; i++) {\n" +
- " bases[i].print();\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new Team221ltb17().test();\n" +
- " }\n" +
+ "public team class Team221ltb17 {\n" +
+ " protected class R playedBy T221ltb17 {\n" +
+ " protected R() { base(); }\n" +
+ " }\n" +
+ " void test() {\n" +
+ " R r = new R();\n" +
+ " T221ltb17[] bases = new T221ltb17[] { r };\n" +
+ " for (int i = 0; i < bases.length; i++) {\n" +
+ " bases[i].print();\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new Team221ltb17().test();\n" +
+ " }\n" +
"}\n",
"T221ltb17.java",
- "public class T221ltb17 {\n" +
- " public void print() {\n" +
- " System.out.println(\"OK\");\n" +
+ "public class T221ltb17 {\n" +
+ " public void print() {\n" +
+ " System.out.println(\"OK\");\n" +
" }\n" +
"}\n"
},
"OK");
}
-
+
// Bug 335628 - [compiler] lowering in array initializer
public void test221_loweringToBaseclass18 () {
runConformTest(
new String[] {
"Team221ltb18.java",
- "public team class Team221ltb18 {\n" +
- " protected class R playedBy T221ltb18 {\n" +
- " protected R() { base(); }\n" +
- " }\n" +
- " void test() {\n" +
- " R r = new R();\n" +
- " T221ltb18[][] bases = new T221ltb18[][] { { r } };\n" +
- " for (int i = 0; i < bases.length; i++)\n" +
- " for (int k = 0; k < bases[i].length; k++)\n" +
- " bases[i][k].print();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new Team221ltb18().test();\n" +
- " }\n" +
+ "public team class Team221ltb18 {\n" +
+ " protected class R playedBy T221ltb18 {\n" +
+ " protected R() { base(); }\n" +
+ " }\n" +
+ " void test() {\n" +
+ " R r = new R();\n" +
+ " T221ltb18[][] bases = new T221ltb18[][] { { r } };\n" +
+ " for (int i = 0; i < bases.length; i++)\n" +
+ " for (int k = 0; k < bases[i].length; k++)\n" +
+ " bases[i][k].print();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new Team221ltb18().test();\n" +
+ " }\n" +
"}\n",
"T221ltb18.java",
- "public class T221ltb18 {\n" +
- " public void print() {\n" +
- " System.out.println(\"OK\");\n" +
+ "public class T221ltb18 {\n" +
+ " public void print() {\n" +
+ " System.out.println(\"OK\");\n" +
" }\n" +
"}\n"
},
@@ -815,25 +815,25 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
true /* flushOutputDir*/,
new String[] {
"Team221ltb19.java",
- "public team class Team221ltb19 {\n" +
- " protected class R playedBy T221ltb19 {\n" +
+ "public team class Team221ltb19 {\n" +
+ " protected class R playedBy T221ltb19 {\n" +
" protected R() { base(); }\n" +
" protected void test() {\n" +
" T221ltb19.accept(this);\n" +
- " }\n" +
- " }\n" +
- " T221ltb19 aBase;\n" +
- " void test() {\n" +
- " new R().test();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new Team221ltb19().test();\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
+ " T221ltb19 aBase;\n" +
+ " void test() {\n" +
+ " new R().test();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new Team221ltb19().test();\n" +
+ " }\n" +
"}\n",
"T221ltb19.java",
- "public class T221ltb19 {\n" +
- " public static void accept(T221ltb19 inst) {\n" +
- " System.out.println(\"OK\");\n" +
+ "public class T221ltb19 {\n" +
+ " public static void accept(T221ltb19 inst) {\n" +
+ " System.out.println(\"OK\");\n" +
" }\n" +
"}\n"
},
@@ -854,26 +854,26 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
true /* flushOutputDir*/,
new String[] {
"Team221ltb20.java",
- "public team class Team221ltb20 {\n" +
- " protected class R playedBy T221ltb20 {\n" +
+ "public team class Team221ltb20 {\n" +
+ " protected class R playedBy T221ltb20 {\n" +
" protected R() { base(); }\n" +
" protected void test() {\n" +
" R r = this;" +
" T221ltb20.accept(r);\n" +
- " }\n" +
- " }\n" +
- " T221ltb20 aBase;\n" +
- " void test() {\n" +
- " new R().test();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new Team221ltb20().test();\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
+ " T221ltb20 aBase;\n" +
+ " void test() {\n" +
+ " new R().test();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new Team221ltb20().test();\n" +
+ " }\n" +
"}\n",
"T221ltb20.java",
- "public class T221ltb20 {\n" +
- " public static void accept(T221ltb20 inst) {\n" +
- " System.out.println(\"OK\");\n" +
+ "public class T221ltb20 {\n" +
+ " public static void accept(T221ltb20 inst) {\n" +
+ " System.out.println(\"OK\");\n" +
" }\n" +
"}\n"
},
@@ -944,7 +944,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// lowering of a role object for the same base object produces the same base class object
// 2.2.3-otjld-lowering-produces-same-object-1
public void test223_loweringProducesSameObject1() {
-
+
runConformTest(
new String[] {
"T223lpso1Main.java",
@@ -995,7 +995,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// lowering of a role object for the same base object produces the same base class object
// 2.2.3-otjld-lowering-produces-same-object-2
public void test223_loweringProducesSameObject2() {
-
+
runConformTest(
new String[] {
"T223lpso2Main.java",
@@ -1129,7 +1129,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a role is not equal to its lowered self
// 2.2.4-otjld-role-not-equal-to-baseobject-2
public void test224_roleNotEqualToBaseobject2() {
-
+
runConformTest(
new String[] {
"T224rnetb2Main.java",
@@ -1174,7 +1174,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a role is not equal to its lowered self
// 2.2.4-otjld-role-not-equal-to-baseobject-3
public void test224_roleNotEqualToBaseobject3() {
-
+
runConformTest(
new String[] {
"T224rnetb3Main.java",
@@ -1230,7 +1230,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// the type of a lowering assignment expression is the base class
// 2.2.5-otjld-type-of-lowering-assignment-1
public void test225_typeOfLoweringAssignment1() {
-
+
runConformTest(
new String[] {
"T225tola1Main.java",
@@ -1274,7 +1274,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// the type of a lowering assignment expression is the base class
// 2.2.5-otjld-type-of-lowering-assignment-2
public void test225_typeOfLoweringAssignment2() {
-
+
runConformTest(
new String[] {
"T225tola2Main.java",
@@ -1330,7 +1330,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a base class object is lifted to a role via a method parameter
// 2.2.6-otjld-lifting-1
public void test226_lifting1() {
-
+
runConformTest(
new String[] {
"T226l1Main.java",
@@ -1375,7 +1375,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a base class object is lifted to a role via a final method parameter
// 2.2.6-otjld-lifting-2
public void test226_lifting2() {
-
+
runConformTest(
new String[] {
"T226l2Main.java",
@@ -1428,7 +1428,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a base class object is lifted to a role via a return statement
// 2.2.6-otjld-lifting-3
public void test226_lifting3() {
-
+
runConformTest(
new String[] {
"T226l3Main.java",
@@ -1535,7 +1535,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// subsequent lifting of the same base class object produces the same role object
// 2.2.8-otjld-lifting-produces-same-role-1
public void test228_liftingProducesSameRole1() {
-
+
runConformTest(
new String[] {
"T228lpsr1Main.java",
@@ -1589,7 +1589,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// subsequent lifting of the same base class object produces the same role object
// 2.2.8-otjld-lifting-produces-same-role-2
public void test228_liftingProducesSameRole2() {
-
+
runConformTest(
new String[] {
"T228lpsr2Main.java",
@@ -1656,7 +1656,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// lifting of the same base class object to roles related by implicit inheritance does produce different role objcts (as of their hashCode)
// 2.2.9-otjld-different-context-lifting-1
public void test229_differentContextLifting1() {
-
+
runConformTest(
new String[] {
"T229dcl1Main.java",
@@ -1708,7 +1708,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// lifting of the same base class object to unrelated roles produces different role objcts
// 2.2.9-otjld-different-context-lifting-2
public void test229_differentContextLifting2() {
-
+
runConformTest(
new String[] {
"T229lpsr2Main.java",
@@ -1762,7 +1762,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// lifting of the same base class object to related roles produces the same role objct
// 2.2.9-otjld-different-context-lifting-3
public void test229_differentContextLifting3() {
-
+
runConformTest(
new String[] {
"T229lpsr3Main.java",
@@ -1816,7 +1816,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// compare instances of different teams
// 2.2.9-otjld-different-context-lifting-5
public void test229_differentContextLifting5() {
-
+
runConformTest(
new String[] {
"T229lpsr1Main.java",
@@ -1868,7 +1868,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a base object is not equal to its lifted self
// 2.2.10-otjld-baseobject-not-equal-to-roleobject-1
public void test2210_baseobjectNotEqualToRoleobject1() {
-
+
runConformTest(
new String[] {
"T2210bnetr1Main.java",
@@ -1916,7 +1916,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a base object is not equal to its lifted self
// 2.2.10-otjld-baseobject-not-equal-to-roleobject-2
public void test2210_baseobjectNotEqualToRoleobject2() {
-
+
runConformTest(
new String[] {
"T2210bnetr2Main.java",
@@ -1965,7 +1965,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a base object is not equal to its lifted self
// 2.2.10-otjld-baseobject-not-equal-to-roleobject-3
public void test2210_baseobjectNotEqualToRoleobject3() {
-
+
runConformTest(
new String[] {
"T2210bnetr3Main.java",
@@ -2062,7 +2062,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// an array of role objects is lowered to an array of the base class that it is played by
// 2.2.12-otjld-array-lowering-to-baseclass-1a
public void test2212_arrayLoweringToBaseclass1a() {
-
+
runConformTest(
new String[] {
"T2212altb1aMain.java",
@@ -2110,7 +2110,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// an array of role objects is lowered to an array of the base class that it is played by
// 2.2.12-otjld-array-lowering-to-baseclass-1
public void test2212_arrayLoweringToBaseclass1() {
-
+
runConformTest(
new String[] {
"T2212altb1Main.java",
@@ -2157,7 +2157,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// an array of role objects is lowered to an array of the base class that it is played by
// 2.2.12-otjld-array-lowering-to-baseclass-2
public void test2212_arrayLoweringToBaseclass2() {
-
+
runConformTest(
new String[] {
"T2212tb2Main.java",
@@ -2204,7 +2204,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// an array of role objects is lowered to an array of the base class that it is played by
// 2.2.12-otjld-array-lowering-to-baseclass-3
public void test2212_arrayLoweringToBaseclass3() {
-
+
runConformTest(
new String[] {
"T2212tb3Main.java",
@@ -2264,7 +2264,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// an array of role objects is lowered to an array of the base class that it is played by
// 2.2.12-otjld-array-lowering-to-baseclass-4
public void test2212_arrayLoweringToBaseclass4() {
-
+
runConformTest(
new String[] {
"T2212tb4Main.java",
@@ -2318,7 +2318,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// an array of role objects is lowered to an array of the base class that it is played by
// 2.2.12-otjld-array-lowering-to-baseclass-5
public void test2212_arrayLoweringToBaseclass5() {
-
+
runConformTest(
new String[] {
"T2212tb5Main.java",
@@ -2374,7 +2374,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// an array of role objects is lowered to an array of the base class that it is played by
// 2.2.12-otjld-array-lowering-to-baseclass-6
public void test2212_arrayLoweringToBaseclass6() {
-
+
runConformTest(
new String[] {
"T2212tb6Main.java",
@@ -2423,7 +2423,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// an array of role objects is lowered to an array of the base class that it is played by -- base call
// 2.2.12-otjld-array-lowering-to-baseclass-7
public void test2212_arrayLoweringToBaseclass7() {
-
+
runConformTest(
new String[] {
"Team2212altb7.java",
@@ -2493,7 +2493,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
"}\n"
});
}
-
+
public void test2212_arrayLoweringToBaseclass9() {
runConformTest(
new String[] {
@@ -2520,7 +2520,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
},
"T2214altb9");
}
-
+
public void test2212_arrayLowering_inConditionalExpression1() {
runConformTest(
new String[] {
@@ -2547,11 +2547,11 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
},
"T2214alice1");
}
-
+
// lowering of a role object array for the same base objects produces the an equal object array
// 2.2.14-otjld-array-lowering-produces-equal-object-1
public void test2214_arrayLoweringProducesEqualObject1() {
-
+
runConformTest(
new String[] {
"T2214alpeo1Main.java",
@@ -2602,7 +2602,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// lowering of a role object array for the same base objects produces an equal object array
// 2.2.14-otjld-array-lowering-produces-equal-object-2
public void test2214_arrayLoweringProducesEqualObject2() {
-
+
runConformTest(
new String[] {
"T2214alpeo2Main.java",
@@ -2664,7 +2664,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// an array of base class objects is lifted to a role array
// 2.2.15-otjld-array-lifting-1
public void test2215_arrayLifting1() {
-
+
runConformTest(
new String[] {
"T2215al1Main.java",
@@ -2709,7 +2709,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// an array of base class objects is lifted to a role array
// 2.2.15-otjld-array-lifting-2
public void test2215_arrayLifting2() {
-
+
runConformTest(
new String[] {
"T2215al2Main.java",
@@ -2760,7 +2760,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// an array of base class objects is lifted to a role array
// 2.2.15-otjld-array-lifting-3
public void test2215_arrayLifting3() {
-
+
runConformTest(
new String[] {
"T2215al3Main.java",
@@ -2810,7 +2810,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// an array of base class objects (inner class) is lifted to a role array
// 2.2.15-otjld-array-lifting-4
public void test2215_arrayLifting4() {
-
+
runConformTest(
new String[] {
"T2215al4Main.java",
@@ -2854,11 +2854,11 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
},
"OK");
}
-
+
// an array of base class objects is lifted to an array of nested roles
public void test2215_arrayLifting5() {
-
+
runConformTest(
new String[] {
"T2215al5Main.java",
@@ -2904,7 +2904,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// an array of base class objects is lifted to an array of nested roles - location: callout return
// witness for broken bytecode: ifc-part of array lifter was not found, but silently generated a problem method for the caller
public void test2215_arrayLifting6() {
-
+
runConformTest(
new String[] {
"T2215al6Main.java",
@@ -2954,7 +2954,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// an array of base class objects is lifted to an array of nested roles - location: callin return
public void test2215_arrayLifting7() {
-
+
runConformTest(
new String[] {
"T2215al7Main.java",
@@ -3054,7 +3054,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// the lifting of an array of base objects produces equal role object arrays (but not the same)
// 2.2.17-otjld-array-lifting-produces-equal-object-1
public void test2217_arrayLiftingProducesEqualObject1() {
-
+
runConformTest(
new String[] {
"T2217alpeo1Main.java",
@@ -3119,7 +3119,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// the lifting of an array of base objects produces equal role object arrays (but not the same)
// 2.2.17-otjld-array-lifting-produces-equal-object-2
public void test2217_arrayLiftingProducesEqualObject2() {
-
+
runConformTest(
new String[] {
"T2217alpeo2Main.java",
@@ -3181,7 +3181,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// an array of base objects is not equal to its lifted self
// 2.2.18-otjld-basearray-not-equal-to-rolearray-1
public void test2218_basearrayNotEqualToRolearray1() {
-
+
runConformTest(
new String[] {
"T2218bnetr1Main.java",
@@ -3236,7 +3236,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// an array of base objects is not equal to its lifted self
// 2.2.18-otjld-basearray-not-equal-to-rolearray-2
public void test2218_basearrayNotEqualToRolearray2() {
-
+
runConformTest(
new String[] {
"T2218bnetr2Main.java",
@@ -3299,7 +3299,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// an array of role objects is not equal to its lowered self
// 2.2.19-otjld-rolearray-equal-to-lowered-1
public void test2219_rolearrayEqualToLowered1() {
-
+
runConformTest(
new String[] {
"T2219bnetr1Main.java",
@@ -3352,7 +3352,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// an array of role objects is not equal to its lowered self
// 2.2.19-otjld-rolearray-equal-to-lowered-2
public void test2219_rolearrayEqualToLowered2() {
-
+
runConformTest(
new String[] {
"T2219bnetr2Main.java",
@@ -3416,7 +3416,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a role class has an initializeRole method with a signature that is not as required 2.2h
// 2.2.20-otjld_obsolete-initializeRole-with-different-signature-1
public void _obsolete_test2220_initializeRoleWithDifferentSignature1() {
-
+
runConformTest(
new String[] {
"T2220iwds1Main.java",
@@ -3466,7 +3466,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a role class has an initializeRole method with a signature that is not as required 2.2h
// 2.2.20-otjld_obsolete-initializeRole-with-different-signature-2
public void _obsolete_test2220_initializeRoleWithDifferentSignature2() {
-
+
runConformTest(
new String[] {
"T2220iwds2Main.java",
@@ -3516,7 +3516,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a role class has an initializeRole method with a signature that is not as required 2.2h
// 2.2.20-otjld_obsolete-initializeRole-with-different-signature-3
public void _obsolete_test2220_initializeRoleWithDifferentSignature3() {
-
+
runConformTest(
new String[] {
"T2220iwds3Main.java",
@@ -3566,7 +3566,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a role class has an initializeRole method with a signature that is not as required 2.2h
// 2.2.20-otjld_obsolete-initializeRole-with-different-signature-4
public void _obsolete_test2220_initializeRoleWithDifferentSignature4() {
-
+
runConformTest(
new String[] {
"T2220iwds4Main.java",
@@ -3617,7 +3617,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a role class has an initializeRole method with a signature that is not as required 2.2h
// 2.2.20-otjld_obsolete-initializeRole-with-different-signature-5
public void _obsolete_test2220_initializeRoleWithDifferentSignature5() {
-
+
runConformTest(
new String[] {
"T2220iwds5Main.java",
@@ -3667,7 +3667,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a role class has an initializeRole method that is called exactly once during subsequent lifting of the same base object in the same team
// 2.2.22-otjld-role-with-initializeRole-method-1
public void test2222_roleWithInitializeRoleMethod1() {
-
+
runConformTest(
new String[] {
"T2222rwim1Main.java",
@@ -3725,7 +3725,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a role class has an initializeRole method that is called twice during subsequent lifting of the same base object to different roles in the same team
// 2.2.22-otjld-role-with-initializeRole-method-2
public void test2222_roleWithInitializeRoleMethod2() {
-
+
runConformTest(
new String[] {
"T2222rwim2Main.java",
@@ -3793,7 +3793,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// each class in a role hierarchy has its own default constructor, all of which are invoked
// 2.2.23-otjld-role-hierarchy-with-initializeRole-methods
public void test2223_roleHierarchyWithInitializeRoleMethods() {
-
+
runConformTest(
new String[] {
"T2223rhwimMain.java",
@@ -3859,7 +3859,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a role hierarchy with initializeRole methods containing super-calls
// 2.2.24-otjld-role-hierarchy-with-initializeRole-methods
public void test2224_roleHierarchyWithInitializeRoleMethods() {
-
+
runConformTest(
new String[] {
"T2224rhwimMain.java",
@@ -3978,7 +3978,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a role class inherited the initializeRole method which is called exactly once during lifting
// 2.2.25-otjld-inherited-initializeRole-method
public void test2225_inheritedInitializeRoleMethod() {
-
+
runConformTest(
new String[] {
"T2225iimMain.java",
@@ -4036,7 +4036,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// an array of base class objects is lifted to a role array, and for each lifted base object the initializeRole method is called
// 2.2.27-otjld-array-lifting-calls-initializeRole-1
public void test2227_arrayLiftingCallsInitializeRole1() {
-
+
runConformTest(
new String[] {
"T2227alci1Main.java",
@@ -4090,7 +4090,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// an array of base class objects is lifted to a role array, and for each lifted base object the initializeRole method is called
// 2.2.27-otjld-array-lifting-calls-initializeRole-2
public void test2227_arrayLiftingCallsInitializeRole2() {
-
+
runConformTest(
new String[] {
"T2227alci2Main.java",
@@ -4145,7 +4145,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a constructor declares a parameter with lifting
// 2.2.28-otjld-declared-lifting-in-construtor-1
public void test2228_declaredLiftingInConstrutor1() {
-
+
runConformTest(
new String[] {
"Team2228dlic1.java",
@@ -4180,7 +4180,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a constructor declares a parameter with lifting
// 2.2.28-otjld-declared-lifting-in-construtor-2
public void test2228_declaredLiftingInConstrutor2() {
-
+
runConformTest(
new String[] {
"Team2228dlic2_2.java",
@@ -4224,7 +4224,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a constructor declares a parameter with lifting - invoking super with role type
// 2.2.28-otjld-declared-lifting-in-construtor-3
public void test2228_declaredLiftingInConstrutor3() {
-
+
runConformTest(
new String[] {
"Team2228dlic3_2.java",
@@ -4265,7 +4265,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
"OK");
}
- // a constructor uses a parameter with declared lifting, but the base type is invalid
+ // a constructor uses a parameter with declared lifting, but the base type is invalid
// WITNESS for error reported in TPX-204 (fixed somewhere between 0.7.5 and 0.7.11)
// 2.2.28-otjld-declared-lifting-in-construtor-4
public void test2228_declaredLiftingInConstrutor4() {
@@ -4286,9 +4286,9 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a constructor with declared lifting calls super with a role across several levels
// 2.2.28-otjld-declared-lifting-in-constructor-5
- // Bug 326052 [compiler] problems with team ctors with declared lifting in specific inheritance situations
+ // Bug 326052 [compiler] problems with team ctors with declared lifting in specific inheritance situations
public void test2228_declaredLiftingInConstructor5() {
-
+
runConformTest(
new String[] {
"Team2228dlic5_3.java",
@@ -4405,7 +4405,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a constructor with declared lifting calls super with a role across several levels - compiling in one go should not trigger compiler limitation (can't find super call)
// 2.2.28-otjld-declared-lifting-in-constructor-5g
public void test2228_declaredLiftingInConstructor5g() {
-
+
runConformTest(
new String[] {
"Team2228dlic5g_3.java",
@@ -4454,7 +4454,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a constructor with declared lifting calls super with a role across several levels -- unsupported data flow
// 2.2.28-otjld-declared-lifting-in-constructor-6
- // Bug 326052 [compiler] problems with team ctors with declared lifting in specific inheritance situations
+ // Bug 326052 [compiler] problems with team ctors with declared lifting in specific inheritance situations
public void _test2228_declaredLiftingInConstructor6() {
runConformTest(
new String[] {
@@ -4555,30 +4555,30 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
},
(this.weavingScheme == WeavingScheme.OTDRE || this.complianceLevel < ClassFileConstants.JDK1_8
?
- "----------\n" +
- "1. ERROR in Team2228dlic6l_3.java (at line 4)\n" +
- " public Team2228dlic6l_3(T2228dlic6l as R2 r) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Compiler limitation: This constructor seems to request lifting of an argument. However, the self call in Team2228dlic6l_2(R) of class Team2228dlic6l_2 passes its arguments in an unexpected way. Cannot perform required transitive byte-code translation.\n" +
+ "----------\n" +
+ "1. ERROR in Team2228dlic6l_3.java (at line 4)\n" +
+ " public Team2228dlic6l_3(T2228dlic6l as R2 r) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Compiler limitation: This constructor seems to request lifting of an argument. However, the self call in Team2228dlic6l_2(R) of class Team2228dlic6l_2 passes its arguments in an unexpected way. Cannot perform required transitive byte-code translation.\n" +
"----------\n"
:
- "----------\n" +
- "1. WARNING in Team2228dlic6l_3.java (at line 3)\n" +
- " public class R2 extends R playedBy T2228dlic6l {}\n" +
- " ^^^^^^^^^^^\n" +
- "Base class T2228dlic6l has class file version 52 which cannot be handled by the traditional OTRE based on BCEL. Please consider using the ASM based OTDRE instead.\n" +
- "----------\n" +
- "2. ERROR in Team2228dlic6l_3.java (at line 4)\n" +
- " public Team2228dlic6l_3(T2228dlic6l as R2 r) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Compiler limitation: This constructor seems to request lifting of an argument. However, the self call in Team2228dlic6l_2(R) of class Team2228dlic6l_2 passes its arguments in an unexpected way. Cannot perform required transitive byte-code translation.\n" +
+ "----------\n" +
+ "1. WARNING in Team2228dlic6l_3.java (at line 3)\n" +
+ " public class R2 extends R playedBy T2228dlic6l {}\n" +
+ " ^^^^^^^^^^^\n" +
+ "Base class T2228dlic6l has class file version 52 which cannot be handled by the traditional OTRE based on BCEL. Please consider using the ASM based OTDRE instead.\n" +
+ "----------\n" +
+ "2. ERROR in Team2228dlic6l_3.java (at line 4)\n" +
+ " public Team2228dlic6l_3(T2228dlic6l as R2 r) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Compiler limitation: This constructor seems to request lifting of an argument. However, the self call in Team2228dlic6l_2(R) of class Team2228dlic6l_2 passes its arguments in an unexpected way. Cannot perform required transitive byte-code translation.\n" +
"----------\n"
),
null/*classLibraries*/,
false/*shouldFlushOutputDirectory*/);
}
- // a constructor with declared lifting calls super with a role across several levels --
+ // a constructor with declared lifting calls super with a role across several levels --
// this version generated ICE("Binary method has no code attribute")
// 2.2.28-otjld-declared-lifting-in-constructor-6f
public void test2228_declaredLiftingInConstructor6f() {
@@ -4625,23 +4625,23 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team2228dlic6f_1.java (at line 7)\n" +
- " r.test(); // not visible \n" +
- " ^^^^\n" +
- "The method test() from the role type Team2228dlic6f_1.R is not visible (OTJLD 1.2.1(e)).\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Team2228dlic6f_2.java (at line 12)\n" +
- " super(r.id()); // not visible\n" +
- " ^^\n" +
- "The method id() from the role type Team2228dlic6f_2.R is not visible (OTJLD 1.2.1(e)).\n" +
+ "----------\n" +
+ "1. ERROR in Team2228dlic6f_1.java (at line 7)\n" +
+ " r.test(); // not visible \n" +
+ " ^^^^\n" +
+ "The method test() from the role type Team2228dlic6f_1.R is not visible (OTJLD 1.2.1(e)).\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in Team2228dlic6f_2.java (at line 12)\n" +
+ " super(r.id()); // not visible\n" +
+ " ^^\n" +
+ "The method id() from the role type Team2228dlic6f_2.R is not visible (OTJLD 1.2.1(e)).\n" +
"----------\n");
}
// a constructor with declared lifting calls super with a role across several levels -- unsupported data flow
// 2.2.28-otjld-declared-lifting-in-constructor-7
- // Bug 326052 [compiler] problems with team ctors with declared lifting in specific inheritance situations
+ // Bug 326052 [compiler] problems with team ctors with declared lifting in specific inheritance situations
public void _test2228_declaredLiftingInConstructor7() {
runConformTest(
new String[] {
@@ -4690,7 +4690,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
},
"OK");
}
-
+
// a constructor with declared lifting calls super with a role across several levels -- unsupported data flow
// 2.2.28-otjld-declared-lifting-in-constructor-7l
public void test2228_declaredLiftingInConstructor7l() {
@@ -4732,7 +4732,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
null/*classLibraries*/,
false/*shouldFlushOutputDirectory*/,
null/*vmArguments*/);
-
+
runNegativeTest(
new String[] {
"Team2228dlic7l_3.java",
@@ -4750,22 +4750,22 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
},
(this.weavingScheme == WeavingScheme.OTDRE || this.complianceLevel < ClassFileConstants.JDK1_8
?
- "----------\n" +
- "1. ERROR in Team2228dlic7l_3.java (at line 4)\n" +
- " public Team2228dlic7l_3(T2228dlic7l as R2 r) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Compiler limitation: This constructor seems to request lifting of an argument. However, the self call in Team2228dlic7l_2(R) of class Team2228dlic7l_2 passes its arguments in an unexpected way. Cannot perform required transitive byte-code translation.\n" +
+ "----------\n" +
+ "1. ERROR in Team2228dlic7l_3.java (at line 4)\n" +
+ " public Team2228dlic7l_3(T2228dlic7l as R2 r) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Compiler limitation: This constructor seems to request lifting of an argument. However, the self call in Team2228dlic7l_2(R) of class Team2228dlic7l_2 passes its arguments in an unexpected way. Cannot perform required transitive byte-code translation.\n" +
"----------\n"
:
- "1. WARNING in Team2228dlic7l_3.java (at line 3)\n" +
- " public class R2 extends R playedBy T2228dlic7l {}\n" +
- " ^^^^^^^^^^^\n" +
- "Base class T2228dlic7l has class file version 52 which cannot be handled by the traditional OTRE based on BCEL. Please consider using the ASM based OTDRE instead.\n" +
- "----------\n" +
- "2. ERROR in Team2228dlic7l_3.java (at line 4)\n" +
- " public Team2228dlic7l_3(T2228dlic7l as R2 r) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Compiler limitation: This constructor seems to request lifting of an argument. However, the self call in Team2228dlic7l_2(R) of class Team2228dlic7l_2 passes its arguments in an unexpected way. Cannot perform required transitive byte-code translation.\n" +
+ "1. WARNING in Team2228dlic7l_3.java (at line 3)\n" +
+ " public class R2 extends R playedBy T2228dlic7l {}\n" +
+ " ^^^^^^^^^^^\n" +
+ "Base class T2228dlic7l has class file version 52 which cannot be handled by the traditional OTRE based on BCEL. Please consider using the ASM based OTDRE instead.\n" +
+ "----------\n" +
+ "2. ERROR in Team2228dlic7l_3.java (at line 4)\n" +
+ " public Team2228dlic7l_3(T2228dlic7l as R2 r) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Compiler limitation: This constructor seems to request lifting of an argument. However, the self call in Team2228dlic7l_2(R) of class Team2228dlic7l_2 passes its arguments in an unexpected way. Cannot perform required transitive byte-code translation.\n" +
"----------\n"
),
null/*classLibraries*/,
@@ -4774,7 +4774,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// two roles are lifted, witness for a former AIOOBE in AnchorMapping
// 2.2.28-otjld-declared-lifting-in-constructor-8
public void test2228_declaredLiftingInConstructor8() {
-
+
runConformTest(
new String[] {
"Team2228dlic8_2.java",
@@ -4836,7 +4836,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a role is explicitly lowered
// 2.2.29-otjld-explicit-lowering-1
public void test2229_explicitLowering1() {
-
+
runConformTest(
new String[] {
"Team2229el1.java",
@@ -4869,7 +4869,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// explicit lowering has the type of the bound base class
// 2.2.29-otjld-explicit-lowering-2
public void test2229_explicitLowering2() {
-
+
runConformTest(
new String[] {
"Team2229el2.java",
@@ -4919,7 +4919,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// an abstract bound role implements ILowerable
// 2.2.29-otjld-explicit-lowering-3
public void test2229_explicitLowering3() {
-
+
runConformTest(
new String[] {
"Team2229el3.java",
@@ -5027,18 +5027,18 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
"} \n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team2230dlism.java (at line 4)\n" +
- " static void erroneous(T2230dlism as R o) {}\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Illegal type for argument o: declared lifting not allowed in static methods (OTJLD 2.3.2(a)).\n" +
+ "----------\n" +
+ "1. ERROR in Team2230dlism.java (at line 4)\n" +
+ " static void erroneous(T2230dlism as R o) {}\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Illegal type for argument o: declared lifting not allowed in static methods (OTJLD 2.3.2(a)).\n" +
"----------\n");
}
// a base object should be lifting before its ctor has finished (was TPX-487)
// 2.2.31-otjld-lifting-uninitialized-object-1
public void test2231_liftingUninitializedObject1() {
-
+
runConformTest(
new String[] {
"Team2231luo1.java",
@@ -5079,7 +5079,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a base object should be lifting before its ctor has finished - replace
// 2.2.31-otjld-lifting-uninitialized-object-2
public void test2231_liftingUninitializedObject2() {
-
+
runConformTest(
new String[] {
"Team2231luo2.java",
@@ -5121,7 +5121,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// an abstract role class is bound to an abstract base class
// 2.2.32-otjld-lifting-to-abstract-role-1
public void test2232_liftingToAbstractRole1() {
-
+
runConformTest(
new String[] {
"Team2232ltar1.java",
@@ -5161,7 +5161,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a role is explicitly created to a class that could not be produced by smart lifting, subsequent lifting callin fails
// 2.2.33-otjld-explicit-creation-breaks-lifting-1
public void test2233_explicitCreationBreaksLifting1() {
-
+
runConformTest(
new String[] {
"Team2233ecbl1.java",
@@ -5205,7 +5205,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a nested team uses declared lifting, regular base class
// 2.2.34-otjld-declared-lifting-in-nested-team-1
public void test2234_declaredLiftingInNestedTeam1() {
-
+
runConformTest(
new String[] {
"Team2234dlint1.java",
@@ -5242,7 +5242,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a nested team uses declared lifting, base class is role of outer team
// 2.2.34-otjld-declared-lifting-in-nested-team-2
public void test2234_declaredLiftingInNestedTeam2() {
-
+
runConformTest(
new String[] {
"Team2234dlint2.java",
@@ -5276,7 +5276,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
// a method call could be resolved both with and without lowering - role type is more specific than lowered base
// 2.2.35-otjld-ambiguous-lowering-1
public void test2235_ambiguousLowering1() {
-
+
runConformTest(
new String[] {
"Team2235al1.java",
@@ -5491,7 +5491,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
" t.test(b);\n" +
" System.out.print(t.getAllRoles().length);\n" +
" }\n" +
- "}\n",
+ "}\n",
"T2237ip1.java",
"public class T2237ip1 {\n" +
" void test() { System.out.print(\"OK\"); }\n" +
@@ -5524,7 +5524,7 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
" t.test(b);\n" +
" System.out.print(t.getAllRoles().length);\n" +
" }\n" +
- "}\n",
+ "}\n",
"T2237ip2.java",
"public class T2237ip2 {\n" +
" void test() { System.out.print(\"OK\"); }\n" +
@@ -5546,16 +5546,16 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
" @Instantiation(ONDEMAND)\n" +
" protected class R {\n" +
" }\n" +
- "}\n",
+ "}\n",
},
- "----------\n" +
- "1. ERROR in NotATeam2237ip3.java (at line 4)\n" +
- " @Instantiation(ONDEMAND)\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Annotation \'@Instantiation\' can only be applied to role classes (OTJLD 2.3.1(d)).\n" +
+ "----------\n" +
+ "1. ERROR in NotATeam2237ip3.java (at line 4)\n" +
+ " @Instantiation(ONDEMAND)\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Annotation \'@Instantiation\' can only be applied to role classes (OTJLD 2.3.1(d)).\n" +
"----------\n");
}
-
+
public void test2237_instantiationPolicy4() {
runNegativeTest(
new String[] {
@@ -5567,18 +5567,18 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
" protected class R {\n" +
" int val = 0;\n" +
" }\n" +
- "}\n",
+ "}\n",
},
- "----------\n" +
- "1. WARNING in Team2237ip4.java (at line 5)\n" +
- " protected class R {\n" +
- " ^\n" +
- "Roles with InstantiationPolicy \'ALWAYS\' should define equals() and hashCode() methods (OTJLD 2.3.1(d)).\n" +
- "----------\n" +
- "2. WARNING in Team2237ip4.java (at line 6)\n" +
- " int val = 0;\n" +
- " ^^^\n" +
- "Fields are discouraged in roles with InstantiationPolicy \'ALWAYS\' (OTJLD 2.3.1(d)).\n" +
+ "----------\n" +
+ "1. WARNING in Team2237ip4.java (at line 5)\n" +
+ " protected class R {\n" +
+ " ^\n" +
+ "Roles with InstantiationPolicy \'ALWAYS\' should define equals() and hashCode() methods (OTJLD 2.3.1(d)).\n" +
+ "----------\n" +
+ "2. WARNING in Team2237ip4.java (at line 6)\n" +
+ " int val = 0;\n" +
+ " ^^^\n" +
+ "Fields are discouraged in roles with InstantiationPolicy \'ALWAYS\' (OTJLD 2.3.1(d)).\n" +
"----------\n");
}
@@ -5587,34 +5587,34 @@ public class LiftingAndLowering extends AbstractOTJLDTest {
runConformTest(
new String[] {
"to/TOuter.java",
- "package to;\n" +
- "\n" +
- "\n" +
- "import base tb.TB1;\n" +
- "import base tb.TB2;\n" +
- "\n" +
- "public team class TOuter {\n" +
- " public team class T1 playedBy TB1 {\n" +
- " protected class R playedBy B<@base> { }\n" +
- " /* added method */\n" +
- " public void test() {\n" +
- " new R(new B<@base>()); // works!\n" +
- " }\n" +
- " }\n" +
- " public team class T2 extends T1 playedBy TB2 {\n" +
+ "package to;\n" +
+ "\n" +
+ "\n" +
+ "import base tb.TB1;\n" +
+ "import base tb.TB2;\n" +
+ "\n" +
+ "public team class TOuter {\n" +
+ " public team class T1 playedBy TB1 {\n" +
+ " protected class R playedBy B<@base> { }\n" +
+ " /* added method */\n" +
+ " public void test() {\n" +
+ " new R(new B<@base>()); // works!\n" +
+ " }\n" +
+ " }\n" +
+ " public team class T2 extends T1 playedBy TB2 {\n" +
+ " @Override\n" +
+ " protected class R playedBy B<@base> { }\n" +
" @Override\n" +
- " protected class R playedBy B<@base> { }\n" +
- " @Override\n" +
- " public void test() {\n" +
- " new R(new B<@base>()); // error!\n" +
- " }\n" +
+ " public void test() {\n" +
+ " new R(new B<@base>()); // error!\n" +
+ " }\n" +
" }\n" +
" void test(TB2 as T2 t2) {\n" +
" t2.test();\n" +
" }\n" +
" public static void main(String... args) {\n" +
" new TOuter().test(new tb.TB2());\n" +
- " }\n" +
+ " }\n" +
"}\n",
"tb/TB2.java",
"package tb;\n" +
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/PlayedByRelation.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/PlayedByRelation.java
index 66523ef74..c8cf8dc46 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/PlayedByRelation.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/roleplaying/PlayedByRelation.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -29,11 +29,11 @@ import junit.framework.Test;
@SuppressWarnings("unchecked")
public class PlayedByRelation extends AbstractOTJLDTest {
-
+
public PlayedByRelation(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -41,7 +41,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -53,7 +53,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
// a role is bound to an unrelated class
// 2.1.1-otjld-bound-to-unrelated-class-1
public void test211_boundToUnrelatedClass1() {
-
+
runConformTest(
new String[] {
"T211btuc1Main.java",
@@ -96,7 +96,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
// a role is bound to an inner class of the enclosing normal class
// 2.1.1-otjld-bound-to-unrelated-class-2
public void test211_boundToUnrelatedClass2() {
-
+
runConformTest(
new String[] {
"T211btuc2Main.java",
@@ -137,7 +137,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
// a role is bound to a nested class of some other normal class
// 2.1.1-otjld-bound-to-unrelated-class-3
public void test211_boundToUnrelatedClass3() {
-
+
runConformTest(
new String[] {
"T211btuc3Main.java",
@@ -182,7 +182,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
// a role is bound to another team class
// 2.1.1-otjld-bound-to-unrelated-class-4
public void test211_boundToUnrelatedClass4() {
-
+
runConformTest(
new String[] {
"T211btuc4Main.java",
@@ -240,18 +240,18 @@ public class PlayedByRelation extends AbstractOTJLDTest {
"public class T211btuc5 { }\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team211btuc5.java (at line 3)\n" +
- " protected class R playedBy T211btuc5 { }\n" +
- " ^^^^^^^^^\n" +
- "Base class T211btuc5 is deprecated.\n" +
+ "----------\n" +
+ "1. ERROR in Team211btuc5.java (at line 3)\n" +
+ " protected class R playedBy T211btuc5 { }\n" +
+ " ^^^^^^^^^\n" +
+ "Base class T211btuc5 is deprecated.\n" +
"----------\n");
}
// a role is bound to its direct superclass
// 2.1.2-otjld-bound-to-related-class-1
public void test212_boundToRelatedClass1() {
-
+
runConformTest(
new String[] {
"T212btrc1Main.java",
@@ -297,7 +297,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
// a role is bound to its indirect superclass
// 2.1.2-otjld-bound-to-related-class-2
public void test212_boundToRelatedClass2() {
-
+
runConformTest(
new String[] {
"T212btrc2Main.java",
@@ -374,21 +374,21 @@ public class PlayedByRelation extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in T212btrc3.java (at line 7)\n" +
- " public class Role212btrc3 playedBy T212btrc3 {\n" +
- " ^^^^^^^^^\n" +
- "Base class T212btrc3 is an enclosing type of Role212btrc3; please read the hints in the OT/J Language Definition (OTJLD 2.1.2(b)).\n" +
- "----------\n" +
- "2. ERROR in T212btrc3.java (at line 8)\n" +
- " public String getValue() -> String getValueInternal();\n" +
- " ^^^^^^^^\n" +
- "Role T212btrc3.Team212btrc3.Role212btrc3 cannot declare callout bindings because it is playedBy enclosing type T212btrc3 (OTJLD 3.1(a)); please directly access the target method.\n" +
- "----------\n" +
- "3. ERROR in T212btrc3.java (at line 12)\n" +
- " return obj.getValue();\n" +
- " ^^^^^^^^\n" +
- "The method getValue() is undefined for the type Role212btrc3<@tthis[Team212btrc3]>\n" +
+ "----------\n" +
+ "1. ERROR in T212btrc3.java (at line 7)\n" +
+ " public class Role212btrc3 playedBy T212btrc3 {\n" +
+ " ^^^^^^^^^\n" +
+ "Base class T212btrc3 is an enclosing type of Role212btrc3; please read the hints in the OT/J Language Definition (OTJLD 2.1.2(b)).\n" +
+ "----------\n" +
+ "2. ERROR in T212btrc3.java (at line 8)\n" +
+ " public String getValue() -> String getValueInternal();\n" +
+ " ^^^^^^^^\n" +
+ "Role T212btrc3.Team212btrc3.Role212btrc3 cannot declare callout bindings because it is playedBy enclosing type T212btrc3 (OTJLD 3.1(a)); please directly access the target method.\n" +
+ "----------\n" +
+ "3. ERROR in T212btrc3.java (at line 12)\n" +
+ " return obj.getValue();\n" +
+ " ^^^^^^^^\n" +
+ "The method getValue() is undefined for the type Role212btrc3<@tthis[Team212btrc3]>\n" +
"----------\n",
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
@@ -409,7 +409,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
" }\n" +
"\n" +
" @SuppressWarnings(\"baseclasscycle\")\n" +
- " protected class Role212btrc4 playedBy Team212btrc4 {\n" +
+ " protected class Role212btrc4 playedBy Team212btrc4 {\n" +
" String getValue() <- replace String getValueInternal();\n" +
" callin String getValue() {\n" +
" return base.getValue() + \"K\";\n" +
@@ -431,7 +431,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
// 2.1.2-otjld-bound-to-related-class-5
// Bug 318815 - [otjld] [compiler] Support the "Internal Role" pattern
public void test212_boundToRelatedClass5() {
-
+
runNegativeTest(
new String[] {
"T212btrc5Main.java",
@@ -468,16 +468,16 @@ public class PlayedByRelation extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team212btrc5_2.java (at line 6)\n" +
- " public String getValue() -> String getValueInternal();\n" +
- " ^^^^^^^^\n" +
- "Role Team212btrc5_2.Role212btrc5 cannot declare callout bindings because it is playedBy enclosing type Team212btrc5_1 (OTJLD 3.1(a)); please directly access the target method.\n" +
- "----------\n" +
- "2. ERROR in Team212btrc5_2.java (at line 10)\n" +
- " return obj.getValue();\n" +
- " ^^^^^^^^\n" +
- "The method getValue() is undefined for the type Role212btrc5<@tthis[Team212btrc5_2]>\n" +
+ "----------\n" +
+ "1. ERROR in Team212btrc5_2.java (at line 6)\n" +
+ " public String getValue() -> String getValueInternal();\n" +
+ " ^^^^^^^^\n" +
+ "Role Team212btrc5_2.Role212btrc5 cannot declare callout bindings because it is playedBy enclosing type Team212btrc5_1 (OTJLD 3.1(a)); please directly access the target method.\n" +
+ "----------\n" +
+ "2. ERROR in Team212btrc5_2.java (at line 10)\n" +
+ " return obj.getValue();\n" +
+ " ^^^^^^^^\n" +
+ "The method getValue() is undefined for the type Role212btrc5<@tthis[Team212btrc5_2]>\n" +
"----------\n");
}
@@ -491,7 +491,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
"Team212btrc6_2.java",
"\n" +
"public team class Team212btrc6_2 {\n" +
- " protected class Role212btrc6_2 playedBy Team212btrc6_1 {\n" +
+ " protected class Role212btrc6_2 playedBy Team212btrc6_1 {\n" +
" }\n" +
"}\n",
"Team212btrc6_1.java",
@@ -499,25 +499,25 @@ public class PlayedByRelation extends AbstractOTJLDTest {
" protected class Role212btrc6_1 playedBy Team212btrc6_2 {} \n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Team212btrc6_2.java (at line 3)\n" +
- " protected class Role212btrc6_2 playedBy Team212btrc6_1 {\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Base class/member type circularity via chain Team212btrc6_2.Role212btrc6_2->Team212btrc6_1->Team212btrc6_1.Role212btrc6_1->Team212btrc6_2;\n" +
- "please read the hints in the OT/J Language Definition (OTJLD 2.1.2(b)).\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Team212btrc6_1.java (at line 2)\n" +
- " protected class Role212btrc6_1 playedBy Team212btrc6_2 {} \n" +
- " ^^^^^^^^^^^^^^\n" +
- "Base class/member type circularity via chain Team212btrc6_1.Role212btrc6_1->Team212btrc6_2->Team212btrc6_2.Role212btrc6_2->Team212btrc6_1;\n" +
- "please read the hints in the OT/J Language Definition (OTJLD 2.1.2(b)).\n" +
+ "----------\n" +
+ "1. ERROR in Team212btrc6_2.java (at line 3)\n" +
+ " protected class Role212btrc6_2 playedBy Team212btrc6_1 {\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Base class/member type circularity via chain Team212btrc6_2.Role212btrc6_2->Team212btrc6_1->Team212btrc6_1.Role212btrc6_1->Team212btrc6_2;\n" +
+ "please read the hints in the OT/J Language Definition (OTJLD 2.1.2(b)).\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in Team212btrc6_1.java (at line 2)\n" +
+ " protected class Role212btrc6_1 playedBy Team212btrc6_2 {} \n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Base class/member type circularity via chain Team212btrc6_1.Role212btrc6_1->Team212btrc6_2->Team212btrc6_2.Role212btrc6_2->Team212btrc6_1;\n" +
+ "please read the hints in the OT/J Language Definition (OTJLD 2.1.2(b)).\n" +
"----------\n",
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
customOptions);
}
-
+
// a role is bound to an interface
// 2.1.3-otjld-bound-to-interface
public void test213_boundToInterface_1() {
@@ -550,18 +550,18 @@ public class PlayedByRelation extends AbstractOTJLDTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in Team213bti1.java (at line 3)\n" +
- " public class Role213bti1 playedBy I213bti1 {\n" +
- " ^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in Team213bti1.java (at line 3)\n" +
+ " public class Role213bti1 playedBy I213bti1 {\n" +
+ " ^^^^^^^^\n" +
"When binding interface I213bti1 as base of Role213bti1:\n" +
- "Note that some features like callin bindings are not yet supported in this situation (OTJLD 2.1.1).\n" +
+ "Note that some features like callin bindings are not yet supported in this situation (OTJLD 2.1.1).\n" +
"----------\n",
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
customOptions);
}
-
+
// a role is bound to an interface
// this could work (no method bindings here)
public void test213_boundToInterface_2() {
@@ -603,7 +603,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
}
// a role is bound to an interface - with callout
- // 2.1.3-otjld-bound-to-interface
+ // 2.1.3-otjld-bound-to-interface
public void test213_boundToInterface_3() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation, CompilerOptions.DISABLED);
@@ -741,11 +741,11 @@ public class PlayedByRelation extends AbstractOTJLDTest {
true/*shouldFlushOutputDirectory*/,
customOptions);
}
-
+
// a role is bound to an abstract class
// 2.1.3-otjld-bound-to-abstract-class
public void test213_boundToAbstractClass() {
-
+
runConformTest(
new String[] {
"T213btacMain.java",
@@ -806,23 +806,23 @@ public class PlayedByRelation extends AbstractOTJLDTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in Team214btrt1.java (at line 3)\n" +
- " protected class Role214btrt1 playedBy Team214btrt1 {\n" +
- " ^^^^^^^^^^^^\n" +
- "Base class Team214btrt1 is an enclosing type of Role214btrt1; please read the hints in the OT/J Language Definition (OTJLD 2.1.2(b)).\n" +
- "----------\n" +
- "2. ERROR in Team214btrt1.java (at line 5)\n" +
- " base();\n" +
- " ^^^^\n" +
- "Cannot invoke a base constructor because enclosing role Team214btrt1.Role214btrt1 is involved in baseclass circularity (OTJLD 2.4.2). \n" +
+ "----------\n" +
+ "1. WARNING in Team214btrt1.java (at line 3)\n" +
+ " protected class Role214btrt1 playedBy Team214btrt1 {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Base class Team214btrt1 is an enclosing type of Role214btrt1; please read the hints in the OT/J Language Definition (OTJLD 2.1.2(b)).\n" +
+ "----------\n" +
+ "2. ERROR in Team214btrt1.java (at line 5)\n" +
+ " base();\n" +
+ " ^^^^\n" +
+ "Cannot invoke a base constructor because enclosing role Team214btrt1.Role214btrt1 is involved in baseclass circularity (OTJLD 2.4.2). \n" +
"----------\n");
}
// a role is bound to its superteam (from which it is implicitly inherited), invokes method of enclosing team that recursively invokes the role method
// 2.1.4-otjld-bound-to-related-team-2
public void test214_boundToRelatedTeam2() {
-
+
runConformTest(
new String[] {
"T214btrt2Main.java",
@@ -962,7 +962,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
// a role is bound to another role in a different team using an anchored type
// 2.1.5-otjld-bound-to-role-4
public void test215_boundToRole4() {
-
+
runConformTest(
new String[] {
"Team215btr4_2.java",
@@ -1004,7 +1004,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
// a role is bound to another role in a different team using an anchored type (with package structure)
// 2.1.5-otjld-bound-to-role-4a
public void test215_boundToRole4a() {
-
+
runConformTest(
new String[] {
"mypackage/Team215btr4a_2.java",
@@ -1048,7 +1048,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
// a role is bound to another role in a different team using an anchored type - after callin
// 2.1.5-otjld-bound-to-role-5
public void test215_boundToRole5() {
-
+
runConformTest(
new String[] {
"Team215btr5_2.java",
@@ -1103,7 +1103,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
// a role is bound to another role in a different team using an anchored type - replace callin
// 2.1.5-otjld-bound-to-role-6
public void test215_boundToRole6() {
-
+
runConformTest(
new String[] {
"Team215btr6_2.java",
@@ -1160,7 +1160,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
// a role is bound to another role in a different team using an anchored type - after callin to callin method
// 2.1.5-otjld-bound-to-role-7
public void test215_boundToRole7() {
-
+
runConformTest(
new String[] {
"Team215btr7_2.java",
@@ -1226,7 +1226,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
// a role is bound to another role in a different team using an anchored type - before callin to after callin
// 2.1.5-otjld-bound-to-role-8
public void test215_boundToRole8() {
-
+
runConformTest(
new String[] {
"Team215btr8_2.java",
@@ -1279,7 +1279,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
// 2.1.5-otjld-bound-to-role-9
public void test215_boundToRole9() {
Map customOptions = getCompilerOptions();
-
+
runConformTest(
new String[] {
"Team215btr9_2.java",
@@ -1352,7 +1352,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
// two instances of lower team exist, only one is adapted by an active team
// 2.1.5-otjld-bound-to-role-10
public void test215_boundToRole10() {
-
+
runConformTest(
new String[] {
"T215btr10Main.java",
@@ -1405,7 +1405,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
// two instances of lower team exist, only one is adapted by an active team -- playedBy from binary
// 2.1.5-otjld_bound-to-role-11
public void _bound_test215_toRole11() {
-
+
runConformTest(
new String[] {
"T215btr11Main.java",
@@ -1470,7 +1470,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
// multilevel baseclass refinement + accumulating base imported bases
// 2.1.5-otjld_bound-to-role-12
public void _bound_test215_toRole12() {
-
+
runConformTest(
new String[] {
"Team215btr12_4.java",
@@ -1542,7 +1542,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
// a role is bound to the same base class as its implicit super role
// 2.1.6-otjld-same-player-as-superrole-1
public void test216_samePlayerAsSuperrole1() {
-
+
runConformTest(
new String[] {
"T216spas1Main.java",
@@ -1604,7 +1604,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
" return \"OK\";\n" +
" }\n" +
" }\n" +
- "}\n"
+ "}\n"
});
runConformTest(
new String[] {
@@ -1654,7 +1654,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
// a role is bound to the same base class (an inner class in the same enclosing normal class) as its explicit super role
// 2.1.6-otjld-same-player-as-superrole-3
public void test216_samePlayerAsSuperrole3() {
-
+
runConformTest(
new String[] {
"T216spas3Main.java",
@@ -1706,7 +1706,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
// a role is bound to the subclass of the base class of its explicit superrole
// 2.1.7-otjld-bound-to-subclass-1
public void test217_boundToSubclass1() {
-
+
runConformTest(
new String[] {
"T217bts1Main.java",
@@ -1758,7 +1758,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
// a role is bound to the subclass of the base class of its explicit superrole
// 2.1.7-otjld-bound-to-subclass-2
public void test217_boundToSubclass2() {
-
+
runConformTest(
new String[] {
"T217bts2Main.java",
@@ -1995,7 +1995,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
// a role inherits different, but compatible base classes
// 2.1.9-otjld-playedby-inheritance-4
public void test219_playedbyInheritance4() {
-
+
runConformTest(
new String[] {
"Team219pi4.java",
@@ -2049,7 +2049,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
// a role implicitly inherits and uses a playedby relation unchanged
// 2.1.9-otjld-playedby-inheritance-5
public void test219_playedbyInheritance5() {
-
+
runConformTest(
new String[] {
"Team219pi5_2.java",
@@ -2089,7 +2089,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
// a team imports a base class using a base-import
// 2.1.10-otjld-base-import-1
public void test2110_baseImport1() {
-
+
runConformTest(
new String[] {
"Team2110bi1.java",
@@ -2124,7 +2124,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
// a team imports a base class using a base-import - base class decapsulation
// 2.1.10-otjld-base-import-1d
public void test2110_baseImport1d() {
-
+
runConformTest(
new String[] {
"Team2110bi1d.java",
@@ -2190,7 +2190,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
// a team imports a base class using a base-import -- using in declared lifting
// 2.1.10-otjld-base-import-3
public void test2110_baseImport3() {
-
+
runConformTest(
new String[] {
"Team2110bi3.java",
@@ -2260,7 +2260,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
" \n"
},
"----------\n" +
- "1. WARNING in Team2110bi5.java (at line 5)\n" +
+ "1. WARNING in Team2110bi5.java (at line 5)\n" +
" protected class Role playedBy JFrame {}\n" +
" ^^^^^^\n" +
"It is recommended that base class JFrame be imported with the modifier \"base\" (OTJLD 2.1.2(d)).\n" +
@@ -2285,25 +2285,25 @@ public class PlayedByRelation extends AbstractOTJLDTest {
},
(this.weavingScheme == WeavingScheme.OTDRE || !IS_JRE_8
?
- "----------\n" +
- "1. WARNING in Team2110bi6.java (at line 4)\n" +
- " protected class Role playedBy JFrame {}\n" +
- " ^^^^^^\n" +
- "Base class javax.swing.JFrame appears to be a system class, which means that load time weaving could possibly fail\n" +
- "if this class is loaded from rt.jar/the bootstrap classpath.\n" +
+ "----------\n" +
+ "1. WARNING in Team2110bi6.java (at line 4)\n" +
+ " protected class Role playedBy JFrame {}\n" +
+ " ^^^^^^\n" +
+ "Base class javax.swing.JFrame appears to be a system class, which means that load time weaving could possibly fail\n" +
+ "if this class is loaded from rt.jar/the bootstrap classpath.\n" +
"----------\n"
:
- "----------\n" +
- "1. WARNING in Team2110bi6.java (at line 4)\n" +
- " protected class Role playedBy JFrame {}\n" +
- " ^^^^^^\n" +
- "Base class javax.swing.JFrame has class file version 52 which cannot be handled by the traditional OTRE based on BCEL. Please consider using the ASM based OTDRE instead.\n" +
- "----------\n" +
- "2. WARNING in Team2110bi6.java (at line 4)\n" +
- " protected class Role playedBy JFrame {}\n" +
- " ^^^^^^\n" +
- "Base class javax.swing.JFrame appears to be a system class, which means that load time weaving could possibly fail\n" +
- "if this class is loaded from rt.jar/the bootstrap classpath.\n" +
+ "----------\n" +
+ "1. WARNING in Team2110bi6.java (at line 4)\n" +
+ " protected class Role playedBy JFrame {}\n" +
+ " ^^^^^^\n" +
+ "Base class javax.swing.JFrame has class file version 52 which cannot be handled by the traditional OTRE based on BCEL. Please consider using the ASM based OTDRE instead.\n" +
+ "----------\n" +
+ "2. WARNING in Team2110bi6.java (at line 4)\n" +
+ " protected class Role playedBy JFrame {}\n" +
+ " ^^^^^^\n" +
+ "Base class javax.swing.JFrame appears to be a system class, which means that load time weaving could possibly fail\n" +
+ "if this class is loaded from rt.jar/the bootstrap classpath.\n" +
"----------\n"
),
customOptions);
@@ -2336,11 +2336,11 @@ public class PlayedByRelation extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. WARNING in Team2110bi7.java (at line 3)\n" +
- " import base java.util.List;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The import java.util.List is never used\n" +
+ "----------\n" +
+ "1. WARNING in Team2110bi7.java (at line 3)\n" +
+ " import base java.util.List;\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The import java.util.List is never used\n" +
"----------\n",
customOptions);
}
@@ -2405,18 +2405,18 @@ public class PlayedByRelation extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team2111pwt1f.java (at line 22)\n" +
- " new Team2111pwt1f().new Mid();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The constructor Team2111pwt1f.Mid() is undefined\n" +
+ "----------\n" +
+ "1. ERROR in Team2111pwt1f.java (at line 22)\n" +
+ " new Team2111pwt1f().new Mid();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The constructor Team2111pwt1f.Mid() is undefined\n" +
"----------\n");
}
// a role is playedBy a role of outer enclosing team
// 2.1.11-otjld-playedBy-within-team-1
public void test2111_playedByWithinTeam1() {
-
+
runConformTest(
new String[] {
"Team2111pwt1.java",
@@ -2451,7 +2451,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
// a playedBy is refined by implicit inheritence, base is role of same enclosing
// 2.1.12-otjld-implicitly-refined-playedBy-1
public void test2112_implicitlyRefinedPlayedBy1() {
-
+
runConformTest(
new String[] {
"Team2112irp1_2.java",
@@ -2505,7 +2505,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
// a playedBy is refined by implicit inheritence, two levels of nesting
// 2.1.12-otjld-implicitly-refined-playedBy-2
public void test2112_implicitlyRefinedPlayedBy2() {
-
+
runConformTest(
new String[] {
"Team2112irp2_2.java",
@@ -2563,7 +2563,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
// a role migrates to a different base object, same type
// 2.1.13-otjld-base-migration-1
public void test2113_baseMigration1() {
-
+
runConformTest(
new String[] {
"Team2113bm1.java",
@@ -2644,7 +2644,7 @@ public class PlayedByRelation extends AbstractOTJLDTest {
},
"not applicable");
}
-
+
// see https://bugs.eclipse.org/348082
// [compiler] Internal Role pattern with deeply nested team gives compile error in generated code
public void test2124_internalRole1() {
@@ -2653,11 +2653,11 @@ public class PlayedByRelation extends AbstractOTJLDTest {
"p2124/Team2124ir1.java",
"package p2124;\n" +
"public team class Team2124ir1 {\n" +
- " protected team class Mid {\n" +
+ " protected team class Mid {\n" +
" protected team class Inner playedBy Mid {\n" +
- "\n" +
- " }\n" +
- " }\n" +
+ "\n" +
+ " }\n" +
+ " }\n" +
"" +
"}\n"
});
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/AcquisitionAndInheritanceOfRoleClasses.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/AcquisitionAndInheritanceOfRoleClasses.java
index 16f11c173..e188e9fe6 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/AcquisitionAndInheritanceOfRoleClasses.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/AcquisitionAndInheritanceOfRoleClasses.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -32,7 +32,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
public AcquisitionAndInheritanceOfRoleClasses(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -40,7 +40,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -52,7 +52,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// a team accesses a public feature of an unbound role class defined in it
// 1.3.1-otjld-role-feature-access-1
public void test131_roleFeatureAccess1() {
-
+
runConformTest(
new String[] {
"T131rfa1Main.java",
@@ -87,7 +87,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// a team accesses a friendly feature of a bound role class defined in it
// 1.3.1-otjld-role-feature-access-2
public void test131_roleFeatureAccess2() {
-
+
runConformTest(
new String[] {
"T131rfa2Main.java",
@@ -131,7 +131,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// a team accesses a protected feature of an unbound role inherited from an indirect super team
// 1.3.1-otjld-role-feature-access-3
public void test131_roleFeatureAccess3() {
-
+
runConformTest(
new String[] {
"T131rfa3Main.java",
@@ -173,7 +173,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// a team accesses a static protected feature of a bound role inherited from a direct super team - callout
// 1.3.1-otjld-role-feature-access-4
public void test131_roleFeatureAccess4() {
-
+
runConformTest(
new String[] {
"T131rfa4Main.java",
@@ -220,7 +220,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// a team accesses a static protected feature of a bound role inherited from a direct super team - shorthand callout
// 1.3.1-otjld-role-feature-access-4s
public void test131_roleFeatureAccess4s() {
-
+
runConformTest(
new String[] {
"T131rfa4sMain.java",
@@ -266,7 +266,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// a team accesses a static protected feature of a unbound role inherited from a direct super team - regular method
// 1.3.1-otjld-role-feature-access-5
public void test131_roleFeatureAccess5() {
-
+
runConformTest(
new String[] {
"T131rfa5Main.java",
@@ -306,7 +306,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// role feature accessed via function in the team, overridden (challenging weakening
// 1.3.1-otjld-role-feature-access-6
public void test131_roleFeatureAccess6() {
-
+
runConformTest(
new String[] {
"Team131rfa6_2.java",
@@ -342,7 +342,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// a role class accesses a feature inherited from its implicit super role
// 1.3.2-otjld-role-inherited-feature-access-1
public void test132_roleInheritedFeatureAccess1() {
-
+
runConformTest(
new String[] {
"T132rfa1Main.java",
@@ -386,7 +386,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// a role class accesses an overwritten feature that it indirectly inherited from its implicit super role - default visibility
// 1.3.2-otjld-role-inherited-feature-access-2
public void test132_roleInheritedFeatureAccess2() {
-
+
runConformTest(
new String[] {
"T132rfa2Main.java",
@@ -437,7 +437,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// a role class accesses an overwritten feature that it indirectly inherited from its implicit super role
// 1.3.2-otjld-role-inherited-feature-access-2a
public void test132_roleInheritedFeatureAccess2a() {
-
+
runConformTest(
new String[] {
"T132rfa2aMain.java",
@@ -488,7 +488,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// a role class accesses an overwritten feature that it indirectly inherited from its implicit super role
// challenge tsuper from private
public void _test132_roleInheritedFeatureAccess2b() {
-
+
runConformTest(
new String[] {
"T132rfa2bMain.java",
@@ -539,7 +539,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// a role class accesses a feature inherited from its direct explicit super role
// 1.3.2-otjld-role-inherited-feature-access-3
public void test132_roleInheritedFeatureAccess3() {
-
+
runConformTest(
new String[] {
"T132rfa3Main.java",
@@ -586,7 +586,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// a role class accesses an overwritten feature inherited from an indirectly explicit super role
// 1.3.2-otjld-role-inherited-feature-access-4
public void test132_roleInheritedFeatureAccess4() {
-
+
runConformTest(
new String[] {
"T132rfa4Main.java",
@@ -639,7 +639,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// an implicitly inherited role class is not the subtype (as of Java) of its super role
// 1.3.3-otjld-role-not-subtype-of-superrole-1
public void test133_roleNotSubtypeOfSuperrole1() {
-
+
runConformTest(
new String[] {
"T133rnsos1Main.java",
@@ -674,7 +674,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// an implicitly inherited role class is not the subtype (as of Java) of its super role, cast fails
// 1.3.3-otjld-role-not-subtype-of-superrole-1a
public void test133_roleNotSubtypeOfSuperrole1a() {
-
+
runConformTest(
new String[] {
"T133rnsos1aMain.java",
@@ -714,7 +714,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// an implicitly inherited role class is not the subtype (as of Java) of its super role -- cast to unqualified role type
// 1.3.3-otjld-role-not-subtype-of-superrole-1c
public void test133_roleNotSubtypeOfSuperrole1c() {
-
+
runConformTest(
new String[] {
"Team133rnsos1c_2.java",
@@ -750,7 +750,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// an implicitly inherited role class is not the subtype (as of Java) of its super role -- unqualified role type expands to "tthis.R"
// 1.3.3-otjld-role-not-subtype-of-superrole-1e
public void test133_roleNotSubtypeOfSuperrole1e() {
-
+
runConformTest(
new String[] {
"Team133rnsos1e_2.java",
@@ -783,7 +783,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// an implicitly inherited role class is not the subtype (as of Java) of its super role - anchors are fields
// 1.3.3-otjld-role-not-subtype-of-superrole-1f
public void test133_roleNotSubtypeOfSuperrole1f() {
-
+
runConformTest(
new String[] {
"T133rnsos1fMain.java",
@@ -817,7 +817,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// a role class is not the subtype (as of Java) of its implicit super role
// 1.3.3-otjld-role-not-subtype-of-superrole-2
public void test133_roleNotSubtypeOfSuperrole2() {
-
+
runConformTest(
new String[] {
"T133rnsos2Main.java",
@@ -857,7 +857,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// a role class is a subtype (as of Java) of its explicit super role
// 1.3.3-otjld-role-not-subtype-of-superrole-3
public void test133_roleNotSubtypeOfSuperrole3() {
-
+
runConformTest(
new String[] {
"T133rnsos3Main.java",
@@ -963,7 +963,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// a subteam redefines an implicitly inherited role class including one of the role class's features
// 1.3.5-otjld-redefining-role-feature
public void test135_redefiningRoleFeature() {
-
+
runConformTest(
new String[] {
"T135rrfMain.java",
@@ -1004,7 +1004,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// a subteam redefines an implicitly inherited role class that is used via an anchored type in a feature of another role of the superteam
// 1.3.6-otjld-redefined-anchored-type-1
public void test136_redefinedAnchoredType1() {
-
+
runConformTest(
new String[] {
"T136rat1Main.java",
@@ -1055,7 +1055,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// a subteam redefines an implicitly inherited role class that is used via an anchored type in an inner class of another role of the superteam
// 1.3.6-otjld-redefined-anchored-type-2
public void test136_redefinedAnchoredType2() {
-
+
runConformTest(
new String[] {
"T136rat2Main.java",
@@ -1111,7 +1111,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// a subteam redefines an implicitly inherited role class that is used via an anchored type in a local class of another role of the superteam
// 1.3.6-otjld-redefined-anchored-type-3
public void test136_redefinedAnchoredType3() {
-
+
runConformTest(
new String[] {
"T136rat3Main.java",
@@ -1167,7 +1167,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// a role class accesses a feature of its explicit super role via super
// 1.3.7-otjld-access-to-explicit-superrole-1
public void test137_accessToExplicitSuperrole1() {
-
+
runConformTest(
new String[] {
"T137ates1Main.java",
@@ -1208,7 +1208,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// a role class accesses a feature of its explicit super role via super in an inner class
// 1.3.7-otjld-access-to-explicit-superrole-2
public void test137_accessToExplicitSuperrole2() {
-
+
runConformTest(
new String[] {
"T137ates2Main.java",
@@ -1266,7 +1266,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// a role class accesses a feature defined in a super role of its explicit super role via super in a local class
// 1.3.7-otjld-access-to-explicit-superrole-3
public void test137_accessToExplicitSuperrole3() {
-
+
runConformTest(
new String[] {
"T137ates3Main.java",
@@ -1324,7 +1324,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// a role class accesses a method of its implicit super role via tsuper
// 1.3.8-otjld-access-to-superrole-1
public void test138_accessToSuperrole1() {
-
+
runConformTest(
new String[] {
"T138ats1Main.java",
@@ -1367,7 +1367,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// a role class accesses a method defined in a super role of its implicit super role via tsuper from an anonymous class
// 1.3.8-otjld-access-to-superrole-2
public void test138_accessToSuperrole2() {
-
+
runConformTest(
new String[] {
"T138ats2Main.java",
@@ -1485,7 +1485,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// a role class accesses a field of its implicit super role via tsuper
// 1.3.8-otjld-access-to-superrole-4
public void test138_accessToSuperrole4() {
-
+
runConformTest(
new String[] {
"T138ats4Main.java",
@@ -1634,11 +1634,11 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team138ats7.java (at line 13)\n" +
- " Team138ats7.tsuper.foo();\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Invalid qualified \'tsuper\': type org.objectteams.Team contains no role corresponding to Team138ats7.Mid2.R (OTJLD 1.3.1(f)).\n" +
+ "----------\n" +
+ "1. ERROR in Team138ats7.java (at line 13)\n" +
+ " Team138ats7.tsuper.foo();\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Invalid qualified \'tsuper\': type org.objectteams.Team contains no role corresponding to Team138ats7.Mid2.R (OTJLD 1.3.1(f)).\n" +
"----------\n");
}
@@ -1824,7 +1824,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
},
"1.3.1(f)");
}
-
+
// a tsuper call is unresolved (requires specific error reporting, setting tsuperMethod to a ProblemMethodBinding)
public void test139_illegalTsuperAccess6() {
runNegativeTestMatching(
@@ -1848,14 +1848,14 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team139ita6_2.java (at line 6)\n" +
- " return tsuper.getValue(arg);\n" +
- " ^^^^^^^^\n" +
- "The method getValue(String) is undefined for the type Team139ita6_1.Role139ita6\n" +
+ "----------\n" +
+ "1. ERROR in Team139ita6_2.java (at line 6)\n" +
+ " return tsuper.getValue(arg);\n" +
+ " ^^^^^^^^\n" +
+ "The method getValue(String) is undefined for the type Team139ita6_1.Role139ita6\n" +
"----------\n");
}
-
+
// Bug 343079 - [compiler] internal compiler error when trying to invoke an abstract method as tsuper
public void test139_illegalTsuperAccess7() {
runNegativeTest(
@@ -1877,11 +1877,11 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in Team139ita7_2.java (at line 6)\n" +
- " tsuper.rm();\n" +
- " ^^^^^^^^^^^\n" +
- "Cannot directly invoke the abstract method rm() for the type Team139ita7_1.R\n" +
+ "----------\n" +
+ "1. ERROR in Team139ita7_2.java (at line 6)\n" +
+ " tsuper.rm();\n" +
+ " ^^^^^^^^^^^\n" +
+ "Cannot directly invoke the abstract method rm() for the type Team139ita7_1.R\n" +
"----------\n");
}
@@ -2215,10 +2215,10 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
"2.3.1(b)");
}
- //
+ //
// 1.3.17-otjld-multilevel-role-overriding-1
public void test1317_multilevelRoleOverriding1() {
-
+
runConformTest(
new String[] {
"Team1317mro1_3.java",
@@ -2259,7 +2259,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// a object of static non-role type is checked instanceof wrt a role type, witness for NPE reported by woll
// 1.3.18-otjld-instanceof-non-role-to-role-1
public void test1318_instanceofNonRoleToRole1() {
-
+
runConformTest(
new String[] {
"Team1318inrtr1_2.java",
@@ -2325,7 +2325,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// a role declares a constant which is imported
// 1.3.19-otjld-role-import-2
public void test1319_roleImport2() {
-
+
runConformTest(
new String[] {
"T1319ri2Main.java",
@@ -2353,7 +2353,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// EXPERIMENTAL, method arg
// 1.3.20-otjld-tournament-polymorphism-1
public void test1320_tournamentPolymorphism1() {
-
+
runConformTest(
new String[] {
"Team1320tp1_3.java",
@@ -2400,7 +2400,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
// EXPERIMENTAL, assignment
// 1.3.20-otjld-tournament-polymorphism-2
public void test1320_tournamentPolymorphism2() {
-
+
runConformTest(
new String[] {
"Team1320tp2_3.java",
@@ -2447,7 +2447,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
public void test1320_tournamentPolymorphism3() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportOverrideFinalRole, CompilerOptions.IGNORE);
-
+
runConformTest(
new String[] {
"Team1320tp3_4.java",
@@ -2506,7 +2506,7 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
public void test1320_tournamentPolymorphism4() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportOverrideFinalRole, CompilerOptions.IGNORE);
-
+
runConformTest(
new String[] {
"Team1320tp4_4.java",
@@ -2582,11 +2582,11 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team1321tm1.java (at line 9)\n" +
- " r.migrateToTeam(other);\n" +
- " ^^^^^\n" +
- "The special method R.migrateToTeam(Team1321tm1) is not applicable for the arguments (org.objectteams.Team).\n" +
+ "----------\n" +
+ "1. ERROR in Team1321tm1.java (at line 9)\n" +
+ " r.migrateToTeam(other);\n" +
+ " ^^^^^\n" +
+ "The special method R.migrateToTeam(Team1321tm1) is not applicable for the arguments (org.objectteams.Team).\n" +
"----------\n");
}
@@ -2611,23 +2611,23 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team1321tm2.java (at line 4)\n" +
- " public class R implements ITeamMigratable {\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Team migration not possible because enclosing team class Team1321tm2 is not final (OT/J experimental feature). \n" +
- "----------\n" +
- "2. ERROR in Team1321tm2.java (at line 8)\n" +
- " r.migrateToTeam(other);\n" +
- " ^^^^^^^^^^^^^\n" +
- "The method migrateToTeam(Team1321tm2) is undefined for the type R<@tthis[Team1321tm2]>\n" +
+ "----------\n" +
+ "1. ERROR in Team1321tm2.java (at line 4)\n" +
+ " public class R implements ITeamMigratable {\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Team migration not possible because enclosing team class Team1321tm2 is not final (OT/J experimental feature). \n" +
+ "----------\n" +
+ "2. ERROR in Team1321tm2.java (at line 8)\n" +
+ " r.migrateToTeam(other);\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The method migrateToTeam(Team1321tm2) is undefined for the type R<@tthis[Team1321tm2]>\n" +
"----------\n");
}
// a role migrates to a different team, null team
// 1.3.21-otjld-team-migration-3
public void test1321_teamMigration3() {
-
+
runConformTest(
new String[] {
"Team1321tm3.java",
@@ -2691,16 +2691,16 @@ public class AcquisitionAndInheritanceOfRoleClasses extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in T1321tm5.java (at line 2)\n" +
- " public class T1321tm5 implements org.objectteams.ITeamMigratable {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type T1321tm5 does not support team migration, only applicable for roles (OT/J experimental feature).\n" +
- "----------\n" +
- "2. ERROR in T1321tm5.java (at line 4)\n" +
- " this.migrateToTeam(aTeam);\n" +
- " ^^^^^^^^^^^^^\n" +
- "The method migrateToTeam(Team) is undefined for the type T1321tm5\n" +
+ "----------\n" +
+ "1. ERROR in T1321tm5.java (at line 2)\n" +
+ " public class T1321tm5 implements org.objectteams.ITeamMigratable {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type T1321tm5 does not support team migration, only applicable for roles (OT/J experimental feature).\n" +
+ "----------\n" +
+ "2. ERROR in T1321tm5.java (at line 4)\n" +
+ " this.migrateToTeam(aTeam);\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The method migrateToTeam(Team) is undefined for the type T1321tm5\n" +
"----------\n");
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/Confinement.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/Confinement.java
index 4dcbcad5a..8fbc708a0 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/Confinement.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/Confinement.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010 Stephan Herrmann
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -23,11 +23,11 @@ import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
import junit.framework.Test;
public class Confinement extends AbstractOTJLDTest {
-
+
public Confinement(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -35,7 +35,7 @@ public class Confinement extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -72,7 +72,7 @@ public class Confinement extends AbstractOTJLDTest {
// invoking a method from user class on an IConfined object
// 1.7.1-otjld-invalid-method-on-iconfined-2
public void test171_invalidMethodOnIconfined2() {
-
+
runConformTest(
new String[] {
"T171imoi2Main.java",
@@ -122,11 +122,11 @@ public class Confinement extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team171imoi3.java (at line 10)\n" +
- " Object o = i.clone();\n" +
- " ^^^^^\n" +
- "The method clone() is undefined for the type IConfined<@tthis[Team171imoi3]>\n" +
+ "----------\n" +
+ "1. ERROR in Team171imoi3.java (at line 10)\n" +
+ " Object o = i.clone();\n" +
+ " ^^^^^\n" +
+ "The method clone() is undefined for the type IConfined<@tthis[Team171imoi3]>\n" +
"----------\n");
}
@@ -264,7 +264,7 @@ public class Confinement extends AbstractOTJLDTest {
// invoking a method from user class on an IConfined role
// 1.7.1-otjld-invalid-method-on-iconfined-4
public void test171_invalidMethodOnIconfined4() {
-
+
runConformTest(
new String[] {
"T171imoi4Main.java",
@@ -303,7 +303,7 @@ public class Confinement extends AbstractOTJLDTest {
// invoking a method from user class on an IConfined role
// 1.7.1-otjld-invalid-method-on-iconfined-5
public void test171_invalidMethodOnIconfined5() {
-
+
runConformTest(
new String[] {
"T171imoi5Main.java",
@@ -339,7 +339,7 @@ public class Confinement extends AbstractOTJLDTest {
// invoking a method that is listed in Confined - according to 6.2(a) nothing is listed there
// 1.7.1-otjld_invalid_invalid-method-on-iconfined-6
public void _invalid_test171_invalidMethodOnIconfined6() {
-
+
runConformTest(
new String[] {
"T171imoi6Main.java",
@@ -507,11 +507,11 @@ public class Confinement extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team172iwocr5.java (at line 8)\n" +
- " return (Object)ic; }\n" +
- " ^^^^^^^^^^\n" +
- "Cannot cast from IMyConfined<@tthis[Team172iwocr5]> to Object\n" +
+ "----------\n" +
+ "1. ERROR in Team172iwocr5.java (at line 8)\n" +
+ " return (Object)ic; }\n" +
+ " ^^^^^^^^^^\n" +
+ "Cannot cast from IMyConfined<@tthis[Team172iwocr5]> to Object\n" +
"----------\n");
}
@@ -607,7 +607,7 @@ public class Confinement extends AbstractOTJLDTest {
// an object of a confined type is seen by the type IConfined
// 1.7.4-otjld-viewing-confined-role-by-interface-1
public void test174_viewingConfinedRoleByInterface1() {
-
+
runConformTest(
new String[] {
"T174vcrbi1Main.java",
@@ -677,7 +677,7 @@ public class Confinement extends AbstractOTJLDTest {
// an object of a confined type is seen by the type org.obectteams.IConfined -- passed to wrong team
// 1.7.4-otjld-viewing-confined-role-by-interface-3
public void test174_viewingConfinedRoleByInterface3() {
-
+
runConformTest(
new String[] {
"T174vcrbi3Main.java",
@@ -810,7 +810,7 @@ public class Confinement extends AbstractOTJLDTest {
// see also TPX-465
// 1.7.7-otjld-otjld-example-1
public void test177_example1() {
-
+
runConformTest(
new String[] {
"T177oe1Main.java",
@@ -863,7 +863,7 @@ public class Confinement extends AbstractOTJLDTest {
// see also TPX-465 - but using generics
// 1.7.7-otjld-otjld-example-2
public void test177_example2() {
-
+
runConformTest(
new String[] {
"T177oe2Main.java",
@@ -915,7 +915,7 @@ public class Confinement extends AbstractOTJLDTest {
// see also TPX-465 -- casting null
// 1.7.7-otjld-otjld-example-3
public void test177_example3() {
-
+
runConformTest(
new String[] {
"T177oe3Main.java",
@@ -966,7 +966,7 @@ public class Confinement extends AbstractOTJLDTest {
// relevant cast to IConfined
// 1.7.7-otjld-otjld-example-4
public void test177_example4() {
-
+
runConformTest(
new String[] {
"T177oe4Main.java",
@@ -1065,18 +1065,18 @@ public class Confinement extends AbstractOTJLDTest {
"\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in T177oe5Main.java (at line 7)\n" +
- " System.out.println(emp); //<-- forbidden!\n" +
- " ^^^^^^^\n" +
- "The method println(boolean) in the type PrintStream is not applicable for the arguments (IConfined<@comp>)\n" +
+ "----------\n" +
+ "1. ERROR in T177oe5Main.java (at line 7)\n" +
+ " System.out.println(emp); //<-- forbidden!\n" +
+ " ^^^^^^^\n" +
+ "The method println(boolean) in the type PrintStream is not applicable for the arguments (IConfined<@comp>)\n" +
"----------\n");
}
// see TPX-466
// 1.7.8-otjld-confined-implicit-inheritance-1
public void test178_confinedImplicitInheritance1() {
-
+
runConformTest(
new String[] {
"Team178cii1_2.java",
@@ -1108,7 +1108,7 @@ public class Confinement extends AbstractOTJLDTest {
// see TPX-467
// 1.7.8-otjld-confined-implicit-inheritance-2
public void test178_confinedImplicitInheritance2() {
-
+
runConformTest(
new String[] {
"Team178cii2_2.java",
@@ -1146,7 +1146,7 @@ public class Confinement extends AbstractOTJLDTest {
// variation: explicit tsuper
// 1.7.8-otjld-confined-implicit-inheritance-3
public void test178_confinedImplicitInheritance3() {
-
+
runConformTest(
new String[] {
"Team178cii3_2.java",
@@ -1229,7 +1229,7 @@ public class Confinement extends AbstractOTJLDTest {
// a bound role is confined
// 1.7.10-otjld-confined-bound-role-1
public void test1710_confinedBoundRole1() {
-
+
runConformTest(
new String[] {
"T1710cbr1Main.java",
@@ -1284,7 +1284,7 @@ public class Confinement extends AbstractOTJLDTest {
// a bound role is confined, base constructor used
public void test1710_confinedBoundRole2() {
-
+
runConformTest(
new String[] {
"T1710cbr2Main.java",
@@ -1347,7 +1347,7 @@ public class Confinement extends AbstractOTJLDTest {
// a bound role is confined, callin defined
// see https://bugs.eclipse.org/370271 [compiler] NPE in PredicateGenerator with no predicate present
public void test1710_confinedBoundRole3() {
-
+
runConformTest(
new String[] {
"T1710cbr3Main.java",
@@ -1432,7 +1432,7 @@ public class Confinement extends AbstractOTJLDTest {
// a role explicitly extends confined, using the super type
// 1.7.12-otjld-explicit-inheritance-of-confined-1
public void test1712_explicitInheritanceOfConfined1() {
-
+
runConformTest(
new String[] {
"Team1712eioc1.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/Covariance.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/Covariance.java
index 7068f09e9..86f39aa65 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/Covariance.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/Covariance.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -24,11 +24,11 @@ import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
import junit.framework.Test;
public class Covariance extends AbstractOTJLDTest {
-
+
public Covariance(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -36,7 +36,7 @@ public class Covariance extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -48,7 +48,7 @@ public class Covariance extends AbstractOTJLDTest {
// a method uses a redefined role as a parameter
// 6.3.1-otjld-redefined-role-as-paramerer-1
public void test631_redefinedRoleAsParamerer1() {
-
+
runConformTest(
new String[] {
"T631rrap1Main.java",
@@ -98,7 +98,7 @@ public class Covariance extends AbstractOTJLDTest {
// a method uses a redefined role as a parameter
// 6.3.1-otjld-redefined-role-as-paramerer-2
public void test631_redefinedRoleAsParamerer2() {
-
+
runConformTest(
new String[] {
"T631rrap2Main.java",
@@ -147,7 +147,7 @@ public class Covariance extends AbstractOTJLDTest {
// a method uses a redefined role as a parameter
// 6.3.1-otjld-redefined-role-as-paramerer-3
public void test631_redefinedRoleAsParamerer3() {
-
+
runConformTest(
new String[] {
"T631rrap3Main.java",
@@ -196,7 +196,7 @@ public class Covariance extends AbstractOTJLDTest {
// a method uses a redefined role as a parameter
// 6.3.1-otjld-redefined-role-as-paramerer-4
public void test631_redefinedRoleAsParamerer4() {
-
+
runConformTest(
new String[] {
"T631rrap4Main.java",
@@ -249,7 +249,7 @@ public class Covariance extends AbstractOTJLDTest {
// a method uses a redefined role as a parameter
// 6.3.1-otjld-redefined-role-as-paramerer-5
public void test631_redefinedRoleAsParamerer5() {
-
+
runConformTest(
new String[] {
"T631rrap5Main.java",
@@ -298,7 +298,7 @@ public class Covariance extends AbstractOTJLDTest {
// a method uses a redefined role as a parameter
// 6.3.1-otjld-redefined-role-as-paramerer-6
public void test631_redefinedRoleAsParamerer6() {
-
+
runConformTest(
new String[] {
"T631rrap6Main.java",
@@ -343,7 +343,7 @@ public class Covariance extends AbstractOTJLDTest {
// a method uses a redefined role as a return type
// 6.3.2-otjld-redefined-role-as-return-type-1
public void test632_redefinedRoleAsReturnType1() {
-
+
runConformTest(
new String[] {
"Team632rrart1_2.java",
@@ -387,7 +387,7 @@ public class Covariance extends AbstractOTJLDTest {
// a method uses a sub role as a return type
// 6.3.2-otjld-redefined-role-as-return-type-2
public void test632_redefinedRoleAsReturnType2() {
-
+
runConformTest(
new String[] {
"Team632rrart2_2.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/ExternalizedRoles.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/ExternalizedRoles.java
index a128d1b5e..f93c901f4 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/ExternalizedRoles.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/ExternalizedRoles.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010, 2013 Stephan Herrmann
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -22,11 +22,11 @@ import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
import junit.framework.Test;
public class ExternalizedRoles extends AbstractOTJLDTest {
-
+
public ExternalizedRoles(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -34,7 +34,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -45,7 +45,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a type of a field is anchored to a simple field reference
// 1.6.1-otjld-simple-anchored-type-1
public void test161_simpleAnchoredType1() {
-
+
runConformTest(
new String[] {
"T161sat1Main.java",
@@ -79,7 +79,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a type of a field is anchored to a simple field reference - otherwise unused private field
// 1.6.1-otjld-simple-anchored-type-1a
public void test161_simpleAnchoredType1a() {
-
+
runConformTest(
new String[] {
"T161sat1aMain.java",
@@ -118,7 +118,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a type of a field is anchored to a simple field reference - overloading plus varargs plus ambiguous lowering confuses AnchorMapping
// 1.6.1-otjld-simple-anchored-type-1f
public void test161_simpleAnchoredType1f() {
-
+
runConformTest(
new String[] {
"T161sat1fMain.java",
@@ -166,7 +166,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a type of a local variable is anchored to a simple field reference
// 1.6.1-otjld-simple-anchored-type-2
public void test161_simpleAnchoredType2() {
-
+
runConformTest(
new String[] {
"T161sat2Main.java",
@@ -200,7 +200,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a type of a parameter is anchored to a simple field reference
// 1.6.1-otjld-simple-anchored-type-3
public void test161_simpleAnchoredType3() {
-
+
runConformTest(
new String[] {
"T161sat3Main.java",
@@ -233,7 +233,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// qualified field reference has type of externalized role
// 1.6.1-otjld-simple-anchored-type-4
public void test161_simpleAnchoredType4() {
-
+
runConformTest(
new String[] {
"Team161sat4_2.java",
@@ -274,7 +274,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a type of an array field is anchored to a simple field reference
// 1.6.2-otjld-anchored-array-type-1
public void test162_anchoredArrayType1() {
-
+
runConformTest(
new String[] {
"T162aat1Main.java",
@@ -308,7 +308,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a type of a local array variable is anchored to a simple field reference
// 1.6.2-otjld-anchored-array-type-2
public void test162_anchoredArrayType2() {
-
+
runConformTest(
new String[] {
"T162aat2Main.java",
@@ -342,7 +342,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a type of a array parameter is anchored to a simple field reference
// 1.6.2-otjld-anchored-array-type-3
public void test162_anchoredArrayType3() {
-
+
runConformTest(
new String[] {
"T162aat3Main.java",
@@ -375,7 +375,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a type of an array field is anchored to a simple field reference, reading array element
// 1.6.2-otjld-anchored-array-type-4
public void test162_anchoredArrayType4() {
-
+
runConformTest(
new String[] {
"T162aat4Main.java",
@@ -443,7 +443,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a type of an array field is anchored to a simple field reference, assigning array element
// 1.6.2-otjld-anchored-array-type-5
public void test162_anchoredArrayType5() {
-
+
runConformTest(
new String[] {
"T162aat5Main.java",
@@ -513,7 +513,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a role type is anchored to a static variable given by its qualified name
// 1.6.3-otjld-type-anchored-to-qualified-static-1
public void test163_typeAnchoredToQualifiedStatic1() {
-
+
runConformTest(
new String[] {
"T163tatqs1Main.java",
@@ -547,7 +547,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a role array type is anchored to a static variable given by its qualified name
// 1.6.3-otjld-type-anchored-to-qualified-static-2
public void test163_typeAnchoredToQualifiedStatic2() {
-
+
runConformTest(
new String[] {
"T163tatqs2Main.java",
@@ -581,7 +581,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a type anchor is assigned in its initialization
// 1.6.4-otjld-type-anchor-initialization-1
public void test164_typeAnchorInitialization1() {
-
+
runConformTest(
new String[] {
"T164tai1Main.java",
@@ -642,7 +642,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a type anchor is assigned
// 1.6.5-otjld-type-anchor-assignment-1
public void test165_typeAnchorAssignment1() {
-
+
runConformTest(
new String[] {
"T165taa1Main.java",
@@ -704,7 +704,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a type anchor is a 3 element path
// 1.6.6-otjld-type-anchor-is-path-1
public void test166_typeAnchorIsPath1() {
-
+
runConformTest(
new String[] {
"T166taia1Main.java",
@@ -787,21 +787,21 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in T166taia1fMain.java (at line 5)\n" +
- " R<@t.a1.a2> r = t.a1.a2.getR();\n" +
- " ^^^^^^^^\n" +
- "Anchor T166taia1f_1.a1 for the role type R is not final (OTJLD 1.2.2(c)).\n" +
- "----------\n" +
- "2. ERROR in T166taia1fMain.java (at line 5)\n" +
- " R<@t.a1.a2> r = t.a1.a2.getR();\n" +
- " ^^^^\n" +
- "Anchor t.a1 for the role type R<@tthis[Team166taia1f]> is not final (OTJLD 1.2.2(c)).\n" +
- "----------\n" +
- "3. ERROR in T166taia1fMain.java (at line 5)\n" +
- " R<@t.a1.a2> r = t.a1.a2.getR();\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from R<@tthis[Team166taia1f]> to R<@t.a1.a2> because type anchors could not be proven to be the same instance (OTJLD 1.2.2(e)).\n" +
+ "----------\n" +
+ "1. ERROR in T166taia1fMain.java (at line 5)\n" +
+ " R<@t.a1.a2> r = t.a1.a2.getR();\n" +
+ " ^^^^^^^^\n" +
+ "Anchor T166taia1f_1.a1 for the role type R is not final (OTJLD 1.2.2(c)).\n" +
+ "----------\n" +
+ "2. ERROR in T166taia1fMain.java (at line 5)\n" +
+ " R<@t.a1.a2> r = t.a1.a2.getR();\n" +
+ " ^^^^\n" +
+ "Anchor t.a1 for the role type R<@tthis[Team166taia1f]> is not final (OTJLD 1.2.2(c)).\n" +
+ "----------\n" +
+ "3. ERROR in T166taia1fMain.java (at line 5)\n" +
+ " R<@t.a1.a2> r = t.a1.a2.getR();\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from R<@tthis[Team166taia1f]> to R<@t.a1.a2> because type anchors could not be proven to be the same instance (OTJLD 1.2.2(e)).\n" +
"----------\n");
}
@@ -853,7 +853,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a type anchor is a 3 element path - trying to implicitly use enclosing instance
// 1.6.6-otjld-type-anchor-is-path-3
public void test166_typeAnchorIsPath3() {
-
+
runConformTest(
new String[] {
"T166taia3Main.java",
@@ -899,7 +899,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a type anchor is a 3 element path - role is accessed by a field
// 1.6.6-otjld-type-anchor-is-path-4
public void test166_typeAnchorIsPath4() {
-
+
runConformTest(
new String[] {
"T166taia4Main.java",
@@ -978,16 +978,16 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in T166taia4fMain.java (at line 5)\n" +
- " R<@t.a1.a2> r = t.a1.a2.myR;\n" +
- " ^^^^^^^^\n" +
- "Anchor T166taia4f_1.a1 for the role type R is not final (OTJLD 1.2.2(c)).\n" +
- "----------\n" +
- "2. ERROR in T166taia4fMain.java (at line 5)\n" +
- " R<@t.a1.a2> r = t.a1.a2.myR;\n" +
- " ^^^^\n" +
- "Anchor t.a1 for the role type R<@tthis[Team166taia4f]> is not final (OTJLD 1.2.2(c)).\n" +
+ "----------\n" +
+ "1. ERROR in T166taia4fMain.java (at line 5)\n" +
+ " R<@t.a1.a2> r = t.a1.a2.myR;\n" +
+ " ^^^^^^^^\n" +
+ "Anchor T166taia4f_1.a1 for the role type R is not final (OTJLD 1.2.2(c)).\n" +
+ "----------\n" +
+ "2. ERROR in T166taia4fMain.java (at line 5)\n" +
+ " R<@t.a1.a2> r = t.a1.a2.myR;\n" +
+ " ^^^^\n" +
+ "Anchor t.a1 for the role type R<@tthis[Team166taia4f]> is not final (OTJLD 1.2.2(c)).\n" +
"----------\n");
}
@@ -1174,18 +1174,18 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
new String[] {
"p166taip9/Main.java",
"package p166taip9;\n" +
- "public team class Main {\n" +
- " private final Display display;\n" +
- "\n" +
- " public Main(Display display) {\n" +
- " this.display = display;\n" +
- " }\n" +
- " protected class C playedBy Connect<@display> {\n" +
- " final Shapes sw = display.a;\n" +
- " protected void test() {\n" +
- " sw.new Connection(getNode().getShape());\n" +
- " }\n" +
- " Node<@display> getNode() -> Node<@display> getNode();\n" +
+ "public team class Main {\n" +
+ " private final Display display;\n" +
+ "\n" +
+ " public Main(Display display) {\n" +
+ " this.display = display;\n" +
+ " }\n" +
+ " protected class C playedBy Connect<@display> {\n" +
+ " final Shapes sw = display.a;\n" +
+ " protected void test() {\n" +
+ " sw.new Connection(getNode().getShape());\n" +
+ " }\n" +
+ " Node<@display> getNode() -> Node<@display> getNode();\n" +
" }\n" +
" void test2(Connect<@display> as C c) {\n" +
" c.test();\n" +
@@ -1196,36 +1196,36 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
" public static void main(String[] args) {\n" +
" final Display d = new Display();\n" +
" new Main(d).test();\n" +
- " }\n" +
+ " }\n" +
"}",
"p166taip9/Shapes.java",
"package p166taip9;\n" +
- "public team class Shapes {\n" +
+ "public team class Shapes {\n" +
" public class Shape {\n" +
" protected void print() {\n" +
" System.out.print(\"OK\");\n" +
" }\n" +
- " }\n" +
- " public class Connection {\n" +
+ " }\n" +
+ " public class Connection {\n" +
" public Connection(Shape s) {" +
" s.print();\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}\n",
"p166taip9/Display.java",
"package p166taip9;\n" +
- "public team class Display {\n" +
- " public final Shapes a = new Shapes();\n" +
- " public class Connect {\n" +
- " public Node getNode() {\n" +
- " return new Node();\n" +
- " }\n" +
- " }\n" +
- " public class Node {\n" +
- " public Shape<@a> getShape() {\n" +
- " return a.new Shape();\n" +
- " }\n" +
- " }\n" +
+ "public team class Display {\n" +
+ " public final Shapes a = new Shapes();\n" +
+ " public class Connect {\n" +
+ " public Node getNode() {\n" +
+ " return new Node();\n" +
+ " }\n" +
+ " }\n" +
+ " public class Node {\n" +
+ " public Shape<@a> getShape() {\n" +
+ " return a.new Shape();\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
"OK");
@@ -1234,7 +1234,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a role is externalized relative to the base reference
// 1.6.7-otjld-role-anchored-to-base-1
public void test167_roleAnchoredToBase1() {
-
+
runConformTest(
new String[] {
"Team167ratb1_2.java",
@@ -1280,7 +1280,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a role is externalized relative to the base reference - passed as parameter
// 1.6.7-otjld-role-anchored-to-base-2
public void test167_roleAnchoredToBase2() {
-
+
runConformTest(
new String[] {
"Team167ratb2_2.java",
@@ -1329,7 +1329,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a role is externalized relative to the base reference and used in the playedBy clause of a nested role!
// 1.6.7-otjld-role-anchored-to-base-3
public void test167_roleAnchoredToBase3() {
-
+
runConformTest(
new String[] {
"Team167ratb3_2.java",
@@ -1378,7 +1378,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a role array is externalized relative to the base reference
// 1.6.7-otjld-role-anchored-to-base-4
public void test167_roleAnchoredToBase4() {
-
+
runConformTest(
new String[] {
"Team167ratb4_2.java",
@@ -1425,7 +1425,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a role is externalized relative to the base reference, used in a callout signature
// 1.6.7-otjld-role-anchored-to-base-5
public void test167_roleAnchoredToBase5() {
-
+
runConformTest(
new String[] {
"Team167ratb5_2.java",
@@ -1610,7 +1610,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a role is externalized relative to the base reference - used in callin signature
// 1.6.7-otjld-role-anchored-to-base-6
public void test167_roleAnchoredToBase6() {
-
+
runConformTest(
new String[] {
"Team167ratb6_2.java",
@@ -1670,7 +1670,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// an anchored type is read from a class file , navigate along MessageSend-receiver
// 1.6.8-otjld-anchored-type-from-classfile-1
public void test168_anchoredTypeFromClassfile1() {
-
+
runConformTest(
new String[] {
"T168atfc1_2.java",
@@ -1708,7 +1708,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// an anchored type is read from a class file , navigate along outer of MessageSend-receiver
// 1.6.8-otjld-anchored-type-from-classfile-2
public void test168_anchoredTypeFromClassfile2() {
-
+
runConformTest(
new String[] {
"T168atfc2_2.java",
@@ -1749,7 +1749,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// an anchored type is read from a class file , navigate along field
// 1.6.8-otjld-anchored-type-from-classfile-3
public void test168_anchoredTypeFromClassfile3() {
-
+
runConformTest(
new String[] {
"T168atfc3_2.java",
@@ -1787,7 +1787,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// an anchored type is read from a class file, navigate along field - compile two files in one go
// 1.6.8-otjld-anchored-type-from-classfile-3a
public void test168_anchoredTypeFromClassfile3a() {
-
+
runConformTest(
new String[] {
"T168atfc3a_2.java",
@@ -1825,7 +1825,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a callout binding has an arg that is anchored to another argument
// 1.6.9-otjld-callout-with-anchored-type-1
public void test169_calloutWithAnchoredType1() {
-
+
runConformTest(
new String[] {
"Team169cwat1.java",
@@ -1869,7 +1869,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a callout binding has an arg that is anchored to another argument
// 1.6.9-otjld-callout-with-anchored-type-2
public void test169_calloutWithAnchoredType2() {
-
+
runConformTest(
new String[] {
"Team169cwat2.java",
@@ -2004,18 +2004,18 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team1610mria4.java (at line 5)\n" +
- " public R<@t.f> test() {\n" +
- " ^\n" +
- "Parameter \'f\' cannot be resolved (OTJLD 9.2.1).\n" +
+ "----------\n" +
+ "1. ERROR in Team1610mria4.java (at line 5)\n" +
+ " public R<@t.f> test() {\n" +
+ " ^\n" +
+ "Parameter \'f\' cannot be resolved (OTJLD 9.2.1).\n" +
"----------\n");
}
// a parameter type is defined relative to tthis, in a message send this is updated to the team of the receiver - a role
// 1.6.11-otjld-parameter-type-anchored-updated-to-receiver-1
public void test1611_parameterTypeAnchoredUpdatedToReceiver1() {
-
+
runConformTest(
new String[] {
"Team1611ptautr1.java",
@@ -2048,7 +2048,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a parameter type is defined relative to tthis, in a message send this is updated to the receiver - a array-reference of role
// 1.6.11-otjld-parameter-type-anchored-updated-to-receiver-2
public void test1611_parameterTypeAnchoredUpdatedToReceiver2() {
-
+
runConformTest(
new String[] {
"Team1611ptautr2.java",
@@ -2081,7 +2081,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// an externalized role via static anchor is used as receiver and argument
// 1.6.11-otjld-parameter-type-anchored-updated-to-receiver-3
public void test1611_parameterTypeAnchoredUpdatedToReceiver3() {
-
+
runConformTest(
new String[] {
"T1611ptautr3Main.java",
@@ -2117,7 +2117,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// on an anchor path, an implitly reachable shortcut is taken, which is dropped from the path
// 1.6.12-otjld-path-drops-implicitly-reachable-1
public void test1612_pathDropsImplicitlyReachable1() {
-
+
runConformTest(
new String[] {
"Team1612pdir1_2.java",
@@ -2172,7 +2172,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// on an anchor path, an implitly reachable shortcut is taken, which is dropped from the path - tested in team method
// 1.6.12-otjld-path-drops-implicitly-reachable-2
public void test1612_pathDropsImplicitlyReachable2() {
-
+
runConformTest(
new String[] {
"Team1612pdir2_2.java",
@@ -2227,7 +2227,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// on an anchor path, an implitly reachable shortcut is taken, which is dropped from the path - same team
// 1.6.12-otjld-path-drops-implicitly-reachable-3
public void test1612_pathDropsImplicitlyReachable3() {
-
+
runConformTest(
new String[] {
"Team1612pdir3.java",
@@ -2274,7 +2274,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a field is accessed qualified with a interface name, WITNESS for TPX-256 (fixed between 0.8.1 and 0.8.2)
// 1.6.13-otjld-static-field-accessed-qualified
public void test1613_staticFieldAccessedQualified() {
-
+
runConformTest(
new String[] {
"T1613.java",
@@ -2369,7 +2369,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
" protected void test() {" +
" t.test(new R<@t>());\n" + // verify error was observed here
" }\n" +
- " protected void print() { System.out.print(\"OK\"); }\n" +
+ " protected void print() { System.out.print(\"OK\"); }\n" +
" }\n" +
" public void test(R r) {" +
" r.print();\n" +
@@ -2397,7 +2397,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
" protected void test() {" +
" t.test(new R<@t>());\n" + // verify error was observed here
" }\n" +
- " protected void print() { System.out.print(\"OK\"); }\n" +
+ " protected void print() { System.out.print(\"OK\"); }\n" +
" }\n" +
" public void test(R r) {" +
" r.print();\n" +
@@ -2413,7 +2413,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a role is casted to its externalized type
// 1.6.16-otjld-casting-to-externalized-1
public void test1616_castingToExternalized1() {
-
+
runConformTest(
new String[] {
"Team1616cte1.java",
@@ -2439,7 +2439,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a role is casted to its externalized type - array type
// 1.6.16-otjld-casting-to-externalized-1a
public void test1616_castingToExternalized1a() {
-
+
runConformTest(
new String[] {
"Team1616cte1a.java",
@@ -2465,7 +2465,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a role is casted to its externalized type - array type , cast error
// 1.6.16-otjld-casting-to-externalized-1f
public void test1616_castingToExternalized1f() {
-
+
runConformTest(
new String[] {
"Team1616cte1f.java",
@@ -2497,7 +2497,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a role is casted to its externalized type - array type , team instance mismatch
// 1.6.16-otjld-casting-to-externalized-1g
public void test1616_castingToExternalized1g() {
-
+
runConformTest(
new String[] {
"Team1616cte1g.java",
@@ -2528,7 +2528,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a role is casted to its externalized type, wrong team instance
// 1.6.16-otjld-casting-to-externalized-2
public void test1616_castingToExternalized2() {
-
+
runConformTest(
new String[] {
"Team1616cte2.java",
@@ -2559,7 +2559,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a role is casted to its externalized type - wrong role type
// 1.6.16-otjld-casting-to-externalized-3
public void test1616_castingToExternalized3() {
-
+
runConformTest(
new String[] {
"Team1616cte3.java",
@@ -2590,7 +2590,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a role type return is anchored to a parameter of the same method
// 1.6.17-otjld-return-anchored-to-parameter-1
public void test1617_returnAnchoredToParameter1() {
-
+
runConformTest(
new String[] {
"Team1617ratp1.java",
@@ -2626,7 +2626,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a role type return is anchored to a parameter of the same method
// 1.6.17-otjld-return-anchored-to-parameter-2
public void test1617_returnAnchoredToParameter2() {
-
+
runConformTest(
new String[] {
"Team1617ratp2.java",
@@ -2663,7 +2663,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a role type return (array) is anchored to a parameter of the same method
// 1.6.17-otjld-return-anchored-to-parameter-3
public void test1617_returnAnchoredToParameter3() {
-
+
runConformTest(
new String[] {
"Team1617ratp3.java",
@@ -2699,7 +2699,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a role type return is anchored indirectly to a parameter of the same method
// 1.6.17-otjld-return-anchored-to-parameter-4
public void test1617_returnAnchoredToParameter4() {
-
+
runConformTest(
new String[] {
"Team1617ratp4.java",
@@ -2736,7 +2736,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// an anchor needs a static qualifier to disambiguate
// 1.6.18-otjld-anchor-problems-1
public void test1618_anchorProblems1() {
-
+
runConformTest(
new String[] {
"T1618ap1.java",
@@ -2813,7 +2813,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// an anchor needs a static qualifier to disambiguate - misinterpretation leads to recursion
// 1.6.18-otjld-anchor-problems-3
public void test1618_anchorProblems3() {
-
+
runConformTest(
new String[] {
"T1618ap3.java",
@@ -2926,7 +2926,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// the argument of a constructor is anchored
// 1.6.19-otjld-anchored-constructor-arg-1
public void test1619_anchoredConstructorArg1() {
-
+
runConformTest(
new String[] {
"T1619Main.java",
@@ -2958,7 +2958,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// the example from the otjld 1.2.2
// 1.6.20-otjld-doc-example-1
public void test1620_docExample1() {
-
+
runConformTest(
new String[] {
"T1620de1.java",
@@ -3013,10 +3013,10 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
"no longer showing subscr with -1 credits");
}
- //
+ //
// 1.6.21-otjld-constructor-receives-externalized-role-1
public void test1621_constructorReceivesExternalizedRole1() {
-
+
runConformTest(
new String[] {
"T1621crer1Main.java",
@@ -3089,7 +3089,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a shorthand defined callout method is called on an externalized role
// 1.6.22-otjld-call-to-callout-of-externalized-1
public void test1622_callToCalloutOfExternalized1() {
-
+
runConformTest(
new String[] {
"T1622ctcoe1Main.java",
@@ -3129,7 +3129,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a method parameter has a type anchored to another paramter
// 1.6.23-otjld-type-anchored-to-parameter-1
public void test1623_typeAnchoredToParameter1() {
-
+
runConformTest(
new String[] {
"T1623tatp1Main.java",
@@ -3277,7 +3277,7 @@ public class ExternalizedRoles extends AbstractOTJLDTest {
// a team method returns a role type - the caller is not allowed to see the role type but uses Object
// 1.6.25-otjld-return-is-non-externalizable-role-1
public void test1625_returnIsNonExternalizableRole1() {
-
+
runConformTest(
new String[] {
"T1625riner1Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/FileStructure.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/FileStructure.java
index 152c51595..e96057ad2 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/FileStructure.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/FileStructure.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2015 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -29,7 +29,7 @@ import junit.framework.Test;
/**
* Former jacks tests from section file-structure (1.5.*)
- * @author stephan
+ * @author stephan
*/
@SuppressWarnings("unchecked")
public class FileStructure extends AbstractOTJLDTest {
@@ -37,7 +37,7 @@ public class FileStructure extends AbstractOTJLDTest {
public FileStructure(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -45,7 +45,7 @@ public class FileStructure extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -64,7 +64,7 @@ public class FileStructure extends AbstractOTJLDTest {
// an externally stored role class uses a feature of its team class
// 1.5.1-otjld-access-from-external-role
public void test151_accessFromExternalRole() {
-
+
runConformTest(
new String[] {
"T151aferMain.java",
@@ -107,7 +107,7 @@ public class FileStructure extends AbstractOTJLDTest {
// an externally stored role class uses a 'friendly' feature of a class in the same package as its team class
// 1.5.2-otjld-access-from-external-role-1
public void test152_accessFromExternalRole1() {
-
+
runConformTest(
new String[] {
"T152afer1Main.java",
@@ -459,7 +459,7 @@ public class FileStructure extends AbstractOTJLDTest {
// a role file contains an interface
// 1.5.8-otjld-interface-role-file-1
public void test158_interfaceRoleFile1() {
-
+
runConformTest(
new String[] {
"Team158irf1.java",
@@ -542,7 +542,7 @@ public class FileStructure extends AbstractOTJLDTest {
// a role file contains an interface, class is inline
// 1.5.8-otjld-interface-role-file-2
public void test158_interfaceRoleFile2() {
-
+
runConformTest(
new String[] {
"Team158irf2.java",
@@ -744,12 +744,12 @@ public class FileStructure extends AbstractOTJLDTest {
" boolean addAll(Collection c) -> boolean addAll(Collection c);\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in Team1511rfi2\\R1511rfi2.java (at line 5)\n" +
- " public class R1511rfi2 playedBy LinkedList {\n" +
- " ^^^^^^^^^^\n" +
- "Base class java.util.LinkedList appears to be a system class, which means that load time weaving could possibly fail\n" +
- "if this class is loaded from rt.jar/the bootstrap classpath.\n" +
+ "----------\n" +
+ "1. WARNING in Team1511rfi2\\R1511rfi2.java (at line 5)\n" +
+ " public class R1511rfi2 playedBy LinkedList {\n" +
+ " ^^^^^^^^^^\n" +
+ "Base class java.util.LinkedList appears to be a system class, which means that load time weaving could possibly fail\n" +
+ "if this class is loaded from rt.jar/the bootstrap classpath.\n" +
"----------\n",
false);
}
@@ -835,16 +835,16 @@ public class FileStructure extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team1511rfi5\\R1511rfi5.java (at line 3)\n" +
- " import base pbase.T1511rfi5;\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "\"base\" import is not allowed in a role file (OTJLD 2.1.2(d)).\n" +
- "----------\n" +
- "2. ERROR in Team1511rfi5\\R1511rfi5.java (at line 4)\n" +
- " protected class R1511rfi5 playedBy T1511rfi5 {}\n" +
- " ^^^^^^^^^\n" +
- "T1511rfi5 cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in Team1511rfi5\\R1511rfi5.java (at line 3)\n" +
+ " import base pbase.T1511rfi5;\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "\"base\" import is not allowed in a role file (OTJLD 2.1.2(d)).\n" +
+ "----------\n" +
+ "2. ERROR in Team1511rfi5\\R1511rfi5.java (at line 4)\n" +
+ " protected class R1511rfi5 playedBy T1511rfi5 {}\n" +
+ " ^^^^^^^^^\n" +
+ "T1511rfi5 cannot be resolved to a type\n" +
"----------\n");
}
@@ -896,23 +896,23 @@ public class FileStructure extends AbstractOTJLDTest {
"protected class R1511rfi7 {}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team1511rfi7.java (at line 4)\n" +
- " LinkedList<R1511rfi7> roles = new LinkedList<R1511rfi7>();\n" +
- " ^^^^^^^^^^\n" +
- "LinkedList cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in Team1511rfi7.java (at line 4)\n" +
- " LinkedList<R1511rfi7> roles = new LinkedList<R1511rfi7>();\n" +
- " ^^^^^^^^^^\n" +
- "LinkedList cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in Team1511rfi7.java (at line 4)\n" +
+ " LinkedList<R1511rfi7> roles = new LinkedList<R1511rfi7>();\n" +
+ " ^^^^^^^^^^\n" +
+ "LinkedList cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in Team1511rfi7.java (at line 4)\n" +
+ " LinkedList<R1511rfi7> roles = new LinkedList<R1511rfi7>();\n" +
+ " ^^^^^^^^^^\n" +
+ "LinkedList cannot be resolved to a type\n" +
"----------\n");
}
// role files are compiled indirectly
// 1.5.12-otjld-role-file-compile-order-1
public void test1512_roleFileCompileOrder1() {
-
+
runConformTest(
new String[] {
"Team1512rfco1.java",
@@ -959,7 +959,7 @@ public class FileStructure extends AbstractOTJLDTest {
// role files are compiled indirectly - extending each other
// 1.5.12-otjld-role-file-compile-order-2
public void test1512_roleFileCompileOrder2() {
-
+
runConformTest(
new String[] {
"Team1512rfco2.java",
@@ -1005,7 +1005,7 @@ public class FileStructure extends AbstractOTJLDTest {
// role files (unbound) are compiled indirectly - extending each other
// 1.5.12-otjld-role-file-compile-order-3
public void test1512_roleFileCompileOrder3() {
-
+
runConformTest(
new String[] {
"Team1512rfco3.java",
@@ -1064,7 +1064,7 @@ public class FileStructure extends AbstractOTJLDTest {
// a role file imports its base class which is not visible to the team
// 1.5.14-otjld-role-file-scope-1
public void test1514_roleFileScope1() {
-
+
runConformTest(
new String[] {
"p2/Team1514rfs1.java",
@@ -1110,7 +1110,7 @@ public class FileStructure extends AbstractOTJLDTest {
// a role file defines a callin - one compilation
// 1.5.15-otjld-callin-into-rolefile-1
public void test1515_callinIntoRolefile1() {
-
+
runConformTest(
new String[] {
"Team1515cir1.java",
@@ -1148,7 +1148,7 @@ public class FileStructure extends AbstractOTJLDTest {
// a role file defines a callin - one compilation role driven
// 1.5.15-otjld-callin-into-rolefile-2
public void test1515_callinIntoRolefile2() {
-
+
runConformTest(
new String[] {
"Team1515cir2.java",
@@ -1185,7 +1185,7 @@ public class FileStructure extends AbstractOTJLDTest {
// a role file defines a callin - separate compilation
// 1.5.15-otjld-callin-into-rolefile-3
public void test1515_callinIntoRolefile3() {
-
+
runConformTest(
new String[] {
"Team1515cir3.java",
@@ -1222,7 +1222,7 @@ public class FileStructure extends AbstractOTJLDTest {
// a role file defines a callin and a base predicate - separate compilation - witness for TPX-428
// 1.5.15-otjld-callin-into-rolefile-4
public void test1515_callinIntoRolefile4() {
-
+
runConformTest(
new String[] {
"Team1515cir4.java",
@@ -1265,7 +1265,7 @@ public class FileStructure extends AbstractOTJLDTest {
// two role files define a callin and a base predicate - team driven compilation - witness for TPX-428 part 2
// 1.5.15-otjld-callin-into-rolefile-5
public void test1515_callinIntoRolefile5() {
-
+
runConformTest(
new String[] {
"Team1515cir5.java",
@@ -1321,7 +1321,7 @@ public class FileStructure extends AbstractOTJLDTest {
// a role file defines a callin - team driven compilation reusing binary role
// 1.5.15-otjld_postponed_callin-into-rolefile-6
public void _postponed_test1515_callinIntoRolefile6() {
-
+
runConformTest(
new String[] {
"Team1515cir6.java",
@@ -1364,7 +1364,7 @@ public class FileStructure extends AbstractOTJLDTest {
// a role file defines a static replace callin - team driven compilation reusing binary role
// 1.5.15-otjld_postponed_callin-into-rolefile-7
public void _postponed_test1515_callinIntoRolefile7() {
-
+
runConformTest(
new String[] {
"Team1515cir7.java",
@@ -1408,7 +1408,7 @@ public class FileStructure extends AbstractOTJLDTest {
// a nested team is implicitly inherited (phantom) and contains a role file
// 1.5.16-otjld_postponed_role-file-of-phantom-nested-team-1
public void _postponed_test1516_roleFileOfPhantomNestedTeam1() {
-
+
runConformTest(
new String[] {
"Team1516rfopnt1_2.java",
@@ -1491,7 +1491,7 @@ public class FileStructure extends AbstractOTJLDTest {
// a nested role is in a role file, direct enclosing is not
// 1.5.17-otjld-nested-role-file-2
public void test1517_nestedRoleFile2() {
-
+
runConformTest(
new String[] {
"Team1517nrf2.java",
@@ -1622,25 +1622,25 @@ public class FileStructure extends AbstractOTJLDTest {
"protected class R1517nrf5 {}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in p\\Team1517nrf5\\Mid1517nrf5.java (at line 3)\n" +
- " public team class Mid1517nrf5 {}\n" +
- " \n" +
- " ^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Team1517nrf5.__OT__Mid1517nrf5.R1517nrf5 to Team1517nrf5.__OT__Mid1517nrf5.R1517nrf5\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in "+convertedOutputPath+"p\\Team1517nrf5\\Mid1517nrf5\\R1517nrf5.java (at line 3)\n" +
- " protected class R1517nrf5 {}\n" +
- " ^^^^^^^^^\n" +
- "Duplicate nested type R1517nrf5\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in p\\Team1517nrf5\\Mid1517nrf5.java (at line 3)\n" +
+ " public team class Mid1517nrf5 {}\n" +
+ " \n" +
+ " ^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Team1517nrf5.__OT__Mid1517nrf5.R1517nrf5 to Team1517nrf5.__OT__Mid1517nrf5.R1517nrf5\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in "+convertedOutputPath+"p\\Team1517nrf5\\Mid1517nrf5\\R1517nrf5.java (at line 3)\n" +
+ " protected class R1517nrf5 {}\n" +
+ " ^^^^^^^^^\n" +
+ "Duplicate nested type R1517nrf5\n" +
+ "----------\n" +
// this is the main error message, the others are mostly caused by compilation order issues:
- "----------\n" +
- "1. ERROR in p\\Team1517nrf5\\Mid1517nrf5\\R1517nrf5\\Deep1517nrf5.java (at line 3)\n" +
- " protected class Deep1517nrf5 {}\n" +
- " ^^^^^^^^^^^^\n" +
- "Member types not allowed in regular roles. Mark class p.Team1517nrf5.Mid1517nrf5.R1517nrf5 as a team if Deep1517nrf5 should be its role (OTJLD 1.5(a,b)). \n" +
+ "----------\n" +
+ "1. ERROR in p\\Team1517nrf5\\Mid1517nrf5\\R1517nrf5\\Deep1517nrf5.java (at line 3)\n" +
+ " protected class Deep1517nrf5 {}\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Member types not allowed in regular roles. Mark class p.Team1517nrf5.Mid1517nrf5.R1517nrf5 as a team if Deep1517nrf5 should be its role (OTJLD 1.5(a,b)). \n" +
"----------\n");
}
@@ -1648,7 +1648,7 @@ public class FileStructure extends AbstractOTJLDTest {
// 1.5.17-otjld-nested-role-file-6
public void test1517_nestedRoleFile6() {
this.compileOrder = new String[][] {
- {"p/Team1517nrf6.java"},
+ {"p/Team1517nrf6.java"},
{"p/Team1517nrf6/Mid1517nrf6.java"},
{"p/Team1517nrf6/Mid1517nrf6/R1517nrf6.java"},
{"p/Team1517nrf6/Mid1517nrf6/R1517nrf6/Deep1517nrf6.java"}};
@@ -1680,7 +1680,7 @@ public class FileStructure extends AbstractOTJLDTest {
// a phantom role is a tsub of a role file
// 1.5.18-otjld-implicitly-inherit-role-file-1
public void test1518_implicitlyInheritRoleFile1() {
-
+
runConformTest(
new String[] {
"Team1518iirf1_3.java",
@@ -1759,7 +1759,7 @@ public class FileStructure extends AbstractOTJLDTest {
// 1.5.18-otjld-implicitly-inherit-role-file-2
public void test1518_implicitlyInheritRoleFile2() {
Map customOptions = getCompilerOptions();
-
+
runConformTest(
new String[] {
"Team1518iirf2_3.java",
@@ -1850,11 +1850,11 @@ public class FileStructure extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team1520rfwt1\\R1520rfwt1.java (at line 2)\n" +
- " team package Team1520rfwt1;\n" +
- " ^^^^^^^^^^^^^\n" +
- "Enclosing team Team1520rfwt1 not found for role file R1520rfwt1 (OTJLD 1.2.5(c)).\n" +
+ "----------\n" +
+ "1. ERROR in Team1520rfwt1\\R1520rfwt1.java (at line 2)\n" +
+ " team package Team1520rfwt1;\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Enclosing team Team1520rfwt1 not found for role file R1520rfwt1 (OTJLD 1.2.5(c)).\n" +
"----------\n");
}
@@ -1954,11 +1954,11 @@ public class FileStructure extends AbstractOTJLDTest {
"protected class R1522rtij2_2 {}\n" +
" \n"
},
- "----------\n" +
- "1. WARNING in Team1522rtij2.java (at line 6)\n" +
- " public team class Team1522rtij2 {\n" +
- " ^^^^^^^^^^^^^\n" +
- "Javadoc: Missing tag for role file R1522rtij2_2 (OTJLD 1.2.5(d)).\n" +
+ "----------\n" +
+ "1. WARNING in Team1522rtij2.java (at line 6)\n" +
+ " public team class Team1522rtij2 {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Javadoc: Missing tag for role file R1522rtij2_2 (OTJLD 1.2.5(d)).\n" +
"----------\n",
customOptions);
}
@@ -1992,11 +1992,11 @@ public class FileStructure extends AbstractOTJLDTest {
"protected class R1522rtij3_1 {}\n" +
" \n"
},
- "----------\n" +
- "1. WARNING in Team1522rtij3.java (at line 5)\n" +
- " * @role R1522rtij3_2 this role is inline\n" +
- " ^^^^^^^^^^^^\n" +
- "Javadoc: R1522rtij3_2 is an inline role, whereas the @role tag should only be used for role files (OTJLD 1.2.5(d)).\n" +
+ "----------\n" +
+ "1. WARNING in Team1522rtij3.java (at line 5)\n" +
+ " * @role R1522rtij3_2 this role is inline\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Javadoc: R1522rtij3_2 is an inline role, whereas the @role tag should only be used for role files (OTJLD 1.2.5(d)).\n" +
"----------\n",
customOptions);
}
@@ -2030,11 +2030,11 @@ public class FileStructure extends AbstractOTJLDTest {
"protected class R1522rtij4_1 {}\n" +
" \n"
},
- "----------\n" +
- "1. WARNING in Team1522rtij4.java (at line 5)\n" +
- " * @role String\n" +
- " ^^^^^^\n" +
- "Javadoc: String cannot be resolved to a role of this team (OTJLD 1.2.5(d)).\n" +
+ "----------\n" +
+ "1. WARNING in Team1522rtij4.java (at line 5)\n" +
+ " * @role String\n" +
+ " ^^^^^^\n" +
+ "Javadoc: String cannot be resolved to a role of this team (OTJLD 1.2.5(d)).\n" +
"----------\n",
customOptions);
}
@@ -2068,11 +2068,11 @@ public class FileStructure extends AbstractOTJLDTest {
"protected class R1522rtij5_1 {}\n" +
" \n"
},
- "----------\n" +
- "1. WARNING in Team1522rtij5.java (at line 4)\n" +
- " * @role\n" +
- " ^^^^\n" +
- "Javadoc: Missing identifier\n" +
+ "----------\n" +
+ "1. WARNING in Team1522rtij5.java (at line 4)\n" +
+ " * @role\n" +
+ " ^^^^\n" +
+ "Javadoc: Missing identifier\n" +
"----------\n",
customOptions);
}
@@ -2106,11 +2106,11 @@ public class FileStructure extends AbstractOTJLDTest {
"protected class R1522rtij6_1 {}\n" +
" \n"
},
- "----------\n" +
- "1. WARNING in Team1522rtij6.java (at line 5)\n" +
- " * @role Wrong\n" +
- " ^^^^^\n" +
- "Javadoc: Wrong cannot be resolved to a role of this team (OTJLD 1.2.5(d)).\n" +
+ "----------\n" +
+ "1. WARNING in Team1522rtij6.java (at line 5)\n" +
+ " * @role Wrong\n" +
+ " ^^^^^\n" +
+ "Javadoc: Wrong cannot be resolved to a role of this team (OTJLD 1.2.5(d)).\n" +
"----------\n",
customOptions);
}
@@ -2138,11 +2138,11 @@ public class FileStructure extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. WARNING in T1522rtij7.java (at line 4)\n" +
- " * @role R1522rtij7_1\n" +
- " ^^^^^^^^^^^^\n" +
- "Javadoc: Illegal @role tag, type T1522rtij7 is not a team (OTJLD 1.2.5(d)).\n" +
+ "----------\n" +
+ "1. WARNING in T1522rtij7.java (at line 4)\n" +
+ " * @role R1522rtij7_1\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Javadoc: Illegal @role tag, type T1522rtij7 is not a team (OTJLD 1.2.5(d)).\n" +
"----------\n",
customOptions);
}
@@ -2164,7 +2164,7 @@ public class FileStructure extends AbstractOTJLDTest {
},
"1.2.5(b)");
}
-
+
// a compilation unit contains a secondary toplevel team class
public void test1524_secondaryTeam1() {
runConformTest(
@@ -2180,7 +2180,7 @@ public class FileStructure extends AbstractOTJLDTest {
" new T0().test();\n" +
" }\n" +
"}\n"
- },
+ },
"OK");
}
@@ -2235,10 +2235,10 @@ public class FileStructure extends AbstractOTJLDTest {
null/*classLibraries*/,
false/*shouldFlushOutputFolder*/,
null/*vmArguments*/,
- customOptions,
+ customOptions,
null/*customRequestor*/);
}
-
+
// a role file holds a nested team which extends a non-team role file
public void test1526_rofiTeamExtendsNonTeam1() {
Map customOptions = getCompilerOptions();
@@ -2265,7 +2265,7 @@ public class FileStructure extends AbstractOTJLDTest {
customOptions,
null/*no custom requestor*/);
}
-
+
// Bug 460525 - Evaluating PlayedBy attribute may cause bad processing order
public void testBug460525() {
compileOrder = new String[][] {
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/ImplicitInheritance.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/ImplicitInheritance.java
index 9493b2ba1..e87e64487 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/ImplicitInheritance.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/ImplicitInheritance.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010, 2014 Stephan Herrmann
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -23,11 +23,11 @@ import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
import junit.framework.Test;
public class ImplicitInheritance extends AbstractOTJLDTest {
-
+
public ImplicitInheritance(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -35,7 +35,7 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -47,7 +47,7 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
// implicit sub-role overrides method with role signature
// 0.c.1-otjld-implicit-overrides-1
public void test0c1_implicitOverrides1() {
-
+
runConformTest(
new String[] {
"T0c112.java",
@@ -84,7 +84,7 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
// a constructor with self call is copied as tsuper, adjustment required
// 0.c.2-otjld-tsuper-in-constructor-1
public void test0c2_tsuperInConstructor1() {
-
+
runConformTest(
new String[] {
"Team0c2tic1_2.java",
@@ -130,7 +130,7 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
// a constructor with self call is copied as tsuper, ctor called in self call not overridden
// 0.c.2-otjld-tsuper-in-constructor-2
public void test0c2_tsuperInConstructor2() {
-
+
runConformTest(
new String[] {
"Team0c2tic2_2.java",
@@ -173,7 +173,7 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
// a team overrides a method returning role
// 0.c.3-otjld-override-method-with-roletype-1
public void test0c3_overrideMethodWithRoletype1() {
-
+
runConformTest(
new String[] {
"T0c3omwr1Main.java",
@@ -219,7 +219,7 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
// a team overrides a method returning role using super
// 0.c.3-otjld-override-method-with-roletype-2
public void test0c3_overrideMethodWithRoletype2() {
-
+
runConformTest(
new String[] {
"T0c3omwr2Main.java",
@@ -265,7 +265,7 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
// a role overrides an implicitly inherited method return a role type
// 0.c.3-otjld-override-method-with-roletype-3
public void test0c3_overrideMethodWithRoletype3() {
-
+
runConformTest(
new String[] {
"T0c3omwr3Main.java",
@@ -312,7 +312,7 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
// a role implicitly inherits an abstract method
// 0.c.4-otjld-copy-abstract-method-1
public void test0c4_copyAbstractMethod1() {
-
+
runConformTest(
new String[] {
"Team0c4cam1_3.java",
@@ -349,7 +349,7 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
// a role implicitly inherits an abstract method that is called from another method
// 0.c.4-otjld-copy-abstract-method-2
public void test0c4_copyAbstractMethod2() {
-
+
runConformTest(
new String[] {
"Team0c4cam2_3.java",
@@ -386,7 +386,7 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
// Bug 355311 - error regarding abstract method in non-abstract role may be displayed at position 0
public void test0c4_copyAbstractMethod3() {
-
+
runNegativeTest(
new String[] {
"Team0c4cam3_1.java",
@@ -406,22 +406,22 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team0c4cam3_2.java (at line 4)\n" +
- " public class Role {\n" +
- " ^^^^\n" +
- "The abstract method getVal in type Role can only be defined by an abstract class\n" +
+ "----------\n" +
+ "1. ERROR in Team0c4cam3_2.java (at line 4)\n" +
+ " public class Role {\n" +
+ " ^^^^\n" +
+ "The abstract method getVal in type Role can only be defined by an abstract class\n" +
"----------\n" +
- "2. ERROR in Team0c4cam3_2.java (at line 4)\n" +
- " public class Role {\n" +
- " ^^^^\n" +
- "The type Team0c4cam3_2.Role must implement the inherited abstract method Team0c4cam3_2.Role.getVal()\n" +
+ "2. ERROR in Team0c4cam3_2.java (at line 4)\n" +
+ " public class Role {\n" +
+ " ^^^^\n" +
+ "The type Team0c4cam3_2.Role must implement the inherited abstract method Team0c4cam3_2.Role.getVal()\n" +
"----------\n");
}
// Bug 359894 - [compiler] support @Override for static role methods
public void test0c4_copyAbstractMethod4() {
-
+
runConformTest(
new String[] {
"Team0c4cam4_1.java",
@@ -503,7 +503,7 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
// a role implicitely inherits a constructor - changed between compiles - corrected program - change not relevant here
// 0.c.5-otjld-changes-between-compiles-2
public void test0c5_changesBetweenCompiles2() {
-
+
runConformTest(
new String[] {
"Team0c5cbc2_3.java",
@@ -606,7 +606,7 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
// a role refines the extends clause, invoking super and base and a role method
// 0.c.6-otjld-ctor-with-changed-extends-2
public void test0c6_ctorWithChangedExtends2() {
-
+
runConformTest(
new String[] {
"Team0c6cwce2_2.java",
@@ -660,7 +660,7 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
// a role refines the extends clause, invoking super and base and a final role method
// 0.c.6-otjld-ctor-with-changed-extends-3
public void test0c6_ctorWithChangedExtends3() {
-
+
runConformTest(
new String[] {
"Team0c6cwce3_2.java",
@@ -716,38 +716,38 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
"Team0c6cwce4_2.java",
"public team class Team0c6cwce4_2 extends Team0c6cwce4_1 {\n" + // should inherit class R1 extends R0
" @Override\n" +
- " protected class R2 extends R1 {\n" +
- " public R2() {\n" +
- " super();\n" +
- " }\n" +
- " }\n" +
- " void test() {\n" +
- " R2 r = new R2();\n" +
- " System.out.print(r.val);\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new Team0c6cwce4_2().test();\n" +
- " }\n" +
+ " protected class R2 extends R1 {\n" +
+ " public R2() {\n" +
+ " super();\n" +
+ " }\n" +
+ " }\n" +
+ " void test() {\n" +
+ " R2 r = new R2();\n" +
+ " System.out.print(r.val);\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new Team0c6cwce4_2().test();\n" +
+ " }\n" +
"}\n",
"Team0c6cwce4_1.java",
- "public team class Team0c6cwce4_1 {\n" +
+ "public team class Team0c6cwce4_1 {\n" +
" protected class R0 {\n" +
- " public String val;\n" +
- "\n" +
- " public R0(String val) {\n" +
- " this.val = val;\n" +
- " } \n" +
- " }\n" +
- " protected class R1 extends R0 {\n" +
- " public R1() {\n" +
- " super(\"T1.R1\");\n" +
- " }\n" +
- " }\n" +
- " protected class R2 extends R0 {\n" +
- " public R2(String val) {\n" +
- " super(val);\n" +
- " } \n" +
- " }\n" +
+ " public String val;\n" +
+ "\n" +
+ " public R0(String val) {\n" +
+ " this.val = val;\n" +
+ " } \n" +
+ " }\n" +
+ " protected class R1 extends R0 {\n" +
+ " public R1() {\n" +
+ " super(\"T1.R1\");\n" +
+ " }\n" +
+ " }\n" +
+ " protected class R2 extends R0 {\n" +
+ " public R2(String val) {\n" +
+ " super(val);\n" +
+ " } \n" +
+ " }\n" +
"}\n"
},
"T1.R1");
@@ -758,40 +758,40 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
"Team0c6cwce5_2.java",
"public team class Team0c6cwce5_2 extends Team0c6cwce5_1 {\n" +
" @Override\n" +
- " protected class R1 extends R0 {} \n" + // should inherited ctor public R1()
+ " protected class R1 extends R0 {} \n" + // should inherited ctor public R1()
" @Override\n" +
- " protected class R2 extends R1 {\n" +
- " public R2() {\n" +
- " super();\n" +
- " }\n" +
- " }\n" +
- " void test() {\n" +
- " R2 r = new R2();\n" +
- " System.out.print(r.val);\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new Team0c6cwce5_2().test();\n" +
- " }\n" +
+ " protected class R2 extends R1 {\n" +
+ " public R2() {\n" +
+ " super();\n" +
+ " }\n" +
+ " }\n" +
+ " void test() {\n" +
+ " R2 r = new R2();\n" +
+ " System.out.print(r.val);\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new Team0c6cwce5_2().test();\n" +
+ " }\n" +
"}\n",
"Team0c6cwce5_1.java",
- "public team class Team0c6cwce5_1 {\n" +
+ "public team class Team0c6cwce5_1 {\n" +
" protected class R0 {\n" +
- " public String val;\n" +
- "\n" +
- " public R0(String val) {\n" +
- " this.val = val;\n" +
- " } \n" +
- " }\n" +
- " protected class R1 extends R0 {\n" +
- " public R1() {\n" +
- " super(\"T1.R1\");\n" +
- " }\n" +
- " }\n" +
- " protected class R2 extends R0 {\n" +
- " public R2(String val) {\n" +
- " super(val);\n" +
- " } \n" +
- " }\n" +
+ " public String val;\n" +
+ "\n" +
+ " public R0(String val) {\n" +
+ " this.val = val;\n" +
+ " } \n" +
+ " }\n" +
+ " protected class R1 extends R0 {\n" +
+ " public R1() {\n" +
+ " super(\"T1.R1\");\n" +
+ " }\n" +
+ " }\n" +
+ " protected class R2 extends R0 {\n" +
+ " public R2(String val) {\n" +
+ " super(val);\n" +
+ " } \n" +
+ " }\n" +
"}\n"
});
}
@@ -802,41 +802,41 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
"public team class Team0c6cwce6_2 extends Team0c6cwce6_1 {\n" +
" @Override\n" +
" protected class R1 extends R0 {\n" +
- " } \n" +
+ " } \n" +
" @Override\n" +
- " protected class R2 extends R1 {\n" +
- " public R2() {\n" +
+ " protected class R2 extends R1 {\n" +
+ " public R2() {\n" +
" super();\n" +
- " tsuper(\"T2.R2\");\n" +
- " }\n" +
- " }\n" +
- " void test() {\n" +
- " R2 r = new R2();\n" +
- " System.out.print(r.val);\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new Team0c6cwce6_2().test();\n" +
- " }\n" +
+ " tsuper(\"T2.R2\");\n" +
+ " }\n" +
+ " }\n" +
+ " void test() {\n" +
+ " R2 r = new R2();\n" +
+ " System.out.print(r.val);\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new Team0c6cwce6_2().test();\n" +
+ " }\n" +
"}\n",
"Team0c6cwce6_1.java",
- "public team class Team0c6cwce6_1 {\n" +
+ "public team class Team0c6cwce6_1 {\n" +
" protected class R0 {\n" +
- " public String val;\n" +
- "\n" +
- " public R0(String val) {\n" +
- " this.val = val;\n" +
- " } \n" +
- " }\n" +
- " protected class R1 extends R0 {\n" +
- " public R1() {\n" +
- " super(\"T1.R1\");\n" +
- " }\n" +
- " }\n" +
- " protected class R2 extends R0 {\n" +
- " public R2(String val) {\n" +
- " super(val);\n" +
- " } \n" +
- " }\n" +
+ " public String val;\n" +
+ "\n" +
+ " public R0(String val) {\n" +
+ " this.val = val;\n" +
+ " } \n" +
+ " }\n" +
+ " protected class R1 extends R0 {\n" +
+ " public R1() {\n" +
+ " super(\"T1.R1\");\n" +
+ " }\n" +
+ " }\n" +
+ " protected class R2 extends R0 {\n" +
+ " public R2(String val) {\n" +
+ " super(val);\n" +
+ " } \n" +
+ " }\n" +
"}\n"
},
"----------\n" +
@@ -906,11 +906,11 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
"} \n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team0c7itcc3_2.java (at line 6)\n" +
- " tsuper(7);\n" +
- " ^^^^^^^^^^\n" +
- "The constructor Team0c7itcc3_1.R(int) is undefined\n" +
+ "----------\n" +
+ "1. ERROR in Team0c7itcc3_2.java (at line 6)\n" +
+ " tsuper(7);\n" +
+ " ^^^^^^^^^^\n" +
+ "The constructor Team0c7itcc3_1.R(int) is undefined\n" +
"----------\n");
}
@@ -967,7 +967,7 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
// a private method is callin bound, subteam inherits everything. Bug reported by OTS-students working on OTPong
// 0.c.9-otjld-implicitly-inheriting-callin-to-private-1
public void test0c9_implicitlyInheritingCallinToPrivate1() {
-
+
runConformTest(
new String[] {
"Team0c9iictp1_2.java",
@@ -1023,10 +1023,10 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
"final");
}
- //
+ //
// 0.c.11-otjld-implicitly-inheriting-static-role-method-1
public void test0c11_implicitlyInheritingStaticRoleMethod1() {
-
+
runConformTest(
new String[] {
"Team0c11iisrm1_2.java",
@@ -1065,7 +1065,7 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
// a tsuper call initially does not require a marker arg, but byte code copy has to add one
// 0.c.12-otjld-tsuper-call-rewriting-1
public void test0c12_tsuperCallRewriting1() {
-
+
runConformTest(
new String[] {
"Team0c12tcr1_3.java",
@@ -1112,7 +1112,7 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
// a class implicitly inherits a super interface declaration - src-level role ifc
// 0.c.13-otjld-implicitly-inherited-superinterface-1
public void test0c13_implicitlyInheritedSuperinterface1() {
-
+
runConformTest(
new String[] {
"Team0c13iis1_2.java",
@@ -1151,7 +1151,7 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
},
"OK");
}
-
+
// a role implicitly inherits a final field with an initializer.
// see Bug 315322 - [compiler] final field with initializer breaks implicit inheritance
public void test0c14_implicitlyInheritedInitializedField1() {
@@ -1218,7 +1218,7 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
"Team0c15obsr1_2.java",
"public team class Team0c15obsr1_2 extends Team0c15obsr1_1 {\n" +
" protected class R playedBy T0c15obsr1_1 {}\n" +
- "}\n"
+ "}\n"
},
"mfoo");
}
@@ -1261,7 +1261,7 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
" tsuper(o);\n" +
" }\n" +
" }\n" +
- "}\n"
+ "}\n"
},
"mfoo");
}
@@ -1295,12 +1295,12 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
"Team0c15obsr2_2.java",
"public team class Team0c15obsr2_2 extends Team0c15obsr2_1 {\n" +
" protected class R playedBy T0c15obsr2_1 {}\n" +
- "}\n"
+ "}\n"
},
"caught");
}
- // detect use of inherited illegal role ctor
+ // detect use of inherited illegal role ctor
// see Bug 318415 - Copy inheritance problem
public void test0c15_overrideBoundSuperRole3() {
runConformTest(
@@ -1334,7 +1334,7 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
"Team0c15obsr3_2.java",
"public team class Team0c15obsr3_2 extends Team0c15obsr3_1 {\n" +
" public class R playedBy T0c15obsr3_1 {}\n" +
- "}\n"
+ "}\n"
},
"caught");
}
@@ -1363,11 +1363,11 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
" protected String test(String u){ return u;}" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Team0c16iir1_1.java (at line 4)\n" +
- " return \"O\"+base.test(u);\n" +
- " ^^^^^^^^^^^^\n" +
- "Cannot use \'base\' in the regular method \'test(String)\' (OTJLD 2.6(c)).\n" +
+ "----------\n" +
+ "1. ERROR in Team0c16iir1_1.java (at line 4)\n" +
+ " return \"O\"+base.test(u);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Cannot use \'base\' in the regular method \'test(String)\' (OTJLD 2.6(c)).\n" +
"----------\n");
}
@@ -1451,11 +1451,11 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in SubTeam.java (at line 5)\n" +
- " tsuper();\n" +
- " ^^^^^^^^^\n" +
- "The constructor SuperTeamFI4.R1() is undefined\n" +
+ "----------\n" +
+ "1. ERROR in SubTeam.java (at line 5)\n" +
+ " tsuper();\n" +
+ " ^^^^^^^^^\n" +
+ "The constructor SuperTeamFI4.R1() is undefined\n" +
"----------\n");
}
@@ -1579,21 +1579,21 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in SubTeamFI3a.java (at line 5)\n" +
- " super();\n" +
- " ^^^^^^^^\n" +
- "Need to invoke a tsuper constructor because tsuper role \'SuperTeamFI4FI3.R1\' has field initializations.\n" +
- "----------\n" +
- "2. ERROR in SubTeamFI3a.java (at line 11)\n" +
- " super();\n" +
- " ^^^^^^^^\n" +
- "Need to invoke a tsuper constructor because tsuper role \'SuperTeamFI4FI3.R2\' has field initializations.\n" +
- "----------\n" +
- "3. ERROR in SubTeamFI3a.java (at line 13)\n" +
- " protected R2(int i) {\n" +
- " ^^^^^^^^^\n" +
- "Need to invoke a tsuper constructor because tsuper role \'SuperTeamFI4FI3.R2\' has field initializations.\n" +
+ "----------\n" +
+ "1. ERROR in SubTeamFI3a.java (at line 5)\n" +
+ " super();\n" +
+ " ^^^^^^^^\n" +
+ "Need to invoke a tsuper constructor because tsuper role \'SuperTeamFI4FI3.R1\' has field initializations.\n" +
+ "----------\n" +
+ "2. ERROR in SubTeamFI3a.java (at line 11)\n" +
+ " super();\n" +
+ " ^^^^^^^^\n" +
+ "Need to invoke a tsuper constructor because tsuper role \'SuperTeamFI4FI3.R2\' has field initializations.\n" +
+ "----------\n" +
+ "3. ERROR in SubTeamFI3a.java (at line 13)\n" +
+ " protected R2(int i) {\n" +
+ " ^^^^^^^^^\n" +
+ "Need to invoke a tsuper constructor because tsuper role \'SuperTeamFI4FI3.R2\' has field initializations.\n" +
"----------\n");
}
@@ -1637,16 +1637,16 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
"Base2.java",
"public class Base2 {}\n",
},
- "----------\n" +
- "1. ERROR in SubTeamFI4.java (at line 5)\n" +
- " tsuper();\n" +
- " ^^^^^^^^^\n" +
- "The constructor SuperTeamFI4.R1() is undefined\n" +
- "----------\n" +
- "2. ERROR in SubTeamFI4.java (at line 10)\n" +
- " protected R2() {\n" +
- " ^^^^\n" +
- "Need to invoke a tsuper constructor because tsuper role \'SuperTeamFI4.R2\' has field initializations.\n" +
+ "----------\n" +
+ "1. ERROR in SubTeamFI4.java (at line 5)\n" +
+ " tsuper();\n" +
+ " ^^^^^^^^^\n" +
+ "The constructor SuperTeamFI4.R1() is undefined\n" +
+ "----------\n" +
+ "2. ERROR in SubTeamFI4.java (at line 10)\n" +
+ " protected R2() {\n" +
+ " ^^^^\n" +
+ "Need to invoke a tsuper constructor because tsuper role \'SuperTeamFI4.R2\' has field initializations.\n" +
"----------\n");
}
@@ -1681,16 +1681,16 @@ public class ImplicitInheritance extends AbstractOTJLDTest {
"Base1.java",
"public class Base1 {}\n",
},
- "----------\n" +
- "1. ERROR in SubTeamFI5.java (at line 5)\n" +
- " super();\n" +
- " ^^^^^^^^\n" +
- "Need to invoke a tsuper constructor because tsuper role \'SuperTeamFI5.R1\' has field initializations.\n" +
- "----------\n" +
- "2. ERROR in SubTeamFI5.java (at line 11)\n" +
- " super(b);\n" +
- " ^^^^^^^^^\n" +
- "Need to invoke a tsuper constructor because tsuper role \'SuperTeamFI5.R2\' has field initializations.\n" +
+ "----------\n" +
+ "1. ERROR in SubTeamFI5.java (at line 5)\n" +
+ " super();\n" +
+ " ^^^^^^^^\n" +
+ "Need to invoke a tsuper constructor because tsuper role \'SuperTeamFI5.R1\' has field initializations.\n" +
+ "----------\n" +
+ "2. ERROR in SubTeamFI5.java (at line 11)\n" +
+ " super(b);\n" +
+ " ^^^^^^^^^\n" +
+ "Need to invoke a tsuper constructor because tsuper role \'SuperTeamFI5.R2\' has field initializations.\n" +
"----------\n");
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/InheritanceHierarchyOfTeams.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/InheritanceHierarchyOfTeams.java
index 1e711c6d8..bd9a68e2a 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/InheritanceHierarchyOfTeams.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/InheritanceHierarchyOfTeams.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2015 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -25,14 +25,14 @@ import junit.framework.Test;
/**
* Former jacks tests from section implicit-hierarchy-of-teams (1.2.*)
- * @author stephan
+ * @author stephan
*/
public class InheritanceHierarchyOfTeams extends AbstractOTJLDTest {
public InheritanceHierarchyOfTeams(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -40,7 +40,7 @@ public class InheritanceHierarchyOfTeams extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -503,7 +503,7 @@ public class InheritanceHierarchyOfTeams extends AbstractOTJLDTest {
" \n"
});
}
-
+
// a nested team has a non-team superclass
public void test127_nonTeamSuperclass3() {
runConformTest(
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/OldExternalizedRoles.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/OldExternalizedRoles.java
index 23bffac2a..7be0d3ebf 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/OldExternalizedRoles.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/OldExternalizedRoles.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -24,11 +24,11 @@ import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
import junit.framework.Test;
public class OldExternalizedRoles extends AbstractOTJLDTest {
-
+
public OldExternalizedRoles(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -36,7 +36,7 @@ public class OldExternalizedRoles extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -48,7 +48,7 @@ public class OldExternalizedRoles extends AbstractOTJLDTest {
// access to a feature of an externalized role object
// 6.2.1-otjld-access-to-externalized-role-1
public void test621_accessToExternalizedRole1() {
-
+
runConformTest(
new String[] {
"T621ater1Main.java",
@@ -80,7 +80,7 @@ public class OldExternalizedRoles extends AbstractOTJLDTest {
// access to a feature of an externalized role object
// 6.2.1-otjld-access-to-externalized-role-2
public void test621_accessToExternalizedRole2() {
-
+
runConformTest(
new String[] {
"T621ater2Main.java",
@@ -116,7 +116,7 @@ public class OldExternalizedRoles extends AbstractOTJLDTest {
// access to a feature of an externalized role object
// 6.2.1-otjld-access-to-externalized-role-3
public void test621_accessToExternalizedRole3() {
-
+
runConformTest(
new String[] {
"T621ater3Main.java",
@@ -319,7 +319,7 @@ public class OldExternalizedRoles extends AbstractOTJLDTest {
// access to a feature of an externalized role object
// 6.2.1-otjld-access-to-externalized-role-4
public void test621_accessToExternalizedRole4() {
-
+
runConformTest(
new String[] {
"T621ater4Main.java",
@@ -399,7 +399,7 @@ public class OldExternalizedRoles extends AbstractOTJLDTest {
// access to a feature of an externalized role object
// 6.2.1-otjld-access-to-externalized-role-6
public void test621_accessToExternalizedRole6() {
-
+
runConformTest(
new String[] {
"T621ater6Main.java",
@@ -451,7 +451,7 @@ public class OldExternalizedRoles extends AbstractOTJLDTest {
// access to a feature of an externalized role object
// 6.2.1-otjld-access-to-externalized-role-7
public void test621_accessToExternalizedRole7() {
-
+
runConformTest(
new String[] {
"T621ater7Main.java",
@@ -528,7 +528,7 @@ public class OldExternalizedRoles extends AbstractOTJLDTest {
// access to a feature of an externalized role object
// 6.2.1-otjld_testbug-access-to-externalized-role-8
public void _testbug_test621_accessToExternalizedRole8() {
-
+
runConformTest(
new String[] {
"T621ater8Main.java",
@@ -568,7 +568,7 @@ public class OldExternalizedRoles extends AbstractOTJLDTest {
// access to a feature of an externalized role object
// 6.2.1-otjld_testbug-access-to-externalized-role-9
public void _testbug_test621_accessToExternalizedRole9() {
-
+
runConformTest(
new String[] {
"T621ater9Main.java",
@@ -631,7 +631,7 @@ public class OldExternalizedRoles extends AbstractOTJLDTest {
// access to a feature of an externalized role object
// 6.2.1-otjld_testbug-access-to-externalized-role-10
public void _testbug_test621_accessToExternalizedRole10() {
-
+
runConformTest(
new String[] {
"T621ater10Main.java",
@@ -675,7 +675,7 @@ public class OldExternalizedRoles extends AbstractOTJLDTest {
// access to a feature of an externalized role object
// 6.2.1-otjld-access-to-externalized-role-11
public void test621_accessToExternalizedRole11() {
-
+
runConformTest(
new String[] {
"T621ater11Main.java",
@@ -738,7 +738,7 @@ public class OldExternalizedRoles extends AbstractOTJLDTest {
// access to a feature of an externalized role object
// 6.2.1-otjld-access-to-externalized-role-12
public void test621_accessToExternalizedRole12() {
-
+
runConformTest(
new String[] {
"T621ater12Main.java",
@@ -812,7 +812,7 @@ public class OldExternalizedRoles extends AbstractOTJLDTest {
// access to a feature of an externalized role object
// 6.2.1-otjld-access-to-externalized-role-13
public void test621_accessToExternalizedRole13() {
-
+
runConformTest(
new String[] {
"T621ater13Main.java",
@@ -856,7 +856,7 @@ public class OldExternalizedRoles extends AbstractOTJLDTest {
// access to a feature of an externalized role object
// 6.2.1-otjld-access-to-externalized-role-14
public void test621_accessToExternalizedRole14() {
-
+
runConformTest(
new String[] {
"T621ater14Main.java",
@@ -953,7 +953,7 @@ public class OldExternalizedRoles extends AbstractOTJLDTest {
// access to a feature of an externalized role object
// 6.2.1-otjld-access-to-externalized-role-15
public void test621_accessToExternalizedRole15() {
-
+
runConformTest(
new String[] {
"T621ater15Main.java",
@@ -1012,7 +1012,7 @@ public class OldExternalizedRoles extends AbstractOTJLDTest {
// an externalized role is declared with a non-final team variable, but never involved in any assignment
// 6.2.2-otjld-nonfinal-externalized-role-anchor-1
public void test622_nonfinalExternalizedRoleAnchor1() {
-
+
runConformTest(
new String[] {
"Team622nera1_2.java",
@@ -1054,7 +1054,7 @@ public class OldExternalizedRoles extends AbstractOTJLDTest {
// an externalized role is declared with a non-final team variable, but never involved in any assignment
// 6.2.2-otjld-nonfinal-externalized-role-anchor-1a
public void test622_nonfinalExternalizedRoleAnchor1a() {
-
+
runConformTest(
new String[] {
"Team622nera1a_2.java",
@@ -1099,7 +1099,7 @@ public class OldExternalizedRoles extends AbstractOTJLDTest {
// an externalized role is declared with a non-final team obtained from a method call, but never involved in any assignment
// 6.2.2-otjld-nonfinal-externalized-role-anchor-1m
public void test622_nonfinalExternalizedRoleAnchor1m() {
-
+
runConformTest(
new String[] {
"Team622nera1m_2.java",
@@ -1146,7 +1146,7 @@ public class OldExternalizedRoles extends AbstractOTJLDTest {
// an externalized role is declared with a non-final team obtained from a method call, but never involved in any assignment
// 6.2.2-otjld-nonfinal-externalized-role-anchor-1n
public void test622_nonfinalExternalizedRoleAnchor1n() {
-
+
runConformTest(
new String[] {
"Team622nera1n_2.java",
@@ -1376,7 +1376,7 @@ public class OldExternalizedRoles extends AbstractOTJLDTest {
// access to a feature of an externalized role object that has converted
// 6.2.5-otjld-different-dynamic-type-externalized-role-1
public void test625_differentDynamicTypeExternalizedRole1() {
-
+
runConformTest(
new String[] {
"T625ddter1Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/RegularRoleInheritance.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/RegularRoleInheritance.java
index 19d6f4925..d790df9f3 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/RegularRoleInheritance.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/RegularRoleInheritance.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -25,14 +25,14 @@ import junit.framework.Test;
/**
* Former jacks tests from section regular-role-inheritance (1.4.*)
- * @author stephan
+ * @author stephan
*/
public class RegularRoleInheritance extends AbstractOTJLDTest {
-
+
public RegularRoleInheritance(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -40,7 +40,7 @@ public class RegularRoleInheritance extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -48,11 +48,11 @@ public class RegularRoleInheritance extends AbstractOTJLDTest {
public static Class testClass() {
return RegularRoleInheritance.class;
}
-
+
// a role class extends a role from the same team and uses a feature of it
// 1.4.1-otjld-same-team-super-role-access-1
public void test141_sameTeamSuperRoleAccess1() {
-
+
runConformTest(
new String[] {
"T141stsra1Main.java",
@@ -93,7 +93,7 @@ public class RegularRoleInheritance extends AbstractOTJLDTest {
// a role class extends a implicitly inherited role from the same team and uses a feature of it
// 1.4.1-otjld-same-team-super-role-access-2
public void test141_sameTeamSuperRoleAccess2() {
-
+
runConformTest(
new String[] {
"T141stsra2Main.java",
@@ -138,7 +138,7 @@ public class RegularRoleInheritance extends AbstractOTJLDTest {
// a role class extends an inherited role from the same team and uses a feature of it
// 1.4.1-otjld-same-team-super-role-access-3
public void test141_sameTeamSuperRoleAccess3() {
-
+
runConformTest(
new String[] {
"T141stsra3Main.java",
@@ -194,7 +194,7 @@ public class RegularRoleInheritance extends AbstractOTJLDTest {
// a role class redefines an implicitly inherited role
// 1.4.2-otjld-role-redefinition-1
public void test142_roleRedefinition1() {
-
+
runConformTest(
new String[] {
"T142rr1Main.java",
@@ -239,7 +239,7 @@ public class RegularRoleInheritance extends AbstractOTJLDTest {
// a role class redefines an implicitly inherited role
// 1.4.2-otjld-role-redefinition-2
public void test142_roleRedefinition2() {
-
+
runConformTest(
new String[] {
"T142rr2Main.java",
@@ -288,7 +288,7 @@ public class RegularRoleInheritance extends AbstractOTJLDTest {
// a role class redefines an implicitly inherited role
// 1.4.2-otjld-role-redefinition-3
public void test142_roleRedefinition3() {
-
+
runConformTest(
new String[] {
"T142rr3Main.java",
@@ -339,7 +339,7 @@ public class RegularRoleInheritance extends AbstractOTJLDTest {
// a role class is implicitly cast to its direct base interface
// 1.4.3-otjld-cast-to-baseinterface-1
public void test143_castToBaseinterface1() {
-
+
runConformTest(
new String[] {
"T143ctb1Main.java",
@@ -376,7 +376,7 @@ public class RegularRoleInheritance extends AbstractOTJLDTest {
// a role class is explicitly cast to a base interface inherited from its implicit super role
// 1.4.3-otjld-cast-to-baseinterface-2
public void test143_castToBaseinterface2() {
-
+
runConformTest(
new String[] {
"T143ctb2Main.java",
@@ -423,7 +423,7 @@ public class RegularRoleInheritance extends AbstractOTJLDTest {
// a role class is implicitly cast to a base interface inherited from its explicit super role
// 1.4.3-otjld-cast-to-baseinterface-3
public void test143_castToBaseinterface3() {
-
+
runConformTest(
new String[] {
"T143ctb3Main.java",
@@ -469,7 +469,7 @@ public class RegularRoleInheritance extends AbstractOTJLDTest {
// a role class is implicitly cast to the normal super class of its implicit super role
// 1.4.4-otjld-cast-to-superclass-1
public void test144_castToSuperclass1() {
-
+
runConformTest(
new String[] {
"T144cts1Main.java",
@@ -512,7 +512,7 @@ public class RegularRoleInheritance extends AbstractOTJLDTest {
// a role class is explicitly cast to the normal super class of its explicit super role
// 1.4.4-otjld-cast-to-superclass-2
public void test144_castToSuperclass2() {
-
+
runConformTest(
new String[] {
"T144cts2Main.java",
@@ -553,7 +553,7 @@ public class RegularRoleInheritance extends AbstractOTJLDTest {
// a role class is implicitly cast to the normal super class of a remote super role
// 1.4.4-otjld-cast-to-superclass-3
public void test144_castToSuperclass3() {
-
+
runConformTest(
new String[] {
"T144cts3Main.java",
@@ -723,7 +723,7 @@ public class RegularRoleInheritance extends AbstractOTJLDTest {
// a role class has a normal super class, and invokes the super constructor
// 1.4.6-otjld-super-constructor-access-1
public void test146_superConstructorAccess1() {
-
+
runConformTest(
new String[] {
"T146sca1Main.java",
@@ -770,7 +770,7 @@ public class RegularRoleInheritance extends AbstractOTJLDTest {
// a role class has a normal super class, and invokes a super constructor with a different signature
// 1.4.6-otjld-super-constructor-access-2
public void test146_superConstructorAccess2() {
-
+
runConformTest(
new String[] {
"T146sca2Main.java",
@@ -817,7 +817,7 @@ public class RegularRoleInheritance extends AbstractOTJLDTest {
// a role class accesses a field of its normal super class without using super
// 1.4.7-otjld-access-to-superclass-feature-1
public void test147_accessToSuperclassFeature1() {
-
+
runConformTest(
new String[] {
"T147atsf1Main.java",
@@ -857,7 +857,7 @@ public class RegularRoleInheritance extends AbstractOTJLDTest {
// a role class accesses a method of the normal super class of its implicit superrole without using super
// 1.4.7-otjld-access-to-superclass-feature-2
public void test147_accessToSuperclassFeature2() {
-
+
runConformTest(
new String[] {
"T147atsf2Main.java",
@@ -905,7 +905,7 @@ public class RegularRoleInheritance extends AbstractOTJLDTest {
// a role class accesses a static method of the normal super class of its implicit superrole without using super
// 1.4.7-otjld-access-to-superclass-feature-2s
public void test147_accessToSuperclassFeature2s() {
-
+
runConformTest(
new String[] {
"T147atsf2sMain.java",
@@ -953,7 +953,7 @@ public class RegularRoleInheritance extends AbstractOTJLDTest {
// a team class accesses a static method of a role's normal super class of its implicit superrole without using super
// 1.4.7-otjld_unsupported_access-to-superclass-feature-2t
public void _unsupported_test147_accessToSuperclassFeature2t() {
-
+
runConformTest(
new String[] {
"T147atsf2tMain.java",
@@ -998,7 +998,7 @@ public class RegularRoleInheritance extends AbstractOTJLDTest {
// a team class accesses a static method of an externalized role's normal super class of its implicit superrole without using super - SYNTAX NOT SUPPORTED
// 1.4.7-otjld_unsupported_access-to-superclass-feature-2u
public void _unsupported_test147accessToSuperclassFeature2u() {
-
+
runConformTest(
new String[] {
"T147atsf2uMain.java",
@@ -1039,7 +1039,7 @@ public class RegularRoleInheritance extends AbstractOTJLDTest {
// a role class accesses a final method of the normal super class
// 1.4.7-otjld-access-to-superclass-feature-3
public void test147_accessToSuperclassFeature3() {
-
+
runConformTest(
new String[] {
"Team147atsf3.java",
@@ -1109,7 +1109,7 @@ public class RegularRoleInheritance extends AbstractOTJLDTest {
// a role accesses a protected method inherited from its regular super class
// 1.4.7-otjld-access-to-superclass-feature-4
public void test147_accessToSuperclassFeature4() {
-
+
runConformTest(
new String[] {
"Team147atsf4.java",
@@ -1163,18 +1163,18 @@ public class RegularRoleInheritance extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team147atsf5.java (at line 5)\n" +
- " notVisible();\n" +
- " ^^^^^^^^^^\n" +
- "The method notVisible() from the type T147atsf5 is not visible\n" +
+ "----------\n" +
+ "1. ERROR in Team147atsf5.java (at line 5)\n" +
+ " notVisible();\n" +
+ " ^^^^^^^^^^\n" +
+ "The method notVisible() from the type T147atsf5 is not visible\n" +
"----------\n");
}
// was falsly reporting ambiguity between a local method and a private method from its regular superclass
// 1.4.7-otjld-access-to-superclass-feature-6
public void test147_accessToSuperclassFeature6() {
-
+
runConformTest(
new String[] {
"Team147atsf6.java",
@@ -1229,14 +1229,14 @@ public class RegularRoleInheritance extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team148erfut1_2.java (at line 5)\n" +
- " public class Role148erfut1_2 extends t.Role148erfut1_1 {}\n" +
- " ^\n" +
- "t cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in Team148erfut1_2.java (at line 5)\n" +
+ " public class Role148erfut1_2 extends t.Role148erfut1_1 {}\n" +
+ " ^\n" +
+ "t cannot be resolved to a type\n" +
"----------\n");
}
-
+
// same as above but using new syntax depdendent type
public void test148_extendingRoleFromUnrelatedTeam2() {
runNegativeTest(
@@ -1256,11 +1256,11 @@ public class RegularRoleInheritance extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team148erfut2_2.java (at line 5)\n" +
- " public class Role148erfut2_2 extends Role148erfut2_1<@t> {}\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Cannot sub-class an externalized role type (OTJLD 1.2.2(g)).\n" +
+ "----------\n" +
+ "1. ERROR in Team148erfut2_2.java (at line 5)\n" +
+ " public class Role148erfut2_2 extends Role148erfut2_1<@t> {}\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Cannot sub-class an externalized role type (OTJLD 1.2.2(g)).\n" +
"----------\n");
}
@@ -1311,7 +1311,7 @@ public class RegularRoleInheritance extends AbstractOTJLDTest {
// a callout binding overrides a method from the explicit (non-role) superclass - witness for TPX-416
// 1.4.10-otjld-callout-overrides-explicitly-inheritd-1
public void test1410_calloutOverridesExplicitlyInheritd1() {
-
+
runConformTest(
new String[] {
"Team1410cowi1.java",
@@ -1350,7 +1350,7 @@ public class RegularRoleInheritance extends AbstractOTJLDTest {
// a role class accesses a public field from its regular super class
// 1.4.11-otjld-field-of-regular-super-1
public void test1411_fieldOfRegularSuper1() {
-
+
runConformTest(
new String[] {
"Team1411fors1.java",
@@ -1388,7 +1388,7 @@ public class RegularRoleInheritance extends AbstractOTJLDTest {
// a role accesses a public field from its regular super class - different instances
// 1.4.11-otjld-field-of-regular-super-2
public void test1411_fieldOfRegularSuper2() {
-
+
runConformTest(
new String[] {
"Team1411fors2.java",
@@ -1426,7 +1426,7 @@ public class RegularRoleInheritance extends AbstractOTJLDTest {
// a team accesses a public field from its role's regular super class
// 1.4.11-otjld-field-of-regular-super-3
public void test1411_fieldOfRegularSuper3() {
-
+
runConformTest(
new String[] {
"Team1411fors3.java",
@@ -1496,24 +1496,24 @@ public class RegularRoleInheritance extends AbstractOTJLDTest {
runConformTest(
new String[] {
"base/BGraph.java",
- "package base;\n" +
- "\n" +
- "public team class BGraph {\n" +
- " public class BNode { }\n" +
- " public class BEdge {}\n" +
+ "package base;\n" +
+ "\n" +
+ "public team class BGraph {\n" +
+ " public class BNode { }\n" +
+ " public class BEdge {}\n" +
"}\n",
"features/Features.java",
- "package features;\n" +
- "import base base.BGraph;\n" +
- "public team class Features {\n" +
- " public team class BasicGraph playedBy BGraph {\n" +
- " public BasicGraph() { base(); }\n" +
- " public class Edge playedBy BEdge<@base> {\n" +
- " public Edge() { base(); }\n" +
- " }\n" +
- " }\n" +
- " public team class WeightedGraph extends BasicGraph {\n" +
- " }\n" +
+ "package features;\n" +
+ "import base base.BGraph;\n" +
+ "public team class Features {\n" +
+ " public team class BasicGraph playedBy BGraph {\n" +
+ " public BasicGraph() { base(); }\n" +
+ " public class Edge playedBy BEdge<@base> {\n" +
+ " public Edge() { base(); }\n" +
+ " }\n" +
+ " }\n" +
+ " public team class WeightedGraph extends BasicGraph {\n" +
+ " }\n" +
"}\n"
});
}
@@ -1522,25 +1522,25 @@ public class RegularRoleInheritance extends AbstractOTJLDTest {
runConformTest(
new String[] {
"base/BGraph.java",
- "package base;\n" +
- "\n" +
- "public team class BGraph {\n" +
- " public class BNode { }\n" +
- " public class BEdge {}\n" +
+ "package base;\n" +
+ "\n" +
+ "public team class BGraph {\n" +
+ " public class BNode { }\n" +
+ " public class BEdge {}\n" +
"}\n",
"features/Features.java",
- "package features;\n" +
- "import base base.BGraph;\n" +
- "public team class Features {\n" +
- " public team class BasicGraph playedBy BGraph {\n" +
- " public BasicGraph() { base(); }\n" +
- " public class Edge playedBy BEdge<@base> {\n" +
- " public Edge() { base(); }\n" +
- " }\n" +
- " }\n" +
+ "package features;\n" +
+ "import base base.BGraph;\n" +
+ "public team class Features {\n" +
+ " public team class BasicGraph playedBy BGraph {\n" +
+ " public BasicGraph() { base(); }\n" +
+ " public class Edge playedBy BEdge<@base> {\n" +
+ " public Edge() { base(); }\n" +
+ " }\n" +
+ " }\n" +
" public team class WeightedGraph extends BasicGraph {\n" +
- " @Override public class Edge {}\n" +
- " }\n" +
+ " @Override public class Edge {}\n" +
+ " }\n" +
"}\n"
});
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/RelevantRole.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/RelevantRole.java
index 21b9a030b..d5b6785d3 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/RelevantRole.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/RelevantRole.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010 Stephan Herrmann
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -23,11 +23,11 @@ import junit.framework.Test;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class RelevantRole extends AbstractOTJLDTest {
-
+
public RelevantRole(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -35,7 +35,7 @@ public class RelevantRole extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -43,11 +43,11 @@ public class RelevantRole extends AbstractOTJLDTest {
public static Class testClass() {
return RelevantRole.class;
}
-
+
// a role implicitly inherits from an abstract relevant role but has a different constructor
// 1.8.1-otjld-refining-abstract-role-1
public void test181_refiningAbstractRole1() {
-
+
runConformTest(
new String[] {
"Team181rar1_2.java",
@@ -136,7 +136,7 @@ public class RelevantRole extends AbstractOTJLDTest {
" \n"
});
}
-
+
// an abstract relevant role is inherited as a phantom
// Bug 336420 - [compiler] NPE during reporting "abstract relevant role"
public void test182_phantomAbstractRole1() {
@@ -152,17 +152,17 @@ public class RelevantRole extends AbstractOTJLDTest {
"T182par1.java",
"public class T182par1 {}"
},
- "----------\n" +
- "1. ERROR in Team182par1_2.java (at line 1)\n" +
- " public team class Team182par1_2 extends Team182par1_1 {\n" +
- " ^^^^^^^^^^^^^\n" +
- "Team Team182par1_2 must be declared abstract, because abstract role R is relevant (OTJLD 2.5(b)).\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Team182par1_1.java (at line 2)\n" +
- " protected abstract class R playedBy T182par1 {}\n" +
- " ^\n" +
- "Team Team182par1_1 must be declared abstract, because abstract role R is relevant (OTJLD 2.5(b)).\n" +
+ "----------\n" +
+ "1. ERROR in Team182par1_2.java (at line 1)\n" +
+ " public team class Team182par1_2 extends Team182par1_1 {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Team Team182par1_2 must be declared abstract, because abstract role R is relevant (OTJLD 2.5(b)).\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in Team182par1_1.java (at line 2)\n" +
+ " protected abstract class R playedBy T182par1 {}\n" +
+ " ^\n" +
+ "Team Team182par1_1 must be declared abstract, because abstract role R is relevant (OTJLD 2.5(b)).\n" +
"----------\n",
null, // classLibraries
true, // shouldFlushOutputDirectory
@@ -180,11 +180,11 @@ public class RelevantRole extends AbstractOTJLDTest {
"public team class Team182par1_2 extends Team182par1_1 {\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in Team182par1_2.java (at line 1)\n" +
- " public team class Team182par1_2 extends Team182par1_1 {\n" +
- " ^^^^^^^^^^^^^\n" +
- "Team Team182par1_2 must be declared abstract, because abstract role R is relevant (OTJLD 2.5(b)).\n" +
+ "----------\n" +
+ "1. ERROR in Team182par1_2.java (at line 1)\n" +
+ " public team class Team182par1_2 extends Team182par1_1 {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Team Team182par1_2 must be declared abstract, because abstract role R is relevant (OTJLD 2.5(b)).\n" +
"----------\n",
null, // classLibraries
false, // shouldFlushOutputDirectory
@@ -196,7 +196,7 @@ public class RelevantRole extends AbstractOTJLDTest {
true // performStatementsRecovery
);
}
-
+
// an abstract potentially relevant role is inherited as a phantom
// Bug 336420 - [compiler] NPE during reporting "abstract relevant role"
public void test182_phantomAbstractRole2() {
@@ -212,17 +212,17 @@ public class RelevantRole extends AbstractOTJLDTest {
"T182par2.java",
"public abstract class T182par2 {}"
},
- "----------\n" +
- "1. WARNING in Team182par2_2.java (at line 1)\n" +
- " public team class Team182par2_2 extends Team182par2_1 {\n" +
- " ^^^^^^^^^^^^^\n" +
- "[@sup:abstractrelevantrole] Team Team182par2_2 may need to be declared abstract, because irrelevance for abstract role R could not be shown (OTJLD 2.5(b)).\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in Team182par2_1.java (at line 2)\n" +
- " protected abstract class R playedBy T182par2 {}\n" +
- " ^\n" +
- "[@sup:abstractrelevantrole] Team Team182par2_1 may need to be declared abstract, because irrelevance for abstract role R could not be shown (OTJLD 2.5(b)).\n" +
+ "----------\n" +
+ "1. WARNING in Team182par2_2.java (at line 1)\n" +
+ " public team class Team182par2_2 extends Team182par2_1 {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "[@sup:abstractrelevantrole] Team Team182par2_2 may need to be declared abstract, because irrelevance for abstract role R could not be shown (OTJLD 2.5(b)).\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in Team182par2_1.java (at line 2)\n" +
+ " protected abstract class R playedBy T182par2 {}\n" +
+ " ^\n" +
+ "[@sup:abstractrelevantrole] Team Team182par2_1 may need to be declared abstract, because irrelevance for abstract role R could not be shown (OTJLD 2.5(b)).\n" +
"----------\n",
null, // classLibraries
true, // shouldFlushOutputDirectory
@@ -240,11 +240,11 @@ public class RelevantRole extends AbstractOTJLDTest {
"public team class Team182par2_2 extends Team182par2_1 {\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in Team182par2_2.java (at line 1)\n" +
- " public team class Team182par2_2 extends Team182par2_1 {\n" +
- " ^^^^^^^^^^^^^\n" +
- "[@sup:abstractrelevantrole] Team Team182par2_2 may need to be declared abstract, because irrelevance for abstract role R could not be shown (OTJLD 2.5(b)).\n" +
+ "----------\n" +
+ "1. WARNING in Team182par2_2.java (at line 1)\n" +
+ " public team class Team182par2_2 extends Team182par2_1 {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "[@sup:abstractrelevantrole] Team Team182par2_2 may need to be declared abstract, because irrelevance for abstract role R could not be shown (OTJLD 2.5(b)).\n" +
"----------\n",
null, // classLibraries
false, // shouldFlushOutputDirectory
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/RoleObjectContainment.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/RoleObjectContainment.java
index 8aad2b389..0de566e7e 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/RoleObjectContainment.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/RoleObjectContainment.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -26,14 +26,14 @@ import junit.framework.Test;
/**
* Former jacks tests from section role-object-containment (1.1.*)
- * @author stephan
+ * @author stephan
*/
public class RoleObjectContainment extends AbstractOTJLDTest {
public RoleObjectContainment(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -41,7 +41,7 @@ public class RoleObjectContainment extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -50,7 +50,7 @@ public class RoleObjectContainment extends AbstractOTJLDTest {
return RoleObjectContainment.class;
}
- // 1.1.1-otjld-team-method-invocation-1
+ // 1.1.1-otjld-team-method-invocation-1
// role invokes method of enclosing team using the unqualified name
public void testTeamMethodInvocation1() {
runConformTest(
@@ -81,7 +81,7 @@ public class RoleObjectContainment extends AbstractOTJLDTest {
" }\n" +
" }\n" +
"}",
- },
+ },
"OK");
}
// role invokes method of enclosing team using the unqualified name
@@ -1128,11 +1128,11 @@ public class RoleObjectContainment extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team116qta.java (at line 5)\n" +
- " Team116qta.this = new Team116qta();\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "The left-hand side of an assignment must be a variable\n" +
+ "----------\n" +
+ "1. ERROR in Team116qta.java (at line 5)\n" +
+ " Team116qta.this = new Team116qta();\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "The left-hand side of an assignment must be a variable\n" +
"----------\n");
}
@@ -1284,5 +1284,5 @@ public class RoleObjectContainment extends AbstractOTJLDTest {
" \n"
},
"OTJLD 1.2.1");
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/TeamNesting.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/TeamNesting.java
index 49eb89cda..184393fba 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/TeamNesting.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/TeamNesting.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010, 2013 Stephan Herrmann
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -22,11 +22,11 @@ import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
import junit.framework.Test;
public class TeamNesting extends AbstractOTJLDTest {
-
+
public TeamNesting(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -34,7 +34,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -46,7 +46,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// a role inherits features from all possible super roles within nested teams - one level only
// 1.1.10-otjld-full-inheritance-structure-1
public void test1110_fullInheritanceStructure1() {
-
+
runConformTest(
new String[] {
"T1110fis1.java",
@@ -160,7 +160,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// a role inherits features from all possible super roles within nested teams - one compilation
// 1.1.10-otjld-full-inheritance-structure-2
public void test1110_fullInheritanceStructure2() {
-
+
runConformTest(
new String[] {
"T1110fis2.java",
@@ -318,7 +318,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// a role inherits features from all possible super roles within nested teams - separate compilation
// 1.1.10-otjld-full-inheritance-structure-3
public void test1110_fullInheritanceStructure3() {
-
+
runConformTest(
new String[] {
"T1110fis3.java",
@@ -476,7 +476,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// a role inherits features from all possible super roles within nested teams - more combinations - separate compilation
// 1.1.10-otjld-full-inheritance-structure-4
public void test1110_fullInheritanceStructure4() {
-
+
runConformTest(
new String[] {
"T1110fis4.java",
@@ -598,7 +598,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// a role inherits features from all possible super roles within nested teams - super and tsuper tree (note, that some of these are re-bound, so full tree is not possible.
// 1.1.10-otjld-full-inheritance-structure-5
public void test1110_fullInheritanceStructure5() {
-
+
runConformTest(
new String[] {
"T1110fis5.java",
@@ -687,7 +687,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// use qualified tsuper to achieve order of old tsuper-precedence (pre 0.8M3)
// 1.1.10-otjld-full-inheritance-structure-5
public void test1110_fullInheritanceStructure5a() {
-
+
runConformTest(
new String[] {
"T1110fis5a.java",
@@ -775,7 +775,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// A role inherits callin bindings from several tsuper classes
// 1.1.11-otjld-role-inherits-callin-from-tsupers-1
public void test1111_roleInheritsCallinFromTsupers1() {
-
+
runConformTest(
new String[] {
"Team1111ricft1_2.java",
@@ -836,7 +836,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// A role inherits named callin bindings from several tsuper classes
// 1.1.11-otjld-role-inherits-callin-from-tsupers-2
public void test1111_roleInheritsCallinFromTsupers2() {
-
+
runConformTest(
new String[] {
"Team1111ricft2_2.java",
@@ -897,7 +897,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// a nested team overrides a regular role
// 1.1.12-otjld-team-overrides-regular-1
public void test1112_teamOverridesRegular1() {
-
+
runConformTest(
new String[] {
"Team1112tor1_2.java",
@@ -965,7 +965,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// simple tsuper is used to select the closest version among different tsupers in a nested team
// 1.1.14-otjld-tsuper-in-nested-1
public void test1114_tsuperInNested1() {
-
+
runConformTest(
new String[] {
"Team1114tin1_2.java",
@@ -1024,7 +1024,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// qualified tsuper is used to select the closest version among different tsupers in a nested team
// 1.1.14-otjld-tsuper-in-nested-1a
public void test1114_tsuperInNested1a() {
-
+
runConformTest(
new String[] {
"Team1114tin1a_2.java",
@@ -1083,7 +1083,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// qualified tsuper is used to select a version among different tsupers in a nested team
// 1.1.14-otjld-tsuper-in-nested-2
public void test1114_tsuperInNested2() {
-
+
runConformTest(
new String[] {
"Team1114tin2_2.java",
@@ -1138,7 +1138,7 @@ public class TeamNesting extends AbstractOTJLDTest {
},
"OK");
}
-
+
// Bug 330002 - Wrong linearization of tsuper calls in diamond inheritance
public void _test1114_tsuperInNested3() {
runConformTest(
@@ -1150,59 +1150,59 @@ public class TeamNesting extends AbstractOTJLDTest {
" }\n" +
"}\n",
"Team1114tin3_0.java",
- "public team class Team1114tin3_0 {\n" +
- " protected abstract team class TeamA {\n" +
- " protected abstract class R {\n" +
- " protected void print() { System.out.println(\"topR\"); }\n" +
- " }\n" +
- " public void test() {\n" +
- " System.out.println(\"topT\");\n" +
- " new R().print();\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " protected team class TeamB extends TeamA {\n" +
- " protected class R {\n" +
- " protected void print() {\n" +
- " System.out.println(\"0B\");\n" +
- " tsuper.print();\n" +
- " }\n" +
- " }\n" +
- " public void test() {\n" +
- " System.out.println(\"TeamB\");\n" +
- " super.test();\n" +
- " }\n" +
- " }\n" +
+ "public team class Team1114tin3_0 {\n" +
+ " protected abstract team class TeamA {\n" +
+ " protected abstract class R {\n" +
+ " protected void print() { System.out.println(\"topR\"); }\n" +
+ " }\n" +
+ " public void test() {\n" +
+ " System.out.println(\"topT\");\n" +
+ " new R().print();\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " protected team class TeamB extends TeamA {\n" +
+ " protected class R {\n" +
+ " protected void print() {\n" +
+ " System.out.println(\"0B\");\n" +
+ " tsuper.print();\n" +
+ " }\n" +
+ " }\n" +
+ " public void test() {\n" +
+ " System.out.println(\"TeamB\");\n" +
+ " super.test();\n" +
+ " }\n" +
+ " }\n" +
"}",
"Team1114tin3_1.java",
- "public team class Team1114tin3_1 extends Team1114tin3_0 {\n" +
- " @Override\n" +
- " protected team class TeamA {\n" +
- " @Override\n" +
- " protected class R {\n" +
- " @Override\n" +
- " protected void print() {\n" +
- " System.out.println(\"1A\");\n" +
- " tsuper.print();\n" +
- " }\n" +
- " }\n" +
- " @Override\n" +
- " public void test() {\n" +
- " System.out.println(\"TeamA\");\n" +
- " tsuper.test();\n" +
- " }\n" +
- " }\n" +
- " protected team class TeamB {\n" +
- " protected class R {\n" +
- " protected void print() {\n" +
- " System.out.println(\"bottomB\");\n" +
- " tsuper.print();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " void test() {\n" +
- " new TeamB().test();\n" +
- " }\n" +
+ "public team class Team1114tin3_1 extends Team1114tin3_0 {\n" +
+ " @Override\n" +
+ " protected team class TeamA {\n" +
+ " @Override\n" +
+ " protected class R {\n" +
+ " @Override\n" +
+ " protected void print() {\n" +
+ " System.out.println(\"1A\");\n" +
+ " tsuper.print();\n" +
+ " }\n" +
+ " }\n" +
+ " @Override\n" +
+ " public void test() {\n" +
+ " System.out.println(\"TeamA\");\n" +
+ " tsuper.test();\n" +
+ " }\n" +
+ " }\n" +
+ " protected team class TeamB {\n" +
+ " protected class R {\n" +
+ " protected void print() {\n" +
+ " System.out.println(\"bottomB\");\n" +
+ " tsuper.print();\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " void test() {\n" +
+ " new TeamB().test();\n" +
+ " }\n" +
"}"
},
"TeamB\n" +
@@ -1216,7 +1216,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// a nested team extends a toplevel team, role signature contains role
// 1.1.15-otjld-nested-team-extends-regular-team-1
public void test1115_nestedTeamExtendsRegularTeam1() {
-
+
runConformTest(
new String[] {
"Team1115ntert1.java",
@@ -1255,11 +1255,11 @@ public class TeamNesting extends AbstractOTJLDTest {
},
"OK");
}
-
+
// a nested team extends a toplevel team, role signature contains role, constructor not visible
// 1.1.15-otjld-nested-team-extends-regular-team-1
public void test1115_nestedTeamExtendsRegularTeam1f() {
-
+
runNegativeTest(
new String[] {
"Team1115ntert1f.java",
@@ -1287,16 +1287,16 @@ public class TeamNesting extends AbstractOTJLDTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Team1115ntert1f.java (at line 5)\n" +
- " R r1 = new R(\"O\");\n" +
- " ^^^^^^^^^^\n" +
- "The role constructor Team1115ntert1f.Team1115ntert1f_2.R(String) is not visible (OTJLD 1.2.1(e)).\n" +
- "----------\n" +
- "2. ERROR in Team1115ntert1f.java (at line 6)\n" +
- " R r2 = new R(\"K\");\n" +
- " ^^^^^^^^^^\n" +
- "The role constructor Team1115ntert1f.Team1115ntert1f_2.R(String) is not visible (OTJLD 1.2.1(e)).\n" +
+ "----------\n" +
+ "1. ERROR in Team1115ntert1f.java (at line 5)\n" +
+ " R r1 = new R(\"O\");\n" +
+ " ^^^^^^^^^^\n" +
+ "The role constructor Team1115ntert1f.Team1115ntert1f_2.R(String) is not visible (OTJLD 1.2.1(e)).\n" +
+ "----------\n" +
+ "2. ERROR in Team1115ntert1f.java (at line 6)\n" +
+ " R r2 = new R(\"K\");\n" +
+ " ^^^^^^^^^^\n" +
+ "The role constructor Team1115ntert1f.Team1115ntert1f_2.R(String) is not visible (OTJLD 1.2.1(e)).\n" +
"----------\n");
}
@@ -1516,90 +1516,90 @@ public class TeamNesting extends AbstractOTJLDTest {
runNegativeTest(
new String[] {
"n1118/Team1118roe2_2.java",
- "package n1118;\n" +
- "public team class Team1118roe2_2 extends Team1118roe2_1 {\n" +
+ "package n1118;\n" +
+ "public team class Team1118roe2_2 extends Team1118roe2_1 {\n" +
" @Override\n"+
- " public team class TB1 {\n" +
+ " public team class TB1 {\n" +
" @Override\n"+
- " public team class TC1 {\n" +
+ " public team class TC1 {\n" +
" @Override\n"+
- " public class R1 {}\n" +
- " }\n" +
+ " public class R1 {}\n" +
+ " }\n" +
" @Override\n"+
- " public team class TC2 extends TC1 {\n" +
+ " public team class TC2 extends TC1 {\n" +
" @Override\n"+
- " public class R1 extends C2 {}\n" +
- " }\n" +
- " }\n" +
+ " public class R1 extends C2 {}\n" +
+ " }\n" +
+ " }\n" +
" @Override\n"+
- " public team class TB2 extends TB1 {\n" +
+ " public team class TB2 extends TB1 {\n" +
" @Override\n"+
- " public team class TC1 {\n" +
+ " public team class TC1 {\n" +
" @Override\n"+
- " public class R1 extends C1 {}\n" +
- " }\n" +
+ " public class R1 extends C1 {}\n" +
+ " }\n" +
" @Override\n"+
- " public team class TC2 {\n" +
+ " public team class TC2 {\n" +
" @Override\n"+
- " public class R1 {}\n" +
- " }\n" +
- " }\n" +
+ " public class R1 {}\n" +
+ " }\n" +
+ " }\n" +
"}",
"n1118/Team1118roe2_1.java",
- "package n1118;\n" +
- "public team class Team1118roe2_1 {\n" +
- " public team class TB1 {\n" +
- " public team class TC1 {\n" +
- " public class R1 {}\n" +
- " }\n" +
- " public team class TC2 extends TC1 {\n" +
+ "package n1118;\n" +
+ "public team class Team1118roe2_1 {\n" +
+ " public team class TB1 {\n" +
+ " public team class TC1 {\n" +
+ " public class R1 {}\n" +
+ " }\n" +
+ " public team class TC2 extends TC1 {\n" +
" @Override\n"+
- " public class R1 {}\n" +
- " }\n" +
- " }\n" +
- " public team class TB2 extends TB1 {\n" +
+ " public class R1 {}\n" +
+ " }\n" +
+ " }\n" +
+ " public team class TB2 extends TB1 {\n" +
" @Override\n"+
- " public team class TC1 {\n" +
+ " public team class TC1 {\n" +
" @Override\n"+
- " public class R1 {}\n" +
- " }\n" +
+ " public class R1 {}\n" +
+ " }\n" +
" @Override\n"+
- " public team class TC2 {\n" +
+ " public team class TC2 {\n" +
" @Override\n"+
- " public class R1 extends C3 {}\n" +
- " }\n" +
- " }\n" +
+ " public class R1 extends C3 {}\n" +
+ " }\n" +
+ " }\n" +
"}",
"n1118/C0.java",
- "package n1118;\n" +
+ "package n1118;\n" +
"public class C0 {}\n",
"n1118/C1.java",
- "package n1118;\n" +
+ "package n1118;\n" +
"public class C1 extends C0 {}\n",
"n1118/C2.java",
- "package n1118;\n" +
+ "package n1118;\n" +
"public class C2 extends C0 {}\n",
"n1118/C3.java",
- "package n1118;\n" +
+ "package n1118;\n" +
"public class C3 extends C0 {}\n",
},
- "----------\n" +
- "1. ERROR in n1118\\Team1118roe2_2.java (at line 26)\n" +
- " public class R1 {}\n" +
- " ^^\n" +
- "Role inherits incompatible \'extends\' declarations: C1 is not a sub-type of C2 (\'extends C2\' is inherited is from n1118.Team1118roe2_2.TB1.TC2.R1) (OTJLD 1.3.2(b)).\n" +
- "----------\n" +
- "2. ERROR in n1118\\Team1118roe2_2.java (at line 26)\n" +
- " public class R1 {}\n" +
- " ^^\n" +
- "Role inherits incompatible \'extends\' declarations: C1 is not a sub-type of C3 (\'extends C3\' is inherited is from n1118.Team1118roe2_1.TB2.TC2.R1) (OTJLD 1.3.2(b)).\n" +
+ "----------\n" +
+ "1. ERROR in n1118\\Team1118roe2_2.java (at line 26)\n" +
+ " public class R1 {}\n" +
+ " ^^\n" +
+ "Role inherits incompatible \'extends\' declarations: C1 is not a sub-type of C2 (\'extends C2\' is inherited is from n1118.Team1118roe2_2.TB1.TC2.R1) (OTJLD 1.3.2(b)).\n" +
+ "----------\n" +
+ "2. ERROR in n1118\\Team1118roe2_2.java (at line 26)\n" +
+ " public class R1 {}\n" +
+ " ^^\n" +
+ "Role inherits incompatible \'extends\' declarations: C1 is not a sub-type of C3 (\'extends C3\' is inherited is from n1118.Team1118roe2_1.TB2.TC2.R1) (OTJLD 1.3.2(b)).\n" +
"----------\n");
}
// some roles are missing in the lattice of tsuper types
// 1.1.19-otjld-incomplete-tsuper-structure-1
public void test1119_incompleteTsuperStructure1() {
-
+
runConformTest(
new String[] {
"Team1119its1_2.java",
@@ -1650,7 +1650,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// some roles are missing in the lattice of tsuper types
// 1.1.19-otjld-incomplete-tsuper-structure-2
public void test1119_incompleteTsuperStructure2() {
-
+
runConformTest(
new String[] {
"Team1119its2_2.java",
@@ -1730,7 +1730,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// using tsuper in a setting of diamond inheritance
// 1.1.21-otjld-diamond-inheritance-1
public void test1121_diamondInheritance1() {
-
+
runConformTest(
new String[] {
"Team1121di1_2.java",
@@ -1794,18 +1794,18 @@ public class TeamNesting extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team1121di1f_2.java (at line 7)\n" +
- " tsuper.test();\n" +
- " ^^^^\n" +
- "Indirect tsuper method inherited from Team1121di1f_1.R1 is not visible (OTJLD 1.2.1(e)).\n" +
+ "----------\n" +
+ "1. ERROR in Team1121di1f_2.java (at line 7)\n" +
+ " tsuper.test();\n" +
+ " ^^^^\n" +
+ "Indirect tsuper method inherited from Team1121di1f_1.R1 is not visible (OTJLD 1.2.1(e)).\n" +
"----------\n");
}
// using tsuper in a setting of diamond inheritance - role R1 reused from byte code
// 1.1.21-otjld-diamond-inheritance-2
public void test1121_diamondInheritance2() {
-
+
runConformTest(
new String[] {
"Team1121di2_2.java",
@@ -1842,7 +1842,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// callin arg anchored to "base", problem(s) observed in ordertesting.OrderCustomerSC
// 1.1.22-otjld-layered-teams-1
public void test1122_layeredTeams1() {
-
+
runConformTest(
new String[] {
"Team1122lt1_3.java",
@@ -1907,7 +1907,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// a role references a role which the lower team inherits from its super
// 1.1.22-otjld-layered-teams-2
public void test1122_layeredTeams2() {
-
+
runConformTest(
new String[] {
"Team1122lt2_3.java",
@@ -1952,7 +1952,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// a role references a role which the lower team inherits from its super - signature defined in super team
// 1.1.22-otjld-layered-teams-3
public void test1122_layeredTeams3() {
-
+
runConformTest(
new String[] {
"Team1122lt3_3.java",
@@ -1997,7 +1997,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// callin requires lifting of non-public role to role-of-role
// 1.1.22-otjld-layered-teams-4
public void test1122_layeredTeams4() {
-
+
runConformTest(
new String[] {
"Team1122lt4_2.java",
@@ -2041,7 +2041,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// callin requires lifting of non-public role to role-of-role - declared lifting at base
// 1.1.22-otjld-layered-teams-5
public void test1122_layeredTeams5() {
-
+
runConformTest(
new String[] {
"l2/Team1122lt5_3.java",
@@ -2112,7 +2112,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// callin requires lifting of non-public role to role-of-role - base method spec requires role strengthening for parameter
// 1.1.22-otjld-layered-teams-6
public void test1122_layeredTeams6() {
-
+
runConformTest(
new String[] {
"Team1122lt6_3.java",
@@ -2202,14 +2202,14 @@ public class TeamNesting extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team1122lt7_2.java (at line 12)\n" +
- " void testMid(RInner r) <- before void test(R<@base> r);\n" +
- " ^\n" +
- "Method specifier finds no direct match, argument of closest match is T1122lt7 instead of R<@base> (OTJLD 4.1(c)).\n" +
+ "----------\n" +
+ "1. ERROR in Team1122lt7_2.java (at line 12)\n" +
+ " void testMid(RInner r) <- before void test(R<@base> r);\n" +
+ " ^\n" +
+ "Method specifier finds no direct match, argument of closest match is T1122lt7 instead of R<@base> (OTJLD 4.1(c)).\n" +
"----------\n");
}
-
+
// callout to private method of lower role caused "Cannot externalize non-public role R1 (OTJLD 1.2.2(a))"
// plus 2 follow-up errors.
public void test1122_layeredTeams8() {
@@ -2250,7 +2250,7 @@ public class TeamNesting extends AbstractOTJLDTest {
" new R1().callTest();\n" +
" }\n" +
"}\n"
- },
+ },
"OK");
}
@@ -2261,17 +2261,17 @@ public class TeamNesting extends AbstractOTJLDTest {
"Team1122lt9_2.java",
"\n" +
"public team class Team1122lt9_2 {\n" +
- " public team class T1 {\n" +
- " protected final Team1122lt9_1 thatTeam = new Team1122lt9_1();\n" +
+ " public team class T1 {\n" +
+ " protected final Team1122lt9_1 thatTeam = new Team1122lt9_1();\n" +
" protected class R playedBy R1<@thatTeam> {" +
" @SuppressWarnings(\"basecall\")\n" +
" callin String fixedToString() {\n" +
" return \"OK\";\n" +
" }\n" +
- " }\n" +
+ " }\n" +
" }\n" +
" public team class T2 extends T1 {\n" +
- " @Override protected class R {\n" +
+ " @Override protected class R {\n" +
" String fixedToString() <- replace String toString();\n" +
" }\n" +
" }\n" +
@@ -2304,7 +2304,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// a nested team is played by a regular class, its (inner) role by an inner of the base - (we had a problem with splitting creation methods in conjunction with base class decapsulation )
// 1.1.23-otjld-team-layered-on-regular-nested-1
public void test1123_teamLayeredOnRegularNested1() {
-
+
runConformTest(
new String[] {
"Team1123tlorn1.java",
@@ -2408,7 +2408,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// a nested team is played by a regular class, its (inner) role by an inner of the base - base constructor needs explicit enclosing instance
// 1.1.23-otjld-team-layered-on-regular-nested-3
public void test1123_teamLayeredOnRegularNested3() {
-
+
runConformTest(
new String[] {
"Team1123tlorn3.java",
@@ -2461,7 +2461,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// a reflective method is used on a nested team
// 1.1.24-otjld-generated-method-of-nested-team-1
public void test1124_generatedMethodOfNestedTeam1() {
-
+
runConformTest(
new String[] {
"p2/T1124gmont1Main.java",
@@ -2495,7 +2495,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// a creator method is invoked on an externalized nested team
// 1.1.24-otjld-generated-method-of-nested-team-2
public void test1124_generatedMethodOfNestedTeam2() {
-
+
runConformTest(
new String[] {
"p2/T1124gmont2Main.java",
@@ -2527,7 +2527,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// a cast method is used for a nested role
// 1.1.24-otjld-generated-method-of-nested-team-3
public void test1124_generatedMethodOfNestedTeam3() {
-
+
runConformTest(
new String[] {
"Team1124gmont3.java",
@@ -2561,7 +2561,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// a nested role accesses its outer-outer team
// 1.1.25-otjld-outer-access-in-nested-team-1
public void test1125_outerAccessInNestedTeam1() {
-
+
runConformTest(
new String[] {
"Team1125oaint1.java",
@@ -2590,7 +2590,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// a nested role accesses its outer-outer team - team inheritance
// 1.1.25-otjld-outer-access-in-nested-team-2
public void test1125_outerAccessInNestedTeam2() {
-
+
runConformTest(
new String[] {
"Team1125oaint2_2.java",
@@ -2624,7 +2624,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// a nested role accesses its outer-outer team - team inheritance
// 1.1.25-otjld-outer-access-in-nested-team-3
public void test1125_outerAccessInNestedTeam3() {
-
+
runConformTest(
new String[] {
"Team1125oaint3_2.java",
@@ -2660,7 +2660,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// a nested role accesses a static method of the intermediate enclosing team/role
// 1.1.25-otjld-outer-access-in-nested-team-4
public void test1125_outerAccessInNestedTeam4() {
-
+
runConformTest(
new String[] {
"Team1125oaint4.java",
@@ -2694,7 +2694,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// nested teams adapt a lower team - with method decapsulation
// 1.1.26-otjld-nesting-and-layering-1
public void test1126_nestingAndLayering1() {
-
+
runConformTest(
new String[] {
"Team1126nal1_2.java",
@@ -2739,7 +2739,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// nested teams with implicit inheritance adapt a hierarchy of lower teams - with method decapsulation
// 1.1.26-otjld-nesting-and-layering-2
public void test1126_nestingAndLayering2() {
-
+
runConformTest(
new String[] {
"Team1126nal2_3.java",
@@ -2791,7 +2791,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// nested teams with implicit inheritance adapt a hierarchy of lower teams - with private method decapsulation
// 1.1.26-otjld-nesting-and-layering-3p
public void test1126_nestingAndLayering3p() {
-
+
runConformTest(
new String[] {
"Team1126nal3p_3.java",
@@ -2845,7 +2845,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// nested teams with implicit inheritance adapt a hierarchy of lower teams - with private method decapsulation - double compile re-using binary role
// 1.1.26-otjld-nesting-and-layering-3p2
public void test1126_nestingAndLayering3p2() {
-
+
runConformTest(
new String[] {
"Team1126nal3p2_3.java",
@@ -2953,7 +2953,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// nested teams with implicit inheritance adapt a hierarchy of lower teams - method is protected
// 1.1.26-otjld-nesting-and-layering-3
public void test1126_nestingAndLayering3() {
-
+
runConformTest(
new String[] {
"p2/Team1126nal3_3.java",
@@ -3017,7 +3017,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// nested teams with implicit inheritance adapt a hierarchy of lower teams - method is protected - incremenatl (i.e., double) build
// 1.1.26-otjld-nesting-and-layering-3i
public void test1126_nestingAndLayering3i() {
-
+
runConformTest(
new String[] {
"p2/Team1126nal3i_3.java",
@@ -3081,7 +3081,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// nested teams with implicit inheritance adapt a hierarchy of lower teams
// 1.1.26-otjld-nesting-and-layering-4
public void test1126_nestingAndLayering4() {
-
+
runConformTest(
new String[] {
"Team1126nal4_3.java",
@@ -3139,7 +3139,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// nested teams with implicit inheritance adapt a hierarchy of lower team -- callout to role field
// 1.1.26-otjld_nesting-and-layering-4f
public void _nesting_test1126_andLayering4f() {
-
+
runConformTest(
new String[] {
"Team1126nal4f_3.java",
@@ -3196,7 +3196,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// nested teams with implicit inheritance adapt a hierarchy of lower teams - callout to private role field
// 1.1.26-otjld-nesting-and-layering-4pf
public void test1126_nestingAndLayering4pf() {
-
+
runConformTest(
new String[] {
"Team1126nal4pf_3.java",
@@ -3256,7 +3256,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// two-level base anchored types
// 1.1.26-otjld-nesting-and-layering-5
public void test1126_nestingAndLayering5() {
-
+
runConformTest(
new String[] {
"Team1126nal5_2.java",
@@ -3312,7 +3312,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// the ctor of a nested team assigns a final field - reported by kmeier on 06/10/21
// 1.1.27-otjld-constructor-of-nested-team-1
public void test1127_constructorOfNestedTeam1() {
-
+
runConformTest(
new String[] {
"Team1127cont1.java",
@@ -3354,7 +3354,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// the ctor of a role in a nested team is duplicated during implicit inheritance (phantom type) - reported by Robin Sedlaczek
// 1.1.27-otjld-constructor-of-nested-team-2
public void test1127_constructorOfNestedTeam2() {
-
+
runConformTest(
new String[] {
"Team1127cont2_2.java",
@@ -3420,7 +3420,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// a callin in a nested role mentions the base class of another toplevel role
// 1.1.29-otjld-nested-callin-1
public void test1129_nestedCallin1() {
-
+
runConformTest(
new String[] {
"T1129nc1Main.java",
@@ -3479,7 +3479,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// a callin in a nested role mentions the base class of another toplevel role - array type - witness for NPE in CallinImplementor
// 1.1.29-otjld-nested-callin-2
public void test1129_nestedCallin2() {
-
+
runConformTest(
new String[] {
"T1129nc2Main.java",
@@ -3539,7 +3539,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// a callin mentions a nested role in its signature - binding without signatures
// 1.1.29-otjld-nested-callin-3
public void test1129_nestedCallin3() {
-
+
runConformTest(
new String[] {
"Team1129nc3.java",
@@ -3583,7 +3583,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// a callin mentions a nested role in its signature - binding with signatures
// 1.1.29-otjld-nested-callin-4
public void test1129_nestedCallin4() {
-
+
runConformTest(
new String[] {
"Team1129nc4.java",
@@ -3628,7 +3628,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// a third-level role has a callin
// 1.1.30-otjld-deeply-nested-team-1
public void test1130_deeplyNestedTeam1() {
-
+
runConformTest(
new String[] {
"Team1130dnt1.java",
@@ -3678,7 +3678,7 @@ public class TeamNesting extends AbstractOTJLDTest {
// role refers to base of sibling role - witness for NPE in TeamAnchor.getStrengthenedRole() resp. AssertionError in RTB.<init>
// 1.1.31-otjld-stacked-teams-1
public void test1131_stackedTeams1() {
-
+
runConformTest(
new String[] {
"Team1131lt1_2.java",
@@ -3784,25 +3784,25 @@ public class TeamNesting extends AbstractOTJLDTest {
"}\n"
});
}
-
+
public void testBug411450() {
runConformTest(
new String[] {
"T0.java",
- "public team class T0 {\n" +
- " final Inner inner = new Inner();\n" +
- " \n" +
- " public team class Inner {\n" +
- " protected class R {}\n" +
- " }\n" +
+ "public team class T0 {\n" +
+ " final Inner inner = new Inner();\n" +
+ " \n" +
+ " public team class Inner {\n" +
+ " protected class R {}\n" +
+ " }\n" +
"}",
"T1.java",
- "public team class T1 {\n" +
- " final T0 other = new T0();\n" +
- " \n" +
- " protected class R1 playedBy R<@other.inner> {\n" +
- " \n" +
- " }\n" +
+ "public team class T1 {\n" +
+ " final T0 other = new T0();\n" +
+ " \n" +
+ " protected class R1 playedBy R<@other.inner> {\n" +
+ " \n" +
+ " }\n" +
"}"
});
}
@@ -3830,11 +3830,11 @@ public class TeamNesting extends AbstractOTJLDTest {
" public boolean pred() { return true; }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in T2.java (at line 2)\n" +
- " protected class R extends T11 playedBy B2 {\n" +
- " ^^^\n" +
- "Illegal \'extends\' for a regular class: superclass T1.T11 is a team (OTJLD 1.3).\n" +
+ "----------\n" +
+ "1. ERROR in T2.java (at line 2)\n" +
+ " protected class R extends T11 playedBy B2 {\n" +
+ " ^^^\n" +
+ "Illegal \'extends\' for a regular class: superclass T1.T11 is a team (OTJLD 1.3).\n" +
"----------\n");
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/ValueParameters.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/ValueParameters.java
index 800b46446..b98fa0c0d 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/ValueParameters.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/ValueParameters.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010 Stephan Herrmann
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -27,11 +27,11 @@ import junit.framework.Test;
@SuppressWarnings("unchecked")
public class ValueParameters extends AbstractOTJLDTest {
-
+
public ValueParameters(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -39,7 +39,7 @@ public class ValueParameters extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -170,7 +170,7 @@ public class ValueParameters extends AbstractOTJLDTest {
// a regular class has a value parameter - compile in one pass
// 1.9.2-otjld-regular-class-with-value-parameter-1
public void test192_regularClassWithValueParameter1() {
-
+
runConformTest(
new String[] {
"T192rcwvp1Main.java",
@@ -200,7 +200,7 @@ public class ValueParameters extends AbstractOTJLDTest {
// a regular class has a value parameter - compile in separately
// 1.9.2-otjld-regular-class-with-value-parameter-2
public void test192_regularClassWithValueParameter2() {
-
+
runConformTest(
new String[] {
"T192rcwvp2Main.java",
@@ -331,7 +331,7 @@ public class ValueParameters extends AbstractOTJLDTest {
// using "base" in a type anchor
// 1.9.6-otjld-base-anchored-type-1
public void test196_baseAnchoredType1() {
-
+
runConformTest(
new String[] {
"Team196bat1_2.java",
@@ -412,7 +412,7 @@ public class ValueParameters extends AbstractOTJLDTest {
// using "base" in a type anchor
// 1.9.6-otjld-base-anchored-type-3
public void test196_baseAnchoredType3() {
-
+
runConformTest(
new String[] {
"Team196bat3_2.java",
@@ -464,7 +464,7 @@ public class ValueParameters extends AbstractOTJLDTest {
// using "base" in a type anchor (callout-return), nested generics
// 1.9.6-otjld-base-anchored-type-4
public void test196_baseAnchoredType4() {
-
+
runConformTest(
new String[] {
"Team196bat4_2.java",
@@ -521,7 +521,7 @@ public class ValueParameters extends AbstractOTJLDTest {
// using "base" in a type anchor (callout-to-field-return), nested generics
// 1.9.6-otjld-base-anchored-type-4f
public void test196_baseAnchoredType4f() {
-
+
runConformTest(
new String[] {
"Team196bat4f_2.java",
@@ -582,7 +582,7 @@ public class ValueParameters extends AbstractOTJLDTest {
// using "base" in a type anchor (callin-return), array
// 1.9.6-otjld-base-anchored-type-5
public void test196_baseAnchoredType5() {
-
+
runConformTest(
new String[] {
"Team196bat5_2.java",
@@ -639,7 +639,7 @@ public class ValueParameters extends AbstractOTJLDTest {
// a role type is explicitly anchored to 'this' (OTJLD(1.2.2(d))
// 1.9.7-otjld-special-anchors-1
public void test197_specialAnchors1() {
-
+
runConformTest(
new String[] {
"Team197sa1.java",
@@ -722,7 +722,7 @@ public class ValueParameters extends AbstractOTJLDTest {
// a team has a value parameter - parameter used as value
// 1.9.9-otjld-parameterized-team-1
public void test199_parameterizedTeam1() {
-
+
runConformTest(
new String[] {
"T199pt1Main.java",
@@ -758,7 +758,7 @@ public class ValueParameters extends AbstractOTJLDTest {
// a team has a value parameter - parameter used as anchor for field type
// 1.9.9-otjld-parameterized-team-2
public void test199_parameterizedTeam2() {
-
+
runConformTest(
new String[] {
"T199pt2Main.java",
@@ -804,7 +804,7 @@ public class ValueParameters extends AbstractOTJLDTest {
// a team has a value parameter - parameter used as anchor for base-role
// 1.9.9-otjld-parameterized-team-3
public void test199_parameterizedTeam3() {
-
+
runConformTest(
new String[] {
"T199pt3Main.java",
@@ -852,7 +852,7 @@ public class ValueParameters extends AbstractOTJLDTest {
// a team has a value parameter - parameter used as anchor for base-role - uses decapsulation
// 1.9.9-otjld-parameterized-team-3d
public void test199_parameterizedTeam3d() {
-
+
runConformTest(
new String[] {
"T199pt3dMain.java",
@@ -901,7 +901,7 @@ public class ValueParameters extends AbstractOTJLDTest {
// a team has a value parameter - nesting involved
// 1.9.9-otjld-parameterized-team-4
public void test199_parameterizedTeam4() {
-
+
runConformTest(
new String[] {
"T199pt4Main.java",
@@ -997,11 +997,11 @@ public class ValueParameters extends AbstractOTJLDTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Team199pt4f_2.java (at line 10)\n" +
- " wrongPrint();\n" +
- " ^^^^^^^^^^\n" +
- "The method wrongPrint() is undefined for the type Team199pt4f_2<@other>.Mid.RInner\n" +
+ "----------\n" +
+ "1. ERROR in Team199pt4f_2.java (at line 10)\n" +
+ " wrongPrint();\n" +
+ " ^^^^^^^^^^\n" +
+ "The method wrongPrint() is undefined for the type Team199pt4f_2<@other>.Mid.RInner\n" +
"----------\n");
}
@@ -1048,23 +1048,23 @@ public class ValueParameters extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team199pt4ff_2.java (at line 7)\n" +
- " protected class RInner playedBy RMid {\n" +
- " ^^^^^^\n" +
- "Member types not allowed in regular roles. Mark class Team199pt4ff_2.Mid as a team if RInner should be its role (OTJLD 1.5(a,b)). \n" +
- "----------\n" +
- "2. ERROR in Team199pt4ff_2.java (at line 10)\n" +
- " wrongPrint();\n" +
- " ^^^^^^^^^^\n" +
- "The method wrongPrint() is undefined for the type Team199pt4ff_2<@other>.Mid.RInner\n" +
+ "----------\n" +
+ "1. ERROR in Team199pt4ff_2.java (at line 7)\n" +
+ " protected class RInner playedBy RMid {\n" +
+ " ^^^^^^\n" +
+ "Member types not allowed in regular roles. Mark class Team199pt4ff_2.Mid as a team if RInner should be its role (OTJLD 1.5(a,b)). \n" +
+ "----------\n" +
+ "2. ERROR in Team199pt4ff_2.java (at line 10)\n" +
+ " wrongPrint();\n" +
+ " ^^^^^^^^^^\n" +
+ "The method wrongPrint() is undefined for the type Team199pt4ff_2<@other>.Mid.RInner\n" +
"----------\n");
}
// a type depends on an enum instance, ctor has explicit arg, too
// 1.9.10-otjld-dependent-type-1
public void test1910_dependentType1() {
-
+
runConformTest(
new String[] {
"T1910dt1Main.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/syntax/Syntax.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/syntax/Syntax.java
index b03150310..bdcb1296e 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/syntax/Syntax.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/syntax/Syntax.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -25,11 +25,11 @@ import org.eclipse.jdt.core.tests.util.Util;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class Syntax extends AbstractOTJLDTest {
-
+
public Syntax(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -37,7 +37,7 @@ public class Syntax extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -553,11 +553,11 @@ public class Syntax extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team861pis1.java (at line 7)\n" +
- " this -> other;\n" +
- " ^\n" +
- "Syntax error on token \";\", , expected\n" +
+ "----------\n" +
+ "1. ERROR in Team861pis1.java (at line 7)\n" +
+ " this -> other;\n" +
+ " ^\n" +
+ "Syntax error on token \";\", , expected\n" +
"----------\n");
}
@@ -688,18 +688,18 @@ public class Syntax extends AbstractOTJLDTest {
"public class T871buid4 {}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team871buid4.java (at line 5)\n" +
- " i;\n" +
- " ^\n" +
- "Syntax error, insert \"Identifier (\" to complete MethodHeaderName\n" +
+ "----------\n" +
+ "1. ERROR in Team871buid4.java (at line 5)\n" +
+ " i;\n" +
+ " ^\n" +
+ "Syntax error, insert \"Identifier (\" to complete MethodHeaderName\n" +
"----------\n");
}
// a "base" package is imported regularly from a team
// 8.7.1-otjld-base-used-in-declaration-5
public void test871_baseUsedInDeclaration5() {
-
+
runConformTest(
new String[] {
"Team871buid5.java",
@@ -727,7 +727,7 @@ public class Syntax extends AbstractOTJLDTest {
// a "base" package is imported regularly from a role file
// 8.7.1-otjld-base-used-in-declaration-6
public void test871_baseUsedInDeclaration6() {
-
+
runConformTest(
new String[] {
"Team871buid6.java",
@@ -827,11 +827,11 @@ public class Syntax extends AbstractOTJLDTest {
"} \n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team881br1.java (at line 39)\n" +
- " public class R3 played // { lbrace is assumed by the parser\n" +
- " ^^^^^^\n" +
- "Syntax error on token \"played\", { expected\n" +
+ "----------\n" +
+ "1. ERROR in Team881br1.java (at line 39)\n" +
+ " public class R3 played // { lbrace is assumed by the parser\n" +
+ " ^^^^^^\n" +
+ "Syntax error on token \"played\", { expected\n" +
"----------\n");
}
@@ -859,41 +859,41 @@ public class Syntax extends AbstractOTJLDTest {
"} \n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team881br2.java (at line 6)\n" +
- " with { result <- result.intValue() };\n" +
- " ^\n" +
- "Syntax error on token \";\", & expected before this token\n" +
- "----------\n" +
- "2. ERROR in Team881br2.java (at line 6)\n" +
- " with { result <- result.intValue() };\n" +
- " ^\n" +
- "Syntax error on token \".\", delete this token\n" +
- "----------\n" +
- "3. ERROR in Team881br2.java (at line 6)\n" +
- " with { result <- result.intValue() };\n" +
- " ^\n" +
- "Syntax error on token \")\", { expected after this token\n" +
- "----------\n" +
- "4. ERROR in Team881br2.java (at line 8)\n" +
- " abstract int wrong(noTypeGiven);\n" +
- " ^^^^^^\n" +
- "Abstract methods do not specify a body\n" +
- "----------\n" +
- "5. ERROR in Team881br2.java (at line 8)\n" +
- " abstract int wrong(noTypeGiven);\n" +
- " ^^^^^^^^^^^\n" +
- "Syntax error, insert \"... VariableDeclaratorId\" to complete FormalParameterList\n" +
- "----------\n" +
- "6. ERROR in Team881br2.java (at line 9)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error on token \"}\", delete this token\n" +
- "----------\n" +
- "7. ERROR in Team881br2.java (at line 10)\n" +
- " } \n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete ClassBody\n" +
+ "----------\n" +
+ "1. ERROR in Team881br2.java (at line 6)\n" +
+ " with { result <- result.intValue() };\n" +
+ " ^\n" +
+ "Syntax error on token \";\", & expected before this token\n" +
+ "----------\n" +
+ "2. ERROR in Team881br2.java (at line 6)\n" +
+ " with { result <- result.intValue() };\n" +
+ " ^\n" +
+ "Syntax error on token \".\", delete this token\n" +
+ "----------\n" +
+ "3. ERROR in Team881br2.java (at line 6)\n" +
+ " with { result <- result.intValue() };\n" +
+ " ^\n" +
+ "Syntax error on token \")\", { expected after this token\n" +
+ "----------\n" +
+ "4. ERROR in Team881br2.java (at line 8)\n" +
+ " abstract int wrong(noTypeGiven);\n" +
+ " ^^^^^^\n" +
+ "Abstract methods do not specify a body\n" +
+ "----------\n" +
+ "5. ERROR in Team881br2.java (at line 8)\n" +
+ " abstract int wrong(noTypeGiven);\n" +
+ " ^^^^^^^^^^^\n" +
+ "Syntax error, insert \"... VariableDeclaratorId\" to complete FormalParameterList\n" +
+ "----------\n" +
+ "6. ERROR in Team881br2.java (at line 9)\n" +
+ " }\n" +
+ " ^\n" +
+ "Syntax error on token \"}\", delete this token\n" +
+ "----------\n" +
+ "7. ERROR in Team881br2.java (at line 10)\n" +
+ " } \n" +
+ " ^\n" +
+ "Syntax error, insert \"}\" to complete ClassBody\n" +
"----------\n");
}
@@ -927,47 +927,47 @@ public class Syntax extends AbstractOTJLDTest {
"} \n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team881br3.java (at line 7)\n" +
- " with { result <- result.intValue() };\n" +
- " ^\n" +
- "Syntax error on token \";\", & expected before this token\n" +
- "----------\n" +
- "2. ERROR in Team881br3.java (at line 7)\n" +
- " with { result <- result.intValue() };\n" +
- " ^\n" +
- "Syntax error on token \".\", delete this token\n" +
- "----------\n" +
- "3. ERROR in Team881br3.java (at line 7)\n" +
- " with { result <- result.intValue() };\n" +
- " ^\n" +
- "Syntax error on token \")\", { expected after this token\n" +
- "----------\n" +
- "4. ERROR in Team881br3.java (at line 11)\n" +
- " result -> result\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
- "----------\n" +
- "5. ERROR in Team881br3.java (at line 14)\n" +
- " abstract int wrong(noTypeGiven);\n" +
- " ^^^^^^\n" +
- "Abstract methods do not specify a body\n" +
- "----------\n" +
- "6. ERROR in Team881br3.java (at line 14)\n" +
- " abstract int wrong(noTypeGiven);\n" +
- " ^^^^^^^^^^^\n" +
- "Syntax error, insert \"... VariableDeclaratorId\" to complete FormalParameterList\n" +
- "----------\n" +
- "7. ERROR in Team881br3.java (at line 15)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error on token \"}\", delete this token\n" +
- "----------\n" +
- "8. ERROR in Team881br3.java (at line 16)\n" +
- " } \n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete ClassBody\n" +
+ "----------\n" +
+ "1. ERROR in Team881br3.java (at line 7)\n" +
+ " with { result <- result.intValue() };\n" +
+ " ^\n" +
+ "Syntax error on token \";\", & expected before this token\n" +
+ "----------\n" +
+ "2. ERROR in Team881br3.java (at line 7)\n" +
+ " with { result <- result.intValue() };\n" +
+ " ^\n" +
+ "Syntax error on token \".\", delete this token\n" +
+ "----------\n" +
+ "3. ERROR in Team881br3.java (at line 7)\n" +
+ " with { result <- result.intValue() };\n" +
+ " ^\n" +
+ "Syntax error on token \")\", { expected after this token\n" +
+ "----------\n" +
+ "4. ERROR in Team881br3.java (at line 11)\n" +
+ " result -> result\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error on tokens, delete these tokens\n" +
+ "----------\n" +
+ "5. ERROR in Team881br3.java (at line 14)\n" +
+ " abstract int wrong(noTypeGiven);\n" +
+ " ^^^^^^\n" +
+ "Abstract methods do not specify a body\n" +
+ "----------\n" +
+ "6. ERROR in Team881br3.java (at line 14)\n" +
+ " abstract int wrong(noTypeGiven);\n" +
+ " ^^^^^^^^^^^\n" +
+ "Syntax error, insert \"... VariableDeclaratorId\" to complete FormalParameterList\n" +
+ "----------\n" +
+ "7. ERROR in Team881br3.java (at line 15)\n" +
+ " }\n" +
+ " ^\n" +
+ "Syntax error on token \"}\", delete this token\n" +
+ "----------\n" +
+ "8. ERROR in Team881br3.java (at line 16)\n" +
+ " } \n" +
+ " ^\n" +
+ "Syntax error, insert \"}\" to complete ClassBody\n" +
"----------\n");
}
@@ -1064,14 +1064,14 @@ public class Syntax extends AbstractOTJLDTest {
"} \n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team8101bsc1.java (at line 4)\n" +
- " setVal(String v) -> set String val;\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error: missing return type for method designator (OTJLD A.3.2). \n" +
+ "----------\n" +
+ "1. ERROR in Team8101bsc1.java (at line 4)\n" +
+ " setVal(String v) -> set String val;\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error: missing return type for method designator (OTJLD A.3.2). \n" +
"----------\n");
}
-
+
String[] getClassLibraries() {
if (this.verifier != null)
this.verifier.shutDown();
@@ -1173,11 +1173,11 @@ public class Syntax extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team8112dlse1.java (at line 6)\n" +
- " void run(Object as R) {\n" +
- " ^\n" +
- "Syntax error, insert \"... VariableDeclaratorId\" to complete FormalParameterList\n" +
+ "----------\n" +
+ "1. ERROR in Team8112dlse1.java (at line 6)\n" +
+ " void run(Object as R) {\n" +
+ " ^\n" +
+ "Syntax error, insert \"... VariableDeclaratorId\" to complete FormalParameterList\n" +
"----------\n");
}
@@ -1202,21 +1202,21 @@ public class Syntax extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team8112dlse2.java (at line 7)\n" +
- " callin void run(Object as R) {\n" +
- " ^\n" +
- "Syntax error, insert \"... VariableDeclaratorId\" to complete FormalParameterList\n" +
- "----------\n" +
- "2. ERROR in Team8112dlse2.java (at line 10)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error on token \"}\", delete this token\n" +
- "----------\n" +
- "3. ERROR in Team8112dlse2.java (at line 11)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete ClassBody\n" +
+ "----------\n" +
+ "1. ERROR in Team8112dlse2.java (at line 7)\n" +
+ " callin void run(Object as R) {\n" +
+ " ^\n" +
+ "Syntax error, insert \"... VariableDeclaratorId\" to complete FormalParameterList\n" +
+ "----------\n" +
+ "2. ERROR in Team8112dlse2.java (at line 10)\n" +
+ " }\n" +
+ " ^\n" +
+ "Syntax error on token \"}\", delete this token\n" +
+ "----------\n" +
+ "3. ERROR in Team8112dlse2.java (at line 11)\n" +
+ " }\n" +
+ " ^\n" +
+ "Syntax error, insert \"}\" to complete ClassBody\n" +
"----------\n");
}
@@ -1252,18 +1252,18 @@ public class Syntax extends AbstractOTJLDTest {
"}\n" +
" \n"
},
- "----------\n" +
- "1. ERROR in Team8112dlse3.java (at line 7)\n" +
- " callin void m(T8112dlse3_2 as R) {\n" +
- " ^\n" +
- "Syntax error, insert \"... VariableDeclaratorId\" to complete FormalParameterList\n" +
+ "----------\n" +
+ "1. ERROR in Team8112dlse3.java (at line 7)\n" +
+ " callin void m(T8112dlse3_2 as R) {\n" +
+ " ^\n" +
+ "Syntax error, insert \"... VariableDeclaratorId\" to complete FormalParameterList\n" +
"----------\n");
}
// Fixed: a declared lifting lacks an argument name, callin method of nested team
// 8.11.2-otjld-declared-lifting-syntax-error-4
public void test8112_declaredLiftingSyntaxError4() {
-
+
runConformTest(
new String[] {
"Team8112dlse4.java",
@@ -1312,7 +1312,7 @@ public class Syntax extends AbstractOTJLDTest {
// team is used in a package name
// 8.12.1-otjld-scoped-keyword-1
public void test8121_scopedKeyword1() {
-
+
runConformTest(
new String[] {
"T8121sk1Main.java",
@@ -1393,19 +1393,19 @@ public class Syntax extends AbstractOTJLDTest {
"public class T8131bg2 {}\n" +
" \n"
},
- "----------\n" +
- "1. WARNING in Team8131bg2.java (at line 4)\n" +
+ "----------\n" +
+ "1. WARNING in Team8131bg2.java (at line 4)\n" +
+ " toString <- after toString base when;\n" +
+ " ^^^^^^^^\n" +
+ "Callin after binding cannot return a value to the base caller, role method return value of type java.lang.String will be ignored (OTJLD 4.4(a)).\n" +
+ "----------\n" +
+ "2. ERROR in Team8131bg2.java (at line 4)\n" +
" toString <- after toString base when;\n" +
- " ^^^^^^^^\n" +
- "Callin after binding cannot return a value to the base caller, role method return value of type java.lang.String will be ignored (OTJLD 4.4(a)).\n" +
- "----------\n" +
- "2. ERROR in Team8131bg2.java (at line 4)\n" +
- " toString <- after toString base when;\n" +
- " ^^^^^^^^^\n" +
- "Syntax error on token(s), misplaced construct(s)\n" +
+ " ^^^^^^^^^\n" +
+ "Syntax error on token(s), misplaced construct(s)\n" +
"----------\n");
}
-
+
// illegal use of "readonly" on field declaration
public void test8132_illegalModifier1() {
runNegativeTest(
@@ -1415,7 +1415,7 @@ public class Syntax extends AbstractOTJLDTest {
" public readonly String val = \"V\";\n" +
"}\n"
},
- "----------\n" +
+ "----------\n" +
"1. ERROR in Team8132im1.java (at line 2)\n" +
" public readonly String val = \"V\";\n" +
" ^^^^^^^^\n" +
@@ -1427,7 +1427,7 @@ public class Syntax extends AbstractOTJLDTest {
"Syntax error on token \"val\", delete this token\n" +
"----------\n");
}
-
+
// illegal order of callin label and annotation (long)
public void test8133_callinWithNameAndAnnotation1() {
runNegativeTest(
@@ -1443,11 +1443,11 @@ public class Syntax extends AbstractOTJLDTest {
"T8133cwnaa1.java",
"public class T8133cwnaa1 { void bar() {} }\n"
},
- "----------\n" +
- "1. ERROR in Team8133cwnaa1.java (at line 3)\n" +
- " @SuppressWarnings(\"unused\")\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Syntax error: callin annotations must be specified after the callin name (OTJLD A.3.3).\n" +
+ "----------\n" +
+ "1. ERROR in Team8133cwnaa1.java (at line 3)\n" +
+ " @SuppressWarnings(\"unused\")\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error: callin annotations must be specified after the callin name (OTJLD A.3.3).\n" +
"----------\n");
}
@@ -1466,14 +1466,14 @@ public class Syntax extends AbstractOTJLDTest {
"T8133cwnaa2.java",
"public class T8133cwnaa2 { void bar() {} }\n"
},
- "----------\n" +
- "1. ERROR in Team8133cwnaa2.java (at line 3)\n" +
- " @SuppressWarnings(\"unused\")\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Syntax error: callin annotations must be specified after the callin name (OTJLD A.3.3).\n" +
+ "----------\n" +
+ "1. ERROR in Team8133cwnaa2.java (at line 3)\n" +
+ " @SuppressWarnings(\"unused\")\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error: callin annotations must be specified after the callin name (OTJLD A.3.3).\n" +
"----------\n");
}
-
+
// correct order of callin label and annotation (long)
public void test8133_callinWithNameAndAnnotation3() {
runConformTest(
@@ -1520,11 +1520,11 @@ public class Syntax extends AbstractOTJLDTest {
" protected class R playedBy java.util.List<@Ann> {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " protected class R playedBy java.util.List<@Ann> {}\n" +
- " ^^^^\n" +
- "Illegal position for value parameter @Ann: must be a parameter of a single name type reference(OTJLD A.9(a)).\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " protected class R playedBy java.util.List<@Ann> {}\n" +
+ " ^^^^\n" +
+ "Illegal position for value parameter @Ann: must be a parameter of a single name type reference(OTJLD A.9(a)).\n" +
"----------\n");
}
@@ -1535,11 +1535,11 @@ public class Syntax extends AbstractOTJLDTest {
"public team class X extends java.util.List<@Ann> {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public team class X extends java.util.List<@Ann> {\n" +
- " ^^^^\n" +
- "Illegal position for value parameter @Ann: must be a parameter of a single name type reference(OTJLD A.9(a)).\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public team class X extends java.util.List<@Ann> {\n" +
+ " ^^^^\n" +
+ "Illegal position for value parameter @Ann: must be a parameter of a single name type reference(OTJLD A.9(a)).\n" +
"----------\n");
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/teamactivation/ExplicitTeamActivation.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/teamactivation/ExplicitTeamActivation.java
index 68e2455a8..827d23b27 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/teamactivation/ExplicitTeamActivation.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/teamactivation/ExplicitTeamActivation.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -28,11 +28,11 @@ import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
@SuppressWarnings("unchecked")
public class ExplicitTeamActivation extends AbstractOTJLDTest {
-
+
public ExplicitTeamActivation(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -40,7 +40,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -52,7 +52,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// a team is explicitly activated and a callin binding is called in the activation context
// 5.2.1-otjld-callin-invocation-1
public void test521_callinInvocation1() {
-
+
runConformTest(
new String[] {
"T521ci1Main.java",
@@ -111,7 +111,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// a team is explicitly activated and a callin binding is called in the activation context
// 5.2.1-otjld-callin-invocation-2
public void test521_callinInvocation2() {
-
+
runConformTest(
new String[] {
"T521ci2Main.java",
@@ -175,7 +175,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// a team is explicitly activated and a callin binding is called in the activation context
// 5.2.1-otjld-callin-invocation-3
public void test521_callinInvocation3() {
-
+
runConformTest(
new String[] {
"T521ci3Main.java",
@@ -219,7 +219,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// a team is explicitly activated and a callin binding is called in the activation context
// 5.2.1-otjld-callin-invocation-4
public void test521_callinInvocation4() {
-
+
runConformTest(
new String[] {
"T521ci4Main.java",
@@ -269,7 +269,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// a team is explicitly activated and a callin binding is called in the activation context
// Bug 326416 - [compiler] within() not working for team extending non-team
public void test521_callinInvocation5() {
-
+
runConformTest(
new String[] {
"T521ci5Main.java",
@@ -330,7 +330,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// invoking a role method activates the team temporarily
// 5.2.2-otjld-role-method-invocation-activates-team
public void test522_roleMethodInvocationActivatesTeam() {
-
+
runConformTest(
new String[] {
"T522rmiatMain.java",
@@ -381,7 +381,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// a callin binding is not called when an unrelated team is active
// 5.2.3-otjld-callin-in-other-team-context-1
public void test523_callinInOtherTeamContext1() {
-
+
runConformTest(
new String[] {
"T523ciotc1Main.java",
@@ -427,7 +427,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// a callin binding is not called when a base team is active
// 5.2.3-otjld-callin-in-other-team-context-2
public void test523_callinInOtherTeamContext2() {
-
+
runConformTest(
new String[] {
"T523ciotc2Main.java",
@@ -477,7 +477,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// a callin binding is not called when not within a team activation context
// 5.2.4-otjld-callin-when-team-is-inactive-1
public void test524_callinWhenTeamIsInactive1() {
-
+
runConformTest(
new String[] {
"T524cwtii1Main.java",
@@ -520,7 +520,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// a callin binding is not called when not within a team activation context
// 5.2.4-otjld-callin-when-team-is-inactive-2
public void test524_callinWhenTeamIsInactive2() {
-
+
runConformTest(
new String[] {
"T524cwtii2Main.java",
@@ -815,7 +815,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// NOTE: still need to define callin overriding along 'extends'
// 5.2.6-otjld-activation-order
public void test526_activationOrder() {
-
+
runConformTest(
new String[] {
"T526aoMain.java",
@@ -914,7 +914,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// NOTE: still need to define callin overriding along 'extends'
// 5.2.7-otjld-activation-order
public void test527_activationOrder() {
-
+
runConformTest(
new String[] {
"T527aoMain.java",
@@ -1023,7 +1023,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// in nested activation contexts of the same team instance, deactivating an inner context does not make the team inactive
// 5.2.8-otjld-nested-activation-contexts-1
public void test528_nestedActivationContexts1() {
-
+
runConformTest(
new String[] {
"T528nac1Main.java",
@@ -1073,7 +1073,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// in nested activation contexts of the same team instance, explicitly deactivating an inner context restores the previous activation state
// 5.2.8-otjld-nested-activation-contexts-2
public void test528_nestedActivationContexts2() {
-
+
runConformTest(
new String[] {
"T528nac2Main.java",
@@ -1121,7 +1121,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// in nested activation contexts of the same team instance, deactivating an inner context makes the team inactive
// 5.2.8-otjld-nested-activation-contexts-3
public void test528_nestedActivationContexts3() {
-
+
runConformTest(
new String[] {
"T528nac3Main.java",
@@ -1168,7 +1168,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// in nested activation contexts of the same team instance, deactivating an inner context does not make the team inactive
// 5.2.8-otjld-nested-activation-contexts-4
public void test528_nestedActivationContexts4() {
-
+
runConformTest(
new String[] {
"T528nac4Main.java",
@@ -1216,7 +1216,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// an exception is thrown in a within activation context that is catched outside of the context
// 5.2.9-otjld-exception-from-within-activation-context-1
public void test529_exceptionFromWithinActivationContext1() {
-
+
runConformTest(
new String[] {
"T529efwac1Main.java",
@@ -1266,7 +1266,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// an exception is thrown in a activate/deactivate activation context that is catched outside of the context
// 5.2.9-otjld-exception-from-within-activation-context-2
public void test529_exceptionFromWithinActivationContext2() {
-
+
runConformTest(
new String[] {
"T529efwac2Main.java",
@@ -1326,7 +1326,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// deactivate is called for an inactive team
// 5.2.10-otjld-deactivate-for-inactive-team-1
public void test5210_deactivateForInactiveTeam1() {
-
+
runConformTest(
new String[] {
"T5210dfit1Main.java",
@@ -1368,7 +1368,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// deactivate is called for an inactive team
// 5.2.10-otjld-deactivate-for-inactive-team-2
public void test5210_deactivateForInactiveTeam2() {
-
+
runConformTest(
new String[] {
"T5210dfit2Main.java",
@@ -1414,7 +1414,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// deactivate is called for an inactive team
// 5.2.10-otjld-deactivate-for-inactive-team-3
public void test5210_deactivateForInactiveTeam3() {
-
+
runConformTest(
new String[] {
"T5210dfit3Main.java",
@@ -1460,7 +1460,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// an activation context is closed in the presense of another thread that also works with the object
// 5.2.11-otjld-activation-context-and-thread
public void test5211_activationContextAndThread() {
-
+
runConformTest(
new String[] {
"T5211acatMain.java",
@@ -1553,7 +1553,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// a within statement is executed while the team is explicitly active
// 5.2.12-otjld-within-and-other-activation-1
public void test5212_withinAndOtherActivation1() {
-
+
runConformTest(
new String[] {
"T5212waoa1Main.java",
@@ -1601,7 +1601,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// a within statement is executed while the team is implicitly active
// 5.2.12-otjld-within-and-other-activation-2
public void test5212_withinAndOtherActivation2() {
-
+
runConformTest(
new String[] {
"T5212waoa2Main.java",
@@ -1654,7 +1654,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// a within statement is executed while the team is implicitly active and calls another team method
// 5.2.12-otjld-within-and-other-activation-3
public void test5212_withinAndOtherActivation3() {
-
+
runConformTest(
new String[] {
"T5212waoa3Main.java",
@@ -1710,7 +1710,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// a within block only activates the team for the current thread
// 5.2.13-otjld-within-activation-and-threads-1
public void test5213_withinActivationAndThreads1() {
-
+
runConformTest(
new String[] {
"T5213waat1Main.java",
@@ -1766,7 +1766,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// entering a within block while the team has been activated for ALL_THREADS (lazy)
// 5.2.13-otjld-within-activation-and-threads-2
public void test5213_withinActivationAndThreads2() {
-
+
runConformTest(
new String[] {
"T5213waat2Main.java",
@@ -1825,7 +1825,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// global team deactivation permanently 'overrides' thread local activation
// 5.2.14-otjld-explicit-per-thread-activation-1
public void test5214_explicitPerThreadActivation1() {
-
+
runConformTest(
new String[] {
"T5214epta1Main.java",
@@ -1905,7 +1905,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// global team activation applies also for later started threads
// 5.2.15-otjld-explicit-activation-for-all-threads-1
public void test5215_explicitActivationForAllThreads1() {
-
+
runConformTest(
new String[] {
"T5215eaat1Main.java",
@@ -1966,7 +1966,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// global team activation applies also for later started threads - SUPER class of started thread implements 'Runnable'
// 5.2.15-otjld-explicit-activation-for-all-threads-1a
public void test5215_explicitActivationForAllThreads1a() {
-
+
runConformTest(
new String[] {
"T5215eaat1aMain.java",
@@ -2049,7 +2049,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// deactivating a (lazy) global active team for a thread will activate it for all other threads
// 5.2.15-otjld-explicit-activation-for-all-threads-2
public void test5215_explicitActivationForAllThreads2() {
-
+
runConformTest(
new String[] {
"T5215eaat2Main.java",
@@ -2132,7 +2132,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// deactivating a (lazy) global active team for a thread will activate it for all other threads
// 5.2.15-otjld-explicit-activation-for-all-threads-2a
public void test5215_explicitActivationForAllThreads2a() {
-
+
runConformTest(
new String[] {
"T5215eaat2aMain.java",
@@ -2219,7 +2219,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// deactivating a (lazy) global active team for a thread will activate it for all other threads INCLUDING the main thread
// 5.2.15-otjld-explicit-activation-for-all-threads-3
public void test5215_explicitActivationForAllThreads3() {
-
+
runConformTest(
new String[] {
"T5215eaat3Main.java",
@@ -2285,7 +2285,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// using a Runnable.run() a thread creation is faked [see also Bug 316696 - [otre] OTRE doesn't know about all threads].
public void test5215_explicitActivationForAllThreads3a() {
-
+
runConformTest(
new String[] {
"T5215eaat3aMain.java",
@@ -2312,7 +2312,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
" runnable.run();\n" + // bm() during run(): not active for this thread
" t.activate();\n" +
" Thread ot1 = new Thread(runnable);\n" +
- " ot1.start();\n" + // bm() during run(): inherit activation from current thread
+ " ot1.start();\n" + // bm() during run(): inherit activation from current thread
" try {\n" +
" ot1.join();\n" +
" } catch (InterruptedException ie) {\n" +
@@ -2348,7 +2348,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// isActive(ALL_THREADS) returns true if the theam has been activated for all threads
// 5.2.15-otjld-explicit-activation-for-all-threads-4
public void test5215_explicitActivationForAllThreads4() {
-
+
runConformTest(
new String[] {
"T5215eaat4Main.java",
@@ -2400,7 +2400,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// a team registers twice at a super class which is bound by another team - seen in OTPong
// 5.2.16-otjld-activation-bug-1
public void test5216_activationBug1() {
-
+
runConformTest(
new String[] {
"Team5216_2.java",
@@ -2461,7 +2461,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// internally duplicate attempt to deactivate a team caused an AIOOBE "0" - reported by MWSE students
// 5.2.16-otjld-activation-bug-2
public void test5216_activationBug2() {
-
+
runConformTest(
new String[] {
"Team5216ab2_2.java",
@@ -2540,7 +2540,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// witness for AIOOBE
// 5.2.17-otjld-concurrent-activation-1
public void _test5217_concurrentActivation1() {
-
+
runConformTest(
new String[] {
"Team5217ca1.java",
@@ -2605,7 +2605,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// witness for deadlock
// 5.2.17-otjld-concurrent-activation-2
public void test5217_concurrentActivation2() {
-
+
runConformTest(
new String[] {
"Team5217ca2.java",
@@ -2680,7 +2680,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// a per-thread team inherits this activation to a child thread, see Trac #228
// 5.2.18-otjld-inheritable-team-activation-1
public void test5218_inheritableTeamActivation1() {
-
+
runConformTest(
new String[] {
"Team5218ita1.java",
@@ -2719,7 +2719,7 @@ public class ExplicitTeamActivation extends AbstractOTJLDTest {
// a per-thread team does not inherit this activation to a child thread, see Trac #228
// 5.2.18-otjld-inheritable-team-activation-2
public void test5218_inheritableTeamActivation2() {
-
+
runConformTest(
new String[] {
"Team5218ita2.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/teamactivation/ImplicitTeamActivation.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/teamactivation/ImplicitTeamActivation.java
index 121a88ad5..b7fcd0570 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/teamactivation/ImplicitTeamActivation.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/teamactivation/ImplicitTeamActivation.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 IT Service Omikron GmbH and others.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Thomas Dudziak - Initial API and implementation
* Stephan Herrmann - Initial API and implementation
@@ -26,11 +26,11 @@ import junit.framework.Test;
import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
public class ImplicitTeamActivation extends AbstractOTJLDTest {
-
+
public ImplicitTeamActivation(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -38,7 +38,7 @@ public class ImplicitTeamActivation extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -50,7 +50,7 @@ public class ImplicitTeamActivation extends AbstractOTJLDTest {
static final String IMPLICIT_ACTIVATION_ALWAYS = "-Dot.implicit.team.activation=ALWAYS";
static final String IMPLICIT_ACTIVATION_ANNOTATED = "-Dot.implicit.team.activation=ANNOTATED";
static final String IMPLICIT_ACTIVATION_NEVER = "-Dot.implicit.team.activation=NEVER";
-
+
// a team is explicitly activated and a callin binding is called in the activation context
// 5.3.1-otjld-callin-invocation-in-team-method
public void test531_callinInvocationInTeamMethod() {
@@ -1804,7 +1804,7 @@ public class ImplicitTeamActivation extends AbstractOTJLDTest {
// 5.3.17-otjld-concurrent-activation-1
// see http://trac.objectteams.org/ot/ticket/331
public void test5317_concurrentActivation1() {
-
+
runConformTest(
new String[] {
"T5317ca1Main2.java",
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/teamactivation/Predicates.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/teamactivation/Predicates.java
index eec0f9dd2..24e49f9f7 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/teamactivation/Predicates.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/teamactivation/Predicates.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010 Stephan Herrmann
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -27,11 +27,11 @@ import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest;
@SuppressWarnings("unchecked")
public class Predicates extends AbstractOTJLDTest {
-
+
public Predicates(String name) {
super(name);
}
-
+
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
@@ -39,7 +39,7 @@ public class Predicates extends AbstractOTJLDTest {
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
-
+
public static Test suite() {
return buildComparableTestSuite(testClass());
}
@@ -51,7 +51,7 @@ public class Predicates extends AbstractOTJLDTest {
// a role class has a predicate
// 9.1.1-otjld-class-predicate-1
public void test911_classPredicate1() {
-
+
runConformTest(
new String[] {
"T911cp1Main.java",
@@ -96,7 +96,7 @@ public class Predicates extends AbstractOTJLDTest {
// a role class has a base predicate
// 9.1.1-otjld-class-predicate-2
public void test911_classPredicate2() {
-
+
runConformTest(
new String[] {
"T911cp2Main.java",
@@ -141,7 +141,7 @@ public class Predicates extends AbstractOTJLDTest {
// a team class has a base predicate
// 9.1.1-otjld-class-predicate-3
public void test911_classPredicate3() {
-
+
runConformTest(
new String[] {
"T911cp3Main.java",
@@ -187,7 +187,7 @@ public class Predicates extends AbstractOTJLDTest {
// a nested team has a base predicate - which affects its own callins and those of its roles
// 9.1.1-otjld-class-predicate-4
public void test911_classPredicate4() {
-
+
runConformTest(
new String[] {
"T911cp4Main.java",
@@ -255,7 +255,7 @@ public class Predicates extends AbstractOTJLDTest {
// two roles have base predicates - witness of TPX-428 part 2
// 9.1.1-otjld-class-predicate-5
public void test911_classPredicate5() {
-
+
runConformTest(
new String[] {
"Team911cp5.java",
@@ -492,11 +492,11 @@ public class Predicates extends AbstractOTJLDTest {
customOptions,
null/*no custom requestor*/);
}
-
+
// a role class has a base predicate using base in the expression
// 9.1.2-otjld-base-expression-1
public void test912_baseExpression1() {
-
+
runConformTest(
new String[] {
"T912ba1Main.java",
@@ -541,7 +541,7 @@ public class Predicates extends AbstractOTJLDTest {
// a team class and a role have predicates
// 9.1.3-otjld-multiple-predicates-1
public void test913_multiplePredicates1() {
-
+
runConformTest(
new String[] {
"T913mp1Main.java",
@@ -598,7 +598,7 @@ public class Predicates extends AbstractOTJLDTest {
// a team class and a role have base predicates
// 9.1.3-otjld-multiple-predicates-2
public void test913_multiplePredicates2() {
-
+
runConformTest(
new String[] {
"T913mp2Main.java",
@@ -657,7 +657,7 @@ public class Predicates extends AbstractOTJLDTest {
// a role class has a predicate, so does its super
// 9.1.3-otjld-multiple-predicates-3
public void test913_multiplePredicates3() {
-
+
runConformTest(
new String[] {
"T913mp3Main.java",
@@ -716,7 +716,7 @@ public class Predicates extends AbstractOTJLDTest {
// a role class has a base predicate, so does its super
// 9.1.3-otjld-multiple-predicates-4
public void test913_multiplePredicates4() {
-
+
runConformTest(
new String[] {
"T913mp4Main.java",
@@ -777,7 +777,7 @@ public class Predicates extends AbstractOTJLDTest {
// a role class has a predicate, its super has a base predicate
// 9.1.3-otjld-multiple-predicates-5
public void test913_multiplePredicates5() {
-
+
runConformTest(
new String[] {
"T913mp5Main.java",
@@ -843,7 +843,7 @@ public class Predicates extends AbstractOTJLDTest {
// a role class has a predicate, so does its tsuper
// 9.1.3-otjld-multiple-predicates-6
public void test913_multiplePredicates6() {
-
+
runConformTest(
new String[] {
"T913mp6Main.java",
@@ -907,7 +907,7 @@ public class Predicates extends AbstractOTJLDTest {
// a role class has a predicate, its tsuper has a base predicate
// 9.1.3-otjld-multiple-predicates-7
public void test913_multiplePredicates7() {
-
+
runConformTest(
new String[] {
"T913mp7Main.java",
@@ -971,7 +971,7 @@ public class Predicates extends AbstractOTJLDTest {
// a role class has a base predicate so has its tsuper
// 9.1.3-otjld-multiple-predicates-8
public void test913_multiplePredicates8() {
-
+
runConformTest(
new String[] {
"T913mp8Main.java",
@@ -1037,7 +1037,7 @@ public class Predicates extends AbstractOTJLDTest {
// a role class has a base predicate, its tsuper has a regulare predicate
// 9.1.3-otjld-multiple-predicates-9
public void test913_multiplePredicates9() {
-
+
runConformTest(
new String[] {
"T913mp9Main.java",
@@ -1105,7 +1105,7 @@ public class Predicates extends AbstractOTJLDTest {
// a replace callin binding has a base predicate, the surrounding role class has an additional base predicate
// 9.1.3-otjld-multiple-predicates-10
public void test913_multiplePredicates10() {
-
+
runConformTest(
new String[] {
"T913mp10Main.java",
@@ -1172,7 +1172,7 @@ public class Predicates extends AbstractOTJLDTest {
// a role method and its binding both have predicates
// 9.1.3-otjld-multiple-predicates-11
public void test913_multiplePredicates11() {
-
+
runConformTest(
new String[] {
"Team913mp11.java",
@@ -1208,7 +1208,7 @@ public class Predicates extends AbstractOTJLDTest {
// a callin binding has a guard predicate
// 9.1.4-otjld-binding-predicate-1
public void test914_bindingPredicate1() {
-
+
runConformTest(
new String[] {
"T914bp1Main.java",
@@ -1255,7 +1255,7 @@ public class Predicates extends AbstractOTJLDTest {
// a callin binding has a guard predicate and parameter mappings -- role and base have the same name
// 9.1.4-otjld-binding-predicate-1a
public void test914_bindingPredicate1a() {
-
+
runConformTest(
new String[] {
"T914bp1aMain.java",
@@ -1313,7 +1313,7 @@ public class Predicates extends AbstractOTJLDTest {
// a callin binding has a base guard predicate
// 9.1.4-otjld-binding-predicate-2
public void test914_bindingPredicate2() {
-
+
runConformTest(
new String[] {
"T914bp2Main.java",
@@ -1360,7 +1360,7 @@ public class Predicates extends AbstractOTJLDTest {
// a callin binding with multiple base methods has a base guard predicate - WITNESS for TPX-286
// 9.1.4-otjld-binding-predicate-2a
public void test914_bindingPredicate2a() {
-
+
runConformTest(
new String[] {
"T914bp2aMain.java",
@@ -1408,7 +1408,7 @@ public class Predicates extends AbstractOTJLDTest {
// a callin binding with multiple base methods has a base guard predicate - have signatures
// 9.1.4-otjld-binding-predicate-2b
public void test914_bindingPredicate2b() {
-
+
runConformTest(
new String[] {
"T914bp2bMain.java",
@@ -1456,7 +1456,7 @@ public class Predicates extends AbstractOTJLDTest {
// a callin binding with multiple base methods has a regular guard predicate
// 9.1.4-otjld-binding-predicate-2c
public void test914_bindingPredicate2c() {
-
+
runConformTest(
new String[] {
"T914bp2cMain.java",
@@ -1504,7 +1504,7 @@ public class Predicates extends AbstractOTJLDTest {
// a callin binding has a base guard predicate - static methods
// 9.1.4-otjld-binding-predicate-2s
public void test914_bindingPredicate2s() {
-
+
runConformTest(
new String[] {
"T914bp2sMain.java",
@@ -1550,7 +1550,7 @@ public class Predicates extends AbstractOTJLDTest {
// a callin binding has a role guard predicate - static methods
// 9.1.4-otjld-binding-predicate-2r
public void test914_bindingPredicate2r() {
-
+
runConformTest(
new String[] {
"T914bp2rMain.java",
@@ -1596,7 +1596,7 @@ public class Predicates extends AbstractOTJLDTest {
// a callin binding has a role guard predicate - static methods with different signatures
// 9.1.4-otjld-binding-predicate-2R
public void test914_bindingPredicate2R() {
-
+
runConformTest(
new String[] {
"T914bp2RMain.java",
@@ -1643,7 +1643,7 @@ public class Predicates extends AbstractOTJLDTest {
// a callin binding has a base guard predicate with parameter
// 9.1.4-otjld-binding-predicate-3
public void test914_bindingPredicate3() {
-
+
runConformTest(
new String[] {
"T914bp3Main.java",
@@ -1689,7 +1689,7 @@ public class Predicates extends AbstractOTJLDTest {
// a replace callin binding has a base guard predicate with parameter
// 9.1.4-otjld-binding-predicate-4
public void test914_bindingPredicate4() {
-
+
runConformTest(
new String[] {
"T914bp4Main.java",
@@ -1736,7 +1736,7 @@ public class Predicates extends AbstractOTJLDTest {
// a before callin binding has a base guard predicate with parameter - no team-level attribute declared
// 9.1.4-otjld-binding-predicate-5
public void test914_bindingPredicate5() {
-
+
runConformTest(
new String[] {
"T914bp5Main.java",
@@ -1782,7 +1782,7 @@ public class Predicates extends AbstractOTJLDTest {
// a before callin binding has a regular guard predicate with parameter
// 9.1.4-otjld-binding-predicate-6
public void test914_bindingPredicate6() {
-
+
runConformTest(
new String[] {
"T914bp6Main.java",
@@ -1827,7 +1827,7 @@ public class Predicates extends AbstractOTJLDTest {
// a callin binding with base guard predicate is added in a sub team
// 9.1.4-otjld-binding-predicate-7
public void test914_bindingPredicate7() {
-
+
runConformTest(
new String[] {
"T914bp7Main.java",
@@ -1880,7 +1880,7 @@ public class Predicates extends AbstractOTJLDTest {
// a callin binding with base guard predicate is repeated in a sub team - named callin
// 9.1.4-otjld-binding-predicate-7a
public void test914_bindingPredicate7a() {
-
+
runConformTest(
new String[] {
"T914bp7aMain.java",
@@ -1977,7 +1977,7 @@ public class Predicates extends AbstractOTJLDTest {
// a role method is bound after AND before the same base method, both bindings have base guard predicates
// 9.1.4-otjld-binding-predicate-8
public void test914_bindingPredicate8() {
-
+
runConformTest(
new String[] {
"T914bp8Main.java",
@@ -2027,7 +2027,7 @@ public class Predicates extends AbstractOTJLDTest {
// a role method returning void is bound after a base method returning void using a base guard predicate
// 9.1.4-otjld-binding-predicate-9
public void test914_bindingPredicate9() {
-
+
runConformTest(
new String[] {
"T914bp9Main.java",
@@ -2069,7 +2069,7 @@ public class Predicates extends AbstractOTJLDTest {
// a role method is bound before a base method with no arguments using a base guard predicate - the full signatures are used in the binding (vs. "9.1.4-otjld-binding-predicate-2")
// 9.1.4-otjld-binding-predicate-10
public void test914_bindingPredicate10() {
-
+
runConformTest(
new String[] {
"T914bp10Main.java",
@@ -2112,7 +2112,7 @@ public class Predicates extends AbstractOTJLDTest {
// 9.1.4-otjld-binding-predicate-11
public void test914_bindingPredicate11() {
Map customOptions = getCompilerOptions();
-
+
runConformTest(
new String[] {
"T914bp11Main.java",
@@ -2162,7 +2162,7 @@ public class Predicates extends AbstractOTJLDTest {
// like "9.1.4-otjld-binding-predicate-11" with signatures in the binding
// 9.1.4-otjld-binding-predicate-11a
public void test914_bindingPredicate11a() {
-
+
runConformTest(
new String[] {
"T914bp11aMain.java",
@@ -2206,7 +2206,7 @@ public class Predicates extends AbstractOTJLDTest {
// like "9.1.4-otjld-binding-predicate-11" with signatures in the binding + plus a team predicate
// 9.1.4-otjld-binding-predicate-12
public void test914_bindingPredicate12() {
-
+
runConformTest(
new String[] {
"T914bp12Main.java",
@@ -2257,7 +2257,7 @@ public class Predicates extends AbstractOTJLDTest {
// like "9.1.4-otjld-binding-predicate-12" but regular guards only
// 9.1.4-otjld-binding-predicate-13
public void test914_bindingPredicate13() {
-
+
runConformTest(
new String[] {
"T914bp13Main.java",
@@ -2313,7 +2313,7 @@ public class Predicates extends AbstractOTJLDTest {
// binding a base method two times to the same role method (predecdence declaration) one is inhibited by a guard predicate (Reported by Henry Sudhof on 5.1.2006)
// 9.1.4-otjld-binding-predicate-14
public void test914_bindingPredicate14() {
-
+
runConformTest(
new String[] {
"T914bp14Main.java",
@@ -2358,7 +2358,7 @@ public class Predicates extends AbstractOTJLDTest {
// binding a base method two times to the same role method (predecdence declaration) with replace
// 9.1.4-otjld-binding-predicate-15
public void test914_bindingPredicate15() {
-
+
runConformTest(
new String[] {
"T914bp15Main.java",
@@ -2404,7 +2404,7 @@ public class Predicates extends AbstractOTJLDTest {
// a base guard applies base-class decapsulation for its parameters and in an expression
// 9.1.4-otjld-binding-predicate-16
public void test914_bindingPredicate16() {
-
+
runConformTest(
new String[] {
"p1/T914bp16Main.java",
@@ -2532,7 +2532,7 @@ public class Predicates extends AbstractOTJLDTest {
// a method guard accesses parameters but the callin binding fails to mention signatures (not a problem)
// 9.1.4-otjld-binding-predicate-19
public void test914_bindingPredicate19() {
-
+
runConformTest(
new String[] {
"p2/Team914bp19.java",
@@ -2578,7 +2578,7 @@ public class Predicates extends AbstractOTJLDTest {
// a method guard accesses a parameter which is mapped in a parameter mapping
// 9.1.4-otjld-binding-predicate-20
public void test914_bindingPredicate20() {
-
+
runConformTest(
new String[] {
"p2/Team914bp20.java",
@@ -2625,7 +2625,7 @@ public class Predicates extends AbstractOTJLDTest {
},
"X");
}
-
+
// unresolved method reference in a base guard, role already has a re-checkable problem
public void test914_bindingPredicate21() {
runNegativeTest(
@@ -2646,11 +2646,11 @@ public class Predicates extends AbstractOTJLDTest {
" void blub() {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Team914bp21.java (at line 7)\n" +
- " base when (test(base));\n" +
- " ^^^^\n" +
- "The method test(T914bp21) is undefined for the type Team914bp21.R\n" +
+ "----------\n" +
+ "1. ERROR in Team914bp21.java (at line 7)\n" +
+ " base when (test(base));\n" +
+ " ^^^^\n" +
+ "The method test(T914bp21) is undefined for the type Team914bp21.R\n" +
"----------\n");
}
@@ -2702,7 +2702,7 @@ public class Predicates extends AbstractOTJLDTest {
// a role method has a guard predicate
// 9.1.5-otjld-method-predicate-1
public void test915_methodPredicate1() {
-
+
runConformTest(
new String[] {
"T915mp1Main.java",
@@ -2750,7 +2750,7 @@ public class Predicates extends AbstractOTJLDTest {
// a role method has a base guard predicate
// 9.1.5-otjld-method-predicate-2
public void test915_methodPredicate2() {
-
+
runConformTest(
new String[] {
"T915mp2Main.java",
@@ -2798,7 +2798,7 @@ public class Predicates extends AbstractOTJLDTest {
// a role method has a regular guard predicate with parameter
// 9.1.5-otjld-method-predicate-3
public void test915_methodPredicate3() {
-
+
runConformTest(
new String[] {
"T915mp3Main.java",
@@ -2844,7 +2844,7 @@ public class Predicates extends AbstractOTJLDTest {
// a callin role method has a regular guard predicate with parameter
// 9.1.5-otjld-method-predicate-4
public void test915_methodPredicate4() {
-
+
runConformTest(
new String[] {
"T915mp4Main.java",
@@ -2891,7 +2891,7 @@ public class Predicates extends AbstractOTJLDTest {
// a callin role method has a regular guard predicate with parameter - also have a role predicate
// 9.1.5-otjld-method-predicate-5
public void test915_methodPredicate5() {
-
+
runConformTest(
new String[] {
"T915mp5Main.java",
@@ -2943,7 +2943,7 @@ public class Predicates extends AbstractOTJLDTest {
// a base predicate of an after binding accesses the result of the base method
// 9.1.6-otjld-base-predicate-accessing-result-1
public void test916_basePredicateAccessingResult1() {
-
+
runConformTest(
new String[] {
"Team916bpar1.java",
@@ -3009,11 +3009,11 @@ public class Predicates extends AbstractOTJLDTest {
"5.4.1(a)");
}
- // a predicate is not the first element in a class
+ // a predicate is not the first element in a class
// WITNESS for TPX-252 - fixed between 0.8.0 and 0.8.1
// 9.1.6-otjld-predicate-confusing-the-parser-1
public void test916_predicateConfusingTheParser1() {
-
+
runConformTest(
new String[] {
"Team916pctp1.java",
@@ -3043,7 +3043,7 @@ public class Predicates extends AbstractOTJLDTest {
// a role of role has a base predicate (was bugreport ImplicitMayhem by hsudhof)
// 9.1.7-otjld-predicate-in-role-of-role-1
public void test917_predicateInRoleOfRole1() {
-
+
runConformTest(
new String[] {
"p2/Team917piror1_2.java",
@@ -3091,7 +3091,7 @@ public class Predicates extends AbstractOTJLDTest {
// a role level base guard blocks lifting of a callin argument
// 9.1.8-otjld_rejected_feature-base-guard-affecting-argument-lifting-1
public void _rejected_test918_featureBaseGuardAffectingArgumentLifting1() {
-
+
runConformTest(
new String[] {
"Team918bgaal1.java",
@@ -3135,7 +3135,7 @@ public class Predicates extends AbstractOTJLDTest {
// a binding guard throws an undeclared exception
// 9.1.9-otjld-exception-in-predicate-1
public void test919_exceptionInPredicate1() {
-
+
runConformTest(
new String[] {
"Team919eip1.java",
@@ -3170,7 +3170,7 @@ public class Predicates extends AbstractOTJLDTest {
public void test919_exceptionInPredicate2() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportExceptionInGuard, CompilerOptions.WARNING);
-
+
runConformTest(
new String[] {
"Team919eip2.java",
@@ -3210,38 +3210,38 @@ public class Predicates extends AbstractOTJLDTest {
runConformTest(
new String[] {
"bugxyz/Main.java",
- "package bugxyz;\n" +
+ "package bugxyz;\n" +
"\n" +
- "public class Main {\n" +
- " public static void main(String[] args) {\n" +
- " new T1().activate();\n" +
- " new B1().foo();\n" +
- " }\n" +
+ "public class Main {\n" +
+ " public static void main(String[] args) {\n" +
+ " new T1().activate();\n" +
+ " new B1().foo();\n" +
+ " }\n" +
"}\n",
"bugxzy/B1.java",
- "package bugxyz;\n" +
- "\n" +
- "public class B1 {\n" +
- " boolean test() { return true; }\n" +
- " void foo() { }\n" +
+ "package bugxyz;\n" +
+ "\n" +
+ "public class B1 {\n" +
+ " boolean test() { return true; }\n" +
+ " void foo() { }\n" +
"}\n",
"bugxzy/B2.java",
- "package bugxyz;\n" +
- "\n" +
+ "package bugxyz;\n" +
+ "\n" +
"public class B2 extends B1 {}\n",
"bugxyz/T1.java",
- "package bugxyz;\n" +
- "\n" +
- "public team class T1 {\n" +
- " protected class R1 playedBy B1 {\n" +
- " bar <- before foo\n" +
- " base when (base.test());\n" +
- "\n" +
- " private void bar() {\n" +
- " System.out.println(\"bar\");\n" +
- " }\n" +
- " }\n" +
- " protected class R2 extends R1 playedBy B2 { }\n" +
+ "package bugxyz;\n" +
+ "\n" +
+ "public team class T1 {\n" +
+ " protected class R1 playedBy B1 {\n" +
+ " bar <- before foo\n" +
+ " base when (base.test());\n" +
+ "\n" +
+ " private void bar() {\n" +
+ " System.out.println(\"bar\");\n" +
+ " }\n" +
+ " }\n" +
+ " protected class R2 extends R1 playedBy B2 { }\n" +
"}\n"
},
"bar");
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/parser/org/eclipse/objectteams/otdt/tests/parser/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/parser/org/eclipse/objectteams/otdt/tests/parser/AllTests.java
index bfbdbaece..44608c1b3 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/parser/org/eclipse/objectteams/otdt/tests/parser/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/parser/org/eclipse/objectteams/otdt/tests/parser/AllTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/parser/org/eclipse/objectteams/otdt/tests/parser/SourceElementParserTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/parser/org/eclipse/objectteams/otdt/tests/parser/SourceElementParserTest.java
index ded9fe77c..d912fa28a 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/parser/org/eclipse/objectteams/otdt/tests/parser/SourceElementParserTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/parser/org/eclipse/objectteams/otdt/tests/parser/SourceElementParserTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -45,12 +45,12 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
public class SourceElementParserTest extends FileBasedModelTest implements ISourceElementRequestor
{
private char[] source;
-
+
public SourceElementParserTest(String testName)
{
super(testName);
}
-
+
public static Test suite()
{
if (true)
@@ -61,13 +61,13 @@ public class SourceElementParserTest extends FileBasedModelTest implements ISour
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
- setTestProjectDir("ParserTest");
+ setTestProjectDir("ParserTest");
super.setUpSuite();
}
-
+
protected void setUp() throws Exception
{
super.setUp();
@@ -76,19 +76,19 @@ public class SourceElementParserTest extends FileBasedModelTest implements ISour
public void fullParse(String src, String fileName)
{
this.source = src.toCharArray();
-
- // km: two new parameter in 32m4: "reportLocalDeclarations","optimizeStringLiterals"
+
+ // km: two new parameter in 32m4: "reportLocalDeclarations","optimizeStringLiterals"
// assuming both as true
- SourceElementParser parser =
- new SourceElementParser(this, new DefaultProblemFactory(Locale.getDefault()), new CompilerOptions(), true, true);
-
+ SourceElementParser parser =
+ new SourceElementParser(this, new DefaultProblemFactory(Locale.getDefault()), new CompilerOptions(), true, true);
+
ICompilationUnit sourceUnit = new CompilationUnit(source, fileName, null);
-
+
parser.parseCompilationUnit(sourceUnit, true, null);
}
// test-methods following
-
+
public void testDeclarationSourceStart() throws JavaModelException
{
org.eclipse.jdt.core.ICompilationUnit unit = getCompilationUnit(
@@ -96,21 +96,21 @@ public class SourceElementParserTest extends FileBasedModelTest implements ISour
"src",
"sourcelocations",
"JdtTestAdaptor.java");
-
+
String src = unit.getSource();
- IResource res = unit.getCorrespondingResource();
-
+ IResource res = unit.getCorrespondingResource();
+
String fileName = res.toString();
fullParse(src, fileName);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.compiler.ISourceElementRequestor#acceptConstructorReference(char[], int, int)
*/
public void acceptConstructorReference(char[] typeName, int argCount, int sourcePosition)
{
// TODO Auto-generated method stub
-
+
}
/* (non-Javadoc)
@@ -119,7 +119,7 @@ public class SourceElementParserTest extends FileBasedModelTest implements ISour
public void acceptFieldReference(char[] fieldName, int sourcePosition)
{
// TODO Auto-generated method stub
-
+
}
/* (non-Javadoc)
@@ -128,7 +128,7 @@ public class SourceElementParserTest extends FileBasedModelTest implements ISour
public void acceptLineSeparatorPositions(int[] positions)
{
// TODO Auto-generated method stub
-
+
}
/* (non-Javadoc)
@@ -137,7 +137,7 @@ public class SourceElementParserTest extends FileBasedModelTest implements ISour
public void acceptMethodReference(char[] methodName, int argCount, int sourcePosition)
{
// TODO Auto-generated method stub
-
+
}
/* (non-Javadoc)
@@ -146,7 +146,7 @@ public class SourceElementParserTest extends FileBasedModelTest implements ISour
public void acceptTypeReference(char[][] typeName, int sourceStart, int sourceEnd)
{
// TODO Auto-generated method stub
-
+
}
/* (non-Javadoc)
@@ -155,7 +155,7 @@ public class SourceElementParserTest extends FileBasedModelTest implements ISour
public void acceptTypeReference(char[] typeName, int sourcePosition)
{
// TODO Auto-generated method stub
-
+
}
/* (non-Javadoc)
@@ -164,7 +164,7 @@ public class SourceElementParserTest extends FileBasedModelTest implements ISour
public void acceptUnknownReference(char[][] name, int sourceStart, int sourceEnd)
{
// TODO Auto-generated method stub
-
+
}
/* (non-Javadoc)
@@ -173,7 +173,7 @@ public class SourceElementParserTest extends FileBasedModelTest implements ISour
public void acceptUnknownReference(char[] name, int sourcePosition)
{
// TODO Auto-generated method stub
-
+
}
/* (non-Javadoc)
@@ -182,7 +182,7 @@ public class SourceElementParserTest extends FileBasedModelTest implements ISour
public void enterCompilationUnit()
{
// TODO Auto-generated method stub
-
+
}
@@ -192,7 +192,7 @@ public class SourceElementParserTest extends FileBasedModelTest implements ISour
public void enterInitializer(int declarationStart, int modifiers)
{
// TODO Auto-generated method stub
-
+
}
/* (non-Javadoc)
@@ -201,7 +201,7 @@ public class SourceElementParserTest extends FileBasedModelTest implements ISour
public void exitCompilationUnit(int declarationEnd)
{
// TODO Auto-generated method stub
-
+
}
/* (non-Javadoc)
@@ -210,7 +210,7 @@ public class SourceElementParserTest extends FileBasedModelTest implements ISour
public void exitConstructor(int declarationEnd)
{
// TODO Auto-generated method stub
-
+
}
/* (non-Javadoc)
@@ -219,7 +219,7 @@ public class SourceElementParserTest extends FileBasedModelTest implements ISour
public void exitField(int initializationStart, int declarationEnd, int declarationSourceEnd)
{
// TODO Auto-generated method stub
-
+
}
/* (non-Javadoc)
@@ -228,7 +228,7 @@ public class SourceElementParserTest extends FileBasedModelTest implements ISour
public void exitInitializer(int declarationEnd)
{
// TODO Auto-generated method stub
-
+
}
/* (non-Javadoc)
@@ -237,7 +237,7 @@ public class SourceElementParserTest extends FileBasedModelTest implements ISour
public void exitCalloutMapping(int sourceEnd, int declarationSourceEnd)
{
// TODO Auto-generated method stub
-
+
}
/* (non-Javadoc)
@@ -246,7 +246,7 @@ public class SourceElementParserTest extends FileBasedModelTest implements ISour
public void exitCalloutToFieldMapping(int sourceEnd, int declarationSourceEnd)
{
// TODO Auto-generated method stub
-
+
}
/* (non-Javadoc)
@@ -255,57 +255,57 @@ public class SourceElementParserTest extends FileBasedModelTest implements ISour
public void exitCallinMapping(int sourceEnd, int declarationSourceEnd)
{
// TODO Auto-generated method stub
-
+
}
-// {ObjectTeams:
+// {ObjectTeams:
public void enterCalloutMapping(CalloutInfo calloutInfo) {}
public void enterCalloutToFieldMapping(CalloutToFieldInfo calloutInfo) {}
public void enterCallinMapping(CallinInfo callinInfo) {}
-
+
public void acceptBaseReference(char[][] typeName, int sourceStart, int sourceEnd) {}
// haebor}
public void enterConstructor(MethodInfo methodInfo) {
// TODO Auto-generated method stub
-
+
}
public void enterField(FieldInfo fieldInfo) {
// TODO Auto-generated method stub
-
+
}
public void enterMethod(MethodInfo methodInfo) {
// TODO Auto-generated method stub
-
+
}
public void enterType(TypeInfo typeInfo) {
// TODO Auto-generated method stub
-
+
}
public void exitType(int declarationEnd) {
// TODO Auto-generated method stub
-
+
}
public void acceptProblem(CategorizedProblem problem) {
// TODO Auto-generated method stub
-
+
}
public void acceptImport(int declarationStart, int declarationEnd, char[][] tokens, boolean onDemand, int modifiers) {
// TODO Auto-generated method stub
-
+
}
-
+
public void acceptImport(int declarationStart, int declarationEnd, int nameStart, int nameEnd, char[][] tokens,
boolean onDemand, int modifiers) {
// TODO Auto-generated method stub
-
+
}
public void acceptAnnotationTypeReference(char[][] annotation, int sourceStart, int sourceEnd) {
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/search/org/eclipse/objectteams/otdt/tests/search/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/search/org/eclipse/objectteams/otdt/tests/search/AllTests.java
index d6a9cfd2a..cfbc01be5 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/search/org/eclipse/objectteams/otdt/tests/search/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/search/org/eclipse/objectteams/otdt/tests/search/AllTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/search/org/eclipse/objectteams/otdt/tests/search/FileBasedSearchTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/search/org/eclipse/objectteams/otdt/tests/search/FileBasedSearchTest.java
index 4ed6ef5a9..a24da6e9c 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/search/org/eclipse/objectteams/otdt/tests/search/FileBasedSearchTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/search/org/eclipse/objectteams/otdt/tests/search/FileBasedSearchTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/search/org/eclipse/objectteams/otdt/tests/search/OTJavaFieldSearchTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/search/org/eclipse/objectteams/otdt/tests/search/OTJavaFieldSearchTests.java
index d27f617e1..4e3b00b2f 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/search/org/eclipse/objectteams/otdt/tests/search/OTJavaFieldSearchTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/search/org/eclipse/objectteams/otdt/tests/search/OTJavaFieldSearchTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -27,19 +27,19 @@ import org.eclipse.core.runtime.CoreException;
/**
* @author svacina
- *
+ *
* @version $Id: OTJavaFieldSearchTests.java 23494 2010-02-05 23:06:44Z stephan $
*/
//Note: in case of search for type declaration with fully qualified name use the search method with the current JavaModel
-// and not the fully qualified name as string -> Workbench use the javaElement to build the search pattern
+// and not the fully qualified name as string -> Workbench use the javaElement to build the search pattern
public class OTJavaFieldSearchTests extends OTJavaSearchTestBase
{
public OTJavaFieldSearchTests(String name)
{
super(name);
}
-
+
public static Test suite()
{
if (false)
@@ -49,13 +49,13 @@ public class OTJavaFieldSearchTests extends OTJavaSearchTestBase
suite.addTest(new OTJavaFieldSearchTests("test016"));
return suite;
}
-
+
return new Suite(OTJavaFieldSearchTests.class);
}
-
+
/**
* Search for:<br>
- * - Team declaration<br>
+ * - Team declaration<br>
* Search pattern:<br>
* - fully qualified name<br>
* Searched element:<br>
@@ -68,48 +68,48 @@ public class OTJavaFieldSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p_field_search.FieldAccessInRoleMethod.R.name",
- FIELD,
+ "p_field_search.FieldAccessInRoleMethod.R.name",
+ FIELD,
READ_ACCESSES|WRITE_ACCESSES,
- getJavaSearchScopeFromPackage("p_field_search"),
+ getJavaSearchScopeFromPackage("p_field_search"),
resultCollector);
-
+
assertSearchResults("Team decl, fq name",
"src/p_field_search/FieldAccessInRoleMethod.java void p_field_search.FieldAccessInRoleMethod$R.setName(String) [name]",
resultCollector);
}
-
+
public void test002() throws CoreException
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p_field_search.FieldAccessInCallinMethod.R.name",
- FIELD,
+ "p_field_search.FieldAccessInCallinMethod.R.name",
+ FIELD,
READ_ACCESSES|WRITE_ACCESSES,
- getJavaSearchScopeFromPackage("p_field_search"),
+ getJavaSearchScopeFromPackage("p_field_search"),
resultCollector);
-
+
assertSearchResults("Team decl, fq name",
"src/p_field_search/FieldAccessInCallinMethod.java void p_field_search.FieldAccessInCallinMethod$R.setName(String) [name]",
resultCollector);
}
-
+
/**
* Parameter mappings contain field references.
*/
- public void test003() throws CoreException
+ public void test003() throws CoreException
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
resultCollector.showAccuracy = true;
search(
- "p_field_search.FieldAccessInParameterMapping.Role.value",
- FIELD,
+ "p_field_search.FieldAccessInParameterMapping.Role.value",
+ FIELD,
REFERENCES,
- getJavaSearchScopeFromPackage("p_field_search"),
+ getJavaSearchScopeFromPackage("p_field_search"),
resultCollector);
-
+
assertSearchResults("Expecting two exact matching references to Role.value",
- "src/p_field_search/FieldAccessInParameterMapping.java p_field_search.FieldAccessInParameterMapping$Role rm1() -> baseMethod() [value] EXACT_MATCH\n" +
+ "src/p_field_search/FieldAccessInParameterMapping.java p_field_search.FieldAccessInParameterMapping$Role rm1() -> baseMethod() [value] EXACT_MATCH\n" +
"src/p_field_search/FieldAccessInParameterMapping.java p_field_search.FieldAccessInParameterMapping$Role rm2() <- baseMethod4() [value] EXACT_MATCH",
resultCollector);
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/search/org/eclipse/objectteams/otdt/tests/search/OTJavaMethodSearchTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/search/org/eclipse/objectteams/otdt/tests/search/OTJavaMethodSearchTests.java
index 2d2571603..93c2f24c8 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/search/org/eclipse/objectteams/otdt/tests/search/OTJavaMethodSearchTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/search/org/eclipse/objectteams/otdt/tests/search/OTJavaMethodSearchTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2015 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -45,7 +45,7 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
super(name);
}
-
+
public static Test suite()
{
/*
@@ -54,14 +54,14 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
suite.addTest(new OTJavaMethodSearchTests("test031b"));
return suite;
/*/
-
+
return new Suite(OTJavaMethodSearchTests.class);
//*/
}
/**
* Search for:<br>
- * - method references<br>
+ * - method references<br>
* Search pattern:<br>
* - fully qualified name<br>
* Searched element:<br>
@@ -75,17 +75,17 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p.Team1.Role1.roleMethod()",
- METHOD,
+ "p.Team1.Role1.roleMethod()",
+ METHOD,
REFERENCES,
- getJavaSearchScopeFromPackage("p"),
+ getJavaSearchScopeFromPackage("p"),
resultCollector);
-
- assertSearchResults("src/p/Team1.java void p.Team1$Role1.testMethod() [roleMethod()]\n" +
+
+ assertSearchResults("src/p/Team1.java void p.Team1$Role1.testMethod() [roleMethod()]\n" +
"src/p/Team1.java p.Team1$Role1 roleMethod -> baseMethod [roleMethod]",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method references<br>
@@ -102,17 +102,17 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "roleMethod()",
- METHOD,
+ "roleMethod()",
+ METHOD,
REFERENCES,
- getJavaSearchScopeFromPackage("p"),
+ getJavaSearchScopeFromPackage("p"),
resultCollector);
-
+
assertSearchResults("src/p/Team1.java void p.Team1$Role1.testMethod() [roleMethod()]\n" +
"src/p/Team1.java p.Team1$Role1 roleMethod -> baseMethod [roleMethod]",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method declarations<br>
@@ -128,16 +128,16 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p.Team1.Role1.roleMethod()",
- METHOD,
+ "p.Team1.Role1.roleMethod()",
+ METHOD,
DECLARATIONS,
- getJavaSearchScopeFromPackage("p"),
+ getJavaSearchScopeFromPackage("p"),
resultCollector);
-
+
assertSearchResults("src/p/Team1.java void p.Team1$Role1.roleMethod() [roleMethod]",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method declarations<br>
@@ -153,16 +153,16 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "roleMethod()",
- METHOD,
+ "roleMethod()",
+ METHOD,
DECLARATIONS,
getJavaSearchScopeFromPackage("p"),
resultCollector);
-
+
assertSearchResults("src/p/Team1.java void p.Team1$Role1.roleMethod() [roleMethod]",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method references<br>
@@ -175,7 +175,7 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
* Expected search result:<br>
* Declarations in<br>
* - role<br>
- * References in<br>
+ * References in<br>
* - role method (testMethod)<br>
* - role method spec in a callout without signature (abstract method decl in the same role)<br>
*see TPX-293(fixed)<br>
@@ -184,18 +184,18 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p.Team1.Role1.roleMethod()",
- METHOD,
+ "p.Team1.Role1.roleMethod()",
+ METHOD,
ALL_OCCURRENCES,
getJavaSearchScopeFromPackage("p"),
resultCollector);
-
- assertSearchResults("src/p/Team1.java void p.Team1$Role1.roleMethod() [roleMethod]\n" +
- "src/p/Team1.java void p.Team1$Role1.testMethod() [roleMethod()]\n" +
+
+ assertSearchResults("src/p/Team1.java void p.Team1$Role1.roleMethod() [roleMethod]\n" +
+ "src/p/Team1.java void p.Team1$Role1.testMethod() [roleMethod()]\n" +
"src/p/Team1.java p.Team1$Role1 roleMethod -> baseMethod [roleMethod]",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method references<br>
@@ -216,18 +216,18 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "roleMethod()",
- METHOD,
+ "roleMethod()",
+ METHOD,
ALL_OCCURRENCES,
- getJavaSearchScopeFromPackage("p"),
+ getJavaSearchScopeFromPackage("p"),
resultCollector);
-
- assertSearchResults("src/p/Team1.java void p.Team1$Role1.roleMethod() [roleMethod]\n" +
+
+ assertSearchResults("src/p/Team1.java void p.Team1$Role1.roleMethod() [roleMethod]\n" +
"src/p/Team1.java void p.Team1$Role1.testMethod() [roleMethod()]\n" +
"src/p/Team1.java p.Team1$Role1 roleMethod -> baseMethod [roleMethod]",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method declarations<br>
@@ -243,16 +243,16 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p.Team1.Role2.role2Method()",
- METHOD,
+ "p.Team1.Role2.role2Method()",
+ METHOD,
DECLARATIONS,
- getJavaSearchScopeFromPackage("p"),
+ getJavaSearchScopeFromPackage("p"),
resultCollector);
-
+
assertSearchResults("src/p/Team1.java void p.Team1$Role2.role2Method() [role2Method]",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method declarations<br>
@@ -268,16 +268,16 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "role2Method()",
- METHOD,
+ "role2Method()",
+ METHOD,
DECLARATIONS,
- getJavaSearchScopeFromPackage("p"),
+ getJavaSearchScopeFromPackage("p"),
resultCollector);
-
+
assertSearchResults("src/p/Team1.java void p.Team1$Role2.role2Method() [role2Method]",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method declarations<br>
@@ -299,19 +299,19 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p.Team1.Role2.role2Method()",
- METHOD,
+ "p.Team1.Role2.role2Method()",
+ METHOD,
ALL_OCCURRENCES,
- getJavaSearchScopeFromPackage("p"),
+ getJavaSearchScopeFromPackage("p"),
resultCollector);
-
- assertSearchResults("src/p/Team1.java void p.Team1$Role2.role2Method() [role2Method]\n" +
- "src/p/Team1.java void p.Team1$Role2.testMethod() [role2Method()]\n" +
+
+ assertSearchResults("src/p/Team1.java void p.Team1$Role2.role2Method() [role2Method]\n" +
+ "src/p/Team1.java void p.Team1$Role2.testMethod() [role2Method()]\n" +
"src/p/Team1.java p.Team1$Role2 role2Method <- baseMethod [role2Method]",
resultCollector);
}
-
- /**
+
+ /**
* Search for:<br>
* - method declarations<br>
* - method references<br>
@@ -331,18 +331,18 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "role2Method()",
- METHOD,
+ "role2Method()",
+ METHOD,
ALL_OCCURRENCES,
- getJavaSearchScopeFromPackage("p"),
+ getJavaSearchScopeFromPackage("p"),
resultCollector);
-
- assertSearchResults("src/p/Team1.java void p.Team1$Role2.role2Method() [role2Method]\n" +
+
+ assertSearchResults("src/p/Team1.java void p.Team1$Role2.role2Method() [role2Method]\n" +
"src/p/Team1.java void p.Team1$Role2.testMethod() [role2Method()]\n" +
"src/p/Team1.java p.Team1$Role2 role2Method <- baseMethod [role2Method]",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method references<br>
@@ -359,17 +359,17 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "role2Method()",
- METHOD,
+ "role2Method()",
+ METHOD,
REFERENCES,
- getJavaSearchScopeFromPackage("p"),
+ getJavaSearchScopeFromPackage("p"),
resultCollector);
-
+
assertSearchResults("src/p/Team1.java void p.Team1$Role2.testMethod() [role2Method()]\n" +
"src/p/Team1.java p.Team1$Role2 role2Method <- baseMethod [role2Method]",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method references<br>
@@ -386,17 +386,17 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p.Team1.Role2.role2Method()",
- METHOD,
+ "p.Team1.Role2.role2Method()",
+ METHOD,
REFERENCES,
- getJavaSearchScopeFromPackage("p"),
+ getJavaSearchScopeFromPackage("p"),
resultCollector);
-
- assertSearchResults("src/p/Team1.java void p.Team1$Role2.testMethod() [role2Method()]\n" +
+
+ assertSearchResults("src/p/Team1.java void p.Team1$Role2.testMethod() [role2Method()]\n" +
"src/p/Team1.java p.Team1$Role2 role2Method <- baseMethod [role2Method]",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method references<br>
@@ -413,17 +413,17 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p_long_methodspecs.Team1.Role1.roleMethodWithAbstractDecl",
- METHOD,
+ "p_long_methodspecs.Team1.Role1.roleMethodWithAbstractDecl",
+ METHOD,
REFERENCES,
- getJavaSearchScopeFromPackage("p_long_methodspecs"),
+ getJavaSearchScopeFromPackage("p_long_methodspecs"),
resultCollector);
-
- assertSearchResults("src/p_long_methodspecs/Team1.java void p_long_methodspecs.Team1$Role1.testMethod() [roleMethodWithAbstractDecl()]\n" +
+
+ assertSearchResults("src/p_long_methodspecs/Team1.java void p_long_methodspecs.Team1$Role1.testMethod() [roleMethodWithAbstractDecl()]\n" +
"src/p_long_methodspecs/Team1.java p_long_methodspecs.Team1$Role1 roleMethodWithAbstractDecl() -> baseMethod() [roleMethodWithAbstractDecl()]",
resultCollector);
}
-
+
/**
* Search for:
* - method references
@@ -440,17 +440,17 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p_long_methodspecs.Team1.Role1.roleMethodWithoutAbstractDecl",
- METHOD,
+ "p_long_methodspecs.Team1.Role1.roleMethodWithoutAbstractDecl",
+ METHOD,
REFERENCES,
- getJavaSearchScopeFromPackage("p_long_methodspecs"),
+ getJavaSearchScopeFromPackage("p_long_methodspecs"),
resultCollector);
//TODO(jsv) the role method spec in a callout is reported as reference. after improvement resolved change expected test result
- assertSearchResults("src/p_long_methodspecs/Team1.java void p_long_methodspecs.Team1$Role1.testMethod() [roleMethodWithoutAbstractDecl()]\n" +
+ assertSearchResults("src/p_long_methodspecs/Team1.java void p_long_methodspecs.Team1$Role1.testMethod() [roleMethodWithoutAbstractDecl()]\n" +
"src/p_long_methodspecs/Team1.java p_long_methodspecs.Team1$Role1 roleMethodWithoutAbstractDecl() -> baseMethod() [roleMethodWithoutAbstractDecl()]",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method references<br>
@@ -467,17 +467,17 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "roleMethodWithAbstractDecl()",
- METHOD,
+ "roleMethodWithAbstractDecl()",
+ METHOD,
REFERENCES,
- getJavaSearchScopeFromPackage("p_long_methodspecs"),
+ getJavaSearchScopeFromPackage("p_long_methodspecs"),
resultCollector);
-
+
assertSearchResults("src/p_long_methodspecs/Team1.java void p_long_methodspecs.Team1$Role1.testMethod() [roleMethodWithAbstractDecl()]\n" +
"src/p_long_methodspecs/Team1.java p_long_methodspecs.Team1$Role1 roleMethodWithAbstractDecl() -> baseMethod() [roleMethodWithAbstractDecl()]",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method references<br>
@@ -494,24 +494,24 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "roleMethodWithoutAbstractDecl()",
- METHOD,
+ "roleMethodWithoutAbstractDecl()",
+ METHOD,
REFERENCES,
- getJavaSearchScopeFromPackage("p_long_methodspecs"),
+ getJavaSearchScopeFromPackage("p_long_methodspecs"),
resultCollector);
//TODO(jsv) the role method spec in a callout is reported as reference. after improvement resolved change expected test result
assertSearchResults("src/p_long_methodspecs/Team1.java void p_long_methodspecs.Team1$Role1.testMethod() [roleMethodWithoutAbstractDecl()]\n" +
"src/p_long_methodspecs/Team1.java p_long_methodspecs.Team1$Role1 roleMethodWithoutAbstractDecl() -> baseMethod() [roleMethodWithoutAbstractDecl()]",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method declaration<br>
* Search pattern:<br>
* - fully qualified name<br>
* Searched element:<br>
- * - "method declaration" in callout binding<br>
+ * - "method declaration" in callout binding<br>
* Expected search result:<br>
* Declaration in<br>
* - none<br>
@@ -520,23 +520,23 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p_long_methodspecs.Team1.Role1.roleMethodWithoutAbstractDecl()",
- METHOD,
+ "p_long_methodspecs.Team1.Role1.roleMethodWithoutAbstractDecl()",
+ METHOD,
DECLARATIONS,
- getJavaSearchScopeFromPackage("p_long_methodspecs"),
+ getJavaSearchScopeFromPackage("p_long_methodspecs"),
resultCollector);
- //TODO(jsv) the role method spec in a callout is reported as reference. after improvement resolved change expected test result
+ //TODO(jsv) the role method spec in a callout is reported as reference. after improvement resolved change expected test result
assertSearchResults("",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method declaration<br>
* Search pattern:<br>
* - simple name<br>
* Searched element:<br>
- * - "method declaration" in callout binding<br>
+ * - "method declaration" in callout binding<br>
* Expected search result:<br>
* Declaration in<br>
* - none<br>
@@ -545,8 +545,8 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "roleMethodWithoutAbstractDecl()",
- METHOD,
+ "roleMethodWithoutAbstractDecl()",
+ METHOD,
DECLARATIONS,
getJavaSearchScopeFromPackage("p_long_methodspecs"),
resultCollector);
@@ -554,7 +554,7 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
assertSearchResults("",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method declaration<br>
@@ -575,18 +575,18 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p_long_methodspecs.Team1.Role1.roleMethodWithAbstractDecl()",
- METHOD,
+ "p_long_methodspecs.Team1.Role1.roleMethodWithAbstractDecl()",
+ METHOD,
ALL_OCCURRENCES,
getJavaSearchScopeFromPackage("p_long_methodspecs"),
resultCollector);
-
- assertSearchResults("src/p_long_methodspecs/Team1.java void p_long_methodspecs.Team1$Role1.roleMethodWithAbstractDecl() [roleMethodWithAbstractDecl]\n" +
- "src/p_long_methodspecs/Team1.java void p_long_methodspecs.Team1$Role1.testMethod() [roleMethodWithAbstractDecl()]\n" +
+
+ assertSearchResults("src/p_long_methodspecs/Team1.java void p_long_methodspecs.Team1$Role1.roleMethodWithAbstractDecl() [roleMethodWithAbstractDecl]\n" +
+ "src/p_long_methodspecs/Team1.java void p_long_methodspecs.Team1$Role1.testMethod() [roleMethodWithAbstractDecl()]\n" +
"src/p_long_methodspecs/Team1.java p_long_methodspecs.Team1$Role1 roleMethodWithAbstractDecl() -> baseMethod() [roleMethodWithAbstractDecl()]",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method declaration<br>
@@ -595,7 +595,7 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
* - fully qualified name<br>
* - combined pattern<br>
* Searched element:<br>
- * - "method declaration" in callout binding<br>
+ * - "method declaration" in callout binding<br>
* Expected search result:<br>
* Declaration in<br>
* - none<br>
@@ -607,17 +607,17 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p_long_methodspecs.Team1.Role1.roleMethodWithoutAbstractDecl()",
- METHOD,
+ "p_long_methodspecs.Team1.Role1.roleMethodWithoutAbstractDecl()",
+ METHOD,
ALL_OCCURRENCES,
getJavaSearchScopeFromPackage("p_long_methodspecs"),
resultCollector);
//TODO(jsv) the role method spec in a callout is reported as reference. after improvement resolved change expected test result
- assertSearchResults("src/p_long_methodspecs/Team1.java void p_long_methodspecs.Team1$Role1.testMethod() [roleMethodWithoutAbstractDecl()]\n" +
+ assertSearchResults("src/p_long_methodspecs/Team1.java void p_long_methodspecs.Team1$Role1.testMethod() [roleMethodWithoutAbstractDecl()]\n" +
"src/p_long_methodspecs/Team1.java p_long_methodspecs.Team1$Role1 roleMethodWithoutAbstractDecl() -> baseMethod() [roleMethodWithoutAbstractDecl()]",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method declaration<br>
@@ -625,7 +625,7 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
* Search pattern:<br>
* - fully qualified name<br>
* Searched element:<br>
- * - role method<br>
+ * - role method<br>
* Expected search result:<br>
* Declaration in<br>
* - role<br>
@@ -633,23 +633,23 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
* - role method<br>
* - role method spec in callin binding with signature<br>
*/
-
+
public void test021() throws CoreException
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p_long_methodspecs.Team1.Role2.role2Method()",
- METHOD,
+ "p_long_methodspecs.Team1.Role2.role2Method()",
+ METHOD,
ALL_OCCURRENCES,
- getJavaSearchScopeFromPackage("p_long_methodspecs"),
+ getJavaSearchScopeFromPackage("p_long_methodspecs"),
resultCollector);
-
- assertSearchResults("src/p_long_methodspecs/Team1.java void p_long_methodspecs.Team1$Role2.role2Method() [role2Method]\n" +
- "src/p_long_methodspecs/Team1.java void p_long_methodspecs.Team1$Role2.testMethod() [role2Method()]\n" +
+
+ assertSearchResults("src/p_long_methodspecs/Team1.java void p_long_methodspecs.Team1$Role2.role2Method() [role2Method]\n" +
+ "src/p_long_methodspecs/Team1.java void p_long_methodspecs.Team1$Role2.testMethod() [role2Method()]\n" +
"src/p_long_methodspecs/Team1.java p_long_methodspecs.Team1$Role2 role2Method() <- baseMethod() [role2Method()]",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method declaration<br>
@@ -657,7 +657,7 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
* Search pattern:<br>
* - simple name<br>
* Searched element:<br>
- * - role method<br>
+ * - role method<br>
* Expected search result:<br>
* Declaration in<br>
* - role<br>
@@ -669,25 +669,25 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "role2Method()",
- METHOD,
+ "role2Method()",
+ METHOD,
ALL_OCCURRENCES,
- getJavaSearchScopeFromPackage("p_long_methodspecs"),
+ getJavaSearchScopeFromPackage("p_long_methodspecs"),
resultCollector);
-
- assertSearchResults("src/p_long_methodspecs/Team1.java void p_long_methodspecs.Team1$Role2.role2Method() [role2Method]\n" +
+
+ assertSearchResults("src/p_long_methodspecs/Team1.java void p_long_methodspecs.Team1$Role2.role2Method() [role2Method]\n" +
"src/p_long_methodspecs/Team1.java void p_long_methodspecs.Team1$Role2.testMethod() [role2Method()]\n" +
"src/p_long_methodspecs/Team1.java p_long_methodspecs.Team1$Role2 role2Method() <- baseMethod() [role2Method()]",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method references<br>
* Search pattern:<br>
* - simple name<br>
* Searched element:<br>
- * - role method<br>
+ * - role method<br>
* Expected search result:<br>
* References in<br>
* - role method<br>
@@ -697,24 +697,24 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "role2Method()",
- METHOD,
+ "role2Method()",
+ METHOD,
REFERENCES,
- getJavaSearchScopeFromPackage("p_long_methodspecs"),
+ getJavaSearchScopeFromPackage("p_long_methodspecs"),
resultCollector);
-
+
assertSearchResults("src/p_long_methodspecs/Team1.java void p_long_methodspecs.Team1$Role2.testMethod() [role2Method()]\n" +
"src/p_long_methodspecs/Team1.java p_long_methodspecs.Team1$Role2 role2Method() <- baseMethod() [role2Method()]",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method references<br>
* Search pattern:<br>
* - fully qualified name<br>
* Searched element:<br>
- * - role method<br>
+ * - role method<br>
* Expected search result:<br>
* References in<br>
* - role method<br>
@@ -724,24 +724,24 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p_long_methodspecs.Team1.Role2.role2Method()",
- METHOD,
+ "p_long_methodspecs.Team1.Role2.role2Method()",
+ METHOD,
REFERENCES,
- getJavaSearchScopeFromPackage("p_long_methodspecs"),
+ getJavaSearchScopeFromPackage("p_long_methodspecs"),
resultCollector);
-
- assertSearchResults("src/p_long_methodspecs/Team1.java void p_long_methodspecs.Team1$Role2.testMethod() [role2Method()]\n" +
+
+ assertSearchResults("src/p_long_methodspecs/Team1.java void p_long_methodspecs.Team1$Role2.testMethod() [role2Method()]\n" +
"src/p_long_methodspecs/Team1.java p_long_methodspecs.Team1$Role2 role2Method() <- baseMethod() [role2Method()]",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method declarations (in hierarchy) -> decl & fully qualified name<br>
* Search pattern:<br>
* - fully qualified name<br>
* Searched element:<br>
- * - base method<br>
+ * - base method<br>
* Expected search result:<br>
* Declarations in<br>
* - base class AA <br>
@@ -752,52 +752,52 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p2.AA.mm1()",
- METHOD,
+ "p2.AA.mm1()",
+ METHOD,
DECLARATIONS,
- getJavaSearchScopeFromPackage("p2"),
+ getJavaSearchScopeFromPackage("p2"),
resultCollector);
-
- assertSearchResults("src/p2/A.java void p2.A.mm1() [mm1]\n" +
+
+ assertSearchResults("src/p2/A.java void p2.A.mm1() [mm1]\n" +
"src/p2/AA.java void p2.AA.mm1() [mm1]",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method references<br>
* Search pattern:<br>
* - fully qualified name<br>
* Searched element:<br>
- * - base method<br>
+ * - base method<br>
* Expected search result:<br>
- * References in
+ * References in
* <li> base method spec in callout mapping with signature. corresponding abstract declaration of role method is inherited from super role<br>
*/
public void test026() throws CoreException
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p.Base1.baseMethod()",
- METHOD,
+ "p.Base1.baseMethod()",
+ METHOD,
REFERENCES,
- getJavaSearchScopeFromPackage("p"),
+ getJavaSearchScopeFromPackage("p"),
resultCollector);
-
+
assertSearchResults("src/p/Team1.java p.Team1$Role1 roleMethod -> baseMethod [baseMethod]\n" +
"src/p/Team1.java p.Team1$Role1 roleMethod3 -> baseMethod [baseMethod]\n" +
"src/p/Team1.java p.Team1$Role2 role2Method <- baseMethod [baseMethod]"
,
resultCollector);
}
-
+
/**
* Search for:<br>
* - method declarations (in hierarchy) -> decl & fully qualified name<br>
* Search pattern:<br>
* - fully qualified name<br>
* Searched element:<br>
- * - role method<br>
+ * - role method<br>
* Expected search result:<br>
* Declarations in<br>
* - role class TestTeam1.TestRole1 <br>
@@ -807,24 +807,24 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p_implicit_inheritance.TestTeam1.TestRole1.roleMethod()",
- METHOD,
+ "p_implicit_inheritance.TestTeam1.TestRole1.roleMethod()",
+ METHOD,
DECLARATIONS,
- getJavaSearchScopeFromPackage("p_implicit_inheritance"),
+ getJavaSearchScopeFromPackage("p_implicit_inheritance"),
resultCollector);
-
- assertSearchResults("src/p_implicit_inheritance/TestTeam1.java void p_implicit_inheritance.TestTeam1$TestRole1.roleMethod() [roleMethod]\n" +
+
+ assertSearchResults("src/p_implicit_inheritance/TestTeam1.java void p_implicit_inheritance.TestTeam1$TestRole1.roleMethod() [roleMethod]\n" +
"src/p_implicit_inheritance/TestTeam2.java void p_implicit_inheritance.TestTeam2$TestRole1.roleMethod() [roleMethod]",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method reference<br>
* Search pattern:<br>
* - fully qualified name<br>
* Searched element:<br>
- * - private role method<br>
+ * - private role method<br>
* Expected search result:<br>
* References in<br>
* - ref in TestTeam1.TestRole1.roleMethod() <br>
@@ -834,25 +834,25 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p_implicit_inheritance.TestTeam1.TestRole1.privateRoleMethod()",
- METHOD,
+ "p_implicit_inheritance.TestTeam1.TestRole1.privateRoleMethod()",
+ METHOD,
REFERENCES,
- getJavaSearchScopeFromPackage("p_implicit_inheritance"),
+ getJavaSearchScopeFromPackage("p_implicit_inheritance"),
resultCollector);
-
+
assertSearchResults("Search for references of private role method, fully qualified name",
"src/p_implicit_inheritance/TestTeam1.java void p_implicit_inheritance.TestTeam1$TestRole1.roleMethod() [privateRoleMethod()]\n" +
"src/p_implicit_inheritance/TestTeam2.java void p_implicit_inheritance.TestTeam2$TestRole1.foo() [privateRoleMethod()]",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method declaration<br>
* Search pattern:<br>
* - fully qualified name<br>
* Searched element:<br>
- * - declaration of a role method which overrides an implicit inherited role method<br>
+ * - declaration of a role method which overrides an implicit inherited role method<br>
* Expected search result:<br>
* Declaration in<br>
* - Declaration in TestTeam2.TestRole1<br>
@@ -861,24 +861,24 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p_implicit_inheritance.TestTeam2.TestRole1.roleMethod()",
- METHOD,
+ "p_implicit_inheritance.TestTeam2.TestRole1.roleMethod()",
+ METHOD,
DECLARATIONS,
- getJavaSearchScopeFromPackage("p_implicit_inheritance"),
+ getJavaSearchScopeFromPackage("p_implicit_inheritance"),
resultCollector);
-
+
assertSearchResults("Search for role method decl which overrides an implicit inherited method. fq name",
"src/p_implicit_inheritance/TestTeam2.java void p_implicit_inheritance.TestTeam2$TestRole1.roleMethod() [roleMethod]",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method declaration<br>
* Search pattern:<br>
* - fully qualified name<br>
* Searched element:<br>
- * - declaration of a role method which does not override an implicit inherited role method<br>
+ * - declaration of a role method which does not override an implicit inherited role method<br>
* Expected search result:<br>
* Declaration in<br>
* - Declaration in TestTeam2.TestRole1<br>
@@ -887,17 +887,17 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p_implicit_inheritance.TestTeam2.TestRole1.roleMethod2()",
- METHOD,
+ "p_implicit_inheritance.TestTeam2.TestRole1.roleMethod2()",
+ METHOD,
DECLARATIONS,
- getJavaSearchScopeFromPackage("p_implicit_inheritance"),
+ getJavaSearchScopeFromPackage("p_implicit_inheritance"),
resultCollector);
-
+
assertSearchResults("Search for role method decl which does not override an implicit inherited method. fq name",
"src/p_implicit_inheritance/TestTeam2.java void p_implicit_inheritance.TestTeam2$TestRole1.roleMethod2() [roleMethod2]",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method declaration<br>
@@ -906,7 +906,7 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
* - combined method pattern
* - fully qualified name<br>
* Searched element:<br>
- * - all occurences of a role method which overrides an implicit inherited role method<br>
+ * - all occurences of a role method which overrides an implicit inherited role method<br>
* Expected search result:<br>
* Declaration in<br>
* - Declaration in TestTeam2.TestRole1<br>
@@ -917,17 +917,17 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p_implicit_inheritance.TestTeam2.TestRole1.roleMethod()",
- METHOD,
+ "p_implicit_inheritance.TestTeam2.TestRole1.roleMethod()",
+ METHOD,
ALL_OCCURRENCES,
- getJavaSearchScopeFromPackage("p_implicit_inheritance"),
+ getJavaSearchScopeFromPackage("p_implicit_inheritance"),
resultCollector);
-
+
assertSearchResults("Search for role method decl which overrides an implicit inherited method. fq name",
"src/p_implicit_inheritance/TestTeam2.java void p_implicit_inheritance.TestTeam2$TestRole1.roleMethod() [roleMethod]",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method references<br>
@@ -935,7 +935,7 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
* - combined method pattern
* - fully qualified name<br>
* Searched element:<br>
- * - all references to a role method which is overridden in a tsub role<br>
+ * - all references to a role method which is overridden in a tsub role<br>
* Expected search result:<br>
* - reference:
* TSuperMessageSend in body of method TestTeam2.TestRole1.roleMethod()<br>
@@ -945,12 +945,12 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p_implicit_inheritance.TestTeam1.TestRole1.roleMethod()",
- METHOD,
+ "p_implicit_inheritance.TestTeam1.TestRole1.roleMethod()",
+ METHOD,
REFERENCES,
- getJavaSearchScopeFromPackage("p_implicit_inheritance"),
+ getJavaSearchScopeFromPackage("p_implicit_inheritance"),
resultCollector);
-
+
assertSearchResults("Search for role method decl which is overridden in a tsub role. fq name",
"src/p_implicit_inheritance/TestTeam2.java void p_implicit_inheritance.TestTeam2$TestRole1.roleMethod() [roleMethod()]",
resultCollector);
@@ -963,7 +963,7 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
* - combined method pattern
* - fully qualified name<br>
* Searched element:<br>
- * - all references to a role method which is overridden in a tsub role<br>
+ * - all references to a role method which is overridden in a tsub role<br>
* Expected search result:<br>
* - reference:
* TSuperMessageSend in body of method TestTeam2.TestRole1.roleMethod()<br>
@@ -976,12 +976,12 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
IType roleType = this.javaProject.findType("p_implicit_inheritance.TestTeam1.TestRole1");
IMethod roleMethod = roleType.getMethod("roleMethod", new String[0]);
search(
- roleMethod,
- REFERENCES,
+ roleMethod,
+ REFERENCES,
SearchPattern.R_EXACT_MATCH|SearchPattern.R_CASE_SENSITIVE,
- getJavaSearchScopeFromPackage("p_implicit_inheritance"),
+ getJavaSearchScopeFromPackage("p_implicit_inheritance"),
resultCollector);
-
+
assertSearchResults("Search for role method decl which is overridden in a tsub role. fq name",
"src/p_implicit_inheritance/TestTeam2.java void p_implicit_inheritance.TestTeam2$TestRole1.roleMethod() [roleMethod()]",
resultCollector);
@@ -994,7 +994,7 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
* - combined method pattern
* - fully qualified name<br>
* Searched element:<br>
- * - all references to a role method which overriddes in a tsuper method<br>
+ * - all references to a role method which overriddes in a tsuper method<br>
* Expected search result:<br>
* - reference:
* Nothing, specifically *not* the TSuperMessageSend in it's own body<br>
@@ -1006,17 +1006,17 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
IType roleType = this.javaProject.findType("p_implicit_inheritance.TestTeam2.TestRole1");
IMethod roleMethod = roleType.getMethod("roleMethod", new String[0]);
search(
- roleMethod,
- REFERENCES,
+ roleMethod,
+ REFERENCES,
SearchPattern.R_EXACT_MATCH|SearchPattern.R_CASE_SENSITIVE,
- getJavaSearchScopeFromPackage("p_implicit_inheritance"),
+ getJavaSearchScopeFromPackage("p_implicit_inheritance"),
resultCollector);
-
+
assertSearchResults("Search for role method decl which overrides an implicit inherited method. fq name",
"",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method declaration<br>
@@ -1025,7 +1025,7 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
* - combined method pattern
* - fully qualified name<br>
* Searched element:<br>
- * - declaration of a role method which does not override an implicit inherited role method<br>
+ * - declaration of a role method which does not override an implicit inherited role method<br>
* Expected search result:<br>
* Declaration in<br>
* - Declaration in TestTeam2.TestRole1<br>
@@ -1035,25 +1035,25 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p_implicit_inheritance.TestTeam2.TestRole1.roleMethod2()",
- METHOD,
+ "p_implicit_inheritance.TestTeam2.TestRole1.roleMethod2()",
+ METHOD,
ALL_OCCURRENCES,
- getJavaSearchScopeFromPackage("p_implicit_inheritance"),
+ getJavaSearchScopeFromPackage("p_implicit_inheritance"),
resultCollector);
-
+
assertSearchResults("Search for role method decl which does not override an implicit inherited method. fq name",
"src/p_implicit_inheritance/TestTeam2.java void p_implicit_inheritance.TestTeam2$TestRole1.roleMethod2() [roleMethod2]",
resultCollector);
}
-
-
+
+
/**
* Search for:<br>
* - method references<br>
* Search pattern:<br>
* - use IMethod<br>
* Searched element:<br>
- * - method zork overridden in TestTeam2.TestRole1<br>
+ * - method zork overridden in TestTeam2.TestRole1<br>
* Expected search result:<br>
* Declaration in<br>
* - Reference in TestTeam1.TestRole1.privateRoleMethod, but not tsr.zork() referring to regular super role<br>
@@ -1065,23 +1065,23 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
IJavaProject project= getJavaProject("OTJavaSearch");
IType type= project.findType("p_implicit_inheritance.TestTeam2.TestRole1");
IMethod method= type.getMethod("zork", new String[0]);
- search(method,
+ search(method,
REFERENCES,
- getJavaSearchScopeFromPackage("p_implicit_inheritance"),
+ getJavaSearchScopeFromPackage("p_implicit_inheritance"),
resultCollector);
-
+
assertSearchResults("Search for role method call within tsuper method. fq name",
"src/p_implicit_inheritance/TestTeam1.java void p_implicit_inheritance.TestTeam1$TestRole1.privateRoleMethod() [zork()]",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method declarations<br>
* Search pattern:<br>
* - fully qualified name<br>
* Searched element:<br>
- * - callin method in a bound role
+ * - callin method in a bound role
* Expected search result:<br>
* Declaration in<br>
* - 1 Declaration in Team1.Role1<br>
@@ -1090,25 +1090,25 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p_callin_method.Team1.Role1.callinMethod()",
- METHOD,
+ "p_callin_method.Team1.Role1.callinMethod()",
+ METHOD,
DECLARATIONS,
- getJavaSearchScopeFromPackage("p_callin_method"),
+ getJavaSearchScopeFromPackage("p_callin_method"),
resultCollector);
-
+
assertSearchResults("Search for declaration of callin method. fq name",
"src/p_callin_method/Team1.java void p_callin_method.Team1$Role1.callinMethod() [callinMethod]",
resultCollector);
}
-
-
+
+
/**
* Search for:<br>
* - method declarations<br>
* Search pattern:<br>
* - JavaElement<br>
* Searched element:<br>
- * - callin method in a bound role
+ * - callin method in a bound role
* Expected search result:<br>
* Declaration in<br>
* - 1 Declaration in Team1.Role1<br>
@@ -1116,21 +1116,21 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
public void test034() throws CoreException
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
-
+
IType type = getRole(getTestProjectDir(),
"src",
"p_callin_method",
"Team1",
"Role1");
-
+
IMethod method = type.getMethods()[0];
-
+
search(
- method,
+ method,
DECLARATIONS,
- getJavaSearchScopeFromPackage("p_callin_method"),
+ getJavaSearchScopeFromPackage("p_callin_method"),
resultCollector);
-
+
assertSearchResults("Search for declaration of callin method. javaModel",
"src/p_callin_method/Team1.java void p_callin_method.Team1$Role1.callinMethod() [callinMethod]",
resultCollector);
@@ -1142,7 +1142,7 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
* Search pattern:<br>
* - JavaElement<br>
* Searched element:<br>
- * - callin method in a bound role and the method references
+ * - callin method in a bound role and the method references
* Expected search result:<br>
* Declaration in<br>
* - 1 Declaration in Team1.Role1<br>
@@ -1152,28 +1152,28 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
public void test035() throws CoreException
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
-
+
IType type = getRole(getTestProjectDir(),
"src",
"p_callin_method",
"Team1",
"Role1");
-
+
IMethod method = type.getMethods()[0];
-
+
search(
- method,
+ method,
ALL_OCCURRENCES,
- getJavaSearchScopeFromPackage("p_callin_method"),
+ getJavaSearchScopeFromPackage("p_callin_method"),
resultCollector);
-
+
assertSearchResults("Search for all occurrences of callin method. javaModel",
"src/p_callin_method/Team1.java void p_callin_method.Team1$Role1.callinMethod() [callinMethod]\n" +
"src/p_callin_method/Team1.java void p_callin_method.Team1$Role1.callinMethod() [callinMethod()]\n" +
"src/p_callin_method/Team1.java p_callin_method.Team1$Role1 callinMethod <- baseMethod [callinMethod]",
resultCollector);
}
-
+
/**
* Reference to private role method (with focus set):
* Search for:<br>
@@ -1195,13 +1195,13 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p_callin_method.Team1.Role1.privateRoleMethod(String)",
- METHOD,
+ "p_callin_method.Team1.Role1.privateRoleMethod(String)",
+ METHOD,
REFERENCES,
method, /* focus */
- getJavaSearchScopeFromPackage("p_callin_method"),
+ getJavaSearchScopeFromPackage("p_callin_method"),
resultCollector);
-
+
assertSearchResults("src/p_callin_method/Team1.java void p_callin_method.Team1$Role1.callinMethodParam(String) [privateRoleMethod(str)]",
resultCollector);
}
@@ -1212,7 +1212,7 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
* Search pattern:<br>
* - fully qualified name<br>
* Searched element:<br>
- * - references of a private base method whose name is used in the subclass to declare a non private method
+ * - references of a private base method whose name is used in the subclass to declare a non private method
* Expected search result:<br>
* References in<br>
* - Reference fo foo() in A.m()<br>
@@ -1222,26 +1222,26 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
IType classA = getType(getTestProjectDir(), "src", "p_TPX_363", "A");
IMethod methodFoo = classA.getMethod("foo", new String[0]);
-
+
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- methodFoo,
+ methodFoo,
REFERENCES,
- getJavaSearchScopeFromPackage("p_TPX_363"),
+ getJavaSearchScopeFromPackage("p_TPX_363"),
resultCollector);
-
+
assertSearchResults("see TPX-363, fq name",
"src/p_TPX_363/A.java void p_TPX_363.A.m() [foo()]",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method declaration<br>
* Search pattern:<br>
* - fully qualified name<br>
* Searched element:<br>
- * - declaration of a private base method whose name is used in the subclass to declare a non private method
+ * - declaration of a private base method whose name is used in the subclass to declare a non private method
* Expected search result:<br>
* Declaration<br>
* - private void A.foo()<br>
@@ -1251,31 +1251,31 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
IType classA = getType(getTestProjectDir(), "src", "p_TPX_363", "A");
IMethod methodFoo = classA.getMethod("foo", new String[0]);
-
+
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- methodFoo,
+ methodFoo,
DECLARATIONS,
- getJavaSearchScopeFromPackage("p_TPX_363"),
+ getJavaSearchScopeFromPackage("p_TPX_363"),
resultCollector);
-
+
assertSearchResults("see TPX-363, fq name",
"src/p_TPX_363/A.java void p_TPX_363.A.foo() [foo]\n" +
"src/p_TPX_363/B.java void p_TPX_363.B.foo() [foo]",
resultCollector);
}
-
+
//see TPX-229
public void testTPX_229_1() throws CoreException
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p3.TeamA.RoleA.foo()",
- METHOD,
+ "p3.TeamA.RoleA.foo()",
+ METHOD,
REFERENCES,
- getJavaSearchScopeFromPackage("p3"),
+ getJavaSearchScopeFromPackage("p3"),
resultCollector);
-
+
assertSearchResults("src/p3/TeamA.java void p3.TeamA$RoleA.bar() [foo()]\n" +
"src/p3/TeamB.java p3.TeamB$RoleB foo -> foo [foo]",
resultCollector);
@@ -1285,23 +1285,23 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p3.TeamB.RoleB.foo()",
- METHOD,
+ "p3.TeamB.RoleB.foo()",
+ METHOD,
REFERENCES,
- getJavaSearchScopeFromPackage("p3"),
+ getJavaSearchScopeFromPackage("p3"),
resultCollector);
-
+
assertSearchResults("src/p3/TeamB.java p3.TeamB$RoleB foo -> foo [foo]",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method declarations<br>
* Search pattern:<br>
* - JavaElement<br>
* Searched element:<br>
- * - callin method in a bound role
+ * - callin method in a bound role
* Expected search result:<br>
* Declaration in<br>
* - 1 Declaration in Team1.Role1<br>
@@ -1309,21 +1309,21 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
public void testTPX_483() throws CoreException
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
-
+
IType type = getRole(getTestProjectDir(),
"src",
"p_callin_method",
"Team1",
"Role1");
-
+
IMethod method = type.getMethods()[1];
-
+
search(
- method,
+ method,
DECLARATIONS,
- getJavaSearchScopeFromPackage("p_callin_method"),
+ getJavaSearchScopeFromPackage("p_callin_method"),
resultCollector);
-
+
assertSearchResults("Search for declaration of callin method. javaModel",
"src/p_callin_method/Team1.java void p_callin_method.Team1$Role1.callinMethodParam(String) [callinMethodParam]",
resultCollector);
@@ -1335,7 +1335,7 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
* Search pattern:<br>
* - fully qualified name<br>
* Searched element:<br>
- * - overridden method gulp()<br>
+ * - overridden method gulp()<br>
* Expected search result:<br>
* Reference in<br>
* - ref in TestTeam1.TestRole1.bar() <br>
@@ -1350,21 +1350,21 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
IMethod method= type.getMethod("gulp", new String[0]);
search( method,
REFERENCES,
- getJavaSearchScopeFromPackage("p_implicit_inheritance"),
+ getJavaSearchScopeFromPackage("p_implicit_inheritance"),
resultCollector);
-
+
assertSearchResults("Search for references of implicitly overridden role method, fully qualified name",
"src/p_implicit_inheritance/TestTeam1.java void p_implicit_inheritance.TestTeam1$TestRole1.bar() [gulp()]",
resultCollector);
}
-
+
/**
* Search for:<br>
* - method reference<br>
* Search pattern:<br>
* - fully qualified name<br>
* Searched element:<br>
- * - overridden method gulp()<br>
+ * - overridden method gulp()<br>
* Expected search result:<br>
* Reference in<br>
* - ref in TestTeam1.TestRole1.bar() <br>
@@ -1377,9 +1377,9 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
search("p_implicit_inheritance.TestTeam1.TestRole2.gulp()",
METHOD,
REFERENCES,
- getJavaSearchScopeFromPackage("p_implicit_inheritance"),
+ getJavaSearchScopeFromPackage("p_implicit_inheritance"),
resultCollector);
-
+
assertSearchResults("Search for references of implicitly overridden role method, fully qualified name",
"src/p_implicit_inheritance/TestTeam1.java void p_implicit_inheritance.TestTeam1$TestRole2.good() [gulp()]",
resultCollector);
@@ -1395,9 +1395,9 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
// not yet seeing the NPE :-/
search( callout,
REFERENCES,
- getJavaSearchScopeFromPackages(new String[]{"bug325297","bug325297/OuterTeam"}),
+ getJavaSearchScopeFromPackages(new String[]{"bug325297","bug325297/OuterTeam"}),
resultCollector);
-
+
assertSearchResults("Search for references of callout-defined role method in role within specific nesting/inheritance structure",
"src/bug325297/OuterTeam/InnerSubTeam.java void bug325297.OuterTeam.InnerSubTeam.test(InnerRole) [concat(\"1\", \"2\")]",
resultCollector);
@@ -1408,16 +1408,16 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
IJavaProject project= getJavaProject("OTJavaSearch");
IType type= project.findType("bug323076.MyTeam");
IMethod method = type.getMethod("foo", new String[]{"[QMyBase;"});
-
+
search( method,
REFERENCES,
- getJavaSearchScopeFromPackages(new String[]{"bug323076"}),
+ getJavaSearchScopeFromPackages(new String[]{"bug323076"}),
resultCollector);
-
+
assertSearchResults("Search for references to method with array lifting",
"src/bug323076/MyTeam.java void bug323076.MyTeam.test() [foo(new MyBase[]{ new MyBase() })]",
resultCollector);
-
+
}
public void test459055() throws CoreException {
@@ -1425,16 +1425,16 @@ public class OTJavaMethodSearchTests extends OTJavaSearchTestBase
IJavaProject project= getJavaProject("OTJavaSearch");
IType type= project.findType("bug459055.MyTeam.MyRole");
IMethod method = type.getMethod("targetMethod", new String[0]);
-
+
search( method,
REFERENCES,
R_EXACT_MATCH | R_CASE_SENSITIVE | R_FULL_MATCH,
- getJavaSearchScopeFromPackages(new String[]{"bug459055", "bug459055/MyTeam"}),
+ getJavaSearchScopeFromPackages(new String[]{"bug459055", "bug459055/MyTeam"}),
resultCollector);
-
+
assertSearchResults("Search for references to method of role file",
"src/bug459055/MyTeam.java void bug459055.MyTeam.teamTest(R) [targetMethod()]\n" +
"src/bug459055/MyTeam/MyRole.java void bug459055.MyTeam.MyRole.sourceMethod() [targetMethod()]",
- resultCollector);
+ resultCollector);
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/search/org/eclipse/objectteams/otdt/tests/search/OTJavaSearchTestBase.java b/testplugins/org.eclipse.objectteams.otdt.tests/search/org/eclipse/objectteams/otdt/tests/search/OTJavaSearchTestBase.java
index b75e42ebb..f34dbe9b1 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/search/org/eclipse/objectteams/otdt/tests/search/OTJavaSearchTestBase.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/search/org/eclipse/objectteams/otdt/tests/search/OTJavaSearchTestBase.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -55,7 +55,7 @@ import org.eclipse.objectteams.otdt.core.IMethodMapping;
/**
* Tests the Java search engine where results are JavaElements and source
* positions.
- *
+ *
* @version $Id: OTJavaSearchTestBase.java 23494 2010-02-05 23:06:44Z stephan $
*/
public class OTJavaSearchTestBase extends FileBasedSearchTest implements
@@ -420,29 +420,29 @@ public class OTJavaSearchTestBase extends FileBasedSearchTest implements
return SearchEngine
.createJavaSearchScope(new IJavaProject[] { getJavaProject("OTJavaSearch") });
}
-
+
IJavaSearchScope getJavaSearchScopeFromTypes(IType[] types)
{
return SearchEngine
.createJavaSearchScope(types);
}
-
+
IJavaSearchScope getJavaSearchScopeFromPackage(String packageName)
{
IPackageFragment packageFragment = null;
try
{
packageFragment = getPackageFragment(getTestProjectDir(),"src", packageName);
- }
+ }
catch (JavaModelException e)
{
return null;
}
-
+
return SearchEngine
.createJavaSearchScope(new IPackageFragment[]{packageFragment});
}
-
+
IJavaSearchScope getJavaSearchScopeFromPackages(String[] packageNames)
{
IPackageFragment[] packageFragments = new IPackageFragment[packageNames.length];
@@ -454,7 +454,7 @@ public class OTJavaSearchTestBase extends FileBasedSearchTest implements
String packageName = packageNames[idx];
IPackageFragment packageFragment = getPackageFragment(getTestProjectDir(),"src", packageName);
packageFragments[idx] = packageFragment;
- }
+ }
catch (JavaModelException e)
{
return null;
@@ -469,7 +469,7 @@ public class OTJavaSearchTestBase extends FileBasedSearchTest implements
setTestProjectDir("OTJavaSearch");
super.setUpSuite();
}
-
+
protected void setUp() throws Exception
{
super.setUp();
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/search/org/eclipse/objectteams/otdt/tests/search/OTJavaTypeSearchTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/search/org/eclipse/objectteams/otdt/tests/search/OTJavaTypeSearchTests.java
index d4f204c3d..d4bc7b7cb 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/search/org/eclipse/objectteams/otdt/tests/search/OTJavaTypeSearchTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/search/org/eclipse/objectteams/otdt/tests/search/OTJavaTypeSearchTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -32,12 +32,12 @@ import org.eclipse.objectteams.otdt.core.IRoleType;
/**
* @author svacina
- *
+ *
* @version $Id: OTJavaTypeSearchTests.java 23494 2010-02-05 23:06:44Z stephan $
*/
//Note: in case of search for type declaration with fully qualified name use the search method with the current JavaModel
-// and not the fully qualified name as string -> Workbench use the javaElement to build the search pattern
+// and not the fully qualified name as string -> Workbench use the javaElement to build the search pattern
public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
{
private Map originalOptions;
@@ -46,7 +46,7 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
{
super(name);
}
-
+
public static Test suite()
{
if (false)
@@ -72,7 +72,7 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
this.originalOptions = this.javaProject.getOptions(true);
this.javaProject.setOption(JavaCore.COMPILER_DOC_COMMENT_SUPPORT, JavaCore.ENABLED);
}
-
+
public void tearDown() throws Exception {
this.javaProject.setOptions(originalOptions);
super.tearDown();
@@ -84,10 +84,10 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
private void disableJavadocOptions() {
this.javaProject.setOption(JavaCore.COMPILER_DOC_COMMENT_SUPPORT, JavaCore.DISABLED);
}
-
+
/**
* Search for:<br>
- * - Team declaration<br>
+ * - Team declaration<br>
* Search pattern:<br>
* - fully qualified name<br>
* Searched element:<br>
@@ -100,20 +100,20 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p_type_search.T1",
- TYPE,
+ "p_type_search.T1",
+ TYPE,
DECLARATIONS,
- getJavaSearchScopeFromPackage("p_type_search"),
+ getJavaSearchScopeFromPackage("p_type_search"),
resultCollector);
-
+
assertSearchResults("Team decl, fq name",
"src/p_type_search/T1.java p_type_search.T1 [T1]",
resultCollector);
}
-
+
/**
* Search for:<br>
- * - Team declaration<br>
+ * - Team declaration<br>
* Search pattern:<br>
* - simple name<br>
* Searched element:<br>
@@ -126,20 +126,20 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "T1",
- TYPE,
+ "T1",
+ TYPE,
DECLARATIONS,
- getJavaSearchScopeFromPackage("p_type_search"),
+ getJavaSearchScopeFromPackage("p_type_search"),
resultCollector);
-
+
assertSearchResults("Team decl, simple name",
"src/p_type_search/T1.java p_type_search.T1 [T1]",
resultCollector);
}
-
+
/**
* Search for:<br>
- * - Interface References in the implementors<br>
+ * - Interface References in the implementors<br>
* Search pattern:<br>
* - fully qualified name<br>
* Searched element:<br>
@@ -156,24 +156,24 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p_type_search.I1",
- TYPE,
+ "p_type_search.I1",
+ TYPE,
IMPLEMENTORS,
getJavaSearchScopeFromPackages(new String[]{"p_type_search","p_type_search.T6"}),
resultCollector);
-
+
assertSearchResults("Interface References in the implementors, fq name",
- "src/p_type_search/B1.java p_type_search.B1 [I1]\n" +
+ "src/p_type_search/B1.java p_type_search.B1 [I1]\n" +
"src/p_type_search/T1.java p_type_search.T1 [I1]\n" +
"src/p_type_search/T2.java p_type_search.T2$R0 [I1]\n" +
"src/p_type_search/T2.java p_type_search.T2$T3 [I1]\n" +
"src/p_type_search/T6/R6.java p_type_search.T6.R6 [I1]",
resultCollector);
}
-
+
/**
* Search for:<br>
- * - References in Implementors of a Interface<br>
+ * - References in Implementors of a Interface<br>
* Search pattern:<br>
* - simple name<br>
* Searched element:<br>
@@ -190,24 +190,24 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "I1",
- TYPE,
+ "I1",
+ TYPE,
IMPLEMENTORS,
getJavaSearchScopeFromPackages(new String[]{"p_type_search","p_type_search.T6"}),
resultCollector);
-
+
assertSearchResults("Interface References in the implementors, simple name",
- "src/p_type_search/B1.java p_type_search.B1 [I1]\n" +
+ "src/p_type_search/B1.java p_type_search.B1 [I1]\n" +
"src/p_type_search/T1.java p_type_search.T1 [I1]\n" +
"src/p_type_search/T2.java p_type_search.T2$R0 [I1]\n" +
"src/p_type_search/T2.java p_type_search.T2$T3 [I1]\n" +
"src/p_type_search/T6/R6.java p_type_search.T6.R6 [I1]",
resultCollector);
}
-
+
/**
* Search for:<br>
- * - Role declaration<br>
+ * - Role declaration<br>
* Search pattern:<br>
* - fully qualified name<br>
* Searched element:<br>
@@ -220,20 +220,20 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p_type_search.T2.R1",
- TYPE,
+ "p_type_search.T2.R1",
+ TYPE,
DECLARATIONS,
- getJavaSearchScopeFromPackage("p_type_search"),
+ getJavaSearchScopeFromPackage("p_type_search"),
resultCollector);
-
+
assertSearchResults("role declaration, fully qualified name",
"src/p_type_search/T2.java p_type_search.T2$R1 [R1]",
resultCollector);
}
-
+
/**
* Search for:<br>
- * - Role declaration<br>
+ * - Role declaration<br>
* Search pattern:<br>
* - simple name<br>
* Searched element:<br>
@@ -246,20 +246,20 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "R1",
- TYPE,
+ "R1",
+ TYPE,
DECLARATIONS,
- getJavaSearchScopeFromPackage("p_type_search"),
+ getJavaSearchScopeFromPackage("p_type_search"),
resultCollector);
-
+
assertSearchResults("role declaration, simple",
"src/p_type_search/T2.java p_type_search.T2$R1 [R1]",
resultCollector);
}
-
+
/**
* Search for:<br>
- * - Role reference in lifting type<br>
+ * - Role reference in lifting type<br>
* Search pattern:<br>
* - fully qualified name<br>
* Searched element:<br>
@@ -272,20 +272,20 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "p_type_search.T2.R1",
- TYPE,
+ "p_type_search.T2.R1",
+ TYPE,
REFERENCES,
- getJavaSearchScopeFromPackage("p_type_search"),
+ getJavaSearchScopeFromPackage("p_type_search"),
resultCollector);
-
+
assertSearchResults("Role reference in lifting type, fq name",
"src/p_type_search/T2.java void p_type_search.T2.teamMethod(B1) [R1]",
resultCollector);
}
-
+
/**
* Search for:<br>
- * - Role reference in lifting type<br>
+ * - Role reference in lifting type<br>
* Search pattern:<br>
* - simple name<br>
* Searched element:<br>
@@ -298,28 +298,28 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "R1",
- TYPE,
+ "R1",
+ TYPE,
REFERENCES,
- getJavaSearchScopeFromPackage("p_type_search"),
+ getJavaSearchScopeFromPackage("p_type_search"),
resultCollector);
-
+
assertSearchResults("Role reference in lifting type, simple name",
"src/p_type_search/T2.java void p_type_search.T2.teamMethod(B1) [R1]",
resultCollector);
}
-
+
// Fine Grained: restrict to class instance creation
public void testRoleLiftingReferences3() throws CoreException
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "R1",
- TYPE,
+ "R1",
+ TYPE,
CLASS_INSTANCE_CREATION_TYPE_REFERENCE,
- getJavaSearchScopeFromPackage("p_type_search"),
+ getJavaSearchScopeFromPackage("p_type_search"),
resultCollector);
-
+
assertSearchResults("Role reference in lifting type - restricted to class instance creation",
"src/p_type_search/T2.java void p_type_search.T2.teamMethod(B1) [R1]",
resultCollector);
@@ -330,14 +330,14 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "R8",
- TYPE,
+ "R8",
+ TYPE,
CLASS_INSTANCE_CREATION_TYPE_REFERENCE,
- getJavaSearchScopeFromPackage("p_type_search"),
+ getJavaSearchScopeFromPackage("p_type_search"),
resultCollector);
-
+
assertSearchResults("Role lifting references - restricted to class instance creation",
- "src/p_type_search/T8.java p_type_search.T8$R8 consumeR8(R8) <- getB3() [R8]\n" +
+ "src/p_type_search/T8.java p_type_search.T8$R8 consumeR8(R8) <- getB3() [R8]\n" +
"src/p_type_search/T8.java p_type_search.T8$R8 getR8() -> getB3() [R8]",
resultCollector);
}
@@ -347,14 +347,14 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "R6",
- TYPE,
+ "R6",
+ TYPE,
CLASS_INSTANCE_CREATION_TYPE_REFERENCE,
- getJavaSearchScopeFromPackage("p_type_search"),
+ getJavaSearchScopeFromPackage("p_type_search"),
resultCollector);
-
+
assertSearchResults("Role reference in method spec, lifting position - restricted to class instance creation",
- "src/p_type_search/T2.java void p_type_search.T2.teamMethod(B3) [R6]\n" + // declared lifting
+ "src/p_type_search/T2.java void p_type_search.T2.teamMethod(B3) [R6]\n" + // declared lifting
"src/p_type_search/T2.java p_type_search.T2$R6 role6Method(R6) <- compareTo(B3) [R6]", // callin arg lifting
resultCollector);
}
@@ -364,12 +364,12 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "R6",
- TYPE,
+ "R6",
+ TYPE,
CLASS_INSTANCE_CREATION_TYPE_REFERENCE|PARAMETER_DECLARATION_TYPE_REFERENCE,
- getJavaSearchScopeFromPackage("p_type_search"),
+ getJavaSearchScopeFromPackage("p_type_search"),
resultCollector);
-
+
assertSearchResults("Role reference in method spec, lifting position - restricted to class instance creation or method parameter",
"src/p_type_search/T2.java void p_type_search.T2.teamMethod(B3) [R6]\n" + // declared lifting
"src/p_type_search/T2.java boolean p_type_search.T2$R6.role6Method(R6) [R6]\n" + // method parameter
@@ -382,12 +382,12 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "R6",
- TYPE,
+ "R6",
+ TYPE,
REFERENCES,
- getJavaSearchScopeFromPackage("p_type_search"),
+ getJavaSearchScopeFromPackage("p_type_search"),
resultCollector);
-
+
assertSearchResults("Role reference in method spec, lifting position - all references",
"src/p_type_search/T2.java void p_type_search.T2.teamMethod(B3) [R6]\n" + // declared lifting
"src/p_type_search/T2.java boolean p_type_search.T2$R6.role6Method(R6) [R6]\n" + // method parameter
@@ -395,43 +395,43 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
"src/p_type_search/T6.java p_type_search.T6 [R6]", // javadoc @role tag
resultCollector);
}
-
+
// see https://svn.objectteams.org/trac/ot/ticket/81
- public void testRoleReferenceInPrecedences() throws CoreException
+ public void testRoleReferenceInPrecedences() throws CoreException
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "R71",
- TYPE,
+ "R71",
+ TYPE,
REFERENCES,
- getJavaSearchScopeFromPackage("p_type_search"),
+ getJavaSearchScopeFromPackage("p_type_search"),
resultCollector);
-
+
assertSearchResults("Role reference in precedence declaration, simple name",
"src/p_type_search/T7.java p_type_search.T7 [R71]",
resultCollector);
}
// see https://svn.objectteams.org/trac/ot/ticket/82
- public void testRoleReferenceInPredicate() throws CoreException
+ public void testRoleReferenceInPredicate() throws CoreException
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "R72",
- TYPE,
+ "R72",
+ TYPE,
REFERENCES,
- getJavaSearchScopeFromPackage("p_type_search"),
+ getJavaSearchScopeFromPackage("p_type_search"),
resultCollector);
-
+
assertSearchResults("Role reference in precedence declaration, simple name",
"src/p_type_search/T7.java p_type_search.T7 [R72]\n"+ // precedence
"src/p_type_search/T7.java boolean p_type_search.T7$R72._OT$base_when() [R72]", // predicate
resultCollector);
}
-
+
/**
* Search for:<br>
- * - Role declaration<br>
+ * - Role declaration<br>
* Search pattern:<br>
* - javaModel<br>
* Searched element:<br>
@@ -452,15 +452,15 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
DECLARATIONS,
getJavaSearchScopeFromProject(),
resultCollector);
-
+
assertSearchResults("Role declaration in role file, JavaModel",
"src/p_type_search/T6/R6.java p_type_search.T6.R6 [R6]",
resultCollector);
}
-
+
/**
* Search for:<br>
- * - Role declaration<br>
+ * - Role declaration<br>
* Search pattern:<br>
* - simple name<br>
* Searched element:<br>
@@ -473,21 +473,21 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
{
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
search(
- "R6",
- TYPE,
+ "R6",
+ TYPE,
DECLARATIONS,
- getJavaSearchScopeFromPackages(new String[]{"p_type_search.T6"}),
+ getJavaSearchScopeFromPackages(new String[]{"p_type_search.T6"}),
resultCollector);
-
+
assertSearchResults("Role declaration in role file, simple name",
"src/p_type_search/T6/R6.java p_type_search.T6.R6 [R6]",
resultCollector);
}
-
+
//base class as return type in callin callout with signature
/**
* Search for:<br>
- * - Base class references<br>
+ * - Base class references<br>
* Search pattern:<br>
* - JavaModel<br>
* Searched element:<br>
@@ -506,34 +506,34 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
"src",
"p_type_search",
"C1");
-
+
search(
- type,
+ type,
REFERENCES,
- getJavaSearchScopeFromPackages(new String[]{"p_type_search","p_type_search.T6"}),
+ getJavaSearchScopeFromPackages(new String[]{"p_type_search","p_type_search.T6"}),
resultCollector);
-
+
assertSearchResults("Base class references in callins/callouts as return types, JavaModel",
- "src/p_type_search/B1.java C1 p_type_search.B1.baseMethod3(B4) [C1]\n" +
- "src/p_type_search/T2.java C1 p_type_search.T2$R1.roleMethod(B4) [C1]\n" +
- "src/p_type_search/T2.java p_type_search.T2$R1 roleMethod(B4) <- baseMethod3(B4) [C1]\n" +
- "src/p_type_search/T2.java p_type_search.T2$R1 roleMethod(B4) <- baseMethod3(B4) [C1]\n" +
+ "src/p_type_search/B1.java C1 p_type_search.B1.baseMethod3(B4) [C1]\n" +
+ "src/p_type_search/T2.java C1 p_type_search.T2$R1.roleMethod(B4) [C1]\n" +
+ "src/p_type_search/T2.java p_type_search.T2$R1 roleMethod(B4) <- baseMethod3(B4) [C1]\n" +
+ "src/p_type_search/T2.java p_type_search.T2$R1 roleMethod(B4) <- baseMethod3(B4) [C1]\n" +
"src/p_type_search/T2.java p_type_search.T2$R1 roleMethod2(B4) -> baseMethod3(B4) [C1]\n" +
"src/p_type_search/T2.java p_type_search.T2$R1 roleMethod2(B4) -> baseMethod3(B4) [C1]",
resultCollector);
- }
-
+ }
+
//Base class in type binding (after playedBy (in nested teams und rolefiles))
/**
* Search for:<br>
- * - Base class references<br>
+ * - Base class references<br>
* Search pattern:<br>
* - JavaModel<br>
* Searched element:<br>
* - Base class references after playedBy keyword<br>
* Expected search result:<br>
* References in<br>
- * - p_type_search.T6.R6 (role file)<br>
+ * - p_type_search.T6.R6 (role file)<br>
* - p_type_search.T2.T3.R5 (nested team)<br>
* - p_type_search.B3 (as superclass)
*/
@@ -544,17 +544,17 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
"src",
"p_type_search",
"B2");
-
+
search(
- type,
+ type,
REFERENCES,
- getJavaSearchScopeFromPackages(new String[]{"p_type_search","p_type_search.T6"}),
+ getJavaSearchScopeFromPackages(new String[]{"p_type_search","p_type_search.T6"}),
resultCollector);
-
+
assertSearchResults("Base class after playedBy in roleFile and nested Team, JavaModel",
"src/p_type_search/B3.java p_type_search.B3 [B2]\n" +
- "src/p_type_search/T2.java p_type_search.T2$R6 [B2]\n" + // javadoc reference (@see)
- "src/p_type_search/T2.java p_type_search.T2$T3$R5 [B2]\n" +
+ "src/p_type_search/T2.java p_type_search.T2$R6 [B2]\n" + // javadoc reference (@see)
+ "src/p_type_search/T2.java p_type_search.T2$T3$R5 [B2]\n" +
"src/p_type_search/T6/R6.java p_type_search.T6.R6 [B2]",
resultCollector);
}
@@ -562,14 +562,14 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
//Base class in type binding (only after playedBy (in nested teams und rolefiles))
/**
* Search for:<br>
- * - Base class references<br>
+ * - Base class references<br>
* Search pattern:<br>
* - JavaModel<br>
* Searched element:<br>
* - Base class references after playedBy keyword<br>
* Expected search result:<br>
* References in<br>
- * - p_type_search.T6.R6 (role file)<br>
+ * - p_type_search.T6.R6 (role file)<br>
* - p_type_search.T2.T3.R5 (nested team)<br>
* - DON'T show B3 (cf. above)
*/
@@ -580,22 +580,22 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
"src",
"p_type_search",
"B2");
-
+
search(
- type,
+ type,
PLAYEDBY_REFERENCES,
- getJavaSearchScopeFromPackages(new String[]{"p_type_search","p_type_search.T6"}),
+ getJavaSearchScopeFromPackages(new String[]{"p_type_search","p_type_search.T6"}),
resultCollector);
-
+
assertSearchResults("Base class after playedBy in roleFile and nested Team, JavaModel",
- "src/p_type_search/T2.java p_type_search.T2$T3$R5 [B2]\n" +
+ "src/p_type_search/T2.java p_type_search.T2$T3$R5 [B2]\n" +
"src/p_type_search/T6/R6.java p_type_search.T6.R6 [B2]",
resultCollector);
}
//Base class in javadoc @role tag
/**
* Search for:<br>
- * - Role class references<br>
+ * - Role class references<br>
* Search pattern:<br>
* - JavaModel<br>
* Searched element:<br>
@@ -607,7 +607,7 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
public void test012b() throws CoreException
{
setJavadocOptions();
-
+
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
resultCollector.showAccuracy = true;
resultCollector.showInsideDoc = true;
@@ -618,13 +618,13 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
"T6");
IType type = getRole(teamType,
"T6.R6");
-
+
search(
- type,
+ type,
REFERENCES,
- getJavaSearchScopeFromPackages(new String[]{"p_type_search","p_type_search.T6"}),
+ getJavaSearchScopeFromPackages(new String[]{"p_type_search","p_type_search.T6"}),
resultCollector);
-
+
assertSearchResults("Javadoc role reference, JavaModel",
"src/p_type_search/T6.java p_type_search.T6 [R6] EXACT_MATCH INSIDE_JAVADOC",
resultCollector);
@@ -632,7 +632,7 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
//Base class in javadoc @role tag, filtered, not a playedBy reference.
/**
* Search for:<br>
- * - Base class references<br>
+ * - Base class references<br>
* Search pattern:<br>
* - JavaModel<br>
* Searched element:<br>
@@ -643,7 +643,7 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
public void test012c() throws CoreException
{
setJavadocOptions();
-
+
JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
IType teamType = getType(getTestProjectDir(),
"src",
@@ -651,29 +651,29 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
"T6");
IType type = getRole(teamType,
"T6.R6");
-
+
search(
- type,
+ type,
PLAYEDBY_REFERENCES,
- getJavaSearchScopeFromPackages(new String[]{"p_type_search","p_type_search.T6"}),
+ getJavaSearchScopeFromPackages(new String[]{"p_type_search","p_type_search.T6"}),
resultCollector);
-
+
assertSearchResults("Javadoc role reference, JavaModel",
"",
resultCollector);
}
-
+
// Base class in lifting type
/**
* Search for:<br>
- * - Base class references<br>
+ * - Base class references<br>
* Search pattern:<br>
* - JavaModel<br>
* Searched element:<br>
* - Base class references in lifting type<br>
* Expected search result:<br>
* References in<br>
- * - role declaration (public class R6 playedBy B3)<br>
+ * - role declaration (public class R6 playedBy B3)<br>
* - base side of lifting type (teamMethod(B3 as R6 role))<br>
* - regular base method (B3.compareTo(B3))<br>
* - regular base method (B3.getB3()B3)<br>
@@ -689,36 +689,36 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
"src",
"p_type_search",
"B3");
-
+
search(
- type,
+ type,
REFERENCES,
- getJavaSearchScopeFromPackages(new String[]{"p_type_search","p_type_search.T6"}),
+ getJavaSearchScopeFromPackages(new String[]{"p_type_search","p_type_search.T6"}),
resultCollector);
-
+
assertSearchResults("Base class after playedBy in roleFile and nested Team, JavaModel",
"src/p_type_search/B3.java boolean p_type_search.B3.compareTo(B3) [B3]\n" +
"src/p_type_search/B3.java B3 p_type_search.B3.getB3() [B3]\n" +
"src/p_type_search/T2.java void p_type_search.T2.teamMethod(B3) [B3]\n" +
- "src/p_type_search/T2.java p_type_search.T2$R6 [B3]\n" +
- "src/p_type_search/T2.java p_type_search.T2$R6 role6Method(R6) <- compareTo(B3) [B3]\n" +
+ "src/p_type_search/T2.java p_type_search.T2$R6 [B3]\n" +
+ "src/p_type_search/T2.java p_type_search.T2$R6 role6Method(R6) <- compareTo(B3) [B3]\n" +
"src/p_type_search/T8.java p_type_search.T8$R8 [B3]\n" +
- "src/p_type_search/T8.java p_type_search.T8$R8 consumeR8(R8) <- getB3() [B3]\n" +
+ "src/p_type_search/T8.java p_type_search.T8$R8 consumeR8(R8) <- getB3() [B3]\n" +
"src/p_type_search/T8.java p_type_search.T8$R8 getR8() -> getB3() [B3]",
resultCollector);
}
-
- // Base class as argument in method spec
+
+ // Base class as argument in method spec
/**
* Search for:<br>
- * - Base class references<br>
+ * - Base class references<br>
* Search pattern:<br>
* - JavaModel<br>
* Searched element:<br>
* - Base class references in method spec signature<br>
* Expected search result:<br>
* References in<br>
- * - callin / callout / method declaration<br>
+ * - callin / callout / method declaration<br>
*/
public void test014() throws CoreException
{
@@ -727,34 +727,34 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
"src",
"p_type_search",
"B4");
-
+
search(
- type,
+ type,
REFERENCES,
- getJavaSearchScopeFromPackages(new String[]{"p_type_search","p_type_search.T6"}),
+ getJavaSearchScopeFromPackages(new String[]{"p_type_search","p_type_search.T6"}),
resultCollector);
-
+
assertSearchResults("Base class as argument in callin callout with signature, JavaModel",
- "src/p_type_search/B1.java C1 p_type_search.B1.baseMethod3(B4) [B4]\n" +
- "src/p_type_search/T2.java C1 p_type_search.T2$R1.roleMethod(B4) [B4]\n" +
- "src/p_type_search/T2.java p_type_search.T2$R1 roleMethod(B4) <- baseMethod3(B4) [B4]\n" +
- "src/p_type_search/T2.java p_type_search.T2$R1 roleMethod(B4) <- baseMethod3(B4) [B4]\n" +
- "src/p_type_search/T2.java p_type_search.T2$R1 roleMethod2(B4) -> baseMethod3(B4) [B4]\n" +
+ "src/p_type_search/B1.java C1 p_type_search.B1.baseMethod3(B4) [B4]\n" +
+ "src/p_type_search/T2.java C1 p_type_search.T2$R1.roleMethod(B4) [B4]\n" +
+ "src/p_type_search/T2.java p_type_search.T2$R1 roleMethod(B4) <- baseMethod3(B4) [B4]\n" +
+ "src/p_type_search/T2.java p_type_search.T2$R1 roleMethod(B4) <- baseMethod3(B4) [B4]\n" +
+ "src/p_type_search/T2.java p_type_search.T2$R1 roleMethod2(B4) -> baseMethod3(B4) [B4]\n" +
"src/p_type_search/T2.java p_type_search.T2$R1 roleMethod2(B4) -> baseMethod3(B4) [B4]",
resultCollector);
}
-
+
// Base class as role attribute
/**
* Search for:<br>
- * - Base class references<br>
+ * - Base class references<br>
* Search pattern:<br>
* - JavaModel<br>
* Searched element:<br>
* - Base class references in private role attribute<br>
* Expected search result:<br>
* References in<br>
- * - p_type_search.T2.T3.R5<br>
+ * - p_type_search.T2.T3.R5<br>
*/
public void test015() throws CoreException
{
@@ -763,13 +763,13 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
"src",
"p_type_search",
"B5");
-
+
search(
- type,
+ type,
REFERENCES,
- getJavaSearchScopeFromPackages(new String[]{"p_type_search","p_type_search.T6"}),
+ getJavaSearchScopeFromPackages(new String[]{"p_type_search","p_type_search.T6"}),
resultCollector);
-
+
assertSearchResults("Base class in private role attribute, JavaModel",
"src/p_type_search/T2.java p_type_search.T2$T3$R5.b5 [B5]",
resultCollector);
@@ -778,7 +778,7 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
/**
* Search for:<br>
- * - Team reference<br>
+ * - Team reference<br>
* Search pattern:<br>
* - JavaModel<br>
* Searched element:<br>
@@ -794,21 +794,21 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
"src",
"p_type_search",
"T6");
-
+
search(
- type,
+ type,
REFERENCES,
- getJavaSearchScopeFromPackages(new String[]{"p_type_search","p_type_search.T6"}),
+ getJavaSearchScopeFromPackages(new String[]{"p_type_search","p_type_search.T6"}),
resultCollector);
-
+
assertSearchResults("Team reference in Team package, JavaModel",
"src/p_type_search/T6/R6.java [p_type_search.T6]",
resultCollector);
}
-
+
/**
* Search for:<br>
- * - Reference to externalized role using <code>type anchor</code>(base)<br>
+ * - Reference to externalized role using <code>type anchor</code>(base)<br>
* Search pattern:<br>
* - JavaModel<br>
* Searched element:<br>
@@ -827,13 +827,13 @@ public class OTJavaTypeSearchTests extends OTJavaSearchTestBase
"p_type_search",
"T5",
"R8");
-
+
search(
- type.getCorrespondingJavaElement(),
+ type.getCorrespondingJavaElement(),
REFERENCES,
- getJavaSearchScopeFromPackages(new String[]{"p_type_search"}),
+ getJavaSearchScopeFromPackages(new String[]{"p_type_search"}),
resultCollector);
-
+
assertSearchResults("Reference to externalized role in field declaration, callin method, and after playedBy, JavaModel",
"src/p_type_search/T4.java p_type_search.T4$R7.aRoleOfMyBase [base.R8]\n" +
"src/p_type_search/T4.java void p_type_search.T4$R7.tm(base.R8) [base.R8]\n" +
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/AllTests.java
index 4c0a02cae..29fddfcde 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/AllTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -35,13 +35,13 @@ import org.eclipse.objectteams.otdt.tests.selection.codeselect.CodeSelectionTest
/**
* Enter a class description here!
- *
+ *
* @author jwloka
* @version $Id: AllTests.java 23494 2010-02-05 23:06:44Z stephan $
*/
public class AllTests extends TestCase {
- public AllTests(String name)
+ public AllTests(String name)
{
super(name);
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/OTSelectionJavadocTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/OTSelectionJavadocTest.java
index 7ee667054..518d42f29 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/OTSelectionJavadocTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/OTSelectionJavadocTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -27,7 +27,7 @@ import org.eclipse.jdt.core.tests.compiler.parser.SelectionJavadocTest;
/**
* Testing selection of OT-specific javadoc.
- *
+ *
* @author stephan
* @since 1.2.5
*/
@@ -36,7 +36,7 @@ public class OTSelectionJavadocTest extends SelectionJavadocTest {
public OTSelectionJavadocTest(String testName) {
super(testName);
}
-
+
public static Test suite() {
return buildAllCompliancesTestSuite(OTSelectionJavadocTest.class);
}
@@ -52,9 +52,9 @@ public class OTSelectionJavadocTest extends SelectionJavadocTest {
" */\n" +
"public team class T1 {\n" +
"}\n");
-
+
findJavadoc("MyRoFi");
-
+
assertValid("/**<SelectOnType:MyRoFi>*/\n");
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/OTSpecificSelectionWithinRoleTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/OTSpecificSelectionWithinRoleTests.java
index 9ff114609..44f596c93 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/OTSpecificSelectionWithinRoleTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/OTSpecificSelectionWithinRoleTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2016 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -25,36 +25,36 @@ import org.eclipse.jdt.core.tests.compiler.parser.AbstractSelectionTest;
/**
* Testing OT-specific selections within a role class.
- *
+ *
* @author brcan
*/
@SuppressWarnings("nls")
public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
{
- public OTSpecificSelectionWithinRoleTests(String testName)
+ public OTSpecificSelectionWithinRoleTests(String testName)
{
super(testName);
}
-
- //for type declarations see org.eclipse.objectteams.otdt.tests.selection.codeselect.CodeSelectionTests.
+
+ //for type declarations see org.eclipse.objectteams.otdt.tests.selection.codeselect.CodeSelectionTests.
//type references
/**
* Select role class name of externalized role.
*/
- public void test02()
+ public void test02()
{
- String str =
+ String str =
"public team class T1 {\n" +
" final T1 t1 = new T1();\n" +
" t1.R1 r1;\n" +
" public class R1 {\n" +
" }\n" +
"}\n";
-
+
String selectionStartBehind = "t1.";
String selectionEndBehind = ".R1";
-
+
String expectedCompletionNodeToString = "<SelectOnType:t1.R1>";
String completionIdentifier = "R1";
String expectedUnitDisplayString =
@@ -66,13 +66,13 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
" public T1() {\n" +
" }\n" +
"}\n";
-
+
String expectedReplacedSource = "t1.R1";
String testName = "<select role class name of externalized role>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
str.toCharArray(),
selectionStart,
@@ -83,24 +83,24 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
expectedReplacedSource,
testName);
}
-
+
//type references
/**
* Select role class name of externalized role, new syntax
*/
- public void testExternalizedRoleField()
+ public void testExternalizedRoleField()
{
- String str =
+ String str =
"public team class T1 {\n" +
" final T1 t1 = new T1();\n" +
" /*here*/R1<@t1> r1;\n" +
" public class R1 {\n" +
" }\n" +
"}\n";
-
+
String selectionStartBehind = "/*here*/";
String selectionEndBehind = "/R1";
-
+
String expectedCompletionNodeToString = "<SelectOnType:R1<@t1>>";
String completionIdentifier = "R1";
String expectedUnitDisplayString =
@@ -112,13 +112,13 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
" public T1() {\n" +
" }\n" +
"}\n";
-
+
String expectedReplacedSource = "R1";
String testName = "<select role class name of externalized role - new syntax>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
str.toCharArray(),
selectionStart,
@@ -133,9 +133,9 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
/**
* Select role class name of externalized role, new syntax
*/
- public void testExternalizedRoleAllocation()
+ public void testExternalizedRoleAllocation()
{
- String str =
+ String str =
"public team class T1 {\n" +
" void test(final T1 t1) {\n" +
" R1<@t1> r1 = new R1<@t1>();\n" +
@@ -143,10 +143,10 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
" public class R1 {\n" +
" }\n" +
"}\n";
-
+
String selectionStartBehind = " new ";
String selectionEndBehind = "new R1";
-
+
String expectedCompletionNodeToString = "<SelectOnAllocationExpression:new R1<@t1>()>";
String completionIdentifier = "R1";
String expectedUnitDisplayString =
@@ -159,13 +159,13 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
" R1<@t1> r1 = <SelectOnAllocationExpression:new R1<@t1>()>;\n" +
" }\n" +
"}\n";
-
+
String expectedReplacedSource = "new R1<@t1>()";
String testName = "<select role class name in allocation of externalized role - new syntax>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
str.toCharArray(),
selectionStart,
@@ -176,23 +176,23 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
expectedReplacedSource,
testName);
}
-
+
/**
* Select role class name in lifting method (declared lifting).
*/
public void test03()
{
- String str =
+ String str =
"public team class T1 {\n" +
" public void m1(B1 as R1 arg) {\n" +
" }\n" +
" public class R1 playedBy B1 {\n" +
" }\n" +
- "}\n";
-
+ "}\n";
+
String selectionStartBehind = "as ";
String selectionEndBehind = "as R1";
-
+
String expectedCompletionNodeToString = "<SelectOnType:R1>";
String completionIdentifier = "R1";
String expectedUnitDisplayString =
@@ -203,23 +203,23 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
" }\n" +
" public void m1(B1 as <SelectOnType:R1> arg) {\n" +
" }\n" +
- "}\n";
-
+ "}\n";
+
String expectedReplacedSource = "R1";
String testName = "<select role class name in lifting method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
@@ -227,15 +227,15 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
*/
public void test04()
{
- String str =
+ String str =
"public team class T1 {\n" +
" public class R1 playedBy base.R2 {\n" +
" }\n" +
- "}\n";
-
+ "}\n";
+
String selectionStartBehind = "base.";
String selectionEndBehind = "R2";
-
+
String expectedCompletionNodeToString = "<SelectOnType:_OT$base.R2>";
String completionIdentifier = "R2";
String expectedUnitDisplayString =
@@ -245,22 +245,22 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
" public T1() {\n" +
" }\n" +
"}\n";
-
+
String expectedReplacedSource = "base.R2";
String testName = "<select role class name in playedBy relation>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
@@ -268,16 +268,16 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
*/
public void test05()
{
- String str =
+ String str =
"public team class T1 {\n" +
" public class R1 playedBy B1 {\n" +
" R2 m1() -> R2 n1();\n" +
" }\n" +
- "}\n";
-
+ "}\n";
+
String selectionStartBehind = "B1 {\n ";
String selectionEndBehind = " R2";
-
+
String expectedCompletionNodeToString = "<SelectOnType:R2>";
String completionIdentifier = "R2";
String expectedUnitDisplayString =
@@ -288,39 +288,39 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
" public T1() {\n" +
" }\n" +
"}\n";
-
+
String expectedReplacedSource = "R2";
String testName = "<select role class name in method spec representing the return type>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
-
+
/**
* Select role class name in method spec. Role class is a parameter type in the method spec.
*/
public void test06()
{
- String str =
+ String str =
"public team class T1 {\n" +
" public class R1 playedBy B1 {\n" +
" void m1(R2 r2) -> void n1(R2 r2);\n" +
" }\n" +
- "}\n";
-
+ "}\n";
+
String selectionStartBehind = "m1(";
String selectionEndBehind = "m1(R2";
-
+
String expectedCompletionNodeToString = "<SelectOnType:R2>";
String completionIdentifier = "R2";
String expectedUnitDisplayString =
@@ -331,33 +331,33 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
" public T1() {\n" +
" }\n" +
"}\n";
-
+
String expectedReplacedSource = "R2";
String testName = "<select role class name in method spec representing a parameter type>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
//for method declarations see org.eclipse.objectteams.otdt.tests.selection.codeselect.CodeSelectionTests.
-
- //method references
+
+ //method references
/**
* Select role method name in a role method.
*/
public void test07()
{
- String str =
+ String str =
"public team class T1 {\n" +
" public class R1 playedBy B1 {\n" +
" public void rm1() {\n" +
@@ -366,11 +366,11 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
" rm1();\n" +
" }\n" +
" }\n" +
- "}\n";
-
+ "}\n";
+
String selectionStartBehind = "rm2() {\n ";
String selectionEndBehind = " rm1";
-
+
String expectedCompletionNodeToString = "<SelectOnMessageSend:rm1()>";
String completionIdentifier = "rm1";
String expectedUnitDisplayString =
@@ -384,42 +384,42 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
" }\n" +
" public T1() {\n" +
" }\n" +
- "}\n";
-
+ "}\n";
+
String expectedReplacedSource = "rm1()";
String testName = "<select role method name in a role method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
-
+
/**
* Select role method name in a callin binding.
*/
public void test08()
{
- String str =
+ String str =
"public team class T1 {\n" +
" public class R1 playedBy B1 {\n" +
" public void rm1() {\n" +
" }\n" +
" rm1 <- after n1;\n" +
" }\n" +
- "}\n";
-
+ "}\n";
+
String selectionStartBehind = "}\n ";
String selectionEndBehind = " rm1";
-
+
String expectedCompletionNodeToString = "<SelectOnMethodSpec:rm1>";
String completionIdentifier = "rm1";
String expectedUnitDisplayString =
@@ -433,22 +433,22 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
" public T1() {\n" +
" }\n" +
"}\n";
-
+
String expectedReplacedSource = "rm1";
String testName = "<select role method name in a callin binding>.java";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
//for role method spec of a callout binding see class CodeSelectionTests
@@ -458,7 +458,7 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
*/
public void test10()
{
- String str =
+ String str =
"public team class T1 {\n" +
" public class R1 playedBy B1 {\n" +
" public abstract int rm1();\n" +
@@ -467,11 +467,11 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
" result <- result\n" +
" }\n" +
" }\n" +
- "}\n";
-
+ "}\n";
+
String selectionStartBehind = "with {\n ";
String selectionEndBehind = " rm1";
-
+
String expectedCompletionNodeToString = "<SelectOnMessageSend:rm1()>";
String completionIdentifier = "rm1";
String expectedUnitDisplayString =
@@ -486,22 +486,22 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
" public T1() {\n" +
" }\n" +
"}\n";
-
+
String expectedReplacedSource = "rm1()";
String testName = "<select role method name in an expression inside a parameter mapping.>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
@@ -509,7 +509,7 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
*/
public void test10a()
{
- String str =
+ String str =
"public team class T1 {\n" +
" public class R1 playedBy B1 {\n" +
" public abstract int rm1();\n" +
@@ -518,11 +518,11 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
" result <- rm1()\n" +
" }\n" +
" }\n" +
- "}\n";
-
+ "}\n";
+
String selectionStartBehind = " result <- ";
String selectionEndBehind = "<- rm1";
-
+
String expectedCompletionNodeToString = "<SelectOnMessageSend:rm1()>";
String completionIdentifier = "rm1";
String expectedUnitDisplayString =
@@ -537,29 +537,29 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
" public T1() {\n" +
" }\n" +
"}\n";
-
+
String expectedReplacedSource = "rm1()";
String testName = "<select role method name in an expression inside a parameter mapping.>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select role method name in a callin method.
*/
public void test11()
{
- String str =
+ String str =
"public team class T1 {\n" +
" public class R1 playedBy B1 {\n" +
" public void rm1() {\n" +
@@ -569,11 +569,11 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
" base.rm2();\n" +
" }\n" +
" }\n" +
- "}\n";
-
+ "}\n";
+
String selectionStartBehind = "rm2() {\n ";
String selectionEndBehind = " rm1";
-
+
String expectedCompletionNodeToString = "<SelectOnMessageSend:rm1()>";
String completionIdentifier = "rm1";
String expectedUnitDisplayString =
@@ -585,25 +585,25 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
" <SelectOnMessageSend:rm1()>;\n" +
" }\n" +
" }\n" +
- " public T1() {\n" +
- " }\n" +
- "}\n";
-
+ " public T1() {\n" +
+ " }\n" +
+ "}\n";
+
String expectedReplacedSource = "rm1()";
String testName = "<select role method name in a callin method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
@@ -612,7 +612,7 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
*/
public void test11b()
{
- String str =
+ String str =
"public team class T1 {\n" +
" public class R1 playedBy B1 {\n" +
" public void rm1() {\n" +
@@ -623,11 +623,11 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
" }\n" +
" rm2 <- replace foo;" +
" }\n" +
- "}\n";
-
+ "}\n";
+
String selectionStartBehind = "base.";
String selectionEndBehind = "base.rm2";
-
+
String expectedCompletionNodeToString = "<SelectOnBaseCallMessageSend:base.rm2()>";
String expectedSelectionIdentifier = "rm2";
String expectedUnitDisplayString =
@@ -642,25 +642,25 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
" <<select base call in a callin method>:9,4>:\n" +
" rm2 <- replace foo;\n" +
" }\n" +
- " public T1() {\n" +
- " }\n" +
- "}\n";
-
+ " public T1() {\n" +
+ " }\n" +
+ "}\n";
+
String expectedSelectedSource = "base.rm2()";
String testName = "<select base call in a callin method>.java";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
expectedSelectionIdentifier,
expectedSelectedSource,
- testName);
+ testName);
}
/**
@@ -668,39 +668,39 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
*/
public void test12()
{
- String str =
+ String str =
"public team class T1 {\n" +
" public class R1 playedBy B1 when (this.isNotNull()) {\n" +
" public boolean isNotNull() {\n" +
" return true;" +
" }\n" +
" }\n" +
- "}\n";
-
+ "}\n";
+
String selectionStartBehind = "when (this.";
String selectionEndBehind = "this.isNotNull";
-
+
String expectedCompletionNodeToString = "<SelectOnMessageSend:this.isNotNull()>";
String completionIdentifier = "isNotNull";
String expectedUnitDisplayString =
- "public team class T1 {\n" +
- " public role class R1 playedBy B1 {\n" +
- " public boolean isNotNull() {\n" +
- " }\n" +
- " protected synchronized boolean _OT$when() {\n" +
- " return <SelectOnMessageSend:this.isNotNull()>;\n" +
- " }\n" +
- " }\n" +
- " public T1() {\n" +
- " }\n" +
+ "public team class T1 {\n" +
+ " public role class R1 playedBy B1 {\n" +
+ " public boolean isNotNull() {\n" +
+ " }\n" +
+ " protected synchronized boolean _OT$when() {\n" +
+ " return <SelectOnMessageSend:this.isNotNull()>;\n" +
+ " }\n" +
+ " }\n" +
+ " public T1() {\n" +
+ " }\n" +
"}\n";
-
+
String expectedReplacedSource = "this.isNotNull()";
String testName = "<select role method name in role-level guard>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
str.toCharArray(),
selectionStart,
@@ -714,12 +714,12 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
/**
* Select base method name in role-level base guard.
- * Former bug: base.m() was interpreted as base-call due to doubly
- * parsing the predicate (2nd parse with incorrect parser state).
+ * Former bug: base.m() was interpreted as base-call due to doubly
+ * parsing the predicate (2nd parse with incorrect parser state).
*/
public void test12base()
{
- String str =
+ String str =
"public team class T1 {\n" +
" void foo() { return; }\n" +
" public class R1 playedBy B1 base when (base.isReady()) {\n" +
@@ -727,34 +727,34 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
" return true;" +
" }\n" +
" }\n" +
- "}\n";
-
+ "}\n";
+
String selectionStartBehind = "when (base.";
String selectionEndBehind = "base.isReady";
-
+
String expectedCompletionNodeToString = "<SelectOnMessageSend:base.isReady()>";
String completionIdentifier = "isReady";
String expectedUnitDisplayString =
"public team class T1 {\n" +
- " public role class R1 playedBy B1 {\n" +
- " public boolean isNotNull() {\n" +
- " }\n" +
- " protected static synchronized boolean _OT$base_when(final _OT$unknownBaseType base) {\n" +
- " return <SelectOnMessageSend:base.isReady()>;\n" +
- " }\n" +
- " }\n" +
- " public T1() {\n" +
- " }\n" +
+ " public role class R1 playedBy B1 {\n" +
+ " public boolean isNotNull() {\n" +
+ " }\n" +
+ " protected static synchronized boolean _OT$base_when(final _OT$unknownBaseType base) {\n" +
+ " return <SelectOnMessageSend:base.isReady()>;\n" +
+ " }\n" +
+ " }\n" +
+ " public T1() {\n" +
+ " }\n" +
" void foo() {\n" +
" }\n" +
"}\n";
-
+
String expectedReplacedSource = "base.isReady()";
String testName = "<select role method name in role-level base guard>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
str.toCharArray(),
selectionStart,
@@ -767,14 +767,14 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
}
//for field declarations see org.eclipse.objectteams.otdt.tests.selection.codeselect.CodeSelectionTests
-
+
//field references
/**
* Select role field name in a role method.
*/
public void test13()
{
- String str =
+ String str =
"public team class T1 {\n" +
" public class R1 playedBy B1 {\n" +
" private int f;\n" +
@@ -782,11 +782,11 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
" this.f = 1;\n" +
" }\n" +
" }\n" +
- "}\n";
-
+ "}\n";
+
String selectionStartBehind = "rm1() {\n this.";
String selectionEndBehind = " this.f";
-
+
String expectedCompletionNodeToString = "<SelectionOnFieldReference:this.f>";
String completionIdentifier = "f";
String expectedUnitDisplayString =
@@ -797,25 +797,25 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
" <SelectionOnFieldReference:this.f>;\n" +
" }\n" +
" }\n" +
- " public T1() {\n" +
- " }\n" +
- "}\n";
-
+ " public T1() {\n" +
+ " }\n" +
+ "}\n";
+
String expectedReplacedSource = "this.f";
String testName = "<select role field name in a role method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
@@ -823,7 +823,7 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
*/
public void test14()
{
- String str =
+ String str =
"public team class T1 {\n" +
" public class R1 playedBy B1 {\n" +
" private int f;\n" +
@@ -832,11 +832,11 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
" base.rm1();\n" +
" }\n" +
" }\n" +
- "}\n";
-
+ "}\n";
+
String selectionStartBehind = "rm1() {\n ";
String selectionEndBehind = " f";
-
+
String expectedCompletionNodeToString = "<SelectOnName:f>";
String completionIdentifier = "f";
String expectedUnitDisplayString =
@@ -847,25 +847,25 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
" <SelectOnName:f>;\n" +
" }\n" +
" }\n" +
- " public T1() {\n" +
- " }\n" +
- "}\n";
-
+ " public T1() {\n" +
+ " }\n" +
+ "}\n";
+
String expectedReplacedSource = "f";
String testName = "<select role field name in a callin method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
@@ -874,7 +874,7 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
*/
public void test14b()
{
- String str =
+ String str =
"public team class T1 {\n" +
" public class R1 playedBy B1 {\n" +
" private int f;\n" +
@@ -883,11 +883,11 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
" base.rm1();\n" +
" }\n" +
" }\n" +
- "}\n";
-
+ "}\n";
+
String selectionStartBehind = "rm1() {\n this.";
String selectionEndBehind = " this.f";
-
+
String expectedCompletionNodeToString = "<SelectionOnFieldReference:this.f>";
String completionIdentifier = "f";
String expectedUnitDisplayString =
@@ -898,25 +898,25 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
" <SelectionOnFieldReference:this.f>;\n" +
" }\n" +
" }\n" +
- " public T1() {\n" +
- " }\n" +
- "}\n";
-
+ " public T1() {\n" +
+ " }\n" +
+ "}\n";
+
String expectedReplacedSource = "this.f";
String testName = "<select role field name in a callin method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
@@ -924,7 +924,7 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
*/
public void test15()
{
- String str =
+ String str =
"public team class T1 {\n" +
" public class R1 playedBy B1 {\n" +
" private int f;\n" +
@@ -934,11 +934,11 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
" result <- result\n" +
" }\n" +
" }\n" +
- "}\n";
-
+ "}\n";
+
String selectionStartBehind = "with {\n ";
String selectionEndBehind = " f";
-
+
String expectedCompletionNodeToString = "<SelectOnName:f>";
String completionIdentifier = "f";
String expectedUnitDisplayString =
@@ -953,13 +953,13 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
" public T1() {\n" +
" }\n" +
"}\n";
-
+
String expectedReplacedSource = "f";
String testName = "<select role field name in an expression inside a parameter mapping.>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
str.toCharArray(),
selectionStart,
@@ -976,36 +976,36 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
*/
public void test16()
{
- String str =
+ String str =
"public team class T1 {\n" +
" public class R1 playedBy B1 when (this.f != 0) {\n" +
" private int f;\n" +
" }\n" +
- "}\n";
-
+ "}\n";
+
String selectionStartBehind = "when (this.";
String selectionEndBehind = "f";
-
+
String expectedCompletionNodeToString = "<SelectionOnFieldReference:this.f>";
String completionIdentifier = "f";
String expectedUnitDisplayString =
"public team class T1 {\n" +
" public role class R1 playedBy B1 {\n" +
" private int f;\n" +
- " protected synchronized boolean _OT$when() {\n" +
- " return (<SelectionOnFieldReference:this.f> != 0);\n" +
- " }\n" +
- " }\n" +
- " public T1() {\n" +
- " }\n" +
- "}\n";
-
+ " protected synchronized boolean _OT$when() {\n" +
+ " return (<SelectionOnFieldReference:this.f> != 0);\n" +
+ " }\n" +
+ " }\n" +
+ " public T1() {\n" +
+ " }\n" +
+ "}\n";
+
String expectedReplacedSource = "this.f";
String testName = "<select role field name in role-level guard>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
str.toCharArray(),
selectionStart,
@@ -1022,35 +1022,35 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
*/
public void test17()
{
- String str =
+ String str =
"public team class T1 {\n" +
" public class R1 playedBy B1 {\n" +
" void toString() => toString;\n" +
" hashCode => hashCode;\n" +
" }\n" +
- "}\n";
-
+ "}\n";
+
String selectionStartBehind = "void ";
String selectionEndBehind = "void toString";
-
+
String expectedCompletionNodeToString = "<SelectOnMethodSpec:void toString()>";
String completionIdentifier = "toString";
String expectedUnitDisplayString =
"public team class T1 {\n" +
" public role class R1 playedBy B1 {\n" +
- " <SelectOnMethodSpec:void toString()> => <nullBaseMethod>;\n" +
+ " <SelectOnMethodSpec:void toString()> => <nullBaseMethod>;\n" +
" hashCode => hashCode;\n" +
" }\n" +
- " public T1() {\n" +
- " }\n" +
- "}\n";
-
+ " public T1() {\n" +
+ " }\n" +
+ "}\n";
+
String expectedReplacedSource = "toString";
String testName = "<select method spec in buggy callout>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
str.toCharArray(),
selectionStart,
@@ -1061,22 +1061,22 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
expectedReplacedSource,
testName);
}
-
- public void test18()
+
+ public void test18()
{
- String str =
+ String str =
"public team class T1 {\n" +
" public class R1 playedBy B1 {\n" +
" int f() {\n" +
" return bm1(3);\n"+
" }\n"+
" }\n" +
- "}\n";
-
+ "}\n";
+
String selectionStartBehind = "return ";
String selectionEndBehind = "bm1";
-
+
String expectedCompletionNodeToString = "<SelectOnMessageSend:bm1(3)>";
String completionIdentifier = "bm1";
String expectedUnitDisplayString =
@@ -1088,15 +1088,15 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
" }\n" +
" public T1() {\n"+
" }\n"+
- "}\n";
-
+ "}\n";
+
String expectedReplacedSource = "bm1(3)";
String testName = "<select application of inferred callout>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
-
+
+
this.checkMethodParse(
str.toCharArray(),
selectionStart,
@@ -1106,7 +1106,7 @@ public class OTSpecificSelectionWithinRoleTests extends AbstractSelectionTest
completionIdentifier,
expectedReplacedSource,
testName);
-
+
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/OTSpecificSelectionWithinTeamTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/OTSpecificSelectionWithinTeamTests.java
index 9bfd2740f..c0a215e29 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/OTSpecificSelectionWithinTeamTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/OTSpecificSelectionWithinTeamTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -25,13 +25,13 @@ import org.eclipse.jdt.core.tests.compiler.parser.AbstractSelectionTest;
/**
* Testing OT-specific selections within a team class.
- *
+ *
* @author jwloka
* @version $Id: OTSpecificSelectionWithinTeamTests.java 23494 2010-02-05 23:06:44Z stephan $
*/
-public class OTSpecificSelectionWithinTeamTests extends AbstractSelectionTest
+public class OTSpecificSelectionWithinTeamTests extends AbstractSelectionTest
{
- public OTSpecificSelectionWithinTeamTests(String testName)
+ public OTSpecificSelectionWithinTeamTests(String testName)
{
super(testName);
}
@@ -45,14 +45,14 @@ public class OTSpecificSelectionWithinTeamTests extends AbstractSelectionTest
// */
// public void test01()
// {
-// String str =
+// String str =
// "public team class T1 {\n" +
// "\n" +
-// "}\n";
-//
+// "}\n";
+//
// String selectionStartBehind = "class ";
// String selectionEndBehind = "T1";
-//
+//
// String expectedCompletionNodeToString = "<SelectOnType:T1>";
// String completionIdentifier = "T1";
// String expectedUnitDisplayString =
@@ -62,45 +62,45 @@ public class OTSpecificSelectionWithinTeamTests extends AbstractSelectionTest
// " \n" +
// " }\n" +
// "}\n";
-//
+//
// String expectedReplacedSource = "T1";
// String testName = "<select team class name of team class declaration>";
-//
+//
// int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
// int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-//
+//
// this.checkDietParse(
-// str.toCharArray(),
+// str.toCharArray(),
// selectionStart,
// selectionEnd,
// expectedCompletionNodeToString,
// expectedUnitDisplayString,
// completionIdentifier,
// expectedReplacedSource,
-// testName);
+// testName);
// }
-//
+//
// /**
// * Select team class name of nested team class declaration.
// */
-// public void test02()
+// public void test02()
// {
-// String str =
+// String str =
// "public team class T1 {\n" +
// "{\n" +
// " public team class TR1 {\n" +
// " \n" +
// " }\n" +
// "}\n";
-//
+//
// String selectionStartBehind = "\n{\n\n\tpublic team class ";
// String selectionEndBehind = "TR1";
-//
+//
// String expectedCompletionNodeToString = "<SelectOnType:TR1>";
// String completionIdentifier = "TR1";
// String expectedUnitDisplayString =
// "public team class T1 {\n" +
-// "\n" +
+// "\n" +
// " public T1() {\n" +
// " \n" +
// " }\n" +
@@ -108,41 +108,41 @@ public class OTSpecificSelectionWithinTeamTests extends AbstractSelectionTest
// " \n" +
// " }\n" +
// "}\n";
-//
+//
// String expectedReplacedSource = "TR1";
// String testName = "<select team class name of nested team class declaration>";
-//
+//
// int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
// int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-//
+//
// this.checkDietParse(
-// str.toCharArray(),
+// str.toCharArray(),
// selectionStart,
// selectionEnd,
// expectedCompletionNodeToString,
// expectedUnitDisplayString,
// completionIdentifier,
// expectedReplacedSource,
-// testName);
+// testName);
//}
-
- //type references
+
+ //type references
/**
* Select team class name of anchor type.
*/
- public void test03()
+ public void test03()
{
- String str =
+ String str =
"public team class T1 {\n" +
" T1 t1 = new T1();\n" +
" t1.R1 r1;\n" +
" public class R1 {\n" +
" }\n" +
"}\n";
-
+
String selectionStartBehind = "T1 {\n ";
String selectionEndBehind = " T1";
-
+
String expectedCompletionNodeToString = "<SelectOnType:T1>";
String completionIdentifier = "T1";
String expectedUnitDisplayString =
@@ -152,24 +152,24 @@ public class OTSpecificSelectionWithinTeamTests extends AbstractSelectionTest
" <SelectOnType:T1> t1 = new T1();\n" +
" t1.R1 r1;\n" +
" public T1() {\n" +
- " }\n" +
+ " }\n" +
"}\n";
-
+
String expectedReplacedSource = "T1";
String testName = "<select team class name of anchored type>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
@@ -177,60 +177,60 @@ public class OTSpecificSelectionWithinTeamTests extends AbstractSelectionTest
*/
public void test04()
{
- String str =
+ String str =
"public team class T1 {\n" +
" void foo() {\n" +
" within (new T2()) {\n" +
" }\n" +
" }\n" +
"}\n";
-
+
String selectionStartBehind = "new ";
String selectionEndBehind = "T2";
-
+
String expectedCompletionNodeToString = "<SelectOnAllocationExpression:new T2()>";
String completionIdentifier = "T2";
String expectedUnitDisplayString =
"public team class T1 {\n" +
" public T1() {\n" +
- " }\n" +
+ " }\n" +
" void foo() {\n" +
" <SelectOnAllocationExpression:new T2()>;\n" +
" }\n" +
"}\n";
-
+
String expectedReplacedSource = "new T2()";
String testName = "<select team instantiation in within expression>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
-
+
/**
* Select team class name in <code>playedBy</code>-relation.
*/
public void test05()
{
- String str =
+ String str =
"public team class T1 {\n" +
" public class R1 playedBy T2 {\n" +
" \n" +
" }\n" +
- "}\n";
-
+ "}\n";
+
String selectionStartBehind = "playedBy ";
String selectionEndBehind = "T2";
-
+
String expectedCompletionNodeToString = "<SelectOnType:T2>";
String completionIdentifier = "T2";
String expectedUnitDisplayString =
@@ -240,22 +240,22 @@ public class OTSpecificSelectionWithinTeamTests extends AbstractSelectionTest
" public T1() {\n" +
" }\n" +
"}\n";
-
+
String expectedReplacedSource = "T2";
String testName = "<select team class name in playedBy relation>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
@@ -263,17 +263,17 @@ public class OTSpecificSelectionWithinTeamTests extends AbstractSelectionTest
*/
public void test06()
{
- String str =
+ String str =
"import x.y.T2\n" +
"public team class T1 {\n" +
" public class R1 playedBy T2 {\n" +
" \n" +
" }\n" +
- "}\n";
-
+ "}\n";
+
String selectionStartBehind = "y.";
String selectionEndBehind = "y.T2";
-
+
String expectedCompletionNodeToString = "<SelectOnImport:x.y.T2>";
String completionIdentifier = "T2";
String expectedUnitDisplayString =
@@ -284,41 +284,41 @@ public class OTSpecificSelectionWithinTeamTests extends AbstractSelectionTest
" public T1() {\n" +
" }\n" +
"}\n";
-
+
String expectedReplacedSource = "x.y.T2";
String testName = "<select team class name in import declaration>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
-
+
/**
* Select team class name in lifting method (declared lifting).
* The team class is the role class.
*/
public void test07()
{
- String str =
+ String str =
"public team class T1 {\n" +
" public void m1(B1 as T2 arg) {\n" +
" }\n" +
" public team class T2 playedBy B1 {\n" +
" }\n" +
- "}\n";
-
+ "}\n";
+
String selectionStartBehind = "as ";
String selectionEndBehind = "as T2";
-
+
String expectedCompletionNodeToString = "<SelectOnType:T2>";
String completionIdentifier = "T2";
String expectedUnitDisplayString =
@@ -329,23 +329,23 @@ public class OTSpecificSelectionWithinTeamTests extends AbstractSelectionTest
" }\n" +
" public void m1(B1 as <SelectOnType:T2> arg) {\n" +
" }\n" +
- "}\n";
-
+ "}\n";
+
String expectedReplacedSource = "T2";
String testName = "<select team class name in lifting method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
@@ -354,17 +354,17 @@ public class OTSpecificSelectionWithinTeamTests extends AbstractSelectionTest
*/
public void test08()
{
- String str =
+ String str =
"public team class T1 {\n" +
" public void m1(T2 as R1 arg) {\n" +
" }\n" +
" public class R1 playedBy T2 {\n" +
" }\n" +
- "}\n";
-
+ "}\n";
+
String selectionStartBehind = "(";
String selectionEndBehind = "(T2";
-
+
String expectedCompletionNodeToString = "<SelectOnType:T2>";
String completionIdentifier = "T2";
String expectedUnitDisplayString =
@@ -375,40 +375,40 @@ public class OTSpecificSelectionWithinTeamTests extends AbstractSelectionTest
" }\n" +
" public void m1(<SelectOnType:T2> as R1 arg) {\n" +
" }\n" +
- "}\n";
-
+ "}\n";
+
String expectedReplacedSource = "T2";
String testName = "<select team class name in lifting method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
-
-
+
+
/**
* Select team class name in team-level guard.
*/
public void test09()
{
- String str =
+ String str =
"public class T2 {\n" +
" public team class T1 when (T2.this != null) {\n" +
" }\n" +
"}\n";
-
+
String selectionStartBehind = "(";
String selectionEndBehind = "(T2";
-
+
String expectedCompletionNodeToString = "<SelectOnType:T2>";
String completionIdentifier = "T2";
String expectedUnitDisplayString =
@@ -416,55 +416,55 @@ public class OTSpecificSelectionWithinTeamTests extends AbstractSelectionTest
" public team class T1 {\n" +
" public T1() {\n" +
" }\n" +
- " protected synchronized boolean _OT$when() {\n" +
- " return (<SelectOnType:T2>.this != null);\n" +
- " }\n" +
+ " protected synchronized boolean _OT$when() {\n" +
+ " return (<SelectOnType:T2>.this != null);\n" +
+ " }\n" +
" }\n" +
" public T2() {\n" +
" }\n" +
"}\n";
-
+
String expectedReplacedSource = "T2";
String testName = "<select team class name in team-level guard>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
-
+
//TODO(gbr) select team class name in team package
//method declarations
//NOTE(gbr): method declarations are tested differently than method references
//(see org.eclipse.objectteams.otdt.tests.selection.codeselect.CodeSelectionTests).
-
+
//method references
/**
* Select team method name in team-level method.
*/
public void test10()
{
- String str =
+ String str =
"public team class T1 {\n" +
" public void m1(int x) {\n" +
- " }\n" +
+ " }\n" +
" public void m2(int x) {\n" +
" m1(x);\n" +
" }\n" +
- "}\n";
-
+ "}\n";
+
String selectionStartBehind = "m2(int x) {\n ";
String selectionEndBehind = " m1";
-
+
String expectedCompletionNodeToString = "<SelectOnMessageSend:m1(x)>";
String completionIdentifier = "m1";
String expectedUnitDisplayString =
@@ -476,23 +476,23 @@ public class OTSpecificSelectionWithinTeamTests extends AbstractSelectionTest
" public void m2(int x) {\n" +
" <SelectOnMessageSend:m1(x)>;\n" +
" }\n" +
- "}\n";
-
+ "}\n";
+
String expectedReplacedSource = "m1(x)";
String testName = "<select team method name in team-level method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
@@ -500,7 +500,7 @@ public class OTSpecificSelectionWithinTeamTests extends AbstractSelectionTest
*/
public void test11()
{
- String str =
+ String str =
"public team class T1 {\n" +
" public void m1() {\n" +
" within (new T1()) {\n" +
@@ -508,10 +508,10 @@ public class OTSpecificSelectionWithinTeamTests extends AbstractSelectionTest
" }\n" +
" }\n" +
"}\n";
-
+
String selectionStartBehind = "new T1()) {\n ";
String selectionEndBehind = " m1";
-
+
String expectedCompletionNodeToString = "<SelectOnMessageSend:m1()>";
String completionIdentifier = "m1";
String expectedUnitDisplayString =
@@ -524,22 +524,22 @@ public class OTSpecificSelectionWithinTeamTests extends AbstractSelectionTest
" }\n" +
" }\n" +
"}\n";
-
+
String expectedReplacedSource = "m1()";
String testName = "<select team method name in within-block>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
@@ -547,94 +547,94 @@ public class OTSpecificSelectionWithinTeamTests extends AbstractSelectionTest
*/
public void test12()
{
- String str =
+ String str =
"public team class T1 when (this.isValid()) {\n" +
" public boolean isValid() {\n" +
" return true;" +
" }\n" +
"}\n";
-
+
String selectionStartBehind = "when (this.";
String selectionEndBehind = "this.isValid";
-
+
String expectedCompletionNodeToString = "<SelectOnMessageSend:this.isValid()>";
String completionIdentifier = "isValid";
String expectedUnitDisplayString =
"public team class T1 {\n" +
- " public T1() {\n" +
- " }\n" +
+ " public T1() {\n" +
+ " }\n" +
" public boolean isValid() {\n" +
" }\n" +
- " protected synchronized boolean _OT$when() {\n" +
- " return <SelectOnMessageSend:this.isValid()>;\n" +
- " }\n" +
+ " protected synchronized boolean _OT$when() {\n" +
+ " return <SelectOnMessageSend:this.isValid()>;\n" +
+ " }\n" +
"}\n";
-
+
String expectedReplacedSource = "this.isValid()";
String testName = "<select team method name in team-level guard>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
//field declarations
//NOTE(gbr): field declarations are tested differently than field references
//(see org.eclipse.objectteams.otdt.tests.selection.codeselect.CodeSelectionTests).
-
+
//field references
/**
* Select team field name in team-level method.
*/
public void test13()
{
- String str =
+ String str =
"public team class T1 {\n" +
" private int f;\n" +
" public void m2(int y) {\n" +
" f = y;\n" +
" }\n" +
- "}\n";
-
+ "}\n";
+
String selectionStartBehind = "m2(int y) {\n ";
String selectionEndBehind = " f";
-
+
String expectedCompletionNodeToString = "<SelectOnName:f>";
String completionIdentifier = "f";
String expectedUnitDisplayString =
"public team class T1 {\n" +
" private int f;\n" +
- " public T1() {\n" +
- " }\n" +
+ " public T1() {\n" +
+ " }\n" +
" public void m2(int y) {\n" +
" <SelectOnName:f>;\n" +
" }\n" +
- "}\n";
-
+ "}\n";
+
String expectedReplacedSource = "f";
String testName = "<select team field name in team-level method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
@@ -642,7 +642,7 @@ public class OTSpecificSelectionWithinTeamTests extends AbstractSelectionTest
*/
public void test14()
{
- String str =
+ String str =
"public team class T1 {\n" +
" private int f;\n" +
" void foo() {\n" +
@@ -651,30 +651,30 @@ public class OTSpecificSelectionWithinTeamTests extends AbstractSelectionTest
" }\n" +
" }\n" +
"}\n";
-
+
String selectionStartBehind = "new T1()) {\n ";
String selectionEndBehind = " f";
-
+
String expectedCompletionNodeToString = "<SelectOnName:f>";
String completionIdentifier = "f";
String expectedUnitDisplayString =
"public team class T1 {\n" +
" private int f;\n" +
- " public T1() {\n" +
- " }\n" +
+ " public T1() {\n" +
+ " }\n" +
" void foo() {\n" +
" {\n" +
" <SelectOnName:f>;\n" +
" }\n" +
" }\n" +
"}\n";
-
+
String expectedReplacedSource = "f";
String testName = "<select team field name in within-block>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
str.toCharArray(),
selectionStart,
@@ -691,41 +691,41 @@ public class OTSpecificSelectionWithinTeamTests extends AbstractSelectionTest
*/
public void test15()
{
- String str =
+ String str =
"public team class T1 when (this.f != 0) {\n" +
" private int f;\n" +
"}\n";
-
+
String selectionStartBehind = "(this.";
String selectionEndBehind = "this.f";
-
+
String expectedCompletionNodeToString = "<SelectionOnFieldReference:this.f>";
String completionIdentifier = "f";
String expectedUnitDisplayString =
"public team class T1 {\n" +
" private int f;\n" +
- " public T1() {\n" +
- " }\n" +
- " protected synchronized boolean _OT$when() {\n" +
- " return (<SelectionOnFieldReference:this.f> != 0);\n" +
- " }\n" +
+ " public T1() {\n" +
+ " }\n" +
+ " protected synchronized boolean _OT$when() {\n" +
+ " return (<SelectionOnFieldReference:this.f> != 0);\n" +
+ " }\n" +
"}\n";
-
+
String expectedReplacedSource = "this.f";
String testName = "<select team field name in team-level guard>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
} \ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/SelectionWithinRoleTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/SelectionWithinRoleTests.java
index e35f0e959..9369fd114 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/SelectionWithinRoleTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/SelectionWithinRoleTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -25,13 +25,13 @@ import org.eclipse.jdt.core.tests.compiler.parser.AbstractSelectionTest;
/**
* Enter a class description here!
- *
+ *
* @author jwloka
* @version $Id: SelectionWithinRoleTests.java 23494 2010-02-05 23:06:44Z stephan $
*/
-public class SelectionWithinRoleTests extends AbstractSelectionTest
+public class SelectionWithinRoleTests extends AbstractSelectionTest
{
- public SelectionWithinRoleTests(String testName)
+ public SelectionWithinRoleTests(String testName)
{
super(testName);
}
@@ -39,23 +39,23 @@ public class SelectionWithinRoleTests extends AbstractSelectionTest
* Select explicit superclass of role class
*/
public void test01() {
-
- String str =
- "import java.io.*; \n" +
- " \n" +
+
+ String str =
+ "import java.io.*; \n" +
+ " \n" +
"public team class T1 { \n" +
- " public class R1 extends IOException { \n" +
+ " public class R1 extends IOException { \n" +
" } \n" +
- "} \n";
-
+ "} \n";
+
String selectionStartBehind = "extends ";
String selectionEndBehind = "IOException";
-
+
String expectedCompletionNodeToString = "<SelectOnType:IOException>";
String completionIdentifier = "IOException";
String expectedUnitDisplayString =
- "import java.io.*;\n" +
- "public team class T1 {\n" +
+ "import java.io.*;\n" +
+ "public team class T1 {\n" +
" public role class R1 extends <SelectOnType:IOException> {\n" +
" }\n" +
" public T1() {\n" +
@@ -63,233 +63,233 @@ public class SelectionWithinRoleTests extends AbstractSelectionTest
"}\n";
String expectedReplacedSource = "IOException";
String testName = "<select explicit superclass of role>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select explicit superinterface of role class
*/
public void test02() {
-
- String str =
- "import java.io.*; \n" +
- " \n" +
+
+ String str =
+ "import java.io.*; \n" +
+ " \n" +
"public team class T1 { \n" +
- " public class R1 extends IOException implements Serializable { \n" +
+ " public class R1 extends IOException implements Serializable { \n" +
" int foo(){} \n" +
" } \n" +
- "} \n";
-
+ "} \n";
+
String selectionStartBehind = "implements ";
String selectionEndBehind = "Serializable";
-
+
String expectedCompletionNodeToString = "<SelectOnType:Serializable>";
String completionIdentifier = "Serializable";
String expectedUnitDisplayString =
- "import java.io.*;\n" +
- "public team class T1 {\n" +
+ "import java.io.*;\n" +
+ "public team class T1 {\n" +
" public role class R1 extends IOException implements <SelectOnType:Serializable> {\n" +
- " int foo() {\n" +
- " }\n" +
+ " int foo() {\n" +
+ " }\n" +
" }\n" +
" public T1() {\n" +
" }\n" +
"}\n";
String expectedReplacedSource = "Serializable";
String testName = "<select explicit superinterface of role>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select qualified explicit superclass of role class
*/
public void test03() {
-
- String str =
+
+ String str =
"public team class T1 { \n" +
" public class R1 extends java.io.IOException { \n" +
- " } \n" +
- "} \n";
-
+ " } \n" +
+ "} \n";
+
String selectionStartBehind = "java.io.";
String selectionEndBehind = "IOException";
-
+
String expectedCompletionNodeToString = "<SelectOnType:java.io.IOException>";
String completionIdentifier = "IOException";
String expectedUnitDisplayString =
"public team class T1 {\n" +
" public role class R1 extends <SelectOnType:java.io.IOException> {\n" +
- " }\n" +
+ " }\n" +
" public T1() {\n" +
- " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "java.io.IOException";
String testName = "<select qualified explicit superclass of role>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select package from qualified explicit superclass in role class
*/
public void test04() {
-
- String str =
+
+ String str =
"public team class T1 { \n" +
" public class R1 extends java.io.IOException { \n" +
- " } \n" +
- "} \n";
-
+ " } \n" +
+ "} \n";
+
String selectionStartBehind = "java.";
String selectionEndBehind = "java.io";
-
+
String expectedCompletionNodeToString = "<SelectOnType:java.io>";
String completionIdentifier = "io";
String expectedUnitDisplayString =
"public team class T1 {\n" +
" public role class R1 extends <SelectOnType:java.io> {\n" +
- " }\n" +
+ " }\n" +
" public T1() {\n" +
- " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "java.io.IOException";
String testName = "<select package from qualified explicit superclass of role>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select message send in role method
*/
public void test05() {
-
- String str =
+
+ String str =
"public team class T1 { \n" +
" public class R1 extends java.io.IOException { \n" +
" int foo(){ \n" +
" System.out.println(\"hello\"); \n";
-
+
String selectionStartBehind = "System.out.";
String selectionEndBehind = "println";
-
+
String expectedCompletionNodeToString = "<SelectOnMessageSend:System.out.println(\"hello\")>";
String completionIdentifier = "println";
String expectedUnitDisplayString =
"public team class T1 {\n" +
" public role class R1 extends java.io.IOException {\n" +
- " int foo() {\n" +
- " <SelectOnMessageSend:System.out.println(\"hello\")>;\n" +
- " }\n" +
- " }\n" +
+ " int foo() {\n" +
+ " <SelectOnMessageSend:System.out.println(\"hello\")>;\n" +
+ " }\n" +
+ " }\n" +
" public T1() {\n" +
- " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "System.out.println(\"hello\")";
String testName = "<select message send in role method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select message send with recovery before in role method
*/
public void test06() {
-
+
String str =
"public team class T1 { \n" +
" public class R1 extends \n" +
" int foo(){ \n" +
" System.out.println(\"hello\"); \n";
-
+
String selectionStartBehind = "System.out.";
String selectionEndBehind = "println";
-
+
String expectedCompletionNodeToString = "<SelectOnMessageSend:System.out.println(\"hello\")>";
String completionIdentifier = "println";
String expectedUnitDisplayString =
"public team class T1 {\n" +
" public role class R1 {\n" +
- " int foo() {\n" +
- " <SelectOnMessageSend:System.out.println(\"hello\")>;\n" +
- " }\n" +
- " }\n" +
+ " int foo() {\n" +
+ " <SelectOnMessageSend:System.out.println(\"hello\")>;\n" +
+ " }\n" +
+ " }\n" +
" public T1() {\n" +
- " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "System.out.println(\"hello\")";
String testName = "<select message send with recovery before in role method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
- * Select message send in role method with sibling method
+ * Select message send in role method with sibling method
*/
public void test07() {
-
- String str =
+
+ String str =
"public team class T1 { \n" +
" public class R1 extends \n" +
" int foo(){ \n" +
@@ -299,45 +299,45 @@ public class SelectionWithinRoleTests extends AbstractSelectionTest
" } \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "this.";
String selectionEndBehind = "this.bar";
-
+
String expectedCompletionNodeToString = "<SelectOnMessageSend:this.bar(\"hello\")>";
String completionIdentifier = "bar";
String expectedUnitDisplayString =
"public team class T1 {\n" +
" public role class R1 {\n" +
- " int foo() {\n" +
- " <SelectOnMessageSend:this.bar(\"hello\")>;\n" +
- " }\n" +
- " int bar(String s) {\n" +
+ " int foo() {\n" +
+ " <SelectOnMessageSend:this.bar(\"hello\")>;\n" +
+ " }\n" +
+ " int bar(String s) {\n" +
" }\n" +
- " }\n" +
+ " }\n" +
" public T1() {\n" +
- " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "this.bar(\"hello\")";
String testName = "<select message send in role method with sibling method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select field reference in role method
*/
public void test08() {
-
+
String str =
"public team class T1 { \n" +
" public class R1 { \n" +
@@ -346,44 +346,44 @@ public class SelectionWithinRoleTests extends AbstractSelectionTest
" int j = this.num; \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "this.";
String selectionEndBehind = "this.num";
-
+
String expectedCompletionNodeToString = "<SelectionOnFieldReference:this.num>";
String completionIdentifier = "num";
String expectedUnitDisplayString =
"public team class T1 {\n" +
" public role class R1 {\n" +
- " int num;\n" +
- " int foo() {\n" +
- " int j = <SelectionOnFieldReference:this.num>;\n" +
- " }\n" +
- " }\n" +
+ " int num;\n" +
+ " int foo() {\n" +
+ " int j = <SelectionOnFieldReference:this.num>;\n" +
+ " }\n" +
+ " }\n" +
" public T1() {\n" +
- " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "this.num";
String testName = "<select field reference in role method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select implicitly inherited field reference in role method
*/
public void test08b() {
-
+
String str =
"team class T1 { \n" +
" public class R1 { \n" +
@@ -396,51 +396,51 @@ public class SelectionWithinRoleTests extends AbstractSelectionTest
" int j = this.num; \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "this.";
String selectionEndBehind = "this.num";
-
+
String expectedCompletionNodeToString = "<SelectionOnFieldReference:this.num>";
String completionIdentifier = "num";
String expectedUnitDisplayString =
"team class T1 {\n" +
" public role class R1 {\n" +
- " int num;\n" +
- " }\n" +
+ " int num;\n" +
+ " }\n" +
" T1() {\n" +
- " }\n" +
+ " }\n" +
"}\n" +
"public team class T2 extends T1 {\n" +
" public role class R1 {\n" +
- " int foo() {\n" +
- " int j = <SelectionOnFieldReference:this.num>;\n" +
- " }\n" +
- " }\n" +
+ " int foo() {\n" +
+ " int j = <SelectionOnFieldReference:this.num>;\n" +
+ " }\n" +
+ " }\n" +
" public T2() {\n" +
- " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "this.num";
String testName = "<select field reference in role method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select field reference with syntax errors in role method
*/
public void test09() {
-
- String str =
+
+ String str =
"public team class T1 { \n" +
" public class R1 { \n" +
" int num \n" +
@@ -448,45 +448,45 @@ public class SelectionWithinRoleTests extends AbstractSelectionTest
" int j = this.num; \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "this.";
String selectionEndBehind = "this.num";
-
+
String expectedCompletionNodeToString = "<SelectionOnFieldReference:this.num>";
String completionIdentifier = "num";
String expectedUnitDisplayString =
"public team class T1 {\n" +
" public role class R1 {\n" +
- " int num;\n" +
- " int foo() {\n" +
- " int j = <SelectionOnFieldReference:this.num>;\n" +
- " }\n" +
- " }\n" +
+ " int num;\n" +
+ " int foo() {\n" +
+ " int j = <SelectionOnFieldReference:this.num>;\n" +
+ " }\n" +
+ " }\n" +
" public T1() {\n" +
- " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "this.num";
String testName = "<select field reference with syntax errors in role method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select field reference inside message receiver within role method
*/
public void test10() {
-
- String str =
+
+ String str =
"public team class T1 { \n" +
" public class R1 { \n" +
" R1 x; \n" +
@@ -495,45 +495,45 @@ public class SelectionWithinRoleTests extends AbstractSelectionTest
" } \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "this.";
String selectionEndBehind = "this.x";
-
+
String expectedCompletionNodeToString = "<SelectionOnFieldReference:this.x>";
String completionIdentifier = "x";
String expectedUnitDisplayString =
"public team class T1 {\n" +
" public role class R1 {\n" +
" R1 x;\n" +
- " int foo() {\n" +
- " int j = <SelectionOnFieldReference:this.x>;\n" +
- " }\n" +
- " }\n" +
+ " int foo() {\n" +
+ " int j = <SelectionOnFieldReference:this.x>;\n" +
+ " }\n" +
+ " }\n" +
" public T1() {\n" +
- " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "this.x";
String testName = "<select field reference inside message receiver within role method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select allocation in role method
*/
public void test11() {
-
- String str =
+
+ String str =
"public team class T1 { \n" +
" public class R1 { \n" +
" R1(int i){} \n" +
@@ -543,48 +543,48 @@ public class SelectionWithinRoleTests extends AbstractSelectionTest
" } \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "new ";
String selectionEndBehind = "new R1";
-
+
String expectedCompletionNodeToString = "<SelectOnAllocationExpression:new R1(j)>";
String completionIdentifier = "R1";
String expectedUnitDisplayString =
"public team class T1 {\n" +
" public role class R1 {\n" +
- " R1(int i) {\n" +
- " }\n" +
- " int foo() {\n" +
- " int j;\n" +
- " R1 x = <SelectOnAllocationExpression:new R1(j)>;\n" +
- " }\n" +
- " }\n" +
+ " R1(int i) {\n" +
+ " }\n" +
+ " int foo() {\n" +
+ " int j;\n" +
+ " R1 x = <SelectOnAllocationExpression:new R1(j)>;\n" +
+ " }\n" +
+ " }\n" +
" public T1() {\n" +
- " }\n" +
+ " }\n" +
"}\n";
-
+
String expectedReplacedSource = "new R1(j)";
String testName = "<select allocation in role method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select qualified name reference receiver in role method
*/
public void test13() {
-
- String str =
+
+ String str =
"public team class T1 { \n" +
" public class R1 { \n" +
" int foo(){ \n" +
@@ -592,178 +592,178 @@ public class SelectionWithinRoleTests extends AbstractSelectionTest
" } \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "java.lang.";
String selectionEndBehind = "java.lang.System";
-
+
String expectedCompletionNodeToString = "<SelectOnName:java.lang.System>";
String completionIdentifier = "System";
String expectedUnitDisplayString =
"public team class T1 {\n" +
" public role class R1 {\n" +
- " int foo() {\n" +
- " <SelectOnName:java.lang.System>;\n" +
- " }\n" +
- " }\n" +
+ " int foo() {\n" +
+ " <SelectOnName:java.lang.System>;\n" +
+ " }\n" +
+ " }\n" +
" public T1() {\n" +
- " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "java.lang.System.out";
String testName = "<select qualified name receiver in role method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select qualified name reference in role method
*/
public void test14() {
-
- String str =
+
+ String str =
"public team class T1 { \n" +
" public class R1 { \n" +
" int foo(){ \n" +
" System sys = java.lang.System; \n" +
" } \n" +
" } \n" +
- "} \n";
-
+ "} \n";
+
String selectionStartBehind = "java.lang.";
String selectionEndBehind = "java.lang.System";
-
+
String expectedCompletionNodeToString = "<SelectOnName:java.lang.System>";
String completionIdentifier = "System";
String expectedUnitDisplayString =
"public team class T1 {\n" +
" public role class R1 {\n" +
- " int foo() {\n" +
- " System sys = <SelectOnName:java.lang.System>;\n" +
- " }\n" +
- " }\n" +
+ " int foo() {\n" +
+ " System sys = <SelectOnName:java.lang.System>;\n" +
+ " }\n" +
+ " }\n" +
" public T1() {\n" +
- " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "java.lang.System";
String testName = "<select qualified name in role method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select variable type with modifier in role method
*/
public void test15() {
-
- String str =
+
+ String str =
"public team class T1 { \n" +
" public class R1 { \n" +
" int foo(){ \n" +
" final System sys = null; \n" +
" } \n" +
" } \n" +
- "} \n";
-
+ "} \n";
+
String selectionStartBehind = "final ";
String selectionEndBehind = "final System";
-
+
String expectedCompletionNodeToString = "<SelectOnType:System>";
String completionIdentifier = "System";
String expectedUnitDisplayString =
"public team class T1 {\n" +
" public role class R1 {\n" +
- " int foo() {\n" +
- " final <SelectOnType:System> sys;\n" +
- " }\n" +
- " }\n" +
+ " int foo() {\n" +
+ " final <SelectOnType:System> sys;\n" +
+ " }\n" +
+ " }\n" +
" public T1() {\n" +
- " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "System";
String testName = "<select variable type with modifier in role method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select variable type in role method
*/
public void test16() {
-
- String str =
+
+ String str =
"public team class T1 { \n" +
" public class R1 { \n" +
" int foo(){ \n" +
" System sys = null; \n" +
" } \n" +
" } \n" +
- "} \n";
-
+ "} \n";
+
String selectionStartBehind = "\n ";
String selectionEndBehind = "\n System";
-
+
String expectedCompletionNodeToString = "<SelectOnType:System>";
String completionIdentifier = "System";
String expectedUnitDisplayString =
"public team class T1 {\n" +
" public role class R1 {\n" +
- " int foo() {\n" +
- " <SelectOnType:System> sys;\n" +
- " }\n" +
- " }\n" +
+ " int foo() {\n" +
+ " <SelectOnType:System> sys;\n" +
+ " }\n" +
+ " }\n" +
" public T1() {\n" +
- " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "System";
String testName = "<select variable type in role method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select name in role method
*/
public void test17() {
-
+
String str =
"public team class T1 { \n" +
" public class R1 { \n" +
@@ -771,45 +771,45 @@ public class SelectionWithinRoleTests extends AbstractSelectionTest
" System \n" +
" } \n" +
" } \n" +
- "} \n";
-
+ "} \n";
+
String selectionStartBehind = "\n ";
String selectionEndBehind = "\n System";
-
+
String expectedCompletionNodeToString = "<SelectOnName:System>";
String completionIdentifier = "System";
String expectedUnitDisplayString =
"public team class T1 {\n" +
" public role class R1 {\n" +
- " int foo() {\n" +
- " <SelectOnName:System>;\n" +
- " }\n" +
- " }\n" +
+ " int foo() {\n" +
+ " <SelectOnName:System>;\n" +
+ " }\n" +
+ " }\n" +
" public T1() {\n" +
- " }\n" +
+ " }\n" +
"}\n";
-
+
String expectedReplacedSource = "System";
String testName = "<select name in team method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select anonymous type in role method
*/
public void test18() {
-
+
String str =
"public team class T1 { \n" +
" public class R1 { \n" +
@@ -819,49 +819,49 @@ public class SelectionWithinRoleTests extends AbstractSelectionTest
" } \n" +
" } \n" +
" } \n" +
- "} \n";
-
+ "} \n";
+
String selectionStartBehind = "new ";
String selectionEndBehind = "new Object";
-
- String expectedCompletionNodeToString =
+
+ String expectedCompletionNodeToString =
"<SelectOnAllocationExpression:new Object() {\n" +
"}>";
String completionIdentifier = "Object";
String expectedUnitDisplayString =
"public team class T1 {\n" +
" public role class R1 {\n" +
- " int foo() {\n" +
+ " int foo() {\n" +
" <SelectOnAllocationExpression:new Object() {\n" +
- " }>;\n" +
- " }\n" +
- " }\n" +
+ " }>;\n" +
+ " }\n" +
+ " }\n" +
" public T1() {\n" +
- " }\n" +
+ " }\n" +
"}\n";
-
+
String expectedReplacedSource = "new Object()";
String testName = "<select anonymous type in role method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select cast type in role method
*/
public void test19() {
-
- String str =
+
+ String str =
"public team class T1 { \n" +
" public class R1 { \n" +
" Object foo(){ \n" +
@@ -869,169 +869,169 @@ public class SelectionWithinRoleTests extends AbstractSelectionTest
" } \n" +
" } \n" +
" } \n" +
- "} \n";
-
+ "} \n";
+
String selectionStartBehind = "return (";
String selectionEndBehind = "return (Object";
-
+
String expectedCompletionNodeToString = "<SelectOnType:Object>";
String completionIdentifier = "Object";
String expectedUnitDisplayString =
"public team class T1 {\n" +
" public role class R1 {\n" +
- " Object foo() {\n" +
- " return (<SelectOnType:Object>) this;\n" +
- " }\n" +
- " }\n" +
+ " Object foo() {\n" +
+ " return (<SelectOnType:Object>) this;\n" +
+ " }\n" +
+ " }\n" +
" public T1() {\n" +
- " }\n" +
+ " }\n" +
"}\n";
-
+
String expectedReplacedSource = "Object";
String testName = "<select cast type in role method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select package of role file
*/
public void test20() {
-
+
String str =
"team package x.y.T1; \n" +
"public class R1 { \n" +
" int foo(){ \n" +
" } \n" +
- "} \n";
-
+ "} \n";
+
String selectionStartBehind = "x.";
String selectionEndBehind = "x.y";
-
+
String expectedCompletionNodeToString = "<SelectOnPackage:x.y>";
String completionIdentifier = "y";
String expectedUnitDisplayString =
- "team package <SelectOnPackage:x.y>;\n" +
+ "team package <SelectOnPackage:x.y>;\n" +
"public role class R1 {\n" +
- " int foo() {\n" +
- " }\n" +
+ " int foo() {\n" +
+ " }\n" +
"}\n";
-
+
String expectedReplacedSource = "x.y.T1";
String testName = "<select package of role file>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select import in role file
*/
public void test21() {
-
+
String str =
"team package a.b.T1; \n" +
"import x.y.Other; \n" +
"public class R1 { \n" +
" int foo(){ \n" +
" } \n" +
- "} \n";
-
+ "} \n";
+
String selectionStartBehind = "y.";
String selectionEndBehind = "y.Other";
-
+
String expectedCompletionNodeToString = "<SelectOnImport:x.y.Other>";
String completionIdentifier = "Other";
String expectedUnitDisplayString =
- "team package a.b.T1;\n" +
- "import <SelectOnImport:x.y.Other>;\n" +
+ "team package a.b.T1;\n" +
+ "import <SelectOnImport:x.y.Other>;\n" +
"public role class R1 {\n" +
- " int foo() {\n" +
- " }\n" +
+ " int foo() {\n" +
+ " }\n" +
"}\n";
-
+
String expectedReplacedSource = "x.y.Other";
String testName = "<select import in role file>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select import on demand in role file
*/
public void test22() {
-
+
String str =
"team package a.b.T1; \n" +
"import x.y.other.*; \n" +
"public class R1 { \n" +
" int foo(){ \n" +
" } \n" +
- "} \n";
-
+ "} \n";
+
String selectionStartBehind = "y.";
String selectionEndBehind = "y.other";
-
+
String expectedCompletionNodeToString = "<SelectOnImport:x.y.other>";
String completionIdentifier = "other";
String expectedUnitDisplayString =
- "team package a.b.T1;\n" +
- "import <SelectOnImport:x.y.other>;\n" +
+ "team package a.b.T1;\n" +
+ "import <SelectOnImport:x.y.other>;\n" +
"public role class R1 {\n" +
- " int foo() {\n" +
- " }\n" +
+ " int foo() {\n" +
+ " }\n" +
"}\n";
-
+
String expectedReplacedSource = "x.y.other";
String testName = "<select import on demand in role file>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select array initializer type in role method
*/
public void test23() {
-
+
String str =
"public team class T1 { \n" +
" public class R1 { \n" +
@@ -1039,44 +1039,44 @@ public class SelectionWithinRoleTests extends AbstractSelectionTest
" String[] p = new String[]{\"Left\"}; \n" +
" } \n" +
" } \n" +
- "} \n";
-
+ "} \n";
+
String selectionStartBehind = "new ";
String selectionEndBehind = "new String";
String expectedCompletionNodeToString = "<SelectOnType:String>";
String completionIdentifier = "String";
String expectedUnitDisplayString =
- "public team class T1 {\n" +
+ "public team class T1 {\n" +
" public role class R1 {\n" +
- " int foo() {\n" +
- " String[] p = <SelectOnType:String>;\n" +
- " }\n" +
+ " int foo() {\n" +
+ " String[] p = <SelectOnType:String>;\n" +
+ " }\n" +
+ " }\n" +
+ " public T1() {\n" +
" }\n" +
- " public T1() {\n" +
- " }\n" +
"}\n";
-
+
String expectedReplacedSource = "String";
String testName = "<select array initializer type in role method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select super in role method
*/
public void test25() {
-
+
String str =
"public team class T1 { \n" +
" public class R1 { \n" +
@@ -1084,46 +1084,46 @@ public class SelectionWithinRoleTests extends AbstractSelectionTest
" return super.foo(); \n" +
" } \n" +
" } \n" +
- "} \n";
-
+ "} \n";
+
String selectionStartBehind = "return ";
String selectionEndBehind = "return super";
-
+
String expectedCompletionNodeToString = "<SelectOnSuper:super>";
-
+
String completionIdentifier = "super";
String expectedUnitDisplayString =
- "public team class T1 {\n" +
+ "public team class T1 {\n" +
" public role class R1 {\n" +
- " Object foo() {\n" +
- " return <SelectOnSuper:super>;\n" +
- " }\n" +
+ " Object foo() {\n" +
+ " return <SelectOnSuper:super>;\n" +
+ " }\n" +
+ " }\n" +
+ " public T1() {\n" +
" }\n" +
- " public T1() {\n" +
- " }\n" +
"}\n";
-
+
String expectedReplacedSource = "super";
String testName = "<select super in role method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select qualified super in anonymous instance in role method
*/
public void test26() {
-
+
String str =
"public team class T1 { \n" +
" public class R1 { \n" +
@@ -1135,49 +1135,49 @@ public class SelectionWithinRoleTests extends AbstractSelectionTest
" } \n" +
" } \n" +
" } \n" +
- "} \n";
-
+ "} \n";
+
String selectionStartBehind = "R1.";
String selectionEndBehind = "R1.super";
-
+
String expectedCompletionNodeToString = "<SelectOnQualifiedSuper:R1.super>";
-
+
String completionIdentifier = "super";
String expectedUnitDisplayString =
- "public team class T1 {\n" +
+ "public team class T1 {\n" +
" public role class R1 {\n" +
- " Object foo() {\n" +
- " new X() {\n" +
- " Object bar() {\n" +
- " return <SelectOnQualifiedSuper:R1.super>;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
+ " Object foo() {\n" +
+ " new X() {\n" +
+ " Object bar() {\n" +
+ " return <SelectOnQualifiedSuper:R1.super>;\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
+ " }\n" +
+ " public T1() {\n" +
" }\n" +
- " public T1() {\n" +
- " }\n" +
"}\n";
String expectedReplacedSource = "R1.super";
String testName = "<select qualified super in anonymous instance in role method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select super constructor call within role constructor
*/
public void test27() {
-
+
String str =
"public team class T1 { \n" +
" public class R1 { \n" +
@@ -1185,46 +1185,46 @@ public class SelectionWithinRoleTests extends AbstractSelectionTest
" super(); \n" +
" } \n" +
" } \n" +
- "} \n";
-
+ "} \n";
+
String selectionStartBehind = "\n\t\t\t";
String selectionEndBehind = "super";
-
+
String expectedCompletionNodeToString = "<SelectOnExplicitConstructorCall:super()>;";
-
+
String completionIdentifier = "super";
String expectedUnitDisplayString =
- "public team class T1 {\n" +
+ "public team class T1 {\n" +
" public role class R1 {\n" +
- " R1() {\n" +
- " <SelectOnExplicitConstructorCall:super()>;\n" +
- " }\n" +
+ " R1() {\n" +
+ " <SelectOnExplicitConstructorCall:super()>;\n" +
+ " }\n" +
+ " }\n" +
+ " public T1() {\n" +
" }\n" +
- " public T1() {\n" +
- " }\n" +
"}\n";
-
+
String expectedReplacedSource = "super()";
String testName = "<select super constructor call within role constructor>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select qualified super constructor call within local class in role class
*/
public void test28() {
-
+
String str =
"public team class G { \n" +
" class M { \n" +
@@ -1237,48 +1237,48 @@ public class SelectionWithinRoleTests extends AbstractSelectionTest
" } \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "new G().";
String selectionEndBehind = "new G().super";
-
+
String expectedCompletionNodeToString = "<SelectOnExplicitConstructorCall:new G().super()>;";
-
+
String completionIdentifier = "super";
String expectedUnitDisplayString =
- "public team class G {\n" +
- " role class M {\n" +
- " static Object foo() {\n" +
- " class X extends M {\n" +
- " X() {\n" +
- " <SelectOnExplicitConstructorCall:new G().super()>;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " public G() {\n" +
- " }\n" +
- "}\n";
+ "public team class G {\n" +
+ " role class M {\n" +
+ " static Object foo() {\n" +
+ " class X extends M {\n" +
+ " X() {\n" +
+ " <SelectOnExplicitConstructorCall:new G().super()>;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " public G() {\n" +
+ " }\n" +
+ "}\n";
String expectedReplacedSource = "new G().super()";
String testName = "<select qualified super constructor call>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select qualified super constructor call with arguments in local class within role class
*/
public void test29() {
-
+
String str =
"public team class G { \n" +
" class M {} \n" +
@@ -1290,48 +1290,48 @@ public class SelectionWithinRoleTests extends AbstractSelectionTest
" } \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "new G().";
String selectionEndBehind = "new G().super";
-
+
String expectedCompletionNodeToString = "<SelectOnExplicitConstructorCall:new G().super((23 + \"hello\"))>;";
-
+
String completionIdentifier = "super";
String expectedUnitDisplayString =
- "public team class G {\n" +
- " role class M {\n" +
- " }\n" +
- " public G() {\n" +
- " }\n" +
- " static Object foo() {\n" +
- " class X extends M {\n" +
- " X() {\n" +
- " <SelectOnExplicitConstructorCall:new G().super((23 + \"hello\"))>;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
+ "public team class G {\n" +
+ " role class M {\n" +
+ " }\n" +
+ " public G() {\n" +
+ " }\n" +
+ " static Object foo() {\n" +
+ " class X extends M {\n" +
+ " X() {\n" +
+ " <SelectOnExplicitConstructorCall:new G().super((23 + \"hello\"))>;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "}\n";
String expectedReplacedSource = "new G().super(23 + \"hello\")";
String testName = "<select qualified super constructor call with arguments in local class within role class>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select super constructor call with arguments in role constructor
*/
public void test30() {
-
+
String str =
"public team class G { \n" +
" class M { \n" +
@@ -1340,45 +1340,45 @@ public class SelectionWithinRoleTests extends AbstractSelectionTest
" } \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "M() {\t\t\t\t\t\t\t\n\t\t\t";
String selectionEndBehind = "super";
-
+
String expectedCompletionNodeToString = "<SelectOnExplicitConstructorCall:super(new M())>;";
-
+
String completionIdentifier = "super";
String expectedUnitDisplayString =
- "public team class G {\n" +
- " role class M {\n" +
- " M() {\n" +
- " <SelectOnExplicitConstructorCall:super(new M())>;\n" +
- " }\n" +
- " }\n" +
- " public G() {\n" +
- " }\n" +
- "}\n";
-
+ "public team class G {\n" +
+ " role class M {\n" +
+ " M() {\n" +
+ " <SelectOnExplicitConstructorCall:super(new M())>;\n" +
+ " }\n" +
+ " }\n" +
+ " public G() {\n" +
+ " }\n" +
+ "}\n";
+
String expectedReplacedSource = "super(new M())";
String testName = "<select super constructor call with arguments in role constructor>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Regression test for 1FVQ0LK
*/
public void test31() {
-
+
String str =
"public team class G { \n" +
" class M { \n" +
@@ -1389,45 +1389,45 @@ public class SelectionWithinRoleTests extends AbstractSelectionTest
" } \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "\n\t\t";
String selectionEndBehind = "Y";
-
+
String expectedCompletionNodeToString = "<SelectOnType:Y>";
-
+
String completionIdentifier = "Y";
String expectedUnitDisplayString =
- "public team class G {\n" +
- " role class M {\n" +
+ "public team class G {\n" +
+ " role class M {\n" +
" <SelectOnType:Y> f;\n" +
" void foo() {\n" +
" }\n" +
- " }\n" +
- " public G() {\n" +
- " }\n" +
- "}\n";
-
+ " }\n" +
+ " public G() {\n" +
+ " }\n" +
+ "}\n";
+
String expectedReplacedSource = "Y";
String testName = "<regression test for 1FVQ0LK>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select qualified this constructor call of role class
*/
public void test32() {
-
+
String str =
"public team class G { \n" +
" class M { \n" +
@@ -1442,51 +1442,51 @@ public class SelectionWithinRoleTests extends AbstractSelectionTest
" } \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "new G().";
String selectionEndBehind = "new G().this";
-
+
String expectedCompletionNodeToString = "<SelectOnExplicitConstructorCall:new G().this()>;";
-
+
String completionIdentifier = "this";
String expectedUnitDisplayString =
- "public team class G {\n" +
- " role class M {\n" +
- " static Object foo() {\n" +
- " class X {\n" +
+ "public team class G {\n" +
+ " role class M {\n" +
+ " static Object foo() {\n" +
+ " class X {\n" +
" X() {\n" +
" super();\n"+
- " }\n" +
- " X(int x) {\n" +
- " <SelectOnExplicitConstructorCall:new G().this()>;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " public G() {\n" +
- " }\n" +
- "}\n";
+ " }\n" +
+ " X(int x) {\n" +
+ " <SelectOnExplicitConstructorCall:new G().this()>;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " public G() {\n" +
+ " }\n" +
+ "}\n";
String expectedReplacedSource = "new G().this()";
String testName = "<select qualified this constructor call of role class>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* bugs 14468 select inside instanceof statement in role method
*/
public void test33() {
-
+
String str =
"public team class T1 { \n" +
" class R1 { \n" +
@@ -1495,11 +1495,11 @@ public class SelectionWithinRoleTests extends AbstractSelectionTest
" } \n" +
" } \n" +
"} \n";
-
+
String selection = "Object";
-
+
String expectedCompletionNodeToString = "<SelectOnType:Object>";
-
+
String completionIdentifier = "Object";
String expectedUnitDisplayString =
"public team class T1 {\n"+
@@ -1514,12 +1514,12 @@ public class SelectionWithinRoleTests extends AbstractSelectionTest
String expectedReplacedSource = "Object";
String testName = "<select inside instanceof statement in role method>";
-
+
int selectionStart = str.indexOf(selection);
int selectionEnd = str.indexOf(selection) + selection.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
@@ -1532,7 +1532,7 @@ public class SelectionWithinRoleTests extends AbstractSelectionTest
* bugs 14468 select inside instanceof statement in team method
*/
public void test34() {
-
+
String str =
"public team class T1 { \n" +
" class R1 { \n" +
@@ -1541,11 +1541,11 @@ public class SelectionWithinRoleTests extends AbstractSelectionTest
" } \n" +
" } \n" +
"} \n";
-
+
String selection = "Object";
-
+
String expectedCompletionNodeToString = "<SelectOnType:Object>";
-
+
String completionIdentifier = "Object";
String expectedUnitDisplayString =
"public team class T1 {\n"+
@@ -1560,12 +1560,12 @@ public class SelectionWithinRoleTests extends AbstractSelectionTest
String expectedReplacedSource = "Object";
String testName = "<select inside instanceof statement in role method>";
-
+
int selectionStart = str.indexOf(selection);
int selectionEnd = str.indexOf(selection) + selection.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
@@ -1578,18 +1578,18 @@ public class SelectionWithinRoleTests extends AbstractSelectionTest
* bugs 14468 select inside instanceof statement in role class
*/
public void test35() {
-
+
String str =
"public team class T1 { \n" +
" class R1 { \n" +
" boolean y = x instanceof Object; \n" +
" } \n" +
"} \n";
-
+
String selection = "Object";
-
+
String expectedCompletionNodeToString = "<SelectOnType:Object>";
-
+
String completionIdentifier = "Object";
String expectedUnitDisplayString =
"public team class T1 {\n"+
@@ -1601,12 +1601,12 @@ public class SelectionWithinRoleTests extends AbstractSelectionTest
"}\n";
String expectedReplacedSource = "Object";
String testName = "<select inside instanceof statement in role class>";
-
+
int selectionStart = str.indexOf(selection);
int selectionEnd = str.indexOf(selection) + selection.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
@@ -1619,19 +1619,19 @@ public class SelectionWithinRoleTests extends AbstractSelectionTest
* bugs 28064 select anonymous type in field decl of team class
*/
public void test36() {
-
+
String str =
"public team class T1 { \n" +
" class R1 { \n" +
" R1 x = new R1(){} \n" +
" } \n" +
"} \n";
-
+
String selection = "R1";
-
+
String expectedCompletionNodeToString = "<SelectOnAllocationExpression:new R1() {\n" +
"}>";
-
+
String completionIdentifier = "R1";
String expectedUnitDisplayString =
"public team class T1 {\n"+
@@ -1644,12 +1644,12 @@ public class SelectionWithinRoleTests extends AbstractSelectionTest
"}\n";
String expectedReplacedSource = "new R1()";
String testName = "<select anonymous type in field decl of role class>";
-
+
int selectionStart = str.lastIndexOf(selection);
int selectionEnd = str.lastIndexOf(selection) + selection.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
@@ -1658,6 +1658,6 @@ public class SelectionWithinRoleTests extends AbstractSelectionTest
expectedReplacedSource,
testName);
}
-
-
+
+
} \ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/SelectionWithinTeamTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/SelectionWithinTeamTests.java
index f36fc4e33..f7037b0d3 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/SelectionWithinTeamTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/SelectionWithinTeamTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -25,13 +25,13 @@ import org.eclipse.jdt.core.tests.compiler.parser.AbstractSelectionTest;
/**
* Enter a class description here!
- *
+ *
* @author jwloka
* @version $Id: SelectionWithinTeamTests.java 23494 2010-02-05 23:06:44Z stephan $
*/
-public class SelectionWithinTeamTests extends AbstractSelectionTest
+public class SelectionWithinTeamTests extends AbstractSelectionTest
{
- public SelectionWithinTeamTests(String testName)
+ public SelectionWithinTeamTests(String testName)
{
super(testName);
}
@@ -39,235 +39,235 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
* Select superclass of team class
*/
public void test01() {
-
- String str =
- "import java.io.*; \n" +
- " \n" +
- "public team class X extends IOException { \n" +
- "} \n";
-
+
+ String str =
+ "import java.io.*; \n" +
+ " \n" +
+ "public team class X extends IOException { \n" +
+ "} \n";
+
String selectionStartBehind = "extends ";
String selectionEndBehind = "IOException";
-
+
String expectedCompletionNodeToString = "<SelectOnType:IOException>";
String completionIdentifier = "IOException";
String expectedUnitDisplayString =
- "import java.io.*;\n" +
- "public team class X extends <SelectOnType:IOException> {\n" +
- " public X() {\n" +
- " }\n" +
+ "import java.io.*;\n" +
+ "public team class X extends <SelectOnType:IOException> {\n" +
+ " public X() {\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "IOException";
String testName = "<select superclass of team>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select superinterface of team class
*/
public void test02() {
-
- String str =
- "import java.io.*; \n" +
- " \n" +
+
+ String str =
+ "import java.io.*; \n" +
+ " \n" +
"public team class X extends IOException implements Serializable { \n" +
" int foo(){} \n" +
- "} \n";
-
+ "} \n";
+
String selectionStartBehind = "implements ";
String selectionEndBehind = "Serializable";
-
+
String expectedCompletionNodeToString = "<SelectOnType:Serializable>";
String completionIdentifier = "Serializable";
String expectedUnitDisplayString =
- "import java.io.*;\n" +
- "public team class X extends IOException implements <SelectOnType:Serializable> {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
+ "import java.io.*;\n" +
+ "public team class X extends IOException implements <SelectOnType:Serializable> {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " int foo() {\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "Serializable";
String testName = "<select superinterface of team>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select qualified superclass of team class
*/
public void test03() {
-
- String str =
- "public team class X extends java.io.IOException { \n" +
- "} \n";
-
+
+ String str =
+ "public team class X extends java.io.IOException { \n" +
+ "} \n";
+
String selectionStartBehind = "java.io.";
String selectionEndBehind = "IOException";
-
+
String expectedCompletionNodeToString = "<SelectOnType:java.io.IOException>";
String completionIdentifier = "IOException";
String expectedUnitDisplayString =
- "public team class X extends <SelectOnType:java.io.IOException> {\n" +
- " public X() {\n" +
- " }\n" +
+ "public team class X extends <SelectOnType:java.io.IOException> {\n" +
+ " public X() {\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "java.io.IOException";
String testName = "<select qualified superclass of team>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select package from qualified superclass in team class
*/
public void test04() {
-
- String str =
- "public team class X extends java.io.IOException { \n" +
- "} \n";
-
+
+ String str =
+ "public team class X extends java.io.IOException { \n" +
+ "} \n";
+
String selectionStartBehind = "java.";
String selectionEndBehind = "java.io";
-
+
String expectedCompletionNodeToString = "<SelectOnType:java.io>";
String completionIdentifier = "io";
String expectedUnitDisplayString =
- "public team class X extends <SelectOnType:java.io> {\n" +
- " public X() {\n" +
- " }\n" +
+ "public team class X extends <SelectOnType:java.io> {\n" +
+ " public X() {\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "java.io.IOException";
String testName = "<select package from qualified superclass in team>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select message send in team method
*/
public void test05() {
-
- String str =
+
+ String str =
"public team class X extends java.io.IOException { \n" +
" int foo(){ \n" +
" System.out.println(\"hello\"); \n";
-
+
String selectionStartBehind = "System.out.";
String selectionEndBehind = "println";
-
+
String expectedCompletionNodeToString = "<SelectOnMessageSend:System.out.println(\"hello\")>";
String completionIdentifier = "println";
String expectedUnitDisplayString =
- "public team class X extends java.io.IOException {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " <SelectOnMessageSend:System.out.println(\"hello\")>;\n" +
- " }\n" +
+ "public team class X extends java.io.IOException {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " int foo() {\n" +
+ " <SelectOnMessageSend:System.out.println(\"hello\")>;\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "System.out.println(\"hello\")";
String testName = "<select message send in team method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select message send with recovery before in team method
*/
public void test06() {
-
- String str =
+
+ String str =
"public team class X extends \n" +
" int foo(){ \n" +
" System.out.println(\"hello\"); \n";
-
+
String selectionStartBehind = "System.out.";
String selectionEndBehind = "println";
-
+
String expectedCompletionNodeToString = "<SelectOnMessageSend:System.out.println(\"hello\")>";
String completionIdentifier = "println";
String expectedUnitDisplayString =
- "public team class X {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " <SelectOnMessageSend:System.out.println(\"hello\")>;\n" +
- " }\n" +
+ "public team class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " int foo() {\n" +
+ " <SelectOnMessageSend:System.out.println(\"hello\")>;\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "System.out.println(\"hello\")";
String testName = "<select message send with recovery before>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
- * Select message send in team method with sibling method
+ * Select message send in team method with sibling method
*/
public void test07() {
-
- String str =
+
+ String str =
"public team class X extends \n" +
" int foo(){ \n" +
" this.bar(\"hello\"); \n" +
@@ -275,170 +275,170 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
" return s.length(); \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "this.";
String selectionEndBehind = "this.bar";
-
+
String expectedCompletionNodeToString = "<SelectOnMessageSend:this.bar(\"hello\")>";
String completionIdentifier = "bar";
String expectedUnitDisplayString =
- "public team class X {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " <SelectOnMessageSend:this.bar(\"hello\")>;\n" +
- " }\n" +
- " int bar(String s) {\n" +
- " }\n" +
+ "public team class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " int foo() {\n" +
+ " <SelectOnMessageSend:this.bar(\"hello\")>;\n" +
+ " }\n" +
+ " int bar(String s) {\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "this.bar(\"hello\")";
String testName = "<select message send in team method with sibling method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select field reference in team method
*/
public void test08() {
-
- String str =
+
+ String str =
"public team class X { \n" +
" int num = 0; \n" +
" int foo(){ \n" +
" int j = this.num; \n" +
"} \n";
-
+
String selectionStartBehind = "this.";
String selectionEndBehind = "this.num";
-
+
String expectedCompletionNodeToString = "<SelectionOnFieldReference:this.num>";
String completionIdentifier = "num";
String expectedUnitDisplayString =
- "public team class X {\n" +
- " int num;\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " int j = <SelectionOnFieldReference:this.num>;\n" +
- " }\n" +
+ "public team class X {\n" +
+ " int num;\n" +
+ " public X() {\n" +
+ " }\n" +
+ " int foo() {\n" +
+ " int j = <SelectionOnFieldReference:this.num>;\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "this.num";
String testName = "<select field reference in team method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select field reference with syntax errors in team method
*/
public void test09() {
-
- String str =
+
+ String str =
"public team class X \n" +
" int num \n" +
" int foo(){ \n" +
" int j = this.num; \n" +
"} \n";
-
+
String selectionStartBehind = "this.";
String selectionEndBehind = "this.num";
-
+
String expectedCompletionNodeToString = "<SelectionOnFieldReference:this.num>";
String completionIdentifier = "num";
String expectedUnitDisplayString =
- "public team class X {\n" +
- " int num;\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " int j = <SelectionOnFieldReference:this.num>;\n" +
- " }\n" +
+ "public team class X {\n" +
+ " int num;\n" +
+ " public X() {\n" +
+ " }\n" +
+ " int foo() {\n" +
+ " int j = <SelectionOnFieldReference:this.num>;\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "this.num";
String testName = "<select field reference with syntax errors>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select field reference inside message receiver within team method
*/
public void test10() {
-
- String str =
+
+ String str =
"public team class X { \n" +
" X x; \n" +
" int foo(){ \n" +
" int j = this.x.foo(); \n" +
"} \n";
-
+
String selectionStartBehind = "this.";
String selectionEndBehind = "this.x";
-
+
String expectedCompletionNodeToString = "<SelectionOnFieldReference:this.x>";
String completionIdentifier = "x";
String expectedUnitDisplayString =
- "public team class X {\n" +
- " X x;\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " int j = <SelectionOnFieldReference:this.x>;\n" +
- " }\n" +
+ "public team class X {\n" +
+ " X x;\n" +
+ " public X() {\n" +
+ " }\n" +
+ " int foo() {\n" +
+ " int j = <SelectionOnFieldReference:this.x>;\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "this.x";
String testName = "<select field reference inside message receiver within team method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select allocation in team method
*/
public void test11() {
-
- String str =
+
+ String str =
"public team class X { \n" +
" X(int i){} \n" +
" int foo(){ \n" +
@@ -446,43 +446,43 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
" X x = new X(j); \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "new ";
String selectionEndBehind = "new X";
-
+
String expectedCompletionNodeToString = "<SelectOnAllocationExpression:new X(j)>";
String completionIdentifier = "X";
String expectedUnitDisplayString =
- "public team class X {\n" +
- " X(int i) {\n" +
- " }\n" +
- " int foo() {\n" +
- " int j;\n" +
- " X x = <SelectOnAllocationExpression:new X(j)>;\n" +
- " }\n" +
+ "public team class X {\n" +
+ " X(int i) {\n" +
+ " }\n" +
+ " int foo() {\n" +
+ " int j;\n" +
+ " X x = <SelectOnAllocationExpression:new X(j)>;\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "new X(j)";
String testName = "<select allocation in team method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select qualified allocation in team method
*/
public void test12() {
-
- String str =
+
+ String str =
"public team class X { \n" +
" class Y { \n" +
" Y(int i){} \n" +
@@ -494,254 +494,254 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
" x.new Y(1); \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "x.new ";
String selectionEndBehind = "x.new Y";
-
+
String expectedCompletionNodeToString = "<SelectOnQualifiedAllocationExpression:x.new Y(1)>";
String completionIdentifier = "Y";
String expectedUnitDisplayString =
- "public team class X {\n" +
- " role class Y {\n" +
- " Y(int i) {\n" +
- " }\n" +
- " }\n" +
- " X(int i) {\n" +
- " }\n" +
- " int foo() {\n" +
- " int j;\n" +
- " X x;\n" +
- " <SelectOnQualifiedAllocationExpression:x.new Y(1)>;\n" +
- " }\n" +
+ "public team class X {\n" +
+ " role class Y {\n" +
+ " Y(int i) {\n" +
+ " }\n" +
+ " }\n" +
+ " X(int i) {\n" +
+ " }\n" +
+ " int foo() {\n" +
+ " int j;\n" +
+ " X x;\n" +
+ " <SelectOnQualifiedAllocationExpression:x.new Y(1)>;\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "x.new Y(1)";
String testName = "<select qualified allocation in team method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select qualified name reference receiver in team method
*/
public void test13() {
-
- String str =
+
+ String str =
"public team class X { \n" +
" int foo(){ \n" +
" java.lang.System.out.println(); \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "java.lang.";
String selectionEndBehind = "java.lang.System";
-
+
String expectedCompletionNodeToString = "<SelectOnName:java.lang.System>";
String completionIdentifier = "System";
String expectedUnitDisplayString =
- "public team class X {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " <SelectOnName:java.lang.System>;\n" +
- " }\n" +
+ "public team class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " int foo() {\n" +
+ " <SelectOnName:java.lang.System>;\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "java.lang.System.out";
String testName = "<select qualified name receiver in team method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select qualified name reference in team method
*/
public void test14() {
-
- String str =
+
+ String str =
"public team class X { \n" +
" int foo(){ \n" +
" System sys = java.lang.System; \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "java.lang.";
String selectionEndBehind = "java.lang.System";
-
+
String expectedCompletionNodeToString = "<SelectOnName:java.lang.System>";
String completionIdentifier = "System";
String expectedUnitDisplayString =
- "public team class X {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " System sys = <SelectOnName:java.lang.System>;\n" +
- " }\n" +
+ "public team class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " int foo() {\n" +
+ " System sys = <SelectOnName:java.lang.System>;\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "java.lang.System";
String testName = "<select qualified name in team method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select variable type with modifier in team method
*/
public void test15() {
-
- String str =
+
+ String str =
"public team class X { \n" +
" int foo(){ \n" +
" final System sys = null; \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "final ";
String selectionEndBehind = "final System";
-
+
String expectedCompletionNodeToString = "<SelectOnType:System>";
String completionIdentifier = "System";
String expectedUnitDisplayString =
- "public team class X {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " final <SelectOnType:System> sys;\n" +
- " }\n" +
+ "public team class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " int foo() {\n" +
+ " final <SelectOnType:System> sys;\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "System";
String testName = "<select variable type with modifier in team method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select variable type in team method
*/
public void test16() {
-
- String str =
+
+ String str =
"public team class X { \n" +
" int foo(){ \n" +
" System sys = null; \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "\n ";
String selectionEndBehind = "\n System";
-
+
String expectedCompletionNodeToString = "<SelectOnType:System>";
String completionIdentifier = "System";
String expectedUnitDisplayString =
- "public team class X {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " <SelectOnType:System> sys;\n" +
- " }\n" +
+ "public team class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " int foo() {\n" +
+ " <SelectOnType:System> sys;\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "System";
String testName = "<select variable type in team method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select name in team method
*/
public void test17() {
-
- String str =
+
+ String str =
"public team class X { \n" +
" int foo(){ \n" +
" System \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "\n ";
String selectionEndBehind = "\n System";
-
+
String expectedCompletionNodeToString = "<SelectOnName:System>";
String completionIdentifier = "System";
String expectedUnitDisplayString =
- "public team class X {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " <SelectOnName:System>;\n" +
- " }\n" +
+ "public team class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " int foo() {\n" +
+ " <SelectOnName:System>;\n" +
+ " }\n" +
"}\n";
-
+
String expectedReplacedSource = "System";
String testName = "<select name in team method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select anonymous type in team method
*/
public void test18() {
-
- String str =
+
+ String str =
"public team class X { \n" +
" int foo(){ \n" +
" new Object(){ \n" +
@@ -749,88 +749,88 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
" } \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "new ";
String selectionEndBehind = "new Object";
-
- String expectedCompletionNodeToString =
+
+ String expectedCompletionNodeToString =
"<SelectOnAllocationExpression:new Object() {\n" +
"}>";
String completionIdentifier = "Object";
String expectedUnitDisplayString =
- "public team class X {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
+ "public team class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " int foo() {\n" +
" <SelectOnAllocationExpression:new Object() {\n" +
- " }>;\n" +
- " }\n" +
+ " }>;\n" +
+ " }\n" +
"}\n";
-
+
String expectedReplacedSource = "new Object()";
String testName = "<select anonymous type in team method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select cast type in team method
*/
public void test19() {
-
- String str =
+
+ String str =
"public team class X { \n" +
" Object foo(){ \n" +
" return (Object) this; \n" +
" } \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "return (";
String selectionEndBehind = "return (Object";
-
+
String expectedCompletionNodeToString = "<SelectOnType:Object>";
String completionIdentifier = "Object";
String expectedUnitDisplayString =
- "public team class X {\n" +
- " public X() {\n" +
- " }\n" +
- " Object foo() {\n" +
- " return (<SelectOnType:Object>) this;\n" +
- " }\n" +
+ "public team class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " Object foo() {\n" +
+ " return (<SelectOnType:Object>) this;\n" +
+ " }\n" +
"}\n";
-
+
String expectedReplacedSource = "Object";
String testName = "<select cast type in team method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select package of team class
*/
public void test20() {
-
+
String str =
"package x.y.other; \n" +
"public team class X { \n" +
@@ -838,42 +838,42 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
" } \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "x.";
String selectionEndBehind = "x.y";
-
+
String expectedCompletionNodeToString = "<SelectOnPackage:x.y>";
String completionIdentifier = "y";
String expectedUnitDisplayString =
- "package <SelectOnPackage:x.y>;\n" +
- "public team class X {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
+ "package <SelectOnPackage:x.y>;\n" +
+ "public team class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " int foo() {\n" +
+ " }\n" +
"}\n";
-
+
String expectedReplacedSource = "x.y.other";
String testName = "<select package of team class>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select import in team class
*/
public void test21() {
-
+
String str =
"import x.y.Other; \n" +
"public team class X { \n" +
@@ -881,42 +881,42 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
" } \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "y.";
String selectionEndBehind = "y.Other";
-
+
String expectedCompletionNodeToString = "<SelectOnImport:x.y.Other>";
String completionIdentifier = "Other";
String expectedUnitDisplayString =
- "import <SelectOnImport:x.y.Other>;\n" +
- "public team class X {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
+ "import <SelectOnImport:x.y.Other>;\n" +
+ "public team class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " int foo() {\n" +
+ " }\n" +
"}\n";
-
+
String expectedReplacedSource = "x.y.Other";
String testName = "<select import in team class>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select import on demand in team class
*/
public void test22() {
-
+
String str =
"import x.y.other.*; \n" +
"public team class X { \n" +
@@ -924,42 +924,42 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
" } \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "y.";
String selectionEndBehind = "y.other";
-
+
String expectedCompletionNodeToString = "<SelectOnImport:x.y.other>";
String completionIdentifier = "other";
String expectedUnitDisplayString =
- "import <SelectOnImport:x.y.other>;\n" +
- "public team class X {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
+ "import <SelectOnImport:x.y.other>;\n" +
+ "public team class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " int foo() {\n" +
+ " }\n" +
"}\n";
-
+
String expectedReplacedSource = "x.y.other";
String testName = "<select import on demand in team class>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select array initializer type in team method
*/
public void test23() {
-
+
String str =
"public team class X { \n" +
" int foo(){ \n" +
@@ -967,84 +967,84 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
// " } \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "new ";
String selectionEndBehind = "new String";
String expectedCompletionNodeToString = "<SelectOnType:String>";
String completionIdentifier = "String";
String expectedUnitDisplayString =
- "public team class X {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " String[] p = <SelectOnType:String>;\n" +
- " }\n" +
+ "public team class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " int foo() {\n" +
+ " String[] p = <SelectOnType:String>;\n" +
+ " }\n" +
"}\n";
-
+
String expectedReplacedSource = "String";
String testName = "<select array initializer type in team method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select super in team method
*/
public void test25() {
-
+
String str =
"public team class G { \n" +
" Object foo() { \n" +
" return super.foo(); \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "return ";
String selectionEndBehind = "return super";
-
+
String expectedCompletionNodeToString = "<SelectOnSuper:super>";
-
+
String completionIdentifier = "super";
String expectedUnitDisplayString =
- "public team class G {\n" +
- " public G() {\n" +
- " }\n" +
- " Object foo() {\n" +
- " return <SelectOnSuper:super>;\n" +
- " }\n" +
+ "public team class G {\n" +
+ " public G() {\n" +
+ " }\n" +
+ " Object foo() {\n" +
+ " return <SelectOnSuper:super>;\n" +
+ " }\n" +
"}\n";
-
+
String expectedReplacedSource = "super";
String testName = "<select super in team method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select qualified super in anonymous instance in team method
*/
public void test26() {
-
+
String str =
"public team class G { \n" +
" Object foo() { \n" +
@@ -1055,87 +1055,87 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
" } \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "G.";
String selectionEndBehind = "G.super";
-
+
String expectedCompletionNodeToString = "<SelectOnQualifiedSuper:G.super>";
-
+
String completionIdentifier = "super";
String expectedUnitDisplayString =
- "public team class G {\n" +
- " public G() {\n" +
- " }\n" +
- " Object foo() {\n" +
- " new X() {\n" +
- " Object bar() {\n" +
- " return <SelectOnQualifiedSuper:G.super>;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n";
+ "public team class G {\n" +
+ " public G() {\n" +
+ " }\n" +
+ " Object foo() {\n" +
+ " new X() {\n" +
+ " Object bar() {\n" +
+ " return <SelectOnQualifiedSuper:G.super>;\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
+ "}\n";
String expectedReplacedSource = "G.super";
String testName = "<select qualified superr in anonymous instance in team method>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select super constructor call within team constructor
*/
public void test27() {
-
+
String str =
"public team class G { \n" +
" G() { \n" +
" super(); \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "\n\t\t";
String selectionEndBehind = "super";
-
+
String expectedCompletionNodeToString = "<SelectOnExplicitConstructorCall:super()>;";
-
+
String completionIdentifier = "super";
String expectedUnitDisplayString =
- "public team class G {\n" +
- " G() {\n" +
- " <SelectOnExplicitConstructorCall:super()>;\n" +
- " }\n" +
+ "public team class G {\n" +
+ " G() {\n" +
+ " <SelectOnExplicitConstructorCall:super()>;\n" +
+ " }\n" +
"}\n";
-
+
String expectedReplacedSource = "super()";
String testName = "<select super constructor call within team constructor>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select qualified super constructor call within local class in team class
*/
public void test28() {
-
+
String str =
"public team class G { \n" +
" class M {} \n" +
@@ -1147,90 +1147,90 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
" } \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "new G().";
String selectionEndBehind = "new G().super";
-
+
String expectedCompletionNodeToString = "<SelectOnExplicitConstructorCall:new G().super()>;";
-
+
String completionIdentifier = "super";
String expectedUnitDisplayString =
- "public team class G {\n" +
- " role class M {\n" +
- " }\n" +
- " public G() {\n" +
- " }\n" +
- " static Object foo() {\n" +
- " class X extends M {\n" +
- " X() {\n" +
- " <SelectOnExplicitConstructorCall:new G().super()>;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
+ "public team class G {\n" +
+ " role class M {\n" +
+ " }\n" +
+ " public G() {\n" +
+ " }\n" +
+ " static Object foo() {\n" +
+ " class X extends M {\n" +
+ " X() {\n" +
+ " <SelectOnExplicitConstructorCall:new G().super()>;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "}\n";
String expectedReplacedSource = "new G().super()";
String testName = "<select qualified super constructor call>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
-
+
/**
* Select super constructor call with arguments in team constructor
*/
public void test30() {
-
+
String str =
"public team class G { \n" +
" G() { \n" +
" super(new G()); \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "\n\t\t";
String selectionEndBehind = "super";
-
+
String expectedCompletionNodeToString = "<SelectOnExplicitConstructorCall:super(new G())>;";
-
+
String completionIdentifier = "super";
String expectedUnitDisplayString =
- "public team class G {\n" +
- " G() {\n" +
- " <SelectOnExplicitConstructorCall:super(new G())>;\n" +
- " }\n" +
+ "public team class G {\n" +
+ " G() {\n" +
+ " <SelectOnExplicitConstructorCall:super(new G())>;\n" +
+ " }\n" +
"}\n";
-
+
String expectedReplacedSource = "super(new G())";
String testName = "<select super constructor call with arguments in team constructor>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Regression test for 1FVQ0LK
*/
public void test31() {
-
+
String str =
"team class X { \n" +
" Y f; \n" +
@@ -1239,12 +1239,12 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
" Z z= new Z(); \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "\n\t";
String selectionEndBehind = "Y";
-
+
String expectedCompletionNodeToString = "<SelectOnType:Y>";
-
+
String completionIdentifier = "Y";
String expectedUnitDisplayString =
"team class X {\n" +
@@ -1254,28 +1254,28 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
" void foo() {\n" +
" }\n" +
"}\n";
-
+
String expectedReplacedSource = "Y";
String testName = "<regression test for 1FVQ0LK>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Regression test for 1FWT4AJ: ITPCOM:WIN98 - SelectionParser produces duplicate type declaration
*/
public void test32() {
-
+
String str =
"package search; \n"+
"import java.io.*; \n"+
@@ -1285,47 +1285,47 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
" char currentChar = \"hello\".toLowerCase() \n"+
" } \n"+
"} \n";
-
+
String selectionStartBehind = "\"hello\".";
String selectionEndBehind = "\"hello\".toLowerCase";
-
+
String expectedCompletionNodeToString = "<SelectOnMessageSend:\"hello\".toLowerCase()>";
-
+
String completionIdentifier = "toLowerCase";
String expectedUnitDisplayString =
- "package search;\n" +
- "import java.io.*;\n" +
- "public team class PhraseQuery {\n" +
- " public PhraseQuery() {\n" +
- " }\n" +
- " public boolean containsPhrase() {\n" +
- " {\n" +
- " char currentChar = <SelectOnMessageSend:\"hello\".toLowerCase()>;\n" +
- " }\n" +
- " }\n" +
+ "package search;\n" +
+ "import java.io.*;\n" +
+ "public team class PhraseQuery {\n" +
+ " public PhraseQuery() {\n" +
+ " }\n" +
+ " public boolean containsPhrase() {\n" +
+ " {\n" +
+ " char currentChar = <SelectOnMessageSend:\"hello\".toLowerCase()>;\n" +
+ " }\n" +
+ " }\n" +
"}\n";
-
+
String expectedReplacedSource = "\"hello\".toLowerCase()";
String testName = "<1FWT4AJ: ITPCOM:WIN98 - SelectionParser produces duplicate type declaration>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Regression test for 1G4CLZM: ITPJUI:WINNT - 'Import Selection' - Set not found
*/
public void test33() {
-
+
String str =
" import java.util.AbstractMap; \n"+
" public team class c4 extends AbstractMap { \n"+
@@ -1336,43 +1336,43 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
" return null; \n"+
" } \n"+
" } \n";
-
+
String selectionStartBehind = "\n\t\tpublic ";
String selectionEndBehind = "public Set";
-
+
String expectedCompletionNodeToString = "<SelectOnType:Set>";
-
+
String completionIdentifier = "Set";
String expectedUnitDisplayString =
- "import java.util.AbstractMap;\n" +
- "public team class c4 extends AbstractMap {\n" +
- " public c4() {\n" +
- " }\n" +
- " public <SelectOnType:Set> entrySet() {\n" +
- " }\n" +
+ "import java.util.AbstractMap;\n" +
+ "public team class c4 extends AbstractMap {\n" +
+ " public c4() {\n" +
+ " }\n" +
+ " public <SelectOnType:Set> entrySet() {\n" +
+ " }\n" +
"}\n";
-
+
String expectedReplacedSource = "Set";
String testName = "<1G4CLZM: ITPJUI:WINNT - 'Import Selection' - Set not found>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Regression test for 1GB99S3: ITPJUI:WINNT - SH: NPE in editor while getting hover help
*/
public void test34() {
-
+
String str =
"public team class X { \n"+
" public int foo() { \n"+
@@ -1380,44 +1380,44 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
" return array.length; \n"+
" } \n"+
"} \n";
-
+
String selectionStartBehind = "\n\t\treturn ";
String selectionEndBehind = "array.length";
-
+
String expectedCompletionNodeToString = NONE;
-
+
String completionIdentifier = NONE;
String expectedUnitDisplayString =
- "public team class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public int foo() {\n" +
- " Object[] array;\n" +
- " return array.length;\n" +
- " }\n" +
+ "public team class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public int foo() {\n" +
+ " Object[] array;\n" +
+ " return array.length;\n" +
+ " }\n" +
"}\n";
-
+
String expectedReplacedSource = NONE;
String testName = "<1GB99S3: ITPJUI:WINNT - SH: NPE in editor while getting hover help>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select this constructor call in team constructor with arguments
*/
public void test35() {
-
+
String str =
"public team class G { \n" +
" G() { \n" +
@@ -1426,43 +1426,43 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
" this(); \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "\n\t\t";
String selectionEndBehind = "this";
-
+
String expectedCompletionNodeToString = "<SelectOnExplicitConstructorCall:this()>;";
-
+
String completionIdentifier = "this";
String expectedUnitDisplayString =
- "public team class G {\n" +
+ "public team class G {\n" +
" G() {\n" +
" }\n" +
- " G(int x) {\n" +
- " <SelectOnExplicitConstructorCall:this()>;\n" +
+ " G(int x) {\n" +
+ " <SelectOnExplicitConstructorCall:this()>;\n" +
" }\n" +
"}\n";
-
+
String expectedReplacedSource = "this()";
String testName = "<select this constructor call in team constructor with arguments>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select qualified this constructor call of team class
*/
public void test36() {
-
+
String str =
"public team class G { \n" +
" static Object foo() { \n" +
@@ -1475,49 +1475,49 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
" } \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "new G().";
String selectionEndBehind = "new G().this";
-
+
String expectedCompletionNodeToString = "<SelectOnExplicitConstructorCall:new G().this()>;";
-
+
String completionIdentifier = "this";
String expectedUnitDisplayString =
- "public team class G {\n" +
- " public G() {\n" +
- " }\n" +
- " static Object foo() {\n" +
- " class X {\n" +
+ "public team class G {\n" +
+ " public G() {\n" +
+ " }\n" +
+ " static Object foo() {\n" +
+ " class X {\n" +
" X() {\n" +
" super();\n"+
- " }\n" +
- " X(int x) {\n" +
- " <SelectOnExplicitConstructorCall:new G().this()>;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
+ " }\n" +
+ " X(int x) {\n" +
+ " <SelectOnExplicitConstructorCall:new G().this()>;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "}\n";
String expectedReplacedSource = "new G().this()";
String testName = "<select qualified this constructor call of team class>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select qualified this constructor call with arguments of local class
*/
public void test37() {
-
+
String str =
"public team class G { \n" +
" static Object foo() { \n" +
@@ -1530,90 +1530,90 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
" } \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "new G().";
String selectionEndBehind = "new G().this";
-
+
String expectedCompletionNodeToString = "<SelectOnExplicitConstructorCall:new G().this((23 + \"hello\"))>;";
-
+
String completionIdentifier = "this";
String expectedUnitDisplayString =
- "public team class G {\n" +
- " public G() {\n" +
- " }\n" +
- " static Object foo() {\n" +
- " class X {\n" +
- " X() {\n" +
+ "public team class G {\n" +
+ " public G() {\n" +
+ " }\n" +
+ " static Object foo() {\n" +
+ " class X {\n" +
+ " X() {\n" +
" super();\n"+
- " }\n" +
- " X(int x) {\n" +
- " <SelectOnExplicitConstructorCall:new G().this((23 + \"hello\"))>;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
+ " }\n" +
+ " X(int x) {\n" +
+ " <SelectOnExplicitConstructorCall:new G().this((23 + \"hello\"))>;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "}\n";
String expectedReplacedSource = "new G().this(23 + \"hello\")";
String testName = "<select qualified this constructor call with arguments>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* Select this constructor call with arguments of team class
*/
public void test38() {
-
+
String str =
"public team class G { \n" +
" G() { \n" +
" this(new G()); \n" +
" } \n" +
"} \n";
-
+
String selectionStartBehind = "\n\t\t";
String selectionEndBehind = "this";
-
+
String expectedCompletionNodeToString = "<SelectOnExplicitConstructorCall:this(new G())>;";
-
+
String completionIdentifier = "this";
String expectedUnitDisplayString =
- "public team class G {\n" +
- " G() {\n" +
- " <SelectOnExplicitConstructorCall:this(new G())>;\n" +
- " }\n" +
+ "public team class G {\n" +
+ " G() {\n" +
+ " <SelectOnExplicitConstructorCall:this(new G())>;\n" +
+ " }\n" +
"}\n";
-
+
String expectedReplacedSource = "this(new G())";
String testName = "<select this constructor call with arguments of team class>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
expectedUnitDisplayString,
completionIdentifier,
expectedReplacedSource,
- testName);
+ testName);
}
/**
* bugs 3293 search does not work in inner class (1GEUQHJ)
*/
public void test39() {
-
+
String str =
"public team class X { \n" +
" Object hello = new Object(){ \n" +
@@ -1622,12 +1622,12 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
" } \n" +
" }; \n" +
"} \n";
-
+
String selectionStartBehind = "s.";
String selectionEndBehind = "length";
-
+
String expectedCompletionNodeToString = "<SelectOnMessageSend:s.length()>";
-
+
String completionIdentifier = "length";
String expectedUnitDisplayString =
"public team class X {\n" +
@@ -1641,12 +1641,12 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
"}\n";
String expectedReplacedSource = "s.length()";
String testName = "<bugs 3293 search does not work in inner class (1GEUQHJ)>";
-
+
int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
@@ -1659,31 +1659,31 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
* bugs 3229 OpenOnSelection - strange behaviour of code resolve (1GAVL08)
*/
public void test40() {
-
+
String str =
"public team class X { \n" +
" Object \n" +
"} \n";
-
+
String selection = "Object";
-
+
String expectedCompletionNodeToString = "<SelectOnType:Object>";
-
+
String completionIdentifier = "Object";
String expectedUnitDisplayString =
- "public team class X {\n" +
- " <SelectOnType:Object>;\n" +
- " public X() {\n" +
- " }\n" +
+ "public team class X {\n" +
+ " <SelectOnType:Object>;\n" +
+ " public X() {\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "Object";
String testName = "<bugs 3229 OpenOnSelection - strange behaviour of code resolve (1GAVL08)>";
-
+
int selectionStart = str.indexOf(selection);
int selectionEnd = str.indexOf(selection) + selection.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
@@ -1696,35 +1696,35 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
* selection on local name in team method
*/
public void test41() {
-
+
String str =
"public team class X { \n" +
" public void foo() { \n" +
" Object var; \n" +
" } \n" +
"} \n";
-
+
String selection = "var";
-
+
String expectedCompletionNodeToString = "<SelectionOnLocalName:Object var>;";
-
+
String completionIdentifier = "var";
String expectedUnitDisplayString =
- "public team class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " <SelectionOnLocalName:Object var>;\n" +
- " }\n" +
+ "public team class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public void foo() {\n" +
+ " <SelectionOnLocalName:Object var>;\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "var";
String testName = "<select local name in team method>";
-
+
int selectionStart = str.indexOf(selection);
int selectionEnd = str.indexOf(selection) + selection.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
@@ -1737,33 +1737,33 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
* bugs 11475 selection on argument name of team method
*/
public void test42() {
-
+
String str =
"public team class X { \n" +
" public void foo(Object var){ \n" +
" } \n" +
"} \n";
-
+
String selection = "var";
-
+
String expectedCompletionNodeToString = "<SelectionOnArgumentName:Object var>";
-
+
String completionIdentifier = "var";
String expectedUnitDisplayString =
- "public team class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public void foo(<SelectionOnArgumentName:Object var>) {\n" +
- " }\n" +
+ "public team class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public void foo(<SelectionOnArgumentName:Object var>) {\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "var";
String testName = "<select argument name of team method>";
-
+
int selectionStart = str.indexOf(selection);
int selectionEnd = str.indexOf(selection) + selection.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
@@ -1776,7 +1776,7 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
* bugs 11475 selection on argument name inside catch statement in team method.
*/
public void test43() {
-
+
String str =
"public team class X { \n" +
" public void foo(){ \n" +
@@ -1784,28 +1784,28 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
" }catch(Object var){}\n" +
" } \n" +
"} \n";
-
+
String selection = "var";
-
+
String expectedCompletionNodeToString = "<SelectionOnArgumentName:Object var>";
-
+
String completionIdentifier = "var";
String expectedUnitDisplayString =
- "public team class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " <SelectionOnArgumentName:Object var>;\n" +
- " }\n" +
+ "public team class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public void foo() {\n" +
+ " <SelectionOnArgumentName:Object var>;\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "var";
String testName = "<select argument name inside catch statement in team method>";
-
+
int selectionStart = str.indexOf(selection);
int selectionEnd = str.indexOf(selection) + selection.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
@@ -1818,31 +1818,31 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
* bugs 15430 select super in field initializer within team class
*/
public void test44() {
-
+
String str =
"public team class X { \n" +
" String x = super.foo() \n" +
"} \n";
-
+
String selection = "super";
-
+
String expectedCompletionNodeToString = "<SelectOnSuper:super>";
-
+
String completionIdentifier = "super";
String expectedUnitDisplayString =
- "public team class X {\n" +
- " String x = <SelectOnSuper:super>;\n" +
- " public X() {\n" +
- " }\n" +
+ "public team class X {\n" +
+ " String x = <SelectOnSuper:super>;\n" +
+ " public X() {\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "super";
String testName = "<select super in field initializer within team class>";
-
+
int selectionStart = str.indexOf(selection);
int selectionEnd = str.indexOf(selection) + selection.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
@@ -1855,7 +1855,7 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
* bugs 14468 select inside instanceof statement in team method
*/
public void test45() {
-
+
String str =
"public team class X { \n" +
" void foo() {\n" +
@@ -1863,11 +1863,11 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
" }\n" +
" } \n" +
"} \n";
-
+
String selection = "Object";
-
+
String expectedCompletionNodeToString = "<SelectOnType:Object>";
-
+
String completionIdentifier = "Object";
String expectedUnitDisplayString =
"public team class X {\n"+
@@ -1879,12 +1879,12 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
"}\n";
String expectedReplacedSource = "Object";
String testName = "<select inside instanceof statement in team method>";
-
+
int selectionStart = str.indexOf(selection);
int selectionEnd = str.indexOf(selection) + selection.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
@@ -1897,18 +1897,18 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
* bugs 14468 select inside instanceof statement in team method
*/
public void test46() {
-
+
String str =
"public team class X { \n" +
" void foo() {\n" +
" y = x instanceof Object;\n" +
" } \n" +
"} \n";
-
+
String selection = "Object";
-
+
String expectedCompletionNodeToString = "<SelectOnType:Object>";
-
+
String completionIdentifier = "Object";
String expectedUnitDisplayString =
"public team class X {\n"+
@@ -1920,12 +1920,12 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
"}\n";
String expectedReplacedSource = "Object";
String testName = "<select inside instanceof statement in team method>";
-
+
int selectionStart = str.indexOf(selection);
int selectionEnd = str.indexOf(selection) + selection.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
@@ -1938,18 +1938,18 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
* bugs 14468 select inside instanceof statement in team method
*/
public void test47() {
-
+
String str =
"public team class X { \n" +
" void foo() {\n" +
" boolean y = x instanceof Object;\n" +
" } \n" +
"} \n";
-
+
String selection = "Object";
-
+
String expectedCompletionNodeToString = "<SelectOnType:Object>";
-
+
String completionIdentifier = "Object";
String expectedUnitDisplayString =
"public team class X {\n"+
@@ -1961,12 +1961,12 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
"}\n";
String expectedReplacedSource = "Object";
String testName = "<select inside instanceof statement in team method>";
-
+
int selectionStart = str.indexOf(selection);
int selectionEnd = str.indexOf(selection) + selection.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
@@ -1979,16 +1979,16 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
* bugs 14468 select inside instanceof statement in team class
*/
public void test48() {
-
+
String str =
"public team class X { \n" +
" boolean y = x instanceof Object;\n" +
"} \n";
-
+
String selection = "Object";
-
+
String expectedCompletionNodeToString = "<SelectOnType:Object>";
-
+
String completionIdentifier = "Object";
String expectedUnitDisplayString =
"public team class X {\n"+
@@ -1998,12 +1998,12 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
"}\n";
String expectedReplacedSource = "Object";
String testName = "<select inside instanceof statement in team class>";
-
+
int selectionStart = str.indexOf(selection);
int selectionEnd = str.indexOf(selection) + selection.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
@@ -2016,17 +2016,17 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
* bugs 28064 select anonymous type in field decl of team class
*/
public void test49() {
-
+
String str =
"public team class X { \n" +
" X x = new X(){}\n" +
"} \n";
-
+
String selection = "X";
-
+
String expectedCompletionNodeToString = "<SelectOnAllocationExpression:new X() {\n" +
"}>";
-
+
String completionIdentifier = "X";
String expectedUnitDisplayString =
"public team class X {\n"+
@@ -2037,12 +2037,12 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
"}\n";
String expectedReplacedSource = "new X()";
String testName = "<select anonymous type in field decl of team class>";
-
+
int selectionStart = str.lastIndexOf(selection);
int selectionEnd = str.lastIndexOf(selection) + selection.length() - 1;
-
+
this.checkDietParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
@@ -2056,7 +2056,7 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
* select method call inside anonymous type in team method
*/
public void test50() {
-
+
String str =
"public team class X { \n" +
" void foo() {\n" +
@@ -2069,34 +2069,34 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
" }\n" +
" } \n" +
"} \n";
-
+
String selection = "bar2";
-
+
String expectedCompletionNodeToString = "<SelectOnMessageSend:bar2()>";
-
+
String completionIdentifier = "bar2";
String expectedUnitDisplayString =
- "public team class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " new Object() {\n" +
- " void bar() {\n" +
- " <SelectOnMessageSend:bar2()>;\n" +
- " }\n" +
- " void bar2() {\n" +
- " }\n" +
- " };\n" +
- " }\n" +
+ "public team class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " void foo() {\n" +
+ " new Object() {\n" +
+ " void bar() {\n" +
+ " <SelectOnMessageSend:bar2()>;\n" +
+ " }\n" +
+ " void bar2() {\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "bar2()";
String testName = "<select method call inside anonymous type in team method>";
-
+
int selectionStart = str.indexOf(selection);
int selectionEnd = str.indexOf(selection) + selection.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
@@ -2110,7 +2110,7 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
* select method call inside anonymous type in team method
*/
public void test51() {
-
+
String str =
"public team class X { \n" +
" void foo() {\n" +
@@ -2127,38 +2127,38 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
" }\n" +
" }\n" +
"} \n";
-
+
String selection = "bar2";
-
+
String expectedCompletionNodeToString = "<SelectOnMessageSend:bar2()>";
-
+
String completionIdentifier = "bar2";
String expectedUnitDisplayString =
- "public team class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " new Object() {\n" +
- " void foo0() {\n" +
- " new Object() {\n" +
- " void bar() {\n" +
- " <SelectOnMessageSend:bar2()>;\n" +
- " }\n" +
- " void bar2() {\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " };\n" +
- " }\n" +
+ "public team class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " void foo() {\n" +
+ " new Object() {\n" +
+ " void foo0() {\n" +
+ " new Object() {\n" +
+ " void bar() {\n" +
+ " <SelectOnMessageSend:bar2()>;\n" +
+ " }\n" +
+ " void bar2() {\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "bar2()";
String testName = "<select method call inside anonymous type in team method>";
-
+
int selectionStart = str.indexOf(selection);
int selectionEnd = str.indexOf(selection) + selection.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
@@ -2172,7 +2172,7 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
* select method call inside anonymous type in team method
*/
public void test52() {
-
+
String str =
"public team class X { \n" +
" void foo() {\n" +
@@ -2182,7 +2182,7 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
" void bar(){\n" +
" bar2();\n" +
" }\n" +
-
+
" }\n" +
" }\n" +
" void bar2() {\n" +
@@ -2190,38 +2190,38 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
" }\n" +
" }\n" +
"} \n";
-
+
String selection = "bar2";
-
+
String expectedCompletionNodeToString = "<SelectOnMessageSend:bar2()>";
-
+
String completionIdentifier = "bar2";
String expectedUnitDisplayString =
- "public team class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " new Object() {\n" +
- " void foo0() {\n" +
- " new Object() {\n" +
- " void bar() {\n" +
- " <SelectOnMessageSend:bar2()>;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " void bar2() {\n" +
- " }\n" +
- " };\n" +
- " }\n" +
+ "public team class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " void foo() {\n" +
+ " new Object() {\n" +
+ " void foo0() {\n" +
+ " new Object() {\n" +
+ " void bar() {\n" +
+ " <SelectOnMessageSend:bar2()>;\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
+ " void bar2() {\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "bar2()";
String testName = "<select method call inside anonymous type in team method>";
-
+
int selectionStart = str.indexOf(selection);
int selectionEnd = str.indexOf(selection) + selection.length() - 1;
-
+
this.checkMethodParse(
- str.toCharArray(),
+ str.toCharArray(),
selectionStart,
selectionEnd,
expectedCompletionNodeToString,
@@ -2230,6 +2230,6 @@ public class SelectionWithinTeamTests extends AbstractSelectionTest
expectedReplacedSource,
testName);
}
-
-
+
+
} \ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/codeselect/CodeSelectionTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/codeselect/CodeSelectionTests.java
index 705857519..3e2db8c0b 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/codeselect/CodeSelectionTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/codeselect/CodeSelectionTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -99,7 +99,7 @@ public class CodeSelectionTests extends AbstractJavaModelTests
"B1() [in B1 [in B1.java [in basepkg [in src [in CodeSelection]]]]]",
elements);
}
-
+
public void testBaseclass2() throws JavaModelException
{
ICompilationUnit cu = getCompilationUnit("CodeSelection", "src", "teampkg1", "T2.java");
@@ -109,7 +109,7 @@ public class CodeSelectionTests extends AbstractJavaModelTests
"B1 [in B1.java [in basepkg [in src [in CodeSelection]]]]",
elements);
}
-
+
public void testBaseclass3() throws JavaModelException
{
ICompilationUnit cu = getCompilationUnit("CodeSelection", "src", "teampkg1", "T3.java");
@@ -119,7 +119,7 @@ public class CodeSelectionTests extends AbstractJavaModelTests
"T1 [in T1.java [in teampkg1 [in src [in CodeSelection]]]]",
elements);
}
-
+
public void testBaseclass4() throws JavaModelException
{
ICompilationUnit cu = getCompilationUnit("CodeSelection", "src", "teampkg1", "T4.java");
@@ -129,7 +129,7 @@ public class CodeSelectionTests extends AbstractJavaModelTests
"T0 [in T0.java [in teampkg2 [in src [in CodeSelection]]]]",
elements);
}
-
+
public void testBaseclass5() throws JavaModelException
{
ICompilationUnit cu = getCompilationUnit("CodeSelection", "src", "teampkg1", "T5.java");
@@ -146,7 +146,7 @@ public class CodeSelectionTests extends AbstractJavaModelTests
IJavaElement[] elements = codeSelect(cu, "base.R1", "base.R1");
assertElementsEqual(
"Unexpected elements",
- "R1 [in T5 [in T5.java [in teampkg1 [in src [in CodeSelection]]]]]",
+ "R1 [in T5 [in T5.java [in teampkg1 [in src [in CodeSelection]]]]]",
elements);
}
@@ -169,9 +169,9 @@ public class CodeSelectionTests extends AbstractJavaModelTests
"R1 [in T5 [in T5.java [in teampkg1 [in src [in CodeSelection]]]]]",
elements);
}
-
+
// select the superclass ref from one rofi to another
- public void testRoleSuperclass() throws JavaModelException
+ public void testRoleSuperclass() throws JavaModelException
{
ICompilationUnit cu = getCompilationUnit("CodeSelection", "src", "teampkg2.T2", "R2.java");
IJavaElement[] elements = codeSelect(cu, "R1", "R1");
@@ -180,7 +180,7 @@ public class CodeSelectionTests extends AbstractJavaModelTests
"R1 [in R1.java [in teampkg2.T2 [in src [in CodeSelection]]]]",
elements);
}
-
+
//testing type declarations
public void testTeamDeclaration() throws JavaModelException
{
@@ -211,9 +211,9 @@ public class CodeSelectionTests extends AbstractJavaModelTests
"R1 [in T1 [in T1.java [in teampkg2 [in src [in CodeSelection]]]]]",
elements);
}
-
+
//TODO(gbr) test role declaration in role file.
-
+
//testing method declarations
public void testMethodDeclaration1() throws JavaModelException
{
@@ -295,7 +295,7 @@ public class CodeSelectionTests extends AbstractJavaModelTests
"A [in A.java [in regression [in src [in CodeSelection]]]]",
elements);
}
-
+
/**
* Select a callout mapping (role method spec)
@@ -309,7 +309,7 @@ public class CodeSelectionTests extends AbstractJavaModelTests
"rm2(int) -> bm1(int) [in R [in MappingsTeam1 [in MappingsTeam1.java [in mappings [in src [in CodeSelection]]]]]]",
elements);
}
-
+
/**
* Select a callout mapping (role method spec)
*/
@@ -335,7 +335,7 @@ public class CodeSelectionTests extends AbstractJavaModelTests
"rm1(int, Collection) [in R [in MappingsTeam1 [in MappingsTeam1.java [in mappings [in src [in CodeSelection]]]]]]",
elements);
}
-
+
/**
* Select argument name inside a callin parameter mapping.
*/
@@ -364,11 +364,11 @@ public class CodeSelectionTests extends AbstractJavaModelTests
// "x [in rm2(int)->bm1(int) [in R [in MappingsTeam1 [in MappingsTeam1.java [in mappings [in src [in CodeSelection]]]]]]]",
elements);
}
-
+
/**
* Select method call inside a callout parameter mapping.
*/
- public void testParamMapping3() throws JavaModelException
+ public void testParamMapping3() throws JavaModelException
{
ICompilationUnit cu = getCompilationUnit("CodeSelection", "src", "mappings", "MappingsTeam1.java");
IJavaElement[] elements = codeSelect(cu, "doubleIt(result)", "doubleIt");
@@ -377,33 +377,33 @@ public class CodeSelectionTests extends AbstractJavaModelTests
"doubleIt(int) [in R [in MappingsTeam1 [in MappingsTeam1.java [in mappings [in src [in CodeSelection]]]]]]",
// codeSelect cannot handle children of OTJavaElement :(, uses corresponding SourceMethod as parent
// "x [in rm2(int)->bm1(int) [in R [in MappingsTeam1 [in MappingsTeam1.java [in mappings [in src [in CodeSelection]]]]]]]",
- elements);
+ elements);
}
/**
* Select base field reference inside a callout-to-field parameter mapping.
*/
- public void testParamMapping4() throws JavaModelException
+ public void testParamMapping4() throws JavaModelException
{
ICompilationUnit cu = getCompilationUnit("CodeSelection", "src", "mappings", "MappingsTeam1.java");
IJavaElement[] elements = codeSelect(cu, "jon } // c-t-f", "jon");
assertElementsEqual(
"Unexpected elements",
"jon [in B1 [in B1.java [in basepkg [in src [in CodeSelection]]]]]",
- elements);
+ elements);
}
/**
* Select base field reference inside a callin parameter mapping.
*/
- public void testParamMapping5() throws JavaModelException
+ public void testParamMapping5() throws JavaModelException
{
ICompilationUnit cu = getCompilationUnit("CodeSelection", "src", "mappings", "MappingsTeam1.java");
IJavaElement[] elements = codeSelect(cu, "jon } // callin", "jon");
assertElementsEqual(
"Unexpected elements",
"jon [in B1 [in B1.java [in basepkg [in src [in CodeSelection]]]]]",
- elements);
+ elements);
}
public void testInferredCallout1() throws JavaModelException
@@ -413,9 +413,9 @@ public class CodeSelectionTests extends AbstractJavaModelTests
assertElementsEqual(
"Unexpected elements",
"bm1(int) [in B1 [in B1.java [in basepkg [in src [in CodeSelection]]]]]",
- elements);
+ elements);
}
-
+
public void testInferredCallout2() throws JavaModelException
{
ICompilationUnit cu = getCompilationUnit("CodeSelection", "src", "mappings", "InferredCallouts.java");
@@ -423,9 +423,9 @@ public class CodeSelectionTests extends AbstractJavaModelTests
assertElementsEqual(
"Unexpected elements",
"jon [in B1 [in B1.java [in basepkg [in src [in CodeSelection]]]]]",
- elements);
+ elements);
}
-
+
public void testInferredCallout3() throws JavaModelException
{
ICompilationUnit cu = getCompilationUnit("CodeSelection", "src", "mappings", "InferredCallouts.java");
@@ -433,9 +433,9 @@ public class CodeSelectionTests extends AbstractJavaModelTests
assertElementsEqual(
"Unexpected elements",
"jon [in B1 [in B1.java [in basepkg [in src [in CodeSelection]]]]]",
- elements);
+ elements);
}
-
+
public void testInferredCallout4() throws JavaModelException
{
ICompilationUnit cu = getCompilationUnit("CodeSelection", "src", "mappings", "InferredCallouts.java");
@@ -443,9 +443,9 @@ public class CodeSelectionTests extends AbstractJavaModelTests
assertElementsEqual(
"Unexpected elements",
"jon [in B1 [in B1.java [in basepkg [in src [in CodeSelection]]]]]",
- elements);
+ elements);
}
-
+
public void testInferredCallout5() throws JavaModelException
{
ICompilationUnit cu = getCompilationUnit("CodeSelection", "src", "mappings", "InferredCallouts.java");
@@ -453,10 +453,10 @@ public class CodeSelectionTests extends AbstractJavaModelTests
assertElementsEqual(
"Unexpected elements",
"jon [in B1 [in B1.java [in basepkg [in src [in CodeSelection]]]]]",
- elements);
+ elements);
}
- public void testRoleCreation1() throws JavaModelException
+ public void testRoleCreation1() throws JavaModelException
{
ICompilationUnit cu = getCompilationUnit("CodeSelection", "src", "statements", "RoleCreation.java");
IJavaElement[] elements = codeSelect(cu, "R<@t>(\"1\");", "R");
@@ -466,7 +466,7 @@ public class CodeSelectionTests extends AbstractJavaModelTests
elements);
}
- public void testRoleCreation2() throws JavaModelException
+ public void testRoleCreation2() throws JavaModelException
{
ICompilationUnit cu = getCompilationUnit("CodeSelection", "src", "statements", "RoleCreation.java");
IJavaElement[] elements = codeSelect(cu, "R(\"2\");", "R");
@@ -475,9 +475,9 @@ public class CodeSelectionTests extends AbstractJavaModelTests
"R(String) [in R [in RoleCreation [in RoleCreation.java [in statements [in src [in CodeSelection]]]]]]",
elements);
}
-
+
// awaiting progress in Trac #192
- public void _testRoleCreation3() throws JavaModelException
+ public void _testRoleCreation3() throws JavaModelException
{
ProblemRequestor problemRequestor = new ProblemRequestor();
WorkingCopyOwner owner = newWorkingCopyOwner(problemRequestor);
@@ -485,23 +485,23 @@ public class CodeSelectionTests extends AbstractJavaModelTests
ICompilationUnit cu = getCompilationUnit("CodeSelection", "src", "statements", "RoleCreation.java");
cu.getWorkingCopy(owner, null);
IJavaElement[] elements = codeSelect(cu, "RProtected<@t>(\"3\");", "RProtected");
- assertProblems("Unexpected problems",
- "----------\n" +
- "1. ERROR in /CodeSelection/src/statements/RoleCreation.java\n" +
- "Illegal parameterized use of non-public role RProtected (OTJLD 1.2.3(b)).\n" +
- "----------\n" +
- "2. ERROR in /CodeSelection/src/statements/RoleCreation.java\n" +
- "Illegal parameterized use of non-public role RProtected (OTJLD 1.2.3(b)).\n" +
- "----------\n",
+ assertProblems("Unexpected problems",
+ "----------\n" +
+ "1. ERROR in /CodeSelection/src/statements/RoleCreation.java\n" +
+ "Illegal parameterized use of non-public role RProtected (OTJLD 1.2.3(b)).\n" +
+ "----------\n" +
+ "2. ERROR in /CodeSelection/src/statements/RoleCreation.java\n" +
+ "Illegal parameterized use of non-public role RProtected (OTJLD 1.2.3(b)).\n" +
+ "----------\n",
problemRequestor);
-
+
assertElementsEqual(
"Unexpected elements",
"RProtected(String) [in RProtected [in RoleCreation [in RoleCreation.java [in statements [in src [in CodeSelection]]]]]]",
elements);
}
- public void testRoleCreation4() throws JavaModelException
+ public void testRoleCreation4() throws JavaModelException
{
ICompilationUnit cu = getCompilationUnit("CodeSelection", "src", "statements", "RoleCreation.java");
IJavaElement[] elements = codeSelect(cu, "RProtected(\"4\");", "RProtected");
@@ -510,7 +510,7 @@ public class CodeSelectionTests extends AbstractJavaModelTests
"RProtected(String) [in RProtected [in RoleCreation [in RoleCreation.java [in statements [in src [in CodeSelection]]]]]]",
elements);
}
-
+
public void testTSuperCall1() throws JavaModelException {
ICompilationUnit cu = getCompilationUnit("CodeSelection", "src", "statements", "TSuper.java");
IJavaElement[] elements = codeSelect(cu, "m(1);", "m");
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/AbstractJavaModelTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/AbstractJavaModelTests.java
index 79ec8e0bd..153ae5d2d 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/AbstractJavaModelTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/AbstractJavaModelTests.java
@@ -125,11 +125,11 @@ public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
*/
//{ObjectTeams: removed private SH}
IJavaElementDelta[] deltas;
-
+
private int eventType;
private ByteArrayOutputStream stackTraces;
-
+
private boolean gotResourceDelta;
public DeltaListener() {
@@ -147,7 +147,7 @@ public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
System.arraycopy(this.deltas, 0, copy, 0, this.deltas.length);
copy[this.deltas.length]= event.getDelta();
this.deltas= copy;
-
+
new Throwable("Caller of IElementChangedListener#elementChanged").printStackTrace(new PrintStream(this.stackTraces));
}
}
@@ -164,14 +164,14 @@ public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
return delta.getCompilationUnitAST();
return null;
}
-
+
/**
* Returns the last delta for the given element from the cached delta.
*/
public IJavaElementDelta getDeltaFor(IJavaElement element) {
return getDeltaFor(element, false);
}
-
+
/**
* Returns the delta for the given element from the cached delta.
* If the boolean is true returns the first delta found.
@@ -190,7 +190,7 @@ public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
}
return result;
}
-
+
public synchronized IJavaElementDelta getLastDelta() {
return this.deltas[this.deltas.length - 1];
}
@@ -298,7 +298,7 @@ public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
//{ObjectTeams: avoid problems with performance meter (testcase names are not unique when used with a TestSetting)
private boolean _usePerformanceMeter = true;
//carp}
-
+
protected ILogListener logListener;
protected ILog log;
@@ -1207,7 +1207,7 @@ public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
protected void createJar(String[] javaPathsAndContents, String jarPath) throws IOException {
org.eclipse.jdt.core.tests.util.Util.createJar(javaPathsAndContents, jarPath, "1.4");
}
-
+
protected void createJar(String[] javaPathsAndContents, String jarPath, Map options) throws IOException {
org.eclipse.jdt.core.tests.util.Util.createJar(javaPathsAndContents, null, jarPath, null, "1.4", options);
}
@@ -1468,22 +1468,22 @@ public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
final String compliance,
final boolean simulateImport) throws CoreException {
return createJavaProject(
- projectName,
- sourceFolders,
- libraries,
- librariesInclusionPatterns,
- librariesExclusionPatterns,
- projects,
- projectsInclusionPatterns,
- projectsExclusionPatterns,
- combineAccessRestrictions,
- exportedProjects,
- projectOutput,
- sourceOutputs,
- inclusionPatterns,
- exclusionPatterns,
- compliance,
- false,
+ projectName,
+ sourceFolders,
+ libraries,
+ librariesInclusionPatterns,
+ librariesExclusionPatterns,
+ projects,
+ projectsInclusionPatterns,
+ projectsExclusionPatterns,
+ combineAccessRestrictions,
+ exportedProjects,
+ projectOutput,
+ sourceOutputs,
+ inclusionPatterns,
+ exclusionPatterns,
+ compliance,
+ false,
simulateImport);
}
protected IJavaProject createJavaProject(
@@ -2186,7 +2186,7 @@ public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
*/
protected String getPluginDirectoryPath() {
try {
-//{ObjectTeams: adjust plugin id from org.eclipse.jdt.core.tests.model to org.eclipse.objectteams.otdt.tests
+//{ObjectTeams: adjust plugin id from org.eclipse.jdt.core.tests.model to org.eclipse.objectteams.otdt.tests
URL platformURL = Platform.getBundle("org.eclipse.objectteams.otdt.tests").getEntry("/");
//carp}
return new File(FileLocator.toFileURL(platformURL).getFile()).getAbsolutePath();
@@ -2472,9 +2472,9 @@ public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
if (patternString.indexOf('*') != -1 || patternString.indexOf('?') != -1)
matchRule |= SearchPattern.R_PATTERN_MATCH;
SearchPattern pattern = SearchPattern.createPattern(
- patternString,
+ patternString,
searchFor,
- limitTo,
+ limitTo,
matchRule);
// that's why we maintain this copy:
MatchLocator.setFocus(pattern, focus);
@@ -2731,7 +2731,7 @@ public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
}
}
//{ObjectTeams: copy jcl at least once per test run:
- private static boolean forceCopyJCL= true;
+ private static boolean forceCopyJCL= true;
// SH}
/**
* Check locally for the required JCL files, <jclName>.jar and <jclName>src.zip.
@@ -2923,7 +2923,7 @@ public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
new String[] {"JCL18_FULL", "JCL18_SRC", "JCL_SRCROOT"},
new IPath[] {new Path(getExternalJCLPathString("1.8", true)), getExternalJCLSourcePath("1.8"), getExternalJCLRootSourcePath()},
null);
- }
+ }
} else if (JavaCore.getClasspathVariable("JCL18_LIB") == null) {
setupExternalJCL("jclMin1.8");
JavaCore.setClasspathVariables(
@@ -2968,7 +2968,7 @@ public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
}
}
protected void setUp () throws Exception {
-//{ObjectTeams:
+//{ObjectTeams:
if (_usePerformanceMeter)
//}
super.setUp();
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/AllTests.java
index d37f2ab29..515e42117 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/AllTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2018 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -35,37 +35,37 @@ public class AllTests
//Parser
suite.addTest(org.eclipse.objectteams.otdt.tests.parser.AllTests.suite());
-
- //compiler
+
+ //compiler
suite.addTest(org.eclipse.objectteams.otdt.tests.compiler.errorreporting.TestAll.suite());
suite.addTest(org.eclipse.objectteams.otdt.tests.compiler.ast.TypeDeclarationTest.suite());
suite.addTest(org.eclipse.objectteams.otdt.tests.compiler.smap.AllTests.suite());
suite.addTest(org.eclipse.objectteams.otdt.tests.compiler.AttributesTest.suite());
-
+
//hierarchy
suite.addTest(org.eclipse.objectteams.otdt.tests.hierarchy.AllTests.suite());
-
+
//model
suite.addTest(org.eclipse.objectteams.otdt.tests.otmodel.AllTests.suite());
-
+
//search
suite.addTest(org.eclipse.objectteams.otdt.tests.search.AllTests.suite());
-
+
//completion
suite.addTest(org.eclipse.objectteams.otdt.tests.model.AllTests.suite());
-
+
//formatter
suite.addTest(org.eclipse.objectteams.otdt.core.tests.formatter.FormatterTests.suite());
-
+
//selection
suite.addTest(org.eclipse.objectteams.otdt.tests.selection.AllTests.suite());
//builder
// tests moved to separate plug-in, needs OT/Equinox to enable compiler.adaptor.
-
+
// the OTJLD suite:
suite.addTest(org.eclipse.objectteams.otdt.tests.otjld.AllTests.suite());
-
+
//$JUnit-END$
return suite;
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/ClasspathUtil.java b/testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/ClasspathUtil.java
index 2554b8d83..f1d9366b7 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/ClasspathUtil.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/ClasspathUtil.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010, 2014 GK Software AG
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/FileBasedTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/FileBasedTest.java
index 2ddf9b255..a866f76a2 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/FileBasedTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/FileBasedTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -55,14 +55,14 @@ public abstract class FileBasedTest extends AbstractJavaModelTests
private static final String LINE_SEPARATOR = System
.getProperty("line.separator");
private static final String WORKSPACE_DIR = "workspace";
-
+
private String _projectDir;
protected IJavaProject javaProject;
public FileBasedTest(String name)
{
super(name);
-
+
if (getTestSetting() != null)
setUsePerformanceMeter(false);
}
@@ -71,7 +71,7 @@ public abstract class FileBasedTest extends AbstractJavaModelTests
{
return TestDataHandler.getTestSetting(getClass());
}
-
+
public String getSourceWorkspacePath()
{
return getPluginDirectoryPath()
@@ -82,7 +82,7 @@ public abstract class FileBasedTest extends AbstractJavaModelTests
public void setUpSuite() throws Exception
{
super.setUpSuite();
-
+
// ensure autobuilding is turned off
IWorkspaceDescription description = getWorkspace().getDescription();
if (description.isAutoBuilding())
@@ -91,7 +91,7 @@ public abstract class FileBasedTest extends AbstractJavaModelTests
getWorkspace().setDescription(description);
}
if (_projectDir != null)
- this.javaProject = setUpJavaProject(_projectDir);
+ this.javaProject = setUpJavaProject(_projectDir);
}
public void tearDownSuite() throws Exception
@@ -119,7 +119,7 @@ public abstract class FileBasedTest extends AbstractJavaModelTests
}
return null;
}
-
+
protected abstract String getPluginID();
protected String getResource(String packageName, String resourceName)
@@ -148,17 +148,17 @@ public abstract class FileBasedTest extends AbstractJavaModelTests
}
return result;
}
-
+
protected void setTestProjectDir(String dirName)
{
_projectDir = dirName;
}
-
+
protected String getTestProjectDir()
{
return _projectDir;
}
-
+
public boolean isRole(IType type)
{
IOTType otType =
@@ -167,56 +167,56 @@ public abstract class FileBasedTest extends AbstractJavaModelTests
&& (otType.exists())
&& (otType instanceof IRoleType);
}
-
+
public IRoleType getRole(String project, String srcFolder, String pkg, String aTeam, String role)
throws JavaModelException
{
- ICompilationUnit teamUnit =
- getCompilationUnit(project, srcFolder, pkg, aTeam + ".java");
+ ICompilationUnit teamUnit =
+ getCompilationUnit(project, srcFolder, pkg, aTeam + ".java");
assertNotNull(teamUnit);
assertTrue(teamUnit.exists());
-
+
IType teamType = teamUnit.getType(aTeam);
assertNotNull(teamType);
assertTrue(teamType.exists());
-
+
IType javaModelRole = teamType.getType(role);
assertNotNull(javaModelRole);
assertTrue(javaModelRole.exists());
-
- IOTJavaElement roleType =
+
+ IOTJavaElement roleType =
OTModelManager.getOTElement(javaModelRole);
return (IRoleType)roleType;
-
+
}
-
+
public IType getRole(IType aTeam, String role)
{
return TypeHelper.findNestedRoleType(aTeam, role);
}
-
+
public IType getMemberType(String project, String srcFolder, String pkg, String enclosingTypeName, String member)
throws JavaModelException
{
- ICompilationUnit declaringUnit =
- getCompilationUnit(project, srcFolder, pkg, enclosingTypeName + ".java");
+ ICompilationUnit declaringUnit =
+ getCompilationUnit(project, srcFolder, pkg, enclosingTypeName + ".java");
assertTrue(declaringUnit.exists());
-
+
IType enclosingType = declaringUnit.getType(enclosingTypeName);
assertTrue(enclosingType.exists());
-
+
IType memberType = enclosingType.getType(member);
assertTrue(memberType.exists());
-
+
return memberType;
}
-
+
public IType getType(String projectName, String srcFolder, String pkg, String typeName)
throws JavaModelException
{
- ICompilationUnit declaringUnit =
- getCompilationUnit(projectName, srcFolder, pkg, typeName + ".java");
-
+ ICompilationUnit declaringUnit =
+ getCompilationUnit(projectName, srcFolder, pkg, typeName + ".java");
+
IType type = declaringUnit != null ? declaringUnit.getType(typeName) : null;
if(type == null)
{
@@ -224,30 +224,30 @@ public abstract class FileBasedTest extends AbstractJavaModelTests
}
assertNotNull(type);
assertTrue(type.exists());
-
+
return type;
}
-
+
public IType getRoleJavaElem(
- String project,
- String srcFolder,
- String pkg,
- String aTeam,
+ String project,
+ String srcFolder,
+ String pkg,
+ String aTeam,
String role)
throws JavaModelException
{
return getMemberType(
- project,
+ project,
srcFolder,
pkg,
aTeam,
role);
}
-
+
public boolean containsAllRequiredTypes(IType[] actual, List expected)
{
- if(actual == null
+ if(actual == null
|| expected == null
|| actual.length != expected.size())
{
@@ -272,8 +272,8 @@ public abstract class FileBasedTest extends AbstractJavaModelTests
}
return result;
}
-
-
+
+
/**
* Fully qualified name-based comparison of typelists, without respect to the order
* @param expected types that have been expected
@@ -281,7 +281,7 @@ public abstract class FileBasedTest extends AbstractJavaModelTests
*/
public boolean compareTypes(IType[] expected, IType[] actual)
{
- if(actual == null
+ if(actual == null
|| expected == null
|| actual.length != expected.length)
{
@@ -289,7 +289,7 @@ public abstract class FileBasedTest extends AbstractJavaModelTests
" but got "+(actual == null ? "null" : actual.length));
return false;
}
-
+
boolean result = true;
for (int expIdx = 0; expIdx < expected.length; expIdx++)
{
@@ -310,7 +310,7 @@ public abstract class FileBasedTest extends AbstractJavaModelTests
}
return result;
}
-
+
/**
* Name-based comparison of methodlists, without respect to the order
* @param expected methods that have been expected
@@ -318,13 +318,13 @@ public abstract class FileBasedTest extends AbstractJavaModelTests
*/
public boolean compareMethods(IMethod[] expected, IMethod[] actual)
{
- if(actual == null
+ if(actual == null
|| expected == null
|| actual.length != expected.length)
{
return false;
}
-
+
boolean result = true;
for (int expIdx = 0; expIdx < expected.length; expIdx++)
{
@@ -343,7 +343,7 @@ public abstract class FileBasedTest extends AbstractJavaModelTests
}
return result;
}
-
+
/**
* Fully qualified name-based comparison of two types
*/
@@ -353,10 +353,10 @@ public abstract class FileBasedTest extends AbstractJavaModelTests
{
return false;
}
-
+
String name1 = type1.getFullyQualifiedName();
String name2 = type2.getFullyQualifiedName();
-
+
return name1.equals(name2);
}
@@ -367,12 +367,12 @@ public abstract class FileBasedTest extends AbstractJavaModelTests
assertTrue(jlo.exists());
return jlo;
}
-
+
// Println output disabled
// /**
// * enriches the super-method with print-statements
// */
-// public void runBare() throws Throwable
+// public void runBare() throws Throwable
// {
// System.out.println("\nsetUp");
// setUp();
@@ -383,5 +383,5 @@ public abstract class FileBasedTest extends AbstractJavaModelTests
// finally {
// tearDown();
// }
-// }
+// }
} \ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/ModifyingResourceTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/ModifyingResourceTests.java
index 864b5c7c7..27faa98b3 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/ModifyingResourceTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/ModifyingResourceTests.java
@@ -6,7 +6,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 @@ import org.eclipse.objectteams.otdt.tests.AbstractJavaModelTests;
*/
//{OT_COPY_PASTE: class copied from org.eclipse.jdt.core.tests.model
public class ModifyingResourceTests extends AbstractJavaModelTests {
-
+
public ModifyingResourceTests(String name) {
super(name);
}
@@ -109,7 +109,7 @@ public static void generateClassFile(String className, String javaSource) throws
if (read != -1) System.out.print("\t");
for (int i = 0; i < read; i++) {
System.out.print(buffer[i]);
- System.out.print(", ");
+ System.out.print(", ");
}
if (read != -1) System.out.println();
}
@@ -145,7 +145,7 @@ protected IFolder createFolder(String path) throws CoreException {
IContainer parent = folder.getParent();
if (parent instanceof IFolder && !parent.exists()) {
createFolder(parent.getFullPath().toString());
- }
+ }
folder.create(true, true, null);
}
},
@@ -165,7 +165,7 @@ protected IFile editFile(String path, String content) throws CoreException {
file.setContents(input, IResource.FORCE, null);
return file;
}
-/*
+/*
* Expands (i.e. open) the given element and returns a toString() representation
* of the tree.
*/
@@ -234,18 +234,18 @@ protected String getSortedByProjectDeltas() {
for (int i=0, length = this.deltaListener.deltas.length; i<length; i++) {
IJavaElementDelta[] projects = this.deltaListener.deltas[i].getAffectedChildren();
int projectsLength = projects.length;
-
+
// sort by project
IJavaElementDelta[] sorted = new IJavaElementDelta[projectsLength];
System.arraycopy(projects, 0, sorted, 0, projectsLength);
org.eclipse.jdt.internal.core.util.Util.sort(
- sorted,
+ sorted,
new org.eclipse.jdt.internal.core.util.Util.Comparer() {
public int compare(Object a, Object b) {
return a.toString().compareTo(b.toString());
}
});
-
+
for (int j=0; j<projectsLength; j++) {
buffer.append(sorted[j]);
if (j != projectsLength-1) {
@@ -314,7 +314,7 @@ protected IClasspathEntry[] createClasspath(String[] sourceFoldersAndPatterns, b
exclusionPatternPaths[j] = new Path(tokenizer.nextToken());
}
}
- classpath[i/increment] = JavaCore.newSourceEntry(new Path(src), inclusionPatternPaths, exclusionPatternPaths, null);
+ classpath[i/increment] = JavaCore.newSourceEntry(new Path(src), inclusionPatternPaths, exclusionPatternPaths, null);
}
return classpath;
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/StringBasedTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/StringBasedTest.java
index abb896edd..7d7d33fbd 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/StringBasedTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/StringBasedTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -31,10 +31,10 @@ import org.eclipse.objectteams.otdt.core.OTModelManager;
/**
* @author jwloka
- * @version $Id: StringBasedTest.java 23494 2010-02-05 23:06:44Z stephan $
+ * @version $Id: StringBasedTest.java 23494 2010-02-05 23:06:44Z stephan $
*
- * NOTE: Preliminary version of a test suite for testing the OTModel. The creation
- * of test classes will be changed soon!
+ * NOTE: Preliminary version of a test suite for testing the OTModel. The creation
+ * of test classes will be changed soon!
*/
public class StringBasedTest extends ModifyingResourceTests
{
@@ -85,6 +85,6 @@ public class StringBasedTest extends ModifyingResourceTests
protected IOTType getOTElem(String name) throws JavaModelException
{
IType javaElem = getTestProject().findType(name);
- return OTModelManager.getOTElement(javaElem);
+ return OTModelManager.getOTElement(javaElem);
}
} \ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/SuiteOfTestCases.java b/testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/SuiteOfTestCases.java
index 57e69c264..cc8312996 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/SuiteOfTestCases.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/src/org/eclipse/objectteams/otdt/tests/SuiteOfTestCases.java
@@ -6,7 +6,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -26,14 +26,14 @@ import junit.framework.TestSuite;
*/
//{OT_COPY_PASTE: class copied from org.eclipse.jdt.core.tests.model
public class SuiteOfTestCases extends org.eclipse.jdt.core.tests.junit.extension.TestCase {
-
+
/*
* A test suite that initialize the test case's fields once, then that copies the values
* of these fields intto each subsequent test case.
*/
public static class Suite extends TestSuite {
public SuiteOfTestCases currentTestCase;
-
+
/*
* Creates a new suite on the given class. This class must be a subclass of SetupableTestSuite.
*/
@@ -49,14 +49,14 @@ public class SuiteOfTestCases extends org.eclipse.jdt.core.tests.junit.extension
Field[] fields = currentClass.getDeclaredFields();
for (int i = 0, length = fields.length; i < length; i++) {
Field field = fields[i];
-
+
// skip static and final fields
int modifiers = field.getModifiers();
if (Modifier.isStatic(modifiers) || Modifier.isFinal(modifiers)) continue;
-
+
// make the field accessible
field.setAccessible(true);
-
+
try {
Object value = field.get(this.currentTestCase);
field.set(test, value);
@@ -72,7 +72,7 @@ public class SuiteOfTestCases extends org.eclipse.jdt.core.tests.junit.extension
try {
// run suite (first test run will setup the suite)
superRun(result);
- } finally {
+ } finally {
// tear down the suite
if (Suite.this.currentTestCase != null) { // protect against empty test suite
Suite.this.currentTestCase.tearDownSuite();
@@ -100,23 +100,23 @@ public class SuiteOfTestCases extends org.eclipse.jdt.core.tests.junit.extension
}
try {
super.runTest(test, result);
- } finally {
+ } finally {
// make current
this.currentTestCase = current;
}
}
}
-
+
public SuiteOfTestCases(String name) {
super(name);
}
-
+
/**
* Setup the test suite once before all test cases run.
*/
public void setUpSuite() throws Exception {
}
-
+
/**
* Tear down the test suite once after all test cases have run.
*/
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/AllTests.java
index 619e617de..5ed8ccc5c 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/AllTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -37,13 +37,13 @@ public class AllTests {
//$JUnit-BEGIN$
// DOM bindings tests
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.dom.bindings.AllTests.suite());
-
+
// DOM converter tests
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.dom.converter.AllTests.suite());
-
+
// DOM rewrite tests
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.dom.rewrite.AllTests.suite());
-
+
//$JUnit-END$
return suite;
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/DOMTestPlugin.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/DOMTestPlugin.java
index 6c65e0493..98878179d 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/DOMTestPlugin.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/DOMTestPlugin.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -35,7 +35,7 @@ public class DOMTestPlugin extends Plugin {
private static DOMTestPlugin plugin;
//Resource bundle.
private ResourceBundle resourceBundle;
-
+
/**
* The constructor.
*/
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/FileBasedDOMTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/FileBasedDOMTest.java
index 27f9d9b1c..e7bb6d53d 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/FileBasedDOMTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/FileBasedDOMTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/TypeDeclarationFinder.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/TypeDeclarationFinder.java
index 84d3bf5ec..eecef55e3 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/TypeDeclarationFinder.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/TypeDeclarationFinder.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -35,52 +35,52 @@ public class TypeDeclarationFinder extends ASTVisitor
private TypeDeclaration _typeDecl;
private String[] _path;
private int _pathIdx;
-
+
public TypeDeclarationFinder()
{
_typeDecl = null;
_path = null;
_pathIdx = 0;
}
-
+
private boolean checkTypeDeclaration(TypeDeclaration node)
{
if ( (_path == null) || (_pathIdx >= _path.length))
{
return false;
}
-
+
if (!node.getName().getIdentifier().equals(_path[_pathIdx]))
{
return false; // wrong path
}
-
+
_pathIdx++;
if (_pathIdx == _path.length)
{
_typeDecl = node;
return false;
}
-
+
return true;
}
-
-
- public boolean visit(RoleTypeDeclaration node)
+
+
+ public boolean visit(RoleTypeDeclaration node)
{
return checkTypeDeclaration(node);
}
-
+
public boolean visit(TypeDeclaration node)
{
return checkTypeDeclaration(node);
}
-
+
public TypeDeclaration getTypeDeclaration()
{
return _typeDecl;
}
-
+
public void setName(String name)
{
if (name != null)
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/bindings/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/bindings/AllTests.java
index 2426f0873..bb20f6117 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/bindings/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/bindings/AllTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/bindings/MethodMappingBindingTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/bindings/MethodMappingBindingTest.java
index 12fb7fca6..1e5aadd5b 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/bindings/MethodMappingBindingTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/bindings/MethodMappingBindingTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -63,24 +63,24 @@ public class MethodMappingBindingTest extends FileBasedDOMTest
private CalloutMappingDeclaration[] _callouts;
private MethodDeclaration[] _methods;
private IMethodMappingBinding _testObj;
-
+
public MethodMappingBindingTest(String name)
{
super(name);
}
-
+
public static Test suite()
{
return new Suite(MethodMappingBindingTest.class);
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir(TEST_PROJECT);
super.setUpSuite();
}
- protected void setUp() throws Exception
+ protected void setUp() throws Exception
{
super.setUp();
_team = getCompilationUnit(
@@ -88,12 +88,12 @@ public class MethodMappingBindingTest extends FileBasedDOMTest
"src",
"bindings.teampkg",
"T1.java");
-
+
_parser = ASTParser.newParser(JAVA_LANGUAGE_SPEC_LEVEL);
_parser.setProject( getJavaProject(TEST_PROJECT) );
_parser.setSource(_team);
_parser.setResolveBindings(true);
-
+
ASTNode root = _parser.createAST( new NullProgressMonitor() );
CompilationUnit compUnit = (CompilationUnit)root;
_teamDecl = (TypeDeclaration)compUnit.types().get(0);
@@ -113,43 +113,43 @@ public class MethodMappingBindingTest extends FileBasedDOMTest
public void testGetName_NoSignature()
{
_testObj = _callouts[0].resolveBinding();
-
+
String actual = _testObj.getName();
String expected = "void m1() -> void m1() ;";
-
+
assertEquals(expected, actual);
}
public void testGetName_WithSignature()
{
_testObj = _callouts[1].resolveBinding();
-
+
String actual = _testObj.getName();
- String expected = "java.lang.String m2(java.lang.Integer) -> java.lang.String m2(java.lang.Integer) ;";
-
+ String expected = "java.lang.String m2(java.lang.Integer) -> java.lang.String m2(java.lang.Integer) ;";
+
assertEquals(expected, actual);
}
-
+
public void testGetDeclaringClass()
{
_testObj = _callouts[0].resolveBinding();
-
+
ITypeBinding actual = _testObj.getDeclaringRoleClass();
ITypeBinding expected = _roleDecl.resolveBinding();
-
+
assertEquals(expected, actual);
}
public void testGetRoleMethod()
{
_testObj = _callins[0].resolveBinding();
-
+
MethodDeclaration roleMethod =
(MethodDeclaration)_methods[1];
-
+
IMethodBinding actual = _testObj.getRoleMethod();
IMethodBinding expected = roleMethod.resolveBinding();
-
+
assertEquals(expected, actual);
}
@@ -160,36 +160,36 @@ public class MethodMappingBindingTest extends FileBasedDOMTest
// check we have the same method:
MethodDeclaration roleMethod = (MethodDeclaration)_methods[1];
assertEquals(roleMethod.resolveBinding(), ((MethodSpec)roleMappingElement).resolveBinding());
-
+
// check the return types:
ITypeBinding actual = roleMappingElement.getName().resolveTypeBinding();
ITypeBinding expected = roleMethod.resolveBinding().getReturnType();
-
+
assertEquals(expected, actual);
}
-
+
public void testGetReferencedBaseClass()
{
_testObj = _callins[0].resolveBinding();
ITypeBinding actual = _testObj.getReferencedBaseClass();
ITypeBinding expected = _roleDecl.resolveBinding().getBaseClass();
-
+
assertNotNull(actual);
assertEquals(expected, actual);
}
-
+
public void testGetModifiers_After()
{
_testObj = _callins[0].resolveBinding();
int modifier = _testObj.getModifiers();
-
+
boolean isCallinReplace = Modifier.isAfter(modifier)
&& _testObj.isCallin();
-
+
assertTrue(isCallinReplace);
}
-
+
/** Resolve a qualified callin name in a precedence declaration. */
public void testPrecedence1() {
PrecedenceDeclaration prec = (PrecedenceDeclaration) _teamDecl.precedences().get(0);
@@ -199,7 +199,7 @@ public class MethodMappingBindingTest extends FileBasedDOMTest
assertTrue("Is mapping binding", binding instanceof IMethodMappingBinding);
assertEquals("Has expected representation", "ci1: java.lang.Integer m5(java.lang.Integer) <- after java.lang.Integer m5(java.lang.Integer) ;", binding.toString());
}
-
+
/** Try to resolve an unqualified callin name in a precedence declaration -> fails to resolve but shouldn't CCE. */
public void testPrecedence2() {
PrecedenceDeclaration prec = (PrecedenceDeclaration) _teamDecl.precedences().get(0);
@@ -209,7 +209,7 @@ public class MethodMappingBindingTest extends FileBasedDOMTest
assertTrue("Is mapping binding", binding instanceof IMethodMappingBinding);
assertEquals("Has expected representation", "missingCallin:ci2: NULL ROLE METHODS<- <unknown> ;", binding.toString());
}
-
+
/** Resolve an unqualified callin name in a precedence declaration */
public void testPrecedence3() {
RoleTypeDeclaration role2Decl = (RoleTypeDeclaration)_teamDecl.getRoles()[1];
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/bindings/TypeBindingTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/bindings/TypeBindingTest.java
index 5c840b1db..7801c571b 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/bindings/TypeBindingTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/bindings/TypeBindingTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -50,7 +50,7 @@ public class TypeBindingTest extends FileBasedDOMTest
{
public static final String TEST_PROJECT = "DOM_AST";
private static final int JAVA_LANGUAGE_SPEC_LEVEL = AST.JLS4;
-
+
private ASTParser _parser;
private ICompilationUnit _cuTA;
private ICompilationUnit _cuTB;
@@ -59,28 +59,28 @@ public class TypeBindingTest extends FileBasedDOMTest
private RoleTypeDeclaration _roleTAT2R1;
private RoleTypeDeclaration _roleTBT1R1;
private RoleTypeDeclaration _roleTBT2R1;
-
+
private TypeDeclaration _teamMyTeam;
private RoleTypeDeclaration _focus;
-
- public TypeBindingTest(String name)
+
+ public TypeBindingTest(String name)
{
super(name);
}
-
+
public static Test suite()
{
return new Suite(TypeBindingTest.class);
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir(TEST_PROJECT);
super.setUpSuite();
}
-
- protected void setUp() throws Exception
+
+ protected void setUp() throws Exception
{
super.setUp();
_cuTA = getCompilationUnit(
@@ -98,12 +98,12 @@ public class TypeBindingTest extends FileBasedDOMTest
"src",
"roleTypeDeclaration.teampkg",
"MyTeam.java");
-
+
_parser = ASTParser.newParser(JAVA_LANGUAGE_SPEC_LEVEL);
_parser.setProject(super.getJavaProject(TEST_PROJECT));
_parser.setResolveBindings(true);
_parser.setSource(_cuTA);
-
+
ASTNode root = _parser.createAST( new NullProgressMonitor() );
CompilationUnit compUnit = (CompilationUnit) root;
TypeDeclarationFinder finder = new TypeDeclarationFinder();
@@ -114,7 +114,7 @@ public class TypeBindingTest extends FileBasedDOMTest
_parser.setSource(_cuTB);
_parser.setResolveBindings(true);
-
+
root = _parser.createAST( new NullProgressMonitor() );
compUnit = (CompilationUnit) root;
@@ -124,11 +124,11 @@ public class TypeBindingTest extends FileBasedDOMTest
finder.setName("TB.T2.R1");
compUnit.accept(finder);
- _roleTBT2R1 = (RoleTypeDeclaration)finder.getTypeDeclaration();
+ _roleTBT2R1 = (RoleTypeDeclaration)finder.getTypeDeclaration();
_parser.setSource(_cuMyT);
_parser.setResolveBindings(true);
-
+
root = _parser.createAST( new NullProgressMonitor() );
compUnit = (CompilationUnit) root;
@@ -136,7 +136,7 @@ public class TypeBindingTest extends FileBasedDOMTest
compUnit.accept(finder);
_teamMyTeam = finder.getTypeDeclaration();
}
-
+
public void testInstanceTypes()
{
assertNotNull(_roleTAT2R1);
@@ -146,12 +146,12 @@ public class TypeBindingTest extends FileBasedDOMTest
assertTrue(_roleTBT1R1 instanceof RoleTypeDeclaration);
assertTrue(_roleTBT2R1 instanceof RoleTypeDeclaration);
}
-
+
public void testGetSuperRoles()
{
_focus = _roleTBT2R1;
ITypeBinding binding = (ITypeBinding)_focus.resolveBinding();
-
+
ITypeBinding[] expected = new ITypeBinding[]
{
_roleTBT1R1.resolveBinding(),
@@ -164,7 +164,7 @@ public class TypeBindingTest extends FileBasedDOMTest
assertEquals(expected[0].getOptimalName(), actual[0].getOptimalName());
assertEquals(expected[1].getOptimalName(), actual[1].getOptimalName());
}
-
+
public void testDeclaredLiftingType() {
MethodDeclaration method = (MethodDeclaration) _teamMyTeam.bodyDeclarations().get(3);
SingleVariableDeclaration arg1 = (SingleVariableDeclaration) method.parameters().get(0);
@@ -185,10 +185,10 @@ public class TypeBindingTest extends FileBasedDOMTest
parser.setSource(("public class C {\n" +
"public bug352605.Sub f;\n" +
"}\n").toCharArray());
-
+
ASTNode root = parser.createAST( new NullProgressMonitor() );
CompilationUnit compUnit = (CompilationUnit) root;
-
+
TypeDeclaration type = (TypeDeclaration) compUnit.types().get(0);
FieldDeclaration field = (FieldDeclaration) type.bodyDeclarations().get(0);
Type fieldType = field.getType();
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/AllTests.java
index e514580bb..31e27a031 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/AllTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -32,14 +32,14 @@ import org.eclipse.objectteams.otdt.tests.AbstractJavaModelTests;
/**
* Enter a class description here!
- *
+ *
* @author jwloka
* @version $Id: AllTests.java 23496 2010-02-05 23:20:15Z stephan $
*/
public class AllTests extends TestCase
{
- public AllTests(String name)
+ public AllTests(String name)
{
super(name);
}
@@ -52,7 +52,7 @@ public class AllTests extends TestCase
BaseCallMessageSendTest2.class,
BaseConstructorInvocationTest.class,
CallinMappingDeclarationTest.class,
- CalloutMappingDeclarationTest.class,
+ CalloutMappingDeclarationTest.class,
FieldAccessSpecTest.class,
GuardPredicateTest.class,
LiftingTypeTest.class,
@@ -64,7 +64,7 @@ public class AllTests extends TestCase
TSuperConstructorInvocationTest.class,
TSuperMessageSendTest.class,
WithinStatementTest.class,
-
+
DOMRegressionTests.class
};
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/AnchoredTypeTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/AnchoredTypeTest.java
index 0f3ff7804..281157a4d 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/AnchoredTypeTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/AnchoredTypeTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -51,33 +51,33 @@ public class AnchoredTypeTest extends FileBasedDOMTest
private ASTParser _parser;
private ICompilationUnit _simpleTeam;
-
+
private TypeDeclaration _typeDecl; // a java class common to all within tests
- private MethodDeclaration _methodDecl;
+ private MethodDeclaration _methodDecl;
private SingleVariableDeclaration _argumentDecl;
private VariableDeclarationStatement _localDecls;
private VariableDeclarationFragment _localDecl;
-
-
+
+
private Type _testObj;
-
+
public AnchoredTypeTest(String name)
{
super(name);
}
-
+
public static Test suite()
{
return new Suite(AnchoredTypeTest.class);
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir(TEST_PROJECT);
super.setUpSuite();
}
- protected void setUp() throws Exception
+ protected void setUp() throws Exception
{
super.setUp();
_simpleTeam = getCompilationUnit(
@@ -85,15 +85,15 @@ public class AnchoredTypeTest extends FileBasedDOMTest
"src",
"anchoredType.teampkg",
"Team1.java");
-
+
_parser = ASTParser.newParser(JAVA_LANGUAGE_SPEC_LEVEL);
_parser.setProject( getJavaProject(TEST_PROJECT) );
_parser.setSource(_simpleTeam);
-
+
ASTNode root = _parser.createAST( new NullProgressMonitor() );
CompilationUnit compUnit = (CompilationUnit) root;
_typeDecl = (TypeDeclaration)compUnit.types().get(0);
- _methodDecl = (MethodDeclaration)_typeDecl.bodyDeclarations().get(0);
+ _methodDecl = (MethodDeclaration)_typeDecl.bodyDeclarations().get(0);
_argumentDecl = (SingleVariableDeclaration)_methodDecl.parameters().get(1);
_localDecls = (VariableDeclarationStatement)_methodDecl.getBody().statements().get(0);
_localDecl = (VariableDeclarationFragment)_localDecls.fragments().get(0);
@@ -104,17 +104,17 @@ public class AnchoredTypeTest extends FileBasedDOMTest
{
_testObj = _argumentDecl.getType();
String sig = Util.getSignature(_testObj);
-
+
assertEquals("Argument type has wrong name ",
"QMyRole<@team1>;",
sig);
}
-
+
public void testAllocation()
{
ClassInstanceCreation creation = (ClassInstanceCreation) _localDecl.getInitializer();
String sig = Util.getSignature(creation.getType());
-
+
assertEquals("Argument type has wrong name ",
"QMyRole<@team1>;",
sig);
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/BaseCallMessageSendTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/BaseCallMessageSendTest.java
index e0976e523..5d03ea98c 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/BaseCallMessageSendTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/BaseCallMessageSendTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -56,7 +56,7 @@ import org.eclipse.objectteams.otdt.ui.tests.dom.FileBasedDOMTest;
*/
public class BaseCallMessageSendTest extends FileBasedDOMTest
{
-
+
public static final String TEST_PROJECT = "DOM_AST";
private static final int JAVA_LANGUAGE_SPEC_LEVEL = AST.JLS10;
@@ -69,12 +69,12 @@ public class BaseCallMessageSendTest extends FileBasedDOMTest
{
super(name);
}
-
+
public static Test suite()
{
return new Suite(BaseCallMessageSendTest.class);
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir(TEST_PROJECT);
@@ -88,19 +88,19 @@ public class BaseCallMessageSendTest extends FileBasedDOMTest
parser.setProject(getJavaProject(TEST_PROJECT));
parser.setSource(teamClass);
parser.setResolveBindings(true);
-
- ASTNode root = parser.createAST( new NullProgressMonitor() );
+
+ ASTNode root = parser.createAST( new NullProgressMonitor() );
CompilationUnit compUnit = (CompilationUnit) root;
_typeDecl = (TypeDeclaration)compUnit.types().get(0);
_role = _typeDecl.getTypes()[0];
}
- protected void setUp() throws Exception
+ protected void setUp() throws Exception
{
super.setUp();
}
-
+
public void testInstanceType1()
{
MethodDeclaration method = _role.getMethods()[0];
@@ -108,7 +108,7 @@ public class BaseCallMessageSendTest extends FileBasedDOMTest
(ExpressionStatement)method.getBody().statements().get(0);
Expression testObj = exprStatement.getExpression();
-
+
assertTrue("Base call not an instance of BaseCallMessageSend",
testObj instanceof BaseCallMessageSend);
}
@@ -122,27 +122,27 @@ public class BaseCallMessageSendTest extends FileBasedDOMTest
(VariableDeclarationFragment)varDecl.fragments().get(0);
Expression testObj = varDeclFrag.getInitializer();
-
+
assertTrue("Base call not an instance of BaseCallMessageSend",
testObj instanceof BaseCallMessageSend);
}
-
-
+
+
public void testGetNodeType1()
{
MethodDeclaration method = _role.getMethods()[0];
ExpressionStatement exprStatement =
(ExpressionStatement)method.getBody().statements().get(0);
_testObj = (BaseCallMessageSend)exprStatement.getExpression();
-
+
int actual = _testObj.getNodeType();
-
+
assertEquals("Base Call has wrong node type",
ASTNode.BASE_CALL_MESSAGE_SEND,
actual);
}
-
+
public void testGetName1()
{
MethodDeclaration method = _role.getMethods()[0];
@@ -151,21 +151,21 @@ public class BaseCallMessageSendTest extends FileBasedDOMTest
_testObj = (BaseCallMessageSend)exprStatement.getExpression();
String actual = _testObj.getName().getIdentifier();
-
+
assertEquals("Base call has wrong name ",
"roleMethod0",
actual);
}
-
+
public void testGetArguments_2Args()
{
MethodDeclaration method = _role.getMethods()[0];
ExpressionStatement exprStatement =
(ExpressionStatement)method.getBody().statements().get(0);
_testObj = (BaseCallMessageSend)exprStatement.getExpression();
-
+
List<?> actual = _testObj.getArguments();
-
+
assertEquals("Base call has wrong number of arguments",
2,
actual.size());
@@ -177,25 +177,25 @@ public class BaseCallMessageSendTest extends FileBasedDOMTest
ExpressionStatement exprStatement =
(ExpressionStatement)method.getBody().statements().get(0);
_testObj = (BaseCallMessageSend)exprStatement.getExpression();
-
+
List<?> actual = _testObj.getArguments();
-
+
assertEquals("Base call has wrong number of arguments",
0,
actual.size());
}
-
-
+
+
public void testChildNodesHaveCorrectParent1()
{
MethodDeclaration constructor = _role.getMethods()[1];
ExpressionStatement statement =
(ExpressionStatement)constructor.getBody().statements().get(0);
_testObj = (BaseCallMessageSend)statement.getExpression();
-
+
List<Expression> childNodes = _testObj.getArguments();
- for (Iterator<Expression> iter = childNodes.iterator(); iter.hasNext();)
+ for (Iterator<Expression> iter = childNodes.iterator(); iter.hasNext();)
{
Expression curChild = (Expression) iter.next();
assertEquals("Base call arguments have wrong parent node",
@@ -203,47 +203,47 @@ public class BaseCallMessageSendTest extends FileBasedDOMTest
curChild.getParent());
}
}
-
+
public void testChildNodesHaveCorrectParent2()
{
MethodDeclaration method = _role.getMethods()[0];
ExpressionStatement exprStatement =
(ExpressionStatement)method.getBody().statements().get(0);
_testObj = (BaseCallMessageSend)exprStatement.getExpression();
-
+
SimpleName childNode = _testObj.getName();
-
+
assertEquals("Base call selector has wrong parent",
_testObj,
childNode.getParent());
}
-
+
public void testSubtreeMatch1()
{
MethodDeclaration method = _role.getMethods()[0];
ExpressionStatement exprStatement =
(ExpressionStatement)method.getBody().statements().get(0);
_testObj = (BaseCallMessageSend)exprStatement.getExpression();
-
+
boolean actual = _testObj.subtreeMatch(new ASTMatcher(), _testObj);
assertTrue("Base call message sends don't match", actual);
}
-
+
public void testToString1()
{
MethodDeclaration method = _role.getMethods()[0];
ExpressionStatement exprStatement =
(ExpressionStatement)method.getBody().statements().get(0);
_testObj = (BaseCallMessageSend)exprStatement.getExpression();
-
+
String actual = _testObj.toString();
String expected = "base.roleMethod0(arg0, arg1)";
-
+
assertEquals("Base call message send: wrong naive flat string representation",
expected, actual);
}
-
+
public void testResolveMethodBinding()
{
MethodDeclaration method = _role.getMethods()[0];
@@ -251,11 +251,11 @@ public class BaseCallMessageSendTest extends FileBasedDOMTest
(ExpressionStatement)method.getBody().statements().get(0);
_testObj = (BaseCallMessageSend)exprStatement.getExpression();
-
+
// Note(SH): base call message send no longer resolves to the enclosing method
//IMethodBinding expected = method.resolveBinding();
IMethodBinding actual = _testObj.resolveMethodBinding();
-
+
assertNotNull(actual);
//Not correct: assertEquals(expected, actual);
//Not implemented: assertTrue(actual.isBaseCallSurrogate());
@@ -264,13 +264,13 @@ public class BaseCallMessageSendTest extends FileBasedDOMTest
// public void testResolveReferencedBaseMethodBinding()
// mkr: either remove test or implement resolve binding.
// Note(SH): base call does NOT resolve to a base method.
-
+
public void testNoOtherStatement() {
MethodDeclaration method = _role.getMethods()[0];
assertEquals("Body should have exactly one statement", 1, method.getBody().statements().size());
}
-
+
// check base call within a buggy role (missing base class)
public void testtoString1() throws JavaModelException
@@ -280,30 +280,30 @@ public class BaseCallMessageSendTest extends FileBasedDOMTest
"src",
"basecall.teampkg",
"Team2.java");
-
+
ASTParser parser = ASTParser.newParser(JAVA_LANGUAGE_SPEC_LEVEL);
parser.setResolveBindings(true);
parser.setProject( getJavaProject(TEST_PROJECT) );
parser.setSource(_teamClass);
-
+
ASTNode root = parser.createAST( new NullProgressMonitor() );
CompilationUnit compUnit = (CompilationUnit)root;
TypeDeclaration teamDecl = (TypeDeclaration)compUnit.types().get(0);
TypeDeclaration roleDecl = teamDecl.getTypes()[0];
-
+
MethodDeclaration callinMethod = roleDecl.getMethods()[0];
IfStatement statement = (IfStatement) callinMethod.getBody().statements().get(1);
Assignment assignment = (Assignment)((ExpressionStatement)statement.getThenStatement()).getExpression();
_testObj = (BaseCallMessageSend)assignment.getRightHandSide();
-
+
String actual = _testObj.toString();
String expected = "base.callinMethod(dummy)";
assertEquals("Base call has wrong naive flat string representation",
expected, actual);
}
-
+
// see http://bugs.eclipse.org/372433 - [refactoring][dom] extract method in a callin with tunneled base result throws NPE
public void testReturnWithHiddenExpression1() {
MethodDeclaration method = _role.getMethods()[1];
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/BaseCallMessageSendTest2.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/BaseCallMessageSendTest2.java
index 783dce8e3..a29d9d911 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/BaseCallMessageSendTest2.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/BaseCallMessageSendTest2.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -46,7 +46,7 @@ import org.eclipse.objectteams.otdt.ui.tests.dom.FileBasedDOMTest;
*/
public class BaseCallMessageSendTest2 extends FileBasedDOMTest
{
-
+
public static final String TEST_PROJECT = "DOM_AST";
private static final int JAVA_LANGUAGE_SPEC_LEVEL = AST.JLS4;
@@ -59,12 +59,12 @@ public class BaseCallMessageSendTest2 extends FileBasedDOMTest
{
super(name);
}
-
+
public static Test suite()
{
return new Suite(BaseCallMessageSendTest2.class);
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir(TEST_PROJECT);
@@ -77,14 +77,14 @@ public class BaseCallMessageSendTest2 extends FileBasedDOMTest
ASTParser parser = ASTParser.newParser(JAVA_LANGUAGE_SPEC_LEVEL);
parser.setProject(getJavaProject(TEST_PROJECT));
parser.setSource(teamClass);
-
- ASTNode root = parser.createAST( new NullProgressMonitor() );
+
+ ASTNode root = parser.createAST( new NullProgressMonitor() );
CompilationUnit compUnit = (CompilationUnit) root;
_typeDecl = (TypeDeclaration)compUnit.types().get(0);
_role = _typeDecl.getTypes()[0];
}
- protected void setUp() throws Exception
+ protected void setUp() throws Exception
{
super.setUp();
}
@@ -94,18 +94,18 @@ public class BaseCallMessageSendTest2 extends FileBasedDOMTest
MethodDeclaration method = _role.getMethods()[0];
TryStatement tryStatement = (TryStatement)method.getBody().statements().get(0);
Block block = tryStatement.getBody();
-
+
ExpressionStatement exprStatement = (ExpressionStatement)block.statements().get(0);
-
+
_testObj = (BaseCallMessageSend)exprStatement.getExpression();
String actual = _testObj.getName().getIdentifier();
-
+
assertEquals("Base call has wrong name ",
"roleMethod0",
actual);
}
-
+
public void testGetName2()
{
MethodDeclaration method = _role.getMethods()[1];
@@ -114,9 +114,9 @@ public class BaseCallMessageSendTest2 extends FileBasedDOMTest
_testObj = (BaseCallMessageSend)exprStatement.getExpression();
String actual = _testObj.getName().getIdentifier();
-
+
assertEquals("Base call has wrong name ",
"roleMethod1",
actual);
}
-}
+}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/BaseConstructorInvocationTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/BaseConstructorInvocationTest.java
index 89abba40b..2e91cb428 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/BaseConstructorInvocationTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/BaseConstructorInvocationTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -56,19 +56,19 @@ public class BaseConstructorInvocationTest extends FileBasedDOMTest
private TypeDeclaration _typeDecl;
private TypeDeclaration _role;
-
+
private BaseConstructorInvocation _testObj;
public BaseConstructorInvocationTest(String name)
{
super(name);
}
-
+
public static Test suite()
{
return new Suite(BaseConstructorInvocationTest.class);
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir(TEST_PROJECT);
@@ -79,12 +79,12 @@ public class BaseConstructorInvocationTest extends FileBasedDOMTest
"src",
"baseconstructor.teampkg",
"Team1.java");
-
+
ASTParser parser = ASTParser.newParser(JAVA_LANGUAGE_SPEC_LEVEL);
parser.setResolveBindings(true);
parser.setProject( getJavaProject(TEST_PROJECT) );
parser.setSource(_teamClass);
-
+
ASTNode root = parser.createAST( new NullProgressMonitor() );
CompilationUnit compUnit = (CompilationUnit)root;
_typeDecl = (TypeDeclaration)compUnit.types().get(0);
@@ -92,7 +92,7 @@ public class BaseConstructorInvocationTest extends FileBasedDOMTest
_role = _typeDecl.getTypes()[0];
}
- protected void setUp() throws Exception
+ protected void setUp() throws Exception
{
super.setUp();
}
@@ -114,7 +114,7 @@ public class BaseConstructorInvocationTest extends FileBasedDOMTest
_testObj = (BaseConstructorInvocation)constructor.getBody().statements().get(0);
int actual = _testObj.getNodeType();
-
+
assertEquals("BaseConstructorMessageSend has wrong node type",
ASTNode.BASE_CONSTRUCTOR_INVOCATION,
actual);
@@ -124,9 +124,9 @@ public class BaseConstructorInvocationTest extends FileBasedDOMTest
{
MethodDeclaration constructor = _role.getMethods()[0];
_testObj = (BaseConstructorInvocation)constructor.getBody().statements().get(0);
-
+
List actual = _testObj.getArguments();
-
+
assertEquals("BaseConstructorMessageSend has wrong number of arguments",
0,
actual.size());
@@ -137,23 +137,23 @@ public class BaseConstructorInvocationTest extends FileBasedDOMTest
RoleTypeDeclaration role = _typeDecl.getRoles()[0];
MethodDeclaration constructor = role.getMethods()[1];
_testObj = (BaseConstructorInvocation)constructor.getBody().statements().get(0);
-
+
List actual = _testObj.getArguments();
-
+
assertEquals("BaseConstructorMessageSend has wrong number of arguments",
2,
actual.size());
}
-
+
public void testChildNodesHaveCorrectParent1()
{
MethodDeclaration constructor = _role.getMethods()[1];
_testObj = (BaseConstructorInvocation) constructor.getBody().statements().get(0);
-
+
List childNodes = _testObj.getArguments();
- for (Iterator iter = childNodes.iterator(); iter.hasNext();)
+ for (Iterator iter = childNodes.iterator(); iter.hasNext();)
{
Expression curChild = (Expression) iter.next();
assertEquals("Base call arguments have wrong parent node",
@@ -161,23 +161,23 @@ public class BaseConstructorInvocationTest extends FileBasedDOMTest
curChild.getParent());
}
}
-
+
public void testSubtreeMatch1()
{
MethodDeclaration constructor = _role.getMethods()[1];
_testObj = (BaseConstructorInvocation)constructor.getBody().statements().get(0);
-
+
boolean actual = _testObj.subtreeMatch(new ASTMatcher(), _testObj);
assertTrue("Base constructor calls don't match", actual);
-
+
}
public void testtoString1()
{
MethodDeclaration constructor = _role.getMethods()[1];
_testObj = (BaseConstructorInvocation)constructor.getBody().statements().get(0);
-
+
String actual = _testObj.toString();
String expected = "base(dummy0, dummy1);";
@@ -193,28 +193,28 @@ public class BaseConstructorInvocationTest extends FileBasedDOMTest
"src",
"baseconstructor.teampkg",
"Team2.java");
-
+
ASTParser parser = ASTParser.newParser(JAVA_LANGUAGE_SPEC_LEVEL);
parser.setResolveBindings(true);
parser.setProject( getJavaProject(TEST_PROJECT) );
parser.setSource(_teamClass);
-
+
ASTNode root = parser.createAST( new NullProgressMonitor() );
CompilationUnit compUnit = (CompilationUnit)root;
TypeDeclaration team2Decl = (TypeDeclaration)compUnit.types().get(0);
TypeDeclaration role2Decl = team2Decl.getTypes()[0];
-
+
MethodDeclaration constructor = role2Decl.getMethods()[1];
_testObj = (BaseConstructorInvocation)constructor.getBody().statements().get(0);
-
+
String actual = _testObj.toString();
String expected = "base(dummy0, dummy1);";
assertEquals("Base constructor call has wrong naive flat string representation",
expected, actual);
}
-
+
public void testResolveConstructorBinding()
{
RoleTypeDeclaration role = _typeDecl.getRoles()[0];
@@ -224,10 +224,10 @@ public class BaseConstructorInvocationTest extends FileBasedDOMTest
ITypeBinding baseClass = role.resolveBinding().getBaseClass();
IMethodBinding baseConstructorBinding = baseClass.getDeclaredMethods()[1];
-
+
IMethodBinding expected = baseConstructorBinding;
IMethodBinding actual = _testObj.resolveConstructorBinding();
-
+
assertNotNull(actual);
assertEquals(expected, actual);
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/CallinMappingDeclarationTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/CallinMappingDeclarationTest.java
index 34718f470..d679047df 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/CallinMappingDeclarationTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/CallinMappingDeclarationTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -47,7 +47,7 @@ import org.eclipse.objectteams.otdt.ui.tests.dom.FileBasedDOMTest;
/**
* @author mkr
* @version $Id: CallinMappingDeclarationTest.java 23496 2010-02-05 23:20:15Z stephan $
- *
+ *
* NOTE: ParameterMappings are tested in ParameterMappingTest, including the PARAMETER_MAPPINGS_PROPERTY
* (attribute of CallinMappingDeclaration).
*/
@@ -68,12 +68,12 @@ public class CallinMappingDeclarationTest extends FileBasedDOMTest
{
super(name);
}
-
+
public static Test suite()
{
return new Suite(CallinMappingDeclarationTest.class);
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir(TEST_PROJECT);
@@ -88,13 +88,13 @@ public class CallinMappingDeclarationTest extends FileBasedDOMTest
_parser.setProject( getJavaProject(TEST_PROJECT) );
_parser.setSource(_simpleTeam);
_parser.setResolveBindings(true);
-
+
ASTNode root = _parser.createAST( new NullProgressMonitor() );
CompilationUnit compUnit = (CompilationUnit) root;
_typeDecl = (TypeDeclaration)compUnit.types().get(0);
}
- protected void setUp() throws Exception
+ protected void setUp() throws Exception
{
super.setUp();
}
@@ -130,11 +130,11 @@ public class CallinMappingDeclarationTest extends FileBasedDOMTest
TypeDeclaration role = types[0];
_testObj = (CallinMappingDeclaration)role.bodyDeclarations().get(0);
-
+
assertTrue("Missing 'before' modifier",
Modifier.isBefore(_testObj.getCallinModifier()));
}
-
+
public void testGetCallinModifiers_ReplaceBinding()
{
TypeDeclaration[] types = _typeDecl.getTypes();
@@ -198,7 +198,7 @@ public class CallinMappingDeclarationTest extends FileBasedDOMTest
assertEquals(1, actual.size());
}
-
+
public void testGetBaseMappingElements_ThreeElems()
{
TypeDeclaration[] types = _typeDecl.getTypes();
@@ -210,41 +210,41 @@ public class CallinMappingDeclarationTest extends FileBasedDOMTest
assertEquals("Wrong number of MethodSpec",
3, actual.size());
}
-
+
public void testGetRoleMappingElement_InstanceType()
{
TypeDeclaration[] types = _typeDecl.getTypes();
TypeDeclaration role = types[0];
_testObj = (CallinMappingDeclaration)role.bodyDeclarations().get(3);
-
+
assertTrue("Left side of callin not a MethodSpec",
_testObj.getRoleMappingElement() instanceof MethodSpec);
}
-
+
public void testGetBaseMappingElements_InstanceType()
{
TypeDeclaration[] types = _typeDecl.getTypes();
TypeDeclaration role = types[0];
_testObj = (CallinMappingDeclaration)role.bodyDeclarations().get(3);
-
+
assertTrue("Right side of callin not a MethodSpec",
_testObj.getBaseMappingElements().get(0) instanceof MethodSpec);
assertTrue("Right side of callin not a MethodSpec",
_testObj.getBaseMappingElements().get(1) instanceof MethodSpec);
assertTrue("Right side of callin not a MethodSpec",
_testObj.getBaseMappingElements().get(2) instanceof MethodSpec);
-
+
}
-
+
public void testGetParameterMappings_NotNull()
{
TypeDeclaration[] types = _typeDecl.getTypes();
TypeDeclaration role = types[0];
_testObj = (CallinMappingDeclaration)role.bodyDeclarations().get(4);
-
+
assertTrue("Parameter mapping null", _testObj.getParameterMappings() != null);
}
@@ -255,12 +255,12 @@ public class CallinMappingDeclarationTest extends FileBasedDOMTest
_testObj = (CallinMappingDeclaration)role.bodyDeclarations().get(4);
List actualNodes = _testObj.getParameterMappings();
- for (Iterator iter = actualNodes.iterator(); iter.hasNext();)
+ for (Iterator iter = actualNodes.iterator(); iter.hasNext();)
{
ParameterMapping curActual = (ParameterMapping) iter.next();
assertTrue("CallinMappingDeclaration has ParameterMapping with wrong parent",
_testObj == curActual.getParent());
- }
+ }
}
public void testGetParameterMappings_Empty()
@@ -303,7 +303,7 @@ public class CallinMappingDeclarationTest extends FileBasedDOMTest
"BrokenTeam.java");
_parser.setSource(brokenCU);
_parser.setResolveBindings(true);
-
+
ASTNode root = _parser.createAST( new NullProgressMonitor() );
CompilationUnit compUnit = (CompilationUnit) root;
TypeDeclaration teamType = (TypeDeclaration)compUnit.types().get(0);
@@ -312,5 +312,5 @@ public class CallinMappingDeclarationTest extends FileBasedDOMTest
assertEquals("foo <- after bar;", callinMapping.toString());
// TODO(SH): adjust once recovery of parameter mappings is implemented.
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/CalloutMappingDeclarationTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/CalloutMappingDeclarationTest.java
index 75760dfbd..1a97c15cf 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/CalloutMappingDeclarationTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/CalloutMappingDeclarationTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -47,7 +47,7 @@ import org.eclipse.objectteams.otdt.ui.tests.dom.FileBasedDOMTest;
/**
* @author jsv
* @version $Id: CalloutMappingDeclarationTest.java 23496 2010-02-05 23:20:15Z stephan $
- *
+ *
* NOTE: ParameterMappings are tested in ParameterMappingTest, including the PARAMETER_MAPPINGS_PROPERTY
* (attribute of CalloutMappingDeclaration).
*/
@@ -63,28 +63,28 @@ public class CalloutMappingDeclarationTest extends FileBasedDOMTest
private TypeDeclaration _role;
// one more version with a syntax error:
private ICompilationUnit _simpleTeamBuggy;
- private TypeDeclaration _typeDeclBuggy;
+ private TypeDeclaration _typeDeclBuggy;
private TypeDeclaration _roleBuggy;
-
+
private CalloutMappingDeclaration _testObj;
public CalloutMappingDeclarationTest(String name)
{
super(name);
}
-
+
public static Test suite()
{
return new Suite(CalloutMappingDeclarationTest.class);
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir(TEST_PROJECT);
super.setUpSuite();
}
- protected void setUp() throws Exception
+ protected void setUp() throws Exception
{
super.setUp();
_simpleTeam = getCompilationUnit(
@@ -92,11 +92,11 @@ public class CalloutMappingDeclarationTest extends FileBasedDOMTest
"src",
"callouts.teampkg",
"Team1.java");
-
+
_parser = ASTParser.newParser(JAVA_LANGUAGE_SPEC_LEVEL);
_parser.setProject( getJavaProject(TEST_PROJECT) );
_parser.setSource(_simpleTeam);
-
+
ASTNode root = _parser.createAST( new NullProgressMonitor() );
CompilationUnit compUnit = (CompilationUnit) root;
_typeDecl = (TypeDeclaration)compUnit.types().get(0);
@@ -109,11 +109,11 @@ public class CalloutMappingDeclarationTest extends FileBasedDOMTest
"src",
"callouts.teampkg",
"TeamBuggy.java");
-
+
_parser = ASTParser.newParser(JAVA_LANGUAGE_SPEC_LEVEL);
_parser.setProject( getJavaProject(TEST_PROJECT) );
_parser.setSource(_simpleTeamBuggy);
-
+
ASTNode root = _parser.createAST( new NullProgressMonitor() );
CompilationUnit compUnit = (CompilationUnit) root;
_typeDeclBuggy = (TypeDeclaration)compUnit.types().get(0);
@@ -124,68 +124,68 @@ public class CalloutMappingDeclarationTest extends FileBasedDOMTest
{
// extract the callout mapping as body declaration
BodyDeclaration testObj = (BodyDeclaration)_role.bodyDeclarations().get(2);
-
+
assertTrue(
"BodyDeclaration is not an instance of CalloutMappingDeclaration",
testObj instanceof CalloutMappingDeclaration);
}
-
+
public void testGetNodeType1()
{
// extract the callout mapping as body declaration
BodyDeclaration testObj = (BodyDeclaration)_role.bodyDeclarations().get(2);
-
+
int actual = testObj.getNodeType();
-
+
assertEquals(
- "CalloutMappingDeclaration has wrong NodeType",
- ASTNode.CALLOUT_MAPPING_DECLARATION,
+ "CalloutMappingDeclaration has wrong NodeType",
+ ASTNode.CALLOUT_MAPPING_DECLARATION,
actual);
}
-
+
public void testIsCalloutOverride_false()
{
- _testObj = (CalloutMappingDeclaration)_role.bodyDeclarations().get(2);
+ _testObj = (CalloutMappingDeclaration)_role.bodyDeclarations().get(2);
boolean actual = _testObj.isCalloutOverride();
-
+
assertFalse("Callout is not overridden", actual);
}
-
+
public void testIsCalloutOverride_true()
{
_testObj = (CalloutMappingDeclaration)_role.bodyDeclarations().get(3);
-
+
boolean actual = _testObj.isCalloutOverride();
-
+
assertTrue("Callout is overridden", actual);
}
-
+
public void testHasSignature_true()
{
_testObj = (CalloutMappingDeclaration)_role.bodyDeclarations().get(3);
-
- boolean actual = _testObj.hasSignature();
-
+
+ boolean actual = _testObj.hasSignature();
+
assertTrue(
- "Callout binding should have a signature",
+ "Callout binding should have a signature",
actual);
}
-
+
public void testHasSignature_false()
{
_testObj = (CalloutMappingDeclaration)_role.bodyDeclarations().get(2);
-
+
boolean actual = _testObj.hasSignature();
-
+
assertFalse(
- "Callout binding should not have a signature",
+ "Callout binding should not have a signature",
actual);
}
-
+
public void testCalloutWithModifier() {
_testObj = (CalloutMappingDeclaration)_role.bodyDeclarations().get(10);
-
+
boolean found = false;
boolean other = false;
for (Object modObj : _testObj.modifiers()) {
@@ -198,12 +198,12 @@ public class CalloutMappingDeclarationTest extends FileBasedDOMTest
System.out.println("Unexpected modifier "+other);
}
}
-
+
assertTrue(
- "Callout binding should have a protected modifier",
- found);
+ "Callout binding should have a protected modifier",
+ found);
assertFalse(
- "Callout binding should not have other modifier",
+ "Callout binding should not have other modifier",
other);
}
@@ -211,8 +211,8 @@ public class CalloutMappingDeclarationTest extends FileBasedDOMTest
{
_testObj = (CalloutMappingDeclaration)_role.bodyDeclarations().get(2);
- ASTNode actual = _testObj.getParent();
-
+ ASTNode actual = _testObj.getParent();
+
assertNotNull(
"ParentNode of CalloutMappingDeclaration has to be not null",
actual);
@@ -222,17 +222,17 @@ public class CalloutMappingDeclarationTest extends FileBasedDOMTest
{
_testObj = (CalloutMappingDeclaration)_role.bodyDeclarations().get(3);
- ASTNode actual = _testObj.getParent();
-
+ ASTNode actual = _testObj.getParent();
+
assertNotNull(
"ParentNode of CalloutMappingDeclaration has to be not null",
actual);
- }
+ }
public void testGetParent_InstanceType1()
{
_testObj = (CalloutMappingDeclaration)_role.bodyDeclarations().get(2);
-
+
ASTNode actual = _testObj.getParent();
assertTrue(
@@ -245,185 +245,185 @@ public class CalloutMappingDeclarationTest extends FileBasedDOMTest
_testObj = (CalloutMappingDeclaration)_role.bodyDeclarations().get(3);
ASTNode actual = _testObj.getParent();
-
+
assertTrue(
"ParentNode has wrong Type",
actual instanceof RoleTypeDeclaration );
}
-
+
public void testGetLeftMethodSpec_notNull()
{
_testObj = (CalloutMappingDeclaration)_role.bodyDeclarations().get(2);
-
+
MethodSpec actual = (MethodSpec)_testObj.getRoleMappingElement();
-
+
assertNotNull("LeftMethodSpec must not be null", actual);
- }
+ }
public void testGetRightMethodSpec_notNull()
{
_testObj = (CalloutMappingDeclaration)_role.bodyDeclarations().get(2);
-
+
MethodSpec actual = (MethodSpec)_testObj.getBaseMappingElement();
assertNotNull("RightMethodSpec must not be null", actual);
}
-
+
public void testHasSignature_SameFlag()
{
_testObj = (CalloutMappingDeclaration)_role.bodyDeclarations().get(3);
MethodSpec leftMethodSpec = (MethodSpec)_testObj.getRoleMappingElement();
MethodSpec rightMethodSpec = (MethodSpec)_testObj.getBaseMappingElement();
-
- boolean actual = leftMethodSpec.hasSignature() == rightMethodSpec.hasSignature();
-
+
+ boolean actual = leftMethodSpec.hasSignature() == rightMethodSpec.hasSignature();
+
assertTrue(
"The base and base method should have the same signature flag",
actual);
}
-
+
public void testGetRightMethodSpec_InstanceType1()
{
_testObj = (CalloutMappingDeclaration)_role.bodyDeclarations().get(2);
-
+
Object actual = _testObj.getBaseMappingElement();
assertTrue(
- "In this case the base accessor should be a MethodSpec",
+ "In this case the base accessor should be a MethodSpec",
actual instanceof MethodSpec);
}
-
+
public void testGetRightMethodSpec_InstanceType2()
{
_testObj = (CalloutMappingDeclaration)_role.bodyDeclarations().get(5);
-
+
Object actual = _testObj.getBaseMappingElement();
-
+
assertTrue(
- "In this case the base accessor should be a FieldAccessSpec",
+ "In this case the base accessor should be a FieldAccessSpec",
actual instanceof FieldAccessSpec);
}
-
+
public void testGetRightMethodSpec_InstanceType3()
{
_testObj = (CalloutMappingDeclaration)_role.bodyDeclarations().get(7);
-
+
Object actual = _testObj.getBaseMappingElement();
-
+
assertTrue(
- "In this case the base accessor should be a FieldAccessSpec",
+ "In this case the base accessor should be a FieldAccessSpec",
actual instanceof FieldAccessSpec);
}
-
+
public void testGetParameterMappings_Empty()
{
_testObj = (CalloutMappingDeclaration)_role.bodyDeclarations().get(7);
List parameterMappings = _testObj.getParameterMappings();
-
+
boolean actual = parameterMappings.isEmpty();
-
+
assertTrue(
"List ParameterMappings is not empty",
actual);
}
-
+
public void testGetParameterMappings_NotEmpty()
{
_testObj = (CalloutMappingDeclaration)_role.bodyDeclarations().get(9);
List parameterMappings = _testObj.getParameterMappings();
-
+
boolean actual = parameterMappings.isEmpty();
-
+
assertFalse("List ParameterMappings is empty", actual);
- }
-
- /**
- * compares the AST references of calloutMappingDeclaration and
- * roleMethodSpec
+ }
+
+ /**
+ * compares the AST references of calloutMappingDeclaration and
+ * roleMethodSpec
*/
public void testGetAST_Identity1()
{
_testObj = (CalloutMappingDeclaration)_role.bodyDeclarations().get(2);
MethodSpec roleMethodSpec = (MethodSpec)_testObj.getRoleMappingElement();
-
+
assertTrue(
"Role Methodspec is not associate to the same AST like parent CalloutMappingDeclaration",
_testObj.getAST() == roleMethodSpec.getAST());
}
- /**
+ /**
* compares the AST references of calloutMappingDeclaration and baseMethodSpec
*/
public void testGetAST_Identity2()
{
_testObj= (CalloutMappingDeclaration)_role.bodyDeclarations().get(2);
MethodSpec baseMethodSpec = (MethodSpec)_testObj.getBaseMappingElement();
-
+
assertTrue(
"Base Methodspec is not associate to the same AST like parent CalloutMappingDeclaration",
_testObj.getAST() == baseMethodSpec.getAST());
}
-
- /**
- * compares the AST references of calloutMappingDeclaration and
- * baseFieldAccessSpec
- */
+
+ /**
+ * compares the AST references of calloutMappingDeclaration and
+ * baseFieldAccessSpec
+ */
public void testGetAST_Identity3()
{
_testObj = (CalloutMappingDeclaration)_role.bodyDeclarations().get(5);
- FieldAccessSpec baseFiedAccessSpec =
+ FieldAccessSpec baseFiedAccessSpec =
(FieldAccessSpec)_testObj.getBaseMappingElement();
-
+
assertTrue(
"Base FieldAccessySpec is not associate to the same AST like parent CalloutMappingDeclaration",
_testObj.getAST() == baseFiedAccessSpec.getAST());
}
-
- /**
- * compares the AST references of calloutMappingDeclaration and first
- * ParameterMapping
- */
+
+ /**
+ * compares the AST references of calloutMappingDeclaration and first
+ * ParameterMapping
+ */
public void testGetAST_Identity4()
{
_testObj = (CalloutMappingDeclaration)_role.bodyDeclarations().get(9);
// get first ParameterMapping
- ParameterMapping parameterMapping =
- (ParameterMapping)_testObj.getParameterMappings().get(0);
-
+ ParameterMapping parameterMapping =
+ (ParameterMapping)_testObj.getParameterMappings().get(0);
+
assertTrue(
"First ParameterMapping is not associate to the same AST like parent CalloutMappingDeclaration",
_testObj.getAST() == parameterMapping.getAST());
}
-
+
public void testSubtreeMatch1()
{
_testObj = (CalloutMappingDeclaration)_role.bodyDeclarations().get(9);
-
+
boolean actual = _testObj.subtreeMatch(new ASTMatcher(), _testObj);
-
+
assertTrue("Callout mappings don't match", actual);
}
-
+
public void testCopySubtree1()
{
_testObj = (CalloutMappingDeclaration)_role.bodyDeclarations().get(9);
-
- CalloutMappingDeclaration clonedTestObject =
+
+ CalloutMappingDeclaration clonedTestObject =
(CalloutMappingDeclaration)ASTNode.copySubtree(AST.newAST(AST.JLS4), _testObj);
boolean actual = _testObj.subtreeMatch(new ASTMatcher(), clonedTestObject);
assertTrue("Copy of subtree not correct", actual);
}
-
+
public void testSourceRangeOfBuggyCallout() throws JavaModelException
{
setupForBuggyTeam();
-
+
_testObj = (CalloutMappingDeclaration)_roleBuggy.bodyDeclarations().get(3);
-
- int start = _testObj.getRoleMappingElement().getStartPosition();
- int length = _testObj.getRoleMappingElement().getLength();
-
+
+ int start = _testObj.getRoleMappingElement().getStartPosition();
+ int length = _testObj.getRoleMappingElement().getLength();
+
assertEquals(436, start);
assertEquals(14, length); // "void fooBar2()"
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/DOMRegressionTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/DOMRegressionTests.java
index fdd5d3b58..b48004a98 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/DOMRegressionTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/DOMRegressionTests.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010 Stephan Herrmann.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -34,20 +34,20 @@ import org.eclipse.jdt.core.dom.TypeDeclaration;
import org.eclipse.objectteams.otdt.ui.tests.dom.FileBasedDOMTest;
public class DOMRegressionTests extends FileBasedDOMTest {
-
+
public static final String TEST_PROJECT = "DOM_AST";
private static final int JAVA_LANGUAGE_SPEC_LEVEL = AST.JLS4;
-
+
public DOMRegressionTests(String name) {
super(name);
}
-
+
public static Test suite()
{
return new Suite(DOMRegressionTests.class);
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir(TEST_PROJECT);
@@ -55,11 +55,11 @@ public class DOMRegressionTests extends FileBasedDOMTest {
}
- protected void setUp() throws Exception
+ protected void setUp() throws Exception
{
super.setUp();
}
-
+
// Bug 316666 - [dom] IllegalArgumentException in very broken source
public void testBug316666() throws JavaModelException {
ICompilationUnit teamClass = getCompilationUnit(
@@ -71,15 +71,15 @@ public class DOMRegressionTests extends FileBasedDOMTest {
parser.setProject(getJavaProject(TEST_PROJECT));
parser.setSource(teamClass);
parser.setResolveBindings(true);
-
- ASTNode root = parser.createAST( new NullProgressMonitor() );
+
+ ASTNode root = parser.createAST( new NullProgressMonitor() );
CompilationUnit compUnit = (CompilationUnit) root;
TypeDeclaration topTeam = (TypeDeclaration) compUnit.types().get(0);
TypeDeclaration nestedTeam = (TypeDeclaration) topTeam.getTypes()[1];
// note: the bug was related to mistakenly converted generated fields.
assertEquals("No fields expected",nestedTeam.getFields().length, 0);
}
-
+
// version with somewhat repaired structure in the source file (similar(?) to what the parser actually saw):
public void testBug316666_repaired() throws JavaModelException {
ICompilationUnit teamClass = getCompilationUnit(
@@ -91,8 +91,8 @@ public class DOMRegressionTests extends FileBasedDOMTest {
parser.setProject(getJavaProject(TEST_PROJECT));
parser.setSource(teamClass);
parser.setResolveBindings(true);
-
- ASTNode root = parser.createAST( new NullProgressMonitor() );
+
+ ASTNode root = parser.createAST( new NullProgressMonitor() );
CompilationUnit compUnit = (CompilationUnit) root;
TypeDeclaration topTeam = (TypeDeclaration) compUnit.types().get(0);
TypeDeclaration nestedTeam = (TypeDeclaration) topTeam.getTypes()[0];
@@ -113,8 +113,8 @@ public class DOMRegressionTests extends FileBasedDOMTest {
parser.setSource(teamClass);
parser.setStatementsRecovery(true);
parser.setResolveBindings(true);
-
- ASTNode root = parser.createAST( new NullProgressMonitor() );
+
+ ASTNode root = parser.createAST( new NullProgressMonitor() );
CompilationUnit compUnit = (CompilationUnit) root;
TypeDeclaration topTeam = (TypeDeclaration) compUnit.types().get(0);
TypeDeclaration role = (TypeDeclaration) topTeam.getTypes()[0];
@@ -124,5 +124,5 @@ public class DOMRegressionTests extends FileBasedDOMTest {
// note: the bug was related to mistakenly converted generated fields.
assertEquals("Call to foo expected", "foo", basecall.getName().getIdentifier());
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/FieldAccessSpecTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/FieldAccessSpecTest.java
index ed0a81633..fc512254a 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/FieldAccessSpecTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/FieldAccessSpecTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -50,31 +50,31 @@ public class FieldAccessSpecTest extends FileBasedDOMTest
private ASTParser _parser;
private ICompilationUnit _simpleTeam;
private ICompilationUnit _baseClassCompUnit;
-
+
private TypeDeclaration _typeDecl; // a java class common to all within tests
private TypeDeclaration _role;
private TypeDeclaration _base;
-
+
private FieldAccessSpec _testObj;
private Object mapping;
-
+
public FieldAccessSpecTest(String name)
{
super(name);
}
-
+
public static Test suite()
{
return new Suite(FieldAccessSpecTest.class);
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir(TEST_PROJECT);
super.setUpSuite();
}
- protected void setUp() throws Exception
+ protected void setUp() throws Exception
{
super.setUp();
_simpleTeam = getCompilationUnit(
@@ -93,26 +93,26 @@ public class FieldAccessSpecTest extends FileBasedDOMTest
_parser.setProject( getJavaProject(TEST_PROJECT) );
_parser.setSource(_simpleTeam);
_parser.setResolveBindings(true);
-
+
ASTNode root = _parser.createAST( new NullProgressMonitor() );
CompilationUnit compUnit = (CompilationUnit)root;
_typeDecl = (TypeDeclaration)compUnit.types().get(0);
_role = _typeDecl.getTypes()[0];
-
+
_parser = ASTParser.newParser(JAVA_LANGUAGE_SPEC_LEVEL);
_parser.setProject( getJavaProject(TEST_PROJECT) );
_parser.setSource(_baseClassCompUnit);
_parser.setResolveBindings(true);
-
+
compUnit = (CompilationUnit)_parser.createAST( new NullProgressMonitor() );
- _base = (TypeDeclaration)compUnit.types().get(0);
+ _base = (TypeDeclaration)compUnit.types().get(0);
}
public void testInstanceType1()
{
CalloutMappingDeclaration mapping = (CalloutMappingDeclaration)_role.bodyDeclarations().get(1);
FieldAccessSpec testObj = (FieldAccessSpec)mapping.getBaseMappingElement();
-
+
assertTrue(testObj instanceof FieldAccessSpec);
}
@@ -120,117 +120,117 @@ public class FieldAccessSpecTest extends FileBasedDOMTest
{
CalloutMappingDeclaration mapping = (CalloutMappingDeclaration)_role.bodyDeclarations().get(3);
_testObj = (FieldAccessSpec)mapping.getBaseMappingElement();
-
+
boolean actual = _testObj.hasSignature();
-
+
assertTrue("FieldAccessSpec should have a signature", actual);
}
-
+
public void testHasSignature_false()
{
CalloutMappingDeclaration mapping = (CalloutMappingDeclaration)_role.bodyDeclarations().get(1);
_testObj = (FieldAccessSpec)mapping.getBaseMappingElement();
-
+
boolean actual = _testObj.hasSignature();
-
+
assertFalse("FieldAccessSpec should not have a signature", actual);
}
-
+
public void testGetParent_InstanceType1()
{
CalloutMappingDeclaration mapping = (CalloutMappingDeclaration)_role.bodyDeclarations().get(1);
- _testObj = (FieldAccessSpec)mapping.getBaseMappingElement();
-
+ _testObj = (FieldAccessSpec)mapping.getBaseMappingElement();
+
ASTNode actual = _testObj.getParent();
assertTrue(
"ParentNode has wrong Type, Should be CalloutMappingDeclaration",
actual instanceof CalloutMappingDeclaration);
}
-
+
public void testSubtreeMatch1()
{
CalloutMappingDeclaration mapping = (CalloutMappingDeclaration)_role.bodyDeclarations().get(3);
_testObj = (FieldAccessSpec)mapping.getBaseMappingElement();
-
+
boolean actual = _testObj.subtreeMatch(new ASTMatcher(), _testObj);
-
+
assertTrue("FieldAccessSpecs don't match", actual);
}
-
+
public void testCopySubtree1()
{
CalloutMappingDeclaration mapping = (CalloutMappingDeclaration)_role.bodyDeclarations().get(3);
- _testObj = (FieldAccessSpec)mapping.getBaseMappingElement();
-
- FieldAccessSpec clonedTestObject =
+ _testObj = (FieldAccessSpec)mapping.getBaseMappingElement();
+
+ FieldAccessSpec clonedTestObject =
(FieldAccessSpec)ASTNode.copySubtree(AST.newAST(AST.JLS4), _testObj);
-
+
boolean actual = _testObj.subtreeMatch(new ASTMatcher(), clonedTestObject);
assertTrue("Copy of subtree not correct", actual);
}
-
+
public void testGetModifiers_Get()
{
CalloutMappingDeclaration mapping = (CalloutMappingDeclaration)_role.bodyDeclarations().get(1);
_testObj = (FieldAccessSpec)mapping.getBaseMappingElement();
-
+
int actual = mapping.bindingOperator().getBindingModifier();
-
+
assertTrue(
- "Callout should have the get modifier",
+ "Callout should have the get modifier",
Modifier.isGet(actual));
assertEquals(
"Callout should be a getter",
Modifier.OT_GET_CALLOUT,
mapping.bindingOperator().getBindingModifier());
}
-
+
public void testGetModifiers_Set()
{
CalloutMappingDeclaration mapping = (CalloutMappingDeclaration)_role.bodyDeclarations().get(3);
_testObj = (FieldAccessSpec)mapping.getBaseMappingElement();
-
+
int actual = mapping.bindingOperator().getBindingModifier();
-
+
assertTrue(
- "Callout should have the set modifier",
+ "Callout should have the set modifier",
Modifier.isSet(actual));
assertEquals(
- "Callout should be a setter",
+ "Callout should be a setter",
Modifier.OT_SET_CALLOUT,
mapping.bindingOperator().getBindingModifier());
}
-
+
public void testGetName_string()
{
CalloutMappingDeclaration mapping = (CalloutMappingDeclaration)_role.bodyDeclarations().get(1);
_testObj = (FieldAccessSpec)mapping.getBaseMappingElement();
-
+
String actual = _testObj.getName().getIdentifier();
-
+
assertEquals("FieldAccess has wrong name ",
"_string",
actual);
}
-
+
public void testResolveBinding()
{
CalloutMappingDeclaration mapping = (CalloutMappingDeclaration)_role.bodyDeclarations().get(1);
FieldDeclaration fieldDecl = (FieldDeclaration)_base.bodyDeclarations().get(0);
-
+
_testObj = (FieldAccessSpec)mapping.getBaseMappingElement();
-
+
VariableDeclarationFragment varDeclFrag =
(VariableDeclarationFragment)fieldDecl.fragments().get(0);
-
+
IVariableBinding expected = varDeclFrag.resolveBinding();
IVariableBinding actual = _testObj.resolveBinding();
assertEquals(expected.getKey(), actual.getKey());
}
-
-
-
+
+
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/GuardPredicateTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/GuardPredicateTest.java
index 1a9538478..ec9313874 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/GuardPredicateTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/GuardPredicateTest.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -46,7 +46,7 @@ import org.eclipse.objectteams.otdt.ui.tests.dom.FileBasedDOMTest;
public class GuardPredicateTest extends FileBasedDOMTest {
public static final String TEST_PROJECT = "DOM_AST";
-
+
private static final int JAVA_LANGUAGE_SPEC_LEVEL = AST.JLS4;
private ASTParser _parser;
@@ -55,16 +55,16 @@ public class GuardPredicateTest extends FileBasedDOMTest {
// Java class used for all within tests
private CompilationUnit _cu;
private TypeDeclaration _typeDecl;
-
+
public GuardPredicateTest(String name) {
super(name);
}
-
+
public static Test suite()
{
return new Suite(GuardPredicateTest.class);
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir(TEST_PROJECT);
@@ -79,28 +79,28 @@ public class GuardPredicateTest extends FileBasedDOMTest {
_parser.setProject( getJavaProject(TEST_PROJECT) );
}
- protected void setUp() throws Exception
+ protected void setUp() throws Exception
{
super.setUp();
}
-
+
@SuppressWarnings({ "unchecked" })
- private void initAST(ICompilationUnit icu, boolean resolve, String targetLevel)
+ private void initAST(ICompilationUnit icu, boolean resolve, String targetLevel)
{
_parser.setSource(icu);
-
+
Map options = getJavaProject(TEST_PROJECT).getOptions(true);
options.put(CompilerOptions.OPTION_TargetPlatform, targetLevel);
_parser.setCompilerOptions(options);
_parser.setResolveBindings(resolve);
-
+
ASTNode root = _parser.createAST( new NullProgressMonitor() );
_cu = (CompilationUnit) root;
_typeDecl = (TypeDeclaration)_cu.types().get(0);
-
+
}
-
+
public void testPredicateInRole() {
initAST(_simpleTeam, false, CompilerOptions.VERSION_1_5);
@@ -110,7 +110,7 @@ public class GuardPredicateTest extends FileBasedDOMTest {
GuardPredicateDeclaration guard = role1.getGuardPredicate();
assertFalse("guard predicate is non-null", guard == null);
assertTrue("guard is base guard", guard.isBase());
-
+
ASTRewriteFlattener _rewriteFlattener = new ASTRewriteFlattener(new RewriteEventStore());
guard.accept(_rewriteFlattener);
@@ -118,7 +118,7 @@ public class GuardPredicateTest extends FileBasedDOMTest {
String expected = "base when (Team2.this.hasRole(base,R.class))"; //$NON-NLS-1$
assertEquals("Wrong guard Code", expected, actual);
}
-
+
@SuppressWarnings({ "restriction"})
public void testPredicateRegression() throws JavaModelException {
initAST(getCompilationUnit(
@@ -127,14 +127,14 @@ public class GuardPredicateTest extends FileBasedDOMTest {
"predicates.teampkg",
"TeamBug.java"),
true, CompilerOptions.VERSION_1_6);
-
+
TypeDeclaration[] types = _typeDecl.getTypes();
RoleTypeDeclaration role1 = (RoleTypeDeclaration)types[0];
CallinMappingDeclaration callinDecl = role1.getCallIns()[0];
GuardPredicateDeclaration guard = callinDecl.getGuardPredicate();
assertFalse("guard predicate is non-null", guard == null);
assertFalse("guard is not base guard", guard.isBase());
-
+
ASTRewriteFlattener _rewriteFlattener = new ASTRewriteFlattener(new RewriteEventStore());
guard.accept(_rewriteFlattener);
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/LiftingTypeTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/LiftingTypeTest.java
index 513de7427..62fc9fe98 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/LiftingTypeTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/LiftingTypeTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -51,30 +51,30 @@ public class LiftingTypeTest extends FileBasedDOMTest
private ASTParser _parser;
private ICompilationUnit _simpleTeam;
-
+
private TypeDeclaration _typeDecl; // a java class common to all within tests
- private MethodDeclaration _methodDecl;
+ private MethodDeclaration _methodDecl;
private SingleVariableDeclaration _variableDecl;
-
+
private LiftingType _testObj;
-
+
public LiftingTypeTest(String name)
{
super(name);
}
-
+
public static Test suite()
{
return new Suite(LiftingTypeTest.class);
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir(TEST_PROJECT);
super.setUpSuite();
}
- protected void setUp() throws Exception
+ protected void setUp() throws Exception
{
super.setUp();
_simpleTeam = getCompilationUnit(
@@ -82,77 +82,77 @@ public class LiftingTypeTest extends FileBasedDOMTest
"src",
"liftingType.teampkg",
"Team1.java");
-
+
_parser = ASTParser.newParser(JAVA_LANGUAGE_SPEC_LEVEL);
_parser.setProject( getJavaProject(TEST_PROJECT) );
_parser.setSource(_simpleTeam);
-
+
ASTNode root = _parser.createAST( new NullProgressMonitor() );
CompilationUnit compUnit = (CompilationUnit) root;
_typeDecl = (TypeDeclaration)compUnit.types().get(0);
- _methodDecl = (MethodDeclaration)_typeDecl.bodyDeclarations().get(0);
+ _methodDecl = (MethodDeclaration)_typeDecl.bodyDeclarations().get(0);
_variableDecl = (SingleVariableDeclaration)_methodDecl.parameters().get(0);
}
public void testInstanceType1()
{
Type testObj = _variableDecl.getType();
-
+
assertTrue(testObj instanceof LiftingType);
}
-
+
public void testSubtreeMatch1()
{
_testObj = (LiftingType)_variableDecl.getType();
-
+
boolean actual = _testObj.subtreeMatch(new ASTMatcher(), _testObj);
-
+
assertTrue("LiftingTypes don't match", actual);
}
-
+
public void testCopySubtree1()
{
- _testObj = (LiftingType)_variableDecl.getType();
- LiftingType clonedTestObject =
+ _testObj = (LiftingType)_variableDecl.getType();
+ LiftingType clonedTestObject =
(LiftingType)ASTNode.copySubtree(AST.newAST(AST.JLS4), _testObj);
-
+
boolean actual = _testObj.subtreeMatch(new ASTMatcher(), clonedTestObject);
assertTrue("Copy of subtree not correct", actual);
}
-
+
public void testGetBaseType_MyClass()
{
_testObj = (LiftingType)_variableDecl.getType();
Name typeName = ((SimpleType)_testObj.getBaseType()).getName();
-
+
String actual = ((SimpleName)typeName).getIdentifier();
-
+
assertEquals("Base type has wrong name ",
"MyClass",
actual);
}
-
+
public void testGetRoleType_MyRole()
{
_testObj = (LiftingType)_variableDecl.getType();
Name typeName = ((SimpleType)_testObj.getRoleType()).getName();
-
+
String actual = ((SimpleName)typeName).getIdentifier();
-
+
assertEquals("Role type has wrong name ",
"MyRole",
actual);
}
-
+
public void testSignature()
{
_testObj = (LiftingType)_variableDecl.getType();
String sig = Util.getSignature(_testObj);
-
+
assertEquals("Base type has wrong name ",
"QMyClass;",
sig);
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/MethodSpecTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/MethodSpecTest.java
index 695ab6c79..f98b71a66 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/MethodSpecTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/MethodSpecTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -52,29 +52,29 @@ public class MethodSpecTest extends FileBasedDOMTest
private ASTParser _parser;
private ICompilationUnit _simpleTeam;
-
+
private TypeDeclaration _typeDecl; // a java class common to all within tests
private TypeDeclaration _role;
-
+
private MethodSpec _testObj;
-
+
public MethodSpecTest(String name)
{
super(name);
}
-
+
public static Test suite()
{
return new Suite(MethodSpecTest.class);
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir(TEST_PROJECT);
super.setUpSuite();
}
- protected void setUp() throws Exception
+ protected void setUp() throws Exception
{
super.setUp();
_simpleTeam = getCompilationUnit(
@@ -82,144 +82,144 @@ public class MethodSpecTest extends FileBasedDOMTest
"src",
"methodSpec.teampkg",
"Team1.java");
-
+
_parser = ASTParser.newParser(JAVA_LANGUAGE_SPEC_LEVEL);
_parser.setProject( getJavaProject(TEST_PROJECT) );
_parser.setSource(_simpleTeam);
_parser.setResolveBindings(true);
-
+
ASTNode root = _parser.createAST( new NullProgressMonitor() );
CompilationUnit compUnit = (CompilationUnit)root;
_typeDecl = (TypeDeclaration)compUnit.types().get(0);
- _role = _typeDecl.getTypes()[0];
+ _role = _typeDecl.getTypes()[0];
}
public void testInstanceType1()
{
CalloutMappingDeclaration mapping = (CalloutMappingDeclaration)_role.bodyDeclarations().get(1);
Object testObj = mapping.getRoleMappingElement();
-
+
assertTrue(testObj instanceof MethodSpec);
}
-
+
public void testParameters_Two()
{
CalloutMappingDeclaration mapping = (CalloutMappingDeclaration)_role.bodyDeclarations().get(1);
_testObj = (MethodSpec)mapping.getRoleMappingElement();
-
+
List actual = _testObj.parameters();
-
+
assertEquals(2, actual.size());
}
-
+
public void testParameters_Empty()
{
CalloutMappingDeclaration mapping = (CalloutMappingDeclaration)_role.bodyDeclarations().get(3);
_testObj = (MethodSpec)mapping.getRoleMappingElement();
-
+
List actual = _testObj.parameters();
-
+
assertTrue(actual.isEmpty());
}
-
+
public void testHasSignature_true()
{
CalloutMappingDeclaration mapping = (CalloutMappingDeclaration)_role.bodyDeclarations().get(1);
_testObj = (MethodSpec)mapping.getRoleMappingElement();
-
+
boolean actual = _testObj.hasSignature();
-
+
assertTrue("MethodSpec should have a signature", actual);
}
-
+
public void testHasSignature_false()
{
CalloutMappingDeclaration mapping = (CalloutMappingDeclaration)_role.bodyDeclarations().get(5);
_testObj = (MethodSpec)mapping.getRoleMappingElement();
-
+
boolean actual = _testObj.hasSignature();
assertFalse("MethodSpec should not have a signature", actual);
}
-
+
public void testSubtreeMatch1()
{
CalloutMappingDeclaration mapping = (CalloutMappingDeclaration)_role.bodyDeclarations().get(1);
_testObj = (MethodSpec)mapping.getRoleMappingElement();
-
+
boolean actual = _testObj.subtreeMatch(new ASTMatcher(), _testObj);
-
+
assertTrue("MethodSpecs don't match", actual);
}
-
+
public void testCopySubtree1()
{
CalloutMappingDeclaration mapping = (CalloutMappingDeclaration)_role.bodyDeclarations().get(1);
- _testObj = (MethodSpec)mapping.getRoleMappingElement();
-
- MethodSpec clonedTestObject =
+ _testObj = (MethodSpec)mapping.getRoleMappingElement();
+
+ MethodSpec clonedTestObject =
(MethodSpec)ASTNode.copySubtree(AST.newAST(AST.JLS4), _testObj);
boolean actual = _testObj.subtreeMatch(new ASTMatcher(), clonedTestObject);
assertTrue("Copy of subtree not correct", actual);
}
-
+
public void testGetParent_InstanceType1()
{
CalloutMappingDeclaration mapping = (CalloutMappingDeclaration)_role.bodyDeclarations().get(1);
- _testObj = (MethodSpec)mapping.getRoleMappingElement();
-
+ _testObj = (MethodSpec)mapping.getRoleMappingElement();
+
ASTNode actual = _testObj.getParent();
assertTrue(
"ParentNode has wrong Type, Should be CalloutMappingDeclaration",
actual instanceof CalloutMappingDeclaration );
}
-
+
public void testGetParent_InstanceType2()
{
CallinMappingDeclaration mapping = (CallinMappingDeclaration)_role.bodyDeclarations().get(7);
- _testObj = (MethodSpec)mapping.getRoleMappingElement();
-
+ _testObj = (MethodSpec)mapping.getRoleMappingElement();
+
ASTNode actual = _testObj.getParent();
assertTrue(
"ParentNode has wrong Type. Should be CallinMappingDeclaration",
actual instanceof CallinMappingDeclaration );
}
-
+
public void testGetName1()
{
CalloutMappingDeclaration mapping = (CalloutMappingDeclaration)_role.bodyDeclarations().get(1);
_testObj = (MethodSpec)mapping.getRoleMappingElement();
String actual = _testObj.getName().getIdentifier();
-
+
assertEquals("MethodSpec has wrong name ",
"roleGetString",
actual);
}
-
+
public void testResolveBinding_roleMethSpec()
- {
+ {
CallinMappingDeclaration mapping = (CallinMappingDeclaration)_role.bodyDeclarations().get(7);
MethodDeclaration methDecl = (MethodDeclaration)_role.bodyDeclarations().get(6);
-
+
_testObj = (MethodSpec)mapping.getRoleMappingElement();
-
+
IMethodBinding expected = methDecl.resolveBinding();
IMethodBinding actual = _testObj.resolveBinding();
-
+
assertEquals(expected, actual);
}
-
+
public void testResolveBinding_baseMethSpec()
- {
+ {
CallinMappingDeclaration mapping = (CallinMappingDeclaration)_role.bodyDeclarations().get(7);
-
+
_testObj = (MethodSpec)mapping.getBaseMappingElements().get(0);
-
+
// Note: more than one createAST call causes that bindings resolved from one
- // AST won't be equal to ones resolved from the other AST. Se we can't compare
+ // AST won't be equal to ones resolved from the other AST. Se we can't compare
// bindings from _base with ones from _role. Instead, navigate the bindings within
// one AST.
@@ -233,7 +233,7 @@ public class MethodSpecTest extends FileBasedDOMTest
break;
}
}
-
+
IMethodBinding expected = baseMethodBinding;
assertNotNull(expected);
IMethodBinding actual = _testObj.resolveBinding();
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/ParameterMappingCallinTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/ParameterMappingCallinTest.java
index 0b922ad17..acf9a0e69 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/ParameterMappingCallinTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/ParameterMappingCallinTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -41,9 +41,9 @@ import org.eclipse.objectteams.otdt.ui.tests.dom.FileBasedDOMTest;
* @author ike
*
* Tests the DOM-astNode parameterMapping.
- *
+ *
*/
-public class ParameterMappingCallinTest extends FileBasedDOMTest
+public class ParameterMappingCallinTest extends FileBasedDOMTest
{
public static final String TEST_PROJECT = "DOM_AST";
private static final int JAVA_LANGUAGE_SPEC_LEVEL = AST.JLS4;
@@ -51,9 +51,9 @@ public class ParameterMappingCallinTest extends FileBasedDOMTest
private ASTParser _parser;
private ICompilationUnit _simpleTeam;
private TypeDeclaration _typeDecl;
- private TypeDeclaration _role;
-
- public ParameterMappingCallinTest(String name)
+ private TypeDeclaration _role;
+
+ public ParameterMappingCallinTest(String name)
{
super(name);
}
@@ -62,14 +62,14 @@ public class ParameterMappingCallinTest extends FileBasedDOMTest
{
return new Suite(ParameterMappingCallinTest.class);
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir(TEST_PROJECT);
super.setUpSuite();
}
- protected void setUp() throws Exception
+ protected void setUp() throws Exception
{
super.setUp();
_simpleTeam = getCompilationUnit(
@@ -77,83 +77,83 @@ public class ParameterMappingCallinTest extends FileBasedDOMTest
"src",
"parameterMapping.teampkg",
"MyTeam.java");
-
+
_parser = ASTParser.newParser(JAVA_LANGUAGE_SPEC_LEVEL);
_parser.setProject(super.getJavaProject(TEST_PROJECT));
_parser.setSource(_simpleTeam);
-
+
ASTNode root = _parser.createAST( new NullProgressMonitor() );
CompilationUnit compUnit = (CompilationUnit) root;
_typeDecl = (TypeDeclaration)compUnit.types().get(0);
-
+
//this role contains only callinBindings
_role = _typeDecl.getTypes()[1];
}
-
+
//test is for first callinMapping in Testdata (Role)
public void testGetParameterMappings_notEmpty1()
{
CallinMappingDeclaration callinDecl = (CallinMappingDeclaration)_role.bodyDeclarations().get(3);
List mappings = callinDecl.getParameterMappings();
-
+
assertNotNull("ParametermappingList should be not empty", mappings);
assertFalse(mappings.isEmpty());
- }
-
+ }
+
//test is for first callinMapping in Testdata (Role)
public void testHasResultFlag_true1()
{
CallinMappingDeclaration callinDecl = (CallinMappingDeclaration)_role.bodyDeclarations().get(3);
List parameterMappings = callinDecl.getParameterMappings();
-
+
//test the second parameterMapping of this CalloutMappingDeclaration
ParameterMapping testObj = (ParameterMapping)parameterMappings.get(1);
boolean actual = testObj.hasResultFlag();
-
+
assertTrue("Mapping is a result mapping, but was not detected", actual);
- }
+ }
//test is for second callinMapping in Testdata (Role)
public void testGetParameterMappings_notEmpty2()
{
CallinMappingDeclaration callinDecl = (CallinMappingDeclaration)_role.bodyDeclarations().get(4);
List mappings = callinDecl.getParameterMappings();
-
+
assertNotNull("ParametermappingList should be not empty", mappings);
assertFalse(mappings.isEmpty());
- }
-
+ }
+
//test is for fourth calloutMapping in Testdata (Role)
public void testHasResultFlag_true2()
{
CallinMappingDeclaration callinDecl = (CallinMappingDeclaration)_role.bodyDeclarations().get(4);
List parameterMappings = callinDecl.getParameterMappings();
-
+
//test the second parameterMapping of this CalloutMappingDeclaration
ParameterMapping testObj = (ParameterMapping)parameterMappings.get(1);
boolean actual = testObj.hasResultFlag();
-
+
assertTrue("Mapping is a result mapping, but was not detected", actual);
- }
+ }
public void testSubTreeMatch1()
{
CallinMappingDeclaration callinDecl = (CallinMappingDeclaration)_role.bodyDeclarations().get(4);
List parameterMappings = callinDecl.getParameterMappings();
ParameterMapping testObj = (ParameterMapping)parameterMappings.get(1);
-
+
boolean actual = testObj.subtreeMatch(new ASTMatcher(), testObj);
assertTrue("Both nodes are equal, even the same.", actual);
}
-
+
public void testCopySubtree()
{
CallinMappingDeclaration callinDecl = (CallinMappingDeclaration)_role.bodyDeclarations().get(4);
List parameterMappings = callinDecl.getParameterMappings();
ParameterMapping testObj = (ParameterMapping)parameterMappings.get(1);
- ParameterMapping clonedTestObject =
+ ParameterMapping clonedTestObject =
(ParameterMapping)ASTNode.copySubtree(AST.newAST(AST.JLS4), testObj);
boolean actual = testObj.subtreeMatch(new ASTMatcher(), clonedTestObject);
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/ParameterMappingCalloutTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/ParameterMappingCalloutTest.java
index 7428c3bfa..3491ebcd2 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/ParameterMappingCalloutTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/ParameterMappingCalloutTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -45,9 +45,9 @@ import org.eclipse.objectteams.otdt.ui.tests.dom.FileBasedDOMTest;
* @author ike
*
* Tests the DOM-astNode parameterMapping.
- *
+ *
*/
-public class ParameterMappingCalloutTest extends FileBasedDOMTest
+public class ParameterMappingCalloutTest extends FileBasedDOMTest
{
public static final String TEST_PROJECT = "DOM_AST";
private static final int JAVA_LANGUAGE_SPEC_LEVEL = AST.JLS4;
@@ -56,8 +56,8 @@ public class ParameterMappingCalloutTest extends FileBasedDOMTest
private ICompilationUnit _simpleTeam;
private TypeDeclaration _typeDecl;
private TypeDeclaration _role;
-
- public ParameterMappingCalloutTest(String name)
+
+ public ParameterMappingCalloutTest(String name)
{
super(name);
}
@@ -66,14 +66,14 @@ public class ParameterMappingCalloutTest extends FileBasedDOMTest
{
return new Suite(ParameterMappingCalloutTest.class);
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir(TEST_PROJECT);
super.setUpSuite();
}
- protected void setUp() throws Exception
+ protected void setUp() throws Exception
{
super.setUp();
_simpleTeam = getCompilationUnit(
@@ -81,17 +81,17 @@ public class ParameterMappingCalloutTest extends FileBasedDOMTest
"src",
"parameterMapping.teampkg",
"MyTeam.java");
-
+
_parser = ASTParser.newParser(JAVA_LANGUAGE_SPEC_LEVEL);
_parser.setProject(super.getJavaProject(TEST_PROJECT));
_parser.setSource(_simpleTeam);
-
+
ASTNode root = _parser.createAST( new NullProgressMonitor() );
CompilationUnit compUnit = (CompilationUnit) root;
_typeDecl = (TypeDeclaration)compUnit.types().get(0);
_role = _typeDecl.getTypes()[0];
}
-
+
//test is for first calloutMapping in Testdata (Role)
public void testGetParameterMappings_notEmpty()
{
@@ -99,34 +99,34 @@ public class ParameterMappingCalloutTest extends FileBasedDOMTest
CalloutMappingDeclaration calloutDecl = (CalloutMappingDeclaration)_role.bodyDeclarations().get(4);
List mappings = calloutDecl.getParameterMappings();
-
+
assertNotNull("ParametermappingList should be not empty", mappings);
assertFalse(mappings.isEmpty());
- }
-
+ }
+
//test is for first calloutMapping in Testdata (Role)
public void testGetDirection()
{
CalloutMappingDeclaration calloutDecl = (CalloutMappingDeclaration)_role.bodyDeclarations().get(4);
List parameterMappings = calloutDecl.getParameterMappings();
-
+
ParameterMapping testObj = (ParameterMapping)parameterMappings.get(0);
String actual = testObj.getDirection();
String expected = "->";
-
+
assertEquals("Wrong direction", expected, actual);
}
-
+
//test is for first calloutMapping in Testdata (Role)
public void testGetIdentifier()
{
CalloutMappingDeclaration calloutDecl = (CalloutMappingDeclaration)_role.bodyDeclarations().get(4);
List parameterMappings = calloutDecl.getParameterMappings();
-
+
ParameterMapping testObj = (ParameterMapping)parameterMappings.get(0);
String actual = testObj.getIdentifier().getIdentifier();
String expected = "val";
-
+
assertEquals("Identifier is wrong", expected, actual);
}
@@ -135,43 +135,43 @@ public class ParameterMappingCalloutTest extends FileBasedDOMTest
{
CalloutMappingDeclaration calloutDecl = (CalloutMappingDeclaration)_role.bodyDeclarations().get(4);
List parameterMappings = calloutDecl.getParameterMappings();
-
+
ParameterMapping testObj = (ParameterMapping)parameterMappings.get(0);
Expression actual = (Expression)testObj.getExpression();
-
+
assertTrue(
- "Wrong Type of given expression, type is " + actual.getClass(),
+ "Wrong Type of given expression, type is " + actual.getClass(),
actual instanceof MethodInvocation);
- }
-
+ }
+
//test is for second calloutMapping in Testdata (Role)
public void testGetExpression_InstanceType2()
{
CalloutMappingDeclaration calloutDecl = (CalloutMappingDeclaration)_role.bodyDeclarations().get(5);
List parameterMappings = calloutDecl.getParameterMappings();
-
+
ParameterMapping testObj = (ParameterMapping)parameterMappings.get(0);
Expression actual = (Expression)testObj.getExpression();
-
+
assertTrue(
- "Wrong Type of given expression, type is " + actual.getClass(),
+ "Wrong Type of given expression, type is " + actual.getClass(),
actual instanceof ClassInstanceCreation);
- }
+ }
//test is for fourth calloutMapping in Testdata (Role)
public void testGetExpression_InstanceType3()
{
CalloutMappingDeclaration calloutDecl = (CalloutMappingDeclaration)_role.bodyDeclarations().get(7);
List parameterMappings = calloutDecl.getParameterMappings();
-
+
ParameterMapping testObj = (ParameterMapping)parameterMappings.get(0);
Expression actual = (Expression)testObj.getExpression();
-
+
assertTrue(
- "Wrong Type of given expression, type is " + actual.getClass(),
+ "Wrong Type of given expression, type is " + actual.getClass(),
actual instanceof SimpleName);
- }
-
+ }
+
//test is for third calloutMapping in Testdata (Role)
public void testValidMappingListSize()
{
@@ -187,10 +187,10 @@ public class ParameterMappingCalloutTest extends FileBasedDOMTest
{
CalloutMappingDeclaration calloutDecl = (CalloutMappingDeclaration)_role.bodyDeclarations().get(4);
List parameterMappings = calloutDecl.getParameterMappings();
-
+
ParameterMapping testObj = (ParameterMapping)parameterMappings.get(0);
boolean actual = testObj.hasResultFlag();
-
+
assertFalse("Mapping is a not a result mapping", actual);
}
@@ -199,11 +199,11 @@ public class ParameterMappingCalloutTest extends FileBasedDOMTest
{
CalloutMappingDeclaration calloutDecl = (CalloutMappingDeclaration)_role.bodyDeclarations().get(6);
List parameterMappings = calloutDecl.getParameterMappings();
-
+
//test the second parameterMapping of this CalloutMappingDeclaration
ParameterMapping testObj = (ParameterMapping)parameterMappings.get(1);
boolean actual = testObj.hasResultFlag();
-
+
assertTrue("Mapping is a result mapping, but was not detected", actual);
}
@@ -212,13 +212,13 @@ public class ParameterMappingCalloutTest extends FileBasedDOMTest
{
CalloutMappingDeclaration calloutDecl = (CalloutMappingDeclaration)_role.bodyDeclarations().get(7);
List parameterMappings = calloutDecl.getParameterMappings();
-
+
//test the third parameterMapping of this CalloutMappingDeclaration
ParameterMapping testObj = (ParameterMapping)parameterMappings.get(2);
boolean actual = testObj.hasResultFlag();
-
+
assertTrue("Mapping is a result mapping, but was not detected", actual);
- }
+ }
//test is for fourth calloutMapping in Testdata (Role)
public void testValidMappingListSize1()
{
@@ -227,19 +227,19 @@ public class ParameterMappingCalloutTest extends FileBasedDOMTest
int expected = 3;
assertEquals("ParameterMappingList has wrong size", expected, actual);
- }
-
+ }
+
//test is for fourth calloutMapping in Testdata (Role)
public void testSubTreeMatch()
{
CalloutMappingDeclaration calloutDecl = (CalloutMappingDeclaration)_role.bodyDeclarations().get(7);
List parameterMappings = calloutDecl.getParameterMappings();
ParameterMapping testObj = (ParameterMapping)parameterMappings.get(2);
-
+
boolean actual = testObj.subtreeMatch(new ASTMatcher(), testObj);
assertTrue("Both nodes are equal, even the same.", actual);
- }
+ }
public void testCopySubtree()
{
@@ -247,7 +247,7 @@ public class ParameterMappingCalloutTest extends FileBasedDOMTest
List parameterMappings = calloutDecl.getParameterMappings();
ParameterMapping testObj = (ParameterMapping)parameterMappings.get(2);
- ParameterMapping clonedTestObject =
+ ParameterMapping clonedTestObject =
(ParameterMapping)ASTNode.copySubtree(AST.newAST(AST.JLS4), testObj);
boolean actual = testObj.subtreeMatch(new ASTMatcher(), clonedTestObject);
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/PrecedenceDeclarationTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/PrecedenceDeclarationTest.java
index 4a3e10967..828a3f55b 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/PrecedenceDeclarationTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/PrecedenceDeclarationTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -41,7 +41,7 @@ import org.eclipse.objectteams.otdt.ui.tests.dom.FileBasedDOMTest;
public class PrecedenceDeclarationTest extends FileBasedDOMTest
{
public static final String TEST_PROJECT = "DOM_AST";
-
+
private static final int JAVA_LANGUAGE_SPEC_LEVEL = AST.JLS9;
private ASTParser _parser;
@@ -55,12 +55,12 @@ public class PrecedenceDeclarationTest extends FileBasedDOMTest
{
super(name);
}
-
+
public static Test suite()
{
return new Suite(PrecedenceDeclarationTest.class);
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir(TEST_PROJECT);
@@ -74,13 +74,13 @@ public class PrecedenceDeclarationTest extends FileBasedDOMTest
_parser = ASTParser.newParser(JAVA_LANGUAGE_SPEC_LEVEL);
_parser.setProject( getJavaProject(TEST_PROJECT) );
_parser.setSource(_simpleTeam);
-
+
ASTNode root = _parser.createAST( new NullProgressMonitor() );
_cu = (CompilationUnit) root;
_typeDecl = (TypeDeclaration)_cu.types().get(0);
}
- protected void setUp() throws Exception
+ protected void setUp() throws Exception
{
super.setUp();
}
@@ -91,7 +91,7 @@ public class PrecedenceDeclarationTest extends FileBasedDOMTest
List<?> precedences = role1.precedences();
assertFalse("precedences are non-null", precedences == null);
assertTrue("Role1 has 3 precedence lists", precedences.size() == 3);
-
+
PrecedenceDeclaration prec;
prec = (PrecedenceDeclaration)precedences.get(0);
List<?> elements = prec.elements();
@@ -122,7 +122,7 @@ public class PrecedenceDeclarationTest extends FileBasedDOMTest
List<?> precedences = _typeDecl.precedences();
assertFalse("precedences are non-null", precedences == null);
assertTrue("Team2 has 2 precedence lists", precedences.size() == 2);
-
+
PrecedenceDeclaration prec;
prec = (PrecedenceDeclaration)precedences.get(0);
List<?> elements = prec.elements();
@@ -136,7 +136,7 @@ public class PrecedenceDeclarationTest extends FileBasedDOMTest
List<?> precedences = _typeDecl.precedences();
assertFalse("precedences are non-null", precedences == null);
assertTrue("Team2 has 2 precedence lists", precedences.size() == 2);
-
+
PrecedenceDeclaration prec;
prec = (PrecedenceDeclaration)precedences.get(1);
List<?> elements = prec.elements();
@@ -145,13 +145,13 @@ public class PrecedenceDeclarationTest extends FileBasedDOMTest
assertEquals("expecting element", elements.get(0).toString(), "Role2");
assertEquals("expecting element", elements.get(1).toString(), "Role1");
}
-
+
public void testPrecedenceFlattening() {
ASTRewriteFlattener _rewriteFlattener = new ASTRewriteFlattener(new RewriteEventStore());
_cu.accept(_rewriteFlattener);
String actual = _rewriteFlattener.getResult();
- String expected =
+ String expected =
"package precedences.teampkg;"+
"import precedences.basepkg.MyClass;"+
"public team class Team1 {"+
@@ -170,11 +170,11 @@ public class PrecedenceDeclarationTest extends FileBasedDOMTest
"precedence callin3, callin2;" +
"precedence after callinA3, callinA2;"+
"}"+
- "public class Role2 {}"+
+ "public class Role2 {}"+
"precedence Role1.callin2, Role1.callin1;"+
"precedence Role2, Role1;"+
"}";
-
+
assertEquals("Wrong CU-Code", expected, actual);
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/RoleTypeDeclarationTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/RoleTypeDeclarationTest.java
index 40792f820..3b3bc9c86 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/RoleTypeDeclarationTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/RoleTypeDeclarationTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -47,31 +47,31 @@ public class RoleTypeDeclarationTest extends FileBasedDOMTest
{
public static final String TEST_PROJECT = "DOM_AST";
private static final int JAVA_LANGUAGE_SPEC_LEVEL = AST.JLS4;
-
+
private ASTParser _parser;
private ICompilationUnit _simpleTeam;
private TypeDeclaration _typeDecl;
private TypeDeclaration _testObj1;
- private TypeDeclaration _testObj2;
- private TypeDeclaration _testObj3;
-
- public RoleTypeDeclarationTest(String name)
+ private TypeDeclaration _testObj2;
+ private TypeDeclaration _testObj3;
+
+ public RoleTypeDeclarationTest(String name)
{
super(name);
}
-
+
public static Test suite()
{
return new Suite(RoleTypeDeclarationTest.class);
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir(TEST_PROJECT);
super.setUpSuite();
}
-
- protected void setUp() throws Exception
+
+ protected void setUp() throws Exception
{
super.setUp();
_simpleTeam = getCompilationUnit(
@@ -79,11 +79,11 @@ public class RoleTypeDeclarationTest extends FileBasedDOMTest
"src",
"roleTypeDeclaration.teampkg",
"MyTeam.java");
-
+
_parser = ASTParser.newParser(JAVA_LANGUAGE_SPEC_LEVEL);
_parser.setProject(super.getJavaProject(TEST_PROJECT));
_parser.setSource(_simpleTeam);
-
+
ASTNode root = _parser.createAST( new NullProgressMonitor() );
CompilationUnit compUnit = (CompilationUnit) root;
_typeDecl = (TypeDeclaration)compUnit.types().get(0);
@@ -91,102 +91,102 @@ public class RoleTypeDeclarationTest extends FileBasedDOMTest
_testObj2 = _typeDecl.getTypes()[1];
_testObj3 = _typeDecl.getTypes()[2];
}
-
+
public void testInstanceTypes()
{
assertTrue("First role was not detected as RoleTypeDeclaration",_testObj1 instanceof RoleTypeDeclaration);
assertTrue("Second role was not detected as RoleTypeDeclaration",_testObj2 instanceof RoleTypeDeclaration);
assertTrue("Third role was not detected as RoleTypeDeclaration",_testObj3 instanceof RoleTypeDeclaration);
}
-
+
//test for first Role in roleTypeDeclaration.teampkg.MyTeam
public void testIsTeam1()
{
boolean actual = _testObj1.isTeam();
-
+
assertFalse("This RoleTypeDeclaration is not a Team.", actual);
}
-
- //test for second Role in roleTypeDeclaration.teampkg.MyTeam
+
+ //test for second Role in roleTypeDeclaration.teampkg.MyTeam
public void testIsTeam2()
{
boolean actual = _testObj2.isTeam();
-
+
assertTrue("This RoleTypeDeclaration is a Team.", actual);
}
-
- //test for third Role in roleTypeDeclaration.teampkg.MyTeam
+
+ //test for third Role in roleTypeDeclaration.teampkg.MyTeam
public void testIsTeam3()
{
boolean actual = _testObj3.isTeam();
-
+
assertFalse("This RoleTypeDeclaration is not a Team.", actual);
- }
-
-
+ }
+
+
//test for first Role in roleTypeDeclaration.teampkg.MyTeam
public void testGetBase1_notNull()
{
Type baseClass = ((RoleTypeDeclaration)_testObj1).getBaseClassType();
-
+
assertNotNull("RoleTypeDeclaration !!!has!!! a BaseClass.", baseClass);
}
-
- //test for second Role in roleTypeDeclaration.teampkg.MyTeam
+
+ //test for second Role in roleTypeDeclaration.teampkg.MyTeam
public void testGetBase2_notNull()
{
Type baseClass = ((RoleTypeDeclaration)_testObj2).getBaseClassType();
-
+
assertNotNull("RoleTypeDeclaration !!!has!!! a BaseClass.", baseClass);
}
-
- //test for third Role in roleTypeDeclaration.teampkg.MyTeam
+
+ //test for third Role in roleTypeDeclaration.teampkg.MyTeam
public void testGetBase3_Null()
{
Type baseClass = ((RoleTypeDeclaration)_testObj3).getBaseClassType();
-
+
assertNull("RoleTypeDeclaration !!!hasn't!!! a BaseClass.", baseClass);
- }
-
+ }
+
//test for first Role in roleTypeDeclaration.teampkg.MyTeam
public void testGetTeam1_notNull()
{
Type teamClass = ((RoleTypeDeclaration)_testObj1).getTeamClassType();
-
+
assertNotNull("RoleTypeDeclaration !!!has!!! a TeamClass.", teamClass);
}
-
- //test for second Role in roleTypeDeclaration.teampkg.MyTeam
+
+ //test for second Role in roleTypeDeclaration.teampkg.MyTeam
public void testGetTeam2_notNull()
{
Type teamClass = ((RoleTypeDeclaration)_testObj2).getTeamClassType();
-
+
assertNotNull("RoleTypeDeclaration !!!has!!! a TeamClass.", teamClass);
}
-
- //test for third Role in roleTypeDeclaration.teampkg.MyTeam
+
+ //test for third Role in roleTypeDeclaration.teampkg.MyTeam
public void testGetTeam3_notNull()
{
Type teamClass = ((RoleTypeDeclaration)_testObj3).getTeamClassType();
-
+
assertNotNull("RoleTypeDeclaration !!!hasn't!!! a TeamClass.", teamClass);
- }
+ }
//test for first Role in roleTypeDeclaration.teampkg.MyTeam
public void testGetCallOuts1_notEmpty()
{
CalloutMappingDeclaration[] callouts = ((RoleTypeDeclaration)_testObj1).getCallOuts();
- boolean isEmpty = callouts.length == 0;
-
+ boolean isEmpty = callouts.length == 0;
+
assertFalse("List of CalloutMappingDeclaration isn't empty", isEmpty);
}
-
+
//test for third Role in roleTypeDeclaration.teampkg.MyTeam
public void testGetCallOuts3_isEmpty()
{
CalloutMappingDeclaration[] callouts = ((RoleTypeDeclaration)_testObj3).getCallOuts();
- boolean isEmpty = callouts.length == 0;
-
+ boolean isEmpty = callouts.length == 0;
+
assertTrue("List of CalloutMappingDeclaration is empty", isEmpty);
}
@@ -194,17 +194,17 @@ public class RoleTypeDeclarationTest extends FileBasedDOMTest
public void testGetCallIns2_notEmpty()
{
CallinMappingDeclaration[] callins = ((RoleTypeDeclaration)_testObj2).getCallIns();
- boolean isEmpty = callins.length == 0;
-
+ boolean isEmpty = callins.length == 0;
+
assertFalse("List of CallinMappingDeclaration isn't empty", isEmpty);
}
-
+
//test for third Role in roleTypeDeclaration.teampkg.MyTeam
public void testGetCallIns3_isEmpty()
{
CallinMappingDeclaration[] callins = ((RoleTypeDeclaration)_testObj3).getCallIns();
- boolean isEmpty = callins.length == 0;
-
+ boolean isEmpty = callins.length == 0;
+
assertTrue("List of CallinMappingDeclaration is empty", isEmpty);
}
@@ -213,15 +213,15 @@ public class RoleTypeDeclarationTest extends FileBasedDOMTest
boolean actual = _testObj1.subtreeMatch(new ASTMatcher(), _testObj1);
assertTrue("Both nodes are equal, even the same.", actual);
- }
-
+ }
+
public void testCopySubtree1()
{
- RoleTypeDeclaration clonedTestObject =
+ RoleTypeDeclaration clonedTestObject =
(RoleTypeDeclaration)ASTNode.copySubtree(AST.newAST(AST.JLS4), _testObj1);
boolean actual = _testObj1.subtreeMatch(new ASTMatcher(), clonedTestObject);
-
+
assertTrue("Copy of subtree not correct", actual);
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/TSuperConstructorInvocationTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/TSuperConstructorInvocationTest.java
index 4476d0c45..f5a588ecf 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/TSuperConstructorInvocationTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/TSuperConstructorInvocationTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -60,20 +60,20 @@ public class TSuperConstructorInvocationTest extends FileBasedDOMTest
private MethodDeclaration _constructor1;
private Statement _tsuper0;
private Statement _tsuper1;
-
-
+
+
private TSuperConstructorInvocation _testObj;
public TSuperConstructorInvocationTest(String name)
{
super(name);
}
-
+
public static Test suite()
{
return new Suite(TSuperConstructorInvocationTest.class);
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir(TEST_PROJECT);
@@ -87,8 +87,8 @@ public class TSuperConstructorInvocationTest extends FileBasedDOMTest
parser.setProject( getJavaProject(TEST_PROJECT) );
parser.setSource(_teamClass);
parser.setResolveBindings(true);
-
- ASTNode root = parser.createAST( new NullProgressMonitor() );
+
+ ASTNode root = parser.createAST( new NullProgressMonitor() );
CompilationUnit compUnit = (CompilationUnit) root;
_typeDecl = (TypeDeclaration)compUnit.types().get(0);
@@ -100,12 +100,12 @@ public class TSuperConstructorInvocationTest extends FileBasedDOMTest
}
- protected void setUp() throws Exception
+ protected void setUp() throws Exception
{
super.setUp();
}
-
+
public void testInstanceType1()
{
assertTrue("tsuper call not an instance of TSuperConstructorInvocation",
@@ -121,21 +121,21 @@ public class TSuperConstructorInvocationTest extends FileBasedDOMTest
public void testNodeType1()
{
_testObj = (TSuperConstructorInvocation)_tsuper1;
-
+
int actual = _testObj.getNodeType();
-
+
assertEquals("tsuper call has wrong node type",
ASTNode.TSUPER_CONSTRUCTOR_INVOCATION,
actual);
}
-
+
public void testGetArguments2_TwoArgs()
{
_testObj = (TSuperConstructorInvocation)_tsuper1;
-
+
List actual = _testObj.getArguments();
-
+
assertEquals("tsuper call has wrong number of arguments",
2,
actual.size());
@@ -144,9 +144,9 @@ public class TSuperConstructorInvocationTest extends FileBasedDOMTest
public void testGetArguments1_NoArgs()
{
_testObj = (TSuperConstructorInvocation)_tsuper0;
-
+
List actual = _testObj.getArguments();
-
+
assertEquals("tsuper call has wrong number of arguments",
0,
actual.size());
@@ -155,10 +155,10 @@ public class TSuperConstructorInvocationTest extends FileBasedDOMTest
public void testChildNodesHaveCorrectParent1()
{
_testObj = (TSuperConstructorInvocation)_tsuper1;
-
+
List childNodes = _testObj.getArguments();
- for (Iterator iter = childNodes.iterator(); iter.hasNext();)
+ for (Iterator iter = childNodes.iterator(); iter.hasNext();)
{
Expression curChild = (Expression) iter.next();
assertEquals("tsuper call arguments have wrong parent node",
@@ -167,34 +167,34 @@ public class TSuperConstructorInvocationTest extends FileBasedDOMTest
}
}
-
+
public void testSubtreeMatch1()
{
_testObj = (TSuperConstructorInvocation)_tsuper1;
-
+
boolean actual = _testObj.subtreeMatch(new ASTMatcher(), _testObj);
assertTrue("tsuper call message sends don't match", actual);
-
+
}
public void testToString1()
{
_testObj = (TSuperConstructorInvocation)_tsuper1;
-
+
String actual = _testObj.toString();
String expected = "tsuper(arg0, arg1)";
-
+
assertEquals(
"tsuper call message send: wrong naive flat string representation",
- expected,
+ expected,
actual);
}
-
+
public void testResolveBinding()
{
_testObj = (TSuperConstructorInvocation)_tsuper1;
-
+
ITypeBinding itb = _typeDecl.resolveBinding();
ITypeBinding tsuperRoleClass = null;
for (ITypeBinding role : itb.getSuperclass().getDeclaredTypes()) {
@@ -206,11 +206,11 @@ public class TSuperConstructorInvocationTest extends FileBasedDOMTest
assertNotNull("tsuper Role not found", tsuperRoleClass);
IMethodBinding tSuperConstructor =
tsuperRoleClass.getDeclaredMethods()[1];
-
+
IMethodBinding expected = tSuperConstructor;
IMethodBinding actual = _testObj.resolveConstructorBinding();
assertEquals(expected, actual);
}
-
-
+
+
} \ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/TSuperMessageSendTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/TSuperMessageSendTest.java
index c420dc957..08ad67146 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/TSuperMessageSendTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/TSuperMessageSendTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -65,12 +65,12 @@ public class TSuperMessageSendTest extends FileBasedDOMTest
{
super(name);
}
-
+
public static Test suite()
{
return new Suite(TSuperMessageSendTest.class);
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir(TEST_PROJECT);
@@ -84,8 +84,8 @@ public class TSuperMessageSendTest extends FileBasedDOMTest
parser.setProject( getJavaProject(TEST_PROJECT) );
parser.setSource(_teamClass);
parser.setResolveBindings(true);
-
- ASTNode root = parser.createAST( new NullProgressMonitor() );
+
+ ASTNode root = parser.createAST( new NullProgressMonitor() );
CompilationUnit compUnit = (CompilationUnit) root;
_typeDecl = (TypeDeclaration)compUnit.types().get(0);
_role = _typeDecl.getTypes()[0];
@@ -93,19 +93,19 @@ public class TSuperMessageSendTest extends FileBasedDOMTest
_roleMethod1 = _role.getMethods()[3];
}
- protected void setUp() throws Exception
+ protected void setUp() throws Exception
{
super.setUp();
}
-
+
public void testInstanceType1()
{
ExpressionStatement exprStatement =
(ExpressionStatement)_roleMethod0.getBody().statements().get(0);
Expression testObj = exprStatement.getExpression();
-
+
assertTrue("tsuper call not an instance of TSuperMessageSend",
testObj instanceof TSuperMessageSend);
}
@@ -116,7 +116,7 @@ public class TSuperMessageSendTest extends FileBasedDOMTest
(ExpressionStatement)_roleMethod1.getBody().statements().get(0);
Expression testObj = exprStatement.getExpression();
-
+
assertTrue("tsuper call not an instance of TSuperMessageSend",
testObj instanceof TSuperMessageSend);
}
@@ -126,9 +126,9 @@ public class TSuperMessageSendTest extends FileBasedDOMTest
ExpressionStatement exprStatement =
(ExpressionStatement)_roleMethod0.getBody().statements().get(0);
_testObj = (TSuperMessageSend)exprStatement.getExpression();
-
+
int actual = _testObj.getNodeType();
-
+
assertEquals("tsuper call has wrong node type",
ASTNode.TSUPER_MESSAGE_SEND,
actual);
@@ -141,20 +141,20 @@ public class TSuperMessageSendTest extends FileBasedDOMTest
_testObj = (TSuperMessageSend)exprStatement.getExpression();
String actual = _testObj.getName().getIdentifier();
-
+
assertEquals("tsuper call has wrong name ",
"method0",
actual);
}
-
+
public void testGetArguments2_TwoArgs()
{
ExpressionStatement exprStatement =
(ExpressionStatement)_roleMethod1.getBody().statements().get(0);
_testObj = (TSuperMessageSend)exprStatement.getExpression();
-
+
List actual = _testObj.getArguments();
-
+
assertEquals("tsuper call has wrong number of arguments",
2,
actual.size());
@@ -165,9 +165,9 @@ public class TSuperMessageSendTest extends FileBasedDOMTest
ExpressionStatement exprStatement =
(ExpressionStatement)_roleMethod0.getBody().statements().get(0);
_testObj = (TSuperMessageSend)exprStatement.getExpression();
-
+
List actual = _testObj.getArguments();
-
+
assertEquals("tsuper call has wrong number of arguments",
0,
actual.size());
@@ -178,10 +178,10 @@ public class TSuperMessageSendTest extends FileBasedDOMTest
ExpressionStatement exprStatement =
(ExpressionStatement)_roleMethod1.getBody().statements().get(0);
_testObj = (TSuperMessageSend)exprStatement.getExpression();
-
+
List childNodes = _testObj.getArguments();
- for (Iterator iter = childNodes.iterator(); iter.hasNext();)
+ for (Iterator iter = childNodes.iterator(); iter.hasNext();)
{
Expression curChild = (Expression) iter.next();
assertEquals("tsuper call arguments have wrong parent node",
@@ -190,15 +190,15 @@ public class TSuperMessageSendTest extends FileBasedDOMTest
}
}
-
+
public void testChidlNodeHaveCorrectParrent2()
{
ExpressionStatement exprStatement =
(ExpressionStatement)_roleMethod1.getBody().statements().get(0);
_testObj = (TSuperMessageSend)exprStatement.getExpression();
-
+
SimpleName childNode = _testObj.getName();
-
+
assertEquals("tsuper call selector has wrong parent",
_testObj,
childNode.getParent());
@@ -209,11 +209,11 @@ public class TSuperMessageSendTest extends FileBasedDOMTest
ExpressionStatement exprStatement =
(ExpressionStatement)_roleMethod1.getBody().statements().get(0);
_testObj = (TSuperMessageSend)exprStatement.getExpression();
-
+
boolean actual = _testObj.subtreeMatch(new ASTMatcher(), _testObj);
assertTrue("tsuper call message sends don't match", actual);
-
+
}
public void testToString1()
@@ -221,21 +221,21 @@ public class TSuperMessageSendTest extends FileBasedDOMTest
ExpressionStatement exprStatement =
(ExpressionStatement)_roleMethod1.getBody().statements().get(0);
_testObj = (TSuperMessageSend)exprStatement.getExpression();
-
+
String actual = _testObj.toString();
String expected = "tsuper.method1(arg0, arg1)";
-
+
assertEquals("tsuper call message send: wrong naive flat string representation",
expected, actual);
}
-
+
public void testResolveBinding()
{
ExpressionStatement exprStatement =
(ExpressionStatement)_roleMethod1.getBody().statements().get(0);
-
+
_testObj = (TSuperMessageSend)exprStatement.getExpression();
-
+
ITypeBinding itb = _typeDecl.resolveBinding();
IMethodBinding expected = null;
// don't access method via index since bindings are sorted by the compiler
@@ -247,17 +247,17 @@ public class TSuperMessageSendTest extends FileBasedDOMTest
}
}
assertNotNull("tsuper Role not found", tsuperRoleClass);
- for (IMethodBinding tSuperMethod: tsuperRoleClass.getDeclaredMethods())
+ for (IMethodBinding tSuperMethod: tsuperRoleClass.getDeclaredMethods())
{
if (tSuperMethod.getName().equals("method1")) {
expected = tSuperMethod;
break;
- }
+ }
}
-
+
IMethodBinding actual = _testObj.resolveMethodBinding();
-
+
assertEquals(expected, actual);
}
-
+
} \ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/WithinStatementTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/WithinStatementTest.java
index b8295082c..279ee0ac1 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/WithinStatementTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/WithinStatementTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -62,12 +62,12 @@ public class WithinStatementTest extends FileBasedDOMTest
{
super(name);
}
-
+
public static Test suite()
{
return new Suite(WithinStatementTest.class);
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir(TEST_PROJECT);
@@ -87,7 +87,7 @@ public class WithinStatementTest extends FileBasedDOMTest
_typeDecl = (TypeDeclaration)compUnit.types().get(0);
}
- protected void setUp() throws Exception
+ protected void setUp() throws Exception
{
super.setUp();
}
@@ -99,28 +99,28 @@ public class WithinStatementTest extends FileBasedDOMTest
WithinStatementTest.getMethodDeclarationByName(_typeDecl,
"withinSimple");
List statements = methodDecl.getBody().statements();
-
+
Statement testObj = (Statement) statements.get(0);
assertTrue("Statement is not an instance of WithinStatement",
testObj instanceof WithinStatement);
}
-
+
public void testGetNodeType()
{
MethodDeclaration methodDecl =
WithinStatementTest.getMethodDeclarationByName(_typeDecl,
"withinSimple");
List statements = methodDecl.getBody().statements();
-
+
_testObj = (WithinStatement) statements.get(0);
-
+
assertEquals(
"WithinStatement has wrong NodeType",
- ASTNode.WITHIN_STATEMENT,
+ ASTNode.WITHIN_STATEMENT,
_testObj.getNodeType());
}
-
+
public void testGetBody_Empty()
{
MethodDeclaration methodDecl =
@@ -128,14 +128,14 @@ public class WithinStatementTest extends FileBasedDOMTest
"withinSimpleEmptyBody");
List statements = methodDecl.getBody().statements();
Statement firstStatement = (Statement) statements.get(0);
-
+
_testObj = (WithinStatement) firstStatement;
assertTrue(
"withing: body block is not empty",
((Block)_testObj.getBody()).statements().isEmpty());
}
-
+
public void testGetBody_NotEmpty()
{
MethodDeclaration methodDecl =
@@ -149,7 +149,7 @@ public class WithinStatementTest extends FileBasedDOMTest
assertEquals("within: body block is empty",
1, ((Block)_testObj.getBody()).statements().size());
}
-
+
public void testBody_ParentIdentity()
{
MethodDeclaration methodDecl = WithinStatementTest.getMethodDeclarationByName(_typeDecl, "withinSimple");
@@ -159,11 +159,11 @@ public class WithinStatementTest extends FileBasedDOMTest
_testObj = (WithinStatement) firstStatement;
Block body = (Block)_testObj.getBody();
ASTNode bodyParent = body.getParent();
-
+
assertTrue("within: ", _testObj == bodyParent );
-
+
}
-
+
/** Tests if body belong to the same AST as the within statement */
public void testBody_ASTIdentity()
{
@@ -175,7 +175,7 @@ public class WithinStatementTest extends FileBasedDOMTest
Block body = (Block)_testObj.getBody();
assertTrue(
- "within: body (Block) doesn't belong to AST",
+ "within: body (Block) doesn't belong to AST",
_testObj.getAST() == body.getAST() );
}
@@ -218,7 +218,7 @@ public class WithinStatementTest extends FileBasedDOMTest
assertTrue("within: Team expression is not a ClassInstanceCreation",
_testObj.getTeamExpression() instanceof ClassInstanceCreation);
}
-
+
public void testGetTeamExpression2_InstanceType()
{
MethodDeclaration methodDecl = WithinStatementTest.getMethodDeclarationByName(_typeDecl, "withinSimple");
@@ -238,11 +238,11 @@ public class WithinStatementTest extends FileBasedDOMTest
Statement firstStatement = (Statement)statements.get(0);
_testObj = (WithinStatement) firstStatement;
-
+
assertTrue("within: Team expression is not a SimpleName",
_testObj.getTeamExpression() instanceof MethodInvocation);
}
-
+
public void testGetTeamExpression_Parent()
{
MethodDeclaration methodDecl = WithinStatementTest.getMethodDeclarationByName(_typeDecl, "withinNewTeam");
@@ -264,11 +264,11 @@ public class WithinStatementTest extends FileBasedDOMTest
_testObj = (WithinStatement) firstStatement;
ClassInstanceCreation teamExpression = (ClassInstanceCreation)_testObj.getTeamExpression();
-
+
assertEquals("within: Team expression is not a SimpleName",
"new Team1()", teamExpression.toString());
}
-
+
public void testGetTeamExpression_Identifier2()
{
MethodDeclaration methodDecl = WithinStatementTest.getMethodDeclarationByName(_typeDecl, "withinSimple");
@@ -277,7 +277,7 @@ public class WithinStatementTest extends FileBasedDOMTest
_testObj = (WithinStatement) firstStatement;
SimpleName teamExpression = (SimpleName)_testObj.getTeamExpression();
-
+
assertEquals("within: Team expression is not a SimpleName",
"myTeam", teamExpression.toString());
}
@@ -291,17 +291,17 @@ public class WithinStatementTest extends FileBasedDOMTest
_testObj = (WithinStatement) statements.get(0);
String actual = _testObj.toString();
- String expected =
+ String expected =
"within(new Team1()) {\n"+
" foo();\n"+
"}\n";
-
+
assertEquals(
"within statement: wrong naive flat string representation",
- expected,
+ expected,
actual);
}
-
+
public void testSubtreeMatch1()
{
MethodDeclaration methodDecl = WithinStatementTest.getMethodDeclarationByName(_typeDecl, "withinNewTeam");
@@ -313,32 +313,32 @@ public class WithinStatementTest extends FileBasedDOMTest
assertTrue("Within statements don't match", actual);
}
-
+
/**
* Helper method to find the named MethodDeclaration
* in the given TypeDeclaration.
- *
+ *
* @return the found MethodDeclaration or null
*/
private static MethodDeclaration getMethodDeclarationByName(TypeDeclaration type, String name)
{
MethodDeclaration[] methods = type.getMethods();
int numberOfMethods = methods.length;
-
+
if (numberOfMethods == 0)
{
return null;
}
-
+
for (int idx = 0; idx < numberOfMethods; idx++)
{
if (name.equals(methods[idx].getName().getIdentifier()))
{
return methods[idx];
}
-
+
}
-
+
return null; // method not found
};
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/ASTRewriteFlattenerTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/ASTRewriteFlattenerTest.java
index fe0454d4d..9838ed74c 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/ASTRewriteFlattenerTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/ASTRewriteFlattenerTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -57,422 +57,422 @@ import org.eclipse.jdt.internal.core.dom.rewrite.RewriteEventStore;
* @author ikeman
*/
public class ASTRewriteFlattenerTest extends TestCase {
-
+
public static final String TEST_PROJECT = "DOM_AST";
private static final int JAVA_LANGUAGE_SPEC_LEVEL = AST.JLS4;
-
-
+
+
private ASTRewriteFlattener _rewriteFlattener;
private AST _newAst;
private RewriteEventStore _store;
-
+
public ASTRewriteFlattenerTest(String name)
{
super(name);
}
-
- protected void setUp() throws Exception
+
+ protected void setUp() throws Exception
{
super.setUp();
_store = new RewriteEventStore();
_rewriteFlattener = new ASTRewriteFlattener(_store);
_newAst = AST.newAST(JAVA_LANGUAGE_SPEC_LEVEL);
}
-
+
public void testNewCuCreation()
{
PackageDeclaration newPack = _newAst.newPackageDeclaration();
newPack.setName(_newAst.newQualifiedName(_newAst.newSimpleName("testmain"), _newAst.newSimpleName("testsub")));
-
+
ImportDeclaration newImport = _newAst.newImportDeclaration();
newImport.setName(_newAst.newQualifiedName(_newAst.newSimpleName("testpackage"), _newAst.newSimpleName("TestClass")));
newImport.setOnDemand(false);
List importList = new ArrayList();
importList.add(newImport);
-
+
CompilationUnit newCU = createCU(newPack, importList, null);
-
+
newCU.accept(_rewriteFlattener);
String actual = _rewriteFlattener.getResult();
String expected = "package testmain.testsub;import testpackage.TestClass;";
-
+
assertEquals("Wrong CU-Code", expected, actual);
}
public void testNewTeamCreation()
{
- TypeDeclaration newTypeDecl = createTeam(null, (Modifier.PUBLIC | Modifier.OT_TEAM),
- false, false, "GeneratedClass", null, null, null);
-
+ TypeDeclaration newTypeDecl = createTeam(null, (Modifier.PUBLIC | Modifier.OT_TEAM),
+ false, false, "GeneratedClass", null, null, null);
+
newTypeDecl.accept(_rewriteFlattener);
-
+
String actual = _rewriteFlattener.getResult();
String expected = "public team class GeneratedClass {}";
-
+
assertEquals("Wrong TeamCode", expected, actual);
}
-
+
public void testNewRoleCreation()
{
-
- RoleTypeDeclaration role = createRole(null, 1, "GeneratedRoleClass", "GeneratedBaseClass",
+
+ RoleTypeDeclaration role = createRole(null, 1, "GeneratedRoleClass", "GeneratedBaseClass",
"GeneratedTeamClass", null, null , false, null);
-
+
role.accept(_rewriteFlattener);
-
+
String actual = _rewriteFlattener.getResult();
String expected = "public class GeneratedRoleClass playedBy GeneratedBaseClass {}";
-
+
assertEquals("Wrong RoleCode", expected, actual);
}
public void testNewParameterMappingCreation()
{
MethodInvocation methodInv = (MethodInvocation)createExpression("integer", "intValue");
- ParameterMapping newParameterMapping =
+ ParameterMapping newParameterMapping =
createParameterMapping(methodInv, "value", "->", false);
newParameterMapping.accept(_rewriteFlattener);
-
+
String actual = _rewriteFlattener.getResult();
String expected = "integer.intValue() -> value";
-
+
assertEquals("Wrong ParameterMappingCode", expected, actual);
}
-
+
public void testNewParameterMappingCreation1()
{
SimpleName argumentName = _newAst.newSimpleName("val");
List arguments = new ArrayList();
arguments.add(argumentName);
-
+
ClassInstanceCreation cIC = (ClassInstanceCreation)createExpression(null,"Integer", arguments, null);
- ParameterMapping newParameterMapping =
+ ParameterMapping newParameterMapping =
createParameterMapping(cIC, "integer", "->",false);
newParameterMapping.accept(_rewriteFlattener);
-
+
String actual = _rewriteFlattener.getResult();
String expected = "new Integer(val) -> integer";
-
+
assertEquals("Wrong ParameterMappingCode", expected, actual);
}
public void testNewCalloutMappingCreation()
{
//Callout - roleMethodSpec - Parameter
- SingleVariableDeclaration roleMethodSpecParameter =
+ SingleVariableDeclaration roleMethodSpecParameter =
createMethodParameter(0, "Integer", null, "integer", 0, null);
List roleMethodParameters = new ArrayList();
roleMethodParameters.add(roleMethodSpecParameter);
-
+
//Callout - roleMethodSpec
MethodSpec roleMethodSpec = createMethodSpec("roleMethod0", PrimitiveType.VOID, roleMethodParameters, true);
-
+
//Callout - baseMethodSpec - Parameter
- SingleVariableDeclaration baseMethodSpecParameter =
+ SingleVariableDeclaration baseMethodSpecParameter =
createMethodParameter(0, null, PrimitiveType.INT, "value", 0, null);
List baseMethodParameters = new ArrayList();
baseMethodParameters.add(baseMethodSpecParameter);
-
+
//Callout - baseMethodSpec
MethodSpec baseMethodSpec = createMethodSpec("baseMethod0", PrimitiveType.VOID, baseMethodParameters, true);
-
- //Callout - ParameterMapping
+
+ //Callout - ParameterMapping
MethodInvocation methodInv = (MethodInvocation)createExpression("integer", "intValue");
- ParameterMapping newParameterMapping =
+ ParameterMapping newParameterMapping =
createParameterMapping(methodInv, "value", "->", false);
List parameterMappingList = new ArrayList();
parameterMappingList.add(newParameterMapping);
-
+
//build CalloutMapping
CalloutMappingDeclaration newCalloutMapping = createCalloutMapping(null, 0, roleMethodSpec, baseMethodSpec, parameterMappingList, false, true);
-
+
newCalloutMapping.accept(_rewriteFlattener);
-
+
String actual = _rewriteFlattener.getResult();
- String expected =
+ String expected =
"void roleMethod0(Integer integer) -> void baseMethod0(int value) with {\n" +
" integer.intValue() -> value\n" +
"}";
-
+
assertEquals("Wrong CalloutMappingCode", expected, actual);
}
-
+
public void testNewCalloutMappingCreation1()
{
//Callout - roleMethodSpec
MethodSpec roleMethodSpec = createMethodSpec("roleMethod3", PrimitiveType.INT, null, false);
-
+
//Callout - baseMethodSpec(s)
MethodSpec baseMethodSpec = createMethodSpec("baseMethod3", PrimitiveType.INT, null, false);
//build CalloutMapping
CalloutMappingDeclaration newCalloutMapping = createCalloutMapping(null, 0, roleMethodSpec, baseMethodSpec, null, false, false);
-
+
newCalloutMapping.accept(_rewriteFlattener);
-
+
String actual = _rewriteFlattener.getResult();
String expected = "roleMethod3 -> baseMethod3;";
-
+
assertEquals("Wrong CalloutMappingCode", expected, actual);
}
-
+
public void testNewCalloutMappingCreation2()
{
//Callout - roleMethodSpec
MethodSpec roleMethodSpec = createMethodSpec("getTestString", PrimitiveType.VOID, null, false);
-
+
//Callout - baseMethodSpec
FieldAccessSpec newFieldAcc = createFieldAccSpec("_string", PrimitiveType.VOID, null, false);
-
+
//build CalloutMapping
CalloutMappingDeclaration newCalloutMapping = createCalloutMapping(null, 0, roleMethodSpec, newFieldAcc, null, false, false);
newCalloutMapping.bindingOperator().setBindingModifier(Modifier.OT_GET_CALLOUT);
-
+
newCalloutMapping.accept(_rewriteFlattener);
-
+
String actual = _rewriteFlattener.getResult();
String expected = "getTestString -> get _string;";
-
+
assertEquals("Wrong CalloutMappingCode", expected, actual);
- }
-
+ }
+
public void testNewCalloutMappingCreation3()
{
//Callout - roleMethodSpec - Parameter
- SingleVariableDeclaration roleMethodSpecParameter =
+ SingleVariableDeclaration roleMethodSpecParameter =
createMethodParameter(0, "Integer", null, "i", 0, null);
List roleMethodParameters = new ArrayList();
roleMethodParameters.add(roleMethodSpecParameter);
-
-
+
+
//Callout - roleMethodSpec
MethodSpec roleMethodSpec = createMethodSpec("setTestInteger", PrimitiveType.VOID, roleMethodParameters, true);
-
+
//Callout - baseMethodSpec
FieldAccessSpec newFieldAcc = createFieldAccSpec("_integer", null, "Integer", true);
-
+
//build CalloutMapping
CalloutMappingDeclaration newCalloutMapping = createCalloutMapping(null, 0, roleMethodSpec, newFieldAcc, null, false, true);
newCalloutMapping.bindingOperator().setBindingModifier(Modifier.OT_SET_CALLOUT);
-
+
newCalloutMapping.accept(_rewriteFlattener);
-
+
String actual = _rewriteFlattener.getResult();
String expected = "void setTestInteger(Integer i) -> set Integer _integer;";
-
+
assertEquals("Wrong CalloutMappingCode", expected, actual);
}
-
+
public void testNewCallinMappingCreation()
{
int callinMappingModifier = Modifier.OT_REPLACE_CALLIN;
-
+
//Callin - roleMethodSpec - Parameter
- SingleVariableDeclaration roleMethodSpecParameter =
+ SingleVariableDeclaration roleMethodSpecParameter =
createMethodParameter(0, "Integer", null, "roleInteger", 0, null);
List roleMethodParameters = new ArrayList();
roleMethodParameters.add(roleMethodSpecParameter);
-
+
//Callin - roleMethodSpec
MethodSpec roleMethodSpec = createMethodSpec("roleMethod1", PrimitiveType.INT, roleMethodParameters, true);
-
+
//Callin - baseMethodSpec - Parameter
- SingleVariableDeclaration baseMethodSpecParameter =
+ SingleVariableDeclaration baseMethodSpecParameter =
createMethodParameter(0, "Integer", null, "integer", 0, null);
List baseMethodParameters = new ArrayList();
baseMethodParameters.add(baseMethodSpecParameter);
-
+
//Callin - baseMethodSpec(s)
MethodSpec baseMethodSpec = createMethodSpec("baseMethod1", PrimitiveType.INT, baseMethodParameters, true);
List baseMethods = new ArrayList();
baseMethods.add(baseMethodSpec);
-
+
//Callin - ParameterMapping
SimpleName expressionName1 = (SimpleName)createExpression("integer");
- ParameterMapping newParameterMappingInt =
+ ParameterMapping newParameterMappingInt =
createParameterMapping(expressionName1, "roleInteger", "<-", false);
-
+
SimpleName expressionName2 = (SimpleName)createExpression("result");
- ParameterMapping newParameterMappingRes =
+ ParameterMapping newParameterMappingRes =
createParameterMapping(expressionName2, "result", "->", true);
List paramMappings = new ArrayList();
paramMappings.add(newParameterMappingInt);
paramMappings.add(newParameterMappingRes);
-
+
//build CallinMapping
CallinMappingDeclaration newCallinMapping = createCallinMappingDeclaration(null, callinMappingModifier, roleMethodSpec, baseMethods, paramMappings);
-
+
newCallinMapping.accept(_rewriteFlattener);
-
+
String actual = _rewriteFlattener.getResult();
- String expected =
+ String expected =
"int roleMethod1(Integer roleInteger) <- replace int baseMethod1(Integer integer) with {\n"+
- " roleInteger <- integer,\n"+
+ " roleInteger <- integer,\n"+
" result -> result\n" +
"}";
-
+
assertEquals("Wrong CallinMappingCode", expected, actual);
}
-
+
public void testNewCallinMappingCreation1()
{
//Callin - roleMethodSpec
MethodSpec roleMethodSpec = createMethodSpec("roleMethod2", PrimitiveType.INT, null, false);
-
+
//Callin - baseMethodSpec(s)
MethodSpec baseMethodSpec = createMethodSpec("baseMethod2", PrimitiveType.INT, null, false);
List baseMethods = new ArrayList();
baseMethods.add(baseMethodSpec);
-
+
//build CallinMapping
CallinMappingDeclaration newCallinMapping = createCallinMappingDeclaration(null, Modifier.OT_BEFORE_CALLIN, roleMethodSpec, baseMethods, null);
-
+
newCallinMapping.accept(_rewriteFlattener);
-
+
String actual = _rewriteFlattener.getResult();
String expected = "roleMethod2 <- before baseMethod2;";
-
+
assertEquals("Wrong CallinMappingCode", expected, actual);
}
-
+
public void testNewFieldAccSpecCreation()
{
FieldAccessSpec newFieldAcc = createFieldAccSpec("_string", PrimitiveType.VOID, null, false);
-
+
newFieldAcc.accept(_rewriteFlattener);
-
+
String actual = _rewriteFlattener.getResult();
String expected = "_string";
-
+
assertEquals("Wrong FieldAccSpecCode", expected, actual);
}
-
+
public void testNewFieldAccSpecCreation1()
{
FieldAccessSpec newFieldAcc = createFieldAccSpec("_integer", null,"Integer", true);
-
+
newFieldAcc.accept(_rewriteFlattener);
-
+
String actual = _rewriteFlattener.getResult();
String expected = "Integer _integer";
-
+
assertEquals("Wrong FieldAccSpecCode", expected, actual);
}
-
+
public void testNewFullyCuCreation()
{
PackageDeclaration newPack = _newAst.newPackageDeclaration();
newPack.setName(_newAst.newQualifiedName(_newAst.newSimpleName("testmain"), _newAst.newSimpleName("testsub")));
-
+
ImportDeclaration newImport = _newAst.newImportDeclaration();
newImport.setName(_newAst.newQualifiedName(_newAst.newSimpleName("testpackage"), _newAst.newSimpleName("TestClass")));
newImport.setOnDemand(false);
List importList = new ArrayList();
importList.add(newImport);
-
-
+
+
int callinMappingModifier = Modifier.OT_REPLACE_CALLIN;
-
+
//Callin - roleMethodSpec - Parameter
- SingleVariableDeclaration roleMethodSpecParameter =
+ SingleVariableDeclaration roleMethodSpecParameter =
createMethodParameter(0, "Integer", null, "roleInteger", 0, null);
List roleMethodParameters = new ArrayList();
roleMethodParameters.add(roleMethodSpecParameter);
-
+
//Callin - roleMethodSpec
MethodSpec roleMethodSpec = createMethodSpec("roleMethod1", PrimitiveType.INT, roleMethodParameters, true);
-
+
//Callin - baseMethodSpec - Parameter
- SingleVariableDeclaration baseMethodSpecParameter =
+ SingleVariableDeclaration baseMethodSpecParameter =
createMethodParameter(0, "Integer", null, "integer", 0, null);
List baseMethodParameters = new ArrayList();
baseMethodParameters.add(baseMethodSpecParameter);
-
+
//Callin - baseMethodSpec(s)
MethodSpec baseMethodSpec = createMethodSpec("baseMethod1", PrimitiveType.INT, baseMethodParameters, true);
List baseMethods = new ArrayList();
baseMethods.add(baseMethodSpec);
-
+
//Callin - ParameterMapping
SimpleName expressionName1 = (SimpleName)createExpression("integer");
- ParameterMapping newParameterMappingInt =
+ ParameterMapping newParameterMappingInt =
createParameterMapping(expressionName1, "roleInteger", "<-", false);
-
+
SimpleName expressionName2 = (SimpleName)createExpression("result");
- ParameterMapping newParameterMappingRes =
+ ParameterMapping newParameterMappingRes =
createParameterMapping(expressionName2, "result", "->", true);
List paramMappings = new ArrayList();
paramMappings.add(newParameterMappingInt);
paramMappings.add(newParameterMappingRes);
-
+
//build CallinMapping
CallinMappingDeclaration newCallinMapping = createCallinMappingDeclaration(null, callinMappingModifier, roleMethodSpec, baseMethods, paramMappings);
List roleBodyDecl = new ArrayList();
roleBodyDecl.add(newCallinMapping);
-
- RoleTypeDeclaration role = createRole(null, 1, "GeneratedRoleClass", "GeneratedBaseClass",
+
+ RoleTypeDeclaration role = createRole(null, 1, "GeneratedRoleClass", "GeneratedBaseClass",
"GeneratedTeamClass", null, null , false, roleBodyDecl);
List typeBodyDecl = new ArrayList();
typeBodyDecl.add(role);
-
- TypeDeclaration newTypeDecl = createTeam(null, (Modifier.PUBLIC | Modifier.OT_TEAM),
+
+ TypeDeclaration newTypeDecl = createTeam(null, (Modifier.PUBLIC | Modifier.OT_TEAM),
false, false, "GeneratedClass", null, null, typeBodyDecl);
List typeList = new ArrayList();
typeList.add(newTypeDecl);
CompilationUnit newCU = createCU(newPack, importList, typeList);
-
+
newCU.accept(_rewriteFlattener);
String cUString ="package testmain.testsub;import testpackage.TestClass;public team class GeneratedClass {";
String roleString = "public class GeneratedRoleClass playedBy GeneratedBaseClass {";
String bodyDeclString = "int roleMethod1(Integer roleInteger) <- replace int baseMethod1(Integer integer)";
- String paramMappingString =
+ String paramMappingString =
" with {\n" +
" roleInteger <- integer,\n" +
" result -> result\n" +
"}}}";
-
+
String actual = _rewriteFlattener.getResult();
String expected = cUString + roleString + bodyDeclString + paramMappingString;
-
+
assertEquals("Wrong CU-Code", expected, actual);
}
-
-
+
+
// form here there are only HELPER - METHODS
-
+
private CompilationUnit createCU(PackageDeclaration pack, List importList, List typeList)
{
CompilationUnit newCU = _newAst.newCompilationUnit();
-
+
if (pack != null)
newCU.setPackage(pack);
-
+
if (importList != null && importList.size()!= 0)
{
List cuImportList = newCU.imports();
for (int idx = 0; idx < importList.size(); idx++)
{
ImportDeclaration tmp = (ImportDeclaration)importList.get(idx);
- cuImportList.add(tmp);
+ cuImportList.add(tmp);
}
}
-
+
if (typeList != null && typeList.size()!= 0)
{
List cuTypeList = newCU.types();
for (int idx = 0; idx < typeList.size(); idx++)
{
TypeDeclaration tmp = (TypeDeclaration)typeList.get(idx);
- cuTypeList.add(tmp);
+ cuTypeList.add(tmp);
}
}
return newCU;
}
-
+
private TypeDeclaration createTeam(Javadoc javadoc, int modifiers, boolean isInterface, boolean isRole,
String teamClassName, String superClassName, List superInterfaces, List bodyDeclarations)
{
@@ -486,16 +486,16 @@ public class ASTRewriteFlattenerTest extends TestCase {
if (javadoc != null)
newTypeDecl.setJavadoc(javadoc);
- if (superClassName != null)
+ if (superClassName != null)
newTypeDecl.setSuperclass(_newAst.newSimpleName(superClassName));
-
+
if (superInterfaces != null && superInterfaces.size()!= 0)
{
List superInterfacesList = newTypeDecl.superInterfaces();
for (int idx = 0; idx < superInterfaces.size(); idx++)
{
SimpleName tmp = (SimpleName)superInterfaces.get(idx);
- superInterfacesList.add(tmp);
+ superInterfacesList.add(tmp);
}
}
@@ -505,40 +505,40 @@ public class ASTRewriteFlattenerTest extends TestCase {
for (int idx = 0; idx < bodyDeclarations.size(); idx++)
{
Object tmp = bodyDeclarations.get(idx);
- bodyDeclarationList.add(tmp);
+ bodyDeclarationList.add(tmp);
}
}
return newTypeDecl;
}
-
- private RoleTypeDeclaration createRole(Javadoc javadoc, int modifier, String roleName, String baseClassName,
+
+ private RoleTypeDeclaration createRole(Javadoc javadoc, int modifier, String roleName, String baseClassName,
String teamClassName, String superClassName, List superInterfaces, boolean isTeam,
List bodyDeclarations)
{
RoleTypeDeclaration role = _newAst.newRoleTypeDeclaration();
-
+
role.modifiers().addAll(_newAst.newModifiers(modifier));
role.setName(_newAst.newSimpleName(roleName));
role.setTeamClassType(_newAst.newSimpleType((_newAst.newSimpleName(teamClassName))));
role.setTeam(isTeam);
- role.setRole(true);
+ role.setRole(true);
if (javadoc != null)
role.setJavadoc(javadoc);
-
- if (baseClassName != null)
+
+ if (baseClassName != null)
role.setBaseClassType(_newAst.newSimpleType(_newAst.newSimpleName(baseClassName)));
-
- if (superClassName != null)
+
+ if (superClassName != null)
role.setSuperclass(_newAst.newSimpleName(superClassName));
-
+
if (superInterfaces != null && superInterfaces.size()!= 0)
{
List superInterfacesList = role.superInterfaceTypes();
for (int idx = 0; idx < superInterfaces.size(); idx++)
{
SimpleName tmp = (SimpleName)superInterfaces.get(idx);
- superInterfacesList.add(tmp);
+ superInterfacesList.add(tmp);
}
}
@@ -548,7 +548,7 @@ public class ASTRewriteFlattenerTest extends TestCase {
for (int idx = 0; idx < bodyDeclarations.size(); idx++)
{
Object tmp = bodyDeclarations.get(idx);
- bodyDeclarationList.add(tmp);
+ bodyDeclarationList.add(tmp);
}
}
return role;
@@ -560,10 +560,10 @@ public class ASTRewriteFlattenerTest extends TestCase {
CallinMappingDeclaration newCallinMapping = _newAst.newCallinMappingDeclaration();
newCallinMapping.setCallinModifier(callinModifier);
newCallinMapping.setRoleMappingElement(roleMethod);
-
+
if (javadoc != null)
newCallinMapping.setJavadoc(javadoc);
-
+
if (baseMethods != null && baseMethods.size()!= 0)
{
List baseMappingList = newCallinMapping.getBaseMappingElements();
@@ -579,50 +579,50 @@ public class ASTRewriteFlattenerTest extends TestCase {
for (int idx = 0; idx < paramMappings.size(); idx++)
{
ParameterMapping tmp = (ParameterMapping)paramMappings.get(idx);
- parameterMappingList.add(tmp);
+ parameterMappingList.add(tmp);
}
}
return newCallinMapping;
}
-
+
private CalloutMappingDeclaration createCalloutMapping(Javadoc javadoc, int modifier, MethodSpec roleMethod,
MethodMappingElement baseMethod, List paramMappings, boolean calloutOverride, boolean signatureFlag)
{
CalloutMappingDeclaration newCalloutMapping = _newAst.newCalloutMappingDeclaration();
-
+
if (javadoc != null)
newCalloutMapping.setJavadoc(javadoc);
-
+
newCalloutMapping.modifiers().addAll(_newAst.newModifiers(modifier));
newCalloutMapping.setSignatureFlag(signatureFlag);
newCalloutMapping.setRoleMappingElement(roleMethod);
newCalloutMapping.setBaseMappingElement(baseMethod);
if (calloutOverride)
newCalloutMapping.bindingOperator().setBindingKind(MethodBindingOperator.KIND_CALLOUT_OVERRIDE);
-
+
if (paramMappings != null && paramMappings.size()!= 0)
{
List parameterMapping = newCalloutMapping.getParameterMappings();
for (int idx = 0; idx < paramMappings.size(); idx++)
{
ParameterMapping tmp = (ParameterMapping)paramMappings.get(idx);
- parameterMapping.add(tmp);
+ parameterMapping.add(tmp);
}
}
return newCalloutMapping;
}
-
+
private FieldAccessSpec createFieldAccSpec(String fieldName, PrimitiveType.Code simpleType, String type, boolean hasSignature)
{
FieldAccessSpec newFieldAcc = _newAst.newFieldAccessSpec();
newFieldAcc.setName(_newAst.newSimpleName(fieldName));
-
+
if (simpleType!= null)
newFieldAcc.setFieldType(_newAst.newPrimitiveType(simpleType));
-
+
if (type!= null)
newFieldAcc.setFieldType(_newAst.newSimpleType(_newAst.newSimpleName(type)));
-
+
newFieldAcc.setSignatureFlag(hasSignature);
return newFieldAcc;
}
@@ -633,43 +633,43 @@ public class ASTRewriteFlattenerTest extends TestCase {
methodSpec.setName(_newAst.newSimpleName(methodName));
methodSpec.setReturnType2(_newAst.newPrimitiveType(returnType));
methodSpec.setSignatureFlag(signatureFlag);
-
+
if (parameters!=null && parameters.size()!=0)
{
List methodParameters = methodSpec.parameters();
for (int idx = 0; idx < parameters.size(); idx++)
{
VariableDeclaration tmp = (VariableDeclaration)parameters.get(idx);
- methodParameters.add(tmp);
+ methodParameters.add(tmp);
}
}
return methodSpec;
}
-
+
private SingleVariableDeclaration createMethodParameter(int modifier, String parameterType, PrimitiveType.Code primitiveType, String parameterName, int dimension,
Expression initializer)
{
SingleVariableDeclaration methodSpecParameter = _newAst.newSingleVariableDeclaration();
methodSpecParameter.modifiers().addAll(_newAst.newModifiers(modifier));
-
+
if(primitiveType!= null)
{
PrimitiveType primitiveRoleParameterType = _newAst.newPrimitiveType(primitiveType);
methodSpecParameter.setType(primitiveRoleParameterType);
}
-
+
if (parameterType!= null)
{
SimpleType simpleRoleParameterType = _newAst.newSimpleType(_newAst.newSimpleName(parameterType));
methodSpecParameter.setType(simpleRoleParameterType);
}
-
+
methodSpecParameter.setName(_newAst.newSimpleName(parameterName));
methodSpecParameter.setExtraDimensions(dimension);
methodSpecParameter.setInitializer(initializer);
return methodSpecParameter;
}
-
+
private ParameterMapping createParameterMapping(Expression expression, String identName,
String direction, boolean resultFlag)
{
@@ -680,7 +680,7 @@ public class ASTRewriteFlattenerTest extends TestCase {
newParameterMapping.setResultFlag(resultFlag);
return newParameterMapping;
}
-
+
private Expression createExpression(String expressionName, String methodName)
{
MethodInvocation expression = _newAst.newMethodInvocation();
@@ -694,7 +694,7 @@ public class ASTRewriteFlattenerTest extends TestCase {
Expression expression= _newAst.newSimpleName(expressionName);
return expression;
}
-
+
private Expression createExpression(Expression innerExpression, String className,
List arguments, AnonymousClassDeclaration anonymousClass)
{
@@ -709,7 +709,7 @@ public class ASTRewriteFlattenerTest extends TestCase {
for (int idx = 0; idx < arguments.size(); idx++)
{
Expression tmp = (Expression)arguments.get(idx);
- classArguments.add(tmp);
+ classArguments.add(tmp);
}
}
return expression;
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/ASTRewritingModifyingCallinMappingDeclarationTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/ASTRewritingModifyingCallinMappingDeclarationTest.java
index 7da3994b3..7f06b7f2d 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/ASTRewritingModifyingCallinMappingDeclarationTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/ASTRewritingModifyingCallinMappingDeclarationTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -51,15 +51,15 @@ import org.eclipse.text.edits.MalformedTreeException;
@SuppressWarnings("nls")
public class ASTRewritingModifyingCallinMappingDeclarationTest extends ASTRewritingModifyingTest {
private static final Class<?> THIS = ASTRewritingModifyingCallinMappingDeclarationTest.class;
-
+
public ASTRewritingModifyingCallinMappingDeclarationTest(String name) {
super(name);
}
-
+
public static Test allTests() {
return new Suite(THIS);
}
-
+
public static Test suite() {
if (true) {
return allTests();
@@ -68,12 +68,12 @@ public class ASTRewritingModifyingCallinMappingDeclarationTest extends ASTRewrit
suite.addTest(new ASTRewritingModifyingCallinMappingDeclarationTest("test0009"));
return suite;
}
-
+
/**
* add 2 parameter mappings to callinMappingDeclaration without parameter mappings
*/
@SuppressWarnings("unchecked") // callin.getParameterMappings().add(..);
- public void test0001() throws MalformedTreeException, JavaModelException, BadLocationException {
+ public void test0001() throws MalformedTreeException, JavaModelException, BadLocationException {
IPackageFragment pack1= sourceFolder.createPackageFragment("test0001", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0001;\n");
@@ -83,23 +83,23 @@ public class ASTRewritingModifyingCallinMappingDeclarationTest extends ASTRewrit
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
AST ast = astRoot.getAST();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
Expression expression1 = ASTNodeCreator.createExpression(ast,"s1+\"Test\"");
ParameterMapping mapping1 = ASTNodeCreator.createParameterMapping(ast,expression1,ast.newSimpleName("s2"),"<-",false);
-
- CallinMappingDeclaration callin = (CallinMappingDeclaration) role.bodyDeclarations().get(0);
+
+ CallinMappingDeclaration callin = (CallinMappingDeclaration) role.bodyDeclarations().get(0);
callin.getParameterMappings().add(mapping1);
-
+
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0001;\n");
buf.append("public team class Team {\n");
@@ -111,11 +111,11 @@ public class ASTRewritingModifyingCallinMappingDeclarationTest extends ASTRewrit
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
/**
* delete all parameter mappings from callinMappingDeclaration
*/
- public void test0002() throws MalformedTreeException, JavaModelException, BadLocationException {
+ public void test0002() throws MalformedTreeException, JavaModelException, BadLocationException {
IPackageFragment pack1= sourceFolder.createPackageFragment("test0002", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0002;\n");
@@ -127,21 +127,21 @@ public class ASTRewritingModifyingCallinMappingDeclarationTest extends ASTRewrit
buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
-
+
ICompilationUnit cu= pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
CallinMappingDeclaration callin = (CallinMappingDeclaration) role.bodyDeclarations().get(0);
callin.getParameterMappings().remove(1);
callin.getParameterMappings().remove(0);
-
+
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0002;\n");
buf.append("public team class Team {\n");
@@ -149,15 +149,15 @@ public class ASTRewritingModifyingCallinMappingDeclarationTest extends ASTRewrit
buf.append(" String roleMethod(String s1) <- before String baseMethod(String s2);\n");
buf.append(" }\n");
buf.append("}\n");
-
+
assertEqualString(preview, buf.toString());
}
-
+
/**
* add one parameter mapping
*/
@SuppressWarnings("unchecked") // callin.getParameterMappings().add(..);
- public void test0003() throws MalformedTreeException, JavaModelException, BadLocationException {
+ public void test0003() throws MalformedTreeException, JavaModelException, BadLocationException {
IPackageFragment pack1= sourceFolder.createPackageFragment("test0003", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0003;\n");
@@ -168,25 +168,25 @@ public class ASTRewritingModifyingCallinMappingDeclarationTest extends ASTRewrit
buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
-
+
ICompilationUnit cu= pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
AST ast = astRoot.getAST();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
- Expression expression1 = ASTNodeCreator.createExpression(ast,"result+\"addOnString\"");
+ Expression expression1 = ASTNodeCreator.createExpression(ast,"result+\"addOnString\"");
ParameterMapping mapping1 = ASTNodeCreator.createParameterMapping(ast,expression1,ast.newSimpleName("result"),"->",false);
-
- CallinMappingDeclaration callin = (CallinMappingDeclaration) role.bodyDeclarations().get(0);
+
+ CallinMappingDeclaration callin = (CallinMappingDeclaration) role.bodyDeclarations().get(0);
callin.getParameterMappings().add(mapping1);
-
+
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0003;\n");
buf.append("public team class Team {\n");
@@ -197,14 +197,14 @@ public class ASTRewritingModifyingCallinMappingDeclarationTest extends ASTRewrit
buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
-
+
assertEqualString(preview, buf.toString());
}
/**
* change callin modifier
*/
- public void test0004() throws MalformedTreeException, JavaModelException, BadLocationException {
+ public void test0004() throws MalformedTreeException, JavaModelException, BadLocationException {
IPackageFragment pack1= sourceFolder.createPackageFragment("test0004", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0004;\n");
@@ -215,21 +215,21 @@ public class ASTRewritingModifyingCallinMappingDeclarationTest extends ASTRewrit
buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
-
+
ICompilationUnit cu= pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
-
- CallinMappingDeclaration callin = (CallinMappingDeclaration) role.bodyDeclarations().get(0);
+
+ CallinMappingDeclaration callin = (CallinMappingDeclaration) role.bodyDeclarations().get(0);
callin.setCallinModifier(Modifier.OT_AFTER_CALLIN);
-
+
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0004;\n");
buf.append("public team class Team {\n");
@@ -239,19 +239,19 @@ public class ASTRewritingModifyingCallinMappingDeclarationTest extends ASTRewrit
buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
-
+
assertEqualString(preview, buf.toString());
}
-
+
/**
- * change role methodSpec in callinMappingDeclaration
+ * change role methodSpec in callinMappingDeclaration
* @throws JavaModelException
* @throws BadLocationException
* @throws MalformedTreeException
*/
@SuppressWarnings("unchecked") // argList1.add(..)
public void test0005() throws MalformedTreeException, JavaModelException, BadLocationException {
-
+
IPackageFragment pack1= sourceFolder.createPackageFragment("test0005", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0005;\n");
@@ -262,33 +262,33 @@ public class ASTRewritingModifyingCallinMappingDeclarationTest extends ASTRewrit
buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
-
+
ICompilationUnit cu= pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
AST ast = astRoot.getAST();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
- CallinMappingDeclaration callin = (CallinMappingDeclaration) role.bodyDeclarations().get(0);
+ CallinMappingDeclaration callin = (CallinMappingDeclaration) role.bodyDeclarations().get(0);
List<SingleVariableDeclaration> argList1 = new ArrayList<SingleVariableDeclaration>();
argList1.add(ASTNodeCreator.createArgument(ast,0,ASTNodeCreator.createType(ast, "String"),"s1",null));
-
+
MethodSpec methodSpec1 = ASTNodeCreator.createMethodSpec(
ast,
"newRoleMethod",
ASTNodeCreator.createType(ast, "String"),
argList1,
true);
-
+
callin.setRoleMappingElement(methodSpec1);
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0005;\n");
buf.append("public team class Team {\n");
@@ -298,7 +298,7 @@ public class ASTRewritingModifyingCallinMappingDeclarationTest extends ASTRewrit
buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
-
+
assertEqualString(preview, buf.toString());
}
@@ -306,8 +306,8 @@ public class ASTRewritingModifyingCallinMappingDeclarationTest extends ASTRewrit
* add base mapping element (guard present)
*/
@SuppressWarnings("unchecked") // argList1.add(..)
- public void test0006() throws MalformedTreeException, JavaModelException, BadLocationException {
-
+ public void test0006() throws MalformedTreeException, JavaModelException, BadLocationException {
+
IPackageFragment pack1= sourceFolder.createPackageFragment("test0006", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0006;\n");
@@ -318,33 +318,33 @@ public class ASTRewritingModifyingCallinMappingDeclarationTest extends ASTRewrit
buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
-
+
ICompilationUnit cu = pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
AST ast = astRoot.getAST();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
- CallinMappingDeclaration callin = (CallinMappingDeclaration) role.bodyDeclarations().get(0);
+ CallinMappingDeclaration callin = (CallinMappingDeclaration) role.bodyDeclarations().get(0);
List<SingleVariableDeclaration> argList1 = new ArrayList<SingleVariableDeclaration>();
argList1.add(ASTNodeCreator.createArgument(ast,0,ASTNodeCreator.createType(ast, "String"),"s3",null));
-
+
MethodSpec methodSpec1 = ASTNodeCreator.createMethodSpec(
ast,
"fooBaseMethod",
ASTNodeCreator.createType(ast, "String"),
argList1,
true);
-
+
callin.getBaseMappingElements().add(methodSpec1);
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0006;\n");
buf.append("public team class Team {\n");
@@ -354,17 +354,17 @@ public class ASTRewritingModifyingCallinMappingDeclarationTest extends ASTRewrit
buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
-
+
assertEqualString(preview, buf.toString());
}
-
+
/**
* remove first base mapping element
*/
- public void test0007() throws MalformedTreeException, JavaModelException, BadLocationException {
+ public void test0007() throws MalformedTreeException, JavaModelException, BadLocationException {
IPackageFragment pack1= sourceFolder.createPackageFragment("test0007", false, null);
StringBuffer buf= new StringBuffer();
-
+
buf.append("package test0007;\n");
buf.append("public team class Team {\n");
buf.append(" public class Role playedBy Base {\n");
@@ -373,20 +373,20 @@ public class ASTRewritingModifyingCallinMappingDeclarationTest extends ASTRewrit
buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
-
+
ICompilationUnit cu = pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
- CallinMappingDeclaration callin = (CallinMappingDeclaration) role.bodyDeclarations().get(0);
+ CallinMappingDeclaration callin = (CallinMappingDeclaration) role.bodyDeclarations().get(0);
callin.getBaseMappingElements().remove(0);
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0007;\n");
buf.append("public team class Team {\n");
@@ -396,16 +396,16 @@ public class ASTRewritingModifyingCallinMappingDeclarationTest extends ASTRewrit
buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
-
+
assertEqualString(preview, buf.toString());
}
-
-
+
+
/**
* add guard predicate
*/
- public void test0008() throws MalformedTreeException, JavaModelException, BadLocationException {
-
+ public void test0008() throws MalformedTreeException, JavaModelException, BadLocationException {
+
IPackageFragment pack1= sourceFolder.createPackageFragment("test0008", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0008;\n");
@@ -416,25 +416,25 @@ public class ASTRewritingModifyingCallinMappingDeclarationTest extends ASTRewrit
buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
-
+
ICompilationUnit cu = pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
AST ast = astRoot.getAST();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
- CallinMappingDeclaration callin = (CallinMappingDeclaration) role.bodyDeclarations().get(0);
-
+ CallinMappingDeclaration callin = (CallinMappingDeclaration) role.bodyDeclarations().get(0);
+
GuardPredicateDeclaration guard = ASTNodeCreator.createGuardPredicate(ast, /*isBase*/false, ast.newBooleanLiteral(true));
-
+
callin.setGuardPredicate(guard);
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0008;\n");
buf.append("public team class Team {\n");
@@ -444,37 +444,37 @@ public class ASTRewritingModifyingCallinMappingDeclarationTest extends ASTRewrit
buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
-
+
assertEqualString(preview, buf.toString());
}
/**
* remove signatures, 2 base methods.
*/
- public void test0009() throws MalformedTreeException, JavaModelException, BadLocationException {
+ public void test0009() throws MalformedTreeException, JavaModelException, BadLocationException {
IPackageFragment pack1= sourceFolder.createPackageFragment("test0009", false, null);
StringBuffer buf= new StringBuffer();
-
+
buf.append("package test0009;\n");
buf.append("public team class Team {\n");
buf.append(" public class Role playedBy Base {\n");
buf.append(" String roleMethod(String s1) <- before String baseMethod(String s2), String fooBaseMethod(String s3);\n");
buf.append(" }\n");
buf.append("}\n");
-
+
ICompilationUnit cu = pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
- CallinMappingDeclaration callin = (CallinMappingDeclaration) role.bodyDeclarations().get(0);
+ CallinMappingDeclaration callin = (CallinMappingDeclaration) role.bodyDeclarations().get(0);
callin.removeSignatures();
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0009;\n");
buf.append("public team class Team {\n");
@@ -482,17 +482,17 @@ public class ASTRewritingModifyingCallinMappingDeclarationTest extends ASTRewrit
buf.append(" roleMethod <- before baseMethod, fooBaseMethod;\n");
buf.append(" }\n");
buf.append("}\n");
-
+
assertEqualString(preview, buf.toString());
}
/**
* remove signatures, 2 base methods, some arg-lists are empty, w/ linebreaks
*/
- public void test0010() throws MalformedTreeException, JavaModelException, BadLocationException {
+ public void test0010() throws MalformedTreeException, JavaModelException, BadLocationException {
IPackageFragment pack1= sourceFolder.createPackageFragment("test0010", false, null);
StringBuffer buf= new StringBuffer();
-
+
buf.append("package test0010;\n");
buf.append("public team class Team {\n");
buf.append(" public class Role playedBy Base {\n");
@@ -502,20 +502,20 @@ public class ASTRewritingModifyingCallinMappingDeclarationTest extends ASTRewrit
buf.append(" String fooBaseMethod(String s3);\n");
buf.append(" }\n");
buf.append("}\n");
-
+
ICompilationUnit cu = pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
- CallinMappingDeclaration callin = (CallinMappingDeclaration) role.bodyDeclarations().get(0);
+ CallinMappingDeclaration callin = (CallinMappingDeclaration) role.bodyDeclarations().get(0);
callin.removeSignatures();
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0010;\n");
buf.append("public team class Team {\n");
@@ -523,40 +523,40 @@ public class ASTRewritingModifyingCallinMappingDeclarationTest extends ASTRewrit
buf.append(" roleMethod// should keep this comment\n");
buf.append(" <- before\n");
buf.append(" baseMethod,\n");
- buf.append(" fooBaseMethod;\n");
+ buf.append(" fooBaseMethod;\n");
buf.append(" }\n");
buf.append("}\n");
-
+
assertEqualString(preview, buf.toString());
}
/**
* remove signatures, 1 base method, type parameter
*/
- public void test0011() throws MalformedTreeException, JavaModelException, BadLocationException {
+ public void test0011() throws MalformedTreeException, JavaModelException, BadLocationException {
IPackageFragment pack1= sourceFolder.createPackageFragment("test0011", false, null);
StringBuffer buf= new StringBuffer();
-
+
buf.append("package test0011;\n");
buf.append("public team class Team {\n");
buf.append(" public class Role playedBy Base {\n");
buf.append(" <E> String roleMethod(E s1) <- before String baseMethod(String s2);\n");
buf.append(" }\n");
buf.append("}\n");
-
+
ICompilationUnit cu = pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
- CallinMappingDeclaration callin = (CallinMappingDeclaration) role.bodyDeclarations().get(0);
+ CallinMappingDeclaration callin = (CallinMappingDeclaration) role.bodyDeclarations().get(0);
callin.removeSignatures();
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0011;\n");
buf.append("public team class Team {\n");
@@ -564,33 +564,33 @@ public class ASTRewritingModifyingCallinMappingDeclarationTest extends ASTRewrit
buf.append(" roleMethod <- before baseMethod;\n");
buf.append(" }\n");
buf.append("}\n");
-
+
assertEqualString(preview, buf.toString());
}
/**
* add signatures, 2 base methods.
*/
- public void test0012() throws MalformedTreeException, JavaModelException, BadLocationException {
+ public void test0012() throws MalformedTreeException, JavaModelException, BadLocationException {
IPackageFragment pack1= sourceFolder.createPackageFragment("test0012", false, null);
StringBuffer buf= new StringBuffer();
-
+
buf.append("package test0012;\n");
buf.append("public team class Team {\n");
buf.append(" public class Role playedBy Base {\n");
buf.append(" roleMethod <- before baseMethod, fooBaseMethod;\n");
buf.append(" }\n");
buf.append("}\n");
-
+
ICompilationUnit cu = pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
- CallinMappingDeclaration callin = (CallinMappingDeclaration) role.bodyDeclarations().get(0);
+ CallinMappingDeclaration callin = (CallinMappingDeclaration) role.bodyDeclarations().get(0);
addSignature(astRoot.getAST(),
(MethodSpec)callin.getRoleMappingElement(),
"String", new String[] {"String"}, new String[] {"s1"} );
@@ -602,7 +602,7 @@ public class ASTRewritingModifyingCallinMappingDeclarationTest extends ASTRewrit
"String", new String[] {"String", "Object"}, new String[] {"s3", "ignored"} );
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0012;\n");
buf.append("public team class Team {\n");
@@ -610,34 +610,34 @@ public class ASTRewritingModifyingCallinMappingDeclarationTest extends ASTRewrit
buf.append(" String roleMethod(String s1) <- before String baseMethod(String s2), String fooBaseMethod(String s3, Object ignored);\n");
buf.append(" }\n");
buf.append("}\n");
-
+
assertEqualString(preview, buf.toString());
}
/**
* add signatures, 1 base method, type parameter
*/
- public void test0013() throws MalformedTreeException, JavaModelException, BadLocationException {
+ public void test0013() throws MalformedTreeException, JavaModelException, BadLocationException {
IPackageFragment pack1= sourceFolder.createPackageFragment("test0013", false, null);
StringBuffer buf= new StringBuffer();
-
+
buf.append("package test0013;\n");
buf.append("public team class Team {\n");
buf.append(" public class Role playedBy Base {\n");
buf.append(" roleMethod <- before baseMethod;\n");
buf.append(" }\n");
buf.append("}\n");
-
+
ICompilationUnit cu = pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
AST ast = astRoot.getAST();
-
+
astRoot.recordModifications();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
- CallinMappingDeclaration callin = (CallinMappingDeclaration) role.bodyDeclarations().get(0);
+ CallinMappingDeclaration callin = (CallinMappingDeclaration) role.bodyDeclarations().get(0);
MethodSpec roleMethodSpec = (MethodSpec)callin.getRoleMappingElement();
TypeParameter typeParameter = ast.newTypeParameter();
typeParameter.setName(ast.newSimpleName("E"));
@@ -650,7 +650,7 @@ public class ASTRewritingModifyingCallinMappingDeclarationTest extends ASTRewrit
"E", new String[] {"String"}, new String[] {"s2"} );
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0013;\n");
buf.append("public team class Team {\n");
@@ -658,7 +658,7 @@ public class ASTRewritingModifyingCallinMappingDeclarationTest extends ASTRewrit
buf.append(" <E> E roleMethod(String s1) <- before E baseMethod(String s2);\n");
buf.append(" }\n");
buf.append("}\n");
-
+
assertEqualString(preview, buf.toString());
}
@@ -674,4 +674,3 @@ public class ASTRewritingModifyingCallinMappingDeclarationTest extends ASTRewrit
}
}
}
- \ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/ASTRewritingModifyingCalloutMappingDeclarationTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/ASTRewritingModifyingCalloutMappingDeclarationTest.java
index 12b3fe3a6..d6617c9df 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/ASTRewritingModifyingCalloutMappingDeclarationTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/ASTRewritingModifyingCalloutMappingDeclarationTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -50,15 +50,15 @@ import org.eclipse.text.edits.MalformedTreeException;
// TODO(jsv) create own OT package for this test
public class ASTRewritingModifyingCalloutMappingDeclarationTest extends ASTRewritingModifyingTest {
private static final Class THIS = ASTRewritingModifyingCalloutMappingDeclarationTest.class;
-
+
public ASTRewritingModifyingCalloutMappingDeclarationTest(String name) {
super(name);
}
-
+
public static Test allTests() {
return new Suite(THIS);
}
-
+
public static Test suite() {
if (true) {
return allTests();
@@ -67,11 +67,11 @@ public class ASTRewritingModifyingCalloutMappingDeclarationTest extends ASTRewri
suite.addTest(new ASTRewritingModifyingCalloutMappingDeclarationTest("test0009"));
return suite;
}
-
+
/**
* add 2 parameter mappings to calloutMappingDeclaration without parameter mappings
*/
- public void test0001() throws MalformedTreeException, JavaModelException, BadLocationException {
+ public void test0001() throws MalformedTreeException, JavaModelException, BadLocationException {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test0001", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0001;\n");
@@ -81,26 +81,26 @@ public class ASTRewritingModifyingCalloutMappingDeclarationTest extends ASTRewri
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
AST ast = astRoot.getAST();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
Expression expression1 = ASTNodeCreator.createExpression(ast,"s1+\"Test\"");
ParameterMapping mapping1 = ASTNodeCreator.createParameterMapping(ast,expression1,ast.newSimpleName("s2"),"->",false);
- Expression expression2 = ASTNodeCreator.createExpression(ast,"result+\"addOnString\"");
+ Expression expression2 = ASTNodeCreator.createExpression(ast,"result+\"addOnString\"");
ParameterMapping mapping2 = ASTNodeCreator.createParameterMapping(ast,expression2,ast.newSimpleName("result"),"<-",false);
-
- CalloutMappingDeclaration callout = (CalloutMappingDeclaration) role.bodyDeclarations().get(0);
+
+ CalloutMappingDeclaration callout = (CalloutMappingDeclaration) role.bodyDeclarations().get(0);
callout.getParameterMappings().add(mapping1);
callout.getParameterMappings().add(mapping2);
-
+
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0001;\n");
buf.append("public team class Team {\n");
@@ -113,11 +113,11 @@ public class ASTRewritingModifyingCalloutMappingDeclarationTest extends ASTRewri
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
/**
* delete all parameter mappings from calloutMappingDeclaration
*/
- public void test0002() throws MalformedTreeException, JavaModelException, BadLocationException {
+ public void test0002() throws MalformedTreeException, JavaModelException, BadLocationException {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test0002", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0002;\n");
@@ -129,23 +129,23 @@ public class ASTRewritingModifyingCalloutMappingDeclarationTest extends ASTRewri
buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
-
+
ICompilationUnit cu= pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
AST ast = astRoot.getAST();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
CalloutMappingDeclaration callout = (CalloutMappingDeclaration) role.bodyDeclarations().get(0);
callout.getParameterMappings().remove(1);
callout.getParameterMappings().remove(0);
-
+
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0002;\n");
buf.append("public team class Team {\n");
@@ -153,14 +153,14 @@ public class ASTRewritingModifyingCalloutMappingDeclarationTest extends ASTRewri
buf.append(" String roleMethod(String s1) -> String baseMethod(String s2);\n");
buf.append(" }\n");
buf.append("}\n");
-
+
assertEqualString(preview, buf.toString());
}
-
+
/**
* add one parameter mapping
*/
- public void test0003() throws MalformedTreeException, JavaModelException, BadLocationException {
+ public void test0003() throws MalformedTreeException, JavaModelException, BadLocationException {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test0003", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0003;\n");
@@ -171,25 +171,25 @@ public class ASTRewritingModifyingCalloutMappingDeclarationTest extends ASTRewri
buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
-
+
ICompilationUnit cu= pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
AST ast = astRoot.getAST();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
- Expression expression1 = ASTNodeCreator.createExpression(ast,"result+\"addOnString\"");
+ Expression expression1 = ASTNodeCreator.createExpression(ast,"result+\"addOnString\"");
ParameterMapping mapping1 = ASTNodeCreator.createParameterMapping(ast,expression1,ast.newSimpleName("result"),"<-",false);
-
- CalloutMappingDeclaration callout = (CalloutMappingDeclaration) role.bodyDeclarations().get(0);
+
+ CalloutMappingDeclaration callout = (CalloutMappingDeclaration) role.bodyDeclarations().get(0);
callout.getParameterMappings().add(mapping1);
-
+
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0003;\n");
buf.append("public team class Team {\n");
@@ -200,14 +200,14 @@ public class ASTRewritingModifyingCalloutMappingDeclarationTest extends ASTRewri
buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
-
+
assertEqualString(preview, buf.toString());
}
/**
* change callout kind
*/
- public void test0004() throws MalformedTreeException, JavaModelException, BadLocationException {
+ public void test0004() throws MalformedTreeException, JavaModelException, BadLocationException {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test0004", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0004;\n");
@@ -218,23 +218,23 @@ public class ASTRewritingModifyingCalloutMappingDeclarationTest extends ASTRewri
buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
-
+
ICompilationUnit cu= pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
AST ast = astRoot.getAST();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
-
- CalloutMappingDeclaration callout = (CalloutMappingDeclaration) role.bodyDeclarations().get(0);
+
+ CalloutMappingDeclaration callout = (CalloutMappingDeclaration) role.bodyDeclarations().get(0);
callout.bindingOperator().setBindingKind(MethodBindingOperator.KIND_CALLOUT_OVERRIDE);
-
+
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0004;\n");
buf.append("public team class Team {\n");
@@ -244,17 +244,17 @@ public class ASTRewritingModifyingCalloutMappingDeclarationTest extends ASTRewri
buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
-
+
assertEqualString(preview, buf.toString());
}
-
+
/**
- * change role and base methodSpec in calloutMappingDeclaration
+ * change role and base methodSpec in calloutMappingDeclaration
*/
- public void test0005() throws MalformedTreeException, JavaModelException, BadLocationException {
+ public void test0005() throws MalformedTreeException, JavaModelException, BadLocationException {
//FIXME(jsv): Handling of MethodSpecs needs to be implemented in Parser!
//fail("Feature not yet implemented!");
-
+
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test0005", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0005;\n");
@@ -265,45 +265,45 @@ public class ASTRewritingModifyingCalloutMappingDeclarationTest extends ASTRewri
buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
-
+
ICompilationUnit cu= pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
AST ast = astRoot.getAST();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
- CalloutMappingDeclaration callout = (CalloutMappingDeclaration) role.bodyDeclarations().get(0);
-
+ CalloutMappingDeclaration callout = (CalloutMappingDeclaration) role.bodyDeclarations().get(0);
+
List<SingleVariableDeclaration> argList1 = new ArrayList<SingleVariableDeclaration>();
argList1.add(ASTNodeCreator.createArgument(ast,0,ASTNodeCreator.createType(ast, "String"),"s1",null));
-
+
List<SingleVariableDeclaration> argList2 = new ArrayList<SingleVariableDeclaration>();
- argList2.add(ASTNodeCreator.createArgument(ast,0,ASTNodeCreator.createType(ast, "String"),"s2",null));
-
+ argList2.add(ASTNodeCreator.createArgument(ast,0,ASTNodeCreator.createType(ast, "String"),"s2",null));
+
MethodSpec methodSpec1 = ASTNodeCreator.createMethodSpec(
ast,
"newRoleMethod",
ASTNodeCreator.createType(ast, "String"),
argList1,
true);
-
+
MethodSpec methodSpec2 = ASTNodeCreator.createMethodSpec(
ast,
"newBaseMethod",
ASTNodeCreator.createType(ast, "String"),
argList2,
true);
-
+
callout.setRoleMappingElement(methodSpec1);
callout.setBaseMappingElement(methodSpec2);
callout.bindingOperator().setBindingKind(MethodBindingOperator.KIND_CALLOUT_OVERRIDE);
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0005;\n");
buf.append("public team class Team {\n");
@@ -313,15 +313,15 @@ public class ASTRewritingModifyingCalloutMappingDeclarationTest extends ASTRewri
buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
-
+
assertEqualString(preview, buf.toString());
}
-
+
/**
* remove signatures, regular callout.
*/
- public void test0006() throws MalformedTreeException, JavaModelException, BadLocationException {
+ public void test0006() throws MalformedTreeException, JavaModelException, BadLocationException {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test0006", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0006;\n");
@@ -331,21 +331,21 @@ public class ASTRewritingModifyingCalloutMappingDeclarationTest extends ASTRewri
buf.append(" String roleMethod(String s1) -> String baseMethod(String s2);\n");
buf.append(" }\n");
buf.append("}\n");
-
+
ICompilationUnit cu= pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
-
- CalloutMappingDeclaration callout = (CalloutMappingDeclaration) role.bodyDeclarations().get(1);
+
+ CalloutMappingDeclaration callout = (CalloutMappingDeclaration) role.bodyDeclarations().get(1);
callout.removeSignatures();
-
+
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0006;\n");
buf.append("public team class Team {\n");
@@ -354,7 +354,7 @@ public class ASTRewritingModifyingCalloutMappingDeclarationTest extends ASTRewri
buf.append(" roleMethod -> baseMethod;\n");
buf.append(" }\n");
buf.append("}\n");
-
+
assertEqualString(preview, buf.toString());
}
@@ -362,7 +362,7 @@ public class ASTRewritingModifyingCalloutMappingDeclarationTest extends ASTRewri
/**
* remove signatures, callout-to-field (get)
*/
- public void test0007() throws MalformedTreeException, JavaModelException, BadLocationException {
+ public void test0007() throws MalformedTreeException, JavaModelException, BadLocationException {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test0007", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0007;\n");
@@ -372,21 +372,21 @@ public class ASTRewritingModifyingCalloutMappingDeclarationTest extends ASTRewri
buf.append(" String getField() -> get String baseField;\n");
buf.append(" }\n");
buf.append("}\n");
-
+
ICompilationUnit cu= pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
-
- CalloutMappingDeclaration callout = (CalloutMappingDeclaration) role.bodyDeclarations().get(1);
+
+ CalloutMappingDeclaration callout = (CalloutMappingDeclaration) role.bodyDeclarations().get(1);
callout.removeSignatures();
-
+
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0007;\n");
buf.append("public team class Team {\n");
@@ -395,15 +395,15 @@ public class ASTRewritingModifyingCalloutMappingDeclarationTest extends ASTRewri
buf.append(" getField -> get baseField;\n");
buf.append(" }\n");
buf.append("}\n");
-
+
assertEqualString(preview, buf.toString());
}
-
+
/**
* remove signatures, callout-to-field (set)
*/
- public void test0008() throws MalformedTreeException, JavaModelException, BadLocationException {
+ public void test0008() throws MalformedTreeException, JavaModelException, BadLocationException {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test0008", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0008;\n");
@@ -413,21 +413,21 @@ public class ASTRewritingModifyingCalloutMappingDeclarationTest extends ASTRewri
buf.append(" void setField(String val) -> set String baseField;\n");
buf.append(" }\n");
buf.append("}\n");
-
+
ICompilationUnit cu= pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
-
- CalloutMappingDeclaration callout = (CalloutMappingDeclaration) role.bodyDeclarations().get(1);
+
+ CalloutMappingDeclaration callout = (CalloutMappingDeclaration) role.bodyDeclarations().get(1);
callout.removeSignatures();
-
+
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0008;\n");
buf.append("public team class Team {\n");
@@ -436,7 +436,7 @@ public class ASTRewritingModifyingCalloutMappingDeclarationTest extends ASTRewri
buf.append(" setField -> set baseField;\n");
buf.append(" }\n");
buf.append("}\n");
-
+
assertEqualString(preview, buf.toString());
}
@@ -444,7 +444,7 @@ public class ASTRewritingModifyingCalloutMappingDeclarationTest extends ASTRewri
/**
* add signatures, callout-to-field (set)
*/
- public void test0009() throws MalformedTreeException, JavaModelException, BadLocationException {
+ public void test0009() throws MalformedTreeException, JavaModelException, BadLocationException {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test0009", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0009;\n");
@@ -454,17 +454,17 @@ public class ASTRewritingModifyingCalloutMappingDeclarationTest extends ASTRewri
buf.append(" setField -> set baseField;\n");
buf.append(" }\n");
buf.append("}\n");
-
+
ICompilationUnit cu= pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
AST ast = astRoot.getAST();
-
+
astRoot.recordModifications();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
-
+
CalloutMappingDeclaration callout = (CalloutMappingDeclaration) role.bodyDeclarations().get(1);
// role side:
MethodSpec roleMethodSpec = (MethodSpec)callout.getRoleMappingElement();
@@ -474,14 +474,14 @@ public class ASTRewritingModifyingCalloutMappingDeclarationTest extends ASTRewri
arg.setName(ast.newSimpleName("val"));
arg.setType(ast.newSimpleType(ast.newSimpleName("String")));
roleMethodSpec.parameters().add(arg);
-
+
// base side:
FieldAccessSpec fieldAccessSpec = (FieldAccessSpec)callout.getBaseMappingElement();
fieldAccessSpec.setSignatureFlag(true);
fieldAccessSpec.setFieldType(ast.newSimpleType(ast.newSimpleName("String")));
-
+
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0009;\n");
buf.append("public team class Team {\n");
@@ -490,8 +490,7 @@ public class ASTRewritingModifyingCalloutMappingDeclarationTest extends ASTRewri
buf.append(" void setField(String val) -> set String baseField;\n");
buf.append(" }\n");
buf.append("}\n");
-
+
assertEqualString(preview, buf.toString());
}
}
- \ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/ASTRewritingModifyingRoleTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/ASTRewritingModifyingRoleTest.java
index 40e6df952..7f1d97166 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/ASTRewritingModifyingRoleTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/ASTRewritingModifyingRoleTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -44,15 +44,15 @@ import org.eclipse.jdt.core.dom.InfixExpression.Operator;
// TODO(jsv) create own OT package for this test
public class ASTRewritingModifyingRoleTest extends ASTRewritingModifyingTest {
private static final Class THIS = ASTRewritingModifyingRoleTest.class;
-
+
public ASTRewritingModifyingRoleTest(String name) {
super(name);
}
-
+
public static Test allTests() {
return new Suite(THIS);
}
-
+
public static Test suite() {
if (true) {
return allTests();
@@ -61,11 +61,11 @@ public class ASTRewritingModifyingRoleTest extends ASTRewritingModifyingTest {
suite.addTest(new ASTRewritingModifyingRoleTest("test0009"));
return suite;
}
-
+
/**
* change name of role
*/
- public void test0001() throws Exception {
+ public void test0001() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test0001", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0001;\n");
@@ -74,19 +74,19 @@ public class ASTRewritingModifyingRoleTest extends ASTRewritingModifyingTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
AST ast = astRoot.getAST();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
role.setName(ast.newSimpleName("NewRole"));
-
+
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0001;\n");
buf.append("public team class Team {\n");
@@ -95,11 +95,11 @@ public class ASTRewritingModifyingRoleTest extends ASTRewritingModifyingTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
/**
* delete base class
*/
- public void test0002() throws Exception {
+ public void test0002() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test0002", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0002;\n");
@@ -108,19 +108,19 @@ public class ASTRewritingModifyingRoleTest extends ASTRewritingModifyingTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
AST ast = astRoot.getAST();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
role.setBaseClassType(null);
-
+
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0002;\n");
buf.append("public team class Team {\n");
@@ -129,11 +129,11 @@ public class ASTRewritingModifyingRoleTest extends ASTRewritingModifyingTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
/**
* add base class
*/
- public void test0003() throws Exception {
+ public void test0003() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test0003", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0003;\n");
@@ -142,19 +142,19 @@ public class ASTRewritingModifyingRoleTest extends ASTRewritingModifyingTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
AST ast = astRoot.getAST();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
role.setBaseClassType(ast.newSimpleType(ast.newName(new String[] {"Base"})));
-
+
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0003;\n");
buf.append("public team class Team {\n");
@@ -163,11 +163,11 @@ public class ASTRewritingModifyingRoleTest extends ASTRewritingModifyingTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
/**
* change base class
*/
- public void test0004() throws Exception {
+ public void test0004() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test0004", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0004;\n");
@@ -176,19 +176,19 @@ public class ASTRewritingModifyingRoleTest extends ASTRewritingModifyingTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
AST ast = astRoot.getAST();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
role.setBaseClassType(ast.newSimpleType(ast.newName(new String[] {"NewBase"})));
-
+
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0004;\n");
buf.append("public team class Team {\n");
@@ -197,11 +197,11 @@ public class ASTRewritingModifyingRoleTest extends ASTRewritingModifyingTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
/**
* add calloutmappingdeclaration
*/
- public void test0005() throws Exception {
+ public void test0005() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test0005", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0005;\n");
@@ -210,35 +210,35 @@ public class ASTRewritingModifyingRoleTest extends ASTRewritingModifyingTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
AST ast = astRoot.getAST();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
-
+
CalloutMappingDeclaration callout = ast.newCalloutMappingDeclaration();
MethodSpec baseMethodSpec = ast.newMethodSpec();
MethodSpec roleMethodSpec = ast.newMethodSpec();
-
+
baseMethodSpec.setName(ast.newSimpleName("baseMethodSpec"));
roleMethodSpec.setName(ast.newSimpleName("roleMethodSpec"));
baseMethodSpec.setSignatureFlag(true);
baseMethodSpec.setReturnType2(ast.newPrimitiveType(PrimitiveType.VOID));
roleMethodSpec.setSignatureFlag(true);
roleMethodSpec.setReturnType2(ast.newPrimitiveType(PrimitiveType.VOID));
-
+
callout.setBaseMappingElement(baseMethodSpec);
callout.setRoleMappingElement(roleMethodSpec);
- callout.setSignatureFlag(true);
-
+ callout.setSignatureFlag(true);
+
role.bodyDeclarations().add(callout);
-
+
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0005;\n");
buf.append("public team class Team {\n");
@@ -249,11 +249,11 @@ public class ASTRewritingModifyingRoleTest extends ASTRewritingModifyingTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
/**
* remove calloutMappingDeclaration
- */
- public void test0006() throws Exception {
+ */
+ public void test0006() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test0006", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0006;\n");
@@ -263,35 +263,35 @@ public class ASTRewritingModifyingRoleTest extends ASTRewritingModifyingTest {
buf.append(" void roleMethodSpec() -> void baseMethodSpec();\n");
buf.append(" }\n");
buf.append("}\n");
-
+
ICompilationUnit cu= pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
AST ast = astRoot.getAST();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
role.bodyDeclarations().remove(0);
-
+
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0006;\n");
buf.append("public team class Team {\n");
buf.append(" public class Role playedBy Base {\n");
buf.append(" }\n");
buf.append("}\n");
-
+
assertEqualString(preview, buf.toString());
}
-
+
/**
* add callinmappingdeclaration
*/
- public void test0007() throws Exception {
+ public void test0007() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test0007", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0007;\n");
@@ -300,36 +300,36 @@ public class ASTRewritingModifyingRoleTest extends ASTRewritingModifyingTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
AST ast = astRoot.getAST();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
-
+
CallinMappingDeclaration callin = ast.newCallinMappingDeclaration();
-
+
MethodSpec baseMethodSpec = ast.newMethodSpec();
MethodSpec roleMethodSpec = ast.newMethodSpec();
-
+
baseMethodSpec.setName(ast.newSimpleName("baseMethodSpec"));
roleMethodSpec.setName(ast.newSimpleName("roleMethodSpec"));
baseMethodSpec.setSignatureFlag(true);
baseMethodSpec.setReturnType2(ast.newPrimitiveType(PrimitiveType.VOID));
roleMethodSpec.setSignatureFlag(true);
roleMethodSpec.setReturnType2(ast.newPrimitiveType(PrimitiveType.VOID));
-
+
callin.getBaseMappingElements().add(baseMethodSpec);
callin.setRoleMappingElement(roleMethodSpec);
-
+
callin.setCallinModifier(Modifier.OT_BEFORE_CALLIN);
role.bodyDeclarations().add(callin);
-
+
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0007;\n");
buf.append("public team class Team {\n");
@@ -340,11 +340,11 @@ public class ASTRewritingModifyingRoleTest extends ASTRewritingModifyingTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
/**
* remove callinmappingdeclaration
*/
- public void test0008() throws Exception {
+ public void test0008() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test0008", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0008;\n");
@@ -354,35 +354,35 @@ public class ASTRewritingModifyingRoleTest extends ASTRewritingModifyingTest {
buf.append(" void roleMethodSpec() <- before void baseMethodSpec();\n");
buf.append(" }\n");
buf.append("}\n");
-
+
ICompilationUnit cu= pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
AST ast = astRoot.getAST();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
-
+
role.bodyDeclarations().remove(0);
-
+
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0008;\n");
buf.append("public team class Team {\n");
buf.append(" public class Role playedBy Base {\n");
buf.append(" }\n");
buf.append("}\n");
-
+
assertEqualString(preview, buf.toString());
}
/**
* add role guard predicate
*/
- public void test0009() throws Exception {
+ public void test0009() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test0009", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0009;\n");
@@ -392,20 +392,20 @@ public class ASTRewritingModifyingRoleTest extends ASTRewritingModifyingTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
AST ast = astRoot.getAST();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
-
+
GuardPredicateDeclaration guard = ast.newGuardPredicateDeclaration();
-
+
guard.setBase(true);
-
+
InfixExpression expr = ast.newInfixExpression();
NumberLiteral lhs = ast.newNumberLiteral();
lhs.setToken("4");
@@ -417,24 +417,24 @@ public class ASTRewritingModifyingRoleTest extends ASTRewritingModifyingTest {
guard.setExpression(expr);
role.setGuardPredicate(guard);
-
+
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0009;\n");
buf.append("public team class Team {\n");
buf.append(" public class Role playedBy Base\n");
- buf.append(" base when (4 == 5)\n");
+ buf.append(" base when (4 == 5)\n");
buf.append(" {\n");
buf.append(" }\n");
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
/**
* remove role guard predicate
*/
- public void test0010() throws Exception {
+ public void test0010() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test0010", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0010;\n");
@@ -445,22 +445,22 @@ public class ASTRewritingModifyingRoleTest extends ASTRewritingModifyingTest {
buf.append("\n");
buf.append(" }\n");
buf.append("}\n");
-
+
ICompilationUnit cu= pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
AST ast = astRoot.getAST();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
-
+
role.setGuardPredicate(null);
-
+
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0010;\n");
buf.append("public team class Team {\n");
@@ -469,15 +469,15 @@ public class ASTRewritingModifyingRoleTest extends ASTRewritingModifyingTest {
buf.append("\n");
buf.append(" }\n");
buf.append("}\n");
-
+
assertEqualString(preview, buf.toString());
}
-
-
+
+
/**
* changed role guard predicate
*/
- public void test0011() throws Exception {
+ public void test0011() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test0011", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0011;\n");
@@ -488,22 +488,22 @@ public class ASTRewritingModifyingRoleTest extends ASTRewritingModifyingTest {
buf.append("\n");
buf.append(" }\n");
buf.append("}\n");
-
+
ICompilationUnit cu= pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
AST ast = astRoot.getAST();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = (RoleTypeDeclaration) aTeam.bodyDeclarations().get(0);
-
+
GuardPredicateDeclaration guard = role.getGuardPredicate();
-
+
guard.setBase(true);
-
+
InfixExpression expr = ast.newInfixExpression();
NumberLiteral lhs = ast.newNumberLiteral();
lhs.setToken("23");
@@ -513,9 +513,9 @@ public class ASTRewritingModifyingRoleTest extends ASTRewritingModifyingTest {
expr.setRightOperand(rhs);
expr.setOperator(Operator.NOT_EQUALS);
guard.setExpression(expr);
-
+
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0011;\n");
buf.append("public team class Team {\n");
@@ -525,8 +525,7 @@ public class ASTRewritingModifyingRoleTest extends ASTRewritingModifyingTest {
buf.append("\n");
buf.append(" }\n");
buf.append("}\n");
-
+
assertEqualString(preview, buf.toString());
}
}
- \ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/ASTRewritingModifyingTeamTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/ASTRewritingModifyingTeamTest.java
index 860e0bb11..cf301f00d 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/ASTRewritingModifyingTeamTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/ASTRewritingModifyingTeamTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -49,15 +49,15 @@ import org.eclipse.text.edits.TextEdit;
//TODO(jsv) create own OT package for this test
public class ASTRewritingModifyingTeamTest extends ASTRewritingModifyingTest {
private static final Class THIS = ASTRewritingModifyingTeamTest.class;
-
+
public ASTRewritingModifyingTeamTest(String name) {
super(name);
}
-
+
public static Test allTests() {
return new Suite(THIS);
}
-
+
public static Test suite() {
if (true) {
return allTests();
@@ -66,32 +66,32 @@ public class ASTRewritingModifyingTeamTest extends ASTRewritingModifyingTest {
suite.addTest(new ASTRewritingModifyingTeamTest("test0009"));
return suite;
}
-
+
/**
* insert a new role
*/
- public void test0001() throws Exception {
+ public void test0001() throws Exception {
IPackageFragment pack1= sourceFolder.createPackageFragment("test0001", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0001;\n");
buf.append("public team class X {\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("X.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
AST ast = astRoot.getAST();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = ast.newRoleTypeDeclaration();
role.setName(ast.newSimpleName("Y"));
role.modifiers().add(ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
- aTeam.bodyDeclarations().add(role);
-
+ aTeam.bodyDeclarations().add(role);
+
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0001;\n");
buf.append("public team class X {\n");
@@ -101,11 +101,11 @@ public class ASTRewritingModifyingTeamTest extends ASTRewritingModifyingTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
/**
* Delete role from team
*/
- public void test0002() throws Exception {
+ public void test0002() throws Exception {
IPackageFragment pack1= sourceFolder.createPackageFragment("test0002", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0002;\n");
@@ -114,29 +114,29 @@ public class ASTRewritingModifyingTeamTest extends ASTRewritingModifyingTest {
buf.append("}\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("X.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
AST ast = astRoot.getAST();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
- aTeam.bodyDeclarations().remove(0);
-
+ aTeam.bodyDeclarations().remove(0);
+
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0002;\n");
buf.append("public team class X {\n");
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
/**
* Replace role
*/
- public void test0003() throws Exception {
+ public void test0003() throws Exception {
IPackageFragment pack1= sourceFolder.createPackageFragment("test0003", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0003;\n");
@@ -149,22 +149,22 @@ public class ASTRewritingModifyingTeamTest extends ASTRewritingModifyingTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("X.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
AST ast = astRoot.getAST();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
RoleTypeDeclaration role = ast.newRoleTypeDeclaration();
role.setName(ast.newSimpleName("YY"));
role.modifiers().add(ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
aTeam.bodyDeclarations().remove(1);
aTeam.bodyDeclarations().add(1,role);
-
+
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0003;\n");
buf.append("public team class X {\n");
@@ -177,27 +177,27 @@ public class ASTRewritingModifyingTeamTest extends ASTRewritingModifyingTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
// Insert a role with playedBy via modification and cloning.
public void test0004() throws Exception {
-
+
// generate some AST:
- String generated =
- "public team class MyTeam {\n" +
+ String generated =
+ "public team class MyTeam {\n" +
" protected class DisposeWatcher playedBy Item {\n" +
" void bar() { nop(); }\n" +
- " }\n" +
+ " }\n" +
"}\n";
-
+
ASTParser parser = ASTParser.newParser(AST.JLS4);
parser.setKind(ASTParser.K_STATEMENTS);
parser.setSource(generated.toCharArray());
-
+
Block block = (Block) parser.createAST(null);
TypeDeclarationStatement st = (TypeDeclarationStatement) block.statements().get(0);
TypeDeclaration decl = (TypeDeclaration) st.getDeclaration();
ASTNode[] myNodes = (ASTNode[]) decl.bodyDeclarations().toArray(new ASTNode[1]);
-
+
// create a CU to copy into:
String existing =
"public team class MyTeam {\n" +
@@ -209,19 +209,19 @@ public class ASTRewritingModifyingTeamTest extends ASTRewritingModifyingTest {
parser.setSource(existing.toCharArray());
CompilationUnit _astCU = (CompilationUnit)parser.createAST(null);
TypeDeclaration teamDecl = (TypeDeclaration)_astCU.types().get(0);
-
+
// copy generated into CU:
_astCU.recordModifications();
teamDecl.bodyDeclarations().add(ASTNode.copySubtree(_astCU.getAST(), myNodes[0]));
-
+
// apply change:
Document doc = new Document(existing);
TextEdit edits = _astCU.rewrite(doc, null);
edits.apply(doc);
-
+
// compare result with expected:
String newSource = doc.get();
- String expected =
+ String expected =
"public team class MyTeam {\n" +
" protected class OtherRole {}\n" +
" void foo() { System.out.println(this); }\n" +
@@ -233,29 +233,29 @@ public class ASTRewritingModifyingTeamTest extends ASTRewritingModifyingTest {
"}\n";
assertEquals(expected, newSource);
}
-
+
// insert a role with playedBy and base predicate :
public void test0005() throws Exception {
-
+
// generate some AST:
- String generated =
- "public team class MyTeam {\n" +
+ String generated =
+ "public team class MyTeam {\n" +
" protected class DisposeWatcher playedBy Item \n" +
" base when (hasRole(base)) {\n" +
" void bar() { nop(); }\n" +
- " }\n" +
+ " }\n" +
"}\n";
-
+
ASTParser parser = ASTParser.newParser(AST.JLS4);
parser.setKind(ASTParser.K_STATEMENTS);
parser.setSource(generated.toCharArray());
-
+
Block block = (Block) parser.createAST(null);
TypeDeclarationStatement st = (TypeDeclarationStatement) block.statements().get(0);
TypeDeclaration decl = (TypeDeclaration) st.getDeclaration();
ASTNode[] myNodes = (ASTNode[]) decl.bodyDeclarations().toArray(new ASTNode[1]);
-
+
// create a CU to copy into:
String existing =
"public team class MyTeam {\n" +
@@ -267,19 +267,19 @@ public class ASTRewritingModifyingTeamTest extends ASTRewritingModifyingTest {
parser.setSource(existing.toCharArray());
CompilationUnit _astCU = (CompilationUnit)parser.createAST(null);
TypeDeclaration teamDecl = (TypeDeclaration)_astCU.types().get(0);
-
+
// copy generated into CU:
_astCU.recordModifications();
teamDecl.bodyDeclarations().add(ASTNode.copySubtree(_astCU.getAST(), myNodes[0]));
-
+
// apply change:
Document doc = new Document(existing);
TextEdit edits = _astCU.rewrite(doc, null);
edits.apply(doc);
-
+
// compare result with expected:
String newSource = doc.get();
- String expected =
+ String expected =
"public team class MyTeam {\n" +
" protected class OtherRole {}\n" +
" void foo() { System.out.println(this); }\n" +
@@ -293,27 +293,27 @@ public class ASTRewritingModifyingTeamTest extends ASTRewritingModifyingTest {
"}\n";
assertEquals(expected, newSource);
}
-
+
// insert a team with a predicate :
public void test0006() throws Exception {
-
+
// generate some AST:
- String generated =
- "public team class MyTeam \n" +
+ String generated =
+ "public team class MyTeam \n" +
" when (isSunday(today())) {\n" +
" void bar() { nop(); }\n" +
"}\n";
-
+
ASTParser parser = ASTParser.newParser(AST.JLS4);
parser.setKind(ASTParser.K_STATEMENTS);
parser.setSource(generated.toCharArray());
-
+
Block block = (Block) parser.createAST(null);
System.out.println(block);
TypeDeclarationStatement st = (TypeDeclarationStatement) block.statements().get(0);
TypeDeclaration decl = (TypeDeclaration) st.getDeclaration();
-
+
// create a CU to copy into:
String existing =
"import javax.swing.JFrame;\n";
@@ -321,19 +321,19 @@ public class ASTRewritingModifyingTeamTest extends ASTRewritingModifyingTest {
parser.setKind(ASTParser.K_COMPILATION_UNIT);
parser.setSource(existing.toCharArray());
CompilationUnit _astCU = (CompilationUnit)parser.createAST(null);
-
+
// copy generated into CU:
_astCU.recordModifications();
_astCU.types().add(ASTNode.copySubtree(_astCU.getAST(), decl));
-
+
// apply change:
Document doc = new Document(existing);
TextEdit edits = _astCU.rewrite(doc, null);
edits.apply(doc);
-
+
// compare result with expected:
String newSource = doc.get();
- String expected =
+ String expected =
"import javax.swing.JFrame;\n\n" +
"public team class MyTeam\n" +
" when (isSunday(today()))\n" +
@@ -344,34 +344,34 @@ public class ASTRewritingModifyingTeamTest extends ASTRewritingModifyingTest {
"}\n";
assertEquals(expected, newSource);
}
-
+
/**
* add team guard predicate
*/
- public void test0009() throws Exception {
+ public void test0009() throws Exception {
IPackageFragment pack1= sourceFolder.createPackageFragment("test0009", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0009;\n");
- buf.append("public team class Team\n");
+ buf.append("public team class Team\n");
buf.append("{\n");
buf.append(" public class Role playedBy Base\n");
buf.append(" {\n");
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
AST ast = astRoot.getAST();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
GuardPredicateDeclaration guard = ast.newGuardPredicateDeclaration();
-
+
guard.setBase(true);
-
+
InfixExpression expr = ast.newInfixExpression();
NumberLiteral lhs = ast.newNumberLiteral();
lhs.setToken("4");
@@ -383,13 +383,13 @@ public class ASTRewritingModifyingTeamTest extends ASTRewritingModifyingTest {
guard.setExpression(expr);
aTeam.setGuardPredicate(guard);
-
+
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0009;\n");
buf.append("public team class Team\n");
- buf.append(" base when (4 == 5)\n");
+ buf.append(" base when (4 == 5)\n");
buf.append("{\n");
buf.append(" public class Role playedBy Base\n");
buf.append(" {\n");
@@ -397,11 +397,11 @@ public class ASTRewritingModifyingTeamTest extends ASTRewritingModifyingTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
/**
* remove team guard predicate
*/
- public void test0010() throws Exception {
+ public void test0010() throws Exception {
IPackageFragment pack1= sourceFolder.createPackageFragment("test0010", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0010;\n");
@@ -413,21 +413,21 @@ public class ASTRewritingModifyingTeamTest extends ASTRewritingModifyingTest {
buf.append("\n");
buf.append(" }\n");
buf.append("}\n");
-
+
ICompilationUnit cu= pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
AST ast = astRoot.getAST();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
-
+
aTeam.setGuardPredicate(null);
-
+
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0010;\n");
buf.append("public team class Team\n");
@@ -437,15 +437,15 @@ public class ASTRewritingModifyingTeamTest extends ASTRewritingModifyingTest {
buf.append("\n");
buf.append(" }\n");
buf.append("}\n");
-
+
assertEqualString(preview, buf.toString());
}
-
-
+
+
/**
* changed team guard predicate
*/
- public void test0011() throws Exception {
+ public void test0011() throws Exception {
IPackageFragment pack1= sourceFolder.createPackageFragment("test0011", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test0011;\n");
@@ -457,21 +457,21 @@ public class ASTRewritingModifyingTeamTest extends ASTRewritingModifyingTest {
buf.append("\n");
buf.append(" }\n");
buf.append("}\n");
-
+
ICompilationUnit cu= pack1.createCompilationUnit("Team.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= createCU(cu, false);
-
+
astRoot.recordModifications();
-
+
AST ast = astRoot.getAST();
-
+
TypeDeclaration aTeam = (TypeDeclaration) astRoot.types().get(0);
-
+
GuardPredicateDeclaration guard = aTeam.getGuardPredicate();
-
+
guard.setBase(true);
-
+
InfixExpression expr = ast.newInfixExpression();
NumberLiteral lhs = ast.newNumberLiteral();
lhs.setToken("23");
@@ -481,9 +481,9 @@ public class ASTRewritingModifyingTeamTest extends ASTRewritingModifyingTest {
expr.setRightOperand(rhs);
expr.setOperator(Operator.NOT_EQUALS);
guard.setExpression(expr);
-
+
String preview = evaluateRewrite(cu.getSource(), astRoot);
-
+
buf= new StringBuffer();
buf.append("package test0011;\n");
buf.append("public team class Team\n");
@@ -494,9 +494,8 @@ public class ASTRewritingModifyingTeamTest extends ASTRewritingModifyingTest {
buf.append("\n");
buf.append(" }\n");
buf.append("}\n");
-
+
assertEqualString(preview, buf.toString());
}
}
- \ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/ASTRewritingModifyingTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/ASTRewritingModifyingTest.java
index 415e48f84..c966e8afc 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/ASTRewritingModifyingTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/ASTRewritingModifyingTest.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -34,8 +34,8 @@ import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.objectteams.otdt.core.ext.OTDTPlugin;
// replace cu creation as to use JLS3 instead of JLS2.
-public class ASTRewritingModifyingTest
- extends org.eclipse.jdt.core.tests.rewrite.modifying.ASTRewritingModifyingTest
+public class ASTRewritingModifyingTest
+ extends org.eclipse.jdt.core.tests.rewrite.modifying.ASTRewritingModifyingTest
{
public ASTRewritingModifyingTest(String name) {
@@ -43,7 +43,7 @@ public class ASTRewritingModifyingTest
}
public CompilationUnit createCU(ICompilationUnit unit, boolean resolveBindings) {
-
+
try {
ASTParser c = ASTParser.newParser(AST.JLS4);
c.setSource(unit);
@@ -66,7 +66,7 @@ public class ASTRewritingModifyingTest
return (CompilationUnit) result;
}
- protected IJavaProject createJavaProject(String projectName, String[] sourceFolders, String[] libraries, String output, String compliance)
+ protected IJavaProject createJavaProject(String projectName, String[] sourceFolders, String[] libraries, String output, String compliance)
throws CoreException
{
IJavaProject javaProject = super.createJavaProject(projectName, sourceFolders, libraries, output, compliance);
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/AllTests.java
index 6c016e97c..1213abb37 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/AllTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/describing/AstRewritingDescribingTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/describing/AstRewritingDescribingTest.java
index 02c02d22f..fb09bdfa6 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/describing/AstRewritingDescribingTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/describing/AstRewritingDescribingTest.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -30,14 +30,14 @@ import org.eclipse.objectteams.otdt.ui.tests.util.JavaProjectHelper;
-public class AstRewritingDescribingTest
- extends org.eclipse.jdt.core.tests.rewrite.describing.ASTRewritingTest
+public class AstRewritingDescribingTest
+ extends org.eclipse.jdt.core.tests.rewrite.describing.ASTRewritingTest
{
public AstRewritingDescribingTest(String name) {
super(name);
}
-
+
public AstRewritingDescribingTest(String name, int apilevel) {
super(name, apilevel);
}
@@ -47,11 +47,11 @@ public class AstRewritingDescribingTest
super.setUp();
JavaProjectHelper.addNatureToProject(project1.getProject(), JavaCore.OTJ_NATURE_ID, null);
}
-
- public static RoleTypeDeclaration findRoleTypeDeclaration (TypeDeclaration teamType, String roleName)
+
+ public static RoleTypeDeclaration findRoleTypeDeclaration (TypeDeclaration teamType, String roleName)
{
for (Object member : teamType.bodyDeclarations()) {
- if (member instanceof RoleTypeDeclaration) {
+ if (member instanceof RoleTypeDeclaration) {
RoleTypeDeclaration roleType = (RoleTypeDeclaration)member;
if (roleType.getName().getIdentifier().equals(roleName))
return (RoleTypeDeclaration)member;
@@ -59,8 +59,8 @@ public class AstRewritingDescribingTest
}
return null;
}
-
- public static CallinMappingDeclaration findCallinMappingDeclaration(RoleTypeDeclaration typeDecl, String roleMethodName)
+
+ public static CallinMappingDeclaration findCallinMappingDeclaration(RoleTypeDeclaration typeDecl, String roleMethodName)
{
CallinMappingDeclaration[] callinCallouts = typeDecl.getCallIns();
for (int i= 0; i < callinCallouts.length; i++) {
@@ -69,6 +69,6 @@ public class AstRewritingDescribingTest
}
}
return null;
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/describing/CallinMappingDeclarationTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/describing/CallinMappingDeclarationTest.java
index e4349b5d4..cb405190c 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/describing/CallinMappingDeclarationTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/describing/CallinMappingDeclarationTest.java
@@ -48,8 +48,8 @@ public class CallinMappingDeclarationTest extends AstRewritingDescribingTest {
suite.addTest(new CallinMappingDeclarationTest("test0009")); // FIXME? Used?
return suite;
}
-
-
+
+
// copied from org.eclipse.jdt.core.tests.rewrite.describing.ASTRewritingMethodDeclTest
// and syntactically adjusted for callins
public void testModifiersAST3WithAnnotations() throws Exception {
@@ -68,15 +68,15 @@ public class CallinMappingDeclarationTest extends AstRewritingDescribingTest {
buf.append(" @ToBeRemoved\n");
buf.append(" @Deprecated\n");
buf.append(" Object foo4() <- after Object bfoo4();\n");
- buf.append("}\n");
- buf.append("}\n");
- ICompilationUnit cu= pack1.createCompilationUnit("T.java", buf.toString(), false, null);
-
+ buf.append("}\n");
+ buf.append("}\n");
+ ICompilationUnit cu= pack1.createCompilationUnit("T.java", buf.toString(), false, null);
+
CompilationUnit astRoot= createAST(cu);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
AST ast= astRoot.getAST();
RoleTypeDeclaration type= findRoleTypeDeclaration(findTypeDeclaration(astRoot, "T"), "E");
-
+
{ // insert annotation first before normal
CallinMappingDeclaration mappingDecl= findCallinMappingDeclaration(type, "foo1");
ListRewrite listRewrite= rewrite.getListRewrite(mappingDecl, CallinMappingDeclaration.MODIFIERS2_PROPERTY);
@@ -90,7 +90,7 @@ public class CallinMappingDeclarationTest extends AstRewritingDescribingTest {
MarkerAnnotation annot= ast.newMarkerAnnotation();
annot.setTypeName(ast.newSimpleName("Override"));
listRewrite.insertFirst(annot, null);
- }
+ }
{ // remove annotation before normal
CallinMappingDeclaration mappingDecl= findCallinMappingDeclaration(type, "foo3");
ListRewrite listRewrite= rewrite.getListRewrite(mappingDecl, CallinMappingDeclaration.MODIFIERS2_PROPERTY);
@@ -101,9 +101,9 @@ public class CallinMappingDeclarationTest extends AstRewritingDescribingTest {
ListRewrite listRewrite= rewrite.getListRewrite(mappingDecl, CallinMappingDeclaration.MODIFIERS2_PROPERTY);
listRewrite.remove((ASTNode) mappingDecl.modifiers().get(0), null);
}
-
+
String preview= evaluateRewrite(cu, rewrite);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public team abstract class T {\n");
@@ -118,10 +118,10 @@ public class CallinMappingDeclarationTest extends AstRewritingDescribingTest {
buf.append(" /** javadoc comment */\n");
buf.append(" @Deprecated\n");
buf.append(" Object foo4() <- after Object bfoo4();\n");
- buf.append("}\n");
- buf.append("}\n");
+ buf.append("}\n");
+ buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
-
+
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/describing/TypeDeclarationTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/describing/TypeDeclarationTest.java
index 5a40efc4e..d65f07676 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/describing/TypeDeclarationTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/rewrite/describing/TypeDeclarationTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -55,30 +55,30 @@ public class TypeDeclarationTest extends AstRewritingDescribingTest {
public static Test suite() {
return createSuite(TypeDeclarationTest.class, AST.JLS3);
}
-
-
+
+
public void testRoleTypeDeclChanges1() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public team class T {\n");
buf.append(" public class R extends java.util.List implements Runnable, Serializable playedBy String {\n");
- buf.append(" }\n");
+ buf.append(" }\n");
buf.append("}\n");
- ICompilationUnit cu= pack1.createCompilationUnit("T.java", buf.toString(), false, null);
+ ICompilationUnit cu= pack1.createCompilationUnit("T.java", buf.toString(), false, null);
CompilationUnit astRoot= createAST(cu);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
AST ast= astRoot.getAST();
-
+
{ // change to protected team, rename type, rename supertype, rename first interface, rename base-class
TypeDeclaration teamType= findTypeDeclaration(astRoot, "T");
RoleTypeDeclaration roleType= findRoleTypeDeclaration(teamType, "R");
// change flags
rewrite.getListRewrite(roleType, RoleTypeDeclaration.MODIFIERS2_PROPERTY).replace(
- (Modifier)roleType.modifiers().get(0),
- ast.newModifier(Modifier.ModifierKeyword.PROTECTED_KEYWORD),
+ (Modifier)roleType.modifiers().get(0),
+ ast.newModifier(Modifier.ModifierKeyword.PROTECTED_KEYWORD),
null);
// change to team
@@ -88,7 +88,7 @@ public class TypeDeclarationTest extends AstRewritingDescribingTest {
SimpleName name= roleType.getName();
SimpleName newName= ast.newSimpleName("R1");
rewrite.replace(name, newName, null);
-
+
Type superClass= roleType.getSuperclassType();
assertTrue("Has super type", superClass != null);
SimpleType newSuperclass= ast.newSimpleType(ast.newSimpleName("Object"));
@@ -98,7 +98,7 @@ public class TypeDeclarationTest extends AstRewritingDescribingTest {
assertTrue("Has super interfaces", !superInterfaces.isEmpty());
SimpleType newSuperinterface= ast.newSimpleType(ast.newSimpleName("Cloneable"));
rewrite.replace((ASTNode) superInterfaces.get(0), newSuperinterface, null);
-
+
Type baseClass= roleType.getBaseClassType();
assertTrue("Has base type", baseClass != null);
SimpleType newBaseclass= ast.newSimpleType(ast.newSimpleName("System"));
@@ -107,13 +107,13 @@ public class TypeDeclarationTest extends AstRewritingDescribingTest {
}
String preview= evaluateRewrite(cu, rewrite);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public team class T {\n");
buf.append(" protected team class R1 extends Object implements Cloneable, Serializable playedBy System {\n");
- buf.append(" }\n");
- buf.append("}\n");
+ buf.append(" }\n");
+ buf.append("}\n");
assertEqualString(preview, buf.toString());
}
@@ -125,14 +125,14 @@ public class TypeDeclarationTest extends AstRewritingDescribingTest {
buf.append(" public team class R1 implements Runnable, Serializable playedBy String {}\n");
buf.append(" public class R2 extends Object implements Runnable {}\n");
buf.append("}\n");
- ICompilationUnit cu= pack1.createCompilationUnit("T.java", buf.toString(), false, null);
+ ICompilationUnit cu= pack1.createCompilationUnit("T.java", buf.toString(), false, null);
CompilationUnit astRoot= createAST(cu);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
AST ast= astRoot.getAST();
-
+
TypeDeclaration teamType= findTypeDeclaration(astRoot, "T");
- {
+ {
// change R1 to non-team, add supertype, remmove first interface, remove base-class
RoleTypeDeclaration role1Type= findRoleTypeDeclaration(teamType, "R1");
@@ -148,13 +148,13 @@ public class TypeDeclarationTest extends AstRewritingDescribingTest {
List superInterfaces= role1Type.superInterfaceTypes();
assertTrue("Has super interfaces", !superInterfaces.isEmpty());
rewrite.getListRewrite(role1Type, RoleTypeDeclaration.SUPER_INTERFACE_TYPES_PROPERTY).remove((Type)superInterfaces.get(0), null);
-
+
Type baseClass= role1Type.getBaseClassType();
assertTrue("Has base type", baseClass != null);
rewrite.remove(baseClass, null);
}
- {
+ {
// change R2: remove supertype, add super-interface, add base-class
RoleTypeDeclaration role2Type= findRoleTypeDeclaration(teamType, "R2");
@@ -166,9 +166,9 @@ public class TypeDeclarationTest extends AstRewritingDescribingTest {
assertTrue("Has super interfaces", !superInterfaces.isEmpty());
Type newSuperInterface = ast.newSimpleType(ast.newSimpleName("Cloneable"));
rewrite.getListRewrite(role2Type, RoleTypeDeclaration.SUPER_INTERFACE_TYPES_PROPERTY).insertLast(
- newSuperInterface,
+ newSuperInterface,
null);
-
+
Type baseClass= role2Type.getBaseClassType();
assertTrue("Has no base type", baseClass == null);
SimpleType newBaseclass= ast.newSimpleType(ast.newSimpleName("System"));
@@ -177,13 +177,13 @@ public class TypeDeclarationTest extends AstRewritingDescribingTest {
}
String preview= evaluateRewrite(cu, rewrite);
-
+
buf= new StringBuffer();
buf.append("package test2;\n");
buf.append("public team class T {\n");
buf.append(" public class R1 extends Object implements Serializable {}\n");
buf.append(" public class R2 implements Runnable, Cloneable playedBy System {}\n");
- buf.append("}\n");
+ buf.append("}\n");
assertEqualString(preview, buf.toString());
}
@@ -194,14 +194,14 @@ public class TypeDeclarationTest extends AstRewritingDescribingTest {
buf.append("package test2;\n");
buf.append("public class R1 implements Runnable, Serializable playedBy String {\n");
buf.append("}\n");
- ICompilationUnit cu= pack1.createCompilationUnit("R1.java", buf.toString(), false, null);
+ ICompilationUnit cu= pack1.createCompilationUnit("R1.java", buf.toString(), false, null);
CompilationUnit astRoot= createAST(cu);
ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
AST ast= astRoot.getAST();
-
+
PackageDeclaration packageDecl = astRoot.getPackage();
- {
+ {
// change to team
ListRewrite modifiersRewrite = rewrite.getListRewrite(packageDecl, PackageDeclaration.MODIFIERS_PROPERTY);
Modifier teamModifier = ast.newModifier(ModifierKeyword.TEAM_KEYWORD);
@@ -212,7 +212,7 @@ public class TypeDeclarationTest extends AstRewritingDescribingTest {
}
String preview= evaluateRewrite(cu, rewrite);
-
+
buf= new StringBuffer();
buf.append("@NonNullByDefault ");
buf.append("team package test2.MyTeam;\n");
@@ -222,7 +222,7 @@ public class TypeDeclarationTest extends AstRewritingDescribingTest {
// re-get to also challenge ASTConverter and NaiveASTFlattener:
IPackageFragment pack2 = this.sourceFolder.createPackageFragment("test2.MyTeam", false, null);
- cu= pack2.createCompilationUnit("R1.java", buf.toString(), false, null);
+ cu= pack2.createCompilationUnit("R1.java", buf.toString(), false, null);
astRoot= createAST(cu);
assertEqualString(astRoot.toString(), buf.toString());
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/AllTests.java
index e6b6d487f..0dd03a697 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/AllTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -28,7 +28,7 @@ import junit.framework.TestSuite;
/**
* @author brcan
- *
+ *
* Runs all OT-specific refactoring tests and corresponding eclipse refactoring tests
*/
public class AllTests
@@ -46,7 +46,7 @@ public class AllTests
// util
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.util.AllTests.suite());
-
+
// OTDT refactoring tests
// rename
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.rename.RenameMethodInInterfaceTests.suite());
@@ -55,11 +55,11 @@ public class AllTests
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.rename.RenameVirtualMethodInClassTests.suite());
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.rename.RenamePrivateFieldTests.suite());
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.rename.RenameTypeTests.suite());
-
+
// move
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.move.MoveInstanceMethodTests.suite());
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.move.MoveStaticMethodTests.suite());
-
+
//extract
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.extractmethod.ExtractMethodTests.suite());
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.extractmethod.ExtractMethodRefactoringUtilTests.suite());
@@ -69,15 +69,15 @@ public class AllTests
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.reorg.OTCopyToClipboardTests.suite());
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.reorg.OTDeleteTests.suite());
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.reorg.OTPasteActionTest.suite());
-
+
// pull & push
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.pullup.PullUpTests.suite());
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.pushdown.PushDownTests.suite());
-
+
// ot refactorings
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.inlinecallin.InlineCallinTests.suite());
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.extractcallin.ExtractCallinTests.suite());
-
+
return suite;
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/FileBasedRefactoringTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/FileBasedRefactoringTest.java
index a3ff3b977..b73c10a2b 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/FileBasedRefactoringTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/FileBasedRefactoringTest.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/MySetup.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/MySetup.java
index 156acddf5..0c8882531 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/MySetup.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/MySetup.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -44,10 +44,10 @@ public class MySetup extends TestSetup
private static IPackageFragmentRoot _root;
private static IPackageFragment _packageP;
private static IJavaProject _javaTestProject;
-
+
public static final String CONTAINER = "src";
-
+
public MySetup(Test test)
{
super(test);
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/OTRefactoringTestPlugin.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/OTRefactoringTestPlugin.java
index f70ba37ef..cca219908 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/OTRefactoringTestPlugin.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/OTRefactoringTestPlugin.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/OTRefactoringTestSetup.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/OTRefactoringTestSetup.java
index e159eb5c6..d7b858186 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/OTRefactoringTestSetup.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/OTRefactoringTestSetup.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -41,9 +41,9 @@ public team class OTRefactoringTestSetup extends RefactoringTestSetup {
within (this)
super.setUp();
}
-
+
protected class ProjectHelper playedBy JavaProjectHelper {
-
+
IJavaProject createJavaProject(String projectName, String binFolderName) <- replace IJavaProject createJavaProject(String projectName, String binFolderName);
@SuppressWarnings("basecall")
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/RefactoringTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/RefactoringTest.java
index 81cf5e09b..548f59b86 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/RefactoringTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/RefactoringTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2013 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -419,7 +419,7 @@ public abstract class RefactoringTest extends TestCase
protected ICompilationUnit[] createCUs(String[] cuNames) throws Exception {
ICompilationUnit[] cus = new ICompilationUnit[cuNames.length];
-
+
for (int idx = 0; idx < cuNames.length; idx++) {
Assert.isNotNull(cuNames[idx]);
cus[idx] = createCUfromTestFile(getPackageP(), cuNames[idx]);
@@ -576,7 +576,7 @@ public abstract class RefactoringTest extends TestCase
return getMethods(type, names, signatures, null, false);
}
public static IMethod[] getMethods(IType type, String[] names, String[][] signatures,
- boolean[] flags, boolean flag)
+ boolean[] flags, boolean flag)
throws JavaModelException
{
if (names == null || signatures == null)
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/adapt/JdtTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/adapt/JdtTests.java
index 62cb0377f..a0af8004e 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/adapt/JdtTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/adapt/JdtTests.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010 GK Software AG
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -28,13 +28,13 @@ import base org.eclipse.jdt.ui.tests.refactoring.RefactoringTest;
@SuppressWarnings("restriction")
public team class JdtTests {
-
+
protected team class ChangeSignature playedBy ChangeSignatureTests {
-
+
final static String OT_NAME = "a_of_string";
-
+
testGenerics04 <- replace testGenerics04;
-
+
@SuppressWarnings({ "inferredcallout", "basecall", "decapsulation" })
callin void testGenerics04() throws Exception {
String[] signature= {"QList<QInteger;>;", "QA<QString;>;"};
@@ -44,7 +44,7 @@ public team class JdtTests {
ParameterInfo[] newParamInfo= createNewParamInfos(newTypes, newNames, newDefaultValues);
int[] newIndices= {2};
-//{ObjectTeams: avoid keyword "as" - renamed to "a_of_string"
+//{ObjectTeams: avoid keyword "as" - renamed to "a_of_string"
String[] oldParamNames= {"li", OT_NAME};
String[] newParamNames= {"li", OT_NAME};
// SH}
@@ -56,7 +56,7 @@ public team class JdtTests {
within (this) // OT: enable nested role ContentPatching
helperDoAll("A", "m", signature, newParamInfo, newIndices, oldParamNames, newParamNames, newParameterTypeNames, permutation, newVisibility, deletedIndices, newReturnTypeName);
}
-
+
protected class ContentPatching playedBy RefactoringTest {
String getFileContents(String fileName) <- replace String getFileContents(String fileName);
@@ -65,7 +65,7 @@ public team class JdtTests {
String orig = base.getFileContents(fileName);
// word "as" appears after " ", "\t" and "(", but don't replace in "class":
return orig.replaceAll("([ \t(])as", "$1"+OT_NAME);
- }
+ }
}
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractcallin/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractcallin/AllTests.java
index 779332965..7d3d34602 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractcallin/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractcallin/AllTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -40,7 +40,7 @@ public class AllTests
"All OT-ExtractCallin-Refactoring Tests");
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.extractcallin.ExtractCallinTests.suite());
-
+
return suite;
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractcallin/ExtractCallinTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractcallin/ExtractCallinTests.java
index f092d0d29..67dd2028c 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractcallin/ExtractCallinTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractcallin/ExtractCallinTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -37,7 +37,7 @@ import org.eclipse.objectteams.otdt.ui.tests.refactoring.RefactoringTest;
/**
* @author Johannes Gebauer
- *
+ *
*/
@SuppressWarnings("restriction")
public class ExtractCallinTests extends RefactoringTest {
@@ -80,9 +80,9 @@ public class ExtractCallinTests extends RefactoringTest {
assertTrue("activation", ref.checkInitialConditions(new NullProgressMonitor()).isOK());
ref.setDeleteBaseMethod(deleteRoleMethod);
-
+
ref.setCopyBaseMethod(copyBaseMethod);
-
+
RefactoringStatus checkInputResult = ref.checkFinalConditions(new NullProgressMonitor());
assertTrue("precondition was supposed to pass", !checkInputResult.hasError());
performChange(ref, false);
@@ -104,27 +104,27 @@ public class ExtractCallinTests extends RefactoringTest {
/******* tests ******************/
/* Extract Callin Tests */
-
+
public void testExtractSimpleBeforeCallin() throws Exception {
performPullUp_pass(new String[] { "B", "T" }, "m", new String[0], CallinMapping.KIND_BEFORE, false, "B", "R", false);
}
-
+
public void testExtractSimpleReplaceCallin1() throws Exception {
performPullUp_pass(new String[] { "B", "T" }, "m", new String[0], CallinMapping.KIND_REPLACE, false, "B", "R", true);
}
-
+
public void testExtractSimpleAfterCallin() throws Exception {
performPullUp_pass(new String[] { "B", "T" }, "m", new String[0], CallinMapping.KIND_AFTER, false, "B", "R", false);
}
-
+
public void testExtractSimpleReplaceCallin2() throws Exception {
performPullUp_pass(new String[] { "B", "T" }, "m", new String[0], CallinMapping.KIND_REPLACE, false, "B", "R", false);
}
-
+
public void testExtractCallinWithParameter() throws Exception {
performPullUp_pass(new String[] { "B", "T" }, "m", new String[] { "I" }, CallinMapping.KIND_BEFORE, false, "B", "R", false);
}
-
+
public void testExtractCallinWithParameterMapping() throws Exception {
performPullUp_pass(new String[] { "B", "T" }, "m", new String[] { "I", "I" }, CallinMapping.KIND_BEFORE, false, "B", "R", false);
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/AbstractSelectionTestCase.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/AbstractSelectionTestCase.java
index 3ec2b392f..c4a638d72 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/AbstractSelectionTestCase.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/AbstractSelectionTestCase.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -54,11 +54,11 @@ public abstract class AbstractSelectionTestCase extends AbstractCUTestCase
public static final int SQUARE_BRACKET_OPEN_LENGTH = SQUARE_BRACKET_OPEN.length();
public static final String SQUARE_BRACKET_CLOSE = "/*]*/";
public static final int SQUARE_BRACKET_CLOSE_LENGTH = SQUARE_BRACKET_CLOSE.length();
-
+
protected static final int VALID_SELECTION = 1;
protected static final int INVALID_SELECTION = 2;
protected static final int COMPARE_WITH_OUTPUT = 3;
-
+
public AbstractSelectionTestCase(String name)
{
super(name);
@@ -81,7 +81,7 @@ public abstract class AbstractSelectionTestCase extends AbstractCUTestCase
{
excludingStart = -1;
}
-
+
if (includingEnd < excludingEnd)
{
includingEnd = -1;
@@ -90,7 +90,7 @@ public abstract class AbstractSelectionTestCase extends AbstractCUTestCase
{
excludingEnd = -1;
}
-
+
if (includingStart != -1)
{
start = includingStart;
@@ -99,7 +99,7 @@ public abstract class AbstractSelectionTestCase extends AbstractCUTestCase
{
start = excludingStart + SQUARE_BRACKET_CLOSE_LENGTH;
}
-
+
if (excludingEnd != -1)
{
end = excludingEnd;
@@ -108,37 +108,37 @@ public abstract class AbstractSelectionTestCase extends AbstractCUTestCase
{
end = includingEnd + SQUARE_BRACKET_CLOSE_LENGTH;
}
-
+
assertTrue("Selection invalid", start >= 0 && end >= 0 && end >= start);
-
- int[] result = new int[] { start, end - start };
+
+ int[] result = new int[] { start, end - start };
// System.out.println("|"+ source.substring(result[0], result[0] + result[1]) + "|");
return result;
}
-
+
protected ITextSelection getTextSelection(String source)
{
int[] s = getSelection(source);
return new TextSelection(s[0], s[1]);
}
-
+
protected InputStream getFileInputStream(String fileName) throws IOException
{
return OTRefactoringTestPlugin.getDefault().getTestResourceStream(fileName);
}
-
-//{ObjectTeams: fixing a JDT-problem: couldn't cope with package paths > 1
+
+//{ObjectTeams: fixing a JDT-problem: couldn't cope with package paths > 1
protected ICompilationUnit createCU(IPackageFragment pack, String name) throws Exception {
name= adaptName(name);
return createCU(pack, name, getFileInputStream(myGetFilePath(pack, name)));
}
-
+
protected String myGetFilePath(String path, String name) {
return getResourceLocation() + path + "/" + name;
}
-
+
protected String myGetFilePath(IPackageFragment pack, String name) {
- return myGetFilePath(pack.getElementName().replace('.','/'), name); // <-- the patch: force the package path to use '/'
+ return myGetFilePath(pack.getElementName().replace('.','/'), name); // <-- the patch: force the package path to use '/'
}
// SH}
@@ -162,7 +162,7 @@ public abstract class AbstractSelectionTestCase extends AbstractCUTestCase
IUndoManager undoManager = RefactoringCore.getUndoManager();
undoManager.flush();
String original = unit.getSource();
-
+
PerformRefactoringOperation op = new PerformRefactoringOperation(
refactoring, getCheckingStyle());
JavaCore.run(op, new NullProgressMonitor());
@@ -181,10 +181,10 @@ public abstract class AbstractSelectionTestCase extends AbstractCUTestCase
assertTrue("Undo manager is empty", undoManager.anythingToRedo());
compareSource(original, unit.getSource());
}
- break;
+ break;
}
}
-
+
protected RefactoringStatus checkPreconditions(
Refactoring refactoring,
IProgressMonitor pm) throws CoreException
@@ -194,7 +194,7 @@ public abstract class AbstractSelectionTestCase extends AbstractCUTestCase
op.run(new NullProgressMonitor());
return op.getStatus();
}
-
+
protected int getCheckingStyle()
{
return CheckConditionsOperation.ALL_CONDITIONS;
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/AllTests.java
index ebdcfdd84..b6f90134d 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/AllTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -28,7 +28,7 @@ import junit.framework.TestSuite;
/**
* @author brcan
- *
+ *
* Runs all OT-specific refactoring tests and corresponding eclipse refactoring tests
*/
public class AllTests
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/ExtractMethodRefactoringUtilTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/ExtractMethodRefactoringUtilTests.java
index c4737183b..213618621 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/ExtractMethodRefactoringUtilTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/ExtractMethodRefactoringUtilTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -46,7 +46,7 @@ import org.eclipse.objectteams.otdt.ui.tests.refactoring.FileBasedRefactoringTes
/**
* @author brcan
- *
+ *
*/
@SuppressWarnings( { "restriction", "nls" })
public class ExtractMethodRefactoringUtilTests extends FileBasedRefactoringTest {
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/ExtractMethodTestSetup.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/ExtractMethodTestSetup.java
index d9667c8e9..dbf12fa7c 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/ExtractMethodTestSetup.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/ExtractMethodTestSetup.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -52,7 +52,7 @@ public class ExtractMethodTestSetup extends TestSetup
private static final String CONTAINER = "src";
// private IPackageFragment _selectionPackage;
-
+
private IPackageFragment _teamClassPackage;
private IPackageFragment _roleClassPackage;
private IPackageFragment _nestedTeamPackage;
@@ -61,12 +61,12 @@ public class ExtractMethodTestSetup extends TestSetup
private IPackageFragment _focusTypePackage;
private IPackageFragment _overloadingPackage;
private IPackageFragment _syntaxPackage;
-
+
public ExtractMethodTestSetup(Test test)
{
super(test);
}
-
+
public IPackageFragmentRoot getRoot() {
return _root;
}
@@ -80,12 +80,12 @@ public class ExtractMethodTestSetup extends TestSetup
options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4");
JavaCore.setOptions(options);
TestOptions.initializeCodeGenerationOptions();
- JavaPlugin.getDefault().getCodeTemplateStore().load();
-
+ JavaPlugin.getDefault().getCodeTemplateStore().load();
+
_javaProject = JavaProjectHelper.createOTJavaProject("TestProject", "bin");
JavaProjectHelper.addRTJar(_javaProject);
_root = JavaProjectHelper.addSourceContainer(_javaProject, CONTAINER);
-
+
RefactoringCore.getUndoManager().flush();
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IWorkspaceDescription description = workspace.getDescription();
@@ -110,7 +110,7 @@ public class ExtractMethodTestSetup extends TestSetup
JavaProjectHelper.performDummySearch(_javaProject);
JavaProjectHelper.delete(_javaProject);
}
-
+
// public IPackageFragment getSelectionPackage()
// {
// return _selectionPackage;
@@ -125,7 +125,7 @@ public class ExtractMethodTestSetup extends TestSetup
{
return _roleClassPackage;
}
-
+
public IPackageFragment getNestedTeamPackage()
{
return _nestedTeamPackage;
@@ -140,12 +140,12 @@ public class ExtractMethodTestSetup extends TestSetup
{
return _rolefileParentPackage;
}
-
+
public IPackageFragment getFocusTypePackage()
{
return _focusTypePackage;
}
-
+
public IPackageFragment getOverloadingPackage()
{
return _overloadingPackage;
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/ExtractMethodTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/ExtractMethodTests.java
index 841a130d9..0f8a78dfe 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/ExtractMethodTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/ExtractMethodTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -42,13 +42,13 @@ import org.eclipse.jdt.internal.corext.refactoring.code.ExtractMethodRefactoring
/**
* @author brcan
- *
+ *
*/
@SuppressWarnings({ "nls", "restriction" })
public class ExtractMethodTests extends AbstractSelectionTestCase
{
private static ExtractMethodTestSetup _testSetup;
-
+
public ExtractMethodTests(String name)
{
super(name);
@@ -64,12 +64,12 @@ public class ExtractMethodTests extends AbstractSelectionTestCase
{
return _testSetup.getRoot();
}
-
+
protected String getResourceLocation()
{
return "ExtractMethod/";
}
-
+
protected String adaptName(String name)
{
if (getName().startsWith("testFocusType"))
@@ -77,8 +77,8 @@ public class ExtractMethodTests extends AbstractSelectionTestCase
return super.adaptName(name);
}
return name + "_" + getName() + ".java";
- }
-
+ }
+
// protected void selectionTest(int startLine, int startColumn, int endLine, int endColumn)
// throws Exception
// {
@@ -90,12 +90,12 @@ public class ExtractMethodTests extends AbstractSelectionTestCase
// assertEquals(expected.getOffset(), selection[0]);
// assertEquals(expected.getLength(), selection[1]);
// }
-//
+//
// private IPackageFragment getSelectionPackage() throws JavaModelException
// {
// return _testSetup.getSelectionPackage();
// }
-
+
protected void performTest(
IPackageFragment packageFragment,
String[] ids,
@@ -104,7 +104,7 @@ public class ExtractMethodTests extends AbstractSelectionTestCase
{
performTest(packageFragment, ids, mode, outputFolder, null, null, 0);
}
-
+
protected void performTest(
IPackageFragment packageFragment,
String[] ids,
@@ -156,24 +156,24 @@ public class ExtractMethodTests extends AbstractSelectionTestCase
}
}
refactoring.setDestination(destination);
-
+
String out = null;
switch (mode)
{
case COMPARE_WITH_OUTPUT:
out = getProofedContent(outputFolder, ids[0]);
- break;
+ break;
}
performTest(compUnits[0], refactoring, mode, out, true);
}
-
+
private ICompilationUnit[] createCUs(
IPackageFragment packageFragment,
String[] ids)
throws Exception
{
ICompilationUnit[] cus = new ICompilationUnit[ids.length];
-
+
for (int idx = 0; idx < ids.length; idx++)
{
Assert.isNotNull(ids[idx]);
@@ -201,7 +201,7 @@ public class ExtractMethodTests extends AbstractSelectionTestCase
COMPARE_WITH_OUTPUT,
"team_out");
}
- //extract expression in team
+ //extract expression in team
public void testTeamclass2() throws Exception
{
performTest(
@@ -245,7 +245,7 @@ public class ExtractMethodTests extends AbstractSelectionTestCase
performTest(
_testSetup.getNestedTeamPackage(),
new String[]{"T1"},
- COMPARE_WITH_OUTPUT,
+ COMPARE_WITH_OUTPUT,
"nestedTeam_out");
}
//extract method invocation in inner role of unbound nested team
@@ -254,7 +254,7 @@ public class ExtractMethodTests extends AbstractSelectionTestCase
performTest(
_testSetup.getNestedTeamPackage(),
new String[]{"T1"},
- COMPARE_WITH_OUTPUT,
+ COMPARE_WITH_OUTPUT,
"nestedTeam_out");
}
@@ -278,7 +278,7 @@ public class ExtractMethodTests extends AbstractSelectionTestCase
"nestedTeam_out");
}
//extract method invocation in bound inner role of nested team ->
- //ambiguous base method spec
+ //ambiguous base method spec
public void testNestedTeam5() throws Exception
{
performTest(
@@ -288,7 +288,7 @@ public class ExtractMethodTests extends AbstractSelectionTestCase
"nestedTeam_out");
}
//extract method invocation in bound inner role of nested team ->
- //ambiguous role method spec
+ //ambiguous role method spec
public void testNestedTeam6() throws Exception
{
performTest(
@@ -297,7 +297,7 @@ public class ExtractMethodTests extends AbstractSelectionTestCase
INVALID_SELECTION,
"nestedTeam_out");
}
-
+
//=====================================================================================
// Testing role files
//=====================================================================================
@@ -334,7 +334,7 @@ public class ExtractMethodTests extends AbstractSelectionTestCase
}
// =====================================================================================
// Testing overloading and/or ambiguity for different focus types
- // =====================================================================================
+ // =====================================================================================
//focus implicit role hierarchy
public void testFocusTypeIsSuperroleInRoleHierarchy() throws Exception
@@ -345,7 +345,7 @@ public class ExtractMethodTests extends AbstractSelectionTestCase
INVALID_SELECTION,
"focusType_out");
}
-
+
public void testFocusTypeIsMiddleRoleInRoleHierarchy() throws Exception
{
performTest(
@@ -371,9 +371,9 @@ public class ExtractMethodTests extends AbstractSelectionTestCase
_testSetup.getFocusTypePackage(),
new String[] {"A", "B", "C", "T1", "T2", "T3"},
INVALID_SELECTION,
- "focusType_out");
+ "focusType_out");
}
-
+
public void testFocusTypeIsMiddleBasetypeInBaseHierarchy() throws Exception
{
performTest(
@@ -382,7 +382,7 @@ public class ExtractMethodTests extends AbstractSelectionTestCase
INVALID_SELECTION,
"focusType_out");
}
-
+
public void testFocusTypeIsLowestBasetypeInBaseHierarchy() throws Exception
{
performTest(
@@ -391,7 +391,7 @@ public class ExtractMethodTests extends AbstractSelectionTestCase
INVALID_SELECTION,
"focusType_out");
}
-
+
//focus team hierarchy
public void testFocusTypeIsSuperteamInTeamHierachy() throws Exception
{
@@ -401,7 +401,7 @@ public class ExtractMethodTests extends AbstractSelectionTestCase
INVALID_SELECTION,
"focusType_out");
}
-
+
public void testFocusTypeIsMiddleTeamInTeamHierachy() throws Exception
{
performTest(
@@ -429,7 +429,7 @@ public class ExtractMethodTests extends AbstractSelectionTestCase
INVALID_SELECTION,
"overloading_out");
}
-
+
// role is a indirect subclass of target class, explicit + implicit inheritance, short methodSpec
public void test21() throws Exception
{
@@ -439,7 +439,7 @@ public class ExtractMethodTests extends AbstractSelectionTestCase
INVALID_SELECTION,
"overloading_out");
}
-
+
// role is a indirect subclass of target class, explicit + implicit inheritance, long methodSpec
public void test22() throws Exception
{
@@ -449,8 +449,8 @@ public class ExtractMethodTests extends AbstractSelectionTestCase
COMPARE_WITH_OUTPUT,
"overloading_out");
}
-
- // bound base class is target class, short methodSpec
+
+ // bound base class is target class, short methodSpec
public void test23() throws Exception
{
performTest(
@@ -459,7 +459,7 @@ public class ExtractMethodTests extends AbstractSelectionTestCase
INVALID_SELECTION,
"overloading_out");
}
-
+
// bound base class is direct/indirect subclass of target class, short methodSpec
public void test24() throws Exception
{
@@ -469,7 +469,7 @@ public class ExtractMethodTests extends AbstractSelectionTestCase
INVALID_SELECTION,
"overloading_out");
}
-
+
// base class is subclass of target class, long methodSpec
public void test25() throws Exception
{
@@ -482,7 +482,7 @@ public class ExtractMethodTests extends AbstractSelectionTestCase
// =====================================================================================
// Testing special syntactic nodes
- // =====================================================================================
+ // =====================================================================================
// call target is a declared-lifting argument
public void testDeclaredLifting1() throws Exception
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/ExtractTempTestSetup.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/ExtractTempTestSetup.java
index 809cc1f50..b0f481d00 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/ExtractTempTestSetup.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/ExtractTempTestSetup.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -56,7 +56,7 @@ public class ExtractTempTestSetup extends TestSetup
{
super(test);
}
-
+
public IPackageFragmentRoot getRoot() {
return _root;
}
@@ -69,12 +69,12 @@ public class ExtractTempTestSetup extends TestSetup
options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4");
JavaCore.setOptions(options);
TestOptions.initializeCodeGenerationOptions();
- JavaPlugin.getDefault().getCodeTemplateStore().load();
-
+ JavaPlugin.getDefault().getCodeTemplateStore().load();
+
_javaProject = JavaProjectHelper.createOTJavaProject("TestProject", "bin");
JavaProjectHelper.addRTJar(_javaProject);
_root = JavaProjectHelper.addSourceContainer(_javaProject, CONTAINER);
-
+
RefactoringCore.getUndoManager().flush();
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IWorkspaceDescription description = workspace.getDescription();
@@ -90,7 +90,7 @@ public class ExtractTempTestSetup extends TestSetup
JavaProjectHelper.performDummySearch(_javaProject);
JavaProjectHelper.delete(_javaProject);
}
-
+
public IPackageFragment getStatementsPackage()
{
return _statementsPackage;
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/ExtractTempTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/ExtractTempTests.java
index 6540747ef..d07f7d710 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/ExtractTempTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/ExtractTempTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -38,7 +38,7 @@ import org.eclipse.ltk.core.refactoring.RefactoringStatus;
/**
* @author stephan
- *
+ *
*/
@SuppressWarnings("restriction")
public class ExtractTempTests extends AbstractSelectionTestCase
@@ -60,12 +60,12 @@ public class ExtractTempTests extends AbstractSelectionTestCase
{
return _testSetup.getRoot();
}
-
+
protected String getResourceLocation()
{
return "ExtractTemp/";
}
-
+
protected String adaptName(String name)
{
if (getName().startsWith("testFocusType"))
@@ -73,8 +73,8 @@ public class ExtractTempTests extends AbstractSelectionTestCase
return super.adaptName(name);
}
return name + "_" + getName() + ".java";
- }
-
+ }
+
protected void performTest(
int startLine,
int startColumn,
@@ -85,12 +85,12 @@ public class ExtractTempTests extends AbstractSelectionTestCase
{
performTest(_testSetup.getStatementsPackage(),
new String[]{"T"},
- startLine,
- startColumn, endLine, endColumn,
- COMPARE_WITH_OUTPUT, declareFinal,
+ startLine,
+ startColumn, endLine, endColumn,
+ COMPARE_WITH_OUTPUT, declareFinal,
outputFolder);
}
-
+
protected void performTest(
IPackageFragment packageFragment,
String[] ids,
@@ -103,7 +103,7 @@ public class ExtractTempTests extends AbstractSelectionTestCase
{
performTest(packageFragment, ids, startLine, startColumn, endLine, endColumn, mode, false, outputFolder);
}
-
+
protected void performTest(
IPackageFragment packageFragment,
String[] ids,
@@ -134,24 +134,24 @@ public class ExtractTempTests extends AbstractSelectionTestCase
if (!status.isOK())
return;
}
-
+
String out = null;
switch (mode)
{
case COMPARE_WITH_OUTPUT:
out = getProofedContent(outputFolder, ids[0]);
- break;
+ break;
}
performTest(compUnits[0], refactoring, mode, out, true);
}
-
+
private ICompilationUnit[] createCUs(
IPackageFragment packageFragment,
String[] ids)
throws Exception
{
ICompilationUnit[] cus = new ICompilationUnit[ids.length];
-
+
for (int idx = 0; idx < ids.length; idx++)
{
Assert.isNotNull(ids[idx]);
@@ -184,9 +184,9 @@ public class ExtractTempTests extends AbstractSelectionTestCase
false,
"statements_out");
}
-
+
// two element path, extracted is a dependent type
- public void testTypeAnchor1() throws Exception
+ public void testTypeAnchor1() throws Exception
{
performTest(15,13,15,18,
true,
@@ -194,7 +194,7 @@ public class ExtractTempTests extends AbstractSelectionTestCase
}
// three element path, extracted is not a dependent type
- public void testTypeAnchor2() throws Exception
+ public void testTypeAnchor2() throws Exception
{
performTest(21,13,21,20,
true,
@@ -202,7 +202,7 @@ public class ExtractTempTests extends AbstractSelectionTestCase
}
// three element path, extracted is a dependent type
- public void testTypeAnchor3() throws Exception
+ public void testTypeAnchor3() throws Exception
{
performTest(19,13,19,20,
true,
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/inlinecallin/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/inlinecallin/AllTests.java
index fda71df73..f8218a545 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/inlinecallin/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/inlinecallin/AllTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -40,7 +40,7 @@ public class AllTests
"All OT-InlineCallin-Refactoring Tests");
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.inlinecallin.InlineCallinTests.suite());
-
+
return suite;
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/inlinecallin/InlineCallinTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/inlinecallin/InlineCallinTests.java
index 0c43314b3..b6373a423 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/inlinecallin/InlineCallinTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/inlinecallin/InlineCallinTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -42,7 +42,7 @@ import org.eclipse.objectteams.otdt.ui.tests.refactoring.MySetup;
import org.eclipse.objectteams.otdt.ui.tests.refactoring.RefactoringTest;
/**
- *
+ *
* @author Johannes Gebauer
*/
@SuppressWarnings("restriction")
@@ -79,7 +79,7 @@ public class InlineCallinTests extends RefactoringTest {
/**
* The <code>ICompilationUnit</code> containing the role that defines the
* <code>ICallinMapping</code> at position 0 and its base at position 1.
- *
+ *
*/
private void performInlineCallin_pass(String[] cuNames, String roleMethodName, String[] roleMethodSignature, String[] baseMethodNames, String[][] baseMethodSignatures,
int[] mappingKinds, boolean deleteRoleMethod, String roleName, String baseName) throws Exception {
@@ -98,7 +98,7 @@ public class InlineCallinTests extends RefactoringTest {
assertTrue("base method " + baseMethods[i].getElementName() + " does not exist", baseMethods[i].exists());
}
-
+
ICallinMapping[] mappings = new ICallinMapping[baseMethodNames.length];
for (int i = 0; i < mappings.length; i++) {
mappings[i] = getCallinMethodMapping(roleType, roleMethod, baseMethods[i], mappingKinds[i]);
@@ -110,7 +110,7 @@ public class InlineCallinTests extends RefactoringTest {
assertTrue("activation", ref.checkInitialConditions(new NullProgressMonitor()).isOK());
ref.setDeleteRoleMethod(deleteRoleMethod);
-
+
RefactoringStatus checkInputResult = ref.checkFinalConditions(new NullProgressMonitor());
assertTrue("precondition was supposed to pass", !checkInputResult.hasError());
performChange(ref, false);
@@ -128,11 +128,11 @@ public class InlineCallinTests extends RefactoringTest {
}
}
-
+
/**
* The <code>ICompilationUnit</code> containing the role that defines the
* <code>ICallinMapping</code> at position 0 and its base at position 1.
- *
+ *
*/
private void performInlineCallin_failing(String[] cuNames, String roleMethodName, String[] roleMethodSignature, String[] baseMethodNames,
String[][] baseMethodSignatures, int[] mappingKinds, boolean deleteRoleMethod, String roleName, String baseName) throws Exception {
@@ -163,12 +163,12 @@ public class InlineCallinTests extends RefactoringTest {
assertTrue("activation", ref.checkInitialConditions(new NullProgressMonitor()).isOK());
ref.setDeleteRoleMethod(deleteRoleMethod);
-
+
RefactoringStatus result = performRefactoring(ref);
assertNotNull("precondition was supposed to fail.", result);
assertTrue("precondition was supposed to fail.", !result.isOK());
assertNotNull("precondition result is expected to contain an error.", result.getEntryMatchingSeverity(RefactoringStatus.ERROR));
-
+
} finally {
performDummySearch();
for (int i = 0; i < cus.length; i++) {
@@ -181,13 +181,13 @@ public class InlineCallinTests extends RefactoringTest {
private ICallinMapping getCallinMethodMapping(IType roleType, IMethod roleMethod, IMethod baseMethod, int mappingKind) throws JavaModelException {
IRoleType role = (IRoleType) OTModelManager.getOTElement(roleType);
assertNotNull("type " + roleType.getElementName() + " is not a role", role);
-
+
IMethodMapping[] mappings = role.getMethodMappings();
-
+
for (int i = 0; i < mappings.length; i++) {
if (mappings[i] instanceof ICallinMapping) {
ICallinMapping mapping = (ICallinMapping) mappings[i];
-
+
for (int j = 0; j < mapping.getBoundBaseMethods().length; j++) {
IMethod roleMethod2 = mapping.getRoleMethod();
IMethod baseMethod2 = mapping.getBoundBaseMethods()[j];
@@ -199,12 +199,12 @@ public class InlineCallinTests extends RefactoringTest {
}
return null;
}
-
+
/******* tests ******************/
/* Inline Callin Tests */
-
+
public void testSimpleBeforeCallin() throws Exception {
performInlineCallin_pass(new String[] { "T", "B" }, "n", new String[0], new String[] { "m" }, new String[][] { new String[0] }, new int[] { CallinMapping.KIND_BEFORE }, false, "R", "B");
}
@@ -217,12 +217,12 @@ public class InlineCallinTests extends RefactoringTest {
public void testSimpleReplaceCallin() throws Exception {
performInlineCallin_pass(new String[] { "T", "B" }, "n", new String[0], new String[] { "m" }, new String[][] { new String[0] }, new int[] { CallinMapping.KIND_REPLACE }, false, "R", "B");
}
-
+
public void testAfterCallinWithReturn() throws Exception {
performInlineCallin_pass(new String[] { "T", "B" }, "n", new String[0], new String[] { "m" }, new String[][] { new String[0] },
new int[] { CallinMapping.KIND_AFTER }, false, "R", "B");
- }
-
+ }
+
public void testReplaceCallinResultTunneling1() throws Exception {
performInlineCallin_pass(new String[] { "T", "B" }, "n", new String[0], new String[] { "m" }, new String[][] { new String[0] },
new int[] { CallinMapping.KIND_REPLACE }, false, "R", "B");
@@ -231,25 +231,25 @@ public class InlineCallinTests extends RefactoringTest {
public void testReplaceCallinResultTunneling2() throws Exception {
performInlineCallin_pass(new String[] { "T", "B" }, "n", new String[0], new String[] { "m" }, new String[][] { new String[0] }, new int[] { CallinMapping.KIND_REPLACE }, false, "R", "B");
}
-
+
public void testReplaceCallinWithReturn() throws Exception {
performInlineCallin_pass(new String[] { "T", "B" }, "n", new String[0], new String[] { "m" }, new String[][] { new String[0] }, new int[] { CallinMapping.KIND_REPLACE }, false, "R", "B");
}
-
+
public void testDifferentParamNames() throws Exception {
performInlineCallin_pass(new String[] { "T", "B" }, "n", new String[] { "I" }, new String[] { "m" }, new String[][] { new String[] { "I" } }, new int[] { CallinMapping.KIND_REPLACE }, false, "R", "B");
- }
-
+ }
+
public void testDifferentParamLength() throws Exception {
performInlineCallin_pass(new String[] { "T", "B" }, "n", new String[] { "I" }, new String[] { "m" }, new String[][] { new String[] { "I", "QString;" } }, new int[] { CallinMapping.KIND_REPLACE }, false, "R",
"B");
- }
-
+ }
+
public void testDifferentParamLengthBeforeCallin() throws Exception {
performInlineCallin_pass(new String[] { "T", "B" }, "n", new String[] { "I" }, new String[] { "m" }, new String[][] { new String[] { "I", "QString;" } }, new int[] { CallinMapping.KIND_BEFORE }, false, "R",
"B");
- }
-
+ }
+
public void testSimpleParameterMapping() throws Exception {
performInlineCallin_pass(new String[] { "T", "B" }, "n", new String[] { "I" }, new String[] { "m" }, new String[][] { new String[] { "I", "I" } },
new int[] { CallinMapping.KIND_AFTER }, false, "R", "B");
@@ -259,83 +259,83 @@ public class InlineCallinTests extends RefactoringTest {
performInlineCallin_pass(new String[] { "T", "B" }, "n", new String[] { "I" }, new String[] { "m" }, new String[][] { new String[] { "I", "I" } },
new int[] { CallinMapping.KIND_REPLACE }, false, "R", "B");
}
-
+
public void testReplaceCallinWithMultipleReturns() throws Exception {
performInlineCallin_pass(new String[] { "T", "B" }, "n", new String[0], new String[] { "m" }, new String[][] { new String[0] },
new int[] { CallinMapping.KIND_REPLACE }, false, "R", "B");
}
-
+
public void testReplaceCallinWithParameter() throws Exception {
performInlineCallin_pass(new String[] { "T", "B" }, "n", new String[] { "I", "QString;" }, new String[] { "m" }, new String[][] { new String[] { "I", "QString;" } }, new int[] { CallinMapping.KIND_REPLACE },
false, "R", "B");
}
-
+
public void testCallinMappingWithSignature() throws Exception {
performInlineCallin_pass(new String[] { "T", "B" }, "n", new String[0], new String[] { "m" }, new String[][] { new String[0] },
new int[] { CallinMapping.KIND_AFTER }, false, "R", "B");
}
-
+
public void testMultipleBaseMethodCallin() throws Exception {
performInlineCallin_pass(new String[] { "T", "B" }, "n", new String[0], new String[] { "m" }, new String[][] { new String[0] },
new int[] { CallinMapping.KIND_AFTER }, false, "R", "B");
}
-
+
public void testRoleMethodReferencesCallout() throws Exception {
performInlineCallin_pass(new String[] { "T", "B" }, "n", new String[0], new String[] { "m" }, new String[][] { new String[0] },
new int[] { CallinMapping.KIND_AFTER }, false, "R", "B");
}
-
+
public void testRoleMethodReferencesCalloutToFieldGet() throws Exception {
performInlineCallin_pass(new String[] { "T", "B" }, "n", new String[0], new String[] { "m" }, new String[][] { new String[0] },
new int[] { CallinMapping.KIND_AFTER }, false, "R", "B");
}
-
+
public void testRoleMethodReferencesCalloutToFieldSet() throws Exception {
performInlineCallin_pass(new String[] { "T", "B" }, "n", new String[0], new String[] { "m" }, new String[][] { new String[0] },
new int[] { CallinMapping.KIND_AFTER }, false, "R", "B");
}
-
+
public void testParameterTunneling1() throws Exception {
performInlineCallin_pass(new String[] { "T", "B" }, "n", new String[0], new String[] { "m" }, new String[][] { new String[] { "I" } }, new int[] { CallinMapping.KIND_REPLACE }, false, "R", "B");
- }
-
+ }
+
public void testParameterTunneling2() throws Exception {
performInlineCallin_pass(new String[] { "T", "B" }, "n", new String[0], new String[] { "m" }, new String[][] { new String[] { "I" } }, new int[] { CallinMapping.KIND_REPLACE }, false, "R", "B");
- }
-
+ }
+
public void testInlineMultipleCallins() throws Exception {
performInlineCallin_pass(new String[] { "T", "B" }, "n", new String[0], new String[] { "m1", "m2" }, new String[][] { new String[0], new String[0] },
new int[] { CallinMapping.KIND_AFTER, CallinMapping.KIND_AFTER }, false, "R", "B");
}
-
+
public void testDeleteRoleMethod() throws Exception {
performInlineCallin_pass(new String[] { "T", "B" }, "n", new String[0], new String[] { "m" }, new String[][] { new String[0] },
new int[] { CallinMapping.KIND_REPLACE }, true, "R", "B");
}
-
+
public void testDeleteReferencedRoleMethod() throws Exception {
performInlineCallin_failing(new String[] { "T", "B" }, "n", new String[0], new String[] { "m" }, new String[][] { new String[0] },
new int[] { CallinMapping.KIND_BEFORE }, true, "R", "B");
}
-
+
public void testInlineBoundCallin1() throws Exception {
performInlineCallin_failing(new String[] { "T1", "B", "T2" }, "n", new String[0], new String[] { "m" }, new String[][] { new String[0] },
new int[] { CallinMapping.KIND_REPLACE }, false, "R", "B");
}
-
+
public void testInlineBoundCallin2() throws Exception {
performInlineCallin_failing(new String[] { "T1", "B", "T2" }, "n", new String[0], new String[] { "m" }, new String[][] { new String[0] },
new int[] { CallinMapping.KIND_REPLACE }, false, "R", "B");
}
-
+
public void testDependencyToRole1() throws Exception {
performInlineCallin_failing(new String[] { "T", "B" }, "n", new String[0], new String[] { "m" }, new String[][] { new String[0] },
new int[] { CallinMapping.KIND_BEFORE }, false, "R", "B");
}
-
+
public void testDependencyToRole2() throws Exception {
performInlineCallin_failing(new String[] { "T", "B" }, "n", new String[0], new String[] { "m" }, new String[][] { new String[0] },
new int[] { CallinMapping.KIND_BEFORE }, false, "R", "B");
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/misc/ChangeSignatureTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/misc/ChangeSignatureTests.java
index 6d7ae14ec..5b9f0b80c 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/misc/ChangeSignatureTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/misc/ChangeSignatureTests.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010 GK Software AG
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -50,12 +50,12 @@ import org.eclipse.objectteams.otdt.ui.tests.refactoring.RefactoringTest;
* Some helper methods in this class have been inspired by the test class
* <code>ChangeSignatureTests</code> in the test suite
* <code>org.eclipse.jdt.ui.tests.refactoring</code> provided by Eclipse JDT.
- *
+ *
* @author stephan
*/
@SuppressWarnings("restriction")
public class ChangeSignatureTests extends RefactoringTest {
-
+
private static final String REFACTORING_PATH = "ChangeSignature/";
public ChangeSignatureTests(String name) {
@@ -170,7 +170,7 @@ public class ChangeSignatureTests extends RefactoringTest {
}
void helperDelete(ICompilationUnit cu, IType declaringClass, String[] signature, int[] deleteIndices, boolean createDelegate, String expectedInfo)
- throws JavaModelException, CoreException, Exception, IOException
+ throws JavaModelException, CoreException, Exception, IOException
{
IMethod method = declaringClass.getMethod("m", signature);
assertTrue("method does not exist", method.exists());
@@ -202,7 +202,7 @@ public class ChangeSignatureTests extends RefactoringTest {
}
void helperRename(ICompilationUnit cu, IType declaringClass, String[] signature, int idx, String oldName, String newName, String expectedInfo)
- throws JavaModelException, CoreException, Exception, IOException
+ throws JavaModelException, CoreException, Exception, IOException
{
IMethod method = declaringClass.getMethod("m", signature);
assertTrue("method does not exist", method.exists());
@@ -234,7 +234,7 @@ public class ChangeSignatureTests extends RefactoringTest {
// from RenameTempTests with adaptation:
private void helperRegularRename(String newName, boolean updateReferences, IJavaElement element, ICompilationUnit cu,
// new for OT: don't use automatic outfile name
- String outFileName)
+ String outFileName)
throws Exception
{
assertTrue(element.getClass().toString(), element instanceof ILocalVariable);
@@ -340,7 +340,7 @@ public class ChangeSignatureTests extends RefactoringTest {
assertNotNull("precondition was supposed to have an error", result);
assertFalse("result was not supposed to be OK", result.isOK());
} else {
- assertEquals("precondition was supposed to pass", null, result);
+ assertEquals("precondition was supposed to pass", null, result);
}
IPackageFragment pack= (IPackageFragment)cu.getParent();
@@ -446,7 +446,7 @@ public class ChangeSignatureTests extends RefactoringTest {
helperRename(cu, teamType, new String[]{"QA;"}, 0, "arg", "renamed", null);
}
- // simulate performing the same operation as testRename01() triggered by Shift-Alt-R:
+ // simulate performing the same operation as testRename01() triggered by Shift-Alt-R:
public void testRename01a() throws Exception {
boolean canRename = true;
String simpleTestFileName = "A_testRename01_in.java";
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/AllTests.java
index 458478a93..7f0696912 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/AllTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -28,7 +28,7 @@ import junit.framework.TestSuite;
/**
* @author brcan
- *
+ *
* Runs all OT-specific refactoring tests for this package (move)
*/
public class AllTests
@@ -48,7 +48,7 @@ public class AllTests
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.move.MoveStaticMethodTests.suite());
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.move.MoveRoleTests.suite());
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.move.MoveBaseClassTests.suite());
-
+
return suite;
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveBaseClassTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveBaseClassTests.java
index 855e2014b..424878010 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveBaseClassTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveBaseClassTests.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2012 Stephan Herrmann.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -44,39 +44,39 @@ public team class MoveBaseClassTests extends TestCase {
@SuppressWarnings("decapsulation")
protected class MoveBaseClass playedBy MoveTest {
-
+
void setUp() -> void setUp();
void tearDown() -> void tearDown();
-
+
public MoveBaseClass() {
base(MoveBaseClass.class.getName());
}
-
+
@SuppressWarnings("inferredcallout")
public void testDestination_yes_baseTypeToDifferentPackage() throws Exception{
ParticipantTesting.reset();
IPackageFragment packB = getRoot().createPackageFragment("b", true, null);
IPackageFragment packBTemp = getRoot().createPackageFragment("b.temp", true, null);
ICompilationUnit cuB= packB.createCompilationUnit("B.java", "package b;public class B {}", true, null);
- ICompilationUnit cuT= getPackageP().createCompilationUnit("T1.java",
+ ICompilationUnit cuT= getPackageP().createCompilationUnit("T1.java",
"package p;\n" +
"import base b.B;\n" +
- "team class T1{void foo(){}protected class Role playedBy B{}}",
+ "team class T1{void foo(){}protected class Role playedBy B{}}",
false, new NullProgressMonitor());
IType baseType = cuB.getTypes()[0];
IJavaElement[] javaElements= {baseType};
IResource[] resources= {};
JavaMoveProcessor ref= verifyEnabled(resources, javaElements, createReorgQueries());
-
+
Object destination= packBTemp;
verifyValidDestination(ref, destination);
-
+
RefactoringStatus status= performRefactoring(ref, true);
assertEquals(null, status);
-
+
// expect that base import has been updated in cuT:
- String expectedSource2=
+ String expectedSource2=
"package p;\n" +
"import base b.temp.B;\n" +
"team class T1{void foo(){}protected class Role playedBy B{}}";
@@ -104,13 +104,13 @@ public team class MoveBaseClassTests extends TestCase {
setupProject();
this.mover.setUp();
}
-
+
@Override
protected void tearDown() throws Exception {
super.tearDown();
this.mover.tearDown();
}
-
+
void setupProject() throws Exception {
if (!this.projectInitialized) {
this.projectInitialized = true;
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveInstanceMethodTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveInstanceMethodTests.java
index 9b41ff1aa..39568d77b 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveInstanceMethodTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveInstanceMethodTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -45,7 +45,7 @@ import org.eclipse.objectteams.otdt.ui.tests.refactoring.RefactoringTest;
/**
* @author brcan
- *
+ *
*/
@SuppressWarnings({ "restriction", "nls" })
public class MoveInstanceMethodTests extends RefactoringTest
@@ -174,12 +174,12 @@ public class MoveInstanceMethodTests extends RefactoringTest
}
assertTrue("precondition was supposed to pass", preconditionResult
.isOK());
-
+
assertFalse("no warnings expected", preconditionResult.hasWarning());
} else {
assertTrue("warning expected", preconditionResult.hasWarning());
}
-
+
performChange(ref, false);
for (int idx = 0; idx < cus.length; idx++)
{
@@ -232,7 +232,7 @@ public class MoveInstanceMethodTests extends RefactoringTest
preconditionResult.merge(ref.checkFinalConditions(new NullProgressMonitor()));
assertTrue("expected a warning", preconditionResult.hasInfo());
assertEquals("expected specific warning", expectedWarning, preconditionResult.getMessageMatchingSeverity(RefactoringStatus.INFO));
-
+
performChange(ref, false);
for (int idx = 0; idx < cus.length; idx++)
{
@@ -253,7 +253,7 @@ public class MoveInstanceMethodTests extends RefactoringTest
Assert.isTrue(selectionCuIndex != -1,
"parameter selectionCuQName must match some String in cuQNames.");
performRefactoring_failing(cuQNames, selectionCuIndex, startLine, startColumn,
- endLine, endColumn, newReceiverType, newReceiverName,
+ endLine, endColumn, newReceiverType, newReceiverName,
null, inlineDelegator, removeDelegator, errorCode);
}
@@ -307,7 +307,7 @@ public class MoveInstanceMethodTests extends RefactoringTest
assertEquals(errorCode, result.getEntryMatchingSeverity(
RefactoringStatus.ERROR).getCode());
}
- }
+ }
private void performConditionChecking_warnings(
String[] cuQNames, String selectionCuQName,
@@ -360,7 +360,7 @@ public class MoveInstanceMethodTests extends RefactoringTest
assertEquals(errorCode, result.getEntryMatchingSeverity(
RefactoringStatus.WARNING).getCode());
}
- }
+ }
protected ICompilationUnit[] createCUs(String[] qualifiedNames)
throws Exception
@@ -426,7 +426,7 @@ public class MoveInstanceMethodTests extends RefactoringTest
}
/********** tests *********/
-// test method template
+// test method template
// public void test0() throws Exception
// {
// helper1(new String[] { "p1.A", "p2.B", "p3.C" }, "p1.A", 7, 17, 7, 20,
@@ -434,11 +434,11 @@ public class MoveInstanceMethodTests extends RefactoringTest
// }
// public void testFail0() throws Exception
// {
-// failHelper1("p1.IA", 5, 17, 5, 20, PARAMETER, "b", true, true, RefactoringStatusCodes.SELECT_METHOD_IMPLEMENTATION);
+// failHelper1("p1.IA", 5, 17, 5, 20, PARAMETER, "b", true, true, RefactoringStatusCodes.SELECT_METHOD_IMPLEMENTATION);
// }
// TODO(SH): more tests for combinations of inline,removeDelegate!
-
+
/* Testing receiver types */
public void testFieldNewReceiver() throws Exception {
performAndCheckSelectedCU_passing(new String[] { "p.A", "p.B" }, "p.A", 7, 17, 7, 19, FIELD, "b", true, true,
@@ -689,7 +689,7 @@ public class MoveInstanceMethodTests extends RefactoringTest
"p.A", 6, 17, 6, 18, PARAMETER, "b",
true, true, OTRefactoringStatusCodes.DUPLICATE_METHOD_IN_NEW_RECEIVER);
}
-
+
public void _testDuplicateMethodInNewParameterReceiver2()
throws Exception
{
@@ -698,7 +698,7 @@ public class MoveInstanceMethodTests extends RefactoringTest
"p.A", 8, 17, 8, 18, PARAMETER, "b",
true, true, OTRefactoringStatusCodes.DUPLICATE_METHOD_IN_NEW_RECEIVER);
}
-
+
public void _testTargetMethodIsPrivate()
throws Exception
{
@@ -707,5 +707,5 @@ public class MoveInstanceMethodTests extends RefactoringTest
"p.A", 6, 18, 6, 20, PARAMETER, "b",
true, true, OTRefactoringStatusCodes.CANNOT_MOVE_PRIVATE);
}
-
+
} \ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveMethodTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveMethodTests.java
index d1d09f6c4..0b655ba29 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveMethodTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveMethodTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -34,10 +34,10 @@ public class MoveMethodTests
public static Test suite()
{
TestSuite suite = new TestSuite(MoveMethodTests.class.getName());
-
+
suite.addTest(MoveInstanceMethodTests.suite());
suite.addTest(MoveStaticMethodTests.suite());
-
+
return suite;
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveRoleTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveRoleTests.java
index 694aeecdc..48b9caabd 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveRoleTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveRoleTests.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2011 Stephan Herrmann.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -43,15 +43,15 @@ public team class MoveRoleTests extends TestCase {
@SuppressWarnings("decapsulation")
protected class MoveRole playedBy MoveTest {
-
+
void setUp() -> void setUp();
void tearDown() -> void tearDown();
-
+
public MoveRole() {
base(MoveRole.class.getName());
}
-
+
@SuppressWarnings("inferredcallout")
public void testDestination_yes_roleTypeToDifferentTeam() throws Exception{
ParticipantTesting.reset();
@@ -65,20 +65,20 @@ public team class MoveRoleTests extends TestCase {
IJavaElement[] javaElements= { roleType };
IResource[] resources= {};
JavaMoveProcessor ref= verifyEnabled(resources, javaElements, createReorgQueries());
-
+
Object destination= cu2.getTypes()[0];
verifyValidDestination(ref, destination);
-
+
RefactoringStatus status= performRefactoring(ref, true);
assertEquals(null, status);
-
+
// expect that base import has been added to cu2:
String expectedSource2= "package p;\nimport base b.B;\nteam class T2{protected class Role playedBy B{}\n\nvoid bar(){}}";
assertEqualLines("source compare failed", expectedSource2, cu2.getSource());
// expect that base import has been removed from cu1:
String expectedSource1= "package p;team class T1{void foo(){}}";
- assertEqualLines("source compare failed", expectedSource1, cu1.getSource());
+ assertEqualLines("source compare failed", expectedSource1, cu1.getSource());
}
}
@@ -102,13 +102,13 @@ public team class MoveRoleTests extends TestCase {
setupProject();
this.mover.setUp();
}
-
+
@Override
protected void tearDown() throws Exception {
super.tearDown();
this.mover.tearDown();
}
-
+
void setupProject() throws Exception {
if (!this.projectInitialized) {
this.projectInitialized = true;
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveStaticMethodTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveStaticMethodTests.java
index c448305a6..c6ac7c259 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveStaticMethodTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveStaticMethodTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -46,7 +46,7 @@ import org.eclipse.objectteams.otdt.ui.tests.refactoring.RefactoringTest;
*<code>org.eclipse.jdt.ui.tests.refactoring</code> provided by Eclipse.
*
* @author brcan
- *
+ *
*/
public class MoveStaticMethodTests extends RefactoringTest
{
@@ -220,7 +220,7 @@ public class MoveStaticMethodTests extends RefactoringTest
cuB.delete(false, null);
}
}
-
+
/********** tests *********/
public void test0() throws Exception
{
@@ -544,7 +544,7 @@ public class MoveStaticMethodTests extends RefactoringTest
RefactoringStatus.ERROR,
"p.B");
}
-
+
public void testMoveToTeamclass() throws Exception
{
methodHelper_passing(new String[] { "m" }, new String[][] { new String[0] }, "B", "T");
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pullup/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pullup/AllTests.java
index 88833dcb4..6298f4e66 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pullup/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pullup/AllTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -28,7 +28,7 @@ import junit.framework.TestSuite;
/**
* @author jogeb
- *
+ *
* Runs all OT-specific refactoring tests and corresponding eclipse
* refactoring tests
*/
@@ -46,7 +46,7 @@ public class AllTests
"All OT-PullUp-Refactoring Tests");
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.pullup.PullUpTests.suite());
-
+
return suite;
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pullup/PullUpTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pullup/PullUpTests.java
index e6f88be0b..fa8a14fe8 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pullup/PullUpTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pullup/PullUpTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -51,7 +51,7 @@ import org.eclipse.objectteams.otdt.ui.tests.refactoring.RefactoringTest;
/**
* Example TestCase to practice testing for the diploma thesis.
- *
+ *
* @author Johannes Gebauer
*/
@SuppressWarnings("restriction")
@@ -103,7 +103,7 @@ public class PullUpTests extends RefactoringTest {
/**
* The <code>ICompilationUnit</code> containing the declaring type must be
* at position 0.
- *
+ *
* @param fieldNames
* TODO
*/
@@ -116,8 +116,8 @@ public class PullUpTests extends RefactoringTest {
performPullUp_pass(cuNames, methodNames, signatures, makeAbstract, fieldNames, deleteAllInSourceType, deleteAllMatchingMethods, targetClassIndex, nameOfDeclaringType, false/*replace*/);
}
private void performPullUp_pass(String[] cuNames, String[] methodNames, String[][] signatures, boolean[] makeAbstract, String[] fieldNames,
- boolean deleteAllInSourceType, boolean deleteAllMatchingMethods, int targetClassIndex, String nameOfDeclaringType, boolean replace)
- throws Exception
+ boolean deleteAllInSourceType, boolean deleteAllMatchingMethods, int targetClassIndex, String nameOfDeclaringType, boolean replace)
+ throws Exception
{
ICompilationUnit[] cus = createCUs(cuNames);
try {
@@ -180,9 +180,9 @@ public class PullUpTests extends RefactoringTest {
PullUpRefactoringProcessor processor = createRefactoringProcessor(methods);
Refactoring ref = processor.getRefactoring();
-
+
assertTrue("activation", ref.checkInitialConditions(new NullProgressMonitor()).isOK());
-
+
setTargetClass(processor, targetClassIndex);
if (deleteAllInSourceType)
@@ -210,13 +210,13 @@ public class PullUpTests extends RefactoringTest {
}
}
-
+
private void performPullUp_failing(String[] cuNames, String[] methodNames, String[][] signatures, String[] fieldNames, boolean deleteAllInSourceType,
boolean deleteAllMatchingMethods, int targetClassIndex, String nameOfDeclaringType) throws Exception {
performPullUp_failing(cuNames, methodNames, signatures, null,
fieldNames, deleteAllInSourceType, deleteAllMatchingMethods, targetClassIndex, nameOfDeclaringType,
null);
- }
+ }
private void performPullUp_failing(String[] cuNames, String[] methodNames, String[][] signatures, boolean[] makeAbstract, String[] fieldNames, boolean deleteAllInSourceType,
boolean deleteAllMatchingMethods, int targetClassIndex, String nameOfDeclaringType, String[] errorMessages)
throws Exception
@@ -266,7 +266,7 @@ public class PullUpTests extends RefactoringTest {
/******* tests ******************/
/* Pull up Method Tests */
-
+
public void testPullUpBoundMethod() throws Exception {
performPullUp_warning(new String[] { "B", "BSuper", "T" }, new String[] { "bm" }, new String[][] { new String[0] }, true, false, 0, "B");
}
@@ -325,25 +325,25 @@ public class PullUpTests extends RefactoringTest {
}
/* Pull up Field Tests */
-
+
public void testPullUpAnchoredTypeField() throws Exception {
performPullUp_failing(new String[] { "T2", "T1", "T3" }, new String[] {}, new String[][] { new String[0] }, new String[] { "extern" }, true, false, 0,
"T2");
}
-
+
public void testPulledUpFieldWillBeShadowed() throws Exception {
performPullUp_failing(new String[] { "T2", "T1", "T3" }, new String[] {}, new String[][] { new String[0] }, new String[] { "f" }, true, false, 0,
"Role");
}
-
+
public void testPullUpCalloutFieldInBase() throws Exception {
performPullUp_pass(new String[] { "B1", "B2", "T" }, new String[] {}, new String[][] { new String[0] }, new String[] { "f" }, true, false, 0, "B1");
}
-
+
public void testPullUpFieldToImplicitSuperclass() throws Exception {
performPullUp_pass(new String[] { "T", "TSuper" }, new String[] {}, new String[][] { new String[0] }, new String[] { "f" }, true, false, 0, "R");
}
-
+
// Bug 374841 - [refactoring] pull up does not work among (nested) roles
public void testPullUpWithReferenceToCallout1() throws Exception {
// without pull-up of getS1/getS2 we cannot succeed:
@@ -351,35 +351,35 @@ public class PullUpTests extends RefactoringTest {
}
// Bug 386587 - [refactoring] pull-up refactoring cannot handle callout bindings
public void testPullUpWithReferenceToCallout2() throws Exception {
- performPullUp_pass(new String[] {"T", "B"},
- new String[]{"foo", "getS1", "getS2"},
- new String[][] { new String[0], new String[0], new String[0] },
- new boolean[] {false, true, true},
+ performPullUp_pass(new String[] {"T", "B"},
+ new String[]{"foo", "getS1", "getS2"},
+ new String[][] { new String[0], new String[0], new String[0] },
+ new boolean[] {false, true, true},
new String[0], true, true, 0, "RSub",
true /*replace*/);
}
// Bug 386814 - [refactoring] pull-up should distinguish callouts that can be pull-up vs. abstract decl.
public void testPullUpCallout1() throws Exception {
- performPullUp_failing(new String[] {"T", "B"},
- new String[]{"foo", "getS1", "getS2"},
- new String[][] { new String[0], new String[0], new String[0] },
- new boolean[] {false, false, true}, // true pull up of callout not possible
+ performPullUp_failing(new String[] {"T", "B"},
+ new String[]{"foo", "getS1", "getS2"},
+ new String[][] { new String[0], new String[0], new String[0] },
+ new boolean[] {false, false, true}, // true pull up of callout not possible
new String[0], true, true, 0, "RSub",
new String[]{"The callout binding 'getS1() -> String s' can only be moved to a bound role (OTJLD \u00A73.1.(a))."});
}
// Bug 386814 - [refactoring] pull-up should distinguish callouts that can be pull-up vs. abstract decl.
public void testPullUpCallout2() throws Exception {
- performPullUp_pass(new String[] {"T", "B0", "B1", "B2"},
- new String[]{"foo", "getS1", "getS2"},
- new String[][] { new String[0], new String[0], new String[0] },
- new boolean[] {false, false, false}, // true pull up of callout
+ performPullUp_pass(new String[] {"T", "B0", "B1", "B2"},
+ new String[]{"foo", "getS1", "getS2"},
+ new String[][] { new String[0], new String[0], new String[0] },
+ new boolean[] {false, false, false}, // true pull up of callout
new String[0], true, true, 0, "RSub");
}
// Bug 386814 - [refactoring] pull-up should distinguish callouts that can be pull-up vs. abstract decl.
public void testPullUpCallout3() throws Exception {
- performPullUp_failing(new String[] {"T", "B0", "B1", "B2"},
- new String[]{"foo", "getS1", "getS2"},
- new String[][] { new String[0], new String[0], new String[0] },
+ performPullUp_failing(new String[] {"T", "B0", "B1", "B2"},
+ new String[]{"foo", "getS1", "getS2"},
+ new String[][] { new String[0], new String[0], new String[0] },
new boolean[] {false, false, false}, // true pull up of callout, which are NOT available in super base (B1)
new String[0], true, true, 0, "RSub",
new String[]{
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pushdown/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pushdown/AllTests.java
index ea126bb37..3bd03de77 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pushdown/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pushdown/AllTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -28,7 +28,7 @@ import junit.framework.TestSuite;
/**
* @author jogeb
- *
+ *
* Runs all OT-specific refactoring tests and corresponding eclipse
* refactoring tests
*/
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pushdown/PushDownTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pushdown/PushDownTests.java
index 99dae77b9..5f62ee443 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pushdown/PushDownTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pushdown/PushDownTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -42,9 +42,9 @@ import org.eclipse.objectteams.otdt.ui.tests.refactoring.RefactoringTest;
/**
* Copy of {@link org.eclipse.jdt.ui.tests.refactoring.PushDownTests}.
- *
+ *
* @author Johannes Gebauer
- *
+ *
*/
@SuppressWarnings({ "nls", "restriction" })
public class PushDownTests extends RefactoringTest {
@@ -54,11 +54,11 @@ public class PushDownTests extends RefactoringTest {
public PushDownTests(String name) {
super(name);
}
-
+
protected String getRefactoringPath() {
return REFACTORING_PATH;
}
-
+
public static Test suite() {
return new MySetup(new TestSuite(PushDownTests.class));
@@ -96,7 +96,7 @@ public class PushDownTests extends RefactoringTest {
}
}
-
+
private void performPushDown_fail(String[] cuNames, String[] methodNames, String[][] signatures, String[] fieldNames, String nameOfDeclaringType)
throws Exception {
ICompilationUnit[] cus = createCUs(cuNames);
@@ -111,7 +111,7 @@ public class PushDownTests extends RefactoringTest {
Refactoring ref = processor.getRefactoring();
assertTrue("activation", ref.checkInitialConditions(new NullProgressMonitor()).isOK());
-
+
RefactoringStatus result = performRefactoring(ref);
assertNotNull("precondition was supposed to fail.", result);
assertTrue("precondition was supposed to fail.", !result.isOK());
@@ -125,7 +125,7 @@ public class PushDownTests extends RefactoringTest {
}
}
-
+
private static PushDownRefactoringProcessor createRefactoringProcessor(IMember[] methods) throws JavaModelException {
if (RefactoringAvailabilityTester.isPullUpAvailable(methods)) {
PushDownRefactoringProcessor processor = new PushDownRefactoringProcessor(methods);
@@ -134,40 +134,40 @@ public class PushDownTests extends RefactoringTest {
}
return null;
}
-
+
//--------------------------------------------------------
public void testPushDownMethodToImplicitSubclass() throws Exception {
performPushDown_pass(new String[] { "TSuper", "T", "B" }, new String[] { "rm" }, new String[][] { new String[0] }, new String[] {}, "R");
}
-
+
public void testDeclaringTypeHasADirectPhantomSubRole() throws Exception {
performPushDown_fail(new String[] { "TSuper", "T1", "T2" }, new String[] { "rm" }, new String[][] { new String[0] }, new String[] {}, "R");
}
-
+
public void testPushedDownMethodReferencedInMethodBinding1() throws Exception {
performPushDown_fail(new String[] { "B1", "B2", "T" }, new String[] { "bm" }, new String[][] { new String[0] }, new String[] {}, "B1");
}
-
+
public void testPushedDownMethodReferencedInMethodBinding2() throws Exception {
performPushDown_fail(new String[] { "B1", "B2", "T" }, new String[] { "bm" }, new String[][] { new String[0] }, new String[] {}, "B1");
}
-
+
public void testPushedDownMethodReferencedInMethodBinding3() throws Exception {
performPushDown_fail(new String[] { "T1", "T2", "B" }, new String[] { "rm" }, new String[][] { new String[0] }, new String[] {}, "Role");
- }
-
+ }
+
public void testPushedDownMethodIsReferencedInRegularGuard1() throws Exception {
performPushDown_fail(new String[] { "T", "B" }, new String[] { "b" }, new String[][] { new String[0] }, new String[] {}, "R1");
- }
-
+ }
+
public void testPushedDownMethodIsReferencedInRegularGuard2() throws Exception {
performPushDown_fail(new String[] { "T", "B" }, new String[] { "b" }, new String[][] { new String[0] }, new String[] {}, "R1");
- }
-
+ }
+
public void testPushedDownMethodIsReferencedInBaseGuard1() throws Exception {
performPushDown_fail(new String[] { "B1", "B2", "T" }, new String[] { "b" }, new String[][] { new String[0] }, new String[] {}, "B1");
}
-
+
public void testPushedDownMethodIsReferencedInBaseGuard2() throws Exception {
performPushDown_fail(new String[] { "B1", "B2", "T" }, new String[] { "b" }, new String[][] { new String[0] }, new String[] {}, "B1");
}
@@ -175,7 +175,7 @@ public class PushDownTests extends RefactoringTest {
public void testPushedDownMethodIsReferencedInBaseGuard3() throws Exception {
performPushDown_fail(new String[] { "B1", "B2", "T" }, new String[] { "b" }, new String[][] { new String[0] }, new String[] {}, "B1");
}
-
+
public void testPushedDownMethodIsReferencedInParameterMapping1() throws Exception {
performPushDown_fail(new String[] { "T", "B" }, new String[] { "f" }, new String[][] { new String[0] }, new String[] {}, "R1");
}
@@ -187,24 +187,24 @@ public class PushDownTests extends RefactoringTest {
public void testPushedDownMethodIsReferencedInParameterMapping3() throws Exception {
performPushDown_fail(new String[] { "T", "B" }, new String[] { "f" }, new String[][] { new String[0] }, new String[] {}, "R1");
}
-
+
/* Push Down Field Tests */
public void testPushDownFieldToImplicitSubclass() throws Exception {
performPushDown_pass(new String[] { "TSuper", "T", "B" }, new String[] {}, new String[][] { new String[0] }, new String[] { "f" }, "R");
}
-
+
public void testPushedDownFieldReferencedInCalloutToField() throws Exception {
performPushDown_fail(new String[] { "B1", "B2", "T" }, new String[] {}, new String[][] { new String[0] }, new String[] { "f" }, "B1");
}
-
+
public void testPushDownTypeAnchorInstance() throws Exception {
performPushDown_fail(new String[] { "T1", "T2", "T3" }, new String[] {}, new String[][] { new String[0] }, new String[] { "anchor" }, "T1");
}
-
+
public void testPushedDownFieldWouldShadowAnInheritedField() throws Exception {
performPushDown_fail(new String[] { "B", "T1", "T2" }, new String[] {}, new String[][] { new String[0] }, new String[] { "f" }, "B");
}
-
+
public void testPushedDownFieldIsReferencedInRegularGuard1() throws Exception {
performPushDown_fail(new String[] { "T", "B" }, new String[] {}, new String[][] { new String[0] }, new String[] { "b" }, "R1");
}
@@ -224,23 +224,23 @@ public class PushDownTests extends RefactoringTest {
public void testPushedDownFieldIsReferencedInBaseGuard3() throws Exception {
performPushDown_fail(new String[] { "B1", "B2", "T" }, new String[] {}, new String[][] { new String[0] }, new String[] { "b" }, "B1");
}
-
+
public void testPushedDownFieldIsReferencedInParameterMapping1() throws Exception {
performPushDown_fail(new String[] { "T", "B" }, new String[] {}, new String[][] { new String[0] }, new String[] { "f" }, "R1");
}
-
+
public void testPushedDownFieldIsReferencedInParameterMapping2() throws Exception {
performPushDown_fail(new String[] { "T", "B" }, new String[] {}, new String[][] { new String[0] }, new String[] { "f" }, "R1");
}
-
+
public void testOverrideImplicitInheritedMethod() throws Exception {
performPushDown_fail(new String[] { "A", "T1", "T2" }, new String[] { "m" }, new String[][] { new String[0] }, new String[] {}, "A");
}
-
+
public void testOverrideExplicitInheritedMethod() throws Exception {
performPushDown_pass(new String[] { "T2", "T1", "A" }, new String[] { "m" }, new String[][] { new String[0] }, new String[] {}, "R");
}
-
+
// See Ticket #286
public void testPushedDownFieldIsReferencedInParameterMapping3() throws Exception {
performPushDown_fail(new String[] { "T", "B" }, new String[] {}, new String[][] { new String[0] }, new String[] { "f" }, "R1");
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/AllTests.java
index 8353c6e71..82992c9cc 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/AllTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2013 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -27,7 +27,7 @@ import junit.framework.TestSuite;
/**
* @author brcan
- *
+ *
* Runs all OT-specific refactoring tests
*/
public class AllTests
@@ -50,7 +50,7 @@ public class AllTests
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.rename.RenamePrivateFieldTests.suite());
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.rename.RenameTypeTests.suite());
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.rename.RenamePackageTests.suite());
-
+
return suite;
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameMethodInInterfaceTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameMethodInInterfaceTests.java
index f0212821c..9ba8415fa 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameMethodInInterfaceTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameMethodInInterfaceTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -40,7 +40,7 @@ import org.eclipse.objectteams.otdt.ui.tests.refactoring.RefactoringTest;
/**
* @author brcan
- *
+ *
*/
public class RenameMethodInInterfaceTests extends RefactoringTest
{
@@ -81,7 +81,7 @@ public class RenameMethodInInterfaceTests extends RefactoringTest
{
performRenameRefactoring_failing(cuQNames, "m", "k", new String[0]);
}
-
+
private void performRenameRefactoring_failing(
String[] cuQNames,
String methodName,
@@ -111,7 +111,7 @@ public class RenameMethodInInterfaceTests extends RefactoringTest
{
performRenamingMtoK_passing(cuQNames, true);
}
-
+
/**
* Rename method m to k and update all references.
*/
@@ -127,10 +127,10 @@ public class RenameMethodInInterfaceTests extends RefactoringTest
private void performRenameRefactoring_passing(
String[] cuQNames,
- String methodName,
+ String methodName,
String newMethodName,
- String[] signatures,
- boolean shouldPass,
+ String[] signatures,
+ boolean shouldPass,
boolean updateReferences)
throws Exception
{
@@ -166,7 +166,7 @@ public class RenameMethodInInterfaceTests extends RefactoringTest
getFileContents(
getOutputTestFileName(
getSimpleName(cuQNames[idx]))), cus[idx].getSource());
- }
+ }
assertTrue("anythingToUndo", RefactoringCore.getUndoManager()
.anythingToUndo());
assertTrue("! anythingToRedo", !RefactoringCore.getUndoManager()
@@ -202,7 +202,7 @@ public class RenameMethodInInterfaceTests extends RefactoringTest
throws Exception
{
ICompilationUnit[] cus = new ICompilationUnit[qualifiedNames.length];
-
+
for (int idx = 0; idx < qualifiedNames.length; idx++)
{
Assert.isNotNull(qualifiedNames[idx]);
@@ -212,7 +212,7 @@ public class RenameMethodInInterfaceTests extends RefactoringTest
}
return cus;
}
-
+
private String getQualifier(String qualifiedName)
{
int dot = qualifiedName.lastIndexOf('.');
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameMethodTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameMethodTests.java
index 7ab989032..45f702fa7 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameMethodTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameMethodTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -34,10 +34,10 @@ public class RenameMethodTests
public static Test suite()
{
TestSuite suite = new TestSuite(RenameMethodTests.class.getName());
-
+
suite.addTest(RenameVirtualMethodInClassTests.suite());
suite.addTest(RenameMethodInInterfaceTests.suite());
- suite.addTest(RenamePrivateMethodTests.suite());
+ suite.addTest(RenamePrivateMethodTests.suite());
suite.addTest(RenameStaticMethodTests.suite());
return suite;
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenamePrivateFieldTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenamePrivateFieldTests.java
index 00c17f9cb..115fe4654 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenamePrivateFieldTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenamePrivateFieldTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -108,7 +108,7 @@ public class RenamePrivateFieldTests extends RefactoringTest
String declaringTypeName,
String fieldName,
String newFieldName,
- boolean renameGetter,
+ boolean renameGetter,
boolean renameSetter) throws Exception
{
int selectionCuIndex = firstIndexOf(selectionCuName, cuNames);
@@ -132,7 +132,7 @@ public class RenamePrivateFieldTests extends RefactoringTest
private void performRenamingFtoG_passing(
String[] cuNames,
- String declaringTypeName,
+ String declaringTypeName,
boolean updateReferences) throws Exception
{
performRenameRefactoring_passing(
@@ -210,7 +210,7 @@ public class RenamePrivateFieldTests extends RefactoringTest
assertEqualLines("invalid undo",
getFileContents(createInputTestFileName(cus, idx)), cus[idx].getSource());
}
-
+
assertTrue("! anythingToUndo", !RefactoringCore.getUndoManager()
.anythingToUndo());
assertTrue("anythingToRedo", RefactoringCore.getUndoManager()
@@ -242,12 +242,12 @@ public class RenamePrivateFieldTests extends RefactoringTest
{
performRenamingFtoG_passing(new String[]{"T"}, "T", true);
}
-
+
public void testUpdateFieldReferenceInTeamMethod() throws Exception
{
performRenamingFtoG_passing(new String[]{"T"}, "T", true);
}
-
+
public void testUpdateFieldReferenceInLiftingMethod() throws Exception
{
performRenamingFtoG_passing(new String[]{"T"}, "T", true);
@@ -266,7 +266,7 @@ public class RenamePrivateFieldTests extends RefactoringTest
new String[]{"T"}, "T", "number", "amount",
true, false, false, false, false, false);
}
-
+
public void testUpdateTeamFieldReferenceInNestedTeam1() throws Exception
{
performRenameRefactoring_passing(
@@ -285,7 +285,7 @@ public class RenamePrivateFieldTests extends RefactoringTest
{
performRenamingFtoG_passing(new String[]{"T"}, "R", true);
}
-
+
public void testUpdateFieldReferenceInRoleclass1() throws Exception
{
performRenameRefactoring_passing(
@@ -342,7 +342,7 @@ public class RenamePrivateFieldTests extends RefactoringTest
{
performRenamingFtoG_passing(new String[]{"B", "T"}, "B", true);
}
-
+
//passing
public void testRenameGetterAndSetter1() throws Exception
{
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenamePrivateMethodTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenamePrivateMethodTests.java
index 7a91fb934..e39541b04 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenamePrivateMethodTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenamePrivateMethodTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -41,7 +41,7 @@ import org.eclipse.jdt.internal.corext.refactoring.rename.RenameMethodProcessor;
* The tests in this class have been inspired by the test class
* <code>RenamePrivateMethodTests</code> in the test suite
*<code>org.eclipse.jdt.ui.tests.refactoring</code> provided by Eclipse JDT.
- *
+ *
* @author brcan
*/
@SuppressWarnings("restriction")
@@ -63,12 +63,12 @@ public class RenamePrivateMethodTests extends RefactoringTest
{
return new MySetup(test);
}
-
+
protected String getRefactoringPath()
{
return REFACTORING_PATH;
}
-
+
private RenameRefactoring createRefactoring(RenameMethodProcessor processor)
{
return new RenameRefactoring(processor);
@@ -82,7 +82,7 @@ public class RenamePrivateMethodTests extends RefactoringTest
private void performRenameRefactoring_failing(
String methodName,
String newMethodName,
- String[] signatures)
+ String[] signatures)
throws Exception
{
IType classA = getType(createCUfromTestFile(getPackageP(), "A"), "A");
@@ -93,14 +93,14 @@ public class RenamePrivateMethodTests extends RefactoringTest
RefactoringStatus result= performRefactoring(refactoring);
assertNotNull("precondition was supposed to fail", result);
}
-
+
private void performRenaming_passing(
String cuNames[],
String declaringTypeName) throws Exception
{
performRenamingMtoK_passing(cuNames, declaringTypeName, true);
}
-
+
private void performRenamingMtoK_passing(
String cuNames[],
String declaringTypeName,
@@ -110,7 +110,7 @@ public class RenamePrivateMethodTests extends RefactoringTest
performRenameRefactoring_passing(
cuNames, declaringTypeName, "m", "k", new String[0], updateReferences);
}
-
+
private void performRenameRefactoring_passing(
String[] cuNames,
String declaringTypeName,
@@ -133,7 +133,7 @@ public class RenamePrivateMethodTests extends RefactoringTest
assertEqualLines("invalid renaming!",
getFileContents(createOutputTestFileName(cus, idx)), cus[idx].getSource());
}
-
+
assertTrue("anythingToUndo", RefactoringCore.getUndoManager()
.anythingToUndo());
assertTrue("! anythingToRedo", !RefactoringCore.getUndoManager()
@@ -146,7 +146,7 @@ public class RenamePrivateMethodTests extends RefactoringTest
assertEqualLines("invalid undo",
getFileContents(createInputTestFileName(cus, idx)), cus[idx].getSource());
}
-
+
assertTrue("! anythingToUndo", !RefactoringCore.getUndoManager()
.anythingToUndo());
assertTrue("anythingToRedo", RefactoringCore.getUndoManager()
@@ -162,18 +162,18 @@ public class RenamePrivateMethodTests extends RefactoringTest
}
/******* tests ******************/
-
+
public void testUpdateReferenceInCalloutBinding1() throws Exception
{
performRenaming_passing(new String[]{"B", "T"}, "B");
- }
-
+ }
+
public void testUpdateReferenceInCalloutBinding2() throws Exception
{
performRenameRefactoring_passing(
new String[]{"B", "T"}, "B", "getAmount", "getQuantity", null, true);
}
-
+
public void testUpdateReferenceInCallinBinding1() throws Exception
{
performRenaming_passing(new String[]{"B", "T"}, "B");
@@ -189,12 +189,12 @@ public class RenamePrivateMethodTests extends RefactoringTest
{
performRenaming_passing(new String[]{"T"}, "T");
}
-
+
public void testUpdatePrivateTeamMethodInvocation1() throws Exception
{
performRenaming_passing(new String[]{"T"}, "T");
}
-
+
public void testUpdatePrivateTeamMethodInvocation2() throws Exception
{
performRenameRefactoring_passing(new String[]{"T", "B1"}, "T", "m1", "k1", null, true);
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameStaticMethodTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameStaticMethodTests.java
index e44d775f0..fdab6ee0c 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameStaticMethodTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameStaticMethodTests.java
@@ -35,8 +35,8 @@ import org.eclipse.jdt.internal.corext.refactoring.rename.RenameNonVirtualMethod
/**
* The tests in this class have initially been copied from the original class
* <code>RenameStaticMethodTests</code> in the test suite
- *<code>org.eclipse.jdt.ui.tests.refactoring</code> provided by Eclipse.
- *
+ *<code>org.eclipse.jdt.ui.tests.refactoring</code> provided by Eclipse.
+ *
* @author brcan
*/
@SuppressWarnings("restriction")
@@ -214,81 +214,81 @@ public class RenameStaticMethodTests extends RefactoringTest
// {
// helper0_passing();
// }
-
+
public void testFail0() throws Exception{
performRenamingMtoK_failing();
}
-
+
public void testFail1() throws Exception{
performRenamingMtoK_failing();
}
-
+
public void testFail2() throws Exception{
performRenamingMtoK_failing();
}
-
+
//testFail3 deleted
-
+
public void testFail4() throws Exception{
performRenamingMtoK_failing();
}
-
+
public void testFail5() throws Exception{
performRenamingMtoK_failing();
}
-
+
public void testFail6() throws Exception{
performRenamingMtoK_failing();
}
-
+
public void testFail7() throws Exception{
performRenamingMtoK_failing();
}
-
+
public void testFail8() throws Exception{
performRenamingMtoK_failing();
}
-
+
public void test0() throws Exception{
performRenaming_passing();
}
-
+
public void test1() throws Exception{
performRenaming_passing();
}
-
+
public void test2() throws Exception{
performRenaming_passing();
}
-
+
public void test3() throws Exception{
performRenaming_passing();
}
-
+
public void test4() throws Exception{
performRenaming_passing();
}
-
+
public void test5() throws Exception{
performRenaming_passing();
}
-
+
public void test6() throws Exception{
performRenaming_passing();
}
-
+
public void test7() throws Exception{
performRenameRefactoring_passing2("m", "k", new String[]{Signature.SIG_INT});
}
-
+
public void test8() throws Exception{
performRenameRefactoring_passing2("m", "k", new String[]{Signature.SIG_INT});
}
-
+
public void test9() throws Exception{
performRenameRefactoring_passing1("m", "k", new String[]{Signature.SIG_INT}, false);
}
-
+
public void test10() throws Exception
{
ICompilationUnit cuA = createCUfromTestFile(getPackageP(), "A");
@@ -317,7 +317,7 @@ public class RenameStaticMethodTests extends RefactoringTest
{
ICompilationUnit cuA = createCUfromTestFile(packageA, "A");
ICompilationUnit cuB = createCUfromTestFile(packageB, "B");
-
+
IType classA = getType(cuA, "A");
RenameMethodProcessor processor =
createProcessor(classA.getMethod("method2", new String[0]));
@@ -336,7 +336,7 @@ public class RenameStaticMethodTests extends RefactoringTest
packageB.delete(true, new NullProgressMonitor());
}
}
-
+
public void testUpdateReferenceToBaseMethodInCalloutBinding1() throws Exception {
performRenameRefactoring_passing(new String[] { "B", "T" }, "B", "getAmount", "getQuantity", new String[0], true, true);
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameTypeTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameTypeTests.java
index 10b9c41ad..c62c822d6 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameTypeTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameTypeTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -43,26 +43,26 @@ import org.eclipse.objectteams.otdt.ui.tests.refactoring.RefactoringTest;
* FIXME(SH):
* Once this test class is reactivated, also check the following conditions which are
* known not to work currently (e.g., OTDT 1.1.6):
- * + Rename role type:
- * - inline (not dialog-based) refactoring links all references of a role type but not:
- * - its declaration
- * - class literals
+ * + Rename role type:
+ * - inline (not dialog-based) refactoring links all references of a role type but not:
+ * - its declaration
+ * - class literals
* (linked-mode in the Editor).
* - class literals in a predicate are not renamed
- *
+ *
* @author brcan
- *
+ *
*/
@SuppressWarnings({"restriction", "nls"})
public class RenameTypeTests extends RefactoringTest
{
private static final String REFACTORING_PATH = "RenameType/";
-
+
private static IPackageFragment _teamPkg;
-
+
private RenameProcessor _processor = null;
-
+
public RenameTypeTests(String name)
{
super(name);
@@ -98,7 +98,7 @@ public class RenameTypeTests extends RefactoringTest
{
_teamPkg = getRoot().createPackageFragment("p.T1", true, null);
}
-
+
private IPackageFragment getUpdatedTeamPackageFragment() throws Exception
{
return getRoot().getPackageFragment("p.T2");
@@ -199,7 +199,7 @@ public class RenameTypeTests extends RefactoringTest
{
if (cus[idx].getElementName().startsWith("R") ||
cus[idx].getElementName().startsWith("TR"))
-
+
{
cus[idx] = updatedTeamPackage.getCompilationUnit(cus[idx].getElementName());
assertEqualLines("invalid renaming!",
@@ -218,7 +218,7 @@ public class RenameTypeTests extends RefactoringTest
}
}
-
+
protected ICompilationUnit[] createCUs(String[] cuNames) throws Exception
{
ICompilationUnit[] cus = new ICompilationUnit[cuNames.length];
@@ -237,7 +237,7 @@ public class RenameTypeTests extends RefactoringTest
}
return cus;
}
-
+
/*********** tests ***********/
//passing
public void testRenameTeamclass() throws Exception {
@@ -407,11 +407,11 @@ public class RenameTypeTests extends RefactoringTest
public void testShadowedNameOfSubType1() throws Exception {
performRenameRefactoring_failing(new String[] { "T1", "T2" }, "R1", "R2", false);
}
-
+
public void testNameClashWithRoleFile() throws Exception {
performRenameRefactoring_failing(new String[] { "T1", "R2" }, "R1", "R2", true);
}
-
+
public void testShadowedNameRoleFile1() throws Exception {
performRenameRefactoring_failing(new String[] { "R1", "T1" }, "R1", "R2", true);
}
@@ -431,7 +431,7 @@ public class RenameTypeTests extends RefactoringTest
public void testShadowedNameRoleFile6() throws Exception {
performRenameRefactoring_failing(new String[] { "T2", "T1", "R2" }, "R1", "R2", true);
}
-
+
public void testImplicitOverridingWithRoleFile1() throws Exception {
performRenameRefactoring_failing(new String[] { "T2", "T1", "R1" }, "R", "R1", true);
}
@@ -439,9 +439,9 @@ public class RenameTypeTests extends RefactoringTest
public void testImplicitOverridingWithRoleFile2() throws Exception {
performRenameRefactoring_failing(new String[] { "T", "R1", "T1" }, "R", "R1", true);
}
-
+
// failing
-
+
// FIXME(jogeb): phantom roles within phantom roles wont be found by the
// OTTypeHierarchy or change strategy in RenameTypeAdapter
public void _testShadowedNameOfSubType2() throws Exception {
@@ -451,7 +451,7 @@ public class RenameTypeTests extends RefactoringTest
public void _testShadowedNameRoleFile4() throws Exception {
performRenameRefactoring_failing(new String[] { "RT", "T1", "T2" }, "R1", "R2", true);
}
-
+
public void testRenameBaseClass1() throws Exception {
IPackageFragment packB = getRoot().createPackageFragment("b", true, null);
ICompilationUnit cuB = packB.createCompilationUnit("B.java", "package b;public class B {}", true, null);
@@ -465,11 +465,11 @@ public class RenameTypeTests extends RefactoringTest
renameTypeProcessor.setUpdateTextualMatches(false);
RefactoringStatus result = performRefactoring(refactoring);
assertEquals("was supposed to pass", null, result);
-
+
// expect that base import has been updated in cu1:
String expectedSource1= "package p;import base b.B1;team class T1{void foo(){}protected class Role playedBy B1{}}";
assertEqualLines("source compare failed", expectedSource1, cu1.getSource());
-
+
} finally {
performDummySearch();
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameVirtualMethodInClassTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameVirtualMethodInClassTests.java
index d3782df7d..cde037e32 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameVirtualMethodInClassTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameVirtualMethodInClassTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -43,7 +43,7 @@ import org.eclipse.objectteams.otdt.ui.tests.refactoring.RefactoringTest;
/**
* @author brcan
- *
+ *
*/
@SuppressWarnings("restriction")
public class RenameVirtualMethodInClassTests extends RefactoringTest {
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/reorg/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/reorg/AllTests.java
index b9886b09c..5d562c5e2 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/reorg/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/reorg/AllTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -28,7 +28,7 @@ import junit.framework.TestSuite;
/**
* @author brcan
- *
+ *
* Runs all OT-specific refactoring tests and corresponding eclipse refactoring tests
*/
public class AllTests
@@ -49,7 +49,7 @@ public class AllTests
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.reorg.OTDeleteTests.suite());
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.reorg.PasteActionTest.suite());
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.reorg.OTPasteActionTest.suite());
-
+
return suite;
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/reorg/MockReorgQueries.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/reorg/MockReorgQueries.java
index 6ffbade89..abc4fe14f 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/reorg/MockReorgQueries.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/reorg/MockReorgQueries.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/reorg/OTCopyToClipboardTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/reorg/OTCopyToClipboardTests.java
index 5dc42c99d..c20a81ade 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/reorg/OTCopyToClipboardTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/reorg/OTCopyToClipboardTests.java
@@ -6,7 +6,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -67,7 +67,7 @@ public class OTCopyToClipboardTests extends RefactoringTest
private Clipboard _clipboard;
private ICompilationUnit _cuT1;
private ICompilationUnit _cuB1;
-
+
public OTCopyToClipboardTests(String name) {
super(name);
}
@@ -80,8 +80,8 @@ public class OTCopyToClipboardTests extends RefactoringTest
{
super.setUp();
_clipboard = new MockClipboard(Display.getDefault());
-
- _cuT1 = createCU(getPackageP(), CU_T1_NAME + ".java",
+
+ _cuT1 = createCU(getPackageP(), CU_T1_NAME + ".java",
"package p;" + "\n" +
"import java.util.List;" + "\n" +
"public team class T1" + "\n" +
@@ -101,7 +101,7 @@ public class OTCopyToClipboardTests extends RefactoringTest
"}" + "\n" +
"}");
- _cuB1 = createCU(getPackageP(), CU_B1_NAME + ".java",
+ _cuB1 = createCU(getPackageP(), CU_B1_NAME + ".java",
"package p;" + "\n" +
"public class B1" + "\n" +
"{" + "\n" +
@@ -110,14 +110,14 @@ public class OTCopyToClipboardTests extends RefactoringTest
"}");
_labelProvider = new JavaElementLabelProvider(
- JavaElementLabelProvider.SHOW_VARIABLE +
- JavaElementLabelProvider.SHOW_PARAMETERS +
+ JavaElementLabelProvider.SHOW_VARIABLE +
+ JavaElementLabelProvider.SHOW_PARAMETERS +
JavaElementLabelProvider.SHOW_TYPE);
assertTrue("T1.java does not exist", _cuT1.exists());
assertTrue("B1.java does not exist", _cuB1.exists());
}
-
+
protected void tearDown() throws Exception
{
super.tearDown();
@@ -126,17 +126,17 @@ public class OTCopyToClipboardTests extends RefactoringTest
_labelProvider.dispose();
delete(_cuT1);
delete(_cuB1);
- }
-
+ }
+
private static void delete(ISourceManipulation element) {
try {
if (element != null && ((IJavaElement)element).exists())
element.delete(true, null);
} catch(JavaModelException e) {
//ignore, we must keep going
- }
+ }
}
-
+
private void checkDisabled(Object[] elements){
CopyToClipboardAction copyAction= new CopyToClipboardAction(new MockWorkbenchSite(elements), _clipboard);
copyAction.setAutoRepeatOnFailure(true);
@@ -157,10 +157,10 @@ public class OTCopyToClipboardTests extends RefactoringTest
IResource[] resourcesCopied= getResources(elementsCopied);
IJavaElement[] javaElementsCopied= getJavaElements(elementsCopied);
IType[] mainTypesCopied= ReorgUtils.getMainTypes(javaElementsCopied);
-
+
IResource[] resourcesExpected= computeResourcesExpectedInClipboard(resourcesCopied, mainTypesCopied, javaElementsCopied);
IJavaElement[] javaElementsExpected= computeJavaElementsExpectedInClipboard(javaElementsCopied, mainTypesCopied);
-
+
String[] clipboardFiles= getClipboardFiles();
IResource[] clipboardResources= getClipboardResources();
String clipboardText= getClipboardText();
@@ -173,10 +173,10 @@ public class OTCopyToClipboardTests extends RefactoringTest
checkElements(resourcesExpected, clipboardResources);
checkElements(javaElementsExpected, clipboardJavaElements);
}
-
+
private void checkTypedSources(IJavaElement[] javaElementsCopied, TypedSource[] clipboardTypedSources) throws Exception {
TypedSource[] typedSources= TypedSource.createTypedSources(javaElementsCopied);
- assertEquals("different number", typedSources.length, clipboardTypedSources.length);
+ assertEquals("different number", typedSources.length, clipboardTypedSources.length);
TypedSource.sortByType(typedSources);
TypedSource.sortByType(clipboardTypedSources);
for (int i= 0; i < typedSources.length; i++) {
@@ -247,17 +247,17 @@ public class OTCopyToClipboardTests extends RefactoringTest
IJavaElement element= javaElementsCopied[i];
if (! ReorgUtils.isInsideCompilationUnit(element)){
String name= getName(element);
- assertTrue("name not in set:" + name, stringLines.contains(name));
+ assertTrue("name not in set:" + name, stringLines.contains(name));
}
}
- }
-
+ }
+
private static void checkFiles(IResource[] resourcesCopied, IJavaElement[] javaElementsCopied, IType[] mainTypes, String[] clipboardFiles) {
int expected= 0;
expected += resourcesCopied.length;
expected += countResources(javaElementsCopied);
expected += mainTypes.length;
-
+
//we cannot compare file names here because they're absolute and depend on the worspace location
assertEquals("different number of files in clipboard", expected, clipboardFiles.length);
}
@@ -293,49 +293,49 @@ public class OTCopyToClipboardTests extends RefactoringTest
private IJavaElement[] getClipboardJavaElements() {
IJavaElement[] elements= (IJavaElement[])_clipboard.getContents(JavaElementTransfer.getInstance());
- return elements == null ? new IJavaElement[0]: elements;
+ return elements == null ? new IJavaElement[0]: elements;
}
private String[] getClipboardFiles() {
String[] files= (String[])_clipboard.getContents(FileTransfer.getInstance());
return files == null ? new String[0]: files;
}
-
+
private IResource[] getClipboardResources() {
IResource[] resources= (IResource[])_clipboard.getContents(ResourceTransfer.getInstance());
- return resources == null ? new IResource[0]: resources;
+ return resources == null ? new IResource[0]: resources;
}
private TypedSource[] getClipboardTypedSources() {
TypedSource[] typedSources= (TypedSource[])_clipboard.getContents(TypedSourceTransfer.getInstance());
- return typedSources == null ? new TypedSource[0]: typedSources;
+ return typedSources == null ? new TypedSource[0]: typedSources;
}
private String getClipboardText() {
return (String)_clipboard.getContents(TextTransfer.getInstance());
}
-
+
///---------tests
public void testDisabled0() {
Object[] elements= {};
checkDisabled(elements);
- }
+ }
public void testDisabled1() throws Exception {
Object[] elements= {null};
checkDisabled(elements);
- }
+ }
public void testDisabled2() throws Exception {
Object[] elements= {this};
checkDisabled(elements);
- }
+ }
public void testDisabled3() throws Exception {
Object[] elements= {RefactoringTestSetup.getProject(), getPackageP()};
checkDisabled(elements);
- }
+ }
public void testDisabled4() throws Exception{
checkDisabled(new Object[]{getPackageP(), _cuT1});
@@ -354,25 +354,25 @@ public class OTCopyToClipboardTests extends RefactoringTest
Object classA= _cuT1.getType("T1");
Object[] elements= {fieldF, classA};
checkDisabled(elements);
- }
+ }
public void testDisabled16() throws Exception {
Object fieldF= _cuT1.getType("T1").getField("x");
Object[] elements= {fieldF, _cuT1};
checkDisabled(elements);
- }
+ }
public void testDisabled20() throws Exception {
Object fieldF= _cuT1.getType("T1").getField("x");
Object[] elements= {fieldF, getRoot()};
checkDisabled(elements);
- }
+ }
public void testDisabled21() throws Exception {
Object fieldF= _cuT1.getType("T1").getField("x");
Object[] elements= {fieldF, RefactoringTestSetup.getProject()};
checkDisabled(elements);
- }
+ }
public void testDisabled22() throws Exception {
Object typeT1= _cuT1.getType("T1");
@@ -380,27 +380,27 @@ public class OTCopyToClipboardTests extends RefactoringTest
Object[] elements= {typeT1, typeB1};
checkDisabled(elements);
}
-
+
public void testEnabled0() throws Exception {
Object[] elements= {RefactoringTestSetup.getProject()};
checkEnabled(elements);
- }
+ }
public void testEnabled1() throws Exception {
Object[] elements= {getPackageP()};
checkEnabled(elements);
- }
+ }
public void testEnabled2() throws Exception {
Object[] elements= {getRoot()};
checkEnabled(elements);
- }
+ }
public void testEnabled3() throws Exception {
Object[] elements= {RefactoringTestSetup.getDefaultSourceFolder()};
checkEnabled(elements);
}
-
+
public void testEnabled5() throws Exception{
checkEnabled(new Object[]{getRoot()});
}
@@ -412,11 +412,11 @@ public class OTCopyToClipboardTests extends RefactoringTest
public void testEnabled7() throws Exception{
checkEnabled(new Object[]{getRoot().getJavaProject()});
}
-
+
public void testEnabled8() throws Exception{
checkEnabled(new Object[]{getPackageP()});
}
-
+
public void testEnabled10() throws Exception{
Object packDecl= _cuT1.getPackageDeclarations()[0];
Object[] elements= {packDecl};
@@ -475,7 +475,7 @@ public class OTCopyToClipboardTests extends RefactoringTest
Object[] elements= {classA, packDecl};
checkEnabled(elements);
}
-
+
public void testEnabledOT0() throws Exception
{
IType teamT1 = _cuT1.getType("T1");
@@ -493,7 +493,7 @@ public class OTCopyToClipboardTests extends RefactoringTest
if (elem instanceof IType)
{
IType type = (IType)elem;
- IRoleType roleR1 = (IRoleType)OTModelManager.getOTElement(type);
+ IRoleType roleR1 = (IRoleType)OTModelManager.getOTElement(type);
Object[] elements = { roleR1 };
checkEnabled(elements);
}
@@ -538,7 +538,7 @@ public class OTCopyToClipboardTests extends RefactoringTest
IMethodMapping[] mapping = roleR1.getMethodMappings(IRoleType.CALLINS);
ICallinMapping callin = (ICallinMapping)mapping[0];
Object[] elements = { callin };
- checkEnabled(elements);
+ checkEnabled(elements);
}
public void testEnabledOT5() throws Exception
@@ -557,7 +557,7 @@ public class OTCopyToClipboardTests extends RefactoringTest
}
}
Object[] elements = { calloutToField };
- checkEnabled(elements);
+ checkEnabled(elements);
}
public void testEnabledOT6() throws Exception
@@ -569,7 +569,7 @@ public class OTCopyToClipboardTests extends RefactoringTest
Object[] elements = { fieldX, methodT1m, nestedTeamTR1 };
checkEnabled(elements);
}
-
-
+
+
}
//sko} \ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/reorg/OTDeleteTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/reorg/OTDeleteTests.java
index 2013d16e5..3a084f1c9 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/reorg/OTDeleteTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/reorg/OTDeleteTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -126,7 +126,7 @@ public class OTDeleteTests extends RefactoringTest
return new MockReorgQueries();
}
- //---- tests ----
+ //---- tests ----
public void testDeleteTeamclass() throws Exception
{
// ParticipantTesting.reset();
@@ -135,9 +135,9 @@ public class OTDeleteTests extends RefactoringTest
IJavaElement[] elems = new IJavaElement[] { aTeam };
checkDelete(elems, true);
// String[] handles = ParticipantTesting.createHandles(elem0);
-// ParticipantTesting.testDelete(handles);
+// ParticipantTesting.testDelete(handles);
}
-
+
public void testDeleteNestedTeamclass() throws Exception
{
loadFileSetup();
@@ -150,7 +150,7 @@ public class OTDeleteTests extends RefactoringTest
{
loadFileSetup();
IType type = _cuT.getType("T").getType("R");
- IRoleType role = (IRoleType)OTModelManager.getOTElement(type);
+ IRoleType role = (IRoleType)OTModelManager.getOTElement(type);
IJavaElement[] elems = new IJavaElement[] { role };
checkDelete(elems, false);
}
@@ -160,7 +160,7 @@ public class OTDeleteTests extends RefactoringTest
{
loadFileSetup();
IType type = _cuT.getType("T").getType("R");
- IRoleType role = (IRoleType)OTModelManager.getOTElement(type);
+ IRoleType role = (IRoleType)OTModelManager.getOTElement(type);
String message1= ReorgUtils.getName(role);
assertEquals("role 'R'", message1);
}
@@ -169,8 +169,8 @@ public class OTDeleteTests extends RefactoringTest
{
loadFileSetup();
IType type = _cuT.getType("T").getType("R");
- IRoleType role = (IRoleType)OTModelManager.getOTElement(type);
- IMethodMapping[] mappings = role.getMethodMappings();
+ IRoleType role = (IRoleType)OTModelManager.getOTElement(type);
+ IMethodMapping[] mappings = role.getMethodMappings();
IJavaElement[] elems = new IJavaElement[] { mappings[0] };
checkDelete(elems, false);
}
@@ -179,8 +179,8 @@ public class OTDeleteTests extends RefactoringTest
{
loadFileSetup();
IType type = _cuT.getType("T").getType("R");
- IRoleType role = (IRoleType)OTModelManager.getOTElement(type);
- IMethodMapping[] mappings = role.getMethodMappings();
+ IRoleType role = (IRoleType)OTModelManager.getOTElement(type);
+ IMethodMapping[] mappings = role.getMethodMappings();
IJavaElement[] elems = new IJavaElement[] { mappings[0] };
checkDelete(elems, false);
}
@@ -189,8 +189,8 @@ public class OTDeleteTests extends RefactoringTest
{
loadFileSetup();
IType type = _cuT.getType("T").getType("R");
- IRoleType role = (IRoleType)OTModelManager.getOTElement(type);
- IMethodMapping[] mappings = role.getMethodMappings();
+ IRoleType role = (IRoleType)OTModelManager.getOTElement(type);
+ IMethodMapping[] mappings = role.getMethodMappings();
IJavaElement[] elems = new IJavaElement[] { mappings[0] };
checkDelete(elems, false);
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/reorg/OTPasteActionTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/reorg/OTPasteActionTest.java
index 9918adb24..29edb080f 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/reorg/OTPasteActionTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/reorg/OTPasteActionTest.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -62,7 +62,7 @@ public class OTPasteActionTest extends RefactoringTest
public OTPasteActionTest(String name) {
super(name);
}
-
+
public static Test suite() {
return new MySetup(new TestSuite(OTPasteActionTest.class));
}
@@ -76,8 +76,8 @@ public class OTPasteActionTest extends RefactoringTest
_clipboard= new MockClipboard(Display.getDefault());
_packageQ = MySetup.getDefaultSourceFolder().createPackageFragment("q", true, null);
}
-
- protected void tearDown() throws Exception
+
+ protected void tearDown() throws Exception
{
if (_packageQ.exists())
{
@@ -93,7 +93,7 @@ public class OTPasteActionTest extends RefactoringTest
elements.addAll(Arrays.asList(array2));
return elements.toArray();
}
-
+
private PasteAction verifyEnabled(IResource[] copySelectedResources, IJavaElement[] copySelectedJavaElements, IResource[] pasteSelectedResources, IJavaElement[] pasteSelectedJavaElements) throws JavaModelException {
PasteAction pasteAction= new PasteAction(new MockWorkbenchSite(merge(pasteSelectedResources, pasteSelectedJavaElements)), _clipboard);
CopyToClipboardAction copyToClipboardAction= new CopyToClipboardAction(new MockWorkbenchSite(merge(copySelectedResources, copySelectedJavaElements)), _clipboard);
@@ -101,7 +101,7 @@ public class OTPasteActionTest extends RefactoringTest
copyToClipboardAction.update(copyToClipboardAction.getSelection());
assertTrue("copy not enabled", copyToClipboardAction.isEnabled());
copyToClipboardAction.run();
-
+
pasteAction.update(pasteAction.getSelection());
assertTrue("paste should be enabled", pasteAction.isEnabled());
return pasteAction;
@@ -110,7 +110,7 @@ public class OTPasteActionTest extends RefactoringTest
private void compareContents(String cuName) throws JavaModelException, IOException {
assertEqualLines(cuName, getFileContents(getOutputTestFileName(cuName)), getPackageP().getCompilationUnit(cuName + ".java").getSource());
}
-
+
private void delete(ICompilationUnit cu) throws Exception {
try {
performDummySearch();
@@ -132,7 +132,7 @@ public class OTPasteActionTest extends RefactoringTest
{
IType teamTSource = cuTSource.getType("TSource");
IType teamTDest = cuTDest.getType("TDest");
-
+
assertTrue("TSource does not exist", teamTSource.exists());
assertTrue("TDest does not exist", teamTDest.exists());
@@ -143,7 +143,7 @@ public class OTPasteActionTest extends RefactoringTest
PasteAction paste = verifyEnabled(copyResources,
copyJavaElements, pasteResources, pasteJavaElements);
paste.run((IStructuredSelection)paste.getSelection());
-
+
compareContents("TSource");
compareContents("TDest");
}
@@ -152,7 +152,7 @@ public class OTPasteActionTest extends RefactoringTest
delete(cuTSource);
}
}
-
+
public void testPasteNestedTeamclass() throws Exception
{
ICompilationUnit cuTSource = createCUfromTestFile(getPackageP(),
@@ -219,16 +219,16 @@ public class OTPasteActionTest extends RefactoringTest
{
ICompilationUnit cuTSource= createCUfromTestFile(getPackageP(), "TSource");
ICompilationUnit cuTDest= createCUfromTestFile(getPackageP(), "TDest");
-
- try
+
+ try
{
IRoleType roleSrc = (IRoleType)OTModelManager.getOTElement(cuTSource.getType("TSource").getType("R"));
IMethodMapping calloutMapping = roleSrc.getMethodMappings()[0];
IType roleTDest_R = cuTDest.getType("TDest").getType("R");
-
+
assertTrue("callout does not exist", calloutMapping.exists());
assertTrue("R does not exist", roleTDest_R.exists());
-
+
IJavaElement[] copyJavaElements= {calloutMapping};
IResource[] copyResources= {};
IJavaElement[] pasteJavaElements= {roleTDest_R};
@@ -237,7 +237,7 @@ public class OTPasteActionTest extends RefactoringTest
paste.run((IStructuredSelection)paste.getSelection());
compareContents("TSource");
compareContents("TDest");
- }
+ }
finally
{
delete(cuTSource);
@@ -249,16 +249,16 @@ public class OTPasteActionTest extends RefactoringTest
{
ICompilationUnit cuTSource= createCUfromTestFile(getPackageP(), "TSource");
ICompilationUnit cuTDest= createCUfromTestFile(getPackageP(), "TDest");
-
- try
+
+ try
{
IRoleType roleSrc = (IRoleType)OTModelManager.getOTElement(cuTSource.getType("TSource").getType("R"));
IMethodMapping calloutMapping = roleSrc.getMethodMappings()[0];
IType roleTDest_R = cuTDest.getType("TDest").getType("R");
-
+
assertTrue("callout does not exist", calloutMapping.exists());
assertTrue("R does not exist", roleTDest_R.exists());
-
+
IJavaElement[] copyJavaElements= {calloutMapping};
IResource[] copyResources= {};
IJavaElement[] pasteJavaElements= {roleTDest_R};
@@ -267,7 +267,7 @@ public class OTPasteActionTest extends RefactoringTest
paste.run((IStructuredSelection)paste.getSelection());
compareContents("TSource");
compareContents("TDest");
- }
+ }
finally
{
delete(cuTSource);
@@ -279,16 +279,16 @@ public class OTPasteActionTest extends RefactoringTest
{
ICompilationUnit cuTSource= createCUfromTestFile(getPackageP(), "TSource");
ICompilationUnit cuTDest= createCUfromTestFile(getPackageP(), "TDest");
-
- try
+
+ try
{
IRoleType roleSrc = (IRoleType)OTModelManager.getOTElement(cuTSource.getType("TSource").getType("R"));
IMethodMapping calloutMapping = roleSrc.getMethodMappings()[0];
IType roleTDest_R = cuTDest.getType("TDest").getType("R");
-
+
assertTrue("callout does not exist", calloutMapping.exists());
assertTrue("R does not exist", roleTDest_R.exists());
-
+
IJavaElement[] copyJavaElements= {calloutMapping};
IResource[] copyResources= {};
IJavaElement[] pasteJavaElements= {roleTDest_R};
@@ -297,7 +297,7 @@ public class OTPasteActionTest extends RefactoringTest
paste.run((IStructuredSelection)paste.getSelection());
compareContents("TSource");
compareContents("TDest");
- }
+ }
finally
{
delete(cuTSource);
@@ -337,7 +337,7 @@ public class OTPasteActionTest extends RefactoringTest
delete(cuTDest);
}
}
-
+
public void testPasteCallinMapping() throws Exception
{
ICompilationUnit cuTSource = createCUfromTestFile(getPackageP(),
@@ -370,5 +370,5 @@ public class OTPasteActionTest extends RefactoringTest
delete(cuTDest);
}
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/reorg/PasteActionTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/reorg/PasteActionTest.java
index 97f940f02..634945106 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/reorg/PasteActionTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/reorg/PasteActionTest.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -68,7 +68,7 @@ public class PasteActionTest extends RefactoringTest{
public PasteActionTest(String name) {
super(name);
}
-
+
public static Test suite() {
return new RefactoringTestSetup(new TestSuite(PasteActionTest.class));
}
@@ -92,7 +92,7 @@ public class PasteActionTest extends RefactoringTest{
elements.addAll(Arrays.asList(array2));
return elements.toArray();
}
-
+
private PasteAction verifyEnabled(IResource[] copySelectedResources, IJavaElement[] copySelectedJavaElements, IResource[] pasteSelectedResources, IJavaElement[] pasteSelectedJavaElements) throws JavaModelException {
PasteAction pasteAction= new PasteAction(new MockWorkbenchSite(merge(pasteSelectedResources, pasteSelectedJavaElements)), _clipboard);
CopyToClipboardAction copyToClipboardAction= new CopyToClipboardAction(new MockWorkbenchSite(merge(copySelectedResources, copySelectedJavaElements)), _clipboard);
@@ -100,7 +100,7 @@ public class PasteActionTest extends RefactoringTest{
copyToClipboardAction.update(copyToClipboardAction.getSelection());
assertTrue("copy not enabled", copyToClipboardAction.isEnabled());
copyToClipboardAction.run();
-
+
pasteAction.update(pasteAction.getSelection());
assertTrue("paste should be enabled", pasteAction.isEnabled());
return pasteAction;
@@ -113,7 +113,7 @@ public class PasteActionTest extends RefactoringTest{
copyToClipboardAction.update(copyToClipboardAction.getSelection());
assertTrue("copy not enabled", copyToClipboardAction.isEnabled());
copyToClipboardAction.run();
-
+
pasteAction.update(pasteAction.getSelection());
assertTrue("paste should be enabled", pasteAction.isEnabled());
return pasteAction;
@@ -130,7 +130,7 @@ public class PasteActionTest extends RefactoringTest{
IResource[] resources= {RefactoringTestSetup.getProject().getProject()};
verifyEnabled(resources, javaElements, new IResource[0], new IJavaElement[0]);
}
-
+
public void testEnabled_workingSet() throws Exception {
IWorkingSet ws= PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSet("Test", new IAdaptable[] {});
try {
@@ -143,7 +143,7 @@ public class PasteActionTest extends RefactoringTest{
private void compareContents(String cuName) throws JavaModelException, IOException {
assertEqualLines(cuName, getFileContents(getOutputTestFileName(cuName)), getPackageP().getCompilationUnit(cuName + ".java").getSource());
}
-
+
private void delete(ICompilationUnit cu) throws Exception {
try {
performDummySearch();
@@ -162,14 +162,14 @@ public class PasteActionTest extends RefactoringTest{
ICompilationUnit cuA= createCUfromTestFile(getPackageP(), "A");
ICompilationUnit cuB= createCUfromTestFile(getPackageP(), "B");
-
+
try {
IType typeA= cuA.getType("A");
IType typeB= cuB.getType("B");
-
+
assertTrue("A does not exist", typeA.exists());
assertTrue("B does not exist", typeB.exists());
-
+
IJavaElement[] copyJavaElements= {typeA};
IResource[] copyResources= {};
IJavaElement[] pasteJavaElements= {typeB};
@@ -187,14 +187,14 @@ public class PasteActionTest extends RefactoringTest{
public void test2() throws Exception{
ICompilationUnit cuA= createCUfromTestFile(getPackageP(), "A");
ICompilationUnit cuB= createCUfromTestFile(getPackageP(), "B");
-
+
try {
IField fieldY= cuA.getType("A").getField("y");
IType typeB= cuB.getType("B");
-
+
assertTrue("y does not exist", fieldY.exists());
assertTrue("B does not exist", typeB.exists());
-
+
IJavaElement[] copyJavaElements= {fieldY};
IResource[] copyResources= {};
IJavaElement[] pasteJavaElements= {typeB};
@@ -213,14 +213,14 @@ public class PasteActionTest extends RefactoringTest{
// printTestDisabledMessage("test for bug#19007");
ICompilationUnit cuA= createCUfromTestFile(getPackageP(), "A");
ICompilationUnit cuB= createCUfromTestFile(getPackageP(), "B");
-
+
try {
IJavaElement elem0= cuA.getImport("java.lang.*");
IImportContainer importContainer= cuB.getImportContainer();
-
+
assertTrue("y does not exist", elem0.exists());
assertTrue("B does not exist", importContainer.exists());
-
+
IJavaElement[] copyJavaElements= {elem0};
IResource[] copyResources= {};
IJavaElement[] pasteJavaElements= {importContainer};
@@ -241,10 +241,10 @@ public class PasteActionTest extends RefactoringTest{
try {
IJavaElement elem0= cuA.getType("A").getMethod("f", new String[0]);
IMethod method= cuA.getType("A").getMethod("f1", new String[0]);
-
+
assertTrue("y does not exist", elem0.exists());
assertTrue("B does not exist", method.exists());
-
+
IJavaElement[] copyJavaElements= {elem0};
IResource[] copyResources= {};
IJavaElement[] pasteJavaElements= {method};
@@ -256,7 +256,7 @@ public class PasteActionTest extends RefactoringTest{
delete(cuA);
}
}
-
+
public void testPastingJavaElementIntoWorkingSet() throws Exception {
IWorkingSet ws= PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSet("Test", new IAdaptable[] {});
try {
@@ -304,7 +304,7 @@ public class PasteActionTest extends RefactoringTest{
}
public void testPastingExistingElementIntoWorkingSet() throws Exception {
- IWorkingSet ws= PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSet("Test",
+ IWorkingSet ws= PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSet("Test",
new IAdaptable[] {RefactoringTestSetup.getProject()});
try {
IResource[] resources= {};
@@ -319,7 +319,7 @@ public class PasteActionTest extends RefactoringTest{
}
public void testPastingChildJavaElementIntoWorkingSet() throws Exception {
- IWorkingSet ws= PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSet("Test",
+ IWorkingSet ws= PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSet("Test",
new IAdaptable[] {RefactoringTestSetup.getProject()});
try {
IResource[] resources= {};
@@ -336,7 +336,7 @@ public class PasteActionTest extends RefactoringTest{
public void testPastingChildResourceIntoWorkingSet() throws Exception {
IFolder folder= RefactoringTestSetup.getProject().getProject().getFolder("folder");
folder.create(true, true, null);
- IWorkingSet ws= PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSet("Test",
+ IWorkingSet ws= PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSet("Test",
new IAdaptable[] {folder});
IFolder sub= folder.getFolder("sub");
sub.create(true, true, null);
@@ -356,7 +356,7 @@ public class PasteActionTest extends RefactoringTest{
}
public void testPastingChildResourceIntoWorkingSetContainingParent() throws Exception {
- IWorkingSet ws= PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSet("Test",
+ IWorkingSet ws= PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSet("Test",
new IAdaptable[] {RefactoringTestSetup.getProject()});
IFolder folder= RefactoringTestSetup.getProject().getProject().getFolder("folder");
folder.create(true, true, null);
@@ -384,7 +384,7 @@ public class PasteActionTest extends RefactoringTest{
setClipboardContents(typedSources, repeat+1);
}
}
-
+
private void copyAndPasteTypedSources(IJavaElement[] elemsForClipboard, IJavaElement[] pasteSelectedJavaElements, boolean pasteEnabled) throws CoreException {
setClipboardContents(TypedSource.createTypedSources(elemsForClipboard), 0);
PasteAction pasteAction= new PasteAction(new MockWorkbenchSite(pasteSelectedJavaElements), _clipboard);
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/requiredfeatures/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/requiredfeatures/AllTests.java
index b06d437ae..11e024538 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/requiredfeatures/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/requiredfeatures/AllTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -27,7 +27,7 @@ import junit.framework.TestSuite;
/**
* @author svacina
- *
+ *
* Runs all test cases which are needed for refactoring
*/
public class AllTests
@@ -42,9 +42,9 @@ public class AllTests
{
TestSuite suite = new TestSuite(
"Tests for required features");
-
+
//TODO(jsv) test only the usage of specific components used in Refactoring Processor
-
+
// Hierarchy
suite.addTest(org.eclipse.objectteams.otdt.tests.superhierarchy.AllTests.suite());
// TypeHelper.getInheritedMethods
@@ -52,7 +52,7 @@ public class AllTests
// SearchEngine
suite.addTest(org.eclipse.objectteams.otdt.tests.search.OTJavaMethodSearchTests.suite());
suite.addTest(org.eclipse.objectteams.otdt.tests.search.OTJavaTypeSearchTests.suite());
- //TODO(jsv): add required selection tests
+ //TODO(jsv): add required selection tests
return suite;
}
} \ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rolefile/MoveToRileFileTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rolefile/MoveToRileFileTests.java
index 3cabd15fd..35d95a8eb 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rolefile/MoveToRileFileTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rolefile/MoveToRileFileTests.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010 (c) GK Software AG
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -90,7 +90,7 @@ public class MoveToRileFileTests extends RefactoringTest {
MoveToRoleFileRefactoring ref = createMoveToRoleFileRefactoring(roleType);
assertTrue("activation", ref.checkInitialConditions(new NullProgressMonitor()).isOK());
-
+
RefactoringStatus checkInputResult = ref.checkFinalConditions(new NullProgressMonitor());
assertTrue("precondition was supposed to pass", !checkInputResult.hasError());
performChange(ref, false);
@@ -109,7 +109,7 @@ public class MoveToRileFileTests extends RefactoringTest {
}
}
}
-
+
private void performMoveToRoleFile_initialChecksFailing(String inputCU, String roleName, String expectedMsg) throws Exception {
ICompilationUnit cu = createCUfromTestFile(getPackageP(), inputCU);
try {
@@ -147,7 +147,7 @@ public class MoveToRileFileTests extends RefactoringTest {
// MoveToRoleFileRefactoring ref = createMoveToRoleFileRefactoring(roleType);
//
// assertTrue("activation", ref.checkInitialConditions(new NullProgressMonitor()).isOK());
-//
+//
// RefactoringStatus result = ref.checkFinalConditions(new NullProgressMonitor());
// assertNotNull("precondition was supposed to fail.", result);
// assertTrue("precondition was supposed to fail.", !result.isOK());
@@ -167,15 +167,15 @@ public class MoveToRileFileTests extends RefactoringTest {
/******* tests ******************/
/* Move To Role File Tests */
-
+
public void testSimpleRole1() throws Exception {
performMoveToRoleFile_pass("T", "R", new String[] { "T", "T/R" });
}
-
+
public void testWithMoreContents() throws Exception {
performMoveToRoleFile_pass("T", "R2", new String[] { "T", "T/R2" });
}
-
+
public void testFieldAndRole() throws Exception {
performMoveToRoleFile_pass("T2", "R2", new String[] { "T2", "T2/R2" });
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/util/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/util/AllTests.java
index 065cb33d8..7d4fb4b59 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/util/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/util/AllTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -29,7 +29,7 @@ import junit.framework.TestSuite;
/**
* @author brcan
- *
+ *
* Runs all OT-specific refactoring tests and corresponding eclipse refactoring tests
*/
public class AllTests
@@ -48,7 +48,7 @@ public class AllTests
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.util.RefactoringUtilTest.suite());
suite.addTest(TypeHelperGetInheritedMethodsTest.suite());
-
+
return suite;
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/util/RefactoringUtilTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/util/RefactoringUtilTest.java
index 8511e0dfd..d0fb42497 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/util/RefactoringUtilTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/util/RefactoringUtilTest.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -47,24 +47,24 @@ public class RefactoringUtilTest extends FileBasedRefactoringTest
private IType _c;
private IType _itest1;
private IType _itest2;
-
+
private IRoleType _team1role1;
private IRoleType _team2role1;
-
+
private IRoleType _team3role2;
private IRoleType _team4role2;
-
+
private IMethod _team2role1m1;
private IMethod _team2role1m2;
private IMethod _itest2m1;
-
+
private IMethod _cm1;
private IMethod _cm2;
private IMethod _team4role2m1;
private IMethod _team4role2m2;
-
+
ITypeHierarchy _hierarchy;
-
+
public RefactoringUtilTest(String name)
{
super(name);
@@ -74,7 +74,7 @@ public class RefactoringUtilTest extends FileBasedRefactoringTest
{
return new Suite(RefactoringUtilTest.class);
}
-
+
/**
* Creates a team hierarchy with implicit role type inheritance.
*/
@@ -82,110 +82,110 @@ public class RefactoringUtilTest extends FileBasedRefactoringTest
{
setTestProjectDir("RefactoringUtil");
super.setUpSuite();
-
+
_a = getType(getTestProjectDir(),
"src",
"rolehierarchy1",
"A");
-
+
_aa = getType(getTestProjectDir(),
"src",
"rolehierarchy1",
"AA");
-
+
_b = getType(getTestProjectDir(),
"src",
"rolehierarchy1",
"B");
-
+
_c = getType(getTestProjectDir(),
"src",
"rolehierarchy1",
"C");
-
+
_itest1 = getType(getTestProjectDir(),
"src",
"rolehierarchy1",
"ITest1");
-
+
_itest2 = getType(getTestProjectDir(),
"src",
"rolehierarchy1",
"ITest2");
-
+
_team1role1 =
getRole(getTestProjectDir(),
"src",
"rolehierarchy1",
"Team1",
"Role1");
-
+
_team2role1 =
getRole(getTestProjectDir(),
"src",
"rolehierarchy1",
"Team2",
"Role1");
-
+
_team3role2 =
getRole(getTestProjectDir(),
"src",
"rolehierarchy1",
"Team3",
"Role2");
-
+
_team4role2 =
getRole(getTestProjectDir(),
"src",
"rolehierarchy1",
"Team4",
"Role2");
-
+
_team2role1m1 = _team2role1.getMethods()[0];
_team2role1m2 = _team2role1.getMethods()[1];
-
+
_itest2m1 = _itest2.getMethods()[0];
-
+
_cm1 = _c.getMethods()[0];
_cm2 = _c.getMethods()[1];
_team4role2m2 = _team4role2.getMethods()[1];
_team4role2m1 = _team4role2.getMethods()[0];
-
-
+
+
_hierarchy = ((IType)_team4role2.getCorrespondingJavaElement()).newTypeHierarchy(null);
}
-
+
protected void setUp() throws Exception
{
super.setUp();
}
-
+
public void testIsDeclaredInInterface_yes() throws JavaModelException
{
IMethod expected = _itest2m1;
IMethod actual = RefactoringUtil.isDeclaredInInterface(_team2role1m1, _hierarchy, new NullProgressMonitor());
assertTrue(expected.equals(actual));
}
-
+
public void testIsDeclaredInInterface_no1() throws JavaModelException
{
IMethod actual = RefactoringUtil.isDeclaredInInterface(_team2role1m2, _hierarchy, new NullProgressMonitor());
assertNull(actual);
}
-
+
public void testIsDeclaredInInterface_no2() throws JavaModelException
{
IMethod actual = RefactoringUtil.isDeclaredInInterface(_team4role2m2, _hierarchy, new NullProgressMonitor());
assertNull(actual);
}
-
+
public void testOverridesAnotherMethod_yes() throws JavaModelException
{
IMethod expected = _cm2;
IMethod actual = RefactoringUtil.overridesAnotherMethod(_team4role2m2, _hierarchy, new NullProgressMonitor());
assertTrue(expected.equals(actual));
}
-
+
public void testOverridesAnotherMethod_no() throws JavaModelException
{
IMethod actual = RefactoringUtil.overridesAnotherMethod(_team2role1m2, _hierarchy, new NullProgressMonitor());
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/util/TypeHelperGetInheritedMethodsTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/util/TypeHelperGetInheritedMethodsTest.java
index 7f3093a6e..8157054d8 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/util/TypeHelperGetInheritedMethodsTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/util/TypeHelperGetInheritedMethodsTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -55,8 +55,8 @@ public class TypeHelperGetInheritedMethodsTest extends FileBasedModelTest
private IMethod _t2r1m5;
private IMethod _t3r2m1;
private IMethod _t3r2m3;
-
-
+
+
public TypeHelperGetInheritedMethodsTest(String name)
{
@@ -67,7 +67,7 @@ public class TypeHelperGetInheritedMethodsTest extends FileBasedModelTest
{
return new Suite(TypeHelperGetInheritedMethodsTest.class);
}
-
+
/**
* Creates a team hierarchy with implicit role type inheritance.
*/
@@ -75,14 +75,14 @@ public class TypeHelperGetInheritedMethodsTest extends FileBasedModelTest
{
setTestProjectDir("Hierarchy");
super.setUpSuite();
-
+
_t1r1 =
getRole(getTestProjectDir(),
"analysis",
"rolehierarchy4",
"T1",
"R1");
-
+
_t2r1 =
getRole(getTestProjectDir(),
"analysis",
@@ -96,14 +96,14 @@ public class TypeHelperGetInheritedMethodsTest extends FileBasedModelTest
"rolehierarchy4",
"T2",
"R2");
-
+
_t3r1 =
getRole(getTestProjectDir(),
"analysis",
"rolehierarchy4",
"T3",
"R1");
-
+
_t3r2 =
getRole(getTestProjectDir(),
"analysis",
@@ -116,7 +116,7 @@ public class TypeHelperGetInheritedMethodsTest extends FileBasedModelTest
"analysis",
"rolehierarchy4",
"C1");
-
+
_c1m1 = _c1.getMethods()[0];
_c1m2 = _c1.getMethods()[1];
_t1r1m3 = _t1r1.getMethods()[0];
@@ -124,12 +124,12 @@ public class TypeHelperGetInheritedMethodsTest extends FileBasedModelTest
_t2r1m5 = _t2r1.getMethods()[1];
_t2r2m3 = _t2r2.getMethods()[0];
_t2r2m4 = _t2r2.getMethods()[1];
-
+
_t3r2m1 = _t3r2.getMethods()[0];
_t3r2m3 = _t3r2.getMethods()[1];
-
+
}
-
+
protected void setUp() throws Exception
{
super.setUp();
@@ -141,13 +141,13 @@ public class TypeHelperGetInheritedMethodsTest extends FileBasedModelTest
IMethod[] actual = RefactoringUtil.getInheritedMethods(_t3r2, false, false, true, new NullProgressMonitor());
assertTrue( compareMethods(expected, actual) );
}
-
+
public void testGetInheritedMethodsFocusTypeIncluded() throws JavaModelException
{
IMethod[] expected = new IMethod[] {_t3r2m3, _t2r2m4, _t3r2m1, _c1m2};
IMethod[] actual = RefactoringUtil.getInheritedMethods(_t3r2, true, false, true, new NullProgressMonitor());
assertTrue( compareMethods(expected, actual) );
}
-
+
//TODO(jsv) test with nested teams
} \ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/AllTests.java
index 919c29497..d74c98100 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/AllTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/FileBasedUITest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/FileBasedUITest.java
index eb7c6ffa7..ff8a485fc 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/FileBasedUITest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/FileBasedUITest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/TestAdjuster.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/TestAdjuster.java
index a43017391..394dbfc80 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/TestAdjuster.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/TestAdjuster.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2014 GK Software AG
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -38,7 +38,7 @@ public team class TestAdjuster {
within(this)
base.changeNumberOfExpectedProblems();
}
-
+
protected class Collect playedBy QuickFixTest {
collectAllCorrections <- replace collectAllCorrections;
@@ -48,6 +48,6 @@ public team class TestAdjuster {
{
base.collectAllCorrections(iCompilationUnit, compilationUnit, nProblems == 9 ? 10 : nProblems);
}
- }
+ }
}
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/TestPlugin.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/TestPlugin.java
index 326c2fd5c..864b5415d 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/TestPlugin.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/TestPlugin.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -43,7 +43,7 @@ public class TestPlugin extends AbstractUIPlugin {
private static TestPlugin plugin;
//Resource bundle.
private ResourceBundle resourceBundle;
-
+
/**
* The constructor.
*/
@@ -62,7 +62,7 @@ public class TestPlugin extends AbstractUIPlugin {
*/
public void start(BundleContext context) throws Exception {
super.start(context);
-
+
disableCallinMarkers();
}
@@ -106,7 +106,7 @@ public class TestPlugin extends AbstractUIPlugin {
public ResourceBundle getResourceBundle() {
return resourceBundle;
}
-
+
public File getFileInPlugin(IPath path)
{
try
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/callinmarker/CallinMarkerTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/callinmarker/CallinMarkerTests.java
index 9f6bf7a30..1adeb5617 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/callinmarker/CallinMarkerTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/callinmarker/CallinMarkerTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -71,7 +71,7 @@ public class CallinMarkerTests extends FileBasedUITest
private IType _baseType;
private IResource _baseResource;
private MyCallinMarkerCreator _creator;
-
+
private class MyCallinMarkerCreator extends CallinMarkerCreator2
{
private boolean _finished = false;
@@ -80,7 +80,7 @@ public class CallinMarkerTests extends FileBasedUITest
{
return _finished;
}
-
+
public void reset() {
this._finished = false;
}
@@ -92,7 +92,7 @@ public class CallinMarkerTests extends FileBasedUITest
this.annotationHelper = new AnnotationHelper(targetEditor, targetEditor.getEditorInput());
}
}
-
+
protected void schedule(final CallinMarkerJob job,
IStatusLineManager statusLine)
{
@@ -110,7 +110,7 @@ public class CallinMarkerTests extends FileBasedUITest
return this._currentJob != null;
}
}
-
+
public CallinMarkerTests(String name)
{
super(name);
@@ -126,19 +126,19 @@ public class CallinMarkerTests extends FileBasedUITest
junit.framework.TestSuite suite = new Suite(CallinMarkerTests.class.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
enableUiMonitoring(false);
setTestProjectDir("CallinMarker");
-
+
super.setUpSuite();
}
-
+
protected void setUp() throws Exception
{
super.setUp();
-
+
_creator = new MyCallinMarkerCreator();
_creator.setEnabled(true);
System.out.println("Running test: "+this.getName());
@@ -203,9 +203,9 @@ public class CallinMarkerTests extends FileBasedUITest
project.open(null);
}
};
- getWorkspace().run(populate, null);
+ getWorkspace().run(populate, null);
}
-
+
private IType getJavaType(String projectName, String srcFolderName, String pkgName, String typeName) throws JavaModelException
{
ICompilationUnit typeUnit = getCompilationUnit(
@@ -214,13 +214,13 @@ public class CallinMarkerTests extends FileBasedUITest
pkgName,
typeName +".java");
IType typeJavaElem = typeUnit.getType(typeName);
-
+
if ((typeJavaElem != null) && (typeJavaElem.exists()))
{
return typeJavaElem;
}
return null;
- }
+ }
private void synchronousCreateMarkers(IResource resource) throws PartInitException, JavaModelException
{
@@ -248,22 +248,22 @@ public class CallinMarkerTests extends FileBasedUITest
fail("Interrupted while waiting for CallinMarkerCreator");
}
}
-
+
// The markers appear in undefined order, so we need to look them up in a Set
private void assertMarkers(Set<String> expectedMarkers, IMarker[] markers)
{
assertNotNull(markers);
assertNotNull(expectedMarkers);
-
+
assertEquals("Wrong number of markers", expectedMarkers.size(), markers.length);
-
+
try {
for (int i = 0; i < markers.length; i++)
{
assertNotNull(markers[i]);
String methodId = (String) markers[i].getAttribute(CallinMarker.ATTR_BASE_ELEMENT);
assertNotNull("CallinMarker without methodId attribute", methodId);
-
+
boolean isExpected = expectedMarkers.contains(methodId);
assertTrue("Unexpected marker found for method id: " + methodId, isExpected);
}
@@ -294,7 +294,7 @@ public class CallinMarkerTests extends FileBasedUITest
_baseResource = _baseType.getResource();
assertNotNull(_baseResource);
-
+
synchronousCreateMarkers(_baseResource);
Set<String> expectedMarkers = new HashSet<String>();
@@ -302,11 +302,11 @@ public class CallinMarkerTests extends FileBasedUITest
expectedMarkers.add("=CallinMarker/src<foo{MyBase.java[MyBase~bm2");
expectedMarkers.add("=CallinMarker/src<foo{MyBase.java[MyBase~bm3");
expectedMarkers.add("=CallinMarker/src<foo{MyBase.java[MyBase~bm4");
-
+
IMarker[] markers = getCallinMarkers(_baseResource);
assertMarkers(expectedMarkers, markers);
}
-
+
/** compute marker although one baseclass is missing. */
public void testMarkers_2() throws JavaModelException, PartInitException
{
@@ -314,12 +314,12 @@ public class CallinMarkerTests extends FileBasedUITest
_baseResource = _baseType.getResource();
assertNotNull(_baseResource);
-
+
synchronousCreateMarkers(_baseResource);
Set<String> expectedMarkers = new HashSet<String>();
expectedMarkers.add("=CallinMarker/src<bar{BaseTeam.java[BaseTeam~murx");
-
+
IMarker[] markers = getCallinMarkers(_baseResource);
assertMarkers(expectedMarkers, markers);
}
@@ -330,16 +330,16 @@ public class CallinMarkerTests extends FileBasedUITest
_baseResource = _baseType.getResource();
assertNotNull(_baseResource);
-
+
synchronousCreateMarkers(_baseResource);
Set<String> expectedMarkers = new HashSet<String>();
expectedMarkers.add("=CallinMarker/src<cycle{Base1.java[Base1[Inner~foo");
-
+
IMarker[] markers = getCallinMarkers(_baseResource);
assertMarkers(expectedMarkers, markers);
}
-
+
/** Cycle a la https://bugs.eclipse.org/303474 and callin-to-callin */
public void testMarkers_4() throws JavaModelException, PartInitException
{
@@ -347,37 +347,37 @@ public class CallinMarkerTests extends FileBasedUITest
_baseResource = _baseType.getResource();
assertNotNull(_baseResource);
-
+
synchronousCreateMarkers(_baseResource);
Set<String> expectedMarkers = new HashSet<String>();
expectedMarkers.add("=CallinMarker/src<cycle2{B.java[B[R~run");
-
+
IMarker[] markers = getCallinMarkers(_baseResource);
assertMarkers(expectedMarkers, markers);
}
-
+
// see http://trac.objectteams.org/ot/ticket/188
public void testMarkers_NonJavaPrj1() throws CoreException, IOException, InterruptedException
- {
+ {
createNonJavaPrj("NonJavaPrj");
MyLogListener myLogListener = new MyLogListener();
// can't use startLogListening() because we need to listen to RuntimeLog.
RuntimeLog.addLogListener(myLogListener);
-
+
try {
IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
IResource resource = workspaceRoot.findMember(new Path("/NonJavaPrj/folder/File.java"));
-
+
synchronousCreateMarkers(resource);
-
+
// wait for logging to occur after job is done:
while(this._creator.isCreatingMarkersFor(resource))
Thread.sleep(100);
-
+
if (!myLogListener.status.isEmpty())
fail("Unexpected Log: "+myLogListener.status.get(0));
-
+
IMarker[] markers = getCallinMarkers(resource);
assertEquals("Should have no markers", markers.length, 0);
} finally {
@@ -385,7 +385,7 @@ public class CallinMarkerTests extends FileBasedUITest
deleteProject("NonJavaPrj");
}
}
-
+
// see http://trac.objectteams.org/ot/ticket/188
public void testMarkers_NonJavaPrj2() throws CoreException, IOException, InterruptedException
{
@@ -393,23 +393,23 @@ public class CallinMarkerTests extends FileBasedUITest
MyLogListener myLogListener = new MyLogListener();
// can't use startLogListening() because we need to listen to RuntimeLog.
RuntimeLog.addLogListener(myLogListener);
-
+
try {
IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
IResource resource = workspaceRoot.findMember(new Path("/NonJavaPrj/folder/File.java"));
-
+
// cu pretends to exist when previously opened in a java editor
JavaUI.openInEditor(JavaCore.create(resource));
-
+
synchronousCreateMarkers(resource);
-
+
// wait for logging to occur after job is done:
while(this._creator.isCreatingMarkersFor(resource))
Thread.sleep(100);
-
+
if (!myLogListener.status.isEmpty())
fail("Unexpected Log: "+myLogListener.status.get(0));
-
+
IMarker[] markers = getCallinMarkers(resource);
assertEquals("Should have no markers", markers.length, 0);
} finally {
@@ -417,7 +417,7 @@ public class CallinMarkerTests extends FileBasedUITest
deleteProject("NonJavaPrj");
}
}
-
+
// see http://trac.objectteams.org/ot/ticket/188
public void testMarkers_NonJavaPrj3() throws CoreException, IOException, InterruptedException
{
@@ -425,27 +425,27 @@ public class CallinMarkerTests extends FileBasedUITest
MyLogListener myLogListener = new MyLogListener();
// can't use startLogListening() because we need to listen to RuntimeLog.
RuntimeLog.addLogListener(myLogListener);
-
+
try {
IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
// use classfile:
IResource resource = workspaceRoot.findMember(new Path("/NonJavaPrj/bin/folder/File.class"));
-
+
// cu pretends to exist when previously opened in a java editor
JavaUI.openInEditor(JavaCore.create(resource));
-
+
synchronousCreateMarkers(resource);
-
+
// wait for logging to occur after job is done:
while(this._creator.isCreatingMarkersFor(resource))
Thread.sleep(100);
-
+
assertEquals("Unexpeted number of log entries", 1, myLogListener.status.size());
- assertEquals("Unexpected Log[0]",
+ assertEquals("Unexpected Log[0]",
"Status ERROR: org.eclipse.ui code=4 Unable to create part " +
"org.eclipse.ui.PartInitException: The class file is not on the classpath",
myLogListener.status.get(0).toString());
-
+
IMarker[] markers = getCallinMarkers(resource);
assertEquals("Should have no markers", markers.length, 0);
} finally {
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/contentprovider/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/contentprovider/AllTests.java
index 62182ee1e..8c9a84044 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/contentprovider/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/contentprovider/AllTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/contentprovider/ExternalDefinedRoleContentAndParentTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/contentprovider/ExternalDefinedRoleContentAndParentTests.java
index 2643eb5be..57a126b04 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/contentprovider/ExternalDefinedRoleContentAndParentTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/contentprovider/ExternalDefinedRoleContentAndParentTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -54,7 +54,7 @@ public class ExternalDefinedRoleContentAndParentTests extends FileBasedUITest
private PackageExplorerContentProvider _testObj;
-
+
public ExternalDefinedRoleContentAndParentTests(String name)
{
super(name);
@@ -70,18 +70,18 @@ public class ExternalDefinedRoleContentAndParentTests extends FileBasedUITest
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("ExternalDefinedRole");
-
+
super.setUpSuite();
}
-
+
protected void setUp() throws Exception
{
super.setUp();
-
+
_testObj = new PackageExplorerContentProvider(true);
setShowTeamPackages(false);
}
@@ -90,7 +90,7 @@ public class ExternalDefinedRoleContentAndParentTests extends FileBasedUITest
PackageExplorerAdaptor adaptor = PackageExplorerAdaptor.getInstance();
adaptor.setShowTeamPackages(show, _testObj);
}
-
+
private IType getJavaType(String projectName, String srcFolderName, String pkgName, String typeName) throws JavaModelException
{
@@ -100,20 +100,20 @@ public class ExternalDefinedRoleContentAndParentTests extends FileBasedUITest
pkgName,
typeName +".java");
IType typeJavaElem = typeUnit.getType(typeName);
-
+
if ((typeJavaElem != null) && (typeJavaElem.exists()))
{
return typeJavaElem;
}
return null;
- }
-
+ }
+
private IRoleType getRole(String srcFolderName, String pkgName, String teamName, String roleName) throws JavaModelException
{
IType teamJavaElem = getJavaType(getTestProjectDir(), srcFolderName, pkgName, teamName);
IOTJavaElement teamOTElem = OTModelManager.getOTElement(teamJavaElem);
assertNotNull(teamOTElem);
-
+
IOTType teamType = (IOTType) teamOTElem;
IType roleJavaElem = teamType.getRoleType(roleName);
// IType roleJavaElem = teamJavaElem.getType(roleName); // IOTType.getType() does not return role files!
@@ -124,251 +124,251 @@ public class ExternalDefinedRoleContentAndParentTests extends FileBasedUITest
}
return null;
}
-
-
+
+
public void testRoleContent_EmptyRole() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("unbound", "teampkg", "Team_1", "SampleRole");
assertNotNull(roleOTElem);
-
+
Object[] children = _testObj.getChildren(roleOTElem);
-
+
assertNotNull(children);
assertTrue(children.length == 0);
}
-
+
public void testRoleContent_Field() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("unbound", "teampkg", "Team_2", "SampleRole");
assertNotNull(roleOTElem);
-
+
Object[] children = _testObj.getChildren(roleOTElem);
-
+
assertNotNull(children);
assertTrue(children.length == 1);
assertTrue(children[0] instanceof IField);
-
+
IField field = (IField) children[0];
assertEquals("roleAttr", field.getElementName());
assertEquals("QString;", field.getTypeSignature());
}
-
+
public void testRoleContent_ParameterlessMethod() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("unbound", "teampkg", "Team_3a", "SampleRole");
assertNotNull(roleOTElem);
-
+
Object[] children = _testObj.getChildren(roleOTElem);
-
+
assertNotNull(children);
assertTrue(children.length == 1);
assertTrue(children[0] instanceof IMethod);
-
+
IMethod method = (IMethod) children[0];
assertEquals("roleMethod", method.getElementName());
- assertEquals("()V", method.getSignature());
+ assertEquals("()V", method.getSignature());
}
-
+
public void testRoleContent_MethodWithParameter() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("unbound", "teampkg", "Team_3b", "SampleRole");
assertNotNull(roleOTElem);
-
+
Object[] children = _testObj.getChildren(roleOTElem);
-
+
assertNotNull(children);
assertTrue(children.length == 1);
assertTrue(children[0] instanceof IMethod);
-
+
IMethod method = (IMethod) children[0];
assertEquals("roleMethod", method.getElementName());
- assertEquals("(QString;)V", method.getSignature());
+ assertEquals("(QString;)V", method.getSignature());
}
public void testRoleContent_MethodWithReturnValue() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("unbound", "teampkg", "Team_3c", "SampleRole");
assertNotNull(roleOTElem);
-
+
Object[] children = _testObj.getChildren(roleOTElem);
-
+
assertNotNull(children);
assertTrue(children.length == 1);
assertTrue(children[0] instanceof IMethod);
-
+
IMethod method = (IMethod) children[0];
assertEquals("roleMethod", method.getElementName());
- assertEquals("()QString;", method.getSignature());
+ assertEquals("()QString;", method.getSignature());
}
-
+
public void testRoleContent_MethodWithThrowClause() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("unbound", "teampkg", "Team_3d", "SampleRole");
assertNotNull(roleOTElem);
-
+
Object[] children = _testObj.getChildren(roleOTElem);
-
+
assertNotNull(children);
assertTrue(children.length == 1);
assertTrue(children[0] instanceof IMethod);
-
+
IMethod method = (IMethod) children[0];
assertEquals("roleMethod", method.getElementName());
- assertEquals("()V", method.getSignature());
-
+ assertEquals("()V", method.getSignature());
+
String[] exceptionTypes = method.getExceptionTypes();
assertNotNull(exceptionTypes);
assertTrue(exceptionTypes.length == 1);
assertEquals("QException;", exceptionTypes[0]);
}
-
+
public void testRoleContent_Innerclass() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("unbound", "teampkg", "Team_4a", "SampleRole");
assertNotNull(roleOTElem);
-
+
Object[] children = _testObj.getChildren(roleOTElem);
-
+
assertNotNull(children);
assertTrue(children.length == 1);
assertTrue(children[0] instanceof IType);
-
+
IType innerType = (IType) children[0];
assertEquals("AnInnerClass", innerType.getElementName());
- }
+ }
public void testRoleContent_InnerTeamClass() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("unbound", "teampkg", "Team_4b", "SampleRole");
assertNotNull(roleOTElem);
-
+
Object[] children = _testObj.getChildren(roleOTElem);
-
+
assertNotNull(children);
assertTrue(children.length == 1);
assertTrue(children[0] instanceof IType);
-
+
IType innerType = (IType) children[0];
assertEquals("AnInnerTeamClass", innerType.getElementName());
}
-
-
+
+
public void testRoleContent_BoundRoleWithAbstractMethodAndCalloutMapping() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("boundtoordinary", "teampkg", "Team_5a", "SampleRole");
assertNotNull(roleOTElem);
-
+
Object[] children = _testObj.getChildren(roleOTElem);
assertNotNull(children);
assertTrue(children.length == 2);
-
+
assertTrue(children[MAPPING_IDX] instanceof ICalloutMapping);
assertEquals("roleMethod -> baseMethod", ((ICalloutMapping)children[MAPPING_IDX]).getElementName());
-
+
assertTrue(children[METHOD_IDX] instanceof IMethod);
IMethod method = (IMethod) children[METHOD_IDX];
assertEquals("roleMethod", method.getElementName());
- assertEquals("()V", method.getSignature());
+ assertEquals("()V", method.getSignature());
}
-
+
public void testRoleContent_BoundRoleWithConcreteMethodAndCalloutMapping() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("boundtoordinary", "teampkg", "Team_5b", "SampleRole");
assertNotNull(roleOTElem);
-
+
Object[] children = _testObj.getChildren(roleOTElem);
assertNotNull(children);
assertTrue(children.length == 2);
-
+
assertTrue(children[MAPPING_IDX] instanceof ICalloutMapping);
//TODO (kaschja) change mapping name by the time there is a distinction of '->' and '=>' in the OT-Model
assertEquals("roleMethod -> baseMethod", ((ICalloutMapping)children[MAPPING_IDX]).getElementName());
-
+
assertTrue(children[METHOD_IDX] instanceof IMethod);
IMethod method = (IMethod) children[METHOD_IDX];
assertEquals("roleMethod", method.getElementName());
- assertEquals("()V", method.getSignature());
+ assertEquals("()V", method.getSignature());
}
-
+
public void testRoleContent_BoundRoleWithMethodAndBeforeCallinMapping() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("boundtoordinary", "teampkg", "Team_5c", "SampleRole");
assertNotNull(roleOTElem);
-
+
Object[] children = _testObj.getChildren(roleOTElem);
assertNotNull(children);
assertTrue(children.length == 2);
-
+
assertTrue(children[MAPPING_IDX] instanceof ICallinMapping);
ICallinMapping mapping = (ICallinMapping)children[MAPPING_IDX];
assertEquals("roleMethod <- baseMethod", mapping.getElementName());
assertTrue(mapping.getCallinKind() == ICallinMapping.KIND_BEFORE);
-
+
assertTrue(children[METHOD_IDX] instanceof IMethod);
IMethod method = (IMethod) children[METHOD_IDX];
assertEquals("roleMethod", method.getElementName());
- assertEquals("()V", method.getSignature());
+ assertEquals("()V", method.getSignature());
}
-
+
public void testRoleContent_BoundRoleWithMethodAndReplaceCallinMapping() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("boundtoordinary", "teampkg", "Team_5d", "SampleRole");
assertNotNull(roleOTElem);
-
+
Object[] children = _testObj.getChildren(roleOTElem);
assertNotNull(children);
assertTrue(children.length == 2);
-
+
assertTrue(children[MAPPING_IDX] instanceof ICallinMapping);
ICallinMapping mapping = (ICallinMapping)children[MAPPING_IDX];
assertEquals("roleMethod <- baseMethod", mapping.getElementName());
assertTrue(mapping.getCallinKind() == ICallinMapping.KIND_REPLACE);
-
+
assertTrue(children[METHOD_IDX] instanceof IMethod);
IMethod method = (IMethod) children[METHOD_IDX];
assertEquals("roleMethod", method.getElementName());
- assertEquals("()V", method.getSignature());
+ assertEquals("()V", method.getSignature());
}
-
+
public void testRoleContent_BoundRoleWithMethodAndAfterCallinMapping() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("boundtoordinary", "teampkg", "Team_5e", "SampleRole");
assertNotNull(roleOTElem);
-
+
Object[] children = _testObj.getChildren(roleOTElem);
assertNotNull(children);
assertTrue(children.length == 2);
-
+
assertTrue(children[MAPPING_IDX] instanceof ICallinMapping);
ICallinMapping mapping = (ICallinMapping)children[MAPPING_IDX];
assertEquals("roleMethod <- baseMethod", mapping.getElementName());
assertTrue(mapping.getCallinKind() == ICallinMapping.KIND_AFTER);
-
+
assertTrue(children[METHOD_IDX] instanceof IMethod);
IMethod method = (IMethod) children[METHOD_IDX];
assertEquals("roleMethod", method.getElementName());
- assertEquals("()V", method.getSignature());
- }
+ assertEquals("()V", method.getSignature());
+ }
//************************************************************
// from here: testRoleParent
-//************************************************************
+//************************************************************
public void testRoleParent_EmptyRole() throws JavaModelException
{
IRoleType roleOTElem = getRole("unbound", "teampkg", "Team_1", "SampleRole");
assertNotNull(roleOTElem);
-
- Object parent = _testObj.getParent(roleOTElem);
+
+ Object parent = _testObj.getParent(roleOTElem);
assertNotNull(parent);
assertTrue(parent instanceof IType);
assertEquals("Team_1", ((IType)parent).getElementName());
}
-
+
public void testRoleParent_EmptyRole_PhysicalView() throws JavaModelException
{
IRoleType roleOTElem = getRole("unbound", "teampkg", "Team_1", "SampleRole");
assertNotNull(roleOTElem);
-
+
setShowTeamPackages(true);
Object parent = _testObj.getParent(roleOTElem);
assertNotNull(parent);
@@ -377,24 +377,24 @@ public class ExternalDefinedRoleContentAndParentTests extends FileBasedUITest
assertTrue("second level parent should be IPackageFragment", parent instanceof IPackageFragment);
assertEquals("Team package should have team name", "teampkg.Team_1", ((IPackageFragment)parent).getElementName());
}
-
+
public void testRoleParent_RoleWithField() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("unbound", "teampkg", "Team_2", "SampleRole");
assertNotNull(roleOTElem);
-
- Object parent = _testObj.getParent(roleOTElem);
+
+ Object parent = _testObj.getParent(roleOTElem);
assertNotNull(parent);
assertTrue(parent instanceof IType);
assertEquals("Team_2", ((IType)parent).getElementName());
- }
-
+ }
+
public void testRoleParent_RoleWithParameterlessMethod() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("unbound", "teampkg", "Team_3a", "SampleRole");
assertNotNull(roleOTElem);
-
- Object parent = _testObj.getParent(roleOTElem);
+
+ Object parent = _testObj.getParent(roleOTElem);
assertNotNull(parent);
assertTrue(parent instanceof IType);
assertEquals("Team_3a", ((IType)parent).getElementName());
@@ -404,41 +404,41 @@ public class ExternalDefinedRoleContentAndParentTests extends FileBasedUITest
{
IOTJavaElement roleOTElem = getRole("unbound", "teampkg", "Team_3b", "SampleRole");
assertNotNull(roleOTElem);
-
- Object parent = _testObj.getParent(roleOTElem);
+
+ Object parent = _testObj.getParent(roleOTElem);
assertNotNull(parent);
assertTrue(parent instanceof IType);
assertEquals("Team_3b", ((IType)parent).getElementName());
- }
-
+ }
+
public void testRoleParent_RoleWithMethodWithReturnValue() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("unbound", "teampkg", "Team_3c", "SampleRole");
assertNotNull(roleOTElem);
-
- Object parent = _testObj.getParent(roleOTElem);
+
+ Object parent = _testObj.getParent(roleOTElem);
assertNotNull(parent);
assertTrue(parent instanceof IType);
assertEquals("Team_3c", ((IType)parent).getElementName());
}
-
+
public void testRoleParent_RoleWithMethodWithThrowClause() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("unbound", "teampkg", "Team_3d", "SampleRole");
assertNotNull(roleOTElem);
-
- Object parent = _testObj.getParent(roleOTElem);
+
+ Object parent = _testObj.getParent(roleOTElem);
assertNotNull(parent);
assertTrue(parent instanceof IType);
assertEquals("Team_3d", ((IType)parent).getElementName());
- }
-
+ }
+
public void testRoleParent_RoleWithInnerclass() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("unbound", "teampkg", "Team_4a", "SampleRole");
assertNotNull(roleOTElem);
-
- Object parent = _testObj.getParent(roleOTElem);
+
+ Object parent = _testObj.getParent(roleOTElem);
assertNotNull(parent);
assertTrue(parent instanceof IType);
assertEquals("Team_4a", ((IType)parent).getElementName());
@@ -448,66 +448,66 @@ public class ExternalDefinedRoleContentAndParentTests extends FileBasedUITest
{
IOTJavaElement roleOTElem = getRole("unbound", "teampkg", "Team_4b", "SampleRole");
assertNotNull(roleOTElem);
-
- Object parent = _testObj.getParent(roleOTElem);
+
+ Object parent = _testObj.getParent(roleOTElem);
assertNotNull(parent);
assertTrue(parent instanceof IType);
assertEquals("Team_4b", ((IType)parent).getElementName());
}
-
+
public void testRoleParent_BoundRoleWithAbstractMethodAndCalloutMapping() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("boundtoordinary", "teampkg", "Team_5a", "SampleRole");
assertNotNull(roleOTElem);
Object parent = _testObj.getParent(roleOTElem);
-
+
assertNotNull(parent);
assertTrue(parent instanceof IType);
assertEquals("Team_5a", ((IType)parent).getElementName());
}
-
+
public void testRoleParent_BoundRoleWithConcreteMethodAndCalloutMapping() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("boundtoordinary", "teampkg", "Team_5b", "SampleRole");
assertNotNull(roleOTElem);
Object parent = _testObj.getParent(roleOTElem);
-
+
assertNotNull(parent);
assertTrue(parent instanceof IType);
assertEquals("Team_5b", ((IType)parent).getElementName());
}
-
+
public void testRoleParent_BoundRoleWithMethodAndBeforeCallinMapping() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("boundtoordinary", "teampkg", "Team_5c", "SampleRole");
assertNotNull(roleOTElem);
Object parent = _testObj.getParent(roleOTElem);
-
+
assertNotNull(parent);
assertTrue(parent instanceof IType);
assertEquals("Team_5c", ((IType)parent).getElementName());
}
-
+
public void testRoleParent_BoundRoleWithMethodAndReplaceCallinMapping() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("boundtoordinary", "teampkg", "Team_5d", "SampleRole");
assertNotNull(roleOTElem);
Object parent = _testObj.getParent(roleOTElem);
-
+
assertNotNull(parent);
assertTrue(parent instanceof IType);
assertEquals("Team_5d", ((IType)parent).getElementName());
}
-
+
public void testRoleParent_BoundRoleWithMethodAndAfterCallinMapping() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("boundtoordinary", "teampkg", "Team_5e", "SampleRole");
assertNotNull(roleOTElem);
Object parent = _testObj.getParent(roleOTElem);
-
+
assertNotNull(parent);
assertTrue(parent instanceof IType);
assertEquals("Team_5e", ((IType)parent).getElementName());
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/contentprovider/InternalDefinedRoleContentAndParentTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/contentprovider/InternalDefinedRoleContentAndParentTests.java
index 7ed4f72cc..771dc978b 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/contentprovider/InternalDefinedRoleContentAndParentTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/contentprovider/InternalDefinedRoleContentAndParentTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -47,9 +47,9 @@ public class InternalDefinedRoleContentAndParentTests extends FileBasedUITest
{
final int METHOD_IDX = 0;
final int MAPPING_IDX = 1;
-
+
private PackageExplorerContentProvider _testObj;
-
+
public InternalDefinedRoleContentAndParentTests(String name)
{
super(name);
@@ -65,21 +65,21 @@ public class InternalDefinedRoleContentAndParentTests extends FileBasedUITest
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("InternalDefinedRole");
-
+
super.setUpSuite();
}
-
+
protected void setUp() throws Exception
{
super.setUp();
-
+
_testObj = new PackageExplorerContentProvider(true);
}
-
+
private IType getJavaType(String projectName, String srcFolderName, String pkgName, String typeName) throws JavaModelException
{
@@ -89,18 +89,18 @@ public class InternalDefinedRoleContentAndParentTests extends FileBasedUITest
pkgName,
typeName +".java");
IType typeJavaElem = typeUnit.getType(typeName);
-
+
if ((typeJavaElem != null) && (typeJavaElem.exists()))
{
return typeJavaElem;
}
return null;
- }
-
+ }
+
private IOTJavaElement getRole(String srcFolderName, String pkgName, String teamName, String roleName) throws JavaModelException
{
IType teamJavaElem = getJavaType(getTestProjectDir(), srcFolderName, pkgName, teamName);
-
+
if (teamJavaElem != null)
{
IType roleJavaElem = teamJavaElem.getType(roleName);
@@ -115,143 +115,143 @@ public class InternalDefinedRoleContentAndParentTests extends FileBasedUITest
}
return null;
}
-
-
+
+
public void testRoleContent_EmptyRole() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("unbound", "teampkg", "Team_1", "SampleRole");
assertNotNull(roleOTElem);
-
+
Object[] children = _testObj.getChildren(roleOTElem);
-
+
assertNotNull(children);
assertTrue(children.length == 0);
}
-
+
public void testRoleContent_Field() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("unbound", "teampkg", "Team_2", "SampleRole");
assertNotNull(roleOTElem);
-
+
Object[] children = _testObj.getChildren(roleOTElem);
-
+
assertNotNull(children);
assertTrue(children.length == 1);
assertTrue(children[0] instanceof IField);
-
+
IField field = (IField) children[0];
assertEquals(field.getElementName(), "roleAttr");
assertEquals(field.getTypeSignature(), "QString;");
}
-
+
public void testRoleContent_ParameterlessMethod() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("unbound", "teampkg", "Team_3a", "SampleRole");
assertNotNull(roleOTElem);
-
+
Object[] children = _testObj.getChildren(roleOTElem);
-
+
assertNotNull(children);
assertTrue(children.length == 1);
assertTrue(children[0] instanceof IMethod);
-
+
IMethod method = (IMethod) children[0];
assertEquals(method.getElementName(), "roleMethod");
assertEquals(method.getSignature(), "()V");
}
-
+
public void testRoleContent_MethodWithParameter() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("unbound", "teampkg", "Team_3b", "SampleRole");
assertNotNull(roleOTElem);
-
+
Object[] children = _testObj.getChildren(roleOTElem);
-
+
assertNotNull(children);
assertTrue(children.length == 1);
assertTrue(children[0] instanceof IMethod);
-
+
IMethod method = (IMethod) children[0];
assertEquals(method.getElementName(), "roleMethod");
- assertEquals(method.getSignature(), "(QString;)V");
+ assertEquals(method.getSignature(), "(QString;)V");
}
public void testRoleContent_MethodWithReturnValue() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("unbound", "teampkg", "Team_3c", "SampleRole");
assertNotNull(roleOTElem);
-
+
Object[] children = _testObj.getChildren(roleOTElem);
-
+
assertNotNull(children);
assertTrue(children.length == 1);
assertTrue(children[0] instanceof IMethod);
-
+
IMethod method = (IMethod) children[0];
assertEquals(method.getElementName(), "roleMethod");
- assertEquals(method.getSignature(), "()QString;");
+ assertEquals(method.getSignature(), "()QString;");
}
-
+
public void testRoleContent_MethodWithThrowClause() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("unbound", "teampkg", "Team_3d", "SampleRole");
assertNotNull(roleOTElem);
-
+
Object[] children = _testObj.getChildren(roleOTElem);
-
+
assertNotNull(children);
assertTrue(children.length == 1);
assertTrue(children[0] instanceof IMethod);
-
+
IMethod method = (IMethod) children[0];
assertEquals(method.getElementName(), "roleMethod");
assertEquals(method.getSignature(), "()V");
-
+
String[] exceptionTypes = method.getExceptionTypes();
assertNotNull(exceptionTypes);
assertTrue(exceptionTypes.length == 1);
assertEquals(exceptionTypes[0], "QException;");
}
-
+
public void testRoleContent_Innerclass() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("unbound", "teampkg", "Team_4a", "SampleRole");
assertNotNull(roleOTElem);
-
+
Object[] children = _testObj.getChildren(roleOTElem);
-
+
assertNotNull(children);
assertTrue(children.length == 1);
assertTrue(children[0] instanceof IType);
-
+
IType innerType = (IType) children[0];
assertEquals(innerType.getElementName(), "AnInnerClass");
- }
+ }
public void testRoleContent_InnerTeamClass() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("unbound", "teampkg", "Team_4b", "SampleRole");
assertNotNull(roleOTElem);
-
+
Object[] children = _testObj.getChildren(roleOTElem);
-
+
assertNotNull(children);
assertTrue(children.length == 1);
assertTrue(children[0] instanceof IType);
-
+
IType innerType = (IType) children[0];
assertEquals(innerType.getElementName(), "AnInnerTeamClass");
}
-
-
+
+
public void testRoleContent_BoundRoleWithAbstractMethodAndCalloutMapping() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("boundtoordinary", "teampkg", "Team_5a", "SampleRole");
assertNotNull(roleOTElem);
-
+
Object[] children = _testObj.getChildren(roleOTElem);
assertNotNull(children);
-
+
//*********
// Logger.println(children.length);
// for (int idx = 0; idx < children.length; idx++)
@@ -260,126 +260,126 @@ public class InternalDefinedRoleContentAndParentTests extends FileBasedUITest
// }
assertTrue(children.length == 2);
//*********
-
+
assertTrue(children[MAPPING_IDX] instanceof ICalloutMapping);
assertEquals("roleMethod -> baseMethod", ((ICalloutMapping)children[MAPPING_IDX]).getElementName());
-
+
assertTrue(children[METHOD_IDX] instanceof IMethod);
IMethod method = (IMethod) children[METHOD_IDX];
assertEquals(method.getElementName(), "roleMethod");
- assertEquals(method.getSignature(), "()V");
+ assertEquals(method.getSignature(), "()V");
}
-
+
public void testRoleContent_BoundRoleWithConcreteMethodAndCalloutMapping() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("boundtoordinary", "teampkg", "Team_5b", "SampleRole");
assertNotNull(roleOTElem);
-
+
Object[] children = _testObj.getChildren(roleOTElem);
assertNotNull(children);
assertTrue(children.length == 2);
-
+
assertTrue(children[MAPPING_IDX] instanceof ICalloutMapping);
//TODO (kaschja) change mapping name by the time there is a distinction of '->' and '=>' in the OT-Model
assertEquals("roleMethod -> baseMethod", ((ICalloutMapping)children[MAPPING_IDX]).getElementName());
-
+
assertTrue(children[METHOD_IDX] instanceof IMethod);
IMethod method = (IMethod) children[METHOD_IDX];
assertEquals(method.getElementName(), "roleMethod");
- assertEquals(method.getSignature(), "()V");
+ assertEquals(method.getSignature(), "()V");
}
-
+
public void testRoleContent_BoundRoleWithMethodAndBeforeCallinMapping() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("boundtoordinary", "teampkg", "Team_5c", "SampleRole");
assertNotNull(roleOTElem);
-
+
Object[] children = _testObj.getChildren(roleOTElem);
assertNotNull(children);
assertTrue(children.length == 2);
-
+
assertTrue(children[MAPPING_IDX] instanceof ICallinMapping);
ICallinMapping mapping = (ICallinMapping)children[MAPPING_IDX];
assertEquals("roleMethod <- baseMethod", mapping.getElementName());
assertTrue(mapping.getCallinKind() == ICallinMapping.KIND_BEFORE);
-
+
assertTrue(children[METHOD_IDX] instanceof IMethod);
IMethod method = (IMethod) children[METHOD_IDX];
assertEquals(method.getElementName(), "roleMethod");
- assertEquals(method.getSignature(), "()V");
+ assertEquals(method.getSignature(), "()V");
}
-
+
public void testRoleContent_BoundRoleWithMethodAndReplaceCallinMapping() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("boundtoordinary", "teampkg", "Team_5d", "SampleRole");
assertNotNull(roleOTElem);
-
+
Object[] children = _testObj.getChildren(roleOTElem);
assertNotNull(children);
assertTrue(children.length == 2);
-
+
assertTrue(children[MAPPING_IDX] instanceof ICallinMapping);
ICallinMapping mapping = (ICallinMapping)children[MAPPING_IDX];
assertEquals("roleMethod <- baseMethod", mapping.getElementName());
assertTrue(mapping.getCallinKind() == ICallinMapping.KIND_REPLACE);
-
+
assertTrue(children[METHOD_IDX] instanceof IMethod);
IMethod method = (IMethod) children[METHOD_IDX];
assertEquals(method.getElementName(), "roleMethod");
- assertEquals(method.getSignature(), "()V");
+ assertEquals(method.getSignature(), "()V");
}
-
+
public void testRoleContent_BoundRoleWithMethodAndAfterCallinMapping() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("boundtoordinary", "teampkg", "Team_5e", "SampleRole");
assertNotNull(roleOTElem);
-
+
Object[] children = _testObj.getChildren(roleOTElem);
assertNotNull(children);
assertTrue(children.length == 2);
-
+
assertTrue(children[MAPPING_IDX] instanceof ICallinMapping);
ICallinMapping mapping = (ICallinMapping)children[MAPPING_IDX];
assertEquals("roleMethod <- baseMethod", mapping.getElementName());
assertTrue(mapping.getCallinKind() == ICallinMapping.KIND_AFTER);
-
+
assertTrue(children[METHOD_IDX] instanceof IMethod);
IMethod method = (IMethod) children[METHOD_IDX];
assertEquals(method.getElementName(), "roleMethod");
- assertEquals(method.getSignature(), "()V");
- }
+ assertEquals(method.getSignature(), "()V");
+ }
//************************************************************
// from here: testRoleParent
-//************************************************************
+//************************************************************
public void testRoleParent_EmptyRole() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("unbound", "teampkg", "Team_1", "SampleRole");
assertNotNull(roleOTElem);
-
- Object parent = _testObj.getParent(roleOTElem);
+
+ Object parent = _testObj.getParent(roleOTElem);
assertNotNull(parent);
assertTrue(parent instanceof IType);
assertEquals(((IType)parent).getElementName(), "Team_1");
}
-
+
public void testRoleParent_RoleWithField() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("unbound", "teampkg", "Team_2", "SampleRole");
assertNotNull(roleOTElem);
-
- Object parent = _testObj.getParent(roleOTElem);
+
+ Object parent = _testObj.getParent(roleOTElem);
assertNotNull(parent);
assertTrue(parent instanceof IType);
assertEquals(((IType)parent).getElementName(), "Team_2");
- }
-
+ }
+
public void testRoleParent_RoleWithParameterlessMethod() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("unbound", "teampkg", "Team_3a", "SampleRole");
assertNotNull(roleOTElem);
-
- Object parent = _testObj.getParent(roleOTElem);
+
+ Object parent = _testObj.getParent(roleOTElem);
assertNotNull(parent);
assertTrue(parent instanceof IType);
assertEquals(((IType)parent).getElementName(), "Team_3a");
@@ -389,41 +389,41 @@ public class InternalDefinedRoleContentAndParentTests extends FileBasedUITest
{
IOTJavaElement roleOTElem = getRole("unbound", "teampkg", "Team_3b", "SampleRole");
assertNotNull(roleOTElem);
-
- Object parent = _testObj.getParent(roleOTElem);
+
+ Object parent = _testObj.getParent(roleOTElem);
assertNotNull(parent);
assertTrue(parent instanceof IType);
assertEquals(((IType)parent).getElementName(), "Team_3b");
- }
-
+ }
+
public void testRoleParent_RoleWithMethodWithReturnValue() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("unbound", "teampkg", "Team_3c", "SampleRole");
assertNotNull(roleOTElem);
-
- Object parent = _testObj.getParent(roleOTElem);
+
+ Object parent = _testObj.getParent(roleOTElem);
assertNotNull(parent);
assertTrue(parent instanceof IType);
assertEquals(((IType)parent).getElementName(), "Team_3c");
}
-
+
public void testRoleParent_RoleWithMethodWithThrowClause() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("unbound", "teampkg", "Team_3d", "SampleRole");
assertNotNull(roleOTElem);
-
- Object parent = _testObj.getParent(roleOTElem);
+
+ Object parent = _testObj.getParent(roleOTElem);
assertNotNull(parent);
assertTrue(parent instanceof IType);
assertEquals(((IType)parent).getElementName(), "Team_3d");
- }
-
+ }
+
public void testRoleParent_RoleWithInnerclass() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("unbound", "teampkg", "Team_4a", "SampleRole");
assertNotNull(roleOTElem);
-
- Object parent = _testObj.getParent(roleOTElem);
+
+ Object parent = _testObj.getParent(roleOTElem);
assertNotNull(parent);
assertTrue(parent instanceof IType);
assertEquals(((IType)parent).getElementName(), "Team_4a");
@@ -433,66 +433,66 @@ public class InternalDefinedRoleContentAndParentTests extends FileBasedUITest
{
IOTJavaElement roleOTElem = getRole("unbound", "teampkg", "Team_4b", "SampleRole");
assertNotNull(roleOTElem);
-
- Object parent = _testObj.getParent(roleOTElem);
+
+ Object parent = _testObj.getParent(roleOTElem);
assertNotNull(parent);
assertTrue(parent instanceof IType);
assertEquals(((IType)parent).getElementName(), "Team_4b");
}
-
+
public void testRoleParent_BoundRoleWithAbstractMethodAndCalloutMapping() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("boundtoordinary", "teampkg", "Team_5a", "SampleRole");
assertNotNull(roleOTElem);
Object parent = _testObj.getParent(roleOTElem);
-
+
assertNotNull(parent);
assertTrue(parent instanceof IType);
assertEquals(((IType)parent).getElementName(), "Team_5a");
}
-
+
public void testRoleParent_BoundRoleWithConcreteMethodAndCalloutMapping() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("boundtoordinary", "teampkg", "Team_5b", "SampleRole");
assertNotNull(roleOTElem);
Object parent = _testObj.getParent(roleOTElem);
-
+
assertNotNull(parent);
assertTrue(parent instanceof IType);
assertEquals(((IType)parent).getElementName(), "Team_5b");
}
-
+
public void testRoleParent_BoundRoleWithMethodAndBeforeCallinMapping() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("boundtoordinary", "teampkg", "Team_5c", "SampleRole");
assertNotNull(roleOTElem);
Object parent = _testObj.getParent(roleOTElem);
-
+
assertNotNull(parent);
assertTrue(parent instanceof IType);
assertEquals(((IType)parent).getElementName(), "Team_5c");
}
-
+
public void testRoleParent_BoundRoleWithMethodAndReplaceCallinMapping() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("boundtoordinary", "teampkg", "Team_5d", "SampleRole");
assertNotNull(roleOTElem);
Object parent = _testObj.getParent(roleOTElem);
-
+
assertNotNull(parent);
assertTrue(parent instanceof IType);
assertEquals(((IType)parent).getElementName(), "Team_5d");
}
-
+
public void testRoleParent_BoundRoleWithMethodAndAfterCallinMapping() throws JavaModelException
{
IOTJavaElement roleOTElem = getRole("boundtoordinary", "teampkg", "Team_5e", "SampleRole");
assertNotNull(roleOTElem);
Object parent = _testObj.getParent(roleOTElem);
-
+
assertNotNull(parent);
assertTrue(parent instanceof IType);
assertEquals(((IType)parent).getElementName(), "Team_5e");
- }
-
+ }
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/contentprovider/Logger.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/contentprovider/Logger.java
index 84523867c..16e762520 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/contentprovider/Logger.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/contentprovider/Logger.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -38,14 +38,14 @@ public class Logger
System.out.println(obj.toString());
}
}
-
+
// public static void println(String text)
// {
// System.out.println(text);
// }
-
+
public static void println(int number)
{
System.out.println(number);
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/contentprovider/TeamContentTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/contentprovider/TeamContentTests.java
index 4e45717de..6c5b60ac6 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/contentprovider/TeamContentTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/contentprovider/TeamContentTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -44,10 +44,10 @@ import org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider;
*/
public class TeamContentTests extends FileBasedUITest
{
-
+
private PackageExplorerContentProvider _testObj;
-
-
+
+
public TeamContentTests(String name)
{
super(name);
@@ -63,20 +63,20 @@ public class TeamContentTests extends FileBasedUITest
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("TeamProject");
-
+
super.setUpSuite();
}
-
+
protected void setUp() throws Exception
{
super.setUp();
_testObj = new PackageExplorerContentProvider(true);
}
-
+
private IType getJavaType(String projectName, String srcFolderName, String pkgName, String typeName) throws JavaModelException
{
@@ -86,18 +86,18 @@ public class TeamContentTests extends FileBasedUITest
pkgName,
typeName +".java");
IType typeJavaElem = typeUnit.getType(typeName);
-
+
if ((typeJavaElem != null) && (typeJavaElem.exists()))
{
return typeJavaElem;
}
return null;
- }
-
+ }
+
private IOTJavaElement getTeam(String srcFolderName, String pkgName, String teamName) throws JavaModelException
{
IType teamJavaElem = getJavaType(getTestProjectDir(), srcFolderName, pkgName, teamName);
-
+
if (teamJavaElem != null)
{
IOTJavaElement teamOTElem = OTModelManager.getOTElement(teamJavaElem);
@@ -108,184 +108,184 @@ public class TeamContentTests extends FileBasedUITest
}
return null;
}
-
-
+
+
public void testTeamContent_EmptyTeam() throws JavaModelException
{
IOTJavaElement teamOTElem = getTeam("src", "teampkg", "EmptyTeam");
assertNotNull(teamOTElem);
-
+
Object[] children = _testObj.getChildren(teamOTElem);
-
+
assertNotNull(children);
assertTrue(children.length == 0);
}
-
+
public void testTeamContent_Field() throws JavaModelException
{
IOTJavaElement teamOTElem = getTeam("src", "teampkg", "TeamWithField");
assertNotNull(teamOTElem);
-
+
Object[] children = _testObj.getChildren(teamOTElem);
-
+
assertNotNull(children);
assertTrue(children.length == 1);
assertTrue(children[0] instanceof IField);
-
+
IField field = (IField) children[0];
assertEquals(field.getElementName(), "teamlevelField");
assertEquals(field.getTypeSignature(), "QString;");
}
-
+
public void testTeamContent_ParameterlessMethod() throws JavaModelException
{
IOTJavaElement teamOTElem = getTeam("src", "teampkg", "TeamWithParameterlessMethod");
assertNotNull(teamOTElem);
-
+
Object[] children = _testObj.getChildren(teamOTElem);
-
+
assertNotNull(children);
assertTrue(children.length == 1);
assertTrue(children[0] instanceof IMethod);
-
+
IMethod method = (IMethod) children[0];
assertEquals(method.getElementName(), "teamlevelMethod");
assertEquals(method.getSignature(), "()V");
}
-
+
public void testTeamContent_MethodWithParameter() throws JavaModelException
{
IOTJavaElement teamOTElem = getTeam("src", "teampkg", "TeamWithMethodWithParameter");
assertNotNull(teamOTElem);
-
+
Object[] children = _testObj.getChildren(teamOTElem);
-
+
assertNotNull(children);
assertTrue(children.length == 1);
assertTrue(children[0] instanceof IMethod);
-
+
IMethod method = (IMethod) children[0];
assertEquals(method.getElementName(), "teamlevelMethod");
- assertEquals(method.getSignature(), "(QString;)V");
+ assertEquals(method.getSignature(), "(QString;)V");
}
public void testTeamContent_MethodWithReturnValue() throws JavaModelException
{
IOTJavaElement teamOTElem = getTeam("src", "teampkg", "TeamWithMethodWithReturnValue");
assertNotNull(teamOTElem);
-
+
Object[] children = _testObj.getChildren(teamOTElem);
-
+
assertNotNull(children);
assertTrue(children.length == 1);
assertTrue(children[0] instanceof IMethod);
-
+
IMethod method = (IMethod) children[0];
assertEquals(method.getElementName(), "teamlevelMethod");
- assertEquals(method.getSignature(), "()QString;");
+ assertEquals(method.getSignature(), "()QString;");
}
-
+
public void testTeamContent_MethodWithThrowClause() throws JavaModelException
{
IOTJavaElement teamOTElem = getTeam("src", "teampkg", "TeamWithMethodWithThrowClause");
assertNotNull(teamOTElem);
-
+
Object[] children = _testObj.getChildren(teamOTElem);
-
+
assertNotNull(children);
assertTrue(children.length == 1);
assertTrue(children[0] instanceof IMethod);
-
+
IMethod method = (IMethod) children[0];
assertEquals(method.getElementName(), "teamlevelMethod");
assertEquals(method.getSignature(), "()V");
-
+
String[] exceptionTypes = method.getExceptionTypes();
assertNotNull(exceptionTypes);
assertTrue(exceptionTypes.length == 1);
assertEquals(exceptionTypes[0], "QException;");
}
-
+
public void testTeamContent_InnerRoleClass() throws JavaModelException
{
IOTJavaElement teamOTElem = getTeam("src", "teampkg", "TeamWithRoleClass");
assertNotNull(teamOTElem);
-
+
Object[] children = _testObj.getChildren(teamOTElem);
-
+
assertNotNull(children);
-
+
// Logger.println(children.length);
// Logger.println(((IRoleType)children[0]).getElementName());
-
+
assertTrue(children.length == 1);
-
+
assertTrue(children[0] instanceof IRoleType);
-
+
IRoleType innerType = (IRoleType) children[0];
assertEquals(innerType.getElementName(), "RoleClass");
- }
+ }
public void testTeamContent_InnerTeamClass() throws JavaModelException
{
IOTJavaElement teamOTElem = getTeam("src", "teampkg", "TeamWithInnerTeamClass");
assertNotNull(teamOTElem);
-
+
Object[] children = _testObj.getChildren(teamOTElem);
-
+
assertNotNull(children);
-
+
// Logger.println(children.length);
// Logger.println(((IRoleType)children[0]).getElementName());
-
+
assertTrue(children.length == 1);
assertTrue(children[0] instanceof IRoleType);
-
+
IRoleType innerType = (IRoleType) children[0];
assertEquals(innerType.getElementName(), "InnerTeamClass");
- //TODO (kaschja) comment in next line by the time team cascading is supported
+ //TODO (kaschja) comment in next line by the time team cascading is supported
//assertTrue(innerType.isTeam());
}
-
-//TODO (kaschja) test containment of external defined role classes in a team depending on user defined visibility specification for external role packages
+
+//TODO (kaschja) test containment of external defined role classes in a team depending on user defined visibility specification for external role packages
// public void testTeamContent_ExternalDefinedRoleClass() throws JavaModelException
// {
// PackageExplorerPart part = new PackageExplorerPart();
// part.createPartControl(null);
-//
+//
// PackageExplorerContentProvider contentProviderToTest = part.getContentProvider();
-// HideExternalRolePackagesAction hideRolesAction = contentProviderToTest.getHideRolesAction();
+// HideExternalRolePackagesAction hideRolesAction = contentProviderToTest.getHideRolesAction();
// IOTJavaElement teamOTElem = getTeam("src", "teampkg", "TeamWithExternalDefinedRoleClass");
// Object[] children;
-//
+//
// assertNotNull(contentProviderToTest);
// assertNotNull(hideRolesAction);
// assertNotNull(teamOTElem);
-//
-//
+//
+//
// if (!hideRolesAction.isRolePackageVisible())
// {
-// //switch the state to "role package is visible"
+// //switch the state to "role package is visible"
// _hideExternalRolesAction.run();
// }
// assertTrue(hideRolesAction.isRolePackageVisible());
-//
+//
// children = contentProviderToTest.getChildren(teamOTElem);
-//
+//
// assertNotNull(children);
// assertTrue(children.length == 1);
// assertTrue(children[0] instanceof IRoleType);
-//
+//
// IRoleType innerType = (IRoleType) children[0];
-// assertEquals(innerType.getElementName(), "RoleClass");
-//
-//
-// //switch the state to "role package is NOT visible"
+// assertEquals(innerType.getElementName(), "RoleClass");
+//
+//
+// //switch the state to "role package is NOT visible"
// hideRolesAction.run();
// assertTrue(!hideRolesAction.isRolePackageVisible());
-//
+//
// children = contentProviderToTest.getChildren(teamOTElem);
// assertNotNull(children);
-// assertTrue(children.length == 0);
-// }
+// assertTrue(children.length == 0);
+// }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/AddImportQuickFixTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/AddImportQuickFixTest.java
index d43cdb805..000cd4396 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/AddImportQuickFixTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/AddImportQuickFixTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2016 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -48,7 +48,7 @@ import org.junit.runners.JUnit4;
@RunWith(JUnit4.class)
public class AddImportQuickFixTest extends OTQuickFixTest {
-
+
@Rule
public ProjectTestSetup projectsetup = new ProjectTestSetup();
@@ -66,39 +66,39 @@ public class AddImportQuickFixTest extends OTQuickFixTest {
// team:
IPackageFragment pack1= fSourceFolder.createPackageFragment("test.import1", false, null);
buf = new StringBuffer();
- buf.append("package test.import1;\n");
+ buf.append("package test.import1;\n");
buf.append("public team class T {\n");
buf.append(" protected class R2 playedBy test.base1.Base1 {\n");
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("T.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 3);
assertCorrectLabels(proposals);
-
+
CUCorrectionProposal proposal= null;
for (Object prop : proposals)
if (prop instanceof CUCorrectionProposal && ((CUCorrectionProposal)prop).getRelevance() > 0)
proposal = (CUCorrectionProposal)prop;
assertNotNull("Need proposal with positive relevance", proposal);
assertEquals("Wrong quickfix label", "\"Change qualified reference to using 'import base test...Base1;'\"", proposal.getDisplayString());
-
+
String preview= getPreviewContent(proposal);
buf= new StringBuffer();
buf.append("package test.import1;\n");
- buf.append("\n");
+ buf.append("\n");
buf.append("import base test.base1.Base1;\n");
- buf.append("\n");
+ buf.append("\n");
buf.append("public team class T {\n");
buf.append(" protected class R2 playedBy Base1 {\n");
buf.append(" }\n");
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
// ROFI variant:
@Test
public void testChangeFQNToBaseImport2() throws Exception {
@@ -114,30 +114,30 @@ public class AddImportQuickFixTest extends OTQuickFixTest {
// team:
IPackageFragment pack1= fSourceFolder.createPackageFragment("test.import1", false, null);
buf = new StringBuffer();
- buf.append("package test.import1;\n");
+ buf.append("package test.import1;\n");
buf.append("public team class T {\n");
buf.append("}\n");
ICompilationUnit teamUnit = pack1.createCompilationUnit("T.java", buf.toString(), false, null);
// ROFI:
IPackageFragment teamPack = fSourceFolder.createPackageFragment("test.import1.T", true, null);
buf = new StringBuffer();
- buf.append("team package test.import1.T;\n");
+ buf.append("team package test.import1.T;\n");
buf.append("protected class R2 playedBy test.base1.Base1 {\n");
buf.append("}\n");
ICompilationUnit cu= teamPack.createCompilationUnit("R2.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 3);
assertCorrectLabels(proposals);
-
+
CUCorrectionProposal proposal= null;
for (Object prop : proposals)
if (prop instanceof CUCorrectionProposal && ((CUCorrectionProposal)prop).getRelevance() > 0)
proposal = (CUCorrectionProposal)prop;
assertNotNull("Need proposal with positive relevance", proposal);
assertEquals("Wrong quickfix label", "\"Change qualified reference to using 'import base test...Base1;'\"", proposal.getDisplayString());
-
+
String preview= getPreviewContent(proposal);
buf= new StringBuffer();
@@ -157,7 +157,7 @@ public class AddImportQuickFixTest extends OTQuickFixTest {
assertEquals("Expected one import", 1, imports.length);
assertEquals("Unexpected import", "test.base1.Base1", imports[0].getElementName());
assertEquals("Expected base import", ExtraCompilerModifiers.AccBase, imports[0].getFlags());
-
+
// drop editors whose content has been modified by apply(),
// so that tearDown can delete files without asking the user:
Workbench.getInstance().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false);
@@ -228,7 +228,7 @@ public class AddImportQuickFixTest extends OTQuickFixTest {
// team:
IPackageFragment pack1= fSourceFolder.createPackageFragment("test.import1", false, null);
buf = new StringBuffer();
- buf.append("package test.import1;\n");
+ buf.append("package test.import1;\n");
buf.append("public team class T {\n");
buf.append("}\n");
pack1.createCompilationUnit("T.java", buf.toString(), false, null);
@@ -241,25 +241,25 @@ public class AddImportQuickFixTest extends OTQuickFixTest {
buf.append("}\n");
ICompilationUnit cu= pack1T.createCompilationUnit("R2.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 6);
assertCorrectLabels(proposals);
-
+
CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0);
String preview= getPreviewContent(proposal);
buf= new StringBuffer();
buf.append("package test.import1;\n");
- buf.append("\n");
+ buf.append("\n");
buf.append("import base test.base.Base1;\n");
- buf.append("\n");
+ buf.append("\n");
buf.append("public team class T {\n");
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
// this time files already have content
@Test
public void testAddBaseImportForRofi2() throws Exception {
@@ -298,18 +298,18 @@ public class AddImportQuickFixTest extends OTQuickFixTest {
buf.append("}\n");
ICompilationUnit cu= pack1T.createCompilationUnit("R2.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 6);
assertCorrectLabels(proposals);
-
+
CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0);
String preview= getPreviewContent(proposal);
buf= new StringBuffer();
buf.append("package test.import1;\n");
- buf.append("\n");
+ buf.append("\n");
buf.append("import java.util.List;\n");
buf.append("\n");
buf.append("import base java.awt.Window;\n");
@@ -337,7 +337,7 @@ public class AddImportQuickFixTest extends OTQuickFixTest {
buf.append(" public class R {}\n");
buf.append("}\n");
pack1.createCompilationUnit("T.java", buf.toString(), false, null);
-
+
// client
IPackageFragment pack2= fSourceFolder.createPackageFragment("test.import2", false, null);
buf = new StringBuffer();
@@ -352,12 +352,12 @@ public class AddImportQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu = pack2.createCompilationUnit("C.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 7);
assertCorrectLabels(proposals);
-
+
CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0);
String preview= getPreviewContent(proposal);
@@ -395,7 +395,7 @@ public class AddImportQuickFixTest extends OTQuickFixTest {
buf.append("\n");
buf.append("public class R {}\n");
teampack.createCompilationUnit("R.java", buf.toString(), false, null);
-
+
// client
IPackageFragment pack2= fSourceFolder.createPackageFragment("test.import2", false, null);
buf = new StringBuffer();
@@ -410,12 +410,12 @@ public class AddImportQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu = pack2.createCompilationUnit("C.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 7);
assertCorrectLabels(proposals);
-
+
CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0);
String preview= getPreviewContent(proposal);
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/AddUnimplementedMethodsTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/AddUnimplementedMethodsTest.java
index a2efe699c..6a5c5d521 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/AddUnimplementedMethodsTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/AddUnimplementedMethodsTest.java
@@ -6,7 +6,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Fraunhofer FIRST - Initial API and implementation
@@ -55,20 +55,20 @@ import org.eclipse.jdt.ui.JavaUI;
import org.eclipse.jdt.ui.PreferenceConstants;
import org.eclipse.jdt.ui.tests.core.ProjectTestSetup;
-/** Structure is OT_COPY_PASTE from {@link org.eclipse.jdt.ui.tests.core.source.AddUnimplementedMethodsTest}
- * @since 1.2.1
+/** Structure is OT_COPY_PASTE from {@link org.eclipse.jdt.ui.tests.core.source.AddUnimplementedMethodsTest}
+ * @since 1.2.1
*/
public class AddUnimplementedMethodsTest extends TestCase {
-
+
private static final Class THIS= AddUnimplementedMethodsTest.class;
-
+
private IJavaProject fJavaProject;
private IPackageFragment fPackage;
-
+
public AddUnimplementedMethodsTest(String name) {
super(name);
}
-
+
public static Test allTests() {
return new ProjectTestSetup(new TestSuite(THIS));
}
@@ -80,24 +80,24 @@ public class AddUnimplementedMethodsTest extends TestCase {
TestSuite suite= new TestSuite();
suite.addTest(new AddUnimplementedMethodsTest("test1"));
return new ProjectTestSetup(suite);
- }
+ }
}
-
+
protected void setUp() throws Exception {
fJavaProject= JavaProjectHelper.createJavaProject("DummyProject", "bin");
assertNotNull(JavaProjectHelper.addRTJar(fJavaProject));
-
+
Hashtable<String,String> options= TestOptions.getDefaultOptions();
options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.SPACE);
options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4");
options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "999");
fJavaProject.setOptions(options);
-
+
StubUtility.setCodeTemplate(CodeTemplateContextType.METHODSTUB_ID, "${body_statement}\n// TODO", null);
-
+
IPackageFragmentRoot root= JavaProjectHelper.addSourceContainer(fJavaProject, "src");
fPackage= root.createPackageFragment("org.eclispe.objectteams.util", true, null);
-
+
IEclipsePreferences node= new ProjectScope(fJavaProject.getProject()).getNode(JavaUI.ID_PLUGIN);
node.putBoolean(PreferenceConstants.CODEGEN_USE_OVERRIDE_ANNOTATION, false);
node.putBoolean(PreferenceConstants.CODEGEN_ADD_COMMENTS, false);
@@ -121,28 +121,28 @@ public class AddUnimplementedMethodsTest extends TestCase {
buf.append(" }\n");
buf.append("}\n");
fPackage.createCompilationUnit("F.java", buf.toString(), false, null);
-
+
buf= new StringBuffer();
buf.append("package org.eclipse.objectteams.util;\n");
ICompilationUnit cu= fPackage.createCompilationUnit("F2.java", buf.toString(), false, null);
-
+
IType testClass= cu.createType("public team class F2 extends F {\n\n}\n", null, true, null);
testClass = testClass.createType("public class R playedBy Object {\n\n}\n", null, true, null);
-
+
testHelper(testClass);
-
+
IMethod[] methods= testClass.getMethods();
checkMethods(new String[] { "b", "equals", "clone", "toString", "finalize", "hashCode" }, methods);
-
+
IImportDeclaration[] imports= cu.getImports();
checkImports(new String[]{"java.util.Properties"}, imports);
}
-
-
+
+
private void testHelper(IType testClass) throws JavaModelException, CoreException {
testHelper(testClass, -1, true);
}
-
+
private void testHelper(IType testClass, int insertionPos, boolean implementAllOverridable) throws JavaModelException, CoreException {
RefactoringASTParser parser= new RefactoringASTParser(AST.JLS8);
CompilationUnit unit= parser.parse(testClass.getCompilationUnit(), true);
@@ -150,14 +150,14 @@ public class AddUnimplementedMethodsTest extends TestCase {
assertNotNull("Could not find type declaration node", declaration);
ITypeBinding binding= declaration.resolveBinding();
assertNotNull("Binding for type declaration could not be resolved", binding);
-
+
IMethodBinding[] overridableMethods= implementAllOverridable ? StubUtility2Core.getOverridableMethods(unit.getAST(), binding, false) : null;
-
+
AddUnimplementedMethodsOperation op= new AddUnimplementedMethodsOperation(unit, binding, overridableMethods, insertionPos, true, true, true);
op.run(new NullProgressMonitor());
JavaModelUtil.reconcile(testClass.getCompilationUnit());
}
-
+
private void checkMethods(String[] expected, IMethod[] methods) {
int nMethods= methods.length;
int nExpected= expected.length;
@@ -166,8 +166,8 @@ public class AddUnimplementedMethodsTest extends TestCase {
String methName= expected[i];
assertTrue("method " + methName + " expected", nameContained(methName, methods));
}
- }
-
+ }
+
private void checkImports(String[] expected, IImportDeclaration[] imports) {
int nImports= imports.length;
int nExpected= expected.length;
@@ -197,5 +197,5 @@ public class AddUnimplementedMethodsTest extends TestCase {
}
}
return false;
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/CallinQuickFixTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/CallinQuickFixTest.java
index 64f831c9e..caf79e3a3 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/CallinQuickFixTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/CallinQuickFixTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2016 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -46,7 +46,7 @@ import org.junit.Test;
*/
@RunWith(JUnit4.class)
public class CallinQuickFixTest extends OTQuickFixTest {
-
+
@Rule
public ProjectTestSetup projectsetup = new ProjectTestSetup();
@@ -69,7 +69,7 @@ public class CallinQuickFixTest extends OTQuickFixTest {
pack1.createCompilationUnit("B1.java", buf.toString(), false, null);
buf = new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" void foo(){\n");
@@ -82,7 +82,7 @@ public class CallinQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cuteam = pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cuteam);
ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cuteam, astRoot);
assertNumberOfProposals(proposals, 2);
@@ -90,7 +90,7 @@ public class CallinQuickFixTest extends OTQuickFixTest {
String[] expectedProposals = new String[2];
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" void foo(){\n");
@@ -121,7 +121,7 @@ public class CallinQuickFixTest extends OTQuickFixTest {
pack1.createCompilationUnit("B1.java", buf.toString(), false, null);
buf = new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" @SuppressWarnings(\"basecall\")\n");
@@ -132,7 +132,7 @@ public class CallinQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cuteam = pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cuteam);
ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cuteam, astRoot);
assertNumberOfProposals(proposals, 2);
@@ -140,7 +140,7 @@ public class CallinQuickFixTest extends OTQuickFixTest {
String[] expectedProposals = new String[2];
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" @SuppressWarnings(\"basecall\") void foo() {\n");// removed callin modifier
@@ -151,7 +151,7 @@ public class CallinQuickFixTest extends OTQuickFixTest {
buf.append("}\n");
expectedProposals[0] = buf.toString();
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" @SuppressWarnings(\"basecall\")\n");
@@ -179,7 +179,7 @@ public class CallinQuickFixTest extends OTQuickFixTest {
pack1.createCompilationUnit("B1.java", buf.toString(), false, null);
buf = new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" @SuppressWarnings(\"basecall\") void foo() {\n");
@@ -189,7 +189,7 @@ public class CallinQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cuteam = pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
int offset= buf.toString().indexOf("foo() <- after");
AssistContext context= getCorrectionContext(cuteam, offset, 0);
List<IJavaCompletionProposal> proposals= collectAssists(context, false);
@@ -199,7 +199,7 @@ public class CallinQuickFixTest extends OTQuickFixTest {
String[] expectedProposals = new String[1];
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" @SuppressWarnings(\"basecall\") void foo() {\n");
@@ -306,7 +306,7 @@ public class CallinQuickFixTest extends OTQuickFixTest {
pack1.createCompilationUnit("B1.java", buf.toString(), false, null);
buf = new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" @SuppressWarnings(\"basecall\") <E1, E2> E1 foo(E2 e) {\n");
@@ -316,7 +316,7 @@ public class CallinQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cuteam = pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
int offset= buf.toString().indexOf("foo(E2 e) <- after");
AssistContext context= getCorrectionContext(cuteam, offset, 0);
List<IJavaCompletionProposal> proposals= collectAssists(context, false);
@@ -326,7 +326,7 @@ public class CallinQuickFixTest extends OTQuickFixTest {
String[] expectedProposals = new String[1];
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" @SuppressWarnings(\"basecall\") <E1, E2> E1 foo(E2 e) {\n");
@@ -353,7 +353,7 @@ public class CallinQuickFixTest extends OTQuickFixTest {
pack1.createCompilationUnit("B1.java", buf.toString(), false, null);
buf = new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" @SuppressWarnings(\"basecall\") void foo(int one, int two) {\n");
@@ -366,7 +366,7 @@ public class CallinQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cuteam = pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
int offset= buf.toString().indexOf("foo(int one,//eol");
AssistContext context= getCorrectionContext(cuteam, offset, 0);
List<IJavaCompletionProposal> proposals= collectAssists(context, false);
@@ -376,7 +376,7 @@ public class CallinQuickFixTest extends OTQuickFixTest {
String[] expectedProposals = new String[1];
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" @SuppressWarnings(\"basecall\") void foo(int one, int two) {\n");
@@ -404,7 +404,7 @@ public class CallinQuickFixTest extends OTQuickFixTest {
pack1.createCompilationUnit("B1.java", buf.toString(), false, null);
buf = new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" @SuppressWarnings(\"basecall\") void foo() {\n");
@@ -414,7 +414,7 @@ public class CallinQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cuteam = pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
int offset= buf.toString().indexOf("foo <- after");
AssistContext context= getCorrectionContext(cuteam, offset, 0);
List<IJavaCompletionProposal> proposals= collectAssists(context, false);
@@ -424,7 +424,7 @@ public class CallinQuickFixTest extends OTQuickFixTest {
String[] expectedProposals = new String[1];
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" @SuppressWarnings(\"basecall\") void foo() {\n");
@@ -450,7 +450,7 @@ public class CallinQuickFixTest extends OTQuickFixTest {
pack1.createCompilationUnit("B1.java", buf.toString(), false, null);
buf = new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" @SuppressWarnings(\"basecall\") <E1, E2 extends java.util.List<E1>> E1 foo(E2 val) {\n");
@@ -460,7 +460,7 @@ public class CallinQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cuteam = pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
int offset= buf.toString().indexOf("foo <- after");
AssistContext context= getCorrectionContext(cuteam, offset, 0);
List<IJavaCompletionProposal> proposals= collectAssists(context, false);
@@ -470,7 +470,7 @@ public class CallinQuickFixTest extends OTQuickFixTest {
String[] expectedProposals = new String[1];
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" @SuppressWarnings(\"basecall\") <E1, E2 extends java.util.List<E1>> E1 foo(E2 val) {\n");
@@ -497,7 +497,7 @@ public class CallinQuickFixTest extends OTQuickFixTest {
pack1.createCompilationUnit("B1.java", buf.toString(), false, null);
buf = new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" void foo() {\n");
@@ -507,7 +507,7 @@ public class CallinQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cuteam = pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
int offset= buf.toString().indexOf("foo <- after");
AssistContext context= getCorrectionContext(cuteam, offset, 0);
List<IJavaCompletionProposal> proposals= collectAssists(context, false);
@@ -517,7 +517,7 @@ public class CallinQuickFixTest extends OTQuickFixTest {
String[] expectedProposals = new String[1];
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" void foo() {\n");
@@ -529,8 +529,8 @@ public class CallinQuickFixTest extends OTQuickFixTest {
expectedProposals[0] = buf.toString();
assertExpectedExistInProposals(proposals, expectedProposals);
-
-
+
+
String[] alternatives = {"void foo()", "void foo(String val)"};
assertChoices((ICompletionProposal) proposals.get(0), "basemethod", alternatives);
}
@@ -550,7 +550,7 @@ public class CallinQuickFixTest extends OTQuickFixTest {
pack1.createCompilationUnit("B1.java", buf.toString(), false, null);
buf = new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" void bar(R r, Number n) {\n");
@@ -560,7 +560,7 @@ public class CallinQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cuteam = pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
int offset= buf.toString().indexOf("bar <- after");
AssistContext context= getCorrectionContext(cuteam, offset, 0);
List<IJavaCompletionProposal> proposals= collectAssists(context, false);
@@ -570,7 +570,7 @@ public class CallinQuickFixTest extends OTQuickFixTest {
String[] expectedProposals = new String[1];
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" void bar(R r, Number n) {\n");
@@ -582,8 +582,8 @@ public class CallinQuickFixTest extends OTQuickFixTest {
expectedProposals[0] = buf.toString();
assertExpectedExistInProposals(proposals, expectedProposals);
-
-
+
+
String[] alternatives = {"void foo(B1 b, Integer val)", "void foo(B1 b, Integer val, int x)"};
assertChoices((ICompletionProposal) proposals.get(0), "basemethod", alternatives);
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/CalloutQuickFixTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/CalloutQuickFixTest.java
index 8c4fe3d88..9e324e0e5 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/CalloutQuickFixTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/CalloutQuickFixTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2016 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -56,7 +56,7 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
super.addOptions(options);
options.put(OTDTPlugin.OT_COMPILER_INFERRED_CALLOUT, JavaCore.WARNING);
}
-
+
/* Converting a field read to explicitly use a callout-to-field. */
@Test
public void testConvertFieldAccessToCalloutCall1() throws Exception {
@@ -69,7 +69,7 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
pack1.createCompilationUnit("B1.java", buf.toString(), false, null);
buf = new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" void foo(){\n");
@@ -78,7 +78,7 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cuteam = pack1.createCompilationUnit("T.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cuteam);
ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cuteam, astRoot);
assertNumberOfProposals(proposals, 3);
@@ -86,7 +86,7 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
String[] expectedProposals = new String[3];
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" int getVal() -> get int val;\n");
@@ -99,9 +99,9 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
expectedProposals[0] = buf.toString();
assertEquals("proposal label", "Configure problem severity", proposals.get(1).getDisplayString());
-
+
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" @SuppressWarnings(\"inferredcallout\")\n");
@@ -115,7 +115,7 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
assertExpectedExistInProposals(proposals, expectedProposals);
}
-
+
/* Converting a field read (this-qualified) to explicitly use a callout-to-field. */
@Test
public void testConvertFieldAccessToCalloutCall2() throws Exception {
@@ -128,7 +128,7 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
pack1.createCompilationUnit("B1.java", buf.toString(), false, null);
buf = new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" void foo(){\n");
@@ -137,16 +137,16 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cuteam = pack1.createCompilationUnit("T.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cuteam);
ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cuteam, astRoot);
assertNumberOfProposals(proposals, 3);
assertCorrectLabels(proposals);
-
+
String[] expectedProposals = new String[3];
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" int getVal() -> get int val;\n");
@@ -161,7 +161,7 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
assertEquals("proposal label", "Configure problem severity", proposals.get(1).getDisplayString());
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" @SuppressWarnings(\"inferredcallout\")\n");
@@ -175,7 +175,7 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
assertExpectedExistInProposals(proposals, expectedProposals);
}
-
+
/* Converting a field assignment to explicitly use a callout-to-field. */
@Test
public void testConvertFieldAccessToCalloutCall3() throws Exception {
@@ -188,7 +188,7 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
pack1.createCompilationUnit("B1.java", buf.toString(), false, null);
buf = new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" void foo(){\n");
@@ -197,16 +197,16 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cuteam = pack1.createCompilationUnit("T.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cuteam);
ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cuteam, astRoot);
assertNumberOfProposals(proposals, 3);
assertCorrectLabels(proposals);
-
+
String[] expectedProposals = new String[3];
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" void setVal(int val) -> set int val;\n");
@@ -221,7 +221,7 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
assertEquals("proposal label", "Configure problem severity", proposals.get(1).getDisplayString());
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" @SuppressWarnings(\"inferredcallout\")\n");
@@ -235,7 +235,7 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
assertExpectedExistInProposals(proposals, expectedProposals);
}
-
+
/* Converting a field assignment (this-qualified) to explicitly use a callout-to-field. */
@Test
public void testConvertFieldAccessToCalloutCall4() throws Exception {
@@ -248,7 +248,7 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
pack1.createCompilationUnit("B1.java", buf.toString(), false, null);
buf = new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" void foo(){\n");
@@ -257,16 +257,16 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cuteam = pack1.createCompilationUnit("T.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cuteam);
ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cuteam, astRoot);
assertNumberOfProposals(proposals, 3);
assertCorrectLabels(proposals);
-
+
String[] expectedProposals = new String[3];
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" void setVal(int val) -> set int val;\n");
@@ -276,13 +276,13 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
-
+
expectedProposals[0] = buf.toString();
assertEquals("proposal label", "Configure problem severity", proposals.get(1).getDisplayString());
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" @SuppressWarnings(\"inferredcallout\")\n");
@@ -295,8 +295,8 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
assertExpectedExistInProposals(proposals, expectedProposals);
}
-
-
+
+
/* Convert field access to call to existing callout-to-field. */
@Test
public void testConvertFieldAccessToCalloutCall5() throws Exception {
@@ -309,7 +309,7 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
pack1.createCompilationUnit("B1.java", buf.toString(), false, null);
buf = new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" int getVal() -> get int val;\n");
@@ -320,17 +320,17 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cuteam = pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cuteam);
ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cuteam, astRoot);
assertNumberOfProposals(proposals, 3);
assertCorrectLabels(proposals);
-
+
String[] expectedProposals = new String[3];
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" int getVal() -> get int val;\n");
@@ -345,7 +345,7 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
assertEquals("proposal label", "Configure problem severity", proposals.get(1).getDisplayString());
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" int getVal() -> get int val;\n");
@@ -373,7 +373,7 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
pack1.createCompilationUnit("B1.java", buf.toString(), false, null);
buf = new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" void setVal(int val) -> set int val;\n");
@@ -384,17 +384,17 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cuteam = pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cuteam);
ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cuteam, astRoot);
assertNumberOfProposals(proposals, 3);
assertCorrectLabels(proposals);
-
+
String[] expectedProposals = new String[3];
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" void setVal(int val) -> set int val;\n");
@@ -409,7 +409,7 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
assertEquals("proposal label", "Configure problem severity", proposals.get(1).getDisplayString());
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" void setVal(int val) -> set int val;\n");
@@ -424,7 +424,7 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
assertExpectedExistInProposals(proposals, expectedProposals);
}
-
+
/* Remove signatures from a callout to field. */
@Test
@@ -438,7 +438,7 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
pack1.createCompilationUnit("B1.java", buf.toString(), false, null);
buf = new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" abstract String getFoo();\n");
@@ -446,7 +446,7 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cuteam = pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
int offset= buf.toString().indexOf("getFoo() -> get");
AssistContext context= getCorrectionContext(cuteam, offset, 0);
List<IJavaCompletionProposal> proposals= collectAssists(context, false);
@@ -456,7 +456,7 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
String[] expectedProposals = new String[1];
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" abstract String getFoo();\n");
@@ -480,7 +480,7 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
pack1.createCompilationUnit("B1.java", buf.toString(), false, null);
buf = new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" abstract String getFoo(Boolean b);\n");
@@ -488,7 +488,7 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cuteam = pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
int offset= buf.toString().indexOf("getFoo -> foo");
AssistContext context= getCorrectionContext(cuteam, offset, 0);
List<IJavaCompletionProposal> proposals= collectAssists(context, false);
@@ -498,7 +498,7 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
String[] expectedProposals = new String[1];
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" abstract String getFoo(Boolean b);\n");
@@ -522,15 +522,15 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
pack1.createCompilationUnit("B1.java", buf.toString(), false, null);
buf = new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" abstract String getFoo();\n");
- buf.append(" getFoo -> get foo;\n");
+ buf.append(" getFoo -> get foo;\n");
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cuteam = pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
int offset= buf.toString().indexOf("getFoo -> get");
AssistContext context= getCorrectionContext(cuteam, offset, 0);
List<IJavaCompletionProposal> proposals= collectAssists(context, false);
@@ -540,7 +540,7 @@ public class CalloutQuickFixTest extends OTQuickFixTest {
String[] expectedProposals = new String[1];
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" abstract String getFoo();\n");
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/CodeCompletionTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/CodeCompletionTest.java
index 15cd834b6..cd90a3d4f 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/CodeCompletionTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/CodeCompletionTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2016 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -87,9 +87,9 @@ import junit.framework.Test;
import junit.framework.TestSuite;
/**
- * Tests for code completion including the UI part
- * i.e., testing the actual rewriting and also selections.
- *
+ * Tests for code completion including the UI part
+ * i.e., testing the actual rewriting and also selections.
+ *
* @author stephan
* @since 1.1.8
*/
@@ -156,7 +156,7 @@ public class CodeCompletionTest extends CoreTests {
StubUtility.setCodeTemplate(CodeTemplateContextType.CONSTRUCTORSTUB_ID, "//TODO\n${body_statement}", null);
StubUtility.setCodeTemplate(CodeTemplateContextType.GETTERCOMMENT_ID, "/**\n * @return the ${bare_field_name}\n */", fJProject1);
StubUtility.setCodeTemplate(CodeTemplateContextType.SETTERCOMMENT_ID, "/**\n * @param ${param} the ${bare_field_name} to set\n */", fJProject1);
-
+
fBeforeImports= "";
fAfterImports= "";
fMembers= "";
@@ -173,14 +173,14 @@ public class CodeCompletionTest extends CoreTests {
closeAllEditors();
JavaProjectHelper.delete(fJProject1);
}
-
+
public static void closeEditor(IEditorPart editor) {
IWorkbenchPartSite site;
IWorkbenchPage page;
if (editor != null && (site= editor.getSite()) != null && (page= site.getPage()) != null)
page.closeEditor(editor, false);
}
-
+
public static void closeAllEditors() {
IWorkbenchWindow[] windows= PlatformUI.getWorkbench().getWorkbenchWindows();
for (int i= 0; i < windows.length; i++) {
@@ -208,7 +208,7 @@ public class CodeCompletionTest extends CoreTests {
String contents= buf.toString();
pack1.createCompilationUnit("B.java", contents, false, null);
-
+
// create team class:
IPackageFragment pack2= sourceFolder.createPackageFragment("test2", false, null);
buf= new StringBuffer();
@@ -222,7 +222,7 @@ public class CodeCompletionTest extends CoreTests {
contents= buf.toString();
ICompilationUnit cuT= pack2.createCompilationUnit("T.java", contents, false, null);
-
+
fEditor= (JavaEditor)JavaUI.openInEditor(cuT);
String str= " fo";
@@ -245,7 +245,7 @@ public class CodeCompletionTest extends CoreTests {
assertNotNull("expected proposal", selected);
IDocument doc= fEditor.getDocumentProvider().getDocument(fEditor.getEditorInput());
- selected.apply(doc);
+ selected.apply(doc);
buf= new StringBuffer();
buf.append("package test2;\n" +
@@ -275,15 +275,15 @@ public class CodeCompletionTest extends CoreTests {
ISourceViewer viewer= editor.getViewer();
return new JavaContentAssistInvocationContext(viewer, offset, editor);
}
-
+
// ==== START REAL TESTS: ====
-
+
/** At the empty space within a role one could create a constructor. */
public void testCreateRoleConstructor() throws Exception {
createBaseClass(" public void foo() {}\n");
assertTypeBodyProposal(
- " |",
- "R(",
+ " |",
+ "R(",
" /**\n" +
" * Constructor.\n" +
" */\n" +
@@ -291,14 +291,14 @@ public class CodeCompletionTest extends CoreTests {
" //TODO\n" +
"\n" +
" }",
- INTERESTING_CALLIN_CALLOUT_PROPOSAL);
+ INTERESTING_CALLIN_CALLOUT_PROPOSAL);
}
public void testCreateCallout1() throws Exception {
createBaseClass(" public void foo() {}\n");
assertTypeBodyProposal(
- " fo|",
- "foo(",
+ " fo|",
+ "foo(",
"\n" + // TODO(SH): initial newline is not intended?
" /* (non-Javadoc)\n" +
" * @see test1.B#foo()\n" +
@@ -312,8 +312,8 @@ public class CodeCompletionTest extends CoreTests {
createBaseClass(" public void foo() {}\n");
assertTypeBodyProposal(
" abstract void foo();\n"+
- " fo|",
- "foo(",
+ " fo|",
+ "foo(",
" abstract void foo();\n"+
"\n" + // TODO(SH): initial newline is not intended?
" /* (non-Javadoc)\n" +
@@ -328,8 +328,8 @@ public class CodeCompletionTest extends CoreTests {
public void testCreateCallout2() throws Exception {
createBaseClass(" public void foo() {}\n");
assertROFIBodyProposal(
- " fo|",
- "foo(",
+ " fo|",
+ "foo(",
"\n" + // TODO(SH): initial newline is not intended?
" /* (non-Javadoc)\n" +
" * @see test1.B#foo()\n" +
@@ -338,26 +338,26 @@ public class CodeCompletionTest extends CoreTests {
" ",
INTERESTING_CALLIN_CALLOUT_PROPOSAL);
}
-
+
public void testCreateCalloutOverride1() throws Exception {
IPackageFragment pkg = CompletionTestSetup.getTestPackage(this.fJProject1, "p1");
- pkg.createCompilationUnit("SuperTeam.java",
+ pkg.createCompilationUnit("SuperTeam.java",
"package test1.p1;\n" +
"public team class SuperTeam {\n" +
" public class MyRole {\n" +
" String blub(int i) { return \"\"; }\n" +
- " }\n" +
+ " }\n" +
"}\n",
true, null);
-
- pkg.createCompilationUnit("ABase.java",
+
+ pkg.createCompilationUnit("ABase.java",
"package test1.p1;\n" +
"public class ABase {\n" +
" String blub(int k) { return null; }\n" +
- "}\n",
+ "}\n",
true, null);
-
- StringBuffer subTeamContent = new StringBuffer();
+
+ StringBuffer subTeamContent = new StringBuffer();
subTeamContent.append("package test1;\n");
subTeamContent.append("import test1.p1.SuperTeam;\n");
subTeamContent.append("\n");
@@ -367,8 +367,8 @@ public class CodeCompletionTest extends CoreTests {
subTeamContent.append(" \n");
subTeamContent.append(" }\n");
subTeamContent.append("}");
-
- StringBuffer expectedContent = new StringBuffer();
+
+ StringBuffer expectedContent = new StringBuffer();
expectedContent.append("package test1;\n");
expectedContent.append("import test1.p1.SuperTeam;\n");
expectedContent.append("\n");
@@ -387,32 +387,32 @@ public class CodeCompletionTest extends CoreTests {
String completeAfter = " ";
int pos = subTeamContent.indexOf(completeAfter)+completeAfter.length();
int posAfter = expectedContent.indexOf("String");
-
+
// discriminate from overriding "blub(int i)":
- assertProposal("blub(int k", null, null, subTeamContent, new Region(pos, 0), expectedContent, new Region(posAfter, "String".length()), 0);
+ assertProposal("blub(int k", null, null, subTeamContent, new Region(pos, 0), expectedContent, new Region(posAfter, "String".length()), 0);
}
-
-
+
+
// callout override to field
public void testCreateCalloutOverride2() throws Exception {
IPackageFragment pkg = CompletionTestSetup.getTestPackage(this.fJProject1, "p1");
- pkg.createCompilationUnit("SuperTeam.java",
+ pkg.createCompilationUnit("SuperTeam.java",
"package test1.p1;\n" +
"public team class SuperTeam {\n" +
" public class MyRole {\n" +
" void setBlub(int i) { }\n" +
- " }\n" +
+ " }\n" +
"}\n",
true, null);
-
- pkg.createCompilationUnit("ABase.java",
+
+ pkg.createCompilationUnit("ABase.java",
"package test1.p1;\n" +
"public class ABase {\n" +
" int blub;\n" +
- "}\n",
+ "}\n",
true, null);
-
- StringBuffer subTeamContent = new StringBuffer();
+
+ StringBuffer subTeamContent = new StringBuffer();
subTeamContent.append("package test1;\n");
subTeamContent.append("import test1.p1.SuperTeam;\n");
subTeamContent.append("import base test1.p1.ABase;\n");
@@ -421,8 +421,8 @@ public class CodeCompletionTest extends CoreTests {
subTeamContent.append(" set\n");
subTeamContent.append(" }\n");
subTeamContent.append("}");
-
- StringBuffer expectedContent = new StringBuffer();
+
+ StringBuffer expectedContent = new StringBuffer();
expectedContent.append("package test1;\n");
expectedContent.append("import test1.p1.SuperTeam;\n");
expectedContent.append("import base test1.p1.ABase;\n");
@@ -440,24 +440,24 @@ public class CodeCompletionTest extends CoreTests {
String completeAfter = " set";
int pos = subTeamContent.indexOf(completeAfter)+completeAfter.length();
int posAfter = expectedContent.indexOf(" ");
-
+
// discriminate from overriding "setBlub(int i)":
- assertProposal("setBlub(int)", null, null, subTeamContent, new Region(pos, 0), expectedContent, new Region(posAfter+2, 0), 0);
+ assertProposal("setBlub(int)", null, null, subTeamContent, new Region(pos, 0), expectedContent, new Region(posAfter+2, 0), 0);
}
-
-
+
+
// Bug 374840 - [assist] callout completion after parameter mapping garbles the code
public void testCreateCalloutOverride3() throws Exception {
IPackageFragment pkg = CompletionTestSetup.getTestPackage(this.fJProject1, "p1");
-
- pkg.createCompilationUnit("ABase.java",
+
+ pkg.createCompilationUnit("ABase.java",
"package test1.p1;\n" +
"public class ABase {\n" +
" Object blub;\n" +
- "}\n",
+ "}\n",
true, null);
-
- StringBuffer subTeamContent = new StringBuffer();
+
+ StringBuffer subTeamContent = new StringBuffer();
subTeamContent.append("package test1;\n");
subTeamContent.append("import base test1.p1.ABase;\n");
subTeamContent.append("public team class Completion_testCreateCalloutOverride3 {\n");
@@ -467,8 +467,8 @@ public class CodeCompletionTest extends CoreTests {
subTeamContent.append(" toStr\n");
subTeamContent.append(" }\n");
subTeamContent.append("}");
-
- StringBuffer expectedContent = new StringBuffer();
+
+ StringBuffer expectedContent = new StringBuffer();
expectedContent.append("package test1;\n");
expectedContent.append("import base test1.p1.ABase;\n");
expectedContent.append("public team class Completion_testCreateCalloutOverride3 {\n");
@@ -487,17 +487,17 @@ public class CodeCompletionTest extends CoreTests {
String completeAfter = " toStr";
int pos = subTeamContent.indexOf(completeAfter)+completeAfter.length();
int posAfter = expectedContent.indexOf("String toString");
-
+
// discriminate from method override:
- assertProposal("toString() String", null, null, subTeamContent, new Region(pos, 0), expectedContent, new Region(posAfter, "String".length()), 0);
+ assertProposal("toString() String", null, null, subTeamContent, new Region(pos, 0), expectedContent, new Region(posAfter, "String".length()), 0);
}
-
+
public void testCompleteCallout1() throws Exception {
createBaseClass(" public void foo() {}\n");
assertTypeBodyProposal(
- " void foo() ->|",
- "foo(",
+ " void foo() ->|",
+ "foo(",
" void foo() ->| void foo();|" + // SH: why selected?
"",
INTERESTING_CALLIN_CALLOUT_PROPOSAL);
@@ -506,9 +506,9 @@ public class CodeCompletionTest extends CoreTests {
public void testCompleteCallout2() throws Exception {
createBaseClass(" public void foo() {}\n");
assertTypeBodyProposal(
- " foo -> |",
- "foo(",
- " foo -> foo; |" + // SH: trailing space?
+ " foo -> |",
+ "foo(",
+ " foo -> foo; |" + // SH: trailing space?
"",
INTERESTING_CALLIN_CALLOUT_PROPOSAL);
}
@@ -520,8 +520,8 @@ public class CodeCompletionTest extends CoreTests {
" callin void bar() {}\n"+
" void foo() ->|\n" + // no leading space, inserted below (good)
" bar <- replace clone;\n",
- "foo(",
- " callin void bar() {}\n" +
+ "foo(",
+ " callin void bar() {}\n" +
" void foo() ->| void foo();|\n" +
" bar <- replace clone;\n" +
"",
@@ -532,8 +532,8 @@ public class CodeCompletionTest extends CoreTests {
public void testCompleteCallout4() throws Exception {
createBaseClass(" public void foo() {}\n");
assertTypeBodyProposal(
- " foo -> f|",
- "foo(",
+ " foo -> f|",
+ "foo(",
" foo -> |foo;|",
INTERESTING_CALLIN_CALLOUT_PROPOSAL);
}
@@ -541,28 +541,28 @@ public class CodeCompletionTest extends CoreTests {
public void testCompleteCallout5() throws Exception {
createBaseClass(" public void foo() {}\n");
assertTypeBodyProposal(
- " |",
+ " |",
"foo(",
"\n"+
" /* (non-Javadoc)\n" +
" * @see test1.B#foo()\n" +
" */\n" +
" void |foo|() -> void foo();\n" +
- " ",
+ " ",
INTERESTING_CALLIN_CALLOUT_PROPOSAL);
}
public void testCompleteCallout6() throws Exception {
createBaseClass(" public void foo() {}\n");
assertROFIBodyProposal(
- " |",
+ " |",
"foo(",
"\n"+
" /* (non-Javadoc)\n" +
" * @see test1.B#foo()\n" +
" */\n" +
" void |foo|() -> void foo();\n" +
- " ",
+ " ",
INTERESTING_CALLIN_CALLOUT_PROPOSAL);
}
@@ -570,14 +570,14 @@ public class CodeCompletionTest extends CoreTests {
public void testCompleteCallout7() throws Exception {
createBaseClass(" public static void foo() {}\n");
assertROFIBodyProposal(
- " |",
+ " |",
"foo(",
"\n"+
" /* (non-Javadoc)\n" +
" * @see test1.B#foo()\n" +
" */\n" +
" void |foo|() -> void foo();\n" +
- " ",
+ " ",
INTERESTING_CALLIN_CALLOUT_PROPOSAL);
}
@@ -586,7 +586,7 @@ public class CodeCompletionTest extends CoreTests {
createBaseClass(" java.util.List<String> names;\n");
assertNosuchTypeBodyProposal(
" String setName(int i, String n) -> set java.util.List<String> names\n" +
- " with { n -> base.| }",
+ " with { n -> base.| }",
"names",
INTERESTING_CALLIN_CALLOUT_PROPOSAL);
}
@@ -596,8 +596,8 @@ public class CodeCompletionTest extends CoreTests {
createBaseClass(" java.util.List<String> names;\n");
assertTypeBodyProposal(
" String getName(int i) -> get java.util.List<String> names\n" +
- " with { result <- base.| }",
- "names",
+ " with { result <- base.| }",
+ "names",
" String getName(int i) -> get java.util.List<String> names\n" +
" with { result <- base.names|| }",
INTERESTING_CALLIN_CALLOUT_PROPOSAL);
@@ -619,15 +619,15 @@ public class CodeCompletionTest extends CoreTests {
String contents= buf.toString();
IPackageFragment basePkg = CompletionTestSetup.getAbsoluteTestPackage(this.fJProject1, "test1");
basePkg.createCompilationUnit("B.java", contents, true, null);
-
+
fAfterImports = "\n" +
"import test1.b1.B1;\n" +
"import test1.b1.B1.Inner;\n" +
"import test1.b2.B2;\n";
-
+
assertTypeBodyProposal(
- " |",
- "foo(",
+ " |",
+ "foo(",
"\n" +
" /* (non-Javadoc)\n" +
" * @see test1.B#foo(test1.b1.B1, test1.b1.B1.Inner, test1.b2.B2)\n" +
@@ -647,8 +647,8 @@ public class CodeCompletionTest extends CoreTests {
" String toString() => |String toString();|",
INTERESTING_CALLIN_CALLOUT_PROPOSAL);
}
-
-
+
+
/** A base method spec without return type and beginning of the selector is searched. */
public void testCompletionMethodSpecLong2() throws Exception {
createBaseClass("");
@@ -658,7 +658,7 @@ public class CodeCompletionTest extends CoreTests {
" String toString() => |String toString();|",
INTERESTING_CALLIN_CALLOUT_PROPOSAL);
}
-
+
/** A base method spec with return type and no selector is searched. */
public void testCompletionMethodSpecLong3() throws Exception {
createBaseClass("");
@@ -668,7 +668,7 @@ public class CodeCompletionTest extends CoreTests {
" String toString() => String toString(); |", // trailing space?
INTERESTING_CALLIN_CALLOUT_PROPOSAL);
}
-
+
/* short, no callinModifier, follows: method */
public void testCompleteCallin1() throws Exception {
createBaseClass(" public void foo() {}\n");
@@ -676,8 +676,8 @@ public class CodeCompletionTest extends CoreTests {
" void bar() {}\n"+
" bar <-|\n" + // no space, inserted below (good)
" void zork() {}\n",
- "foo(",
- " void bar() {}\n" +
+ "foo(",
+ " void bar() {}\n" +
" bar <- |before| foo;\n" +
" void zork() {}\n" +
"",
@@ -688,8 +688,8 @@ public class CodeCompletionTest extends CoreTests {
createBaseClass(" public void foo() {}\n");
assertTypeBodyProposal(
" void foo() {}\n"+
- " fo|",
- "foo(",
+ " fo|",
+ "foo(",
" void foo() {}\n"+
"\n" + // TODO(SH): initial newline is not intended?
" /* (non-Javadoc)\n" +
@@ -705,8 +705,8 @@ public class CodeCompletionTest extends CoreTests {
public void _testCreateCallin2() throws Exception {
createBaseClass(" public String foo() {}\n");
assertTypeBodyProposal(
- " fo|",
- "foo(",
+ " fo|",
+ "foo(",
"\n" + // TODO(SH): initial newline is not intended?
" /* (non-Javadoc)\n" +
" * @see test1.B#foo()\n" +
@@ -721,32 +721,32 @@ public class CodeCompletionTest extends CoreTests {
createBaseClass(" public void foo() {}\n");
assertTypeBodyProposal(
" void bar() {}\n"+
- " bar <- after |\n" +
+ " bar <- after |\n" +
" void foo() -> void foo();\n",
- "foo(",
- " void bar() {}\n" +
+ "foo(",
+ " void bar() {}\n" +
" bar <- after foo; |\n" + // SH: trailing space?
" void foo() -> void foo();\n" +
"",
INTERESTING_CALLIN_CALLOUT_PROPOSAL);
}
-
-
+
+
/* short, with callinModifier, follows: callout binding, non-keyword return type. */
public void testCompleteCallin2a() throws Exception {
createBaseClass(" public String foo() { return null; }\n");
assertTypeBodyProposal(
" String bar() { return \"\"; }\n"+
- " bar <- after |\n" +
+ " bar <- after |\n" +
" String foo() -> String foo();\n",
- "foo(",
- " String bar() { return \"\"; }\n" +
+ "foo(",
+ " String bar() { return \"\"; }\n" +
" bar <- after foo; |\n" + // SH: trailing space?
" String foo() -> String foo();\n" +
"",
INTERESTING_CALLIN_CALLOUT_PROPOSAL);
}
-
+
/* long, with callinModifier, follows: field. */
public void testCompleteCallin3() throws Exception {
createBaseClass(" public void foo() {}\n");
@@ -754,29 +754,29 @@ public class CodeCompletionTest extends CoreTests {
" void bar() {}\n"+
" void bar() <-after |\n" + // cannot insert space before modifier (OK)
" int i;\n",
- "foo(",
- " void bar() {}\n" +
- " void bar() <-after void foo(); |\n" +
+ "foo(",
+ " void bar() {}\n" +
+ " void bar() <-after void foo(); |\n" +
" int i;\n" +
"",
INTERESTING_CALLIN_CALLOUT_PROPOSAL);
}
-
+
/* long, no callinModifier, callin-method, follows: field. */
public void testCompleteCallin4() throws Exception {
createBaseClass(" public void foo() {}\n");
assertTypeBodyProposal(
" callin void bar() {}\n"+
- " void bar() <- |\n" +
+ " void bar() <- |\n" +
" int i;\n",
- "foo(",
- " callin void bar() {}\n" +
+ "foo(",
+ " callin void bar() {}\n" +
" void bar() <- |replace| void foo(); \n" +
" int i;\n" +
"",
INTERESTING_CALLIN_CALLOUT_PROPOSAL);
}
-
+
/* long, no callinModifier, callin-method, follows: method. */
public void testCompleteCallin5() throws Exception {
createBaseClass(" public void foo() {}\n");
@@ -784,14 +784,14 @@ public class CodeCompletionTest extends CoreTests {
" callin void bar() {}\n"+
" void bar() <-|\n" + // no leading space, inserted below (good)
" int zork() {}\n",
- "foo(",
- " callin void bar() {}\n" +
+ "foo(",
+ " callin void bar() {}\n" +
" void bar() <- |replace| void foo();\n" +
" int zork() {}\n" +
"",
INTERESTING_CALLIN_CALLOUT_PROPOSAL);
}
-
+
/* long, no callinModifier, callin-method, follows: short callin. */
public void testCompleteCallin6() throws Exception {
createBaseClass(" public void foo() {}\n");
@@ -799,8 +799,8 @@ public class CodeCompletionTest extends CoreTests {
" callin void bar() {}\n"+
" void bar() <-|\n" + // no leading space, inserted below (good)
" bar <- replace clone;\n",
- "foo(",
- " callin void bar() {}\n" +
+ "foo(",
+ " callin void bar() {}\n" +
" void bar() <- |replace| void foo();\n" +
" bar <- replace clone;\n" +
"",
@@ -812,31 +812,31 @@ public class CodeCompletionTest extends CoreTests {
createBaseClass(" public void foo() {}\n");
assertTypeBodyProposal(
" callin void bar() {}\n"+
- " bar <- replace |\n" +
+ " bar <- replace |\n" +
" bar <- replace clone;\n",
- "foo",
- " callin void bar() {}\n" +
+ "foo",
+ " callin void bar() {}\n" +
" bar <- replace foo; |\n" + // SH: trailing space?
" bar <- replace clone;\n" +
"",
INTERESTING_CALLIN_CALLOUT_PROPOSAL);
}
-
+
/* short, prefix typed, with callinModifier, follows: callout binding. */
public void testCompleteCallin8() throws Exception {
createBaseClass(" public void foo() {}\n");
assertTypeBodyProposal(
" void bar() {}\n"+
- " bar <- after f|\n" +
+ " bar <- after f|\n" +
" void foo() -> void foo();\n",
- "foo(",
- " void bar() {}\n" +
- " bar <- after |foo;|\n" +
+ "foo(",
+ " void bar() {}\n" +
+ " bar <- after |foo;|\n" +
" void foo() -> void foo();\n" +
"",
INTERESTING_CALLIN_CALLOUT_PROPOSAL);
}
-
+
public void testCompleteBasecall1() throws Exception {
createBaseClass(" public String getBaseText(Object object) {return null;}\n");
assertTypeBodyProposal(
@@ -852,7 +852,7 @@ public class CodeCompletionTest extends CoreTests {
"",
0); // should only have one proposal, so accept any to see if there are others
}
-
+
// static case, result ignored - see https://bugs.eclipse.org/bugs/show_bug.cgi?id=331669
public void testCompleteBasecall2() throws Exception {
createBaseClass(" public static String getBaseText(Object object) {return null;}\n");
@@ -926,7 +926,7 @@ public class CodeCompletionTest extends CoreTests {
String str= "//here";
int offset= contents.indexOf(str);
-
+
fEditor= (JavaEditor) EditorUtility.openInEditor(cu1);
ICompletionProposal proposal= findNonNullProposal("", cu1, new Region(offset, 0), 0);
String expectedContents= "package test1;\n" +
@@ -978,7 +978,7 @@ public class CodeCompletionTest extends CoreTests {
codeComplete(cu1, offset, collector);
IJavaCompletionProposal[] proposals= collector.getJavaCompletionProposals();
-
+
// strictly expect one method only.
assertEquals(1, proposals.length);
assertAppliedProposal(contents, proposals[0], "foomethod();"); // arguments are not inserted by this method :(
@@ -1006,7 +1006,7 @@ public class CodeCompletionTest extends CoreTests {
// this is the interesting check: choices??
assertChoices(proposal, new String[][]{new String[]{"i", "idx", "0"}});
}
-
+
/* Full c-t-f declaration */
public void testCalloutToField1() throws Exception {
createBaseClass("public int myField;\n");
@@ -1102,13 +1102,13 @@ public class CodeCompletionTest extends CoreTests {
public void testPlayedBy1() throws Exception {
createBaseClass("test2", "MyBase", "");
fBeforeImports= "";
- fAfterImports= "\nimport base test2.MyBase;\n";
+ fAfterImports= "\nimport base test2.MyBase;\n";
assertTypeBodyProposal(
"protected class R playedBy MyBa| {\n" +
- "}\n",
+ "}\n",
"MyBase",
"protected class R playedBy MyBase| {\n" +
- "}\n",
+ "}\n",
0, false);
}
@@ -1119,13 +1119,13 @@ public class CodeCompletionTest extends CoreTests {
fAfterImports= "\n" +
"import java.util.Map;\n" +
"\n" +
- "import base test2.AClass;\n";
+ "import base test2.AClass;\n";
assertTypeBodyProposal(
"protected class AClass playedBy A| {\n" +
- "}\n",
- "ACl",
+ "}\n",
+ "ACl",
"protected class AClass playedBy AClass| {\n" +
- "}\n",
+ "}\n",
0, false);
}
@@ -1133,9 +1133,9 @@ public class CodeCompletionTest extends CoreTests {
// base import for other role already exists, correctly sort in.
public void testPlayedBy3() throws Exception {
IPackageFragment pkg = CompletionTestSetup.getTestPackage(this.fJProject1, "test3");
- pkg.createCompilationUnit("OtherBase.java",
+ pkg.createCompilationUnit("OtherBase.java",
"package test3;\n" +
- "public class OtherBase {}\n",
+ "public class OtherBase {}\n",
true, null);
createBaseClass("test2", "MyBase", "");
@@ -1147,19 +1147,19 @@ public class CodeCompletionTest extends CoreTests {
"import java.util.Map;\n" +
"\n" +
"import base test2.MyBase;\n" +
- "import base test3.OtherBase;\n";
+ "import base test3.OtherBase;\n";
assertTypeBodyProposal(
"protected class R playedBy MyBa| {\n" +
"}\n" +
"protected class R2 playedBy OtherBase {\n" +
" Map<String,String> f;\n" +
- "}\n",
+ "}\n",
"MyBase",
"protected class R playedBy MyBase| {\n" +
"}\n" +
"protected class R2 playedBy OtherBase {\n" +
" Map<String,String> f;\n" +
- "}\n",
+ "}\n",
0, false);
}
@@ -1179,7 +1179,7 @@ public class CodeCompletionTest extends CoreTests {
"}\n",
0, false);
}
-
+
public void testBaseGuard2() throws Exception {
createBaseClass("test2", "AClass", "");
assertTypeBodyProposal(
@@ -1256,7 +1256,7 @@ public class CodeCompletionTest extends CoreTests {
"}\n",
0, false);
}
-
+
// inside base guard of short method binding, field reference
// Bug 340083 - [assist] cannot complete inside a binding guard
public void testGuard7() throws Exception {
@@ -1297,19 +1297,19 @@ public class CodeCompletionTest extends CoreTests {
public void testRoleTag1() throws Exception {
IPackageFragment teamPkg = CompletionTestSetup.getTestPackage(this.fJProject1, "MyTeam");
- teamPkg.createCompilationUnit("MyRole.java",
+ teamPkg.createCompilationUnit("MyRole.java",
"team package test1.MyTeam;\n" +
- "public class MyRole {}\n",
+ "public class MyRole {}\n",
true, null);
- StringBuffer teamContent = new StringBuffer();
+ StringBuffer teamContent = new StringBuffer();
teamContent.append("package test1;\n");
teamContent.append("/** @role My */\n");
teamContent.append("public team class MyTeam {\n");
teamContent.append(" MyRole roleField;\n"); // trigger loading
teamContent.append(" protected class MyOtherRole {}\n");
teamContent.append("}");
-
- StringBuffer expectedContent = new StringBuffer();
+
+ StringBuffer expectedContent = new StringBuffer();
expectedContent.append("package test1;\n");
expectedContent.append("/** @role MyRole */\n");
expectedContent.append("public team class MyTeam {\n");
@@ -1319,25 +1319,25 @@ public class CodeCompletionTest extends CoreTests {
String completeAfter = "@role My";
int pos = teamContent.indexOf(completeAfter)+completeAfter.length();
-
+
assertProposal("My", null, null, teamContent, new Region(pos, 0), expectedContent, new Region(pos+4, 0), 0); // 4: len(MyRole)-len(My)
}
-
+
public void testRoleTag2() throws Exception {
IPackageFragment teamPkg = CompletionTestSetup.getTestPackage(this.fJProject1, "MyTeam");
- teamPkg.createCompilationUnit("MyRole.java",
+ teamPkg.createCompilationUnit("MyRole.java",
"team package test1.MyTeam;\n" +
- "public class MyRole {}\n",
+ "public class MyRole {}\n",
true, null);
- StringBuffer teamContent = new StringBuffer();
+ StringBuffer teamContent = new StringBuffer();
teamContent.append("package test1;\n");
teamContent.append("/** @role */\n");
teamContent.append("public team class MyTeam {\n");
teamContent.append(" MyRole roleField;\n"); // trigger loading
teamContent.append(" protected class MyOtherRole {}\n");
teamContent.append("}");
-
- StringBuffer expectedContent = new StringBuffer();
+
+ StringBuffer expectedContent = new StringBuffer();
expectedContent.append("package test1;\n");
expectedContent.append("/** @role MyRole */\n");
expectedContent.append("public team class MyTeam {\n");
@@ -1347,23 +1347,23 @@ public class CodeCompletionTest extends CoreTests {
String completeAfter = "@role ";
int pos = teamContent.indexOf(completeAfter)+completeAfter.length();
-
- assertProposal("", null, null, teamContent, new Region(pos, 0), expectedContent, new Region(pos+6, 0), 0); // 6: len(MyRole)
+
+ assertProposal("", null, null, teamContent, new Region(pos, 0), expectedContent, new Region(pos+6, 0), 0); // 6: len(MyRole)
}
-
-
+
+
public void testCreateMethod1() throws Exception {
IPackageFragment pkg = CompletionTestSetup.getTestPackage(this.fJProject1, "p1");
- pkg.createCompilationUnit("SuperTeam.java",
+ pkg.createCompilationUnit("SuperTeam.java",
"package test1.p1;\n" +
"public team class SuperTeam {\n" +
" public class MyRole {\n" +
" String blub(int i) { return \"\"; }\n" +
- " }\n" +
+ " }\n" +
"}\n",
true, null);
-
- StringBuffer subTeamContent = new StringBuffer();
+
+ StringBuffer subTeamContent = new StringBuffer();
subTeamContent.append("package test1;\n");
subTeamContent.append("import test1.p1.SuperTeam;\n");
subTeamContent.append("public team class Completion_testCreateMethod1 extends SuperTeam {\n");
@@ -1371,8 +1371,8 @@ public class CodeCompletionTest extends CoreTests {
subTeamContent.append(" blu\n");
subTeamContent.append(" }\n");
subTeamContent.append("}");
-
- StringBuffer expectedContent = new StringBuffer();
+
+ StringBuffer expectedContent = new StringBuffer();
expectedContent.append("package test1;\n");
expectedContent.append("import test1.p1.SuperTeam;\n");
expectedContent.append("public team class Completion_testCreateMethod1 extends SuperTeam {\n");
@@ -1391,21 +1391,21 @@ public class CodeCompletionTest extends CoreTests {
String completeAfter = "blu";
int pos = subTeamContent.indexOf(completeAfter)+completeAfter.length();
int posAfter = expectedContent.indexOf("}")+1;
-
- assertProposal("", null, null, subTeamContent, new Region(pos, 0), expectedContent, new Region(posAfter, 0), 0);
+
+ assertProposal("", null, null, subTeamContent, new Region(pos, 0), expectedContent, new Region(posAfter, 0), 0);
}
// Bug 362003 - [assist] completion is broken after <B base R> after a base guard
public void testCreateMethod2() throws Exception {
IPackageFragment pkg = CompletionTestSetup.getTestPackage(this.fJProject1, "p1");
- pkg.createCompilationUnit("BaseClass.java",
+ pkg.createCompilationUnit("BaseClass.java",
"package test1.p1;\n" +
"public class BaseClass {\n" +
" public void blub() {}\n" +
"}\n",
true, null);
-
- StringBuffer subTeamContent = new StringBuffer();
+
+ StringBuffer subTeamContent = new StringBuffer();
subTeamContent.append("package test1;\n");
subTeamContent.append("import base test1.p1.BaseClass;\n");
subTeamContent.append("public team class Completion_testCreateMethod2 {\n");
@@ -1426,8 +1426,8 @@ public class CodeCompletionTest extends CoreTests {
subTeamContent.append(" System.out.print(o);\n");
subTeamContent.append(" }\n");
subTeamContent.append("}");
-
- StringBuffer expectedContent = new StringBuffer();
+
+ StringBuffer expectedContent = new StringBuffer();
expectedContent.append("package test1;\n");
expectedContent.append("import base test1.p1.BaseClass;\n");
expectedContent.append("public team class Completion_testCreateMethod2 {\n");
@@ -1460,29 +1460,29 @@ public class CodeCompletionTest extends CoreTests {
int pos = subTeamContent.indexOf(completeAfter)+completeAfter.length();
int posAfter = expectedContent.indexOf("super.foo()");
posAfter = expectedContent.indexOf("}", posAfter)+1;
-
- assertProposal("foo", null, null, subTeamContent, new Region(pos, 0), expectedContent, new Region(posAfter, 0), 0);
+
+ assertProposal("foo", null, null, subTeamContent, new Region(pos, 0), expectedContent, new Region(posAfter, 0), 0);
}
// override role, simple case
public void testOverrideRole1() throws Exception {
IPackageFragment pkg = CompletionTestSetup.getTestPackage(this.fJProject1, "p1");
- pkg.createCompilationUnit("SuperTeam.java",
+ pkg.createCompilationUnit("SuperTeam.java",
"package test1.p1;\n" +
"public team class SuperTeam {\n" +
" public class MyRole {\n" +
- " }\n" +
+ " }\n" +
"}\n",
true, null);
-
- StringBuffer subTeamContent = new StringBuffer();
+
+ StringBuffer subTeamContent = new StringBuffer();
subTeamContent.append("package test1;\n");
subTeamContent.append("import test1.p1.SuperTeam;\n");
subTeamContent.append("public team class Completion_testOverrideRole1 extends SuperTeam {\n");
subTeamContent.append(" \n");
subTeamContent.append("}");
-
- StringBuffer expectedContent = new StringBuffer();
+
+ StringBuffer expectedContent = new StringBuffer();
expectedContent.append("package test1;\n");
expectedContent.append("import test1.p1.SuperTeam;\n");
expectedContent.append("public team class Completion_testOverrideRole1 extends SuperTeam {\n");
@@ -1494,33 +1494,33 @@ public class CodeCompletionTest extends CoreTests {
String completeAfter = " ";
int pos = subTeamContent.indexOf(completeAfter)+completeAfter.length();
int posAfter = expectedContent.indexOf("}")+1;
-
- assertProposal("MyRole - Override", null, null, subTeamContent, new Region(pos, 0), expectedContent, new Region(posAfter, 0), 0);
+
+ assertProposal("MyRole - Override", null, null, subTeamContent, new Region(pos, 0), expectedContent, new Region(posAfter, 0), 0);
}
-
+
// override role, role file with mentioning in the team
public void testOverrideRole2() throws Exception {
IPackageFragment pkg = CompletionTestSetup.getTestPackage(this.fJProject1, "p1");
- pkg.createCompilationUnit("SuperTeam.java",
+ pkg.createCompilationUnit("SuperTeam.java",
"package test1.p1;\n" +
"public team class SuperTeam {\n" +
" RoleFile field\n;" + // help the compiler to find the role file
"}\n",
true, null);
IPackageFragment rolePack = CompletionTestSetup.getTestPackage(this.fJProject1, "p1.SuperTeam");
- rolePack.createCompilationUnit("RoleFile.java",
+ rolePack.createCompilationUnit("RoleFile.java",
"team package test1.p1.SuperTeam;\n" +
- "protected class RoleFile { }\n",
+ "protected class RoleFile { }\n",
true, null);
-
- StringBuffer subTeamContent = new StringBuffer();
+
+ StringBuffer subTeamContent = new StringBuffer();
subTeamContent.append("package test1;\n");
subTeamContent.append("import test1.p1.SuperTeam;\n");
subTeamContent.append("public team class Completion_testOverrideRole1 extends SuperTeam {\n");
subTeamContent.append(" \n");
subTeamContent.append("}");
-
- StringBuffer expectedContent = new StringBuffer();
+
+ StringBuffer expectedContent = new StringBuffer();
expectedContent.append("package test1;\n");
expectedContent.append("import test1.p1.SuperTeam;\n");
expectedContent.append("public team class Completion_testOverrideRole1 extends SuperTeam {\n");
@@ -1532,32 +1532,32 @@ public class CodeCompletionTest extends CoreTests {
String completeAfter = " ";
int pos = subTeamContent.indexOf(completeAfter)+completeAfter.length();
int posAfter = expectedContent.indexOf("}")+1;
-
- assertProposal("RoleFile - Override", null, null, subTeamContent, new Region(pos, 0), expectedContent, new Region(posAfter, 0), 0);
- }
-
+
+ assertProposal("RoleFile - Override", null, null, subTeamContent, new Region(pos, 0), expectedContent, new Region(posAfter, 0), 0);
+ }
+
// override role, role file, without mentioning in the team (requires search engine help)
public void testOverrideRole3() throws Exception {
IPackageFragment pkg = CompletionTestSetup.getTestPackage(this.fJProject1, "p1");
- pkg.createCompilationUnit("SuperTeam.java",
+ pkg.createCompilationUnit("SuperTeam.java",
"package test1.p1;\n" +
"public team class SuperTeam {\n" + // no mentioning of RoleFile
"}\n",
true, null);
IPackageFragment rolePack = CompletionTestSetup.getTestPackage(this.fJProject1, "p1.SuperTeam");
- rolePack.createCompilationUnit("RoleFile.java",
+ rolePack.createCompilationUnit("RoleFile.java",
"team package test1.p1.SuperTeam;\n" +
- "protected class RoleFile { }\n",
+ "protected class RoleFile { }\n",
true, null);
-
- StringBuffer subTeamContent = new StringBuffer();
+
+ StringBuffer subTeamContent = new StringBuffer();
subTeamContent.append("package test1;\n");
subTeamContent.append("import test1.p1.SuperTeam;\n");
subTeamContent.append("public team class Completion_testOverrideRole1 extends SuperTeam {\n");
subTeamContent.append(" \n");
subTeamContent.append("}");
-
- StringBuffer expectedContent = new StringBuffer();
+
+ StringBuffer expectedContent = new StringBuffer();
expectedContent.append("package test1;\n");
expectedContent.append("import test1.p1.SuperTeam;\n");
expectedContent.append("public team class Completion_testOverrideRole1 extends SuperTeam {\n");
@@ -1569,30 +1569,30 @@ public class CodeCompletionTest extends CoreTests {
String completeAfter = " ";
int pos = subTeamContent.indexOf(completeAfter)+completeAfter.length();
int posAfter = expectedContent.indexOf("}")+1;
-
- assertProposal("RoleFile - Override", null, null, subTeamContent, new Region(pos, 0), expectedContent, new Region(posAfter, 0), 0);
- }
+
+ assertProposal("RoleFile - Override", null, null, subTeamContent, new Region(pos, 0), expectedContent, new Region(posAfter, 0), 0);
+ }
// Bug 355255 - [assist] NPE during completion if team contains an enum
public void testOverrideRole4() throws Exception {
IPackageFragment pkg = CompletionTestSetup.getTestPackage(this.fJProject1, "p1");
- pkg.createCompilationUnit("SuperTeam.java",
+ pkg.createCompilationUnit("SuperTeam.java",
"package test1.p1;\n" +
"public team class SuperTeam {\n" +
" public class MyRole {\n" +
- " }\n" +
+ " }\n" +
"}\n",
true, null);
-
- StringBuffer subTeamContent = new StringBuffer();
+
+ StringBuffer subTeamContent = new StringBuffer();
subTeamContent.append("package test1;\n");
subTeamContent.append("import test1.p1.SuperTeam;\n");
subTeamContent.append("public team class Completion_testOverrideRole1 extends SuperTeam {\n");
subTeamContent.append(" enum Aufzaehlung { EINS, ZWEI }\n");
subTeamContent.append(" \n");
subTeamContent.append("}");
-
- StringBuffer expectedContent = new StringBuffer();
+
+ StringBuffer expectedContent = new StringBuffer();
expectedContent.append("package test1;\n");
expectedContent.append("import test1.p1.SuperTeam;\n");
expectedContent.append("public team class Completion_testOverrideRole1 extends SuperTeam {\n");
@@ -1605,8 +1605,8 @@ public class CodeCompletionTest extends CoreTests {
String completeAfter = "}\n ";
int pos = subTeamContent.indexOf(completeAfter)+completeAfter.length();
int posAfter = expectedContent.indexOf(" }")+5;
-
- assertProposal("MyRole - Override", null, null, subTeamContent, new Region(pos, 0), expectedContent, new Region(posAfter, 0), 0);
+
+ assertProposal("MyRole - Override", null, null, subTeamContent, new Region(pos, 0), expectedContent, new Region(posAfter, 0), 0);
}
// propose creating a team instance:
@@ -1674,9 +1674,9 @@ public class CodeCompletionTest extends CoreTests {
"import testutil.MyColl;\n" +
"\n" +
"import base test2.AClass;\n";
- createBaseClass("testutil", "MyColl", "<T> implements java.util.Collection<T>",
- " public void addAll(Collection<? extends E> other) {}\n" +
- " public E[] toArray() { return null; }\n" +
+ createBaseClass("testutil", "MyColl", "<T> implements java.util.Collection<T>",
+ " public void addAll(Collection<? extends E> other) {}\n" +
+ " public E[] toArray() { return null; }\n" +
" public int size() { return 1; }\n");
createBaseClass("test2", "AClass", "public boolean check() { return false; }");
assertTypeBodyProposal(
@@ -1698,7 +1698,7 @@ public class CodeCompletionTest extends CoreTests {
// propose methods invoked via a phantom role, simple case
public void testMethodInvocation1() throws CoreException {
IPackageFragment pkg = CompletionTestSetup.getTestPackage(this.fJProject1, "p1");
- pkg.createCompilationUnit("SuperTeam.java",
+ pkg.createCompilationUnit("SuperTeam.java",
"package test1.p1;\n" +
"public team class SuperTeam {\n" +
" protected class R {\n" +
@@ -1707,8 +1707,8 @@ public class CodeCompletionTest extends CoreTests {
" }\n" +
"}\n",
true, null);
-
- StringBuffer subTeamContent = new StringBuffer();
+
+ StringBuffer subTeamContent = new StringBuffer();
subTeamContent.append("package test1;\n");
subTeamContent.append("import test1.p1.SuperTeam;\n");
subTeamContent.append("public team class Completion_testMethodInvocation1 extends SuperTeam {\n");
@@ -1716,8 +1716,8 @@ public class CodeCompletionTest extends CoreTests {
subTeamContent.append(" r.\n");
subTeamContent.append(" }\n");
subTeamContent.append("}");
-
- StringBuffer expectedContent = new StringBuffer();
+
+ StringBuffer expectedContent = new StringBuffer();
expectedContent.append("package test1;\n");
expectedContent.append("import test1.p1.SuperTeam;\n");
expectedContent.append("public team class Completion_testMethodInvocation1 extends SuperTeam {\n");
@@ -1725,13 +1725,13 @@ public class CodeCompletionTest extends CoreTests {
expectedContent.append(" r.foo();\n");
expectedContent.append(" }\n");
expectedContent.append("}");
-
+
String expectedInfo = ">Doc of foo() </body></html>";
String completeAfter = "r.";
int pos = subTeamContent.indexOf(completeAfter)+completeAfter.length();
int posAfter = expectedContent.indexOf("foo();")+6;
-
+
ICompletionProposal proposal = assertProposal("foo", null, null, subTeamContent, new Region(pos, 0), expectedContent, new Region(posAfter, 0), 0);
assertTrue("Unexpected additional info", proposal.getAdditionalProposalInfo().endsWith(expectedInfo));
}
@@ -1739,7 +1739,7 @@ public class CodeCompletionTest extends CoreTests {
// propose methods invoked via a phantom role, two direct tsuper roles both have the method, pick the nearest version
public void testMethodInvocation2() throws CoreException {
IPackageFragment pkg = CompletionTestSetup.getTestPackage(this.fJProject1, "p1");
- pkg.createCompilationUnit("SuperTeam.java",
+ pkg.createCompilationUnit("SuperTeam.java",
"package test1.p1;\n" +
"public team class SuperTeam {\n" +
" protected team class Mid1 {\n" +
@@ -1756,8 +1756,8 @@ public class CodeCompletionTest extends CoreTests {
" }\n" +
"}\n",
true, null);
-
- StringBuffer subTeamContent = new StringBuffer();
+
+ StringBuffer subTeamContent = new StringBuffer();
subTeamContent.append("package test1;\n");
subTeamContent.append("import test1.p1.SuperTeam;\n");
subTeamContent.append("public team class Completion_testMethodInvocation2 extends SuperTeam {\n");
@@ -1773,8 +1773,8 @@ public class CodeCompletionTest extends CoreTests {
subTeamContent.append(" }\n");
subTeamContent.append(" }\n");
subTeamContent.append("}");
-
- StringBuffer expectedContent = new StringBuffer();
+
+ StringBuffer expectedContent = new StringBuffer();
expectedContent.append("package test1;\n");
expectedContent.append("import test1.p1.SuperTeam;\n");
expectedContent.append("public team class Completion_testMethodInvocation2 extends SuperTeam {\n");
@@ -1790,7 +1790,7 @@ public class CodeCompletionTest extends CoreTests {
expectedContent.append(" }\n");
expectedContent.append(" }\n");
expectedContent.append("}");
-
+
String superMid1R = "%E2%98%82=OTTestProject1/src%3Ctest1.p1%7BSuperTeam.java%E2%98%83SuperTeam%E2%98%83Mid1%E2%98%83R";
String expectedInfo = ">foo in SuperMid2 " +
"<div><b>Overrides:</b> " +
@@ -1800,7 +1800,7 @@ public class CodeCompletionTest extends CoreTests {
String completeAfter = "r.";
int pos = subTeamContent.indexOf(completeAfter)+completeAfter.length();
int posAfter = expectedContent.indexOf("r.foo();")+8;
-
+
ICompletionProposal proposal = assertProposal("foo", null, null, subTeamContent, new Region(pos, 0), expectedContent, new Region(posAfter, 0), 0);
assertTrue("Unexpected additional info", proposal.getAdditionalProposalInfo().endsWith(expectedInfo));
}
@@ -1808,7 +1808,7 @@ public class CodeCompletionTest extends CoreTests {
// propose methods invoked via a phantom role, two direct tsuper roles, only more distant one has the method
public void testMethodInvocation3() throws CoreException {
IPackageFragment pkg = CompletionTestSetup.getTestPackage(this.fJProject1, "p1");
- pkg.createCompilationUnit("SuperTeam.java",
+ pkg.createCompilationUnit("SuperTeam.java",
"package test1.p1;\n" +
"public team class SuperTeam {\n" +
" protected team class Mid1 {\n" +
@@ -1823,8 +1823,8 @@ public class CodeCompletionTest extends CoreTests {
" }\n" +
"}\n",
true, null);
-
- StringBuffer subTeamContent = new StringBuffer();
+
+ StringBuffer subTeamContent = new StringBuffer();
subTeamContent.append("package test1;\n");
subTeamContent.append("import test1.p1.SuperTeam;\n");
subTeamContent.append("public team class Completion_testMethodInvocation3 extends SuperTeam {\n");
@@ -1840,8 +1840,8 @@ public class CodeCompletionTest extends CoreTests {
subTeamContent.append(" }\n");
subTeamContent.append(" }\n");
subTeamContent.append("}");
-
- StringBuffer expectedContent = new StringBuffer();
+
+ StringBuffer expectedContent = new StringBuffer();
expectedContent.append("package test1;\n");
expectedContent.append("import test1.p1.SuperTeam;\n");
expectedContent.append("public team class Completion_testMethodInvocation3 extends SuperTeam {\n");
@@ -1857,7 +1857,7 @@ public class CodeCompletionTest extends CoreTests {
expectedContent.append(" }\n");
expectedContent.append(" }\n");
expectedContent.append("}");
-
+
String superMid1R = "%E2%98%82=OTTestProject1/src%3Ctest1.p1%7BSuperTeam.java%E2%98%83SuperTeam%E2%98%83Mid1%E2%98%83R";
String expectedInfo = ">foo in SubMid1 " +
"<div><b>Overrides:</b> " +
@@ -1867,17 +1867,17 @@ public class CodeCompletionTest extends CoreTests {
String completeAfter = "r.";
int pos = subTeamContent.indexOf(completeAfter)+completeAfter.length();
int posAfter = expectedContent.indexOf("r.foo();")+8;
-
+
ICompletionProposal proposal = assertProposal("foo", null, null, subTeamContent, new Region(pos, 0), expectedContent, new Region(posAfter, 0), 0);
assertTrue("Unexpected additional info", proposal.getAdditionalProposalInfo().endsWith(expectedInfo));
}
-
+
// propose methods invoked via a phantom role, simple nested case
public void testMethodInvocation4() throws CoreException {
-
-
- StringBuffer subTeamContent = new StringBuffer();
+
+
+ StringBuffer subTeamContent = new StringBuffer();
subTeamContent.append("package test1;\n");
subTeamContent.append("public team class Completion_testMethodInvocation4 {\n");
subTeamContent.append(" protected team class Mid1 {\n");
@@ -1893,8 +1893,8 @@ public class CodeCompletionTest extends CoreTests {
subTeamContent.append(" }\n");
subTeamContent.append(" }\n");
subTeamContent.append("}");
-
- StringBuffer expectedContent = new StringBuffer();
+
+ StringBuffer expectedContent = new StringBuffer();
expectedContent.append("package test1;\n");
expectedContent.append("public team class Completion_testMethodInvocation4 {\n");
expectedContent.append(" protected team class Mid1 {\n");
@@ -1910,23 +1910,23 @@ public class CodeCompletionTest extends CoreTests {
expectedContent.append(" }\n");
expectedContent.append(" }\n");
expectedContent.append("}");
-
+
String expectedInfo = ">foo in Mid1 </body></html>";
String completeAfter = "r.";
int pos = subTeamContent.indexOf(completeAfter)+completeAfter.length();
int posAfter = expectedContent.indexOf("r.foo();")+8;
-
+
ICompletionProposal proposal = assertProposal("foo", null, null, subTeamContent, new Region(pos, 0), expectedContent, new Region(posAfter, 0), 0);
assertTrue("Unexpected additional info", proposal.getAdditionalProposalInfo().endsWith(expectedInfo));
}
// propose methods invoked via a phantom role, simple nested case
public void testMethodInvocation5() throws CoreException {
-
+
createBaseClass("test1", "B", "public boolean check() { return false; }");
- StringBuffer subTeamContent = new StringBuffer();
+ StringBuffer subTeamContent = new StringBuffer();
subTeamContent.append("package test1;\n");
subTeamContent.append("public team class Completion_testMethodInvocation5 {\n");
subTeamContent.append(" protected class R playedBy B {\n");
@@ -1938,8 +1938,8 @@ public class CodeCompletionTest extends CoreTests {
subTeamContent.append(" }\n");
subTeamContent.append(" }\n");
subTeamContent.append("}");
-
- StringBuffer expectedContent = new StringBuffer();
+
+ StringBuffer expectedContent = new StringBuffer();
expectedContent.append("package test1;\n");
expectedContent.append("public team class Completion_testMethodInvocation5 {\n");
expectedContent.append(" protected class R playedBy B {\n");
@@ -1951,12 +1951,12 @@ public class CodeCompletionTest extends CoreTests {
expectedContent.append(" }\n");
expectedContent.append(" }\n");
expectedContent.append("}");
-
+
String completeAfter = "roles.";
int pos = subTeamContent.indexOf(completeAfter)+completeAfter.length();
int posAfter = expectedContent.indexOf("roles.add(arg0)")+10; // at start of argument
-
+
ICompletionProposal proposal = assertProposal("add", null, null, subTeamContent, new Region(pos, 0), expectedContent, new Region(posAfter, 4), 0);
assertTrue("Should be a parameter guessing proposal", proposal instanceof ParameterGuessingProposal);
assertChoices(proposal, new String[][]{new String[]{"arg0", "rarg", "null"}}); // <- this is key: expect "rarg" next to "arg0"!
@@ -2000,25 +2000,25 @@ public class CodeCompletionTest extends CoreTests {
"}\n");
int posAfter = expectedContent.indexOf("new R()") + "new R()".length();
-
+
ICompletionProposal proposal = assertProposal("R()", null, null, teamContent, new Region(pos, 0), expectedContent, new Region(posAfter, 0), 0);
assertTrue("Should be a java method proposal", proposal instanceof JavaMethodCompletionProposal);
}
// == Below: Helper methods/fields. ==
-
- private void createBaseClass(String classBody)
- throws JavaModelException, CoreException
+
+ private void createBaseClass(String classBody)
+ throws JavaModelException, CoreException
{
createBaseClass("test1", "B", classBody);
}
- private void createBaseClass(String basePackage, String className, String classBody)
- throws JavaModelException, CoreException
+ private void createBaseClass(String basePackage, String className, String classBody)
+ throws JavaModelException, CoreException
{
createBaseClass(basePackage, className, "", classBody);
}
- private void createBaseClass(String basePackage, String className, String classHeaderDetails, String classBody)
- throws JavaModelException, CoreException
+ private void createBaseClass(String basePackage, String className, String classHeaderDetails, String classBody)
+ throws JavaModelException, CoreException
{
// create a base class:
StringBuffer buf= new StringBuffer();
@@ -2044,7 +2044,7 @@ public class CodeCompletionTest extends CoreTests {
private String fLocals;
private char fTrigger;
private boolean fWaitBeforeCompleting;
-
+
protected void assertChoices(ICompletionProposal proposal, String[][] expected) {
assertTrue("Not a ParameterGuessingProposal", proposal instanceof ParameterGuessingProposal);
ParameterGuessingProposal pgProposal = (ParameterGuessingProposal)proposal;
@@ -2057,48 +2057,48 @@ public class CodeCompletionTest extends CoreTests {
}
}
}
-
- protected ICompletionProposal assertTypeBodyProposal(String before, String selector, String expected, int requiredRelevance)
- throws CoreException
+
+ protected ICompletionProposal assertTypeBodyProposal(String before, String selector, String expected, int requiredRelevance)
+ throws CoreException
{
return assertTypeBodyProposal(before, selector, expected, requiredRelevance, true);
}
- protected ICompletionProposal assertTypeBodyProposal(String before, String selector, String expected, int requiredRelevance, boolean addRole)
- throws CoreException
+ protected ICompletionProposal assertTypeBodyProposal(String before, String selector, String expected, int requiredRelevance, boolean addRole)
+ throws CoreException
{
StringBuffer contents= new StringBuffer();
IRegion preSelection= assembleClassBodyTestCUExtractSelection(contents, before, fBeforeImports, addRole);
StringBuffer result= new StringBuffer();
IRegion expectedSelection= assembleClassBodyTestCUExtractSelection(result, expected, fAfterImports, addRole);
-
+
return assertProposal(selector, null, null, contents, preSelection, result, expectedSelection, requiredRelevance);
}
- protected ICompletionProposal assertROFIBodyProposal(String before, String selector, String expected, int requiredRelevance)
- throws CoreException
+ protected ICompletionProposal assertROFIBodyProposal(String before, String selector, String expected, int requiredRelevance)
+ throws CoreException
{
IPackageFragment testPkg = CompletionTestSetup.getTestPackage(this.fJProject1, null);
String teamName = "Completion_" + getName();
- testPkg.createCompilationUnit(teamName + ".java",
+ testPkg.createCompilationUnit(teamName + ".java",
"package test1;\n" +
"/** @role RoFiRole */\n" +
- "public team class Completion_"+getName()+" {}\n",
+ "public team class Completion_"+getName()+" {}\n",
true, null);
-
+
StringBuffer contents= new StringBuffer();
IRegion preSelection= assembleROFIBodyTestCUExtractSelection(contents, before, fBeforeImports);
StringBuffer result= new StringBuffer();
IRegion expectedSelection= assembleROFIBodyTestCUExtractSelection(result, expected, fAfterImports);
-
+
return assertProposal(selector, teamName, "RoFiRole", contents, preSelection, result, expectedSelection, requiredRelevance);
}
- protected void assertNosuchTypeBodyProposal(String before, String selector, int requiredRelevance)
- throws CoreException
+ protected void assertNosuchTypeBodyProposal(String before, String selector, int requiredRelevance)
+ throws CoreException
{
StringBuffer contents= new StringBuffer();
IRegion preSelection= assembleClassBodyTestCUExtractSelection(contents, before, fBeforeImports, true);
-
+
assertNosuchProposal(selector, contents, preSelection, requiredRelevance);
}
@@ -2172,7 +2172,7 @@ public class CodeCompletionTest extends CoreTests {
private ICompletionProposal assertProposal(String selector, String relativePackage, String typeName, StringBuffer contents, IRegion preSelection, StringBuffer result, IRegion expectedSelection, int requiredRelevance) throws CoreException {
//{ObjectTeams: made package and file name configurable via new arguments `relativePackage'/`typeName':
IPackageFragment pkg = (relativePackage == null) ? CompletionTestSetup.getAnonymousTestPackage(this.fJProject1) : CompletionTestSetup.getTestPackage(this.fJProject1, relativePackage);
- fCU= (typeName == null) ? createCU(pkg, contents.toString()) : pkg.createCompilationUnit(typeName + ".java", contents.toString(), false, null);
+ fCU= (typeName == null) ? createCU(pkg, contents.toString()) : pkg.createCompilationUnit(typeName + ".java", contents.toString(), false, null);
// SH}
fEditor= (JavaEditor) EditorUtility.openInEditor(fCU);
IDocument doc;
@@ -2197,8 +2197,8 @@ public class CodeCompletionTest extends CoreTests {
return proposal;
}
- private void assertNosuchProposal(String selector, StringBuffer contents, IRegion preSelection, int requiredRelevance)
- throws CoreException
+ private void assertNosuchProposal(String selector, StringBuffer contents, IRegion preSelection, int requiredRelevance)
+ throws CoreException
{
fCU= createCU(CompletionTestSetup.getAnonymousTestPackage(this.fJProject1), contents.toString());
fEditor= (JavaEditor) EditorUtility.openInEditor(fCU);
@@ -2209,7 +2209,7 @@ public class CodeCompletionTest extends CoreTests {
closeEditor(fEditor);
}
}
-
+
// from 3.4 CodeCompletionTest
private void assertAppliedProposal(String contents, IJavaCompletionProposal proposal, String completion) {
IDocument doc= new Document(contents);
@@ -2238,10 +2238,10 @@ public class CodeCompletionTest extends CoreTests {
private ICompletionProposal findNamedProposal(String prefix, ICompilationUnit cu, IRegion selection, int requiredRelevance) throws JavaModelException, PartInitException {
ICompletionProposal[] proposals= collectProposals(cu, selection);
-
+
ICompletionProposal found= null;
for (int i= 0; i < proposals.length; i++) {
- if (proposals[i] instanceof IJavaCompletionProposal)
+ if (proposals[i] instanceof IJavaCompletionProposal)
if (((IJavaCompletionProposal)proposals[i]).getRelevance() < requiredRelevance)
continue;
String displayString= proposals[i].getDisplayString();
@@ -2267,7 +2267,7 @@ public class CodeCompletionTest extends CoreTests {
* Invokes {@link Thread#sleep(long)} if {@link #waitBeforeCompleting(boolean)} was set to
* <code>true</code> or camel case completions are enabled. For some reasons, inner types and
* camel case matches don't show up otherwise.
- *
+ *
* @since 3.2
*/
private void waitBeforeCoreCompletion() {
@@ -2299,5 +2299,5 @@ public class CodeCompletionTest extends CoreTests {
} else {
proposal.apply(doc);
}
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/CompletionTestSetup.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/CompletionTestSetup.java
index bb043cf49..a1e8df206 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/CompletionTestSetup.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/CompletionTestSetup.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -48,28 +48,28 @@ class CompletionTestSetup extends ProjectTestSetup {
IPackageFragmentRoot root= project.getPackageFragmentRoot("src");
if (!root.exists())
root= JavaProjectHelper.addSourceContainer(project, "src");
-
+
IPackageFragment fragment= root.getPackageFragment(packageName);
if (!fragment.exists())
fragment= root.createPackageFragment(packageName, false, null);
-
+
return fragment;
}
-
+
private static int fAnonymousSoureFolderCounter= 0;
public static IPackageFragment getAnonymousTestPackage(IJavaProject project) throws CoreException {
String sourceFolder= "src" + fAnonymousSoureFolderCounter++;
IPackageFragmentRoot root= project.getPackageFragmentRoot(sourceFolder);
if (!root.exists())
root= JavaProjectHelper.addSourceContainer(project, sourceFolder);
-
+
IPackageFragment fragment= root.getPackageFragment("test1");
if (!fragment.exists())
fragment= root.createPackageFragment("test1", false, null);
-
+
return fragment;
}
-
+
public CompletionTestSetup(Test test) {
super(test);
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/HierarchicalASTVisiting.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/HierarchicalASTVisiting.java
index 814aac6f6..44cb59d7b 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/HierarchicalASTVisiting.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/HierarchicalASTVisiting.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010 GK Software AG
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -41,7 +41,7 @@ import base org.eclipse.jdt.ui.tests.core.HierarchicalASTVisitorTest;
/**
* This team excludes OT-specific AST nodes from HierarchicalASTVisitorTest
- * because the HierarchicalASTVisitor is not OT-aware.
+ * because the HierarchicalASTVisitor is not OT-aware.
*/
public team class HierarchicalASTVisiting {
@@ -53,8 +53,8 @@ public team class HierarchicalASTVisiting {
static callin boolean isVisitMethod(Method method) {
return base.isVisitMethod(method) && !isOTNode(method.getParameterTypes()[0]);
}
-
-
+
+
private static boolean isOTNode(Class nodeClass) {
Class[] otNodeClasses = new Class[] {
MethodSpec.class,
@@ -74,7 +74,7 @@ public team class HierarchicalASTVisiting {
PrecedenceDeclaration.class,
GuardPredicateDeclaration.class
};
- for (int i = 0; i < otNodeClasses.length; i++)
+ for (int i = 0; i < otNodeClasses.length; i++)
if (otNodeClasses[i] == nodeClass)
return true;
return false;
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/JavaQuickFixTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/JavaQuickFixTests.java
index 0b8b2796d..ab1ec54ba 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/JavaQuickFixTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/JavaQuickFixTests.java
@@ -1,17 +1,17 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010, 2016 Stephan Herrmann.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -51,7 +51,7 @@ import org.osgi.framework.Bundle;
/**
* Testing whether standard Java quickfixes work in OT/J code, too.
- *
+ *
* @author stephan
* @since 0.7.0
*/
@@ -65,7 +65,7 @@ public class JavaQuickFixTests extends OTQuickFixTest {
void setupForNullAnnotations(boolean isPlainJava) throws IOException, JavaModelException {
if (this.ANNOTATION_JAR_PATH == null) {
- String version= "[2.0.0,3.0.0)";
+ String version= "[2.0.0,3.0.0)";
Bundle[] bundles= Platform.getBundles("org.eclipse.jdt.annotation", version);
File bundleFile= FileLocator.getBundleFile(bundles[0]);
if (bundleFile.isDirectory())
@@ -74,9 +74,9 @@ public class JavaQuickFixTests extends OTQuickFixTest {
this.ANNOTATION_JAR_PATH= bundleFile.getPath();
}
JavaProjectHelper.addLibrary(fJProject1, new Path(ANNOTATION_JAR_PATH));
-
+
Hashtable<String, String> options= TestOptions.getDefaultOptions();
-
+
options.put(OTDTPlugin.OT_COMPILER_PURE_JAVA, isPlainJava ? JavaCore.ENABLED : JavaCore.DISABLED);
options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.SPACE);
@@ -98,7 +98,7 @@ public class JavaQuickFixTests extends OTQuickFixTest {
}
// the following three test try to reproduce Bug 311890 - [assist] support "create class" quickfix for OT/J references
-
+
// create a class for an unresolved playedBy declaration
@Test
public void testCreateClass1() throws Exception {
@@ -110,7 +110,7 @@ public class JavaQuickFixTests extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 6);
@@ -129,7 +129,7 @@ public class JavaQuickFixTests extends OTQuickFixTest {
}
fail("Expected proposal not found");
}
-
+
// create a class for an unresolved playedBy declaration in a nested role
@Test
public void testCreateClass2() throws Exception {
@@ -143,7 +143,7 @@ public class JavaQuickFixTests extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 7);
@@ -176,7 +176,7 @@ public class JavaQuickFixTests extends OTQuickFixTest {
buf.append(" public void foo(B as R o) {}\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cu, astRoot, 2, 1, null);
assertNumberOfProposals(proposals, 5);
@@ -195,7 +195,7 @@ public class JavaQuickFixTests extends OTQuickFixTest {
}
fail("Expected proposal not found");
}
-
+
// Bug 348574 - [quickfix] implement abstract methods from tsuper
@Test
public void testAddAbstractMethods1() throws CoreException {
@@ -216,7 +216,7 @@ public class JavaQuickFixTests extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu1);
ArrayList<IJavaCompletionProposal> proposals1= collectCorrections(cu1, astRoot, 2, 0);
assertNumberOfProposals(proposals1, 0);
@@ -234,12 +234,12 @@ public class JavaQuickFixTests extends OTQuickFixTest {
buf.append("\n");
buf.append(" @Override\n");
buf.append(" void foo() {\n");
- buf.append(" // TODO Auto-generated method stub\n");
+ buf.append(" // TODO Auto-generated method stub\n");
buf.append(" \n");
buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
- String expected1= buf.toString();
+ String expected1= buf.toString();
proposal= (CUCorrectionProposal) proposals2.get(1);
@@ -251,9 +251,9 @@ public class JavaQuickFixTests extends OTQuickFixTest {
buf.append(" protected abstract class R {\n");
buf.append(" }\n");
buf.append("}\n");
- String expected2= buf.toString();
-
- assertEqualStringsIgnoreOrder(new String[] { preview1, preview2 }, new String[] { expected1, expected2 });
+ String expected2= buf.toString();
+
+ assertEqualStringsIgnoreOrder(new String[] { preview1, preview2 }, new String[] { expected1, expected2 });
}
// Bug 348574 - [quickfix] implement abstract methods from tsuper
@@ -277,7 +277,7 @@ public class JavaQuickFixTests extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu1);
ArrayList<IJavaCompletionProposal> proposals1= collectCorrections(cu1, astRoot, 2, 0);
assertNumberOfProposals(proposals1, 0);
@@ -295,12 +295,12 @@ public class JavaQuickFixTests extends OTQuickFixTest {
buf.append("\n");
buf.append(" @Override\n");
buf.append(" static void foo() {\n");
- buf.append(" // TODO Auto-generated method stub\n");
+ buf.append(" // TODO Auto-generated method stub\n");
buf.append(" \n");
buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
- String expected1= buf.toString();
+ String expected1= buf.toString();
proposal= (CUCorrectionProposal) proposals2.get(1);
@@ -312,15 +312,15 @@ public class JavaQuickFixTests extends OTQuickFixTest {
buf.append(" protected abstract class R {\n");
buf.append(" }\n");
buf.append("}\n");
- String expected2= buf.toString();
-
- assertEqualStringsIgnoreOrder(new String[] { preview1, preview2 }, new String[] { expected1, expected2 });
+ String expected2= buf.toString();
+
+ assertEqualStringsIgnoreOrder(new String[] { preview1, preview2 }, new String[] { expected1, expected2 });
}
@Test
public void testExtractPotentiallyNullField1() throws Exception {
setupForNullAnnotations(true/*plainJava*/);
-
+
IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test1;\n");
@@ -374,7 +374,7 @@ public class JavaQuickFixTests extends OTQuickFixTest {
// secondary
ChangeCorrectionProposal otherProposal = (ChangeCorrectionProposal) proposals.get(1);
assertEquals("Display String 2", "Add @SuppressWarnings 'null' to 'foo()'", otherProposal.getDisplayString());
-
+
otherProposal = (ChangeCorrectionProposal) proposals.get(2);
assertEquals("Display String 3", "Configure problem severity", otherProposal.getDisplayString());
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/ModifierCorrectionsQuickFixTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/ModifierCorrectionsQuickFixTest.java
index 00b590246..85d06e734 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/ModifierCorrectionsQuickFixTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/ModifierCorrectionsQuickFixTest.java
@@ -6,7 +6,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -34,7 +34,7 @@ import org.junit.runners.JUnit4;
// structure OT_COPY_PASTE from {@link org.eclipse.jdt.ui.tests.quickfix.ModifierCorrectionsQuickFixTest}
@RunWith(JUnit4.class)
public class ModifierCorrectionsQuickFixTest extends OTQuickFixTest {
-
+
@Rule
public ProjectTestSetup projectsetup = new ProjectTestSetup();
@@ -43,7 +43,7 @@ public class ModifierCorrectionsQuickFixTest extends OTQuickFixTest {
public void testRoleCtorCalled1() throws Exception {
IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T {\n");
buf.append(" protected class R {\n");
buf.append(" R(){}\n");
@@ -54,17 +54,17 @@ public class ModifierCorrectionsQuickFixTest extends OTQuickFixTest {
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("T.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 1);
assertCorrectLabels(proposals);
-
+
CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0);
String preview= getPreviewContent(proposal);
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T {\n");
buf.append(" protected class R {\n");
buf.append(" protected R(){}\n");
@@ -81,7 +81,7 @@ public class ModifierCorrectionsQuickFixTest extends OTQuickFixTest {
public void testRoleCtorCalled2() throws Exception {
IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T {\n");
buf.append(" protected class R {\n");
buf.append(" R(){}\n");
@@ -94,17 +94,17 @@ public class ModifierCorrectionsQuickFixTest extends OTQuickFixTest {
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("T.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 1);
assertCorrectLabels(proposals);
-
+
CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0);
String preview= getPreviewContent(proposal);
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T {\n");
buf.append(" protected class R {\n");
buf.append(" protected R(){}\n");
@@ -117,21 +117,21 @@ public class ModifierCorrectionsQuickFixTest extends OTQuickFixTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
/* calling a non-public role constructor from a sibling role file. */
@Test
public void testRoleCtorCalled3() throws Exception {
IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
IPackageFragment pack1T= fSourceFolder.createPackageFragment("test1.T", false, null);
StringBuffer buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T {\n");
buf.append(" protected class R {\n");
buf.append(" R(){}\n");
buf.append(" }\n");
buf.append("}\n");
pack1.createCompilationUnit("T.java", buf.toString(), false, null);
-
+
buf = new StringBuffer();
buf.append("team package test1.T;\n");
buf.append("protected class R2 {\n");
@@ -141,17 +141,17 @@ public class ModifierCorrectionsQuickFixTest extends OTQuickFixTest {
buf.append("}\n");
ICompilationUnit cu= pack1T.createCompilationUnit("R2.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 1);
assertCorrectLabels(proposals);
-
+
CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0);
String preview= getPreviewContent(proposal);
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T {\n");
buf.append(" protected class R {\n");
buf.append(" protected R(){}\n");
@@ -171,9 +171,9 @@ public class ModifierCorrectionsQuickFixTest extends OTQuickFixTest {
buf.append(" R2(){}\n");
buf.append("}\n");
pack1T.createCompilationUnit("R2.java", buf.toString(), false, null);
-
+
buf = new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T {\n");
buf.append(" protected class R {\n");
buf.append(" void foo() {\n");
@@ -183,12 +183,12 @@ public class ModifierCorrectionsQuickFixTest extends OTQuickFixTest {
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("T.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 1);
assertCorrectLabels(proposals);
-
+
CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0);
String preview= getPreviewContent(proposal);
@@ -199,20 +199,20 @@ public class ModifierCorrectionsQuickFixTest extends OTQuickFixTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
/* calling a non-public role constructor as externalized. */
@Test
public void testRoleCtorCalled5() throws Exception {
IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T {\n");
buf.append(" public class R {\n");
buf.append(" R(){}\n");
buf.append(" }\n");
buf.append("}\n");
pack1.createCompilationUnit("T.java", buf.toString(), false, null);
-
+
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("public class Main {\n");
@@ -222,17 +222,17 @@ public class ModifierCorrectionsQuickFixTest extends OTQuickFixTest {
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("Main.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cu, astRoot, 2, null);
assertNumberOfProposals(proposals, 1);
assertCorrectLabels(proposals);
-
+
CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0);
String preview= getPreviewContent(proposal);
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T {\n");
buf.append(" public class R {\n");
buf.append(" public R(){}\n");
@@ -240,20 +240,20 @@ public class ModifierCorrectionsQuickFixTest extends OTQuickFixTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
/* calling a non-public role method on externalized. */
@Test
public void testRoleMethodCalled() throws Exception {
IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T {\n");
buf.append(" public class R {\n");
buf.append(" void bar(){}\n");
buf.append(" }\n");
buf.append("}\n");
pack1.createCompilationUnit("T.java", buf.toString(), false, null);
-
+
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("public class Main {\n");
@@ -263,17 +263,17 @@ public class ModifierCorrectionsQuickFixTest extends OTQuickFixTest {
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("Main.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 1);
assertCorrectLabels(proposals);
-
+
CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0);
String preview= getPreviewContent(proposal);
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T {\n");
buf.append(" public class R {\n");
buf.append(" public void bar(){}\n");
@@ -281,7 +281,7 @@ public class ModifierCorrectionsQuickFixTest extends OTQuickFixTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
@Test
public void testCalloutToPrivate() throws Exception {
IPackageFragment pack1 = fSourceFolder.createPackageFragment("test1", false, null);
@@ -291,7 +291,7 @@ public class ModifierCorrectionsQuickFixTest extends OTQuickFixTest {
buf.append(" private int foo() { return 0; }\n");
buf.append("}\n");
pack1.createCompilationUnit("BaseBar.java", buf.toString(), false, null);
-
+
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("public team class TeamFoo {\n");
@@ -305,12 +305,12 @@ public class ModifierCorrectionsQuickFixTest extends OTQuickFixTest {
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("TeamFoo.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 1);
assertCorrectLabels(proposals);
-
+
CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0);
String preview= getPreviewContent(proposal);
@@ -328,8 +328,8 @@ public class ModifierCorrectionsQuickFixTest extends OTQuickFixTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
-
+
+
@Test
public void testCalloutViaExternalized() throws Exception {
IPackageFragment pack1 = fSourceFolder.createPackageFragment("test1", false, null);
@@ -339,7 +339,7 @@ public class ModifierCorrectionsQuickFixTest extends OTQuickFixTest {
buf.append(" int foo() { return 0; }\n");
buf.append("}\n");
pack1.createCompilationUnit("BaseBar.java", buf.toString(), false, null);
-
+
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("public team class TeamFoo {\n");
@@ -352,12 +352,12 @@ public class ModifierCorrectionsQuickFixTest extends OTQuickFixTest {
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("TeamFoo.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 1);
assertCorrectLabels(proposals);
-
+
CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0);
String preview= getPreviewContent(proposal);
@@ -373,7 +373,7 @@ public class ModifierCorrectionsQuickFixTest extends OTQuickFixTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
/** @SuppressWarnings("bindingconventions") was added a wrong location. */
@Test
public void testSuppressWarnings1() throws Exception {
@@ -384,7 +384,7 @@ public class ModifierCorrectionsQuickFixTest extends OTQuickFixTest {
buf.append(" int foo() { return 0; }\n");
buf.append("}\n");
pack1.createCompilationUnit("BaseBar.java", buf.toString(), false, null);
-
+
IPackageFragment pack2 = fSourceFolder.createPackageFragment("test2", false, null);
buf = new StringBuffer();
buf.append("package test2;\n");
@@ -395,12 +395,12 @@ public class ModifierCorrectionsQuickFixTest extends OTQuickFixTest {
buf.append("}\n");
ICompilationUnit cu= pack2.createCompilationUnit("TeamFoo.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 3);
assertCorrectLabels(proposals);
-
+
CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0);
String preview= getPreviewContent(proposal);
@@ -413,7 +413,7 @@ public class ModifierCorrectionsQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
assertEqualString(preview, buf.toString());
-
+
assertEqualString("Configure problem severity", proposals.get(1).getDisplayString());
assertEqualString("\"Change import to 'import base test1...BaseBar;'\"", proposals.get(2).getDisplayString());
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/OTJavadocQuickFixTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/OTJavadocQuickFixTest.java
index 61809d1bf..b7163ddbd 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/OTJavadocQuickFixTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/OTJavadocQuickFixTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -65,7 +65,7 @@ public class OTJavadocQuickFixTest extends OTQuickFixTest {
options.put(JavaCore.COMPILER_PB_MISSING_JAVADOC_TAGS, JavaCore.ERROR);
options.put(JavaCore.COMPILER_PB_MISSING_JAVADOC_COMMENTS, JavaCore.ERROR);
options.put(JavaCore.COMPILER_PB_MISSING_JAVADOC_COMMENTS_OVERRIDING, JavaCore.ENABLED);
- JavaCore.setOptions(options);
+ JavaCore.setOptions(options);
StringBuffer comment= new StringBuffer();
comment.append("/**\n");
@@ -76,7 +76,7 @@ public class OTJavadocQuickFixTest extends OTQuickFixTest {
StubUtility.setCodeTemplate(CodeTemplateContextType.CONSTRUCTORCOMMENT_ID, res, null);
StubUtility.setCodeTemplate(CodeTemplateContextType.METHODCOMMENT_ID, res, null);
StubUtility.setCodeTemplate(CodeTemplateContextType.TYPECOMMENT_ID, res, null);
-
+
comment= new StringBuffer();
comment.append("/**\n");
comment.append(" * A field comment for ${field}.\n");
@@ -89,29 +89,29 @@ public class OTJavadocQuickFixTest extends OTQuickFixTest {
comment.append(" * ${see_to_overridden}\n");
comment.append(" */");
StubUtility.setCodeTemplate(CodeTemplateContextType.OVERRIDECOMMENT_ID, comment.toString(), null);
-
+
comment= new StringBuffer();
comment.append("/**\n");
comment.append(" * A delegate comment.\n");
comment.append(" * ${see_to_target}\n");
comment.append(" */");
StubUtility.setCodeTemplate(CodeTemplateContextType.DELEGATECOMMENT_ID, comment.toString(), null);
-
+
fJProject1= ProjectTestSetup.getProject();
fSourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src");
-
+
//{ObjectTeams: add the OTRE:
JavaProjectHelper.addLibrary(fJProject1, new Path(OTRE_JAR_PATH));
// SH}
}
-
+
@Test
public void testMissingRoleTag1() throws Exception {
IPackageFragment teamPkg = fSourceFolder.createPackageFragment("test1.MyTeam", false, null);
- teamPkg.createCompilationUnit("MyRole.java",
+ teamPkg.createCompilationUnit("MyRole.java",
"team package test1.MyTeam;\n" +
- "public class MyRole {}\n",
+ "public class MyRole {}\n",
true, null);
IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
@@ -123,15 +123,15 @@ public class OTJavadocQuickFixTest extends OTQuickFixTest {
buf.append(" private MyRole r = null;\n"); // use field to trigger loading of role file
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("MyTeam.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cu, astRoot, 1);
assertNumberOfProposals(proposals, 2);
assertCorrectLabels(proposals);
-
+
CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(1);
String preview1= getPreviewContent(proposal);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("/**\n");
@@ -142,7 +142,7 @@ public class OTJavadocQuickFixTest extends OTQuickFixTest {
buf.append("}\n");
String expected= buf.toString();
assertEqualString(preview1, expected);
-
+
assertEqualString("Configure problem severity", proposals.get(0).getDisplayString());
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/OTQuickFixTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/OTQuickFixTest.java
index e3a94889d..51a8574fc 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/OTQuickFixTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/OTQuickFixTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -64,34 +64,34 @@ import org.junit.runners.Suite;
public class OTQuickFixTest extends QuickFixTest {
protected IJavaProject fJProject1;
-
+
protected IPackageFragmentRoot fSourceFolder;
public static final String OT_RUNTIME_PATH;
public static final String OTRE_JAR_PATH;
static {
OT_RUNTIME_PATH = JavaCore.getClasspathVariable(OTDTPlugin.OTDT_INSTALLDIR).toOSString();
- OTRE_JAR_PATH = OT_RUNTIME_PATH
+ OTRE_JAR_PATH = OT_RUNTIME_PATH
+ File.separator
+ "lib" //$NON-NLS-1$
+ File.separator
+ "otre.jar"; //$NON-NLS-1$
}
-
+
@SuppressWarnings("unchecked")
protected void addOptions(Hashtable options) {
options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.SPACE);
options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4");
- options.put(JavaCore.COMPILER_PB_STATIC_ACCESS_RECEIVER, JavaCore.ERROR);
+ options.put(JavaCore.COMPILER_PB_STATIC_ACCESS_RECEIVER, JavaCore.ERROR);
}
@Before
public void setUp() throws Exception {
Hashtable<String,String> options= TestOptions.getDefaultOptions();
addOptions(options);
-
- JavaCore.setOptions(options);
-
+
+ JavaCore.setOptions(options);
+
fJProject1= ProjectTestSetup.getProject();
if (!OTJavaNature.hasOTJavaNature(fJProject1.getProject())) {
IProjectDescription description = fJProject1.getProject().getDescription();
@@ -99,7 +99,7 @@ public class OTQuickFixTest extends QuickFixTest {
fJProject1.getProject().setDescription(description, null);
OTREContainer.initializeOTJProject(fJProject1.getProject());
}
-
+
fSourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src");
}
@@ -107,11 +107,11 @@ public class OTQuickFixTest extends QuickFixTest {
public void tearDown() throws Exception {
JavaProjectHelper.clear(fJProject1, ProjectTestSetup.getDefaultClasspath());
}
-
+
protected void assertChoices(ICompletionProposal proposal, String linkedGroup, String[] expected) {
assertTrue("Not a LinkedCorrectionProposal", proposal instanceof LinkedCorrectionProposal);
LinkedCorrectionProposal linkedProposal = (LinkedCorrectionProposal)proposal;
-
+
LinkedProposalModel linkedProposalModel = new ProposalAdaptor().getLinkedProposalModel(linkedProposal);
LinkedProposalPositionGroup positionGroup = linkedProposalModel.getPositionGroup(linkedGroup, false);
Proposal[] choices = positionGroup.getProposals();
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/OrganizeImportsTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/OrganizeImportsTest.java
index 19da63078..0ed20842f 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/OrganizeImportsTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/OrganizeImportsTest.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -58,7 +58,7 @@ import org.osgi.service.prefs.BackingStoreException;
* <code>org.eclipse.jdt.ui.tests.core.ImportOrganizeTest</code> in the test suite
* <code>org.eclipse.jdt.ui.tests.refactoring</code> provided by Eclipse as
* well as new OT-specific tests.
- *
+ *
* @author brcan
*/
@RunWith(JUnit4.class)
@@ -131,7 +131,7 @@ public class OrganizeImportsTest
}
};
}
-
+
public static void assertEqualString(String actual, String expected)
{
StringAsserts.assertEqualString(actual, expected);
@@ -438,7 +438,7 @@ public class OrganizeImportsTest
null);
buf = new StringBuffer();
buf.append("package teamPkg;\n");
- buf.append("import base basePkg.B1;\n");
+ buf.append("import base basePkg.B1;\n");
buf.append("import base basePkg.B1.Inner;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class Inner playedBy Inner {\n");
@@ -462,7 +462,7 @@ public class OrganizeImportsTest
buf = new StringBuffer();
buf.append("package teamPkg;\n");
- buf.append("import base basePkg.B1;\n");
+ buf.append("import base basePkg.B1;\n");
buf.append("import base basePkg.B1.Inner;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class Inner playedBy Inner {\n");
@@ -473,7 +473,7 @@ public class OrganizeImportsTest
buf.append("}\n");
assertEqualString(cu.getSource(), buf.toString());
}
-
+
// base import for role file
@Test
public void testTypeReferenceInRoleclass7() throws Exception
@@ -673,7 +673,7 @@ public class OrganizeImportsTest
buf.append(" private static void testB1() { }");
buf.append("}\n");
basePkg.createCompilationUnit("B1.java", buf.toString(), false, null);
-
+
IPackageFragment teamPkg = sourceFolder.createPackageFragment(
"teamPkg",
false,
@@ -725,7 +725,7 @@ public class OrganizeImportsTest
buf.append(" void testB1() { }");
buf.append("}\n");
basePkg.createCompilationUnit("B1.java", buf.toString(), false, null);
-
+
IPackageFragment teamPkg = sourceFolder.createPackageFragment(
"teamPkg",
false,
@@ -785,7 +785,7 @@ public class OrganizeImportsTest
buf.append("public class B1 {\n");
buf.append("}\n");
basePkg.createCompilationUnit("B1.java", buf.toString(), false, null);
-
+
IPackageFragment teamPkg = sourceFolder.createPackageFragment(
"teamPkg",
false,
@@ -841,7 +841,7 @@ public class OrganizeImportsTest
buf.append(" }\n");
buf.append("}\n");
basePkg.createCompilationUnit("BaseTeam.java", buf.toString(), false, null);
-
+
IPackageFragment teamPkg = sourceFolder.createPackageFragment(
"teamPkg",
false,
@@ -855,17 +855,17 @@ public class OrganizeImportsTest
buf.append("}\n");
ICompilationUnit cu = teamPkg.createCompilationUnit("T1.java", buf
.toString(), false, null);
-
+
String[] order = new String[0];
IChooseImportQuery query = createQuery(
"T1",
new String[] {},
new int[] {});
-
+
OrganizeImportsOperation op = createOperation(cu, order,
99, false, true, true, query);
op.run(null);
-
+
buf = new StringBuffer();
buf.append("package teamPkg;\n");
buf.append("import basePkg.BaseTeam;\n");
@@ -892,7 +892,7 @@ public class OrganizeImportsTest
buf.append(" void m() {}\n");
buf.append("}\n");
basePkg.createCompilationUnit("Base.java", buf.toString(), false, null);
-
+
IPackageFragment teamPkg = sourceFolder.createPackageFragment(
"teamPkg",
false,
@@ -912,26 +912,26 @@ public class OrganizeImportsTest
buf.append("}\n");
ICompilationUnit cu = teamPkg.createCompilationUnit("T1.java", buf
.toString(), false, null);
-
+
String[] order = new String[0];
IChooseImportQuery query = createQuery(
"T1",
new String[] {},
new int[] {});
-
+
OrganizeImportsOperation op = createOperation(cu, order,
99, false, true, true, query);
op.run(null);
-
+
// buf remains unchanged
assertEqualString(cu.getSource(), buf.toString());
}
-
+
private OrganizeImportsOperation createOperation(ICompilationUnit cu, String[] order, int threshold, boolean ignoreLowerCaseNames, boolean save, boolean doResolve, IChooseImportQuery chooseImportQuery) throws CoreException, BackingStoreException {
setOrganizeImportSettings(order, threshold, threshold, cu.getJavaProject());
return new OrganizeImportsOperation(cu, null, ignoreLowerCaseNames, save, doResolve, chooseImportQuery);
}
-
+
private void setOrganizeImportSettings(String[] order, int threshold, int staticThreshold, IJavaProject project) throws BackingStoreException {
IEclipsePreferences scope= new ProjectScope(project.getProject()).getNode(JavaUI.ID_PLUGIN);
if (order == null) {
@@ -947,5 +947,5 @@ public class OrganizeImportsTest
scope.put(PreferenceConstants.ORGIMPORTS_ONDEMANDTHRESHOLD, String.valueOf(threshold));
}
}
-
+
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/PrecedenceQuickFixTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/PrecedenceQuickFixTest.java
index 514c0420f..11fbe797b 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/PrecedenceQuickFixTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/PrecedenceQuickFixTest.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010 Stephan Herrmann.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -67,7 +67,7 @@ public class PrecedenceQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 1);
@@ -90,7 +90,7 @@ public class PrecedenceQuickFixTest extends OTQuickFixTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
// QuickFix adds a binding-level "precedence after" declaration
@Test
public void testAddAfterBindingPrecedence() throws Exception {
@@ -114,7 +114,7 @@ public class PrecedenceQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 1);
@@ -137,7 +137,7 @@ public class PrecedenceQuickFixTest extends OTQuickFixTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
// QuickFix adds a role-level precedence declaration
@Test
public void testAddAfterRolePrecedence() throws Exception {
@@ -163,7 +163,7 @@ public class PrecedenceQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 1);
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/ProjectTestSetup.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/ProjectTestSetup.java
index 3f44be0d2..64dd94bdc 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/ProjectTestSetup.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/ProjectTestSetup.java
@@ -6,7 +6,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Fraunhofer FIRST - extended API and implementation
@@ -76,12 +76,12 @@ public class ProjectTestSetup extends TestSetup {
fAutobuilding = CoreUtility.setAutoBuilding(false);
//{ObjectTeams: create an OT project and keep otre.jar (don't overwrite with setRawClasspath)
-/* orig:
+/* orig:
fJProject= JavaProjectHelper.createJavaProject(PROJECT_NAME, "bin");
fJProject.setRawClasspath(getDefaultClasspath(), null);
:giro */
fJProject = org.eclipse.objectteams.otdt.ui.tests.util.JavaProjectHelper.createOTJavaProject(PROJECT_NAME, "bin");
- JavaProjectHelper.addRTJar(fJProject);
+ JavaProjectHelper.addRTJar(fJProject);
//gbr}
TestOptions.initializeProjectOptions(fJProject);
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/ProposalAdaptor.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/ProposalAdaptor.java
index 661b4ad0c..b0bef3750 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/ProposalAdaptor.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/ProposalAdaptor.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -34,7 +34,7 @@ public team class ProposalAdaptor {
@SuppressWarnings("decapsulation")
protected ICompletionProposal[][] getFChoices() -> get ICompletionProposal[][] fChoices;
-
+
}
/** API */
public ICompletionProposal[][] getChoices(ParameterGuessingProposal as GuessingProposal proposal) {
@@ -45,7 +45,7 @@ public team class ProposalAdaptor {
protected class LinkedCorrectionProposal playedBy LinkedCorrectionProposal {
@SuppressWarnings("decapsulation")
LinkedProposalModel getLinkedProposalModel() -> LinkedProposalModel getLinkedProposalModel();
- }
+ }
/** API */
public LinkedProposalModel getLinkedProposalModel(LinkedCorrectionProposal as LinkedCorrectionProposal proposal) {
return proposal.getLinkedProposalModel();
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/StatementQuickFixTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/StatementQuickFixTest.java
index a714f8efd..52a274b3d 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/StatementQuickFixTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/StatementQuickFixTest.java
@@ -1,8 +1,8 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2010 Stephan Herrmann.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Stephan Herrmann - Initial API and implementation
**********************************************************************/
@@ -32,10 +32,10 @@ import org.junit.runners.JUnit4;
@RunWith(JUnit4.class)
public class StatementQuickFixTest extends OTQuickFixTest {
-
+
@Rule
public ProjectTestSetup projectsetup = new ProjectTestSetup();
-
+
/* add a return statement to a role method (callin).
* See https://bugs.eclipse.org/311339
*/
@@ -51,7 +51,7 @@ public class StatementQuickFixTest extends OTQuickFixTest {
pack1.createCompilationUnit("B1.java", buf.toString(), false, null);
buf = new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" @SuppressWarnings(\"basecall\")\n");
@@ -60,7 +60,7 @@ public class StatementQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cuteam = pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cuteam);
ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cuteam, astRoot);
assertNumberOfProposals(proposals, 2);
@@ -68,7 +68,7 @@ public class StatementQuickFixTest extends OTQuickFixTest {
String[] expectedProposals = new String[2];
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" @SuppressWarnings(\"basecall\")\n");
@@ -79,7 +79,7 @@ public class StatementQuickFixTest extends OTQuickFixTest {
buf.append("}\n");
expectedProposals[0] = buf.toString();
buf= new StringBuffer();
- buf.append("package test1;\n");
+ buf.append("package test1;\n");
buf.append("public team class T1 {\n");
buf.append(" protected class R playedBy B1 {\n");
buf.append(" @SuppressWarnings(\"basecall\")\n");
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/StringAsserts.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/StringAsserts.java
index 491d7c478..ba76315f9 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/StringAsserts.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/StringAsserts.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/UnresolvedMethodsQuickFixTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/UnresolvedMethodsQuickFixTest.java
index 47996f090..12f92d417 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/UnresolvedMethodsQuickFixTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/UnresolvedMethodsQuickFixTest.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -55,7 +55,7 @@ import org.junit.runners.JUnit4;
*/
@RunWith(JUnit4.class)
public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
-
+
@Rule
public ProjectTestSetup projectsetup = new ProjectTestSetup();
@@ -83,7 +83,7 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("T.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<? extends ICompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 2);
@@ -103,11 +103,11 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append("\n");
buf.append(" private int goo(Vector vec, boolean b) {\n");
buf.append(" return 0;\n");
- buf.append(" }\n");
+ buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
assertEqualString(preview, buf.toString());
-
+
proposal= (CUCorrectionProposal) proposals.get(1);
preview= getPreviewContent(proposal);
@@ -123,7 +123,7 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append("\n");
buf.append(" public int goo(Vector vec, boolean b) {\n");
buf.append(" return 0;\n");
- buf.append(" }\n");
+ buf.append(" }\n");
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
@@ -142,14 +142,14 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("T.java", buf.toString(), false, null);
-
+
buf= new StringBuffer();
buf.append("team package test1.T;\n");
buf.append("public class R2 {\n");
buf.append("}\n");
IPackageFragment pack1T= fSourceFolder.createPackageFragment("test1.T", false, null);
pack1T.createCompilationUnit("R2.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<? extends ICompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 2); // 2nd proposal not really useful (cast to Object??)
@@ -167,11 +167,11 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append("\n");
buf.append(" public int goo(Vector vec, boolean b) {\n");
buf.append(" return 0;\n");
- buf.append(" }\n");
+ buf.append(" }\n");
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
/* See Trac #12 */
@Test
public void testMethodInDifferentClass2() throws Exception {
@@ -183,7 +183,7 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("import java.util.Vector;\n");
@@ -195,7 +195,7 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("T2.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<? extends ICompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 2); // 2nd proposal not really useful (cast to Object??)
@@ -214,12 +214,12 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append("\n");
buf.append(" public int goo(Vector vec, boolean b) {\n");
buf.append(" return 0;\n");
- buf.append(" }\n");
+ buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
@Test
public void testTSuperConstructor() throws Exception {
IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
@@ -241,7 +241,7 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu1);
ArrayList<? extends ICompletionProposal> proposals= collectCorrections(cu1, astRoot);
assertNumberOfProposals(proposals, 2);
@@ -256,10 +256,10 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append(" protected class R {\n");
buf.append("\n");
buf.append(" public R(int i) {\n");
- buf.append(" }\n");
+ buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
- String expected1= buf.toString();
+ String expected1= buf.toString();
proposal= (CUCorrectionProposal) proposals.get(1);
String preview2= getPreviewContent(proposal);
@@ -273,12 +273,12 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
- String expected2= buf.toString();
-
- assertEqualStringsIgnoreOrder(new String[] { preview1, preview2 }, new String[] { expected1, expected2 });
+ String expected2= buf.toString();
+
+ assertEqualStringsIgnoreOrder(new String[] { preview1, preview2 }, new String[] { expected1, expected2 });
}
-
+
// static callin method created
@Test
public void testCallinMethod1() throws Exception {
@@ -290,7 +290,7 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
pack1.createCompilationUnit("B.java", buf.toString(), false, null);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public team class T1 {\n");
@@ -299,7 +299,7 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<? extends ICompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 2); // don't propose to generate into team!!
@@ -316,11 +316,11 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append(" void voo(int j) <- replace void foo(int i);\n");
buf.append("\n");
buf.append(" static callin void voo(int j) {\n");
- buf.append(" }\n");
+ buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
String expected1= buf.toString();
-
+
// remove signatures in callin binding voo<-foo
proposal= (CUCorrectionProposal) proposals.get(1);
String preview2= getPreviewContent(proposal);
@@ -333,8 +333,8 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
String expected2= buf.toString();
-
- assertEqualStringsIgnoreOrder(new String[] { preview1, preview2 }, new String[] { expected1, expected2 });
+
+ assertEqualStringsIgnoreOrder(new String[] { preview1, preview2 }, new String[] { expected1, expected2 });
}
// non-static callin method created
@Test
@@ -347,7 +347,7 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
pack1.createCompilationUnit("B.java", buf.toString(), false, null);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public team class T1 {\n");
@@ -356,7 +356,7 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<? extends ICompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 2); // don't propose to generate into team!!
@@ -374,7 +374,7 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append("\n");
buf.append(" callin String voo(int j, Boolean b) {\n");
buf.append(" return null;\n");
- buf.append(" }\n");
+ buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
String expected1= buf.toString();
@@ -391,8 +391,8 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
String expected2= buf.toString();
-
- assertEqualStringsIgnoreOrder(new String[] { preview1, preview2 }, new String[] { expected1, expected2 });
+
+ assertEqualStringsIgnoreOrder(new String[] { preview1, preview2 }, new String[] { expected1, expected2 });
}
// non-static non-callin method created (base side)
@@ -405,7 +405,7 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append("public class B {\n");
buf.append("}\n");
pack1.createCompilationUnit("B.java", buf.toString(), false, null);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public team class T1 {\n");
@@ -413,11 +413,11 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append(" String voo(int j, Boolean b) <- replace String foo(int i, Boolean b);\n");
buf.append(" callin String voo(int j, Boolean b) {\n");
buf.append(" return base.voo(j, b);\n");
- buf.append(" }\n");
+ buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<? extends ICompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 2);
@@ -436,7 +436,7 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
String expected1 = buf.toString();
-
+
// remove signatures from callin voo<-foo
proposal= (CUCorrectionProposal) proposals.get(1);
String preview2= getPreviewContent(proposal);
@@ -448,12 +448,12 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append(" voo <- replace foo;\n");
buf.append(" callin String voo(int j, Boolean b) {\n");
buf.append(" return base.voo(j, b);\n");
- buf.append(" }\n");
+ buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
String expected2= buf.toString();
-
- assertEqualStringsIgnoreOrder(new String[] { preview1, preview2 }, new String[] { expected1, expected2 });
+
+ assertEqualStringsIgnoreOrder(new String[] { preview1, preview2 }, new String[] { expected1, expected2 });
}
// Bug 329988 - Quickfix method generation on missing replace callin method generates wrong method
// callin method created from short callin binding -> need to infer method signature
@@ -467,7 +467,7 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
pack1.createCompilationUnit("B.java", buf.toString(), false, null);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public team class T1 {\n");
@@ -476,7 +476,7 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<? extends ICompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 1); // don't propose to generate into team!!
@@ -493,7 +493,7 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append("\n");
buf.append(" callin String voo(int i, Boolean boolean1) {\n");
buf.append(" return null;\n");
- buf.append(" }\n");
+ buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
assertEqualString(preview, buf.toString());
@@ -509,7 +509,7 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append("public class B {\n");
buf.append("}\n");
pack1.createCompilationUnit("B.java", buf.toString(), false, null);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public team class T1 {\n");
@@ -517,11 +517,11 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append(" voo <- replace foo;\n");
buf.append(" callin String voo(int j, Boolean flag) {\n");
buf.append(" return base.voo(j, flag);\n");
- buf.append(" }\n");
+ buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<? extends ICompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 1);
@@ -554,7 +554,7 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
pack1.createCompilationUnit("B.java", buf.toString(), false, null);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public team class T1 {\n");
@@ -564,7 +564,7 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append(" public class R2 playedBy B {}\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<? extends ICompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 1); // don't propose to generate into team!!
@@ -581,12 +581,12 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append("\n");
buf.append(" callin R1 voo(int i, R1 r1) {\n");
buf.append(" return null;\n");
- buf.append(" }\n");
+ buf.append(" }\n");
buf.append(" }\n");
buf.append(" public class R2 playedBy B {}\n");
buf.append("}\n");
assertEqualString(preview, buf.toString());
-
+
LinkedProposalModel linkedProposalModel = new ProposalAdaptor().getLinkedProposalModel(proposal);
assertLinkedTypeProposals(linkedProposalModel, "arg_type_1", new String[]{"R1", "R2", "B"});
assertLinkedTypeProposals(linkedProposalModel, "type", new String[]{"R1", "R2", "B"});
@@ -613,7 +613,7 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append("public class B {\n");
buf.append("}\n");
pack1.createCompilationUnit("B.java", buf.toString(), false, null);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public team class T1 {\n");
@@ -623,7 +623,7 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<? extends ICompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 1);
@@ -643,7 +643,7 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
-
+
// Bug 329988 - Quickfix method generation on missing replace callin method generates wrong method
// missing base method created (short callout binding) - translation involved
@@ -655,7 +655,7 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append("public class B {\n");
buf.append("}\n");
pack1.createCompilationUnit("B.java", buf.toString(), false, null);
-
+
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public team class T1 {\n");
@@ -665,7 +665,7 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu);
ArrayList<? extends ICompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 1);
@@ -721,7 +721,7 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append(" A a= new A(i);\n");
buf.append(" }\n");
buf.append("}\n");
- String expected1= buf.toString();
+ String expected1= buf.toString();
proposal= (CUCorrectionProposal) proposals.get(1);
String preview2= getPreviewContent(proposal);
@@ -735,14 +735,14 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append(" A a= new A();\n");
buf.append(" }\n");
buf.append("}\n");
- String expected2= buf.toString();
-
- assertEqualStringsIgnoreOrder(new String[] { preview1, preview2 }, new String[] { expected1, expected2 });
+ String expected2= buf.toString();
+
+ assertEqualStringsIgnoreOrder(new String[] { preview1, preview2 }, new String[] { expected1, expected2 });
}
/* some orig tests for use in OT-variants:
- *
-
+ *
+
@Test
public void testConstructorInvocation() throws Exception {
IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
@@ -754,7 +754,7 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu1=pack1.createCompilationUnit("E.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu1);
ArrayList proposals= collectCorrections(cu1, astRoot);
assertNumberOfProposals(proposals, 1);
@@ -771,14 +771,14 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append(" }\n");
buf.append("\n");
buf.append(" public E(int i, boolean b) {\n");
- buf.append(" }\n");
+ buf.append(" }\n");
buf.append("}\n");
String expected1= buf.toString();
-
+
assertEqualString(preview1, expected1);
}
-
-
+
+
@Test
public void testSuperMethodInvocation() throws Exception {
IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
@@ -796,7 +796,7 @@ public class UnresolvedMethodsQuickFixTest extends OTQuickFixTest {
buf.append("public class A {\n");
buf.append("}\n");
pack1.createCompilationUnit("A.java", buf.toString(), false, null);
-
+
CompilationUnit astRoot= getASTRoot(cu1);
ArrayList proposals= collectCorrections(cu1, astRoot);
assertNumberOfProposals(proposals, 1);
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/rule/ProjectTestSetup.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/rule/ProjectTestSetup.java
index fada31e4b..9cc6e95fa 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/rule/ProjectTestSetup.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/rule/ProjectTestSetup.java
@@ -84,7 +84,7 @@ public class ProjectTestSetup extends ExternalResource {
javaProject.setRawClasspath(getDefaultClasspath(), null);
:giro */
IJavaProject javaProject= org.eclipse.objectteams.otdt.ui.tests.util.JavaProjectHelper.createOTJavaProject(PROJECT_NAME, "bin");
- JavaProjectHelper.addRTJar(javaProject);
+ JavaProjectHelper.addRTJar(javaProject);
//gbr}
TestOptions.initializeProjectOptions(javaProject);
return javaProject;
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/AllTests.java
index 5e3f11acf..938f248a1 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/AllTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/Comparator.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/Comparator.java
index 9d0dcf06b..cc245a27f 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/Comparator.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/Comparator.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/ITypeComparator.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/ITypeComparator.java
index 7d7393d2f..6ffed618a 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/ITypeComparator.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/ITypeComparator.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/OTSubHierarchyContentProviderTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/OTSubHierarchyContentProviderTests.java
index 1d17f277f..f43138ec1 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/OTSubHierarchyContentProviderTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/OTSubHierarchyContentProviderTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -44,10 +44,10 @@ import org.eclipse.objectteams.otdt.ui.tests.FileBasedUITest;
public class OTSubHierarchyContentProviderTests extends FileBasedUITest
{
private static final String FAKED_PLUGIN_ID = "org.eclipse.objectteams.otdt.tests";
-
+
private static final String PROJECT_DIR = "Hierarchy";
private static final String SRC_FOLDER = "src";
-
+
private SubTypeHierarchyViewer.SubTypeHierarchyContentProvider _testObject;
//call doHierarchyRefresh(IJavaElement element, null) on _lifeCycle
//to create a hierarchy on element.
@@ -61,34 +61,34 @@ public class OTSubHierarchyContentProviderTests extends FileBasedUITest
private IType _T6;
private IType _T7;
private IType _T8;
-
+
private IType _T1_R1;
// private IType _T1_R2; not within the cone of types reachable from _T1_R1
-
+
private IType _T2_R1;
private IType _T2_R2;
-
+
private IType _T3_R1;
private IType _T3_R2;
-
+
private IType _T4_R2;
-
+
private IType _T5_R1;
private IType _T5_R2;
private IType _T5_R3;
-
+
private IType _T6_R1;
-
+
private IType _T7_R2;
private IType _T7_R3;
-
+
private IType _T8_R2;
-
+
private IType _objectType;
private IType[] _allTypesInProject;
-
+
public OTSubHierarchyContentProviderTests(String name)
{
super(name);
@@ -96,11 +96,11 @@ public class OTSubHierarchyContentProviderTests extends FileBasedUITest
protected String getPluginID()
{
- //overwrites the ID because tests are using the
+ //overwrites the ID because tests are using the
//workspace of org.eclipse.objectteams.otdt.tests
return FAKED_PLUGIN_ID;
}
-
+
public static Test suite()
{
if (true)
@@ -111,66 +111,66 @@ public class OTSubHierarchyContentProviderTests extends FileBasedUITest
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir(PROJECT_DIR);
-
+
super.setUpSuite();
waitUntilIndexesReady();
-
+
String pkg = "test001";
- _T1 =
+ _T1 =
getType(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T1");
-
- _T2 =
+
+ _T2 =
getType(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T2");
- _T3 =
+ _T3 =
getType(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T3");
-
- _T4 =
+
+ _T4 =
getType(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T4");
- _T5 =
+ _T5 =
getType(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T5");
- _T6 =
+ _T6 =
getType(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T6");
-
- _T7 =
+
+ _T7 =
getType(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T7");
- _T8 =
+ _T8 =
getType(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T8");
-
+
_T1_R1 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
@@ -184,90 +184,90 @@ public class OTSubHierarchyContentProviderTests extends FileBasedUITest
pkg,
"T2",
"R1").getCorrespondingJavaElement();
-
+
_T2_R2 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T2",
"R2").getCorrespondingJavaElement();
-
+
_T3_R1 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T3",
"R1").getCorrespondingJavaElement();
-
+
_T3_R2 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T3",
"R2").getCorrespondingJavaElement();
-
+
_T4_R2 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T4",
"R2").getCorrespondingJavaElement();
-
+
_T5_R1 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T5",
"R1").getCorrespondingJavaElement();
-
+
_T5_R2 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T5",
"R2").getCorrespondingJavaElement();
-
+
_T5_R3 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T5",
"R3").getCorrespondingJavaElement();
-
+
_T6_R1 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T6",
"R1").getCorrespondingJavaElement();
-
+
_T7_R2 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T7",
"R2").getCorrespondingJavaElement();
-
+
_T7_R3 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T7",
"R3").getCorrespondingJavaElement();
-
+
_T8_R2 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T8",
"R2").getCorrespondingJavaElement();
-
+
_objectType = getType(getTestProjectDir(), "rt.jar", "java.lang", "Object");
-
+
_allTypesInProject = new IType[]
{
_T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8,
- _T1_R1, //_T1_R2,
+ _T1_R1, //_T1_R2,
_T2_R1, _T2_R2,
_T3_R1, _T3_R2,
_T4_R2,
@@ -277,7 +277,7 @@ public class OTSubHierarchyContentProviderTests extends FileBasedUITest
_T8_R2
};
_lifeCycle = new TypeHierarchyLifeCycle(false);
- _testObject =
+ _testObject =
new SubTypeHierarchyViewer.SubTypeHierarchyContentProvider(
_lifeCycle);
_lifeCycle.doHierarchyRefresh(new IType[]{_T1_R1}, new NullProgressMonitor());
@@ -288,12 +288,12 @@ public class OTSubHierarchyContentProviderTests extends FileBasedUITest
ITypeHierarchy hierarchy = _lifeCycle.getHierarchy();
assertNotNull(hierarchy);
}
-
+
public void testGetParent()
{
Object actual;
Map<IType, IType> parents = getParentMap();
-
+
for (int idx = 0; idx < _allTypesInProject.length; idx++)
{
IType cur = _allTypesInProject[idx];
@@ -317,25 +317,25 @@ public class OTSubHierarchyContentProviderTests extends FileBasedUITest
parents.put(_T7_R2, _T5_R2);
parents.put(_T7_R3, _T5_R3);
parents.put(_T8_R2, _T2_R2);
-
+
parents.put(_T2_R2, _T2_R1); // since T1$R2 is outside the cone of T1$R1 we see T2$R2 below its explicit super
return parents;
}
-
+
public void testRecursiveGetChildren_T1R1()
{
TreeNode actualRoot;
TreeNode expectedRoot;
-
+
//pretty ugly, maybe replace this with an automatic hierarchy creation
- //that generates the hierarchy according to some String or with the help
+ //that generates the hierarchy according to some String or with the help
//of an array of types that denotes a path :-I
expectedRoot = new TreeNode(_T1_R1);
-
+
expectedRoot.setChildrenByElements(new Object[] {_T2_R1});
-
+
expectedRoot.getChildNode(_T2_R1).setChildrenByElements(new Object[] {_T2_R2, _T3_R1, _T5_R1, _T6_R1}); // T4$R2 is not a direct child of T2$R1
-
+
expectedRoot.getChildNode(_T2_R1).getChildNode(_T2_R2).setChildrenByElements(new Object[] {_T3_R2, _T4_R2, _T5_R2, _T8_R2}); // include T8$R2: indirect via phantom and tsub
expectedRoot.getChildNode(_T2_R1).getChildNode(_T3_R1).setChildrenByElements(new Object[] {_T3_R2});
expectedRoot.getChildNode(_T2_R1).getChildNode(_T5_R1).setChildrenByElements(new Object[] {_T5_R3}); // don't include T7$R3: indirect via phantom and extends
@@ -344,26 +344,26 @@ public class OTSubHierarchyContentProviderTests extends FileBasedUITest
expectedRoot.getChildNode(_T2_R1).getChildNode(_T2_R2).getChildNode(_T5_R2).setChildrenByElements(new Object[] {_T7_R2});
expectedRoot.getChildNode(_T2_R1).getChildNode(_T5_R1).getChildNode(_T5_R3).setChildrenByElements(new Object[] {_T7_R3, _T5_R2});
expectedRoot.getChildNode(_T2_R1).getChildNode(_T5_R1).getChildNode(_T5_R3).getChildNode(_T7_R3).setChildrenByElements(new Object[] {_T7_R2});
-
-// already rooted under T5$R2
+
+// already rooted under T5$R2
// expectedRoot.getChildNode(_T2_R1).getChildNode(_T5_R1).getChildNode(_T5_R3).getChildNode(_T7_R3).setChildrenByElements(new Object[] {_T7_R2});
expectedRoot.getChildNode(_T2_R1).getChildNode(_T5_R1).getChildNode(_T5_R3).getChildNode(_T5_R2).setChildrenByElements(new Object[] {_T7_R2});
// T2$R2 is not a sub of T6$R1!
// expectedRoot.getChildNode(_T2_R1).getChildNode(_T6_R1).getChildNode(_T2_R2).setChildrenByElements(new Object[] {_T3_R2, _T5_R2, _T4_R2, _T8_R2});
// expectedRoot.getChildNode(_T2_R1).getChildNode(_T6_R1).getChildNode(_T2_R2).getChildNode(_T5_R2).setChildrenByElements(new Object[]{_T7_R2});
-
+
actualRoot = fillTree(_testObject, new TreeNode(_T1_R1));
-
+
assertTrue("Hierarchy trees don't match", expectedRoot.equalsAsserted(actualRoot, new ITypeComparator(), 0));
}
-
+
// this test indirectly asserts symmetry between getChildren() and getParent()
public void testRecursiveGetChildren_againstParentMap_T1R1()
{
TreeNode actualRoot;
TreeNode expectedRoot;
-
+
expectedRoot = new TreeNode(_T1_R1);
Map<IType, IType> parentMap = getParentMap();
@@ -388,15 +388,15 @@ public class OTSubHierarchyContentProviderTests extends FileBasedUITest
expectedRoot.findNode(_T3_R1).addChild(expectedRoot.findNode(_T3_R2)); // already reachable via T2$R2
actualRoot = fillTree(_testObject, new TreeNode(_T1_R1));
-
+
assertTrue("Hierarchy trees don't match", expectedRoot.equalsAsserted(actualRoot, new ITypeComparator(), 0));
}
-
+
private TreeNode fillTree(ITreeContentProvider contentProvider, TreeNode curNode)
{
Object[] children = contentProvider.getChildren(curNode.getElement());
TreeNode[] treeChildren = curNode.setChildrenByElements(children);
-
+
for (int idx = 0; idx < treeChildren.length; idx++)
{
fillTree(contentProvider, treeChildren[idx]);
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/SuperHierarchyContentProviderTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/SuperHierarchyContentProviderTests.java
index 0bda3d5bf..74c11e707 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/SuperHierarchyContentProviderTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/SuperHierarchyContentProviderTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -40,15 +40,15 @@ import org.eclipse.objectteams.otdt.ui.tests.FileBasedUITest;
public class SuperHierarchyContentProviderTests extends FileBasedUITest
{
private static final String FAKED_PLUGIN_ID = "org.eclipse.objectteams.otdt.tests";
-
+
private static final String PROJECT_DIR = "Hierarchy";
private static final String SRC_FOLDER = "src";
-
+
private SuperTypeHierarchyViewer.SuperTypeHierarchyContentProvider _testObject;
//call doHierarchyRefresh(IJavaElement element, null) on _lifeCycle
//to create a hierarchy on element.
private TypeHierarchyLifeCycle _lifeCycle;
-
+
private IType _objectType;
private IType _T1;
@@ -59,32 +59,32 @@ public class SuperHierarchyContentProviderTests extends FileBasedUITest
private IType _T6;
private IType _T7;
private IType _T8;
-
+
private IType _T1_R1;
private IType _T1_R2;
-
+
private IType _T2_R1;
private IType _T2_R2;
-
+
private IType _T3_R1;
private IType _T3_R2;
-
+
private IType _T4_R2;
-
+
private IType _T5_R1;
private IType _T5_R2;
private IType _T5_R3;
-
+
private IType _T6_R1;
-
+
private IType _T7_R2;
private IType _T7_R3;
-
+
private IType _T8_R2;
-
+
private IType[] _allTypesInProject;
-
+
public SuperHierarchyContentProviderTests(String name)
{
super(name);
@@ -92,11 +92,11 @@ public class SuperHierarchyContentProviderTests extends FileBasedUITest
protected String getPluginID()
{
- //overwrites the ID because tests are using the
+ //overwrites the ID because tests are using the
//workspace of org.eclipse.objectteams.otdt.tests
return FAKED_PLUGIN_ID;
}
-
+
public static Test suite()
{
if (true)
@@ -107,175 +107,175 @@ public class SuperHierarchyContentProviderTests extends FileBasedUITest
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir(PROJECT_DIR);
-
+
super.setUpSuite();
-
-
+
+
String pkg = "test001";
- _T1 =
+ _T1 =
getType(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T1");
-
- _T2 =
+
+ _T2 =
getType(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T2");
- _T3 =
+ _T3 =
getType(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T3");
-
- _T4 =
+
+ _T4 =
getType(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T4");
- _T5 =
+ _T5 =
getType(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T5");
- _T6 =
+ _T6 =
getType(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T6");
-
- _T7 =
+
+ _T7 =
getType(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T7");
- _T8 =
+ _T8 =
getType(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T8");
- _objectType =
+ _objectType =
getType(getTestProjectDir(),
"rt.jar",
"java.lang",
"Object");
-
+
_T1_R1 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T1",
"R1").getCorrespondingJavaElement();
-
+
_T1_R2 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T1",
"R2").getCorrespondingJavaElement();
-
+
_T2_R1 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T2",
"R1").getCorrespondingJavaElement();
-
+
_T2_R2 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T2",
"R2").getCorrespondingJavaElement();
-
+
_T3_R1 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T3",
"R1").getCorrespondingJavaElement();
-
+
_T3_R2 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T3",
"R2").getCorrespondingJavaElement();
-
+
_T4_R2 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T4",
"R2").getCorrespondingJavaElement();
-
+
_T5_R1 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T5",
"R1").getCorrespondingJavaElement();
-
+
_T5_R2 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T5",
"R2").getCorrespondingJavaElement();
-
+
_T5_R3 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T5",
"R3").getCorrespondingJavaElement();
-
+
_T6_R1 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T6",
"R1").getCorrespondingJavaElement();
-
+
_T7_R2 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T7",
"R2").getCorrespondingJavaElement();
-
+
_T7_R3 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T7",
"R3").getCorrespondingJavaElement();
-
+
_T8_R2 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T8",
"R2").getCorrespondingJavaElement();
-
-
+
+
_allTypesInProject = new IType[]
{
_T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8,
- _T1_R1, _T1_R2,
+ _T1_R1, _T1_R2,
_T2_R1, _T2_R2,
_T3_R1, _T3_R2,
_T4_R2,
@@ -285,7 +285,7 @@ public class SuperHierarchyContentProviderTests extends FileBasedUITest
_T8_R2
};
_lifeCycle = new TypeHierarchyLifeCycle(true);
- _testObject =
+ _testObject =
new SuperTypeHierarchyViewer.SuperTypeHierarchyContentProvider(
_lifeCycle);
@@ -299,18 +299,18 @@ public class SuperHierarchyContentProviderTests extends FileBasedUITest
fail("JavaModelException while refreshing hierarchy");
}
}
-
+
public void testHierarchyCreated()
{
ITypeHierarchy hierarchy = _lifeCycle.getHierarchy();
assertNotNull(hierarchy);
}
-
+
public void testGetParentAlwaysNull()
{
Object expected = null;
Object actual;
-
+
for (int idx = 0; idx < _allTypesInProject.length; idx++)
{
IType cur = _allTypesInProject[idx];
@@ -318,7 +318,7 @@ public class SuperHierarchyContentProviderTests extends FileBasedUITest
assertEquals("Parent not null for " + cur.getElementName() + " ", expected, actual);
}
}
-
+
public void testGetChildren_T5R3()
{
IType[] expected = new IType[]{ _T5_R1 };
@@ -334,7 +334,7 @@ public class SuperHierarchyContentProviderTests extends FileBasedUITest
_lifeCycle.doHierarchyRefresh(new IType[]{_T3_R2}, new NullProgressMonitor());
IType[] expected = new IType[]{ _T3_R1, _T2_R2 };
IType[] actual = castToIType(_testObject.getChildren(_T3_R2));
-
+
assertTrue("Wrong supertypes", compareTypes(expected, actual));
}
catch (JavaModelException exc)
@@ -353,7 +353,7 @@ public class SuperHierarchyContentProviderTests extends FileBasedUITest
_lifeCycle.doHierarchyRefresh(new IType[]{_T1_R2}, new NullProgressMonitor());
IType[] expected = new IType[]{ _objectType };
IType[] actual = castToIType(_testObject.getChildren(_T1_R2));
-
+
assertTrue("Wrong supertypes", compareTypes(expected, actual));
}
catch (JavaModelException exc)
@@ -373,7 +373,7 @@ public class SuperHierarchyContentProviderTests extends FileBasedUITest
_lifeCycle.doHierarchyRefresh(new IType[]{_T8_R2}, new NullProgressMonitor());
IType[] expected = new IType[]{ _T6_R1, _T2_R2 };
IType[] actual = castToIType(_testObject.getChildren(_T8_R2));
-
+
assertTrue("Wrong supertypes", compareTypes(expected, actual));
}
catch (JavaModelException exc)
@@ -385,7 +385,7 @@ public class SuperHierarchyContentProviderTests extends FileBasedUITest
}
}
-
+
public void testRecursiveGetChildren_T7R3() throws JavaModelException
{
try
@@ -393,28 +393,28 @@ public class SuperHierarchyContentProviderTests extends FileBasedUITest
_lifeCycle.doHierarchyRefresh(new IType[]{_T7_R3}, new NullProgressMonitor());
TreeNode actualRoot;
TreeNode expectedRoot;
-
+
//pretty ugly, maybe replace this with an automatic hierarchy creation
- //that generates the hierarchy according to some String or with the help
+ //that generates the hierarchy according to some String or with the help
//of an array of types that denotes a path :-I
expectedRoot = new TreeNode(_T7_R3);
-
+
expectedRoot.setChildrenByElements(new Object[] {_T5_R1, _T5_R3});
expectedRoot.getChildNode(_T5_R1).setChildrenByElements(new Object[] {_T2_R1, _objectType});
expectedRoot.getChildNode(_T5_R3).setChildrenByElements(new Object[] {_T5_R1});
-
+
expectedRoot.getChildNode(_T5_R1).getChildNode(_T2_R1).setChildrenByElements(new Object[] {_T1_R1, _objectType});
expectedRoot.getChildNode(_T5_R3).getChildNode(_T5_R1).setChildrenByElements(new Object[] {_T2_R1, _objectType});
-
+
expectedRoot.getChildNode(_T5_R3).getChildNode(_T5_R1).getChildNode(_T2_R1).setChildrenByElements(new Object[] {_T1_R1, _objectType});
-
+
expectedRoot.getChildNode(_T5_R1).getChildNode(_T2_R1).getChildNode(_T1_R1).setChildrenByElements(new Object[] {_objectType});
-
+
expectedRoot.getChildNode(_T5_R3).getChildNode(_T5_R1).getChildNode(_T2_R1).getChildNode(_T1_R1).setChildrenByElements(new Object[] {_objectType});
-
-
+
+
actualRoot = fillTree(_testObject, new TreeNode(_T7_R3));
-
+
assertTrue("Hierarchy trees don't match", expectedRoot.equalsAsserted(actualRoot, new ITypeComparator(), 0));
}
catch (JavaModelException exc)
@@ -424,7 +424,7 @@ public class SuperHierarchyContentProviderTests extends FileBasedUITest
} finally {
_lifeCycle.doHierarchyRefresh(new IType[]{_T5_R3}, new NullProgressMonitor());
}
-
+
}
// test looks quite incomplete!?
@@ -442,19 +442,19 @@ public class SuperHierarchyContentProviderTests extends FileBasedUITest
//
// assertTrue("Wrong methods", false);
// }
-
+
private TreeNode fillTree(ITreeContentProvider contentProvider, TreeNode curNode)
{
Object[] children = contentProvider.getChildren(curNode.getElement());
TreeNode[] treeChildren = curNode.setChildrenByElements(children);
-
+
for (int idx = 0; idx < treeChildren.length; idx++)
{
fillTree(contentProvider, treeChildren[idx]);
}
return curNode;
}
-
+
private IType[] castToIType(Object[] types)
{
if(types == null)
@@ -462,7 +462,7 @@ public class SuperHierarchyContentProviderTests extends FileBasedUITest
return null;
}
IType[] result = new IType[types.length];
-
+
for (int idx = 0; idx < types.length; idx++)
{
result[idx] = (IType)types[idx];
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/TraditionalHierarchyContentProviderTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/TraditionalHierarchyContentProviderTests.java
index f9e64cf2a..fc84e9326 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/TraditionalHierarchyContentProviderTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/TraditionalHierarchyContentProviderTests.java
@@ -1,11 +1,11 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@
*
* SPDX-License-Identifier: EPL-2.0
* $Id$
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -40,15 +40,15 @@ import junit.framework.Test;
public class TraditionalHierarchyContentProviderTests extends FileBasedUITest
{
private static final String FAKED_PLUGIN_ID = "org.eclipse.objectteams.otdt.tests";
-
+
private static final String PROJECT_DIR = "Hierarchy";
private static final String SRC_FOLDER = "src";
-
+
private TraditionalHierarchyContentProvider _testObject;
//call doHierarchyRefresh(IJavaElement element, null) on _lifeCycle
//to create a hierarchy on element.
private TypeHierarchyLifeCycle _lifeCycle;
-
+
private IType _objectType;
private IType _T1;
@@ -59,32 +59,32 @@ public class TraditionalHierarchyContentProviderTests extends FileBasedUITest
private IType _T6;
private IType _T7;
private IType _T8;
-
+
private IType _T1_R1;
private IType _T1_R2;
-
+
private IType _T2_R1;
private IType _T2_R2;
-
+
private IType _T3_R1;
private IType _T3_R2;
-
+
private IType _T4_R2;
-
+
private IType _T5_R1;
private IType _T5_R2;
private IType _T5_R3;
-
+
private IType _T6_R1;
-
+
private IType _T7_R2;
private IType _T7_R3;
-
+
private IType _T8_R2;
-
+
private IType[] _allTypesInProject;
-
+
public TraditionalHierarchyContentProviderTests(String name)
{
super(name);
@@ -92,11 +92,11 @@ public class TraditionalHierarchyContentProviderTests extends FileBasedUITest
protected String getPluginID()
{
- //overwrites the ID because tests are using the
+ //overwrites the ID because tests are using the
//workspace of org.eclipse.objectteams.otdt.tests
return FAKED_PLUGIN_ID;
}
-
+
public static Test suite()
{
if (true)
@@ -107,16 +107,16 @@ public class TraditionalHierarchyContentProviderTests extends FileBasedUITest
.getName());
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir(PROJECT_DIR);
-
- super.setUpSuite();
-
+
+ super.setUpSuite();
+
initializeTypes();
_lifeCycle = new TypeHierarchyLifeCycle(true);
- _testObject =
+ _testObject =
new TraditionalHierarchyViewer.TraditionalHierarchyContentProvider(_lifeCycle);
}
@@ -124,165 +124,165 @@ public class TraditionalHierarchyContentProviderTests extends FileBasedUITest
private void initializeTypes() throws JavaModelException {
String pkg = "test001";
- _T1 =
+ _T1 =
getType(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T1");
-
- _T2 =
+
+ _T2 =
getType(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T2");
- _T3 =
+ _T3 =
getType(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T3");
-
- _T4 =
+
+ _T4 =
getType(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T4");
- _T5 =
+ _T5 =
getType(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T5");
- _T6 =
+ _T6 =
getType(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T6");
-
- _T7 =
+
+ _T7 =
getType(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T7");
- _T8 =
+ _T8 =
getType(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T8");
- _objectType =
+ _objectType =
getType(getTestProjectDir(),
"rt.jar",
"java.lang",
"Object");
-
+
_T1_R1 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T1",
"R1").getCorrespondingJavaElement();
-
+
_T1_R2 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T1",
"R2").getCorrespondingJavaElement();
-
+
_T2_R1 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T2",
"R1").getCorrespondingJavaElement();
-
+
_T2_R2 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T2",
"R2").getCorrespondingJavaElement();
-
+
_T3_R1 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T3",
"R1").getCorrespondingJavaElement();
-
+
_T3_R2 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T3",
"R2").getCorrespondingJavaElement();
-
+
_T4_R2 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T4",
"R2").getCorrespondingJavaElement();
-
+
_T5_R1 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T5",
"R1").getCorrespondingJavaElement();
-
+
_T5_R2 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T5",
"R2").getCorrespondingJavaElement();
-
+
_T5_R3 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T5",
"R3").getCorrespondingJavaElement();
-
+
_T6_R1 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T6",
"R1").getCorrespondingJavaElement();
-
+
_T7_R2 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T7",
"R2").getCorrespondingJavaElement();
-
+
_T7_R3 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T7",
"R3").getCorrespondingJavaElement();
-
+
_T8_R2 = (IType)
getRole(getTestProjectDir(),
SRC_FOLDER,
pkg,
"T8",
"R2").getCorrespondingJavaElement();
-
-
+
+
_allTypesInProject = new IType[]
{
_T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8,
- _T1_R1, _T1_R2,
+ _T1_R1, _T1_R2,
_T2_R1, _T2_R2,
_T3_R1, _T3_R2,
_T4_R2,
@@ -301,9 +301,9 @@ public class TraditionalHierarchyContentProviderTests extends FileBasedUITest
{
exc.printStackTrace();
fail("JavaModelException while refreshing hierarchy");
- }
+ }
}
-
+
IType[] getParentChain_T5R2() {
return new IType[] { _T2_R2, _T1_R2, _T5_R3, _T5_R1, _T2_R1, _T1_R1, _objectType };
}
@@ -312,7 +312,7 @@ public class TraditionalHierarchyContentProviderTests extends FileBasedUITest
{
IType current = _T5_R2;
setHierarchyFocus(current);
-
+
IType[] expected = getParentChain_T5R2();
int i=0;
while ((current = (IType) _testObject.getParent(current)) != null) {
@@ -327,8 +327,8 @@ public class TraditionalHierarchyContentProviderTests extends FileBasedUITest
setHierarchyFocus(current);
_T2_R2 = _T1_R2 = _T5_R3 = _T5_R1 = _T2_R1 = _T1_R1 = _objectType = null;
System.gc();
- initializeTypes();
-
+ initializeTypes();
+
IType[] expected = getParentChain_T5R2();
int i=0;
while ((current = (IType) _testObject.getParent(current)) != null) {
@@ -339,7 +339,7 @@ public class TraditionalHierarchyContentProviderTests extends FileBasedUITest
public void testPathToT5R2()
{
setHierarchyFocus(_T5_R2);
-
+
IType[] expected = getParentChain_T5R2();
for (int i=expected.length-1; i>0; i--) {
IType[] subs = castToIType(_testObject.getChildren(expected[i]));
@@ -349,8 +349,8 @@ public class TraditionalHierarchyContentProviderTests extends FileBasedUITest
assertEquals("Unexpected child ("+i+"): "+actualType.getElementName(), expectedType, actualType);
}
}
-
-
+
+
private IType[] castToIType(Object[] types)
{
if(types == null)
@@ -358,7 +358,7 @@ public class TraditionalHierarchyContentProviderTests extends FileBasedUITest
return null;
}
IType[] result = new IType[types.length];
-
+
for (int idx = 0; idx < types.length; idx++)
{
result[idx] = (IType)types[idx];
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/TreeNode.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/TreeNode.java
index 1abb03ae4..015142225 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/TreeNode.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/hierarchy/contentprovider/TreeNode.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -32,9 +32,9 @@ import org.eclipse.objectteams.otdt.tests.FileBasedTest;
public class TreeNode
{
- private HashMap<Object, TreeNode> _children; //keys: elements, values: TreeNodes
+ private HashMap<Object, TreeNode> _children; //keys: elements, values: TreeNodes
private Object _element;
-
+
public TreeNode(Object element)
{
_element = element;
@@ -45,7 +45,7 @@ public class TreeNode
{
return _children.get(element);
}
-
+
public TreeNode[] setChildrenByElements(Object[] childrenElements)
{
if(childrenElements == null)
@@ -58,45 +58,45 @@ public class TreeNode
}
return getChildren();
}
-
+
public void addChildByElement(Object childElement) {
_children.put(childElement, new TreeNode(childElement));
}
-
+
public Object getElement()
{
return _element;
}
-
+
public TreeNode[] getChildren()
{
return _children.values().toArray(new TreeNode[_children.values().size()]);
}
-
+
public HashMap<Object, TreeNode> getChildrenMap()
{
return _children;
}
-
+
public Object[] getChildrenElements()
{
return _children.keySet().toArray();
}
-
+
public boolean equalsAsserted(TreeNode other, Comparator comp, int level)
{
if(!comp.same(_element, other.getElement()))
{
- FileBasedTest.assertTrue("This tree element " + _element
- + " is different from " + other.getElement()
+ FileBasedTest.assertTrue("This tree element " + _element
+ + " is different from " + other.getElement()
+ " at level: " + level, false);
return false;
}
-
+
HashMap<Object, TreeNode> othersChildren = other.getChildrenMap();
if(_children.size() != othersChildren.size())
{
- FileBasedTest.assertEquals("this: " + _element + ", other: " + other.getElement() + " at level: "
+ FileBasedTest.assertEquals("this: " + _element + ", other: " + other.getElement() + " at level: "
+ level, _children.size(), othersChildren.size());
return false;
}
@@ -142,7 +142,7 @@ public class TreeNode
public void addChild(TreeNode node) {
this._children.put(node.getElement(), node);
-
+
}
// facilitate debugging:
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/typecreator/AllInternalRoleCreationTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/typecreator/AllInternalRoleCreationTests.java
index ea81546a2..4b9354414 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/typecreator/AllInternalRoleCreationTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/typecreator/AllInternalRoleCreationTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -37,7 +37,7 @@ import junit.framework.TestSuite;
*/
public class AllInternalRoleCreationTests extends TestCase
{
- public AllInternalRoleCreationTests(String name)
+ public AllInternalRoleCreationTests(String name)
{
super(name);
}
@@ -49,7 +49,7 @@ public class AllInternalRoleCreationTests extends TestCase
org.eclipse.objectteams.otdt.ui.tests.typecreator.RoleCreationTests.class
};
}
-
+
public static TestSetting getActualTestSetting()
{
return new TestSetting("CreationTestProject", "internaldefinedrole", "teampkg");
@@ -73,7 +73,7 @@ public class AllInternalRoleCreationTests extends TestCase
try
{
TestDataHandler.addTestSetting(testClass, getActualTestSetting());
-
+
Method suiteMethod = testClass.getDeclaredMethod(
"suite", new Class[0]); //$NON-NLS-1$
Test suite = (Test) suiteMethod.invoke(null, new Object[0]);
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/typecreator/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/typecreator/AllTests.java
index c016af76e..d4e6b3410 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/typecreator/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/typecreator/AllTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/typecreator/NewTeamWizardPageListenerTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/typecreator/NewTeamWizardPageListenerTest.java
index edccc34fb..608574839 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/typecreator/NewTeamWizardPageListenerTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/typecreator/NewTeamWizardPageListenerTest.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -34,7 +34,7 @@ import org.eclipse.objectteams.otdt.internal.ui.wizards.listeners.NewTeamWizardP
public class NewTeamWizardPageListenerTest extends TestCase
{
private NewTeamWizardPage _teamWizardPage;
-
+
protected void setUp() throws Exception
{
super.setUp();
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/typecreator/RoleCreationTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/typecreator/RoleCreationTests.java
index 1e6dd2127..a692aafa4 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/typecreator/RoleCreationTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/typecreator/RoleCreationTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -52,10 +52,10 @@ public class RoleCreationTests extends FileBasedUITest
/*this test class contains tests for internal defined roles*/
private static boolean DOINLINE = true;
private static String SRC_FOLDER_NAME = "internaldefinedrole";
-
+
private RoleCreator _roleCreator;
-
+
public RoleCreationTests(String name)
{
super(name);
@@ -72,25 +72,25 @@ public class RoleCreationTests extends FileBasedUITest
Suite suite = new Suite(RoleCreationTests.class);
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("CreationTestProject");
super.setUpSuite();
}
-
+
protected void setUp() throws Exception
{
super.setUp();
_roleCreator = new RoleCreator();
}
-
+
@Override
protected void tearDown() throws Exception {
ICompilationUnit[] primaryWCs = JavaModelManager.getJavaModelManager().getWorkingCopies(DefaultWorkingCopyOwner.PRIMARY, false);
try {
assertEquals("All working copies should be discarded", 0, primaryWCs == null ? 0 : primaryWCs.length);
- } finally {
+ } finally {
if (primaryWCs != null)
for (int i = 0; i < primaryWCs.length; i++)
primaryWCs[i].discardWorkingCopy();
@@ -105,8 +105,8 @@ public class RoleCreationTests extends FileBasedUITest
// public void tearDownSuite()
// {
// //don't call super method, so created directory will not be deleted
-// }
-
+// }
+
private IType getJavaType(String projectName, String srcFolderName, String pkgName, String typeName) throws JavaModelException
{
ICompilationUnit typeUnit = getCompilationUnit(
@@ -115,13 +115,13 @@ public class RoleCreationTests extends FileBasedUITest
pkgName,
typeName +".java");
IType typeJavaElem = typeUnit.getType(typeName);
-
+
if ((typeJavaElem != null) && (typeJavaElem.exists()))
{
return typeJavaElem;
}
return null;
- }
+ }
/**
* This method tests the creation of a simple role class (no super role, no super interface, no base class)
@@ -136,29 +136,29 @@ public class RoleCreationTests extends FileBasedUITest
IPackageFragment pkgFrag = getPackageFragment(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg");
assertNotNull(pkgFragRoot);
assertNotNull(pkgFrag);
-
+
RoleTypeInfo typeInfo = new RoleTypeInfo("SimpleRole", pkgFragRoot, pkgFrag);
typeInfo.setEnclosingTypeName("teampkg.TeamForSimpleRole");
typeInfo.setInline(false);
-
+
assertNotNull(_roleCreator);
_roleCreator.setTypeInfo(typeInfo);
_roleCreator.createType(new NullProgressMonitor());
-
+
/*test of role existence and properties*/
IType enclosingTeamJavaElem = getJavaType(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg", "TeamForSimpleRole");
assertNotNull(enclosingTeamJavaElem);
-
+
IType roleJavaElem = getJavaType(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg.TeamForSimpleRole", "SimpleRole");
assertNotNull(roleJavaElem);
assertTrue(roleJavaElem.exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(roleJavaElem);
assertNotNull(roleOTElem);
assertTrue(roleOTElem.isRole());
}
-
+
/**
* This method tests the creation of a simple role class (no super role, no super interface, no base class)
* initially the role's hosting team already contains one role class
@@ -172,29 +172,29 @@ public class RoleCreationTests extends FileBasedUITest
IPackageFragment pkgFrag = getPackageFragment(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg");
assertNotNull(pkgFragRoot);
assertNotNull(pkgFrag);
-
+
RoleTypeInfo typeInfo = new RoleTypeInfo("SimpleRole", pkgFragRoot, pkgFrag);
typeInfo.setEnclosingTypeName("teampkg.TeamForSimpleRole_PreviouslyWithOneRole");
typeInfo.setInline(DOINLINE);
-
+
assertNotNull(_roleCreator);
_roleCreator.setTypeInfo(typeInfo);
_roleCreator.createType(new NullProgressMonitor());
-
+
/*test of role existence and properties*/
IType enclosingTeamJavaElem = getJavaType(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg", "TeamForSimpleRole_PreviouslyWithOneRole");
assertNotNull(enclosingTeamJavaElem);
-
+
IType roleJavaElem = enclosingTeamJavaElem.getType("SimpleRole");
assertNotNull(roleJavaElem);
assertTrue(roleJavaElem.exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(roleJavaElem);
assertNotNull(roleOTElem);
assertTrue(roleOTElem.isRole());
}
-
+
/**
* This method tests the creation of a simple role class (no super role, no super interface, no base class)
* initially the role's hosting team already contains several role classes
@@ -208,29 +208,29 @@ public class RoleCreationTests extends FileBasedUITest
IPackageFragment pkgFrag = getPackageFragment(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg");
assertNotNull(pkgFragRoot);
assertNotNull(pkgFrag);
-
+
RoleTypeInfo typeInfo = new RoleTypeInfo("SimpleRole", pkgFragRoot, pkgFrag);
typeInfo.setEnclosingTypeName("teampkg.TeamForSimpleRole_PreviouslyWithTwoRoles");
typeInfo.setInline(DOINLINE);
-
+
assertNotNull(_roleCreator);
_roleCreator.setTypeInfo(typeInfo);
_roleCreator.createType(new NullProgressMonitor());
-
+
/*test of role existence and properties*/
IType enclosingTeamJavaElem = getJavaType(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg", "TeamForSimpleRole_PreviouslyWithTwoRoles");
assertNotNull(enclosingTeamJavaElem);
-
+
IType roleJavaElem = enclosingTeamJavaElem.getType("SimpleRole");
assertNotNull(roleJavaElem);
assertTrue(roleJavaElem.exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(roleJavaElem);
assertNotNull(roleOTElem);
assertTrue(roleOTElem.isRole());
- }
-
+ }
+
/**
* This method tests the creation of a role class that has one super interface
* initially the role's hosting team class is empty
@@ -239,47 +239,47 @@ public class RoleCreationTests extends FileBasedUITest
CoreException
{
/*creation of role*/
-
+
IPackageFragmentRoot pkgFragRoot = getPackageFragmentRoot(getTestProjectDir(), SRC_FOLDER_NAME);
IPackageFragment pkgFrag = getPackageFragment(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg");
assertNotNull(pkgFragRoot);
assertNotNull(pkgFrag);
-
+
ArrayList<String> interfaceNameList = new ArrayList<String>();
- interfaceNameList.add("ordinarypkg.InterfaceWithOneMethod");
-
+ interfaceNameList.add("ordinarypkg.InterfaceWithOneMethod");
+
RoleTypeInfo typeInfo = new RoleTypeInfo("RoleWithOneSuperInterface", pkgFragRoot, pkgFrag);
typeInfo.setEnclosingTypeName("teampkg.TeamForRoleWithOneSuperInterface");
typeInfo.setInline(DOINLINE);
typeInfo.setSuperInterfacesNames(interfaceNameList);
-
+
assertNotNull(_roleCreator);
_roleCreator.setTypeInfo(typeInfo);
_roleCreator.createType(new NullProgressMonitor());
-
+
/*test of role existence and properties*/
-
+
IType enclosingTeamJavaElem = getJavaType(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg", "TeamForRoleWithOneSuperInterface");
assertNotNull(enclosingTeamJavaElem);
-
+
IType roleJavaElem = enclosingTeamJavaElem.getType("RoleWithOneSuperInterface");
assertNotNull(roleJavaElem);
assertTrue(roleJavaElem.exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(roleJavaElem);
assertNotNull(roleOTElem);
assertTrue(roleOTElem.isRole());
-
+
String[] interfaceNames = roleOTElem.getSuperInterfaceNames();
assertNotNull(interfaceNames);
assertTrue(interfaceNames.length == 1);
assertEquals("InterfaceWithOneMethod", interfaceNames[0]);
-
+
String[] interfacesSignatures = roleOTElem.getSuperInterfaceTypeSignatures();
assertNotNull(interfacesSignatures);
assertTrue(interfacesSignatures.length == 1);
assertEquals("QInterfaceWithOneMethod;", interfacesSignatures[0]);
- }
+ }
/**
* This method tests the creation of a role class that has several super interfaces
@@ -289,53 +289,53 @@ public class RoleCreationTests extends FileBasedUITest
CoreException
{
/*creation of role*/
-
+
IPackageFragmentRoot pkgFragRoot = getPackageFragmentRoot(getTestProjectDir(), SRC_FOLDER_NAME);
IPackageFragment pkgFrag = getPackageFragment(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg");
assertNotNull(pkgFragRoot);
assertNotNull(pkgFrag);
-
+
ArrayList<String> interfaceNameList = new ArrayList<String>();
interfaceNameList.add("ordinarypkg.InterfaceWithOneMethod");
interfaceNameList.add("ordinarypkg.InterfaceWithTwoMethods");
-
+
RoleTypeInfo typeInfo = new RoleTypeInfo("RoleWithSeveralSuperInterfaces", pkgFragRoot, pkgFrag);
typeInfo.setEnclosingTypeName("teampkg.TeamForRoleWithSeveralSuperInterfaces");
typeInfo.setInline(DOINLINE);
typeInfo.setSuperInterfacesNames(interfaceNameList);
-
+
assertNotNull(_roleCreator);
_roleCreator.setTypeInfo(typeInfo);
_roleCreator.createType(new NullProgressMonitor());
-
+
/*test of role existence and properties*/
-
+
IType enclosingTeamJavaElem = getJavaType(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg", "TeamForRoleWithSeveralSuperInterfaces");
assertNotNull(enclosingTeamJavaElem);
-
+
IType roleJavaElem = enclosingTeamJavaElem.getType("RoleWithSeveralSuperInterfaces");
assertNotNull(roleJavaElem);
assertTrue(roleJavaElem.exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(roleJavaElem);
assertNotNull(roleOTElem);
assertTrue(roleOTElem.isRole());
-
+
String[] interfaceNames = roleOTElem.getSuperInterfaceNames();
assertNotNull(interfaceNames);
assertTrue(interfaceNames.length > 0);
assertTrue(interfaceNames.length == 2);
assertEquals("InterfaceWithOneMethod", interfaceNames[0]);
assertEquals("InterfaceWithTwoMethods", interfaceNames[1]);
-
+
String[] interfacesSignatures = roleOTElem.getSuperInterfaceTypeSignatures();
assertNotNull(interfacesSignatures);
assertTrue(interfacesSignatures.length > 0);
assertTrue(interfacesSignatures.length == 2);
assertEquals("QInterfaceWithOneMethod;", interfacesSignatures[0]);
assertEquals("QInterfaceWithTwoMethods;", interfacesSignatures[1]);
- }
-
+ }
+
/**
* This method tests the creation of a role class that has one super interface
* the role class should contain the abstract method that it inherits from its super interface
@@ -345,129 +345,129 @@ public class RoleCreationTests extends FileBasedUITest
CoreException
{
/*creation of role*/
-
+
IPackageFragmentRoot pkgFragRoot = getPackageFragmentRoot(getTestProjectDir(), SRC_FOLDER_NAME);
IPackageFragment pkgFrag = getPackageFragment(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg");
assertNotNull(pkgFragRoot);
assertNotNull(pkgFrag);
-
+
ArrayList<String> interfaceNameList = new ArrayList<String>();
interfaceNameList.add("ordinarypkg.InterfaceWithOneMethod");
-
+
RoleTypeInfo typeInfo = new RoleTypeInfo("RoleWithSuperInterfaceAndInheritedMethod", pkgFragRoot, pkgFrag);
typeInfo.setEnclosingTypeName("teampkg.TeamForRoleWithOneSuperInterfaceAndInheritedMethod");
typeInfo.setInline(DOINLINE);
typeInfo.setSuperInterfacesNames(interfaceNameList);
typeInfo.setCreateAbstractInheritedMethods(true);
-
+
assertNotNull(_roleCreator);
_roleCreator.setTypeInfo(typeInfo);
_roleCreator.createType(new NullProgressMonitor());
-
+
/*test of role existence and properties*/
-
+
IType enclosingTeamJavaElem = getJavaType(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg", "TeamForRoleWithOneSuperInterfaceAndInheritedMethod");
assertNotNull(enclosingTeamJavaElem);
-
+
IType roleJavaElem = enclosingTeamJavaElem.getType("RoleWithSuperInterfaceAndInheritedMethod");
assertNotNull(roleJavaElem);
assertTrue(roleJavaElem.exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(roleJavaElem);
assertNotNull(roleOTElem);
assertTrue(roleOTElem.isRole());
-
+
String[] interfaceNames = roleOTElem.getSuperInterfaceNames();
assertNotNull(interfaceNames);
assertTrue(interfaceNames.length == 1);
assertEquals("InterfaceWithOneMethod", interfaceNames[0]);
-
+
String[] interfacesSignatures = roleOTElem.getSuperInterfaceTypeSignatures();
assertNotNull(interfacesSignatures);
assertTrue(interfacesSignatures.length == 1);
assertEquals("QInterfaceWithOneMethod;", interfacesSignatures[0]);
-
+
IMethod[] methods = roleJavaElem.getMethods();
assertNotNull(methods);
assertTrue(methods.length > 0);
assertTrue(methods.length == 1);
assertEquals("methodToImplement", methods[0].getElementName());
}
-
+
/**
* This method tests the creation of a role class that has several super interfaces
* the role class should contain all abstract methods that it inherits from its several super interfaces
* initially the role's hosting team class is empty
- */
+ */
public void testRoleCreation_WithSeveralSuperInterfacesAndInheritedMethods() throws InterruptedException,
CoreException
{
/*creation of role*/
-
+
IPackageFragmentRoot pkgFragRoot = getPackageFragmentRoot(getTestProjectDir(), SRC_FOLDER_NAME);
IPackageFragment pkgFrag = getPackageFragment(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg");
assertNotNull(pkgFragRoot);
assertNotNull(pkgFrag);
-
+
ArrayList<String> interfaceNameList = new ArrayList<String>();
interfaceNameList.add("ordinarypkg.InterfaceWithOneMethod");
interfaceNameList.add("ordinarypkg.InterfaceWithTwoMethods");
-
+
RoleTypeInfo typeInfo = new RoleTypeInfo("RoleWithSeveralSuperInterfacesAndInheritedMethods", pkgFragRoot, pkgFrag);
typeInfo.setEnclosingTypeName("teampkg.TeamForRoleWithSeveralSuperInterfacesAndInheritedMethods");
typeInfo.setInline(DOINLINE);
typeInfo.setSuperInterfacesNames(interfaceNameList);
typeInfo.setCreateAbstractInheritedMethods(true);
-
+
assertNotNull(_roleCreator);
_roleCreator.setTypeInfo(typeInfo);
_roleCreator.createType(new NullProgressMonitor());
-
+
/*test of role existence and properties*/
-
+
IType enclosingTeamJavaElem = getJavaType(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg", "TeamForRoleWithSeveralSuperInterfacesAndInheritedMethods");
assertNotNull(enclosingTeamJavaElem);
-
+
IType roleJavaElem = enclosingTeamJavaElem.getType("RoleWithSeveralSuperInterfacesAndInheritedMethods");
assertNotNull(roleJavaElem);
assertTrue(roleJavaElem.exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(roleJavaElem);
assertNotNull(roleOTElem);
assertTrue(roleOTElem.isRole());
-
+
String[] interfaceNames = roleOTElem.getSuperInterfaceNames();
assertNotNull(interfaceNames);
assertTrue(interfaceNames.length > 0);
assertTrue(interfaceNames.length == 2);
assertEquals("InterfaceWithOneMethod", interfaceNames[0]);
assertEquals("InterfaceWithTwoMethods", interfaceNames[1]);
-
+
String[] interfacesSignatures = roleOTElem.getSuperInterfaceTypeSignatures();
assertNotNull(interfacesSignatures);
assertTrue(interfacesSignatures.length > 0);
assertTrue(interfacesSignatures.length == 2);
assertEquals("QInterfaceWithOneMethod;", interfacesSignatures[0]);
assertEquals("QInterfaceWithTwoMethods;", interfacesSignatures[1]);
-
+
IMethod[] methods = roleJavaElem.getMethods();
assertNotNull(methods);
assertTrue(methods.length > 0);
assertTrue(methods.length == 3);
-
+
IMethod method = roleJavaElem.getMethod("methodToImplement", new String[0]);
assertNotNull(method);
assertTrue(method.exists());
-
+
method = roleJavaElem.getMethod("methodToImplementA", new String[0]);
assertNotNull(method);
assertTrue(method.exists());
-
+
method = roleJavaElem.getMethod("methodToImplementB", new String[0]);
assertNotNull(method);
assertTrue(method.exists());
- }
-
+ }
+
/**
* This method tests the creation of a role class that is bound to a base class
* the base class is an ordinary class
@@ -477,92 +477,92 @@ public class RoleCreationTests extends FileBasedUITest
CoreException
{
/*creation of role*/
-
+
IPackageFragmentRoot pkgFragRoot = getPackageFragmentRoot(getTestProjectDir(), SRC_FOLDER_NAME);
IPackageFragment pkgFrag = getPackageFragment(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg");
assertNotNull(pkgFragRoot);
assertNotNull(pkgFrag);
-
+
RoleTypeInfo typeInfo = new RoleTypeInfo("RoleWithOrdinaryBase", pkgFragRoot, pkgFrag);
typeInfo.setEnclosingTypeName("teampkg.TeamForRoleWithOrdinaryBase");
typeInfo.setInline(DOINLINE);
typeInfo.setBaseTypeName("ordinarypkg.EmptyClass");
-
+
assertNotNull(_roleCreator);
_roleCreator.setTypeInfo(typeInfo);
_roleCreator.createType(new NullProgressMonitor());
-
+
/*test of role existence and properties*/
-
+
IType enclosingTeamJavaElem = getJavaType(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg", "TeamForRoleWithOrdinaryBase");
assertNotNull(enclosingTeamJavaElem);
-
+
IType roleJavaElem = enclosingTeamJavaElem.getType("RoleWithOrdinaryBase");
assertNotNull(roleJavaElem);
assertTrue(roleJavaElem.exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(roleJavaElem);
assertNotNull(roleOTElem);
assertTrue(roleOTElem.isRole());
-
+
assertTrue(roleOTElem instanceof IRoleType);
IRoleType roleOTRoleElem = (IRoleType) roleOTElem;
IType baseJavaElem = roleOTRoleElem.getBaseClass();
-
+
assertNotNull(baseJavaElem);
assertEquals("ordinarypkg.EmptyClass", baseJavaElem.getFullyQualifiedName());
}
-
+
/**
* This method tests the creation of a role class that is bound to a base class
* the base class is a team class
* initially the role's hosting team class is empty
- */
+ */
public void testRoleCreation_WithTeamBase() throws InterruptedException,
CoreException
{
/*creation of role*/
-
+
IPackageFragmentRoot pkgFragRoot = getPackageFragmentRoot(getTestProjectDir(), SRC_FOLDER_NAME);
IPackageFragment pkgFrag = getPackageFragment(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg");
assertNotNull(pkgFragRoot);
assertNotNull(pkgFrag);
-
+
RoleTypeInfo typeInfo = new RoleTypeInfo("RoleWithTeamBase", pkgFragRoot, pkgFrag);
typeInfo.setEnclosingTypeName("teampkg.TeamForRoleWithTeamBase");
typeInfo.setInline(DOINLINE);
typeInfo.setBaseTypeName("teampkg.EmptyBaseTeam");
-
+
assertNotNull(_roleCreator);
_roleCreator.setTypeInfo(typeInfo);
_roleCreator.createType(new NullProgressMonitor());
-
+
/*test of role existence and properties*/
-
+
IType enclosingTeamJavaElem = getJavaType(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg", "TeamForRoleWithTeamBase");
assertNotNull(enclosingTeamJavaElem);
-
+
IType roleJavaElem = enclosingTeamJavaElem.getType("RoleWithTeamBase");
assertNotNull(roleJavaElem);
assertTrue(roleJavaElem.exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(roleJavaElem);
assertNotNull(roleOTElem);
assertTrue(roleOTElem.isRole());
-
+
assertTrue(roleOTElem instanceof IRoleType);
IRoleType roleOTRoleElem = (IRoleType) roleOTElem;
IType baseJavaElem = roleOTRoleElem.getBaseClass();
-
+
assertNotNull(baseJavaElem);
assertEquals("teampkg.EmptyBaseTeam", baseJavaElem.getFullyQualifiedName());
-
+
IOTType baseOTElem = OTModelManager.getOTElement(baseJavaElem);
assertNotNull(baseOTElem);
assertTrue(baseOTElem.isTeam());
- }
-
-
+ }
+
+
/**
* This method tests the creation of a role class that has an explicit superclass.
* The explicit superclass resides in the same team class as the newly created role class.
@@ -571,12 +571,12 @@ public class RoleCreationTests extends FileBasedUITest
CoreException
{
/*creation of role*/
-
+
IPackageFragmentRoot pkgFragRoot = getPackageFragmentRoot(getTestProjectDir(), SRC_FOLDER_NAME);
IPackageFragment pkgFrag = getPackageFragment(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg");
assertNotNull(pkgFragRoot);
assertNotNull(pkgFrag);
-
+
final String TEAM_CLASS_NAME = "TeamForRoleWithExplicitSuperclass_PreviouslyWithOneRole";
final String ROLE_CLASS_NAME = "RoleWithExplicitSuperClass";
@@ -585,16 +585,16 @@ public class RoleCreationTests extends FileBasedUITest
typeInfo.setInline(DOINLINE);
typeInfo.setSuperClassName("teampkg.TeamForRoleWithExplicitSuperclass_PreviouslyWithOneRole.SuperRole");
typeInfo.setCurrentType(pkgFrag.getCompilationUnit(TEAM_CLASS_NAME+".java").getType(ROLE_CLASS_NAME));
-
+
assertNotNull(_roleCreator);
_roleCreator.setTypeInfo(typeInfo);
_roleCreator.createType(new NullProgressMonitor());
-
+
/*test of role existence and properties*/
-
+
IType enclosingTeamJavaElem = getJavaType(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg", TEAM_CLASS_NAME);
assertNotNull(enclosingTeamJavaElem);
-
+
IType roleJavaElem = enclosingTeamJavaElem.getType(ROLE_CLASS_NAME);
assertNotNull(roleJavaElem);
assertTrue(roleJavaElem.exists());
@@ -602,59 +602,59 @@ public class RoleCreationTests extends FileBasedUITest
IOTType roleOTElem = OTModelManager.getOTElement(roleJavaElem);
assertNotNull(roleOTElem);
assertTrue(roleOTElem.isRole());
-
+
assertEquals("SuperRole", roleJavaElem.getSuperclassName());
assertEquals("QSuperRole;", roleJavaElem.getSuperclassTypeSignature());
}
-
-
+
+
/**
* This method tests the creation of a role class that has an explicit superclass.
* The explicit superclass does not reside in the same team class as the newly created role class,
- * but in a super team of that team.
+ * but in a super team of that team.
*/
public void testRoleCreation_WithExplicitSuperClass_FromSuperTeam() throws InterruptedException,
CoreException
{
/*creation of role*/
-
+
IPackageFragmentRoot pkgFragRoot = getPackageFragmentRoot(getTestProjectDir(), SRC_FOLDER_NAME);
IPackageFragment pkgFrag = getPackageFragment(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg");
assertNotNull(pkgFragRoot);
assertNotNull(pkgFrag);
-
+
final String TEAM_CLASS_NAME = "TeamForRoleWithExplicitSuperclass_PreviouslyEmpty";
final String ROLE_CLASS_NAME = "RoleWithExplicitSuperClass";
RoleTypeInfo typeInfo = new RoleTypeInfo(ROLE_CLASS_NAME, pkgFragRoot, pkgFrag);
typeInfo.setEnclosingTypeName("teampkg."+TEAM_CLASS_NAME);
typeInfo.setInline(DOINLINE);
-//TODO (kaschja) ??? must "teampkg.TeamWithRoleWithAbstractMethod.RoleWithAbstractMethod" be set as super role class ??? (because it is the team class where the super role comes from)
+//TODO (kaschja) ??? must "teampkg.TeamWithRoleWithAbstractMethod.RoleWithAbstractMethod" be set as super role class ??? (because it is the team class where the super role comes from)
typeInfo.setSuperClassName("teampkg.TeamForRoleWithExplicitSuperclass_PreviouslyEmpty.RoleWithAbstractMethod");
typeInfo.setCurrentType(pkgFrag.getCompilationUnit(TEAM_CLASS_NAME+".java").getType(ROLE_CLASS_NAME));
-
+
assertNotNull(_roleCreator);
_roleCreator.setTypeInfo(typeInfo);
_roleCreator.createType(new NullProgressMonitor());
-
+
/*test of role existence and properties*/
-
+
IType enclosingTeamJavaElem = getJavaType(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg", TEAM_CLASS_NAME);
assertNotNull(enclosingTeamJavaElem);
-
+
IType roleJavaElem = enclosingTeamJavaElem.getType(ROLE_CLASS_NAME);
assertNotNull(roleJavaElem);
assertTrue(roleJavaElem.exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(roleJavaElem);
assertNotNull(roleOTElem);
assertTrue(roleOTElem.isRole());
-
+
assertEquals("RoleWithAbstractMethod", roleJavaElem.getSuperclassName());
assertEquals("QRoleWithAbstractMethod;", roleJavaElem.getSuperclassTypeSignature());
}
-
-
+
+
/**
* This method tests the creation of a role class that has an explicit superclass.
* the role class should contain the abstract method that it inherits from its superclass
@@ -664,12 +664,12 @@ public class RoleCreationTests extends FileBasedUITest
CoreException
{
/*creation of role*/
-
+
IPackageFragmentRoot pkgFragRoot = getPackageFragmentRoot(getTestProjectDir(), SRC_FOLDER_NAME);
IPackageFragment pkgFrag = getPackageFragment(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg");
assertNotNull(pkgFragRoot);
assertNotNull(pkgFrag);
-
+
final String TEAM_CLASS_NAME = "TeamForRoleWithExplicitSuperclassAndInheritedMethod_PreviouslyWithOneRole";
final String ROLE_CLASS_NAME = "RoleWithExplicitSuperClassAndInheritedMethod";
@@ -679,35 +679,35 @@ public class RoleCreationTests extends FileBasedUITest
typeInfo.setSuperClassName("teampkg.TeamForRoleWithExplicitSuperclassAndInheritedMethod_PreviouslyWithOneRole.RoleWithAbstractMethod");
typeInfo.setCreateAbstractInheritedMethods(true);
typeInfo.setCurrentType(pkgFrag.getCompilationUnit(TEAM_CLASS_NAME+".java").getType(ROLE_CLASS_NAME));
-
+
assertNotNull(_roleCreator);
_roleCreator.setTypeInfo(typeInfo);
_roleCreator.createType(new NullProgressMonitor());
-
+
/*test of role existence and properties*/
-
+
IType enclosingTeamJavaElem = getJavaType(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg", TEAM_CLASS_NAME);
assertNotNull(enclosingTeamJavaElem);
-
+
IType roleJavaElem = enclosingTeamJavaElem.getType(ROLE_CLASS_NAME);
assertNotNull(roleJavaElem);
assertTrue(roleJavaElem.exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(roleJavaElem);
assertNotNull(roleOTElem);
assertTrue(roleOTElem.isRole());
-
+
assertEquals("RoleWithAbstractMethod", roleJavaElem.getSuperclassName());
assertEquals("QRoleWithAbstractMethod;", roleJavaElem.getSuperclassTypeSignature());
-
+
IMethod[] methods = roleJavaElem.getMethods();
assertNotNull(methods);
assertTrue(methods.length > 0);
assertTrue(methods.length == 1);
assertEquals("methodToImplement1", methods[0].getElementName());
}
-
-
+
+
/**
* This method tests the creation of a role class that has an explicit superclass.
* The role class should contain the abstract method that it inherits from its superclass.
@@ -718,54 +718,54 @@ public class RoleCreationTests extends FileBasedUITest
CoreException
{
/*creation of role*/
-
+
IPackageFragmentRoot pkgFragRoot = getPackageFragmentRoot(getTestProjectDir(), SRC_FOLDER_NAME);
IPackageFragment pkgFrag = getPackageFragment(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg");
assertNotNull(pkgFragRoot);
assertNotNull(pkgFrag);
-
+
final String TEAM_CLASS_NAME = "TeamForRoleWithExplicitSuperclassAndInheritedMethod_PreviouslyEmpty";
final String ROLE_CLASS_NAME = "RoleWithExplicitSuperClassAndInheritedMethod";
-
+
RoleTypeInfo typeInfo = new RoleTypeInfo(ROLE_CLASS_NAME, pkgFragRoot, pkgFrag);
typeInfo.setEnclosingTypeName("teampkg."+TEAM_CLASS_NAME);
typeInfo.setInline(DOINLINE);
//TODO (kaschja) ??? must "teampkg.TeamWithRoleWithAbstractMethod.RoleWithAbstractMethod" be set as super role class ??? (because it is the team class where the super role comes from)
// typeInfo.setSuperClassName("teampkg.TeamForRoleWithExplicitSuperclassAndInheritedMethod_PreviouslyEmpty.RoleWithAbstractMethod");
- typeInfo.setSuperClassName("teampkg.TeamWithRoleWithAbstractMethod.RoleWithAbstractMethod");
+ typeInfo.setSuperClassName("teampkg.TeamWithRoleWithAbstractMethod.RoleWithAbstractMethod");
typeInfo.setCurrentType(pkgFrag.getCompilationUnit(TEAM_CLASS_NAME+".java").getType(ROLE_CLASS_NAME));
-
-
+
+
typeInfo.setCreateAbstractInheritedMethods(true);
-
+
assertNotNull(_roleCreator);
_roleCreator.setTypeInfo(typeInfo);
_roleCreator.createType(new NullProgressMonitor());
-
+
/*test of role existence and properties*/
-
+
IType enclosingTeamJavaElem = getJavaType(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg", "TeamForRoleWithExplicitSuperclassAndInheritedMethod_PreviouslyEmpty");
assertNotNull(enclosingTeamJavaElem);
-
+
IType roleJavaElem = enclosingTeamJavaElem.getType("RoleWithExplicitSuperClassAndInheritedMethod");
assertNotNull(roleJavaElem);
assertTrue(roleJavaElem.exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(roleJavaElem);
assertNotNull(roleOTElem);
assertTrue(roleOTElem.isRole());
-
+
assertEquals("RoleWithAbstractMethod", roleJavaElem.getSuperclassName());
assertEquals("QRoleWithAbstractMethod;", roleJavaElem.getSuperclassTypeSignature());
-
+
IMethod[] methods = roleJavaElem.getMethods();
assertNotNull(methods);
assertTrue(methods.length > 0);
assertTrue(methods.length == 1);
assertEquals("methodToImplement1", methods[0].getElementName());
}
-
-
+
+
/**
* This method tests the creation of a role class that has an implicit superclass.
* The role class should contain the abstract method that it inherits from its superclass.
@@ -774,71 +774,71 @@ public class RoleCreationTests extends FileBasedUITest
CoreException
{
/*creation of role*/
-
+
IPackageFragmentRoot pkgFragRoot = getPackageFragmentRoot(getTestProjectDir(), SRC_FOLDER_NAME);
IPackageFragment pkgFrag = getPackageFragment(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg");
assertNotNull(pkgFragRoot);
assertNotNull(pkgFrag);
-
+
final String TEAM_CLASS_NAME = "TeamForRoleWithImplicitSuperClassAndInheritedMethod";
final String ROLE_CLASS_NAME = "RoleWithAbstractMethod";
-
+
RoleTypeInfo typeInfo = new RoleTypeInfo(ROLE_CLASS_NAME, pkgFragRoot, pkgFrag);
typeInfo.setEnclosingTypeName("teampkg."+TEAM_CLASS_NAME);
typeInfo.setInline(DOINLINE);
typeInfo.setCreateAbstractInheritedMethods(true);
typeInfo.setCurrentType(pkgFrag.getCompilationUnit(TEAM_CLASS_NAME+".java").getType(ROLE_CLASS_NAME));
-
+
assertNotNull(_roleCreator);
_roleCreator.setTypeInfo(typeInfo);
_roleCreator.createType(new NullProgressMonitor());
-
+
/*test of role existence and properties*/
-
+
IType enclosingTeamJavaElem = getJavaType(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg", "TeamForRoleWithImplicitSuperClassAndInheritedMethod");
assertNotNull(enclosingTeamJavaElem);
-
+
IType roleJavaElem = enclosingTeamJavaElem.getType("RoleWithAbstractMethod");
assertNotNull(roleJavaElem);
assertTrue(roleJavaElem.exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(roleJavaElem);
assertNotNull(roleOTElem);
assertTrue(roleOTElem.isRole());
-
+
IMethod[] methods = roleJavaElem.getMethods();
assertNotNull(methods);
assertTrue(methods.length > 0);
assertTrue(methods.length == 1);
- assertEquals("methodToImplement1", methods[0].getElementName());
+ assertEquals("methodToImplement1", methods[0].getElementName());
}
-
-
+
+
/**
* This method tests the creation of a role class that has
* an implicit superclass and an explicit superclass and several super interfaces.
- * The role class should contain all abstract methods that it inherits from
+ * The role class should contain all abstract methods that it inherits from
* its several super classes and interfaces
*/
public void testRoleCreation_WithSeveralSuperTypesAndInheritedMethods() throws InterruptedException,
CoreException
{
/*creation of role*/
-
+
IPackageFragmentRoot pkgFragRoot = getPackageFragmentRoot(getTestProjectDir(), SRC_FOLDER_NAME);
IPackageFragment pkgFrag = getPackageFragment(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg");
assertNotNull(pkgFragRoot);
assertNotNull(pkgFrag);
-
+
ArrayList<String> interfaceNameList = new ArrayList<String>();
interfaceNameList.add("ordinarypkg.InterfaceWithOneMethod");
interfaceNameList.add("ordinarypkg.InterfaceWithTwoMethods");
-
+
//the role to be created should be named "RoleWithAbstractMethod" although it contains several abstract methods
//in order to establish the implicit inheritence relationship with TeamWithRoleWithAbstractMethod.RoleWithAbstractMethod
- final String ROLE_CLASS_NAME = "RoleWithAbstractMethod";
+ final String ROLE_CLASS_NAME = "RoleWithAbstractMethod";
final String TEAM_CLASS_NAME = "TeamForRoleWithSeveralSuperTypesAndInheritedMethods";
-
+
RoleTypeInfo typeInfo = new RoleTypeInfo(ROLE_CLASS_NAME, pkgFragRoot, pkgFrag);
typeInfo.setEnclosingTypeName("teampkg."+TEAM_CLASS_NAME);
typeInfo.setInline(DOINLINE);
@@ -846,51 +846,51 @@ public class RoleCreationTests extends FileBasedUITest
typeInfo.setSuperInterfacesNames(interfaceNameList);
typeInfo.setCreateAbstractInheritedMethods(true);
typeInfo.setCurrentType(pkgFrag.getCompilationUnit(TEAM_CLASS_NAME+".java").getType(ROLE_CLASS_NAME));
-
+
assertNotNull(_roleCreator);
_roleCreator.setTypeInfo(typeInfo);
_roleCreator.createType(new NullProgressMonitor());
-
+
/*test of role existence and properties*/
-
+
IType enclosingTeamJavaElem = getJavaType(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg", "TeamForRoleWithSeveralSuperTypesAndInheritedMethods");
assertNotNull(enclosingTeamJavaElem);
-
+
IType roleJavaElem = enclosingTeamJavaElem.getType("RoleWithAbstractMethod");
assertNotNull(roleJavaElem);
assertTrue(roleJavaElem.exists());
-
+
IOTType roleOTElem = OTModelManager.getOTElement(roleJavaElem);
assertNotNull(roleOTElem);
assertTrue(roleOTElem.isRole());
-
+
assertEquals("AbstractSuperRole", roleJavaElem.getSuperclassName());
assertEquals("QAbstractSuperRole;", roleJavaElem.getSuperclassTypeSignature());
-
+
String[] interfaceNames = roleJavaElem.getSuperInterfaceNames();
assertNotNull(interfaceNames);
assertTrue(interfaceNames.length > 0);
assertTrue(interfaceNames.length == 2);
assertEquals("InterfaceWithOneMethod", interfaceNames[0]);
assertEquals("InterfaceWithTwoMethods", interfaceNames[1]);
-
+
String[] interfaceSignatures = roleJavaElem.getSuperInterfaceTypeSignatures();
assertNotNull(interfaceSignatures);
assertTrue(interfaceSignatures.length > 0);
assertTrue(interfaceSignatures.length == 2);
assertEquals("QInterfaceWithOneMethod;", interfaceSignatures[0]);
assertEquals("QInterfaceWithTwoMethods;", interfaceSignatures[1]);
-
+
IMethod[] methods = roleJavaElem.getMethods();
assertNotNull(methods);
assertTrue(methods.length > 0);
assertTrue(methods.length == 5);
-
+
//method inherited from "InterfaceWithOneMethod"
IMethod method = roleJavaElem.getMethod("methodToImplement", new String[0]);
assertNotNull(method);
assertTrue(method.exists());
-
+
//methods inherited from "InterfaceWithTwoMethods"
method = roleJavaElem.getMethod("methodToImplementA", new String[0]);
assertNotNull(method);
@@ -898,13 +898,13 @@ public class RoleCreationTests extends FileBasedUITest
method = roleJavaElem.getMethod("methodToImplementB", new String[0]);
assertNotNull(method);
assertTrue(method.exists());
-
+
//method inherited from explicit superclass "AbstractSuperRole"
method = roleJavaElem.getMethod("methodToImplementX", new String[0]);
assertNotNull(method);
assertTrue(method.exists());
-
- //method inherited from implicit superclass "TeamWithRoleWithAbstractMethod.RoleWithAbstractMethod"
+
+ //method inherited from implicit superclass "TeamWithRoleWithAbstractMethod.RoleWithAbstractMethod"
method = roleJavaElem.getMethod("methodToImplement1", new String[0]);
assertNotNull(method);
assertTrue(method.exists());
@@ -924,14 +924,14 @@ public class RoleCreationTests extends FileBasedUITest
" }\n" +
" }\n" +
"}", false, new NullProgressMonitor());
-
+
RoleTypeInfo typeInfo = new RoleTypeInfo("XInner", pkgFragRoot, pkgFrag);
typeInfo.setEnclosingTypeName("teampkg.Outer.Mid.Inner");
typeInfo.setInline(true);
typeInfo.setCreateAbstractInheritedMethods(false);
typeInfo.setCurrentType(pkgFrag.getCompilationUnit("Outer.java")
.getType("Mid").getType("Inner").getType("XInner"));
-
+
assertNotNull(_roleCreator);
_roleCreator.setTypeInfo(typeInfo);
_roleCreator.createType(new NullProgressMonitor());
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/typecreator/TeamCreationTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/typecreator/TeamCreationTests.java
index c3a8f87a6..5550f55c0 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/typecreator/TeamCreationTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/typecreator/TeamCreationTests.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -48,12 +48,12 @@ import org.eclipse.objectteams.otdt.ui.tests.FileBasedUITest;
*/
public class TeamCreationTests extends FileBasedUITest
{
-
+
private static final String SRC_FOLDER_NAME = "teams";
-
+
private TeamCreator _teamCreator;
-
-
+
+
public TeamCreationTests(String name)
{
super(name);
@@ -70,26 +70,26 @@ public class TeamCreationTests extends FileBasedUITest
junit.framework.TestSuite suite = new Suite(TeamCreationTests.class);
return suite;
}
-
+
public void setUpSuite() throws Exception
{
setTestProjectDir("CreationTestProject");
-
+
super.setUpSuite();
}
-
+
protected void setUp() throws Exception
{
super.setUp();
_teamCreator = new TeamCreator();
}
-
+
@Override
protected void tearDown() throws Exception {
ICompilationUnit[] primaryWCs = JavaModelManager.getJavaModelManager().getWorkingCopies(DefaultWorkingCopyOwner.PRIMARY, false);
try {
assertEquals("All working copies should be discarded", 0, primaryWCs == null ? 0 : primaryWCs.length);
- } finally {
+ } finally {
if (primaryWCs != null)
for (int i = 0; i < primaryWCs.length; i++)
primaryWCs[i].discardWorkingCopy();
@@ -105,8 +105,8 @@ public class TeamCreationTests extends FileBasedUITest
// {
// //don't call super method, so created directory will not be deleted
// }
-
-
+
+
private IType getJavaType(String projectName, String srcFolderName, String pkgName, String typeName) throws JavaModelException
{
ICompilationUnit typeUnit = getCompilationUnit(
@@ -115,14 +115,14 @@ public class TeamCreationTests extends FileBasedUITest
pkgName,
typeName +".java");
IType typeJavaElem = typeUnit.getType(typeName);
-
+
if ((typeJavaElem != null) && (typeJavaElem.exists()))
{
return typeJavaElem;
}
return null;
- }
-
+ }
+
public void testCreation_EmptyTeam() throws JavaModelException,
InterruptedException,
@@ -132,24 +132,24 @@ public class TeamCreationTests extends FileBasedUITest
IPackageFragment pkgFrag = getPackageFragment(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg");
assertNotNull(pkgFragRoot);
assertNotNull(pkgFrag);
-
+
TypeInfo typeInfo = new TypeInfo("EmptyTeam", pkgFragRoot, pkgFrag);
typeInfo.setModifier(Flags.AccPublic+Flags.AccTeam);
typeInfo.setSuperClassName("org.objectteams.Team");
-
+
assertNotNull(_teamCreator);
_teamCreator.setTypeInfo(typeInfo);
_teamCreator.createType(new NullProgressMonitor());
-
+
IType createdJavaType = getJavaType(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg", "EmptyTeam");
assertNotNull(createdJavaType);
-
+
IOTType createdOTType = OTModelManager.getOTElement(createdJavaType);
assertNotNull(createdOTType);
assertTrue(createdOTType.isTeam());
}
-
+
public void testCreation_NestedTeam() throws JavaModelException,
InterruptedException,
CoreException
@@ -158,31 +158,31 @@ public class TeamCreationTests extends FileBasedUITest
IPackageFragment pkgFrag = getPackageFragment(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg");
assertNotNull(pkgFragRoot);
assertNotNull(pkgFrag);
-
+
TypeInfo typeInfo = new TypeInfo("NestedTeam", pkgFragRoot, pkgFrag);
typeInfo.setModifier(Flags.AccPublic+Flags.AccTeam);
typeInfo.setEnclosingTypeName("teampkg.TeamForNestedTeam");
typeInfo.setInline(true);
typeInfo.setCreateAbstractInheritedMethods(true);
-
+
assertNotNull(_teamCreator);
_teamCreator.setTypeInfo(typeInfo);
_teamCreator.createType(new NullProgressMonitor());
-
+
IType enclosingJavaType = getJavaType(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg", "TeamForNestedTeam");
IType createdJavaType = enclosingJavaType.getType("NestedTeam");
assertNotNull(createdJavaType);
assertTrue("created type should exist", createdJavaType.exists());
-
+
IOTType createdOTType = OTModelManager.getOTElement(createdJavaType);
assertNotNull(createdOTType);
assertTrue(createdOTType.isTeam());
-
+
IMethod[] methods = createdJavaType.getMethods();
assertEquals("Should not have created methods", 0, methods.length);
}
-
+
public void testCreation_TeamWithConstructor() throws JavaModelException,
InterruptedException,
CoreException
@@ -202,20 +202,20 @@ public class TeamCreationTests extends FileBasedUITest
assertNotNull(_teamCreator);
_teamCreator.setTypeInfo(typeInfo);
_teamCreator.createType(new NullProgressMonitor());
-
+
IType createdJavaType = getJavaType(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg", TEAM_CLASS_NAME);
assertNotNull(createdJavaType);
-
+
IOTType createdOTType = OTModelManager.getOTElement(createdJavaType);
assertNotNull(createdOTType);
assertTrue(createdOTType.isTeam());
-
+
// constructor is a method by the name of the enclosing class:
IMethod constructor = createdJavaType.getMethod(TEAM_CLASS_NAME, new String[0]);
assertNotNull(constructor);
assertTrue(constructor.exists());
- }
-
+ }
+
public void testCreation_TeamWithMainMethod() throws JavaModelException,
InterruptedException,
CoreException
@@ -229,24 +229,24 @@ public class TeamCreationTests extends FileBasedUITest
typeInfo.setModifier(Flags.AccPublic+Flags.AccTeam);
typeInfo.setSuperClassName("org.objectteams.Team");
typeInfo.setCreateMainMethod(true);
-
+
assertNotNull(_teamCreator);
_teamCreator.setTypeInfo(typeInfo);
_teamCreator.createType(new NullProgressMonitor());
-
+
IType createdJavaType = getJavaType(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg", "TeamWithMainMethod");
assertNotNull(createdJavaType);
-
+
IOTType createdOTType = OTModelManager.getOTElement(createdJavaType);
assertNotNull(createdOTType);
assertTrue(createdOTType.isTeam());
-
+
String[] paraTypes = {"[QString;"};
IMethod method = createdJavaType.getMethod("main", paraTypes);
assertNotNull(method);
assertTrue(method.exists());
-}
-
+}
+
public void testCreation_EmptyTeamWithEmptySuperTeam() throws JavaModelException,
InterruptedException,
CoreException
@@ -261,23 +261,23 @@ public class TeamCreationTests extends FileBasedUITest
typeInfo.setModifier(Flags.AccPublic+Flags.AccTeam);
typeInfo.setSuperClassName("teampkg.EmptyTeam");
typeInfo.setCurrentType(pkgFrag.getCompilationUnit(TEAM_CLASS_NAME+".java").getType(TEAM_CLASS_NAME));
-
+
assertNotNull(_teamCreator);
_teamCreator.setTypeInfo(typeInfo);
_teamCreator.createType(new NullProgressMonitor());
-
+
IType subTeamJavaElem = getJavaType(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg", "EmptyTeamWithEmptySuperTeam");
assertNotNull(subTeamJavaElem);
-
+
IOTType subTeamOTElem = OTModelManager.getOTElement(subTeamJavaElem);
assertNotNull(subTeamOTElem);
- assertTrue(subTeamOTElem.isTeam());
-
+ assertTrue(subTeamOTElem.isTeam());
+
assertEquals(subTeamOTElem.getSuperclassName(), "EmptyTeam");
assertEquals(subTeamOTElem.getSuperclassTypeSignature(), "QEmptyTeam;");
}
-
-
+
+
public void testCreation_EmptyTeamWithSuperInterface() throws JavaModelException,
InterruptedException,
CoreException
@@ -285,7 +285,7 @@ public class TeamCreationTests extends FileBasedUITest
IType interfaceJavaElem = getJavaType(getTestProjectDir(), SRC_FOLDER_NAME, "ordinarypkg", "InterfaceWithOneMethod");
assertNotNull(interfaceJavaElem);
assertTrue(interfaceJavaElem.exists());
-
+
IPackageFragmentRoot pkgFragRoot = getPackageFragmentRoot(getTestProjectDir(), SRC_FOLDER_NAME);
IPackageFragment pkgFrag = getPackageFragment(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg");
assertNotNull(pkgFragRoot);
@@ -293,34 +293,34 @@ public class TeamCreationTests extends FileBasedUITest
ArrayList<String> interfaceNames = new ArrayList<String>();
interfaceNames.add("ordinary.InterfaceWithOneMethod");
-
+
TypeInfo typeInfo = new TypeInfo("EmptyTeamWithSuperInterface", pkgFragRoot, pkgFrag);
typeInfo.setModifier(Flags.AccPublic+Flags.AccTeam);
typeInfo.setSuperInterfacesNames(interfaceNames);
-
+
assertNotNull(_teamCreator);
_teamCreator.setTypeInfo(typeInfo);
_teamCreator.createType(new NullProgressMonitor());
-
+
IType createdJavaType = getJavaType(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg", "EmptyTeamWithSuperInterface");
assertNotNull(createdJavaType);
-
+
IOTType createdOTType = OTModelManager.getOTElement(createdJavaType);
assertNotNull(createdOTType);
assertTrue(createdOTType.isTeam());
-
+
String[] interfaces = createdOTType.getSuperInterfaceNames();
assertNotNull(interfaces);
assertTrue(interfaces.length == 1);
assertEquals(interfaces[0], "InterfaceWithOneMethod");
-
+
String[] interfaceSignatures = createdOTType.getSuperInterfaceTypeSignatures();
assertNotNull(interfaceSignatures);
assertTrue(interfaceSignatures.length == 1);
assertEquals(interfaceSignatures[0], "QInterfaceWithOneMethod;");
}
-
-
+
+
public void testCreation_TeamWithSuperInterfaceAndInheritedMethod() throws JavaModelException,
InterruptedException,
CoreException
@@ -328,9 +328,9 @@ public class TeamCreationTests extends FileBasedUITest
IType interfaceJavaElem = getJavaType(getTestProjectDir(), SRC_FOLDER_NAME, "ordinarypkg", "InterfaceWithOneMethod");
assertNotNull(interfaceJavaElem);
assertTrue(interfaceJavaElem.exists());
-
+
/*creation of team*/
-
+
IPackageFragmentRoot pkgFragRoot = getPackageFragmentRoot(getTestProjectDir(), SRC_FOLDER_NAME);
IPackageFragment pkgFrag = getPackageFragment(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg");
assertNotNull(pkgFragRoot);
@@ -338,41 +338,41 @@ public class TeamCreationTests extends FileBasedUITest
ArrayList<String> interfaceNames = new ArrayList<String>();
interfaceNames.add("ordinarypkg.InterfaceWithOneMethod");
-
+
String TEAM_CLASS_NAME = "TeamWithSuperInterfaceAndInheritedMethod";
TypeInfo typeInfo = new TypeInfo(TEAM_CLASS_NAME, pkgFragRoot, pkgFrag);
typeInfo.setModifier(Flags.AccPublic+Flags.AccTeam);
typeInfo.setSuperInterfacesNames(interfaceNames);
typeInfo.setCreateAbstractInheritedMethods(true);
typeInfo.setCurrentType(pkgFrag.getCompilationUnit(TEAM_CLASS_NAME+".java").getType(TEAM_CLASS_NAME));
-
+
assertNotNull(_teamCreator);
_teamCreator.setTypeInfo(typeInfo);
_teamCreator.createType(new NullProgressMonitor());
-
+
IType createdJavaType = getJavaType(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg", "TeamWithSuperInterfaceAndInheritedMethod");
assertNotNull(createdJavaType);
-
+
IOTType createdOTType = OTModelManager.getOTElement(createdJavaType);
assertNotNull(createdOTType);
assertTrue(createdOTType.isTeam());
-
+
String[] interfaces = createdOTType.getSuperInterfaceNames();
assertNotNull(interfaces);
assertTrue(interfaces.length == 1);
assertEquals(interfaces[0], "InterfaceWithOneMethod");
-
+
String[] interfaceSignatures = createdOTType.getSuperInterfaceTypeSignatures();
assertNotNull(interfaceSignatures);
assertTrue(interfaceSignatures.length == 1);
assertEquals(interfaceSignatures[0], "QInterfaceWithOneMethod;");
-
+
IMethod method = createdJavaType.getMethod("methodToImplement", new String[0]);
assertNotNull(method);
assertTrue(method.exists());
}
-
-
+
+
public void testCreation_TeamWithSuperTeamAndInheritedMethod() throws JavaModelException,
InterruptedException,
CoreException
@@ -380,14 +380,14 @@ public class TeamCreationTests extends FileBasedUITest
IType superTeamJavaElem = getJavaType(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg", "AbstractTeamWithAbstractMethod");
assertNotNull(superTeamJavaElem);
assertTrue(superTeamJavaElem.exists());
-
+
/*creation of team*/
-
+
IPackageFragmentRoot pkgFragRoot = getPackageFragmentRoot(getTestProjectDir(), SRC_FOLDER_NAME);
IPackageFragment pkgFrag = getPackageFragment(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg");
assertNotNull(pkgFragRoot);
assertNotNull(pkgFrag);
-
+
String TEAM_CLASS_NAME = "TeamWithSuperTeamAndInheritedMethod";
TypeInfo typeInfo = new TypeInfo(TEAM_CLASS_NAME, pkgFragRoot, pkgFrag);
typeInfo.setModifier(Flags.AccPublic+Flags.AccTeam);
@@ -398,19 +398,19 @@ public class TeamCreationTests extends FileBasedUITest
assertNotNull(_teamCreator);
_teamCreator.setTypeInfo(typeInfo);
_teamCreator.createType(new NullProgressMonitor());
-
+
IType createdJavaType = getJavaType(getTestProjectDir(), SRC_FOLDER_NAME, "teampkg", "TeamWithSuperTeamAndInheritedMethod");
assertNotNull(createdJavaType);
-
+
IOTType createdOTType = OTModelManager.getOTElement(createdJavaType);
assertNotNull(createdOTType);
assertTrue(createdOTType.isTeam());
-
+
assertEquals(createdJavaType.getSuperclassName(), "AbstractTeamWithAbstractMethod");
assertEquals(createdJavaType.getSuperclassTypeSignature(), "QAbstractTeamWithAbstractMethod;");
-
+
IMethod method = createdJavaType.getMethod("methodToImplement", new String[0]);
assertNotNull(method);
assertTrue(method.exists());
- }
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/util/JavaProjectHelper.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/util/JavaProjectHelper.java
index bc159f37e..b0803993c 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/util/JavaProjectHelper.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/util/JavaProjectHelper.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -102,10 +102,10 @@ public class JavaProjectHelper extends org.eclipse.jdt.testplugin.JavaProjectHel
project.setDescription(description, null);
IJavaProject jproject = JavaCore.create(project);
-
+
jproject.setOutputLocation(outputLocation, null);
jproject.setRawClasspath(new IClasspathEntry[0], null);
-
+
OTREContainer.initializeOTJProject(project);
return jproject;
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/util/TestOptions.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/util/TestOptions.java
index ab9e1dc6b..94c57b600 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/util/TestOptions.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/util/TestOptions.java
@@ -1,20 +1,20 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
- *
+ *
* Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
- *
+ *
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
+ *
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
@@ -30,14 +30,14 @@ import org.eclipse.jdt.ui.PreferenceConstants;
import org.eclipse.jface.preference.IPreferenceStore;
public class TestOptions {
-
+
public static Hashtable<String,String> getFormatterOptions()
{
Hashtable<String, String> result= JavaCore.getDefaultOptions();
result.putAll(TestFormatterOptions.getSettings());
return result;
}
-
+
public static void initializeCodeGenerationOptions()
{
IPreferenceStore store= JavaPlugin.getDefault().getPreferenceStore();
@@ -59,7 +59,7 @@ class TestFormatterOptions
options.setDefaultSettings();
return options.getMap();
}
-
+
public int alignment_for_arguments_in_allocation_expression;
public int alignment_for_arguments_in_explicit_constructor_call;
public int alignment_for_arguments_in_method_invocation;
@@ -76,9 +76,9 @@ class TestFormatterOptions
public int alignment_for_superinterfaces_in_type_declaration;
public int alignment_for_throws_clause_in_constructor_declaration;
public int alignment_for_throws_clause_in_method_declaration;
-
+
public boolean align_type_members_on_columns;
-
+
public String brace_position_for_anonymous_type_declaration;
public String brace_position_for_array_initializer;
public String brace_position_for_block;
@@ -87,10 +87,10 @@ class TestFormatterOptions
public String brace_position_for_method_declaration;
public String brace_position_for_type_declaration;
public String brace_position_for_switch;
-
+
public int continuation_indentation;
public int continuation_indentation_for_array_initializer;
-
+
public int blank_lines_after_imports;
public int blank_lines_after_package;
public int blank_lines_before_field;
@@ -102,14 +102,14 @@ class TestFormatterOptions
public int blank_lines_before_package;
public int blank_lines_between_type_declarations;
public int blank_lines_at_beginning_of_method_body;
-
+
public boolean indent_statements_compare_to_block;
public boolean indent_statements_compare_to_body;
public boolean indent_body_declarations_compare_to_type_header;
public boolean indent_breaks_compare_to_cases;
public boolean indent_switchstatements_compare_to_cases;
public boolean indent_switchstatements_compare_to_switch;
-
+
public boolean insert_new_line_after_opening_brace_in_array_initializer;
public boolean insert_new_line_before_catch_in_try_statement;
public boolean insert_new_line_before_closing_brace_in_array_initializer;
@@ -241,7 +241,7 @@ class TestFormatterOptions
public int initial_indentation_level;
public String line_separator;
-
+
private TestFormatterOptions()
{
// cannot be instantiated

Back to the top